@lets-events/react 5.0.0 → 6.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.
- package/.eslintrc.json +2 -2
- package/.turbo/turbo-build.log +20 -18
- package/CHANGELOG.md +8 -1
- package/dist/index.d.mts +42 -11
- package/dist/index.d.ts +42 -11
- package/dist/index.js +585 -141
- package/dist/index.mjs +589 -145
- package/package.json +1 -1
- package/src/components/Alert.tsx +255 -255
- package/src/components/Avatar.tsx +55 -55
- package/src/components/Badge.tsx +129 -121
- package/src/components/Box.tsx +3 -3
- package/src/components/Button.tsx +328 -342
- package/src/components/ButtonGroup.tsx +484 -477
- package/src/components/CheckboxGroup.tsx +214 -208
- package/src/components/Container.tsx +39 -39
- package/src/components/Dropdown.tsx +167 -109
- package/src/components/Filter.tsx +164 -95
- package/src/components/Flex.tsx +117 -117
- package/src/components/Grid.tsx +137 -137
- package/src/components/Icon.tsx +47 -47
- package/src/components/Modal.tsx +108 -108
- package/src/components/RadioGroup.tsx +210 -203
- package/src/components/Section.tsx +33 -33
- package/src/components/Step.tsx +147 -147
- package/src/components/Switch.tsx +108 -108
- package/src/components/Text.tsx +31 -31
- package/src/components/TextField.tsx +241 -193
- package/src/index.tsx +27 -27
- package/src/styles/index.ts +38 -38
- package/src/types/typographyValues.ts +179 -0
- package/tsconfig.json +3 -3
package/src/components/Badge.tsx
CHANGED
|
@@ -1,121 +1,129 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { ComponentProps, ElementType } from 'react'
|
|
3
|
-
import { styled } from '../styles'
|
|
4
|
-
import { Badge as BadgeRadix } from '@radix-ui/themes'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ComponentProps, ElementType } from 'react'
|
|
3
|
+
import { styled } from '../styles'
|
|
4
|
+
import { Badge as BadgeRadix } from '@radix-ui/themes'
|
|
5
|
+
import { fontWeights } from '@lets-events/tokens'
|
|
6
|
+
export const BadgeStyled = styled(BadgeRadix, {
|
|
7
|
+
fontFamily: '$default',
|
|
8
|
+
borderRadius: '$sm',
|
|
9
|
+
verticalAlign: 'middle',
|
|
10
|
+
'svg': {
|
|
11
|
+
marginRight: '10px',
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
color: {
|
|
15
|
+
primary: {
|
|
16
|
+
backgroundColor: '$brand100',
|
|
17
|
+
color: '$dark700',
|
|
18
|
+
},
|
|
19
|
+
dark: {
|
|
20
|
+
backgroundColor: '$dark700',
|
|
21
|
+
color: '$grey50',
|
|
22
|
+
},
|
|
23
|
+
light: {
|
|
24
|
+
backgroundColor: '$neutral200',
|
|
25
|
+
color: '$dark700',
|
|
26
|
+
},
|
|
27
|
+
red: {
|
|
28
|
+
backgroundColor: '$red100',
|
|
29
|
+
color: '$dark700',
|
|
30
|
+
},
|
|
31
|
+
green: {
|
|
32
|
+
backgroundColor: '$green100',
|
|
33
|
+
color: '$dark700',
|
|
34
|
+
},
|
|
35
|
+
yellow: {
|
|
36
|
+
backgroundColor: '$yellow100',
|
|
37
|
+
color: '$dark700',
|
|
38
|
+
},
|
|
39
|
+
orange: {
|
|
40
|
+
backgroundColor: '$orange100',
|
|
41
|
+
color: '$dark700',
|
|
42
|
+
},
|
|
43
|
+
blue: {
|
|
44
|
+
backgroundColor: '$blue100',
|
|
45
|
+
color: '$dark700',
|
|
46
|
+
},
|
|
47
|
+
pink: {
|
|
48
|
+
backgroundColor: '$pink100',
|
|
49
|
+
color: '$dark700',
|
|
50
|
+
},
|
|
51
|
+
purple: {
|
|
52
|
+
backgroundColor: '$purple100',
|
|
53
|
+
color: '$dark700',
|
|
54
|
+
},
|
|
55
|
+
grey: {
|
|
56
|
+
backgroundColor: '$grey200',
|
|
57
|
+
color: '$dark700',
|
|
58
|
+
},
|
|
59
|
+
disable: {
|
|
60
|
+
backgroundColor: '$neutral200',
|
|
61
|
+
color: '$grey500',
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
},
|
|
66
|
+
size: {
|
|
67
|
+
xs: {
|
|
68
|
+
padding: '$4 $6',
|
|
69
|
+
fontSize: '$badgeExtraSmall',
|
|
70
|
+
borderRadius: '$2xs',
|
|
71
|
+
lineHeight: '$bagdeExtraSmall',
|
|
72
|
+
},
|
|
73
|
+
sm: {
|
|
74
|
+
padding: '$4 $8',
|
|
75
|
+
fontSize: '$badgeSmall',
|
|
76
|
+
borderRadius: '$xs',
|
|
77
|
+
lineHeight: '$badgeSmall',
|
|
78
|
+
},
|
|
79
|
+
md: {
|
|
80
|
+
padding: '$8 $10',
|
|
81
|
+
fontSize: '$badgeMedium',
|
|
82
|
+
borderRadius: '$sm',
|
|
83
|
+
lineHeight: '$badgeMedium',
|
|
84
|
+
},
|
|
85
|
+
xl: {
|
|
86
|
+
padding: '$12 $12',
|
|
87
|
+
fontSize: '$badgeLarge',
|
|
88
|
+
borderRadius: '$sm',
|
|
89
|
+
lineHeight: '$badgeLarge',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
fontWeight: {
|
|
93
|
+
regular: { fontWeight: '$regular' },
|
|
94
|
+
medium: { fontWeight: '$medium' },
|
|
95
|
+
semibold: { fontWeight: '$semibold' },
|
|
96
|
+
bold: { fontWeight: '$bold' },
|
|
97
|
+
},
|
|
98
|
+
radii: {
|
|
99
|
+
'full': {
|
|
100
|
+
borderRadius: '$full',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
defaultVariants: {
|
|
106
|
+
size: 'md',
|
|
107
|
+
color: 'primary',
|
|
108
|
+
fontWeight: 'regular',
|
|
109
|
+
},
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
export type BadgeProps = ComponentProps<typeof BadgeStyled> & {
|
|
113
|
+
as?: ElementType
|
|
114
|
+
icon?: boolean
|
|
115
|
+
size: 'md',
|
|
116
|
+
children: React.ReactNode
|
|
117
|
+
}
|
|
118
|
+
export function Badge({ asChild, children, ...props }: BadgeProps) {
|
|
119
|
+
return (
|
|
120
|
+
<BadgeStyled {...props}>
|
|
121
|
+
{React.Children.map(children, (child) => {
|
|
122
|
+
if (React.isValidElement(child)) {
|
|
123
|
+
return React.cloneElement(child, { size: props.size } as any)
|
|
124
|
+
}
|
|
125
|
+
return child
|
|
126
|
+
})}
|
|
127
|
+
</BadgeStyled>
|
|
128
|
+
)
|
|
129
|
+
}
|
package/src/components/Box.tsx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Box as BoxRadix } from "@radix-ui/themes";
|
|
2
|
-
export const Box = BoxRadix
|
|
3
|
-
|
|
1
|
+
import { Box as BoxRadix } from "@radix-ui/themes";
|
|
2
|
+
export const Box = BoxRadix
|
|
3
|
+
|