blunt-ui 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("styled-components"),i=require("react"),U=require("react-dom"),O=(o,s,t)=>r.css`
2
- background: ${s};
3
- color: ${t};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("styled-components"),a=require("react"),fo=require("react-dom"),A=(o,r,n)=>s.css`
2
+ background: ${r};
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
- `,xo=r.span`
6
+ `,Do=s.span`
7
7
  display: inline-flex;
8
8
  align-items: center;
9
9
  font-weight: 700;
@@ -15,36 +15,36 @@
15
15
  text-overflow: ellipsis;
16
16
  max-width: 20ch;
17
17
 
18
- ${({$size:o,theme:s})=>({sm:r.css`
18
+ ${({$size:o,theme:r})=>({sm:s.css`
19
19
  padding: 2px 8px;
20
- font-size: ${s.fontSizes.xs};
21
- `,md:r.css`
20
+ font-size: ${r.fontSizes.xs};
21
+ `,md:s.css`
22
22
  padding: 4px 10px;
23
- font-size: ${s.fontSizes.sm};
23
+ font-size: ${r.fontSizes.sm};
24
24
  `})[o]}
25
25
 
26
- ${({$variant:o,theme:s})=>s.brutalism?{primary:O(s,s.colors.primary[500],s.colors.primary.contrast),neutral:O(s,s.colors.neutral[200],s.colors.neutral[900]),success:O(s,s.colors.success[50],s.colors.success[500]),error:O(s,s.colors.error[50],s.colors.error[500]),warning:O(s,s.colors.warning[50],s.colors.warning[500]),info:O(s,s.colors.info[50],s.colors.info[500])}[o]:{primary:r.css`
27
- background: ${s.colors.primary[50]};
28
- color: ${s.colors.primary[500]};
29
- `,neutral:r.css`
30
- background: ${s.colors.neutral[200]};
31
- color: ${s.colors.neutral[600]};
32
- `,success:r.css`
33
- background: ${s.colors.success[50]};
34
- color: ${s.colors.success[500]};
35
- `,error:r.css`
36
- background: ${s.colors.error[50]};
37
- color: ${s.colors.error[500]};
38
- `,warning:r.css`
39
- background: ${s.colors.warning[50]};
40
- color: ${s.colors.warning[500]};
41
- `,info:r.css`
42
- background: ${s.colors.info[50]};
43
- color: ${s.colors.info[500]};
26
+ ${({$variant:o,theme:r})=>r.brutalism?{primary:A(r,r.colors.primary[500],r.colors.primary.contrast),neutral:A(r,r.colors.neutral[200],r.colors.neutral[900]),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]:{primary:s.css`
27
+ background: ${r.colors.primary[50]};
28
+ color: ${r.colors.primary[500]};
29
+ `,neutral:s.css`
30
+ background: ${r.colors.neutral[200]};
31
+ color: ${r.colors.neutral[600]};
32
+ `,success:s.css`
33
+ background: ${r.colors.success[50]};
34
+ color: ${r.colors.success[500]};
35
+ `,error:s.css`
36
+ background: ${r.colors.error[50]};
37
+ color: ${r.colors.error[500]};
38
+ `,warning:s.css`
39
+ background: ${r.colors.warning[50]};
40
+ color: ${r.colors.warning[500]};
41
+ `,info:s.css`
42
+ background: ${r.colors.info[50]};
43
+ color: ${r.colors.info[500]};
44
44
  `}[o]}
45
- `;function Z({variant:o="primary",size:s="md",children:t,...e}){return n.jsx(xo,{$variant:o,$size:s,...e,children:t})}Z.displayName="Badge";const D=(o,s,t)=>r.css`
46
- background-color: ${s};
47
- color: ${t};
45
+ `;function bo({variant:o="primary",size:r="md",children:n,...e}){return t.jsx(Do,{$variant:o,$size:r,...e,children:n})}bo.displayName="Badge";const J=(o,r,n)=>s.css`
46
+ background-color: ${r};
47
+ color: ${n};
48
48
  border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
49
49
  box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
50
50
  0 ${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
- `,yo=r.button`
58
+ `,Ro=s.button`
59
59
  display: inline-flex;
60
60
  align-items: center;
61
61
  justify-content: center;
@@ -74,51 +74,51 @@
74
74
  cursor: not-allowed;
75
75
  }
76
76
 
77
- ${({$variant:o,theme:s})=>s.brutalism?{primary:D(s,s.colors.primary[500],s.colors.primary.contrast),secondary:D(s,s.colors.neutral[100],s.colors.neutral[900]),outline:D(s,s.colors.neutral[0],s.colors.neutral[900])}[o]:{primary:r.css`
78
- background-color: ${s.colors.primary[500]};
79
- color: ${s.colors.neutral[0]};
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
+ background-color: ${r.colors.primary[500]};
79
+ color: ${r.colors.neutral[0]};
80
80
  border: none;
81
81
  &:hover:not(:disabled) {
82
- background-color: ${s.colors.primary[700]};
82
+ background-color: ${r.colors.primary[700]};
83
83
  }
84
- `,secondary:r.css`
85
- background-color: ${s.colors.neutral[200]};
86
- color: ${s.colors.neutral[600]};
84
+ `,secondary:s.css`
85
+ background-color: ${r.colors.neutral[200]};
86
+ color: ${r.colors.neutral[600]};
87
87
  border: none;
88
88
  &:hover:not(:disabled) {
89
- background-color: ${s.colors.neutral[300]};
89
+ background-color: ${r.colors.neutral[300]};
90
90
  }
91
- `,outline:r.css`
91
+ `,outline:s.css`
92
92
  background-color: transparent;
93
- color: ${s.colors.primary[500]};
94
- border: 2px solid ${s.colors.primary[500]};
93
+ color: ${r.colors.primary[500]};
94
+ border: 2px solid ${r.colors.primary[500]};
95
95
  &:hover:not(:disabled) {
96
- background-color: ${s.colors.primary[50]};
96
+ background-color: ${r.colors.primary[50]};
97
97
  }
98
98
  `}[o]}
99
99
 
100
- ${({$size:o,theme:s})=>({sm:r.css`
101
- padding: ${s.spacing[1]} ${s.spacing[3]};
102
- font-size: ${s.fontSizes.sm};
103
- `,md:r.css`
104
- padding: ${s.spacing[2]} ${s.spacing[4]};
105
- font-size: ${s.fontSizes.md};
106
- `,lg:r.css`
107
- padding: ${s.spacing[3]} ${s.spacing[6]};
108
- font-size: ${s.fontSizes.lg};
100
+ ${({$size:o,theme:r})=>({sm:s.css`
101
+ padding: ${r.spacing[1]} ${r.spacing[3]};
102
+ font-size: ${r.fontSizes.sm};
103
+ `,md:s.css`
104
+ padding: ${r.spacing[2]} ${r.spacing[4]};
105
+ font-size: ${r.fontSizes.md};
106
+ `,lg:s.css`
107
+ padding: ${r.spacing[3]} ${r.spacing[6]};
108
+ font-size: ${r.fontSizes.lg};
109
109
  `})[o]}
110
- `;function X({ref:o,as:s,href:t,variant:e="primary",size:l="md",isLoading:d,disabled:c,children:a,...f}){const u=s??(t?"a":"button");return n.jsx(yo,{ref:o,as:u,href:t,$variant:e,$size:l,disabled:d||c,...f,children:d?"Loading...":a})}X.displayName="Button";const wo=r.div`
110
+ `;function go({ref:o,as:r,href:n,variant:e="primary",size:c="md",isLoading:i,disabled:l,children:u,...x}){const p=r??(n?"a":"button");return t.jsx(Ro,{ref:o,as:p,href:n,$variant:e,$size:c,disabled:i||l,...x,children:i?"Loading...":u})}go.displayName="Button";const No=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
- `,vo=r.label`
115
+ `,Lo=s.label`
116
116
  font-size: ${({theme:o})=>o.fontSizes.sm};
117
117
  font-weight: ${({theme:o})=>o.brutalism?"700":"500"};
118
- `,mo=r.span`
118
+ `,Ao=s.span`
119
119
  font-size: ${({theme:o})=>o.fontSizes.xs};
120
- color: ${({$error:o,theme:s})=>o?s.colors.error[500]:s.colors.neutral[500]};
121
- `,ko=r.div`
120
+ color: ${({$error:o,theme:r})=>o?r.colors.error[500]:r.colors.neutral[500]};
121
+ `,Mo=s.div`
122
122
  display: flex;
123
123
  align-items: center;
124
124
  border-radius: ${({theme:o})=>o.radius.md};
@@ -126,44 +126,44 @@
126
126
  border-color 0.2s,
127
127
  box-shadow 0.2s;
128
128
 
129
- ${({$size:o="md",theme:s})=>({sm:r.css`
130
- padding: ${s.spacing[1]} ${s.spacing[2]};
131
- font-size: ${s.fontSizes.sm};
132
- `,md:r.css`
133
- padding: ${s.spacing[2]} ${s.spacing[3]};
134
- font-size: ${s.fontSizes.md};
135
- `,lg:r.css`
136
- padding: ${s.spacing[3]} ${s.spacing[4]};
137
- font-size: ${s.fontSizes.lg};
129
+ ${({$size:o="md",theme:r})=>({sm:s.css`
130
+ padding: ${r.spacing[1]} ${r.spacing[2]};
131
+ font-size: ${r.fontSizes.sm};
132
+ `,md:s.css`
133
+ padding: ${r.spacing[2]} ${r.spacing[3]};
134
+ font-size: ${r.fontSizes.md};
135
+ `,lg:s.css`
136
+ padding: ${r.spacing[3]} ${r.spacing[4]};
137
+ font-size: ${r.fontSizes.lg};
138
138
  `})[o]}
139
139
 
140
- ${({$variant:o="default",theme:s})=>s.brutalism?r.css`
141
- border: ${s.brutalism.borderWidth} solid
142
- ${s.colors.neutral[900]};
143
- background-color: ${s.colors.neutral[0]};
144
- box-shadow: 3px 3px 0 ${s.colors.neutral[900]};
145
- `:{default:r.css`
146
- border: 1px solid ${s.colors.neutral[400]};
147
- background-color: ${s.colors.neutral[0]};
148
- `,outlined:r.css`
149
- border: 2px solid ${s.colors.primary[500]};
150
- background-color: ${s.colors.neutral[0]};
151
- `,filled:r.css`
140
+ ${({$variant:o="default",theme:r})=>r.brutalism?s.css`
141
+ border: ${r.brutalism.borderWidth} solid
142
+ ${r.colors.neutral[900]};
143
+ background-color: ${r.colors.neutral[0]};
144
+ box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
145
+ `:{default:s.css`
146
+ border: 1px solid ${r.colors.neutral[400]};
147
+ background-color: ${r.colors.neutral[0]};
148
+ `,outlined:s.css`
149
+ border: 2px solid ${r.colors.primary[500]};
150
+ background-color: ${r.colors.neutral[0]};
151
+ `,filled:s.css`
152
152
  border: 1px solid transparent;
153
- background-color: ${s.colors.neutral[100]};
153
+ background-color: ${r.colors.neutral[100]};
154
154
  `}[o]}
155
155
 
156
- ${({$error:o,theme:s})=>o&&r.css`
157
- border-color: ${s.colors.error[500]};
158
- ${s.brutalism&&r.css`
159
- box-shadow: 3px 3px 0 ${s.colors.error[500]};
156
+ ${({$error:o,theme:r})=>o&&s.css`
157
+ border-color: ${r.colors.error[500]};
158
+ ${r.brutalism&&s.css`
159
+ box-shadow: 3px 3px 0 ${r.colors.error[500]};
160
160
  `}
161
161
  `}
162
162
 
163
163
  &:focus-within {
164
164
  box-shadow: ${({theme:o})=>o.shadows.focusRing};
165
165
  }
166
- `,ho=r.input`
166
+ `,_o=s.input`
167
167
  flex: 1;
168
168
  border: none;
169
169
  outline: none;
@@ -174,11 +174,11 @@
174
174
  cursor: not-allowed;
175
175
  opacity: 0.6;
176
176
  }
177
- `,H=r.div`
177
+ `,io=s.div`
178
178
  display: inline-flex;
179
179
  align-items: center;
180
180
  margin: 0 ${({theme:o})=>o.spacing[1]};
181
- `,jo=r.button`
181
+ `,Fo=s.button`
182
182
  display: inline-flex;
183
183
  align-items: center;
184
184
  margin: 0 ${({theme:o})=>o.spacing[1]};
@@ -191,19 +191,19 @@
191
191
  &:hover {
192
192
  opacity: 0.8;
193
193
  }
194
- `;function G({ref:o,type:s="text",size:t="md",variant:e="default",label:l,helperText:d,error:c,leftElement:a,rightElement:f,clearable:u,onClear:x,fullWidth:h,id:w,value:p,defaultValue:b,onChange:C,...j}){const m=i.useId(),T=w??m,I=`${T}-hint`,[E,$]=i.useState(b??""),y=p!==void 0,v=y?p:E,k=typeof c=="string"?c:void 0,W=!!(d||c),R=S=>{y||$(S.target.value),C?.(S)},g=()=>{y||$(""),x?.()};return n.jsxs(wo,{$fullWidth:h,children:[l&&n.jsx(vo,{htmlFor:T,children:l}),n.jsxs(ko,{$size:t,$variant:e,$error:!!c,children:[a&&n.jsx(H,{children:a}),n.jsx(ho,{id:T,ref:o,type:s,value:v,onChange:R,...j,"aria-invalid":!!c,"aria-describedby":W?I:void 0}),u&&v&&n.jsx(jo,{type:"button",onClick:g,"aria-label":"Clear input",children:"✕"}),f&&n.jsx(H,{children:f})]}),W&&n.jsx(mo,{id:I,$error:!!c,children:k??d})]})}G.displayName="Input";const Co=r.keyframes`
194
+ `;function $o({ref:o,type:r="text",size:n="md",variant:e="default",label:c,helperText:i,error:l,leftElement:u,rightElement:x,clearable:p,onClear:g,fullWidth:w,id:y,value:b,defaultValue:k,onChange:C,...S}){const v=a.useId(),z=y??v,W=`${z}-hint`,[B,h]=a.useState(k??""),$=b!==void 0,m=$?b:B,E=typeof l=="string"?l:void 0,R=!!(i||l),N=P=>{$||h(P.target.value),C?.(P)},M=()=>{$||h(""),g?.()};return t.jsxs(No,{$fullWidth:w,children:[c&&t.jsx(Lo,{htmlFor:z,children:c}),t.jsxs(Mo,{$size:n,$variant:e,$error:!!l,children:[u&&t.jsx(io,{children:u}),t.jsx(_o,{id:z,ref:o,type:r,value:m,onChange:N,...S,"aria-invalid":!!l,"aria-describedby":R?W:void 0}),p&&m&&t.jsx(Fo,{type:"button",onClick:M,"aria-label":"Clear input",children:"✕"}),x&&t.jsx(io,{children:x})]}),R&&t.jsx(Ao,{id:W,$error:!!l,children:E??i})]})}$o.displayName="Input";const Vo=s.keyframes`
195
195
  from { opacity: 0; }
196
196
  to { opacity: 1; }
197
- `,So=r.keyframes`
197
+ `,Ko=s.keyframes`
198
198
  from { opacity: 1; }
199
199
  to { opacity: 0; }
200
- `,zo=r.keyframes`
200
+ `,Ho=s.keyframes`
201
201
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
202
202
  to { opacity: 1; transform: scale(1) translateY(0); }
203
- `,To=r.keyframes`
203
+ `,qo=s.keyframes`
204
204
  from { opacity: 1; transform: scale(1) translateY(0); }
205
205
  to { opacity: 0; transform: scale(0.95) translateY(-8px); }
206
- `,Io=r.div`
206
+ `,Yo=s.div`
207
207
  position: fixed;
208
208
  inset: 0;
209
209
  background-color: rgba(0, 0, 0, 0.5);
@@ -211,9 +211,9 @@
211
211
  align-items: center;
212
212
  justify-content: center;
213
213
  z-index: ${({theme:o})=>o.zIndex.modal};
214
- animation: ${({$closing:o})=>o?So:Co} 0.15s ease
214
+ animation: ${({$closing:o})=>o?Ko:Vo} 0.15s ease
215
215
  forwards;
216
- `,Eo=r.div`
216
+ `,Uo=s.div`
217
217
  position: relative;
218
218
  background: ${({theme:o})=>o.colors.neutral[0]};
219
219
  border-radius: ${({theme:o})=>o.radius.md};
@@ -222,37 +222,37 @@
222
222
  display: flex;
223
223
  flex-direction: column;
224
224
  max-height: 90vh;
225
- animation: ${({$closing:o})=>o?To:zo} 0.15s ease
225
+ animation: ${({$closing:o})=>o?qo:Ho} 0.15s ease
226
226
  forwards;
227
227
 
228
- ${({$size:o})=>o==="sm"&&r.css`
228
+ ${({$size:o})=>o==="sm"&&s.css`
229
229
  width: min(400px, 90vw);
230
230
  `}
231
- ${({$size:o})=>o==="md"&&r.css`
231
+ ${({$size:o})=>o==="md"&&s.css`
232
232
  width: min(560px, 90vw);
233
233
  `}
234
- ${({$size:o})=>o==="lg"&&r.css`
234
+ ${({$size:o})=>o==="lg"&&s.css`
235
235
  width: min(720px, 90vw);
236
236
  `}
237
- ${({$size:o})=>o==="fullscreen"&&r.css`
237
+ ${({$size:o})=>o==="fullscreen"&&s.css`
238
238
  width: 100vw;
239
239
  height: 100vh;
240
240
  max-height: 100vh;
241
241
  border-radius: 0;
242
242
  `}
243
- `,Wo=r.div`
243
+ `,Go=s.div`
244
244
  display: flex;
245
245
  align-items: center;
246
246
  gap: ${({theme:o})=>o.spacing[2]};
247
247
  padding: ${({theme:o})=>o.spacing[4]};
248
248
  border-bottom: 1px solid ${({theme:o})=>o.colors.neutral[200]};
249
249
  flex-shrink: 0;
250
- `,Bo=r.h2`
250
+ `,Xo=s.h2`
251
251
  flex: 1;
252
252
  font-size: ${({theme:o})=>o.fontSizes.lg};
253
253
  font-weight: 600;
254
254
  margin: 0;
255
- `,Oo=r.button`
255
+ `,Zo=s.button`
256
256
  display: inline-flex;
257
257
  align-items: center;
258
258
  justify-content: center;
@@ -277,11 +277,11 @@
277
277
  outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
278
278
  outline-offset: 2px;
279
279
  }
280
- `,Ro=r.div`
280
+ `,Jo=s.div`
281
281
  padding: ${({theme:o})=>o.spacing[4]};
282
282
  overflow-y: auto;
283
283
  flex: 1;
284
- `,Fo=r.div`
284
+ `,Qo=s.div`
285
285
  display: flex;
286
286
  align-items: center;
287
287
  justify-content: flex-end;
@@ -289,16 +289,16 @@
289
289
  padding: ${({theme:o})=>o.spacing[4]};
290
290
  border-top: 1px solid ${({theme:o})=>o.colors.neutral[200]};
291
291
  flex-shrink: 0;
292
- `,Lo=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex="-1"])'].join(", ");function _(o){return Array.from(o.querySelectorAll(Lo))}function J({open:o,onClose:s,title:t,children:e,footer:l,size:d="md",closeOnBackdrop:c=!0,closeOnEscape:a=!0,ariaLabelledBy:f,ariaDescribedBy:u}){const x=i.useRef(null),h=i.useId(),w=f??(t?h:void 0),[p,b]=i.useState(o),[C,j]=i.useState(!1);return i.useEffect(()=>{if(o)b(!0),j(!1);else if(p){j(!0);const m=setTimeout(()=>{b(!1),j(!1)},150);return()=>clearTimeout(m)}},[o,p]),i.useEffect(()=>{if(!o)return;const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}},[o]),i.useEffect(()=>{if(!o||!x.current)return;const m=x.current,T=document.activeElement;(_(m)[0]??m).focus();const E=$=>{if($.key==="Escape"&&a){s();return}if($.key!=="Tab")return;const y=_(m);if(y.length===0){$.preventDefault();return}const v=y[0],k=y[y.length-1];$.shiftKey?document.activeElement===v&&($.preventDefault(),k.focus()):document.activeElement===k&&($.preventDefault(),v.focus())};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),T?.focus()}},[o,a,s,p]),p?U.createPortal(n.jsx(Io,{$closing:C,onClick:c?s:void 0,children:n.jsxs(Eo,{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":w,"aria-describedby":u,$size:d,$closing:C,tabIndex:-1,onClick:m=>m.stopPropagation(),children:[n.jsxs(Wo,{children:[t&&n.jsx(Bo,{id:h,children:t}),n.jsx(Oo,{onClick:s,"aria-label":"Close modal",children:"×"})]}),n.jsx(Ro,{children:e}),l&&n.jsx(Fo,{children:l})]})}),document.body):null}J.displayName="Modal";const Q=(...o)=>o.filter((s,t,e)=>!!s&&s.trim()!==""&&e.indexOf(s)===t).join(" ").trim();const Ao=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const No=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,t,e)=>e?e.toUpperCase():t.toLowerCase());const q=o=>{const s=No(o);return s.charAt(0).toUpperCase()+s.slice(1)};var V={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 Do=o=>{for(const s in o)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1},Vo=i.createContext({}),Mo=()=>i.useContext(Vo),Po=i.forwardRef(({color:o,size:s,strokeWidth:t,absoluteStrokeWidth:e,className:l="",children:d,iconNode:c,...a},f)=>{const{size:u=24,strokeWidth:x=2,absoluteStrokeWidth:h=!1,color:w="currentColor",className:p=""}=Mo()??{},b=e??h?Number(t??x)*24/Number(s??u):t??x;return i.createElement("svg",{ref:f,...V,width:s??u??V.width,height:s??u??V.height,stroke:o??w,strokeWidth:b,className:Q("lucide",p,l),...!d&&!Do(a)&&{"aria-hidden":"true"},...a},[...c.map(([C,j])=>i.createElement(C,j)),...Array.isArray(d)?d:[d]])});const oo=(o,s)=>{const t=i.forwardRef(({className:e,...l},d)=>i.createElement(Po,{ref:d,iconNode:s,className:Q(`lucide-${Ao(q(o))}`,`lucide-${o}`,e),...l}));return t.displayName=q(o),t};const Yo=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],so=oo("chevron-down",Yo);const Ho=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ro=oo("x",Ho),_o=r.keyframes`
292
+ `,or=["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(or))}function xo({open:o,onClose:r,title:n,children:e,footer:c,size:i="md",closeOnBackdrop:l=!0,closeOnEscape:u=!0,ariaLabelledBy:x,ariaDescribedBy:p}){const g=a.useRef(null),w=a.useId(),y=x??(n?w:void 0),[b,k]=a.useState(o),[C,S]=a.useState(!1);return a.useEffect(()=>{if(o)k(!0),S(!1);else if(b){S(!0);const v=setTimeout(()=>{k(!1),S(!1)},150);return()=>clearTimeout(v)}},[o,b]),a.useEffect(()=>{if(!o)return;const v=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=v}},[o]),a.useEffect(()=>{if(!o||!g.current)return;const v=g.current,z=document.activeElement;(ao(v)[0]??v).focus();const B=h=>{if(h.key==="Escape"&&u){r();return}if(h.key!=="Tab")return;const $=ao(v);if($.length===0){h.preventDefault();return}const m=$[0],E=$[$.length-1];h.shiftKey?document.activeElement===m&&(h.preventDefault(),E.focus()):document.activeElement===E&&(h.preventDefault(),m.focus())};return document.addEventListener("keydown",B),()=>{document.removeEventListener("keydown",B),z?.focus()}},[o,u,r,b]),b?fo.createPortal(t.jsx(Yo,{$closing:C,onClick:l?r:void 0,children:t.jsxs(Uo,{ref:g,role:"dialog","aria-modal":"true","aria-labelledby":y,"aria-describedby":p,$size:i,$closing:C,tabIndex:-1,onClick:v=>v.stopPropagation(),children:[t.jsxs(Go,{children:[n&&t.jsx(Xo,{id:w,children:n}),t.jsx(Zo,{onClick:r,"aria-label":"Close modal",children:"×"})]}),t.jsx(Jo,{children:e}),c&&t.jsx(Qo,{children:c})]})}),document.body):null}xo.displayName="Modal";const yo=(...o)=>o.filter((r,n,e)=>!!r&&r.trim()!==""&&e.indexOf(r)===n).join(" ").trim();const rr=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const sr=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,n,e)=>e?e.toUpperCase():n.toLowerCase());const lo=o=>{const r=sr(o);return r.charAt(0).toUpperCase()+r.slice(1)};var Q={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 nr=o=>{for(const r in o)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},tr=a.createContext({}),er=()=>a.useContext(tr),ir=a.forwardRef(({color:o,size:r,strokeWidth:n,absoluteStrokeWidth:e,className:c="",children:i,iconNode:l,...u},x)=>{const{size:p=24,strokeWidth:g=2,absoluteStrokeWidth:w=!1,color:y="currentColor",className:b=""}=er()??{},k=e??w?Number(n??g)*24/Number(r??p):n??g;return a.createElement("svg",{ref:x,...Q,width:r??p??Q.width,height:r??p??Q.height,stroke:o??y,strokeWidth:k,className:yo("lucide",b,c),...!i&&!nr(u)&&{"aria-hidden":"true"},...u},[...l.map(([C,S])=>a.createElement(C,S)),...Array.isArray(i)?i:[i]])});const K=(o,r)=>{const n=a.forwardRef(({className:e,...c},i)=>a.createElement(ir,{ref:i,iconNode:r,className:yo(`lucide-${rr(lo(o))}`,`lucide-${o}`,e),...c}));return n.displayName=lo(o),n};const ar=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],lr=K("arrow-down",ar);const cr=[["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"}]],dr=K("arrow-up-down",cr);const ur=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],pr=K("arrow-up",ur);const fr=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ho=K("chevron-down",fr);const br=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wo=K("x",br),gr=s.keyframes`
293
293
  from { opacity: 0; transform: translateY(12px); }
294
294
  to { opacity: 1; transform: translateY(0); }
295
- `,qo=r.keyframes`
295
+ `,$r=s.keyframes`
296
296
  from { opacity: 0; transform: translateY(-12px); }
297
297
  to { opacity: 1; transform: translateY(0); }
298
- `,Ko=r.keyframes`
298
+ `,xr=s.keyframes`
299
299
  from { opacity: 1; }
300
300
  to { opacity: 0; }
301
- `,Uo=r.div`
301
+ `,yr=s.div`
302
302
  position: fixed;
303
303
  z-index: ${({theme:o})=>o.zIndex.toast};
304
304
  display: flex;
@@ -308,58 +308,58 @@
308
308
  max-width: 400px;
309
309
  padding: ${({theme:o})=>`${o.spacing[3]} ${o.spacing[4]}`};
310
310
  border-radius: ${({theme:o})=>o.radius.md};
311
- animation: ${({$closing:o,$position:s})=>o?r.css`
312
- ${Ko} 0.2s ease forwards
313
- `:s.startsWith("top")?r.css`
314
- ${qo} 0.2s ease forwards
315
- `:r.css`
316
- ${_o} 0.2s ease forwards
311
+ animation: ${({$closing:o,$position:r})=>o?s.css`
312
+ ${xr} 0.2s ease forwards
313
+ `:r.startsWith("top")?s.css`
314
+ ${$r} 0.2s ease forwards
315
+ `:s.css`
316
+ ${gr} 0.2s ease forwards
317
317
  `};
318
318
 
319
- ${({$position:o,theme:s})=>({"bottom-right":r.css`
320
- bottom: ${s.spacing[6]};
321
- right: ${s.spacing[6]};
322
- `,"bottom-left":r.css`
323
- bottom: ${s.spacing[6]};
324
- left: ${s.spacing[6]};
325
- `,"top-right":r.css`
326
- top: ${s.spacing[6]};
327
- right: ${s.spacing[6]};
328
- `,"top-left":r.css`
329
- top: ${s.spacing[6]};
330
- left: ${s.spacing[6]};
319
+ ${({$position:o,theme:r})=>({"bottom-right":s.css`
320
+ bottom: ${r.spacing[6]};
321
+ right: ${r.spacing[6]};
322
+ `,"bottom-left":s.css`
323
+ bottom: ${r.spacing[6]};
324
+ left: ${r.spacing[6]};
325
+ `,"top-right":s.css`
326
+ top: ${r.spacing[6]};
327
+ right: ${r.spacing[6]};
328
+ `,"top-left":s.css`
329
+ top: ${r.spacing[6]};
330
+ left: ${r.spacing[6]};
331
331
  `})[o]}
332
- `,L=(o,s,t)=>r.css`
333
- background: ${s};
334
- border: ${o.brutalism.borderWidth} solid ${t};
332
+ `,Y=(o,r,n)=>s.css`
333
+ background: ${r};
334
+ border: ${o.brutalism.borderWidth} solid ${n};
335
335
  box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
336
- 0 ${t};
337
- `,Zo=r(Uo)`
338
- ${({$variant:o,theme:s})=>s.brutalism?{success:L(s,s.colors.success[50],s.colors.success[500]),error:L(s,s.colors.error[50],s.colors.error[500]),warning:L(s,s.colors.warning[50],s.colors.warning[500]),info:L(s,s.colors.info[50],s.colors.info[500])}[o]:{success:r.css`
339
- background: ${s.colors.success[50]};
340
- border-left: 4px solid ${s.colors.success[500]};
336
+ 0 ${n};
337
+ `,hr=s(yr)`
338
+ ${({$variant:o,theme:r})=>r.brutalism?{success:Y(r,r.colors.success[50],r.colors.success[500]),error:Y(r,r.colors.error[50],r.colors.error[500]),warning:Y(r,r.colors.warning[50],r.colors.warning[500]),info:Y(r,r.colors.info[50],r.colors.info[500])}[o]:{success:s.css`
339
+ background: ${r.colors.success[50]};
340
+ border-left: 4px solid ${r.colors.success[500]};
341
341
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
342
- `,error:r.css`
343
- background: ${s.colors.error[50]};
344
- border-left: 4px solid ${s.colors.error[500]};
342
+ `,error:s.css`
343
+ background: ${r.colors.error[50]};
344
+ border-left: 4px solid ${r.colors.error[500]};
345
345
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
346
- `,warning:r.css`
347
- background: ${s.colors.warning[50]};
348
- border-left: 4px solid ${s.colors.warning[500]};
346
+ `,warning:s.css`
347
+ background: ${r.colors.warning[50]};
348
+ border-left: 4px solid ${r.colors.warning[500]};
349
349
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
350
- `,info:r.css`
351
- background: ${s.colors.info[50]};
352
- border-left: 4px solid ${s.colors.info[500]};
350
+ `,info:s.css`
351
+ background: ${r.colors.info[50]};
352
+ border-left: 4px solid ${r.colors.info[500]};
353
353
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
354
354
  `}[o]}
355
- `,Xo=r.p`
355
+ `,wr=s.p`
356
356
  flex: 1;
357
357
  margin: 0;
358
358
  font-size: ${({theme:o})=>o.fontSizes.sm};
359
359
  font-weight: ${({theme:o})=>o.brutalism?600:400};
360
360
  line-height: 1.5;
361
361
  color: ${({theme:o})=>o.colors.neutral[900]};
362
- `,Go=r.button`
362
+ `,vr=s.button`
363
363
  flex-shrink: 0;
364
364
  display: inline-flex;
365
365
  align-items: center;
@@ -381,38 +381,37 @@
381
381
  outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
382
382
  outline-offset: 2px;
383
383
  }
384
- `;function M({open:o,onClose:s,message:t,variant:e="info",duration:l=4e3,position:d="bottom-right"}){const[c,a]=i.useState(o),[f,u]=i.useState(!1);return i.useEffect(()=>{if(o)a(!0),u(!1);else if(c){u(!0);const x=setTimeout(()=>{a(!1),u(!1)},200);return()=>clearTimeout(x)}},[o,c]),i.useEffect(()=>{if(!o||l===0)return;const x=setTimeout(s,l);return()=>clearTimeout(x)},[o,l,s]),c?U.createPortal(n.jsxs(Zo,{$position:d,$variant:e,$closing:f,role:"alert","aria-live":"polite",children:[n.jsx(Xo,{children:t}),n.jsx(Go,{onClick:s,"aria-label":"Close notification",children:n.jsx(ro,{size:14,strokeWidth:2.5})})]}),document.body):null}M.displayName="Toast";const Jo=r.form`
384
+ `;function so({open:o,onClose:r,message:n,variant:e="info",duration:c=4e3,position:i="bottom-right"}){const[l,u]=a.useState(o),[x,p]=a.useState(!1);return a.useEffect(()=>{if(o)u(!0),p(!1);else if(l){p(!0);const g=setTimeout(()=>{u(!1),p(!1)},200);return()=>{clearTimeout(g)}}},[o,l]),a.useEffect(()=>{if(!o||c===0)return;const g=setTimeout(r,c);return()=>{clearTimeout(g)}},[o,c,r]),l?fo.createPortal(t.jsxs(hr,{$position:i,$variant:e,$closing:x,role:"alert","aria-live":"polite",children:[t.jsx(wr,{children:n}),t.jsx(vr,{onClick:r,"aria-label":"Close notification",children:t.jsx(wo,{size:14,strokeWidth:2.5})})]}),document.body):null}so.displayName="Toast";const kr=s.form`
385
385
  display: flex;
386
386
  flex-direction: column;
387
387
  gap: ${({theme:o})=>o.spacing[4]};
388
- `,Qo=r.div`
388
+ `,mr=s.div`
389
389
  display: flex;
390
390
  flex-direction: column;
391
391
  gap: ${({theme:o})=>o.spacing[1]};
392
- `,os=r.label`
392
+ `,jr=s.label`
393
393
  font-size: ${({theme:o})=>o.fontSizes.sm};
394
394
  font-weight: 500;
395
395
  color: ${({theme:o})=>o.colors.neutral[900]};
396
- `,ss=r.span`
396
+ `,Sr=s.span`
397
397
  color: ${({theme:o})=>o.colors.error[500]};
398
398
  margin-left: 2px;
399
- aria-hidden: true;
400
- `,rs=r.span`
399
+ `,Cr=s.span`
401
400
  font-size: ${({theme:o})=>o.fontSizes.xs};
402
- color: ${({$error:o,theme:s})=>o?s.colors.error[500]:s.colors.neutral[500]};
403
- `;function no({onSubmit:o,children:s,...t}){return n.jsx(Jo,{onSubmit:e=>{e.preventDefault(),o?.(e)},noValidate:!0,...t,children:s})}no.displayName="Form";function to({label:o,error:s,helperText:t,required:e,children:l}){const d=i.useId(),c=`${d}-hint`,a=!!(s||t),f=typeof s=="string"?s:void 0,u=i.isValidElement(l)?i.cloneElement(l,{id:d,...a&&{"aria-describedby":c},...s&&{"aria-invalid":!0}}):l;return n.jsxs(Qo,{children:[o&&n.jsxs(os,{htmlFor:d,children:[o,e&&n.jsx(ss,{"aria-hidden":"true",children:" *"})]}),u,a&&n.jsx(rs,{id:c,$error:!!s,children:f??t})]})}to.displayName="FormField";const ns=r.div`
401
+ color: ${({$error:o,theme:r})=>o?r.colors.error[500]:r.colors.neutral[500]};
402
+ `;function vo({onSubmit:o,children:r,...n}){return t.jsx(kr,{onSubmit:e=>{e.preventDefault(),o?.(e)},noValidate:!0,...n,children:r})}vo.displayName="Form";function ko({label:o,error:r,helperText:n,required:e,children:c}){const i=a.useId(),l=`${i}-hint`,u=!!(r||n),x=typeof r=="string"?r:void 0,p=a.isValidElement(c)?a.cloneElement(c,{id:i,...u&&{"aria-describedby":l},...r&&{"aria-invalid":!0}}):c;return t.jsxs(mr,{children:[o&&t.jsxs(jr,{htmlFor:i,children:[o,e&&t.jsx(Sr,{"aria-hidden":"true",children:" *"})]}),p,u&&t.jsx(Cr,{id:l,$error:!!r,children:x??n})]})}ko.displayName="FormField";const zr=s.div`
404
403
  display: inline-flex;
405
404
  flex-direction: column;
406
405
  gap: ${({theme:o})=>o.spacing[1]};
407
406
  width: ${({$fullWidth:o})=>o?"100%":"auto"};
408
- `,ts=r.div`
407
+ `,Tr=s.div`
409
408
  position: relative;
410
409
  display: flex;
411
410
  width: 100%;
412
- `,es=r.span`
411
+ `,Ir=s.span`
413
412
  font-size: ${({theme:o})=>o.fontSizes.xs};
414
- color: ${({$error:o,theme:s})=>o?s.colors.error[500]:s.colors.neutral[500]};
415
- `,is=r.select`
413
+ color: ${({$error:o,theme:r})=>o?r.colors.error[500]:r.colors.neutral[500]};
414
+ `,Er=s.select`
416
415
  appearance: none;
417
416
  width: 100%;
418
417
  border-radius: ${({theme:o})=>o.radius.md};
@@ -423,37 +422,37 @@
423
422
  border-color 0.2s,
424
423
  box-shadow 0.2s;
425
424
 
426
- ${({$size:o,theme:s})=>({sm:r.css`
427
- padding: ${s.spacing[1]} ${s.spacing[2]};
428
- font-size: ${s.fontSizes.sm};
429
- `,md:r.css`
430
- padding: ${s.spacing[2]} ${s.spacing[3]};
431
- font-size: ${s.fontSizes.md};
432
- `,lg:r.css`
433
- padding: ${s.spacing[3]} ${s.spacing[4]};
434
- font-size: ${s.fontSizes.lg};
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};
435
434
  `})[o]}
436
435
 
437
436
  padding-right: 2.5rem;
438
437
 
439
- ${({$variant:o,theme:s})=>s.brutalism?r.css`
440
- border: ${s.brutalism.borderWidth} solid
441
- ${s.colors.neutral[900]};
442
- background-color: ${s.colors.neutral[0]};
443
- box-shadow: 3px 3px 0 ${s.colors.neutral[900]};
444
- `:{default:r.css`
445
- border: 1px solid ${s.colors.neutral[400]};
446
- background-color: ${s.colors.neutral[0]};
447
- `,outlined:r.css`
448
- border: 2px solid ${s.colors.primary[500]};
449
- background-color: ${s.colors.neutral[0]};
450
- `,filled:r.css`
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`
451
450
  border: 1px solid transparent;
452
- background-color: ${s.colors.neutral[100]};
451
+ background-color: ${r.colors.neutral[100]};
453
452
  `}[o]}
454
453
 
455
- ${({$error:o,theme:s})=>o&&r.css`
456
- border-color: ${s.colors.error[500]};
454
+ ${({$error:o,theme:r})=>o&&s.css`
455
+ border-color: ${r.colors.error[500]};
457
456
  `}
458
457
 
459
458
  &:focus {
@@ -465,7 +464,7 @@
465
464
  cursor: not-allowed;
466
465
  opacity: 0.6;
467
466
  }
468
- `,as=r.button`
467
+ `,Wr=s.button`
469
468
  position: absolute;
470
469
  right: ${({theme:o})=>o.spacing[3]};
471
470
  top: 50%;
@@ -487,7 +486,7 @@
487
486
  outline-offset: 2px;
488
487
  border-radius: 2px;
489
488
  }
490
- `,ls=r.span`
489
+ `,Br=s.span`
491
490
  position: absolute;
492
491
  right: ${({theme:o})=>o.spacing[3]};
493
492
  top: 50%;
@@ -496,7 +495,7 @@
496
495
  display: flex;
497
496
  align-items: center;
498
497
  color: ${({theme:o})=>o.colors.neutral[500]};
499
- `;function eo({options:o,placeholder:s,size:t="md",variant:e="default",error:l,fullWidth:d,clearable:c,onClear:a,id:f,value:u,defaultValue:x,onChange:h,...w}){const p=i.useId(),b=f??p,C=`${b}-hint`,j=typeof l=="string"?l:void 0,[m,T]=i.useState(x??""),I=u!==void 0,E=I?u:m,$=k=>{I||T(k.target.value),h?.(k)},y=()=>{I||T(""),a?.()},v=c&&!!E;return n.jsxs(ns,{$fullWidth:d,children:[n.jsxs(ts,{children:[n.jsxs(is,{id:b,$size:t,$variant:e,$error:!!l,"aria-invalid":!!l,"aria-describedby":j?C:void 0,value:E,onChange:$,...w,children:[s&&n.jsx("option",{value:"",disabled:!0,children:s}),o.map(k=>n.jsx("option",{value:k.value,disabled:k.disabled,children:k.label},k.value))]}),v?n.jsx(as,{type:"button",onClick:y,"aria-label":"Clear selection",children:n.jsx(ro,{size:14})}):n.jsx(ls,{"aria-hidden":"true",children:n.jsx(so,{size:14})})]}),j&&n.jsx(es,{id:C,$error:!0,children:j})]})}eo.displayName="Select";const cs=r.a`
498
+ `;function mo({options:o,placeholder:r,size:n="md",variant:e="default",error:c,fullWidth:i,clearable:l,onClear:u,id:x,value:p,defaultValue:g,onChange:w,...y}){const b=a.useId(),k=x??b,C=`${k}-hint`,S=typeof c=="string"?c:void 0,[v,z]=a.useState(g??""),W=p!==void 0,B=W?p:v,h=E=>{W||z(E.target.value),w?.(E)},$=()=>{W||z(""),u?.()},m=l&&!!B;return t.jsxs(zr,{$fullWidth:i,children:[t.jsxs(Tr,{children:[t.jsxs(Er,{id:k,$size:n,$variant:e,$error:!!c,"aria-invalid":!!c,"aria-describedby":S?C:void 0,value:B,onChange:h,...y,children:[r&&t.jsx("option",{value:"",disabled:!0,children:r}),o.map(E=>t.jsx("option",{value:E.value,disabled:E.disabled,children:E.label},E.value))]}),m?t.jsx(Wr,{type:"button",onClick:$,"aria-label":"Clear selection",children:t.jsx(wo,{size:14})}):t.jsx(Br,{"aria-hidden":"true",children:t.jsx(ho,{size:14})})]}),S&&t.jsx(Ir,{id:C,$error:!0,children:S})]})}mo.displayName="Select";const Pr=s.a`
500
499
  text-decoration: underline;
501
500
  text-underline-offset: 2px;
502
501
  transition: color 0.15s;
@@ -507,33 +506,33 @@
507
506
  border-radius: 2px;
508
507
  }
509
508
 
510
- ${({$variant:o,theme:s})=>({default:r.css`
511
- color: ${s.colors.primary[500]};
509
+ ${({$variant:o,theme:r})=>({default:s.css`
510
+ color: ${r.colors.primary[500]};
512
511
  &:hover {
513
- color: ${s.colors.primary[700]};
512
+ color: ${r.colors.primary[700]};
514
513
  }
515
- `,subtle:r.css`
516
- color: ${s.colors.neutral[500]};
514
+ `,subtle:s.css`
515
+ color: ${r.colors.neutral[500]};
517
516
  &:hover {
518
- color: ${s.colors.neutral[900]};
517
+ color: ${r.colors.neutral[900]};
519
518
  }
520
519
  `})[o]}
521
- `;function io({variant:o="default",external:s,children:t,...e}){return n.jsx(cs,{$variant:o,...s&&{target:"_blank",rel:"noreferrer"},...e,children:t})}io.displayName="Link";const ds=r.div`
520
+ `;function jo({variant:o="default",external:r,children:n,...e}){return t.jsx(Pr,{$variant:o,...r&&{target:"_blank",rel:"noreferrer"},...e,children:n})}jo.displayName="Link";const Or=s.div`
522
521
  border-radius: ${({theme:o})=>o.radius.md};
523
522
  background: ${({theme:o})=>o.colors.neutral[0]};
524
523
  overflow: hidden;
525
524
 
526
- ${({theme:o,$accentColor:s})=>o.brutalism?r.css`
525
+ ${({theme:o,$accentColor:r})=>o.brutalism?s.css`
527
526
  border: ${o.brutalism.borderWidth} solid
528
- ${s??o.colors.neutral[900]};
527
+ ${r??o.colors.neutral[900]};
529
528
  box-shadow: ${o.brutalism.shadowOffset}
530
529
  ${o.brutalism.shadowOffset} 0
531
- ${s??o.colors.neutral[900]};
532
- `:r.css`
533
- border: 1px solid ${s??o.colors.neutral[200]};
530
+ ${r??o.colors.neutral[900]};
531
+ `:s.css`
532
+ border: 1px solid ${r??o.colors.neutral[200]};
534
533
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
535
534
  `}
536
- `,us=r.button`
535
+ `,Dr=s.button`
537
536
  width: 100%;
538
537
  display: flex;
539
538
  align-items: flex-start;
@@ -550,22 +549,22 @@
550
549
 
551
550
  &:focus-visible {
552
551
  outline: 2px solid
553
- ${({theme:o,$accentColor:s})=>s??o.colors.primary[500]};
552
+ ${({theme:o,$accentColor:r})=>r??o.colors.primary[500]};
554
553
  outline-offset: -2px;
555
554
  }
556
- `,fs=r.div`
555
+ `,Rr=s.div`
557
556
  flex: 1;
558
557
  min-width: 0;
559
- `,ps=r.span`
558
+ `,Nr=s.span`
560
559
  display: block;
561
560
  font-size: ${({theme:o})=>o.fontSizes.md};
562
561
  font-weight: 600;
563
562
  color: ${({theme:o})=>o.colors.neutral[900]};
564
- `,bs=r.span`
563
+ `,Lr=s.span`
565
564
  display: block;
566
565
  font-size: ${({theme:o})=>o.fontSizes.sm};
567
566
  color: ${({theme:o})=>o.colors.neutral[500]};
568
- `,$s=r.div`
567
+ `,Ar=s.div`
569
568
  display: flex;
570
569
  flex-direction: row;
571
570
  align-items: center;
@@ -577,122 +576,247 @@
577
576
  align-items: flex-start;
578
577
  gap: ${({theme:o})=>o.spacing[2]};
579
578
  }
580
- `,gs=r.div`
579
+ `,Mr=s.div`
581
580
  display: flex;
582
581
  align-items: center;
583
582
  gap: ${({theme:o})=>o.spacing[2]};
584
- `,xs=r.span`
583
+ `,_r=s.span`
585
584
  display: inline-flex;
586
585
  align-items: center;
587
586
  justify-content: center;
588
587
  flex-shrink: 0;
589
588
  transition: transform 0.2s ease;
590
589
  transform: ${({$open:o})=>o?"rotate(180deg)":"rotate(0deg)"};
591
- color: ${({theme:o,$accentColor:s})=>s??o.colors.neutral[500]};
592
- `,ys=r.div`
590
+ color: ${({theme:o,$accentColor:r})=>r??o.colors.neutral[500]};
591
+ `,Fr=s.div`
593
592
  display: grid;
594
593
  grid-template-rows: ${({$open:o})=>o?"1fr":"0fr"};
595
594
  transition: grid-template-rows 0.2s ease;
596
- `,ws=r.div`
595
+ `,Vr=s.div`
597
596
  overflow: hidden;
598
- `,vs=r.div`
597
+ `,Kr=s.div`
599
598
  padding: ${({theme:o})=>o.spacing[4]};
600
599
  border-top: 1px solid ${({theme:o})=>o.colors.neutral[200]};
601
- `;function ao({title:o,children:s,defaultOpen:t=!1,open:e,onToggle:l,subtitle:d,headerActions:c,accentColor:a}){const[f,u]=i.useState(t),x=i.useId(),h=e!==void 0,w=h?e:f,p=()=>{const b=!w;h||u(b),l?.(b)};return n.jsxs(ds,{$accentColor:a,children:[n.jsxs(us,{type:"button",$open:w,$accentColor:a,"aria-expanded":w,"aria-controls":x,onClick:p,children:[n.jsxs(fs,{children:[n.jsx(ps,{children:o}),(d||c)&&n.jsxs($s,{children:[d&&n.jsx(bs,{children:d}),c&&n.jsx(gs,{onClick:b=>b.stopPropagation(),children:c})]})]}),n.jsx(xs,{$open:w,$accentColor:a,"aria-hidden":"true",children:n.jsx(so,{size:18,strokeWidth:2.5})})]}),n.jsx(ys,{$open:w,children:n.jsx(ws,{id:x,role:"region","aria-label":o,children:n.jsx(vs,{children:s})})})]})}ao.displayName="CollapsibleCard";const lo=i.createContext(null);function ms({children:o}){const[s,t]=i.useState(null),e=i.useCallback(d=>{t({...d,id:Date.now()})},[]),l=i.useMemo(()=>{const d=c=>e(c);return d.success=(c,a)=>e({...a,message:c,variant:"success"}),d.error=(c,a)=>e({...a,message:c,variant:"error"}),d.warning=(c,a)=>e({...a,message:c,variant:"warning"}),d.info=(c,a)=>e({...a,message:c,variant:"info"}),d},[e]);return n.jsxs(lo.Provider,{value:{toast:l},children:[o,s&&n.jsx(M,{open:!0,onClose:()=>t(null),message:s.message,variant:s.variant,duration:s.duration,position:s.position},s.id)]})}function ks(){const o=i.useContext(lo);if(!o)throw new Error("useToast must be used within a ToastProvider");return o}function hs({initialValues:o,validate:s,onSubmit:t,onError:e}){const[l,d]=i.useState(o),[c,a]=i.useState({}),[f,u]=i.useState({}),[x,h]=i.useState(!1),w=i.useRef(l);w.current=l;const p=i.useCallback($=>{if(!s)return{};const y=s($);return Object.fromEntries(Object.entries(y).filter(([,v])=>v!==void 0))},[s]),b=i.useRef(f);b.current=f;const C=i.useCallback($=>{const{name:y,value:v}=$.target,k={...w.current,[y]:v};d(k),b.current[y]&&a(p(k))},[p]),j=i.useCallback($=>{const{name:y}=$.target;u(v=>({...v,[y]:!0})),a(p(w.current))},[p]),m=i.useCallback($=>{$?.preventDefault();const y=Object.keys(w.current).reduce((W,R)=>({...W,[R]:!0}),{});u(y);const v=p(w.current);if(a(v),Object.keys(v).length>0){e?.(v);return}(async()=>{h(!0);try{await t?.(w.current)}finally{h(!1)}})()},[p,t,e]),T=i.useCallback(($,y)=>{d(v=>({...v,[$]:y}))},[]),I=i.useCallback(()=>{d(o),a({}),u({}),h(!1)},[o]),E=Object.fromEntries(Object.entries(c).filter(([$])=>f[$]));return{values:l,errors:E,touched:f,handleChange:C,handleBlur:j,handleSubmit:m,setFieldValue:T,reset:I,isSubmitting:x}}const co=r.div`
602
- overflow-x: auto;
600
+ `;function So({title:o,children:r,defaultOpen:n=!1,open:e,onToggle:c,subtitle:i,headerActions:l,accentColor:u}){const[x,p]=a.useState(n),g=a.useId(),w=e!==void 0,y=w?e:x,b=()=>{const k=!y;w||p(k),c?.(k)};return t.jsxs(Or,{$accentColor:u,children:[t.jsxs(Dr,{type:"button",$open:y,$accentColor:u,"aria-expanded":y,"aria-controls":g,onClick:b,children:[t.jsxs(Rr,{children:[t.jsx(Nr,{children:o}),(i||l)&&t.jsxs(Ar,{children:[i&&t.jsx(Lr,{children:i}),l&&t.jsx(Mr,{onClick:k=>k.stopPropagation(),children:l})]})]}),t.jsx(_r,{$open:y,$accentColor:u,"aria-hidden":"true",children:t.jsx(ho,{size:18,strokeWidth:2.5})})]}),t.jsx(Fr,{$open:y,children:t.jsx(Vr,{id:g,role:"region","aria-label":o,children:t.jsx(Kr,{children:r})})})]})}So.displayName="CollapsibleCard";const Co=a.createContext(null);function Hr({children:o}){const[r,n]=a.useState(null),e=a.useCallback(i=>{n({...i,id:Date.now()})},[]),c=a.useMemo(()=>Object.assign(i=>e(i),{success:(i,l)=>e({...l,message:i,variant:"success"}),error:(i,l)=>e({...l,message:i,variant:"error"}),warning:(i,l)=>e({...l,message:i,variant:"warning"}),info:(i,l)=>e({...l,message:i,variant:"info"})}),[e]);return t.jsxs(Co.Provider,{value:{toast:c},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(Co);if(!o)throw new Error("useToast must be used within a ToastProvider");return o}function Yr({initialValues:o,validate:r,onSubmit:n,onError:e}){const[c,i]=a.useState(o),[l,u]=a.useState({}),[x,p]=a.useState({}),[g,w]=a.useState(!1),y=a.useRef(c);y.current=c;const b=a.useCallback(h=>{if(!r)return{};const $=r(h);return Object.fromEntries(Object.entries($).filter(([,m])=>m!==void 0))},[r]),k=a.useRef(x);k.current=x;const C=a.useCallback(h=>{const{name:$,value:m}=h.target,E={...y.current,[$]:m};i(E),k.current[$]&&u(b(E))},[b]),S=a.useCallback(h=>{const{name:$}=h.target;p(m=>({...m,[$]:!0})),u(b(y.current))},[b]),v=a.useCallback(h=>{h?.preventDefault();const $=Object.keys(y.current).reduce((R,N)=>({...R,[N]:!0}),{});p($);const m=b(y.current);if(u(m),Object.keys(m).length>0){e?.(m);return}(async()=>{w(!0);try{await n?.(y.current)}finally{w(!1)}})()},[b,n,e]),z=a.useCallback((h,$)=>{i(m=>({...m,[h]:$}))},[]),W=a.useCallback(()=>{i(o),u({}),p({}),w(!1)},[o]),B=Object.fromEntries(Object.entries(l).filter(([h])=>x[h]));return{values:c,errors:B,touched:x,handleChange:C,handleBlur:S,handleSubmit:v,setFieldValue:z,reset:W,isSubmitting:g}}function Ur(o,r){return o?.key!==r?{key:r,direction:"asc"}:o.direction==="asc"?{key:r,direction:"desc"}:null}function Gr({data:o,sort:r,defaultSort:n,onSortChange:e}){const c=r!==void 0,[i,l]=a.useState(n??null),u=c?r??null:i,x=g=>{const w=Ur(u,g);return c||l(w),e?.(w),w},p=a.useMemo(()=>c||!u?o:[...o].sort((g,w)=>{const y=g[u.key],b=w[u.key],k=y<b?-1:y>b?1:0;return u.direction==="asc"?k:-k}),[o,u,c]);return{activeSort:u,sortedData:p,handleSort:x}}const Xr=7,co=3,uo=1;function Zr(o,r){if(r<=Xr)return Array.from({length:r},(e,c)=>c+1);const n=[1];o>co&&n.push("...");for(let e=Math.max(2,o-uo);e<=Math.min(r-1,o+uo);e++)n.push(e);return o<r-co+1&&n.push("..."),n.push(r),n}function Jr({data:o,pageSize:r,page:n,defaultPage:e,totalRows:c,onPageChange:i}){const l=n!==void 0,[u,x]=a.useState(e??1),p=l?n:u,g=C=>{l||x(C),i?.(C)},w=l||c!==void 0,y=c??o.length,b=r?Math.max(1,Math.ceil(y/r)):1,k=a.useMemo(()=>{if(!r||w)return o;const C=(p-1)*r;return o.slice(C,C+r)},[o,r,p,w]);return{activePage:p,totalPages:b,displayData:k,handlePageChange:g}}const zo=(o,r)=>o==="sm"?`${r.spacing[1]} ${r.spacing[2]}`:o==="lg"?`${r.spacing[3]} ${r.spacing[4]}`:`${r.spacing[2]} ${r.spacing[3]}`,To=s.div`
603
601
  width: 100%;
604
602
 
605
- ${({theme:o})=>o.brutalism?r.css`
606
- border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
607
- box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
608
- 0 ${o.colors.neutral[900]};
609
- `:r.css`
610
- border: 1px solid ${o.colors.neutral[300]};
603
+ ${({theme:o,$borderColor:r})=>o.brutalism?s.css`
604
+ border: ${o.brutalism.borderWidth} solid
605
+ ${r??o.colors.neutral[900]};
606
+ box-shadow: ${o.brutalism.shadowOffset}
607
+ ${o.brutalism.shadowOffset} 0
608
+ ${r??o.colors.neutral[900]};
609
+ `:s.css`
610
+ border: 1px solid ${r??o.colors.neutral[300]};
611
611
  border-radius: ${o.radius.md};
612
612
  overflow: hidden;
613
613
  `}
614
- `,uo=r.table`
614
+
615
+ overflow-x: auto;
616
+ ${({$stickyHeader:o})=>o&&s.css`
617
+ overflow-y: auto;
618
+ `}
619
+ `,Io=s.table`
615
620
  width: 100%;
616
621
  border-collapse: collapse;
617
- font-size: ${({$size:o,theme:s})=>({sm:s.fontSizes.sm,md:s.fontSizes.md,lg:s.fontSizes.lg})[o]};
618
- `,fo=r.thead`
619
- ${({theme:o})=>o.brutalism?r.css`
620
- background-color: ${o.colors.neutral[900]};
621
- color: ${o.colors.neutral[0]};
622
- `:r.css`
623
- background-color: ${o.colors.neutral[100]};
624
- color: ${o.colors.neutral[600]};
625
- `}
626
- `,po=r.tbody`
627
- ${({$variant:o,theme:s})=>o==="striped"&&r.css`
622
+ font-size: ${({$size:o,theme:r})=>({sm:r.fontSizes.sm,md:r.fontSizes.md,lg:r.fontSizes.lg})[o]};
623
+
624
+ caption {
625
+ padding: 8px 0;
626
+ }
627
+ `,Eo=s.thead`
628
+ ${({$stickyHeader:o})=>o&&s.css`
629
+ position: sticky;
630
+ top: 0;
631
+ z-index: 1;
632
+ `}
633
+
634
+ ${({theme:o,$headerColor:r,$borderColor:n})=>r?s.css`
635
+ --th-bg: ${r};
636
+ --th-text: ${o.colors.neutral[0]};
637
+ --th-sep: rgba(255, 255, 255, 0.25);
638
+ `:o.brutalism?s.css`
639
+ --th-bg: ${o.colors.neutral[900]};
640
+ --th-text: ${o.colors.neutral[0]};
641
+ --th-sep: ${n??o.colors.neutral[600]};
642
+ `:s.css`
643
+ --th-bg: ${o.colors.neutral[100]};
644
+ --th-text: ${o.colors.neutral[600]};
645
+ --th-sep: ${n??o.colors.neutral[300]};
646
+ `}
647
+ `,Wo=s.tbody`
648
+ ${({$rowColor:o})=>o&&s.css`
649
+ tr {
650
+ background-color: ${o};
651
+ }
652
+ `}
653
+
654
+ ${({$striped:o,theme:r,$stripeColor:n})=>o&&s.css`
628
655
  tr:nth-child(even) {
629
- background-color: ${s.colors.neutral[100]};
656
+ background-color: ${n??r.colors.neutral[100]};
630
657
  }
631
658
  `}
632
659
 
633
660
  tr:last-child td {
634
661
  border-bottom: none;
635
662
  }
636
- `,A=r.tr``,P=r.th`
663
+ `,V=s.tr``,no=s.th`
664
+ background-color: var(--th-bg);
665
+ color: var(--th-text);
637
666
  text-align: left;
638
667
  font-weight: 700;
639
668
  white-space: nowrap;
640
669
 
641
- ${({$size:o,theme:s})=>({sm:r.css`
642
- padding: ${s.spacing[1]} ${s.spacing[2]};
643
- `,md:r.css`
644
- padding: ${s.spacing[2]} ${s.spacing[3]};
645
- `,lg:r.css`
646
- padding: ${s.spacing[3]} ${s.spacing[4]};
647
- `})[o]}
670
+ padding: ${({$size:o,theme:r})=>zo(o,r)};
648
671
 
649
- ${({theme:o})=>o.brutalism?r.css`
650
- border-right: 1px solid ${o.colors.neutral[600]};
651
- &:last-child {
652
- border-right: none;
653
- }
654
- `:r.css`
655
- border-bottom: 2px solid ${o.colors.neutral[300]};
656
- border-right: 1px solid ${o.colors.neutral[200]};
672
+ ${({theme:o,$bordered:r})=>o.brutalism?s.css`
673
+ border-right: 1px solid var(--th-sep);
657
674
  &:last-child {
658
675
  border-right: none;
659
676
  }
677
+ `:s.css`
678
+ border-bottom: 2px solid var(--th-sep);
679
+ ${r&&s.css`
680
+ border-right: 1px solid var(--th-sep);
681
+ &:last-child {
682
+ border-right: none;
683
+ }
684
+ `}
660
685
  `}
661
- `,Y=r.td`
662
- ${({$size:o,theme:s})=>({sm:r.css`
663
- padding: ${s.spacing[1]} ${s.spacing[2]};
664
- `,md:r.css`
665
- padding: ${s.spacing[2]} ${s.spacing[3]};
666
- `,lg:r.css`
667
- padding: ${s.spacing[3]} ${s.spacing[4]};
668
- `})[o]}
686
+ `,Qr=s.button`
687
+ display: inline-flex;
688
+ align-items: center;
689
+ gap: ${({theme:o})=>o.spacing[1]};
690
+ background: none;
691
+ border: none;
692
+ cursor: pointer;
693
+ font: inherit;
694
+ color: inherit;
695
+ font-weight: 700;
696
+ padding: 0;
697
+ width: 100%;
698
+ text-align: left;
669
699
 
670
- ${({$variant:o,theme:s})=>s.brutalism?r.css`
671
- border-bottom: ${s.brutalism.borderWidth} solid
672
- ${s.colors.neutral[900]};
673
- ${o==="bordered"&&r.css`
674
- border-right: ${s.brutalism.borderWidth} solid
675
- ${s.colors.neutral[900]};
700
+ &:focus-visible {
701
+ outline: 2px solid currentColor;
702
+ outline-offset: 2px;
703
+ border-radius: 2px;
704
+ }
705
+ `,os=s.span`
706
+ opacity: 0.5;
707
+ display: inline-flex;
708
+ align-items: center;
709
+ `,G=s.td`
710
+ padding: ${({$size:o,theme:r})=>zo(o,r)};
711
+
712
+ ${({$bordered:o,$borderColor:r,theme:n})=>n.brutalism?s.css`
713
+ border-bottom: ${n.brutalism.borderWidth} solid
714
+ ${r??n.colors.neutral[900]};
715
+ ${o&&s.css`
716
+ border-right: ${n.brutalism.borderWidth} solid
717
+ ${r??n.colors.neutral[900]};
676
718
  &:last-child {
677
719
  border-right: none;
678
720
  }
679
721
  `}
680
- `:o==="bordered"?r.css`
681
- border: 1px solid ${s.colors.neutral[300]};
682
- `:r.css`
683
- border-bottom: 1px solid ${s.colors.neutral[200]};
722
+ `:o?s.css`
723
+ border: 1px solid ${r??n.colors.neutral[300]};
724
+ `:s.css`
725
+ border-bottom: 1px solid
726
+ ${r??n.colors.neutral[200]};
684
727
  `}
685
- `;function bo({columns:o,data:s,size:t="md",variant:e="default",caption:l,className:d,style:c}){return n.jsx(co,{className:d,style:c,children:n.jsxs(uo,{$size:t,children:[l&&n.jsx("caption",{children:l}),n.jsx(fo,{children:n.jsx(A,{children:o.map(a=>n.jsx(P,{$size:t,style:a.width?{width:a.width}:void 0,children:a.header},a.key))})}),n.jsx(po,{$variant:e,children:s.map((a,f)=>n.jsx(A,{children:o.map(u=>n.jsx(Y,{$size:t,$variant:e,children:u.render?u.render(a[u.key],a,f):String(a[u.key]??"")},u.key))},f))})]})})}bo.displayName="Table";const js=r(Y)`
686
- ${({$editable:o,theme:s})=>o&&r.css`
728
+ `,rs=s.td`
729
+ text-align: center;
730
+ color: ${({theme:o})=>o.colors.neutral[400]};
731
+ padding: ${({theme:o})=>`${o.spacing[4]} ${o.spacing[3]}`};
732
+ font-size: ${({theme:o})=>o.fontSizes.sm};
733
+ border-bottom: none;
734
+ `,ss=s.keyframes`
735
+ 0% { background-position: -400px 0; }
736
+ 100% { background-position: 400px 0; }
737
+ `,ns=s(G)``,ts=s.div`
738
+ height: 14px;
739
+ border-radius: 4px;
740
+ background: linear-gradient(
741
+ 90deg,
742
+ ${({theme:o})=>o.colors.neutral[200]} 25%,
743
+ ${({theme:o})=>o.colors.neutral[100]} 50%,
744
+ ${({theme:o})=>o.colors.neutral[200]} 75%
745
+ );
746
+ background-size: 800px 100%;
747
+ animation: ${ss} 1.6s ease-in-out infinite;
748
+ `,es=s.div`
749
+ display: flex;
750
+ align-items: center;
751
+ justify-content: center;
752
+ gap: ${({theme:o})=>o.spacing[1]};
753
+ padding: ${({theme:o})=>`${o.spacing[2]} ${o.spacing[3]}`};
754
+
755
+ ${({theme:o})=>o.brutalism?s.css`
756
+ border-top: ${o.brutalism.borderWidth} solid
757
+ ${o.colors.neutral[900]};
758
+ `:s.css`
759
+ border-top: 1px solid ${o.colors.neutral[200]};
760
+ `}
761
+ `,oo=s.button`
762
+ display: inline-flex;
763
+ align-items: center;
764
+ justify-content: center;
765
+ min-width: 32px;
766
+ height: 32px;
767
+ padding: 0 ${({theme:o})=>o.spacing[2]};
768
+ font: inherit;
769
+ font-size: ${({theme:o})=>o.fontSizes.sm};
770
+ cursor: pointer;
771
+
772
+ ${({$active:o,theme:r})=>r.brutalism?s.css`
773
+ border: ${r.brutalism.borderWidth} solid
774
+ ${r.colors.neutral[900]};
775
+ background: ${o?r.colors.neutral[900]:"transparent"};
776
+ color: ${o?r.colors.neutral[0]:r.colors.neutral[900]};
777
+ box-shadow: ${o?"none":`2px 2px 0 ${r.colors.neutral[900]}`};
778
+
779
+ &:hover:not(:disabled) {
780
+ background: ${o?r.colors.neutral[600]:r.colors.neutral[100]};
781
+ }
782
+ `:s.css`
783
+ border: 1px solid
784
+ ${o?r.colors.primary[500]:"transparent"};
785
+ border-radius: ${r.radius.md};
786
+ background: ${o?r.colors.primary[500]:"transparent"};
787
+ color: ${o?r.colors.neutral[0]:r.colors.neutral[600]};
788
+
789
+ &:hover:not(:disabled) {
790
+ background: ${o?r.colors.primary[700]:r.colors.neutral[100]};
791
+ border-color: ${o?r.colors.primary[700]:r.colors.neutral[200]};
792
+ }
793
+ `}
794
+
795
+ &:disabled {
796
+ opacity: 0.4;
797
+ cursor: not-allowed;
798
+ }
799
+
800
+ &:focus-visible {
801
+ outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
802
+ outline-offset: 2px;
803
+ }
804
+ `,is=4;function as(o,r){return o?.key!==r?t.jsx(dr,{size:14}):o.direction==="asc"?t.jsx(pr,{size:14}):t.jsx(lr,{size:14})}function Bo({columns:o,data:r,rowKey:n,size:e="md",striped:c,bordered:i,stickyHeader:l,caption:u,emptyMessage:x="No data",loading:p,sort:g,defaultSort:w,onSortChange:y,pageSize:b,page:k,defaultPage:C,totalRows:S,onPageChange:v,onChange:z,borderColor:W,headerColor:B,rowColor:h,stripeColor:$,className:m,style:E}){const{activeSort:R,sortedData:N,handleSort:M}=Gr({data:r,sort:g,defaultSort:w,onSortChange:y}),{activePage:P,totalPages:_,displayData:H,handlePageChange:X}=Jr({data:N,pageSize:b,page:k,defaultPage:C,totalRows:S,onPageChange:v}),Z=d=>{const j=M(d);z?.({sort:j,page:P})},F=d=>{X(d),z?.({sort:R,page:d})},f=(d,j)=>String(n?d[n]:j),T=!p&&H.length===0,I=b??is;return t.jsxs(To,{$borderColor:W,$stickyHeader:l,className:m,style:E,children:[t.jsxs(Io,{$size:e,children:[u&&t.jsx("caption",{children:u}),t.jsx(Eo,{$headerColor:B,$borderColor:W,$stickyHeader:l,children:t.jsx(V,{children:o.map(d=>t.jsx(no,{$size:e,$bordered:i,scope:"col",style:d.width?{width:d.width}:void 0,children:d.sortable?t.jsxs(Qr,{type:"button",onClick:()=>Z(d.key),"aria-label":`Sort by ${d.header}${R?.key===d.key?`, ${R.direction}ending`:""}`,children:[d.header,t.jsx(os,{"aria-hidden":"true",children:as(R,d.key)})]}):d.header},d.key))})}),t.jsx(Wo,{$striped:c,$rowColor:h,$stripeColor:$,children:p?Array.from({length:I}).map((d,j)=>t.jsx(V,{children:o.map(O=>t.jsx(ns,{$size:e,$bordered:i,$borderColor:W,children:t.jsx(ts,{})},O.key))},j)):T?t.jsx("tr",{children:t.jsx(rs,{colSpan:o.length,children:x})}):H.map((d,j)=>t.jsx(V,{children:o.map(O=>t.jsx(G,{$size:e,$bordered:i,$borderColor:W,children:O.render?O.render(d[O.key],d,j):String(d[O.key]??"")||" "},O.key))},f(d,j)))})]}),b&&_>1&&t.jsxs(es,{children:[t.jsx(oo,{type:"button",onClick:()=>F(P-1),disabled:P<=1,"aria-label":"Previous page",children:"←"}),Zr(P,_).map((d,j)=>d==="..."?t.jsx("span",{"aria-hidden":"true",style:{padding:"0 4px"},children:"…"},`e${j}`):t.jsx(oo,{type:"button",$active:d===P,onClick:()=>F(d),"aria-label":`Page ${d}`,"aria-current":d===P?"page":void 0,children:d},d)),t.jsx(oo,{type:"button",onClick:()=>F(P+1),disabled:P>=_,"aria-label":"Next page",children:"→"})]})]})}Bo.displayName="Table";const ls=s(Io)`
805
+ table-layout: fixed;
806
+ `,cs=s(G)`
807
+ ${({$editable:o,theme:r})=>o&&s.css`
687
808
  cursor: pointer;
688
809
  position: relative;
689
810
 
690
811
  &:hover {
691
- background-color: ${s.brutalism?s.colors.neutral[100]:s.colors.primary[50]};
812
+ background-color: ${r.brutalism?r.colors.neutral[100]:r.colors.primary[50]};
692
813
  }
693
814
  `}
694
- `,Cs=r.input`
815
+ `,ds=s.input`
816
+ display: block;
695
817
  width: 100%;
818
+ min-width: 0;
819
+ box-sizing: border-box;
696
820
  border: none;
697
821
  outline: none;
698
822
  background: transparent;
@@ -701,24 +825,24 @@
701
825
  padding: 0;
702
826
  margin: 0;
703
827
 
704
- ${({theme:o})=>o.brutalism?r.css`
828
+ ${({theme:o})=>o.brutalism?s.css`
705
829
  &:focus {
706
830
  outline: 2px solid ${o.colors.neutral[900]};
707
831
  outline-offset: 1px;
708
832
  }
709
- `:r.css`
833
+ `:s.css`
710
834
  &:focus {
711
835
  box-shadow: ${o.shadows.focusRing};
712
836
  }
713
837
  `}
714
- `,Ss=r(P)`
838
+ `,us=s(no)`
715
839
  width: 40px;
716
- `,zs=r(Y)`
840
+ `,ps=s(G)`
717
841
  width: 40px;
718
842
  text-align: center;
719
843
  padding-left: 0;
720
844
  padding-right: 0;
721
- `,Ts=r.button`
845
+ `,fs=s.button`
722
846
  display: inline-flex;
723
847
  align-items: center;
724
848
  justify-content: center;
@@ -736,18 +860,18 @@
736
860
  &:hover {
737
861
  color: ${({theme:o})=>o.colors.error[500]};
738
862
 
739
- ${({theme:o})=>o.brutalism&&r.css`
863
+ ${({theme:o})=>o.brutalism&&s.css`
740
864
  background-color: ${o.colors.error[50]};
741
865
  `}
742
866
  }
743
- `,Is=r.tr`
744
- ${({theme:o})=>o.brutalism?r.css`
867
+ `,bs=s.tr`
868
+ ${({theme:o})=>o.brutalism?s.css`
745
869
  border-top: ${o.brutalism.borderWidth} solid
746
870
  ${o.colors.neutral[900]};
747
- `:r.css`
871
+ `:s.css`
748
872
  border-top: 1px solid ${o.colors.neutral[200]};
749
873
  `}
750
- `,Es=r.button`
874
+ `,gs=s.button`
751
875
  display: inline-flex;
752
876
  align-items: center;
753
877
  gap: ${({theme:o})=>o.spacing[1]};
@@ -769,4 +893,4 @@
769
893
  outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
770
894
  outline-offset: 2px;
771
895
  }
772
- `;function $o({columns:o,defaultData:s,data:t,onChange:e,size:l="md",addRowLabel:d="Add row",newRowFactory:c,deletable:a=!1,className:f,style:u}){const x=t!==void 0,[h,w]=i.useState(s??[]),p=x?t:h,[b,C]=i.useState(null),[j,m]=i.useState(""),T=i.useRef(null);i.useEffect(()=>{b&&(T.current?.focus(),T.current?.select())},[b]);const I=i.useCallback(g=>{x||w(g),e?.(g)},[x,e]),E=(g,S,z)=>{C({rowIndex:g,colKey:S}),m(String(z??""))},$=i.useCallback(()=>{if(!b)return;const{rowIndex:g,colKey:S}=b,z=p.map((B,F)=>F===g?{...B,[S]:j}:B);I(z),C(null)},[b,p,j,I]),y=()=>{C(null),m("")},v=g=>{g.key==="Enter"&&$(),g.key==="Escape"&&y()},k=()=>{const g=c?c():Object.fromEntries(o.map(S=>[S.key,""]));I([...p,g])},W=g=>{b?.rowIndex===g&&C(null),I(p.filter((S,z)=>z!==g))},R=a?o.length+1:o.length;return n.jsx(co,{className:f,style:u,children:n.jsxs(uo,{$size:l,children:[n.jsx(fo,{children:n.jsxs(A,{children:[o.map(g=>n.jsx(P,{$size:l,style:g.width?{width:g.width}:void 0,children:g.header},g.key)),a&&n.jsx(Ss,{$size:l,"aria-label":"Actions"})]})}),n.jsxs(po,{$variant:"default",children:[p.map((g,S)=>n.jsxs(A,{children:[o.map(z=>{const B=b?.rowIndex===S&&b.colKey===z.key,F=g[z.key];return n.jsx(js,{$size:l,$variant:"default",$editable:z.editable&&!B,onClick:z.editable&&!B?()=>E(S,z.key,F):void 0,children:B?n.jsx(Cs,{ref:T,$size:l,value:j,onChange:go=>m(go.target.value),onBlur:$,onKeyDown:v,"aria-label":`Edit ${z.header}`}):z.render?z.render(F,g,S):String(F??"")},z.key)}),a&&n.jsx(zs,{$size:l,$variant:"default",children:n.jsx(Ts,{type:"button",onClick:()=>W(S),"aria-label":"Delete row",children:"✕"})})]},S)),n.jsx(Is,{children:n.jsx("td",{colSpan:R,children:n.jsxs(Es,{type:"button",onClick:k,children:["+ ",d]})})})]})]})})}$o.displayName="EditableTable";const K={primary:{50:"#f0f8ff",500:"#0070f3",700:"#005bb5"},neutral:{0:"#ffffff",100:"#f5f5f5",200:"#eaeaea",300:"#cacaca",400:"#cccccc",500:"#666666",600:"#333333",900:"#111111"},error:{50:"#fef2f2",500:"#d32f2f"},success:{50:"#f0fdf4",500:"#16a34a"},warning:{50:"#fffbeb",500:"#d97706"},info:{50:"#eff6ff",500:"#2563eb"}},Ws={1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px"},Bs={md:"6px"},Os={modal:1e3,toast:1100},Rs={xs:"12px",sm:"14px",md:"16px",lg:"18px"},Fs={colors:{...K,primary:{...K.primary,contrast:"#ffffff"}},spacing:Ws,fontSizes:Rs,radius:Bs,zIndex:Os,shadows:{focusRing:"0 0 0 2px rgba(0, 112, 243, 0.25)"}};function Ls(o){const s=parseInt(o.slice(1,3),16)/255,t=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(s)+.7152*l(t)+.0722*l(e)>.179?"#111111":"#ffffff"}const N={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 As(o){return{...N,colors:{...N.colors,primary:{50:"#fffff0",500:o,700:o,contrast:Ls(o)}}}}function Ns({theme:o=N,children:s}){return n.jsx(r.ThemeProvider,{theme:o,children:s})}exports.Badge=Z;exports.Button=X;exports.CollapsibleCard=ao;exports.EditableTable=$o;exports.Form=no;exports.FormField=to;exports.Input=G;exports.Link=io;exports.Modal=J;exports.Select=eo;exports.Table=bo;exports.ThemeProvider=Ns;exports.Toast=M;exports.ToastProvider=ms;exports.createNeoBrutalTheme=As;exports.defaultTheme=Fs;exports.neoBrutalTheme=N;exports.useForm=hs;exports.useToast=ks;
896
+ `;function ro(o,r,n){return typeof o.editable=="function"?o.editable(r,n):!!o.editable}function Po({columns:o,defaultData:r,data:n,rowKey:e,onChange:c,size:i="md",borderColor:l,headerColor:u,addRowLabel:x="Add row",newRowFactory:p,deletable:g=!1,className:w,style:y}){const b=n!==void 0,[k,C]=a.useState(r??[]),S=b?n:k,[v,z]=a.useState(null),[W,B]=a.useState(""),h=a.useRef(null);a.useEffect(()=>{v&&(h.current?.focus(),h.current?.select())},[v]);const $=a.useCallback(f=>{b||C(f),c?.(f)},[b,c]),m=a.useCallback(()=>p?p():Object.fromEntries(o.map(f=>[f.key,""])),[p,o]),E=a.useCallback(f=>{const T=[];return f.forEach((I,d)=>{o.forEach(j=>{ro(j,I,d)&&T.push({rowIndex:d,colKey:j.key})})}),T},[o]),R=(f,T,I)=>{z({rowIndex:f,colKey:T}),B(String(I??""))},N=a.useCallback(()=>{if(!v)return;const{rowIndex:f,colKey:T}=v,I=S.map((d,j)=>j===f?{...d,[T]:W}:d);$(I),z(null)},[v,S,W,$]),M=()=>{z(null),B("")},P=f=>{if(!v)return;f.preventDefault();const{rowIndex:T,colKey:I}=v,d=S.map((D,q)=>q===T?{...D,[I]:W}:D);$(d);const j=E(d),O=j.findIndex(D=>D.rowIndex===T&&D.colKey===I),L=f.shiftKey?O-1:O+1;if(L>=0&&L<j.length){const D=j[L];z(D),B(String(d[D.rowIndex][D.colKey]??""));return}if(!f.shiftKey&&L>=j.length){const D=m(),q=[...d,D];$(q);const to=q.length-1,eo=o.find(Oo=>ro(Oo,D,to));z(eo?{rowIndex:to,colKey:eo.key}:null),B("");return}z(null),B("")},_=f=>{if(f.key==="Enter"){N();return}if(f.key==="Escape"){M();return}f.key==="Tab"&&P(f)},H=()=>$([...S,m()]),X=f=>{v?.rowIndex===f&&z(null),$(S.filter((T,I)=>I!==f))},Z=(f,T)=>String(e?f[e]:T),F=g?o.length+1:o.length;return t.jsx(To,{$borderColor:l,className:w,style:y,children:t.jsxs(ls,{$size:i,children:[t.jsx(Eo,{$headerColor:u,$borderColor:l,children:t.jsxs(V,{children:[o.map(f=>t.jsx(no,{$size:i,scope:"col",style:f.width?{width:f.width}:void 0,children:f.header},f.key)),g&&t.jsx(us,{$size:i,"aria-label":"Actions"})]})}),t.jsxs(Wo,{children:[S.map((f,T)=>t.jsxs(V,{children:[o.map(I=>{const d=v?.rowIndex===T&&v.colKey===I.key,j=f[I.key],O=ro(I,f,T);return t.jsx(cs,{$size:i,$borderColor:l,$editable:O&&!d,onClick:O&&!d?()=>R(T,I.key,j):void 0,children:d?t.jsx(ds,{ref:h,$size:i,value:W,onChange:L=>B(L.target.value),onBlur:N,onKeyDown:_,"aria-label":`Edit ${I.header}`}):I.render?I.render(j,f,T):String(j??"")||" "},I.key)}),g&&t.jsx(ps,{$size:i,$borderColor:l,children:t.jsx(fs,{type:"button",onClick:()=>X(T),"aria-label":"Delete row",children:"✕"})})]},Z(f,T))),t.jsx(bs,{children:t.jsx("td",{colSpan:F,children:t.jsxs(gs,{type:"button",onClick:H,children:["+ ",x]})})})]})]})})}Po.displayName="DataTable";const po={primary:{50:"#f0f8ff",500:"#0070f3",700:"#005bb5"},neutral:{0:"#ffffff",100:"#f5f5f5",200:"#eaeaea",300:"#cacaca",400:"#cccccc",500:"#666666",600:"#333333",900:"#111111"},error:{50:"#fef2f2",500:"#d32f2f"},success:{50:"#f0fdf4",500:"#16a34a"},warning:{50:"#fffbeb",500:"#d97706"},info:{50:"#eff6ff",500:"#2563eb"}},$s={1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px"},xs={md:"6px"},ys={modal:1e3,toast:1100},hs={xs:"12px",sm:"14px",md:"16px",lg:"18px"},ws={colors:{...po,primary:{...po.primary,contrast:"#ffffff"}},spacing:$s,fontSizes:hs,radius:xs,zIndex:ys,shadows:{focusRing:"0 0 0 2px rgba(0, 112, 243, 0.25)"}};function vs(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,c=l=>l<=.03928?l/12.92:((l+.055)/1.055)**2.4;return .2126*c(r)+.7152*c(n)+.0722*c(e)>.179?"#111111":"#ffffff"}const U={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 ks(o){return{...U,colors:{...U.colors,primary:{50:"#fffff0",500:o,700:o,contrast:vs(o)}}}}function ms({theme:o=U,children:r}){return t.jsx(s.ThemeProvider,{theme:o,children:r})}exports.Badge=bo;exports.Button=go;exports.CollapsibleCard=So;exports.DataTable=Po;exports.Form=vo;exports.FormField=ko;exports.Input=$o;exports.Link=jo;exports.Modal=xo;exports.Select=mo;exports.Table=Bo;exports.ThemeProvider=ms;exports.Toast=so;exports.ToastProvider=Hr;exports.createNeoBrutalTheme=ks;exports.defaultTheme=ws;exports.neoBrutalTheme=U;exports.useForm=Yr;exports.useToast=qr;