@lets-events/react 11.3.0 → 11.4.1

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 (58) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +18 -20
  3. package/CHANGELOG.md +12 -0
  4. package/dist/index.d.mts +968 -207
  5. package/dist/index.d.ts +968 -207
  6. package/dist/index.js +266 -54
  7. package/dist/index.mjs +262 -48
  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 +125 -128
  12. package/src/components/Box.tsx +3 -3
  13. package/src/components/Button/index.tsx +16 -16
  14. package/src/components/Button/styledComponents.ts +287 -287
  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 -209
  18. package/src/components/Card.tsx +48 -48
  19. package/src/components/CheckboxGroup.tsx +196 -214
  20. package/src/components/Container.tsx +39 -39
  21. package/src/components/Drawer/index.tsx +48 -48
  22. package/src/components/Drawer/styledComponents.ts +46 -46
  23. package/src/components/Dropdown.tsx +167 -167
  24. package/src/components/Filter.tsx +164 -164
  25. package/src/components/Flex.tsx +118 -118
  26. package/src/components/FormFields/ErrorFormMessage.tsx +36 -36
  27. package/src/components/FormFields/Form.tsx +25 -25
  28. package/src/components/FormFields/FormLabel.tsx +29 -29
  29. package/src/components/FormFields/MultiSelectFormField.tsx +59 -0
  30. package/src/components/FormFields/TextAreaFormField.tsx +46 -46
  31. package/src/components/FormFields/TextFormField.tsx +46 -46
  32. package/src/components/Grid.tsx +137 -137
  33. package/src/components/Icon.tsx +47 -47
  34. package/src/components/MenuDropdown/index.tsx +30 -30
  35. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  36. package/src/components/Modal.tsx +90 -90
  37. package/src/components/MultiSelect.tsx +218 -0
  38. package/src/components/RadioGroup.tsx +210 -210
  39. package/src/components/Section.tsx +33 -33
  40. package/src/components/Step.tsx +164 -164
  41. package/src/components/Switch.tsx +108 -108
  42. package/src/components/Text.tsx +38 -39
  43. package/src/components/TextField.tsx +315 -315
  44. package/src/components/TextareaField.tsx +128 -128
  45. package/src/components/TimePicker.tsx +298 -298
  46. package/src/components/Toast/components/ToastItem.tsx +41 -41
  47. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  48. package/src/components/Toast/hooks/useToast.ts +12 -12
  49. package/src/components/Toast/index.tsx +5 -5
  50. package/src/components/Toast/styles/index.ts +135 -135
  51. package/src/components/Toast/types/index.ts +46 -46
  52. package/src/components/Tooltip/index.tsx +66 -66
  53. package/src/components/Tooltip/styles.ts +77 -77
  54. package/src/hooks/useOnClickOutside.tsx +20 -20
  55. package/src/index.tsx +44 -42
  56. package/src/styles/index.ts +38 -38
  57. package/src/types/typographyValues.ts +178 -178
  58. package/tsconfig.json +3 -3
