blunt-ui 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("styled-components"),a=require("react"),A=require("react-dom"),I=(o,s,n)=>r.css`
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
2
  background: ${s};
3
- color: ${n};
3
+ color: ${t};
4
4
  border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
5
5
  box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
6
- `,no=r.span`
6
+ `,xo=r.span`
7
7
  display: inline-flex;
8
8
  align-items: center;
9
9
  font-weight: 700;
@@ -23,7 +23,7 @@
23
23
  font-size: ${s.fontSizes.sm};
24
24
  `})[o]}
25
25
 
26
- ${({$variant:o,theme:s})=>s.brutalism?{primary:I(s,s.colors.primary[500],s.colors.primary.contrast),neutral:I(s,s.colors.neutral[200],s.colors.neutral[900]),success:I(s,s.colors.success[50],s.colors.success[500]),error:I(s,s.colors.error[50],s.colors.error[500]),warning:I(s,s.colors.warning[50],s.colors.warning[500]),info:I(s,s.colors.info[50],s.colors.info[500])}[o]:{primary:r.css`
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
27
  background: ${s.colors.primary[50]};
28
28
  color: ${s.colors.primary[500]};
29
29
  `,neutral:r.css`
@@ -42,9 +42,9 @@
42
42
  background: ${s.colors.info[50]};
43
43
  color: ${s.colors.info[500]};
44
44
  `}[o]}
45
- `;function D({variant:o="primary",size:s="md",children:n,...e}){return t.jsx(no,{$variant:o,$size:s,...e,children:n})}D.displayName="Badge";const E=(o,s,n)=>r.css`
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
46
  background-color: ${s};
47
- color: ${n};
47
+ color: ${t};
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
- `,to=r.button`
58
+ `,yo=r.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:s})=>s.brutalism?{primary:E(s,s.colors.primary[500],s.colors.primary.contrast),secondary:E(s,s.colors.neutral[100],s.colors.neutral[900]),outline:E(s,s.colors.neutral[0],s.colors.neutral[900])}[o]:{primary:r.css`
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
78
  background-color: ${s.colors.primary[500]};
79
79
  color: ${s.colors.neutral[0]};
80
80
  border: none;
@@ -107,18 +107,18 @@
107
107
  padding: ${s.spacing[3]} ${s.spacing[6]};
108
108
  font-size: ${s.fontSizes.lg};
109
109
  `})[o]}
110
- `;function Y({ref:o,as:s,href:n,variant:e="primary",size:c="md",isLoading:l,disabled:i,children:d,...p}){const u=s??(n?"a":"button");return t.jsx(to,{ref:o,as:u,href:n,$variant:e,$size:c,disabled:l||i,...p,children:l?"Loading...":d})}Y.displayName="Button";const eo=r.div`
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`
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
- `,ao=r.label`
115
+ `,vo=r.label`
116
116
  font-size: ${({theme:o})=>o.fontSizes.sm};
117
117
  font-weight: ${({theme:o})=>o.brutalism?"700":"500"};
118
- `,io=r.span`
118
+ `,mo=r.span`
119
119
  font-size: ${({theme:o})=>o.fontSizes.xs};
120
120
  color: ${({$error:o,theme:s})=>o?s.colors.error[500]:s.colors.neutral[500]};
121
- `,lo=r.div`
121
+ `,ko=r.div`
122
122
  display: flex;
123
123
  align-items: center;
124
124
  border-radius: ${({theme:o})=>o.radius.md};
@@ -163,7 +163,7 @@
163
163
  &:focus-within {
164
164
  box-shadow: ${({theme:o})=>o.shadows.focusRing};
165
165
  }
