Skip to content

Commit 4eaa0c3

Browse files
authored
Merge branch 'fe/feature/RI-7039-replace-eui' into fe/bugfix/RI-7223-links-should-have-underline-only-on-hover
2 parents a83d630 + 22d55f1 commit 4eaa0c3

File tree

128 files changed

+2073
-1973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+2073
-1973
lines changed
Lines changed: 4 additions & 4 deletions
Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react'
2+
import { RiImageProps, StyledImage } from './image.styles'
3+
4+
const RiImage = ({ $size, src, alt, ...rest }: RiImageProps) => (
5+
<StyledImage src={src} alt={alt} $size={$size} {...rest} />
6+
)
7+
8+
export default RiImage
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { HTMLAttributes } from 'react'
2+
import styled, { css } from 'styled-components'
3+
4+
export const SIZES = ['s', 'm', 'l', 'xl', 'original', 'fullWidth'] as const
5+
6+
export const imageSizeStyles = {
7+
s: css`
8+
width: 100px;
9+
`,
10+
m: css`
11+
width: 200px;
12+
`,
13+
l: css`
14+
width: 360px;
15+
`,
16+
xl: css`
17+
width: 600px;
18+
`,
19+
original: css`
20+
width: auto;
21+
`,
22+
fullWidth: css`
23+
width: 100%;
24+
`,
25+
}
26+
27+
export type RiImageSize = (typeof SIZES)[number]
28+
29+
export interface RiImageProps extends HTMLAttributes<HTMLImageElement> {
30+
$size?: RiImageSize
31+
src: string
32+
alt: string
33+
}
34+
35+
export const StyledImage = styled.img<RiImageProps>`
36+
${({ $size = 'original' }) => imageSizeStyles[$size]}
37+
`
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import Loader from './loader/Loader'
22
import ProgressBarLoader from './progress-bar/ProgressBarLoader'
3+
import RiImage from './image/RiImage'
4+
import RiLoadingLogo from './loading-logo/RiLoadingLogo'
5+
import { Modal } from './modal'
6+
7+
export { Loader, ProgressBarLoader, RiImage, RiLoadingLogo, Modal }
38

4-
export { Loader, ProgressBarLoader }
59
export { RICollapsibleNavGroup } from './collapsible-nav-group/RICollapsibleNavGroup'
610

711
export type { RICollapsibleNavGroupProps } from './collapsible-nav-group/RICollapsibleNavGroup'
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import React, { HTMLAttributes } from 'react'
2+
import styled, { keyframes } from 'styled-components'
3+
4+
const bounce = keyframes`
5+
0%, 100% {
6+
transform: translateY(0);
7+
}
8+
9+
50% {
10+
transform: translateY(-15px);
11+
}
12+
`
13+
14+
export const SIZES = ['M', 'L', 'XL', 'XXL'] as const
15+
16+
export type RiLoadingLogoSize = (typeof SIZES)[number]
17+
18+
export interface RiLoadingLogoProps extends HTMLAttributes<HTMLImageElement> {
19+
src: string
20+
$size?: RiLoadingLogoSize
21+
$bounceSpeed?: number
22+
alt?: string
23+
}
24+
25+
const Wrapper = styled.div`
26+
display: inline-flex;
27+
align-items: center;
28+
justify-content: center;
29+
`
30+
31+
const BouncingLogo = styled.img<RiLoadingLogoProps>`
32+
width: ${({ theme, $size = 'XL' }) =>
33+
theme.components.iconButton.sizes[$size].width};
34+
animation: ${bounce} ${({ $bounceSpeed }) => $bounceSpeed}s ease-in-out
35+
infinite;
36+
`
37+
38+
const RiLoadingLogo = ({
39+
src,
40+
$size = 'XL',
41+
$bounceSpeed = 1,
42+
alt = 'Loading logo',
43+
}: RiLoadingLogoProps) => (
44+
<Wrapper>
45+
<BouncingLogo
46+
src={src}
47+
$size={$size}
48+
$bounceSpeed={$bounceSpeed}
49+
alt={alt}
50+
/>
51+
</Wrapper>
52+
)
53+
54+
export default RiLoadingLogo
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { Modal } from '@redis-ui/components'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { ButtonGroup, ButtonGroupProps } from '@redis-ui/components'
2+
3+
export { ButtonGroup }
4+
5+
export type { ButtonGroupProps }
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React, { ComponentProps } from 'react'
2+
3+
import { Input as RedisInput, TooltipProvider } from '@redis-ui/components'
4+
5+
export type RedisInputProps = ComponentProps<typeof RedisInput>
6+
7+
export default function TextInput(props: RedisInputProps) {
8+
// eslint-disable-next-line react/destructuring-assignment
9+
if (props.error) {
10+
return <TooltipProvider>
11+
<RedisInput {...props} />
12+
</TooltipProvider>
13+
}
14+
return <RedisInput {...props} />
15+
}

redisinsight/ui/src/components/base/inputs/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ export { default as SearchInput } from './SearchInput'
33
export { default as NumericInput } from './NumericInput'
44
export { default as SwitchInput } from './SwitchInput'
55
export { default as TextArea } from './TextArea'
6+
export { default as TextInput } from './TextInput'
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React, { HTMLAttributes } from 'react'
2+
import styled from 'styled-components'
3+
import { useTheme } from '@redis-ui/styles'
4+
import { Spacer } from '../spacer'
5+
6+
interface RiEmptyPromptProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
7+
body?: React.ReactNode
8+
title?: React.ReactNode
9+
icon?: React.ReactNode
10+
}
11+
12+
const StyledEmptyPrompt = styled.div`
13+
max-width: 36em;
14+
text-align: center;
15+
padding: 24px;
16+
margin: auto;
17+
`
18+
19+
const RiEmptyPrompt = ({ body, title, icon, ...rest }: RiEmptyPromptProps) => {
20+
const theme = useTheme()
21+
22+
return (<StyledEmptyPrompt {...rest}>
23+
{icon}
24+
{title && (
25+
<>
26+
<Spacer size={theme.core.space.space100} />
27+
{title}
28+
</>
29+
)}
30+
{body && (
31+
<>
32+
<Spacer size={theme.core.space.space100} />
33+
{body}
34+
</>
35+
)}
36+
</StyledEmptyPrompt>
37+
)
38+
}
39+
40+
41+
export default RiEmptyPrompt

0 commit comments

Comments
 (0)