@bzync/rui 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{autocomplete-CfbfpcO4.js → autocomplete-BgKbj6M4.js} +2 -2
- package/dist/{autocomplete-CaysJRpk.cjs → autocomplete-Bk4pRQ2R.cjs} +1 -1
- package/dist/{calendar-Bnld4G59.cjs → calendar-CUXpVrVE.cjs} +1 -1
- package/dist/{calendar-CdICOROs.js → calendar-j2_zvum1.js} +1 -1
- package/dist/{component-styles-Ce56hn9T.js → component-styles-Bgy44fc8.js} +2 -2
- package/dist/{component-styles-TkZ7v6Ef.cjs → component-styles-DOUctc8_.cjs} +1 -1
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/autocomplete.cjs +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.js +3 -3
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/card.cjs +1 -1
- package/dist/components/card.js +3 -3
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/command.cjs +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/datatable.cjs +1 -1
- package/dist/components/datatable.js +1 -1
- package/dist/components/datepicker.cjs +1 -1
- package/dist/components/datepicker.js +2 -2
- package/dist/components/drawer.cjs +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/file-upload.cjs +1 -1
- package/dist/components/file-upload.js +2 -2
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.js +2 -2
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.js +1 -1
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.js +1 -1
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.js +2 -2
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.js +2 -2
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/slider.cjs +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/snackbar.cjs +1 -1
- package/dist/components/snackbar.js +1 -1
- package/dist/components/stat.cjs +1 -1
- package/dist/components/stat.js +8 -8
- package/dist/components/table.cjs +1 -1
- package/dist/components/table.js +2 -2
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.js +2 -2
- package/dist/components/theme-toggle.cjs +1 -1
- package/dist/components/theme-toggle.js +1 -1
- package/dist/{datatable-BB3v__r5.cjs → datatable-rzDgQ3r6.cjs} +1 -1
- package/dist/{datatable-DlBhUhuO.js → datatable-yBN4M3UV.js} +3 -3
- package/dist/{drawer-Cbuh6qdL.cjs → drawer-CTeBsYrO.cjs} +1 -1
- package/dist/{drawer-CqkVZT9Y.js → drawer-ixuzyLVS.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +6 -6
- package/dist/lib/component-styles.d.ts +1 -1
- package/dist/select-BFwx--uK.cjs +1 -0
- package/dist/{select-Ch5fp1GT.js → select-ClWrcj3R.js} +3 -3
- package/dist/styles.css +1 -1
- package/dist/{theme-toggle-CnoiorKV.js → theme-toggle-Bb0BYo51.js} +1 -1
- package/dist/{theme-toggle-Dp1-24zH.cjs → theme-toggle-Cld8tktJ.cjs} +1 -1
- package/package.json +1 -1
- package/dist/select-q0YCMhBP.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./cn-DpgY2leY.js";
|
|
2
|
-
import { o as t, t as n } from "./component-styles-
|
|
2
|
+
import { o as t, t as n } from "./component-styles-Bgy44fc8.js";
|
|
3
3
|
import { o as r } from "./utils-CQ8pvCtk.js";
|
|
4
4
|
import { t as i } from "./use-event-callback-DGkfO_uu.js";
|
|
5
5
|
import { AnimatePresence as a, motion as o } from "framer-motion";
|
|
@@ -359,7 +359,7 @@ function w(n, a) {
|
|
|
359
359
|
children: [
|
|
360
360
|
v && /* @__PURE__ */ g("label", {
|
|
361
361
|
htmlFor: M,
|
|
362
|
-
className: "text-
|
|
362
|
+
className: "text-xs font-semibold leading-5 text-foreground",
|
|
363
363
|
children: [v, A.required && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
|
|
364
364
|
"aria-hidden": "true",
|
|
365
365
|
className: "ml-1 text-destructive",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./cn-BdjraxxU.cjs"),t=require("./component-styles-TkZ7v6Ef.cjs"),n=require("./utils-DOFJTw8o.cjs"),r=require("./use-event-callback-Du9_9eAi.cjs");let i=require("framer-motion"),a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom");var c=({size:e=12})=>(0,o.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,o.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),l=()=>(0,o.jsxs)(`svg`,{className:`animate-spin shrink-0 w-3.5 h-3.5 text-slate-500`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,o.jsx)(`circle`,{className:`opacity-20`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`}),(0,o.jsx)(`path`,{className:`opacity-70`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]});function u({text:e,query:t}){if(!t)return(0,o.jsx)(o.Fragment,{children:e});let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?(0,o.jsx)(o.Fragment,{children:e}):(0,o.jsxs)(o.Fragment,{children:[e.slice(0,n),(0,o.jsx)(`mark`,{className:`bg-blue-500/25 text-blue-700 dark:text-blue-200 rounded-sm not-italic`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function d({inputRef:n,inputId:r,listId:i,open:a,activeIdx:s,inputText:u,prefix:d,placeholder:f,disabled:p,error:m,loading:h,showClear:g,onInputChange:_,onFocus:v,onKeyDown:y,onClear:b,messageId:x,inputProps:S}){return(0,o.jsxs)(`div`,{className:e.t(`flex h-9 items-center gap-2 rounded-[var(--radius-md)] px-3`,t.t,m&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,p&&`opacity-50 cursor-not-allowed`),children:[d&&(0,o.jsx)(`span`,{className:`text-slate-500 shrink-0 text-sm`,children:d}),(0,o.jsx)(`input`,{...S,ref:n,id:r,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":a,"aria-controls":i,"aria-activedescendant":s>=0?`${i}-opt-${s}`:void 0,"aria-invalid":m?!0:void 0,"aria-describedby":x,autoComplete:`off`,value:u,onChange:_,onFocus:v,onKeyDown:y,placeholder:f,disabled:p,className:`flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed`}),h&&(0,o.jsx)(l,{}),g&&!h&&(0,o.jsx)(`button`,{type:`button`,onClick:b,className:`shrink-0 text-slate-500 hover:text-slate-600 dark:hover:text-slate-300 cursor-pointer transition-colors`,children:(0,o.jsx)(c,{})})]})}function f({inputRef:n,inputId:r,listId:i,open:a,activeIdx:s,inputText:u,prefix:d,placeholder:f,disabled:p,error:m,loading:h,showClear:g,selected:_,onContainerClick:v,onInputChange:y,onFocus:b,onKeyDown:x,onRemove:S,onClearAll:C,messageId:w,inputProps:T}){return(0,o.jsxs)(`div`,{onClick:v,className:e.t(`flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-[var(--radius-md)] px-2.5 py-1.5 cursor-text`,t.t,m&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,p&&`opacity-50 cursor-not-allowed`),children:[d&&(0,o.jsx)(`span`,{className:`text-slate-500 shrink-0 text-sm`,children:d}),_.map(e=>(0,o.jsxs)(`span`,{className:`inline-flex max-w-[200px] items-center gap-1 rounded-md border border-border bg-surface-muted px-2 py-0.5 text-xs font-medium text-foreground`,children:[e.icon&&(0,o.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:e.icon}),(0,o.jsx)(`span`,{className:`truncate`,children:e.label}),(0,o.jsx)(`button`,{type:`button`,tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:t=>{t.stopPropagation(),S(e)},disabled:p,className:`shrink-0 text-slate-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white transition-colors cursor-pointer ml-0.5`,"aria-label":`Remove ${e.label}`,children:(0,o.jsx)(c,{size:10})})]},String(e.value))),(0,o.jsx)(`input`,{...T,ref:n,id:r,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":a,"aria-controls":i,"aria-activedescendant":s>=0?`${i}-opt-${s}`:void 0,"aria-invalid":m?!0:void 0,"aria-describedby":w,autoComplete:`off`,value:u,onChange:y,onFocus:b,onKeyDown:x,placeholder:_.length===0?f:void 0,disabled:p,className:`flex-1 min-w-[80px] bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed py-0.5`}),(0,o.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 shrink-0`,children:[h&&(0,o.jsx)(l,{}),g&&!h&&(0,o.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation(),C()},className:`text-slate-500 hover:text-slate-600 dark:hover:text-slate-300 transition-colors`,"aria-label":`Clear all`,children:(0,o.jsx)(c,{})}),_.length>0&&(0,o.jsx)(`span`,{className:`text-[10px] font-medium text-slate-500 tabular-nums`,children:_.length})]})]})}function p({listRef:t,listId:n,open:r,pos:a,multiple:c,loading:d,filtered:f,emptyMessage:p,activeIdx:m,setActiveIdx:h,inputText:g,selectedValues:_,singleValue:v,onSelectSingle:y,onToggleMulti:b,className:x}){return typeof document>`u`?null:(0,s.createPortal)((0,o.jsx)(i.AnimatePresence,{children:r&&a&&(0,o.jsx)(i.motion.ul,{ref:t,id:n,role:`listbox`,"aria-multiselectable":c,initial:{opacity:0,y:a.placement===`bottom`?-4:4},animate:{opacity:1,y:0},exit:{opacity:0,y:a.placement===`bottom`?-4:4},transition:{duration:.13},style:{position:`fixed`,top:a.top,left:a.left,width:a.width,maxHeight:a.maxHeight},className:e.t(`z-[110] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-surface-raised py-1 shadow-floating`,x),children:d?(0,o.jsxs)(`li`,{className:`px-4 py-3 text-sm text-slate-600 flex items-center gap-2`,children:[(0,o.jsx)(l,{}),`Loading…`]}):f.length===0?(0,o.jsx)(`li`,{className:`px-4 py-3 text-sm text-slate-600`,children:p}):f.map((t,r)=>{let i=r===m,a=c?_.includes(t.value):t.value===v;return(0,o.jsxs)(`li`,{id:`${n}-opt-${r}`,role:`option`,"aria-selected":a,onMouseDown:e=>e.preventDefault(),onClick:()=>c?b(t):y(t),onMouseEnter:()=>h(r),className:e.t(`flex min-h-9 items-center gap-3 px-3 py-2 cursor-pointer transition-colors`,i&&`bg-surface-muted`,a&&!i&&`bg-accent-50 dark:bg-accent-500/10`),children:[t.icon&&(0,o.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:t.icon}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`p`,{className:e.t(`text-sm`,a?`text-accent-700 dark:text-accent-300 font-medium`:`text-foreground`),children:(0,o.jsx)(u,{text:t.label,query:g})}),t.description&&(0,o.jsx)(`p`,{className:`text-xs text-slate-500 mt-0.5 truncate`,children:t.description})]}),a&&(0,o.jsx)(`svg`,{"aria-hidden":`true`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-accent-600 shrink-0`,children:(0,o.jsx)(`path`,{d:`m20 6-11 11-5-5`})})]},String(t.value))})})}),document.body)}function m(i,s){let{options:c,inputValue:l,onInputChange:u,label:m,hint:h,error:g,prefix:_,clearable:v=!0,loading:y=!1,emptyMessage:b=`No results`,maxVisible:x=8,className:S,wrapperClassName:C,listClassName:w,placeholder:T,disabled:E,id:ee,multiple:D,unstyled:te=!1,...O}=i,{value:ne,onSelect:re,onDeselect:ie,...k}=O,ae=(0,a.useId)(),A=ee??ae,j=`${A}-list`,M=`${A}-message`,[oe,se]=(0,a.useState)(``),N=l===void 0?oe:l,P=r.t(e=>u?.(e)),F=(0,a.useCallback)(e=>{l===void 0?se(e):P(e)},[l,P]),[I,L]=(0,a.useState)([]),R=(0,a.useMemo)(()=>{if(!D)return[];let e=i;return e.value===void 0?I:c.filter(t=>e.value.includes(t.value))},[D,c,i,I]),z=(0,a.useMemo)(()=>R.map(e=>e.value),[R]),[B,V]=(0,a.useState)(!1),[H,U]=(0,a.useState)(-1),W=(0,a.useRef)(null),G=(0,a.useRef)(null),K=(0,a.useRef)(null),[q,J]=(0,a.useState)(``),Y=(0,a.useMemo)(()=>{let e=q.trim().toLowerCase();return c.filter(t=>!t.disabled&&t.label.toLowerCase().includes(e)).slice(0,x)},[c,q,x]),X=(0,a.useCallback)(e=>{i.onSelect?.(e),F(e.label),V(!1),U(-1)},[i,F]),ce=(0,a.useCallback)(e=>{let t=i,n=[...R,e];t.value===void 0&&L(n),t.onSelect?.(e,n),F(``),U(-1),G.current?.focus()},[R,i,F]),Z=(0,a.useCallback)(e=>{let t=i,n=R.filter(t=>t.value!==e.value);t.value===void 0&&L(n),t.onDeselect?.(e,n)},[R,i]),Q=(0,a.useCallback)(e=>{z.includes(e.value)?Z(e):ce(e)},[z,Z,ce]),le=(0,a.useCallback)(()=>{F(``),i.onSelect?.({value:``,label:``}),V(!1)},[i,F]),ue=(0,a.useCallback)(()=>{i.value===void 0&&L([]),F(``)},[i,F]),de=(0,a.useCallback)(e=>{if(D&&e.key===`Backspace`&&N===``&&R.length>0){Z(R[R.length-1]);return}if(!B){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(V(!0),J(``));return}if(e.key===`ArrowDown`)e.preventDefault(),U(e=>Math.min(e+1,Y.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),U(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=Y[H];if(!t)return;D?Q(t):X(t)}else e.key===`Escape`&&(V(!1),U(-1))},[D,N,R,B,Y,H,Q,X,Z]);(0,a.useEffect)(()=>{H<0||!K.current||K.current.children[H]?.scrollIntoView({block:`nearest`})},[H]),(0,a.useEffect)(()=>{function e(e){let t=e.target;!W.current?.contains(t)&&!K.current?.contains(t)&&V(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let fe=D?void 0:i.value,pe=!!(!D&&v&&N.length>0&&!E),me=!!(D&&v&&(R.length>0||N.length>0)&&!E),he=n.o(B,W),$=(0,a.useCallback)(e=>{F(e.target.value),J(e.target.value),V(!0),U(-1)},[F]),ge=(0,a.useCallback)(()=>{V(!0),J(``)},[]);return te?(0,o.jsxs)(`div`,{ref:W,className:e.t(S,C),children:[(0,o.jsx)(`input`,{ref:s,id:A,value:N,onChange:$,placeholder:T,disabled:E}),B&&(0,o.jsx)(`ul`,{ref:K,id:j,className:w,children:Y.map(e=>(0,o.jsx)(`li`,{onClick:()=>D?Q(e):X(e),children:e.label},String(e.value)))})]}):(0,o.jsxs)(`div`,{ref:W,className:e.t(`relative`,t.o,C,S),children:[m&&(0,o.jsxs)(`label`,{htmlFor:A,className:`text-sm font-medium leading-5 text-foreground`,children:[m,O.required&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,o.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),!D&&(0,o.jsx)(d,{inputRef:s,inputId:A,listId:j,open:B,activeIdx:H,inputText:N,prefix:_,placeholder:T,disabled:E,error:g,loading:y,showClear:pe,onInputChange:$,onFocus:ge,onKeyDown:de,onClear:le,messageId:g||h?M:void 0,inputProps:k}),D&&(0,o.jsx)(f,{inputRef:e=>{G.current=e,typeof s==`function`?s(e):s&&(s.current=e)},inputId:A,listId:j,open:B,activeIdx:H,inputText:N,prefix:_,placeholder:T,disabled:E,error:g,loading:y,showClear:me,selected:R,onContainerClick:()=>{E||(G.current?.focus(),V(!0),J(``))},onInputChange:$,onFocus:ge,onKeyDown:de,onRemove:Z,onClearAll:ue,messageId:g||h?M:void 0,inputProps:k}),(0,o.jsx)(p,{listRef:K,listId:j,open:B,pos:he,multiple:D,loading:y,filtered:Y,emptyMessage:b,activeIdx:H,setActiveIdx:U,inputText:q,selectedValues:z,singleValue:fe,onSelectSingle:X,onToggleMulti:Q,className:w}),g&&(0,o.jsx)(`p`,{id:M,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:g}),h&&!g&&(0,o.jsx)(`p`,{id:M,className:`text-xs leading-5 text-muted-foreground`,children:h})]})}var h=(0,a.forwardRef)(m);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
1
|
+
const e=require("./cn-BdjraxxU.cjs"),t=require("./component-styles-DOUctc8_.cjs"),n=require("./utils-DOFJTw8o.cjs"),r=require("./use-event-callback-Du9_9eAi.cjs");let i=require("framer-motion"),a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom");var c=({size:e=12})=>(0,o.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,o.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),l=()=>(0,o.jsxs)(`svg`,{className:`animate-spin shrink-0 w-3.5 h-3.5 text-slate-500`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,o.jsx)(`circle`,{className:`opacity-20`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`}),(0,o.jsx)(`path`,{className:`opacity-70`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]});function u({text:e,query:t}){if(!t)return(0,o.jsx)(o.Fragment,{children:e});let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?(0,o.jsx)(o.Fragment,{children:e}):(0,o.jsxs)(o.Fragment,{children:[e.slice(0,n),(0,o.jsx)(`mark`,{className:`bg-blue-500/25 text-blue-700 dark:text-blue-200 rounded-sm not-italic`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function d({inputRef:n,inputId:r,listId:i,open:a,activeIdx:s,inputText:u,prefix:d,placeholder:f,disabled:p,error:m,loading:h,showClear:g,onInputChange:_,onFocus:v,onKeyDown:y,onClear:b,messageId:x,inputProps:S}){return(0,o.jsxs)(`div`,{className:e.t(`flex h-9 items-center gap-2 rounded-[var(--radius-md)] px-3`,t.t,m&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,p&&`opacity-50 cursor-not-allowed`),children:[d&&(0,o.jsx)(`span`,{className:`text-slate-500 shrink-0 text-sm`,children:d}),(0,o.jsx)(`input`,{...S,ref:n,id:r,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":a,"aria-controls":i,"aria-activedescendant":s>=0?`${i}-opt-${s}`:void 0,"aria-invalid":m?!0:void 0,"aria-describedby":x,autoComplete:`off`,value:u,onChange:_,onFocus:v,onKeyDown:y,placeholder:f,disabled:p,className:`flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed`}),h&&(0,o.jsx)(l,{}),g&&!h&&(0,o.jsx)(`button`,{type:`button`,onClick:b,className:`shrink-0 text-slate-500 hover:text-slate-600 dark:hover:text-slate-300 cursor-pointer transition-colors`,children:(0,o.jsx)(c,{})})]})}function f({inputRef:n,inputId:r,listId:i,open:a,activeIdx:s,inputText:u,prefix:d,placeholder:f,disabled:p,error:m,loading:h,showClear:g,selected:_,onContainerClick:v,onInputChange:y,onFocus:b,onKeyDown:x,onRemove:S,onClearAll:C,messageId:w,inputProps:T}){return(0,o.jsxs)(`div`,{onClick:v,className:e.t(`flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-[var(--radius-md)] px-2.5 py-1.5 cursor-text`,t.t,m&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,p&&`opacity-50 cursor-not-allowed`),children:[d&&(0,o.jsx)(`span`,{className:`text-slate-500 shrink-0 text-sm`,children:d}),_.map(e=>(0,o.jsxs)(`span`,{className:`inline-flex max-w-[200px] items-center gap-1 rounded-md border border-border bg-surface-muted px-2 py-0.5 text-xs font-medium text-foreground`,children:[e.icon&&(0,o.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:e.icon}),(0,o.jsx)(`span`,{className:`truncate`,children:e.label}),(0,o.jsx)(`button`,{type:`button`,tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:t=>{t.stopPropagation(),S(e)},disabled:p,className:`shrink-0 text-slate-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white transition-colors cursor-pointer ml-0.5`,"aria-label":`Remove ${e.label}`,children:(0,o.jsx)(c,{size:10})})]},String(e.value))),(0,o.jsx)(`input`,{...T,ref:n,id:r,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":a,"aria-controls":i,"aria-activedescendant":s>=0?`${i}-opt-${s}`:void 0,"aria-invalid":m?!0:void 0,"aria-describedby":w,autoComplete:`off`,value:u,onChange:y,onFocus:b,onKeyDown:x,placeholder:_.length===0?f:void 0,disabled:p,className:`flex-1 min-w-[80px] bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed py-0.5`}),(0,o.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 shrink-0`,children:[h&&(0,o.jsx)(l,{}),g&&!h&&(0,o.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation(),C()},className:`text-slate-500 hover:text-slate-600 dark:hover:text-slate-300 transition-colors`,"aria-label":`Clear all`,children:(0,o.jsx)(c,{})}),_.length>0&&(0,o.jsx)(`span`,{className:`text-[10px] font-medium text-slate-500 tabular-nums`,children:_.length})]})]})}function p({listRef:t,listId:n,open:r,pos:a,multiple:c,loading:d,filtered:f,emptyMessage:p,activeIdx:m,setActiveIdx:h,inputText:g,selectedValues:_,singleValue:v,onSelectSingle:y,onToggleMulti:b,className:x}){return typeof document>`u`?null:(0,s.createPortal)((0,o.jsx)(i.AnimatePresence,{children:r&&a&&(0,o.jsx)(i.motion.ul,{ref:t,id:n,role:`listbox`,"aria-multiselectable":c,initial:{opacity:0,y:a.placement===`bottom`?-4:4},animate:{opacity:1,y:0},exit:{opacity:0,y:a.placement===`bottom`?-4:4},transition:{duration:.13},style:{position:`fixed`,top:a.top,left:a.left,width:a.width,maxHeight:a.maxHeight},className:e.t(`z-[110] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-surface-raised py-1 shadow-floating`,x),children:d?(0,o.jsxs)(`li`,{className:`px-4 py-3 text-sm text-slate-600 flex items-center gap-2`,children:[(0,o.jsx)(l,{}),`Loading…`]}):f.length===0?(0,o.jsx)(`li`,{className:`px-4 py-3 text-sm text-slate-600`,children:p}):f.map((t,r)=>{let i=r===m,a=c?_.includes(t.value):t.value===v;return(0,o.jsxs)(`li`,{id:`${n}-opt-${r}`,role:`option`,"aria-selected":a,onMouseDown:e=>e.preventDefault(),onClick:()=>c?b(t):y(t),onMouseEnter:()=>h(r),className:e.t(`flex min-h-9 items-center gap-3 px-3 py-2 cursor-pointer transition-colors`,i&&`bg-surface-muted`,a&&!i&&`bg-accent-50 dark:bg-accent-500/10`),children:[t.icon&&(0,o.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:t.icon}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`p`,{className:e.t(`text-sm`,a?`text-accent-700 dark:text-accent-300 font-medium`:`text-foreground`),children:(0,o.jsx)(u,{text:t.label,query:g})}),t.description&&(0,o.jsx)(`p`,{className:`text-xs text-slate-500 mt-0.5 truncate`,children:t.description})]}),a&&(0,o.jsx)(`svg`,{"aria-hidden":`true`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-accent-600 shrink-0`,children:(0,o.jsx)(`path`,{d:`m20 6-11 11-5-5`})})]},String(t.value))})})}),document.body)}function m(i,s){let{options:c,inputValue:l,onInputChange:u,label:m,hint:h,error:g,prefix:_,clearable:v=!0,loading:y=!1,emptyMessage:b=`No results`,maxVisible:x=8,className:S,wrapperClassName:C,listClassName:w,placeholder:T,disabled:E,id:ee,multiple:D,unstyled:te=!1,...O}=i,{value:ne,onSelect:re,onDeselect:ie,...k}=O,ae=(0,a.useId)(),A=ee??ae,j=`${A}-list`,M=`${A}-message`,[oe,se]=(0,a.useState)(``),N=l===void 0?oe:l,P=r.t(e=>u?.(e)),F=(0,a.useCallback)(e=>{l===void 0?se(e):P(e)},[l,P]),[I,L]=(0,a.useState)([]),R=(0,a.useMemo)(()=>{if(!D)return[];let e=i;return e.value===void 0?I:c.filter(t=>e.value.includes(t.value))},[D,c,i,I]),z=(0,a.useMemo)(()=>R.map(e=>e.value),[R]),[B,V]=(0,a.useState)(!1),[H,U]=(0,a.useState)(-1),W=(0,a.useRef)(null),G=(0,a.useRef)(null),K=(0,a.useRef)(null),[q,J]=(0,a.useState)(``),Y=(0,a.useMemo)(()=>{let e=q.trim().toLowerCase();return c.filter(t=>!t.disabled&&t.label.toLowerCase().includes(e)).slice(0,x)},[c,q,x]),X=(0,a.useCallback)(e=>{i.onSelect?.(e),F(e.label),V(!1),U(-1)},[i,F]),ce=(0,a.useCallback)(e=>{let t=i,n=[...R,e];t.value===void 0&&L(n),t.onSelect?.(e,n),F(``),U(-1),G.current?.focus()},[R,i,F]),Z=(0,a.useCallback)(e=>{let t=i,n=R.filter(t=>t.value!==e.value);t.value===void 0&&L(n),t.onDeselect?.(e,n)},[R,i]),Q=(0,a.useCallback)(e=>{z.includes(e.value)?Z(e):ce(e)},[z,Z,ce]),le=(0,a.useCallback)(()=>{F(``),i.onSelect?.({value:``,label:``}),V(!1)},[i,F]),ue=(0,a.useCallback)(()=>{i.value===void 0&&L([]),F(``)},[i,F]),de=(0,a.useCallback)(e=>{if(D&&e.key===`Backspace`&&N===``&&R.length>0){Z(R[R.length-1]);return}if(!B){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(V(!0),J(``));return}if(e.key===`ArrowDown`)e.preventDefault(),U(e=>Math.min(e+1,Y.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),U(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=Y[H];if(!t)return;D?Q(t):X(t)}else e.key===`Escape`&&(V(!1),U(-1))},[D,N,R,B,Y,H,Q,X,Z]);(0,a.useEffect)(()=>{H<0||!K.current||K.current.children[H]?.scrollIntoView({block:`nearest`})},[H]),(0,a.useEffect)(()=>{function e(e){let t=e.target;!W.current?.contains(t)&&!K.current?.contains(t)&&V(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let fe=D?void 0:i.value,pe=!!(!D&&v&&N.length>0&&!E),me=!!(D&&v&&(R.length>0||N.length>0)&&!E),he=n.o(B,W),$=(0,a.useCallback)(e=>{F(e.target.value),J(e.target.value),V(!0),U(-1)},[F]),ge=(0,a.useCallback)(()=>{V(!0),J(``)},[]);return te?(0,o.jsxs)(`div`,{ref:W,className:e.t(S,C),children:[(0,o.jsx)(`input`,{ref:s,id:A,value:N,onChange:$,placeholder:T,disabled:E}),B&&(0,o.jsx)(`ul`,{ref:K,id:j,className:w,children:Y.map(e=>(0,o.jsx)(`li`,{onClick:()=>D?Q(e):X(e),children:e.label},String(e.value)))})]}):(0,o.jsxs)(`div`,{ref:W,className:e.t(`relative`,t.o,C,S),children:[m&&(0,o.jsxs)(`label`,{htmlFor:A,className:`text-xs font-semibold leading-5 text-foreground`,children:[m,O.required&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,o.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),!D&&(0,o.jsx)(d,{inputRef:s,inputId:A,listId:j,open:B,activeIdx:H,inputText:N,prefix:_,placeholder:T,disabled:E,error:g,loading:y,showClear:pe,onInputChange:$,onFocus:ge,onKeyDown:de,onClear:le,messageId:g||h?M:void 0,inputProps:k}),D&&(0,o.jsx)(f,{inputRef:e=>{G.current=e,typeof s==`function`?s(e):s&&(s.current=e)},inputId:A,listId:j,open:B,activeIdx:H,inputText:N,prefix:_,placeholder:T,disabled:E,error:g,loading:y,showClear:me,selected:R,onContainerClick:()=>{E||(G.current?.focus(),V(!0),J(``))},onInputChange:$,onFocus:ge,onKeyDown:de,onRemove:Z,onClearAll:ue,messageId:g||h?M:void 0,inputProps:k}),(0,o.jsx)(p,{listRef:K,listId:j,open:B,pos:he,multiple:D,loading:y,filtered:Y,emptyMessage:b,activeIdx:H,setActiveIdx:U,inputText:q,selectedValues:z,singleValue:fe,onSelectSingle:X,onToggleMulti:Q,className:w}),g&&(0,o.jsx)(`p`,{id:M,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:g}),h&&!g&&(0,o.jsx)(`p`,{id:M,className:`text-xs leading-5 text-muted-foreground`,children:h})]})}var h=(0,a.forwardRef)(m);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./cn-BdjraxxU.cjs"),t=require("./component-styles-TkZ7v6Ef.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],o=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],s=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],c={blue:`bg-blue-500/12 text-blue-400 border-blue-500/20`,green:`bg-emerald-500/12 text-emerald-400 border-emerald-500/20`,red:`bg-red-500/12 text-red-400 border-red-500/20`,yellow:`bg-amber-500/12 text-amber-400 border-amber-500/20`,purple:`bg-violet-500/12 text-violet-400 border-violet-500/20`,orange:`bg-orange-500/12 text-orange-400 border-orange-500/20`};function l(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function u(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function d(e){let t=new Date(e);return t.setDate(t.getDate()-t.getDay()),t}var f={enter:e=>({opacity:0,x:e*16}),center:{opacity:1,x:0},exit:e=>({opacity:0,x:e*-16})};function p({viewDate:t,today:n,value:r,events:o,onSelect:s,onEventClick:u,isDateDisabled:d,onEventCreate:f,onEventDelete:p,editingId:m,onEditToggle:h,onUpdateTitle:g}){let _=t.getFullYear(),v=t.getMonth(),y=new Date(_,v+1,0).getDate(),b=new Date(_,v,1).getDay(),x=[...Array(b).fill(null),...Array.from({length:y},(e,t)=>new Date(_,v,t+1))];for(;x.length%7!=0;)x.push(null);function S(e){return o.filter(t=>l(t.date,e))}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{role:`row`,className:`grid grid-cols-7 border-b border-border`,children:a.map(e=>(0,i.jsx)(`div`,{role:`columnheader`,className:`py-2.5 text-center text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e},e))}),(0,i.jsx)(`div`,{role:`grid`,className:`grid grid-cols-7`,style:{gridTemplateRows:`repeat(${x.length/7}, minmax(80px, 1fr))`},children:x.map((t,a)=>{let o=a%7==6,h=a>=x.length-7;if(!t)return(0,i.jsx)(`div`,{role:`gridcell`,className:e.t(`border-black/6 dark:border-white/6 bg-black/[0.015] dark:bg-white/[0.015]`,!o&&`border-r`,!h&&`border-b`)},`e${a}`);let g=S(t),_=n?l(t,n):!1,y=r?l(t,r):!1,b=t.getMonth()===v,C=d?.(t)??!1;return(0,i.jsxs)(`div`,{role:`gridcell`,tabIndex:C?void 0:0,"aria-label":t.toLocaleDateString(void 0,{dateStyle:`full`}),"aria-disabled":C||void 0,"aria-selected":y,onClick:()=>!C&&s(t),onKeyDown:e=>{!C&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`p-1.5 transition-colors group/cell`,`border-border focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring/35`,!o&&`border-r`,!h&&`border-b`,!b&&`bg-black/[0.015] dark:bg-white/[0.015]`,C?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted`),children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,i.jsx)(`span`,{className:e.t(`w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium`,y?`bg-primary text-primary-foreground`:_?`border border-accent-500/50 text-accent-600 dark:text-accent-300`:b?`text-slate-700 dark:text-slate-200`:`text-slate-400 dark:text-slate-600`),children:t.getDate()}),f&&!C&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Add event on ${t.toLocaleDateString()}`,onClick:e=>{e.stopPropagation(),f(t)},className:`opacity-0 group-hover/cell:opacity-100 focus:opacity-100 w-5 h-5 rounded-md bg-primary text-primary-foreground flex items-center justify-center text-[10px] hover:bg-primary-hover transition-opacity`,children:`+`})]}),(0,i.jsxs)(`div`,{className:`space-y-0.5`,children:[g.slice(0,2).map(t=>{let n=m===t.id;return(0,i.jsxs)(`div`,{className:e.t(`group/ev flex items-center gap-0.5 rounded border px-1 py-0.5`,c[t.color??`blue`],n&&`ring-1 ring-focus-ring`),children:[(0,i.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u?.(t)},className:`min-w-0 flex-1 truncate text-left text-[10px] font-medium`,children:[t.time&&(0,i.jsx)(`span`,{className:`opacity-60 mr-1`,children:t.time}),t.title]}),p&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Delete ${t.title}`,onClick:e=>{e.stopPropagation(),p(t.id)},className:`flex size-4 shrink-0 items-center justify-center rounded text-[10px] leading-none opacity-60 hover:bg-muted hover:opacity-100`,children:`×`})]},t.id)}),g.length>2&&(0,i.jsxs)(`p`,{className:`text-[10px] text-slate-500 px-1`,children:[`+`,g.length-2,` more`]})]})]},t.toISOString())})})]})}function m({viewDate:t,today:n,value:r,events:a,onSelect:s,onEventClick:f,isDateDisabled:p,onEventCreate:m,onEventDelete:h,editingId:g,onEditToggle:_,onUpdateTitle:v}){let y=d(t),b=Array.from({length:7},(e,t)=>u(y,t));function x(e){return a.filter(t=>l(t.date,e))}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{role:`row`,className:`grid grid-cols-7 border-b border-border`,children:b.map(t=>{let a=n?l(t,n):!1,c=r?l(t,r):!1,u=p?.(t)??!1;return(0,i.jsxs)(`div`,{role:`gridcell`,tabIndex:u?void 0:0,"aria-selected":c,"aria-disabled":u||void 0,"aria-label":t.toLocaleDateString(void 0,{dateStyle:`full`}),onClick:()=>!u&&s(t),onKeyDown:e=>{!u&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`group/whead flex flex-col items-center gap-1 py-3 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring/35`,u?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted`),children:[(0,i.jsx)(`span`,{className:`text-[10px] font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wide`,children:o[t.getDay()]}),(0,i.jsx)(`span`,{className:e.t(`w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold transition-colors`,c?`bg-primary text-primary-foreground`:a?`border border-accent-500/50 text-accent-600 dark:text-accent-300`:`text-slate-700 dark:text-slate-200`),children:t.getDate()}),m&&!u&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Add event on ${t.toLocaleDateString()}`,onClick:e=>{e.stopPropagation(),m(t)},className:`opacity-0 group-hover/whead:opacity-100 focus:opacity-100 h-5 px-1.5 rounded-md bg-primary text-primary-foreground text-[10px] hover:bg-primary-hover`,children:`+ Add`})]},t.toISOString())})}),(0,i.jsx)(`div`,{className:`grid grid-cols-7 min-h-[200px]`,children:b.map((t,n)=>{let r=x(t),a=n===6,o=p?.(t)??!1;return(0,i.jsx)(`div`,{role:`gridcell`,tabIndex:o?void 0:0,"aria-disabled":o||void 0,"aria-label":`${t.toLocaleDateString(void 0,{dateStyle:`full`})} events`,onClick:()=>!o&&s(t),onKeyDown:e=>{!o&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`space-y-1.5 p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring/35`,!a&&`border-r border-border`,o?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted/70`),children:r.map(t=>(0,i.jsxs)(`div`,{className:e.t(`group/wev flex items-start gap-1 rounded-[var(--radius-md)] border px-2 py-1.5`,c[t.color??`blue`],g===t.id&&`ring-1 ring-focus-ring`),children:[(0,i.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f?.(t)},className:`min-w-0 flex-1 text-left`,children:[t.time&&(0,i.jsx)(`div`,{className:`text-[10px] opacity-60 mb-0.5`,children:t.time}),(0,i.jsx)(`div`,{className:`text-xs font-medium truncate`,children:t.title})]}),h&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Delete ${t.title}`,onClick:e=>{e.stopPropagation(),h(t.id)},className:`flex size-5 shrink-0 items-center justify-center rounded text-xs opacity-60 hover:bg-muted hover:opacity-100`,children:`×`})]},t.id))},t.toISOString())})})]})}function h({value:a,defaultValue:o=null,onChange:c,events:l,defaultEvents:h=[],onEventsChange:g,onEventClick:_,onEventCreate:v,onEventUpdate:y,onEventDelete:b,editable:x=!1,view:S,defaultView:C=`month`,onViewChange:ee,viewDate:w,defaultViewDate:T,onViewDateChange:te,minDate:E,maxDate:D,disabledDates:O,className:ne}){let[re,ie]=(0,r.useState)(null),[ae,oe]=(0,r.useState)(o),[se,ce]=(0,r.useState)(C),[k,A]=(0,r.useState)(T??null),[le,ue]=(0,r.useState)(()=>l??h),[j,M]=(0,r.useState)(1),[N,P]=(0,r.useState)(null),[F,I]=(0,r.useState)(``),[L,de]=(0,r.useState)(`blue`),[R,z]=(0,r.useState)(`09:00`),[B,V]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=new Date;ie(e),T===void 0&&w===void 0&&A(new Date(e.getFullYear(),e.getMonth(),1))},[]),(0,r.useEffect)(()=>{w===void 0&&T!==void 0&&k===null&&A(T?new Date(T):null)},[T]);let fe=a===void 0?ae:a,H=S===void 0?se:S,U=w===void 0?k:w,W=l!==void 0,G=W?l:le;function K(e){return!!(E&&e<new Date(E.getFullYear(),E.getMonth(),E.getDate())||D&&e>new Date(D.getFullYear(),D.getMonth(),D.getDate(),23,59,59,999)||O?.(e))}function pe(e){S===void 0&&ce(e),ee?.(e)}function q(e){e!==null&&(w===void 0&&A(e),te?.(e))}function J(e){K(e)||(a===void 0&&oe(e),c?.(e))}function me(e){return e&&(H===`month`?new Date(e.getFullYear(),e.getMonth()-1,1):u(e,-7))}function he(e){return e&&(H===`month`?new Date(e.getFullYear(),e.getMonth()+1,1):u(e,7))}function ge(){M(-1),q(me(U))}function _e(){M(1),q(he(U))}function ve(){let e=new Date;M(0),q(new Date(e.getFullYear(),e.getMonth(),1)),J(e)}function Y(e){W||ue(e),g?.(e)}function X(e,t){if(K(e))return;let n={id:typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():String(Date.now()+Math.random()),title:t?.trim()||F.trim()||`New event`,date:new Date(e),color:L,time:R||void 0};Y([...G,n]),v?.(n),P(null),I(``),z(`09:00`)}function Z(e){Y(G.filter(t=>t.id!==e)),b?.(e),B===e&&V(null)}function Q(e){Y(G.map(t=>t.id===e.id?e:t)),y?.(e),V(null)}function ye(e){x&&V(t=>t===e.id?null:e.id),_?.(e)}let $=``;if(U){if(H===`month`)$=`${s[U.getMonth()]} ${U.getFullYear()}`;else{let e=d(U),t=u(e,6);$=e.getMonth()===t.getMonth()?`${s[e.getMonth()].slice(0,3)} ${e.getDate()} \u2013 ${t.getDate()}, ${e.getFullYear()}`:`${s[e.getMonth()].slice(0,3)} ${e.getDate()} \u2013 ${s[t.getMonth()].slice(0,3)} ${t.getDate()}, ${e.getFullYear()}`}}let be=x||!!v||!!y||!!b||!!g,xe={today:re,value:fe,events:G,onSelect:J,onEventClick:ye,onEventCreate:be?e=>P(e):void 0,onEventDelete:be||b?Z:void 0,onEventUpdate:y,editingId:B,onEditToggle:e=>V(t=>t===e?null:e),onUpdateTitle:(e,t)=>{let n=G.find(t=>t.id===e);n&&Q({...n,title:t})},minDate:E,maxDate:D,disabledDates:O,isDateDisabled:K},Se=U?`${H}-${U.toISOString()}`:null;return(0,i.jsxs)(`div`,{className:e.t(`flex flex-col overflow-hidden rounded-[var(--radius-lg)] border border-border bg-surface`,ne),children:[(0,i.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-border px-3 py-3 sm:px-4`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:ge,"aria-label":`Previous ${H}`,className:e.t(t.c,`size-8`),children:(0,i.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m15 18-6-6 6-6`})})}),(0,i.jsx)(`button`,{type:`button`,onClick:_e,"aria-label":`Next ${H}`,className:e.t(t.c,`size-8`),children:(0,i.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m9 18 6-6-6-6`})})})]}),(0,i.jsx)(`span`,{"aria-live":`polite`,className:`min-w-[9rem] flex-1 select-none text-sm font-semibold text-foreground`,children:$}),(0,i.jsx)(`button`,{type:`button`,onClick:ve,className:e.t(`h-8 rounded-[var(--radius-md)] border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:border-border-strong hover:bg-muted hover:text-foreground`,t.s),children:`Today`}),(0,i.jsx)(`div`,{role:`group`,"aria-label":`Calendar view`,className:`flex overflow-hidden rounded-[var(--radius-md)] border border-border`,children:[`month`,`week`].map(n=>(0,i.jsx)(`button`,{type:`button`,onClick:()=>pe(n),"aria-pressed":H===n,className:e.t(`h-8 px-3 text-xs capitalize transition-colors focus-visible:z-10`,t.s,H===n?`bg-muted text-foreground font-medium`:`text-muted-foreground hover:bg-surface-muted hover:text-foreground`),children:n},n))})]}),N&&(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border bg-warning/8 px-3 py-3 sm:px-4`,children:[(0,i.jsxs)(`span`,{className:`text-xs font-medium text-foreground`,children:[`New event on `,N.toLocaleDateString(),`:`]}),(0,i.jsx)(`input`,{autoFocus:!0,value:F,onChange:e=>I(e.target.value),onKeyDown:e=>{e.key===`Enter`&&X(N),e.key===`Escape`&&(P(null),I(``),z(`09:00`))},placeholder:`Event title`,className:`h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25`}),(0,i.jsx)(`input`,{type:`time`,value:R,onChange:e=>z(e.target.value),className:`h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25`}),(0,i.jsxs)(`select`,{"aria-label":`Event color`,value:L,onChange:e=>de(e.target.value),className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2 text-xs text-foreground`,children:[(0,i.jsx)(`option`,{value:`blue`,children:`Blue`}),(0,i.jsx)(`option`,{value:`green`,children:`Green`}),(0,i.jsx)(`option`,{value:`red`,children:`Red`}),(0,i.jsx)(`option`,{value:`yellow`,children:`Yellow`}),(0,i.jsx)(`option`,{value:`purple`,children:`Purple`}),(0,i.jsx)(`option`,{value:`orange`,children:`Orange`})]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>X(N),className:`h-7 px-3 rounded-md bg-primary text-xs font-medium text-primary-foreground hover:bg-primary-hover`,children:`Add`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>{P(null),I(``),z(`09:00`)},className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:`Cancel`})]}),B&&(()=>{let e=G.find(e=>e.id===B);return e?(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border bg-surface-muted px-3 py-3 sm:px-4`,children:[(0,i.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Edit event:`}),(0,i.jsx)(`input`,{autoFocus:!0,defaultValue:e.title,onKeyDown:t=>{if(t.key===`Enter`){let n=t.target.value,r=document.getElementById(`cal-edit-time-${e.id}`)?.value??e.time??``;n.trim()&&Q({...e,title:n.trim(),time:r||void 0})}t.key===`Escape`&&V(null)},id:`cal-edit-${e.id}`,placeholder:`Title`,className:`h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25`}),(0,i.jsx)(`input`,{type:`time`,defaultValue:e.time??``,id:`cal-edit-time-${e.id}`,className:`h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>{let t=document.getElementById(`cal-edit-${e.id}`),n=document.getElementById(`cal-edit-time-${e.id}`),r=t?.value??e.title,i=n?.value??``;r.trim()&&Q({...e,title:r.trim(),time:i||void 0})},className:`h-7 px-3 rounded-md bg-primary text-xs font-medium text-primary-foreground hover:bg-primary-hover`,children:`Save`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>Z(e.id),className:`h-7 rounded-[var(--radius-md)] bg-destructive px-2.5 text-xs font-medium text-destructive-foreground hover:bg-destructive-hover`,children:`Delete`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>V(null),className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:`Cancel`})]}):null})(),(0,i.jsx)(`div`,{className:`relative flex-1 overflow-x-auto`,children:(0,i.jsx)(`div`,{className:`min-w-[42rem]`,children:(0,i.jsx)(n.AnimatePresence,{mode:`popLayout`,initial:!1,custom:j,children:Se!==null&&U!==null&&(0,i.jsx)(n.motion.div,{custom:j,variants:f,initial:`enter`,animate:`center`,exit:`exit`,transition:{duration:.18,ease:`easeInOut`},children:H===`month`?(0,i.jsx)(p,{viewDate:U,...xe}):(0,i.jsx)(m,{viewDate:U,...xe})},Se)})})})]})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
1
|
+
const e=require("./cn-BdjraxxU.cjs"),t=require("./component-styles-DOUctc8_.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],o=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],s=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],c={blue:`bg-blue-500/12 text-blue-400 border-blue-500/20`,green:`bg-emerald-500/12 text-emerald-400 border-emerald-500/20`,red:`bg-red-500/12 text-red-400 border-red-500/20`,yellow:`bg-amber-500/12 text-amber-400 border-amber-500/20`,purple:`bg-violet-500/12 text-violet-400 border-violet-500/20`,orange:`bg-orange-500/12 text-orange-400 border-orange-500/20`};function l(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function u(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function d(e){let t=new Date(e);return t.setDate(t.getDate()-t.getDay()),t}var f={enter:e=>({opacity:0,x:e*16}),center:{opacity:1,x:0},exit:e=>({opacity:0,x:e*-16})};function p({viewDate:t,today:n,value:r,events:o,onSelect:s,onEventClick:u,isDateDisabled:d,onEventCreate:f,onEventDelete:p,editingId:m,onEditToggle:h,onUpdateTitle:g}){let _=t.getFullYear(),v=t.getMonth(),y=new Date(_,v+1,0).getDate(),b=new Date(_,v,1).getDay(),x=[...Array(b).fill(null),...Array.from({length:y},(e,t)=>new Date(_,v,t+1))];for(;x.length%7!=0;)x.push(null);function S(e){return o.filter(t=>l(t.date,e))}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{role:`row`,className:`grid grid-cols-7 border-b border-border`,children:a.map(e=>(0,i.jsx)(`div`,{role:`columnheader`,className:`py-2.5 text-center text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e},e))}),(0,i.jsx)(`div`,{role:`grid`,className:`grid grid-cols-7`,style:{gridTemplateRows:`repeat(${x.length/7}, minmax(80px, 1fr))`},children:x.map((t,a)=>{let o=a%7==6,h=a>=x.length-7;if(!t)return(0,i.jsx)(`div`,{role:`gridcell`,className:e.t(`border-black/6 dark:border-white/6 bg-black/[0.015] dark:bg-white/[0.015]`,!o&&`border-r`,!h&&`border-b`)},`e${a}`);let g=S(t),_=n?l(t,n):!1,y=r?l(t,r):!1,b=t.getMonth()===v,C=d?.(t)??!1;return(0,i.jsxs)(`div`,{role:`gridcell`,tabIndex:C?void 0:0,"aria-label":t.toLocaleDateString(void 0,{dateStyle:`full`}),"aria-disabled":C||void 0,"aria-selected":y,onClick:()=>!C&&s(t),onKeyDown:e=>{!C&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`p-1.5 transition-colors group/cell`,`border-border focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring/35`,!o&&`border-r`,!h&&`border-b`,!b&&`bg-black/[0.015] dark:bg-white/[0.015]`,C?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted`),children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,i.jsx)(`span`,{className:e.t(`w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium`,y?`bg-primary text-primary-foreground`:_?`border border-accent-500/50 text-accent-600 dark:text-accent-300`:b?`text-slate-700 dark:text-slate-200`:`text-slate-400 dark:text-slate-600`),children:t.getDate()}),f&&!C&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Add event on ${t.toLocaleDateString()}`,onClick:e=>{e.stopPropagation(),f(t)},className:`opacity-0 group-hover/cell:opacity-100 focus:opacity-100 w-5 h-5 rounded-md bg-primary text-primary-foreground flex items-center justify-center text-[10px] hover:bg-primary-hover transition-opacity`,children:`+`})]}),(0,i.jsxs)(`div`,{className:`space-y-0.5`,children:[g.slice(0,2).map(t=>{let n=m===t.id;return(0,i.jsxs)(`div`,{className:e.t(`group/ev flex items-center gap-0.5 rounded border px-1 py-0.5`,c[t.color??`blue`],n&&`ring-1 ring-focus-ring`),children:[(0,i.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u?.(t)},className:`min-w-0 flex-1 truncate text-left text-[10px] font-medium`,children:[t.time&&(0,i.jsx)(`span`,{className:`opacity-60 mr-1`,children:t.time}),t.title]}),p&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Delete ${t.title}`,onClick:e=>{e.stopPropagation(),p(t.id)},className:`flex size-4 shrink-0 items-center justify-center rounded text-[10px] leading-none opacity-60 hover:bg-muted hover:opacity-100`,children:`×`})]},t.id)}),g.length>2&&(0,i.jsxs)(`p`,{className:`text-[10px] text-slate-500 px-1`,children:[`+`,g.length-2,` more`]})]})]},t.toISOString())})})]})}function m({viewDate:t,today:n,value:r,events:a,onSelect:s,onEventClick:f,isDateDisabled:p,onEventCreate:m,onEventDelete:h,editingId:g,onEditToggle:_,onUpdateTitle:v}){let y=d(t),b=Array.from({length:7},(e,t)=>u(y,t));function x(e){return a.filter(t=>l(t.date,e))}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{role:`row`,className:`grid grid-cols-7 border-b border-border`,children:b.map(t=>{let a=n?l(t,n):!1,c=r?l(t,r):!1,u=p?.(t)??!1;return(0,i.jsxs)(`div`,{role:`gridcell`,tabIndex:u?void 0:0,"aria-selected":c,"aria-disabled":u||void 0,"aria-label":t.toLocaleDateString(void 0,{dateStyle:`full`}),onClick:()=>!u&&s(t),onKeyDown:e=>{!u&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`group/whead flex flex-col items-center gap-1 py-3 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring/35`,u?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted`),children:[(0,i.jsx)(`span`,{className:`text-[10px] font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wide`,children:o[t.getDay()]}),(0,i.jsx)(`span`,{className:e.t(`w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold transition-colors`,c?`bg-primary text-primary-foreground`:a?`border border-accent-500/50 text-accent-600 dark:text-accent-300`:`text-slate-700 dark:text-slate-200`),children:t.getDate()}),m&&!u&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Add event on ${t.toLocaleDateString()}`,onClick:e=>{e.stopPropagation(),m(t)},className:`opacity-0 group-hover/whead:opacity-100 focus:opacity-100 h-5 px-1.5 rounded-md bg-primary text-primary-foreground text-[10px] hover:bg-primary-hover`,children:`+ Add`})]},t.toISOString())})}),(0,i.jsx)(`div`,{className:`grid grid-cols-7 min-h-[200px]`,children:b.map((t,n)=>{let r=x(t),a=n===6,o=p?.(t)??!1;return(0,i.jsx)(`div`,{role:`gridcell`,tabIndex:o?void 0:0,"aria-disabled":o||void 0,"aria-label":`${t.toLocaleDateString(void 0,{dateStyle:`full`})} events`,onClick:()=>!o&&s(t),onKeyDown:e=>{!o&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`space-y-1.5 p-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring/35`,!a&&`border-r border-border`,o?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted/70`),children:r.map(t=>(0,i.jsxs)(`div`,{className:e.t(`group/wev flex items-start gap-1 rounded-[var(--radius-md)] border px-2 py-1.5`,c[t.color??`blue`],g===t.id&&`ring-1 ring-focus-ring`),children:[(0,i.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f?.(t)},className:`min-w-0 flex-1 text-left`,children:[t.time&&(0,i.jsx)(`div`,{className:`text-[10px] opacity-60 mb-0.5`,children:t.time}),(0,i.jsx)(`div`,{className:`text-xs font-medium truncate`,children:t.title})]}),h&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Delete ${t.title}`,onClick:e=>{e.stopPropagation(),h(t.id)},className:`flex size-5 shrink-0 items-center justify-center rounded text-xs opacity-60 hover:bg-muted hover:opacity-100`,children:`×`})]},t.id))},t.toISOString())})})]})}function h({value:a,defaultValue:o=null,onChange:c,events:l,defaultEvents:h=[],onEventsChange:g,onEventClick:_,onEventCreate:v,onEventUpdate:y,onEventDelete:b,editable:x=!1,view:S,defaultView:C=`month`,onViewChange:ee,viewDate:w,defaultViewDate:T,onViewDateChange:te,minDate:E,maxDate:D,disabledDates:O,className:ne}){let[re,ie]=(0,r.useState)(null),[ae,oe]=(0,r.useState)(o),[se,ce]=(0,r.useState)(C),[k,A]=(0,r.useState)(T??null),[le,ue]=(0,r.useState)(()=>l??h),[j,M]=(0,r.useState)(1),[N,P]=(0,r.useState)(null),[F,I]=(0,r.useState)(``),[L,de]=(0,r.useState)(`blue`),[R,z]=(0,r.useState)(`09:00`),[B,V]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=new Date;ie(e),T===void 0&&w===void 0&&A(new Date(e.getFullYear(),e.getMonth(),1))},[]),(0,r.useEffect)(()=>{w===void 0&&T!==void 0&&k===null&&A(T?new Date(T):null)},[T]);let fe=a===void 0?ae:a,H=S===void 0?se:S,U=w===void 0?k:w,W=l!==void 0,G=W?l:le;function K(e){return!!(E&&e<new Date(E.getFullYear(),E.getMonth(),E.getDate())||D&&e>new Date(D.getFullYear(),D.getMonth(),D.getDate(),23,59,59,999)||O?.(e))}function pe(e){S===void 0&&ce(e),ee?.(e)}function q(e){e!==null&&(w===void 0&&A(e),te?.(e))}function J(e){K(e)||(a===void 0&&oe(e),c?.(e))}function me(e){return e&&(H===`month`?new Date(e.getFullYear(),e.getMonth()-1,1):u(e,-7))}function he(e){return e&&(H===`month`?new Date(e.getFullYear(),e.getMonth()+1,1):u(e,7))}function ge(){M(-1),q(me(U))}function _e(){M(1),q(he(U))}function ve(){let e=new Date;M(0),q(new Date(e.getFullYear(),e.getMonth(),1)),J(e)}function Y(e){W||ue(e),g?.(e)}function X(e,t){if(K(e))return;let n={id:typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():String(Date.now()+Math.random()),title:t?.trim()||F.trim()||`New event`,date:new Date(e),color:L,time:R||void 0};Y([...G,n]),v?.(n),P(null),I(``),z(`09:00`)}function Z(e){Y(G.filter(t=>t.id!==e)),b?.(e),B===e&&V(null)}function Q(e){Y(G.map(t=>t.id===e.id?e:t)),y?.(e),V(null)}function ye(e){x&&V(t=>t===e.id?null:e.id),_?.(e)}let $=``;if(U){if(H===`month`)$=`${s[U.getMonth()]} ${U.getFullYear()}`;else{let e=d(U),t=u(e,6);$=e.getMonth()===t.getMonth()?`${s[e.getMonth()].slice(0,3)} ${e.getDate()} \u2013 ${t.getDate()}, ${e.getFullYear()}`:`${s[e.getMonth()].slice(0,3)} ${e.getDate()} \u2013 ${s[t.getMonth()].slice(0,3)} ${t.getDate()}, ${e.getFullYear()}`}}let be=x||!!v||!!y||!!b||!!g,xe={today:re,value:fe,events:G,onSelect:J,onEventClick:ye,onEventCreate:be?e=>P(e):void 0,onEventDelete:be||b?Z:void 0,onEventUpdate:y,editingId:B,onEditToggle:e=>V(t=>t===e?null:e),onUpdateTitle:(e,t)=>{let n=G.find(t=>t.id===e);n&&Q({...n,title:t})},minDate:E,maxDate:D,disabledDates:O,isDateDisabled:K},Se=U?`${H}-${U.toISOString()}`:null;return(0,i.jsxs)(`div`,{className:e.t(`flex flex-col overflow-hidden rounded-[var(--radius-lg)] border border-border bg-surface`,ne),children:[(0,i.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-border px-3 py-3 sm:px-4`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:ge,"aria-label":`Previous ${H}`,className:e.t(t.c,`size-8`),children:(0,i.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m15 18-6-6 6-6`})})}),(0,i.jsx)(`button`,{type:`button`,onClick:_e,"aria-label":`Next ${H}`,className:e.t(t.c,`size-8`),children:(0,i.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m9 18 6-6-6-6`})})})]}),(0,i.jsx)(`span`,{"aria-live":`polite`,className:`min-w-[9rem] flex-1 select-none text-sm font-semibold text-foreground`,children:$}),(0,i.jsx)(`button`,{type:`button`,onClick:ve,className:e.t(`h-8 rounded-[var(--radius-md)] border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:border-border-strong hover:bg-muted hover:text-foreground`,t.s),children:`Today`}),(0,i.jsx)(`div`,{role:`group`,"aria-label":`Calendar view`,className:`flex overflow-hidden rounded-[var(--radius-md)] border border-border`,children:[`month`,`week`].map(n=>(0,i.jsx)(`button`,{type:`button`,onClick:()=>pe(n),"aria-pressed":H===n,className:e.t(`h-8 px-3 text-xs capitalize transition-colors focus-visible:z-10`,t.s,H===n?`bg-muted text-foreground font-medium`:`text-muted-foreground hover:bg-surface-muted hover:text-foreground`),children:n},n))})]}),N&&(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border bg-warning/8 px-3 py-3 sm:px-4`,children:[(0,i.jsxs)(`span`,{className:`text-xs font-medium text-foreground`,children:[`New event on `,N.toLocaleDateString(),`:`]}),(0,i.jsx)(`input`,{autoFocus:!0,value:F,onChange:e=>I(e.target.value),onKeyDown:e=>{e.key===`Enter`&&X(N),e.key===`Escape`&&(P(null),I(``),z(`09:00`))},placeholder:`Event title`,className:`h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25`}),(0,i.jsx)(`input`,{type:`time`,value:R,onChange:e=>z(e.target.value),className:`h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25`}),(0,i.jsxs)(`select`,{"aria-label":`Event color`,value:L,onChange:e=>de(e.target.value),className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2 text-xs text-foreground`,children:[(0,i.jsx)(`option`,{value:`blue`,children:`Blue`}),(0,i.jsx)(`option`,{value:`green`,children:`Green`}),(0,i.jsx)(`option`,{value:`red`,children:`Red`}),(0,i.jsx)(`option`,{value:`yellow`,children:`Yellow`}),(0,i.jsx)(`option`,{value:`purple`,children:`Purple`}),(0,i.jsx)(`option`,{value:`orange`,children:`Orange`})]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>X(N),className:`h-7 px-3 rounded-md bg-primary text-xs font-medium text-primary-foreground hover:bg-primary-hover`,children:`Add`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>{P(null),I(``),z(`09:00`)},className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:`Cancel`})]}),B&&(()=>{let e=G.find(e=>e.id===B);return e?(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border bg-surface-muted px-3 py-3 sm:px-4`,children:[(0,i.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Edit event:`}),(0,i.jsx)(`input`,{autoFocus:!0,defaultValue:e.title,onKeyDown:t=>{if(t.key===`Enter`){let n=t.target.value,r=document.getElementById(`cal-edit-time-${e.id}`)?.value??e.time??``;n.trim()&&Q({...e,title:n.trim(),time:r||void 0})}t.key===`Escape`&&V(null)},id:`cal-edit-${e.id}`,placeholder:`Title`,className:`h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25`}),(0,i.jsx)(`input`,{type:`time`,defaultValue:e.time??``,id:`cal-edit-time-${e.id}`,className:`h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-focus-ring/25`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>{let t=document.getElementById(`cal-edit-${e.id}`),n=document.getElementById(`cal-edit-time-${e.id}`),r=t?.value??e.title,i=n?.value??``;r.trim()&&Q({...e,title:r.trim(),time:i||void 0})},className:`h-7 px-3 rounded-md bg-primary text-xs font-medium text-primary-foreground hover:bg-primary-hover`,children:`Save`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>Z(e.id),className:`h-7 rounded-[var(--radius-md)] bg-destructive px-2.5 text-xs font-medium text-destructive-foreground hover:bg-destructive-hover`,children:`Delete`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>V(null),className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:`Cancel`})]}):null})(),(0,i.jsx)(`div`,{className:`relative flex-1 overflow-x-auto`,children:(0,i.jsx)(`div`,{className:`min-w-[42rem]`,children:(0,i.jsx)(n.AnimatePresence,{mode:`popLayout`,initial:!1,custom:j,children:Se!==null&&U!==null&&(0,i.jsx)(n.motion.div,{custom:j,variants:f,initial:`enter`,animate:`center`,exit:`exit`,transition:{duration:.18,ease:`easeInOut`},children:H===`month`?(0,i.jsx)(p,{viewDate:U,...xe}):(0,i.jsx)(m,{viewDate:U,...xe})},Se)})})})]})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./cn-DpgY2leY.js";
|
|
2
|
-
import { c as t, s as n } from "./component-styles-
|
|
2
|
+
import { c as t, s as n } from "./component-styles-Bgy44fc8.js";
|
|
3
3
|
import { AnimatePresence as r, motion as i } from "framer-motion";
|
|
4
4
|
import { useEffect as a, useState as o } from "react";
|
|
5
5
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region src/lib/component-styles.ts
|
|
2
|
-
var e = "flex w-full flex-col gap-1.5", t = "text-
|
|
2
|
+
var e = "flex w-full flex-col gap-1.5", t = "text-xs font-semibold leading-5 text-foreground", n = "text-xs leading-5 text-muted-foreground", r = "text-xs leading-5 text-destructive", i = [
|
|
3
3
|
"border border-border bg-surface text-foreground shadow-xs",
|
|
4
4
|
"transition-[border-color,box-shadow,background-color] duration-150",
|
|
5
5
|
"hover:border-border-strong",
|
|
6
|
-
"focus-within:border-accent-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-focus-ring/
|
|
6
|
+
"focus-within:border-accent-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-focus-ring/15",
|
|
7
7
|
"has-[:disabled]:cursor-not-allowed has-[:disabled]:bg-surface-muted has-[:disabled]:opacity-60",
|
|
8
8
|
"has-[:read-only]:bg-surface-muted"
|
|
9
9
|
].join(" "), a = "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20", o = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg", s = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=[`border border-border bg-surface text-foreground shadow-xs`,`transition-[border-color,box-shadow,background-color] duration-150`,`hover:border-border-strong`,`focus-within:border-accent-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-focus-ring/
|
|
1
|
+
var e=[`border border-border bg-surface text-foreground shadow-xs`,`transition-[border-color,box-shadow,background-color] duration-150`,`hover:border-border-strong`,`focus-within:border-accent-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-focus-ring/15`,`has-[:disabled]:cursor-not-allowed has-[:disabled]:bg-surface-muted has-[:disabled]:opacity-60`,`has-[:read-only]:bg-surface-muted`].join(` `),t=`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,n=`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`,r=[`inline-flex size-8 shrink-0 items-center justify-center rounded-md`,`text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,`disabled:pointer-events-none disabled:opacity-40`,n].join(` `);Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return`text-xs font-semibold leading-5 text-foreground`}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return`text-xs leading-5 text-destructive`}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return`flex w-full flex-col gap-1.5`}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return`text-xs leading-5 text-muted-foreground`}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");function a({items:a,multiple:o=!1,defaultOpen:s=[],className:c,...l}){let[u,d]=(0,r.useState)(new Set(s)),f=(0,r.useId)();function p(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):(o||n.clear(),n.add(e)),n})}return(0,i.jsx)(`div`,{className:e.t(`flex flex-col divide-y divide-border`,c),...l,children:a.map(r=>{let a=u.has(r.id),o=encodeURIComponent(r.id),s=`${f}-trigger-${o}`,c=`${f}-panel-${o}`;return(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`button`,{type:`button`,id:s,"aria-expanded":a,"aria-controls":c,disabled:r.disabled,onClick:()=>p(r.id),className:e.t(`flex items-center justify-between w-full py-3.5 text-left gap-3 transition-colors`,`text-foreground hover:text-foreground`,t.s,r.disabled&&`opacity-40 cursor-not-allowed`),children:[(0,i.jsx)(`span`,{className:`flex-1 min-w-0`,children:r.trigger}),(0,i.jsx)(n.motion.span,{animate:{rotate:a?180:0},transition:{duration:.2},className:`shrink-0 text-slate-500`,children:(0,i.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m6 9 6 6 6-6`})})})]}),(0,i.jsx)(n.AnimatePresence,{initial:!1,children:a&&(0,i.jsx)(n.motion.div,{id:c,role:`region`,"aria-labelledby":s,initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeInOut`},className:`overflow-hidden`,children:(0,i.jsx)(`div`,{className:`pb-4 text-sm leading-6 text-muted-foreground`,children:r.content})})})]},r.id)})})}function o({open:e,onOpenChange:t,defaultOpen:a=!1,trigger:o,children:s,className:c}){let[l,u]=(0,r.useState)(a),d=(0,r.useId)(),f=e??l;function p(){let n=!f;e===void 0&&u(n),t?.(n)}return(0,i.jsxs)(`div`,{className:c,children:[(0,i.jsx)(`button`,{type:`button`,onClick:p,"aria-expanded":f,"aria-controls":d,className:`block w-full cursor-pointer text-left`,children:o}),(0,i.jsx)(n.AnimatePresence,{initial:!1,children:f&&(0,i.jsx)(n.motion.div,{id:d,initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeInOut`},className:`overflow-hidden`,children:s})})]})}exports.Accordion=a,exports.Collapsible=o;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { s as t } from "../component-styles-
|
|
3
|
+
import { s as t } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { AnimatePresence as n, motion as r } from "framer-motion";
|
|
5
5
|
import { useId as i, useState as a } from "react";
|
|
6
6
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-DOUctc8_.cjs");let t=require("framer-motion"),n=require("react/jsx-runtime");var r={info:{container:`bg-sky-500/[0.07] dark:bg-sky-500/[0.09] border-sky-400/25 dark:border-sky-500/20`,accent:`bg-sky-500`,icon:`text-sky-600 dark:text-sky-400`,title:`text-sky-900 dark:text-sky-100`,body:`text-sky-800/90 dark:text-sky-200/70`},success:{container:`bg-emerald-500/[0.07] dark:bg-emerald-500/[0.09] border-emerald-400/25 dark:border-emerald-500/20`,accent:`bg-emerald-500`,icon:`text-emerald-600 dark:text-emerald-400`,title:`text-emerald-900 dark:text-emerald-100`,body:`text-emerald-800/90 dark:text-emerald-200/70`},warning:{container:`bg-amber-500/[0.07] dark:bg-amber-500/[0.09] border-amber-400/30 dark:border-amber-500/20`,accent:`bg-amber-500`,icon:`text-amber-600 dark:text-amber-400`,title:`text-amber-900 dark:text-amber-100`,body:`text-amber-800/90 dark:text-amber-200/70`},error:{container:`bg-red-500/[0.07] dark:bg-red-500/[0.09] border-red-400/25 dark:border-red-500/20`,accent:`bg-red-500`,icon:`text-red-600 dark:text-red-400`,title:`text-red-900 dark:text-red-100`,body:`text-red-800/90 dark:text-red-200/70`}},i={info:(0,n.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,n.jsx)(`path`,{d:`M12 16v-4`}),(0,n.jsx)(`path`,{d:`M12 8h.01`})]}),success:(0,n.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`path`,{d:`M22 11.08V12a10 10 0 1 1-5.93-9.14`}),(0,n.jsx)(`path`,{d:`m9 11 3 3L22 4`})]}),warning:(0,n.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,n.jsx)(`path`,{d:`M12 9v4`}),(0,n.jsx)(`path`,{d:`M12 17h.01`})]}),error:(0,n.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,n.jsx)(`path`,{d:`m15 9-6 6`}),(0,n.jsx)(`path`,{d:`m9 9 6 6`})]})};function a({variant:a=`info`,title:o,icon:s,className:c,children:l,dismissable:u=!1,onDismiss:d,...f}){let p=r[a],m=s??i[a],h=a===`error`||a===`warning`?`alert`:`status`;return(0,n.jsxs)(t.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.16,1,.3,1]},role:h,className:e.t(`relative flex gap-3 rounded-[var(--radius-lg)] border overflow-hidden pl-4 pr-4 py-3.5`,p.container,c),...f,children:[(0,n.jsx)(`span`,{className:e.t(`absolute left-0 inset-y-0 w-[3px]`,p.accent),"aria-hidden":`true`}),(0,n.jsx)(`span`,{className:e.t(`shrink-0 mt-0.5`,p.icon),children:m}),(0,n.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o&&(0,n.jsx)(`p`,{className:e.t(`text-sm font-semibold leading-snug mb-0.5`,p.title),children:o}),l&&(0,n.jsx)(`div`,{className:e.t(`text-sm leading-relaxed`,p.body),children:l})]}),u&&(0,n.jsx)(`button`,{type:`button`,onClick:d,"aria-label":`Dismiss`,className:e.t(`shrink-0 mt-0.5 rounded-sm opacity-60 hover:opacity-100 transition-opacity cursor-pointer`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`,p.icon),children:(0,n.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`path`,{d:`M18 6 6 18`}),(0,n.jsx)(`path`,{d:`m6 6 12 12`})]})})]})}exports.Alert=a;
|
package/dist/components/alert.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import "../component-styles-
|
|
3
|
+
import "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { motion as t } from "framer-motion";
|
|
5
5
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/alert.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../autocomplete-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../autocomplete-Bk4pRQ2R.cjs");exports.Autocomplete=e.t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react/jsx-runtime");var n={default:`bg-accent-50 dark:bg-accent-500/[0.12] text-accent-600 dark:text-accent-400 border-accent-200/80 dark:border-accent-500/20`,success:`bg-emerald-50 dark:bg-emerald-500/[0.12] text-emerald-700 dark:text-emerald-400 border-emerald-200/80 dark:border-emerald-500/20`,warning:`bg-amber-50 dark:bg-amber-500/[0.12] text-amber-700 dark:text-amber-400 border-amber-200/80 dark:border-amber-500/20`,error:`bg-red-50 dark:bg-red-500/[0.12] text-danger dark:text-red-400 border-red-200/80 dark:border-red-500/20`,info:`bg-sky-50 dark:bg-sky-500/[0.12] text-sky-700 dark:text-sky-400 border-sky-200/80 dark:border-sky-500/20`,muted:`bg-black/[0.05] dark:bg-white/[0.07] text-slate-600 dark:text-slate-400 border-black/[0.08] dark:border-white/[0.09]`},r={sm:`px-1.5 py-px text-[10.5px] gap-1 font-medium tracking-[-0.01em]`,md:`px-2 py-0.5 text-[11.5px] gap-1.5 font-medium tracking-[-0.01em]`,lg:`px-2.5 py-1 text-xs gap-1.5 font-medium tracking-[-0.01em]`},i={default:`bg-accent-400`,success:`bg-emerald-400`,warning:`bg-amber-400`,error:`bg-red-400`,info:`bg-sky-400`,muted:`bg-slate-500`};function a({variant:a=`default`,dot:o=!1,size:s=`md`,variants:c,className:l,children:u,...d}){let f=c?.[a]??n[a];return(0,t.jsxs)(`span`,{className:e.t(`inline-flex items-center rounded-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react/jsx-runtime");var n={default:`bg-accent-50 dark:bg-accent-500/[0.12] text-accent-600 dark:text-accent-400 border-accent-200/80 dark:border-accent-500/20`,success:`bg-emerald-50 dark:bg-emerald-500/[0.12] text-emerald-700 dark:text-emerald-400 border-emerald-200/80 dark:border-emerald-500/20`,warning:`bg-amber-50 dark:bg-amber-500/[0.12] text-amber-700 dark:text-amber-400 border-amber-200/80 dark:border-amber-500/20`,error:`bg-red-50 dark:bg-red-500/[0.12] text-danger dark:text-red-400 border-red-200/80 dark:border-red-500/20`,info:`bg-sky-50 dark:bg-sky-500/[0.12] text-sky-700 dark:text-sky-400 border-sky-200/80 dark:border-sky-500/20`,muted:`bg-black/[0.05] dark:bg-white/[0.07] text-slate-600 dark:text-slate-400 border-black/[0.08] dark:border-white/[0.09]`},r={sm:`px-1.5 py-px text-[10.5px] gap-1 font-medium tracking-[-0.01em]`,md:`px-2 py-0.5 text-[11.5px] gap-1.5 font-medium tracking-[-0.01em]`,lg:`px-2.5 py-1 text-xs gap-1.5 font-medium tracking-[-0.01em]`},i={default:`bg-accent-400`,success:`bg-emerald-400`,warning:`bg-amber-400`,error:`bg-red-400`,info:`bg-sky-400`,muted:`bg-slate-500`};function a({variant:a=`default`,dot:o=!1,size:s=`md`,variants:c,className:l,children:u,...d}){let f=c?.[a]??n[a];return(0,t.jsxs)(`span`,{className:e.t(`inline-flex items-center rounded-[var(--radius-sm)] font-medium border leading-none whitespace-nowrap`,f,r[s],l),...d,children:[o&&(0,t.jsx)(`span`,{className:e.t(`w-1.5 h-1.5 rounded-full shrink-0`,i[a])}),u]})}exports.Badge=a,exports.badgeVariants=n;
|
package/dist/components/badge.js
CHANGED
|
@@ -23,7 +23,7 @@ var r = {
|
|
|
23
23
|
function o({ variant: o = "default", dot: s = !1, size: c = "md", variants: l, className: u, children: d, ...f }) {
|
|
24
24
|
let p = l?.[o] ?? r[o];
|
|
25
25
|
return /* @__PURE__ */ n("span", {
|
|
26
|
-
className: e("inline-flex items-center rounded-
|
|
26
|
+
className: e("inline-flex items-center rounded-[var(--radius-sm)] font-medium border leading-none whitespace-nowrap", p, i[c], u),
|
|
27
27
|
...f,
|
|
28
28
|
children: [s && /* @__PURE__ */ t("span", { className: e("w-1.5 h-1.5 rounded-full shrink-0", a[o]) }), d]
|
|
29
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react/jsx-runtime");var r=()=>(0,n.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-slate-400`,children:(0,n.jsx)(`path`,{d:`m9 18 6-6-6-6`})});function i({items:i,separator:a,className:o,...s}){return(0,n.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:e.t(`flex min-w-0`,o),...s,children:(0,n.jsx)(`ol`,{className:`flex min-w-0 items-center gap-1.5 overflow-x-auto`,children:i.map((o,s)=>{let c=s===i.length-1;return(0,n.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[s>0&&(0,n.jsx)(`span`,{className:`flex items-center shrink-0`,children:a??(0,n.jsx)(r,{})}),o.href&&!c?(0,n.jsxs)(`a`,{href:o.href,className:e.t(`flex items-center gap-1 rounded-sm text-sm text-muted-foreground hover:text-foreground transition-colors`,t.s),children:[o.icon&&(0,n.jsx)(`span`,{className:`shrink-0`,children:o.icon}),o.label]}):(0,n.jsxs)(`span`,{className:e.t(`flex items-center gap-1 text-sm`,c?`text-foreground font-medium`:`text-muted-foreground`),"aria-current":c?`page`:void 0,children:[o.icon&&(0,n.jsx)(`span`,{className:`shrink-0`,children:o.icon}),o.label]})]},s)})})})}exports.Breadcrumb=i;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
-
import { s as t } from "../component-styles-
|
|
2
|
+
import { s as t } from "../component-styles-Bgy44fc8.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/breadcrumb.tsx
|
|
5
5
|
var i = () => /* @__PURE__ */ n("svg", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react"),r=require("react/jsx-runtime");var i={primary:[`bg-primary hover:bg-primary-hover active:bg-primary-hover`,`text-primary-foreground font-semibold`,`border border-primary shadow-xs`].join(` `),secondary:[`bg-surface hover:bg-surface-muted active:bg-muted`,`text-foreground font-medium`,`border border-border hover:border-border-strong shadow-xs`].join(` `),ghost:[`bg-transparent`,`hover:bg-muted active:bg-surface-muted`,`text-muted-foreground font-medium hover:text-foreground`].join(` `),outline:[`bg-transparent`,`border border-border-strong hover:border-foreground/35`,`text-foreground font-medium hover:bg-muted`].join(` `),destructive:[`bg-destructive hover:bg-destructive-hover active:bg-destructive-hover`,`text-destructive-foreground font-semibold`,`border border-transparent shadow-xs`].join(` `),link:`h-auto bg-transparent p-0 text-accent-700 underline-offset-4 hover:underline dark:text-accent-300`},a={sm:`h-8 px-3 text-xs rounded-[var(--radius-md)] gap-1.5`,md:`h-9 px-4 text-sm rounded-[var(--radius-lg)] gap-2`,lg:`h-10 px-5 text-sm rounded-[var(--radius-lg)] gap-2.5`,icon:`size-9 rounded-[var(--radius-md)] p-0`},o=(0,n.forwardRef)(({className:n,variant:o=`primary`,size:s=`md`,loading:c=!1,icon:l,iconPosition:u=`left`,variantClassName:d,unstyled:f=!1,children:p,disabled:m,type:h=`button`,...g},_)=>{let v=m||c;return f?(0,r.jsx)(`button`,{ref:_,type:h,disabled:v,className:e.t(n,d),...g,children:c?`Loading…`:p}):(0,r.jsxs)(`button`,{ref:_,type:h,"data-loading":c||void 0,className:e.t(`inline-flex items-center justify-center cursor-pointer select-none whitespace-nowrap`,`transition-[color,background-color,border-color,box-shadow] duration-150`,`disabled:opacity-40 disabled:cursor-not-allowed`,t.s,i[o],d,a[s],n),disabled:v,"aria-busy":c||void 0,...g,children:[c&&(0,r.jsxs)(`svg`,{className:`animate-spin shrink-0 w-3.5 h-3.5`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:[(0,r.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,r.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),!c&&l&&u===`left`&&(0,r.jsx)(`span`,{className:`shrink-0`,children:l}),p&&(0,r.jsx)(`span`,{children:p}),!c&&l&&u===`right`&&(0,r.jsx)(`span`,{className:`shrink-0`,children:l})]})});o.displayName=`Button`;var s=(0,n.memo)(o);exports.Button=s,exports.buttonSizes=a,exports.buttonVariants=i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { s as t } from "../component-styles-
|
|
3
|
+
import { s as t } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { forwardRef as n, memo as r } from "react";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/button.tsx
|
|
@@ -8,7 +8,7 @@ var o = {
|
|
|
8
8
|
primary: [
|
|
9
9
|
"bg-primary hover:bg-primary-hover active:bg-primary-hover",
|
|
10
10
|
"text-primary-foreground font-semibold",
|
|
11
|
-
"border border-
|
|
11
|
+
"border border-primary shadow-xs"
|
|
12
12
|
].join(" "),
|
|
13
13
|
secondary: [
|
|
14
14
|
"bg-surface hover:bg-surface-muted active:bg-muted",
|
|
@@ -49,7 +49,7 @@ var o = {
|
|
|
49
49
|
ref: v,
|
|
50
50
|
type: g,
|
|
51
51
|
"data-loading": l || void 0,
|
|
52
|
-
className: e("inline-flex items-center justify-center cursor-pointer select-none whitespace-nowrap", "transition-[color,background-color,border-color,box-shadow
|
|
52
|
+
className: e("inline-flex items-center justify-center cursor-pointer select-none whitespace-nowrap", "transition-[color,background-color,border-color,box-shadow] duration-150", "disabled:opacity-40 disabled:cursor-not-allowed", t, o[r], f, s[c], n),
|
|
53
53
|
disabled: y,
|
|
54
54
|
"aria-busy": l || void 0,
|
|
55
55
|
..._,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../calendar-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../calendar-CUXpVrVE.cjs");exports.Calendar=e.t;
|
package/dist/components/card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react/jsx-runtime");var n={default:`rounded-[var(--radius-xl)] border border-border bg-surface shadow-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react/jsx-runtime");var n={default:`rounded-[var(--radius-xl)] border border-border bg-surface shadow-xs`,elevated:`rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-floating`,bordered:`rounded-[var(--radius-xl)] border border-border bg-transparent`,glass:`portal-panel rounded-[var(--radius-xl)] border`,flush:`rounded-[var(--radius-lg)] bg-surface`};function r({variant:r=`default`,variantClassName:i,unstyled:a=!1,className:o,children:s,...c}){return a?(0,t.jsx)(`div`,{className:e.t(o,i),...c,children:s}):(0,t.jsx)(`div`,{"data-variant":r,className:e.t(n[r],i,o),...c,children:s})}function i({className:n,children:r,...i}){return(0,t.jsx)(`div`,{className:e.t(`px-4 py-3 sm:px-5 sm:py-3.5`,`border-b border-border`,n),...i,children:r})}function a({as:n=`h3`,className:r,children:i,...a}){return(0,t.jsx)(n,{className:e.t(`text-sm font-semibold leading-5 text-foreground`,r),...a,children:i})}function o({className:n,children:r,...i}){return(0,t.jsx)(`p`,{className:e.t(`mt-1 text-sm leading-5 text-muted-foreground`,n),...i,children:r})}function s({className:n,children:r,...i}){return(0,t.jsx)(`div`,{className:e.t(`px-4 py-3.5 sm:px-5 sm:py-4`,n),...i,children:r})}function c({className:n,children:r,...i}){return(0,t.jsx)(`div`,{className:e.t(`px-4 py-3 sm:px-5 sm:py-3`,`border-t border-border`,`flex flex-wrap items-center gap-2 sm:gap-3`,n),...i,children:r})}exports.Card=r,exports.CardBody=s,exports.CardDescription=o,exports.CardFooter=c,exports.CardHeader=i,exports.CardTitle=a,exports.cardVariants=n;
|
package/dist/components/card.js
CHANGED
|
@@ -2,7 +2,7 @@ import { t as e } from "../cn-DpgY2leY.js";
|
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/card.tsx
|
|
4
4
|
var n = {
|
|
5
|
-
default: "rounded-[var(--radius-xl)] border border-border bg-surface shadow-
|
|
5
|
+
default: "rounded-[var(--radius-xl)] border border-border bg-surface shadow-xs",
|
|
6
6
|
elevated: "rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-floating",
|
|
7
7
|
bordered: "rounded-[var(--radius-xl)] border border-border bg-transparent",
|
|
8
8
|
glass: "portal-panel rounded-[var(--radius-xl)] border",
|
|
@@ -22,7 +22,7 @@ function r({ variant: r = "default", variantClassName: i, unstyled: a = !1, clas
|
|
|
22
22
|
}
|
|
23
23
|
function i({ className: n, children: r, ...i }) {
|
|
24
24
|
return /* @__PURE__ */ t("div", {
|
|
25
|
-
className: e("px-4 py-3 sm:px-5 sm:py-
|
|
25
|
+
className: e("px-4 py-3 sm:px-5 sm:py-3.5", "border-b border-border", n),
|
|
26
26
|
...i,
|
|
27
27
|
children: r
|
|
28
28
|
});
|
|
@@ -43,7 +43,7 @@ function o({ className: n, children: r, ...i }) {
|
|
|
43
43
|
}
|
|
44
44
|
function s({ className: n, children: r, ...i }) {
|
|
45
45
|
return /* @__PURE__ */ t("div", {
|
|
46
|
-
className: e("px-4 py-3 sm:px-5 sm:py-4", n),
|
|
46
|
+
className: e("px-4 py-3.5 sm:px-5 sm:py-4", n),
|
|
47
47
|
...i,
|
|
48
48
|
children: r
|
|
49
49
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-DOUctc8_.cjs");let t=require("framer-motion"),n=require("react"),r=require("react/jsx-runtime");var i={sm:{box:`w-3.5 h-3.5 rounded`,check:10,label:`text-xs`,desc:`text-[10px]`},md:{box:`w-4 h-4 rounded-[4px]`,check:11,label:`text-sm`,desc:`text-xs`},lg:{box:`w-5 h-5 rounded-md`,check:13,label:`text-sm`,desc:`text-xs`}},a=(0,n.forwardRef)(({className:a,label:o,description:s,size:c=`md`,checked:l,defaultChecked:u,indeterminate:d=!1,onChange:f,disabled:p,error:m,id:h,...g},_)=>{let[v,y]=(0,n.useState)(l===void 0?u??!1:l);(0,n.useEffect)(()=>{l!==void 0&&y(l)},[l]);let b=(0,n.useId)(),x=h??b,S=`${x}-message`,C=(0,n.useRef)(null),w=i[c],T=v||d;return(0,n.useEffect)(()=>{C.current&&(C.current.indeterminate=d)},[d]),(0,r.jsxs)(`div`,{className:e.t(`flex flex-col gap-1`,a),children:[(0,r.jsxs)(`label`,{htmlFor:x,className:e.t(`flex items-start gap-2.5 cursor-pointer`,p&&`cursor-not-allowed opacity-50`),children:[(0,r.jsxs)(`div`,{className:e.t(`relative mt-0.5 shrink-0`,w.box),children:[(0,r.jsx)(`input`,{ref:e=>{C.current=e,typeof _==`function`?_(e):_&&(_.current=e)},type:`checkbox`,id:x,className:`peer absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed`,"aria-invalid":m?!0:void 0,"aria-describedby":m||s?S:void 0,"aria-checked":d?`mixed`:v,checked:v,disabled:p,onChange:e=>{l===void 0&&y(e.target.checked),f?.(e)},...g}),(0,r.jsx)(`div`,{className:e.t(`w-full h-full border-2 flex items-center justify-center transition-colors duration-[120ms] peer-focus-visible:ring-2 peer-focus-visible:ring-focus-ring/35 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-bg`,w.box,T?`bg-accent-600 border-accent-600 dark:bg-accent-500 dark:border-accent-500`:m?`bg-transparent border-red-500/50`:`bg-transparent border-black/25 dark:border-white/25`),children:(0,r.jsx)(t.AnimatePresence,{mode:`wait`,children:d?(0,r.jsx)(t.motion.svg,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{duration:.1},width:w.check,height:w.check,viewBox:`0 0 14 14`,fill:`none`,stroke:`white`,strokeWidth:`2.5`,strokeLinecap:`round`,children:(0,r.jsx)(`path`,{d:`M3 7h8`})},`minus`):v?(0,r.jsx)(t.motion.svg,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:`spring`,stiffness:600,damping:30},width:w.check,height:w.check,viewBox:`0 0 14 14`,fill:`none`,stroke:`white`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,r.jsx)(`path`,{d:`M2.5 7l3 3 6-6`})},`check`):null})})]}),(o||s)&&(0,r.jsxs)(`div`,{className:`min-w-0`,children:[o&&(0,r.jsx)(`p`,{className:e.t(`font-medium text-foreground leading-snug`,w.label),children:o}),s&&(0,r.jsx)(`p`,{id:m?void 0:S,className:e.t(`mt-0.5 text-muted-foreground`,w.desc),children:s})]})]}),m&&(0,r.jsx)(`p`,{id:S,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,`ml-[26px]`),children:m})]})});a.displayName=`Checkbox`,exports.Checkbox=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import "../component-styles-
|
|
3
|
+
import "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { AnimatePresence as t, motion as n } from "framer-motion";
|
|
5
5
|
import { forwardRef as r, useEffect as i, useId as a, useRef as o, useState as s } from "react";
|
|
6
6
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-DOUctc8_.cjs");const t=require("../focus-DmG6Ge7X.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=(0,r.createContext)(null);function o(){let e=(0,r.useContext)(a);if(!e)throw Error(`useCommand must be inside <CommandProvider>`);return e}function s({children:e,shortcut:t=`k`}){let[n,o]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===t&&(e.preventDefault(),o(e=>!e))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),(0,i.jsx)(a.Provider,{value:{open:n,setOpen:o},children:e})}function c({items:a,placeholder:s=`Search commands…`,emptyText:c=`No results found.`,ariaLabel:l=`Command palette`}){let{open:u,setOpen:d}=o(),[f,p]=(0,r.useState)(``),[m,h]=(0,r.useState)(0),g=(0,r.useRef)(null),_=(0,r.useRef)(null),v=(0,r.useRef)(null),y=(0,r.useId)();(0,r.useEffect)(()=>{if(!u)return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.body.style.overflow,r=window.setTimeout(()=>g.current?.focus(),0),i=e=>{if(e.key===`Escape`){e.preventDefault(),d(!1);return}if(e.key!==`Tab`||!v.current)return;let n=t.t(v.current);if(n.length===0){e.preventDefault(),v.current.focus();return}let r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus())};return p(``),h(0),document.body.style.overflow=`hidden`,document.addEventListener(`keydown`,i),()=>{window.clearTimeout(r),document.body.style.overflow=n,document.removeEventListener(`keydown`,i),e?.focus()}},[u,d]);let b=(0,r.useMemo)(()=>{if(!f)return a;let e=f.toLowerCase();return a.filter(t=>t.label.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)||t.keywords?.some(t=>t.toLowerCase().includes(e)))},[f,a]),x=(0,r.useMemo)(()=>{let e=new Map;for(let t of b){let n=t.group??``;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[b]),S=(0,r.useMemo)(()=>Array.from(x.values()).flat(),[x]);function C(e){e.key===`ArrowDown`?(e.preventDefault(),h(e=>Math.min(e+1,Math.max(S.length-1,0)))):e.key===`ArrowUp`?(e.preventDefault(),h(e=>Math.max(e-1,0))):e.key===`Enter`?(e.preventDefault(),S[m]?.onSelect(),d(!1)):e.key===`Escape`&&d(!1)}(0,r.useEffect)(()=>{_.current&&_.current.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[m]);let w=0;return(0,i.jsx)(n.AnimatePresence,{children:u&&(0,i.jsxs)(`div`,{className:`fixed inset-0 z-[200] flex items-start justify-center pt-[15vh] p-4`,children:[(0,i.jsx)(n.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`absolute inset-0 bg-overlay`,onClick:()=>d(!1),"aria-hidden":`true`}),(0,i.jsxs)(n.motion.div,{ref:v,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-label":l,initial:{opacity:0,scale:.96,y:-8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:-8},transition:{type:`spring`,stiffness:400,damping:30},className:`relative w-full max-w-lg overflow-hidden rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4`,children:[(0,i.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-slate-400 shrink-0`,children:[(0,i.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,i.jsx)(`path`,{d:`m21 21-4.35-4.35`})]}),(0,i.jsx)(`input`,{ref:g,type:`search`,role:`combobox`,"aria-label":l,"aria-autocomplete":`list`,"aria-expanded":`true`,"aria-controls":y,"aria-activedescendant":S[m]?`${y}-option-${m}`:void 0,value:f,onChange:e=>{p(e.target.value),h(0)},onKeyDown:C,placeholder:s,className:`min-w-0 flex-1 bg-transparent py-3.5 text-sm text-foreground outline-none placeholder:text-muted-foreground`}),(0,i.jsx)(`kbd`,{className:`shrink-0 rounded-[var(--radius-sm)] border border-border-strong bg-surface-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`ESC`})]}),(0,i.jsx)(`div`,{id:y,ref:_,role:`listbox`,"aria-label":`Commands`,className:`max-h-80 overflow-y-auto py-1.5`,children:b.length===0?(0,i.jsx)(`p`,{className:`py-10 text-center text-sm text-muted-foreground`,children:c}):Array.from(x.entries()).map(([t,n])=>(0,i.jsxs)(`div`,{role:`group`,"aria-label":t||void 0,children:[t&&(0,i.jsx)(`p`,{className:`px-4 py-1 text-[10px] font-semibold text-slate-500 uppercase tracking-widest`,children:t}),n.map(t=>{let n=w++,r=n===m;return(0,i.jsxs)(`button`,{id:`${y}-option-${n}`,type:`button`,role:`option`,"aria-selected":r,"data-active":r,onClick:()=>{t.onSelect(),d(!1)},onMouseEnter:()=>h(n),className:e.t(`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`,r?`bg-surface-muted`:`hover:bg-surface-muted/70`),children:[t.icon&&(0,i.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400 w-5 flex items-center justify-center`,children:t.icon}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsx)(`p`,{className:`truncate text-sm text-foreground`,children:t.label}),t.description&&(0,i.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:t.description})]}),t.shortcut&&(0,i.jsx)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:t.shortcut.map((e,t)=>(0,i.jsx)(`kbd`,{className:`rounded-[var(--radius-sm)] border border-border bg-surface-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:e},t))})]},t.id)})]},t))})]})]})})}exports.CommandPalette=c,exports.CommandProvider=s,exports.useCommand=o;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import "../component-styles-
|
|
3
|
+
import "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { t } from "../focus-Dk1YWVPN.js";
|
|
5
5
|
import { AnimatePresence as n, motion as r } from "framer-motion";
|
|
6
6
|
import { createContext as i, useContext as a, useEffect as o, useId as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../datatable-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../datatable-rzDgQ3r6.cjs");exports.DataTable=e.t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],o=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];function s(e){return`${o[e.getMonth()].slice(0,3)} ${e.getDate()}, ${e.getFullYear()}`}function c(e,t){return new Date(e,t+1,0).getDate()}function l(e,t){return new Date(e,t,1).getDay()}function u(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function d({value:d,onChange:f,label:p,hint:m,error:h,placeholder:g=`Select date…`,disabled:_,clearable:v=!0,minDate:y,maxDate:b,className:x}){let[S,C]=(0,r.useState)(null),w=d===void 0?S:d,T=new Date,[E,D]=(0,r.useState)(!1),[O,k]=(0,r.useState)((w??T).getFullYear()),[A,j]=(0,r.useState)((w??T).getMonth()),M=(0,r.useRef)(null),N=(0,r.useId)(),P=`${N}-message`;function F(e){d===void 0&&C(e),f?.(e),D(!1)}function I(e){e.stopPropagation(),d===void 0&&C(null),f?.(null)}function L(){A===0?(j(11),k(e=>e-1)):j(e=>e-1)}function R(){A===11?(j(0),k(e=>e+1)):j(e=>e+1)}(0,r.useEffect)(()=>{function e(e){M.current?.contains(e.target)||D(!1)}function t(e){e.key===`Escape`&&D(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[]);let z=c(O,A),B=l(O,A),V=[...Array(B).fill(null),...Array.from({length:z},(e,t)=>t+1)];return(0,i.jsxs)(`div`,{ref:M,className:e.t(`relative`,t.o,x),children:[p&&(0,i.jsx)(`label`,{htmlFor:N,className:`text-xs font-semibold leading-5 text-foreground`,children:p}),(0,i.jsxs)(`button`,{type:`button`,id:N,"aria-expanded":E,"aria-haspopup":`dialog`,"aria-invalid":h?!0:void 0,"aria-describedby":h||m?P:void 0,disabled:_,onClick:()=>D(e=>!e),className:e.t(`flex h-9 w-full items-center gap-2 rounded-[var(--radius-md)] px-3 text-left outline-none`,t.t,`focus:border-accent-500 focus:ring-2 focus:ring-focus-ring/20`,h&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,_&&`opacity-50 cursor-not-allowed`),children:[(0,i.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-slate-500 shrink-0`,children:[(0,i.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,ry:`2`}),(0,i.jsx)(`line`,{x1:`16`,x2:`16`,y1:`2`,y2:`6`}),(0,i.jsx)(`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`6`}),(0,i.jsx)(`line`,{x1:`3`,x2:`21`,y1:`10`,y2:`10`})]}),(0,i.jsx)(`span`,{className:e.t(`flex-1 text-sm truncate`,w?`text-foreground`:`text-muted-foreground`),children:w?s(w):g}),v&&w&&!_&&(0,i.jsx)(`span`,{role:`button`,tabIndex:-1,onClick:I,className:`shrink-0 text-slate-500 hover:text-slate-700 dark:hover:text-slate-300 transition-colors`,children:(0,i.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),(0,i.jsx)(n.AnimatePresence,{children:E&&(0,i.jsxs)(n.motion.div,{initial:{opacity:0,y:-4,scaleY:.97},animate:{opacity:1,y:0,scaleY:1},exit:{opacity:0,y:-4,scaleY:.97},transition:{duration:.13},style:{originY:0},role:`dialog`,"aria-label":`Choose date`,className:`absolute left-0 top-full z-50 mt-1.5 w-[min(18rem,calc(100vw-2rem))] rounded-[var(--radius-lg)] border border-border bg-surface-raised p-3 shadow-floating`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:L,"aria-label":`Previous month`,className:e.t(t.c,`size-7`),children:(0,i.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m15 18-6-6 6-6`})})}),(0,i.jsxs)(`span`,{"aria-live":`polite`,className:`text-sm font-semibold text-foreground`,children:[o[A],` `,O]}),(0,i.jsx)(`button`,{type:`button`,onClick:R,"aria-label":`Next month`,className:e.t(t.c,`size-7`),children:(0,i.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m9 18 6-6-6-6`})})})]}),(0,i.jsx)(`div`,{className:`grid grid-cols-7 gap-0.5 mb-1`,children:a.map(e=>(0,i.jsx)(`div`,{"aria-hidden":`true`,className:`text-center text-[10px] font-semibold text-muted-foreground py-1`,children:e},e))}),(0,i.jsx)(`div`,{className:`grid grid-cols-7 gap-0.5`,children:V.map((t,n)=>{if(!t)return(0,i.jsx)(`div`,{},`empty-${n}`);let r=new Date(O,A,t),a=w?u(r,w):!1,o=u(r,T),s=y&&r<y||b&&r>b;return(0,i.jsx)(`button`,{type:`button`,disabled:!!s,onClick:()=>F(r),"aria-label":r.toLocaleDateString(void 0,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`}),"aria-pressed":a,"aria-current":o?`date`:void 0,className:e.t(`h-8 w-full rounded-md text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35`,a?`bg-primary text-primary-foreground font-medium`:o?`border border-accent-500/40 text-accent-400 hover:bg-accent-500/10`:`text-slate-700 dark:text-slate-200 hover:bg-black/6 dark:hover:bg-white/6`,s&&`opacity-30 cursor-not-allowed`),children:t},t)})})]})}),h&&(0,i.jsx)(`p`,{id:P,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:h}),m&&!h&&(0,i.jsx)(`p`,{id:P,className:`text-xs leading-5 text-muted-foreground`,children:m})]})}exports.DatePicker=d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { c as t, o as n, t as r } from "../component-styles-
|
|
3
|
+
import { c as t, o as n, t as r } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { AnimatePresence as i, motion as a } from "framer-motion";
|
|
5
5
|
import { useEffect as o, useId as s, useRef as c, useState as l } from "react";
|
|
6
6
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
@@ -71,7 +71,7 @@ function v({ value: v, onChange: y, label: b, hint: x, error: S, placeholder: C
|
|
|
71
71
|
children: [
|
|
72
72
|
b && /* @__PURE__ */ u("label", {
|
|
73
73
|
htmlFor: B,
|
|
74
|
-
className: "text-
|
|
74
|
+
className: "text-xs font-semibold leading-5 text-foreground",
|
|
75
75
|
children: b
|
|
76
76
|
}),
|
|
77
77
|
/* @__PURE__ */ d("button", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../drawer-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../drawer-CTeBsYrO.cjs");exports.Drawer=e.t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(({className:a,label:o,hint:s,error:c,accept:l,maxSizeMB:u,onFilesChange:d,disabled:f,multiple:p,id:m,...h},g)=>{let[_,v]=(0,r.useState)(!1),[y,b]=(0,r.useState)([]),[x,S]=(0,r.useState)(``),C=(0,r.useRef)(null),w=(0,r.useId)(),T=m??w,E=`${T}-message`,D=u&&(u>=1024?`${u/1024}GB`:`${u}MB`);function O(e){if(!e)return;let t=Array.from(e);if(u){let e=t.find(e=>e.size>u*1024*1024);if(e){S(`${e.name} exceeds ${D}`);return}}S(``);let n=p?[...y,...t]:t;b(n),d?.(n)}function k(e){let t=y.filter((t,n)=>n!==e);b(t),d?.(t)}function A(e){e.preventDefault(),v(!1),!f&&O(e.dataTransfer.files)}let j=c??x;return(0,i.jsxs)(`div`,{className:e.t(t.o,a),children:[o&&(0,i.jsx)(`label`,{htmlFor:T,className:`text-xs font-semibold leading-5 text-foreground`,children:o}),(0,i.jsxs)(`label`,{htmlFor:T,onDragOver:e=>{e.preventDefault(),f||v(!0)},onDragLeave:()=>v(!1),onDrop:A,className:e.t(`relative flex flex-col items-center justify-center gap-2 rounded-[var(--radius-lg)] border border-dashed px-4 py-7 text-center cursor-pointer transition-colors focus-within:ring-2 focus-within:ring-focus-ring/25`,_?`border-accent-500/60 bg-accent-500/6`:j?`border-red-500/40 bg-red-500/4`:`border-border-strong bg-surface-muted/50 hover:border-accent-500/60 hover:bg-muted`,f&&`opacity-50 cursor-not-allowed pointer-events-none`),children:[(0,i.jsx)(`input`,{ref:e=>{C.current=e,typeof g==`function`?g(e):g&&(g.current=e)},type:`file`,id:T,accept:l,multiple:p,disabled:f,"aria-invalid":j?!0:void 0,"aria-describedby":j||s?E:void 0,className:`sr-only`,onChange:e=>O(e.target.files),...h}),(0,i.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-muted-foreground`,children:[(0,i.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,i.jsx)(`polyline`,{points:`17 8 12 3 7 8`}),(0,i.jsx)(`line`,{x1:`12`,y1:`3`,x2:`12`,y2:`15`})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`p`,{className:`text-sm font-medium text-foreground`,children:[`Drop files here or `,(0,i.jsx)(`span`,{className:`text-accent-700 dark:text-accent-300`,children:`browse`})]}),(l||u)&&(0,i.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[l&&`Accepts ${l}`,D&&`Max ${D}`].filter(Boolean).join(` · `)})]})]}),(0,i.jsx)(n.AnimatePresence,{initial:!1,children:y.length>0&&(0,i.jsx)(n.motion.ul,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},className:`flex flex-col gap-1 overflow-hidden`,children:y.map((t,n)=>(0,i.jsxs)(`li`,{className:`flex items-center gap-2 rounded-[var(--radius-md)] border border-border bg-surface-muted px-3 py-2`,children:[(0,i.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-slate-400 shrink-0`,children:[(0,i.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,i.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),(0,i.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-foreground`,children:t.name}),(0,i.jsxs)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:[(t.size/1024).toFixed(0),`KB`]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>k(n),"aria-label":`Remove ${t.name}`,className:e.t(`shrink-0 rounded-sm text-muted-foreground hover:text-destructive transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`),children:(0,i.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]},`${t.name}-${n}`))})}),j&&(0,i.jsx)(`p`,{id:E,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:j}),s&&!j&&(0,i.jsx)(`p`,{id:E,className:`text-xs leading-5 text-muted-foreground`,children:s})]})});a.displayName=`FileUpload`,exports.FileUpload=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { o as t } from "../component-styles-
|
|
3
|
+
import { o as t } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { AnimatePresence as n, motion as r } from "framer-motion";
|
|
5
5
|
import { forwardRef as i, useId as a, useRef as o, useState as s } from "react";
|
|
6
6
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -34,7 +34,7 @@ var u = i(({ className: i, label: u, hint: d, error: f, accept: p, maxSizeMB: m,
|
|
|
34
34
|
children: [
|
|
35
35
|
u && /* @__PURE__ */ c("label", {
|
|
36
36
|
htmlFor: k,
|
|
37
|
-
className: "text-
|
|
37
|
+
className: "text-xs font-semibold leading-5 text-foreground",
|
|
38
38
|
children: u
|
|
39
39
|
}),
|
|
40
40
|
/* @__PURE__ */ l("label", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react/jsx-runtime");function r({label:r,hint:i,error:a,required:o,htmlFor:s,className:c,children:l,...u}){return(0,n.jsxs)(`div`,{className:e.t(t.o,c),...u,children:[r&&(0,n.jsxs)(`label`,{htmlFor:s,className:e.t(`flex items-center gap-1`,`text-xs font-semibold leading-5 text-foreground`),children:[r,o&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:`*`}),(0,n.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),l,a&&(0,n.jsx)(`p`,{"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:a}),i&&!a&&(0,n.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:i})]})}exports.FormField=r;
|