@lets-events/react 12.3.9 → 12.3.10

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 (88) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +21 -19
  3. package/CHANGELOG.md +6 -0
  4. package/dist/index.js +2 -1
  5. package/dist/index.mjs +2 -1
  6. package/package.json +1 -1
  7. package/src/components/Alert.tsx +303 -303
  8. package/src/components/Avatar.tsx +55 -55
  9. package/src/components/Badge.tsx +125 -125
  10. package/src/components/Box.tsx +3 -3
  11. package/src/components/Button/index.tsx +45 -45
  12. package/src/components/Button/styledComponents.ts +313 -313
  13. package/src/components/ButtonGroup.tsx +484 -484
  14. package/src/components/Calendar/index.tsx +148 -148
  15. package/src/components/Calendar/styledComponents.ts +250 -250
  16. package/src/components/Card.tsx +67 -67
  17. package/src/components/CheckboxGroup.tsx +176 -176
  18. package/src/components/Container.tsx +39 -39
  19. package/src/components/Divider.tsx +7 -7
  20. package/src/components/Drawer/index.tsx +98 -97
  21. package/src/components/Drawer/styledComponents.ts +103 -103
  22. package/src/components/Dropdown.tsx +302 -302
  23. package/src/components/Filter.tsx +164 -164
  24. package/src/components/Flex.tsx +118 -118
  25. package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
  26. package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
  27. package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
  28. package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
  29. package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
  30. package/src/components/FormFields/BirthDateFormField.tsx +84 -84
  31. package/src/components/FormFields/CNPJFormField.tsx +87 -87
  32. package/src/components/FormFields/CPFFormField.tsx +78 -78
  33. package/src/components/FormFields/CalendarFormField.tsx +95 -95
  34. package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
  35. package/src/components/FormFields/EmailFormField.tsx +27 -27
  36. package/src/components/FormFields/Form.tsx +39 -39
  37. package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +32 -32
  38. package/src/components/FormFields/MultiSelectFormField.tsx +64 -64
  39. package/src/components/FormFields/PhoneFormField.tsx +40 -40
  40. package/src/components/FormFields/RadioGroupFormField.tsx +84 -84
  41. package/src/components/FormFields/RichEditorFormField.tsx +103 -103
  42. package/src/components/FormFields/SelectFormField.tsx +93 -93
  43. package/src/components/FormFields/SwitchFormField.tsx +46 -46
  44. package/src/components/FormFields/TextAreaFormField.tsx +57 -57
  45. package/src/components/FormFields/TextFormField.tsx +112 -112
  46. package/src/components/FormFields/TimePickerFormField.tsx +88 -88
  47. package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
  48. package/src/components/FormFields/subComponents/FormLabel.tsx +29 -29
  49. package/src/components/FormFields/utils/validation.ts +23 -23
  50. package/src/components/Grid.tsx +137 -137
  51. package/src/components/Icon.tsx +47 -47
  52. package/src/components/MenuDropdown/index.tsx +38 -38
  53. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  54. package/src/components/Modal.tsx +110 -110
  55. package/src/components/MultiSelect/index.tsx +243 -243
  56. package/src/components/MultiSelect/styledComponents.ts +160 -160
  57. package/src/components/RadioGroup.tsx +210 -210
  58. package/src/components/RichEditor/QuillComponent.tsx +457 -457
  59. package/src/components/RichEditor/RichEditor.tsx +49 -49
  60. package/src/components/RichEditor/index.ts +2 -2
  61. package/src/components/RichEditor/styledComponents.ts +1151 -1151
  62. package/src/components/Section.tsx +33 -33
  63. package/src/components/Step.tsx +164 -164
  64. package/src/components/Switch.tsx +108 -108
  65. package/src/components/Text.tsx +38 -38
  66. package/src/components/TextField.tsx +372 -372
  67. package/src/components/TextareaField.tsx +127 -127
  68. package/src/components/TimePicker.tsx +328 -328
  69. package/src/components/Toast/components/ToastItem.tsx +41 -41
  70. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  71. package/src/components/Toast/hooks/useToast.ts +12 -12
  72. package/src/components/Toast/index.tsx +5 -5
  73. package/src/components/Toast/styles/index.ts +135 -135
  74. package/src/components/Toast/types/index.ts +46 -46
  75. package/src/components/Tooltip/index.tsx +66 -66
  76. package/src/components/Tooltip/styles.ts +77 -77
  77. package/src/hooks/useCountries.ts +41 -41
  78. package/src/hooks/useImageUpload.ts +139 -139
  79. package/src/hooks/useOnClickOutside.tsx +42 -42
  80. package/src/index.tsx +69 -69
  81. package/src/styles/index.ts +41 -41
  82. package/src/types/typographyValues.ts +178 -178
  83. package/src/utils/getNestedValue.ts +3 -3
  84. package/src/utils/states.ts +29 -29
  85. package/src/utils/uploadService.ts +180 -180
  86. package/tsconfig.json +3 -3
  87. package/tsup.config.ts +38 -38
  88. package/dist/index.css +0 -171