@@ -1,164 +1,164 @@
1
- import React, { ComponentProps, ElementType } from "react";
2
- import { styled } from "../styles";
3
- import { Box, Tabs as StepRadix } from "@radix-ui/themes";
4
-
5
- export const StepStyled = styled("div", {
6
- fontFamily: "$default",
7
- color: "$gray100",
8
- letterSpacing: "0px",
9
- });
10
-
11
- const StepTriggerStyled = styled(StepRadix.Trigger, {
12
- all: "unset",
13
- position: "relative",
14
- display: "flex",
15
- alignItems: "center",
16
- justifyContent: "center",
17
- fontSize: "$16",
18
- fontWeight: "$medium",
19
-
20
- minWidth: "32px",
21
- minHeight: "32px",
22
- marginRight: "40px",
23
-
24
- "&:last-of-type": {
25
- marginRight: 0,
26
- },
27
-
28
- "& > span:first-of-type": {
29
- width: "32px",
30
- height: "32px",
31
- borderRadius: "$full",
32
- backgroundColor: "$neutral50",
33
- border: "1px solid $neutral200",
34
- color: "$gray700",
35
- display: "flex",
36
- alignItems: "center",
37
- justifyContent: "center",
38
- zIndex: 1,
39
- position: "relative",
40
- },
41
-
42
- '&[data-state="active"] > span:first-of-type': {
43
- backgroundColor: "$blue500",
44
- borderColor: "$blue500",
45
- color: "white",
46
- },
47
-
48
- "& > span:last-of-type": {
49
- display: "none",
50
- },
51
-
52
- "&:not(:first-of-type)::before": {
53
- content: '""',
54
- position: "absolute",
55
- top: "50%",
56
- right: "calc(100% + 4px)",
57
- transform: "translateY(-50%)",
58
- width: "32px",
59
- height: "8px",
60
- borderRadius: "$sm",
61
- backgroundColor: "$neutral50",
62
- zIndex: 0,
63
- },
64
-
65
- '&[data-state="active"]::before': {
66
- backgroundColor: "$blue500",
67
- },
68
-
69
- '&[data-filled="true"] > span:first-of-type': {
70
- backgroundColor: "$blue500",
71
- borderColor: "$blue500",
72
- color: "white",
73
- },
74
-
75
- '&[data-filled="true"]::before': {
76
- backgroundColor: "$blue500",
77
- },
78
- });
79
-
80
- const StepListStyled = styled(StepRadix.List, {
81
- display: "flex",
82
- alignItems: "center",
83
- justifyContent: "flex-start",
84
- gap: "$4",
85
- });
86
-
87
- export type StepProps = ComponentProps<typeof StepStyled> & {
88
- children: React.ReactNode;
89
- defaultValue: number;
90
- };
91
- export function Step({ children, defaultValue, ...props }: StepProps) {
92
- return (
93
- <StepRadix.Root defaultValue={String(defaultValue)}>
94
- <StepStyled {...props}>{children}</StepStyled>
95
- </StepRadix.Root>
96
- );
97
- }
98
-
99
- export function StepTrigger({
100
- value,
101
- children,
102
- currentStep,
103
- ...props
104
- }: {
105
- value: number;
106
- children: React.ReactNode | string;
107
- currentStep?: number;
108
- onClick: () => void;
109
- }) {
110
- const isActiveOrPrevious = currentStep !== undefined && value <= currentStep;
111
- return (
112
- <StepTriggerStyled
113
- data-filled={isActiveOrPrevious}
114
- value={String(value)}
115
- {...props}
116
- >
117
- {children}
118
- </StepTriggerStyled>
119
- );
120
- }
121
-
122
- export function StepContent({
123
- value,
124
- children,
125
- ...props
126
- }: {
127
- value: number;
128
- children: React.ReactNode;
129
- }) {
130
- return (
131
- <StepRadix.Content value={String(value)} {...props}>
132
- {children}
133
- </StepRadix.Content>
134
- );
135
- }
136
-
137
- export function StepList({
138
- children,
139
- currentStep,
140
- ...props
141
- }: {
142
- children: React.ReactNode;
143
- currentStep: number;
144
- }) {
145
- return (
146
- <StepListStyled {...props}>
147
- {React.Children.map(children, (child) => {
148
- if (React.isValidElement(child) && child.type === StepTrigger) {
149
- return React.cloneElement(child, { currentStep } as any);
150
- }
151
- return child;
152
- })}
153
- </StepListStyled>
154
- );
155
- }
156
-
157
- export function StepWrapper({
158
- children,
159
- ...props
160
- }: {
161
- children: React.ReactNode;
162
- }) {
163
- return <Box {...props}>{children}</Box>;
164
- }
1
+ import React, { ComponentProps, ElementType } from "react";
2
+ import { styled } from "../styles";
3
+ import { Box, Tabs as StepRadix } from "@radix-ui/themes";
4
+
5
+ export const StepStyled = styled("div", {
6
+ fontFamily: "$default",
7
+ color: "$gray100",
8
+ letterSpacing: "0px",
9
+ });
10
+
11
+ const StepTriggerStyled = styled(StepRadix.Trigger, {
12
+ all: "unset",
13
+ position: "relative",
14
+ display: "flex",
15
+ alignItems: "center",
16
+ justifyContent: "center",
17
+ fontSize: "$16",
18
+ fontWeight: "$medium",
19
+
20
+ minWidth: "32px",
21
+ minHeight: "32px",
22
+ marginRight: "40px",
23
+
24
+ "&:last-of-type": {
25
+ marginRight: 0,
26
+ },
27
+
28
+ "& > span:first-of-type": {
29
+ width: "32px",
30
+ height: "32px",
31
+ borderRadius: "$full",
32
+ backgroundColor: "$neutral50",
33
+ border: "1px solid $neutral200",
34
+ color: "$gray700",
35
+ display: "flex",
36
+ alignItems: "center",
37
+ justifyContent: "center",
38
+ zIndex: 1,
39
+ position: "relative",
40
+ },
41
+
42
+ '&[data-state="active"] > span:first-of-type': {
43
+ backgroundColor: "$blue500",
44
+ borderColor: "$blue500",
45
+ color: "white",
46
+ },
47
+
48
+ "& > span:last-of-type": {
49
+ display: "none",
50
+ },
51
+
52
+ "&:not(:first-of-type)::before": {
53
+ content: '""',
54
+ position: "absolute",
55
+ top: "50%",
56
+ right: "calc(100% + 4px)",
57
+ transform: "translateY(-50%)",
58
+ width: "32px",
59
+ height: "8px",
60
+ borderRadius: "$sm",
61
+ backgroundColor: "$neutral50",
62
+ zIndex: 0,
63
+ },
64
+
65
+ '&[data-state="active"]::before': {
66
+ backgroundColor: "$blue500",
67
+ },
68
+
69
+ '&[data-filled="true"] > span:first-of-type': {
70
+ backgroundColor: "$blue500",
71
+ borderColor: "$blue500",
72
+ color: "white",
73
+ },
74
+
75
+ '&[data-filled="true"]::before': {
76
+ backgroundColor: "$blue500",
77
+ },
78
+ });
79
+
80
+ const StepListStyled = styled(StepRadix.List, {
81
+ display: "flex",
82
+ alignItems: "center",
83
+ justifyContent: "flex-start",
84
+ gap: "$4",
85
+ });
86
+
87
+ export type StepProps = ComponentProps<typeof StepStyled> & {
88
+ children: React.ReactNode;
89
+ defaultValue: number;
90
+ };
91
+ export function Step({ children, defaultValue, ...props }: StepProps) {
92
+ return (
93
+ <StepRadix.Root defaultValue={String(defaultValue)}>
94
+ <StepStyled {...props}>{children}</StepStyled>
95
+ </StepRadix.Root>
96
+ );
97
+ }
98
+
99
+ export function StepTrigger({
100
+ value,
101
+ children,
102
+ currentStep,
103
+ ...props
104
+ }: {
105
+ value: number;
106
+ children: React.ReactNode | string;
107
+ currentStep?: number;
108
+ onClick: () => void;
109
+ }) {
110
+ const isActiveOrPrevious = currentStep !== undefined && value <= currentStep;
111
+ return (
112
+ <StepTriggerStyled
113
+ data-filled={isActiveOrPrevious}
114
+ value={String(value)}
115
+ {...props}
116
+ >
117
+ {children}
118
+ </StepTriggerStyled>
119
+ );
120
+ }
121
+
122
+ export function StepContent({
123
+ value,
124
+ children,
125
+ ...props
126
+ }: {
127
+ value: number;
128
+ children: React.ReactNode;
129
+ }) {
130
+ return (
131
+ <StepRadix.Content value={String(value)} {...props}>
132
+ {children}
133
+ </StepRadix.Content>
134
+ );
135
+ }
136
+
137
+ export function StepList({
138
+ children,
139
+ currentStep,
140
+ ...props
141
+ }: {
142
+ children: React.ReactNode;
143
+ currentStep: number;
144
+ }) {
145
+ return (
146
+ <StepListStyled {...props}>
147
+ {React.Children.map(children, (child) => {
148
+ if (React.isValidElement(child) && child.type === StepTrigger) {
149
+ return React.cloneElement(child, { currentStep } as any);
150
+ }
151
+ return child;
152
+ })}
153
+ </StepListStyled>
154
+ );
155
+ }
156
+
157
+ export function StepWrapper({
158
+ children,
159
+ ...props
160
+ }: {
161
+ children: React.ReactNode;
162
+ }) {
163
+ return <Box {...props}>{children}</Box>;
164
+ }
@@ -1,109 +1,109 @@
1
- import { Switch as RadixSwitch } from '@radix-ui/themes'
2
- import type { ComponentProps } from 'react'
3
- import { styled } from '../styles'
4
-
5
- export const SwitchStyled = styled(RadixSwitch, {
6
- all: 'unset',
7
- borderRadius: '$full',
8
- position: 'relative',
9
- display: 'flex',
10
- alignItems: 'center',
11
- justifyContent: 'center',
12
- transition: 'all 0.3s',
13
- cursor: 'pointer',
14
-
15
- '&::before': {
16
- content: '""',
17
- position: 'absolute',
18
- borderRadius: '$full',
19
- pointerEvents: 'none',
20
- cursor: 'pointer',
21
- },
22
- 'span': {
23
- position: 'absolute',
24
- top: '50%',
25
- left: 0,
26
- transform: 'translate(0, -50%)',
27
- borderRadius: '50%',
28
- transition: 'all 0.3s',
29
- cursor: 'pointer',
30
- borderWidth: '1px',
31
- borderStyle: 'solid',
32
- boxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.24)',
33
- },
34
-
35
- '&[data-state="checked"] span': {
36
- left: 'auto',
37
- transform: 'translate(50%, -50%)',
38
- },
39
-
40
- variants: {
41
- color: {
42
- brand: {
43
- '&::before': {
44
- backgroundColor: '$brand50',
45
- },
46
- 'span': {
47
- backgroundColor: '$dark50',
48
- borderColor: '$neutral300',
49
- },
50
- '&[data-state="checked"] span': {
51
- backgroundColor: '$brand500',
52
- borderColor: '$brand500',
53
- },
54
- }
55
- },
56
- size: {
57
- sm: {
58
- width: '32px',
59
- height: '20px',
60
- '&::before': {
61
- width: '$32',
62
- height: '$12',
63
- },
64
-
65
- 'span': {
66
- width: '$20',
67
- height: '$20',
68
- },
69
- },
70
- md: {
71
- width: '40px',
72
- height: '20px',
73
- '&::before': {
74
- width: '40px',
75
- height: '16px',
76
- },
77
- 'span': {
78
- width: '24px',
79
- height: '24px',
80
- },
81
- },
82
- lg: {
83
- width: '56px',
84
- height: '32px',
85
- '&::before': {
86
- width: '56px',
87
- height: '24px',
88
- },
89
- 'span': {
90
- width: '32px',
91
- height: '32px',
92
- },
93
- },
94
- },
95
- },
96
- defaultVariants: {
97
- size: 'md',
98
- color: 'brand',
99
- },
100
-
101
- })
102
- export type SwitchProps = ComponentProps<typeof RadixSwitch> & {
103
- color?: 'brand'
104
- size?: 'sm' | 'md' | 'lg'
105
- }
106
-
107
- export function Switch(props: SwitchProps) {
108
- return <SwitchStyled color="brand" defaultChecked {...props} />
1
+ import { Switch as RadixSwitch } from '@radix-ui/themes'
2
+ import type { ComponentProps } from 'react'
3
+ import { styled } from '../styles'
4
+
5
+ export const SwitchStyled = styled(RadixSwitch, {
6
+ all: 'unset',
7
+ borderRadius: '$full',
8
+ position: 'relative',
9
+ display: 'flex',
10
+ alignItems: 'center',
11
+ justifyContent: 'center',
12
+ transition: 'all 0.3s',
13
+ cursor: 'pointer',
14
+
15
+ '&::before': {
16
+ content: '""',
17
+ position: 'absolute',
18
+ borderRadius: '$full',
19
+ pointerEvents: 'none',
20
+ cursor: 'pointer',
21
+ },
22
+ 'span': {
23
+ position: 'absolute',
24
+ top: '50%',
25
+ left: 0,
26
+ transform: 'translate(0, -50%)',
27
+ borderRadius: '50%',
28
+ transition: 'all 0.3s',
29
+ cursor: 'pointer',
30
+ borderWidth: '1px',
31
+ borderStyle: 'solid',
32
+ boxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.24)',
33
+ },
34
+
35
+ '&[data-state="checked"] span': {
36
+ left: 'auto',
37
+ transform: 'translate(50%, -50%)',
38
+ },
39
+
40
+ variants: {
41
+ color: {
42
+ brand: {
43
+ '&::before': {
44
+ backgroundColor: '$brand50',
45
+ },
46
+ 'span': {
47
+ backgroundColor: '$dark50',
48
+ borderColor: '$neutral300',
49
+ },
50
+ '&[data-state="checked"] span': {
51
+ backgroundColor: '$brand500',
52
+ borderColor: '$brand500',
53
+ },
54
+ }
55
+ },
56
+ size: {
57
+ sm: {
58
+ width: '32px',
59
+ height: '20px',
60
+ '&::before': {
61
+ width: '$32',
62
+ height: '$12',
63
+ },
64
+
65
+ 'span': {
66
+ width: '$20',
67
+ height: '$20',
68
+ },
69
+ },
70
+ md: {
71
+ width: '40px',
72
+ height: '20px',
73
+ '&::before': {
74
+ width: '40px',
75
+ height: '16px',
76
+ },
77
+ 'span': {
78
+ width: '24px',
79
+ height: '24px',
80
+ },
81
+ },
82
+ lg: {
83
+ width: '56px',
84
+ height: '32px',
85
+ '&::before': {
86
+ width: '56px',
87
+ height: '24px',
88
+ },
89
+ 'span': {
90
+ width: '32px',
91
+ height: '32px',
92
+ },
93
+ },
94
+ },
95
+ },
96
+ defaultVariants: {
97
+ size: 'md',
98
+ color: 'brand',
99
+ },
100
+
101
+ })
102
+ export type SwitchProps = ComponentProps<typeof RadixSwitch> & {
103
+ color?: 'brand'
104
+ size?: 'sm' | 'md' | 'lg'
105
+ }
106
+
107
+ export function Switch(props: SwitchProps) {
108
+ return <SwitchStyled color="brand" defaultChecked {...props} />
109
109
  }