166
- `,co=r.input`
166
+ `,ho=r.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
- `,N=r.div`
177
+ `,H=r.div`
178
178
  display: inline-flex;
179
179
  align-items: center;
180
180
  margin: 0 ${({theme:o})=>o.spacing[1]};
181
- `,uo=r.button`
181
+ `,jo=r.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 H({ref:o,type:s="text",size:n="md",variant:e="default",label:c,helperText:l,error:i,leftElement:d,rightElement:p,clearable:u,onClear:x,fullWidth:v,id:b,value:$,defaultValue:m,onChange:C,...h}){const k=a.useId(),j=b??k,S=`${j}-hint`,[z,f]=a.useState(m??""),g=$!==void 0,y=g?$:z,w=typeof i=="string"?i:void 0,T=!!(l||i),O=R=>{g||f(R.target.value),C?.(R)},ro=()=>{g||f(""),x?.()};return t.jsxs(eo,{$fullWidth:v,children:[c&&t.jsx(ao,{htmlFor:j,children:c}),t.jsxs(lo,{$size:n,$variant:e,$error:!!i,children:[d&&t.jsx(N,{children:d}),t.jsx(co,{id:j,ref:o,type:s,value:y,onChange:O,...h,"aria-invalid":!!i,"aria-describedby":T?S:void 0}),u&&y&&t.jsx(uo,{type:"button",onClick:ro,"aria-label":"Clear input",children:"✕"}),p&&t.jsx(N,{children:p})]}),T&&t.jsx(io,{id:S,$error:!!i,children:w??l})]})}H.displayName="Input";const fo=r.keyframes`
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`
195
195
  from { opacity: 0; }
196
196
  to { opacity: 1; }
197
- `,po=r.keyframes`
197
+ `,So=r.keyframes`
198
198
  from { opacity: 1; }
199
199
  to { opacity: 0; }
200
- `,go=r.keyframes`
200
+ `,zo=r.keyframes`
201
201
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
202
202
  to { opacity: 1; transform: scale(1) translateY(0); }
203
- `,bo=r.keyframes`
203
+ `,To=r.keyframes`
204
204
  from { opacity: 1; transform: scale(1) translateY(0); }
205
205
  to { opacity: 0; transform: scale(0.95) translateY(-8px); }
206
- `,$o=r.div`
206
+ `,Io=r.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?po:fo} 0.15s ease
214
+ animation: ${({$closing:o})=>o?So:Co} 0.15s ease
215
215
  forwards;
216
- `,xo=r.div`
216
+ `,Eo=r.div`
217
217
  position: relative;
218
218
  background: ${({theme:o})=>o.colors.neutral[0]};
219
219
  border-radius: ${({theme:o})=>o.radius.md};
@@ -222,7 +222,7 @@
222
222
  display: flex;
223
223
  flex-direction: column;
224
224
  max-height: 90vh;
225
- animation: ${({$closing:o})=>o?bo:go} 0.15s ease
225
+ animation: ${({$closing:o})=>o?To:zo} 0.15s ease
226
226
  forwards;
227
227
 
228
228
  ${({$size:o})=>o==="sm"&&r.css`
@@ -240,19 +240,19 @@
240
240
  max-height: 100vh;
241
241
  border-radius: 0;
242
242
  `}
243
- `,yo=r.div`
243
+ `,Wo=r.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
- `,mo=r.h2`
250
+ `,Bo=r.h2`
251
251
  flex: 1;
252
252
  font-size: ${({theme:o})=>o.fontSizes.lg};
253
253
  font-weight: 600;
254
254
  margin: 0;
