@lets-events/react 5.0.0 → 6.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.
Files changed (37) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +20 -18
  3. package/CHANGELOG.md +14 -1
  4. package/dist/index.d.mts +1916 -12
  5. package/dist/index.d.ts +1916 -12
  6. package/dist/index.js +5129 -348
  7. package/dist/index.mjs +5083 -307
  8. package/package.json +3 -2
  9. package/src/components/Alert.tsx +255 -255
  10. package/src/components/Avatar.tsx +55 -55
  11. package/src/components/Badge.tsx +129 -121
  12. package/src/components/Box.tsx +3 -3
  13. package/src/components/Button/index.tsx +13 -0
  14. package/src/components/Button/styledComponents.ts +359 -0
  15. package/src/components/ButtonGroup.tsx +484 -477
  16. package/src/components/Calendar/index.tsx +122 -0
  17. package/src/components/Calendar/styledComponents.ts +195 -0
  18. package/src/components/CheckboxGroup.tsx +214 -208
  19. package/src/components/Container.tsx +39 -39
  20. package/src/components/Dropdown.tsx +167 -109
  21. package/src/components/Filter.tsx +164 -95
  22. package/src/components/Flex.tsx +117 -117
  23. package/src/components/Grid.tsx +137 -137
  24. package/src/components/Icon.tsx +47 -47
  25. package/src/components/Modal.tsx +108 -108
  26. package/src/components/RadioGroup.tsx +210 -203
  27. package/src/components/Section.tsx +33 -33
  28. package/src/components/Step.tsx +147 -147
  29. package/src/components/Switch.tsx +108 -108
  30. package/src/components/Text.tsx +31 -31
  31. package/src/components/TextField.tsx +261 -193
  32. package/src/components/TimePicker.tsx +125 -0
  33. package/src/index.tsx +29 -27
  34. package/src/styles/index.ts +38 -38
  35. package/src/types/typographyValues.ts +179 -0
  36. package/tsconfig.json +3 -3
  37. package/src/components/Button.tsx +0 -343
