@lets-events/react 10.0.1 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +2 -2
- package/.turbo/turbo-build.log +20 -18
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +426 -1
- package/dist/index.d.ts +426 -1
- package/dist/index.js +285 -8
- package/dist/index.mjs +276 -7
- package/package.json +3 -1
- package/src/components/Alert.tsx +303 -303
- package/src/components/Avatar.tsx +55 -55
- package/src/components/Badge.tsx +128 -128
- package/src/components/Box.tsx +3 -3
- package/src/components/Button/index.tsx +12 -12
- package/src/components/Button/styledComponents.ts +250 -250
- package/src/components/ButtonGroup.tsx +484 -484
- package/src/components/Calendar/index.tsx +136 -136
- package/src/components/Calendar/styledComponents.ts +208 -208
- package/src/components/Card.tsx +69 -69
- package/src/components/CheckboxGroup.tsx +214 -214
- package/src/components/Container.tsx +39 -39
- package/src/components/Dropdown.tsx +167 -167
- package/src/components/Filter.tsx +164 -164
- package/src/components/Flex.tsx +118 -118
- package/src/components/Grid.tsx +137 -137
- package/src/components/Icon.tsx +47 -47
- package/src/components/Modal.tsx +90 -90
- package/src/components/RadioGroup.tsx +210 -210
- package/src/components/Section.tsx +33 -33
- package/src/components/Step.tsx +164 -164
- package/src/components/Switch.tsx +108 -108
- package/src/components/Text.tsx +30 -30
- package/src/components/TextField.tsx +299 -299
- package/src/components/TextareaField.tsx +101 -101
- package/src/components/TimePicker.tsx +239 -239
- package/src/components/Toast/components/ToastItem.tsx +41 -0
- package/src/components/Toast/components/ToastProvider.tsx +63 -0
- package/src/components/Toast/hooks/useToast.ts +12 -0
- package/src/components/Toast/index.tsx +5 -0
- package/src/components/Toast/styles/index.ts +135 -0
- package/src/components/Toast/types/index.ts +46 -0
- package/src/components/Tooltip/index.tsx +67 -0
- package/src/components/Tooltip/styles.ts +78 -0
- package/src/hooks/useOnClickOutside.tsx +20 -20
- package/src/index.tsx +33 -31
- package/src/styles/index.ts +38 -38
- package/src/types/typographyValues.ts +178 -178
- package/tsconfig.json +3 -3
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import { TextArea as TextAreaRadix } from '@radix-ui/themes'
|
|
2
|
-
import { styled } from '../styles'
|
|
3
|
-
import { ComponentProps, useRef } from 'react'
|
|
4
|
-
import { typographyValues } from '../types/typographyValues'
|
|
5
|
-
import { Text } from './Text'
|
|
6
|
-
|
|
7
|
-
export const TextareaFieldStyle = styled(TextAreaRadix, {
|
|
8
|
-
display: 'flex',
|
|
9
|
-
width: 'fit-content',
|
|
10
|
-
flex: 1,
|
|
11
|
-
textarea: {
|
|
12
|
-
width: '100%',
|
|
13
|
-
minHeight: '3.75rem',
|
|
14
|
-
border: 'none',
|
|
15
|
-
padding: '$12 $14',
|
|
16
|
-
fontFamily: '$default',
|
|
17
|
-
fontSize: '$16',
|
|
18
|
-
outline: 'none',
|
|
19
|
-
resize: 'vertical',
|
|
20
|
-
},
|
|
21
|
-
variants: {
|
|
22
|
-
typography: typographyValues,
|
|
23
|
-
},
|
|
24
|
-
defaultVariants: {
|
|
25
|
-
typography: 'bodyM',
|
|
26
|
-
},
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
export type TextareaFieldProps = ComponentProps<typeof TextareaFieldStyle> & {
|
|
30
|
-
limit: number
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const TextareaContainer = styled('div', {
|
|
34
|
-
position: 'relative',
|
|
35
|
-
display: 'flex',
|
|
36
|
-
overflow: 'hidden',
|
|
37
|
-
// width: '100%',
|
|
38
|
-
border: '1px solid',
|
|
39
|
-
borderColor: '$dark300',
|
|
40
|
-
borderRadius: '$2xs',
|
|
41
|
-
|
|
42
|
-
'&:has(textarea:focus)': {
|
|
43
|
-
border: '1px solid $brand300',
|
|
44
|
-
},
|
|
45
|
-
'&:has(textarea:disabled)': {
|
|
46
|
-
backgroundColor: '$dark100',
|
|
47
|
-
color: '$dark400',
|
|
48
|
-
border: '1px solid $dark200',
|
|
49
|
-
cursor: 'not-allowed',
|
|
50
|
-
},
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const TextareaLimitIndicator = styled('div', {
|
|
54
|
-
position: 'absolute',
|
|
55
|
-
bottom: 0,
|
|
56
|
-
left: 0,
|
|
57
|
-
padding: '$12 $16',
|
|
58
|
-
borderTop: '1px solid $neutral300',
|
|
59
|
-
width: '100%',
|
|
60
|
-
flex: 1,
|
|
61
|
-
display: 'flex',
|
|
62
|
-
span: {
|
|
63
|
-
backgroundColor: '$neutral200',
|
|
64
|
-
color: '$neutral700',
|
|
65
|
-
borderRadius: '$2xs',
|
|
66
|
-
padding: '$4',
|
|
67
|
-
},
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
export function TextareaField({ maxLength, ...props }: TextareaFieldProps) {
|
|
71
|
-
const inputRef = useRef<HTMLTextAreaElement>(null)
|
|
72
|
-
const badgeRef = useRef<HTMLSpanElement>(null)
|
|
73
|
-
|
|
74
|
-
if (!maxLength) {
|
|
75
|
-
return (
|
|
76
|
-
<TextareaContainer>
|
|
77
|
-
<TextareaFieldStyle {...props} ref={inputRef}></TextareaFieldStyle>
|
|
78
|
-
</TextareaContainer>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
const handleInput = () => {
|
|
82
|
-
const remainingChars = maxLength - (inputRef?.current?.value.length || 0)
|
|
83
|
-
if (badgeRef.current) badgeRef.current.textContent = String(remainingChars)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<TextareaContainer css={{ paddingBottom: '3.25rem' }}>
|
|
88
|
-
<TextareaFieldStyle
|
|
89
|
-
ref={inputRef}
|
|
90
|
-
onInput={handleInput}
|
|
91
|
-
maxLength={maxLength}
|
|
92
|
-
{...props}
|
|
93
|
-
></TextareaFieldStyle>
|
|
94
|
-
<TextareaLimitIndicator>
|
|
95
|
-
<Text typography={'badgeMedium'} ref={badgeRef}>
|
|
96
|
-
{maxLength}
|
|
97
|
-
</Text>
|
|
98
|
-
</TextareaLimitIndicator>
|
|
99
|
-
</TextareaContainer>
|
|
100
|
-
)
|
|
101
|
-
}
|
|
1
|
+
import { TextArea as TextAreaRadix } from '@radix-ui/themes'
|
|
2
|
+
import { styled } from '../styles'
|
|
3
|
+
import { ComponentProps, useRef } from 'react'
|
|
4
|
+
import { typographyValues } from '../types/typographyValues'
|
|
5
|
+
import { Text } from './Text'
|
|
6
|
+
|
|
7
|
+
export const TextareaFieldStyle = styled(TextAreaRadix, {
|
|
8
|
+
display: 'flex',
|
|
9
|
+
width: 'fit-content',
|
|
10
|
+
flex: 1,
|
|
11
|
+
textarea: {
|
|
12
|
+
width: '100%',
|
|
13
|
+
minHeight: '3.75rem',
|
|
14
|
+
border: 'none',
|
|
15
|
+
padding: '$12 $14',
|
|
16
|
+
fontFamily: '$default',
|
|
17
|
+
fontSize: '$16',
|
|
18
|
+
outline: 'none',
|
|
19
|
+
resize: 'vertical',
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
typography: typographyValues,
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
typography: 'bodyM',
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
export type TextareaFieldProps = ComponentProps<typeof TextareaFieldStyle> & {
|
|
30
|
+
limit: number
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const TextareaContainer = styled('div', {
|
|
34
|
+
position: 'relative',
|
|
35
|
+
display: 'flex',
|
|
36
|
+
overflow: 'hidden',
|
|
37
|
+
// width: '100%',
|
|
38
|
+
border: '1px solid',
|
|
39
|
+
borderColor: '$dark300',
|
|
40
|
+
borderRadius: '$2xs',
|
|
41
|
+
|
|
42
|
+
'&:has(textarea:focus)': {
|
|
43
|
+
border: '1px solid $brand300',
|
|
44
|
+
},
|
|
45
|
+
'&:has(textarea:disabled)': {
|
|
46
|
+
backgroundColor: '$dark100',
|
|
47
|
+
color: '$dark400',
|
|
48
|
+
border: '1px solid $dark200',
|
|
49
|
+
cursor: 'not-allowed',
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const TextareaLimitIndicator = styled('div', {
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
bottom: 0,
|
|
56
|
+
left: 0,
|
|
57
|
+
padding: '$12 $16',
|
|
58
|
+
borderTop: '1px solid $neutral300',
|
|
59
|
+
width: '100%',
|
|
60
|
+
flex: 1,
|
|
61
|
+
display: 'flex',
|
|
62
|
+
span: {
|
|
63
|
+
backgroundColor: '$neutral200',
|
|
64
|
+
color: '$neutral700',
|
|
65
|
+
borderRadius: '$2xs',
|
|
66
|
+
padding: '$4',
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
export function TextareaField({ maxLength, ...props }: TextareaFieldProps) {
|
|
71
|
+
const inputRef = useRef<HTMLTextAreaElement>(null)
|
|
72
|
+
const badgeRef = useRef<HTMLSpanElement>(null)
|
|
73
|
+
|
|
74
|
+
if (!maxLength) {
|
|
75
|
+
return (
|
|
76
|
+
<TextareaContainer>
|
|
77
|
+
<TextareaFieldStyle {...props} ref={inputRef}></TextareaFieldStyle>
|
|
78
|
+
</TextareaContainer>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
const handleInput = () => {
|
|
82
|
+
const remainingChars = maxLength - (inputRef?.current?.value.length || 0)
|
|
83
|
+
if (badgeRef.current) badgeRef.current.textContent = String(remainingChars)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<TextareaContainer css={{ paddingBottom: '3.25rem' }}>
|
|
88
|
+
<TextareaFieldStyle
|
|
89
|
+
ref={inputRef}
|
|
90
|
+
onInput={handleInput}
|
|
91
|
+
maxLength={maxLength}
|
|
92
|
+
{...props}
|
|
93
|
+
></TextareaFieldStyle>
|
|
94
|
+
<TextareaLimitIndicator>
|
|
95
|
+
<Text typography={'badgeMedium'} ref={badgeRef}>
|
|
96
|
+
{maxLength}
|
|
97
|
+
</Text>
|
|
98
|
+
</TextareaLimitIndicator>
|
|
99
|
+
</TextareaContainer>
|
|
100
|
+
)
|
|
101
|
+
}
|