@lets-events/react 10.1.1 → 11.0.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.
Files changed (47) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +18 -19
  3. package/CHANGELOG.md +6 -0
  4. package/dist/index.d.mts +376 -6
  5. package/dist/index.d.ts +376 -6
  6. package/dist/index.js +73 -36
  7. package/dist/index.mjs +72 -36
  8. package/package.json +1 -1
  9. package/src/components/Alert.tsx +303 -303
  10. package/src/components/Avatar.tsx +55 -55
  11. package/src/components/Badge.tsx +128 -128
  12. package/src/components/Box.tsx +3 -3
  13. package/src/components/Button/index.tsx +12 -12
  14. package/src/components/Button/styledComponents.ts +275 -250
  15. package/src/components/ButtonGroup.tsx +484 -484
  16. package/src/components/Calendar/index.tsx +136 -136
  17. package/src/components/Calendar/styledComponents.ts +209 -208
  18. package/src/components/Card.tsx +69 -69
  19. package/src/components/CheckboxGroup.tsx +214 -214
  20. package/src/components/Container.tsx +39 -39
  21. package/src/components/Dropdown.tsx +167 -167
  22. package/src/components/Filter.tsx +164 -164
  23. package/src/components/Flex.tsx +118 -118
  24. package/src/components/Grid.tsx +137 -137
  25. package/src/components/Icon.tsx +47 -47
  26. package/src/components/Modal.tsx +90 -90
  27. package/src/components/RadioGroup.tsx +210 -210
  28. package/src/components/Section.tsx +33 -33
  29. package/src/components/Step.tsx +164 -164
  30. package/src/components/Switch.tsx +108 -108
  31. package/src/components/Text.tsx +39 -30
  32. package/src/components/TextField.tsx +299 -299
  33. package/src/components/TextareaField.tsx +101 -101
  34. package/src/components/TimePicker.tsx +298 -280
  35. package/src/components/Toast/components/ToastItem.tsx +41 -41
  36. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  37. package/src/components/Toast/hooks/useToast.ts +12 -12
  38. package/src/components/Toast/index.tsx +5 -5
  39. package/src/components/Toast/styles/index.ts +135 -135
  40. package/src/components/Toast/types/index.ts +46 -46
  41. package/src/components/Tooltip/index.tsx +66 -66
  42. package/src/components/Tooltip/styles.ts +77 -77
  43. package/src/hooks/useOnClickOutside.tsx +20 -20
  44. package/src/index.tsx +33 -33
  45. package/src/styles/index.ts +38 -38
  46. package/src/types/typographyValues.ts +178 -178
  47. 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
+ }