@@ -1,176 +1,176 @@
1
- import { ComponentProps } from "react";
2
- import { styled } from "../styles";
3
- import { CheckboxGroup as CheckboxGroupRadix } from "@radix-ui/themes";
4
- import { typographyLabelValues } from "../types/typographyValues";
5
-
6
- export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
7
- fontFamily: "$default",
8
- svg: {
9
- display: "none",
10
- },
11
- label: {
12
- display: "flex",
13
- alignItems: "center",
14
- gap: "$8",
15
- cursor: "pointer",
16
- "&:focus button, &:hover button": {
17
- transition: "all 300ms ease-out",
18
- boxShadow: "0px 0px 0px 4px rgba(56, 129, 255, 0.50)",
19
- },
20
- },
21
- "label button": {
22
- backgroundColor: "$white",
23
- borderRadius: "2px",
24
- height: "$16",
25
- width: "$16",
26
- position: "relative",
27
- border: "2px solid $dark300",
28
- cursor: "pointer",
29
- },
30
- "label button[data-state=checked]:before": {
31
- backgroundImage:
32
- "url(\"data:image/svg+xml,%3Csvg%20width='16'%20height='16'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M2%200C0.896875%200%200%200.896875%200%202V12C0%2013.1031%200.896875%2014%202%2014H12C13.1031%2014%2014%2013.1031%2014%2012V2C14%200.896875%2013.1031%200%2012%200H2ZM10.5312%205.53125L6.53125%209.53125C6.2375%209.825%205.7625%209.825%205.47188%209.53125L3.47187%207.53125C3.17812%207.2375%203.17812%206.7625%203.47187%206.47188C3.76562%206.18125%204.24062%206.17813%204.53125%206.47188L6%207.94063L9.46875%204.46875C9.7625%204.175%2010.2375%204.175%2010.5281%204.46875C10.8187%204.7625%2010.8219%205.2375%2010.5281%205.52812L10.5312%205.53125Z'%20fill='%23004ED2'/%3E%3C/svg%3E\")",
33
- content: "",
34
- width: "1rem",
35
- height: "1rem",
36
- position: "absolute",
37
- top: "-1px",
38
- right: "-2px",
39
- zIndex: 2,
40
- backgroundRepeat: "no-repeat",
41
- },
42
- variants: {
43
- color: {
44
- success: {
45
- label: {
46
- "&:focus button, &:hover button": {
47
- boxShadow: "0px 0px 0px 4px rgba(38, 167, 67, 0.50)",
48
- },
49
- },
50
- "label button": {
51
- borderColor: "$green500",
52
- backgroundColor: "$dark50",
53
- },
54
- "label button[data-state=checked]:before": {
55
- backgroundImage:
56
- "url(\"data:image/svg+xml,%3Csvg%20width='16'%20height='16'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M2%200C0.896875%200%200%200.896875%200%202V12C0%2013.1031%200.896875%2014%202%2014H12C13.1031%2014%2014%2013.1031%2014%2012V2C14%200.896875%2013.1031%200%2012%200H2ZM10.5312%205.53125L6.53125%209.53125C6.2375%209.825%205.7625%209.825%205.47188%209.53125L3.47187%207.53125C3.17812%207.2375%203.17812%206.7625%203.47187%206.47188C3.76562%206.18125%204.24062%206.17813%204.53125%206.47188L6%207.94063L9.46875%204.46875C9.7625%204.175%2010.2375%204.175%2010.5281%204.46875C10.8187%204.7625%2010.8219%205.2375%2010.5281%205.52812L10.5312%205.53125Z'%20fill='%2326A743'/%3E%3C/svg%3E\")",
57
- },
58
- },
59
- blue: {},
60
- error: {
61
- label: {
62
- "&:focus button, &:hover button": {
63
- boxShadow: "0px 0px 0px 4px rgba(225, 86, 98, 0.50)",
64
- },
65
- },
66
- "label button": {
67
- borderColor: "$error400",
68
- backgroundColor: "$dark50",
69
- },
70
- "label button[data-state=checked]:before": {
71
- backgroundImage:
72
- "url(\"data:image/svg+xml,%3Csvg%20width='16'%20height='16'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M2%200C0.896875%200%200%200.896875%200%202V12C0%2013.1031%200.896875%2014%202%2014H12C13.1031%2014%2014%2013.1031%2014%2012V2C14%200.896875%2013.1031%200%2012%200H2ZM10.5312%205.53125L6.53125%209.53125C6.2375%209.825%205.7625%209.825%205.47188%209.53125L3.47187%207.53125C3.17812%207.2375%203.17812%206.7625%203.47187%206.47188C3.76562%206.18125%204.24062%206.17813%204.53125%206.47188L6%207.94063L9.46875%204.46875C9.7625%204.175%2010.2375%204.175%2010.5281%204.46875C10.8187%204.7625%2010.8219%205.2375%2010.5281%205.52812L10.5312%205.53125Z'%20fill='%23DB3644'/%3E%3C/svg%3E\")",
73
- },
74
- },
75
- },
76
- disabled: {
77
- true: {
78
- label: {
79
- cursor: "not-allowed",
80
- opacity: 0.5,
81
- "&:focus button, &:hover button": {
82
- boxShadow: "none",
83
- },
84
- },
85
- "label button": {
86
- cursor: "not-allowed",
87
- },
88
- },
89
- false: {},
90
- },
91
- typography: typographyLabelValues,
92
- fontWeight: {
93
- regular: { fontWeight: "$regular" },
94
- medium: { fontWeight: "$medium" },
95
- semibold: { fontWeight: "$semibold" },
96
- bold: { fontWeight: "$bold" },
97
- },
98
- },
99
-
100
- compoundVariants: [
101
- {
102
- color: "blue",
103
- disabled: false,
104
- css: {
105
- label: {
106
- "&:focus button, &:hover button": {
107
- boxShadow: "0px 0px 0px 4px rgba(56, 129, 255, 0.50)",
108
- },
109
- },
110
- "label button": {
111
- borderColor: "$dark300",
112
- },
113
- },
114
- },
115
-
116
- {
117
- color: "blue",
118
- disabled: true,
119
- css: {
120
- "label button": {
121
- borderColor: "$brand100",
122
- backgroundColor: "$dark50",
123
- },
124
- },
125
- },
126
-
127
- {
128
- color: "success",
129
- disabled: true,
130
- css: {
131
- "label button": {
132
- borderColor: "$success100",
133
- backgroundColor: "$dark50",
134
- },
135
- },
136
- },
137
-
138
- {
139
- color: "error",
140
- disabled: true,
141
- css: {
142
- "label button": {
143
- borderColor: "$error100",
144
- backgroundColor: "$dark50",
145
- },
146
- },
147
- },
148
- ],
149
- defaultVariants: {
150
- color: "blue",
151
- disabled: false,
152
- },
153
- });
154
-
155
- const StyledItem = styled(CheckboxGroupRadix.Item, {});
156
-
157
- export type CheckboxGroupProps = ComponentProps<typeof CheckboxGroupStyled> & {
158
- placeholder?: string;
159
- children?: React.ReactNode;
160
- color?: string;
161
- disabled?: boolean;
162
- };
163
-
164
- export type CheckboxItemProps = ComponentProps<typeof StyledItem> & {
165
- children?: React.ReactNode;
166
- value: string;
167
- style?: React.CSSProperties;
168
- };
169
-
170
- export function CheckboxGroup({ children, ...props }: CheckboxGroupProps) {
171
- return <CheckboxGroupStyled {...props}>{children}</CheckboxGroupStyled>;
172
- }
173
-
174
- export function CheckboxItem({ children, ...props }: CheckboxItemProps) {
175
- return <StyledItem {...props}>{children}</StyledItem>;
176
- }
1
+ import { ComponentProps } from "react";
2
+ import { styled } from "../styles";
3
+ import { CheckboxGroup as CheckboxGroupRadix } from "@radix-ui/themes";
4
+ import { typographyLabelValues } from "../types/typographyValues";
5
+
6
+ export const CheckboxGroupStyled = styled(CheckboxGroupRadix.Root, {
7
+ fontFamily: "$default",
8
+ svg: {
9
+ display: "none",
10
+ },
11
+ label: {
12
+ display: "flex",
13
+ alignItems: "center",
14
+ gap: "$8",
15
+ cursor: "pointer",
16
+ "&:focus button, &:hover button": {
17
+ transition: "all 300ms ease-out",
18
+ boxShadow: "0px 0px 0px 4px rgba(56, 129, 255, 0.50)",
19
+ },
20
+ },
21
+ "label button": {
22
+ backgroundColor: "$white",
23
+ borderRadius: "2px",
24
+ height: "$16",
25
+ width: "$16",
26
+ position: "relative",
27
+ border: "2px solid $dark300",
28
+ cursor: "pointer",
29
+ },
30
+ "label button[data-state=checked]:before": {
31
+ backgroundImage:
32
+ "url(\"data:image/svg+xml,%3Csvg%20width='16'%20height='16'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M2%200C0.896875%200%200%200.896875%200%202V12C0%2013.1031%200.896875%2014%202%2014H12C13.1031%2014%2014%2013.1031%2014%2012V2C14%200.896875%2013.1031%200%2012%200H2ZM10.5312%205.53125L6.53125%209.53125C6.2375%209.825%205.7625%209.825%205.47188%209.53125L3.47187%207.53125C3.17812%207.2375%203.17812%206.7625%203.47187%206.47188C3.76562%206.18125%204.24062%206.17813%204.53125%206.47188L6%207.94063L9.46875%204.46875C9.7625%204.175%2010.2375%204.175%2010.5281%204.46875C10.8187%204.7625%2010.8219%205.2375%2010.5281%205.52812L10.5312%205.53125Z'%20fill='%23004ED2'/%3E%3C/svg%3E\")",
33
+ content: "",
34
+ width: "1rem",
35
+ height: "1rem",
36
+ position: "absolute",
37
+ top: "-1px",
38
+ right: "-2px",
39
+ zIndex: 2,
40
+ backgroundRepeat: "no-repeat",
41
+ },
42
+ variants: {
43
+ color: {
44
+ success: {
45
+ label: {
46
+ "&:focus button, &:hover button": {
47
+ boxShadow: "0px 0px 0px 4px rgba(38, 167, 67, 0.50)",
48
+ },
49
+ },
50
+ "label button": {
51
+ borderColor: "$green500",
52
+ backgroundColor: "$dark50",
53
+ },
54
+ "label button[data-state=checked]:before": {
55
+ backgroundImage:
56
+ "url(\"data:image/svg+xml,%3Csvg%20width='16'%20height='16'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M2%200C0.896875%200%200%200.896875%200%202V12C0%2013.1031%200.896875%2014%202%2014H12C13.1031%2014%2014%2013.1031%2014%2012V2C14%200.896875%2013.1031%200%2012%200H2ZM10.5312%205.53125L6.53125%209.53125C6.2375%209.825%205.7625%209.825%205.47188%209.53125L3.47187%207.53125C3.17812%207.2375%203.17812%206.7625%203.47187%206.47188C3.76562%206.18125%204.24062%206.17813%204.53125%206.47188L6%207.94063L9.46875%204.46875C9.7625%204.175%2010.2375%204.175%2010.5281%204.46875C10.8187%204.7625%2010.8219%205.2375%2010.5281%205.52812L10.5312%205.53125Z'%20fill='%2326A743'/%3E%3C/svg%3E\")",
57
+ },
58
+ },
59
+ blue: {},
60
+ error: {
61
+ label: {
62
+ "&:focus button, &:hover button": {
63
+ boxShadow: "0px 0px 0px 4px rgba(225, 86, 98, 0.50)",
64
+ },
65
+ },
66
+ "label button": {
67
+ borderColor: "$error400",
68
+ backgroundColor: "$dark50",
69
+ },
70
+ "label button[data-state=checked]:before": {
71
+ backgroundImage:
72
+ "url(\"data:image/svg+xml,%3Csvg%20width='16'%20height='16'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M2%200C0.896875%200%200%200.896875%200%202V12C0%2013.1031%200.896875%2014%202%2014H12C13.1031%2014%2014%2013.1031%2014%2012V2C14%200.896875%2013.1031%200%2012%200H2ZM10.5312%205.53125L6.53125%209.53125C6.2375%209.825%205.7625%209.825%205.47188%209.53125L3.47187%207.53125C3.17812%207.2375%203.17812%206.7625%203.47187%206.47188C3.76562%206.18125%204.24062%206.17813%204.53125%206.47188L6%207.94063L9.46875%204.46875C9.7625%204.175%2010.2375%204.175%2010.5281%204.46875C10.8187%204.7625%2010.8219%205.2375%2010.5281%205.52812L10.5312%205.53125Z'%20fill='%23DB3644'/%3E%3C/svg%3E\")",
73
+ },
74
+ },
75
+ },
76
+ disabled: {
77
+ true: {
78
+ label: {
79
+ cursor: "not-allowed",
80
+ opacity: 0.5,
81
+ "&:focus button, &:hover button": {
82
+ boxShadow: "none",
83
+ },
84
+ },
85
+ "label button": {
86
+ cursor: "not-allowed",
87
+ },
88
+ },
89
+ false: {},
90
+ },
91
+ typography: typographyLabelValues,
92
+ fontWeight: {
93
+ regular: { fontWeight: "$regular" },
94
+ medium: { fontWeight: "$medium" },
95
+ semibold: { fontWeight: "$semibold" },
96
+ bold: { fontWeight: "$bold" },
97
+ },
98
+ },
99
+
100
+ compoundVariants: [
101
+ {
102
+ color: "blue",
103
+ disabled: false,
104
+ css: {
105
+ label: {
106
+ "&:focus button, &:hover button": {
107
+ boxShadow: "0px 0px 0px 4px rgba(56, 129, 255, 0.50)",
108
+ },
109
+ },
110
+ "label button": {
111
+ borderColor: "$dark300",
112
+ },
113
+ },
114
+ },
115
+
116
+ {
117
+ color: "blue",
118
+ disabled: true,
119
+ css: {
120
+ "label button": {
121
+ borderColor: "$brand100",
122
+ backgroundColor: "$dark50",
123
+ },
124
+ },
125
+ },
126
+
127
+ {
128
+ color: "success",
129
+ disabled: true,
130
+ css: {
131
+ "label button": {
132
+ borderColor: "$success100",
133
+ backgroundColor: "$dark50",
134
+ },
135
+ },
136
+ },
137
+
138
+ {
139
+ color: "error",
140
+ disabled: true,
141
+ css: {
142
+ "label button": {
143
+ borderColor: "$error100",
144
+ backgroundColor: "$dark50",
145
+ },
146
+ },
147
+ },
148
+ ],
149
+ defaultVariants: {
150
+ color: "blue",
151
+ disabled: false,
152
+ },
153
+ });
154
+
155
+ const StyledItem = styled(CheckboxGroupRadix.Item, {});
156
+
157
+ export type CheckboxGroupProps = ComponentProps<typeof CheckboxGroupStyled> & {
158
+ placeholder?: string;
159
+ children?: React.ReactNode;
160
+ color?: string;
161
+ disabled?: boolean;
162
+ };
163
+
164
+ export type CheckboxItemProps = ComponentProps<typeof StyledItem> & {
165
+ children?: React.ReactNode;
166
+ value: string;
167
+ style?: React.CSSProperties;
168
+ };
169
+
170
+ export function CheckboxGroup({ children, ...props }: CheckboxGroupProps) {
171
+ return <CheckboxGroupStyled {...props}>{children}</CheckboxGroupStyled>;
172
+ }
173
+
174
+ export function CheckboxItem({ children, ...props }: CheckboxItemProps) {
175
+ return <StyledItem {...props}>{children}</StyledItem>;
176
+ }
@@ -1,40 +1,40 @@
1
- import { ComponentProps, ElementType } from 'react';
2
- import { styled } from '../styles';
3
- import { Container as ContainerRadix } from '@radix-ui/themes';
4
-
5
- export const ContainerStyled = styled(ContainerRadix, {
6
- variants: {
7
- size: {
8
- xs: { maxWidth: '576px' },
9
- sm: { minWidth: '577px', maxWidth: '767px' },
10
- md: { mixWidth: '768px', maxWidth: '991px' },
11
- lg: { mixWidth: '992px', maxWidth: '1199px' },
12
- xl: { mixWidth: '1200px', maxWidth: '1399px' },
13
- xxl: { mixWidth: '1400px' },
14
- responsive: { width: '100%', maxWidth: '100%', minWidth: '100%' }
15
- },
16
- display: {
17
- none: { display: 'none' },
18
- initial: { display: 'initial' },
19
- },
20
- align: {
21
- left: { marginLeft: 0, marginRight: 'auto' },
22
- center: { marginLeft: 'auto', marginRight: 'auto' },
23
- right: { marginLeft: 'auto', marginRight: 0 },
24
- },
25
- },
26
- defaultVariants: {
27
- size: 'md',
28
- align: 'left',
29
- display: 'initial'
30
- },
31
- });
32
-
33
- export type ContainerProps = ComponentProps<typeof ContainerStyled> & {
34
- as?: ElementType;
35
- children: React.ReactNode;
36
- };
37
-
38
- export function Container({ children, ...props }: ContainerProps) {
39
- return <ContainerStyled {...props}>{children}</ContainerStyled>;
1
+ import { ComponentProps, ElementType } from 'react';
2
+ import { styled } from '../styles';
3
+ import { Container as ContainerRadix } from '@radix-ui/themes';
4
+
5
+ export const ContainerStyled = styled(ContainerRadix, {
6
+ variants: {
7
+ size: {
8
+ xs: { maxWidth: '576px' },
9
+ sm: { minWidth: '577px', maxWidth: '767px' },
10
+ md: { mixWidth: '768px', maxWidth: '991px' },
11
+ lg: { mixWidth: '992px', maxWidth: '1199px' },
12
+ xl: { mixWidth: '1200px', maxWidth: '1399px' },
13
+ xxl: { mixWidth: '1400px' },
14
+ responsive: { width: '100%', maxWidth: '100%', minWidth: '100%' }
15
+ },
16
+ display: {
17
+ none: { display: 'none' },
18
+ initial: { display: 'initial' },
19
+ },
20
+ align: {
21
+ left: { marginLeft: 0, marginRight: 'auto' },
22
+ center: { marginLeft: 'auto', marginRight: 'auto' },
23
+ right: { marginLeft: 'auto', marginRight: 0 },
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ size: 'md',
28
+ align: 'left',
29
+ display: 'initial'
30
+ },
31
+ });
32
+
33
+ export type ContainerProps = ComponentProps<typeof ContainerStyled> & {
34
+ as?: ElementType;
35
+ children: React.ReactNode;
36
+ };
37
+
38
+ export function Container({ children, ...props }: ContainerProps) {
39
+ return <ContainerStyled {...props}>{children}</ContainerStyled>;
40
40
  }
@@ -1,7 +1,7 @@
1
- import { styled } from "../styles";
2
-
3
- export const Divider = styled("div", {
4
- backgroundColor: "$dark300",
5
- width: "100%",
6
- height: "1px",
7
- });
1
+ import { styled } from "../styles";
2
+
3
+ export const Divider = styled("div", {
4
+ backgroundColor: "$dark300",
5
+ width: "100%",
6
+ height: "1px",
7
+ });
@@ -1,97 +1,98 @@
1
- import { ComponentProps, ReactNode, useEffect, useRef } from "react";
2
- import { colors, Colors } from "@lets-events/tokens";
3
- import Icon from "../Icon";
4
- import {
5
- DrawerOverlayStyled,
6
- DrawerContainerStyled,
7
- DrawerHeaderDiv,
8
- DrawerHeaderTitle,
9
- DrawerHeaderCloseButton,
10
- GoBackButtonStyled,
11
- DrawerWrapper,
12
- } from "./styledComponents";
13
- import { useOnClickOutside } from "../../hooks/useOnClickOutside";
14
- import { Flex } from "../Flex";
15
-
16
- export type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
17
- isOpen: boolean;
18
- onClose: () => void;
19
- width?: string;
20
- backgroundColor?: keyof Colors;
21
- title: string;
22
- children?: ReactNode;
23
- goBackIcon?: ReactNode;
24
- goBackAction?: () => void;
25
- zIndex?: number;
26
- };
27
-
28
- export function Drawer({
29
- isOpen,
30
- onClose,
31
- width,
32
- backgroundColor,
33
- title,
34
- children,
35
- goBackIcon,
36
- goBackAction,
37
- zIndex = 1000,
38
- }: DrawerProps) {
39
- useEffect(() => {
40
- if (isOpen) {
41
- const scrollbarWidth =
42
- window.innerWidth - document.documentElement.clientWidth;
43
-
44
- document.body.style.overflow = "hidden";
45
- document.body.style.paddingRight = `${scrollbarWidth}px`;
46
- } else {
47
- document.body.style.overflow = "";
48
- document.body.style.paddingRight = "";
49
- }
50
-
51
- return () => {
52
- document.body.style.overflow = "";
53
- document.body.style.paddingRight = "";
54
- };
55
- }, [isOpen]);
56
-
57
- return (
58
- <>
59
- <DrawerOverlayStyled
60
- css={{
61
- zIndex,
62
- }}
63
- onClick={onClose}
64
- open={isOpen}
65
- />
66
- <DrawerWrapper
67
- css={{
68
- zIndex: zIndex + 1,
69
- width: width ?? "34.25rem",
70
- }}
71
- open={isOpen}
72
- >
73
- <DrawerContainerStyled
74
- open={isOpen}
75
- css={{
76
- backgroundColor: colors[backgroundColor ?? "neutral50"],
77
- }}
78
- >
79
- <DrawerHeaderDiv>
80
- <Flex gap={8} align="center">
81
- {goBackIcon && goBackIcon && (
82
- <GoBackButtonStyled type="button" onClick={goBackAction}>
83
- {goBackIcon}
84
- </GoBackButtonStyled>
85
- )}
86
- <DrawerHeaderTitle>{title}</DrawerHeaderTitle>
87
- </Flex>
88
- <DrawerHeaderCloseButton onClick={onClose}>
89
- <Icon size={"xl"} color="$dark600" name="xmark" />
90
- </DrawerHeaderCloseButton>
91
- </DrawerHeaderDiv>
92
- {isOpen ? children : null}
93
- </DrawerContainerStyled>
94
- </DrawerWrapper>
95
- </>
96
- );
97
- }
1
+ import { ComponentProps, ReactNode, useEffect, useRef } from "react";
2
+ import { colors, Colors } from "@lets-events/tokens";
3
+ import Icon from "../Icon";
4
+ import {
5
+ DrawerOverlayStyled,
6
+ DrawerContainerStyled,
7
+ DrawerHeaderDiv,
8
+ DrawerHeaderTitle,
9
+ DrawerHeaderCloseButton,
10
+ GoBackButtonStyled,
11
+ DrawerWrapper,
12
+ } from "./styledComponents";
13
+ import { useOnClickOutside } from "../../hooks/useOnClickOutside";
14
+ import { Flex } from "../Flex";
15
+
16
+ export type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
17
+ isOpen: boolean;
18
+ onClose: () => void;
19
+ width?: string;
20
+ backgroundColor?: keyof Colors;
21
+ title: string;
22
+ children?: ReactNode;
23
+ goBackIcon?: ReactNode;
24
+ goBackAction?: () => void;
25
+ zIndex?: number;
26
+ };
27
+
28
+ export function Drawer({
29
+ isOpen,
30
+ onClose,
31
+ width,
32
+ backgroundColor,
33
+ title,
34
+ children,
35
+ goBackIcon,
36
+ goBackAction,
37
+ zIndex = 1000,
38
+ }: DrawerProps) {
39
+ useEffect(() => {
40
+ if (isOpen) {
41
+ const scrollbarWidth =
42
+ window.innerWidth - document.documentElement.clientWidth;
43
+
44
+ document.body.style.overflow = "hidden";
45
+ document.body.style.paddingRight = `${scrollbarWidth}px`;
46
+ } else {
47
+ document.body.style.overflow = "";
48
+ document.body.style.paddingRight = "";
49
+ }
50
+
51
+ return () => {
52
+ document.body.style.overflow = "";
53
+ document.body.style.paddingRight = "";
54
+ };
55
+ }, [isOpen]);
56
+
57
+ return (
58
+ <>
59
+ <DrawerOverlayStyled
60
+ css={{
61
+ zIndex,
62
+ }}
63
+ onClick={onClose}
64
+ open={isOpen}
65
+ />
66
+ <DrawerWrapper
67
+ css={{
68
+ zIndex: zIndex + 1,
69
+ width: width ?? "34.25rem",
70
+ maxWidth: "100%"
71
+ }}
72
+ open={isOpen}
73
+ >
74
+ <DrawerContainerStyled
75
+ open={isOpen}
76
+ css={{
77
+ backgroundColor: colors[backgroundColor ?? "neutral50"],
78
+ }}
79
+ >
80
+ <DrawerHeaderDiv>
81
+ <Flex gap={8} align="center">
82
+ {goBackIcon && goBackIcon && (
83
+ <GoBackButtonStyled type="button" onClick={goBackAction}>
84
+ {goBackIcon}
85
+ </GoBackButtonStyled>
86
+ )}
87
+ <DrawerHeaderTitle>{title}</DrawerHeaderTitle>
88
+ </Flex>
89
+ <DrawerHeaderCloseButton onClick={onClose}>
90
+ <Icon size={"xl"} color="$dark600" name="xmark" />
91
+ </DrawerHeaderCloseButton>
92
+ </DrawerHeaderDiv>
93
+ {isOpen ? children : null}
94
+ </DrawerContainerStyled>
95
+ </DrawerWrapper>
96
+ </>
97
+ );
98
+ }