255
- `,wo=r.button`
255
+ `,Oo=r.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
- `,vo=r.div`
280
+ `,Ro=r.div`
281
281
  padding: ${({theme:o})=>o.spacing[4]};
282
282
  overflow-y: auto;
283
283
  flex: 1;
284
- `,ko=r.div`
284
+ `,Fo=r.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
- `,ho=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex="-1"])'].join(", ");function V(o){return Array.from(o.querySelectorAll(ho))}function q({open:o,onClose:s,title:n,children:e,footer:c,size:l="md",closeOnBackdrop:i=!0,closeOnEscape:d=!0,ariaLabelledBy:p,ariaDescribedBy:u}){const x=a.useRef(null),v=a.useId(),b=p??(n?v:void 0),[$,m]=a.useState(o),[C,h]=a.useState(!1);return a.useEffect(()=>{if(o)m(!0),h(!1);else if($){h(!0);const k=setTimeout(()=>{m(!1),h(!1)},150);return()=>clearTimeout(k)}},[o,$]),a.useEffect(()=>{if(!o)return;const k=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=k}},[o]),a.useEffect(()=>{if(!o||!x.current)return;const k=x.current,j=document.activeElement;(V(k)[0]??k).focus();const z=f=>{if(f.key==="Escape"&&d){s();return}if(f.key!=="Tab")return;const g=V(k);if(g.length===0){f.preventDefault();return}const y=g[0],w=g[g.length-1];f.shiftKey?document.activeElement===y&&(f.preventDefault(),w.focus()):document.activeElement===w&&(f.preventDefault(),y.focus())};return document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z),j?.focus()}},[o,d,s,$]),$?A.createPortal(t.jsx($o,{$closing:C,onClick:i?s:void 0,children:t.jsxs(xo,{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":b,"aria-describedby":u,$size:l,$closing:C,tabIndex:-1,onClick:k=>k.stopPropagation(),children:[t.jsxs(yo,{children:[n&&t.jsx(mo,{id:v,children:n}),t.jsx(wo,{onClick:s,"aria-label":"Close modal",children:"×"})]}),t.jsx(vo,{children:e}),c&&t.jsx(ko,{children:c})]})}),document.body):null}q.displayName="Modal";const _=(...o)=>o.filter((s,n,e)=>!!s&&s.trim()!==""&&e.indexOf(s)===n).join(" ").trim();const Co=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const jo=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,n,e)=>e?e.toUpperCase():n.toLowerCase());const M=o=>{const s=jo(o);return s.charAt(0).toUpperCase()+s.slice(1)};var F={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 So=o=>{for(const s in o)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1},zo=a.createContext({}),Io=()=>a.useContext(zo),To=a.forwardRef(({color:o,size:s,strokeWidth:n,absoluteStrokeWidth:e,className:c="",children:l,iconNode:i,...d},p)=>{const{size:u=24,strokeWidth:x=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:$=""}=Io()??{},m=e??v?Number(n??x)*24/Number(s??u):n??x;return a.createElement("svg",{ref:p,...F,width:s??u??F.width,height:s??u??F.height,stroke:o??b,strokeWidth:m,className:_("lucide",$,c),...!l&&!So(d)&&{"aria-hidden":"true"},...d},[...i.map(([C,h])=>a.createElement(C,h)),...Array.isArray(l)?l:[l]])});const K=(o,s)=>{const n=a.forwardRef(({className:e,...c},l)=>a.createElement(To,{ref:l,iconNode:s,className:_(`lucide-${Co(M(o))}`,`lucide-${o}`,e),...c}));return n.displayName=M(o),n};const Wo=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],U=K("chevron-down",Wo);const Bo=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Z=K("x",Bo),Oo=r.keyframes`
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`
293
293
  from { opacity: 0; transform: translateY(12px); }
294
294
  to { opacity: 1; transform: translateY(0); }
295
- `,Eo=r.keyframes`
295
+ `,qo=r.keyframes`
296
296
  from { opacity: 0; transform: translateY(-12px); }
297
297
  to { opacity: 1; transform: translateY(0); }
298
- `,Fo=r.keyframes`
298
+ `,Ko=r.keyframes`
299
299
  from { opacity: 1; }
300
300
  to { opacity: 0; }
301
- `,Lo=r.div`
301
+ `,Uo=r.div`
302
302
  position: fixed;
303
303
  z-index: ${({theme:o})=>o.zIndex.toast};
304
304
  display: flex;
@@ -309,11 +309,11 @@
309
309
  padding: ${({theme:o})=>`${o.spacing[3]} ${o.spacing[4]}`};
310
310
  border-radius: ${({theme:o})=>o.radius.md};
311
311
  animation: ${({$closing:o,$position:s})=>o?r.css`
312
- ${Fo} 0.2s ease forwards
312
+ ${Ko} 0.2s ease forwards
313
313
  `:s.startsWith("top")?r.css`
314
- ${Eo} 0.2s ease forwards
314
+ ${qo} 0.2s ease forwards
315
315
  `:r.css`
316
- ${Oo} 0.2s ease forwards
316
+ ${_o} 0.2s ease forwards
317
317
  `};
318
318
 
319
319
  ${({$position:o,theme:s})=>({"bottom-right":r.css`
