blunt-ui 0.3.5 → 1.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/README.md +109 -25
- package/dist/components/Badge/Badge.types.d.ts +4 -4
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/{Badge.stories.d.ts → stories/Badge.stories.d.ts} +1 -1
- package/dist/components/Button/Button.types.d.ts +4 -4
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/{Button.stories.d.ts → stories/Button.stories.d.ts} +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +5 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +11 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/stories/Checkbox.stories.d.ts +11 -0
- package/dist/components/CollapsibleCard/{CollapsibleCard.stories.d.ts → stories/CollapsibleCard.stories.d.ts} +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +2 -0
- package/dist/components/ConfirmDialog/{useConfirm.d.ts → ConfirmDialog.provider.d.ts} +2 -2
- package/dist/components/ConfirmDialog/ConfirmDialog.types.d.ts +14 -2
- package/dist/components/ConfirmDialog/index.d.ts +4 -3
- package/dist/components/ConfirmDialog/{ConfirmDialog.stories.d.ts → stories/ConfirmDialog.stories.d.ts} +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.types.d.ts +14 -6
- package/dist/components/DatePicker/index.d.ts +2 -1
- package/dist/components/DatePicker/{DatePicker.stories.d.ts → stories/DatePicker.stories.d.ts} +2 -1
- package/dist/components/Editable/{Editable.stories.d.ts → stories/Editable.stories.d.ts} +1 -1
- package/dist/components/Field/{Field.stories.d.ts → stories/Field.stories.d.ts} +1 -1
- package/dist/components/Form/{useForm.d.ts → Form.hooks.d.ts} +1 -1
- package/dist/components/Form/Form.types.d.ts +19 -7
- package/dist/components/Form/{FormField.d.ts → FormField/FormField.d.ts} +1 -1
- package/dist/components/Form/FormField/FormField.types.d.ts +8 -0
- package/dist/components/Form/FormField/index.d.ts +2 -0
- package/dist/components/Form/index.d.ts +4 -3
- package/dist/components/Form/{Form.stories.d.ts → stories/Form.stories.d.ts} +1 -1
- package/dist/components/Form/tests/Form.validators.test.d.ts +1 -0
- package/dist/components/Form/validators/Form.validators.d.ts +9 -0
- package/dist/components/Input/Input.types.d.ts +6 -6
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/{Input.stories.d.ts → stories/Input.stories.d.ts} +1 -1
- package/dist/components/Link/Link.types.d.ts +2 -2
- package/dist/components/Link/index.d.ts +2 -1
- package/dist/components/Link/{Link.stories.d.ts → stories/Link.stories.d.ts} +1 -1
- package/dist/components/Link/tests/Link.test.d.ts +0 -0
- package/dist/components/Modal/Modal.types.d.ts +2 -2
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/{Modal.stories.d.ts → stories/Modal.stories.d.ts} +1 -1
- package/dist/components/Modal/tests/Modal.test.d.ts +0 -0
- package/dist/components/Radio/Radio.d.ts +5 -0
- package/dist/components/Radio/Radio.types.d.ts +10 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/stories/Radio.stories.d.ts +10 -0
- package/dist/components/Radio/tests/Radio.test.d.ts +0 -0
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.types.d.ts +15 -6
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/{Select.stories.d.ts → stories/Select.stories.d.ts} +1 -1
- package/dist/components/Select/tests/Select.test.d.ts +0 -0
- package/dist/components/Spinner/Spinner.types.d.ts +4 -4
- package/dist/components/Spinner/index.d.ts +1 -1
- package/dist/components/Spinner/{Spinner.stories.d.ts → stories/Spinner.stories.d.ts} +1 -1
- package/dist/components/Spinner/tests/Spinner.test.d.ts +0 -0
- package/dist/components/Switch/Switch.d.ts +5 -0
- package/dist/components/Switch/Switch.types.d.ts +8 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/stories/Switch.stories.d.ts +9 -0
- package/dist/components/Switch/tests/Switch.test.d.ts +0 -0
- package/dist/components/Table/Table.consts.d.ts +3 -0
- package/dist/components/Table/Table.hooks.d.ts +29 -0
- package/dist/components/Table/Table.types.d.ts +12 -2
- package/dist/components/Table/index.d.ts +2 -3
- package/dist/components/Table/{Table.stories.d.ts → stories/Table.stories.d.ts} +1 -1
- package/dist/components/Table/tests/Table.test.d.ts +0 -0
- package/dist/components/Textarea/Textarea.types.d.ts +4 -4
- package/dist/components/Textarea/index.d.ts +1 -1
- package/dist/components/Textarea/{Textarea.stories.d.ts → stories/Textarea.stories.d.ts} +1 -1
- package/dist/components/Textarea/tests/Textarea.test.d.ts +0 -0
- package/dist/components/Toast/Toast.hooks.d.ts +2 -0
- package/dist/components/Toast/{useToast.d.ts → Toast.provider.d.ts} +2 -2
- package/dist/components/Toast/Toast.types.d.ts +18 -2
- package/dist/components/Toast/index.d.ts +4 -3
- package/dist/components/Toast/{Toast.stories.d.ts → stories/Toast.stories.d.ts} +1 -1
- package/dist/components/Toast/tests/Toast.provider.test.d.ts +0 -0
- package/dist/components/Toast/tests/Toast.test.d.ts +0 -0
- package/dist/index.cjs +495 -186
- package/dist/index.d.ts +19 -13
- package/dist/index.js +1996 -1119
- package/dist/themes/types.d.ts +9 -0
- package/package.json +2 -2
- package/dist/components/ConfirmDialog/useConfirm.types.d.ts +0 -14
- package/dist/components/Form/useForm.types.d.ts +0 -20
- package/dist/components/Table/useTable.d.ts +0 -12
- package/dist/components/Table/useTablePagination.d.ts +0 -16
- package/dist/components/Table/useTableSort.d.ts +0 -13
- package/dist/components/Toast/useToast.types.d.ts +0 -17
- /package/dist/components/{Button/Button.test.d.ts → Badge/tests/Badge.test.d.ts} +0 -0
- /package/dist/components/{CollapsibleCard/CollapsibleCard.test.d.ts → Button/tests/Button.test.d.ts} +0 -0
- /package/dist/components/{ConfirmDialog/ConfirmDialog.test.d.ts → Checkbox/tests/Checkbox.test.d.ts} +0 -0
- /package/dist/components/{ConfirmDialog/useConfirm.test.d.ts → CollapsibleCard/tests/CollapsibleCard.test.d.ts} +0 -0
- /package/dist/components/{DatePicker/DatePicker.test.d.ts → ConfirmDialog/tests/ConfirmDialog.provider.test.d.ts} +0 -0
- /package/dist/components/{Form/Form.test.d.ts → ConfirmDialog/tests/ConfirmDialog.test.d.ts} +0 -0
- /package/dist/components/{Input/Input.test.d.ts → DatePicker/tests/DatePicker.test.d.ts} +0 -0
- /package/dist/components/{Modal/Modal.test.d.ts → Editable/tests/Editable.test.d.ts} +0 -0
- /package/dist/components/{Select/Select.test.d.ts → Field/tests/Field.test.d.ts} +0 -0
- /package/dist/components/Form/{useForm.test.d.ts → tests/Form.hooks.test.d.ts} +0 -0
- /package/dist/components/{Toast/Toast.test.d.ts → Form/tests/Form.test.d.ts} +0 -0
- /package/dist/components/{Toast/useToast.test.d.ts → Input/tests/Input.test.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import i, { css as
|
|
3
|
-
import
|
|
4
|
-
import { createPortal as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as S, Fragment as dr } from "react/jsx-runtime";
|
|
2
|
+
import i, { css as s, keyframes as J, ThemeProvider as ur, createGlobalStyle as pr } from "styled-components";
|
|
3
|
+
import Oo, { useId as Q, useState as T, useContext as To, createContext as Wo, forwardRef as Yo, createElement as zo, useRef as U, useCallback as X, useEffect as B, useMemo as Do } from "react";
|
|
4
|
+
import { createPortal as go } from "react-dom";
|
|
5
|
+
const eo = (o, r, n) => s`
|
|
6
6
|
background: ${r};
|
|
7
7
|
color: ${n};
|
|
8
8
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
9
9
|
box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
|
|
10
|
-
`,
|
|
10
|
+
`, fr = i.span`
|
|
11
11
|
display: inline-flex;
|
|
12
12
|
align-items: center;
|
|
13
|
-
font-weight:
|
|
13
|
+
font-weight: ${({ theme: o }) => o.fontWeights.bold};
|
|
14
14
|
letter-spacing: 0.04em;
|
|
15
15
|
cursor: default;
|
|
16
16
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -20,80 +20,80 @@ const H = (o, r, n) => t`
|
|
|
20
20
|
max-width: 20ch;
|
|
21
21
|
|
|
22
22
|
${({ $size: o, theme: r }) => ({
|
|
23
|
-
sm:
|
|
24
|
-
padding:
|
|
23
|
+
sm: s`
|
|
24
|
+
padding: ${r.spacing[0.5]} ${r.spacing[2]};
|
|
25
25
|
font-size: ${r.fontSizes.xs};
|
|
26
26
|
`,
|
|
27
|
-
md:
|
|
28
|
-
padding:
|
|
27
|
+
md: s`
|
|
28
|
+
padding: ${r.spacing[1]} ${r.spacing[3]};
|
|
29
29
|
font-size: ${r.fontSizes.sm};
|
|
30
30
|
`
|
|
31
31
|
})[o]}
|
|
32
32
|
|
|
33
33
|
${({ $variant: o, theme: r }) => r.brutalism ? {
|
|
34
|
-
primary:
|
|
34
|
+
primary: eo(
|
|
35
35
|
r,
|
|
36
36
|
r.colors.primary[500],
|
|
37
37
|
r.colors.primary.contrast
|
|
38
38
|
),
|
|
39
|
-
neutral:
|
|
39
|
+
neutral: eo(
|
|
40
40
|
r,
|
|
41
41
|
r.colors.neutral[200],
|
|
42
42
|
r.colors.neutral[900]
|
|
43
43
|
),
|
|
44
|
-
success:
|
|
44
|
+
success: eo(
|
|
45
45
|
r,
|
|
46
46
|
r.colors.success[50],
|
|
47
47
|
r.colors.success[500]
|
|
48
48
|
),
|
|
49
|
-
error:
|
|
49
|
+
error: eo(
|
|
50
50
|
r,
|
|
51
51
|
r.colors.error[50],
|
|
52
52
|
r.colors.error[500]
|
|
53
53
|
),
|
|
54
|
-
warning:
|
|
54
|
+
warning: eo(
|
|
55
55
|
r,
|
|
56
56
|
r.colors.warning[50],
|
|
57
57
|
r.colors.warning[500]
|
|
58
58
|
),
|
|
59
|
-
info:
|
|
59
|
+
info: eo(r, r.colors.info[50], r.colors.info[500])
|
|
60
60
|
}[o] : {
|
|
61
|
-
primary:
|
|
61
|
+
primary: s`
|
|
62
62
|
background: ${r.colors.primary[50]};
|
|
63
63
|
color: ${r.colors.primary[500]};
|
|
64
64
|
`,
|
|
65
|
-
neutral:
|
|
65
|
+
neutral: s`
|
|
66
66
|
background: ${r.colors.neutral[200]};
|
|
67
67
|
color: ${r.colors.neutral[600]};
|
|
68
68
|
`,
|
|
69
|
-
success:
|
|
69
|
+
success: s`
|
|
70
70
|
background: ${r.colors.success[50]};
|
|
71
71
|
color: ${r.colors.success[500]};
|
|
72
72
|
`,
|
|
73
|
-
error:
|
|
73
|
+
error: s`
|
|
74
74
|
background: ${r.colors.error[50]};
|
|
75
75
|
color: ${r.colors.error[500]};
|
|
76
76
|
`,
|
|
77
|
-
warning:
|
|
77
|
+
warning: s`
|
|
78
78
|
background: ${r.colors.warning[50]};
|
|
79
79
|
color: ${r.colors.warning[500]};
|
|
80
80
|
`,
|
|
81
|
-
info:
|
|
81
|
+
info: s`
|
|
82
82
|
background: ${r.colors.info[50]};
|
|
83
83
|
color: ${r.colors.info[500]};
|
|
84
84
|
`
|
|
85
85
|
}[o]}
|
|
86
86
|
`;
|
|
87
|
-
function
|
|
87
|
+
function $r({
|
|
88
88
|
variant: o = "primary",
|
|
89
89
|
size: r = "md",
|
|
90
90
|
children: n,
|
|
91
|
-
...
|
|
91
|
+
...t
|
|
92
92
|
}) {
|
|
93
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ e(fr, { $variant: o, $size: r, ...t, children: n });
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
const
|
|
95
|
+
$r.displayName = "Badge";
|
|
96
|
+
const ho = (o, r, n) => s`
|
|
97
97
|
background-color: ${r};
|
|
98
98
|
color: ${n};
|
|
99
99
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
@@ -106,12 +106,12 @@ const oo = (o, r, n) => t`
|
|
|
106
106
|
transform: translate(2px, 2px);
|
|
107
107
|
box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
|
|
108
108
|
}
|
|
109
|
-
`,
|
|
109
|
+
`, gr = i.button`
|
|
110
110
|
display: inline-flex;
|
|
111
111
|
align-items: center;
|
|
112
112
|
justify-content: center;
|
|
113
113
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
114
|
-
font-weight:
|
|
114
|
+
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
115
115
|
cursor: pointer;
|
|
116
116
|
text-decoration: none;
|
|
117
117
|
|
|
@@ -126,23 +126,23 @@ const oo = (o, r, n) => t`
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
${({ $variant: o, theme: r }) => r.brutalism ? {
|
|
129
|
-
primary:
|
|
129
|
+
primary: ho(
|
|
130
130
|
r,
|
|
131
131
|
r.colors.primary[500],
|
|
132
132
|
r.colors.primary.contrast
|
|
133
133
|
),
|
|
134
|
-
secondary:
|
|
134
|
+
secondary: ho(
|
|
135
135
|
r,
|
|
136
136
|
r.colors.neutral[100],
|
|
137
137
|
r.colors.neutral[900]
|
|
138
138
|
),
|
|
139
|
-
outline:
|
|
139
|
+
outline: ho(
|
|
140
140
|
r,
|
|
141
141
|
r.colors.neutral[0],
|
|
142
142
|
r.colors.neutral[900]
|
|
143
143
|
)
|
|
144
144
|
}[o] : {
|
|
145
|
-
primary:
|
|
145
|
+
primary: s`
|
|
146
146
|
background-color: ${r.colors.primary[500]};
|
|
147
147
|
color: ${r.colors.neutral[0]};
|
|
148
148
|
border: none;
|
|
@@ -150,7 +150,7 @@ const oo = (o, r, n) => t`
|
|
|
150
150
|
background-color: ${r.colors.primary[700]};
|
|
151
151
|
}
|
|
152
152
|
`,
|
|
153
|
-
secondary:
|
|
153
|
+
secondary: s`
|
|
154
154
|
background-color: ${r.colors.neutral[200]};
|
|
155
155
|
color: ${r.colors.neutral[600]};
|
|
156
156
|
border: none;
|
|
@@ -158,7 +158,7 @@ const oo = (o, r, n) => t`
|
|
|
158
158
|
background-color: ${r.colors.neutral[300]};
|
|
159
159
|
}
|
|
160
160
|
`,
|
|
161
|
-
outline:
|
|
161
|
+
outline: s`
|
|
162
162
|
background-color: transparent;
|
|
163
163
|
color: ${r.colors.primary[500]};
|
|
164
164
|
border: 2px solid ${r.colors.primary[500]};
|
|
@@ -169,58 +169,58 @@ const oo = (o, r, n) => t`
|
|
|
169
169
|
}[o]}
|
|
170
170
|
|
|
171
171
|
${({ $size: o, theme: r }) => ({
|
|
172
|
-
sm:
|
|
172
|
+
sm: s`
|
|
173
173
|
padding: ${r.spacing[1]} ${r.spacing[3]};
|
|
174
174
|
font-size: ${r.fontSizes.sm};
|
|
175
175
|
`,
|
|
176
|
-
md:
|
|
176
|
+
md: s`
|
|
177
177
|
padding: ${r.spacing[2]} ${r.spacing[4]};
|
|
178
178
|
font-size: ${r.fontSizes.md};
|
|
179
179
|
`,
|
|
180
|
-
lg:
|
|
180
|
+
lg: s`
|
|
181
181
|
padding: ${r.spacing[3]} ${r.spacing[6]};
|
|
182
182
|
font-size: ${r.fontSizes.lg};
|
|
183
183
|
`
|
|
184
184
|
})[o]}
|
|
185
185
|
`;
|
|
186
|
-
function
|
|
186
|
+
function Co({
|
|
187
187
|
ref: o,
|
|
188
188
|
as: r,
|
|
189
189
|
href: n,
|
|
190
|
-
variant:
|
|
191
|
-
size:
|
|
192
|
-
isLoading:
|
|
193
|
-
disabled:
|
|
194
|
-
children:
|
|
195
|
-
...
|
|
190
|
+
variant: t = "primary",
|
|
191
|
+
size: a = "md",
|
|
192
|
+
isLoading: l,
|
|
193
|
+
disabled: d,
|
|
194
|
+
children: p,
|
|
195
|
+
...u
|
|
196
196
|
}) {
|
|
197
|
-
return /* @__PURE__ */
|
|
198
|
-
|
|
197
|
+
return /* @__PURE__ */ e(
|
|
198
|
+
gr,
|
|
199
199
|
{
|
|
200
200
|
ref: o,
|
|
201
201
|
as: r ?? (n ? "a" : "button"),
|
|
202
202
|
href: n,
|
|
203
|
-
$variant:
|
|
204
|
-
$size:
|
|
205
|
-
disabled:
|
|
206
|
-
...
|
|
207
|
-
children:
|
|
203
|
+
$variant: t,
|
|
204
|
+
$size: a,
|
|
205
|
+
disabled: l || d,
|
|
206
|
+
...u,
|
|
207
|
+
children: l ? "Loading..." : p
|
|
208
208
|
}
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
const
|
|
211
|
+
Co.displayName = "Button";
|
|
212
|
+
const br = i.div`
|
|
213
213
|
display: flex;
|
|
214
214
|
flex-direction: column;
|
|
215
215
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
216
216
|
width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
|
|
217
|
-
`,
|
|
217
|
+
`, xr = i.label`
|
|
218
218
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
219
|
-
font-weight: ${({ theme: o }) => o.brutalism ?
|
|
220
|
-
`,
|
|
219
|
+
font-weight: ${({ theme: o }) => o.brutalism ? o.fontWeights.bold : o.fontWeights.medium};
|
|
220
|
+
`, yr = i.span`
|
|
221
221
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
222
222
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
223
|
-
`,
|
|
223
|
+
`, hr = i.div`
|
|
224
224
|
display: flex;
|
|
225
225
|
align-items: center;
|
|
226
226
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -229,39 +229,39 @@ const Ao = i.div`
|
|
|
229
229
|
box-shadow 0.2s;
|
|
230
230
|
|
|
231
231
|
${({ $size: o = "md", theme: r }) => ({
|
|
232
|
-
sm:
|
|
232
|
+
sm: s`
|
|
233
233
|
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
234
234
|
font-size: ${r.fontSizes.sm};
|
|
235
235
|
`,
|
|
236
|
-
md:
|
|
236
|
+
md: s`
|
|
237
237
|
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
238
238
|
font-size: ${r.fontSizes.md};
|
|
239
239
|
`,
|
|
240
|
-
lg:
|
|
240
|
+
lg: s`
|
|
241
241
|
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
242
242
|
font-size: ${r.fontSizes.lg};
|
|
243
243
|
`
|
|
244
244
|
})[o]}
|
|
245
245
|
|
|
246
|
-
${({ $variant: o = "default", theme: r }) => r.brutalism ?
|
|
246
|
+
${({ $variant: o = "default", theme: r }) => r.brutalism ? s`
|
|
247
247
|
border: ${r.brutalism.borderWidth} solid
|
|
248
248
|
${r.colors.neutral[900]};
|
|
249
249
|
background-color: ${r.colors.neutral[0]};
|
|
250
250
|
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
251
251
|
` : {
|
|
252
|
-
default:
|
|
252
|
+
default: s`
|
|
253
253
|
border: 1px solid ${r.colors.neutral[400]};
|
|
254
254
|
background-color: ${r.colors.neutral[0]};
|
|
255
255
|
`,
|
|
256
|
-
outlined:
|
|
256
|
+
outlined: s`
|
|
257
257
|
border: 2px solid ${r.colors.primary[500]};
|
|
258
258
|
background-color: ${r.colors.neutral[0]};
|
|
259
259
|
`
|
|
260
260
|
}[o]}
|
|
261
261
|
|
|
262
|
-
${({ $error: o, theme: r }) => o &&
|
|
262
|
+
${({ $error: o, theme: r }) => o && s`
|
|
263
263
|
border-color: ${r.colors.error[500]};
|
|
264
|
-
${r.brutalism &&
|
|
264
|
+
${r.brutalism && s`
|
|
265
265
|
box-shadow: 3px 3px 0 ${r.colors.error[500]};
|
|
266
266
|
`}
|
|
267
267
|
`}
|
|
@@ -269,7 +269,7 @@ const Ao = i.div`
|
|
|
269
269
|
&:focus-within {
|
|
270
270
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
271
271
|
}
|
|
272
|
-
`,
|
|
272
|
+
`, wr = i.input`
|
|
273
273
|
flex: 1;
|
|
274
274
|
border: none;
|
|
275
275
|
outline: none;
|
|
@@ -280,11 +280,11 @@ const Ao = i.div`
|
|
|
280
280
|
cursor: not-allowed;
|
|
281
281
|
opacity: 0.6;
|
|
282
282
|
}
|
|
283
|
-
`,
|
|
283
|
+
`, Lo = i.div`
|
|
284
284
|
display: inline-flex;
|
|
285
285
|
align-items: center;
|
|
286
286
|
margin: 0 ${({ theme: o }) => o.spacing[1]};
|
|
287
|
-
`,
|
|
287
|
+
`, mr = i.button`
|
|
288
288
|
display: inline-flex;
|
|
289
289
|
align-items: center;
|
|
290
290
|
margin: 0 ${({ theme: o }) => o.spacing[1]};
|
|
@@ -298,74 +298,74 @@ const Ao = i.div`
|
|
|
298
298
|
opacity: 0.8;
|
|
299
299
|
}
|
|
300
300
|
`;
|
|
301
|
-
function
|
|
301
|
+
function vr({
|
|
302
302
|
ref: o,
|
|
303
303
|
type: r = "text",
|
|
304
304
|
size: n = "md",
|
|
305
|
-
variant:
|
|
306
|
-
label:
|
|
307
|
-
helperText:
|
|
308
|
-
error:
|
|
309
|
-
leftElement:
|
|
310
|
-
rightElement:
|
|
311
|
-
clearable:
|
|
312
|
-
onClear:
|
|
305
|
+
variant: t = "default",
|
|
306
|
+
label: a,
|
|
307
|
+
helperText: l,
|
|
308
|
+
error: d,
|
|
309
|
+
leftElement: p,
|
|
310
|
+
rightElement: u,
|
|
311
|
+
clearable: f,
|
|
312
|
+
onClear: $,
|
|
313
313
|
fullWidth: h,
|
|
314
|
-
id:
|
|
315
|
-
value:
|
|
316
|
-
defaultValue:
|
|
317
|
-
onChange:
|
|
318
|
-
...
|
|
314
|
+
id: w,
|
|
315
|
+
value: y,
|
|
316
|
+
defaultValue: v,
|
|
317
|
+
onChange: z,
|
|
318
|
+
...O
|
|
319
319
|
}) {
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
},
|
|
323
|
-
|
|
320
|
+
const R = Q(), L = w ?? R, g = `${L}-hint`, [C, m] = T(v ?? ""), x = y !== void 0, I = x ? y : C, D = typeof d == "string" ? d : void 0, W = !!(l || d), M = (_) => {
|
|
321
|
+
x || m(_.target.value), z?.(_);
|
|
322
|
+
}, A = () => {
|
|
323
|
+
x || m(""), $?.();
|
|
324
324
|
};
|
|
325
|
-
return /* @__PURE__ */
|
|
326
|
-
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
|
|
325
|
+
return /* @__PURE__ */ S(br, { $fullWidth: h, children: [
|
|
326
|
+
a && /* @__PURE__ */ e(xr, { htmlFor: L, children: a }),
|
|
327
|
+
/* @__PURE__ */ S(hr, { $size: n, $variant: t, $error: !!d, children: [
|
|
328
|
+
p && /* @__PURE__ */ e(Lo, { children: p }),
|
|
329
|
+
/* @__PURE__ */ e(
|
|
330
|
+
wr,
|
|
331
331
|
{
|
|
332
|
-
id:
|
|
332
|
+
id: L,
|
|
333
333
|
ref: o,
|
|
334
334
|
type: r,
|
|
335
335
|
value: I,
|
|
336
|
-
onChange:
|
|
337
|
-
...
|
|
338
|
-
"aria-invalid": !!
|
|
339
|
-
"aria-describedby":
|
|
336
|
+
onChange: M,
|
|
337
|
+
...O,
|
|
338
|
+
"aria-invalid": !!d,
|
|
339
|
+
"aria-describedby": W ? g : void 0
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
f && I && /* @__PURE__ */ e(
|
|
343
|
+
mr,
|
|
344
344
|
{
|
|
345
345
|
type: "button",
|
|
346
|
-
onClick:
|
|
346
|
+
onClick: A,
|
|
347
347
|
"aria-label": "Clear input",
|
|
348
348
|
children: "✕"
|
|
349
349
|
}
|
|
350
350
|
),
|
|
351
|
-
|
|
351
|
+
u && /* @__PURE__ */ e(Lo, { children: u })
|
|
352
352
|
] }),
|
|
353
|
-
|
|
353
|
+
W && /* @__PURE__ */ e(yr, { id: g, $error: !!d, children: D ?? l })
|
|
354
354
|
] });
|
|
355
355
|
}
|
|
356
|
-
|
|
357
|
-
const
|
|
356
|
+
vr.displayName = "Input";
|
|
357
|
+
const kr = i.div`
|
|
358
358
|
display: flex;
|
|
359
359
|
flex-direction: column;
|
|
360
360
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
361
361
|
width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
|
|
362
|
-
`,
|
|
362
|
+
`, Sr = i.label`
|
|
363
363
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
364
|
-
font-weight: ${({ theme: o }) => o.brutalism ?
|
|
365
|
-
`,
|
|
364
|
+
font-weight: ${({ theme: o }) => o.brutalism ? o.fontWeights.bold : o.fontWeights.medium};
|
|
365
|
+
`, zr = i.span`
|
|
366
366
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
367
367
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
368
|
-
`,
|
|
368
|
+
`, Cr = i.div`
|
|
369
369
|
display: flex;
|
|
370
370
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
371
371
|
transition:
|
|
@@ -373,39 +373,39 @@ const Go = i.div`
|
|
|
373
373
|
box-shadow 0.2s;
|
|
374
374
|
|
|
375
375
|
${({ $size: o = "md", theme: r }) => ({
|
|
376
|
-
sm:
|
|
376
|
+
sm: s`
|
|
377
377
|
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
378
378
|
font-size: ${r.fontSizes.sm};
|
|
379
379
|
`,
|
|
380
|
-
md:
|
|
380
|
+
md: s`
|
|
381
381
|
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
382
382
|
font-size: ${r.fontSizes.md};
|
|
383
383
|
`,
|
|
384
|
-
lg:
|
|
384
|
+
lg: s`
|
|
385
385
|
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
386
386
|
font-size: ${r.fontSizes.lg};
|
|
387
387
|
`
|
|
388
388
|
})[o]}
|
|
389
389
|
|
|
390
|
-
${({ $variant: o = "default", theme: r }) => r.brutalism ?
|
|
390
|
+
${({ $variant: o = "default", theme: r }) => r.brutalism ? s`
|
|
391
391
|
border: ${r.brutalism.borderWidth} solid
|
|
392
392
|
${r.colors.neutral[900]};
|
|
393
393
|
background-color: ${r.colors.neutral[0]};
|
|
394
394
|
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
395
395
|
` : {
|
|
396
|
-
default:
|
|
396
|
+
default: s`
|
|
397
397
|
border: 1px solid ${r.colors.neutral[400]};
|
|
398
398
|
background-color: ${r.colors.neutral[0]};
|
|
399
399
|
`,
|
|
400
|
-
outlined:
|
|
400
|
+
outlined: s`
|
|
401
401
|
border: 2px solid ${r.colors.primary[500]};
|
|
402
402
|
background-color: ${r.colors.neutral[0]};
|
|
403
403
|
`
|
|
404
404
|
}[o]}
|
|
405
405
|
|
|
406
|
-
${({ $error: o, theme: r }) => o &&
|
|
406
|
+
${({ $error: o, theme: r }) => o && s`
|
|
407
407
|
border-color: ${r.colors.error[500]};
|
|
408
|
-
${r.brutalism &&
|
|
408
|
+
${r.brutalism && s`
|
|
409
409
|
box-shadow: 3px 3px 0 ${r.colors.error[500]};
|
|
410
410
|
`}
|
|
411
411
|
`}
|
|
@@ -413,7 +413,7 @@ const Go = i.div`
|
|
|
413
413
|
&:focus-within {
|
|
414
414
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
415
415
|
}
|
|
416
|
-
`,
|
|
416
|
+
`, Ir = i.textarea`
|
|
417
417
|
flex: 1;
|
|
418
418
|
border: none;
|
|
419
419
|
outline: none;
|
|
@@ -427,52 +427,52 @@ const Go = i.div`
|
|
|
427
427
|
opacity: 0.6;
|
|
428
428
|
}
|
|
429
429
|
`;
|
|
430
|
-
function
|
|
430
|
+
function Tr({
|
|
431
431
|
ref: o,
|
|
432
432
|
size: r = "md",
|
|
433
433
|
variant: n = "default",
|
|
434
|
-
label:
|
|
435
|
-
helperText:
|
|
436
|
-
error:
|
|
437
|
-
fullWidth:
|
|
438
|
-
id:
|
|
439
|
-
value:
|
|
440
|
-
defaultValue:
|
|
441
|
-
onChange:
|
|
434
|
+
label: t,
|
|
435
|
+
helperText: a,
|
|
436
|
+
error: l,
|
|
437
|
+
fullWidth: d,
|
|
438
|
+
id: p,
|
|
439
|
+
value: u,
|
|
440
|
+
defaultValue: f,
|
|
441
|
+
onChange: $,
|
|
442
442
|
...h
|
|
443
443
|
}) {
|
|
444
|
-
const
|
|
445
|
-
return /* @__PURE__ */
|
|
446
|
-
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
|
|
444
|
+
const w = Q(), y = p ?? w, v = `${y}-hint`, [z, O] = T(f ?? ""), R = u !== void 0, L = R ? u : z, g = typeof l == "string" ? l : void 0, C = !!(a || l);
|
|
445
|
+
return /* @__PURE__ */ S(kr, { $fullWidth: d, children: [
|
|
446
|
+
t && /* @__PURE__ */ e(Sr, { htmlFor: y, children: t }),
|
|
447
|
+
/* @__PURE__ */ e(Cr, { $size: r, $variant: n, $error: !!l, children: /* @__PURE__ */ e(
|
|
448
|
+
Ir,
|
|
449
449
|
{
|
|
450
|
-
id:
|
|
450
|
+
id: y,
|
|
451
451
|
ref: o,
|
|
452
|
-
value:
|
|
453
|
-
onChange: (
|
|
454
|
-
|
|
452
|
+
value: L,
|
|
453
|
+
onChange: (x) => {
|
|
454
|
+
R || O(x.target.value), $?.(x);
|
|
455
455
|
},
|
|
456
456
|
...h,
|
|
457
|
-
"aria-invalid": !!
|
|
458
|
-
"aria-describedby":
|
|
457
|
+
"aria-invalid": !!l,
|
|
458
|
+
"aria-describedby": C ? v : void 0
|
|
459
459
|
}
|
|
460
460
|
) }),
|
|
461
|
-
|
|
461
|
+
C && /* @__PURE__ */ e(zr, { id: v, $error: !!l, children: g ?? a })
|
|
462
462
|
] });
|
|
463
463
|
}
|
|
464
|
-
|
|
465
|
-
const
|
|
466
|
-
const
|
|
467
|
-
const
|
|
464
|
+
Tr.displayName = "Textarea";
|
|
465
|
+
const Uo = (...o) => o.filter((r, n, t) => !!r && r.trim() !== "" && t.indexOf(r) === n).join(" ").trim();
|
|
466
|
+
const Wr = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
467
|
+
const Dr = (o) => o.replace(
|
|
468
468
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
469
|
-
(r, n,
|
|
469
|
+
(r, n, t) => t ? t.toUpperCase() : n.toLowerCase()
|
|
470
470
|
);
|
|
471
|
-
const
|
|
472
|
-
const r =
|
|
471
|
+
const No = (o) => {
|
|
472
|
+
const r = Dr(o);
|
|
473
473
|
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
474
474
|
};
|
|
475
|
-
var
|
|
475
|
+
var wo = {
|
|
476
476
|
xmlns: "http://www.w3.org/2000/svg",
|
|
477
477
|
width: 24,
|
|
478
478
|
height: 24,
|
|
@@ -483,157 +483,246 @@ var ro = {
|
|
|
483
483
|
strokeLinecap: "round",
|
|
484
484
|
strokeLinejoin: "round"
|
|
485
485
|
};
|
|
486
|
-
const
|
|
486
|
+
const Er = (o) => {
|
|
487
487
|
for (const r in o)
|
|
488
488
|
if (r.startsWith("aria-") || r === "role" || r === "title")
|
|
489
489
|
return !0;
|
|
490
490
|
return !1;
|
|
491
|
-
},
|
|
492
|
-
({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth:
|
|
491
|
+
}, Mr = Wo({}), Or = () => To(Mr), Lr = Yo(
|
|
492
|
+
({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth: t, className: a = "", children: l, iconNode: d, ...p }, u) => {
|
|
493
493
|
const {
|
|
494
|
-
size:
|
|
495
|
-
strokeWidth:
|
|
494
|
+
size: f = 24,
|
|
495
|
+
strokeWidth: $ = 2,
|
|
496
496
|
absoluteStrokeWidth: h = !1,
|
|
497
|
-
color:
|
|
498
|
-
className:
|
|
499
|
-
} =
|
|
500
|
-
return
|
|
497
|
+
color: w = "currentColor",
|
|
498
|
+
className: y = ""
|
|
499
|
+
} = Or() ?? {}, v = t ?? h ? Number(n ?? $) * 24 / Number(r ?? f) : n ?? $;
|
|
500
|
+
return zo(
|
|
501
501
|
"svg",
|
|
502
502
|
{
|
|
503
|
-
ref:
|
|
504
|
-
...
|
|
505
|
-
width: r ??
|
|
506
|
-
height: r ??
|
|
507
|
-
stroke: o ??
|
|
508
|
-
strokeWidth:
|
|
509
|
-
className:
|
|
510
|
-
...!
|
|
511
|
-
...
|
|
503
|
+
ref: u,
|
|
504
|
+
...wo,
|
|
505
|
+
width: r ?? f ?? wo.width,
|
|
506
|
+
height: r ?? f ?? wo.height,
|
|
507
|
+
stroke: o ?? w,
|
|
508
|
+
strokeWidth: v,
|
|
509
|
+
className: Uo("lucide", y, a),
|
|
510
|
+
...!l && !Er(p) && { "aria-hidden": "true" },
|
|
511
|
+
...p
|
|
512
512
|
},
|
|
513
513
|
[
|
|
514
|
-
...
|
|
515
|
-
...Array.isArray(
|
|
514
|
+
...d.map(([z, O]) => zo(z, O)),
|
|
515
|
+
...Array.isArray(l) ? l : [l]
|
|
516
516
|
]
|
|
517
517
|
);
|
|
518
518
|
}
|
|
519
519
|
);
|
|
520
|
-
const
|
|
521
|
-
const n =
|
|
522
|
-
({ className:
|
|
523
|
-
ref:
|
|
520
|
+
const Z = (o, r) => {
|
|
521
|
+
const n = Yo(
|
|
522
|
+
({ className: t, ...a }, l) => zo(Lr, {
|
|
523
|
+
ref: l,
|
|
524
524
|
iconNode: r,
|
|
525
|
-
className:
|
|
526
|
-
`lucide-${
|
|
525
|
+
className: Uo(
|
|
526
|
+
`lucide-${Wr(No(o))}`,
|
|
527
527
|
`lucide-${o}`,
|
|
528
|
-
|
|
528
|
+
t
|
|
529
529
|
),
|
|
530
|
-
...
|
|
530
|
+
...a
|
|
531
531
|
})
|
|
532
532
|
);
|
|
533
|
-
return n.displayName =
|
|
533
|
+
return n.displayName = No(o), n;
|
|
534
534
|
};
|
|
535
|
-
const
|
|
535
|
+
const Nr = [
|
|
536
536
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
537
537
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
538
|
-
],
|
|
539
|
-
const
|
|
538
|
+
], Pr = Z("arrow-down", Nr);
|
|
539
|
+
const Rr = [
|
|
540
540
|
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
541
541
|
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
542
542
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
543
543
|
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
544
|
-
],
|
|
545
|
-
const
|
|
544
|
+
], Vr = Z("arrow-up-down", Rr);
|
|
545
|
+
const Fr = [
|
|
546
546
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
547
547
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
548
|
-
],
|
|
549
|
-
const
|
|
548
|
+
], Ar = Z("arrow-up", Fr);
|
|
549
|
+
const Br = [
|
|
550
550
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
551
551
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
552
552
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
553
553
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
554
|
-
],
|
|
555
|
-
const
|
|
556
|
-
const
|
|
557
|
-
const
|
|
558
|
-
const
|
|
554
|
+
], _r = Z("calendar", Br);
|
|
555
|
+
const jr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Ko = Z("chevron-down", jr);
|
|
556
|
+
const Hr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Yr = Z("chevron-left", Hr);
|
|
557
|
+
const Ur = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Kr = Z("chevron-right", Ur);
|
|
558
|
+
const qr = [
|
|
559
559
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
560
560
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
561
|
-
],
|
|
561
|
+
], bo = Z("x", qr), Gr = i.div`
|
|
562
562
|
display: inline-flex;
|
|
563
563
|
flex-direction: column;
|
|
564
564
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
565
565
|
width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
|
|
566
|
-
`, vr = i.div`
|
|
567
566
|
position: relative;
|
|
567
|
+
min-width: 0;
|
|
568
|
+
`, Xr = i.div`
|
|
569
|
+
height: 0;
|
|
570
|
+
overflow: hidden;
|
|
571
|
+
visibility: hidden;
|
|
572
|
+
pointer-events: none;
|
|
568
573
|
display: flex;
|
|
569
|
-
|
|
570
|
-
`,
|
|
571
|
-
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
572
|
-
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
573
|
-
`, Cr = i.select`
|
|
574
|
+
flex-direction: column;
|
|
575
|
+
`, Jr = i.button`
|
|
574
576
|
appearance: none;
|
|
575
577
|
width: 100%;
|
|
576
578
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
577
|
-
cursor: pointer;
|
|
579
|
+
cursor: ${({ $disabled: o }) => o ? "not-allowed" : "pointer"};
|
|
578
580
|
font: inherit;
|
|
579
581
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
582
|
+
display: flex;
|
|
583
|
+
align-items: center;
|
|
584
|
+
gap: ${({ theme: o }) => o.spacing[2]};
|
|
585
|
+
text-align: left;
|
|
586
|
+
background: none;
|
|
580
587
|
transition:
|
|
581
588
|
border-color 0.2s,
|
|
582
589
|
box-shadow 0.2s;
|
|
583
590
|
|
|
584
591
|
${({ $size: o, theme: r }) => ({
|
|
585
|
-
sm:
|
|
592
|
+
sm: s`
|
|
586
593
|
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
587
594
|
font-size: ${r.fontSizes.sm};
|
|
588
595
|
`,
|
|
589
|
-
md:
|
|
596
|
+
md: s`
|
|
590
597
|
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
591
598
|
font-size: ${r.fontSizes.md};
|
|
592
599
|
`,
|
|
593
|
-
lg:
|
|
600
|
+
lg: s`
|
|
594
601
|
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
595
602
|
font-size: ${r.fontSizes.lg};
|
|
596
603
|
`
|
|
597
604
|
})[o]}
|
|
598
605
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
${({ $variant: o, theme: r }) => r.brutalism ? t`
|
|
606
|
+
${({ $variant: o, theme: r }) => r.brutalism ? s`
|
|
602
607
|
border: ${r.brutalism.borderWidth} solid
|
|
603
608
|
${r.colors.neutral[900]};
|
|
604
609
|
background-color: ${r.colors.neutral[0]};
|
|
605
610
|
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
606
611
|
` : {
|
|
607
|
-
default:
|
|
612
|
+
default: s`
|
|
608
613
|
border: 1px solid ${r.colors.neutral[400]};
|
|
609
614
|
background-color: ${r.colors.neutral[0]};
|
|
610
615
|
`,
|
|
611
|
-
outlined:
|
|
616
|
+
outlined: s`
|
|
612
617
|
border: 2px solid ${r.colors.primary[500]};
|
|
613
618
|
background-color: ${r.colors.neutral[0]};
|
|
614
619
|
`
|
|
615
620
|
}[o]}
|
|
616
621
|
|
|
617
|
-
${({ $error: o, theme: r }) => o &&
|
|
622
|
+
${({ $error: o, theme: r }) => o && s`
|
|
618
623
|
border-color: ${r.colors.error[500]};
|
|
619
624
|
`}
|
|
620
625
|
|
|
621
|
-
|
|
626
|
+
${({ $disabled: o }) => o && s`
|
|
627
|
+
opacity: 0.6;
|
|
628
|
+
`}
|
|
629
|
+
|
|
630
|
+
&:focus-visible {
|
|
622
631
|
outline: none;
|
|
623
632
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
624
633
|
}
|
|
634
|
+
`, mo = i.span`
|
|
635
|
+
flex: 1;
|
|
636
|
+
overflow: hidden;
|
|
637
|
+
white-space: nowrap;
|
|
638
|
+
text-overflow: ellipsis;
|
|
639
|
+
color: ${({ $placeholder: o, theme: r }) => o ? r.colors.neutral[400] : r.colors.neutral[900]};
|
|
640
|
+
`, Qr = i.span`
|
|
641
|
+
display: flex;
|
|
642
|
+
align-items: center;
|
|
643
|
+
gap: ${({ theme: o }) => o.spacing[1]};
|
|
644
|
+
flex-shrink: 0;
|
|
645
|
+
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
646
|
+
`, Zr = i.span`
|
|
647
|
+
display: inline-flex;
|
|
648
|
+
align-items: center;
|
|
649
|
+
transition: transform 0.15s;
|
|
650
|
+
transform: ${({ $open: o }) => o ? "rotate(180deg)" : "rotate(0deg)"};
|
|
651
|
+
`, on = i.ul`
|
|
652
|
+
z-index: ${({ theme: o }) => o.zIndex.modal};
|
|
653
|
+
margin: 0;
|
|
654
|
+
padding: ${({ theme: o }) => o.spacing[1]} 0;
|
|
655
|
+
list-style: none;
|
|
656
|
+
background-color: ${({ theme: o }) => o.colors.neutral[0]};
|
|
657
|
+
border-radius: ${({ theme: o }) => o.radius.md};
|
|
658
|
+
max-height: 240px;
|
|
659
|
+
overflow-y: auto;
|
|
625
660
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
661
|
+
${({ theme: o }) => o.brutalism ? s`
|
|
662
|
+
border: ${o.brutalism.borderWidth} solid
|
|
663
|
+
${o.colors.neutral[900]};
|
|
664
|
+
box-shadow: ${o.brutalism.shadowOffset}
|
|
665
|
+
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
666
|
+
` : s`
|
|
667
|
+
border: 1px solid ${o.colors.neutral[300]};
|
|
668
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
669
|
+
`}
|
|
670
|
+
`, rn = i.div`
|
|
671
|
+
padding: ${({ theme: o }) => o.spacing[2]};
|
|
672
|
+
border-bottom: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
673
|
+
`, nn = i.input`
|
|
674
|
+
width: 100%;
|
|
675
|
+
border: 1px solid ${({ theme: o }) => o.colors.neutral[300]};
|
|
676
|
+
border-radius: ${({ theme: o }) => o.radius.md};
|
|
677
|
+
padding: ${({ theme: o }) => `${o.spacing[1]} ${o.spacing[2]}`};
|
|
678
|
+
font: inherit;
|
|
679
|
+
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
680
|
+
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
681
|
+
background: ${({ theme: o }) => o.colors.neutral[0]};
|
|
682
|
+
outline: none;
|
|
683
|
+
|
|
684
|
+
&:focus {
|
|
685
|
+
border-color: ${({ theme: o }) => o.colors.primary[500]};
|
|
686
|
+
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
629
687
|
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
688
|
+
|
|
689
|
+
${({ theme: o }) => o.brutalism && s`
|
|
690
|
+
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
691
|
+
&:focus {
|
|
692
|
+
box-shadow: ${o.shadows.focusRing};
|
|
693
|
+
}
|
|
694
|
+
`}
|
|
695
|
+
`, tn = i.li`
|
|
696
|
+
padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
|
|
697
|
+
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
698
|
+
color: ${({ theme: o }) => o.colors.neutral[400]};
|
|
699
|
+
list-style: none;
|
|
700
|
+
`, sn = i.li`
|
|
635
701
|
display: flex;
|
|
636
702
|
align-items: center;
|
|
703
|
+
padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
|
|
704
|
+
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
705
|
+
cursor: ${({ $disabled: o }) => o ? "not-allowed" : "pointer"};
|
|
706
|
+
color: ${({ $disabled: o, theme: r }) => o ? r.colors.neutral[400] : r.colors.neutral[900]};
|
|
707
|
+
|
|
708
|
+
background-color: ${({ $selected: o, $focused: r, theme: n }) => o ? n.colors.primary[50] : r ? n.colors.neutral[100] : "transparent"};
|
|
709
|
+
|
|
710
|
+
font-weight: ${({ $selected: o, theme: r }) => o ? r.fontWeights.semibold : r.fontWeights.normal};
|
|
711
|
+
|
|
712
|
+
${({ $selected: o, theme: r }) => o && s`
|
|
713
|
+
border-left: ${r.spacing[1]} solid ${r.colors.primary[500]};
|
|
714
|
+
padding-left: ${r.spacing[2]};
|
|
715
|
+
`}
|
|
716
|
+
|
|
717
|
+
&:hover {
|
|
718
|
+
background-color: ${({ $disabled: o, $selected: r, theme: n }) => o ? "transparent" : r ? n.colors.primary[50] : n.colors.neutral[100]};
|
|
719
|
+
}
|
|
720
|
+
`, en = i.span`
|
|
721
|
+
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
722
|
+
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
723
|
+
`, an = i.button`
|
|
724
|
+
display: inline-flex;
|
|
725
|
+
align-items: center;
|
|
637
726
|
padding: 0;
|
|
638
727
|
background: none;
|
|
639
728
|
border: none;
|
|
@@ -649,102 +738,288 @@ const wr = [
|
|
|
649
738
|
outline-offset: 2px;
|
|
650
739
|
border-radius: 2px;
|
|
651
740
|
}
|
|
652
|
-
`, zr = i.span`
|
|
653
|
-
position: absolute;
|
|
654
|
-
right: ${({ theme: o }) => o.spacing[3]};
|
|
655
|
-
top: 50%;
|
|
656
|
-
transform: translateY(-50%);
|
|
657
|
-
pointer-events: none;
|
|
658
|
-
display: flex;
|
|
659
|
-
align-items: center;
|
|
660
|
-
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
661
741
|
`;
|
|
662
|
-
function
|
|
742
|
+
function ln({
|
|
663
743
|
options: o,
|
|
664
744
|
placeholder: r,
|
|
665
745
|
size: n = "md",
|
|
666
|
-
variant:
|
|
667
|
-
error:
|
|
668
|
-
fullWidth:
|
|
669
|
-
clearable:
|
|
670
|
-
onClear:
|
|
671
|
-
id:
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
746
|
+
variant: t = "default",
|
|
747
|
+
error: a,
|
|
748
|
+
fullWidth: l,
|
|
749
|
+
clearable: d,
|
|
750
|
+
onClear: p,
|
|
751
|
+
id: u,
|
|
752
|
+
name: f,
|
|
753
|
+
value: $,
|
|
754
|
+
defaultValue: h,
|
|
755
|
+
onChange: w,
|
|
756
|
+
disabled: y,
|
|
757
|
+
searchable: v,
|
|
758
|
+
"aria-label": z,
|
|
759
|
+
"aria-describedby": O
|
|
676
760
|
}) {
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
},
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
761
|
+
const R = Q(), L = u ?? R, g = `${L}-list`, C = `${L}-search`, m = typeof a == "string" ? a : void 0, [x, I] = T(!1), [D, W] = T(-1), [M, A] = T(""), [_, P] = T({
|
|
762
|
+
top: 0,
|
|
763
|
+
left: 0,
|
|
764
|
+
width: 0
|
|
765
|
+
}), [j, oo] = T(
|
|
766
|
+
h ?? ""
|
|
767
|
+
), F = $ !== void 0, K = F ? $ : j, ro = U(null), q = U(null), no = U(null), to = U(null), k = o.find(
|
|
768
|
+
(c) => c.value === K
|
|
769
|
+
), N = v && M ? o.filter(
|
|
770
|
+
(c) => c.label.toLowerCase().includes(M.toLowerCase())
|
|
771
|
+
) : o, Y = X(() => {
|
|
772
|
+
if (!q.current)
|
|
773
|
+
return;
|
|
774
|
+
const c = q.current.getBoundingClientRect();
|
|
775
|
+
P({
|
|
776
|
+
top: c.bottom + 4,
|
|
777
|
+
left: c.left,
|
|
778
|
+
width: c.width
|
|
779
|
+
});
|
|
780
|
+
}, []);
|
|
781
|
+
B(() => {
|
|
782
|
+
if (x)
|
|
783
|
+
return Y(), window.addEventListener("scroll", Y, !0), window.addEventListener("resize", Y), () => {
|
|
784
|
+
window.removeEventListener("scroll", Y, !0), window.removeEventListener("resize", Y);
|
|
785
|
+
};
|
|
786
|
+
}, [x, Y]), B(() => {
|
|
787
|
+
if (!x)
|
|
788
|
+
return;
|
|
789
|
+
const c = (E) => {
|
|
790
|
+
const G = ro.current?.contains(
|
|
791
|
+
E.target
|
|
792
|
+
), po = no.current?.contains(
|
|
793
|
+
E.target
|
|
794
|
+
);
|
|
795
|
+
!G && !po && I(!1);
|
|
796
|
+
};
|
|
797
|
+
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
798
|
+
}, [x]), B(() => {
|
|
799
|
+
x && v && setTimeout(() => to.current?.focus(), 0), x || (A(""), W(-1));
|
|
800
|
+
}, [x, v]), B(() => {
|
|
801
|
+
W(-1);
|
|
802
|
+
}, [M]), B(() => {
|
|
803
|
+
if (D < 0)
|
|
804
|
+
return;
|
|
805
|
+
const c = document.getElementById(`${g}-option-${D}`);
|
|
806
|
+
c && typeof c.scrollIntoView == "function" && c.scrollIntoView({ block: "nearest" });
|
|
807
|
+
}, [D, g]);
|
|
808
|
+
function H(c, E) {
|
|
809
|
+
let G = c + E;
|
|
810
|
+
for (; G >= 0 && G < N.length; ) {
|
|
811
|
+
if (!N[G].disabled)
|
|
812
|
+
return G;
|
|
813
|
+
G += E;
|
|
814
|
+
}
|
|
815
|
+
return c;
|
|
816
|
+
}
|
|
817
|
+
function ao() {
|
|
818
|
+
return N.findIndex((c) => !c.disabled);
|
|
819
|
+
}
|
|
820
|
+
function uo() {
|
|
821
|
+
for (let c = N.length - 1; c >= 0; c--)
|
|
822
|
+
if (!N[c].disabled)
|
|
823
|
+
return c;
|
|
824
|
+
return -1;
|
|
825
|
+
}
|
|
826
|
+
function lo(c) {
|
|
827
|
+
if (c.disabled)
|
|
828
|
+
return;
|
|
829
|
+
F || oo(c.value);
|
|
830
|
+
const E = {
|
|
831
|
+
target: { name: f ?? "", value: c.value },
|
|
832
|
+
currentTarget: { name: f ?? "", value: c.value }
|
|
833
|
+
};
|
|
834
|
+
w?.(E), I(!1), q.current?.focus();
|
|
835
|
+
}
|
|
836
|
+
function so(c) {
|
|
837
|
+
c.stopPropagation(), F || oo(""), w?.({
|
|
838
|
+
target: { name: f ?? "", value: "" },
|
|
839
|
+
currentTarget: { name: f ?? "", value: "" }
|
|
840
|
+
}), p?.(), q.current?.focus();
|
|
841
|
+
}
|
|
842
|
+
function xo(c) {
|
|
843
|
+
if (!y) {
|
|
844
|
+
if (!x) {
|
|
845
|
+
["ArrowDown", "ArrowUp", "Enter", " "].includes(c.key) && (c.preventDefault(), I(!0), v || W(ao()));
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
if (c.key === "Escape") {
|
|
849
|
+
c.preventDefault(), I(!1);
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
if (!v) {
|
|
853
|
+
if (c.key === "ArrowDown") {
|
|
854
|
+
c.preventDefault(), W((E) => H(E, 1));
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
if (c.key === "ArrowUp") {
|
|
858
|
+
c.preventDefault(), W((E) => H(E, -1));
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
if (c.key === "Home") {
|
|
862
|
+
c.preventDefault(), W(ao());
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
if (c.key === "End") {
|
|
866
|
+
c.preventDefault(), W(uo());
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
(c.key === "Enter" || c.key === " ") && D >= 0 && (c.preventDefault(), lo(N[D]));
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
function yo(c) {
|
|
874
|
+
if (c.key === "Escape") {
|
|
875
|
+
I(!1), q.current?.focus();
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
if (c.key === "ArrowDown") {
|
|
879
|
+
c.preventDefault(), W(
|
|
880
|
+
(E) => E < 0 ? ao() : H(E, 1)
|
|
881
|
+
);
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
if (c.key === "ArrowUp") {
|
|
885
|
+
c.preventDefault(), W(
|
|
886
|
+
(E) => E < 0 ? uo() : H(E, -1)
|
|
887
|
+
);
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
c.key === "Enter" && D >= 0 && (c.preventDefault(), lo(N[D]));
|
|
891
|
+
}
|
|
892
|
+
const b = d && !!K && !y, V = D >= 0 ? `${g}-option-${D}` : void 0;
|
|
893
|
+
return /* @__PURE__ */ S(Gr, { ref: ro, $fullWidth: l, children: [
|
|
894
|
+
/* @__PURE__ */ S(Xr, { "aria-hidden": "true", children: [
|
|
895
|
+
r && /* @__PURE__ */ e(mo, { children: r }),
|
|
896
|
+
o.map((c) => /* @__PURE__ */ e(mo, { children: c.label }, c.value))
|
|
897
|
+
] }),
|
|
898
|
+
/* @__PURE__ */ S(
|
|
899
|
+
Jr,
|
|
900
|
+
{
|
|
901
|
+
ref: q,
|
|
902
|
+
id: L,
|
|
903
|
+
type: "button",
|
|
904
|
+
role: "combobox",
|
|
905
|
+
"aria-expanded": x,
|
|
906
|
+
"aria-haspopup": "listbox",
|
|
907
|
+
"aria-controls": x ? g : void 0,
|
|
908
|
+
"aria-activedescendant": x && !v ? V : void 0,
|
|
909
|
+
"aria-invalid": !!a,
|
|
910
|
+
"aria-label": z,
|
|
911
|
+
"aria-describedby": O,
|
|
912
|
+
$size: n,
|
|
913
|
+
$variant: t,
|
|
914
|
+
$error: !!a,
|
|
915
|
+
$disabled: y,
|
|
916
|
+
$open: x,
|
|
917
|
+
disabled: y,
|
|
918
|
+
onClick: () => !y && I((c) => !c),
|
|
919
|
+
onKeyDown: xo,
|
|
920
|
+
children: [
|
|
921
|
+
/* @__PURE__ */ e(mo, { $placeholder: !k, children: k?.label ?? r ?? "Select..." }),
|
|
922
|
+
/* @__PURE__ */ S(Qr, { children: [
|
|
923
|
+
b && /* @__PURE__ */ e(
|
|
924
|
+
an,
|
|
925
|
+
{
|
|
926
|
+
type: "button",
|
|
927
|
+
onClick: so,
|
|
928
|
+
"aria-label": "Clear selection",
|
|
929
|
+
children: /* @__PURE__ */ e(bo, { size: 14 })
|
|
930
|
+
}
|
|
931
|
+
),
|
|
932
|
+
/* @__PURE__ */ e(Zr, { $open: x, "aria-hidden": "true", children: /* @__PURE__ */ e(Ko, { size: 14 }) })
|
|
933
|
+
] })
|
|
934
|
+
]
|
|
935
|
+
}
|
|
936
|
+
),
|
|
937
|
+
x && go(
|
|
938
|
+
/* @__PURE__ */ S(
|
|
939
|
+
on,
|
|
688
940
|
{
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
941
|
+
ref: no,
|
|
942
|
+
id: g,
|
|
943
|
+
role: "listbox",
|
|
944
|
+
"aria-label": r ?? "Options",
|
|
945
|
+
style: {
|
|
946
|
+
position: "fixed",
|
|
947
|
+
top: _.top,
|
|
948
|
+
left: _.left,
|
|
949
|
+
width: _.width
|
|
950
|
+
},
|
|
698
951
|
children: [
|
|
699
|
-
|
|
700
|
-
|
|
952
|
+
v && /* @__PURE__ */ e(rn, { children: /* @__PURE__ */ e(
|
|
953
|
+
nn,
|
|
954
|
+
{
|
|
955
|
+
ref: to,
|
|
956
|
+
id: C,
|
|
957
|
+
type: "text",
|
|
958
|
+
placeholder: "Search...",
|
|
959
|
+
value: M,
|
|
960
|
+
onChange: (c) => A(c.target.value),
|
|
961
|
+
onKeyDown: yo,
|
|
962
|
+
"aria-label": "Search options",
|
|
963
|
+
"aria-controls": g,
|
|
964
|
+
"aria-activedescendant": V
|
|
965
|
+
}
|
|
966
|
+
) }),
|
|
967
|
+
N.length === 0 && /* @__PURE__ */ e(tn, { children: "No options found" }),
|
|
968
|
+
N.map((c, E) => /* @__PURE__ */ e(
|
|
969
|
+
sn,
|
|
970
|
+
{
|
|
971
|
+
id: `${g}-option-${E}`,
|
|
972
|
+
role: "option",
|
|
973
|
+
"aria-selected": c.value === K,
|
|
974
|
+
"aria-disabled": c.disabled,
|
|
975
|
+
$selected: c.value === K,
|
|
976
|
+
$focused: E === D,
|
|
977
|
+
$disabled: c.disabled,
|
|
978
|
+
onClick: () => lo(c),
|
|
979
|
+
onMouseEnter: () => !c.disabled && W(E),
|
|
980
|
+
children: c.label
|
|
981
|
+
},
|
|
982
|
+
c.value
|
|
983
|
+
))
|
|
701
984
|
]
|
|
702
985
|
}
|
|
703
986
|
),
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
type: "button",
|
|
708
|
-
onClick: w,
|
|
709
|
-
"aria-label": "Clear selection",
|
|
710
|
-
children: /* @__PURE__ */ s(co, { size: 14 })
|
|
711
|
-
}
|
|
712
|
-
) : /* @__PURE__ */ s(zr, { "aria-hidden": "true", children: /* @__PURE__ */ s(zo, { size: 14 }) })
|
|
713
|
-
] }),
|
|
714
|
-
C && /* @__PURE__ */ s(kr, { id: v, $error: !0, children: C })
|
|
987
|
+
document.body
|
|
988
|
+
),
|
|
989
|
+
m && /* @__PURE__ */ e(en, { $error: !0, children: m })
|
|
715
990
|
] });
|
|
716
991
|
}
|
|
717
|
-
|
|
718
|
-
const
|
|
992
|
+
ln.displayName = "Select";
|
|
993
|
+
const Po = i.span`
|
|
719
994
|
display: inline-block;
|
|
720
|
-
`,
|
|
995
|
+
`, cn = i.span`
|
|
721
996
|
display: inline-block;
|
|
722
997
|
min-width: 60px;
|
|
723
998
|
padding: ${({ theme: o }) => `${o.spacing[1]} ${o.spacing[2]}`};
|
|
724
999
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
725
1000
|
color: ${({ $empty: o, theme: r }) => o ? r.colors.neutral[400] : "inherit"};
|
|
726
1001
|
|
|
727
|
-
${({ theme: o }) => o.brutalism ?
|
|
1002
|
+
${({ theme: o }) => o.brutalism ? s`
|
|
728
1003
|
border: ${o.brutalism.borderWidth} solid transparent;
|
|
729
|
-
` :
|
|
1004
|
+
` : s`
|
|
730
1005
|
border: 1px solid transparent;
|
|
731
1006
|
`}
|
|
732
1007
|
|
|
733
|
-
${({ $disabled: o, theme: r }) => o ?
|
|
1008
|
+
${({ $disabled: o, theme: r }) => o ? s`
|
|
734
1009
|
opacity: 0.5;
|
|
735
|
-
` :
|
|
1010
|
+
` : s`
|
|
736
1011
|
cursor: text;
|
|
737
1012
|
transition:
|
|
738
1013
|
border-color 0.15s ease,
|
|
739
1014
|
box-shadow 0.15s ease;
|
|
740
1015
|
|
|
741
1016
|
&:hover {
|
|
742
|
-
${r.brutalism ?
|
|
1017
|
+
${r.brutalism ? s`
|
|
743
1018
|
border-color: ${r.colors.neutral[900]};
|
|
744
1019
|
box-shadow: ${r.brutalism.shadowOffset}
|
|
745
1020
|
${r.brutalism.shadowOffset} 0
|
|
746
1021
|
${r.colors.neutral[900]};
|
|
747
|
-
` :
|
|
1022
|
+
` : s`
|
|
748
1023
|
border-color: ${r.colors.primary[500]};
|
|
749
1024
|
box-shadow: ${r.shadows.focusRing};
|
|
750
1025
|
`}
|
|
@@ -755,7 +1030,7 @@ const go = i.span`
|
|
|
755
1030
|
box-shadow: ${r.shadows.focusRing};
|
|
756
1031
|
}
|
|
757
1032
|
`}
|
|
758
|
-
`,
|
|
1033
|
+
`, dn = i.input`
|
|
759
1034
|
display: inline-block;
|
|
760
1035
|
min-width: 60px;
|
|
761
1036
|
padding: ${({ theme: o }) => `${o.spacing[1]} ${o.spacing[2]}`};
|
|
@@ -765,62 +1040,62 @@ const go = i.span`
|
|
|
765
1040
|
background: ${({ theme: o }) => o.colors.neutral[0]};
|
|
766
1041
|
outline: none;
|
|
767
1042
|
|
|
768
|
-
${({ theme: o }) => o.brutalism ?
|
|
1043
|
+
${({ theme: o }) => o.brutalism ? s`
|
|
769
1044
|
border: ${o.brutalism.borderWidth} solid
|
|
770
1045
|
${o.colors.neutral[900]};
|
|
771
1046
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
772
1047
|
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
773
|
-
` :
|
|
1048
|
+
` : s`
|
|
774
1049
|
border: 1px solid ${o.colors.primary[500]};
|
|
775
1050
|
box-shadow: ${o.shadows.focusRing};
|
|
776
1051
|
`}
|
|
777
1052
|
`;
|
|
778
|
-
function
|
|
1053
|
+
function un({
|
|
779
1054
|
value: o,
|
|
780
1055
|
defaultValue: r = "",
|
|
781
1056
|
onChange: n,
|
|
782
|
-
onSubmit:
|
|
783
|
-
onCancel:
|
|
784
|
-
placeholder:
|
|
785
|
-
disabled:
|
|
1057
|
+
onSubmit: t,
|
|
1058
|
+
onCancel: a,
|
|
1059
|
+
placeholder: l = "Click to edit",
|
|
1060
|
+
disabled: d = !1
|
|
786
1061
|
}) {
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
|
|
1062
|
+
const p = o !== void 0, [u, f] = T(r), $ = p ? o : u, [h, w] = T(!1), [y, v] = T(""), z = U(null), O = () => {
|
|
1063
|
+
d || (v($), w(!0), setTimeout(() => {
|
|
1064
|
+
z.current?.focus(), z.current?.select();
|
|
790
1065
|
}, 0));
|
|
791
|
-
},
|
|
792
|
-
|
|
793
|
-
},
|
|
794
|
-
|
|
795
|
-
},
|
|
796
|
-
|
|
1066
|
+
}, R = () => {
|
|
1067
|
+
p || f(y), n?.(y), t?.(y), w(!1);
|
|
1068
|
+
}, L = () => {
|
|
1069
|
+
a?.($), w(!1);
|
|
1070
|
+
}, g = (C) => {
|
|
1071
|
+
C.key === "Enter" ? R() : C.key === "Escape" && L();
|
|
797
1072
|
};
|
|
798
|
-
return h ? /* @__PURE__ */
|
|
799
|
-
|
|
1073
|
+
return h ? /* @__PURE__ */ e(Po, { children: /* @__PURE__ */ e(
|
|
1074
|
+
dn,
|
|
800
1075
|
{
|
|
801
|
-
ref:
|
|
802
|
-
value:
|
|
803
|
-
size: Math.max(
|
|
804
|
-
onChange: (
|
|
805
|
-
onBlur:
|
|
806
|
-
onKeyDown:
|
|
1076
|
+
ref: z,
|
|
1077
|
+
value: y,
|
|
1078
|
+
size: Math.max(y.length, l.length, 10),
|
|
1079
|
+
onChange: (C) => v(C.target.value),
|
|
1080
|
+
onBlur: R,
|
|
1081
|
+
onKeyDown: g,
|
|
807
1082
|
"aria-label": "Edit value"
|
|
808
1083
|
}
|
|
809
|
-
) }) : /* @__PURE__ */
|
|
810
|
-
|
|
1084
|
+
) }) : /* @__PURE__ */ e(Po, { children: /* @__PURE__ */ e(
|
|
1085
|
+
cn,
|
|
811
1086
|
{
|
|
812
|
-
role:
|
|
813
|
-
tabIndex:
|
|
814
|
-
$disabled:
|
|
815
|
-
$empty:
|
|
816
|
-
onClick:
|
|
817
|
-
onKeyDown: (
|
|
818
|
-
children:
|
|
1087
|
+
role: d ? void 0 : "button",
|
|
1088
|
+
tabIndex: d ? void 0 : 0,
|
|
1089
|
+
$disabled: d,
|
|
1090
|
+
$empty: !$,
|
|
1091
|
+
onClick: O,
|
|
1092
|
+
onKeyDown: (C) => C.key === "Enter" && O(),
|
|
1093
|
+
children: $ || l
|
|
819
1094
|
}
|
|
820
1095
|
) });
|
|
821
1096
|
}
|
|
822
|
-
|
|
823
|
-
const
|
|
1097
|
+
un.displayName = "Editable";
|
|
1098
|
+
const pn = i.a`
|
|
824
1099
|
text-decoration: underline;
|
|
825
1100
|
text-underline-offset: 2px;
|
|
826
1101
|
transition: color 0.15s;
|
|
@@ -832,13 +1107,13 @@ const Wr = i.a`
|
|
|
832
1107
|
}
|
|
833
1108
|
|
|
834
1109
|
${({ $variant: o, theme: r }) => ({
|
|
835
|
-
default:
|
|
1110
|
+
default: s`
|
|
836
1111
|
color: ${r.colors.primary[500]};
|
|
837
1112
|
&:hover {
|
|
838
1113
|
color: ${r.colors.primary[700]};
|
|
839
1114
|
}
|
|
840
1115
|
`,
|
|
841
|
-
subtle:
|
|
1116
|
+
subtle: s`
|
|
842
1117
|
color: ${r.colors.neutral[500]};
|
|
843
1118
|
&:hover {
|
|
844
1119
|
color: ${r.colors.neutral[900]};
|
|
@@ -846,55 +1121,55 @@ const Wr = i.a`
|
|
|
846
1121
|
`
|
|
847
1122
|
})[o]}
|
|
848
1123
|
`;
|
|
849
|
-
function
|
|
1124
|
+
function qo({
|
|
850
1125
|
variant: o = "default",
|
|
851
1126
|
external: r,
|
|
852
1127
|
children: n,
|
|
853
|
-
...
|
|
1128
|
+
...t
|
|
854
1129
|
}) {
|
|
855
|
-
return /* @__PURE__ */
|
|
856
|
-
|
|
1130
|
+
return /* @__PURE__ */ e(
|
|
1131
|
+
pn,
|
|
857
1132
|
{
|
|
858
1133
|
$variant: o,
|
|
859
1134
|
...r && { target: "_blank", rel: "noreferrer" },
|
|
860
|
-
...
|
|
1135
|
+
...t,
|
|
861
1136
|
children: n
|
|
862
1137
|
}
|
|
863
1138
|
);
|
|
864
1139
|
}
|
|
865
|
-
|
|
866
|
-
const
|
|
1140
|
+
qo.displayName = "Link";
|
|
1141
|
+
const fn = i.div`
|
|
867
1142
|
display: flex;
|
|
868
1143
|
flex-direction: column;
|
|
869
1144
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
870
|
-
`,
|
|
1145
|
+
`, $n = i.span`
|
|
871
1146
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
872
1147
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
873
|
-
font-weight: ${({ theme: o }) => o.brutalism ?
|
|
874
|
-
`,
|
|
1148
|
+
font-weight: ${({ theme: o }) => o.brutalism ? o.fontWeights.bold : o.fontWeights.medium};
|
|
1149
|
+
`, gn = i.span`
|
|
875
1150
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
876
1151
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
877
1152
|
`;
|
|
878
|
-
function
|
|
879
|
-
return /* @__PURE__ */
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
n ? /* @__PURE__ */
|
|
1153
|
+
function bn({ label: o, value: r, href: n }) {
|
|
1154
|
+
return /* @__PURE__ */ S(fn, { children: [
|
|
1155
|
+
/* @__PURE__ */ e($n, { children: o }),
|
|
1156
|
+
n ? /* @__PURE__ */ e(qo, { href: n, external: !0, children: r }) : /* @__PURE__ */ e(gn, { children: r ?? "—" })
|
|
882
1157
|
] });
|
|
883
1158
|
}
|
|
884
|
-
|
|
885
|
-
const
|
|
1159
|
+
bn.displayName = "Field";
|
|
1160
|
+
const xn = J`
|
|
886
1161
|
from { opacity: 0; }
|
|
887
1162
|
to { opacity: 1; }
|
|
888
|
-
`,
|
|
1163
|
+
`, yn = J`
|
|
889
1164
|
from { opacity: 1; }
|
|
890
1165
|
to { opacity: 0; }
|
|
891
|
-
`,
|
|
1166
|
+
`, hn = J`
|
|
892
1167
|
from { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
893
1168
|
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
894
|
-
`,
|
|
1169
|
+
`, wn = J`
|
|
895
1170
|
from { opacity: 1; transform: scale(1) translateY(0); }
|
|
896
1171
|
to { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
897
|
-
`,
|
|
1172
|
+
`, mn = i.div`
|
|
898
1173
|
position: fixed;
|
|
899
1174
|
inset: 0;
|
|
900
1175
|
background-color: rgba(0, 0, 0, 0.5);
|
|
@@ -902,9 +1177,9 @@ const Lr = F`
|
|
|
902
1177
|
align-items: center;
|
|
903
1178
|
justify-content: center;
|
|
904
1179
|
z-index: ${({ theme: o }) => o.zIndex.modal};
|
|
905
|
-
animation: ${({ $closing: o }) => o ?
|
|
1180
|
+
animation: ${({ $closing: o }) => o ? yn : xn} 0.15s ease
|
|
906
1181
|
forwards;
|
|
907
|
-
`,
|
|
1182
|
+
`, vn = i.div`
|
|
908
1183
|
position: relative;
|
|
909
1184
|
background: ${({ theme: o }) => o.colors.neutral[0]};
|
|
910
1185
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -913,37 +1188,37 @@ const Lr = F`
|
|
|
913
1188
|
display: flex;
|
|
914
1189
|
flex-direction: column;
|
|
915
1190
|
max-height: 90vh;
|
|
916
|
-
animation: ${({ $closing: o }) => o ?
|
|
1191
|
+
animation: ${({ $closing: o }) => o ? wn : hn} 0.15s ease
|
|
917
1192
|
forwards;
|
|
918
1193
|
|
|
919
|
-
${({ $size: o }) => o === "sm" &&
|
|
1194
|
+
${({ $size: o }) => o === "sm" && s`
|
|
920
1195
|
width: min(400px, 90vw);
|
|
921
1196
|
`}
|
|
922
|
-
${({ $size: o }) => o === "md" &&
|
|
1197
|
+
${({ $size: o }) => o === "md" && s`
|
|
923
1198
|
width: min(560px, 90vw);
|
|
924
1199
|
`}
|
|
925
|
-
${({ $size: o }) => o === "lg" &&
|
|
1200
|
+
${({ $size: o }) => o === "lg" && s`
|
|
926
1201
|
width: min(720px, 90vw);
|
|
927
1202
|
`}
|
|
928
|
-
${({ $size: o }) => o === "fullscreen" &&
|
|
1203
|
+
${({ $size: o }) => o === "fullscreen" && s`
|
|
929
1204
|
width: 100vw;
|
|
930
1205
|
height: 100vh;
|
|
931
1206
|
max-height: 100vh;
|
|
932
1207
|
border-radius: 0;
|
|
933
1208
|
`}
|
|
934
|
-
`,
|
|
1209
|
+
`, kn = i.div`
|
|
935
1210
|
display: flex;
|
|
936
1211
|
align-items: center;
|
|
937
1212
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
938
1213
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
939
1214
|
border-bottom: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
940
1215
|
flex-shrink: 0;
|
|
941
|
-
`,
|
|
1216
|
+
`, Sn = i.h2`
|
|
942
1217
|
flex: 1;
|
|
943
1218
|
font-size: ${({ theme: o }) => o.fontSizes.lg};
|
|
944
|
-
font-weight:
|
|
1219
|
+
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
945
1220
|
margin: 0;
|
|
946
|
-
`,
|
|
1221
|
+
`, zn = i.button`
|
|
947
1222
|
display: inline-flex;
|
|
948
1223
|
align-items: center;
|
|
949
1224
|
justify-content: center;
|
|
@@ -968,11 +1243,11 @@ const Lr = F`
|
|
|
968
1243
|
outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
|
|
969
1244
|
outline-offset: 2px;
|
|
970
1245
|
}
|
|
971
|
-
`,
|
|
1246
|
+
`, Cn = i.div`
|
|
972
1247
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
973
1248
|
overflow-y: auto;
|
|
974
1249
|
flex: 1;
|
|
975
|
-
`,
|
|
1250
|
+
`, In = i.div`
|
|
976
1251
|
display: flex;
|
|
977
1252
|
align-items: center;
|
|
978
1253
|
justify-content: flex-end;
|
|
@@ -980,7 +1255,7 @@ const Lr = F`
|
|
|
980
1255
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
981
1256
|
border-top: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
982
1257
|
flex-shrink: 0;
|
|
983
|
-
`,
|
|
1258
|
+
`, Tn = [
|
|
984
1259
|
"button:not([disabled])",
|
|
985
1260
|
"input:not([disabled])",
|
|
986
1261
|
"select:not([disabled])",
|
|
@@ -988,94 +1263,96 @@ const Lr = F`
|
|
|
988
1263
|
"a[href]",
|
|
989
1264
|
'[tabindex]:not([tabindex="-1"])'
|
|
990
1265
|
].join(", ");
|
|
991
|
-
function
|
|
1266
|
+
function Ro(o) {
|
|
992
1267
|
return Array.from(
|
|
993
|
-
o.querySelectorAll(
|
|
1268
|
+
o.querySelectorAll(Tn)
|
|
994
1269
|
);
|
|
995
1270
|
}
|
|
996
|
-
function
|
|
1271
|
+
function Go({
|
|
997
1272
|
open: o,
|
|
998
1273
|
onClose: r,
|
|
999
1274
|
title: n,
|
|
1000
|
-
children:
|
|
1001
|
-
footer:
|
|
1002
|
-
size:
|
|
1003
|
-
closeOnBackdrop:
|
|
1004
|
-
closeOnEscape:
|
|
1005
|
-
ariaLabelledBy:
|
|
1006
|
-
ariaDescribedBy:
|
|
1275
|
+
children: t,
|
|
1276
|
+
footer: a,
|
|
1277
|
+
size: l = "md",
|
|
1278
|
+
closeOnBackdrop: d = !0,
|
|
1279
|
+
closeOnEscape: p = !0,
|
|
1280
|
+
ariaLabelledBy: u,
|
|
1281
|
+
ariaDescribedBy: f
|
|
1007
1282
|
}) {
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1283
|
+
const $ = U(null), h = U(null), w = U(r);
|
|
1284
|
+
w.current = r;
|
|
1285
|
+
const y = Q(), v = u ?? (n ? y : void 0), [z, O] = T(o), [R, L] = T(!1);
|
|
1286
|
+
return B(() => {
|
|
1010
1287
|
if (o)
|
|
1011
|
-
|
|
1012
|
-
else if (
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1288
|
+
O(!0), L(!1);
|
|
1289
|
+
else if (z) {
|
|
1290
|
+
L(!0);
|
|
1291
|
+
const g = setTimeout(() => {
|
|
1292
|
+
O(!1), L(!1);
|
|
1016
1293
|
}, 150);
|
|
1017
|
-
return () => clearTimeout(
|
|
1294
|
+
return () => clearTimeout(g);
|
|
1018
1295
|
}
|
|
1019
|
-
}, [o,
|
|
1296
|
+
}, [o, z]), B(() => {
|
|
1020
1297
|
if (!o)
|
|
1021
1298
|
return;
|
|
1022
|
-
const
|
|
1299
|
+
const g = document.body.style.overflow;
|
|
1023
1300
|
return document.body.style.overflow = "hidden", () => {
|
|
1024
|
-
document.body.style.overflow =
|
|
1301
|
+
document.body.style.overflow = g;
|
|
1025
1302
|
};
|
|
1026
|
-
}, [o]),
|
|
1027
|
-
if (!o ||
|
|
1303
|
+
}, [o]), B(() => {
|
|
1304
|
+
if (!o || !$.current)
|
|
1028
1305
|
return;
|
|
1029
|
-
const
|
|
1030
|
-
(
|
|
1031
|
-
const
|
|
1032
|
-
if (
|
|
1033
|
-
|
|
1306
|
+
const g = $.current, C = document.activeElement;
|
|
1307
|
+
(Ro(g)[0] ?? g).focus();
|
|
1308
|
+
const x = (I) => {
|
|
1309
|
+
if (I.key === "Escape" && p) {
|
|
1310
|
+
w.current();
|
|
1034
1311
|
return;
|
|
1035
1312
|
}
|
|
1036
|
-
if (
|
|
1313
|
+
if (I.key !== "Tab")
|
|
1037
1314
|
return;
|
|
1038
|
-
const
|
|
1039
|
-
if (
|
|
1040
|
-
|
|
1315
|
+
const D = Ro(g);
|
|
1316
|
+
if (D.length === 0) {
|
|
1317
|
+
I.preventDefault();
|
|
1041
1318
|
return;
|
|
1042
1319
|
}
|
|
1043
|
-
const W =
|
|
1044
|
-
|
|
1320
|
+
const W = D[0], M = D[D.length - 1];
|
|
1321
|
+
I.shiftKey ? document.activeElement === W && (I.preventDefault(), M.focus()) : document.activeElement === M && (I.preventDefault(), W.focus());
|
|
1045
1322
|
};
|
|
1046
|
-
return document.addEventListener("keydown",
|
|
1047
|
-
document.removeEventListener("keydown",
|
|
1323
|
+
return document.addEventListener("keydown", x), () => {
|
|
1324
|
+
document.removeEventListener("keydown", x), C?.focus();
|
|
1048
1325
|
};
|
|
1049
|
-
}, [o,
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
|
|
1326
|
+
}, [o, p, z]), z ? go(
|
|
1327
|
+
/* @__PURE__ */ e(
|
|
1328
|
+
mn,
|
|
1052
1329
|
{
|
|
1053
|
-
$closing:
|
|
1054
|
-
onMouseDown: (
|
|
1055
|
-
h.current =
|
|
1330
|
+
$closing: R,
|
|
1331
|
+
onMouseDown: (g) => {
|
|
1332
|
+
h.current = g.target;
|
|
1056
1333
|
},
|
|
1057
|
-
onClick: (
|
|
1058
|
-
|
|
1334
|
+
onClick: (g) => {
|
|
1335
|
+
d && h.current === g.currentTarget && r();
|
|
1059
1336
|
},
|
|
1060
|
-
children: /* @__PURE__ */
|
|
1061
|
-
|
|
1337
|
+
children: /* @__PURE__ */ S(
|
|
1338
|
+
vn,
|
|
1062
1339
|
{
|
|
1063
|
-
ref:
|
|
1340
|
+
ref: $,
|
|
1064
1341
|
role: "dialog",
|
|
1065
1342
|
"aria-modal": "true",
|
|
1066
|
-
"aria-labelledby":
|
|
1067
|
-
"aria-describedby":
|
|
1068
|
-
$size:
|
|
1069
|
-
$closing:
|
|
1343
|
+
"aria-labelledby": v,
|
|
1344
|
+
"aria-describedby": f,
|
|
1345
|
+
$size: l,
|
|
1346
|
+
$closing: R,
|
|
1070
1347
|
tabIndex: -1,
|
|
1071
|
-
onClick: (
|
|
1348
|
+
onClick: (g) => g.stopPropagation(),
|
|
1072
1349
|
children: [
|
|
1073
|
-
/* @__PURE__ */
|
|
1074
|
-
n && /* @__PURE__ */
|
|
1075
|
-
/* @__PURE__ */
|
|
1350
|
+
/* @__PURE__ */ S(kn, { children: [
|
|
1351
|
+
n && /* @__PURE__ */ e(Sn, { id: y, children: n }),
|
|
1352
|
+
/* @__PURE__ */ e(zn, { onClick: r, "aria-label": "Close modal", children: "×" })
|
|
1076
1353
|
] }),
|
|
1077
|
-
/* @__PURE__ */
|
|
1078
|
-
|
|
1354
|
+
/* @__PURE__ */ e(Cn, { children: t }),
|
|
1355
|
+
a && /* @__PURE__ */ e(In, { children: a })
|
|
1079
1356
|
]
|
|
1080
1357
|
}
|
|
1081
1358
|
)
|
|
@@ -1084,19 +1361,64 @@ function Io({
|
|
|
1084
1361
|
document.body
|
|
1085
1362
|
) : null;
|
|
1086
1363
|
}
|
|
1087
|
-
|
|
1088
|
-
const
|
|
1364
|
+
Go.displayName = "Modal";
|
|
1365
|
+
const Xo = J`
|
|
1089
1366
|
from { opacity: 0; transform: translateY(12px); }
|
|
1090
1367
|
to { opacity: 1; transform: translateY(0); }
|
|
1091
|
-
`,
|
|
1368
|
+
`, Jo = J`
|
|
1092
1369
|
from { opacity: 0; transform: translateY(-12px); }
|
|
1093
1370
|
to { opacity: 1; transform: translateY(0); }
|
|
1094
|
-
`,
|
|
1371
|
+
`, Qo = J`
|
|
1095
1372
|
from { opacity: 1; }
|
|
1096
1373
|
to { opacity: 0; }
|
|
1097
|
-
`,
|
|
1098
|
-
|
|
1099
|
-
|
|
1374
|
+
`, fo = (o, r, n) => s`
|
|
1375
|
+
background: ${r};
|
|
1376
|
+
border: ${o.brutalism.borderWidth} solid ${n};
|
|
1377
|
+
box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
|
|
1378
|
+
0 ${n};
|
|
1379
|
+
`;
|
|
1380
|
+
function Zo(o, r) {
|
|
1381
|
+
return r.brutalism ? {
|
|
1382
|
+
success: fo(
|
|
1383
|
+
r,
|
|
1384
|
+
r.colors.success[50],
|
|
1385
|
+
r.colors.success[500]
|
|
1386
|
+
),
|
|
1387
|
+
error: fo(
|
|
1388
|
+
r,
|
|
1389
|
+
r.colors.error[50],
|
|
1390
|
+
r.colors.error[500]
|
|
1391
|
+
),
|
|
1392
|
+
warning: fo(
|
|
1393
|
+
r,
|
|
1394
|
+
r.colors.warning[50],
|
|
1395
|
+
r.colors.warning[500]
|
|
1396
|
+
),
|
|
1397
|
+
info: fo(r, r.colors.info[50], r.colors.info[500])
|
|
1398
|
+
}[o] : {
|
|
1399
|
+
success: s`
|
|
1400
|
+
background: ${r.colors.success[50]};
|
|
1401
|
+
border-left: ${r.spacing[1]} solid ${r.colors.success[500]};
|
|
1402
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1403
|
+
`,
|
|
1404
|
+
error: s`
|
|
1405
|
+
background: ${r.colors.error[50]};
|
|
1406
|
+
border-left: ${r.spacing[1]} solid ${r.colors.error[500]};
|
|
1407
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1408
|
+
`,
|
|
1409
|
+
warning: s`
|
|
1410
|
+
background: ${r.colors.warning[50]};
|
|
1411
|
+
border-left: ${r.spacing[1]} solid ${r.colors.warning[500]};
|
|
1412
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1413
|
+
`,
|
|
1414
|
+
info: s`
|
|
1415
|
+
background: ${r.colors.info[50]};
|
|
1416
|
+
border-left: ${r.spacing[1]} solid ${r.colors.info[500]};
|
|
1417
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1418
|
+
`
|
|
1419
|
+
}[o];
|
|
1420
|
+
}
|
|
1421
|
+
const or = s`
|
|
1100
1422
|
display: flex;
|
|
1101
1423
|
align-items: center;
|
|
1102
1424
|
gap: ${({ theme: o }) => o.spacing[3]};
|
|
@@ -1104,85 +1426,89 @@ const qr = F`
|
|
|
1104
1426
|
max-width: 400px;
|
|
1105
1427
|
padding: ${({ theme: o }) => `${o.spacing[3]} ${o.spacing[4]}`};
|
|
1106
1428
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1429
|
+
`, Wn = {
|
|
1430
|
+
"bottom-right": s`
|
|
1431
|
+
bottom: 24px;
|
|
1432
|
+
right: 24px;
|
|
1433
|
+
`,
|
|
1434
|
+
"bottom-left": s`
|
|
1435
|
+
bottom: 24px;
|
|
1436
|
+
left: 24px;
|
|
1437
|
+
`,
|
|
1438
|
+
"top-right": s`
|
|
1439
|
+
top: 24px;
|
|
1440
|
+
right: 24px;
|
|
1441
|
+
`,
|
|
1442
|
+
"top-left": s`
|
|
1443
|
+
top: 24px;
|
|
1444
|
+
left: 24px;
|
|
1445
|
+
`
|
|
1446
|
+
}, Dn = i.div`
|
|
1447
|
+
position: fixed;
|
|
1448
|
+
z-index: ${({ theme: o }) => o.zIndex.toast};
|
|
1449
|
+
${or}
|
|
1450
|
+
|
|
1451
|
+
animation: ${({ $closing: o, $position: r }) => o ? s`
|
|
1452
|
+
${Qo} 0.2s ease forwards
|
|
1453
|
+
` : r.startsWith("top") ? s`
|
|
1454
|
+
${Jo} 0.2s ease forwards
|
|
1455
|
+
` : s`
|
|
1456
|
+
${Xo} 0.2s ease forwards
|
|
1457
|
+
`};
|
|
1458
|
+
|
|
1459
|
+
${({ $position: o }) => Wn[o]}
|
|
1460
|
+
${({ $variant: o, theme: r }) => Zo(o, r)}
|
|
1461
|
+
`, En = i.div`
|
|
1462
|
+
${or}
|
|
1463
|
+
pointer-events: all;
|
|
1464
|
+
|
|
1465
|
+
animation: ${({ $closing: o, $isTop: r }) => o ? s`
|
|
1466
|
+
${Qo} 0.2s ease forwards
|
|
1467
|
+
` : r ? s`
|
|
1468
|
+
${Jo} 0.2s ease forwards
|
|
1469
|
+
` : s`
|
|
1470
|
+
${Xo} 0.2s ease forwards
|
|
1113
1471
|
`};
|
|
1114
1472
|
|
|
1473
|
+
${({ $variant: o, theme: r }) => Zo(o, r)}
|
|
1474
|
+
`, Mn = i.div`
|
|
1475
|
+
position: fixed;
|
|
1476
|
+
z-index: ${({ theme: o }) => o.zIndex.toast};
|
|
1477
|
+
display: flex;
|
|
1478
|
+
flex-direction: column;
|
|
1479
|
+
gap: ${({ theme: o }) => o.spacing[2]};
|
|
1480
|
+
pointer-events: none;
|
|
1481
|
+
|
|
1115
1482
|
${({ $position: o, theme: r }) => ({
|
|
1116
|
-
"bottom-right":
|
|
1483
|
+
"bottom-right": s`
|
|
1117
1484
|
bottom: ${r.spacing[6]};
|
|
1118
1485
|
right: ${r.spacing[6]};
|
|
1486
|
+
align-items: flex-end;
|
|
1119
1487
|
`,
|
|
1120
|
-
"bottom-left":
|
|
1488
|
+
"bottom-left": s`
|
|
1121
1489
|
bottom: ${r.spacing[6]};
|
|
1122
1490
|
left: ${r.spacing[6]};
|
|
1491
|
+
align-items: flex-start;
|
|
1123
1492
|
`,
|
|
1124
|
-
"top-right":
|
|
1493
|
+
"top-right": s`
|
|
1125
1494
|
top: ${r.spacing[6]};
|
|
1126
1495
|
right: ${r.spacing[6]};
|
|
1496
|
+
align-items: flex-end;
|
|
1127
1497
|
`,
|
|
1128
|
-
"top-left":
|
|
1498
|
+
"top-left": s`
|
|
1129
1499
|
top: ${r.spacing[6]};
|
|
1130
1500
|
left: ${r.spacing[6]};
|
|
1501
|
+
align-items: flex-start;
|
|
1131
1502
|
`
|
|
1132
1503
|
})[o]}
|
|
1133
|
-
`,
|
|
1134
|
-
background: ${r};
|
|
1135
|
-
border: ${o.brutalism.borderWidth} solid ${n};
|
|
1136
|
-
box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
|
|
1137
|
-
0 ${n};
|
|
1138
|
-
`, Zr = i(Xr)`
|
|
1139
|
-
${({ $variant: o, theme: r }) => r.brutalism ? {
|
|
1140
|
-
success: J(
|
|
1141
|
-
r,
|
|
1142
|
-
r.colors.success[50],
|
|
1143
|
-
r.colors.success[500]
|
|
1144
|
-
),
|
|
1145
|
-
error: J(
|
|
1146
|
-
r,
|
|
1147
|
-
r.colors.error[50],
|
|
1148
|
-
r.colors.error[500]
|
|
1149
|
-
),
|
|
1150
|
-
warning: J(
|
|
1151
|
-
r,
|
|
1152
|
-
r.colors.warning[50],
|
|
1153
|
-
r.colors.warning[500]
|
|
1154
|
-
),
|
|
1155
|
-
info: J(r, r.colors.info[50], r.colors.info[500])
|
|
1156
|
-
}[o] : {
|
|
1157
|
-
success: t`
|
|
1158
|
-
background: ${r.colors.success[50]};
|
|
1159
|
-
border-left: 4px solid ${r.colors.success[500]};
|
|
1160
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1161
|
-
`,
|
|
1162
|
-
error: t`
|
|
1163
|
-
background: ${r.colors.error[50]};
|
|
1164
|
-
border-left: 4px solid ${r.colors.error[500]};
|
|
1165
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1166
|
-
`,
|
|
1167
|
-
warning: t`
|
|
1168
|
-
background: ${r.colors.warning[50]};
|
|
1169
|
-
border-left: 4px solid ${r.colors.warning[500]};
|
|
1170
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1171
|
-
`,
|
|
1172
|
-
info: t`
|
|
1173
|
-
background: ${r.colors.info[50]};
|
|
1174
|
-
border-left: 4px solid ${r.colors.info[500]};
|
|
1175
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1176
|
-
`
|
|
1177
|
-
}[o]}
|
|
1178
|
-
`, Qr = i.p`
|
|
1504
|
+
`, rr = i.p`
|
|
1179
1505
|
flex: 1;
|
|
1180
1506
|
margin: 0;
|
|
1181
1507
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1182
|
-
font-weight: ${({ theme: o }) => o.brutalism ?
|
|
1508
|
+
font-weight: ${({ theme: o }) => o.brutalism ? o.fontWeights.semibold : o.fontWeights.normal};
|
|
1183
1509
|
line-height: 1.5;
|
|
1184
1510
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
1185
|
-
`,
|
|
1511
|
+
`, nr = i.button`
|
|
1186
1512
|
flex-shrink: 0;
|
|
1187
1513
|
display: inline-flex;
|
|
1188
1514
|
align-items: center;
|
|
@@ -1205,110 +1531,143 @@ const qr = F`
|
|
|
1205
1531
|
outline-offset: 2px;
|
|
1206
1532
|
}
|
|
1207
1533
|
`;
|
|
1208
|
-
function
|
|
1534
|
+
function On({
|
|
1209
1535
|
open: o,
|
|
1210
1536
|
onClose: r,
|
|
1211
1537
|
message: n,
|
|
1212
|
-
variant:
|
|
1213
|
-
duration:
|
|
1214
|
-
position:
|
|
1538
|
+
variant: t = "info",
|
|
1539
|
+
duration: a = 4e3,
|
|
1540
|
+
position: l = "bottom-right"
|
|
1215
1541
|
}) {
|
|
1216
|
-
const [
|
|
1217
|
-
return
|
|
1542
|
+
const [d, p] = T(o), [u, f] = T(!1);
|
|
1543
|
+
return B(() => {
|
|
1218
1544
|
if (o)
|
|
1219
|
-
|
|
1220
|
-
else if (
|
|
1221
|
-
|
|
1222
|
-
const
|
|
1223
|
-
|
|
1545
|
+
p(!0), f(!1);
|
|
1546
|
+
else if (d) {
|
|
1547
|
+
f(!0);
|
|
1548
|
+
const $ = setTimeout(() => {
|
|
1549
|
+
p(!1), f(!1);
|
|
1224
1550
|
}, 200);
|
|
1225
1551
|
return () => {
|
|
1226
|
-
clearTimeout(
|
|
1552
|
+
clearTimeout($);
|
|
1227
1553
|
};
|
|
1228
1554
|
}
|
|
1229
|
-
}, [o,
|
|
1230
|
-
if (!o ||
|
|
1555
|
+
}, [o, d]), B(() => {
|
|
1556
|
+
if (!o || a === 0)
|
|
1231
1557
|
return;
|
|
1232
|
-
const
|
|
1558
|
+
const $ = setTimeout(r, a);
|
|
1233
1559
|
return () => {
|
|
1234
|
-
clearTimeout(
|
|
1560
|
+
clearTimeout($);
|
|
1235
1561
|
};
|
|
1236
|
-
}, [o,
|
|
1237
|
-
/* @__PURE__ */
|
|
1238
|
-
|
|
1562
|
+
}, [o, a, r]), d ? go(
|
|
1563
|
+
/* @__PURE__ */ S(
|
|
1564
|
+
Dn,
|
|
1239
1565
|
{
|
|
1240
|
-
$position:
|
|
1241
|
-
$variant:
|
|
1242
|
-
$closing:
|
|
1566
|
+
$position: l,
|
|
1567
|
+
$variant: t,
|
|
1568
|
+
$closing: u,
|
|
1243
1569
|
role: "alert",
|
|
1244
1570
|
"aria-live": "polite",
|
|
1245
1571
|
children: [
|
|
1246
|
-
/* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
1572
|
+
/* @__PURE__ */ e(rr, { children: n }),
|
|
1573
|
+
/* @__PURE__ */ e(nr, { onClick: r, "aria-label": "Close notification", children: /* @__PURE__ */ e(bo, { size: 14, strokeWidth: 2.5 }) })
|
|
1248
1574
|
]
|
|
1249
1575
|
}
|
|
1250
1576
|
),
|
|
1251
1577
|
document.body
|
|
1252
1578
|
) : null;
|
|
1253
1579
|
}
|
|
1254
|
-
|
|
1255
|
-
const
|
|
1256
|
-
function
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1580
|
+
On.displayName = "Toast";
|
|
1581
|
+
const tr = Wo(null), Vo = 5, Ln = "bottom-right";
|
|
1582
|
+
function Nn({
|
|
1583
|
+
toast: o,
|
|
1584
|
+
isTop: r,
|
|
1585
|
+
onClose: n
|
|
1586
|
+
}) {
|
|
1587
|
+
return B(() => {
|
|
1588
|
+
const t = o.duration ?? 4e3;
|
|
1589
|
+
if (t === 0)
|
|
1590
|
+
return;
|
|
1591
|
+
const a = setTimeout(() => n(o.id), t);
|
|
1592
|
+
return () => clearTimeout(a);
|
|
1593
|
+
}, [o.id, o.duration, n]), /* @__PURE__ */ S(
|
|
1594
|
+
En,
|
|
1595
|
+
{
|
|
1596
|
+
$variant: o.variant ?? "info",
|
|
1597
|
+
$closing: o.closing,
|
|
1598
|
+
$isTop: r,
|
|
1599
|
+
role: "alert",
|
|
1600
|
+
"aria-live": "polite",
|
|
1601
|
+
children: [
|
|
1602
|
+
/* @__PURE__ */ e(rr, { children: o.message }),
|
|
1603
|
+
/* @__PURE__ */ e(
|
|
1604
|
+
nr,
|
|
1605
|
+
{
|
|
1606
|
+
onClick: () => n(o.id),
|
|
1607
|
+
"aria-label": "Close notification",
|
|
1608
|
+
children: /* @__PURE__ */ e(bo, { size: 14, strokeWidth: 2.5 })
|
|
1609
|
+
}
|
|
1610
|
+
)
|
|
1611
|
+
]
|
|
1612
|
+
}
|
|
1613
|
+
);
|
|
1614
|
+
}
|
|
1615
|
+
function $s({ children: o }) {
|
|
1616
|
+
const [r, n] = T([]), t = X((u) => {
|
|
1617
|
+
n(
|
|
1618
|
+
(f) => f.map(
|
|
1619
|
+
($) => $.id === u ? { ...$, closing: !0 } : $
|
|
1620
|
+
)
|
|
1621
|
+
), setTimeout(() => {
|
|
1622
|
+
n(
|
|
1623
|
+
(f) => f.filter(($) => $.id !== u)
|
|
1624
|
+
);
|
|
1625
|
+
}, 200);
|
|
1626
|
+
}, []), a = X((u) => {
|
|
1627
|
+
const f = Date.now();
|
|
1628
|
+
n(($) => {
|
|
1629
|
+
const h = [...$, { ...u, id: f, closing: !1 }];
|
|
1630
|
+
return h.length > Vo ? h.slice(h.length - Vo) : h;
|
|
1631
|
+
});
|
|
1632
|
+
}, []), l = Do(() => Object.assign((u) => a(u), {
|
|
1633
|
+
success: (u, f) => a({ ...f, message: u, variant: "success" }),
|
|
1634
|
+
error: (u, f) => a({ ...f, message: u, variant: "error" }),
|
|
1635
|
+
warning: (u, f) => a({ ...f, message: u, variant: "warning" }),
|
|
1636
|
+
info: (u, f) => a({ ...f, message: u, variant: "info" })
|
|
1637
|
+
}), [a]), d = r[r.length - 1]?.position ?? Ln, p = d.startsWith("top");
|
|
1638
|
+
return /* @__PURE__ */ S(tr.Provider, { value: { toast: l }, children: [
|
|
1266
1639
|
o,
|
|
1267
|
-
r
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
},
|
|
1277
|
-
|
|
1640
|
+
r.length > 0 && go(
|
|
1641
|
+
/* @__PURE__ */ e(Mn, { $position: d, children: r.map((u) => /* @__PURE__ */ e(
|
|
1642
|
+
Nn,
|
|
1643
|
+
{
|
|
1644
|
+
toast: u,
|
|
1645
|
+
isTop: p,
|
|
1646
|
+
onClose: t
|
|
1647
|
+
},
|
|
1648
|
+
u.id
|
|
1649
|
+
)) }),
|
|
1650
|
+
document.body
|
|
1278
1651
|
)
|
|
1279
1652
|
] });
|
|
1280
1653
|
}
|
|
1281
|
-
function
|
|
1282
|
-
const o =
|
|
1654
|
+
function gs() {
|
|
1655
|
+
const o = To(tr);
|
|
1283
1656
|
if (!o)
|
|
1284
1657
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1285
1658
|
return o;
|
|
1286
1659
|
}
|
|
1287
|
-
const
|
|
1660
|
+
const Pn = i.form`
|
|
1288
1661
|
display: flex;
|
|
1289
1662
|
flex-direction: column;
|
|
1290
1663
|
gap: ${({ theme: o }) => o.spacing[4]};
|
|
1291
|
-
`, nn = i.div`
|
|
1292
|
-
display: flex;
|
|
1293
|
-
flex-direction: column;
|
|
1294
|
-
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1295
|
-
`, tn = i.label`
|
|
1296
|
-
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1297
|
-
font-weight: 500;
|
|
1298
|
-
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
1299
|
-
`, sn = i.span`
|
|
1300
|
-
color: ${({ theme: o }) => o.colors.error[500]};
|
|
1301
|
-
margin-left: 2px;
|
|
1302
|
-
`, en = i.span`
|
|
1303
|
-
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
1304
|
-
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
1305
1664
|
`;
|
|
1306
|
-
function
|
|
1307
|
-
return /* @__PURE__ */
|
|
1308
|
-
|
|
1665
|
+
function Rn({ onSubmit: o, children: r, ...n }) {
|
|
1666
|
+
return /* @__PURE__ */ e(
|
|
1667
|
+
Pn,
|
|
1309
1668
|
{
|
|
1310
|
-
onSubmit: (
|
|
1311
|
-
|
|
1669
|
+
onSubmit: (t) => {
|
|
1670
|
+
t.preventDefault(), o?.(t);
|
|
1312
1671
|
},
|
|
1313
1672
|
noValidate: !0,
|
|
1314
1673
|
...n,
|
|
@@ -1316,133 +1675,514 @@ function an({ onSubmit: o, children: r, ...n }) {
|
|
|
1316
1675
|
}
|
|
1317
1676
|
);
|
|
1318
1677
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1678
|
+
Rn.displayName = "Form";
|
|
1679
|
+
const Vn = i.div`
|
|
1680
|
+
display: flex;
|
|
1681
|
+
flex-direction: column;
|
|
1682
|
+
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1683
|
+
`, Fn = i.label`
|
|
1684
|
+
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1685
|
+
font-weight: ${({ theme: o }) => o.fontWeights.medium};
|
|
1686
|
+
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
1687
|
+
`, An = i.span`
|
|
1688
|
+
color: ${({ theme: o }) => o.colors.error[500]};
|
|
1689
|
+
margin-left: ${({ theme: o }) => o.spacing[0.5]};
|
|
1690
|
+
`, Bn = i.span`
|
|
1691
|
+
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
1692
|
+
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
1693
|
+
`;
|
|
1694
|
+
function sr({
|
|
1321
1695
|
label: o,
|
|
1322
1696
|
error: r,
|
|
1323
1697
|
helperText: n,
|
|
1324
|
-
required:
|
|
1325
|
-
children:
|
|
1698
|
+
required: t,
|
|
1699
|
+
children: a
|
|
1326
1700
|
}) {
|
|
1327
|
-
const
|
|
1328
|
-
|
|
1701
|
+
const l = Q(), d = `${l}-hint`, p = !!(r || n), u = typeof r == "string" ? r : void 0, f = Oo.isValidElement(a) ? Oo.cloneElement(
|
|
1702
|
+
a,
|
|
1329
1703
|
{
|
|
1330
|
-
id:
|
|
1331
|
-
...
|
|
1704
|
+
id: l,
|
|
1705
|
+
...p && { "aria-describedby": d },
|
|
1332
1706
|
...r && { "aria-invalid": !0 }
|
|
1333
1707
|
}
|
|
1334
|
-
) :
|
|
1335
|
-
return /* @__PURE__ */
|
|
1336
|
-
o && /* @__PURE__ */
|
|
1708
|
+
) : a;
|
|
1709
|
+
return /* @__PURE__ */ S(Vn, { children: [
|
|
1710
|
+
o && /* @__PURE__ */ S(Fn, { htmlFor: l, children: [
|
|
1337
1711
|
o,
|
|
1338
|
-
|
|
1712
|
+
t && /* @__PURE__ */ e(An, { "aria-hidden": "true", children: " *" })
|
|
1339
1713
|
] }),
|
|
1340
|
-
|
|
1341
|
-
|
|
1714
|
+
f,
|
|
1715
|
+
p && /* @__PURE__ */ e(Bn, { id: d, $error: !!r, children: u ?? n })
|
|
1342
1716
|
] });
|
|
1343
1717
|
}
|
|
1344
|
-
|
|
1345
|
-
function
|
|
1718
|
+
sr.displayName = "FormField";
|
|
1719
|
+
function bs({
|
|
1346
1720
|
initialValues: o,
|
|
1347
1721
|
validate: r,
|
|
1348
1722
|
onSubmit: n,
|
|
1349
|
-
onError:
|
|
1723
|
+
onError: t
|
|
1350
1724
|
}) {
|
|
1351
|
-
const [
|
|
1725
|
+
const [a, l] = T(o), [d, p] = T(
|
|
1352
1726
|
{}
|
|
1353
|
-
), [
|
|
1354
|
-
|
|
1355
|
-
const
|
|
1356
|
-
(
|
|
1727
|
+
), [u, f] = T({}), [$, h] = T(!1), w = U(a);
|
|
1728
|
+
w.current = a;
|
|
1729
|
+
const y = X(
|
|
1730
|
+
(m) => {
|
|
1357
1731
|
if (!r)
|
|
1358
1732
|
return {};
|
|
1359
|
-
const
|
|
1733
|
+
const x = r(m);
|
|
1360
1734
|
return Object.fromEntries(
|
|
1361
|
-
Object.entries(
|
|
1735
|
+
Object.entries(x).filter(([, I]) => I !== void 0)
|
|
1362
1736
|
);
|
|
1363
1737
|
},
|
|
1364
1738
|
[r]
|
|
1365
|
-
),
|
|
1366
|
-
|
|
1367
|
-
const
|
|
1368
|
-
(
|
|
1369
|
-
const { name:
|
|
1370
|
-
process.env.NODE_ENV !== "production" && !
|
|
1739
|
+
), v = U(u);
|
|
1740
|
+
v.current = u;
|
|
1741
|
+
const z = X(
|
|
1742
|
+
(m) => {
|
|
1743
|
+
const { name: x, value: I } = m.target;
|
|
1744
|
+
process.env.NODE_ENV !== "production" && !x && console.warn(
|
|
1371
1745
|
"[useForm] handleChange: field is missing a `name` attribute — value will not be tracked."
|
|
1372
1746
|
);
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1747
|
+
const D = { ...w.current, [x]: I };
|
|
1748
|
+
l(D), v.current[x] && p(y(D));
|
|
1375
1749
|
},
|
|
1376
|
-
[
|
|
1377
|
-
),
|
|
1378
|
-
(
|
|
1379
|
-
const { name:
|
|
1380
|
-
process.env.NODE_ENV !== "production" && !
|
|
1750
|
+
[y]
|
|
1751
|
+
), O = X(
|
|
1752
|
+
(m) => {
|
|
1753
|
+
const { name: x } = m.target;
|
|
1754
|
+
process.env.NODE_ENV !== "production" && !x && console.warn(
|
|
1381
1755
|
"[useForm] handleBlur: field is missing a `name` attribute — touched state will not be tracked."
|
|
1382
|
-
),
|
|
1756
|
+
), f((I) => ({ ...I, [x]: !0 })), p(y(w.current));
|
|
1383
1757
|
},
|
|
1384
|
-
[
|
|
1385
|
-
),
|
|
1386
|
-
(
|
|
1387
|
-
|
|
1388
|
-
const
|
|
1389
|
-
(
|
|
1758
|
+
[y]
|
|
1759
|
+
), R = X(
|
|
1760
|
+
(m) => {
|
|
1761
|
+
m?.preventDefault();
|
|
1762
|
+
const x = Object.keys(w.current).reduce(
|
|
1763
|
+
(W, M) => ({ ...W, [M]: !0 }),
|
|
1390
1764
|
{}
|
|
1391
1765
|
);
|
|
1392
|
-
|
|
1393
|
-
const I =
|
|
1394
|
-
if (
|
|
1395
|
-
|
|
1766
|
+
f(x);
|
|
1767
|
+
const I = y(w.current);
|
|
1768
|
+
if (p(I), Object.keys(I).length > 0) {
|
|
1769
|
+
t?.(I);
|
|
1396
1770
|
return;
|
|
1397
1771
|
}
|
|
1398
1772
|
(async () => {
|
|
1399
1773
|
h(!0);
|
|
1400
1774
|
try {
|
|
1401
|
-
await n?.(
|
|
1775
|
+
await n?.(w.current);
|
|
1402
1776
|
} finally {
|
|
1403
1777
|
h(!1);
|
|
1404
1778
|
}
|
|
1405
1779
|
})();
|
|
1406
1780
|
},
|
|
1407
|
-
[
|
|
1408
|
-
),
|
|
1409
|
-
|
|
1410
|
-
}, []),
|
|
1411
|
-
(
|
|
1412
|
-
|
|
1781
|
+
[y, n, t]
|
|
1782
|
+
), L = X((m, x) => {
|
|
1783
|
+
l((I) => ({ ...I, [m]: x }));
|
|
1784
|
+
}, []), g = X(
|
|
1785
|
+
(m) => {
|
|
1786
|
+
l(m ?? o), p({}), f({}), h(!1);
|
|
1413
1787
|
},
|
|
1414
1788
|
[o]
|
|
1415
|
-
),
|
|
1416
|
-
Object.entries(
|
|
1789
|
+
), C = Object.fromEntries(
|
|
1790
|
+
Object.entries(d).filter(([m]) => u[m])
|
|
1417
1791
|
);
|
|
1418
1792
|
return {
|
|
1419
|
-
values:
|
|
1420
|
-
errors:
|
|
1421
|
-
touched:
|
|
1422
|
-
handleChange:
|
|
1423
|
-
handleBlur:
|
|
1424
|
-
handleSubmit:
|
|
1425
|
-
setFieldValue:
|
|
1426
|
-
reset:
|
|
1427
|
-
isSubmitting:
|
|
1793
|
+
values: a,
|
|
1794
|
+
errors: C,
|
|
1795
|
+
touched: u,
|
|
1796
|
+
handleChange: z,
|
|
1797
|
+
handleBlur: O,
|
|
1798
|
+
handleSubmit: R,
|
|
1799
|
+
setFieldValue: L,
|
|
1800
|
+
reset: g,
|
|
1801
|
+
isSubmitting: $
|
|
1428
1802
|
};
|
|
1429
1803
|
}
|
|
1430
|
-
const
|
|
1804
|
+
const xs = (o = "Required") => (r) => {
|
|
1805
|
+
if (!r.trim())
|
|
1806
|
+
return o;
|
|
1807
|
+
}, ys = (o, r) => (n) => {
|
|
1808
|
+
if (n.length < o)
|
|
1809
|
+
return r ?? `Must be at least ${o} characters`;
|
|
1810
|
+
}, hs = (o, r) => (n) => {
|
|
1811
|
+
if (n.length > o)
|
|
1812
|
+
return r ?? `Must be at most ${o} characters`;
|
|
1813
|
+
}, ws = (o = "Enter a valid email") => (r) => {
|
|
1814
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))
|
|
1815
|
+
return o;
|
|
1816
|
+
}, ms = (o = "Enter a valid URL") => (r) => {
|
|
1817
|
+
try {
|
|
1818
|
+
new URL(r);
|
|
1819
|
+
return;
|
|
1820
|
+
} catch {
|
|
1821
|
+
return o;
|
|
1822
|
+
}
|
|
1823
|
+
}, vs = (o, r) => (n) => {
|
|
1824
|
+
if (!o.test(n))
|
|
1825
|
+
return r;
|
|
1826
|
+
};
|
|
1827
|
+
function ks(...o) {
|
|
1828
|
+
return (r) => {
|
|
1829
|
+
for (const n of o) {
|
|
1830
|
+
const t = n(r);
|
|
1831
|
+
if (t !== void 0)
|
|
1832
|
+
return t;
|
|
1833
|
+
}
|
|
1834
|
+
};
|
|
1835
|
+
}
|
|
1836
|
+
const _n = i.div`
|
|
1837
|
+
display: flex;
|
|
1838
|
+
flex-direction: column;
|
|
1839
|
+
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1840
|
+
`, jn = i.label`
|
|
1841
|
+
display: inline-flex;
|
|
1842
|
+
align-items: center;
|
|
1843
|
+
gap: ${({ theme: o }) => o.spacing[2]};
|
|
1844
|
+
cursor: ${({ $disabled: o }) => o ? "not-allowed" : "pointer"};
|
|
1845
|
+
opacity: ${({ $disabled: o }) => o ? 0.6 : 1};
|
|
1846
|
+
`, Hn = i.input`
|
|
1847
|
+
position: absolute;
|
|
1848
|
+
opacity: 0;
|
|
1849
|
+
width: 0;
|
|
1850
|
+
height: 0;
|
|
1851
|
+
margin: 0;
|
|
1852
|
+
padding: 0;
|
|
1853
|
+
|
|
1854
|
+
&:focus-visible + div {
|
|
1855
|
+
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
1856
|
+
}
|
|
1857
|
+
`, Yn = i.div`
|
|
1858
|
+
position: relative;
|
|
1859
|
+
display: flex;
|
|
1860
|
+
align-items: center;
|
|
1861
|
+
justify-content: center;
|
|
1862
|
+
flex-shrink: 0;
|
|
1863
|
+
border-radius: ${({ theme: o }) => o.radius.md};
|
|
1864
|
+
border: ${({ theme: o }) => o.brutalism?.borderWidth ?? "2px"} solid
|
|
1865
|
+
${({ $error: o, $borderColor: r, theme: n }) => o ? n.colors.error[500] : r ?? n.colors.neutral[900]};
|
|
1866
|
+
background-color: ${({ $checked: o, $color: r, theme: n }) => o ? r ?? n.colors.primary[500] : n.colors.neutral[0]};
|
|
1867
|
+
transition:
|
|
1868
|
+
background-color 0.1s,
|
|
1869
|
+
border-color 0.1s;
|
|
1870
|
+
|
|
1871
|
+
${({ $size: o = "md", theme: r }) => ({
|
|
1872
|
+
sm: s`
|
|
1873
|
+
width: ${r.spacing[4]};
|
|
1874
|
+
height: ${r.spacing[4]};
|
|
1875
|
+
`,
|
|
1876
|
+
md: s`
|
|
1877
|
+
width: ${r.spacing[5]};
|
|
1878
|
+
height: ${r.spacing[5]};
|
|
1879
|
+
`
|
|
1880
|
+
})[o]}
|
|
1881
|
+
|
|
1882
|
+
${({ $checked: o, $checkColor: r }) => o && s`
|
|
1883
|
+
&::after {
|
|
1884
|
+
content: "";
|
|
1885
|
+
display: block;
|
|
1886
|
+
width: 5px;
|
|
1887
|
+
height: 9px;
|
|
1888
|
+
border: 2px solid ${r ?? "currentColor"};
|
|
1889
|
+
border-top: none;
|
|
1890
|
+
border-left: none;
|
|
1891
|
+
transform: rotate(45deg) translate(-1px, -1px);
|
|
1892
|
+
}
|
|
1893
|
+
`}
|
|
1894
|
+
`, Un = i.span`
|
|
1895
|
+
font-size: ${({ $size: o = "md", theme: r }) => o === "sm" ? r.fontSizes.sm : r.fontSizes.md};
|
|
1896
|
+
font-weight: ${({ theme: o }) => o.fontWeights.medium};
|
|
1897
|
+
`, Kn = i.span`
|
|
1898
|
+
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
1899
|
+
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
1900
|
+
`;
|
|
1901
|
+
function qn({
|
|
1902
|
+
ref: o,
|
|
1903
|
+
label: r,
|
|
1904
|
+
size: n = "md",
|
|
1905
|
+
error: t,
|
|
1906
|
+
helperText: a,
|
|
1907
|
+
disabled: l,
|
|
1908
|
+
checked: d,
|
|
1909
|
+
id: p,
|
|
1910
|
+
color: u,
|
|
1911
|
+
borderColor: f,
|
|
1912
|
+
checkColor: $,
|
|
1913
|
+
...h
|
|
1914
|
+
}) {
|
|
1915
|
+
const w = Q(), y = p ?? w, v = typeof t == "string" ? t : void 0, z = !!(a || t);
|
|
1916
|
+
return /* @__PURE__ */ S(_n, { children: [
|
|
1917
|
+
/* @__PURE__ */ S(jn, { htmlFor: y, $disabled: l, children: [
|
|
1918
|
+
/* @__PURE__ */ e(
|
|
1919
|
+
Hn,
|
|
1920
|
+
{
|
|
1921
|
+
id: y,
|
|
1922
|
+
ref: o,
|
|
1923
|
+
type: "checkbox",
|
|
1924
|
+
checked: d,
|
|
1925
|
+
disabled: l,
|
|
1926
|
+
"aria-invalid": !!t,
|
|
1927
|
+
...h
|
|
1928
|
+
}
|
|
1929
|
+
),
|
|
1930
|
+
/* @__PURE__ */ e(
|
|
1931
|
+
Yn,
|
|
1932
|
+
{
|
|
1933
|
+
$checked: d,
|
|
1934
|
+
$error: !!t,
|
|
1935
|
+
$disabled: l,
|
|
1936
|
+
$size: n,
|
|
1937
|
+
$color: u,
|
|
1938
|
+
$borderColor: f,
|
|
1939
|
+
$checkColor: $
|
|
1940
|
+
}
|
|
1941
|
+
),
|
|
1942
|
+
r && /* @__PURE__ */ e(Un, { $size: n, children: r })
|
|
1943
|
+
] }),
|
|
1944
|
+
z && /* @__PURE__ */ e(Kn, { $error: !!t, children: v ?? a })
|
|
1945
|
+
] });
|
|
1946
|
+
}
|
|
1947
|
+
qn.displayName = "Checkbox";
|
|
1948
|
+
const Gn = i.div`
|
|
1949
|
+
display: flex;
|
|
1950
|
+
flex-direction: column;
|
|
1951
|
+
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1952
|
+
`, Xn = i.label`
|
|
1953
|
+
display: inline-flex;
|
|
1954
|
+
align-items: center;
|
|
1955
|
+
gap: ${({ theme: o }) => o.spacing[2]};
|
|
1956
|
+
cursor: ${({ $disabled: o }) => o ? "not-allowed" : "pointer"};
|
|
1957
|
+
opacity: ${({ $disabled: o }) => o ? 0.6 : 1};
|
|
1958
|
+
`, Jn = i.input`
|
|
1959
|
+
position: absolute;
|
|
1960
|
+
opacity: 0;
|
|
1961
|
+
width: 0;
|
|
1962
|
+
height: 0;
|
|
1963
|
+
margin: 0;
|
|
1964
|
+
padding: 0;
|
|
1965
|
+
|
|
1966
|
+
&:focus-visible + div {
|
|
1967
|
+
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
1968
|
+
}
|
|
1969
|
+
`, Qn = i.div`
|
|
1970
|
+
position: relative;
|
|
1971
|
+
display: flex;
|
|
1972
|
+
align-items: center;
|
|
1973
|
+
justify-content: center;
|
|
1974
|
+
flex-shrink: 0;
|
|
1975
|
+
border-radius: 50%;
|
|
1976
|
+
border: ${({ theme: o }) => o.brutalism?.borderWidth ?? "2px"} solid
|
|
1977
|
+
${({ $error: o, $borderColor: r, theme: n }) => o ? n.colors.error[500] : r ?? n.colors.neutral[900]};
|
|
1978
|
+
background-color: ${({ theme: o }) => o.colors.neutral[0]};
|
|
1979
|
+
transition:
|
|
1980
|
+
background-color 0.1s,
|
|
1981
|
+
border-color 0.1s;
|
|
1982
|
+
|
|
1983
|
+
${({ $size: o = "md", theme: r }) => ({
|
|
1984
|
+
sm: s`
|
|
1985
|
+
width: ${r.spacing[4]};
|
|
1986
|
+
height: ${r.spacing[4]};
|
|
1987
|
+
`,
|
|
1988
|
+
md: s`
|
|
1989
|
+
width: ${r.spacing[5]};
|
|
1990
|
+
height: ${r.spacing[5]};
|
|
1991
|
+
`
|
|
1992
|
+
})[o]}
|
|
1993
|
+
|
|
1994
|
+
${({ $checked: o, $color: r, theme: n }) => o && s`
|
|
1995
|
+
&::after {
|
|
1996
|
+
content: "";
|
|
1997
|
+
display: block;
|
|
1998
|
+
width: 8px;
|
|
1999
|
+
height: 8px;
|
|
2000
|
+
border-radius: 50%;
|
|
2001
|
+
background-color: ${r ?? n.colors.primary[500]};
|
|
2002
|
+
}
|
|
2003
|
+
`}
|
|
2004
|
+
`, Zn = i.span`
|
|
2005
|
+
font-size: ${({ $size: o = "md", theme: r }) => o === "sm" ? r.fontSizes.sm : r.fontSizes.md};
|
|
2006
|
+
font-weight: ${({ theme: o }) => o.fontWeights.medium};
|
|
2007
|
+
`, ot = i.span`
|
|
2008
|
+
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
2009
|
+
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
2010
|
+
`;
|
|
2011
|
+
function rt({
|
|
2012
|
+
ref: o,
|
|
2013
|
+
label: r,
|
|
2014
|
+
size: n = "md",
|
|
2015
|
+
error: t,
|
|
2016
|
+
helperText: a,
|
|
2017
|
+
disabled: l,
|
|
2018
|
+
checked: d,
|
|
2019
|
+
id: p,
|
|
2020
|
+
color: u,
|
|
2021
|
+
borderColor: f,
|
|
2022
|
+
...$
|
|
2023
|
+
}) {
|
|
2024
|
+
const h = Q(), w = p ?? h, y = !!(a || t);
|
|
2025
|
+
return /* @__PURE__ */ S(Gn, { children: [
|
|
2026
|
+
/* @__PURE__ */ S(Xn, { htmlFor: w, $disabled: l, children: [
|
|
2027
|
+
/* @__PURE__ */ e(
|
|
2028
|
+
Jn,
|
|
2029
|
+
{
|
|
2030
|
+
id: w,
|
|
2031
|
+
ref: o,
|
|
2032
|
+
type: "radio",
|
|
2033
|
+
checked: d,
|
|
2034
|
+
disabled: l,
|
|
2035
|
+
"aria-invalid": !!t,
|
|
2036
|
+
...$
|
|
2037
|
+
}
|
|
2038
|
+
),
|
|
2039
|
+
/* @__PURE__ */ e(
|
|
2040
|
+
Qn,
|
|
2041
|
+
{
|
|
2042
|
+
$checked: d,
|
|
2043
|
+
$error: t,
|
|
2044
|
+
$disabled: l,
|
|
2045
|
+
$size: n,
|
|
2046
|
+
$color: u,
|
|
2047
|
+
$borderColor: f
|
|
2048
|
+
}
|
|
2049
|
+
),
|
|
2050
|
+
r && /* @__PURE__ */ e(Zn, { $size: n, children: r })
|
|
2051
|
+
] }),
|
|
2052
|
+
y && /* @__PURE__ */ e(ot, { $error: t, children: a })
|
|
2053
|
+
] });
|
|
2054
|
+
}
|
|
2055
|
+
rt.displayName = "Radio";
|
|
2056
|
+
const nt = i.div`
|
|
2057
|
+
display: flex;
|
|
2058
|
+
flex-direction: column;
|
|
2059
|
+
gap: ${({ theme: o }) => o.spacing[1]};
|
|
2060
|
+
`, tt = i.label`
|
|
2061
|
+
display: inline-flex;
|
|
2062
|
+
align-items: center;
|
|
2063
|
+
gap: ${({ theme: o }) => o.spacing[2]};
|
|
2064
|
+
cursor: ${({ $disabled: o }) => o ? "not-allowed" : "pointer"};
|
|
2065
|
+
opacity: ${({ $disabled: o }) => o ? 0.6 : 1};
|
|
2066
|
+
`, st = i.input`
|
|
2067
|
+
position: absolute;
|
|
2068
|
+
opacity: 0;
|
|
2069
|
+
width: 0;
|
|
2070
|
+
height: 0;
|
|
2071
|
+
margin: 0;
|
|
2072
|
+
padding: 0;
|
|
2073
|
+
|
|
2074
|
+
&:focus-visible + div {
|
|
2075
|
+
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
2076
|
+
}
|
|
2077
|
+
`, et = i.div`
|
|
2078
|
+
position: relative;
|
|
2079
|
+
flex-shrink: 0;
|
|
2080
|
+
border-radius: 9999px;
|
|
2081
|
+
border: ${({ theme: o }) => o.brutalism?.borderWidth ?? "2px"} solid
|
|
2082
|
+
${({ $borderColor: o, theme: r }) => o ?? r.colors.neutral[900]};
|
|
2083
|
+
background-color: ${({ $checked: o, $color: r, theme: n }) => o ? r ?? n.colors.primary[500] : n.colors.neutral[200]};
|
|
2084
|
+
transition:
|
|
2085
|
+
background-color 0.15s,
|
|
2086
|
+
box-shadow 0.15s;
|
|
2087
|
+
|
|
2088
|
+
${({ $checked: o, theme: r }) => o && s`
|
|
2089
|
+
box-shadow: ${r.brutalism?.shadowOffset ?? "4px"}
|
|
2090
|
+
${r.brutalism?.shadowOffset ?? "4px"} 0 ${r.colors.neutral[900]};
|
|
2091
|
+
`}
|
|
2092
|
+
|
|
2093
|
+
${({ $size: o = "md" }) => ({
|
|
2094
|
+
sm: s`
|
|
2095
|
+
width: 36px;
|
|
2096
|
+
height: 20px;
|
|
2097
|
+
`,
|
|
2098
|
+
md: s`
|
|
2099
|
+
width: 44px;
|
|
2100
|
+
height: 24px;
|
|
2101
|
+
`
|
|
2102
|
+
})[o]}
|
|
2103
|
+
|
|
2104
|
+
&::after {
|
|
2105
|
+
content: "";
|
|
2106
|
+
position: absolute;
|
|
2107
|
+
top: 50%;
|
|
2108
|
+
border-radius: 50%;
|
|
2109
|
+
background-color: ${({ theme: o }) => o.colors.neutral[0]};
|
|
2110
|
+
border: 2px solid ${({ theme: o }) => o.colors.neutral[900]};
|
|
2111
|
+
transition: transform 0.15s;
|
|
2112
|
+
|
|
2113
|
+
${({ $size: o = "md", $checked: r }) => {
|
|
2114
|
+
const n = s`
|
|
2115
|
+
width: 12px;
|
|
2116
|
+
height: 12px;
|
|
2117
|
+
margin-top: -6px;
|
|
2118
|
+
transform: translateX(${r ? "calc(100% + 4px)" : "2px"});
|
|
2119
|
+
`, t = s`
|
|
2120
|
+
width: 16px;
|
|
2121
|
+
height: 16px;
|
|
2122
|
+
margin-top: -8px;
|
|
2123
|
+
transform: translateX(${r ? "calc(100% + 4px)" : "2px"});
|
|
2124
|
+
`;
|
|
2125
|
+
return o === "sm" ? n : t;
|
|
2126
|
+
}}
|
|
2127
|
+
}
|
|
2128
|
+
`, it = i.span`
|
|
2129
|
+
font-size: ${({ $size: o = "md", theme: r }) => o === "sm" ? r.fontSizes.sm : r.fontSizes.md};
|
|
2130
|
+
font-weight: ${({ theme: o }) => o.fontWeights.medium};
|
|
2131
|
+
`;
|
|
2132
|
+
function at({
|
|
2133
|
+
ref: o,
|
|
2134
|
+
label: r,
|
|
2135
|
+
size: n = "md",
|
|
2136
|
+
disabled: t,
|
|
2137
|
+
checked: a,
|
|
2138
|
+
id: l,
|
|
2139
|
+
color: d,
|
|
2140
|
+
borderColor: p,
|
|
2141
|
+
...u
|
|
2142
|
+
}) {
|
|
2143
|
+
const f = Q(), $ = l ?? f;
|
|
2144
|
+
return /* @__PURE__ */ e(nt, { children: /* @__PURE__ */ S(tt, { htmlFor: $, $disabled: t, children: [
|
|
2145
|
+
/* @__PURE__ */ e(
|
|
2146
|
+
st,
|
|
2147
|
+
{
|
|
2148
|
+
id: $,
|
|
2149
|
+
ref: o,
|
|
2150
|
+
type: "checkbox",
|
|
2151
|
+
role: "switch",
|
|
2152
|
+
checked: a,
|
|
2153
|
+
disabled: t,
|
|
2154
|
+
...u
|
|
2155
|
+
}
|
|
2156
|
+
),
|
|
2157
|
+
/* @__PURE__ */ e(
|
|
2158
|
+
et,
|
|
2159
|
+
{
|
|
2160
|
+
$checked: a,
|
|
2161
|
+
$size: n,
|
|
2162
|
+
$color: d,
|
|
2163
|
+
$borderColor: p
|
|
2164
|
+
}
|
|
2165
|
+
),
|
|
2166
|
+
r && /* @__PURE__ */ e(it, { $size: n, children: r })
|
|
2167
|
+
] }) });
|
|
2168
|
+
}
|
|
2169
|
+
at.displayName = "Switch";
|
|
2170
|
+
const lt = i.div`
|
|
1431
2171
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
1432
2172
|
background: ${({ theme: o }) => o.colors.neutral[0]};
|
|
1433
2173
|
overflow: hidden;
|
|
1434
2174
|
|
|
1435
|
-
${({ theme: o, $accentColor: r }) => o.brutalism ?
|
|
2175
|
+
${({ theme: o, $accentColor: r }) => o.brutalism ? s`
|
|
1436
2176
|
border: ${o.brutalism.borderWidth} solid
|
|
1437
2177
|
${r ?? o.colors.neutral[900]};
|
|
1438
2178
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
1439
2179
|
${o.brutalism.shadowOffset} 0
|
|
1440
2180
|
${r ?? o.colors.neutral[900]};
|
|
1441
|
-
` :
|
|
2181
|
+
` : s`
|
|
1442
2182
|
border: 1px solid ${r ?? o.colors.neutral[200]};
|
|
1443
2183
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
1444
2184
|
`}
|
|
1445
|
-
`,
|
|
2185
|
+
`, ct = i.button`
|
|
1446
2186
|
width: 100%;
|
|
1447
2187
|
display: flex;
|
|
1448
2188
|
align-items: flex-start;
|
|
@@ -1462,19 +2202,19 @@ const cn = i.div`
|
|
|
1462
2202
|
${({ theme: o, $accentColor: r }) => r ?? o.colors.primary[500]};
|
|
1463
2203
|
outline-offset: -2px;
|
|
1464
2204
|
}
|
|
1465
|
-
`,
|
|
2205
|
+
`, dt = i.div`
|
|
1466
2206
|
flex: 1;
|
|
1467
2207
|
min-width: 0;
|
|
1468
|
-
`,
|
|
2208
|
+
`, ut = i.span`
|
|
1469
2209
|
display: block;
|
|
1470
2210
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
1471
|
-
font-weight:
|
|
2211
|
+
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
1472
2212
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
1473
|
-
`,
|
|
2213
|
+
`, pt = i.span`
|
|
1474
2214
|
display: block;
|
|
1475
2215
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1476
2216
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
1477
|
-
`,
|
|
2217
|
+
`, ft = i.div`
|
|
1478
2218
|
display: flex;
|
|
1479
2219
|
flex-direction: row;
|
|
1480
2220
|
align-items: center;
|
|
@@ -1486,11 +2226,11 @@ const cn = i.div`
|
|
|
1486
2226
|
align-items: flex-start;
|
|
1487
2227
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
1488
2228
|
}
|
|
1489
|
-
`,
|
|
2229
|
+
`, $t = i.div`
|
|
1490
2230
|
display: flex;
|
|
1491
2231
|
align-items: center;
|
|
1492
2232
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
1493
|
-
`,
|
|
2233
|
+
`, gt = i.span`
|
|
1494
2234
|
display: inline-flex;
|
|
1495
2235
|
align-items: center;
|
|
1496
2236
|
justify-content: center;
|
|
@@ -1498,175 +2238,186 @@ const cn = i.div`
|
|
|
1498
2238
|
transition: transform 0.2s ease;
|
|
1499
2239
|
transform: ${({ $open: o }) => o ? "rotate(180deg)" : "rotate(0deg)"};
|
|
1500
2240
|
color: ${({ theme: o, $accentColor: r }) => r ?? o.colors.neutral[500]};
|
|
1501
|
-
`,
|
|
2241
|
+
`, bt = i.div`
|
|
1502
2242
|
display: grid;
|
|
1503
2243
|
grid-template-rows: ${({ $open: o }) => o ? "1fr" : "0fr"};
|
|
1504
2244
|
transition: grid-template-rows 0.2s ease;
|
|
1505
|
-
`,
|
|
2245
|
+
`, xt = i.div`
|
|
1506
2246
|
overflow: hidden;
|
|
1507
|
-
`,
|
|
2247
|
+
`, yt = i.div`
|
|
1508
2248
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
1509
2249
|
border-top: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
1510
2250
|
`;
|
|
1511
|
-
function
|
|
2251
|
+
function ht({
|
|
1512
2252
|
title: o,
|
|
1513
2253
|
children: r,
|
|
1514
2254
|
defaultOpen: n = !1,
|
|
1515
|
-
open:
|
|
1516
|
-
onToggle:
|
|
1517
|
-
subtitle:
|
|
1518
|
-
headerActions:
|
|
1519
|
-
accentColor:
|
|
2255
|
+
open: t,
|
|
2256
|
+
onToggle: a,
|
|
2257
|
+
subtitle: l,
|
|
2258
|
+
headerActions: d,
|
|
2259
|
+
accentColor: p
|
|
1520
2260
|
}) {
|
|
1521
|
-
const [
|
|
1522
|
-
return /* @__PURE__ */
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
|
|
2261
|
+
const [u, f] = T(n), $ = Q(), h = t !== void 0, w = h ? t : u;
|
|
2262
|
+
return /* @__PURE__ */ S(lt, { $accentColor: p, children: [
|
|
2263
|
+
/* @__PURE__ */ S(
|
|
2264
|
+
ct,
|
|
1525
2265
|
{
|
|
1526
2266
|
type: "button",
|
|
1527
|
-
$open:
|
|
1528
|
-
$accentColor:
|
|
1529
|
-
"aria-expanded":
|
|
1530
|
-
"aria-controls":
|
|
2267
|
+
$open: w,
|
|
2268
|
+
$accentColor: p,
|
|
2269
|
+
"aria-expanded": w,
|
|
2270
|
+
"aria-controls": $,
|
|
1531
2271
|
onClick: () => {
|
|
1532
|
-
const
|
|
1533
|
-
h ||
|
|
2272
|
+
const v = !w;
|
|
2273
|
+
h || f(v), a?.(v);
|
|
1534
2274
|
},
|
|
1535
2275
|
children: [
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
/* @__PURE__ */
|
|
1538
|
-
(
|
|
1539
|
-
|
|
1540
|
-
|
|
2276
|
+
/* @__PURE__ */ S(dt, { children: [
|
|
2277
|
+
/* @__PURE__ */ e(ut, { children: o }),
|
|
2278
|
+
(l || d) && /* @__PURE__ */ S(ft, { children: [
|
|
2279
|
+
l && /* @__PURE__ */ e(pt, { children: l }),
|
|
2280
|
+
d && /* @__PURE__ */ e($t, { onClick: (v) => v.stopPropagation(), children: d })
|
|
1541
2281
|
] })
|
|
1542
2282
|
] }),
|
|
1543
|
-
/* @__PURE__ */
|
|
1544
|
-
|
|
2283
|
+
/* @__PURE__ */ e(
|
|
2284
|
+
gt,
|
|
1545
2285
|
{
|
|
1546
|
-
$open:
|
|
1547
|
-
$accentColor:
|
|
2286
|
+
$open: w,
|
|
2287
|
+
$accentColor: p,
|
|
1548
2288
|
"aria-hidden": "true",
|
|
1549
|
-
children: /* @__PURE__ */
|
|
2289
|
+
children: /* @__PURE__ */ e(Ko, { size: 18, strokeWidth: 2.5 })
|
|
1550
2290
|
}
|
|
1551
2291
|
)
|
|
1552
2292
|
]
|
|
1553
2293
|
}
|
|
1554
2294
|
),
|
|
1555
|
-
/* @__PURE__ */
|
|
2295
|
+
/* @__PURE__ */ e(bt, { $open: w, children: /* @__PURE__ */ e(xt, { id: $, role: "region", "aria-label": o, children: /* @__PURE__ */ e(yt, { children: r }) }) })
|
|
1556
2296
|
] });
|
|
1557
2297
|
}
|
|
1558
|
-
|
|
1559
|
-
const
|
|
2298
|
+
ht.displayName = "CollapsibleCard";
|
|
2299
|
+
const wt = J`
|
|
1560
2300
|
to { transform: rotate(360deg); }
|
|
1561
|
-
`,
|
|
2301
|
+
`, mt = {
|
|
1562
2302
|
sm: "16px",
|
|
1563
2303
|
md: "24px",
|
|
1564
2304
|
lg: "40px"
|
|
1565
|
-
},
|
|
2305
|
+
}, vt = {
|
|
1566
2306
|
thin: "2px",
|
|
1567
2307
|
normal: "3px",
|
|
1568
2308
|
bold: "5px"
|
|
1569
|
-
},
|
|
2309
|
+
}, kt = i.span`
|
|
1570
2310
|
display: inline-block;
|
|
1571
2311
|
border-radius: 50%;
|
|
1572
|
-
animation: ${
|
|
1573
|
-
|
|
1574
|
-
${({ $size: o = "md", $weight: r = "normal", $color: n, theme:
|
|
1575
|
-
const
|
|
1576
|
-
return
|
|
1577
|
-
width: ${
|
|
1578
|
-
height: ${
|
|
1579
|
-
border: ${
|
|
1580
|
-
border-top-color: ${
|
|
2312
|
+
animation: ${wt} 0.7s linear infinite;
|
|
2313
|
+
|
|
2314
|
+
${({ $size: o = "md", $weight: r = "normal", $color: n, theme: t }) => {
|
|
2315
|
+
const a = mt[o], l = vt[r], d = t.colors.neutral[200], p = n ?? t.colors.primary[500];
|
|
2316
|
+
return s`
|
|
2317
|
+
width: ${a};
|
|
2318
|
+
height: ${a};
|
|
2319
|
+
border: ${l} solid ${d};
|
|
2320
|
+
border-top-color: ${p};
|
|
1581
2321
|
`;
|
|
1582
2322
|
}}
|
|
1583
2323
|
`;
|
|
1584
|
-
function
|
|
2324
|
+
function St({
|
|
1585
2325
|
size: o = "md",
|
|
1586
2326
|
weight: r = "normal",
|
|
1587
2327
|
color: n,
|
|
1588
|
-
label:
|
|
2328
|
+
label: t = "Loading..."
|
|
1589
2329
|
}) {
|
|
1590
|
-
return /* @__PURE__ */
|
|
1591
|
-
|
|
2330
|
+
return /* @__PURE__ */ e(
|
|
2331
|
+
kt,
|
|
1592
2332
|
{
|
|
1593
2333
|
$size: o,
|
|
1594
2334
|
$weight: r,
|
|
1595
2335
|
$color: n,
|
|
1596
2336
|
role: "status",
|
|
1597
|
-
"aria-label":
|
|
2337
|
+
"aria-label": t
|
|
1598
2338
|
}
|
|
1599
2339
|
);
|
|
1600
2340
|
}
|
|
1601
|
-
|
|
1602
|
-
|
|
2341
|
+
St.displayName = "Spinner";
|
|
2342
|
+
const zt = 7, Fo = 3, Ao = 1;
|
|
2343
|
+
function Ss({
|
|
2344
|
+
defaultSort: o,
|
|
2345
|
+
defaultPage: r = 1
|
|
2346
|
+
} = {}) {
|
|
2347
|
+
const [n, t] = T(o ?? null), [a, l] = T(r);
|
|
2348
|
+
return { sort: n, page: a, onSortChange: (u) => {
|
|
2349
|
+
t(u), l(1);
|
|
2350
|
+
}, onPageChange: (u) => {
|
|
2351
|
+
l(u);
|
|
2352
|
+
} };
|
|
2353
|
+
}
|
|
2354
|
+
function Ct(o, r) {
|
|
1603
2355
|
return o?.key !== r ? { key: r, direction: "asc" } : o.direction === "asc" ? { key: r, direction: "desc" } : null;
|
|
1604
2356
|
}
|
|
1605
|
-
function
|
|
2357
|
+
function It({
|
|
1606
2358
|
data: o,
|
|
1607
2359
|
sort: r,
|
|
1608
2360
|
defaultSort: n,
|
|
1609
|
-
onSortChange:
|
|
2361
|
+
onSortChange: t
|
|
1610
2362
|
}) {
|
|
1611
|
-
const
|
|
2363
|
+
const a = r !== void 0, [l, d] = T(
|
|
1612
2364
|
n ?? null
|
|
1613
|
-
),
|
|
1614
|
-
const h =
|
|
1615
|
-
return
|
|
1616
|
-
},
|
|
1617
|
-
const
|
|
1618
|
-
return
|
|
1619
|
-
}), [o,
|
|
1620
|
-
return { activeSort:
|
|
2365
|
+
), p = a ? r ?? null : l, u = ($) => {
|
|
2366
|
+
const h = Ct(p, $);
|
|
2367
|
+
return a || d(h), t?.(h), h;
|
|
2368
|
+
}, f = Do(() => a || !p ? o : [...o].sort(($, h) => {
|
|
2369
|
+
const w = $[p.key], y = h[p.key], v = w < y ? -1 : w > y ? 1 : 0;
|
|
2370
|
+
return p.direction === "asc" ? v : -v;
|
|
2371
|
+
}), [o, p, a]);
|
|
2372
|
+
return { activeSort: p, sortedData: f, handleSort: u };
|
|
1621
2373
|
}
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
return Array.from({ length: r }, (e, l) => l + 1);
|
|
2374
|
+
function Tt(o, r) {
|
|
2375
|
+
if (r <= zt)
|
|
2376
|
+
return Array.from({ length: r }, (t, a) => a + 1);
|
|
1626
2377
|
const n = [1];
|
|
1627
|
-
o >
|
|
1628
|
-
for (let
|
|
1629
|
-
n.push(
|
|
1630
|
-
return o < r -
|
|
2378
|
+
o > Fo && n.push("...");
|
|
2379
|
+
for (let t = Math.max(2, o - Ao); t <= Math.min(r - 1, o + Ao); t++)
|
|
2380
|
+
n.push(t);
|
|
2381
|
+
return o < r - Fo + 1 && n.push("..."), n.push(r), n;
|
|
1631
2382
|
}
|
|
1632
|
-
function
|
|
2383
|
+
function Wt({
|
|
1633
2384
|
data: o,
|
|
1634
2385
|
pageSize: r,
|
|
1635
2386
|
page: n,
|
|
1636
|
-
defaultPage:
|
|
1637
|
-
totalRows:
|
|
1638
|
-
onPageChange:
|
|
2387
|
+
defaultPage: t,
|
|
2388
|
+
totalRows: a,
|
|
2389
|
+
onPageChange: l
|
|
1639
2390
|
}) {
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1642
|
-
}, h =
|
|
2391
|
+
const d = n !== void 0, [p, u] = T(t ?? 1), f = d ? n : p, $ = (z) => {
|
|
2392
|
+
d || u(z), l?.(z);
|
|
2393
|
+
}, h = d || a !== void 0, w = a ?? o.length, y = r ? Math.max(1, Math.ceil(w / r)) : 1, v = Do(() => {
|
|
1643
2394
|
if (!r || h)
|
|
1644
2395
|
return o;
|
|
1645
|
-
const
|
|
1646
|
-
return o.slice(
|
|
1647
|
-
}, [o, r,
|
|
1648
|
-
return { activePage:
|
|
2396
|
+
const z = (f - 1) * r;
|
|
2397
|
+
return o.slice(z, z + r);
|
|
2398
|
+
}, [o, r, f, h]);
|
|
2399
|
+
return { activePage: f, totalPages: y, displayData: v, handlePageChange: $ };
|
|
1649
2400
|
}
|
|
1650
|
-
const
|
|
2401
|
+
const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg" ? `${r.spacing[3]} ${r.spacing[4]}` : `${r.spacing[2]} ${r.spacing[3]}`, Dt = i.div`
|
|
1651
2402
|
width: 100%;
|
|
1652
2403
|
|
|
1653
|
-
${({ theme: o, $borderColor: r }) => o.brutalism ?
|
|
2404
|
+
${({ theme: o, $borderColor: r }) => o.brutalism ? s`
|
|
1654
2405
|
border: ${o.brutalism.borderWidth} solid
|
|
1655
2406
|
${r ?? o.colors.neutral[900]};
|
|
1656
2407
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
1657
2408
|
${o.brutalism.shadowOffset} 0
|
|
1658
2409
|
${r ?? o.colors.neutral[900]};
|
|
1659
|
-
` :
|
|
2410
|
+
` : s`
|
|
1660
2411
|
border: 1px solid ${r ?? o.colors.neutral[300]};
|
|
1661
2412
|
border-radius: ${o.radius.md};
|
|
1662
2413
|
overflow: hidden;
|
|
1663
2414
|
`}
|
|
1664
2415
|
|
|
1665
2416
|
overflow-x: auto;
|
|
1666
|
-
${({ $stickyHeader: o }) => o &&
|
|
2417
|
+
${({ $stickyHeader: o }) => o && s`
|
|
1667
2418
|
overflow-y: auto;
|
|
1668
2419
|
`}
|
|
1669
|
-
`,
|
|
2420
|
+
`, Et = i.table`
|
|
1670
2421
|
width: 100%;
|
|
1671
2422
|
border-collapse: collapse;
|
|
1672
2423
|
font-size: ${({ $size: o, theme: r }) => ({
|
|
@@ -1676,36 +2427,36 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
1676
2427
|
})[o]};
|
|
1677
2428
|
|
|
1678
2429
|
caption {
|
|
1679
|
-
padding:
|
|
2430
|
+
padding: ${({ theme: o }) => o.spacing[2]} 0;
|
|
1680
2431
|
}
|
|
1681
|
-
`,
|
|
1682
|
-
${({ $stickyHeader: o }) => o &&
|
|
2432
|
+
`, Mt = i.thead`
|
|
2433
|
+
${({ $stickyHeader: o }) => o && s`
|
|
1683
2434
|
position: sticky;
|
|
1684
2435
|
top: 0;
|
|
1685
2436
|
z-index: 1;
|
|
1686
2437
|
`}
|
|
1687
2438
|
|
|
1688
|
-
${({ theme: o, $headerColor: r, $borderColor: n }) => r ?
|
|
2439
|
+
${({ theme: o, $headerColor: r, $borderColor: n }) => r ? s`
|
|
1689
2440
|
--th-bg: ${r};
|
|
1690
2441
|
--th-text: ${o.colors.neutral[0]};
|
|
1691
2442
|
--th-sep: rgba(255, 255, 255, 0.25);
|
|
1692
|
-
` : o.brutalism ?
|
|
2443
|
+
` : o.brutalism ? s`
|
|
1693
2444
|
--th-bg: ${o.colors.neutral[900]};
|
|
1694
2445
|
--th-text: ${o.colors.neutral[0]};
|
|
1695
2446
|
--th-sep: ${n ?? o.colors.neutral[600]};
|
|
1696
|
-
` :
|
|
2447
|
+
` : s`
|
|
1697
2448
|
--th-bg: ${o.colors.neutral[100]};
|
|
1698
2449
|
--th-text: ${o.colors.neutral[600]};
|
|
1699
2450
|
--th-sep: ${n ?? o.colors.neutral[300]};
|
|
1700
2451
|
`}
|
|
1701
|
-
`,
|
|
1702
|
-
${({ $rowColor: o }) => o &&
|
|
2452
|
+
`, Ot = i.tbody`
|
|
2453
|
+
${({ $rowColor: o }) => o && s`
|
|
1703
2454
|
tr {
|
|
1704
2455
|
background-color: ${o};
|
|
1705
2456
|
}
|
|
1706
2457
|
`}
|
|
1707
2458
|
|
|
1708
|
-
${({ $striped: o, theme: r, $stripeColor: n }) => o &&
|
|
2459
|
+
${({ $striped: o, theme: r, $stripeColor: n }) => o && s`
|
|
1709
2460
|
tr:nth-child(even) {
|
|
1710
2461
|
background-color: ${n ?? r.colors.neutral[100]};
|
|
1711
2462
|
}
|
|
@@ -1718,7 +2469,7 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
1718
2469
|
tr:hover td {
|
|
1719
2470
|
background-color: rgba(0, 0, 0, 0.04);
|
|
1720
2471
|
}
|
|
1721
|
-
`,
|
|
2472
|
+
`, $o = i.tr``, Lt = i($o)`
|
|
1722
2473
|
cursor: pointer;
|
|
1723
2474
|
|
|
1724
2475
|
td {
|
|
@@ -1735,25 +2486,25 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
1735
2486
|
box-shadow: inset 4px 0 0
|
|
1736
2487
|
${({ $accentColor: o, theme: r }) => o ?? r.colors.neutral[900]};
|
|
1737
2488
|
}
|
|
1738
|
-
`,
|
|
2489
|
+
`, Nt = i.th`
|
|
1739
2490
|
background-color: var(--th-bg);
|
|
1740
2491
|
color: var(--th-text);
|
|
1741
2492
|
text-align: left;
|
|
1742
|
-
font-weight:
|
|
2493
|
+
font-weight: ${({ theme: o }) => o.fontWeights.bold};
|
|
1743
2494
|
white-space: nowrap;
|
|
1744
2495
|
|
|
1745
|
-
padding: ${({ $size: o, theme: r }) =>
|
|
2496
|
+
padding: ${({ $size: o, theme: r }) => er(o, r)};
|
|
1746
2497
|
|
|
1747
|
-
${({ theme: o, $bordered: r }) => o.brutalism ?
|
|
2498
|
+
${({ theme: o, $bordered: r }) => o.brutalism ? s`` : s`
|
|
1748
2499
|
border-bottom: 2px solid var(--th-sep);
|
|
1749
|
-
${r &&
|
|
2500
|
+
${r && s`
|
|
1750
2501
|
border-right: 1px solid var(--th-sep);
|
|
1751
2502
|
&:last-child {
|
|
1752
2503
|
border-right: none;
|
|
1753
2504
|
}
|
|
1754
2505
|
`}
|
|
1755
2506
|
`}
|
|
1756
|
-
`,
|
|
2507
|
+
`, Pt = i.button`
|
|
1757
2508
|
display: inline-flex;
|
|
1758
2509
|
align-items: center;
|
|
1759
2510
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
@@ -1762,7 +2513,7 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
1762
2513
|
cursor: pointer;
|
|
1763
2514
|
font: inherit;
|
|
1764
2515
|
color: inherit;
|
|
1765
|
-
font-weight:
|
|
2516
|
+
font-weight: ${({ theme: o }) => o.fontWeights.bold};
|
|
1766
2517
|
padding: 0;
|
|
1767
2518
|
width: 100%;
|
|
1768
2519
|
text-align: left;
|
|
@@ -1772,39 +2523,39 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
1772
2523
|
outline-offset: 2px;
|
|
1773
2524
|
border-radius: 2px;
|
|
1774
2525
|
}
|
|
1775
|
-
`,
|
|
2526
|
+
`, Rt = i.span`
|
|
1776
2527
|
opacity: 0.5;
|
|
1777
2528
|
display: inline-flex;
|
|
1778
2529
|
align-items: center;
|
|
1779
|
-
`,
|
|
1780
|
-
padding: ${({ $size: o, theme: r }) =>
|
|
2530
|
+
`, ir = i.td`
|
|
2531
|
+
padding: ${({ $size: o, theme: r }) => er(o, r)};
|
|
1781
2532
|
|
|
1782
|
-
${({ $bordered: o, $borderColor: r, theme: n }) => n.brutalism ?
|
|
2533
|
+
${({ $bordered: o, $borderColor: r, theme: n }) => n.brutalism ? s`
|
|
1783
2534
|
border-bottom: ${n.brutalism.borderWidth} solid
|
|
1784
2535
|
${r ?? n.colors.neutral[900]};
|
|
1785
|
-
${o &&
|
|
2536
|
+
${o && s`
|
|
1786
2537
|
border-right: ${n.brutalism.borderWidth} solid
|
|
1787
2538
|
${r ?? n.colors.neutral[900]};
|
|
1788
2539
|
&:last-child {
|
|
1789
2540
|
border-right: none;
|
|
1790
2541
|
}
|
|
1791
2542
|
`}
|
|
1792
|
-
` : o ?
|
|
2543
|
+
` : o ? s`
|
|
1793
2544
|
border: 1px solid ${r ?? n.colors.neutral[300]};
|
|
1794
|
-
` :
|
|
2545
|
+
` : s`
|
|
1795
2546
|
border-bottom: 1px solid
|
|
1796
2547
|
${r ?? n.colors.neutral[200]};
|
|
1797
2548
|
`}
|
|
1798
|
-
`,
|
|
2549
|
+
`, Vt = i.td`
|
|
1799
2550
|
text-align: center;
|
|
1800
2551
|
color: ${({ theme: o }) => o.colors.neutral[400]};
|
|
1801
2552
|
padding: ${({ theme: o }) => `${o.spacing[4]} ${o.spacing[3]}`};
|
|
1802
2553
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1803
2554
|
border-bottom: none;
|
|
1804
|
-
`,
|
|
2555
|
+
`, Ft = J`
|
|
1805
2556
|
0% { background-position: -400px 0; }
|
|
1806
2557
|
100% { background-position: 400px 0; }
|
|
1807
|
-
`,
|
|
2558
|
+
`, At = i(ir)``, Bt = i.div`
|
|
1808
2559
|
height: 14px;
|
|
1809
2560
|
border-radius: 4px;
|
|
1810
2561
|
background: linear-gradient(
|
|
@@ -1814,21 +2565,21 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
1814
2565
|
${({ theme: o }) => o.colors.neutral[200]} 75%
|
|
1815
2566
|
);
|
|
1816
2567
|
background-size: 800px 100%;
|
|
1817
|
-
animation: ${
|
|
1818
|
-
`,
|
|
2568
|
+
animation: ${Ft} 1.6s ease-in-out infinite;
|
|
2569
|
+
`, _t = i.div`
|
|
1819
2570
|
display: flex;
|
|
1820
2571
|
align-items: center;
|
|
1821
2572
|
justify-content: center;
|
|
1822
2573
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1823
2574
|
padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
|
|
1824
2575
|
|
|
1825
|
-
${({ theme: o }) => o.brutalism ?
|
|
2576
|
+
${({ theme: o }) => o.brutalism ? s`
|
|
1826
2577
|
border-top: ${o.brutalism.borderWidth} solid
|
|
1827
2578
|
${o.colors.neutral[900]};
|
|
1828
|
-
` :
|
|
2579
|
+
` : s`
|
|
1829
2580
|
border-top: 1px solid ${o.colors.neutral[200]};
|
|
1830
2581
|
`}
|
|
1831
|
-
`,
|
|
2582
|
+
`, vo = i.button`
|
|
1832
2583
|
display: inline-flex;
|
|
1833
2584
|
align-items: center;
|
|
1834
2585
|
justify-content: center;
|
|
@@ -1839,7 +2590,7 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
1839
2590
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1840
2591
|
cursor: pointer;
|
|
1841
2592
|
|
|
1842
|
-
${({ $active: o, theme: r }) => r.brutalism ?
|
|
2593
|
+
${({ $active: o, theme: r }) => r.brutalism ? s`
|
|
1843
2594
|
border: ${r.brutalism.borderWidth} solid
|
|
1844
2595
|
${r.colors.neutral[900]};
|
|
1845
2596
|
background: ${o ? r.colors.neutral[900] : "transparent"};
|
|
@@ -1849,7 +2600,7 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
1849
2600
|
&:hover:not(:disabled) {
|
|
1850
2601
|
background: ${o ? r.colors.neutral[600] : r.colors.neutral[100]};
|
|
1851
2602
|
}
|
|
1852
|
-
` :
|
|
2603
|
+
` : s`
|
|
1853
2604
|
border: 1px solid
|
|
1854
2605
|
${o ? r.colors.primary[500] : "transparent"};
|
|
1855
2606
|
border-radius: ${r.radius.md};
|
|
@@ -1871,180 +2622,180 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
1871
2622
|
outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
|
|
1872
2623
|
outline-offset: 2px;
|
|
1873
2624
|
}
|
|
1874
|
-
`,
|
|
1875
|
-
function
|
|
1876
|
-
return o?.key !== r ? /* @__PURE__ */
|
|
2625
|
+
`, jt = 4;
|
|
2626
|
+
function Ht(o, r) {
|
|
2627
|
+
return o?.key !== r ? /* @__PURE__ */ e(Vr, { size: 14 }) : o.direction === "asc" ? /* @__PURE__ */ e(Ar, { size: 14 }) : /* @__PURE__ */ e(Pr, { size: 14 });
|
|
1877
2628
|
}
|
|
1878
|
-
function
|
|
2629
|
+
function Yt({
|
|
1879
2630
|
columns: o,
|
|
1880
2631
|
data: r,
|
|
1881
2632
|
rowKey: n,
|
|
1882
|
-
size:
|
|
1883
|
-
striped:
|
|
1884
|
-
bordered:
|
|
1885
|
-
stickyHeader:
|
|
1886
|
-
caption:
|
|
1887
|
-
emptyMessage:
|
|
1888
|
-
loading:
|
|
1889
|
-
sort:
|
|
2633
|
+
size: t = "md",
|
|
2634
|
+
striped: a,
|
|
2635
|
+
bordered: l,
|
|
2636
|
+
stickyHeader: d,
|
|
2637
|
+
caption: p,
|
|
2638
|
+
emptyMessage: u = "No data",
|
|
2639
|
+
loading: f,
|
|
2640
|
+
sort: $,
|
|
1890
2641
|
defaultSort: h,
|
|
1891
|
-
onSortChange:
|
|
1892
|
-
pageSize:
|
|
1893
|
-
page:
|
|
1894
|
-
defaultPage:
|
|
1895
|
-
totalRows:
|
|
1896
|
-
onPageChange:
|
|
1897
|
-
onChange:
|
|
1898
|
-
onRowClick:
|
|
1899
|
-
borderColor:
|
|
1900
|
-
headerColor:
|
|
1901
|
-
rowColor:
|
|
2642
|
+
onSortChange: w,
|
|
2643
|
+
pageSize: y,
|
|
2644
|
+
page: v,
|
|
2645
|
+
defaultPage: z,
|
|
2646
|
+
totalRows: O,
|
|
2647
|
+
onPageChange: R,
|
|
2648
|
+
onChange: L,
|
|
2649
|
+
onRowClick: g,
|
|
2650
|
+
borderColor: C,
|
|
2651
|
+
headerColor: m,
|
|
2652
|
+
rowColor: x,
|
|
1902
2653
|
stripeColor: I,
|
|
1903
|
-
className:
|
|
1904
|
-
style:
|
|
2654
|
+
className: D,
|
|
2655
|
+
style: W
|
|
1905
2656
|
}) {
|
|
1906
2657
|
const {
|
|
1907
|
-
activeSort:
|
|
1908
|
-
sortedData:
|
|
1909
|
-
handleSort:
|
|
1910
|
-
} =
|
|
2658
|
+
activeSort: M,
|
|
2659
|
+
sortedData: A,
|
|
2660
|
+
handleSort: _
|
|
2661
|
+
} = It({
|
|
1911
2662
|
data: r,
|
|
1912
|
-
sort:
|
|
2663
|
+
sort: $,
|
|
1913
2664
|
defaultSort: h,
|
|
1914
|
-
onSortChange:
|
|
2665
|
+
onSortChange: w
|
|
1915
2666
|
}), {
|
|
1916
|
-
activePage:
|
|
1917
|
-
totalPages:
|
|
1918
|
-
displayData:
|
|
1919
|
-
handlePageChange:
|
|
1920
|
-
} =
|
|
1921
|
-
data:
|
|
1922
|
-
pageSize:
|
|
1923
|
-
page:
|
|
1924
|
-
defaultPage:
|
|
1925
|
-
totalRows:
|
|
1926
|
-
onPageChange:
|
|
1927
|
-
}),
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1930
|
-
},
|
|
1931
|
-
|
|
1932
|
-
},
|
|
1933
|
-
return /* @__PURE__ */
|
|
1934
|
-
|
|
2667
|
+
activePage: P,
|
|
2668
|
+
totalPages: j,
|
|
2669
|
+
displayData: oo,
|
|
2670
|
+
handlePageChange: F
|
|
2671
|
+
} = Wt({
|
|
2672
|
+
data: A,
|
|
2673
|
+
pageSize: y,
|
|
2674
|
+
page: v,
|
|
2675
|
+
defaultPage: z,
|
|
2676
|
+
totalRows: O,
|
|
2677
|
+
onPageChange: R
|
|
2678
|
+
}), K = (k) => {
|
|
2679
|
+
const N = _(k);
|
|
2680
|
+
L?.({ sort: N, page: P });
|
|
2681
|
+
}, ro = (k) => {
|
|
2682
|
+
F(k), L?.({ sort: M, page: k });
|
|
2683
|
+
}, q = (k, N) => String(n ? k[n] : N), no = !f && oo.length === 0, to = y ?? jt;
|
|
2684
|
+
return /* @__PURE__ */ S(
|
|
2685
|
+
Dt,
|
|
1935
2686
|
{
|
|
1936
|
-
$borderColor:
|
|
1937
|
-
$stickyHeader:
|
|
1938
|
-
className:
|
|
1939
|
-
style:
|
|
2687
|
+
$borderColor: C,
|
|
2688
|
+
$stickyHeader: d,
|
|
2689
|
+
className: D,
|
|
2690
|
+
style: W,
|
|
1940
2691
|
children: [
|
|
1941
|
-
/* @__PURE__ */
|
|
1942
|
-
|
|
1943
|
-
/* @__PURE__ */
|
|
1944
|
-
|
|
2692
|
+
/* @__PURE__ */ S(Et, { $size: t, children: [
|
|
2693
|
+
p && /* @__PURE__ */ e("caption", { children: p }),
|
|
2694
|
+
/* @__PURE__ */ e(
|
|
2695
|
+
Mt,
|
|
1945
2696
|
{
|
|
1946
|
-
$headerColor:
|
|
1947
|
-
$borderColor:
|
|
1948
|
-
$stickyHeader:
|
|
1949
|
-
children: /* @__PURE__ */
|
|
1950
|
-
|
|
2697
|
+
$headerColor: m,
|
|
2698
|
+
$borderColor: C,
|
|
2699
|
+
$stickyHeader: d,
|
|
2700
|
+
children: /* @__PURE__ */ e($o, { children: o.map((k) => /* @__PURE__ */ e(
|
|
2701
|
+
Nt,
|
|
1951
2702
|
{
|
|
1952
|
-
$size:
|
|
1953
|
-
$bordered:
|
|
2703
|
+
$size: t,
|
|
2704
|
+
$bordered: l,
|
|
1954
2705
|
scope: "col",
|
|
1955
|
-
style:
|
|
1956
|
-
children:
|
|
1957
|
-
|
|
2706
|
+
style: k.width ? { width: k.width } : void 0,
|
|
2707
|
+
children: k.sortable ? /* @__PURE__ */ S(
|
|
2708
|
+
Pt,
|
|
1958
2709
|
{
|
|
1959
2710
|
type: "button",
|
|
1960
|
-
onClick: () =>
|
|
1961
|
-
"aria-label": `Sort by ${
|
|
2711
|
+
onClick: () => K(k.key),
|
|
2712
|
+
"aria-label": `Sort by ${k.header}${M?.key === k.key ? `, ${M.direction}ending` : ""}`,
|
|
1962
2713
|
children: [
|
|
1963
|
-
|
|
1964
|
-
/* @__PURE__ */
|
|
2714
|
+
k.header,
|
|
2715
|
+
/* @__PURE__ */ e(Rt, { "aria-hidden": "true", children: Ht(M, k.key) })
|
|
1965
2716
|
]
|
|
1966
2717
|
}
|
|
1967
|
-
) :
|
|
2718
|
+
) : k.header
|
|
1968
2719
|
},
|
|
1969
|
-
|
|
2720
|
+
k.key
|
|
1970
2721
|
)) })
|
|
1971
2722
|
}
|
|
1972
2723
|
),
|
|
1973
|
-
/* @__PURE__ */
|
|
1974
|
-
|
|
2724
|
+
/* @__PURE__ */ e(
|
|
2725
|
+
Ot,
|
|
1975
2726
|
{
|
|
1976
|
-
$striped:
|
|
1977
|
-
$rowColor:
|
|
2727
|
+
$striped: a,
|
|
2728
|
+
$rowColor: x,
|
|
1978
2729
|
$stripeColor: I,
|
|
1979
|
-
children:
|
|
1980
|
-
|
|
2730
|
+
children: f ? Array.from({ length: to }).map((k, N) => /* @__PURE__ */ e($o, { children: o.map((Y) => /* @__PURE__ */ e(
|
|
2731
|
+
At,
|
|
1981
2732
|
{
|
|
1982
|
-
$size:
|
|
1983
|
-
$bordered:
|
|
1984
|
-
$borderColor:
|
|
1985
|
-
children: /* @__PURE__ */
|
|
2733
|
+
$size: t,
|
|
2734
|
+
$bordered: l,
|
|
2735
|
+
$borderColor: C,
|
|
2736
|
+
children: /* @__PURE__ */ e(Bt, {})
|
|
1986
2737
|
},
|
|
1987
|
-
|
|
1988
|
-
)) },
|
|
1989
|
-
|
|
2738
|
+
Y.key
|
|
2739
|
+
)) }, N)) : no ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(Vt, { colSpan: o.length, children: u }) }) : oo.map((k, N) => /* @__PURE__ */ e(
|
|
2740
|
+
g ? Lt : $o,
|
|
1990
2741
|
{
|
|
1991
|
-
onClick:
|
|
1992
|
-
$accentColor:
|
|
1993
|
-
children: o.map((
|
|
1994
|
-
|
|
2742
|
+
onClick: g ? () => g(k) : void 0,
|
|
2743
|
+
$accentColor: g ? C : void 0,
|
|
2744
|
+
children: o.map((H) => /* @__PURE__ */ e(
|
|
2745
|
+
ir,
|
|
1995
2746
|
{
|
|
1996
|
-
$size:
|
|
1997
|
-
$bordered:
|
|
1998
|
-
$borderColor:
|
|
1999
|
-
children:
|
|
2747
|
+
$size: t,
|
|
2748
|
+
$bordered: l,
|
|
2749
|
+
$borderColor: C,
|
|
2750
|
+
children: H.render ? H.render(k[H.key], k, N) : String(k[H.key] ?? "") || " "
|
|
2000
2751
|
},
|
|
2001
|
-
|
|
2752
|
+
H.key
|
|
2002
2753
|
))
|
|
2003
2754
|
},
|
|
2004
|
-
|
|
2755
|
+
q(k, N)
|
|
2005
2756
|
))
|
|
2006
2757
|
}
|
|
2007
2758
|
)
|
|
2008
2759
|
] }),
|
|
2009
|
-
|
|
2010
|
-
/* @__PURE__ */
|
|
2011
|
-
|
|
2760
|
+
y && j > 1 && /* @__PURE__ */ S(_t, { children: [
|
|
2761
|
+
/* @__PURE__ */ e(
|
|
2762
|
+
vo,
|
|
2012
2763
|
{
|
|
2013
2764
|
type: "button",
|
|
2014
|
-
onClick: () =>
|
|
2015
|
-
disabled:
|
|
2765
|
+
onClick: () => ro(P - 1),
|
|
2766
|
+
disabled: P <= 1,
|
|
2016
2767
|
"aria-label": "Previous page",
|
|
2017
2768
|
children: "←"
|
|
2018
2769
|
}
|
|
2019
2770
|
),
|
|
2020
|
-
|
|
2021
|
-
(
|
|
2771
|
+
Tt(P, j).map(
|
|
2772
|
+
(k, N) => k === "..." ? /* @__PURE__ */ e(
|
|
2022
2773
|
"span",
|
|
2023
2774
|
{
|
|
2024
2775
|
"aria-hidden": "true",
|
|
2025
2776
|
style: { padding: "0 4px" },
|
|
2026
2777
|
children: "…"
|
|
2027
2778
|
},
|
|
2028
|
-
`e${
|
|
2029
|
-
) : /* @__PURE__ */
|
|
2030
|
-
|
|
2779
|
+
`e${N}`
|
|
2780
|
+
) : /* @__PURE__ */ e(
|
|
2781
|
+
vo,
|
|
2031
2782
|
{
|
|
2032
2783
|
type: "button",
|
|
2033
|
-
$active:
|
|
2034
|
-
onClick: () =>
|
|
2035
|
-
"aria-label": `Page ${
|
|
2036
|
-
"aria-current":
|
|
2037
|
-
children:
|
|
2784
|
+
$active: k === P,
|
|
2785
|
+
onClick: () => ro(k),
|
|
2786
|
+
"aria-label": `Page ${k}`,
|
|
2787
|
+
"aria-current": k === P ? "page" : void 0,
|
|
2788
|
+
children: k
|
|
2038
2789
|
},
|
|
2039
|
-
|
|
2790
|
+
k
|
|
2040
2791
|
)
|
|
2041
2792
|
),
|
|
2042
|
-
/* @__PURE__ */
|
|
2043
|
-
|
|
2793
|
+
/* @__PURE__ */ e(
|
|
2794
|
+
vo,
|
|
2044
2795
|
{
|
|
2045
2796
|
type: "button",
|
|
2046
|
-
onClick: () =>
|
|
2047
|
-
disabled:
|
|
2797
|
+
onClick: () => ro(P + 1),
|
|
2798
|
+
disabled: P >= j,
|
|
2048
2799
|
"aria-label": "Next page",
|
|
2049
2800
|
children: "→"
|
|
2050
2801
|
}
|
|
@@ -2054,29 +2805,18 @@ function Un({
|
|
|
2054
2805
|
}
|
|
2055
2806
|
);
|
|
2056
2807
|
}
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
defaultSort: o,
|
|
2060
|
-
defaultPage: r = 1
|
|
2061
|
-
} = {}) {
|
|
2062
|
-
const [n, e] = D(o ?? null), [l, a] = D(r);
|
|
2063
|
-
return { sort: n, page: l, onSortChange: (p) => {
|
|
2064
|
-
e(p), a(1);
|
|
2065
|
-
}, onPageChange: (p) => {
|
|
2066
|
-
a(p);
|
|
2067
|
-
} };
|
|
2068
|
-
}
|
|
2069
|
-
const Kn = i.p`
|
|
2808
|
+
Yt.displayName = "Table";
|
|
2809
|
+
const Ut = i.p`
|
|
2070
2810
|
margin: 0;
|
|
2071
2811
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
2072
2812
|
color: ${({ theme: o }) => o.colors.neutral[600]};
|
|
2073
2813
|
line-height: 1.5;
|
|
2074
|
-
`,
|
|
2814
|
+
`, Kt = i.button`
|
|
2075
2815
|
display: inline-flex;
|
|
2076
2816
|
align-items: center;
|
|
2077
2817
|
justify-content: center;
|
|
2078
2818
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
2079
|
-
font-weight:
|
|
2819
|
+
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
2080
2820
|
cursor: pointer;
|
|
2081
2821
|
padding: ${({ theme: o }) => o.spacing[2]} ${({ theme: o }) => o.spacing[4]};
|
|
2082
2822
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
@@ -2098,7 +2838,7 @@ const Kn = i.p`
|
|
|
2098
2838
|
cursor: not-allowed;
|
|
2099
2839
|
}
|
|
2100
2840
|
|
|
2101
|
-
${({ theme: o }) => o.brutalism &&
|
|
2841
|
+
${({ theme: o }) => o.brutalism && s`
|
|
2102
2842
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
2103
2843
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
2104
2844
|
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
@@ -2112,47 +2852,47 @@ const Kn = i.p`
|
|
|
2112
2852
|
}
|
|
2113
2853
|
`}
|
|
2114
2854
|
`;
|
|
2115
|
-
function
|
|
2855
|
+
function ar({
|
|
2116
2856
|
open: o,
|
|
2117
2857
|
title: r = "Are you sure?",
|
|
2118
2858
|
message: n,
|
|
2119
|
-
confirmLabel:
|
|
2120
|
-
cancelLabel:
|
|
2121
|
-
variant:
|
|
2122
|
-
size:
|
|
2123
|
-
onConfirm:
|
|
2124
|
-
onCancel:
|
|
2859
|
+
confirmLabel: t = "Confirm",
|
|
2860
|
+
cancelLabel: a = "Cancel",
|
|
2861
|
+
variant: l = "default",
|
|
2862
|
+
size: d = "sm",
|
|
2863
|
+
onConfirm: p,
|
|
2864
|
+
onCancel: u
|
|
2125
2865
|
}) {
|
|
2126
|
-
return /* @__PURE__ */
|
|
2127
|
-
|
|
2866
|
+
return /* @__PURE__ */ e(
|
|
2867
|
+
Go,
|
|
2128
2868
|
{
|
|
2129
2869
|
open: o,
|
|
2130
|
-
onClose:
|
|
2870
|
+
onClose: u,
|
|
2131
2871
|
title: r,
|
|
2132
|
-
size:
|
|
2872
|
+
size: d,
|
|
2133
2873
|
closeOnBackdrop: !1,
|
|
2134
|
-
footer: /* @__PURE__ */
|
|
2135
|
-
/* @__PURE__ */
|
|
2136
|
-
|
|
2874
|
+
footer: /* @__PURE__ */ S(dr, { children: [
|
|
2875
|
+
/* @__PURE__ */ e(Co, { variant: "outline", onClick: u, children: a }),
|
|
2876
|
+
l === "danger" ? /* @__PURE__ */ e(Kt, { type: "button", onClick: p, children: t }) : /* @__PURE__ */ e(Co, { variant: "primary", onClick: p, children: t })
|
|
2137
2877
|
] }),
|
|
2138
|
-
children: /* @__PURE__ */
|
|
2878
|
+
children: /* @__PURE__ */ e(Ut, { children: n })
|
|
2139
2879
|
}
|
|
2140
2880
|
);
|
|
2141
2881
|
}
|
|
2142
|
-
|
|
2143
|
-
const
|
|
2144
|
-
function
|
|
2145
|
-
const [r, n] =
|
|
2146
|
-
n({ ...
|
|
2147
|
-
}), []),
|
|
2882
|
+
ar.displayName = "ConfirmDialog";
|
|
2883
|
+
const lr = Wo(null);
|
|
2884
|
+
function zs({ children: o }) {
|
|
2885
|
+
const [r, n] = T(null), t = X((d) => new Promise((p) => {
|
|
2886
|
+
n({ ...d, resolve: p });
|
|
2887
|
+
}), []), a = () => {
|
|
2148
2888
|
r?.resolve(!0), n(null);
|
|
2149
|
-
},
|
|
2889
|
+
}, l = () => {
|
|
2150
2890
|
r?.resolve(!1), n(null);
|
|
2151
2891
|
};
|
|
2152
|
-
return /* @__PURE__ */
|
|
2892
|
+
return /* @__PURE__ */ S(lr.Provider, { value: { confirm: t }, children: [
|
|
2153
2893
|
o,
|
|
2154
|
-
r && /* @__PURE__ */
|
|
2155
|
-
|
|
2894
|
+
r && /* @__PURE__ */ e(
|
|
2895
|
+
ar,
|
|
2156
2896
|
{
|
|
2157
2897
|
open: !0,
|
|
2158
2898
|
title: r.title,
|
|
@@ -2161,24 +2901,24 @@ function vt({ children: o }) {
|
|
|
2161
2901
|
cancelLabel: r.cancelLabel,
|
|
2162
2902
|
variant: r.variant,
|
|
2163
2903
|
size: r.size,
|
|
2164
|
-
onConfirm:
|
|
2165
|
-
onCancel:
|
|
2904
|
+
onConfirm: a,
|
|
2905
|
+
onCancel: l
|
|
2166
2906
|
}
|
|
2167
2907
|
)
|
|
2168
2908
|
] });
|
|
2169
2909
|
}
|
|
2170
|
-
function
|
|
2171
|
-
const o =
|
|
2910
|
+
function Cs() {
|
|
2911
|
+
const o = To(lr);
|
|
2172
2912
|
if (!o)
|
|
2173
2913
|
throw new Error("useConfirm must be used within a ConfirmProvider");
|
|
2174
2914
|
return o.confirm;
|
|
2175
2915
|
}
|
|
2176
|
-
const
|
|
2916
|
+
const qt = i.div`
|
|
2177
2917
|
position: relative;
|
|
2178
2918
|
display: inline-flex;
|
|
2179
2919
|
flex-direction: column;
|
|
2180
2920
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
2181
|
-
`,
|
|
2921
|
+
`, Gt = i.div`
|
|
2182
2922
|
display: flex;
|
|
2183
2923
|
align-items: center;
|
|
2184
2924
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -2190,35 +2930,35 @@ const Gn = i.div`
|
|
|
2190
2930
|
box-shadow 0.2s;
|
|
2191
2931
|
|
|
2192
2932
|
${({ $size: o, theme: r }) => ({
|
|
2193
|
-
sm:
|
|
2933
|
+
sm: s`
|
|
2194
2934
|
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
2195
2935
|
font-size: ${r.fontSizes.sm};
|
|
2196
2936
|
`,
|
|
2197
|
-
md:
|
|
2937
|
+
md: s`
|
|
2198
2938
|
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
2199
2939
|
font-size: ${r.fontSizes.md};
|
|
2200
2940
|
`,
|
|
2201
|
-
lg:
|
|
2941
|
+
lg: s`
|
|
2202
2942
|
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
2203
2943
|
font-size: ${r.fontSizes.lg};
|
|
2204
2944
|
`
|
|
2205
2945
|
})[o]}
|
|
2206
2946
|
|
|
2207
|
-
${({ theme: o }) => o.brutalism ?
|
|
2947
|
+
${({ theme: o }) => o.brutalism ? s`
|
|
2208
2948
|
border: ${o.brutalism.borderWidth} solid
|
|
2209
2949
|
${o.colors.neutral[900]};
|
|
2210
2950
|
background-color: ${o.colors.neutral[0]};
|
|
2211
2951
|
box-shadow: 3px 3px 0 ${o.colors.neutral[900]};
|
|
2212
|
-
` :
|
|
2952
|
+
` : s`
|
|
2213
2953
|
border: 1px solid ${o.colors.neutral[400]};
|
|
2214
2954
|
background-color: ${o.colors.neutral[0]};
|
|
2215
2955
|
`}
|
|
2216
2956
|
|
|
2217
|
-
${({ $error: o, theme: r }) => o &&
|
|
2957
|
+
${({ $error: o, theme: r }) => o && s`
|
|
2218
2958
|
border-color: ${r.colors.error[500]};
|
|
2219
2959
|
`}
|
|
2220
2960
|
|
|
2221
|
-
${({ $disabled: o }) => o &&
|
|
2961
|
+
${({ $disabled: o }) => o && s`
|
|
2222
2962
|
cursor: not-allowed;
|
|
2223
2963
|
opacity: 0.6;
|
|
2224
2964
|
`}
|
|
@@ -2227,19 +2967,19 @@ const Gn = i.div`
|
|
|
2227
2967
|
outline: none;
|
|
2228
2968
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
2229
2969
|
}
|
|
2230
|
-
`,
|
|
2970
|
+
`, Xt = i.span`
|
|
2231
2971
|
flex: 1;
|
|
2232
2972
|
color: ${({ $hasValue: o, theme: r }) => o ? r.colors.neutral[900] : r.colors.neutral[400]};
|
|
2233
2973
|
white-space: nowrap;
|
|
2234
2974
|
overflow: hidden;
|
|
2235
2975
|
text-overflow: ellipsis;
|
|
2236
|
-
`,
|
|
2976
|
+
`, Jt = i.span`
|
|
2237
2977
|
display: inline-flex;
|
|
2238
2978
|
align-items: center;
|
|
2239
2979
|
margin-left: ${({ theme: o }) => o.spacing[2]};
|
|
2240
2980
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
2241
2981
|
flex-shrink: 0;
|
|
2242
|
-
`,
|
|
2982
|
+
`, Qt = i.button`
|
|
2243
2983
|
display: inline-flex;
|
|
2244
2984
|
align-items: center;
|
|
2245
2985
|
margin-left: ${({ theme: o }) => o.spacing[2]};
|
|
@@ -2259,10 +2999,12 @@ const Gn = i.div`
|
|
|
2259
2999
|
outline-offset: 2px;
|
|
2260
3000
|
border-radius: 2px;
|
|
2261
3001
|
}
|
|
2262
|
-
|
|
3002
|
+
`;
|
|
3003
|
+
i.span`
|
|
2263
3004
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
2264
3005
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
2265
|
-
|
|
3006
|
+
`;
|
|
3007
|
+
const Zt = i.div`
|
|
2266
3008
|
position: absolute;
|
|
2267
3009
|
top: calc(100% + 4px);
|
|
2268
3010
|
left: 0;
|
|
@@ -2272,21 +3014,21 @@ const Gn = i.div`
|
|
|
2272
3014
|
padding: ${({ theme: o }) => o.spacing[3]};
|
|
2273
3015
|
min-width: 280px;
|
|
2274
3016
|
|
|
2275
|
-
${({ theme: o }) => o.brutalism ?
|
|
3017
|
+
${({ theme: o }) => o.brutalism ? s`
|
|
2276
3018
|
border: ${o.brutalism.borderWidth} solid
|
|
2277
3019
|
${o.colors.neutral[900]};
|
|
2278
3020
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
2279
3021
|
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
2280
|
-
` :
|
|
3022
|
+
` : s`
|
|
2281
3023
|
border: 1px solid ${o.colors.neutral[200]};
|
|
2282
3024
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
2283
3025
|
`}
|
|
2284
|
-
`,
|
|
3026
|
+
`, os = i.div`
|
|
2285
3027
|
display: flex;
|
|
2286
3028
|
align-items: center;
|
|
2287
3029
|
justify-content: space-between;
|
|
2288
3030
|
margin-bottom: ${({ theme: o }) => o.spacing[3]};
|
|
2289
|
-
`,
|
|
3031
|
+
`, Bo = i.button`
|
|
2290
3032
|
display: inline-flex;
|
|
2291
3033
|
align-items: center;
|
|
2292
3034
|
justify-content: center;
|
|
@@ -2309,31 +3051,31 @@ const Gn = i.div`
|
|
|
2309
3051
|
outline-offset: 2px;
|
|
2310
3052
|
}
|
|
2311
3053
|
|
|
2312
|
-
${({ theme: o }) => o.brutalism &&
|
|
3054
|
+
${({ theme: o }) => o.brutalism && s`
|
|
2313
3055
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
2314
3056
|
&:hover {
|
|
2315
3057
|
background-color: ${o.colors.neutral[100]};
|
|
2316
3058
|
transform: translate(1px, 1px);
|
|
2317
3059
|
}
|
|
2318
3060
|
`}
|
|
2319
|
-
`,
|
|
2320
|
-
font-weight:
|
|
3061
|
+
`, rs = i.span`
|
|
3062
|
+
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
2321
3063
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
2322
3064
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
2323
|
-
`,
|
|
3065
|
+
`, ns = i.div`
|
|
2324
3066
|
display: grid;
|
|
2325
3067
|
grid-template-columns: repeat(7, 1fr);
|
|
2326
|
-
gap:
|
|
2327
|
-
`,
|
|
3068
|
+
gap: ${({ theme: o }) => o.spacing[0.5]};
|
|
3069
|
+
`, ts = i.span`
|
|
2328
3070
|
display: flex;
|
|
2329
3071
|
align-items: center;
|
|
2330
3072
|
justify-content: center;
|
|
2331
3073
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
2332
|
-
font-weight:
|
|
3074
|
+
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
2333
3075
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
2334
3076
|
padding: ${({ theme: o }) => o.spacing[1]};
|
|
2335
|
-
margin-bottom:
|
|
2336
|
-
`,
|
|
3077
|
+
margin-bottom: ${({ theme: o }) => o.spacing[0.5]};
|
|
3078
|
+
`, ko = i.button`
|
|
2337
3079
|
display: flex;
|
|
2338
3080
|
align-items: center;
|
|
2339
3081
|
justify-content: center;
|
|
@@ -2344,15 +3086,36 @@ const Gn = i.div`
|
|
|
2344
3086
|
cursor: pointer;
|
|
2345
3087
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
2346
3088
|
padding: ${({ theme: o }) => o.spacing[1]};
|
|
2347
|
-
font-weight: ${({
|
|
3089
|
+
font-weight: ${({
|
|
3090
|
+
$today: o,
|
|
3091
|
+
$selected: r,
|
|
3092
|
+
$rangeStart: n,
|
|
3093
|
+
$rangeEnd: t,
|
|
3094
|
+
$inRange: a,
|
|
3095
|
+
theme: l
|
|
3096
|
+
}) => o || r || n || t ? l.fontWeights.semibold : l.fontWeights.normal};
|
|
2348
3097
|
pointer-events: ${({ $currentMonth: o }) => o ? "auto" : "none"};
|
|
2349
3098
|
|
|
2350
|
-
color: ${({
|
|
2351
|
-
|
|
2352
|
-
|
|
3099
|
+
color: ${({
|
|
3100
|
+
$currentMonth: o,
|
|
3101
|
+
$selected: r,
|
|
3102
|
+
$today: n,
|
|
3103
|
+
$rangeStart: t,
|
|
3104
|
+
$rangeEnd: a,
|
|
3105
|
+
theme: l
|
|
3106
|
+
}) => o ? r || t || a ? l.colors.primary.contrast : n ? l.colors.primary[500] : l.colors.neutral[900] : l.colors.neutral[300]};
|
|
3107
|
+
|
|
3108
|
+
background-color: ${({
|
|
3109
|
+
$selected: o,
|
|
3110
|
+
$rangeStart: r,
|
|
3111
|
+
$rangeEnd: n,
|
|
3112
|
+
$inRange: t,
|
|
3113
|
+
$currentMonth: a,
|
|
3114
|
+
theme: l
|
|
3115
|
+
}) => a ? o || r || n ? l.colors.primary[500] : t ? l.colors.primary[50] : "transparent" : "transparent"};
|
|
2353
3116
|
|
|
2354
3117
|
&:hover:not(:disabled) {
|
|
2355
|
-
background-color: ${({ $selected: o,
|
|
3118
|
+
background-color: ${({ $selected: o, $rangeStart: r, $rangeEnd: n, theme: t }) => o || r || n ? t.colors.primary[700] : t.colors.neutral[100]};
|
|
2356
3119
|
}
|
|
2357
3120
|
|
|
2358
3121
|
&:disabled {
|
|
@@ -2365,13 +3128,13 @@ const Gn = i.div`
|
|
|
2365
3128
|
outline-offset: 1px;
|
|
2366
3129
|
}
|
|
2367
3130
|
|
|
2368
|
-
${({ $selected: o, $
|
|
2369
|
-
border: ${
|
|
2370
|
-
${o &&
|
|
2371
|
-
box-shadow: 2px 2px 0 ${
|
|
3131
|
+
${({ $selected: o, $rangeStart: r, $rangeEnd: n, $today: t, theme: a }) => a.brutalism && (o || r || n || t) && s`
|
|
3132
|
+
border: ${a.brutalism.borderWidth} solid ${a.colors.neutral[900]};
|
|
3133
|
+
${(o || r || n) && s`
|
|
3134
|
+
box-shadow: 2px 2px 0 ${a.colors.neutral[900]};
|
|
2372
3135
|
`}
|
|
2373
3136
|
`}
|
|
2374
|
-
`,
|
|
3137
|
+
`, ss = [
|
|
2375
3138
|
"January",
|
|
2376
3139
|
"February",
|
|
2377
3140
|
"March",
|
|
@@ -2384,43 +3147,45 @@ const Gn = i.div`
|
|
|
2384
3147
|
"October",
|
|
2385
3148
|
"November",
|
|
2386
3149
|
"December"
|
|
2387
|
-
],
|
|
2388
|
-
function
|
|
3150
|
+
], es = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
3151
|
+
function _o(o, r) {
|
|
2389
3152
|
return new Date(o, r + 1, 0).getDate();
|
|
2390
3153
|
}
|
|
2391
|
-
function
|
|
3154
|
+
function is(o, r) {
|
|
2392
3155
|
return new Date(o, r, 1).getDay();
|
|
2393
3156
|
}
|
|
2394
|
-
function
|
|
3157
|
+
function co(o, r) {
|
|
2395
3158
|
return o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth() && o.getDate() === r.getDate();
|
|
2396
3159
|
}
|
|
2397
|
-
function
|
|
3160
|
+
function as(o, r, n) {
|
|
2398
3161
|
if (r) {
|
|
2399
|
-
const
|
|
3162
|
+
const t = new Date(
|
|
2400
3163
|
r.getFullYear(),
|
|
2401
3164
|
r.getMonth(),
|
|
2402
3165
|
r.getDate()
|
|
2403
3166
|
);
|
|
2404
|
-
if (o <
|
|
3167
|
+
if (o < t)
|
|
3168
|
+
return !0;
|
|
2405
3169
|
}
|
|
2406
3170
|
if (n) {
|
|
2407
|
-
const
|
|
3171
|
+
const t = new Date(
|
|
2408
3172
|
n.getFullYear(),
|
|
2409
3173
|
n.getMonth(),
|
|
2410
3174
|
n.getDate()
|
|
2411
3175
|
);
|
|
2412
|
-
if (o >
|
|
3176
|
+
if (o > t)
|
|
3177
|
+
return !0;
|
|
2413
3178
|
}
|
|
2414
3179
|
return !1;
|
|
2415
3180
|
}
|
|
2416
|
-
function
|
|
3181
|
+
function jo(o) {
|
|
2417
3182
|
return o.toLocaleDateString("en-US", {
|
|
2418
3183
|
month: "short",
|
|
2419
3184
|
day: "numeric",
|
|
2420
3185
|
year: "numeric"
|
|
2421
3186
|
});
|
|
2422
3187
|
}
|
|
2423
|
-
function
|
|
3188
|
+
function Ho(o) {
|
|
2424
3189
|
return o.toLocaleDateString("en-US", {
|
|
2425
3190
|
weekday: "long",
|
|
2426
3191
|
month: "long",
|
|
@@ -2428,153 +3193,244 @@ function ut(o) {
|
|
|
2428
3193
|
year: "numeric"
|
|
2429
3194
|
});
|
|
2430
3195
|
}
|
|
2431
|
-
function
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
3196
|
+
function So(o) {
|
|
3197
|
+
if (!o)
|
|
3198
|
+
return null;
|
|
3199
|
+
const r = o.split("-");
|
|
3200
|
+
if (r.length !== 3)
|
|
3201
|
+
return null;
|
|
3202
|
+
const n = parseInt(r[0], 10), t = parseInt(r[1], 10), a = parseInt(r[2], 10);
|
|
3203
|
+
return isNaN(n) || isNaN(t) || isNaN(a) ? null : new Date(n, t - 1, a);
|
|
3204
|
+
}
|
|
3205
|
+
function io(o) {
|
|
3206
|
+
const r = o.getFullYear(), n = String(o.getMonth() + 1).padStart(2, "0"), t = String(o.getDate()).padStart(2, "0");
|
|
3207
|
+
return `${r}-${n}-${t}`;
|
|
3208
|
+
}
|
|
3209
|
+
function ls({
|
|
3210
|
+
name: o,
|
|
3211
|
+
label: r,
|
|
3212
|
+
value: n,
|
|
3213
|
+
onChange: t,
|
|
3214
|
+
placeholder: a = "Select date...",
|
|
3215
|
+
size: l = "md",
|
|
3216
|
+
disabled: d = !1,
|
|
3217
|
+
clearable: p = !1,
|
|
3218
|
+
minDate: u,
|
|
3219
|
+
maxDate: f,
|
|
3220
|
+
formatDate: $,
|
|
3221
|
+
error: h,
|
|
3222
|
+
required: w,
|
|
3223
|
+
helperText: y,
|
|
3224
|
+
mode: v = "single",
|
|
3225
|
+
nameFrom: z,
|
|
3226
|
+
nameTo: O,
|
|
3227
|
+
valueFrom: R,
|
|
3228
|
+
valueTo: L
|
|
2443
3229
|
}) {
|
|
2444
|
-
const
|
|
2445
|
-
() => (
|
|
2446
|
-
), [
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
3230
|
+
const g = v === "range", C = So(n ?? ""), m = So(R ?? ""), x = So(L ?? ""), I = /* @__PURE__ */ new Date(), D = () => g ? m ?? x ?? I : C ?? I, [W, M] = T(!1), [A, _] = T(
|
|
3231
|
+
() => D().getFullYear()
|
|
3232
|
+
), [P, j] = T(
|
|
3233
|
+
() => D().getMonth()
|
|
3234
|
+
), [oo, F] = T("from"), K = U(null);
|
|
3235
|
+
B(() => {
|
|
3236
|
+
if (!W)
|
|
3237
|
+
return;
|
|
3238
|
+
const b = (V) => {
|
|
3239
|
+
K.current && !K.current.contains(V.target) && (M(!1), g && F("from"));
|
|
2451
3240
|
};
|
|
2452
|
-
return document.addEventListener("mousedown",
|
|
2453
|
-
}, [
|
|
2454
|
-
|
|
2455
|
-
}, [
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
3241
|
+
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
3242
|
+
}, [W, g]), B(() => {
|
|
3243
|
+
!g && C && (_(C.getFullYear()), j(C.getMonth()));
|
|
3244
|
+
}, [n, g]), B(() => {
|
|
3245
|
+
g && m && (_(m.getFullYear()), j(m.getMonth()));
|
|
3246
|
+
}, [R, g]);
|
|
3247
|
+
const q = (() => {
|
|
3248
|
+
if (!g)
|
|
3249
|
+
return C ? $ ? $(C) : jo(C) : "";
|
|
3250
|
+
if (!m && !x)
|
|
3251
|
+
return "";
|
|
3252
|
+
const b = $ ?? jo;
|
|
3253
|
+
return m && x ? `${b(m)} - ${b(x)}` : m ? `${b(m)} - ...` : "";
|
|
3254
|
+
})(), no = g ? !!(m || x) : !!C, to = (b) => {
|
|
3255
|
+
const V = new Date(A, P, b);
|
|
3256
|
+
if (!g) {
|
|
3257
|
+
t(o ?? "", io(V)), M(!1);
|
|
3258
|
+
return;
|
|
3259
|
+
}
|
|
3260
|
+
if (oo === "from") {
|
|
3261
|
+
t(z ?? "", io(V)), F("to");
|
|
3262
|
+
return;
|
|
3263
|
+
}
|
|
3264
|
+
if (!m) {
|
|
3265
|
+
t(z ?? "", io(V)), F("to");
|
|
3266
|
+
return;
|
|
3267
|
+
}
|
|
3268
|
+
if (co(V, m)) {
|
|
3269
|
+
t(z ?? "", ""), t(O ?? "", ""), F("from");
|
|
3270
|
+
return;
|
|
3271
|
+
}
|
|
3272
|
+
if (V >= m) {
|
|
3273
|
+
t(O ?? "", io(V)), F("from"), M(!1);
|
|
3274
|
+
return;
|
|
3275
|
+
}
|
|
3276
|
+
t(O ?? "", io(m)), t(z ?? "", io(V)), F("from"), M(!1);
|
|
3277
|
+
}, k = (b) => {
|
|
3278
|
+
b.stopPropagation(), g ? (t(z ?? "", ""), t(O ?? "", ""), F("from")) : t(o ?? "", "");
|
|
3279
|
+
}, N = () => {
|
|
3280
|
+
if (d)
|
|
3281
|
+
return;
|
|
3282
|
+
const b = !W;
|
|
3283
|
+
M(b), !b && g && F("from");
|
|
3284
|
+
}, Y = (b) => {
|
|
3285
|
+
if ((b.key === "Enter" || b.key === " ") && !d) {
|
|
3286
|
+
b.preventDefault();
|
|
3287
|
+
const V = !W;
|
|
3288
|
+
M(V), !V && g && F("from");
|
|
3289
|
+
}
|
|
3290
|
+
b.key === "Escape" && (M(!1), g && F("from"));
|
|
3291
|
+
}, H = () => {
|
|
3292
|
+
P === 0 ? (j(11), _((b) => b - 1)) : j((b) => b - 1);
|
|
3293
|
+
}, ao = () => {
|
|
3294
|
+
P === 11 ? (j(0), _((b) => b + 1)) : j((b) => b + 1);
|
|
3295
|
+
}, uo = _o(A, P), lo = is(A, P), so = [], xo = _o(
|
|
3296
|
+
P === 0 ? A - 1 : A,
|
|
3297
|
+
P === 0 ? 11 : P - 1
|
|
2467
3298
|
);
|
|
2468
|
-
for (let
|
|
2469
|
-
|
|
2470
|
-
for (let
|
|
2471
|
-
|
|
2472
|
-
const
|
|
2473
|
-
for (let
|
|
2474
|
-
|
|
2475
|
-
return /* @__PURE__ */
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
"aria-expanded": x,
|
|
2486
|
-
tabIndex: l ? -1 : 0,
|
|
2487
|
-
onClick: () => {
|
|
2488
|
-
l || v((u) => !u);
|
|
2489
|
-
},
|
|
2490
|
-
onKeyDown: (u) => {
|
|
2491
|
-
(u.key === "Enter" || u.key === " ") && !l && (u.preventDefault(), v((B) => !B)), u.key === "Escape" && v(!1);
|
|
2492
|
-
},
|
|
2493
|
-
children: [
|
|
2494
|
-
/* @__PURE__ */ s(Xn, { $hasValue: !!o, children: z || n }),
|
|
2495
|
-
a && o ? /* @__PURE__ */ s(
|
|
2496
|
-
Qn,
|
|
2497
|
-
{
|
|
2498
|
-
type: "button",
|
|
2499
|
-
onClick: I,
|
|
2500
|
-
"aria-label": "Clear date",
|
|
2501
|
-
children: /* @__PURE__ */ s(co, { size: 14 })
|
|
2502
|
-
}
|
|
2503
|
-
) : /* @__PURE__ */ s(Zn, { "aria-hidden": "true", children: /* @__PURE__ */ s($r, { size: 14 }) })
|
|
2504
|
-
]
|
|
2505
|
-
}
|
|
2506
|
-
),
|
|
2507
|
-
typeof b == "string" && /* @__PURE__ */ s(ot, { $error: !0, children: b }),
|
|
2508
|
-
x && /* @__PURE__ */ k(rt, { role: "dialog", "aria-label": "Calendar", children: [
|
|
2509
|
-
/* @__PURE__ */ k(nt, { children: [
|
|
2510
|
-
/* @__PURE__ */ s(
|
|
2511
|
-
ho,
|
|
3299
|
+
for (let b = lo - 1; b >= 0; b--)
|
|
3300
|
+
so.push({ day: xo - b, currentMonth: !1 });
|
|
3301
|
+
for (let b = 1; b <= uo; b++)
|
|
3302
|
+
so.push({ day: b, currentMonth: !0 });
|
|
3303
|
+
const yo = 42 - so.length;
|
|
3304
|
+
for (let b = 1; b <= yo; b++)
|
|
3305
|
+
so.push({ day: b, currentMonth: !1 });
|
|
3306
|
+
return /* @__PURE__ */ e(
|
|
3307
|
+
sr,
|
|
3308
|
+
{
|
|
3309
|
+
label: r,
|
|
3310
|
+
error: h,
|
|
3311
|
+
helperText: y,
|
|
3312
|
+
required: w,
|
|
3313
|
+
children: /* @__PURE__ */ S(qt, { ref: K, children: [
|
|
3314
|
+
/* @__PURE__ */ S(
|
|
3315
|
+
Gt,
|
|
2512
3316
|
{
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
3317
|
+
$size: l,
|
|
3318
|
+
$error: !!h,
|
|
3319
|
+
$disabled: d,
|
|
3320
|
+
role: "combobox",
|
|
3321
|
+
"aria-haspopup": "true",
|
|
3322
|
+
"aria-expanded": W,
|
|
3323
|
+
tabIndex: d ? -1 : 0,
|
|
3324
|
+
onClick: N,
|
|
3325
|
+
onKeyDown: Y,
|
|
3326
|
+
children: [
|
|
3327
|
+
/* @__PURE__ */ e(Xt, { $hasValue: no, children: q || a }),
|
|
3328
|
+
p && no ? /* @__PURE__ */ e(
|
|
3329
|
+
Qt,
|
|
3330
|
+
{
|
|
3331
|
+
type: "button",
|
|
3332
|
+
onClick: k,
|
|
3333
|
+
"aria-label": "Clear date",
|
|
3334
|
+
children: /* @__PURE__ */ e(bo, { size: 14 })
|
|
3335
|
+
}
|
|
3336
|
+
) : /* @__PURE__ */ e(Jt, { "aria-hidden": "true", children: /* @__PURE__ */ e(_r, { size: 14 }) })
|
|
3337
|
+
]
|
|
2517
3338
|
}
|
|
2518
3339
|
),
|
|
2519
|
-
/* @__PURE__ */
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
] }),
|
|
2524
|
-
/* @__PURE__ */ s(
|
|
2525
|
-
ho,
|
|
2526
|
-
{
|
|
2527
|
-
type: "button",
|
|
2528
|
-
onClick: O,
|
|
2529
|
-
"aria-label": "Next month",
|
|
2530
|
-
children: /* @__PURE__ */ s(hr, { size: 16 })
|
|
2531
|
-
}
|
|
2532
|
-
)
|
|
2533
|
-
] }),
|
|
2534
|
-
/* @__PURE__ */ k(st, { children: [
|
|
2535
|
-
at.map((u) => /* @__PURE__ */ s(et, { children: u }, u)),
|
|
2536
|
-
N.map((u, B) => {
|
|
2537
|
-
if (!u.currentMonth)
|
|
2538
|
-
return /* @__PURE__ */ s(
|
|
2539
|
-
wo,
|
|
3340
|
+
W && /* @__PURE__ */ S(Zt, { role: "dialog", "aria-label": "Calendar", children: [
|
|
3341
|
+
/* @__PURE__ */ S(os, { children: [
|
|
3342
|
+
/* @__PURE__ */ e(
|
|
3343
|
+
Bo,
|
|
2540
3344
|
{
|
|
2541
3345
|
type: "button",
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
3346
|
+
onClick: H,
|
|
3347
|
+
"aria-label": "Previous month",
|
|
3348
|
+
children: /* @__PURE__ */ e(Yr, { size: 16 })
|
|
3349
|
+
}
|
|
3350
|
+
),
|
|
3351
|
+
/* @__PURE__ */ S(rs, { children: [
|
|
3352
|
+
ss[P],
|
|
3353
|
+
" ",
|
|
3354
|
+
A
|
|
3355
|
+
] }),
|
|
3356
|
+
/* @__PURE__ */ e(
|
|
3357
|
+
Bo,
|
|
3358
|
+
{
|
|
3359
|
+
type: "button",
|
|
3360
|
+
onClick: ao,
|
|
3361
|
+
"aria-label": "Next month",
|
|
3362
|
+
children: /* @__PURE__ */ e(Kr, { size: 16 })
|
|
3363
|
+
}
|
|
3364
|
+
)
|
|
3365
|
+
] }),
|
|
3366
|
+
/* @__PURE__ */ S(ns, { children: [
|
|
3367
|
+
es.map((b) => /* @__PURE__ */ e(ts, { children: b }, b)),
|
|
3368
|
+
so.map((b, V) => {
|
|
3369
|
+
if (!b.currentMonth)
|
|
3370
|
+
return /* @__PURE__ */ e(
|
|
3371
|
+
ko,
|
|
3372
|
+
{
|
|
3373
|
+
type: "button",
|
|
3374
|
+
$currentMonth: !1,
|
|
3375
|
+
$selected: !1,
|
|
3376
|
+
$today: !1,
|
|
3377
|
+
disabled: !0,
|
|
3378
|
+
tabIndex: -1,
|
|
3379
|
+
children: b.day
|
|
3380
|
+
},
|
|
3381
|
+
V
|
|
3382
|
+
);
|
|
3383
|
+
const c = new Date(A, P, b.day), E = co(c, I), G = as(c, u, f);
|
|
3384
|
+
if (g) {
|
|
3385
|
+
const Eo = m ? co(c, m) : !1, Mo = x ? co(c, x) : !1, cr = m && x ? c > m && c < x : !1;
|
|
3386
|
+
return /* @__PURE__ */ e(
|
|
3387
|
+
ko,
|
|
3388
|
+
{
|
|
3389
|
+
type: "button",
|
|
3390
|
+
$currentMonth: !0,
|
|
3391
|
+
$selected: !1,
|
|
3392
|
+
$today: E,
|
|
3393
|
+
$rangeStart: Eo,
|
|
3394
|
+
$rangeEnd: Mo,
|
|
3395
|
+
$inRange: cr,
|
|
3396
|
+
disabled: G,
|
|
3397
|
+
"aria-label": Ho(c),
|
|
3398
|
+
"aria-pressed": Eo || Mo,
|
|
3399
|
+
onClick: () => to(b.day),
|
|
3400
|
+
children: b.day
|
|
3401
|
+
},
|
|
3402
|
+
V
|
|
3403
|
+
);
|
|
3404
|
+
}
|
|
3405
|
+
const po = C ? co(c, C) : !1;
|
|
3406
|
+
return /* @__PURE__ */ e(
|
|
3407
|
+
ko,
|
|
3408
|
+
{
|
|
3409
|
+
type: "button",
|
|
3410
|
+
$currentMonth: !0,
|
|
3411
|
+
$selected: po,
|
|
3412
|
+
$today: E,
|
|
3413
|
+
disabled: G,
|
|
3414
|
+
"aria-label": Ho(c),
|
|
3415
|
+
"aria-pressed": po,
|
|
3416
|
+
onClick: () => to(b.day),
|
|
3417
|
+
children: b.day
|
|
3418
|
+
},
|
|
3419
|
+
V
|
|
3420
|
+
);
|
|
3421
|
+
})
|
|
3422
|
+
] })
|
|
3423
|
+
] })
|
|
2568
3424
|
] })
|
|
2569
|
-
|
|
2570
|
-
|
|
3425
|
+
}
|
|
3426
|
+
);
|
|
2571
3427
|
}
|
|
2572
|
-
|
|
2573
|
-
function
|
|
2574
|
-
const r = parseInt(o.slice(1, 3), 16) / 255, n = parseInt(o.slice(3, 5), 16) / 255,
|
|
2575
|
-
return 0.2126 *
|
|
3428
|
+
ls.displayName = "DatePicker";
|
|
3429
|
+
function cs(o) {
|
|
3430
|
+
const r = parseInt(o.slice(1, 3), 16) / 255, n = parseInt(o.slice(3, 5), 16) / 255, t = parseInt(o.slice(5, 7), 16) / 255, a = (d) => d <= 0.03928 ? d / 12.92 : ((d + 0.055) / 1.055) ** 2.4;
|
|
3431
|
+
return 0.2126 * a(r) + 0.7152 * a(n) + 0.0722 * a(t) > 0.179 ? "#111111" : "#ffffff";
|
|
2576
3432
|
}
|
|
2577
|
-
const
|
|
3433
|
+
const Io = {
|
|
2578
3434
|
colors: {
|
|
2579
3435
|
primary: {
|
|
2580
3436
|
50: "#fffde6",
|
|
@@ -2597,34 +3453,45 @@ const eo = {
|
|
|
2597
3453
|
warning: { 50: "#fffbe6", 500: "#ff9900" },
|
|
2598
3454
|
info: { 50: "#f0f0ff", 500: "#3333ff" }
|
|
2599
3455
|
},
|
|
2600
|
-
spacing: {
|
|
3456
|
+
spacing: {
|
|
3457
|
+
0.5: "2px",
|
|
3458
|
+
1: "4px",
|
|
3459
|
+
2: "8px",
|
|
3460
|
+
3: "12px",
|
|
3461
|
+
4: "16px",
|
|
3462
|
+
5: "20px",
|
|
3463
|
+
6: "24px",
|
|
3464
|
+
8: "32px",
|
|
3465
|
+
10: "40px"
|
|
3466
|
+
},
|
|
2601
3467
|
radius: { md: "2px" },
|
|
2602
3468
|
zIndex: { modal: 1e3, toast: 1100 },
|
|
2603
3469
|
fontSizes: { xs: "12px", sm: "14px", md: "16px", lg: "18px" },
|
|
3470
|
+
fontWeights: { normal: "400", medium: "500", semibold: "600", bold: "700" },
|
|
2604
3471
|
shadows: { focusRing: "3px 3px 0 #111111" },
|
|
2605
3472
|
brutalism: { borderWidth: "2px", shadowOffset: "4px" }
|
|
2606
3473
|
};
|
|
2607
|
-
function
|
|
3474
|
+
function Is(o) {
|
|
2608
3475
|
return {
|
|
2609
|
-
...
|
|
3476
|
+
...Io,
|
|
2610
3477
|
colors: {
|
|
2611
|
-
...
|
|
3478
|
+
...Io.colors,
|
|
2612
3479
|
primary: {
|
|
2613
3480
|
50: "#fffff0",
|
|
2614
3481
|
500: o,
|
|
2615
3482
|
700: o,
|
|
2616
|
-
contrast:
|
|
3483
|
+
contrast: cs(o)
|
|
2617
3484
|
}
|
|
2618
3485
|
}
|
|
2619
3486
|
};
|
|
2620
3487
|
}
|
|
2621
|
-
function
|
|
2622
|
-
theme: o =
|
|
3488
|
+
function Ts({
|
|
3489
|
+
theme: o = Io,
|
|
2623
3490
|
children: r
|
|
2624
3491
|
}) {
|
|
2625
|
-
return /* @__PURE__ */
|
|
3492
|
+
return /* @__PURE__ */ e(ur, { theme: o, children: r });
|
|
2626
3493
|
}
|
|
2627
|
-
const
|
|
3494
|
+
const Ws = pr`
|
|
2628
3495
|
*, *::before, *::after {
|
|
2629
3496
|
box-sizing: border-box;
|
|
2630
3497
|
margin: 0;
|
|
@@ -2643,31 +3510,41 @@ const zt = Bo`
|
|
|
2643
3510
|
}
|
|
2644
3511
|
`;
|
|
2645
3512
|
export {
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
3513
|
+
$r as Badge,
|
|
3514
|
+
Co as Button,
|
|
3515
|
+
qn as Checkbox,
|
|
3516
|
+
ht as CollapsibleCard,
|
|
3517
|
+
ar as ConfirmDialog,
|
|
3518
|
+
zs as ConfirmProvider,
|
|
3519
|
+
ls as DatePicker,
|
|
3520
|
+
un as Editable,
|
|
3521
|
+
bn as Field,
|
|
3522
|
+
Rn as Form,
|
|
3523
|
+
sr as FormField,
|
|
3524
|
+
Ws as GlobalStyles,
|
|
3525
|
+
vr as Input,
|
|
3526
|
+
qo as Link,
|
|
3527
|
+
Go as Modal,
|
|
3528
|
+
rt as Radio,
|
|
3529
|
+
ln as Select,
|
|
3530
|
+
St as Spinner,
|
|
3531
|
+
at as Switch,
|
|
3532
|
+
Yt as Table,
|
|
3533
|
+
Tr as Textarea,
|
|
3534
|
+
Ts as ThemeProvider,
|
|
3535
|
+
On as Toast,
|
|
3536
|
+
$s as ToastProvider,
|
|
3537
|
+
ks as composeValidators,
|
|
3538
|
+
Is as createNeoBrutalTheme,
|
|
3539
|
+
ws as isEmail,
|
|
3540
|
+
ms as isUrl,
|
|
3541
|
+
hs as maxLength,
|
|
3542
|
+
ys as minLength,
|
|
3543
|
+
Io as neoBrutalTheme,
|
|
3544
|
+
vs as pattern,
|
|
3545
|
+
xs as required,
|
|
3546
|
+
Cs as useConfirm,
|
|
3547
|
+
bs as useForm,
|
|
3548
|
+
Ss as useTable,
|
|
3549
|
+
gs as useToast
|
|
2673
3550
|
};
|