@@ -1,39 +1,38 @@
1
- import { ComponentProps, ElementType } from "react";
2
- import { styled } from "../styles";
3
- import { Text as TextRadix } from "@radix-ui/themes";
4
- import { typographyValues } from "../types/typographyValues";
5
-
6
- import { colors, Colors } from "@lets-events/tokens";
7
-
8
- export const TextStyle = styled(TextRadix, {
9
- fontFamily: "$default",
10
- lineHeight: "$base",
11
- color: "$grey950",
12
- variants: {
13
- typography: typographyValues,
14
- fontWeight: {
15
- regular: { fontWeight: "$regular" },
16
- medium: { fontWeight: "$medium" },
17
- semibold: { fontWeight: "$semibold" },
18
- bold: { fontWeight: "$bold" },
19
- },
20
- },
21
- });
22
-
23
- export type TextProps = Omit<ComponentProps<typeof TextStyle>, "color"> & {
24
- as?: ElementType;
25
- asChild?: boolean;
26
- color?: keyof Colors;
27
- };
28
-
29
- export function Text({ color, ...props }: TextProps) {
30
- return (
31
- <TextStyle
32
- {...props}
33
- css={{
34
- color: color ? "$" + color : "$grey950",
35
- ...props.css,
36
- }}
37
- />
38
- );
39
- }
1
+ import { ComponentProps, ElementType } from "react";
2
+ import { styled } from "../styles";
3
+ import { Text as TextRadix } from "@radix-ui/themes";
4
+ import { typographyValues } from "../types/typographyValues";
5
+
6
+ import { colors, Colors } from "@lets-events/tokens";
7
+
8
+ export const TextStyle = styled(TextRadix, {
9
+ fontFamily: "$default",
10
+ lineHeight: "$base",
11
+ variants: {
12
+ typography: typographyValues,
13
+ fontWeight: {
14
+ regular: { fontWeight: "$regular" },
15
+ medium: { fontWeight: "$medium" },
16
+ semibold: { fontWeight: "$semibold" },
17
+ bold: { fontWeight: "$bold" },
18
+ },
19
+ },
20
+ });
21
+
22
+ export type TextProps = Omit<ComponentProps<typeof TextStyle>, "color"> & {
23
+ as?: ElementType;
24
+ asChild?: boolean;
25
+ color?: keyof Colors;
26
+ };
27
+
28
+ export function Text({ color, ...props }: TextProps) {
29
+ return (
30
+ <TextStyle
31
+ {...props}
32
+ css={{
33
+ color: color ? "$" + color : "$dark600",
34
+ ...props.css,
35
+ }}
36
+ />
37
+ );
38
+ }