@@ -329,13 +329,13 @@
329
329
  top: ${s.spacing[6]};
330
330
  left: ${s.spacing[6]};
331
331
  `})[o]}
332
- `,W=(o,s,n)=>r.css`
332
+ `,L=(o,s,t)=>r.css`
333
333
  background: ${s};
334
- border: ${o.brutalism.borderWidth} solid ${n};
334
+ border: ${o.brutalism.borderWidth} solid ${t};
335
335
  box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
336
- 0 ${n};
337
- `,Ro=r(Lo)`
338
- ${({$variant:o,theme:s})=>s.brutalism?{success:W(s,s.colors.success[50],s.colors.success[500]),error:W(s,s.colors.error[50],s.colors.error[500]),warning:W(s,s.colors.warning[50],s.colors.warning[500]),info:W(s,s.colors.info[50],s.colors.info[500])}[o]:{success:r.css`
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
339
  background: ${s.colors.success[50]};
340
340
  border-left: 4px solid ${s.colors.success[500]};
341
341
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
@@ -352,14 +352,14 @@
352
352
  border-left: 4px solid ${s.colors.info[500]};
353
353
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
354
354
  `}[o]}
355
- `,No=r.p`
355
+ `,Xo=r.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
- `,Vo=r.button`
362
+ `,Go=r.button`
363
363
  flex-shrink: 0;
364
364
  display: inline-flex;
365
365
  align-items: center;
@@ -381,38 +381,38 @@
381
381
  outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
382
382
  outline-offset: 2px;
383
383
  }
384
- `;function L({open:o,onClose:s,message:n,variant:e="info",duration:c=4e3,position:l="bottom-right"}){const[i,d]=a.useState(o),[p,u]=a.useState(!1);return a.useEffect(()=>{if(o)d(!0),u(!1);else if(i){u(!0);const x=setTimeout(()=>{d(!1),u(!1)},200);return()=>clearTimeout(x)}},[o,i]),a.useEffect(()=>{if(!o||c===0)return;const x=setTimeout(s,c);return()=>clearTimeout(x)},[o,c,s]),i?A.createPortal(t.jsxs(Ro,{$position:l,$variant:e,$closing:p,role:"alert","aria-live":"polite",children:[t.jsx(No,{children:n}),t.jsx(Vo,{onClick:s,"aria-label":"Close notification",children:t.jsx(Z,{size:14,strokeWidth:2.5})})]}),document.body):null}L.displayName="Toast";const Mo=r.form`
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`
385
385
  display: flex;
386
386
  flex-direction: column;
387
387
  gap: ${({theme:o})=>o.spacing[4]};
388
- `,Po=r.div`
388
+ `,Qo=r.div`
389
389
  display: flex;
390
390
  flex-direction: column;
391
391
  gap: ${({theme:o})=>o.spacing[1]};
392
- `,Ao=r.label`
392
+ `,os=r.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
- `,Do=r.span`
396
+ `,ss=r.span`
397
397
  color: ${({theme:o})=>o.colors.error[500]};
398
398
  margin-left: 2px;
399
399
  aria-hidden: true;
400
- `,Yo=r.span`
400
+ `,rs=r.span`
401
401
  font-size: ${({theme:o})=>o.fontSizes.xs};
402
402
  color: ${({$error:o,theme:s})=>o?s.colors.error[500]:s.colors.neutral[500]};
