@bzync/rui 0.0.4 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/autocomplete-D6z5B-WU.cjs +1 -0
- package/dist/{autocomplete-BgKbj6M4.js → autocomplete-bgySuP8X.js} +149 -142
- package/dist/calendar-CQumLNgS.cjs +1 -0
- package/dist/{calendar-j2_zvum1.js → calendar-nkYCMEy3.js} +9 -9
- package/dist/charts-Cot5lCgC.cjs +1 -0
- package/dist/{charts-CxEy2c3M.js → charts-Dscl6UC3.js} +122 -145
- package/dist/cn-B6R3HKzx.cjs +1 -0
- package/dist/{cn-DpgY2leY.js → cn-BJyZJP-y.js} +389 -389
- package/dist/{component-styles-Bgy44fc8.js → component-styles-C2CbHEEA.js} +2 -2
- package/dist/component-styles-DY4wigiq.cjs +1 -0
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.js +3 -3
- package/dist/components/aspect-ratio.cjs +1 -0
- package/dist/components/aspect-ratio.d.ts +5 -0
- package/dist/components/aspect-ratio.js +20 -0
- package/dist/components/auth-backdrop.cjs +1 -1
- package/dist/components/auth-backdrop.d.ts +4 -1
- package/dist/components/auth-backdrop.js +12 -8
- package/dist/components/autocomplete/dropdown.d.ts +4 -1
- package/dist/components/autocomplete/multi-trigger.d.ts +3 -1
- package/dist/components/autocomplete/single-trigger.d.ts +3 -1
- package/dist/components/autocomplete/types.d.ts +15 -0
- package/dist/components/autocomplete.cjs +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/avatar-group.cjs +1 -0
- package/dist/components/avatar-group.d.ts +14 -0
- package/dist/components/avatar-group.js +35 -0
- package/dist/components/avatar.cjs +1 -1
- package/dist/components/avatar.js +2 -2
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/billing-interval-toggle.cjs +1 -1
- package/dist/components/billing-interval-toggle.d.ts +4 -6
- package/dist/components/billing-interval-toggle.js +26 -19
- package/dist/components/blockquote.cjs +1 -0
- package/dist/components/blockquote.d.ts +10 -0
- package/dist/components/blockquote.js +32 -0
- package/dist/components/breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb.js +2 -2
- package/dist/components/button-group.cjs +1 -0
- package/dist/components/button-group.d.ts +7 -0
- package/dist/components/button-group.js +26 -0
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.js +79 -36
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/callout.cjs +1 -1
- package/dist/components/callout.js +14 -14
- package/dist/components/card.cjs +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/charts/shared.d.ts +15 -0
- package/dist/components/charts.cjs +1 -1
- package/dist/components/charts.js +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.js +3 -3
- package/dist/components/code.cjs +3 -3
- package/dist/components/code.d.ts +4 -4
- package/dist/components/code.js +62 -60
- package/dist/components/command.cjs +1 -1
- package/dist/components/command.d.ts +8 -1
- package/dist/components/command.js +84 -83
- package/dist/components/confirm-dialog.cjs +1 -1
- package/dist/components/confirm-dialog.d.ts +8 -1
- package/dist/components/confirm-dialog.js +37 -31
- package/dist/components/copy-button.cjs +1 -1
- package/dist/components/copy-button.js +5 -4
- package/dist/components/currency.cjs +1 -0
- package/dist/components/currency.d.ts +18 -0
- package/dist/components/currency.js +62 -0
- package/dist/components/datatable/types.d.ts +4 -0
- package/dist/components/datatable.cjs +1 -1
- package/dist/components/datatable.d.ts +1 -5
- package/dist/components/datatable.js +1 -1
- package/dist/components/datepicker.cjs +1 -1
- package/dist/components/datepicker.d.ts +3 -3
- package/dist/components/datepicker.js +234 -105
- package/dist/components/description-list.cjs +1 -0
- package/dist/components/description-list.d.ts +14 -0
- package/dist/components/description-list.js +38 -0
- package/dist/components/divider.cjs +1 -0
- package/dist/components/divider.d.ts +12 -0
- package/dist/components/divider.js +45 -0
- package/dist/components/drawer.cjs +1 -1
- package/dist/components/drawer.d.ts +6 -1
- package/dist/components/drawer.js +128 -2
- package/dist/components/dropdown-menu-panel.cjs +1 -0
- package/dist/components/dropdown-menu-panel.d.ts +24 -0
- package/dist/components/dropdown-menu-panel.js +84 -0
- package/dist/components/dropdown-menu.cjs +1 -1
- package/dist/components/dropdown-menu.d.ts +5 -1
- package/dist/components/dropdown-menu.js +38 -93
- package/dist/components/empty-state.cjs +1 -1
- package/dist/components/empty-state.d.ts +5 -1
- package/dist/components/empty-state.js +9 -9
- package/dist/components/error-state.cjs +1 -1
- package/dist/components/error-state.js +2 -2
- package/dist/components/file-upload.cjs +1 -1
- package/dist/components/file-upload.js +4 -4
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.d.ts +9 -0
- package/dist/components/form-field.js +49 -14
- package/dist/components/info-button.cjs +1 -1
- package/dist/components/info-button.d.ts +5 -3
- package/dist/components/info-button.js +33 -29
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/kbd.cjs +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.js +2 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/link.cjs +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.d.ts +8 -1
- package/dist/components/modal.js +74 -120
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.js +2 -2
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.js +3 -3
- package/dist/components/otp-input.cjs +1 -1
- package/dist/components/otp-input.js +2 -2
- package/dist/components/overlay.cjs +1 -0
- package/dist/components/overlay.d.ts +52 -0
- package/dist/components/overlay.js +87 -0
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.js +2 -2
- package/dist/components/popover.cjs +1 -1
- package/dist/components/popover.d.ts +2 -1
- package/dist/components/popover.js +41 -40
- package/dist/components/progressbar.cjs +1 -1
- package/dist/components/progressbar.js +1 -1
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.js +3 -3
- package/dist/components/rating.cjs +1 -0
- package/dist/components/rating.d.ts +15 -0
- package/dist/components/rating.js +75 -0
- package/dist/components/richtext.cjs +1 -1
- package/dist/components/richtext.js +2 -2
- package/dist/components/scroll-area.cjs +1 -0
- package/dist/components/scroll-area.d.ts +8 -0
- package/dist/components/scroll-area.js +19 -0
- package/dist/components/select/option-list.d.ts +3 -1
- package/dist/components/select/types.d.ts +4 -0
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/seo.cjs +1 -1
- package/dist/components/seo.js +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.d.ts +14 -1
- package/dist/components/skeleton.js +56 -4
- package/dist/components/slider.cjs +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/slot.cjs +1 -0
- package/dist/components/slot.d.ts +12 -0
- package/dist/components/slot.js +16 -0
- package/dist/components/snackbar-viewport.cjs +1 -0
- package/dist/components/snackbar-viewport.d.ts +27 -0
- package/dist/components/snackbar-viewport.js +181 -0
- package/dist/components/snackbar.cjs +1 -1
- package/dist/components/snackbar.d.ts +5 -1
- package/dist/components/snackbar.js +36 -200
- package/dist/components/spinner.cjs +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/stat.cjs +1 -1
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.cjs +1 -1
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.cjs +1 -1
- package/dist/components/stepper.js +5 -5
- package/dist/components/switch.cjs +1 -1
- package/dist/components/switch.js +37 -43
- package/dist/components/table.cjs +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.d.ts +6 -4
- package/dist/components/tabs.js +51 -81
- package/dist/components/tag.cjs +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/terminal.cjs +1 -1
- package/dist/components/terminal.js +1 -1
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.js +3 -3
- package/dist/components/theme-provider.cjs +1 -1
- package/dist/components/theme-provider.js +1 -1
- package/dist/components/theme-toggle.cjs +1 -1
- package/dist/components/theme-toggle.js +27 -3
- package/dist/components/time-picker.cjs +1 -0
- package/dist/components/time-picker.d.ts +31 -0
- package/dist/components/time-picker.js +394 -0
- package/dist/components/timeline.cjs +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/toggle.cjs +1 -0
- package/dist/components/toggle.d.ts +42 -0
- package/dist/components/toggle.js +116 -0
- package/dist/components/tooltip.cjs +1 -1
- package/dist/components/tooltip.d.ts +2 -1
- package/dist/components/tooltip.js +37 -36
- package/dist/components/tree.cjs +1 -1
- package/dist/components/tree.js +1 -1
- package/dist/components/typography.cjs +1 -0
- package/dist/components/typography.d.ts +50 -0
- package/dist/components/typography.js +202 -0
- package/dist/components/visually-hidden.cjs +1 -0
- package/dist/components/visually-hidden.d.ts +16 -0
- package/dist/components/visually-hidden.js +13 -0
- package/dist/{datatable-yBN4M3UV.js → datatable-BJoZMrKI.js} +6 -6
- package/dist/datatable-t0U7t_xh.cjs +1 -0
- package/dist/icons-Dfetr1L2.cjs +1 -0
- package/dist/icons-Dk7VZ4Ph.js +51 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.js +125 -86
- package/dist/lib/cn.d.ts +13 -1
- package/dist/lib/component-styles.d.ts +14 -2
- package/dist/lib/icons.d.ts +12 -0
- package/dist/lib/motion.d.ts +58 -0
- package/dist/motion-B2shivEB.cjs +1 -0
- package/dist/motion-gnRzFS5f.js +62 -0
- package/dist/select-ByjnuEcE.cjs +1 -0
- package/dist/{select-ClWrcj3R.js → select-CiMzLhUK.js} +128 -122
- package/dist/styles.css +1 -1
- package/dist/{terminal-CpraMs50.cjs → terminal-1U0ftG3i.cjs} +2 -2
- package/dist/{terminal-BOR2cFi1.js → terminal-VXdxVoAv.js} +4 -4
- package/dist/use-focus-trap-CPLT49gN.cjs +1 -0
- package/dist/use-focus-trap-CS6BXJAB.js +77 -0
- package/dist/{utils-CQ8pvCtk.js → utils-DEw5mQrH.js} +1 -1
- package/dist/{utils-DOFJTw8o.cjs → utils-MnnCTelh.cjs} +1 -1
- package/package.json +56 -9
- package/dist/autocomplete-Bk4pRQ2R.cjs +0 -1
- package/dist/calendar-CUXpVrVE.cjs +0 -1
- package/dist/charts-UDqS1BH1.cjs +0 -1
- package/dist/cn-BdjraxxU.cjs +0 -1
- package/dist/component-styles-DOUctc8_.cjs +0 -1
- package/dist/createLucideIcon-DDY8HuQR.js +0 -42
- package/dist/createLucideIcon-b_X_3fj-.cjs +0 -1
- package/dist/datatable-rzDgQ3r6.cjs +0 -1
- package/dist/drawer-CTeBsYrO.cjs +0 -1
- package/dist/drawer-ixuzyLVS.js +0 -189
- package/dist/select-BFwx--uK.cjs +0 -1
- package/dist/theme-toggle-Bb0BYo51.js +0 -71
- package/dist/theme-toggle-Cld8tktJ.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./cn-BdjraxxU.cjs"),t=require("./component-styles-DOUctc8_.cjs");let n=require("react"),r=require("react/jsx-runtime");function i({loading:n,sortedLength:i,pageSizeOptions:a,pageSize:o,page:s,totalPages:c,hasPagination:l,setPage:u}){return(0,r.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,r.jsx)(`span`,{children:n?`Loading…`:i===0?`0 results`:a!==!1&&o!==1/0?`${(s-1)*o+1}–${Math.min(s*o,i)} of ${i}`:`${i} row${i===1?``:`s`}`}),l&&(0,r.jsxs)(`nav`,{"aria-label":`Table pagination`,className:`flex items-center gap-1`,children:[(0,r.jsx)(`button`,{type:`button`,onClick:()=>u(1),disabled:s===1,className:e.t(t.c,`size-7 max-sm:hidden`),"aria-label":`First page`,children:(0,r.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,r.jsx)(`path`,{d:`m11 17-5-5 5-5`}),(0,r.jsx)(`path`,{d:`m18 17-5-5 5-5`})]})}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>u(e=>Math.max(1,e-1)),disabled:s===1,className:e.t(t.c,`size-7`),"aria-label":`Previous page`,children:(0,r.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,r.jsx)(`path`,{d:`m15 18-6-6 6-6`})})}),Array.from({length:Math.min(5,c)},(n,i)=>{let a;return a=c<=5||s<=3?i+1:s>=c-2?c-4+i:s-2+i,(0,r.jsx)(`button`,{type:`button`,onClick:()=>u(a),"aria-label":`Page ${a}`,"aria-current":s===a?`page`:void 0,className:e.t(t.c,`size-7 text-xs font-medium`,s===a?`bg-accent-50 text-accent-700 dark:bg-accent-500/15 dark:text-accent-300`:`text-muted-foreground`),children:a},a)}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>u(e=>Math.min(c,e+1)),disabled:s===c,className:e.t(t.c,`size-7`),"aria-label":`Next page`,children:(0,r.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,r.jsx)(`path`,{d:`m9 18 6-6-6-6`})})}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>u(c),disabled:s===c,className:e.t(t.c,`size-7 max-sm:hidden`),"aria-label":`Last page`,children:(0,r.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,r.jsx)(`path`,{d:`m13 17 5-5-5-5`}),(0,r.jsx)(`path`,{d:`m6 17 5-5-5-5`})]})})]})]})}function a({options:e,value:t,onChange:n}){return(0,r.jsxs)(`label`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,r.jsx)(`span`,{children:`Rows`}),(0,r.jsx)(`select`,{value:t,onChange:e=>n(Number(e.target.value)),className:`h-8 rounded-[var(--radius-md)] border border-border bg-surface px-2 text-xs text-foreground focus:border-accent-500 focus:outline-none focus:ring-2 focus:ring-focus-ring/20`,children:e.map(e=>(0,r.jsx)(`option`,{value:e,children:e},e))})]})}function o({cols:e}){return(0,r.jsx)(`tr`,{children:Array.from({length:e}).map((e,t)=>(0,r.jsx)(`td`,{className:`px-4 py-3`,children:(0,r.jsx)(`div`,{className:`h-4 rounded-md bg-black/6 dark:bg-white/6 animate-pulse`,style:{width:`${60+t*17%40}%`}})},t))})}function s({dir:t}){return(0,r.jsxs)(`span`,{className:`inline-flex flex-col ml-1.5 gap-[2px] shrink-0`,children:[(0,r.jsx)(`svg`,{"aria-hidden":`true`,width:`8`,height:`5`,viewBox:`0 0 8 5`,className:e.t(t===`asc`?`text-accent-600`:`text-muted-foreground/60`),children:(0,r.jsx)(`path`,{d:`M4 0L8 5H0L4 0Z`,fill:`currentColor`})}),(0,r.jsx)(`svg`,{"aria-hidden":`true`,width:`8`,height:`5`,viewBox:`0 0 8 5`,className:e.t(t===`desc`?`text-accent-600`:`text-muted-foreground/60`),children:(0,r.jsx)(`path`,{d:`M4 5L0 0H8L4 5Z`,fill:`currentColor`})})]})}var c={left:`text-left`,center:`text-center`,right:`text-right`};function l({columns:t,data:l,loading:u=!1,emptyMessage:d=`No data`,onRowClick:f,className:p,toolbarClassName:m,tableClassName:h,searchable:g=!1,searchPlaceholder:_=`Search…`,pageSizeOptions:v=[10,25,50],defaultPageSize:y,density:b=`comfortable`,ariaLabel:x=`Data table`,getRowLabel:S,unstyled:C=!1}){let[w,T]=(0,n.useState)(null),[E,D]=(0,n.useState)(null),[O,k]=(0,n.useState)(``),[A,j]=(0,n.useState)(1),[M,N]=(0,n.useState)(y??(v===!1?1/0:v[0]??10)),P=(0,n.useCallback)(e=>{w===e?E===`asc`?D(`desc`):(T(null),D(null)):(T(e),D(`asc`)),j(1)},[E,w]),F=(0,n.useMemo)(()=>t.filter(e=>e.searchable!==!1&&e.key),[t]),I=(0,n.useMemo)(()=>{let e=O.trim().toLowerCase();return e?l.filter(t=>F.some(n=>{let r=t[n.key];return String(r??``).toLowerCase().includes(e)})):l},[l,O,F]),L=(0,n.useMemo)(()=>!w||!E?I:[...I].sort((e,t)=>{let n=e[w],r=t[w],i=String(n??``).localeCompare(String(r??``),void 0,{numeric:!0});return E===`asc`?i:-i}),[I,w,E]),R=(0,n.useMemo)(()=>{if(v===!1||M===1/0)return L;let e=(A-1)*M;return L.slice(e,e+M)},[L,A,M,v]),z=(0,n.useMemo)(()=>v!==!1&&M!==1/0?Math.max(1,Math.ceil(L.length/M)):1,[L.length,M,v]),B=v!==!1&&M!==1/0&&z>1,V=g||v!==!1&&Array.isArray(v)&&v.length>1,H=(0,n.useCallback)(e=>{k(e.target.value),j(1)},[]),U=(0,n.useCallback)(e=>{N(e),j(1)},[]);return C?(0,r.jsxs)(`div`,{className:e.t(`w-full`,p),children:[g&&(0,r.jsx)(`input`,{"aria-label":_,value:O,onChange:H,placeholder:_}),(0,r.jsx)(`table`,{"aria-label":x,className:h,children:(0,r.jsx)(`tbody`,{children:R.map(e=>(0,r.jsx)(`tr`,{onClick:f?()=>f(e):void 0,children:t.map(t=>(0,r.jsx)(`td`,{children:t.cell(e)},t.key))},e.id))})})]}):(0,r.jsxs)(`div`,{className:e.t(`w-full min-w-0 max-w-full flex flex-col gap-3`,p),children:[V&&(0,r.jsxs)(`div`,{className:e.t(`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,m),children:[g?(0,r.jsxs)(`div`,{className:`relative flex-1 sm:max-w-xs`,children:[(0,r.jsxs)(`svg`,{"aria-hidden":`true`,className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,r.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,r.jsx)(`path`,{d:`m21 21-4.3-4.3`})]}),(0,r.jsx)(`input`,{"aria-label":_,type:`search`,value:O,onChange:H,placeholder:_,className:`h-8 w-full rounded-[var(--radius-md)] border border-border bg-surface pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground transition-colors focus:border-accent-500 focus:outline-none focus:ring-2 focus:ring-focus-ring/20`})]}):(0,r.jsx)(`div`,{}),v!==!1&&Array.isArray(v)&&v.length>1&&(0,r.jsx)(a,{options:v,value:M,onChange:U})]}),(0,r.jsx)(`div`,{style:{contain:`inline-size paint`},className:e.t(`w-full min-w-0 max-w-full overflow-hidden rounded-[var(--radius-lg)] border border-border bg-surface`,h),children:(0,r.jsx)(`div`,{className:`w-full min-w-0 max-w-full overflow-x-auto overscroll-x-contain scrollbar-thin`,children:(0,r.jsxs)(`table`,{"aria-label":x,"data-density":b,className:`group/table w-full text-sm border-collapse`,children:[(0,r.jsx)(`thead`,{className:`border-b border-border bg-surface-muted`,children:(0,r.jsx)(`tr`,{children:t.map(t=>(0,r.jsx)(`th`,{scope:`col`,"aria-sort":w===t.key?E===`asc`?`ascending`:E===`desc`?`descending`:`none`:void 0,style:{width:t.width},className:e.t(`px-4 py-2.5 text-[11px] font-semibold text-muted-foreground group-data-[density=compact]/table:px-3 group-data-[density=compact]/table:py-2`,c[t.align??`left`]),children:t.sortable?(0,r.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-sm transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35`,onClick:()=>P(t.key),children:[t.header,(0,r.jsx)(s,{dir:w===t.key?E:null})]}):t.header},t.key))})}),(0,r.jsx)(`tbody`,{className:`divide-y divide-border`,children:u?Array.from({length:5}).map((e,n)=>(0,r.jsx)(o,{cols:t.length},n)):R.length===0?(0,r.jsx)(`tr`,{children:(0,r.jsx)(`td`,{colSpan:t.length,className:`px-4 py-12 text-center text-sm text-muted-foreground`,children:O?`No results for “${O}”`:d})}):R.map(n=>(0,r.jsx)(`tr`,{tabIndex:f?0:void 0,"aria-label":S?.(n),className:e.t(`transition-colors duration-100 hover:bg-surface-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring/35`,f&&`cursor-pointer`),onClick:f?()=>f(n):void 0,onKeyDown:f?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(n))}:void 0,children:t.map(t=>(0,r.jsx)(`td`,{className:e.t(`px-4 py-3 text-sm tabular-nums text-foreground group-data-[density=compact]/table:px-3 group-data-[density=compact]/table:py-2`,c[t.align??`left`]),children:t.cell(n)},t.key))},n.id))})]})})}),(B||!u&&L.length>0)&&(0,r.jsx)(i,{loading:u,sortedLength:L.length,pageSizeOptions:v,pageSize:M,page:A,totalPages:z,hasPagination:B,setPage:j})]})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
package/dist/drawer-CTeBsYrO.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./cn-BdjraxxU.cjs"),t=require("./component-styles-DOUctc8_.cjs"),n=require("./use-event-callback-Du9_9eAi.cjs"),r=require("./focus-DmG6Ge7X.cjs"),i=require("./createLucideIcon-b_X_3fj-.cjs");let a=require("framer-motion"),o=require("react"),s=require("react/jsx-runtime"),c=require("react-dom");var l=i.t(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function u({open:i,onClose:u,position:d=`left`,title:f,children:p,width:m=320,className:h,overlayClassName:g,panelClassName:_,unstyled:v=!1,ariaLabel:y=`Drawer`,closeAriaLabel:b=`Close drawer`,closeOnEscape:x=!0,closeOnOverlayClick:S=!0}){let C=n.t(u),w=(0,o.useRef)(null),T=(0,o.useRef)(null),E=(0,o.useRef)(i),D=(0,o.useId)();i&&!E.current&&typeof document<`u`&&document.activeElement instanceof HTMLElement&&(T.current=document.activeElement),E.current=i,(0,o.useEffect)(()=>{if(i)return;let e=e=>{e.target instanceof HTMLElement&&(T.current=e.target)};return!T.current&&document.activeElement instanceof HTMLElement&&(T.current=document.activeElement),document.addEventListener(`focusin`,e),()=>document.removeEventListener(`focusin`,e)},[i]),(0,o.useEffect)(()=>{if(!i)return;!T.current&&document.activeElement instanceof HTMLElement&&(T.current=document.activeElement);let e=document.body.style.overflow,t=e=>{if(e.key===`Escape`&&x){e.preventDefault(),C();return}if(e.key===`Tab`&&w.current){let t=r.t(w.current);if(t.length===0){e.preventDefault(),w.current.focus();return}let n=t[0],i=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),n.focus())}};document.addEventListener(`keydown`,t),document.body.style.overflow=`hidden`;let n=window.setTimeout(()=>{(w.current?.querySelector(`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`)??w.current)?.focus()},0);return()=>{clearTimeout(n),document.removeEventListener(`keydown`,t),document.body.style.overflow=e}},[x,i,C]),(0,o.useEffect)(()=>{if(i||!T.current)return;let e=T.current,t=window.setTimeout(()=>e.focus(),240);return()=>window.clearTimeout(t)},[i]);let O=()=>{let e=T.current;T.current=null,window.setTimeout(()=>e?.focus(),0)};if(typeof document>`u`)return null;if(v&&i)return(0,c.createPortal)((0,s.jsx)(`div`,{ref:w,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-label":typeof f==`string`?f:y,className:e.t(h,_),children:p}),document.body);if(d===`bottom`)return(0,c.createPortal)((0,s.jsx)(a.AnimatePresence,{onExitComplete:O,children:i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},className:e.t(`fixed inset-0 z-[100] bg-overlay`,g),onClick:S?C:void 0},`drawer-backdrop`),(0,s.jsxs)(a.motion.div,{ref:w,tabIndex:-1,initial:{y:`100%`},animate:{y:0},exit:{y:`100%`},transition:{duration:.22,ease:[.16,1,.3,1]},role:`dialog`,"aria-modal":`true`,"aria-labelledby":f?D:void 0,"aria-label":f?void 0:y,className:e.t(`fixed bottom-0 left-0 right-0 z-[101] flex max-h-[80dvh] flex-col rounded-t-[var(--radius-xl)] border-t border-border bg-surface-raised shadow-overlay`,_,h),children:[(0,s.jsx)(`div`,{className:`flex justify-center pb-1 pt-3 shrink-0`,"aria-hidden":`true`,children:(0,s.jsx)(`div`,{className:`h-1 w-9 rounded-full bg-border-strong`})}),f&&(0,s.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-5 py-3 shrink-0`,children:[(0,s.jsx)(`h2`,{id:D,className:`text-sm font-semibold text-foreground`,children:f}),(0,s.jsx)(`button`,{type:`button`,onClick:C,className:t.c,"aria-label":b,children:(0,s.jsx)(l,{size:14,"aria-hidden":`true`})})]}),(0,s.jsx)(`div`,{className:`flex-1 overflow-y-auto pb-safe-bottom`,children:p})]},`drawer-panel`)]})}),document.body);let k=d===`left`?`-100%`:`100%`;return(0,c.createPortal)((0,s.jsx)(a.AnimatePresence,{onExitComplete:O,children:i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},className:e.t(`fixed inset-0 z-[100] bg-overlay`,g),onClick:S?C:void 0},`drawer-backdrop`),(0,s.jsxs)(a.motion.div,{ref:w,tabIndex:-1,initial:{x:k},animate:{x:0},exit:{x:k},transition:{duration:.22,ease:[.16,1,.3,1]},role:`dialog`,"aria-modal":`true`,"aria-labelledby":f?D:void 0,"aria-label":f?void 0:y,className:e.t(`fixed top-0 bottom-0 z-[101] flex max-w-[100vw] flex-col bg-surface-raised shadow-overlay`,d===`left`?`left-0 border-r border-border`:`right-0 border-l border-border`,_,h),style:{width:m},children:[f&&(0,s.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-3 border-b border-border px-5 shrink-0`,children:[(0,s.jsx)(`h2`,{id:D,className:`min-w-0 truncate text-sm font-semibold text-foreground`,children:f}),(0,s.jsx)(`button`,{type:`button`,onClick:C,className:t.c,"aria-label":b,children:(0,s.jsx)(l,{size:14,"aria-hidden":`true`})})]}),(0,s.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:p})]},`drawer-panel`)]})}),document.body)}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
package/dist/drawer-ixuzyLVS.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./cn-DpgY2leY.js";
|
|
2
|
-
import { c as t } from "./component-styles-Bgy44fc8.js";
|
|
3
|
-
import { t as n } from "./use-event-callback-DGkfO_uu.js";
|
|
4
|
-
import { t as r } from "./focus-Dk1YWVPN.js";
|
|
5
|
-
import { t as i } from "./createLucideIcon-DDY8HuQR.js";
|
|
6
|
-
import { AnimatePresence as a, motion as o } from "framer-motion";
|
|
7
|
-
import { useEffect as s, useId as c, useRef as l } from "react";
|
|
8
|
-
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
-
import { createPortal as p } from "react-dom";
|
|
10
|
-
var m = i("x", [["path", {
|
|
11
|
-
d: "M18 6 6 18",
|
|
12
|
-
key: "1bl5f8"
|
|
13
|
-
}], ["path", {
|
|
14
|
-
d: "m6 6 12 12",
|
|
15
|
-
key: "d8bk6v"
|
|
16
|
-
}]]);
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/components/drawer.tsx
|
|
19
|
-
function h({ open: i, onClose: h, position: g = "left", title: _, children: v, width: y = 320, className: b, overlayClassName: x, panelClassName: S, unstyled: C = !1, ariaLabel: w = "Drawer", closeAriaLabel: T = "Close drawer", closeOnEscape: E = !0, closeOnOverlayClick: D = !0 }) {
|
|
20
|
-
let O = n(h), k = l(null), A = l(null), j = l(i), M = c();
|
|
21
|
-
i && !j.current && typeof document < "u" && document.activeElement instanceof HTMLElement && (A.current = document.activeElement), j.current = i, s(() => {
|
|
22
|
-
if (i) return;
|
|
23
|
-
let e = (e) => {
|
|
24
|
-
e.target instanceof HTMLElement && (A.current = e.target);
|
|
25
|
-
};
|
|
26
|
-
return !A.current && document.activeElement instanceof HTMLElement && (A.current = document.activeElement), document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
|
|
27
|
-
}, [i]), s(() => {
|
|
28
|
-
if (!i) return;
|
|
29
|
-
!A.current && document.activeElement instanceof HTMLElement && (A.current = document.activeElement);
|
|
30
|
-
let e = document.body.style.overflow, t = (e) => {
|
|
31
|
-
if (e.key === "Escape" && E) {
|
|
32
|
-
e.preventDefault(), O();
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (e.key === "Tab" && k.current) {
|
|
36
|
-
let t = r(k.current);
|
|
37
|
-
if (t.length === 0) {
|
|
38
|
-
e.preventDefault(), k.current.focus();
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
let n = t[0], i = t[t.length - 1];
|
|
42
|
-
e.shiftKey && document.activeElement === n ? (e.preventDefault(), i.focus()) : !e.shiftKey && document.activeElement === i && (e.preventDefault(), n.focus());
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
document.addEventListener("keydown", t), document.body.style.overflow = "hidden";
|
|
46
|
-
let n = window.setTimeout(() => {
|
|
47
|
-
(k.current?.querySelector("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])") ?? k.current)?.focus();
|
|
48
|
-
}, 0);
|
|
49
|
-
return () => {
|
|
50
|
-
clearTimeout(n), document.removeEventListener("keydown", t), document.body.style.overflow = e;
|
|
51
|
-
};
|
|
52
|
-
}, [
|
|
53
|
-
E,
|
|
54
|
-
i,
|
|
55
|
-
O
|
|
56
|
-
]), s(() => {
|
|
57
|
-
if (i || !A.current) return;
|
|
58
|
-
let e = A.current, t = window.setTimeout(() => e.focus(), 240);
|
|
59
|
-
return () => window.clearTimeout(t);
|
|
60
|
-
}, [i]);
|
|
61
|
-
let N = () => {
|
|
62
|
-
let e = A.current;
|
|
63
|
-
A.current = null, window.setTimeout(() => e?.focus(), 0);
|
|
64
|
-
};
|
|
65
|
-
if (typeof document > "u") return null;
|
|
66
|
-
if (C && i) return p(/* @__PURE__ */ d("div", {
|
|
67
|
-
ref: k,
|
|
68
|
-
tabIndex: -1,
|
|
69
|
-
role: "dialog",
|
|
70
|
-
"aria-modal": "true",
|
|
71
|
-
"aria-label": typeof _ == "string" ? _ : w,
|
|
72
|
-
className: e(b, S),
|
|
73
|
-
children: v
|
|
74
|
-
}), document.body);
|
|
75
|
-
if (g === "bottom") return p(/* @__PURE__ */ d(a, {
|
|
76
|
-
onExitComplete: N,
|
|
77
|
-
children: i && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(o.div, {
|
|
78
|
-
initial: { opacity: 0 },
|
|
79
|
-
animate: { opacity: 1 },
|
|
80
|
-
exit: { opacity: 0 },
|
|
81
|
-
transition: { duration: .16 },
|
|
82
|
-
className: e("fixed inset-0 z-[100] bg-overlay", x),
|
|
83
|
-
onClick: D ? O : void 0
|
|
84
|
-
}, "drawer-backdrop"), /* @__PURE__ */ f(o.div, {
|
|
85
|
-
ref: k,
|
|
86
|
-
tabIndex: -1,
|
|
87
|
-
initial: { y: "100%" },
|
|
88
|
-
animate: { y: 0 },
|
|
89
|
-
exit: { y: "100%" },
|
|
90
|
-
transition: {
|
|
91
|
-
duration: .22,
|
|
92
|
-
ease: [
|
|
93
|
-
.16,
|
|
94
|
-
1,
|
|
95
|
-
.3,
|
|
96
|
-
1
|
|
97
|
-
]
|
|
98
|
-
},
|
|
99
|
-
role: "dialog",
|
|
100
|
-
"aria-modal": "true",
|
|
101
|
-
"aria-labelledby": _ ? M : void 0,
|
|
102
|
-
"aria-label": _ ? void 0 : w,
|
|
103
|
-
className: e("fixed bottom-0 left-0 right-0 z-[101] flex max-h-[80dvh] flex-col rounded-t-[var(--radius-xl)] border-t border-border bg-surface-raised shadow-overlay", S, b),
|
|
104
|
-
children: [
|
|
105
|
-
/* @__PURE__ */ d("div", {
|
|
106
|
-
className: "flex justify-center pb-1 pt-3 shrink-0",
|
|
107
|
-
"aria-hidden": "true",
|
|
108
|
-
children: /* @__PURE__ */ d("div", { className: "h-1 w-9 rounded-full bg-border-strong" })
|
|
109
|
-
}),
|
|
110
|
-
_ && /* @__PURE__ */ f("div", {
|
|
111
|
-
className: "flex items-center justify-between border-b border-border px-5 py-3 shrink-0",
|
|
112
|
-
children: [/* @__PURE__ */ d("h2", {
|
|
113
|
-
id: M,
|
|
114
|
-
className: "text-sm font-semibold text-foreground",
|
|
115
|
-
children: _
|
|
116
|
-
}), /* @__PURE__ */ d("button", {
|
|
117
|
-
type: "button",
|
|
118
|
-
onClick: O,
|
|
119
|
-
className: t,
|
|
120
|
-
"aria-label": T,
|
|
121
|
-
children: /* @__PURE__ */ d(m, {
|
|
122
|
-
size: 14,
|
|
123
|
-
"aria-hidden": "true"
|
|
124
|
-
})
|
|
125
|
-
})]
|
|
126
|
-
}),
|
|
127
|
-
/* @__PURE__ */ d("div", {
|
|
128
|
-
className: "flex-1 overflow-y-auto pb-safe-bottom",
|
|
129
|
-
children: v
|
|
130
|
-
})
|
|
131
|
-
]
|
|
132
|
-
}, "drawer-panel")] })
|
|
133
|
-
}), document.body);
|
|
134
|
-
let P = g === "left" ? "-100%" : "100%";
|
|
135
|
-
return p(/* @__PURE__ */ d(a, {
|
|
136
|
-
onExitComplete: N,
|
|
137
|
-
children: i && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(o.div, {
|
|
138
|
-
initial: { opacity: 0 },
|
|
139
|
-
animate: { opacity: 1 },
|
|
140
|
-
exit: { opacity: 0 },
|
|
141
|
-
transition: { duration: .16 },
|
|
142
|
-
className: e("fixed inset-0 z-[100] bg-overlay", x),
|
|
143
|
-
onClick: D ? O : void 0
|
|
144
|
-
}, "drawer-backdrop"), /* @__PURE__ */ f(o.div, {
|
|
145
|
-
ref: k,
|
|
146
|
-
tabIndex: -1,
|
|
147
|
-
initial: { x: P },
|
|
148
|
-
animate: { x: 0 },
|
|
149
|
-
exit: { x: P },
|
|
150
|
-
transition: {
|
|
151
|
-
duration: .22,
|
|
152
|
-
ease: [
|
|
153
|
-
.16,
|
|
154
|
-
1,
|
|
155
|
-
.3,
|
|
156
|
-
1
|
|
157
|
-
]
|
|
158
|
-
},
|
|
159
|
-
role: "dialog",
|
|
160
|
-
"aria-modal": "true",
|
|
161
|
-
"aria-labelledby": _ ? M : void 0,
|
|
162
|
-
"aria-label": _ ? void 0 : w,
|
|
163
|
-
className: e("fixed top-0 bottom-0 z-[101] flex max-w-[100vw] flex-col bg-surface-raised shadow-overlay", g === "left" ? "left-0 border-r border-border" : "right-0 border-l border-border", S, b),
|
|
164
|
-
style: { width: y },
|
|
165
|
-
children: [_ && /* @__PURE__ */ f("div", {
|
|
166
|
-
className: "flex h-14 items-center justify-between gap-3 border-b border-border px-5 shrink-0",
|
|
167
|
-
children: [/* @__PURE__ */ d("h2", {
|
|
168
|
-
id: M,
|
|
169
|
-
className: "min-w-0 truncate text-sm font-semibold text-foreground",
|
|
170
|
-
children: _
|
|
171
|
-
}), /* @__PURE__ */ d("button", {
|
|
172
|
-
type: "button",
|
|
173
|
-
onClick: O,
|
|
174
|
-
className: t,
|
|
175
|
-
"aria-label": T,
|
|
176
|
-
children: /* @__PURE__ */ d(m, {
|
|
177
|
-
size: 14,
|
|
178
|
-
"aria-hidden": "true"
|
|
179
|
-
})
|
|
180
|
-
})]
|
|
181
|
-
}), /* @__PURE__ */ d("div", {
|
|
182
|
-
className: "flex-1 overflow-y-auto",
|
|
183
|
-
children: v
|
|
184
|
-
})]
|
|
185
|
-
}, "drawer-panel")] })
|
|
186
|
-
}), document.body);
|
|
187
|
-
}
|
|
188
|
-
//#endregion
|
|
189
|
-
export { h as t };
|
package/dist/select-BFwx--uK.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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");function c({listId:t,listRef:r,open:a,pos:c,options:u,flat:d,activeIdx:f,setActiveIdx:p,isSelected:m,onSelect:h,colorDot:g,multiselectable:_=!1,className:v}){return typeof document>`u`?null:(0,s.createPortal)((0,o.jsx)(i.AnimatePresence,{children:a&&c&&(0,o.jsx)(i.motion.ul,{ref:r,id:t,role:`listbox`,"aria-multiselectable":_,initial:{opacity:0,y:c.placement===`bottom`?-4:4,scaleY:.97},animate:{opacity:1,y:0,scaleY:1},exit:{opacity:0,y:c.placement===`bottom`?-4:4,scaleY:.97},transition:{duration:.13},style:{originY:c.placement===`bottom`?0:1,position:`fixed`,top:c.top,left:c.left,width:c.width,maxHeight:c.maxHeight},className:e.t(`z-[110] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-surface-raised py-1 shadow-floating`,v),children:u.map((e,r)=>n.a(e)?(0,o.jsxs)(`li`,{children:[(0,o.jsx)(`p`,{className:`px-3 pt-2 pb-1 text-xs font-semibold text-slate-600 uppercase tracking-widest`,children:e.group}),(0,o.jsx)(`ul`,{children:e.options.map(e=>{let n=d.find(t=>t.value===e.value);return(0,o.jsx)(l,{opt:e,listId:t,flatIdx:n.flatIdx,isActive:n.flatIdx===f,isSelected:m(e.value),onSelect:h,onHover:p,colorDot:g},e.value)})})]},r):(0,o.jsx)(l,{opt:e,listId:t,flatIdx:d.find(t=>t.value===e.value).flatIdx,isActive:d.find(t=>t.value===e.value).flatIdx===f,isSelected:m(e.value),onSelect:h,onHover:p,colorDot:g},e.value))})}),document.body)}function l({opt:t,listId:n,flatIdx:r,isActive:i,isSelected:a,onSelect:s,onHover:c,colorDot:l}){return(0,o.jsxs)(`li`,{id:`${n}-opt-${r}`,role:`option`,"aria-selected":a,"aria-disabled":t.disabled,"data-idx":r,onMouseDown:e=>e.preventDefault(),onClick:()=>!t.disabled&&s(t),onMouseEnter:()=>!t.disabled&&c(r),className:e.t(`flex min-h-9 items-center gap-3 px-3 py-2 cursor-pointer transition-colors select-none`,i&&`bg-surface-muted`,a&&!i&&`bg-accent-50 dark:bg-accent-500/10`,t.disabled&&`opacity-40 cursor-not-allowed pointer-events-none`),children:[t.icon&&(0,o.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:t.icon}),t.color&&t.color!=="default"&&(0,o.jsx)(`span`,{className:e.t(`w-2 h-2 rounded-full shrink-0`,l[t.color])}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`p`,{className:e.t(`text-sm leading-snug truncate`,a?`text-accent-700 dark:text-accent-300 font-medium`:`text-foreground`),children:t.label}),t.description&&(0,o.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,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`})})]})}var u=(0,a.forwardRef)(({options:i,value:s,defaultValue:l,onChange:u,placeholder:d=`Select…`,label:f,hint:p,error:m,disabled:h,required:g,clearable:_=!1,className:v,wrapperClassName:y,triggerClassName:b,listClassName:x,id:S,unstyled:C=!1},w)=>{let T=(0,a.useId)(),E=S??T,D=`${E}-list`,O=`${E}-message`,[k,A]=(0,a.useState)(!1),[j,M]=(0,a.useState)(l??``),[N,P]=(0,a.useState)(-1),F=(0,a.useRef)(null),I=(0,a.useRef)(null),L=r.t(e=>u?.(e)),R=s===void 0?j:s,z=(0,a.useMemo)(()=>n.i(i),[i]),B=(0,a.useMemo)(()=>z.find(e=>e.value===R),[z,R]),V=(0,a.useCallback)(e=>{s===void 0&&M(e.value),L(e.value),A(!1),P(-1)},[s,L]),H=(0,a.useCallback)(e=>{e.stopPropagation(),s===void 0&&M(``),L(``)},[s,L]),U=(0,a.useCallback)(e=>{if(!k){if([`Enter`,` `,`ArrowDown`,`ArrowUp`].includes(e.key)){e.preventDefault(),A(!0);let t=z.find(e=>e.value===R&&e.flatIdx>=0)?.flatIdx??-1,n=z.filter(e=>e.flatIdx>=0);P(t>=0?t:e.key===`ArrowUp`?n[n.length-1]?.flatIdx??-1:n[0]?.flatIdx??-1)}return}if(e.key===`ArrowDown`)e.preventDefault(),P(e=>{let t=z.filter(e=>e.flatIdx>=0),n=t.findIndex(t=>t.flatIdx===e);return t[Math.min(n+1,t.length-1)]?.flatIdx??e});else if(e.key===`ArrowUp`)e.preventDefault(),P(e=>{let t=z.filter(e=>e.flatIdx>=0),n=t.findIndex(t=>t.flatIdx===e);return t[Math.max(n-1,0)]?.flatIdx??e});else if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=z.find(e=>e.flatIdx===N);t&&V(t)}else(e.key===`Escape`||e.key===`Tab`)&&(A(!1),P(-1))},[k,z,R,N,V]);(0,a.useEffect)(()=>{N<0||!I.current||I.current.querySelector(`[data-idx="${N}"]`)?.scrollIntoView({block:`nearest`})},[N]),(0,a.useEffect)(()=>{function e(e){let t=e.target;F.current?.contains(t)||I.current?.contains(t)||A(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let W=n.o(k,F);return C?(0,o.jsxs)(`div`,{ref:F,className:e.t(v,y),children:[(0,o.jsx)(`button`,{ref:w,id:E,type:`button`,role:`combobox`,"aria-expanded":k,onClick:()=>A(e=>!e),className:b,children:B?.label??d}),k&&(0,o.jsx)(`ul`,{ref:I,id:D,className:x,children:z.map(e=>(0,o.jsx)(`li`,{"data-idx":e.flatIdx,onClick:()=>V(e),children:e.label},e.value))})]}):(0,o.jsxs)(`div`,{ref:F,className:e.t(`relative`,t.o,y,v),children:[f&&(0,o.jsxs)(`label`,{htmlFor:E,className:`text-xs font-semibold leading-5 text-foreground`,children:[f,g&&(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)`})]})]}),(0,o.jsxs)(`button`,{ref:w,id:E,type:`button`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":k,"aria-controls":D,"aria-activedescendant":k&&N>=0?`${D}-opt-${N}`:void 0,"aria-invalid":m?!0:void 0,"aria-required":g||void 0,"aria-describedby":m||p?O:void 0,disabled:h,onKeyDown:U,onClick:()=>{h||(A(e=>!e),k||P(z.find(e=>e.value===R&&e.flatIdx>=0)?.flatIdx??-1))},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`,m&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,h&&`opacity-50 cursor-not-allowed`,b),children:[B?.icon&&(0,o.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:B.icon}),B?.color&&B.color!=="default"&&(0,o.jsx)(`span`,{className:e.t(`w-2 h-2 rounded-full shrink-0`,n.r[B.color])}),(0,o.jsx)(`span`,{className:e.t(`flex-1 min-w-0 text-sm truncate`,B?`text-foreground`:`text-muted-foreground`),children:B?.label??d}),_&&R&&!h&&(0,o.jsx)(`span`,{role:`button`,tabIndex:-1,onClick:H,className:`shrink-0 text-slate-400 hover:text-slate-600 dark:hover:text-slate-300 transition-colors`,children:(0,o.jsx)(n.n,{})}),(0,o.jsx)(n.t,{open:k})]}),(0,o.jsx)(c,{listId:D,listRef:I,open:k,pos:W,options:i,flat:z,activeIdx:N,setActiveIdx:P,isSelected:e=>e===R,onSelect:V,colorDot:n.r,className:x}),m&&(0,o.jsx)(`p`,{id:O,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:m}),p&&!m&&(0,o.jsx)(`p`,{id:O,className:`text-xs leading-5 text-muted-foreground`,children:p})]})});u.displayName=`SelectSingle`;var d=(0,a.forwardRef)(({options:r,value:i,defaultValue:s,onChange:l,placeholder:u=`Select…`,label:d,hint:f,error:p,disabled:m,required:h,clearable:g=!1,className:_,wrapperClassName:v,triggerClassName:y,listClassName:b,id:x,unstyled:S=!1},C)=>{let w=(0,a.useId)(),T=x??w,E=`${T}-list`,D=`${T}-message`,[O,k]=(0,a.useState)(!1),[A,j]=(0,a.useState)(s??[]),[M,N]=(0,a.useState)(-1),P=(0,a.useRef)(null),F=(0,a.useRef)(null),I=i===void 0?A:i,L=n.i(r),R=L.filter(e=>I.includes(e.value));function z(e){let t=I.includes(e.value)?I.filter(t=>t!==e.value):[...I,e.value];i===void 0&&j(t),l?.(t)}function B(e,t){t.stopPropagation();let n=I.filter(t=>t!==e);i===void 0&&j(n),l?.(n)}function V(e){e.stopPropagation(),i===void 0&&j([]),l?.([])}function H(e){if(!O){[`Enter`,` `,`ArrowDown`,`ArrowUp`].includes(e.key)&&(e.preventDefault(),k(!0));return}if(e.key===`ArrowDown`)e.preventDefault(),N(e=>{let t=L.filter(e=>e.flatIdx>=0),n=t.findIndex(t=>t.flatIdx===e);return t[Math.min(n+1,t.length-1)]?.flatIdx??e});else if(e.key===`ArrowUp`)e.preventDefault(),N(e=>{let t=L.filter(e=>e.flatIdx>=0),n=t.findIndex(t=>t.flatIdx===e);return t[Math.max(n-1,0)]?.flatIdx??e});else if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=L.find(e=>e.flatIdx===M);t&&z(t)}else(e.key===`Escape`||e.key===`Tab`)&&(k(!1),N(-1))}(0,a.useEffect)(()=>{M<0||!F.current||F.current.querySelector(`[data-idx="${M}"]`)?.scrollIntoView({block:`nearest`})},[M]),(0,a.useEffect)(()=>{function e(e){let t=e.target;P.current?.contains(t)||F.current?.contains(t)||k(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let U=n.o(O,P);return S?(0,o.jsxs)(`div`,{ref:P,className:e.t(_,v),children:[(0,o.jsx)(`button`,{ref:C,id:T,type:`button`,role:`combobox`,"aria-expanded":O,"aria-controls":E,onKeyDown:H,onClick:()=>k(e=>!e),className:y,children:R.length>0?R.map(e=>e.label).join(`, `):u}),(0,o.jsx)(c,{listId:E,listRef:F,open:O,pos:U,options:r,flat:L,activeIdx:M,setActiveIdx:N,isSelected:e=>I.includes(e),onSelect:z,multiselectable:!0,colorDot:n.r,className:b})]}):(0,o.jsxs)(`div`,{ref:P,className:e.t(`relative`,t.o,v,_),children:[d&&(0,o.jsxs)(`label`,{htmlFor:T,className:`text-xs font-semibold leading-5 text-foreground`,children:[d,h&&(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)`})]})]}),(0,o.jsxs)(`button`,{ref:C,id:T,type:`button`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":O,"aria-controls":E,"aria-activedescendant":O&&M>=0?`${E}-opt-${M}`:void 0,"aria-invalid":p?!0:void 0,"aria-required":h||void 0,"aria-describedby":p||f?D:void 0,disabled:m,onKeyDown:H,onClick:()=>{m||k(e=>!e)},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 text-left outline-none`,t.t,`focus:border-accent-500 focus:ring-2 focus:ring-focus-ring/20`,p&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,m&&`opacity-50 cursor-not-allowed`,y),children:[R.length===0?(0,o.jsx)(`span`,{className:`flex-1 text-sm text-slate-500 truncate`,children:u}):R.map(t=>(0,o.jsxs)(`span`,{className:`inline-flex max-w-[160px] items-center gap-1 rounded-md border border-border bg-surface-muted px-2 py-0.5 text-xs font-medium text-foreground`,children:[t.color&&t.color!=="default"&&(0,o.jsx)(`span`,{className:e.t(`w-1.5 h-1.5 rounded-full shrink-0`,n.r[t.color])}),(0,o.jsx)(`span`,{className:`truncate`,children:t.label}),(0,o.jsx)(`span`,{role:`button`,tabIndex:-1,onMouseDown:e=>e.stopPropagation(),onClick:e=>B(t.value,e),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 ${t.label}`,children:(0,o.jsx)(n.n,{})})]},t.value)),(0,o.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 shrink-0 pl-1`,children:[g&&I.length>0&&!m&&(0,o.jsx)(`span`,{role:`button`,tabIndex:-1,onClick:V,className:`text-slate-500 hover:text-slate-600 dark:hover:text-slate-300 transition-colors`,"aria-label":`Clear all`,children:(0,o.jsx)(n.n,{})}),I.length>0&&(0,o.jsx)(`span`,{className:`text-[10px] font-medium text-slate-500 tabular-nums`,children:I.length}),(0,o.jsx)(n.t,{open:O})]})]}),(0,o.jsx)(c,{listId:E,listRef:F,open:O,pos:U,options:r,flat:L,activeIdx:M,setActiveIdx:N,isSelected:e=>I.includes(e),onSelect:z,multiselectable:!0,colorDot:n.r,className:b}),p&&(0,o.jsx)(`p`,{id:D,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:p}),f&&!p&&(0,o.jsx)(`p`,{id:D,className:`text-xs leading-5 text-muted-foreground`,children:f})]})});d.displayName=`SelectMulti`;var f=(0,a.forwardRef)((e,t)=>e.multiple?(0,o.jsx)(d,{...e,ref:t}):(0,o.jsx)(u,{...e,ref:t}));f.displayName=`Select`,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./cn-DpgY2leY.js";
|
|
2
|
-
import { s as t } from "./component-styles-Bgy44fc8.js";
|
|
3
|
-
import { t as n } from "./createLucideIcon-DDY8HuQR.js";
|
|
4
|
-
import { useTheme as r } from "./components/theme-provider.js";
|
|
5
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
var o = n("moon", [["path", {
|
|
7
|
-
d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",
|
|
8
|
-
key: "kfwtm"
|
|
9
|
-
}]]), s = n("sun", [
|
|
10
|
-
["circle", {
|
|
11
|
-
cx: "12",
|
|
12
|
-
cy: "12",
|
|
13
|
-
r: "4",
|
|
14
|
-
key: "4exip2"
|
|
15
|
-
}],
|
|
16
|
-
["path", {
|
|
17
|
-
d: "M12 2v2",
|
|
18
|
-
key: "tus03m"
|
|
19
|
-
}],
|
|
20
|
-
["path", {
|
|
21
|
-
d: "M12 20v2",
|
|
22
|
-
key: "1lh1kg"
|
|
23
|
-
}],
|
|
24
|
-
["path", {
|
|
25
|
-
d: "m4.93 4.93 1.41 1.41",
|
|
26
|
-
key: "149t6j"
|
|
27
|
-
}],
|
|
28
|
-
["path", {
|
|
29
|
-
d: "m17.66 17.66 1.41 1.41",
|
|
30
|
-
key: "ptbguv"
|
|
31
|
-
}],
|
|
32
|
-
["path", {
|
|
33
|
-
d: "M2 12h2",
|
|
34
|
-
key: "1t8f8n"
|
|
35
|
-
}],
|
|
36
|
-
["path", {
|
|
37
|
-
d: "M20 12h2",
|
|
38
|
-
key: "1q8mjw"
|
|
39
|
-
}],
|
|
40
|
-
["path", {
|
|
41
|
-
d: "m6.34 17.66-1.41 1.41",
|
|
42
|
-
key: "1m8zz5"
|
|
43
|
-
}],
|
|
44
|
-
["path", {
|
|
45
|
-
d: "m19.07 4.93-1.41 1.41",
|
|
46
|
-
key: "1shlcs"
|
|
47
|
-
}]
|
|
48
|
-
]);
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/components/theme-toggle.tsx
|
|
51
|
-
function c({ lightIcon: n = /* @__PURE__ */ i(s, { "aria-hidden": "true" }), darkIcon: c = /* @__PURE__ */ i(o, { "aria-hidden": "true" }), showLabel: l = !1, lightLabel: u = "Use light theme", darkLabel: d = "Use dark theme", className: f, onClick: p, type: m = "button", ...h }) {
|
|
52
|
-
let { resolvedTheme: g, toggleTheme: _ } = r(), v = g === "dark", y = v ? u : d;
|
|
53
|
-
return /* @__PURE__ */ a("button", {
|
|
54
|
-
type: m,
|
|
55
|
-
"aria-label": y,
|
|
56
|
-
title: y,
|
|
57
|
-
"aria-pressed": v,
|
|
58
|
-
"data-theme": g,
|
|
59
|
-
className: e("inline-flex h-9 items-center justify-center gap-2 rounded-[var(--radius-md)] border border-border bg-surface px-3 text-sm font-medium text-foreground shadow-xs transition-colors", "hover:border-border-strong hover:bg-surface-muted", t, !l && "w-9 px-0 [&_svg]:size-4", l && "[&_svg]:size-4", f),
|
|
60
|
-
onClick: (e) => {
|
|
61
|
-
p?.(e), e.defaultPrevented || _();
|
|
62
|
-
},
|
|
63
|
-
...h,
|
|
64
|
-
children: [/* @__PURE__ */ i("span", {
|
|
65
|
-
"aria-hidden": "true",
|
|
66
|
-
children: v ? n : c
|
|
67
|
-
}), l && /* @__PURE__ */ i("span", { children: y })]
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
//#endregion
|
|
71
|
-
export { c as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./cn-BdjraxxU.cjs"),t=require("./component-styles-DOUctc8_.cjs"),n=require("./createLucideIcon-b_X_3fj-.cjs"),r=require("./components/theme-provider.cjs");let i=require("react/jsx-runtime");var a=n.t(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),o=n.t(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]);function s({lightIcon:n=(0,i.jsx)(o,{"aria-hidden":`true`}),darkIcon:s=(0,i.jsx)(a,{"aria-hidden":`true`}),showLabel:c=!1,lightLabel:l=`Use light theme`,darkLabel:u=`Use dark theme`,className:d,onClick:f,type:p=`button`,...m}){let{resolvedTheme:h,toggleTheme:g}=r.useTheme(),_=h===`dark`,v=_?l:u;return(0,i.jsxs)(`button`,{type:p,"aria-label":v,title:v,"aria-pressed":_,"data-theme":h,className:e.t(`inline-flex h-9 items-center justify-center gap-2 rounded-[var(--radius-md)] border border-border bg-surface px-3 text-sm font-medium text-foreground shadow-xs transition-colors`,`hover:border-border-strong hover:bg-surface-muted`,t.s,!c&&`w-9 px-0 [&_svg]:size-4`,c&&`[&_svg]:size-4`,d),onClick:e=>{f?.(e),e.defaultPrevented||g()},...m,children:[(0,i.jsx)(`span`,{"aria-hidden":`true`,children:_?n:s}),c&&(0,i.jsx)(`span`,{children:v})]})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|