blunt-ui 0.3.2 → 0.3.4
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/dist/components/ConfirmDialog/ConfirmDialog.d.ts +5 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts +8 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.test.d.ts +0 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.types.d.ts +13 -0
- package/dist/components/ConfirmDialog/index.d.ts +4 -0
- package/dist/components/ConfirmDialog/useConfirm.d.ts +6 -0
- package/dist/components/ConfirmDialog/useConfirm.test.d.ts +0 -0
- package/dist/components/ConfirmDialog/useConfirm.types.d.ts +14 -0
- package/dist/components/DatePicker/DatePicker.d.ts +5 -0
- package/dist/components/DatePicker/DatePicker.stories.d.ts +11 -0
- package/dist/components/DatePicker/DatePicker.test.d.ts +0 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts +14 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/Editable/Editable.d.ts +5 -0
- package/dist/components/Editable/Editable.stories.d.ts +10 -0
- package/dist/components/Editable/Editable.types.d.ts +9 -0
- package/dist/components/Editable/index.d.ts +2 -0
- package/dist/components/Field/Field.d.ts +5 -0
- package/dist/components/Field/Field.stories.d.ts +8 -0
- package/dist/components/Field/Field.types.d.ts +6 -0
- package/dist/components/Field/index.d.ts +2 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/useForm.d.ts +2 -0
- package/dist/components/Form/useForm.test.d.ts +1 -0
- package/dist/components/Form/useForm.types.d.ts +20 -0
- package/dist/components/Input/Input.types.d.ts +1 -1
- package/dist/components/Select/Select.types.d.ts +2 -3
- package/dist/components/Spinner/Spinner.d.ts +5 -0
- package/dist/components/Spinner/Spinner.stories.d.ts +9 -0
- package/dist/components/Spinner/Spinner.types.d.ts +8 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.stories.d.ts +1 -0
- package/dist/components/Table/Table.types.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts +5 -0
- package/dist/components/Textarea/Textarea.stories.d.ts +8 -0
- package/dist/components/Textarea/Textarea.types.d.ts +11 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/useToast.d.ts +6 -0
- package/dist/components/Toast/useToast.test.d.ts +0 -0
- package/dist/components/Toast/useToast.types.d.ts +17 -0
- package/dist/index.cjs +581 -264
- package/dist/index.d.ts +19 -12
- package/dist/index.js +1782 -1277
- package/dist/{components/ThemeProvider/index.d.ts → themes/ThemeProvider.d.ts} +1 -1
- package/dist/themes/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/components/DataTable/DataTable.d.ts +0 -5
- package/dist/components/DataTable/DataTable.stories.d.ts +0 -14
- package/dist/components/DataTable/DataTable.types.d.ts +0 -30
- package/dist/components/DataTable/index.d.ts +0 -2
- package/dist/themes/default.d.ts +0 -2
- /package/dist/{styles → themes}/GlobalStyles.d.ts +0 -0
- /package/dist/{consts.d.ts → themes/consts.d.ts} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("styled-components"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("styled-components"),a=require("react"),bo=require("react-dom"),B=(o,r,n)=>s.css`
|
|
2
2
|
background: ${r};
|
|
3
3
|
color: ${n};
|
|
4
4
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
5
5
|
box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
|
|
6
|
-
`,
|
|
6
|
+
`,Oo=s.span`
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
align-items: center;
|
|
9
9
|
font-weight: 700;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
font-size: ${r.fontSizes.sm};
|
|
24
24
|
`})[o]}
|
|
25
25
|
|
|
26
|
-
${({$variant:o,theme:r})=>r.brutalism?{primary:
|
|
26
|
+
${({$variant:o,theme:r})=>r.brutalism?{primary:B(r,r.colors.primary[500],r.colors.primary.contrast),neutral:B(r,r.colors.neutral[200],r.colors.neutral[900]),success:B(r,r.colors.success[50],r.colors.success[500]),error:B(r,r.colors.error[50],r.colors.error[500]),warning:B(r,r.colors.warning[50],r.colors.warning[500]),info:B(r,r.colors.info[50],r.colors.info[500])}[o]:{primary:s.css`
|
|
27
27
|
background: ${r.colors.primary[50]};
|
|
28
28
|
color: ${r.colors.primary[500]};
|
|
29
29
|
`,neutral:s.css`
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
background: ${r.colors.info[50]};
|
|
43
43
|
color: ${r.colors.info[500]};
|
|
44
44
|
`}[o]}
|
|
45
|
-
`;function go({variant:o="primary",size:r="md",children:n,...e}){return t.jsx(
|
|
45
|
+
`;function go({variant:o="primary",size:r="md",children:n,...e}){return t.jsx(Oo,{$variant:o,$size:r,...e,children:n})}go.displayName="Badge";const J=(o,r,n)=>s.css`
|
|
46
46
|
background-color: ${r};
|
|
47
47
|
color: ${n};
|
|
48
48
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
transform: translate(2px, 2px);
|
|
56
56
|
box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,No=s.button`
|
|
59
59
|
display: inline-flex;
|
|
60
60
|
align-items: center;
|
|
61
61
|
justify-content: center;
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
cursor: not-allowed;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
${({$variant:o,theme:r})=>r.brutalism?{primary:
|
|
77
|
+
${({$variant:o,theme:r})=>r.brutalism?{primary:J(r,r.colors.primary[500],r.colors.primary.contrast),secondary:J(r,r.colors.neutral[100],r.colors.neutral[900]),outline:J(r,r.colors.neutral[0],r.colors.neutral[900])}[o]:{primary:s.css`
|
|
78
78
|
background-color: ${r.colors.primary[500]};
|
|
79
79
|
color: ${r.colors.neutral[0]};
|
|
80
80
|
border: none;
|
|
@@ -107,15 +107,15 @@
|
|
|
107
107
|
padding: ${r.spacing[3]} ${r.spacing[6]};
|
|
108
108
|
font-size: ${r.fontSizes.lg};
|
|
109
109
|
`})[o]}
|
|
110
|
-
`;function
|
|
110
|
+
`;function H({ref:o,as:r,href:n,variant:e="primary",size:l="md",isLoading:i,disabled:c,children:d,...p}){const b=r??(n?"a":"button");return t.jsx(No,{ref:o,as:b,href:n,$variant:e,$size:l,disabled:i||c,...p,children:i?"Loading...":d})}H.displayName="Button";const Fo=s.div`
|
|
111
111
|
display: flex;
|
|
112
112
|
flex-direction: column;
|
|
113
113
|
gap: ${({theme:o})=>o.spacing[1]};
|
|
114
114
|
width: ${({$fullWidth:o})=>o?"100%":"auto"};
|
|
115
|
-
`,
|
|
115
|
+
`,Lo=s.label`
|
|
116
116
|
font-size: ${({theme:o})=>o.fontSizes.sm};
|
|
117
117
|
font-weight: ${({theme:o})=>o.brutalism?"700":"500"};
|
|
118
|
-
`,
|
|
118
|
+
`,Bo=s.span`
|
|
119
119
|
font-size: ${({theme:o})=>o.fontSizes.xs};
|
|
120
120
|
color: ${({$error:o,theme:r})=>o?r.colors.error[500]:r.colors.neutral[500]};
|
|
121
121
|
`,Vo=s.div`
|
|
@@ -148,9 +148,6 @@
|
|
|
148
148
|
`,outlined:s.css`
|
|
149
149
|
border: 2px solid ${r.colors.primary[500]};
|
|
150
150
|
background-color: ${r.colors.neutral[0]};
|
|
151
|
-
`,filled:s.css`
|
|
152
|
-
border: 1px solid transparent;
|
|
153
|
-
background-color: ${r.colors.neutral[100]};
|
|
154
151
|
`}[o]}
|
|
155
152
|
|
|
156
153
|
${({$error:o,theme:r})=>o&&s.css`
|
|
@@ -163,7 +160,7 @@
|
|
|
163
160
|
&:focus-within {
|
|
164
161
|
box-shadow: ${({theme:o})=>o.shadows.focusRing};
|
|
165
162
|
}
|
|
166
|
-
`,
|
|
163
|
+
`,_o=s.input`
|
|
167
164
|
flex: 1;
|
|
168
165
|
border: none;
|
|
169
166
|
outline: none;
|
|
@@ -174,11 +171,11 @@
|
|
|
174
171
|
cursor: not-allowed;
|
|
175
172
|
opacity: 0.6;
|
|
176
173
|
}
|
|
177
|
-
`,
|
|
174
|
+
`,to=s.div`
|
|
178
175
|
display: inline-flex;
|
|
179
176
|
align-items: center;
|
|
180
177
|
margin: 0 ${({theme:o})=>o.spacing[1]};
|
|
181
|
-
`,
|
|
178
|
+
`,Ro=s.button`
|
|
182
179
|
display: inline-flex;
|
|
183
180
|
align-items: center;
|
|
184
181
|
margin: 0 ${({theme:o})=>o.spacing[1]};
|
|
@@ -191,19 +188,269 @@
|
|
|
191
188
|
&:hover {
|
|
192
189
|
opacity: 0.8;
|
|
193
190
|
}
|
|
194
|
-
`;function xo({ref:o,type:r="text",size:n="md",variant:e="default",label:
|
|
191
|
+
`;function xo({ref:o,type:r="text",size:n="md",variant:e="default",label:l,helperText:i,error:c,leftElement:d,rightElement:p,clearable:b,onClear:g,fullWidth:h,id:y,value:f,defaultValue:x,onChange:v,...k}){const T=a.useId(),$=y??T,C=`${$}-hint`,[S,j]=a.useState(x??""),w=f!==void 0,z=w?f:S,I=typeof c=="string"?c:void 0,M=!!(i||c),D=E=>{w||j(E.target.value),v?.(E)},V=()=>{w||j(""),g?.()};return t.jsxs(Fo,{$fullWidth:h,children:[l&&t.jsx(Lo,{htmlFor:$,children:l}),t.jsxs(Vo,{$size:n,$variant:e,$error:!!c,children:[d&&t.jsx(to,{children:d}),t.jsx(_o,{id:$,ref:o,type:r,value:z,onChange:D,...k,"aria-invalid":!!c,"aria-describedby":M?C:void 0}),b&&z&&t.jsx(Ro,{type:"button",onClick:V,"aria-label":"Clear input",children:"✕"}),p&&t.jsx(to,{children:p})]}),M&&t.jsx(Bo,{id:C,$error:!!c,children:I??i})]})}xo.displayName="Input";const Ao=s.div`
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
gap: ${({theme:o})=>o.spacing[1]};
|
|
195
|
+
width: ${({$fullWidth:o})=>o?"100%":"auto"};
|
|
196
|
+
`,Yo=s.label`
|
|
197
|
+
font-size: ${({theme:o})=>o.fontSizes.sm};
|
|
198
|
+
font-weight: ${({theme:o})=>o.brutalism?"700":"500"};
|
|
199
|
+
`,Ho=s.span`
|
|
200
|
+
font-size: ${({theme:o})=>o.fontSizes.xs};
|
|
201
|
+
color: ${({$error:o,theme:r})=>o?r.colors.error[500]:r.colors.neutral[500]};
|
|
202
|
+
`,qo=s.div`
|
|
203
|
+
display: flex;
|
|
204
|
+
border-radius: ${({theme:o})=>o.radius.md};
|
|
205
|
+
transition:
|
|
206
|
+
border-color 0.2s,
|
|
207
|
+
box-shadow 0.2s;
|
|
208
|
+
|
|
209
|
+
${({$size:o="md",theme:r})=>({sm:s.css`
|
|
210
|
+
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
211
|
+
font-size: ${r.fontSizes.sm};
|
|
212
|
+
`,md:s.css`
|
|
213
|
+
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
214
|
+
font-size: ${r.fontSizes.md};
|
|
215
|
+
`,lg:s.css`
|
|
216
|
+
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
217
|
+
font-size: ${r.fontSizes.lg};
|
|
218
|
+
`})[o]}
|
|
219
|
+
|
|
220
|
+
${({$variant:o="default",theme:r})=>r.brutalism?s.css`
|
|
221
|
+
border: ${r.brutalism.borderWidth} solid
|
|
222
|
+
${r.colors.neutral[900]};
|
|
223
|
+
background-color: ${r.colors.neutral[0]};
|
|
224
|
+
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
225
|
+
`:{default:s.css`
|
|
226
|
+
border: 1px solid ${r.colors.neutral[400]};
|
|
227
|
+
background-color: ${r.colors.neutral[0]};
|
|
228
|
+
`,outlined:s.css`
|
|
229
|
+
border: 2px solid ${r.colors.primary[500]};
|
|
230
|
+
background-color: ${r.colors.neutral[0]};
|
|
231
|
+
`}[o]}
|
|
232
|
+
|
|
233
|
+
${({$error:o,theme:r})=>o&&s.css`
|
|
234
|
+
border-color: ${r.colors.error[500]};
|
|
235
|
+
${r.brutalism&&s.css`
|
|
236
|
+
box-shadow: 3px 3px 0 ${r.colors.error[500]};
|
|
237
|
+
`}
|
|
238
|
+
`}
|
|
239
|
+
|
|
240
|
+
&:focus-within {
|
|
241
|
+
box-shadow: ${({theme:o})=>o.shadows.focusRing};
|
|
242
|
+
}
|
|
243
|
+
`,Uo=s.textarea`
|
|
244
|
+
flex: 1;
|
|
245
|
+
border: none;
|
|
246
|
+
outline: none;
|
|
247
|
+
background: transparent;
|
|
248
|
+
font: inherit;
|
|
249
|
+
resize: vertical;
|
|
250
|
+
min-height: 80px;
|
|
251
|
+
|
|
252
|
+
&:disabled {
|
|
253
|
+
cursor: not-allowed;
|
|
254
|
+
opacity: 0.6;
|
|
255
|
+
}
|
|
256
|
+
`;function yo({ref:o,size:r="md",variant:n="default",label:e,helperText:l,error:i,fullWidth:c,id:d,value:p,defaultValue:b,onChange:g,...h}){const y=a.useId(),f=d??y,x=`${f}-hint`,[v,k]=a.useState(b??""),T=p!==void 0,$=T?p:v,C=typeof i=="string"?i:void 0,S=!!(l||i),j=w=>{T||k(w.target.value),g?.(w)};return t.jsxs(Ao,{$fullWidth:c,children:[e&&t.jsx(Yo,{htmlFor:f,children:e}),t.jsx(qo,{$size:r,$variant:n,$error:!!i,children:t.jsx(Uo,{id:f,ref:o,value:$,onChange:j,...h,"aria-invalid":!!i,"aria-describedby":S?x:void 0})}),S&&t.jsx(Ho,{id:x,$error:!!i,children:C??l})]})}yo.displayName="Textarea";const ho=(...o)=>o.filter((r,n,e)=>!!r&&r.trim()!==""&&e.indexOf(r)===n).join(" ").trim();const Ko=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Go=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,n,e)=>e?e.toUpperCase():n.toLowerCase());const eo=o=>{const r=Go(o);return r.charAt(0).toUpperCase()+r.slice(1)};var X={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Jo=o=>{for(const r in o)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},Xo=a.createContext({}),Zo=()=>a.useContext(Xo),Qo=a.forwardRef(({color:o,size:r,strokeWidth:n,absoluteStrokeWidth:e,className:l="",children:i,iconNode:c,...d},p)=>{const{size:b=24,strokeWidth:g=2,absoluteStrokeWidth:h=!1,color:y="currentColor",className:f=""}=Zo()??{},x=e??h?Number(n??g)*24/Number(r??b):n??g;return a.createElement("svg",{ref:p,...X,width:r??b??X.width,height:r??b??X.height,stroke:o??y,strokeWidth:x,className:ho("lucide",f,l),...!i&&!Jo(d)&&{"aria-hidden":"true"},...d},[...c.map(([v,k])=>a.createElement(v,k)),...Array.isArray(i)?i:[i]])});const N=(o,r)=>{const n=a.forwardRef(({className:e,...l},i)=>a.createElement(Qo,{ref:i,iconNode:r,className:ho(`lucide-${Ko(eo(o))}`,`lucide-${o}`,e),...l}));return n.displayName=eo(o),n};const or=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],rr=N("arrow-down",or);const sr=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],nr=N("arrow-up-down",sr);const tr=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],er=N("arrow-up",tr);const ir=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],ar=N("calendar",ir);const lr=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],wo=N("chevron-down",lr);const cr=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],dr=N("chevron-left",cr);const ur=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],pr=N("chevron-right",ur);const fr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Q=N("x",fr),$r=s.div`
|
|
257
|
+
display: inline-flex;
|
|
258
|
+
flex-direction: column;
|
|
259
|
+
gap: ${({theme:o})=>o.spacing[1]};
|
|
260
|
+
width: ${({$fullWidth:o})=>o?"100%":"auto"};
|
|
261
|
+
`,br=s.div`
|
|
262
|
+
position: relative;
|
|
263
|
+
display: flex;
|
|
264
|
+
width: 100%;
|
|
265
|
+
`,gr=s.span`
|
|
266
|
+
font-size: ${({theme:o})=>o.fontSizes.xs};
|
|
267
|
+
color: ${({$error:o,theme:r})=>o?r.colors.error[500]:r.colors.neutral[500]};
|
|
268
|
+
`,xr=s.select`
|
|
269
|
+
appearance: none;
|
|
270
|
+
width: 100%;
|
|
271
|
+
border-radius: ${({theme:o})=>o.radius.md};
|
|
272
|
+
cursor: pointer;
|
|
273
|
+
font: inherit;
|
|
274
|
+
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
275
|
+
transition:
|
|
276
|
+
border-color 0.2s,
|
|
277
|
+
box-shadow 0.2s;
|
|
278
|
+
|
|
279
|
+
${({$size:o,theme:r})=>({sm:s.css`
|
|
280
|
+
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
281
|
+
font-size: ${r.fontSizes.sm};
|
|
282
|
+
`,md:s.css`
|
|
283
|
+
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
284
|
+
font-size: ${r.fontSizes.md};
|
|
285
|
+
`,lg:s.css`
|
|
286
|
+
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
287
|
+
font-size: ${r.fontSizes.lg};
|
|
288
|
+
`})[o]}
|
|
289
|
+
|
|
290
|
+
padding-right: 2.5rem;
|
|
291
|
+
|
|
292
|
+
${({$variant:o,theme:r})=>r.brutalism?s.css`
|
|
293
|
+
border: ${r.brutalism.borderWidth} solid
|
|
294
|
+
${r.colors.neutral[900]};
|
|
295
|
+
background-color: ${r.colors.neutral[0]};
|
|
296
|
+
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
297
|
+
`:{default:s.css`
|
|
298
|
+
border: 1px solid ${r.colors.neutral[400]};
|
|
299
|
+
background-color: ${r.colors.neutral[0]};
|
|
300
|
+
`,outlined:s.css`
|
|
301
|
+
border: 2px solid ${r.colors.primary[500]};
|
|
302
|
+
background-color: ${r.colors.neutral[0]};
|
|
303
|
+
`}[o]}
|
|
304
|
+
|
|
305
|
+
${({$error:o,theme:r})=>o&&s.css`
|
|
306
|
+
border-color: ${r.colors.error[500]};
|
|
307
|
+
`}
|
|
308
|
+
|
|
309
|
+
&:focus {
|
|
310
|
+
outline: none;
|
|
311
|
+
box-shadow: ${({theme:o})=>o.shadows.focusRing};
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
&:disabled {
|
|
315
|
+
cursor: not-allowed;
|
|
316
|
+
opacity: 0.6;
|
|
317
|
+
}
|
|
318
|
+
`,yr=s.button`
|
|
319
|
+
position: absolute;
|
|
320
|
+
right: ${({theme:o})=>o.spacing[3]};
|
|
321
|
+
top: 50%;
|
|
322
|
+
transform: translateY(-50%);
|
|
323
|
+
display: flex;
|
|
324
|
+
align-items: center;
|
|
325
|
+
padding: 0;
|
|
326
|
+
background: none;
|
|
327
|
+
border: none;
|
|
328
|
+
cursor: pointer;
|
|
329
|
+
color: ${({theme:o})=>o.colors.neutral[500]};
|
|
330
|
+
|
|
331
|
+
&:hover {
|
|
332
|
+
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
&:focus-visible {
|
|
336
|
+
outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
|
|
337
|
+
outline-offset: 2px;
|
|
338
|
+
border-radius: 2px;
|
|
339
|
+
}
|
|
340
|
+
`,hr=s.span`
|
|
341
|
+
position: absolute;
|
|
342
|
+
right: ${({theme:o})=>o.spacing[3]};
|
|
343
|
+
top: 50%;
|
|
344
|
+
transform: translateY(-50%);
|
|
345
|
+
pointer-events: none;
|
|
346
|
+
display: flex;
|
|
347
|
+
align-items: center;
|
|
348
|
+
color: ${({theme:o})=>o.colors.neutral[500]};
|
|
349
|
+
`;function mo({options:o,placeholder:r,size:n="md",variant:e="default",error:l,fullWidth:i,clearable:c,onClear:d,id:p,value:b,defaultValue:g,onChange:h,...y}){const f=a.useId(),x=p??f,v=`${x}-hint`,k=typeof l=="string"?l:void 0,[T,$]=a.useState(g??""),C=b!==void 0,S=C?b:T,j=I=>{C||$(I.target.value),h?.(I)},w=()=>{C||$(""),d?.()},z=c&&!!S;return t.jsxs($r,{$fullWidth:i,children:[t.jsxs(br,{children:[t.jsxs(xr,{id:x,$size:n,$variant:e,$error:!!l,"aria-invalid":!!l,"aria-describedby":k?v:void 0,value:S,onChange:j,...y,children:[r&&t.jsx("option",{value:"",disabled:!0,children:r}),o.map(I=>t.jsx("option",{value:I.value,disabled:I.disabled,children:I.label},I.value))]}),z?t.jsx(yr,{type:"button",onClick:w,"aria-label":"Clear selection",children:t.jsx(Q,{size:14})}):t.jsx(hr,{"aria-hidden":"true",children:t.jsx(wo,{size:14})})]}),k&&t.jsx(gr,{id:v,$error:!0,children:k})]})}mo.displayName="Select";const io=s.span`
|
|
350
|
+
display: inline-block;
|
|
351
|
+
`,wr=s.span`
|
|
352
|
+
display: inline-block;
|
|
353
|
+
min-width: 60px;
|
|
354
|
+
padding: ${({theme:o})=>`${o.spacing[1]} ${o.spacing[2]}`};
|
|
355
|
+
border-radius: ${({theme:o})=>o.radius.md};
|
|
356
|
+
color: ${({$empty:o,theme:r})=>o?r.colors.neutral[400]:"inherit"};
|
|
357
|
+
|
|
358
|
+
${({theme:o})=>o.brutalism?s.css`
|
|
359
|
+
border: ${o.brutalism.borderWidth} solid transparent;
|
|
360
|
+
`:s.css`
|
|
361
|
+
border: 1px solid transparent;
|
|
362
|
+
`}
|
|
363
|
+
|
|
364
|
+
${({$disabled:o,theme:r})=>o?s.css`
|
|
365
|
+
opacity: 0.5;
|
|
366
|
+
`:s.css`
|
|
367
|
+
cursor: text;
|
|
368
|
+
transition:
|
|
369
|
+
border-color 0.15s ease,
|
|
370
|
+
box-shadow 0.15s ease;
|
|
371
|
+
|
|
372
|
+
&:hover {
|
|
373
|
+
${r.brutalism?s.css`
|
|
374
|
+
border-color: ${r.colors.neutral[900]};
|
|
375
|
+
box-shadow: ${r.brutalism.shadowOffset}
|
|
376
|
+
${r.brutalism.shadowOffset} 0
|
|
377
|
+
${r.colors.neutral[900]};
|
|
378
|
+
`:s.css`
|
|
379
|
+
border-color: ${r.colors.primary[500]};
|
|
380
|
+
box-shadow: ${r.shadows.focusRing};
|
|
381
|
+
`}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
&:focus {
|
|
385
|
+
outline: none;
|
|
386
|
+
box-shadow: ${r.shadows.focusRing};
|
|
387
|
+
}
|
|
388
|
+
`}
|
|
389
|
+
`,mr=s.input`
|
|
390
|
+
display: inline-block;
|
|
391
|
+
min-width: 60px;
|
|
392
|
+
padding: ${({theme:o})=>`${o.spacing[1]} ${o.spacing[2]}`};
|
|
393
|
+
border-radius: ${({theme:o})=>o.radius.md};
|
|
394
|
+
font: inherit;
|
|
395
|
+
color: inherit;
|
|
396
|
+
background: ${({theme:o})=>o.colors.neutral[0]};
|
|
397
|
+
outline: none;
|
|
398
|
+
|
|
399
|
+
${({theme:o})=>o.brutalism?s.css`
|
|
400
|
+
border: ${o.brutalism.borderWidth} solid
|
|
401
|
+
${o.colors.neutral[900]};
|
|
402
|
+
box-shadow: ${o.brutalism.shadowOffset}
|
|
403
|
+
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
404
|
+
`:s.css`
|
|
405
|
+
border: 1px solid ${o.colors.primary[500]};
|
|
406
|
+
box-shadow: ${o.shadows.focusRing};
|
|
407
|
+
`}
|
|
408
|
+
`;function vo({value:o,defaultValue:r="",onChange:n,onSubmit:e,onCancel:l,placeholder:i="Click to edit",disabled:c=!1}){const d=o!==void 0,[p,b]=a.useState(r),g=d?o:p,[h,y]=a.useState(!1),[f,x]=a.useState(""),v=a.useRef(null),k=()=>{c||(x(g),y(!0),setTimeout(()=>{v.current?.focus(),v.current?.select()},0))},T=()=>{d||b(f),n?.(f),e?.(f),y(!1)},$=()=>{l?.(g),y(!1)},C=S=>{S.key==="Enter"?T():S.key==="Escape"&&$()};return h?t.jsx(io,{children:t.jsx(mr,{ref:v,value:f,size:Math.max(f.length,i.length,10),onChange:S=>x(S.target.value),onBlur:T,onKeyDown:C,"aria-label":"Edit value"})}):t.jsx(io,{children:t.jsx(wr,{role:c?void 0:"button",tabIndex:c?void 0:0,$disabled:c,$empty:!g,onClick:k,onKeyDown:S=>S.key==="Enter"&&k(),children:g||i})})}vo.displayName="Editable";const vr=s.a`
|
|
409
|
+
text-decoration: underline;
|
|
410
|
+
text-underline-offset: 2px;
|
|
411
|
+
transition: color 0.15s;
|
|
412
|
+
|
|
413
|
+
&:focus-visible {
|
|
414
|
+
outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
|
|
415
|
+
outline-offset: 2px;
|
|
416
|
+
border-radius: 2px;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
${({$variant:o,theme:r})=>({default:s.css`
|
|
420
|
+
color: ${r.colors.primary[500]};
|
|
421
|
+
&:hover {
|
|
422
|
+
color: ${r.colors.primary[700]};
|
|
423
|
+
}
|
|
424
|
+
`,subtle:s.css`
|
|
425
|
+
color: ${r.colors.neutral[500]};
|
|
426
|
+
&:hover {
|
|
427
|
+
color: ${r.colors.neutral[900]};
|
|
428
|
+
}
|
|
429
|
+
`})[o]}
|
|
430
|
+
`;function oo({variant:o="default",external:r,children:n,...e}){return t.jsx(vr,{$variant:o,...r&&{target:"_blank",rel:"noreferrer"},...e,children:n})}oo.displayName="Link";const kr=s.div`
|
|
431
|
+
display: flex;
|
|
432
|
+
flex-direction: column;
|
|
433
|
+
gap: ${({theme:o})=>o.spacing[1]};
|
|
434
|
+
`,Sr=s.span`
|
|
435
|
+
font-size: ${({theme:o})=>o.fontSizes.xs};
|
|
436
|
+
color: ${({theme:o})=>o.colors.neutral[500]};
|
|
437
|
+
font-weight: ${({theme:o})=>o.brutalism?"700":"500"};
|
|
438
|
+
`,jr=s.span`
|
|
439
|
+
font-size: ${({theme:o})=>o.fontSizes.md};
|
|
440
|
+
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
441
|
+
`;function ko({label:o,value:r,href:n}){return t.jsxs(kr,{children:[t.jsx(Sr,{children:o}),n?t.jsx(oo,{href:n,external:!0,children:r}):t.jsx(jr,{children:r??"—"})]})}ko.displayName="Field";const Cr=s.keyframes`
|
|
195
442
|
from { opacity: 0; }
|
|
196
443
|
to { opacity: 1; }
|
|
197
|
-
`,
|
|
444
|
+
`,zr=s.keyframes`
|
|
198
445
|
from { opacity: 1; }
|
|
199
446
|
to { opacity: 0; }
|
|
200
|
-
`,
|
|
447
|
+
`,Tr=s.keyframes`
|
|
201
448
|
from { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
202
449
|
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
203
|
-
`,
|
|
450
|
+
`,Ir=s.keyframes`
|
|
204
451
|
from { opacity: 1; transform: scale(1) translateY(0); }
|
|
205
452
|
to { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
206
|
-
`,
|
|
453
|
+
`,Mr=s.div`
|
|
207
454
|
position: fixed;
|
|
208
455
|
inset: 0;
|
|
209
456
|
background-color: rgba(0, 0, 0, 0.5);
|
|
@@ -211,9 +458,9 @@
|
|
|
211
458
|
align-items: center;
|
|
212
459
|
justify-content: center;
|
|
213
460
|
z-index: ${({theme:o})=>o.zIndex.modal};
|
|
214
|
-
animation: ${({$closing:o})=>o?
|
|
461
|
+
animation: ${({$closing:o})=>o?zr:Cr} 0.15s ease
|
|
215
462
|
forwards;
|
|
216
|
-
`,
|
|
463
|
+
`,Dr=s.div`
|
|
217
464
|
position: relative;
|
|
218
465
|
background: ${({theme:o})=>o.colors.neutral[0]};
|
|
219
466
|
border-radius: ${({theme:o})=>o.radius.md};
|
|
@@ -222,7 +469,7 @@
|
|
|
222
469
|
display: flex;
|
|
223
470
|
flex-direction: column;
|
|
224
471
|
max-height: 90vh;
|
|
225
|
-
animation: ${({$closing:o})=>o?
|
|
472
|
+
animation: ${({$closing:o})=>o?Ir:Tr} 0.15s ease
|
|
226
473
|
forwards;
|
|
227
474
|
|
|
228
475
|
${({$size:o})=>o==="sm"&&s.css`
|
|
@@ -240,19 +487,19 @@
|
|
|
240
487
|
max-height: 100vh;
|
|
241
488
|
border-radius: 0;
|
|
242
489
|
`}
|
|
243
|
-
`,
|
|
490
|
+
`,Er=s.div`
|
|
244
491
|
display: flex;
|
|
245
492
|
align-items: center;
|
|
246
493
|
gap: ${({theme:o})=>o.spacing[2]};
|
|
247
494
|
padding: ${({theme:o})=>o.spacing[4]};
|
|
248
495
|
border-bottom: 1px solid ${({theme:o})=>o.colors.neutral[200]};
|
|
249
496
|
flex-shrink: 0;
|
|
250
|
-
`,
|
|
497
|
+
`,Pr=s.h2`
|
|
251
498
|
flex: 1;
|
|
252
499
|
font-size: ${({theme:o})=>o.fontSizes.lg};
|
|
253
500
|
font-weight: 600;
|
|
254
501
|
margin: 0;
|
|
255
|
-
`,
|
|
502
|
+
`,Wr=s.button`
|
|
256
503
|
display: inline-flex;
|
|
257
504
|
align-items: center;
|
|
258
505
|
justify-content: center;
|
|
@@ -277,11 +524,11 @@
|
|
|
277
524
|
outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
|
|
278
525
|
outline-offset: 2px;
|
|
279
526
|
}
|
|
280
|
-
`,
|
|
527
|
+
`,Or=s.div`
|
|
281
528
|
padding: ${({theme:o})=>o.spacing[4]};
|
|
282
529
|
overflow-y: auto;
|
|
283
530
|
flex: 1;
|
|
284
|
-
`,
|
|
531
|
+
`,Nr=s.div`
|
|
285
532
|
display: flex;
|
|
286
533
|
align-items: center;
|
|
287
534
|
justify-content: flex-end;
|
|
@@ -289,16 +536,16 @@
|
|
|
289
536
|
padding: ${({theme:o})=>o.spacing[4]};
|
|
290
537
|
border-top: 1px solid ${({theme:o})=>o.colors.neutral[200]};
|
|
291
538
|
flex-shrink: 0;
|
|
292
|
-
`,
|
|
539
|
+
`,Fr=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex="-1"])'].join(", ");function ao(o){return Array.from(o.querySelectorAll(Fr))}function ro({open:o,onClose:r,title:n,children:e,footer:l,size:i="md",closeOnBackdrop:c=!0,closeOnEscape:d=!0,ariaLabelledBy:p,ariaDescribedBy:b}){const g=a.useRef(null),h=a.useRef(null),y=a.useId(),f=p??(n?y:void 0),[x,v]=a.useState(o),[k,T]=a.useState(!1);return a.useEffect(()=>{if(o)v(!0),T(!1);else if(x){T(!0);const $=setTimeout(()=>{v(!1),T(!1)},150);return()=>clearTimeout($)}},[o,x]),a.useEffect(()=>{if(!o)return;const $=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=$}},[o]),a.useEffect(()=>{if(!o||!g.current)return;const $=g.current,C=document.activeElement;(ao($)[0]??$).focus();const j=w=>{if(w.key==="Escape"&&d){r();return}if(w.key!=="Tab")return;const z=ao($);if(z.length===0){w.preventDefault();return}const I=z[0],M=z[z.length-1];w.shiftKey?document.activeElement===I&&(w.preventDefault(),M.focus()):document.activeElement===M&&(w.preventDefault(),I.focus())};return document.addEventListener("keydown",j),()=>{document.removeEventListener("keydown",j),C?.focus()}},[o,d,r,x]),x?bo.createPortal(t.jsx(Mr,{$closing:k,onMouseDown:$=>{h.current=$.target},onClick:$=>{c&&h.current===$.currentTarget&&r()},children:t.jsxs(Dr,{ref:g,role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-describedby":b,$size:i,$closing:k,tabIndex:-1,onClick:$=>$.stopPropagation(),children:[t.jsxs(Er,{children:[n&&t.jsx(Pr,{id:y,children:n}),t.jsx(Wr,{onClick:r,"aria-label":"Close modal",children:"×"})]}),t.jsx(Or,{children:e}),l&&t.jsx(Nr,{children:l})]})}),document.body):null}ro.displayName="Modal";const Lr=s.keyframes`
|
|
293
540
|
from { opacity: 0; transform: translateY(12px); }
|
|
294
541
|
to { opacity: 1; transform: translateY(0); }
|
|
295
|
-
`,
|
|
542
|
+
`,Br=s.keyframes`
|
|
296
543
|
from { opacity: 0; transform: translateY(-12px); }
|
|
297
544
|
to { opacity: 1; transform: translateY(0); }
|
|
298
|
-
`,
|
|
545
|
+
`,Vr=s.keyframes`
|
|
299
546
|
from { opacity: 1; }
|
|
300
547
|
to { opacity: 0; }
|
|
301
|
-
`,
|
|
548
|
+
`,_r=s.div`
|
|
302
549
|
position: fixed;
|
|
303
550
|
z-index: ${({theme:o})=>o.zIndex.toast};
|
|
304
551
|
display: flex;
|
|
@@ -309,11 +556,11 @@
|
|
|
309
556
|
padding: ${({theme:o})=>`${o.spacing[3]} ${o.spacing[4]}`};
|
|
310
557
|
border-radius: ${({theme:o})=>o.radius.md};
|
|
311
558
|
animation: ${({$closing:o,$position:r})=>o?s.css`
|
|
312
|
-
${
|
|
559
|
+
${Vr} 0.2s ease forwards
|
|
313
560
|
`:r.startsWith("top")?s.css`
|
|
314
|
-
${
|
|
561
|
+
${Br} 0.2s ease forwards
|
|
315
562
|
`:s.css`
|
|
316
|
-
${
|
|
563
|
+
${Lr} 0.2s ease forwards
|
|
317
564
|
`};
|
|
318
565
|
|
|
319
566
|
${({$position:o,theme:r})=>({"bottom-right":s.css`
|
|
@@ -329,13 +576,13 @@
|
|
|
329
576
|
top: ${r.spacing[6]};
|
|
330
577
|
left: ${r.spacing[6]};
|
|
331
578
|
`})[o]}
|
|
332
|
-
`,
|
|
579
|
+
`,A=(o,r,n)=>s.css`
|
|
333
580
|
background: ${r};
|
|
334
581
|
border: ${o.brutalism.borderWidth} solid ${n};
|
|
335
582
|
box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
|
|
336
583
|
0 ${n};
|
|
337
|
-
`,
|
|
338
|
-
${({$variant:o,theme:r})=>r.brutalism?{success:
|
|
584
|
+
`,Rr=s(_r)`
|
|
585
|
+
${({$variant:o,theme:r})=>r.brutalism?{success:A(r,r.colors.success[50],r.colors.success[500]),error:A(r,r.colors.error[50],r.colors.error[500]),warning:A(r,r.colors.warning[50],r.colors.warning[500]),info:A(r,r.colors.info[50],r.colors.info[500])}[o]:{success:s.css`
|
|
339
586
|
background: ${r.colors.success[50]};
|
|
340
587
|
border-left: 4px solid ${r.colors.success[500]};
|
|
341
588
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
@@ -352,14 +599,14 @@
|
|
|
352
599
|
border-left: 4px solid ${r.colors.info[500]};
|
|
353
600
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
354
601
|
`}[o]}
|
|
355
|
-
`,
|
|
602
|
+
`,Ar=s.p`
|
|
356
603
|
flex: 1;
|
|
357
604
|
margin: 0;
|
|
358
605
|
font-size: ${({theme:o})=>o.fontSizes.sm};
|
|
359
606
|
font-weight: ${({theme:o})=>o.brutalism?600:400};
|
|
360
607
|
line-height: 1.5;
|
|
361
608
|
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
362
|
-
`,
|
|
609
|
+
`,Yr=s.button`
|
|
363
610
|
flex-shrink: 0;
|
|
364
611
|
display: inline-flex;
|
|
365
612
|
align-items: center;
|
|
@@ -381,143 +628,25 @@
|
|
|
381
628
|
outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
|
|
382
629
|
outline-offset: 2px;
|
|
383
630
|
}
|
|
384
|
-
`;function
|
|
631
|
+
`;function so({open:o,onClose:r,message:n,variant:e="info",duration:l=4e3,position:i="bottom-right"}){const[c,d]=a.useState(o),[p,b]=a.useState(!1);return a.useEffect(()=>{if(o)d(!0),b(!1);else if(c){b(!0);const g=setTimeout(()=>{d(!1),b(!1)},200);return()=>{clearTimeout(g)}}},[o,c]),a.useEffect(()=>{if(!o||l===0)return;const g=setTimeout(r,l);return()=>{clearTimeout(g)}},[o,l,r]),c?bo.createPortal(t.jsxs(Rr,{$position:i,$variant:e,$closing:p,role:"alert","aria-live":"polite",children:[t.jsx(Ar,{children:n}),t.jsx(Yr,{onClick:r,"aria-label":"Close notification",children:t.jsx(Q,{size:14,strokeWidth:2.5})})]}),document.body):null}so.displayName="Toast";const So=a.createContext(null);function Hr({children:o}){const[r,n]=a.useState(null),e=a.useCallback(i=>{n({...i,id:Date.now()})},[]),l=a.useMemo(()=>Object.assign(i=>e(i),{success:(i,c)=>e({...c,message:i,variant:"success"}),error:(i,c)=>e({...c,message:i,variant:"error"}),warning:(i,c)=>e({...c,message:i,variant:"warning"}),info:(i,c)=>e({...c,message:i,variant:"info"})}),[e]);return t.jsxs(So.Provider,{value:{toast:l},children:[o,r&&t.jsx(so,{open:!0,onClose:()=>n(null),message:r.message,variant:r.variant,duration:r.duration,position:r.position},r.id)]})}function qr(){const o=a.useContext(So);if(!o)throw new Error("useToast must be used within a ToastProvider");return o}const Ur=s.form`
|
|
385
632
|
display: flex;
|
|
386
633
|
flex-direction: column;
|
|
387
634
|
gap: ${({theme:o})=>o.spacing[4]};
|
|
388
|
-
`,
|
|
635
|
+
`,Kr=s.div`
|
|
389
636
|
display: flex;
|
|
390
637
|
flex-direction: column;
|
|
391
638
|
gap: ${({theme:o})=>o.spacing[1]};
|
|
392
|
-
`,
|
|
639
|
+
`,Gr=s.label`
|
|
393
640
|
font-size: ${({theme:o})=>o.fontSizes.sm};
|
|
394
641
|
font-weight: 500;
|
|
395
642
|
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
396
|
-
`,
|
|
643
|
+
`,Jr=s.span`
|
|
397
644
|
color: ${({theme:o})=>o.colors.error[500]};
|
|
398
645
|
margin-left: 2px;
|
|
399
|
-
`,
|
|
646
|
+
`,Xr=s.span`
|
|
400
647
|
font-size: ${({theme:o})=>o.fontSizes.xs};
|
|
401
648
|
color: ${({$error:o,theme:r})=>o?r.colors.error[500]:r.colors.neutral[500]};
|
|
402
|
-
`;function
|
|
403
|
-
display: inline-flex;
|
|
404
|
-
flex-direction: column;
|
|
405
|
-
gap: ${({theme:o})=>o.spacing[1]};
|
|
406
|
-
width: ${({$fullWidth:o})=>o?"100%":"auto"};
|
|
407
|
-
`,Er=s.div`
|
|
408
|
-
position: relative;
|
|
409
|
-
display: flex;
|
|
410
|
-
width: 100%;
|
|
411
|
-
`,Pr=s.span`
|
|
412
|
-
font-size: ${({theme:o})=>o.fontSizes.xs};
|
|
413
|
-
color: ${({$error:o,theme:r})=>o?r.colors.error[500]:r.colors.neutral[500]};
|
|
414
|
-
`,Wr=s.select`
|
|
415
|
-
appearance: none;
|
|
416
|
-
width: 100%;
|
|
417
|
-
border-radius: ${({theme:o})=>o.radius.md};
|
|
418
|
-
cursor: pointer;
|
|
419
|
-
font: inherit;
|
|
420
|
-
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
421
|
-
transition:
|
|
422
|
-
border-color 0.2s,
|
|
423
|
-
box-shadow 0.2s;
|
|
424
|
-
|
|
425
|
-
${({$size:o,theme:r})=>({sm:s.css`
|
|
426
|
-
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
427
|
-
font-size: ${r.fontSizes.sm};
|
|
428
|
-
`,md:s.css`
|
|
429
|
-
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
430
|
-
font-size: ${r.fontSizes.md};
|
|
431
|
-
`,lg:s.css`
|
|
432
|
-
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
433
|
-
font-size: ${r.fontSizes.lg};
|
|
434
|
-
`})[o]}
|
|
435
|
-
|
|
436
|
-
padding-right: 2.5rem;
|
|
437
|
-
|
|
438
|
-
${({$variant:o,theme:r})=>r.brutalism?s.css`
|
|
439
|
-
border: ${r.brutalism.borderWidth} solid
|
|
440
|
-
${r.colors.neutral[900]};
|
|
441
|
-
background-color: ${r.colors.neutral[0]};
|
|
442
|
-
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
443
|
-
`:{default:s.css`
|
|
444
|
-
border: 1px solid ${r.colors.neutral[400]};
|
|
445
|
-
background-color: ${r.colors.neutral[0]};
|
|
446
|
-
`,outlined:s.css`
|
|
447
|
-
border: 2px solid ${r.colors.primary[500]};
|
|
448
|
-
background-color: ${r.colors.neutral[0]};
|
|
449
|
-
`,filled:s.css`
|
|
450
|
-
border: 1px solid transparent;
|
|
451
|
-
background-color: ${r.colors.neutral[100]};
|
|
452
|
-
`}[o]}
|
|
453
|
-
|
|
454
|
-
${({$error:o,theme:r})=>o&&s.css`
|
|
455
|
-
border-color: ${r.colors.error[500]};
|
|
456
|
-
`}
|
|
457
|
-
|
|
458
|
-
&:focus {
|
|
459
|
-
outline: none;
|
|
460
|
-
box-shadow: ${({theme:o})=>o.shadows.focusRing};
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
&:disabled {
|
|
464
|
-
cursor: not-allowed;
|
|
465
|
-
opacity: 0.6;
|
|
466
|
-
}
|
|
467
|
-
`,Br=s.button`
|
|
468
|
-
position: absolute;
|
|
469
|
-
right: ${({theme:o})=>o.spacing[3]};
|
|
470
|
-
top: 50%;
|
|
471
|
-
transform: translateY(-50%);
|
|
472
|
-
display: flex;
|
|
473
|
-
align-items: center;
|
|
474
|
-
padding: 0;
|
|
475
|
-
background: none;
|
|
476
|
-
border: none;
|
|
477
|
-
cursor: pointer;
|
|
478
|
-
color: ${({theme:o})=>o.colors.neutral[500]};
|
|
479
|
-
|
|
480
|
-
&:hover {
|
|
481
|
-
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
&:focus-visible {
|
|
485
|
-
outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
|
|
486
|
-
outline-offset: 2px;
|
|
487
|
-
border-radius: 2px;
|
|
488
|
-
}
|
|
489
|
-
`,Or=s.span`
|
|
490
|
-
position: absolute;
|
|
491
|
-
right: ${({theme:o})=>o.spacing[3]};
|
|
492
|
-
top: 50%;
|
|
493
|
-
transform: translateY(-50%);
|
|
494
|
-
pointer-events: none;
|
|
495
|
-
display: flex;
|
|
496
|
-
align-items: center;
|
|
497
|
-
color: ${({theme:o})=>o.colors.neutral[500]};
|
|
498
|
-
`;function jo({options:o,placeholder:r,size:n="md",variant:e="default",error:d,fullWidth:i,clearable:c,onClear:u,id:b,value:p,defaultValue:$,onChange:w,...y}){const g=l.useId(),m=b??g,I=`${m}-hint`,z=typeof d=="string"?d:void 0,[x,E]=l.useState($??""),W=p!==void 0,B=W?p:x,h=P=>{W||E(P.target.value),w?.(P)},v=()=>{W||E(""),u?.()},k=c&&!!B;return t.jsxs(Ir,{$fullWidth:i,children:[t.jsxs(Er,{children:[t.jsxs(Wr,{id:m,$size:n,$variant:e,$error:!!d,"aria-invalid":!!d,"aria-describedby":z?I:void 0,value:B,onChange:h,...y,children:[r&&t.jsx("option",{value:"",disabled:!0,children:r}),o.map(P=>t.jsx("option",{value:P.value,disabled:P.disabled,children:P.label},P.value))]}),k?t.jsx(Br,{type:"button",onClick:v,"aria-label":"Clear selection",children:t.jsx(vo,{size:14})}):t.jsx(Or,{"aria-hidden":"true",children:t.jsx(wo,{size:14})})]}),z&&t.jsx(Pr,{id:I,$error:!0,children:z})]})}jo.displayName="Select";const Rr=s.a`
|
|
499
|
-
text-decoration: underline;
|
|
500
|
-
text-underline-offset: 2px;
|
|
501
|
-
transition: color 0.15s;
|
|
502
|
-
|
|
503
|
-
&:focus-visible {
|
|
504
|
-
outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
|
|
505
|
-
outline-offset: 2px;
|
|
506
|
-
border-radius: 2px;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
${({$variant:o,theme:r})=>({default:s.css`
|
|
510
|
-
color: ${r.colors.primary[500]};
|
|
511
|
-
&:hover {
|
|
512
|
-
color: ${r.colors.primary[700]};
|
|
513
|
-
}
|
|
514
|
-
`,subtle:s.css`
|
|
515
|
-
color: ${r.colors.neutral[500]};
|
|
516
|
-
&:hover {
|
|
517
|
-
color: ${r.colors.neutral[900]};
|
|
518
|
-
}
|
|
519
|
-
`})[o]}
|
|
520
|
-
`;function So({variant:o="default",external:r,children:n,...e}){return t.jsx(Rr,{$variant:o,...r&&{target:"_blank",rel:"noreferrer"},...e,children:n})}So.displayName="Link";const Dr=s.div`
|
|
649
|
+
`;function jo({onSubmit:o,children:r,...n}){return t.jsx(Ur,{onSubmit:e=>{e.preventDefault(),o?.(e)},noValidate:!0,...n,children:r})}jo.displayName="Form";function Co({label:o,error:r,helperText:n,required:e,children:l}){const i=a.useId(),c=`${i}-hint`,d=!!(r||n),p=typeof r=="string"?r:void 0,b=a.isValidElement(l)?a.cloneElement(l,{id:i,...d&&{"aria-describedby":c},...r&&{"aria-invalid":!0}}):l;return t.jsxs(Kr,{children:[o&&t.jsxs(Gr,{htmlFor:i,children:[o,e&&t.jsx(Jr,{"aria-hidden":"true",children:" *"})]}),b,d&&t.jsx(Xr,{id:c,$error:!!r,children:p??n})]})}Co.displayName="FormField";function Zr({initialValues:o,validate:r,onSubmit:n,onError:e}){const[l,i]=a.useState(o),[c,d]=a.useState({}),[p,b]=a.useState({}),[g,h]=a.useState(!1),y=a.useRef(l);y.current=l;const f=a.useCallback(j=>{if(!r)return{};const w=r(j);return Object.fromEntries(Object.entries(w).filter(([,z])=>z!==void 0))},[r]),x=a.useRef(p);x.current=p;const v=a.useCallback(j=>{const{name:w,value:z}=j.target;process.env.NODE_ENV!=="production"&&!w&&console.warn("[useForm] handleChange: field is missing a `name` attribute — value will not be tracked.");const I={...y.current,[w]:z};i(I),x.current[w]&&d(f(I))},[f]),k=a.useCallback(j=>{const{name:w}=j.target;process.env.NODE_ENV!=="production"&&!w&&console.warn("[useForm] handleBlur: field is missing a `name` attribute — touched state will not be tracked."),b(z=>({...z,[w]:!0})),d(f(y.current))},[f]),T=a.useCallback(j=>{j?.preventDefault();const w=Object.keys(y.current).reduce((M,D)=>({...M,[D]:!0}),{});b(w);const z=f(y.current);if(d(z),Object.keys(z).length>0){e?.(z);return}(async()=>{h(!0);try{await n?.(y.current)}finally{h(!1)}})()},[f,n,e]),$=a.useCallback((j,w)=>{i(z=>({...z,[j]:w}))},[]),C=a.useCallback(j=>{i(j??o),d({}),b({}),h(!1)},[o]),S=Object.fromEntries(Object.entries(c).filter(([j])=>p[j]));return{values:l,errors:S,touched:p,handleChange:v,handleBlur:k,handleSubmit:T,setFieldValue:$,reset:C,isSubmitting:g}}const Qr=s.div`
|
|
521
650
|
border-radius: ${({theme:o})=>o.radius.md};
|
|
522
651
|
background: ${({theme:o})=>o.colors.neutral[0]};
|
|
523
652
|
overflow: hidden;
|
|
@@ -532,7 +661,7 @@
|
|
|
532
661
|
border: 1px solid ${r??o.colors.neutral[200]};
|
|
533
662
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
534
663
|
`}
|
|
535
|
-
`,
|
|
664
|
+
`,os=s.button`
|
|
536
665
|
width: 100%;
|
|
537
666
|
display: flex;
|
|
538
667
|
align-items: flex-start;
|
|
@@ -552,19 +681,19 @@
|
|
|
552
681
|
${({theme:o,$accentColor:r})=>r??o.colors.primary[500]};
|
|
553
682
|
outline-offset: -2px;
|
|
554
683
|
}
|
|
555
|
-
`,
|
|
684
|
+
`,rs=s.div`
|
|
556
685
|
flex: 1;
|
|
557
686
|
min-width: 0;
|
|
558
|
-
`,
|
|
687
|
+
`,ss=s.span`
|
|
559
688
|
display: block;
|
|
560
689
|
font-size: ${({theme:o})=>o.fontSizes.md};
|
|
561
690
|
font-weight: 600;
|
|
562
691
|
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
563
|
-
`,
|
|
692
|
+
`,ns=s.span`
|
|
564
693
|
display: block;
|
|
565
694
|
font-size: ${({theme:o})=>o.fontSizes.sm};
|
|
566
695
|
color: ${({theme:o})=>o.colors.neutral[500]};
|
|
567
|
-
`,
|
|
696
|
+
`,ts=s.div`
|
|
568
697
|
display: flex;
|
|
569
698
|
flex-direction: row;
|
|
570
699
|
align-items: center;
|
|
@@ -576,11 +705,11 @@
|
|
|
576
705
|
align-items: flex-start;
|
|
577
706
|
gap: ${({theme:o})=>o.spacing[2]};
|
|
578
707
|
}
|
|
579
|
-
`,
|
|
708
|
+
`,es=s.div`
|
|
580
709
|
display: flex;
|
|
581
710
|
align-items: center;
|
|
582
711
|
gap: ${({theme:o})=>o.spacing[2]};
|
|
583
|
-
`,
|
|
712
|
+
`,is=s.span`
|
|
584
713
|
display: inline-flex;
|
|
585
714
|
align-items: center;
|
|
586
715
|
justify-content: center;
|
|
@@ -588,16 +717,29 @@
|
|
|
588
717
|
transition: transform 0.2s ease;
|
|
589
718
|
transform: ${({$open:o})=>o?"rotate(180deg)":"rotate(0deg)"};
|
|
590
719
|
color: ${({theme:o,$accentColor:r})=>r??o.colors.neutral[500]};
|
|
591
|
-
`,
|
|
720
|
+
`,as=s.div`
|
|
592
721
|
display: grid;
|
|
593
722
|
grid-template-rows: ${({$open:o})=>o?"1fr":"0fr"};
|
|
594
723
|
transition: grid-template-rows 0.2s ease;
|
|
595
|
-
`,
|
|
724
|
+
`,ls=s.div`
|
|
596
725
|
overflow: hidden;
|
|
597
|
-
`,
|
|
726
|
+
`,cs=s.div`
|
|
598
727
|
padding: ${({theme:o})=>o.spacing[4]};
|
|
599
728
|
border-top: 1px solid ${({theme:o})=>o.colors.neutral[200]};
|
|
600
|
-
`;function
|
|
729
|
+
`;function zo({title:o,children:r,defaultOpen:n=!1,open:e,onToggle:l,subtitle:i,headerActions:c,accentColor:d}){const[p,b]=a.useState(n),g=a.useId(),h=e!==void 0,y=h?e:p,f=()=>{const x=!y;h||b(x),l?.(x)};return t.jsxs(Qr,{$accentColor:d,children:[t.jsxs(os,{type:"button",$open:y,$accentColor:d,"aria-expanded":y,"aria-controls":g,onClick:f,children:[t.jsxs(rs,{children:[t.jsx(ss,{children:o}),(i||c)&&t.jsxs(ts,{children:[i&&t.jsx(ns,{children:i}),c&&t.jsx(es,{onClick:x=>x.stopPropagation(),children:c})]})]}),t.jsx(is,{$open:y,$accentColor:d,"aria-hidden":"true",children:t.jsx(wo,{size:18,strokeWidth:2.5})})]}),t.jsx(as,{$open:y,children:t.jsx(ls,{id:g,role:"region","aria-label":o,children:t.jsx(cs,{children:r})})})]})}zo.displayName="CollapsibleCard";const ds=s.keyframes`
|
|
730
|
+
to { transform: rotate(360deg); }
|
|
731
|
+
`,us={sm:"16px",md:"24px",lg:"40px"},ps={thin:"2px",normal:"3px",bold:"5px"},fs=s.span`
|
|
732
|
+
display: inline-block;
|
|
733
|
+
border-radius: 50%;
|
|
734
|
+
animation: ${ds} 0.7s linear infinite;
|
|
735
|
+
|
|
736
|
+
${({$size:o="md",$weight:r="normal",$color:n,theme:e})=>{const l=us[o],i=ps[r],c=e.colors.neutral[200],d=n??e.colors.primary[500];return s.css`
|
|
737
|
+
width: ${l};
|
|
738
|
+
height: ${l};
|
|
739
|
+
border: ${i} solid ${c};
|
|
740
|
+
border-top-color: ${d};
|
|
741
|
+
`}}
|
|
742
|
+
`;function To({size:o="md",weight:r="normal",color:n,label:e="Loading..."}){return t.jsx(fs,{$size:o,$weight:r,$color:n,role:"status","aria-label":e})}To.displayName="Spinner";function $s(o,r){return o?.key!==r?{key:r,direction:"asc"}:o.direction==="asc"?{key:r,direction:"desc"}:null}function bs({data:o,sort:r,defaultSort:n,onSortChange:e}){const l=r!==void 0,[i,c]=a.useState(n??null),d=l?r??null:i,p=g=>{const h=$s(d,g);return l||c(h),e?.(h),h},b=a.useMemo(()=>l||!d?o:[...o].sort((g,h)=>{const y=g[d.key],f=h[d.key],x=y<f?-1:y>f?1:0;return d.direction==="asc"?x:-x}),[o,d,l]);return{activeSort:d,sortedData:b,handleSort:p}}const gs=7,lo=3,co=1;function xs(o,r){if(r<=gs)return Array.from({length:r},(e,l)=>l+1);const n=[1];o>lo&&n.push("...");for(let e=Math.max(2,o-co);e<=Math.min(r-1,o+co);e++)n.push(e);return o<r-lo+1&&n.push("..."),n.push(r),n}function ys({data:o,pageSize:r,page:n,defaultPage:e,totalRows:l,onPageChange:i}){const c=n!==void 0,[d,p]=a.useState(e??1),b=c?n:d,g=v=>{c||p(v),i?.(v)},h=c||l!==void 0,y=l??o.length,f=r?Math.max(1,Math.ceil(y/r)):1,x=a.useMemo(()=>{if(!r||h)return o;const v=(b-1)*r;return o.slice(v,v+r)},[o,r,b,h]);return{activePage:b,totalPages:f,displayData:x,handlePageChange:g}}const Io=(o,r)=>o==="sm"?`${r.spacing[1]} ${r.spacing[2]}`:o==="lg"?`${r.spacing[3]} ${r.spacing[4]}`:`${r.spacing[2]} ${r.spacing[3]}`,hs=s.div`
|
|
601
743
|
width: 100%;
|
|
602
744
|
|
|
603
745
|
${({theme:o,$borderColor:r})=>o.brutalism?s.css`
|
|
@@ -616,7 +758,7 @@
|
|
|
616
758
|
${({$stickyHeader:o})=>o&&s.css`
|
|
617
759
|
overflow-y: auto;
|
|
618
760
|
`}
|
|
619
|
-
`,
|
|
761
|
+
`,ws=s.table`
|
|
620
762
|
width: 100%;
|
|
621
763
|
border-collapse: collapse;
|
|
622
764
|
font-size: ${({$size:o,theme:r})=>({sm:r.fontSizes.sm,md:r.fontSizes.md,lg:r.fontSizes.lg})[o]};
|
|
@@ -624,7 +766,7 @@
|
|
|
624
766
|
caption {
|
|
625
767
|
padding: 8px 0;
|
|
626
768
|
}
|
|
627
|
-
`,
|
|
769
|
+
`,ms=s.thead`
|
|
628
770
|
${({$stickyHeader:o})=>o&&s.css`
|
|
629
771
|
position: sticky;
|
|
630
772
|
top: 0;
|
|
@@ -644,7 +786,7 @@
|
|
|
644
786
|
--th-text: ${o.colors.neutral[600]};
|
|
645
787
|
--th-sep: ${n??o.colors.neutral[300]};
|
|
646
788
|
`}
|
|
647
|
-
`,
|
|
789
|
+
`,vs=s.tbody`
|
|
648
790
|
${({$rowColor:o})=>o&&s.css`
|
|
649
791
|
tr {
|
|
650
792
|
background-color: ${o};
|
|
@@ -660,21 +802,37 @@
|
|
|
660
802
|
tr:last-child td {
|
|
661
803
|
border-bottom: none;
|
|
662
804
|
}
|
|
663
|
-
|
|
805
|
+
|
|
806
|
+
tr:hover td {
|
|
807
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
808
|
+
}
|
|
809
|
+
`,Y=s.tr``,ks=s(Y)`
|
|
810
|
+
cursor: pointer;
|
|
811
|
+
|
|
812
|
+
td {
|
|
813
|
+
transition:
|
|
814
|
+
background-color 0.1s,
|
|
815
|
+
box-shadow 0.1s;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
&:hover td {
|
|
819
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
&:hover td:first-child {
|
|
823
|
+
box-shadow: inset 4px 0 0
|
|
824
|
+
${({$accentColor:o,theme:r})=>o??r.colors.neutral[900]};
|
|
825
|
+
}
|
|
826
|
+
`,Ss=s.th`
|
|
664
827
|
background-color: var(--th-bg);
|
|
665
828
|
color: var(--th-text);
|
|
666
829
|
text-align: left;
|
|
667
830
|
font-weight: 700;
|
|
668
831
|
white-space: nowrap;
|
|
669
832
|
|
|
670
|
-
padding: ${({$size:o,theme:r})=>
|
|
833
|
+
padding: ${({$size:o,theme:r})=>Io(o,r)};
|
|
671
834
|
|
|
672
|
-
${({theme:o,$bordered:r})=>o.brutalism?s.css`
|
|
673
|
-
border-right: 1px solid var(--th-sep);
|
|
674
|
-
&:last-child {
|
|
675
|
-
border-right: none;
|
|
676
|
-
}
|
|
677
|
-
`:s.css`
|
|
835
|
+
${({theme:o,$bordered:r})=>o.brutalism?s.css``:s.css`
|
|
678
836
|
border-bottom: 2px solid var(--th-sep);
|
|
679
837
|
${r&&s.css`
|
|
680
838
|
border-right: 1px solid var(--th-sep);
|
|
@@ -683,7 +841,7 @@
|
|
|
683
841
|
}
|
|
684
842
|
`}
|
|
685
843
|
`}
|
|
686
|
-
`,
|
|
844
|
+
`,js=s.button`
|
|
687
845
|
display: inline-flex;
|
|
688
846
|
align-items: center;
|
|
689
847
|
gap: ${({theme:o})=>o.spacing[1]};
|
|
@@ -702,12 +860,12 @@
|
|
|
702
860
|
outline-offset: 2px;
|
|
703
861
|
border-radius: 2px;
|
|
704
862
|
}
|
|
705
|
-
`,
|
|
863
|
+
`,Cs=s.span`
|
|
706
864
|
opacity: 0.5;
|
|
707
865
|
display: inline-flex;
|
|
708
866
|
align-items: center;
|
|
709
|
-
`,
|
|
710
|
-
padding: ${({$size:o,theme:r})=>
|
|
867
|
+
`,Mo=s.td`
|
|
868
|
+
padding: ${({$size:o,theme:r})=>Io(o,r)};
|
|
711
869
|
|
|
712
870
|
${({$bordered:o,$borderColor:r,theme:n})=>n.brutalism?s.css`
|
|
713
871
|
border-bottom: ${n.brutalism.borderWidth} solid
|
|
@@ -725,16 +883,16 @@
|
|
|
725
883
|
border-bottom: 1px solid
|
|
726
884
|
${r??n.colors.neutral[200]};
|
|
727
885
|
`}
|
|
728
|
-
`,
|
|
886
|
+
`,zs=s.td`
|
|
729
887
|
text-align: center;
|
|
730
888
|
color: ${({theme:o})=>o.colors.neutral[400]};
|
|
731
889
|
padding: ${({theme:o})=>`${o.spacing[4]} ${o.spacing[3]}`};
|
|
732
890
|
font-size: ${({theme:o})=>o.fontSizes.sm};
|
|
733
891
|
border-bottom: none;
|
|
734
|
-
`,
|
|
892
|
+
`,Ts=s.keyframes`
|
|
735
893
|
0% { background-position: -400px 0; }
|
|
736
894
|
100% { background-position: 400px 0; }
|
|
737
|
-
`,
|
|
895
|
+
`,Is=s(Mo)``,Ms=s.div`
|
|
738
896
|
height: 14px;
|
|
739
897
|
border-radius: 4px;
|
|
740
898
|
background: linear-gradient(
|
|
@@ -744,8 +902,8 @@
|
|
|
744
902
|
${({theme:o})=>o.colors.neutral[200]} 75%
|
|
745
903
|
);
|
|
746
904
|
background-size: 800px 100%;
|
|
747
|
-
animation: ${
|
|
748
|
-
`,
|
|
905
|
+
animation: ${Ts} 1.6s ease-in-out infinite;
|
|
906
|
+
`,Ds=s.div`
|
|
749
907
|
display: flex;
|
|
750
908
|
align-items: center;
|
|
751
909
|
justify-content: center;
|
|
@@ -758,7 +916,7 @@
|
|
|
758
916
|
`:s.css`
|
|
759
917
|
border-top: 1px solid ${o.colors.neutral[200]};
|
|
760
918
|
`}
|
|
761
|
-
`,
|
|
919
|
+
`,Z=s.button`
|
|
762
920
|
display: inline-flex;
|
|
763
921
|
align-items: center;
|
|
764
922
|
justify-content: center;
|
|
@@ -801,101 +959,260 @@
|
|
|
801
959
|
outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
|
|
802
960
|
outline-offset: 2px;
|
|
803
961
|
}
|
|
804
|
-
`,
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
${({
|
|
808
|
-
|
|
809
|
-
|
|
962
|
+
`,Es=4;function Ps(o,r){return o?.key!==r?t.jsx(nr,{size:14}):o.direction==="asc"?t.jsx(er,{size:14}):t.jsx(rr,{size:14})}function Do({columns:o,data:r,rowKey:n,size:e="md",striped:l,bordered:i,stickyHeader:c,caption:d,emptyMessage:p="No data",loading:b,sort:g,defaultSort:h,onSortChange:y,pageSize:f,page:x,defaultPage:v,totalRows:k,onPageChange:T,onChange:$,onRowClick:C,borderColor:S,headerColor:j,rowColor:w,stripeColor:z,className:I,style:M}){const{activeSort:D,sortedData:V,handleSort:E}=bs({data:r,sort:g,defaultSort:h,onSortChange:y}),{activePage:P,totalPages:_,displayData:u,handlePageChange:O}=ys({data:V,pageSize:f,page:x,defaultPage:v,totalRows:k,onPageChange:T}),F=m=>{const W=E(m);$?.({sort:W,page:P})},L=m=>{O(m),$?.({sort:D,page:m})},U=(m,W)=>String(n?m[n]:W),K=!b&&u.length===0,Wo=f??Es;return t.jsxs(hs,{$borderColor:S,$stickyHeader:c,className:I,style:M,children:[t.jsxs(ws,{$size:e,children:[d&&t.jsx("caption",{children:d}),t.jsx(ms,{$headerColor:j,$borderColor:S,$stickyHeader:c,children:t.jsx(Y,{children:o.map(m=>t.jsx(Ss,{$size:e,$bordered:i,scope:"col",style:m.width?{width:m.width}:void 0,children:m.sortable?t.jsxs(js,{type:"button",onClick:()=>F(m.key),"aria-label":`Sort by ${m.header}${D?.key===m.key?`, ${D.direction}ending`:""}`,children:[m.header,t.jsx(Cs,{"aria-hidden":"true",children:Ps(D,m.key)})]}):m.header},m.key))})}),t.jsx(vs,{$striped:l,$rowColor:w,$stripeColor:z,children:b?Array.from({length:Wo}).map((m,W)=>t.jsx(Y,{children:o.map(G=>t.jsx(Is,{$size:e,$bordered:i,$borderColor:S,children:t.jsx(Ms,{})},G.key))},W)):K?t.jsx("tr",{children:t.jsx(zs,{colSpan:o.length,children:p})}):u.map((m,W)=>{const G=C?ks:Y;return t.jsx(G,{onClick:C?()=>C(m):void 0,$accentColor:C?S:void 0,children:o.map(R=>t.jsx(Mo,{$size:e,$bordered:i,$borderColor:S,children:R.render?R.render(m[R.key],m,W):String(m[R.key]??"")||" "},R.key))},U(m,W))})})]}),f&&_>1&&t.jsxs(Ds,{children:[t.jsx(Z,{type:"button",onClick:()=>L(P-1),disabled:P<=1,"aria-label":"Previous page",children:"←"}),xs(P,_).map((m,W)=>m==="..."?t.jsx("span",{"aria-hidden":"true",style:{padding:"0 4px"},children:"…"},`e${W}`):t.jsx(Z,{type:"button",$active:m===P,onClick:()=>L(m),"aria-label":`Page ${m}`,"aria-current":m===P?"page":void 0,children:m},m)),t.jsx(Z,{type:"button",onClick:()=>L(P+1),disabled:P>=_,"aria-label":"Next page",children:"→"})]})]})}Do.displayName="Table";function Ws({defaultSort:o,defaultPage:r=1}={}){const[n,e]=a.useState(o??null),[l,i]=a.useState(r);return{sort:n,page:l,onSortChange:p=>{e(p),i(1)},onPageChange:p=>{i(p)}}}const Os=s.p`
|
|
963
|
+
margin: 0;
|
|
964
|
+
font-size: ${({theme:o})=>o.fontSizes.md};
|
|
965
|
+
color: ${({theme:o})=>o.colors.neutral[600]};
|
|
966
|
+
line-height: 1.5;
|
|
967
|
+
`,Ns=s.button`
|
|
968
|
+
display: inline-flex;
|
|
969
|
+
align-items: center;
|
|
970
|
+
justify-content: center;
|
|
971
|
+
border-radius: ${({theme:o})=>o.radius.md};
|
|
972
|
+
font-weight: 600;
|
|
973
|
+
cursor: pointer;
|
|
974
|
+
padding: ${({theme:o})=>o.spacing[2]} ${({theme:o})=>o.spacing[4]};
|
|
975
|
+
font-size: ${({theme:o})=>o.fontSizes.md};
|
|
976
|
+
background-color: ${({theme:o})=>o.colors.error[500]};
|
|
977
|
+
color: ${({theme:o})=>o.colors.neutral[0]};
|
|
978
|
+
border: none;
|
|
810
979
|
|
|
811
|
-
|
|
812
|
-
|
|
980
|
+
&:hover:not(:disabled) {
|
|
981
|
+
opacity: 0.88;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
&:focus-visible {
|
|
985
|
+
outline: 2px solid ${({theme:o})=>o.colors.error[500]};
|
|
986
|
+
outline-offset: 2px;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
&:disabled {
|
|
990
|
+
opacity: 0.5;
|
|
991
|
+
cursor: not-allowed;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
${({theme:o})=>o.brutalism&&s.css`
|
|
995
|
+
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
996
|
+
box-shadow: ${o.brutalism.shadowOffset}
|
|
997
|
+
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
998
|
+
transition:
|
|
999
|
+
transform 0.1s,
|
|
1000
|
+
box-shadow 0.1s;
|
|
1001
|
+
&:hover:not(:disabled) {
|
|
1002
|
+
opacity: 1;
|
|
1003
|
+
transform: translate(2px, 2px);
|
|
1004
|
+
box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
|
|
813
1005
|
}
|
|
814
1006
|
`}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
1007
|
+
`;function no({open:o,title:r="Are you sure?",message:n,confirmLabel:e="Confirm",cancelLabel:l="Cancel",variant:i="default",size:c="sm",onConfirm:d,onCancel:p}){return t.jsx(ro,{open:o,onClose:p,title:r,size:c,closeOnBackdrop:!1,footer:t.jsxs(t.Fragment,{children:[t.jsx(H,{variant:"outline",onClick:p,children:l}),i==="danger"?t.jsx(Ns,{type:"button",onClick:d,children:e}):t.jsx(H,{variant:"primary",onClick:d,children:e})]}),children:t.jsx(Os,{children:n})})}no.displayName="ConfirmDialog";const Eo=a.createContext(null);function Fs({children:o}){const[r,n]=a.useState(null),e=a.useCallback(c=>new Promise(d=>{n({...c,resolve:d})}),[]),l=()=>{r?.resolve(!0),n(null)},i=()=>{r?.resolve(!1),n(null)};return t.jsxs(Eo.Provider,{value:{confirm:e},children:[o,r&&t.jsx(no,{open:!0,title:r.title,message:r.message,confirmLabel:r.confirmLabel,cancelLabel:r.cancelLabel,variant:r.variant,size:r.size,onConfirm:l,onCancel:i})]})}function Ls(){const o=a.useContext(Eo);if(!o)throw new Error("useConfirm must be used within a ConfirmProvider");return o.confirm}const Bs=s.div`
|
|
1008
|
+
position: relative;
|
|
1009
|
+
display: inline-flex;
|
|
1010
|
+
flex-direction: column;
|
|
1011
|
+
gap: ${({theme:o})=>o.spacing[1]};
|
|
1012
|
+
`,Vs=s.div`
|
|
1013
|
+
display: flex;
|
|
1014
|
+
align-items: center;
|
|
1015
|
+
border-radius: ${({theme:o})=>o.radius.md};
|
|
1016
|
+
cursor: pointer;
|
|
1017
|
+
user-select: none;
|
|
1018
|
+
min-width: 200px;
|
|
1019
|
+
transition:
|
|
1020
|
+
border-color 0.2s,
|
|
1021
|
+
box-shadow 0.2s;
|
|
1022
|
+
|
|
1023
|
+
${({$size:o,theme:r})=>({sm:s.css`
|
|
1024
|
+
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
1025
|
+
font-size: ${r.fontSizes.sm};
|
|
1026
|
+
`,md:s.css`
|
|
1027
|
+
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
1028
|
+
font-size: ${r.fontSizes.md};
|
|
1029
|
+
`,lg:s.css`
|
|
1030
|
+
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
1031
|
+
font-size: ${r.fontSizes.lg};
|
|
1032
|
+
`})[o]}
|
|
827
1033
|
|
|
828
1034
|
${({theme:o})=>o.brutalism?s.css`
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1035
|
+
border: ${o.brutalism.borderWidth} solid
|
|
1036
|
+
${o.colors.neutral[900]};
|
|
1037
|
+
background-color: ${o.colors.neutral[0]};
|
|
1038
|
+
box-shadow: 3px 3px 0 ${o.colors.neutral[900]};
|
|
1039
|
+
`:s.css`
|
|
1040
|
+
border: 1px solid ${o.colors.neutral[400]};
|
|
1041
|
+
background-color: ${o.colors.neutral[0]};
|
|
1042
|
+
`}
|
|
1043
|
+
|
|
1044
|
+
${({$error:o,theme:r})=>o&&s.css`
|
|
1045
|
+
border-color: ${r.colors.error[500]};
|
|
1046
|
+
`}
|
|
1047
|
+
|
|
1048
|
+
${({$disabled:o})=>o&&s.css`
|
|
1049
|
+
cursor: not-allowed;
|
|
1050
|
+
opacity: 0.6;
|
|
1051
|
+
`}
|
|
1052
|
+
|
|
1053
|
+
&:focus {
|
|
1054
|
+
outline: none;
|
|
1055
|
+
box-shadow: ${({theme:o})=>o.shadows.focusRing};
|
|
1056
|
+
}
|
|
1057
|
+
`,_s=s.span`
|
|
1058
|
+
flex: 1;
|
|
1059
|
+
color: ${({$hasValue:o,theme:r})=>o?r.colors.neutral[900]:r.colors.neutral[400]};
|
|
1060
|
+
white-space: nowrap;
|
|
1061
|
+
overflow: hidden;
|
|
1062
|
+
text-overflow: ellipsis;
|
|
1063
|
+
`,Rs=s.span`
|
|
851
1064
|
display: inline-flex;
|
|
852
1065
|
align-items: center;
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
1066
|
+
margin-left: ${({theme:o})=>o.spacing[2]};
|
|
1067
|
+
color: ${({theme:o})=>o.colors.neutral[500]};
|
|
1068
|
+
flex-shrink: 0;
|
|
1069
|
+
`,As=s.button`
|
|
1070
|
+
display: inline-flex;
|
|
1071
|
+
align-items: center;
|
|
1072
|
+
margin-left: ${({theme:o})=>o.spacing[2]};
|
|
856
1073
|
padding: 0;
|
|
857
1074
|
background: none;
|
|
858
1075
|
border: none;
|
|
859
1076
|
cursor: pointer;
|
|
860
|
-
font-size: ${({theme:o})=>o.fontSizes.xs};
|
|
861
1077
|
color: ${({theme:o})=>o.colors.neutral[500]};
|
|
862
|
-
|
|
863
|
-
transition: color 0.1s;
|
|
1078
|
+
flex-shrink: 0;
|
|
864
1079
|
|
|
865
1080
|
&:hover {
|
|
866
|
-
color: ${({theme:o})=>o.colors.
|
|
1081
|
+
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
1082
|
+
}
|
|
867
1083
|
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
1084
|
+
&:focus-visible {
|
|
1085
|
+
outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
|
|
1086
|
+
outline-offset: 2px;
|
|
1087
|
+
border-radius: 2px;
|
|
871
1088
|
}
|
|
872
|
-
`,
|
|
1089
|
+
`,Ys=s.span`
|
|
1090
|
+
font-size: ${({theme:o})=>o.fontSizes.xs};
|
|
1091
|
+
color: ${({$error:o,theme:r})=>o?r.colors.error[500]:r.colors.neutral[500]};
|
|
1092
|
+
`,Hs=s.div`
|
|
1093
|
+
position: absolute;
|
|
1094
|
+
top: calc(100% + 4px);
|
|
1095
|
+
left: 0;
|
|
1096
|
+
z-index: ${({theme:o})=>o.zIndex.modal};
|
|
1097
|
+
background: ${({theme:o})=>o.colors.neutral[0]};
|
|
1098
|
+
border-radius: ${({theme:o})=>o.radius.md};
|
|
1099
|
+
padding: ${({theme:o})=>o.spacing[3]};
|
|
1100
|
+
min-width: 280px;
|
|
1101
|
+
|
|
873
1102
|
${({theme:o})=>o.brutalism?s.css`
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1103
|
+
border: ${o.brutalism.borderWidth} solid
|
|
1104
|
+
${o.colors.neutral[900]};
|
|
1105
|
+
box-shadow: ${o.brutalism.shadowOffset}
|
|
1106
|
+
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
1107
|
+
`:s.css`
|
|
1108
|
+
border: 1px solid ${o.colors.neutral[200]};
|
|
1109
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
1110
|
+
`}
|
|
1111
|
+
`,qs=s.div`
|
|
1112
|
+
display: flex;
|
|
1113
|
+
align-items: center;
|
|
1114
|
+
justify-content: space-between;
|
|
1115
|
+
margin-bottom: ${({theme:o})=>o.spacing[3]};
|
|
1116
|
+
`,uo=s.button`
|
|
880
1117
|
display: inline-flex;
|
|
881
1118
|
align-items: center;
|
|
882
|
-
|
|
883
|
-
|
|
1119
|
+
justify-content: center;
|
|
1120
|
+
width: 28px;
|
|
1121
|
+
height: 28px;
|
|
884
1122
|
border: none;
|
|
1123
|
+
background: none;
|
|
1124
|
+
border-radius: ${({theme:o})=>o.radius.md};
|
|
885
1125
|
cursor: pointer;
|
|
886
|
-
font: inherit;
|
|
887
|
-
font-weight: 600;
|
|
888
1126
|
color: ${({theme:o})=>o.colors.neutral[600]};
|
|
889
|
-
padding:
|
|
890
|
-
width: 100%;
|
|
891
|
-
text-align: left;
|
|
1127
|
+
padding: 0;
|
|
892
1128
|
|
|
893
1129
|
&:hover {
|
|
894
|
-
color: ${({theme:o})=>o.
|
|
1130
|
+
background-color: ${({theme:o})=>o.colors.neutral[100]};
|
|
1131
|
+
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
895
1132
|
}
|
|
896
1133
|
|
|
897
1134
|
&:focus-visible {
|
|
898
1135
|
outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
|
|
899
1136
|
outline-offset: 2px;
|
|
900
1137
|
}
|
|
901
|
-
|
|
1138
|
+
|
|
1139
|
+
${({theme:o})=>o.brutalism&&s.css`
|
|
1140
|
+
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
1141
|
+
&:hover {
|
|
1142
|
+
background-color: ${o.colors.neutral[100]};
|
|
1143
|
+
transform: translate(1px, 1px);
|
|
1144
|
+
}
|
|
1145
|
+
`}
|
|
1146
|
+
`,Us=s.span`
|
|
1147
|
+
font-weight: 600;
|
|
1148
|
+
font-size: ${({theme:o})=>o.fontSizes.md};
|
|
1149
|
+
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
1150
|
+
`,Ks=s.div`
|
|
1151
|
+
display: grid;
|
|
1152
|
+
grid-template-columns: repeat(7, 1fr);
|
|
1153
|
+
gap: 2px;
|
|
1154
|
+
`,Gs=s.span`
|
|
1155
|
+
display: flex;
|
|
1156
|
+
align-items: center;
|
|
1157
|
+
justify-content: center;
|
|
1158
|
+
font-size: ${({theme:o})=>o.fontSizes.xs};
|
|
1159
|
+
font-weight: 600;
|
|
1160
|
+
color: ${({theme:o})=>o.colors.neutral[500]};
|
|
1161
|
+
padding: ${({theme:o})=>o.spacing[1]};
|
|
1162
|
+
margin-bottom: 2px;
|
|
1163
|
+
`,po=s.button`
|
|
1164
|
+
display: flex;
|
|
1165
|
+
align-items: center;
|
|
1166
|
+
justify-content: center;
|
|
1167
|
+
aspect-ratio: 1;
|
|
1168
|
+
border: none;
|
|
1169
|
+
background: none;
|
|
1170
|
+
border-radius: ${({theme:o})=>o.radius.md};
|
|
1171
|
+
cursor: pointer;
|
|
1172
|
+
font-size: ${({theme:o})=>o.fontSizes.sm};
|
|
1173
|
+
padding: ${({theme:o})=>o.spacing[1]};
|
|
1174
|
+
font-weight: ${({$today:o,$selected:r})=>o||r?"600":"400"};
|
|
1175
|
+
pointer-events: ${({$currentMonth:o})=>o?"auto":"none"};
|
|
1176
|
+
|
|
1177
|
+
color: ${({$currentMonth:o,$selected:r,$today:n,theme:e})=>o?r?e.colors.primary.contrast:n?e.colors.primary[500]:e.colors.neutral[900]:e.colors.neutral[300]};
|
|
1178
|
+
|
|
1179
|
+
background-color: ${({$selected:o,theme:r})=>o?r.colors.primary[500]:"transparent"};
|
|
1180
|
+
|
|
1181
|
+
&:hover:not(:disabled) {
|
|
1182
|
+
background-color: ${({$selected:o,theme:r})=>o?r.colors.primary[700]:r.colors.neutral[100]};
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
&:disabled {
|
|
1186
|
+
opacity: 0.35;
|
|
1187
|
+
cursor: not-allowed;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
&:focus-visible {
|
|
1191
|
+
outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
|
|
1192
|
+
outline-offset: 1px;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
${({$selected:o,$today:r,theme:n})=>n.brutalism&&(o||r)&&s.css`
|
|
1196
|
+
border: ${n.brutalism.borderWidth} solid ${n.colors.neutral[900]};
|
|
1197
|
+
${o&&s.css`
|
|
1198
|
+
box-shadow: 2px 2px 0 ${n.colors.neutral[900]};
|
|
1199
|
+
`}
|
|
1200
|
+
`}
|
|
1201
|
+
`,Js=["January","February","March","April","May","June","July","August","September","October","November","December"],Xs=["Su","Mo","Tu","We","Th","Fr","Sa"];function fo(o,r){return new Date(o,r+1,0).getDate()}function Zs(o,r){return new Date(o,r,1).getDay()}function $o(o,r){return o.getFullYear()===r.getFullYear()&&o.getMonth()===r.getMonth()&&o.getDate()===r.getDate()}function Qs(o,r,n){if(r){const e=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(o<e)return!0}if(n){const e=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(o>e)return!0}return!1}function on(o){return o.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function rn(o){return o.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})}function Po({value:o=null,onChange:r,placeholder:n="Select date...",size:e="md",disabled:l=!1,clearable:i=!1,minDate:c,maxDate:d,formatDate:p,id:b,error:g}){const h=a.useId(),y=b??h,f=new Date,[x,v]=a.useState(!1),[k,T]=a.useState(()=>(o??f).getFullYear()),[$,C]=a.useState(()=>(o??f).getMonth()),S=a.useRef(null);a.useEffect(()=>{if(!x)return;const u=O=>{S.current&&!S.current.contains(O.target)&&v(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[x]),a.useEffect(()=>{o&&(T(o.getFullYear()),C(o.getMonth()))},[o]);const j=o?p?p(o):on(o):"",w=u=>{r?.(new Date(k,$,u)),v(!1)},z=u=>{u.stopPropagation(),r?.(null)},I=()=>{$===0?(C(11),T(u=>u-1)):C(u=>u-1)},M=()=>{$===11?(C(0),T(u=>u+1)):C(u=>u+1)},D=fo(k,$),V=Zs(k,$),E=[],P=fo($===0?k-1:k,$===0?11:$-1);for(let u=V-1;u>=0;u--)E.push({day:P-u,currentMonth:!1});for(let u=1;u<=D;u++)E.push({day:u,currentMonth:!0});const _=42-E.length;for(let u=1;u<=_;u++)E.push({day:u,currentMonth:!1});return t.jsxs(Bs,{ref:S,children:[t.jsxs(Vs,{id:y,$size:e,$error:!!g,$disabled:l,role:"combobox","aria-haspopup":"true","aria-expanded":x,tabIndex:l?-1:0,onClick:()=>{l||v(u=>!u)},onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&!l&&(u.preventDefault(),v(O=>!O)),u.key==="Escape"&&v(!1)},children:[t.jsx(_s,{$hasValue:!!o,children:j||n}),i&&o?t.jsx(As,{type:"button",onClick:z,"aria-label":"Clear date",children:t.jsx(Q,{size:14})}):t.jsx(Rs,{"aria-hidden":"true",children:t.jsx(ar,{size:14})})]}),typeof g=="string"&&t.jsx(Ys,{$error:!0,children:g}),x&&t.jsxs(Hs,{role:"dialog","aria-label":"Calendar",children:[t.jsxs(qs,{children:[t.jsx(uo,{type:"button",onClick:I,"aria-label":"Previous month",children:t.jsx(dr,{size:16})}),t.jsxs(Us,{children:[Js[$]," ",k]}),t.jsx(uo,{type:"button",onClick:M,"aria-label":"Next month",children:t.jsx(pr,{size:16})})]}),t.jsxs(Ks,{children:[Xs.map(u=>t.jsx(Gs,{children:u},u)),E.map((u,O)=>{if(!u.currentMonth)return t.jsx(po,{type:"button",$currentMonth:!1,$selected:!1,$today:!1,disabled:!0,tabIndex:-1,children:u.day},O);const F=new Date(k,$,u.day),L=o?$o(F,o):!1,U=$o(F,f),K=Qs(F,c,d);return t.jsx(po,{type:"button",$currentMonth:!0,$selected:L,$today:U,disabled:K,"aria-label":rn(F),"aria-pressed":L,onClick:()=>w(u.day),children:u.day},O)})]})]})]})}Po.displayName="DatePicker";function sn(o){const r=parseInt(o.slice(1,3),16)/255,n=parseInt(o.slice(3,5),16)/255,e=parseInt(o.slice(5,7),16)/255,l=c=>c<=.03928?c/12.92:((c+.055)/1.055)**2.4;return .2126*l(r)+.7152*l(n)+.0722*l(e)>.179?"#111111":"#ffffff"}const q={colors:{primary:{50:"#fffde6",500:"#ffd000",700:"#ffd000",contrast:"#111111"},neutral:{0:"#ffffff",100:"#f5f0e8",200:"#e8e3db",300:"#ccc8c0",400:"#a8a49c",500:"#706c64",600:"#3c3830",900:"#111111"},error:{50:"#fff0f0",500:"#ff3333"},success:{50:"#f0fff4",500:"#00cc44"},warning:{50:"#fffbe6",500:"#ff9900"},info:{50:"#f0f0ff",500:"#3333ff"}},spacing:{1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px"},radius:{md:"2px"},zIndex:{modal:1e3,toast:1100},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px"},shadows:{focusRing:"3px 3px 0 #111111"},brutalism:{borderWidth:"2px",shadowOffset:"4px"}};function nn(o){return{...q,colors:{...q.colors,primary:{50:"#fffff0",500:o,700:o,contrast:sn(o)}}}}function tn({theme:o=q,children:r}){return t.jsx(s.ThemeProvider,{theme:o,children:r})}const en=s.createGlobalStyle`
|
|
1202
|
+
*, *::before, *::after {
|
|
1203
|
+
box-sizing: border-box;
|
|
1204
|
+
margin: 0;
|
|
1205
|
+
padding: 0;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
html, body {
|
|
1209
|
+
font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
|
|
1210
|
+
font-size: ${({theme:o})=>o.fontSizes.md};
|
|
1211
|
+
color: ${({theme:o})=>o.colors.neutral[900]};
|
|
1212
|
+
background-color: ${({theme:o})=>o.colors.neutral[0]};
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
button, input, select, textarea {
|
|
1216
|
+
font-family: inherit;
|
|
1217
|
+
}
|
|
1218
|
+
`;exports.Badge=go;exports.Button=H;exports.CollapsibleCard=zo;exports.ConfirmDialog=no;exports.ConfirmProvider=Fs;exports.DatePicker=Po;exports.Editable=vo;exports.Field=ko;exports.Form=jo;exports.FormField=Co;exports.GlobalStyles=en;exports.Input=xo;exports.Link=oo;exports.Modal=ro;exports.Select=mo;exports.Spinner=To;exports.Table=Do;exports.Textarea=yo;exports.ThemeProvider=tn;exports.Toast=so;exports.ToastProvider=Hr;exports.createNeoBrutalTheme=nn;exports.neoBrutalTheme=q;exports.useConfirm=Ls;exports.useForm=Zr;exports.useTable=Ws;exports.useToast=qr;
|