403
- `;function X({onSubmit:o,children:s,...n}){return t.jsx(Mo,{onSubmit:e=>{e.preventDefault(),o?.(e)},noValidate:!0,...n,children:s})}X.displayName="Form";function G({label:o,error:s,helperText:n,required:e,children:c}){const l=a.useId(),i=`${l}-hint`,d=!!(s||n),p=typeof s=="string"?s:void 0,u=a.isValidElement(c)?a.cloneElement(c,{id:l,...d&&{"aria-describedby":i},...s&&{"aria-invalid":!0}}):c;return t.jsxs(Po,{children:[o&&t.jsxs(Ao,{htmlFor:l,children:[o,e&&t.jsx(Do,{"aria-hidden":"true",children:" *"})]}),u,d&&t.jsx(Yo,{id:i,$error:!!s,children:p??n})]})}G.displayName="FormField";const Ho=r.div`
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`
404
404
  display: inline-flex;
405
405
  flex-direction: column;
406
406
  gap: ${({theme:o})=>o.spacing[1]};
407
407
  width: ${({$fullWidth:o})=>o?"100%":"auto"};
408
- `,qo=r.div`
408
+ `,ts=r.div`
409
409
  position: relative;
410
410
  display: flex;
411
411
  width: 100%;
412
- `,_o=r.span`
412
+ `,es=r.span`
413
413
  font-size: ${({theme:o})=>o.fontSizes.xs};
414
414
  color: ${({$error:o,theme:s})=>o?s.colors.error[500]:s.colors.neutral[500]};
415
- `,Ko=r.select`
415
+ `,is=r.select`
416
416
  appearance: none;
417
417
  width: 100%;
418
418
  border-radius: ${({theme:o})=>o.radius.md};
@@ -465,7 +465,7 @@
465
465
  cursor: not-allowed;
466
466
  opacity: 0.6;
467
467
  }
468
- `,Uo=r.button`
468
+ `,as=r.button`
469
469
  position: absolute;
470
470
  right: ${({theme:o})=>o.spacing[3]};
471
471
  top: 50%;
@@ -487,7 +487,7 @@
487
487
  outline-offset: 2px;
488
488
  border-radius: 2px;
489
489
  }
490
- `,Zo=r.span`
490
+ `,ls=r.span`
491
491
  position: absolute;
492
492
  right: ${({theme:o})=>o.spacing[3]};
493
493
  top: 50%;
@@ -496,7 +496,7 @@
496
496
  display: flex;
497
497
  align-items: center;
498
498
  color: ${({theme:o})=>o.colors.neutral[500]};
499
- `;function J({options:o,placeholder:s,size:n="md",variant:e="default",error:c,fullWidth:l,clearable:i,onClear:d,id:p,value:u,defaultValue:x,onChange:v,...b}){const $=a.useId(),m=p??$,C=`${m}-hint`,h=typeof c=="string"?c:void 0,[k,j]=a.useState(x??""),S=u!==void 0,z=S?u:k,f=w=>{S||j(w.target.value),v?.(w)},g=()=>{S||j(""),d?.()},y=i&&!!z;return t.jsxs(Ho,{$fullWidth:l,children:[t.jsxs(qo,{children:[t.jsxs(Ko,{id:m,$size:n,$variant:e,$error:!!c,"aria-invalid":!!c,"aria-describedby":h?C:void 0,value:z,onChange:f,...b,children:[s&&t.jsx("option",{value:"",disabled:!0,children:s}),o.map(w=>t.jsx("option",{value:w.value,disabled:w.disabled,children:w.label},w.value))]}),y?t.jsx(Uo,{type:"button",onClick:g,"aria-label":"Clear selection",children:t.jsx(Z,{size:14})}):t.jsx(Zo,{"aria-hidden":"true",children:t.jsx(U,{size:14})})]}),h&&t.jsx(_o,{id:C,$error:!0,children:h})]})}J.displayName="Select";const Xo=r.a`
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`
500
500
  text-decoration: underline;
501
501
  text-underline-offset: 2px;
502
502
  transition: color 0.15s;
@@ -518,7 +518,7 @@
518
518
  color: ${s.colors.neutral[900]};
519
519
  }
520
520
  `})[o]}
521
- `;function Q({variant:o="default",external:s,children:n,...e}){return t.jsx(Xo,{$variant:o,...s&&{target:"_blank",rel:"noreferrer"},...e,children:n})}Q.displayName="Link";const Go=r.div`
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`
522
522
  border-radius: ${({theme:o})=>o.radius.md};
523
523
  background: ${({theme:o})=>o.colors.neutral[0]};
524
524
  overflow: hidden;
@@ -533,7 +533,7 @@
533
533
  border: 1px solid ${s??o.colors.neutral[200]};