@@ -1,109 +1,167 @@
1
- import { styled } from '../styles'
2
- import { ComponentProps, ElementType } from 'react'
3
- import { Theme, DropdownMenu as DropdownMenuRadix } from '@radix-ui/themes'
4
-
5
- const DropdownMenuStyled = styled('div', {
6
- fontFamily: '$default',
7
- color: '$dark600',
8
- letterSpacing: '0px',
9
- cursor: 'pointer',
10
- border: '1px solid $dark300',
11
- borderRadius: '$xs',
12
- padding: '$8 $12',
13
- width: 'calc(100% - 24px)',
14
- display: 'flex',
15
- 'button': {
16
- fontFamily: '$default',
17
- color: '$dark600',
18
- letterSpacing: '0px',
19
- backgroundColor: 'transparent',
20
- border: 'none',
21
- width: '100%',
22
- outline: 'none',
23
- display: 'flex',
24
- alignItems: 'center',
25
- gap: '$8',
26
- cursor: 'pointer',
27
- 'svg': {
28
- marginLeft: 'auto',
29
- }
30
- },
31
-
32
- })
33
-
34
- const DropdownMenuContentStyled = styled(DropdownMenuRadix.Content, {
35
- background: 'white',
36
- padding: '$8 $12',
37
- border: '1px solid $dark300',
38
- borderRadius: '$xs',
39
- boxShadow: '0px 4px 4px 0px rgba(35, 53, 67, 0.08)',
40
- width: 'calc(var(--radix-popper-anchor-width) - 24px);',
41
- minWidth: '100%',
42
- marginTop: '3px',
43
-
44
-
45
- })
46
- const DropdownMenuItemStyled = styled(DropdownMenuRadix.Item, {
47
- fontFamily: '$default',
48
- color: '$dark600',
49
- letterSpacing: '0px',
50
- padding: '$8 $12',
51
- '&:hover, &:focus': {
52
- backgroundColor: 'transparent',
53
- border: 'none',
54
- outline: 'none',
55
- cursor: 'pointer',
56
- }
57
-
58
- })
59
-
60
- export type DropdownMenuProps = ComponentProps<typeof DropdownMenuRadix.Root> & {
61
- as?: ElementType,
62
- placeholder?: string,
63
- }
64
- export type DropdownMenuItemProps = ComponentProps<typeof DropdownMenuItemStyled> & {
65
- as?: ElementType,
66
- value: string,
67
- }
68
-
69
-
70
- export function DropdownMenu({
71
- children,
72
- placeholder,
73
- ...props
74
- }: DropdownMenuProps) {
75
- return (
76
- <Theme>
77
- <DropdownMenuRadix.Root {...props}>
78
- <DropdownMenuStyled>
79
- <DropdownMenuRadix.Trigger>
80
- <button aria-label={placeholder || 'Fitrar'}>
81
- <span>{placeholder || 'Fitrar'}</span>
82
- <DropdownMenuRadix.TriggerIcon />
83
- </button>
84
- </DropdownMenuRadix.Trigger>
85
- <DropdownMenuContentStyled avoidCollisions={false}
86
- align="start"
87
- alignOffset={-14}>
88
- <DropdownMenuRadix.Group>
89
- {children}
90
- </DropdownMenuRadix.Group>
91
- </DropdownMenuContentStyled>
92
- </DropdownMenuStyled>
93
- </DropdownMenuRadix.Root>
94
- </Theme>
95
- )
96
- }
97
-
98
-
99
-
100
- export function DropdownMenuItem({
101
- children,
102
- ...props
103
- }: DropdownMenuItemProps) {
104
- return (
105
- <DropdownMenuItemStyled {...props}>
106
- {children}
107
- </DropdownMenuItemStyled>
108
- )
109
- }
1
+ import { ComponentProps, ElementType } from 'react'
2
+ import { Theme, DropdownMenu as DropdownMenuRadix } from '@radix-ui/themes'
3
+ import { styled } from '../styles'
4
+ import { typographyLabelValues } from '../types/typographyValues'
5
+
6
+ const DropdownMenuItemStyled = styled(DropdownMenuRadix.Item, {
7
+ fontFamily: '$default',
8
+ color: '$dark600',
9
+ letterSpacing: '0px',
10
+ padding: '$8 $12',
11
+ '&:hover, &:focus': {
12
+ backgroundColor: 'transparent',
13
+ border: 'none',
14
+ outline: 'none',
15
+ cursor: 'pointer',
16
+ },
17
+ variants: {
18
+ typography: typographyLabelValues,
19
+ fontWeight: {
20
+ regular: { fontWeight: '$regular' },
21
+ medium: { fontWeight: '$medium' },
22
+ semibold: { fontWeight: '$semibold' },
23
+ bold: { fontWeight: '$bold' },
24
+ }
25
+ },
26
+ })
27
+
28
+ const DropdownMenuStyled = styled('div', {
29
+ fontFamily: '$default',
30
+ color: '$dark600',
31
+ letterSpacing: '0px',
32
+ cursor: 'pointer',
33
+ border: '1px solid $dark300',
34
+ borderRadius: '$xs',
35
+ padding: '$8 $12',
36
+ width: 'calc(100% - 24px)',
37
+ display: 'flex',
38
+ 'button': {
39
+ fontFamily: '$default',
40
+ color: '$dark600',
41
+ letterSpacing: '0px',
42
+ backgroundColor: 'transparent',
43
+ border: 'none',
44
+ width: '100%',
45
+ outline: 'none',
46
+ display: 'flex',
47
+ alignItems: 'center',
48
+ gap: '$8',
49
+ cursor: 'pointer',
50
+ 'svg': {
51
+ marginLeft: 'auto',
52
+ },
53
+ },
54
+ variants: {
55
+ typography: {
56
+ labelLarge: {
57
+ 'button': {
58
+ fontSize: '$labelLarge',
59
+ lineHeight: '$labelLarge',
60
+ }
61
+ },
62
+ labelMedium: {
63
+ 'button': {
64
+ fontSize: '$labelMedium',
65
+ lineHeight: '$labelMedium',
66
+ }
67
+ },
68
+ labelSmall: {
69
+ 'button': {
70
+ fontSize: '$labelSmall',
71
+ lineHeight: '$labelSmall',
72
+ }
73
+ },
74
+ labelExtraSmall: {
75
+ 'button': {
76
+ fontSize: '$labelExtraSmall',
77
+ lineHeight: '$labelExtraSmall',
78
+ }
79
+ },
80
+ },
81
+ fontWeight: {
82
+ regular: { 'button': { fontWeight: '$regular' } },
83
+ medium: { 'button': { fontWeight: '$medium' } },
84
+ semibold: { 'button': { fontWeight: '$semibold' } },
85
+ bold: { 'button': { fontWeight: '$bold' } },
86
+ },
87
+ },
88
+ })
89
+
90
+ const DropdownMenuContentStyled = styled(DropdownMenuRadix.Content, {
91
+ background: 'white',
92
+ padding: '$8 $12',
93
+ border: '1px solid $dark300',
94
+ borderRadius: '$xs',
95
+ boxShadow: '0px 4px 4px 0px rgba(35, 53, 67, 0.08)',
96
+ width: 'calc(var(--radix-popper-anchor-width) - 24px);',
97
+ minWidth: '100%',
98
+ marginTop: '3px',
99
+ })
100
+
101
+
102
+
103
+ export type DropdownMenuProps = ComponentProps<typeof DropdownMenuRadix.Root> & {
104
+ as?: ElementType
105
+ placeholder?: string
106
+ fontWeight: 'regular' | 'medium' | 'semibold' | 'bold'
107
+ typography: 'labelExtraSmall' | 'labelSmall' | 'labelMedium' | 'labelLarge'
108
+ children: React.ReactNode
109
+ }
110
+
111
+ export type DropdownMenuItemProps = ComponentProps<typeof DropdownMenuItemStyled> & {
112
+ as?: ElementType
113
+ value: string
114
+ typography: DropdownMenuProps['typography']
115
+ fontWeight: DropdownMenuProps['fontWeight']
116
+ }
117
+
118
+ /* Componente principal */
119
+ export function DropdownMenu({
120
+ children,
121
+ placeholder,
122
+ typography,
123
+ fontWeight,
124
+ ...props
125
+ }: DropdownMenuProps) {
126
+ return (
127
+ <Theme>
128
+ <DropdownMenuRadix.Root {...props}>
129
+ <DropdownMenuStyled typography={typography} fontWeight={fontWeight}>
130
+ <DropdownMenuRadix.Trigger>
131
+ <button aria-label={placeholder || 'Filtrar'}>
132
+ <span>{placeholder || 'Filtrar'}</span>
133
+ <DropdownMenuRadix.TriggerIcon />
134
+ </button>
135
+ </DropdownMenuRadix.Trigger>
136
+ <DropdownMenuContentStyled
137
+ avoidCollisions={false}
138
+ align="start"
139
+ alignOffset={-14}
140
+ >
141
+ <DropdownMenuRadix.Group>
142
+ {children}
143
+ </DropdownMenuRadix.Group>
144
+ </DropdownMenuContentStyled>
145
+ </DropdownMenuStyled>
146
+ </DropdownMenuRadix.Root>
147
+ </Theme>
148
+ )
149
+ }
150
+
151
+ /* Componente de item */
152
+ export function DropdownMenuItem({
153
+ children,
154
+ typography,
155
+ fontWeight,
156
+ ...props
157
+ }: DropdownMenuItemProps) {
158
+ return (
159
+ <DropdownMenuItemStyled
160
+ typography={typography}
161
+ fontWeight={fontWeight}
162
+ {...props}
163
+ >
164
+ {children}
165
+ </DropdownMenuItemStyled>
166
+ )
167
+ }
@@ -1,96 +1,165 @@
1
- import { styled } from '../styles'
2
- import { ComponentProps, ElementType } from 'react'
3
- import { Theme, DropdownMenu } from '@radix-ui/themes'
4
- import { CheckboxGroup, CheckboxItem } from './CheckboxGroup'
5
- import { Icon } from './Icon'
6
- const FilterStyled = styled('div', {
7
- fontFamily: '$default',
8
- color: '$dark600',
9
- letterSpacing: '0px',
10
- cursor: 'pointer',
11
- border: '1px solid $dark300',
12
- borderRadius: '$xs',
13
- padding: '$8 $12',
14
- width: 'calc(100% - 24px)',
15
- display: 'flex',
16
- 'button': {
17
- fontFamily: '$default',
18
- color: '$dark600',
19
- letterSpacing: '0px',
20
- backgroundColor: 'transparent',
21
- border: 'none',
22
- width: '100%',
23
- outline: 'none',
24
- display: 'flex',
25
- alignItems: 'center',
26
- gap: '$8',
27
- cursor: 'pointer',
28
- 'svg:last-child': {
29
- marginLeft: 'auto',
30
- }
31
- },
32
-
33
- })
34
-
35
- const FilterContentStyled = styled(DropdownMenu.Content, {
36
- background: 'white',
37
- padding: '$8 $12',
38
- border: '1px solid $dark300',
39
- borderRadius: '$xs',
40
- boxShadow: '0px 4px 4px 0px rgba(35, 53, 67, 0.08)',
41
- width: 'calc(var(--radix-popper-anchor-width) - 24px);',
42
- minWidth: '100%',
43
- marginTop: '3px',
44
-
45
- })
46
-
47
- export type FilterProps = ComponentProps<typeof DropdownMenu.Root> & {
48
- as?: ElementType,
49
- placeholder?: string,
50
- }
51
- export type FilterItemProps = ComponentProps<typeof CheckboxItem> & {
52
- as?: ElementType,
53
- value: string,
54
- }
55
-
56
-
57
- export function Filter({
58
- children,
59
- placeholder,
60
- ...props
61
- }: FilterProps) {
62
- return (
63
- <Theme>
64
- <DropdownMenu.Root {...props}>
65
- <FilterStyled>
66
- <DropdownMenu.Trigger>
67
- <button aria-label={placeholder || 'Fitrar'}>
68
- <Icon name='filter' />
69
- <span>{placeholder || 'Fitrar'}</span>
70
- <DropdownMenu.TriggerIcon />
71
- </button>
72
- </DropdownMenu.Trigger>
73
- <FilterContentStyled avoidCollisions={false}
74
- align="start"
75
- alignOffset={-14}>
76
- <CheckboxGroup>
77
- {children}
78
- </CheckboxGroup>
79
- </FilterContentStyled>
80
- </FilterStyled>
81
- </DropdownMenu.Root>
82
- </Theme>
83
- )
84
- }
85
-
86
-
87
- export function FilterItem({
88
- children,
89
- ...props
90
- }: FilterItemProps) {
91
- return (
92
- <CheckboxItem {...props} style={{ padding: '8px 12px' }}>
93
- {children}
94
- </CheckboxItem>
95
- )
1
+ import { styled } from '../styles'
2
+ import { ComponentProps, ElementType } from 'react'
3
+ import { Theme, DropdownMenu } from '@radix-ui/themes'
4
+ import { CheckboxGroup, CheckboxItem } from './CheckboxGroup'
5
+ import { Icon } from './Icon'
6
+ import { typographyLabelValues } from '../types/typographyValues'
7
+
8
+ const FilterContentStyled = styled(DropdownMenu.Content, {
9
+ background: 'white',
10
+ padding: '$8 $12',
11
+ border: '1px solid $dark300',
12
+ borderRadius: '$xs',
13
+ boxShadow: '0px 4px 4px 0px rgba(35, 53, 67, 0.08)',
14
+ width: 'calc(var(--radix-popper-anchor-width) - 24px);',
15
+ minWidth: '100%',
16
+ marginTop: '3px',
17
+ fontFamily: '$default',
18
+ variants: {
19
+ typography: typographyLabelValues,
20
+ fontWeight: {
21
+ regular: {
22
+ fontWeight: '$regular'
23
+ },
24
+ medium: {
25
+ fontWeight: '$medium'
26
+ },
27
+ semibold: {
28
+ fontWeight: '$semibold'
29
+ },
30
+ bold: {
31
+ fontWeight: '$bold'
32
+ },
33
+ },
34
+ },
35
+ })
36
+ const FilterStyled = styled('div', {
37
+ fontFamily: '$default',
38
+ color: '$dark600',
39
+ letterSpacing: '0px',
40
+ cursor: 'pointer',
41
+ border: '1px solid $dark300',
42
+ borderRadius: '$xs',
43
+ padding: '$8 $12',
44
+ width: 'calc(100% - 24px)',
45
+ display: 'flex',
46
+ 'button': {
47
+ fontFamily: '$default',
48
+ color: '$dark600',
49
+ letterSpacing: '0px',
50
+ backgroundColor: 'transparent',
51
+ border: 'none',
52
+ width: '100%',
53
+ outline: 'none',
54
+ display: 'flex',
55
+ alignItems: 'center',
56
+ gap: '$8',
57
+ cursor: 'pointer',
58
+ 'svg:last-child': {
59
+ marginLeft: 'auto',
60
+ }
61
+ },
62
+ variants: {
63
+ typography: {
64
+ labelLarge: {
65
+ 'span': {
66
+ fontSize: '$labelLarge',
67
+ lineHeight: '$labelLarge',
68
+ }
69
+ },
70
+ labelMedium: {
71
+ 'span': {
72
+ fontSize: '$labelMedium',
73
+ lineHeight: '$labelMedium',
74
+ }
75
+ },
76
+ labelSmall: {
77
+ 'span': {
78
+ fontSize: '$labelSmall',
79
+ lineHeight: '$labelSmall',
80
+ }
81
+ },
82
+ labelExtraSmall: {
83
+ 'span': {
84
+ fontSize: '$labelExtraSmall',
85
+ lineHeight: '$labelExtraSmall',
86
+ }
87
+ },
88
+ },
89
+ fontWeight: {
90
+ regular: {
91
+ 'span': { fontWeight: '$regular' }
92
+ },
93
+ medium: {
94
+ 'span': { fontWeight: '$medium' }
95
+ },
96
+ semibold: {
97
+ 'span': { fontWeight: '$semibold' }
98
+ },
99
+ bold: {
100
+ 'span': { fontWeight: '$bold' }
101
+ },
102
+ },
103
+ }
104
+ })
105
+
106
+
107
+ export type FilterProps = ComponentProps<typeof DropdownMenu.Root> & {
108
+ as?: ElementType,
109
+ placeholder?: string,
110
+ fontWeight: 'regular' | 'medium' | 'semibold' | 'bold',
111
+ typography: 'labelExtraSmall' | 'labelSmall' | 'labelMedium' | 'labelLarge',
112
+ }
113
+ export type FilterItemProps = ComponentProps<typeof CheckboxItem> & {
114
+ as?: ElementType,
115
+ value: string,
116
+ typography: FilterProps['typography'],
117
+ fontWeight: FilterProps['fontWeight'],
118
+ }
119
+
120
+
121
+ export function Filter({
122
+ children,
123
+ placeholder,
124
+ typography,
125
+ fontWeight,
126
+ ...props
127
+ }: FilterProps) {
128
+ return (
129
+ <Theme>
130
+ <DropdownMenu.Root {...props}>
131
+ <FilterStyled typography={typography} fontWeight={fontWeight}>
132
+ <DropdownMenu.Trigger>
133
+ <button aria-label={placeholder || 'Fitrar'}>
134
+ <Icon name='filter' />
135
+ <span>{placeholder || 'Fitrar'}</span>
136
+ <DropdownMenu.TriggerIcon />
137
+ </button>
138
+ </DropdownMenu.Trigger>
139
+ <FilterContentStyled avoidCollisions={false}
140
+ align="start"
141
+ alignOffset={-14}
142
+ typography={typography}
143
+ fontWeight={fontWeight}
144
+ >
145
+ <CheckboxGroup>
146
+ {children}
147
+ </CheckboxGroup>
148
+ </FilterContentStyled>
149
+ </FilterStyled>
150
+ </DropdownMenu.Root>
151
+ </Theme>
152
+ )
153
+ }
154
+
155
+
156
+ export function FilterItem({
157
+ children,
158
+ ...props
159
+ }: FilterItemProps) {
160
+ return (
161
+ <CheckboxItem {...props} style={{ padding: '8px 12px' }}>
162
+ {children}
163
+ </CheckboxItem>
164
+ )
96
165
  }