534
534
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
535
535
  `}
536
- `,Jo=r.button`
536
+ `,us=r.button`
537
537
  width: 100%;
538
538
  display: flex;
539
539
  align-items: flex-start;
@@ -553,19 +553,19 @@
553
553
  ${({theme:o,$accentColor:s})=>s??o.colors.primary[500]};
554
554
  outline-offset: -2px;
555
555
  }
556
- `,Qo=r.div`
556
+ `,fs=r.div`
557
557
  flex: 1;
558
558
  min-width: 0;
559
- `,os=r.span`
559
+ `,ps=r.span`
560
560
  display: block;
561
561
  font-size: ${({theme:o})=>o.fontSizes.md};
562
562
  font-weight: 600;
563
563
  color: ${({theme:o})=>o.colors.neutral[900]};
564
- `,ss=r.span`
564
+ `,bs=r.span`
565
565
  display: block;
566
566
  font-size: ${({theme:o})=>o.fontSizes.sm};
567
567
  color: ${({theme:o})=>o.colors.neutral[500]};
568
- `,rs=r.div`
568
+ `,$s=r.div`
569
569
  display: flex;
570
570
  flex-direction: row;
571
571
  align-items: center;
@@ -577,11 +577,11 @@
577
577
  align-items: flex-start;
578
578
  gap: ${({theme:o})=>o.spacing[2]};
579
579
  }
580
- `,ns=r.div`
580
+ `,gs=r.div`
581
581
  display: flex;
582
582
  align-items: center;
583
583
  gap: ${({theme:o})=>o.spacing[2]};
584
- `,ts=r.span`
584
+ `,xs=r.span`
585
585
  display: inline-flex;
586
586
  align-items: center;
587
587
  justify-content: center;
@@ -589,13 +589,184 @@
589
589
  transition: transform 0.2s ease;
590
590
  transform: ${({$open:o})=>o?"rotate(180deg)":"rotate(0deg)"};
591
591
  color: ${({theme:o,$accentColor:s})=>s??o.colors.neutral[500]};
592
- `,es=r.div`
592
+ `,ys=r.div`
593
593
  display: grid;
594
594
  grid-template-rows: ${({$open:o})=>o?"1fr":"0fr"};
595
595
  transition: grid-template-rows 0.2s ease;
596
- `,as=r.div`
596
+ `,ws=r.div`
597
597
  overflow: hidden;
598
- `,is=r.div`
598
+ `,vs=r.div`
599
599
  padding: ${({theme:o})=>o.spacing[4]};
600
600
  border-top: 1px solid ${({theme:o})=>o.colors.neutral[200]};
601
- `;function oo({title:o,children:s,defaultOpen:n=!1,open:e,onToggle:c,subtitle:l,headerActions:i,accentColor:d}){const[p,u]=a.useState(n),x=a.useId(),v=e!==void 0,b=v?e:p,$=()=>{const m=!b;v||u(m),c?.(m)};return t.jsxs(Go,{$accentColor:d,children:[t.jsxs(Jo,{type:"button",$open:b,$accentColor:d,"aria-expanded":b,"aria-controls":x,onClick:$,children:[t.jsxs(Qo,{children:[t.jsx(os,{children:o}),(l||i)&&t.jsxs(rs,{children:[l&&t.jsx(ss,{children:l}),i&&t.jsx(ns,{onClick:m=>m.stopPropagation(),children:i})]})]}),t.jsx(ts,{$open:b,$accentColor:d,"aria-hidden":"true",children:t.jsx(U,{size:18,strokeWidth:2.5})})]}),t.jsx(es,{$open:b,children:t.jsx(as,{id:x,role:"region","aria-label":o,children:t.jsx(is,{children:s})})})]})}oo.displayName="CollapsibleCard";const so=a.createContext(null);function ls({children:o}){const[s,n]=a.useState(null),e=a.useCallback(l=>{n({...l,id:Date.now()})},[]),c=a.useMemo(()=>{const l=i=>e(i);return l.success=(i,d)=>e({...d,message:i,variant:"success"}),l.error=(i,d)=>e({...d,message:i,variant:"error"}),l.warning=(i,d)=>e({...d,message:i,variant:"warning"}),l.info=(i,d)=>e({...d,message:i,variant:"info"}),l},[e]);return t.jsxs(so.Provider,{value:{toast:c},children:[o,s&&t.jsx(L,{open:!0,onClose:()=>n(null),message:s.message,variant:s.variant,duration:s.duration,position:s.position},s.id)]})}function cs(){const o=a.useContext(so);if(!o)throw new Error("useToast must be used within a ToastProvider");return o}function ds({initialValues:o,validate:s,onSubmit:n,onError:e}){const[c,l]=a.useState(o),[i,d]=a.useState({}),[p,u]=a.useState({}),[x,v]=a.useState(!1),b=a.useRef(c);b.current=c;const $=a.useCallback(f=>{if(!s)return{};const g=s(f);return Object.fromEntries(Object.entries(g).filter(([,y])=>y!==void 0))},[s]),m=a.useRef(p);m.current=p;const C=a.useCallback(f=>{const{name:g,value:y}=f.target,w={...b.current,[g]:y};l(w),m.current[g]&&d($(w))},[$]),h=a.useCallback(f=>{const{name:g}=f.target;u(y=>({...y,[g]:!0})),d($(b.current))},[$]),k=a.useCallback(f=>{f?.preventDefault();const g=Object.keys(b.current).reduce((T,O)=>({...T,[O]:!0}),{});u(g);const y=$(b.current);if(d(y),Object.keys(y).length>0){e?.(y);return}(async()=>{v(!0);try{await n?.(b.current)}finally{v(!1)}})()},[$,n,e]),j=a.useCallback((f,g)=>{l(y=>({...y,[f]:g}))},[]),S=a.useCallback(()=>{l(o),d({}),u({}),v(!1)},[o]),z=Object.fromEntries(Object.entries(i).filter(([f])=>p[f]));return{values:c,errors:z,touched:p,handleChange:C,handleBlur:h,handleSubmit:k,setFieldValue:j,reset:S,isSubmitting:x}}const P={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"}},us={1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px"},fs={md:"6px"},ps={modal:1e3,toast:1100},gs={xs:"12px",sm:"14px",md:"16px",lg:"18px"},bs={colors:{...P,primary:{...P.primary,contrast:"#ffffff"}},spacing:us,fontSizes:gs,radius:fs,zIndex:ps,shadows:{focusRing:"0 0 0 2px rgba(0, 112, 243, 0.25)"}};function $s(o){const s=parseInt(o.slice(1,3),16)/255,n=parseInt(o.slice(3,5),16)/255,e=parseInt(o.slice(5,7),16)/255,c=i=>i<=.03928?i/12.92:((i+.055)/1.055)**2.4;return .2126*c(s)+.7152*c(n)+.0722*c(e)>.179?"#111111":"#ffffff"}const B={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 xs(o){return{...B,colors:{...B.colors,primary:{50:"#fffff0",500:o,700:o,contrast:$s(o)}}}}function ys({theme:o=B,children:s}){return t.jsx(r.ThemeProvider,{theme:o,children:s})}exports.Badge=D;exports.Button=Y;exports.CollapsibleCard=oo;exports.Form=X;exports.FormField=G;exports.Input=H;exports.Link=Q;exports.Modal=q;exports.Select=J;exports.ThemeProvider=ys;exports.Toast=L;exports.ToastProvider=ls;exports.createNeoBrutalTheme=xs;exports.defaultTheme=bs;exports.neoBrutalTheme=B;exports.useForm=ds;exports.useToast=cs;
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;
603
+ width: 100%;
604
+
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]};
611
+ border-radius: ${o.radius.md};
612
+ overflow: hidden;
613
+ `}
614
+ `,uo=r.table`
615
+ width: 100%;
616
+ 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`
628
+ tr:nth-child(even) {
629
+ background-color: ${s.colors.neutral[100]};
630
+ }
631
+ `}
632
+
633
+ tr:last-child td {
634
+ border-bottom: none;
635
+ }
636
+ `,A=r.tr``,P=r.th`
637
+ text-align: left;
638
+ font-weight: 700;
639
+ white-space: nowrap;
640
+
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]}
648
+
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]};
657
+ &:last-child {
658
+ border-right: none;
659
+ }
660
+ `}
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]}
669
+
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]};
676
+ &:last-child {
677
+ border-right: none;
678
+ }
679
+ `}
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]};
684
+ `}
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`
687
+ cursor: pointer;
688
+ position: relative;
689
+
690
+ &:hover {
691
+ background-color: ${s.brutalism?s.colors.neutral[100]:s.colors.primary[50]};
692
+ }
693
+ `}
694
+ `,Cs=r.input`
695
+ width: 100%;
696
+ border: none;
697
+ outline: none;
698
+ background: transparent;
699
+ font: inherit;
700
+ color: inherit;
701
+ padding: 0;
702
+ margin: 0;
703
+
704
+ ${({theme:o})=>o.brutalism?r.css`
705
+ &:focus {
706
+ outline: 2px solid ${o.colors.neutral[900]};
707
+ outline-offset: 1px;
708
+ }
709
+ `:r.css`
710
+ &:focus {
711
+ box-shadow: ${o.shadows.focusRing};
712
+ }
713
+ `}
714
+ `,Ss=r(P)`
715
+ width: 40px;
716
+ `,zs=r(Y)`
717
+ width: 40px;
718
+ text-align: center;
719
+ padding-left: 0;
720
+ padding-right: 0;
721
+ `,Ts=r.button`
722
+ display: inline-flex;
723
+ align-items: center;
724
+ justify-content: center;
725
+ width: 24px;
726
+ height: 24px;
727
+ padding: 0;
728
+ background: none;
729
+ border: none;
730
+ cursor: pointer;
731
+ font-size: ${({theme:o})=>o.fontSizes.xs};
732
+ color: ${({theme:o})=>o.colors.neutral[500]};
733
+ border-radius: ${({theme:o})=>o.radius.md};
734
+ transition: color 0.1s;
735
+
736
+ &:hover {
737
+ color: ${({theme:o})=>o.colors.error[500]};
738
+
739
+ ${({theme:o})=>o.brutalism&&r.css`
740
+ background-color: ${o.colors.error[50]};
741
+ `}
742
+ }
743
+ `,Is=r.tr`
744
+ ${({theme:o})=>o.brutalism?r.css`
745
+ border-top: ${o.brutalism.borderWidth} solid
746
+ ${o.colors.neutral[900]};
747
+ `:r.css`
748
+ border-top: 1px solid ${o.colors.neutral[200]};
749
+ `}
750
+ `,Es=r.button`
751
+ display: inline-flex;
752
+ align-items: center;
753
+ gap: ${({theme:o})=>o.spacing[1]};
754
+ background: none;
755
+ border: none;
756
+ cursor: pointer;
757
+ font: inherit;
758
+ font-weight: 600;
759
+ color: ${({theme:o})=>o.colors.neutral[600]};
760
+ padding: ${({theme:o})=>`${o.spacing[2]} ${o.spacing[3]}`};
761
+ width: 100%;
762
+ text-align: left;
763
+
764
+ &:hover {
765
+ color: ${({theme:o})=>o.brutalism?o.colors.neutral[900]:o.colors.primary[500]};
766
+ }
767
+
768
+ &:focus-visible {
769
+ outline: 2px solid ${({theme:o})=>o.colors.primary[500]};
770
+ outline-offset: 2px;
771
+ }
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;
package/dist/index.d.ts CHANGED
@@ -20,6 +20,10 @@ export { useToast, ToastProvider } from './hooks';
20
20
  export type { ToastOptions, ToastFn, ToastContextValue } from './hooks';
21
21
  export { useForm } from './hooks';
22
22
  export type { UseFormOptions, UseFormReturn } from './hooks';
23
+ export { Table } from './components/Table';
24
+ export type { TableProps, TableColumn, TableSizes, TableVariants, } from './components/Table';
25
+ export { EditableTable } from './components/EditableTable';
26
+ export type { EditableTableProps, EditableColumn, } from './components/EditableTable';
23
27
  export { ThemeProvider } from './components/ThemeProvider';
24
28
  export { defaultTheme, neoBrutalTheme, createNeoBrutalTheme } from './themes';
25
29
  export type { Theme } from './themes';