@waveinno/ui 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +31 -13
  3. package/dist/components/brand/waveinno-logo.js +1 -1
  4. package/dist/components/charts/bar-list.js +1 -1
  5. package/dist/components/charts/heatmap.js +1 -1
  6. package/dist/components/patterns/activity-feed.js +1 -1
  7. package/dist/components/patterns/app-launcher.js +1 -1
  8. package/dist/components/patterns/data-table-edit.js +1 -1
  9. package/dist/components/patterns/data-table-filters.js +1 -1
  10. package/dist/components/patterns/data-table.js +1 -1
  11. package/dist/components/patterns/index.d.ts +1 -0
  12. package/dist/components/patterns/index.js +1 -1
  13. package/dist/components/patterns/org-chart.d.ts +48 -0
  14. package/dist/components/patterns/org-chart.js +1 -0
  15. package/dist/components/patterns/page-header.js +1 -1
  16. package/dist/components/patterns/page-hero.js +1 -1
  17. package/dist/components/patterns/stat-card.js +1 -1
  18. package/dist/components/patterns/timeline.js +1 -1
  19. package/dist/components/ui/accordion.d.ts +30 -0
  20. package/dist/components/ui/accordion.js +1 -0
  21. package/dist/components/ui/alert.js +1 -1
  22. package/dist/components/ui/avatar.js +1 -1
  23. package/dist/components/ui/badge.js +1 -1
  24. package/dist/components/ui/button.js +1 -1
  25. package/dist/components/ui/calendar.js +1 -1
  26. package/dist/components/ui/carousel.d.ts +27 -0
  27. package/dist/components/ui/carousel.js +1 -0
  28. package/dist/components/ui/checkbox.js +1 -1
  29. package/dist/components/ui/color-picker.d.ts +14 -0
  30. package/dist/components/ui/color-picker.js +1 -0
  31. package/dist/components/ui/combobox.js +1 -1
  32. package/dist/components/ui/confirm-dialog.d.ts +24 -11
  33. package/dist/components/ui/confirm-dialog.js +1 -1
  34. package/dist/components/ui/date-picker.d.ts +18 -1
  35. package/dist/components/ui/date-picker.js +1 -1
  36. package/dist/components/ui/dialog.js +1 -1
  37. package/dist/components/ui/dropdown-menu.js +1 -1
  38. package/dist/components/ui/file-upload.d.ts +12 -4
  39. package/dist/components/ui/file-upload.js +1 -1
  40. package/dist/components/ui/hover-card.d.ts +17 -0
  41. package/dist/components/ui/hover-card.js +1 -0
  42. package/dist/components/ui/index.d.ts +10 -0
  43. package/dist/components/ui/index.js +1 -1
  44. package/dist/components/ui/kbd.js +1 -1
  45. package/dist/components/ui/menu.d.ts +24 -0
  46. package/dist/components/ui/menu.js +1 -1
  47. package/dist/components/ui/pagination.d.ts +51 -0
  48. package/dist/components/ui/pagination.js +1 -0
  49. package/dist/components/ui/password-input.js +1 -1
  50. package/dist/components/ui/pin-input.js +1 -1
  51. package/dist/components/ui/popover.js +1 -1
  52. package/dist/components/ui/progress.js +1 -1
  53. package/dist/components/ui/radio-group.js +1 -1
  54. package/dist/components/ui/rating.d.ts +27 -0
  55. package/dist/components/ui/rating.js +1 -0
  56. package/dist/components/ui/scroll-area.d.ts +17 -0
  57. package/dist/components/ui/scroll-area.js +1 -0
  58. package/dist/components/ui/segmented.d.ts +1 -1
  59. package/dist/components/ui/segmented.js +1 -1
  60. package/dist/components/ui/sheet.js +1 -1
  61. package/dist/components/ui/slider.d.ts +18 -6
  62. package/dist/components/ui/slider.js +1 -1
  63. package/dist/components/ui/spinner.js +1 -1
  64. package/dist/components/ui/steps.d.ts +36 -0
  65. package/dist/components/ui/steps.js +1 -0
  66. package/dist/components/ui/tabs.js +1 -1
  67. package/dist/components/ui/tag-input.d.ts +33 -0
  68. package/dist/components/ui/tag-input.js +1 -0
  69. package/dist/components/ui/toast.js +1 -1
  70. package/dist/components/ui/tree-view.d.ts +38 -0
  71. package/dist/components/ui/tree-view.js +1 -0
  72. package/dist/hooks/index.d.ts +1 -0
  73. package/dist/hooks/index.js +1 -1
  74. package/dist/hooks/use-router.d.ts +41 -0
  75. package/dist/hooks/use-router.js +1 -0
  76. package/dist/lib/index.d.ts +1 -0
  77. package/dist/lib/index.js +1 -1
  78. package/dist/lib/theme.d.ts +48 -0
  79. package/dist/lib/theme.js +7 -0
  80. package/dist/next/index.d.ts +6 -0
  81. package/dist/next/index.js +1 -0
  82. package/dist/shell/app-shell.js +1 -1
  83. package/dist/shell/app-switcher.js +1 -1
  84. package/dist/shell/command-palette.js +1 -1
  85. package/dist/shell/icon-rail.js +1 -1
  86. package/dist/shell/mobile-nav.js +1 -1
  87. package/dist/shell/module-sidebar.js +1 -1
  88. package/dist/shell/notifications.js +1 -1
  89. package/dist/shell/placeholder-screen.js +1 -1
  90. package/dist/shell/topbar.js +1 -1
  91. package/dist/shell/use-active.js +1 -1
  92. package/dist/shell/user-menu.js +1 -1
  93. package/dist/styles.css +91 -5
  94. package/package.json +14 -1
@@ -1 +1 @@
1
- "use client";import{Fragment as T,jsx as e,jsxs as s}from"react/jsx-runtime";import*as l from"@radix-ui/react-dialog";import{Maximize2 as y,Minimize2 as w,PanelRightClose as D,PanelRightOpen as R,X as N}from"lucide-react";import*as n from"react";import{cn as a}from"../../lib/utils.js";const C={sm:"max-w-[420px]",md:"max-w-[520px]",lg:"max-w-[680px]",xl:"max-w-[880px]"},E=l.Root,H=l.Trigger,W=l.Close,f=n.forwardRef(({className:r,...t},i)=>e(l.Overlay,{ref:i,"data-scrim":"",className:a("fixed inset-0 z-50 bg-[rgba(5,8,22,.42)] backdrop-blur-[3px]",r),...t}));f.displayName="DialogOverlay";const z=n.forwardRef(({className:r,children:t,width:i,size:p="md",hideClose:m,variant:d="drawer",resizable:g=!0,...u},v)=>{const[o,b]=n.useState("base"),c=d==="drawer",h=!c||o==="base"?i??C[p]:o==="wide"?"max-w-[min(1040px,calc(100vw-16px))]":"max-w-none sm:left-2",x="hidden size-8 cursor-pointer place-items-center rounded-full border border-border bg-raised/80 text-muted backdrop-blur transition-[background-color,color,transform] hover:bg-hover hover:text-text active:scale-95 sm:grid";return s(l.Portal,{children:[e(f,{}),s(l.Content,{ref:v,...d==="drawer"?{"data-sheet":"right"}:{"data-dialog":""},className:a("z-50 flex flex-col overflow-hidden bg-raised outline-none",d==="drawer"?"fixed inset-y-0 right-0 h-dvh w-full border-border max-sm:border-l sm:inset-y-2 sm:right-2 sm:h-[calc(100dvh-16px)] sm:rounded-[16px] sm:border":"fixed left-1/2 top-1/2 w-[calc(100vw-32px)] -translate-x-1/2 -translate-y-1/2 max-h-[calc(100dvh-48px)] rounded-[16px] border border-border",h,c&&"transition-[max-width,left] duration-300 ease-[cubic-bezier(.3,.7,.2,1)]",r),...u,children:[t,m?null:s("div",{className:a("absolute z-10 flex items-center gap-1.5",d==="drawer"?"right-4 top-4":"right-3 top-3"),children:[c&&g?s(T,{children:[e("button",{type:"button","aria-label":o==="wide"?"Back to normal width":"Widen",title:o==="wide"?"Back to normal width":"Widen",onClick:()=>b(o==="wide"?"base":"wide"),className:a(x,o==="wide"&&"border-primary/40 bg-primary-subtle text-primary"),children:o==="wide"?e(D,{className:"size-4"}):e(R,{className:"size-4"})}),e("button",{type:"button","aria-label":o==="full"?"Exit full width":"Full width",title:o==="full"?"Exit full width":"Full width",onClick:()=>b(o==="full"?"base":"full"),className:a(x,o==="full"&&"border-primary/40 bg-primary-subtle text-primary"),children:o==="full"?e(w,{className:"size-3.5"}):e(y,{className:"size-3.5"})})]}):null,e("kbd",{className:"hidden rounded-[5px] border border-border bg-surface px-1.5 py-0.5 font-sans text-[10.5px] text-muted sm:block",children:"esc"}),s(l.Close,{className:"grid size-8 cursor-pointer place-items-center rounded-full border border-border bg-raised/80 text-muted backdrop-blur transition-[background-color,color,transform] hover:bg-hover hover:text-text active:scale-95",children:[e(N,{className:"size-4"}),e("span",{className:"sr-only",children:"Close"})]})]})]})]})});z.displayName="DialogContent";const L=({className:r,icon:t,eyebrow:i,children:p,...m})=>s("div",{className:a("relative isolate flex shrink-0 items-start gap-3.5 border-b border-border px-6 pb-4 pt-5 pr-28 sm:pr-48","before:absolute before:inset-0 before:-z-10 before:bg-[radial-gradient(120%_100%_at_0%_0%,var(--primary-subtle),transparent_60%)] before:opacity-70",r),...m,children:[t?e("span",{className:"grid size-10 shrink-0 place-items-center rounded-[11px] border border-primary/15 bg-raised text-primary shadow-[0_1px_2px_rgba(5,8,22,.14)] [&>svg]:size-5",children:t}):null,s("div",{className:"min-w-0 flex-1",children:[i?e("p",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-primary",children:i}):null,p]})]}),O=({className:r,...t})=>e("div",{className:a("min-h-0 flex-1 overflow-y-auto px-6 py-5",r),...t}),S=({className:r,...t})=>e("div",{className:a("mt-auto flex shrink-0 items-center justify-end gap-2 border-t border-border bg-raised/85 px-6 py-4 backdrop-blur-md",r),...t}),P=n.forwardRef(({className:r,...t},i)=>e(l.Title,{ref:i,className:a("disp text-[16px] font-semibold leading-6 text-text",r),...t}));P.displayName="DialogTitle";const k=n.forwardRef(({className:r,...t},i)=>e(l.Description,{ref:i,className:a("mt-1 text-[13px] leading-5 text-muted",r),...t}));k.displayName="DialogDescription";export{E as Dialog,O as DialogBody,W as DialogClose,z as DialogContent,k as DialogDescription,S as DialogFooter,L as DialogHeader,f as DialogOverlay,P as DialogTitle,H as DialogTrigger};
1
+ "use client";import{Fragment as T,jsx as e,jsxs as s}from"react/jsx-runtime";import*as l from"@radix-ui/react-dialog";import{Maximize2 as y,Minimize2 as w,PanelRightClose as D,PanelRightOpen as R,X as N}from"lucide-react";import*as d from"react";import{cn as i}from"../../lib/utils.js";const C={sm:"max-w-[420px]",md:"max-w-[520px]",lg:"max-w-[680px]",xl:"max-w-[880px]"},E=l.Root,H=l.Trigger,W=l.Close,f=d.forwardRef(({className:r,...t},o)=>e(l.Overlay,{ref:o,"data-scrim":"",className:i("fixed inset-0 z-50 bg-[rgba(5,8,22,.42)] backdrop-blur-[3px]",r),...t}));f.displayName="DialogOverlay";const z=d.forwardRef(({className:r,children:t,width:o,size:c="md",hideClose:p,variant:n="drawer",resizable:u=!0,...g},v)=>{const[a,b]=d.useState("base"),m=n==="drawer",h=!m||a==="base"?o??C[c]:a==="wide"?"max-w-[min(1040px,calc(100vw-16px))]":"max-w-none sm:left-2",x="hidden size-8 cursor-pointer place-items-center rounded-full border border-border bg-raised/80 text-muted backdrop-blur transition-[background-color,color,transform] hover:bg-hover hover:text-text active:scale-95 sm:grid";return s(l.Portal,{children:[e(f,{}),s(l.Content,{ref:v,...n==="drawer"?{"data-sheet":"right"}:{"data-dialog":""},className:i("z-50 flex flex-col overflow-hidden bg-raised outline-none",n==="drawer"?"fixed inset-y-0 right-0 h-dvh w-full border-border max-sm:border-l sm:inset-y-2 sm:right-2 sm:h-[calc(100dvh-16px)] sm:rounded-[calc(16px*var(--radius-scale))] sm:border":"fixed left-1/2 top-1/2 w-[calc(100vw-32px)] -translate-x-1/2 -translate-y-1/2 max-h-[calc(100dvh-48px)] rounded-[calc(16px*var(--radius-scale))] border border-border",h,m&&"transition-[max-width,left] duration-300 ease-[cubic-bezier(.3,.7,.2,1)]",r),...g,children:[t,p?null:s("div",{className:i("absolute z-10 flex items-center gap-1.5",n==="drawer"?"right-4 top-4":"right-3 top-3"),children:[m&&u?s(T,{children:[e("button",{type:"button","aria-label":a==="wide"?"Back to normal width":"Widen",title:a==="wide"?"Back to normal width":"Widen",onClick:()=>b(a==="wide"?"base":"wide"),className:i(x,a==="wide"&&"border-primary/40 bg-primary-subtle text-primary"),children:a==="wide"?e(D,{className:"size-4"}):e(R,{className:"size-4"})}),e("button",{type:"button","aria-label":a==="full"?"Exit full width":"Full width",title:a==="full"?"Exit full width":"Full width",onClick:()=>b(a==="full"?"base":"full"),className:i(x,a==="full"&&"border-primary/40 bg-primary-subtle text-primary"),children:a==="full"?e(w,{className:"size-3.5"}):e(y,{className:"size-3.5"})})]}):null,e("kbd",{className:"hidden rounded-[calc(5px*var(--radius-scale))] border border-border bg-surface px-1.5 py-0.5 font-sans text-[10.5px] text-muted sm:block",children:"esc"}),s(l.Close,{className:"grid size-8 cursor-pointer place-items-center rounded-full border border-border bg-raised/80 text-muted backdrop-blur transition-[background-color,color,transform] hover:bg-hover hover:text-text active:scale-95",children:[e(N,{className:"size-4"}),e("span",{className:"sr-only",children:"Close"})]})]})]})]})});z.displayName="DialogContent";const L=({className:r,icon:t,eyebrow:o,children:c,...p})=>s("div",{className:i("relative isolate flex shrink-0 items-start gap-3.5 border-b border-border px-6 pb-4 pt-5 pr-28 sm:pr-48","before:absolute before:inset-0 before:-z-10 before:bg-[radial-gradient(120%_100%_at_0%_0%,var(--primary-subtle),transparent_60%)] before:opacity-70",r),...p,children:[t?e("span",{className:"grid size-10 shrink-0 place-items-center rounded-[calc(11px*var(--radius-scale))] border border-primary/15 bg-raised text-primary shadow-[0_1px_2px_rgba(5,8,22,.14)] [&>svg]:size-5",children:t}):null,s("div",{className:"min-w-0 flex-1",children:[o?e("p",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-primary",children:o}):null,c]})]}),O=({className:r,...t})=>e("div",{className:i("min-h-0 flex-1 overflow-y-auto px-6 py-5",r),...t}),S=({className:r,...t})=>e("div",{className:i("mt-auto flex shrink-0 items-center justify-end gap-2 border-t border-border bg-raised/85 px-6 py-4 backdrop-blur-md",r),...t}),P=d.forwardRef(({className:r,...t},o)=>e(l.Title,{ref:o,className:i("disp text-[16px] font-semibold leading-6 text-text",r),...t}));P.displayName="DialogTitle";const k=d.forwardRef(({className:r,...t},o)=>e(l.Description,{ref:o,className:i("mt-1 text-[13px] leading-5 text-muted",r),...t}));k.displayName="DialogDescription";export{E as Dialog,O as DialogBody,W as DialogClose,z as DialogContent,k as DialogDescription,S as DialogFooter,L as DialogHeader,f as DialogOverlay,P as DialogTitle,H as DialogTrigger};
@@ -1 +1 @@
1
- "use client";import{Fragment as I,jsx as t,jsxs as d}from"react/jsx-runtime";import*as a from"@radix-ui/react-dropdown-menu";import{Check as l,ChevronRight as v}from"lucide-react";import*as s from"react";import{cn as i}from"../../lib/utils.js";const S=a.Root,T=a.Trigger,W=a.Group,_=a.Sub,z=a.RadioGroup,f="z-50 min-w-48 overflow-hidden rounded-dlg border border-border bg-raised p-1 shadow-elev3",b=s.createContext("default"),x={default:"",glass:"border-white/40 bg-raised/70 backdrop-blur-xl backdrop-saturate-150 dark:border-white/10",dark:"dark border-white/10 bg-[#140d33] text-white [--hover:rgba(255,255,255,.08)] [--text:#f5f6fa] [--body:#d6d8e6] [--muted:#9aa1bd] [--border:rgba(255,255,255,.1)]"},w=s.forwardRef(({className:o,sideOffset:e=6,variant:n="default",...r},p)=>t(b.Provider,{value:n,children:t(a.Portal,{children:t(a.Content,{ref:p,"data-pop":"",sideOffset:e,className:i(f,x[n],o),...r})})}));w.displayName="DropdownMenuContent";const m="relative flex cursor-pointer select-none items-center gap-2.5 rounded-ctl px-2.5 py-2 text-[13px] text-body outline-none transition-colors data-[highlighted]:bg-hover data-[highlighted]:text-text data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted",C=s.forwardRef(({className:o,danger:e,icon:n,description:r,shortcut:p,badge:c,children:u,...g},R)=>{const h=n!==void 0||r!==void 0||p!==void 0||c!==void 0;return t(a.Item,{ref:R,className:i(m,r&&"items-start py-2",e&&"text-danger data-[highlighted]:bg-danger-subtle data-[highlighted]:text-danger [&_svg]:text-danger",o),...g,children:h?d(I,{children:[n?t("span",{className:i("grid shrink-0 place-items-center rounded-[8px] border border-border bg-surface",r?"size-8":"size-6",e&&"border-danger/20 bg-danger-subtle"),children:n}):null,d("span",{className:"min-w-0 flex-1",children:[d("span",{className:"flex items-center gap-2",children:[t("span",{className:"truncate",children:u}),c]}),r?t("span",{className:"mt-0.5 block text-[11.5px] leading-4 text-muted",children:r}):null]}),p?t("kbd",{className:"ml-auto self-center rounded-[5px] border border-border bg-surface px-1.5 py-px font-sans text-[10.5px] text-muted",children:p}):null]}):u})});C.displayName="DropdownMenuItem";const N=s.forwardRef(({className:o,children:e,...n},r)=>d(a.CheckboxItem,{ref:r,className:i(m,"pr-8",o),...n,children:[e,t(a.ItemIndicator,{className:"absolute right-2.5",children:t(l,{className:"size-3.5 !text-primary",strokeWidth:3})})]}));N.displayName="DropdownMenuCheckboxItem";const P=s.forwardRef(({className:o,children:e,...n},r)=>d(a.RadioItem,{ref:r,className:i(m,"pr-8",o),...n,children:[e,t(a.ItemIndicator,{className:"absolute right-2.5",children:t(l,{className:"size-3.5 !text-primary",strokeWidth:3})})]}));P.displayName="DropdownMenuRadioItem";const V=({className:o,...e})=>t(a.Label,{className:i("ov px-2.5 pb-1 pt-2",o),...e}),L=({className:o,...e})=>t(a.Separator,{className:i("-mx-1 my-1 h-px bg-border",o),...e}),G=({className:o,...e})=>t("span",{className:i("ml-auto text-[11px] tracking-wide text-muted",o),...e}),y=s.forwardRef(({className:o,children:e,...n},r)=>d(a.SubTrigger,{ref:r,className:i(m,"data-[state=open]:bg-hover",o),...n,children:[e,t(v,{className:"ml-auto size-3.5"})]}));y.displayName="DropdownMenuSubTrigger";const M=s.forwardRef(({className:o,...e},n)=>{const r=s.useContext(b);return t(a.Portal,{children:t(a.SubContent,{ref:n,"data-pop":"",className:i(f,x[r],o),...e})})});M.displayName="DropdownMenuSubContent";function H({title:o,subtitle:e,media:n,className:r}){return d("div",{className:i("flex items-center gap-3 rounded-[10px] bg-[radial-gradient(120%_120%_at_0%_0%,var(--primary-subtle),transparent_60%)] px-2.5 py-2.5",r),children:[n,d("div",{className:"min-w-0",children:[t("p",{className:"truncate text-[13px] font-semibold text-text",children:o}),e?t("p",{className:"truncate text-[11.5px] text-muted",children:e}):null]})]})}export{S as DropdownMenu,N as DropdownMenuCheckboxItem,w as DropdownMenuContent,W as DropdownMenuGroup,H as DropdownMenuHeader,C as DropdownMenuItem,V as DropdownMenuLabel,z as DropdownMenuRadioGroup,P as DropdownMenuRadioItem,L as DropdownMenuSeparator,G as DropdownMenuShortcut,_ as DropdownMenuSub,M as DropdownMenuSubContent,y as DropdownMenuSubTrigger,T as DropdownMenuTrigger};
1
+ "use client";import{Fragment as I,jsx as t,jsxs as d}from"react/jsx-runtime";import*as a from"@radix-ui/react-dropdown-menu";import{Check as l,ChevronRight as h}from"lucide-react";import*as s from"react";import{cn as i}from"../../lib/utils.js";const S=a.Root,T=a.Trigger,W=a.Group,_=a.Sub,z=a.RadioGroup,f="z-50 min-w-48 overflow-hidden rounded-dlg border border-border bg-raised p-1 shadow-elev3",b=s.createContext("default"),x={default:"",glass:"border-white/40 bg-raised/70 backdrop-blur-xl backdrop-saturate-150 dark:border-white/10",dark:"dark border-white/10 bg-[var(--ink)] text-white [--hover:rgba(255,255,255,.08)] [--text:#f5f6fa] [--body:#d6d8e6] [--muted:#9aa1bd] [--border:rgba(255,255,255,.1)]"},w=s.forwardRef(({className:o,sideOffset:e=6,variant:n="default",...r},p)=>t(b.Provider,{value:n,children:t(a.Portal,{children:t(a.Content,{ref:p,"data-pop":"",sideOffset:e,className:i(f,x[n],o),...r})})}));w.displayName="DropdownMenuContent";const m="relative flex cursor-pointer select-none items-center gap-2.5 rounded-ctl px-2.5 py-2 text-[13px] text-body outline-none transition-colors data-[highlighted]:bg-hover data-[highlighted]:text-text data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted",C=s.forwardRef(({className:o,danger:e,icon:n,description:r,shortcut:p,badge:c,children:u,...g},R)=>{const v=n!==void 0||r!==void 0||p!==void 0||c!==void 0;return t(a.Item,{ref:R,className:i(m,r&&"items-start py-2",e&&"text-danger data-[highlighted]:bg-danger-subtle data-[highlighted]:text-danger [&_svg]:text-danger",o),...g,children:v?d(I,{children:[n?t("span",{className:i("grid shrink-0 place-items-center rounded-[calc(8px*var(--radius-scale))] border border-border bg-surface",r?"size-8":"size-6",e&&"border-danger/20 bg-danger-subtle"),children:n}):null,d("span",{className:"min-w-0 flex-1",children:[d("span",{className:"flex items-center gap-2",children:[t("span",{className:"truncate",children:u}),c]}),r?t("span",{className:"mt-0.5 block text-[11.5px] leading-4 text-muted",children:r}):null]}),p?t("kbd",{className:"ml-auto self-center rounded-[calc(5px*var(--radius-scale))] border border-border bg-surface px-1.5 py-px font-sans text-[10.5px] text-muted",children:p}):null]}):u})});C.displayName="DropdownMenuItem";const N=s.forwardRef(({className:o,children:e,...n},r)=>d(a.CheckboxItem,{ref:r,className:i(m,"pr-8",o),...n,children:[e,t(a.ItemIndicator,{className:"absolute right-2.5",children:t(l,{className:"size-3.5 !text-primary",strokeWidth:3})})]}));N.displayName="DropdownMenuCheckboxItem";const P=s.forwardRef(({className:o,children:e,...n},r)=>d(a.RadioItem,{ref:r,className:i(m,"pr-8",o),...n,children:[e,t(a.ItemIndicator,{className:"absolute right-2.5",children:t(l,{className:"size-3.5 !text-primary",strokeWidth:3})})]}));P.displayName="DropdownMenuRadioItem";const V=({className:o,...e})=>t(a.Label,{className:i("ov px-2.5 pb-1 pt-2",o),...e}),L=({className:o,...e})=>t(a.Separator,{className:i("-mx-1 my-1 h-px bg-border",o),...e}),G=({className:o,...e})=>t("span",{className:i("ml-auto text-[11px] tracking-wide text-muted",o),...e}),y=s.forwardRef(({className:o,children:e,...n},r)=>d(a.SubTrigger,{ref:r,className:i(m,"data-[state=open]:bg-hover",o),...n,children:[e,t(h,{className:"ml-auto size-3.5"})]}));y.displayName="DropdownMenuSubTrigger";const M=s.forwardRef(({className:o,...e},n)=>{const r=s.useContext(b);return t(a.Portal,{children:t(a.SubContent,{ref:n,"data-pop":"",className:i(f,x[r],o),...e})})});M.displayName="DropdownMenuSubContent";function H({title:o,subtitle:e,media:n,className:r}){return d("div",{className:i("flex items-center gap-3 rounded-[calc(10px*var(--radius-scale))] bg-[radial-gradient(120%_120%_at_0%_0%,var(--primary-subtle),transparent_60%)] px-2.5 py-2.5",r),children:[n,d("div",{className:"min-w-0",children:[t("p",{className:"truncate text-[13px] font-semibold text-text",children:o}),e?t("p",{className:"truncate text-[11.5px] text-muted",children:e}):null]})]})}export{S as DropdownMenu,N as DropdownMenuCheckboxItem,w as DropdownMenuContent,W as DropdownMenuGroup,H as DropdownMenuHeader,C as DropdownMenuItem,V as DropdownMenuLabel,z as DropdownMenuRadioGroup,P as DropdownMenuRadioItem,L as DropdownMenuSeparator,G as DropdownMenuShortcut,_ as DropdownMenuSub,M as DropdownMenuSubContent,y as DropdownMenuSubTrigger,T as DropdownMenuTrigger};
@@ -8,10 +8,16 @@ import * as React from "react";
8
8
  * icon. Pass `progress` (by file name, 0–100) to show uploads moving, and
9
9
  * `failed` for the ones to retry.
10
10
  *
11
- * Looks: `dropzone` (default, a dashed area) and `compact` (one row with a
12
- * button, for a form with other fields).
11
+ * Looks:
12
+ * dropzone — the default: a dashed area. Imports, attachments.
13
+ * card — a large drop target with a moving brand border while a file is
14
+ * over it, and the accepted types as chips. The one upload a page is for.
15
+ * compact — one row with a button, inside a form with other fields.
16
+ * button — just a button, the files listed under it. Tight spaces.
17
+ * gallery — image tiles with an add tile; progress rings on the tiles. Site photos.
18
+ * avatar — one round image with change and remove. A profile photo, a logo.
13
19
  */
14
- export type FileUploadVariant = "dropzone" | "compact";
20
+ export type FileUploadVariant = "dropzone" | "card" | "compact" | "button" | "gallery" | "avatar";
15
21
  export interface FileUploadProps {
16
22
  value?: File[];
17
23
  defaultValue?: File[];
@@ -30,7 +36,9 @@ export interface FileUploadProps {
30
36
  /** Names of files whose upload failed; they get a retry button. */
31
37
  failed?: string[];
32
38
  onRetry?: (file: File) => void;
39
+ /** avatar: the current image (a URL) before a new one is picked. */
40
+ currentUrl?: string;
33
41
  disabled?: boolean;
34
42
  className?: string;
35
43
  }
36
- export declare function FileUpload({ value, defaultValue, onValueChange, accept, multiple, maxSize, maxFiles, variant, title, hint, progress, failed, onRetry, disabled, className, }: FileUploadProps): React.JSX.Element;
44
+ export declare function FileUpload({ value, defaultValue, onValueChange, accept, multiple: multipleProp, maxSize, maxFiles, variant, title, hint, progress, failed, onRetry, currentUrl, disabled, className, }: FileUploadProps): React.JSX.Element;
@@ -1 +1 @@
1
- "use client";import{Fragment as Q,jsx as t,jsxs as n}from"react/jsx-runtime";import{CloudUpload as j,File as A,FileImage as H,FileSpreadsheet as K,FileText as X,RotateCcw as q,X as E}from"lucide-react";import*as c from"react";import{cn as x}from"../../lib/utils.js";const k=r=>r<1024*1024?`${Math.max(1,Math.round(r/1024))} KB`:`${(r/1024/1024).toFixed(1)} MB`;function G(r,i){return i?i.split(",").some(u=>{const a=u.trim().toLowerCase();return a.startsWith(".")?r.name.toLowerCase().endsWith(a):a.endsWith("/*")?r.type.startsWith(a.slice(0,-1)):r.type===a}):!0}function O({file:r}){const i=r.name.toLowerCase();return r.type.startsWith("image/")?t(H,{}):/\.(csv|xlsx?|ods)$/.test(i)?t(K,{}):/\.(pdf|docx?|txt|md)$/.test(i)?t(X,{}):t(A,{})}function J({file:r}){const[i,u]=c.useState(null);return c.useEffect(()=>{if(!r.type.startsWith("image/"))return;const a=URL.createObjectURL(r);return u(a),()=>URL.revokeObjectURL(a)},[r]),t("span",{className:"grid size-10 shrink-0 place-items-center overflow-hidden rounded-[9px] border border-border bg-surface text-muted [&_svg]:size-[18px]",children:i?t("img",{src:i,alt:"",className:"size-full object-cover"}):t(O,{file:r})})}function ee({value:r,defaultValue:i=[],onValueChange:u,accept:a,multiple:h=!0,maxSize:m,maxFiles:p,variant:M="dropzone",title:z,hint:W,progress:I,failed:T,onRetry:F,disabled:b,className:B}){const[V,P]=c.useState(i),g=r??V,[R,_]=c.useState([]),[f,y]=c.useState(!1),N=c.useRef(null),v=c.useRef(0),$=e=>{r===void 0&&P(e),u?.(e)},C=e=>{if(!e)return;const s=[],o=[];for(const d of Array.from(e))G(d,a)?m&&d.size>m?o.push({file:d,reason:`Over ${k(m)}`}):s.push(d):o.push({file:d,reason:"Not an accepted type"});let l=h?[...g,...s.filter(d=>!g.some(L=>L.name===d.name&&L.size===d.size))]:s.slice(0,1);p&&l.length>p&&(l.slice(p).forEach(d=>o.push({file:d,reason:`Only ${p} file${p>1?"s":""}`})),l=l.slice(0,p)),_(o),$(l)},S=e=>$(g.filter(s=>s!==e)),w=W??[a?.split(",").map(e=>e.trim().replace(/^\./,"").toUpperCase()).join(", "),m?`up to ${k(m)}`:null].filter(Boolean).join(" \xB7 "),D=t("input",{ref:N,type:"file",className:"sr-only",tabIndex:-1,accept:a,multiple:h,disabled:b,onChange:e=>{C(e.target.files),e.target.value=""}}),U={onDragEnter:e=>{e.preventDefault(),v.current+=1,y(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:()=>{v.current-=1,v.current<=0&&y(!1)},onDrop:e=>{e.preventDefault(),v.current=0,y(!1),b||C(e.dataTransfer.files)}};return n("div",{className:x("w-full space-y-2.5",B),children:[M==="dropzone"?n("button",{type:"button",disabled:b,onClick:()=>N.current?.click(),...U,className:x("group relative flex w-full cursor-pointer flex-col items-center justify-center gap-2 overflow-hidden rounded-[14px] border-[1.5px] border-dashed border-border2 bg-surface px-6 py-8 text-center outline-none","transition-[border-color,background-color,box-shadow] duration-200 hover:border-primary/50 hover:bg-primary-subtle/30 focus-visible:ring-2 focus-visible:ring-primary/35",f&&"border-primary bg-primary-subtle/50 shadow-[0_0_0_4px_var(--primary-subtle)]",b&&"cursor-not-allowed opacity-50"),children:[t("span",{className:x("grid size-12 place-items-center rounded-[14px] border border-border bg-raised text-primary shadow-[var(--lit),0_4px_12px_-6px_rgba(79,70,229,.45)] transition-transform duration-300 ease-[cubic-bezier(.3,1.5,.5,1)] [&_svg]:size-[22px]",f?"-translate-y-1 scale-110":"group-hover:-translate-y-0.5"),children:t(j,{})}),t("span",{className:"text-[13.5px] font-semibold text-text",children:f?"Drop to add":z??n(Q,{children:[n("span",{className:"text-primary",children:["Choose ",h?"files":"a file"]})," or drag ",h?"them":"it"," here"]})}),w?t("span",{className:"text-[12px] text-muted",children:w}):null,D]}):n("div",{...U,className:x("flex items-center gap-3 rounded-ctl border border-dashed border-border2 bg-surface p-2 pl-3 transition-colors",f&&"border-primary bg-primary-subtle/50"),children:[t(j,{className:"size-4 shrink-0 text-muted"}),t("span",{className:"min-w-0 flex-1 truncate text-[12.5px] text-muted",children:f?"Drop to add":z??w??"Drag files here"}),t("button",{type:"button",disabled:b,onClick:()=>N.current?.click(),className:"h-7 shrink-0 cursor-pointer rounded-[7px] border border-border2 bg-raised px-2.5 text-[12px] font-medium text-text shadow-[0_1px_1px_rgba(5,8,22,.05)] transition-colors hover:bg-hover disabled:cursor-not-allowed disabled:opacity-50",children:"Browse"}),D]}),g.length||R.length?n("ul",{className:"space-y-1.5",children:[g.map(e=>{const s=I?.[e.name],o=T?.includes(e.name),l=s!==void 0&&s<100&&!o;return n("li",{className:"flex items-center gap-3 rounded-[11px] border border-border bg-raised p-2 pr-2.5 animate-[wave-in_220ms_var(--ease)]",children:[t(J,{file:e}),n("span",{className:"min-w-0 flex-1",children:[t("span",{className:"block truncate text-[13px] font-medium text-text",children:e.name}),n("span",{className:x("num flex items-center gap-1.5 text-[11.5px]",o?"text-danger":"text-muted"),children:[k(e.size),o?" \xB7 Upload failed":s===100?" \xB7 Uploaded":l?` \xB7 ${Math.round(s)}%`:null]}),l?t("span",{className:"mt-1.5 block h-1 overflow-hidden rounded-full bg-hover",children:t("span",{className:"block h-full rounded-full bg-[linear-gradient(90deg,#1f45ea,#7560fd)] transition-[width] duration-300",style:{width:`${s}%`}})}):null]}),o&&F?t("button",{type:"button",onClick:()=>F(e),"aria-label":`Retry ${e.name}`,className:"grid size-7 cursor-pointer place-items-center rounded-[7px] text-danger transition-colors hover:bg-danger-subtle [&_svg]:size-3.5",children:t(q,{})}):null,t("button",{type:"button",onClick:()=>S(e),"aria-label":`Remove ${e.name}`,className:"grid size-7 cursor-pointer place-items-center rounded-[7px] text-muted transition-colors hover:bg-hover hover:text-text [&_svg]:size-3.5",children:t(E,{})})]},`${e.name}-${e.size}-${e.lastModified}`)}),R.map(({file:e,reason:s})=>n("li",{className:"flex items-center gap-3 rounded-[11px] border border-danger/25 bg-danger-subtle/50 p-2 pr-2.5",role:"alert",children:[t("span",{className:"grid size-10 shrink-0 place-items-center rounded-[9px] border border-danger/20 bg-raised text-danger [&_svg]:size-[18px]",children:t(O,{file:e})}),n("span",{className:"min-w-0 flex-1",children:[t("span",{className:"block truncate text-[13px] font-medium text-text",children:e.name}),n("span",{className:"text-[11.5px] text-danger",children:[s," \xB7 not added"]})]}),t("button",{type:"button",onClick:()=>_(o=>o.filter(l=>l.file!==e)),"aria-label":`Dismiss ${e.name}`,className:"grid size-7 cursor-pointer place-items-center rounded-[7px] text-muted transition-colors hover:bg-raised hover:text-text [&_svg]:size-3.5",children:t(E,{})})]},`x-${e.name}-${e.size}`))]}):null]})}export{ee as FileUpload};
1
+ "use client";import{Fragment as ue,jsx as e,jsxs as a}from"react/jsx-runtime";import{Camera as H,CloudUpload as K,File as ae,FileImage as X,FileSpreadsheet as J,FileText as se,ImagePlus as oe,RotateCcw as Q,Trash2 as ne,Upload as S,X as P}from"lucide-react";import*as y from"react";import{cn as c}from"../../lib/utils.js";const F=t=>t<1024*1024?`${Math.max(1,Math.round(t/1024))} KB`:`${(t/1024/1024).toFixed(1)} MB`;function ie(t,s){return s?s.split(",").some(i=>{const n=i.trim().toLowerCase();return n.startsWith(".")?t.name.toLowerCase().endsWith(n):n.endsWith("/*")?t.type.startsWith(n.slice(0,-1)):t.type===n}):!0}function W({file:t}){const s=t.name.toLowerCase();return t.type.startsWith("image/")?e(X,{}):/\.(csv|xlsx?|ods)$/.test(s)?e(J,{}):/\.(pdf|docx?|txt|md)$/.test(s)?e(se,{}):e(ae,{})}function O(t){const[s,i]=y.useState(null);return y.useEffect(()=>{if(!t||!t.type.startsWith("image/"))return i(null);const n=URL.createObjectURL(t);return i(n),()=>URL.revokeObjectURL(n)},[t]),s}function le({file:t}){const s=O(t);return e("span",{className:"grid size-10 shrink-0 place-items-center overflow-hidden rounded-[calc(9px*var(--radius-scale))] border border-border bg-surface text-muted [&_svg]:size-[18px]",children:s?e("img",{src:s,alt:"",className:"size-full object-cover"}):e(W,{file:t})})}function de({value:t,size:s=36}){const i=s/2-3,n=2*Math.PI*i;return a("svg",{width:s,height:s,viewBox:`0 0 ${s} ${s}`,className:"-rotate-90","aria-hidden":!0,children:[e("circle",{cx:s/2,cy:s/2,r:i,fill:"none",stroke:"rgba(255,255,255,.3)",strokeWidth:"3"}),e("circle",{cx:s/2,cy:s/2,r:i,fill:"none",stroke:"#fff",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:n*(1-t/100),className:"transition-[stroke-dashoffset] duration-300"})]})}function ce({file:t,progress:s,failed:i,onRemove:n,onRetry:z}){const p=O(t),l=s!==void 0&&s<100&&!i;return a("div",{className:"group/tile relative aspect-square animate-[wm-pop_220ms_var(--ease)] overflow-hidden rounded-[calc(12px*var(--radius-scale))] border border-border bg-surface",children:[p?e("img",{src:p,alt:t.name,className:"size-full object-cover"}):e("span",{className:"grid size-full place-items-center text-muted [&_svg]:size-6",children:e(W,{file:t})}),l?e("span",{className:"absolute inset-0 grid place-items-center bg-ink/45 backdrop-blur-[2px]",children:e(de,{value:s})}):null,i?e("button",{type:"button",onClick:z,"aria-label":`Retry ${t.name}`,className:"absolute inset-0 grid cursor-pointer place-items-center bg-danger/70 text-white [&_svg]:size-5",children:e(Q,{})}):null,e("button",{type:"button",onClick:n,"aria-label":`Remove ${t.name}`,className:"absolute right-1.5 top-1.5 grid size-6 cursor-pointer place-items-center rounded-full bg-ink/70 text-white opacity-0 backdrop-blur transition-opacity group-hover/tile:opacity-100 focus-visible:opacity-100 [&_svg]:size-3.5",children:e(P,{})}),e("span",{className:"pointer-events-none absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/60 to-transparent px-2 pb-1.5 pt-4 text-[11px] font-medium text-white opacity-0 transition-opacity group-hover/tile:opacity-100",children:t.name})]})}function ge({value:t,defaultValue:s=[],onValueChange:i,accept:n,multiple:z,maxSize:p,maxFiles:l,variant:h="dropzone",title:v,hint:j,progress:R,failed:C,onRetry:u,currentUrl:Y,disabled:f,className:L}){const $=h==="avatar"?!1:z??!0,[Z,ee]=y.useState(s),m=t??Z,[U,T]=y.useState([]),[d,E]=y.useState(!1),B=y.useRef(null),D=y.useRef(0),I=r=>{t===void 0&&ee(r),i?.(r)},A=r=>{if(!r)return;const o=[],b=[];for(const x of Array.from(r))ie(x,n)?p&&x.size>p?b.push({file:x,reason:`Over ${F(p)}`}):o.push(x):b.push({file:x,reason:"Not an accepted type"});let g=$?[...m,...o.filter(x=>!m.some(G=>G.name===x.name&&G.size===x.size))]:o.slice(0,1).length?o.slice(0,1):m;l&&g.length>l&&(g.slice(l).forEach(x=>b.push({file:x,reason:`Only ${l} file${l>1?"s":""}`})),g=g.slice(0,l)),T(b),I(g)},V=r=>I(m.filter(o=>o!==r)),_=()=>B.current?.click(),M=n?.split(",").map(r=>r.trim().replace(/^\./,"").replace("/*","").toUpperCase()),N=j??[M?.join(", "),p?`up to ${F(p)}`:null].filter(Boolean).join(" \xB7 "),k=e("input",{ref:B,type:"file",className:"sr-only",tabIndex:-1,accept:n,multiple:$,disabled:f,onChange:r=>{A(r.target.files),r.target.value=""}}),w={onDragEnter:r=>{r.preventDefault(),D.current+=1,E(!0)},onDragOver:r=>r.preventDefault(),onDragLeave:()=>{D.current-=1,D.current<=0&&E(!1)},onDrop:r=>{r.preventDefault(),D.current=0,E(!1),f||A(r.dataTransfer.files)}},q=U.map(({file:r,reason:o})=>a("li",{className:"flex items-center gap-3 rounded-[calc(11px*var(--radius-scale))] border border-danger/25 bg-danger-subtle/50 p-2 pr-2.5",role:"alert",children:[e("span",{className:"grid size-10 shrink-0 place-items-center rounded-[calc(9px*var(--radius-scale))] border border-danger/20 bg-raised text-danger [&_svg]:size-[18px]",children:e(W,{file:r})}),a("span",{className:"min-w-0 flex-1",children:[e("span",{className:"block truncate text-[13px] font-medium text-text",children:r.name}),a("span",{className:"text-[11.5px] text-danger",children:[o," \xB7 not added"]})]}),e("button",{type:"button",onClick:()=>T(b=>b.filter(g=>g.file!==r)),"aria-label":`Dismiss ${r.name}`,className:"grid size-7 cursor-pointer place-items-center rounded-[calc(7px*var(--radius-scale))] text-muted transition-colors hover:bg-raised hover:text-text [&_svg]:size-3.5",children:e(P,{})})]},`x-${r.name}-${r.size}`));if(h==="avatar")return e(pe,{file:m[0],currentUrl:Y,picker:k,open:_,dropProps:w,over:d,disabled:f,title:v,hint:N,onRemove:()=>I([]),rejected:U[0]?.reason,className:L});if(h==="gallery"){const r=l!==void 0&&m.length>=l;return a("div",{className:c("w-full space-y-2.5",L),...w,children:[a("div",{className:c("grid grid-cols-3 gap-2.5 rounded-[calc(14px*var(--radius-scale))] transition-[box-shadow] sm:grid-cols-4",d&&"shadow-[0_0_0_3px_var(--primary-subtle)]"),children:[m.map(o=>e(ce,{file:o,progress:R?.[o.name],failed:C?.includes(o.name),onRemove:()=>V(o),onRetry:u?()=>u(o):void 0},`${o.name}-${o.size}-${o.lastModified}`)),r?null:a("button",{type:"button",disabled:f,onClick:_,className:c("group/add grid aspect-square cursor-pointer place-items-center rounded-[calc(12px*var(--radius-scale))] border-[1.5px] border-dashed border-border2 bg-surface text-muted outline-none transition-[border-color,background-color,color]","hover:border-primary/50 hover:bg-primary-subtle/40 hover:text-primary focus-visible:ring-2 focus-visible:ring-primary/35",d&&"border-primary bg-primary-subtle/50 text-primary"),children:[a("span",{className:"flex flex-col items-center gap-1.5 px-2 text-center",children:[e(oe,{className:"size-6 transition-transform duration-300 ease-[cubic-bezier(.3,1.5,.5,1)] group-hover/add:-translate-y-0.5 group-hover/add:scale-110"}),e("span",{className:"text-[11.5px] font-medium",children:d?"Drop to add":v??"Add photos"}),l?a("span",{className:"num text-[10.5px] text-muted",children:[m.length,"/",l]}):null]}),k]})]}),U.length?e("ul",{className:"space-y-1.5",children:q}):null]})}const re=m.length||U.length?a("ul",{className:"space-y-1.5",children:[m.map(r=>{const o=R?.[r.name],b=C?.includes(r.name),g=o!==void 0&&o<100&&!b;return a("li",{className:"flex animate-[wave-in_220ms_var(--ease)] items-center gap-3 rounded-[calc(11px*var(--radius-scale))] border border-border bg-raised p-2 pr-2.5",children:[e(le,{file:r}),a("span",{className:"min-w-0 flex-1",children:[e("span",{className:"block truncate text-[13px] font-medium text-text",children:r.name}),a("span",{className:c("num flex items-center gap-1.5 text-[11.5px]",b?"text-danger":"text-muted"),children:[F(r.size),b?" \xB7 Upload failed":o===100?" \xB7 Uploaded":g?` \xB7 ${Math.round(o)}%`:null]}),g?e("span",{className:"mt-1.5 block h-1 overflow-hidden rounded-full bg-hover",children:e("span",{className:"block h-full rounded-full bg-[linear-gradient(90deg,var(--brand-1),var(--brand-2))] transition-[width] duration-300",style:{width:`${o}%`}})}):null]}),b&&u?e("button",{type:"button",onClick:()=>u(r),"aria-label":`Retry ${r.name}`,className:"grid size-7 cursor-pointer place-items-center rounded-[calc(7px*var(--radius-scale))] text-danger transition-colors hover:bg-danger-subtle [&_svg]:size-3.5",children:e(Q,{})}):null,e("button",{type:"button",onClick:()=>V(r),"aria-label":`Remove ${r.name}`,className:"grid size-7 cursor-pointer place-items-center rounded-[calc(7px*var(--radius-scale))] text-muted transition-colors hover:bg-hover hover:text-text [&_svg]:size-3.5",children:e(P,{})})]},`${r.name}-${r.size}-${r.lastModified}`)}),q]}):null,te=d?"Drop to add":v??a(ue,{children:[a("span",{className:"text-primary",children:["Choose ",$?"files":"a file"]})," or drag ",$?"them":"it"," here"]});return a("div",{className:c("w-full space-y-2.5",L),children:[h==="dropzone"?a("button",{type:"button",disabled:f,onClick:_,...w,className:c("group relative flex w-full cursor-pointer flex-col items-center justify-center gap-2 overflow-hidden rounded-[calc(14px*var(--radius-scale))] border-[1.5px] border-dashed border-border2 bg-surface px-6 py-8 text-center outline-none","transition-[border-color,background-color,box-shadow] duration-200 hover:border-primary/50 hover:bg-primary-subtle/30 focus-visible:ring-2 focus-visible:ring-primary/35",d&&"border-primary bg-primary-subtle/50 shadow-[0_0_0_4px_var(--primary-subtle)]",f&&"cursor-not-allowed opacity-50"),children:[e("span",{className:c("grid size-12 place-items-center rounded-[calc(14px*var(--radius-scale))] border border-border bg-raised text-primary shadow-[var(--lit),0_4px_12px_-6px_color-mix(in_srgb,var(--primary)_45%,transparent)] transition-transform duration-300 ease-[cubic-bezier(.3,1.5,.5,1)] [&_svg]:size-[22px]",d?"-translate-y-1 scale-110":"group-hover:-translate-y-0.5"),children:e(K,{})}),e("span",{className:"text-[13.5px] font-semibold text-text",children:te}),N?e("span",{className:"text-[12px] text-muted",children:N}):null,k]}):h==="card"?a("div",{...w,className:c("group/card relative isolate overflow-hidden rounded-[calc(18px*var(--radius-scale))] p-[1.5px]",f&&"pointer-events-none opacity-50"),children:[e("span",{"aria-hidden":!0,className:c("absolute inset-[-60%] -z-10 bg-[conic-gradient(from_0deg,var(--brand-1),var(--brand-2),transparent_35%,transparent_65%,var(--brand-1))] transition-opacity duration-300",d?"animate-[spin_2.4s_linear_infinite] opacity-100":"opacity-0 group-hover/card:opacity-60")}),e("span",{"aria-hidden":!0,className:c("absolute inset-0 -z-10 rounded-[inherit] border border-border transition-opacity",d&&"opacity-0")}),a("div",{className:"relative flex flex-col items-center gap-3 rounded-[calc(16.5px*var(--radius-scale))] bg-[radial-gradient(120%_90%_at_50%_0%,var(--primary-subtle),transparent_60%),var(--raised)] px-6 py-10 text-center",children:[a("span",{className:"relative mb-1 h-14 w-16","aria-hidden":!0,children:[e("span",{className:"absolute left-0 top-2 grid size-11 -rotate-12 place-items-center rounded-[calc(10px*var(--radius-scale))] border border-border bg-raised text-muted shadow-[0_4px_12px_-6px_rgba(5,8,22,.3)] transition-transform duration-500 ease-[cubic-bezier(.3,1.5,.5,1)] group-hover/card:-translate-x-1 group-hover/card:-rotate-[18deg] [&_svg]:size-5",children:e(J,{})}),e("span",{className:"absolute right-0 top-2 grid size-11 rotate-12 place-items-center rounded-[calc(10px*var(--radius-scale))] border border-border bg-raised text-muted shadow-[0_4px_12px_-6px_rgba(5,8,22,.3)] transition-transform duration-500 ease-[cubic-bezier(.3,1.5,.5,1)] group-hover/card:translate-x-1 group-hover/card:rotate-[18deg] [&_svg]:size-5",children:e(X,{})}),e("span",{className:c("absolute left-1/2 top-0 grid size-12 -translate-x-1/2 place-items-center rounded-[calc(12px*var(--radius-scale))] bg-[linear-gradient(135deg,var(--brand-1),var(--brand-2))] text-white shadow-[inset_0_1px_0_rgba(255,255,255,.3),0_10px_22px_-10px_var(--brand-1)] transition-transform duration-500 ease-[cubic-bezier(.3,1.5,.5,1)] group-hover/card:-translate-y-1 [&_svg]:size-6",d&&"-translate-y-2 scale-110"),children:e(S,{})})]}),e("p",{className:"disp text-[16px] font-semibold text-text",children:d?"Drop to upload":v??"Drag and drop files"}),a("p",{className:"text-[12.5px] text-muted",children:["or"," ",e("button",{type:"button",onClick:_,className:"cursor-pointer font-semibold text-primary underline-offset-4 hover:underline",children:"browse your computer"}),p?` \xB7 up to ${F(p)} each`:""]}),M?.length?e("div",{className:"flex flex-wrap justify-center gap-1.5",children:M.map(r=>e("span",{className:"rounded-full border border-border bg-surface px-2 py-0.5 font-mono text-[10.5px] font-medium text-muted",children:r},r))}):null,k]})]}):h==="button"?a("div",{...w,className:"flex items-center gap-3",children:[a("button",{type:"button",disabled:f,onClick:_,className:c("inline-flex h-ctl cursor-pointer items-center gap-2 rounded-ctl border border-border2 bg-raised px-3.5 text-[13px] font-medium text-text shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.06)] outline-none transition-colors hover:bg-hover focus-visible:ring-2 focus-visible:ring-primary/35 disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:size-4",d&&"border-primary bg-primary-subtle text-primary"),children:[e(S,{})," ",d?"Drop to add":v??($?"Upload files":"Upload a file")]}),N?e("span",{className:"text-[12px] text-muted",children:N}):null,k]}):a("div",{...w,className:c("flex items-center gap-3 rounded-ctl border border-dashed border-border2 bg-surface p-2 pl-3 transition-colors",d&&"border-primary bg-primary-subtle/50"),children:[e(K,{className:"size-4 shrink-0 text-muted"}),e("span",{className:"min-w-0 flex-1 truncate text-[12.5px] text-muted",children:d?"Drop to add":v??(N||"Drag files here")}),e("button",{type:"button",disabled:f,onClick:_,className:"h-7 shrink-0 cursor-pointer rounded-[calc(7px*var(--radius-scale))] border border-border2 bg-raised px-2.5 text-[12px] font-medium text-text shadow-[0_1px_1px_rgba(5,8,22,.05)] transition-colors hover:bg-hover disabled:cursor-not-allowed disabled:opacity-50",children:"Browse"}),k]}),re]})}function pe({file:t,currentUrl:s,picker:i,open:n,dropProps:z,over:p,disabled:l,title:h,hint:v,onRemove:j,rejected:R,className:C}){const u=O(t)??s??null;return a("div",{className:c("flex items-center gap-4",C),...z,children:[a("button",{type:"button",onClick:n,disabled:l,"aria-label":u?"Change photo":"Add a photo",className:c("group/av relative grid size-20 shrink-0 cursor-pointer place-items-center overflow-hidden rounded-full outline-none ring-offset-2 ring-offset-[var(--canvas)] transition-[box-shadow] focus-visible:ring-2 focus-visible:ring-primary/50",u?"shadow-[0_0_0_3px_var(--raised),0_0_0_5px_color-mix(in_srgb,var(--primary)_35%,transparent)]":"border-[1.5px] border-dashed border-border2 bg-surface text-muted hover:border-primary/50 hover:text-primary",p&&"shadow-[0_0_0_3px_var(--raised),0_0_0_6px_var(--primary)]"),children:[u?e("img",{src:u,alt:"",className:"size-full object-cover"}):e(H,{className:"size-6"}),u?e("span",{className:"absolute inset-0 grid place-items-center bg-ink/55 text-white opacity-0 backdrop-blur-[1px] transition-opacity group-hover/av:opacity-100 [&_svg]:size-5",children:e(H,{})}):null,i]}),a("div",{className:"min-w-0 space-y-1.5",children:[e("p",{className:"text-[13.5px] font-semibold text-text",children:h??"Profile photo"}),R?e("p",{className:"text-[12px] text-danger",children:R}):v?e("p",{className:"text-[12px] text-muted",children:v}):null,a("div",{className:"flex gap-2",children:[e("button",{type:"button",onClick:n,disabled:l,className:"h-7 cursor-pointer rounded-[calc(7px*var(--radius-scale))] border border-border2 bg-raised px-2.5 text-[12px] font-medium text-text transition-colors hover:bg-hover",children:u?"Change":"Upload"}),t?a("button",{type:"button",onClick:j,className:"inline-flex h-7 cursor-pointer items-center gap-1 rounded-[calc(7px*var(--radius-scale))] px-2 text-[12px] font-medium text-danger transition-colors hover:bg-danger-subtle [&_svg]:size-3.5",children:[e(ne,{})," Remove"]}):null]})]})]})}export{ge as FileUpload};
@@ -0,0 +1,17 @@
1
+ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
2
+ import * as React from "react";
3
+ /**
4
+ * HoverCard — a preview of what a link or name points to, on hover or focus:
5
+ * a person, a site, a vehicle. For sighted mouse users it saves a click; it
6
+ * must never hold the only way to do something (touch has no hover).
7
+ *
8
+ * Looks: `default` (raised), `glass` (frosted, over maps and media), `dark`
9
+ * (ink). `arrow` points at the trigger.
10
+ */
11
+ export declare const HoverCard: ({ openDelay, closeDelay, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>) => React.JSX.Element;
12
+ export declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
13
+ export type HoverCardVariant = "default" | "glass" | "dark";
14
+ export declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
+ variant?: HoverCardVariant;
16
+ arrow?: boolean;
17
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as t,jsxs as C}from"react/jsx-runtime";import*as r from"@radix-ui/react-hover-card";import*as b from"react";import{cn as v}from"../../lib/utils.js";const g=({openDelay:o=250,closeDelay:a=120,...e})=>t(r.Root,{openDelay:o,closeDelay:a,...e}),m=r.Trigger,n={default:{box:"border-border bg-raised",arrow:"fill-[var(--raised)]"},glass:{box:"border-white/40 bg-raised/70 backdrop-blur-xl backdrop-saturate-150 dark:border-white/10",arrow:"fill-[var(--raised)] opacity-80"},dark:{box:"border-white/10 bg-ink text-[#d6d8e6] [--text:#f5f6fa] [--body:#d6d8e6] [--muted:#9aa1bd] [--border:rgba(255,255,255,.1)] [--hover:rgba(255,255,255,.08)] [--surface:rgba(255,255,255,.05)]",arrow:"fill-[var(--ink)]"}},f=b.forwardRef(({className:o,align:a="center",sideOffset:e=8,variant:d="default",arrow:i=!1,children:l,...s},p)=>t(r.Portal,{children:C(r.Content,{ref:p,"data-pop":"",align:a,sideOffset:i?e+2:e,collisionPadding:12,className:v("z-50 w-72 rounded-dlg border p-4 text-[13px] shadow-elev3 outline-none",n[d].box,o),...s,children:[l,i?t(r.Arrow,{width:14,height:7,className:n[d].arrow}):null]})}));f.displayName="HoverCardContent";export{g as HoverCard,f as HoverCardContent,m as HoverCardTrigger};
@@ -1,11 +1,14 @@
1
1
  /** Primitives: small, unopinionated building blocks (Radix underneath where it helps). */
2
+ export * from "./accordion";
2
3
  export * from "./alert";
3
4
  export * from "./avatar";
4
5
  export * from "./badge";
5
6
  export * from "./button";
6
7
  export * from "./calendar";
7
8
  export * from "./card";
9
+ export * from "./carousel";
8
10
  export * from "./checkbox";
11
+ export * from "./color-picker";
9
12
  export * from "./combobox";
10
13
  export * from "./confirm-dialog";
11
14
  export * from "./date-picker";
@@ -13,16 +16,20 @@ export * from "./dialog";
13
16
  export * from "./dropdown-menu";
14
17
  export * from "./file-upload";
15
18
  export * from "./form-field";
19
+ export * from "./hover-card";
16
20
  export * from "./input";
17
21
  export * from "./kbd";
18
22
  export * from "./label";
19
23
  export * from "./menu";
20
24
  export * from "./number-input";
25
+ export * from "./pagination";
21
26
  export * from "./password-input";
22
27
  export * from "./pin-input";
23
28
  export * from "./popover";
24
29
  export * from "./progress";
25
30
  export * from "./radio-group";
31
+ export * from "./rating";
32
+ export * from "./scroll-area";
26
33
  export * from "./segmented";
27
34
  export * from "./select";
28
35
  export * from "./separator";
@@ -30,8 +37,11 @@ export * from "./sheet";
30
37
  export * from "./skeleton";
31
38
  export * from "./slider";
32
39
  export * from "./spinner";
40
+ export * from "./steps";
33
41
  export * from "./switch";
34
42
  export * from "./tabs";
43
+ export * from "./tag-input";
35
44
  export * from "./time-picker";
36
45
  export * from "./toast";
37
46
  export * from "./tooltip";
47
+ export * from "./tree-view";
@@ -1 +1 @@
1
- export*from"./alert.js";export*from"./avatar.js";export*from"./badge.js";export*from"./button.js";export*from"./calendar.js";export*from"./card.js";export*from"./checkbox.js";export*from"./combobox.js";export*from"./confirm-dialog.js";export*from"./date-picker.js";export*from"./dialog.js";export*from"./dropdown-menu.js";export*from"./file-upload.js";export*from"./form-field.js";export*from"./input.js";export*from"./kbd.js";export*from"./label.js";export*from"./menu.js";export*from"./number-input.js";export*from"./password-input.js";export*from"./pin-input.js";export*from"./popover.js";export*from"./progress.js";export*from"./radio-group.js";export*from"./segmented.js";export*from"./select.js";export*from"./separator.js";export*from"./sheet.js";export*from"./skeleton.js";export*from"./slider.js";export*from"./spinner.js";export*from"./switch.js";export*from"./tabs.js";export*from"./time-picker.js";export*from"./toast.js";export*from"./tooltip.js";
1
+ export*from"./accordion.js";export*from"./alert.js";export*from"./avatar.js";export*from"./badge.js";export*from"./button.js";export*from"./calendar.js";export*from"./card.js";export*from"./carousel.js";export*from"./checkbox.js";export*from"./color-picker.js";export*from"./combobox.js";export*from"./confirm-dialog.js";export*from"./date-picker.js";export*from"./dialog.js";export*from"./dropdown-menu.js";export*from"./file-upload.js";export*from"./form-field.js";export*from"./hover-card.js";export*from"./input.js";export*from"./kbd.js";export*from"./label.js";export*from"./menu.js";export*from"./number-input.js";export*from"./pagination.js";export*from"./password-input.js";export*from"./pin-input.js";export*from"./popover.js";export*from"./progress.js";export*from"./radio-group.js";export*from"./rating.js";export*from"./scroll-area.js";export*from"./segmented.js";export*from"./select.js";export*from"./separator.js";export*from"./sheet.js";export*from"./skeleton.js";export*from"./slider.js";export*from"./spinner.js";export*from"./steps.js";export*from"./switch.js";export*from"./tabs.js";export*from"./tag-input.js";export*from"./time-picker.js";export*from"./toast.js";export*from"./tooltip.js";export*from"./tree-view.js";
@@ -1 +1 @@
1
- import{jsx as e,jsxs as p}from"react/jsx-runtime";import*as o from"react";import{cn as r}from"../../lib/utils.js";function c({keys:a,size:i="md",className:t,children:s}){const n=r("inline-grid place-items-center rounded-[6px] border border-border2 border-b-[2.5px] bg-raised font-sans font-medium text-body","shadow-[inset_0_-1px_0_var(--border),0_1px_1px_rgba(5,8,22,.06)]",i==="sm"?"h-5 min-w-5 px-1 text-[10.5px]":"h-6 min-w-6 px-1.5 text-[11.5px]");return a?e("kbd",{className:r("inline-flex items-center gap-1",t),"aria-label":a.join(" + "),children:a.map((m,d)=>p(o.Fragment,{children:[d>0?e("span",{"aria-hidden":!0,className:"text-[10px] text-placeholder",children:"+"}):null,e("kbd",{className:n,"aria-hidden":!0,children:m})]},d))}):e("kbd",{className:r(n,t),children:s})}export{c as Kbd};
1
+ import{jsx as e,jsxs as p}from"react/jsx-runtime";import*as o from"react";import{cn as r}from"../../lib/utils.js";function b({keys:a,size:i="md",className:t,children:s}){const d=r("inline-grid place-items-center rounded-[calc(6px*var(--radius-scale))] border border-border2 border-b-[2.5px] bg-raised font-sans font-medium text-body","shadow-[inset_0_-1px_0_var(--border),0_1px_1px_rgba(5,8,22,.06)]",i==="sm"?"h-5 min-w-5 px-1 text-[10.5px]":"h-6 min-w-6 px-1.5 text-[11.5px]");return a?e("kbd",{className:r("inline-flex items-center gap-1",t),"aria-label":a.join(" + "),children:a.map((m,n)=>p(o.Fragment,{children:[n>0?e("span",{"aria-hidden":!0,className:"text-[10px] text-placeholder",children:"+"}):null,e("kbd",{className:d,"aria-hidden":!0,children:m})]},n))}):e("kbd",{className:r(d,t),children:s})}export{b as Kbd};
@@ -18,6 +18,14 @@ import * as React from "react";
18
18
  * second-line `description`, a `count`, a `badge` and a `shortcut`; MenuSub
19
19
  * folds a branch away and opens itself when it holds the chosen item. Arrow
20
20
  * keys, Home and End move between items; → and ← open and close a branch.
21
+ *
22
+ * Collapsing: `collapsible` puts a toggle in the heading row (or place a
23
+ * MenuCollapseTrigger yourself), `collapsed` / `onCollapsedChange` control it.
24
+ * `collapsedMode="icons"` (default) narrows the menu to its icons, each with
25
+ * its name in a tooltip and its count on the icon; items without an icon show
26
+ * their initial. `collapsedMode="hidden"` folds the menu away entirely, as the
27
+ * AppShell's panel does, for a toggle that lives outside it (on a rail, in a
28
+ * top bar). Give the menu a width (`className="w-60"`) and it animates.
21
29
  */
22
30
  export type MenuLook = "soft" | "line" | "raised" | "gradient" | "dark" | "panel" | "rail";
23
31
  export interface MenuProps extends Omit<React.HTMLAttributes<HTMLElement>, "defaultValue" | "onChange"> {
@@ -28,6 +36,15 @@ export interface MenuProps extends Omit<React.HTMLAttributes<HTMLElement>, "defa
28
36
  onValueChange?: (value: string) => void;
29
37
  /** On top of the list: a title, or in the rail, the product mark. */
30
38
  heading?: React.ReactNode;
39
+ /** A collapse toggle in the heading row. */
40
+ collapsible?: boolean;
41
+ collapsed?: boolean;
42
+ defaultCollapsed?: boolean;
43
+ onCollapsedChange?: (collapsed: boolean) => void;
44
+ /** `icons`: narrow to the icons. `hidden`: fold away entirely (toggle it from outside). */
45
+ collapsedMode?: "icons" | "hidden";
46
+ /** ⌘B / Ctrl+B toggles it. Off by default: AppShell already uses ⌘B for its panel. */
47
+ collapseShortcut?: boolean;
31
48
  }
32
49
  export declare const Menu: React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<HTMLElement>>;
33
50
  interface ItemContent {
@@ -71,4 +88,11 @@ export declare function MenuGroup({ label, action, className, children, }: {
71
88
  export declare function MenuSeparator({ className }: {
72
89
  className?: string;
73
90
  }): React.JSX.Element;
91
+ /**
92
+ * The collapse toggle, for a menu with `collapsible` (it draws one in the
93
+ * heading row) or wherever you place it inside a Menu.
94
+ */
95
+ export declare function MenuCollapseTrigger({ className }: {
96
+ className?: string;
97
+ }): React.JSX.Element;
74
98
  export {};
@@ -1 +1 @@
1
- "use client";import{Fragment as D,jsx as o,jsxs as M}from"react/jsx-runtime";import{Slot as V}from"@radix-ui/react-slot";import{ChevronRight as q}from"lucide-react";import*as r from"react";import{cn as u}from"../../lib/utils.js";const S={soft:{root:"",indicator:"-z-10 rounded-[9px] bg-primary-subtle ring-1 ring-inset ring-primary/10",item:["text-body hover:bg-hover hover:text-text","text-primary"],icon:["text-muted group-hover/item:text-text","text-primary"],tile:["border-border bg-surface","border-primary/20 bg-raised shadow-[0_2px_6px_-2px_rgba(79,70,229,.35)]"],description:["text-muted","text-primary/70"],count:["bg-hover text-muted","bg-primary text-white"],kbd:["border-border bg-surface text-muted","border-primary/20 bg-raised text-primary"]},line:{root:"pl-3 before:absolute before:inset-y-1 before:left-[5px] before:w-px before:bg-border",indicator:"z-[1] rounded-full bg-[linear-gradient(180deg,#5b4af5,#1f45ea)] shadow-[0_0_0_3px_var(--canvas),0_0_12px_rgba(91,74,245,.55)]",item:["text-muted hover:bg-hover/70 hover:text-text","bg-[linear-gradient(90deg,var(--primary-subtle),transparent_85%)] text-text"],icon:["text-muted group-hover/item:text-text","text-primary"],tile:["border-border bg-surface","border-primary/20 bg-primary-subtle"],description:["text-muted","text-muted"],count:["bg-hover text-muted","bg-primary-subtle text-primary"],kbd:["border-border bg-surface text-muted","border-border bg-raised text-text"]},raised:{root:"rounded-[14px] border border-border bg-surface p-1.5 shadow-[inset_0_1px_2px_rgba(5,8,22,.04)]",indicator:"-z-10 rounded-[10px] bg-raised ring-1 ring-border/70 shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.06),0_6px_16px_-6px_rgba(5,8,22,.16)]",item:["text-muted hover:bg-raised/60 hover:text-text","text-text"],icon:["text-muted group-hover/item:text-text","text-primary"],tile:["border-border bg-raised","border-primary/15 bg-primary-subtle"],description:["text-muted","text-muted"],count:["bg-hover text-muted","bg-primary-subtle text-primary"],kbd:["border-border bg-raised text-muted","border-border bg-surface text-text"]},gradient:{root:"",indicator:"-z-10 rounded-[10px] bg-[linear-gradient(135deg,#1f45ea,#5b4af5)] shadow-[inset_0_1px_0_rgba(255,255,255,.25),0_8px_20px_-8px_rgba(20,55,211,.7)]",item:["text-body hover:bg-hover hover:text-text","text-white"],icon:["text-muted group-hover/item:text-text","text-white"],tile:["border-border bg-surface","border-white/20 bg-white/15 shadow-[inset_0_1px_0_rgba(255,255,255,.2)]"],description:["text-muted","text-white/75"],count:["bg-hover text-muted","bg-white/20 text-white"],kbd:["border-border bg-surface text-muted","border-white/25 bg-white/10 text-white/85"]},dark:{root:"rounded-[16px] border border-white/10 p-1.5 text-white bg-[#120b2e] bg-[image:radial-gradient(120%_70%_at_0%_0%,rgba(91,74,245,.30),transparent_60%),radial-gradient(90%_60%_at_100%_100%,rgba(31,69,234,.18),transparent_60%)] shadow-[inset_0_1px_0_rgba(255,255,255,.06),0_18px_40px_-16px_rgba(5,8,22,.6)] [--hover:rgba(255,255,255,.06)] [--surface:rgba(255,255,255,.05)] [--raised:rgba(255,255,255,.08)] [--text:#f5f6fa] [--body:#c9cce0] [--muted:#8d93b3] [--border:rgba(255,255,255,.1)] [--primary:#a5a8ff] [--primary-subtle:rgba(139,143,248,.16)] [--danger:#f87171] [--danger-subtle:rgba(239,68,68,.16)] [--canvas:#120b2e]",indicator:"-z-10 rounded-[10px] bg-white/[.07] ring-1 ring-inset ring-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,.08)] before:absolute before:inset-y-2 before:left-0 before:w-[3px] before:rounded-r-full before:bg-[#a5a8ff] before:shadow-[0_0_12px_2px_rgba(139,143,248,.65)]",item:["text-body hover:bg-hover hover:text-text","text-white"],icon:["text-muted group-hover/item:text-text","text-[#a5a8ff]"],tile:["border-border bg-surface","border-[#a5a8ff]/30 bg-[#a5a8ff]/15"],description:["text-muted","text-white/55"],count:["bg-white/[.06] text-muted","bg-[#a5a8ff]/20 text-white"],kbd:["border-border bg-surface text-muted","border-white/15 bg-white/10 text-white/70"]},panel:{root:"rounded-[14px] border border-border bg-surface px-2.5 py-3",indicator:"-z-10 rounded-ctl bg-primary-subtle",item:["font-normal text-body hover:bg-hover hover:text-text","text-primary"],icon:["text-muted group-hover/item:text-text","text-primary"],tile:["border-border bg-raised","border-primary/20 bg-raised"],description:["text-muted","text-primary/70"],count:["bg-transparent px-0 text-[12px] font-normal text-muted","bg-transparent px-0 text-[12px] font-normal text-primary"],kbd:["border-border bg-raised text-muted","border-primary/20 bg-raised text-primary"]},rail:{root:"w-[72px] items-center rounded-[14px] border border-border bg-surface py-2",indicator:"-z-10 rounded-ctl bg-primary-subtle before:absolute before:inset-y-2.5 before:left-[var(--bar-x)] before:w-[3px] before:rounded-r-[3px] before:bg-primary",item:["text-muted hover:bg-hover hover:text-text","text-primary"],icon:["",""],tile:["",""],description:["",""],count:["bg-raised text-body ring-2 ring-surface","bg-primary text-white ring-2 ring-surface"],kbd:["",""],rail:!0}},P=r.createContext({look:"soft",value:void 0,select:()=>{}}),O=r.createContext(null),I="[data-menu-item]",z='[data-menu-sub-body][data-state="closed"]';function K(t){let a=t.querySelector(`${I}[data-active]`),n=a?.closest(z)??null;for(;a&&n&&t.contains(n);)a=n.parentElement?.querySelector(":scope > [data-menu-trigger]")??null,n=n.parentElement?.closest(z)??null;return a}function $(t,a){let n=0,b=0,i=t;for(;i&&i!==a;)n+=i.offsetLeft,b+=i.offsetTop,i=i.offsetParent;return i===a?{x:n,y:b,w:t.offsetWidth,h:t.offsetHeight}:null}const j=r.forwardRef(({variant:t="soft",value:a,defaultValue:n,onValueChange:b,heading:i,className:_,children:N,onKeyDown:y,...E},s)=>{const d=r.useRef(null),[H,l]=r.useState(n),L=a!==void 0?a:H,[x,f]=r.useState(null),c=r.useCallback(e=>{a===void 0&&l(e),b?.(e)},[a,b]),R=r.useMemo(()=>({look:t,value:L,select:c}),[t,L,c]);r.useLayoutEffect(()=>{const e=d.current;if(!e)return;const h=()=>{const T=K(e),p=T?$(T,e):null;f(g=>g&&p&&g.x===p.x&&g.y===p.y&&g.w===p.w&&g.h===p.h?g:p)};h();const C=new MutationObserver(h);C.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-active","data-state"]});const m=new ResizeObserver(h);return m.observe(e),e.addEventListener("transitionend",h),()=>{C.disconnect(),m.disconnect(),e.removeEventListener("transitionend",h)}},[t]);const v=e=>{y?.(e);const h=d.current;if(e.defaultPrevented||!h)return;const C=document.activeElement,m=Array.from(h.querySelectorAll(I)).filter(g=>!g.closest("[inert]")&&!g.hasAttribute("disabled")&&g.getAttribute("aria-disabled")!=="true"),T=C?m.indexOf(C):-1;if(T<0)return;let p;e.key==="ArrowDown"?p=m[(T+1)%m.length]:e.key==="ArrowUp"?p=m[(T-1+m.length)%m.length]:e.key==="Home"?p=m[0]:e.key==="End"?p=m[m.length-1]:e.key==="ArrowLeft"&&(p=C.closest("[data-menu-sub-body]")?.parentElement?.querySelector(":scope > [data-menu-trigger]")),p&&(e.preventDefault(),p.focus())},k=S[t],w=t==="line";return o(P.Provider,{value:R,children:M("nav",{ref:e=>{d.current=e,typeof s=="function"?s(e):s&&(s.current=e)},"data-variant":t,className:u("relative isolate flex flex-col gap-0.5 text-[13px]",k.root,_),onKeyDown:v,...E,children:[i?k.rail?o("div",{className:"mb-3 grid shrink-0 place-items-center",children:i}):o("h2",{className:"px-2.5 pb-2.5 pt-1.5 text-[13px] font-semibold leading-[18px] text-text",children:i}):null,N,x?o("span",{"aria-hidden":!0,className:u("pointer-events-none absolute left-0 top-0 transition-[transform,width,height] duration-300 ease-[cubic-bezier(.3,.7,.2,1)]",k.indicator),style:w?{transform:`translate3d(4px, ${x.y+7}px, 0)`,width:3,height:Math.max(x.h-14,8)}:{transform:`translate3d(${x.x}px, ${x.y}px, 0)`,width:x.w,height:x.h,"--bar-x":`${-x.x}px`}}):null]})})});j.displayName="Menu";function A({label:t,icon:a,description:n,badge:b,count:i,shortcut:_,on:N,danger:y,trailing:E}){const s=S[r.useContext(P).look],d=N?1:0;return s.rail?M(D,{children:[a,o("span",{className:"w-full truncate px-0.5 text-center text-[10px] font-medium leading-3",children:t}),i!==void 0?o("span",{className:u("num absolute right-1 top-1 min-w-4 rounded-full px-1 text-center text-[9.5px] font-semibold leading-4 transition-colors",s.count[d]),children:i}):null]}):M(D,{children:[a?n?o("span",{className:u("grid size-8 shrink-0 place-items-center rounded-[9px] border transition-colors",y?"border-danger/20 bg-danger-subtle text-danger":u(s.tile[d],s.icon[d])),children:a}):o("span",{className:u("grid shrink-0 place-items-center transition-colors",y?"text-danger":s.icon[d]),children:a}):null,M("span",{className:"min-w-0 flex-1",children:[M("span",{className:"flex items-center gap-2",children:[o("span",{className:"truncate",children:t}),b]}),n?o("span",{className:u("mt-0.5 block truncate text-[11.5px] font-normal leading-4",y?"text-danger/70":s.description[d]),children:n}):null]}),i!==void 0?o("span",{className:u("num min-w-5 shrink-0 rounded-full px-1.5 text-center text-[10.5px] font-semibold leading-[18px] transition-colors",s.count[d]),children:i}):null,_?o("kbd",{className:u("shrink-0 rounded-[5px] border px-1.5 py-px font-sans text-[10.5px] font-medium transition-colors",s.kbd[d]),children:_}):null,E]})}const F="mx-auto min-h-14 w-[60px] flex-col justify-center gap-[3px] px-0.5 py-1.5 [&_svg]:size-[19px]",B="group/item relative flex min-h-item w-full cursor-pointer select-none items-center gap-2.5 rounded-[9px] px-2.5 py-1.5 text-left font-medium outline-none transition-[color,background-color] duration-150 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/45 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",G=r.forwardRef(({value:t,active:a,danger:n,asChild:b,icon:i,description:_,badge:N,count:y,shortcut:E,className:s,children:d,onClick:H,...l},L)=>{const x=r.useContext(P),f=r.useContext(O),c=!n&&(a??(t!==void 0&&x.value===t)),R=S[x.look];r.useEffect(()=>{if(!(!c||!f))return f.reveal(),f.mark(1),()=>f.mark(-1)},[c,f]);const v={"data-menu-item":"","data-active":c?"":void 0,"aria-current":c?"page":void 0,className:u(B,R.rail&&F,n?"text-danger hover:bg-danger-subtle":R.item[c?1:0],s),onClick:w=>{H?.(w),!w.defaultPrevented&&t!==void 0&&x.select(t)}},k=w=>o(A,{label:w,icon:i,description:_,badge:N,count:y,shortcut:E,on:c,danger:n});return b&&r.isValidElement(d)?o(V,{ref:L,...v,...l,children:r.cloneElement(d,void 0,k(d.props.children))}):o("button",{ref:L,type:"button",...v,...l,children:k(d)})});G.displayName="MenuItem";function J({label:t,defaultOpen:a=!1,open:n,onOpenChange:b,disabled:i,className:_,children:N,...y}){const E=r.useContext(P),s=r.useContext(O),[d,H]=r.useState(a),l=n??d,[L,x]=r.useState(0),f=r.useId(),c=r.useCallback(e=>{n===void 0&&H(e),b?.(e)},[n,b]),R=r.useMemo(()=>({reveal:()=>{c(!0),s?.reveal()},mark:e=>x(h=>h+e)}),[c,s]),v=L>0;r.useEffect(()=>{if(!(!v||!s))return s.mark(1),()=>s.mark(-1)},[v,s]);const k=S[E.look],w=v&&!l;return M("div",{"data-menu-sub":"",className:_,children:[o("button",{type:"button","data-menu-item":"","data-menu-trigger":"","data-state":l?"open":"closed","aria-expanded":l,"aria-controls":f,disabled:i,className:u(B,k.item[w?1:0],v&&l&&"text-text"),onClick:()=>c(!l),onKeyDown:e=>{e.key==="ArrowRight"?(e.preventDefault(),l?document.getElementById(f)?.querySelector(I)?.focus():c(!0)):e.key==="ArrowLeft"&&l&&(e.preventDefault(),c(!1))},children:o(A,{label:t,...y,on:w,trailing:o(q,{className:u("!size-3.5 shrink-0 opacity-60 transition-transform duration-200",l&&"rotate-90"),"aria-hidden":!0})})}),o("div",{id:f,"data-menu-sub-body":"","data-state":l?"open":"closed",inert:!l,className:u("grid transition-[grid-template-rows,opacity] duration-300 ease-[var(--ease)]",l?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:o("div",{className:"min-h-0 overflow-hidden",children:o("div",{className:"relative ml-[18px] flex flex-col gap-0.5 py-0.5 pl-3 before:absolute before:inset-y-1 before:left-0 before:w-px before:bg-border",children:o(O.Provider,{value:R,children:N})})})})]})}function Q({label:t,action:a,className:n,children:b}){const i=r.useId();return S[r.useContext(P).look].rail?o("div",{role:"group","aria-label":typeof t=="string"?t:void 0,className:u("flex w-full flex-col items-center gap-0.5 [&:not(:first-child)]:before:my-1.5 [&:not(:first-child)]:before:h-px [&:not(:first-child)]:before:w-8 [&:not(:first-child)]:before:bg-border2",n),children:b}):M("div",{role:"group","aria-labelledby":t?i:void 0,className:u("flex flex-col gap-0.5 [&:not(:first-child)]:mt-2",n),children:[t?M("div",{className:"flex items-center justify-between gap-2 px-2.5 pb-1 pt-1.5",children:[o("p",{id:i,className:"ov",children:t}),a]}):null,b]})}function X({className:t}){return o("div",{role:"separator",className:u("mx-1 my-1.5 h-px shrink-0 bg-border",t)})}export{j as Menu,Q as MenuGroup,G as MenuItem,X as MenuSeparator,J as MenuSub};
1
+ "use client";import{Fragment as j,jsx as t,jsxs as w}from"react/jsx-runtime";import{Slot as re}from"@radix-ui/react-slot";import{ChevronRight as ne,PanelLeftClose as oe,PanelLeftOpen as ae}from"lucide-react";import*as o from"react";import{useHotkey as ie}from"../../hooks/use-hotkey.js";import{cn as l}from"../../lib/utils.js";import{Tooltip as q,TooltipProvider as se}from"./tooltip.js";const A={soft:{root:"",indicator:"-z-10 rounded-[calc(9px*var(--radius-scale))] bg-primary-subtle ring-1 ring-inset ring-primary/10",item:["text-body hover:bg-hover hover:text-text","text-primary"],icon:["text-muted group-hover/item:text-text","text-primary"],tile:["border-border bg-surface","border-primary/20 bg-raised shadow-[0_2px_6px_-2px_color-mix(in_srgb,var(--primary)_35%,transparent)]"],description:["text-muted","text-primary/70"],count:["bg-hover text-muted","bg-primary text-white"],kbd:["border-border bg-surface text-muted","border-primary/20 bg-raised text-primary"]},line:{root:"pl-3 before:absolute before:inset-y-1 before:left-[5px] before:w-px before:bg-border",indicator:"z-[1] rounded-full bg-[linear-gradient(180deg,var(--brand-2),var(--brand-1))] shadow-[0_0_0_3px_var(--canvas),0_0_12px_color-mix(in_srgb,var(--brand-2)_55%,transparent)]",item:["text-muted hover:bg-hover/70 hover:text-text","bg-[linear-gradient(90deg,var(--primary-subtle),transparent_85%)] text-text"],icon:["text-muted group-hover/item:text-text","text-primary"],tile:["border-border bg-surface","border-primary/20 bg-primary-subtle"],description:["text-muted","text-muted"],count:["bg-hover text-muted","bg-primary-subtle text-primary"],kbd:["border-border bg-surface text-muted","border-border bg-raised text-text"]},raised:{root:"rounded-[calc(14px*var(--radius-scale))] border border-border bg-surface p-1.5 shadow-[inset_0_1px_2px_rgba(5,8,22,.04)]",indicator:"-z-10 rounded-[calc(10px*var(--radius-scale))] bg-raised ring-1 ring-border/70 shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.06),0_6px_16px_-6px_rgba(5,8,22,.16)]",item:["text-muted hover:bg-raised/60 hover:text-text","text-text"],icon:["text-muted group-hover/item:text-text","text-primary"],tile:["border-border bg-raised","border-primary/15 bg-primary-subtle"],description:["text-muted","text-muted"],count:["bg-hover text-muted","bg-primary-subtle text-primary"],kbd:["border-border bg-raised text-muted","border-border bg-surface text-text"]},gradient:{root:"",indicator:"-z-10 rounded-[calc(10px*var(--radius-scale))] bg-[linear-gradient(135deg,var(--brand-1),var(--brand-2))] shadow-[inset_0_1px_0_rgba(255,255,255,.25),0_8px_20px_-8px_color-mix(in_srgb,var(--brand-1)_70%,transparent)]",item:["text-body hover:bg-hover hover:text-text","text-white"],icon:["text-muted group-hover/item:text-text","text-white"],tile:["border-border bg-surface","border-white/20 bg-white/15 shadow-[inset_0_1px_0_rgba(255,255,255,.2)]"],description:["text-muted","text-white/75"],count:["bg-hover text-muted","bg-white/20 text-white"],kbd:["border-border bg-surface text-muted","border-white/25 bg-white/10 text-white/85"]},dark:{root:"rounded-[calc(16px*var(--radius-scale))] border border-white/10 p-1.5 text-white bg-[var(--ink)] bg-[image:radial-gradient(120%_70%_at_0%_0%,color-mix(in_srgb,var(--brand-2)_30%,transparent),transparent_60%),radial-gradient(90%_60%_at_100%_100%,color-mix(in_srgb,var(--brand-1)_18%,transparent),transparent_60%)] shadow-[inset_0_1px_0_rgba(255,255,255,.06),0_18px_40px_-16px_rgba(5,8,22,.6)] [--hover:rgba(255,255,255,.06)] [--surface:rgba(255,255,255,.05)] [--raised:rgba(255,255,255,.08)] [--text:#f5f6fa] [--body:#c9cce0] [--muted:#8d93b3] [--border:rgba(255,255,255,.1)] [--primary:#a5a8ff] [--primary-subtle:rgba(139,143,248,.16)] [--danger:#f87171] [--danger-subtle:rgba(239,68,68,.16)] [--canvas:var(--ink)]",indicator:"-z-10 rounded-[calc(10px*var(--radius-scale))] bg-white/[.07] ring-1 ring-inset ring-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,.08)] before:absolute before:inset-y-2 before:left-0 before:w-[3px] before:rounded-r-full before:bg-[#a5a8ff] before:shadow-[0_0_12px_2px_rgba(139,143,248,.65)]",item:["text-body hover:bg-hover hover:text-text","text-white"],icon:["text-muted group-hover/item:text-text","text-[#a5a8ff]"],tile:["border-border bg-surface","border-[#a5a8ff]/30 bg-[#a5a8ff]/15"],description:["text-muted","text-white/55"],count:["bg-white/[.06] text-muted","bg-[#a5a8ff]/20 text-white"],kbd:["border-border bg-surface text-muted","border-white/15 bg-white/10 text-white/70"]},panel:{root:"rounded-[calc(14px*var(--radius-scale))] border border-border bg-surface px-2.5 py-3",indicator:"-z-10 rounded-ctl bg-primary-subtle",item:["font-normal text-body hover:bg-hover hover:text-text","text-primary"],icon:["text-muted group-hover/item:text-text","text-primary"],tile:["border-border bg-raised","border-primary/20 bg-raised"],description:["text-muted","text-primary/70"],count:["bg-transparent px-0 text-[12px] font-normal text-muted","bg-transparent px-0 text-[12px] font-normal text-primary"],kbd:["border-border bg-raised text-muted","border-primary/20 bg-raised text-primary"]},rail:{root:"w-[72px] items-center rounded-[calc(14px*var(--radius-scale))] border border-border bg-surface py-2",indicator:"-z-10 rounded-ctl bg-primary-subtle before:absolute before:inset-y-2.5 before:left-[var(--bar-x)] before:w-[3px] before:rounded-r-[3px] before:bg-primary",item:["text-muted hover:bg-hover hover:text-text","text-primary"],icon:["",""],tile:["",""],description:["",""],count:["bg-raised text-body ring-2 ring-surface","bg-primary text-white ring-2 ring-surface"],kbd:["",""],rail:!0}},B=o.createContext({look:"soft",value:void 0,select:()=>{},collapsed:!1,iconsOnly:!1,setCollapsed:()=>{},shortcut:!1}),K=o.createContext(null),$="[data-menu-item]",W='[data-menu-sub-body][data-state="closed"]';function le(e){let r=e.querySelector(`${$}[data-active]`),n=r?.closest(W)??null;for(;r&&n&&e.contains(n);)r=n.parentElement?.querySelector(":scope > [data-menu-trigger]")??null,n=n.parentElement?.closest(W)??null;return r}function de(e,r){let n=0,c=0,a=e;for(;a&&a!==r;)n+=a.offsetLeft,c+=a.offsetTop,a=a.offsetParent;return a===r?{x:n,y:c,w:e.offsetWidth,h:e.offsetHeight}:null}const ce=o.forwardRef(({variant:e="soft",value:r,defaultValue:n,onValueChange:c,heading:a,collapsible:f,collapsed:_,defaultCollapsed:h=!1,onCollapsedChange:g,collapsedMode:p="icons",collapseShortcut:i=!1,className:u,children:k,onKeyDown:O,...C},m)=>{const b=o.useRef(null),[H,E]=o.useState(n),R=r!==void 0?r:H,[d,T]=o.useState(null),v=!!A[e].rail,[N,D]=o.useState(h),S=!v&&(_??N),P=S&&p==="icons",U=S&&p==="hidden",X=!v&&(f||_!==void 0||h||i),V=o.useCallback(s=>{_===void 0&&D(s),g?.(s)},[_,g]);ie({key:"b",mod:!0},()=>V(!S),i&&!v);const F=o.useCallback(s=>{r===void 0&&E(s),c?.(s)},[r,c]),Z=o.useMemo(()=>({look:e,value:R,select:F,collapsed:S,iconsOnly:P,setCollapsed:V,shortcut:i}),[e,R,F,S,P,V,i]);o.useLayoutEffect(()=>{const s=b.current;if(!s)return;const L=()=>{const I=le(s),x=I?de(I,s):null;T(M=>M&&x&&M.x===x.x&&M.y===x.y&&M.w===x.w&&M.h===x.h?M:x)};L();const z=new MutationObserver(L);z.observe(s,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-active","data-state"]});const y=new ResizeObserver(L);return y.observe(s),s.addEventListener("transitionend",L),()=>{z.disconnect(),y.disconnect(),s.removeEventListener("transitionend",L)}},[e]);const ee=s=>{O?.(s);const L=b.current;if(s.defaultPrevented||!L)return;const z=document.activeElement,y=Array.from(L.querySelectorAll($)).filter(M=>!M.closest("[inert]")&&!M.hasAttribute("disabled")&&M.getAttribute("aria-disabled")!=="true"),I=z?y.indexOf(z):-1;if(I<0)return;let x;s.key==="ArrowDown"?x=y[(I+1)%y.length]:s.key==="ArrowUp"?x=y[(I-1+y.length)%y.length]:s.key==="Home"?x=y[0]:s.key==="End"?x=y[y.length-1]:s.key==="ArrowLeft"&&(x=z.closest("[data-menu-sub-body]")?.parentElement?.querySelector(":scope > [data-menu-trigger]")),x&&(s.preventDefault(),x.focus())},G=A[e],te=e==="line";return t(B.Provider,{value:Z,children:w("nav",{ref:s=>{b.current=s,typeof m=="function"?m(s):m&&(m.current=s)},"data-variant":e,"data-collapsed":S?p:void 0,inert:U,className:l("relative isolate flex flex-col gap-0.5 text-[13px]",G.root,X&&"overflow-hidden transition-[width,padding,opacity,border-color] duration-300 ease-[var(--ease)]",u,P&&"!w-16 shrink-0",U&&"!w-0 shrink-0 !border-transparent !px-0 opacity-0"),onKeyDown:ee,...C,children:[w(se,{delayDuration:150,children:[v?a?t("div",{className:"mb-3 grid shrink-0 place-items-center",children:a}):null:a||f?w("div",{className:l("flex min-h-8 shrink-0 items-center gap-2 pb-2 pl-2.5 pr-1",P&&"justify-center px-0"),children:[a&&!P?t("h2",{className:"min-w-0 flex-1 truncate text-[13px] font-semibold leading-[18px] text-text",children:a}):null,!a&&!P?t("span",{className:"flex-1"}):null,f?t(pe,{}):null]}):null,k]}),d?t("span",{"aria-hidden":!0,className:l("pointer-events-none absolute left-0 top-0 transition-[transform,width,height] duration-300 ease-[cubic-bezier(.3,.7,.2,1)]",G.indicator),style:te?{transform:`translate3d(4px, ${d.y+7}px, 0)`,width:3,height:Math.max(d.h-14,8)}:{transform:`translate3d(${d.x}px, ${d.y}px, 0)`,width:d.w,height:d.h,"--bar-x":`${-d.x}px`}}):null]})})});ce.displayName="Menu";function Y({label:e,icon:r,description:n,badge:c,count:a,shortcut:f,on:_,danger:h,trailing:g}){const p=o.useContext(B),i=A[p.look],u=_?1:0;if(p.iconsOnly){const k=typeof e=="string"?e.trim().charAt(0).toUpperCase():"\u2022";return w(j,{children:[w("span",{className:"relative grid shrink-0 place-items-center",children:[r?n?t("span",{className:l("grid size-8 place-items-center rounded-[calc(9px*var(--radius-scale))] border transition-colors",h?"border-danger/20 bg-danger-subtle text-danger":l(i.tile[u],i.icon[u])),children:r}):t("span",{className:l("grid place-items-center transition-colors",h?"text-danger":i.icon[u]),children:r}):t("span",{className:l("grid size-6 place-items-center rounded-[calc(7px*var(--radius-scale))] text-[11.5px] font-semibold",_?"bg-white/15":"bg-hover"),children:k}),a!==void 0?t("span",{className:l("num absolute -right-2.5 -top-2 min-w-4 rounded-full px-1 text-center text-[9px] font-semibold leading-4 ring-2 ring-[var(--canvas)]",i.count[u]),children:a}):null]}),t("span",{className:"sr-only",children:e})]})}return i.rail?w(j,{children:[r,t("span",{className:"w-full truncate px-0.5 text-center text-[10px] font-medium leading-3",children:e}),a!==void 0?t("span",{className:l("num absolute right-1 top-1 min-w-4 rounded-full px-1 text-center text-[9.5px] font-semibold leading-4 transition-colors",i.count[u]),children:a}):null]}):w(j,{children:[r?n?t("span",{className:l("grid size-8 shrink-0 place-items-center rounded-[calc(9px*var(--radius-scale))] border transition-colors",h?"border-danger/20 bg-danger-subtle text-danger":l(i.tile[u],i.icon[u])),children:r}):t("span",{className:l("grid shrink-0 place-items-center transition-colors",h?"text-danger":i.icon[u]),children:r}):null,w("span",{className:"min-w-0 flex-1",children:[w("span",{className:"flex items-center gap-2",children:[t("span",{className:"truncate",children:e}),c]}),n?t("span",{className:l("mt-0.5 block truncate text-[11.5px] font-normal leading-4",h?"text-danger/70":i.description[u]),children:n}):null]}),a!==void 0?t("span",{className:l("num min-w-5 shrink-0 rounded-full px-1.5 text-center text-[10.5px] font-semibold leading-[18px] transition-colors",i.count[u]),children:a}):null,f?t("kbd",{className:l("shrink-0 rounded-[calc(5px*var(--radius-scale))] border px-1.5 py-px font-sans text-[10.5px] font-medium transition-colors",i.kbd[u]),children:f}):null,g]})}const ue="mx-auto min-h-14 w-[60px] flex-col justify-center gap-[3px] px-0.5 py-1.5 [&_svg]:size-[19px]",J="justify-center gap-0 px-0",Q="group/item relative flex min-h-item w-full cursor-pointer select-none items-center gap-2.5 rounded-[calc(9px*var(--radius-scale))] px-2.5 py-1.5 text-left font-medium outline-none transition-[color,background-color] duration-150 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/45 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",be=o.forwardRef(({value:e,active:r,danger:n,asChild:c,icon:a,description:f,badge:_,count:h,shortcut:g,className:p,children:i,onClick:u,...k},O)=>{const C=o.useContext(B),m=o.useContext(K),b=!n&&(r??(e!==void 0&&C.value===e)),H=A[C.look];o.useEffect(()=>{if(!(!b||!m))return m.reveal(),m.mark(1),()=>m.mark(-1)},[b,m]);const E={"data-menu-item":"","data-active":b?"":void 0,"aria-current":b?"page":void 0,className:l(Q,H.rail&&ue,C.iconsOnly&&J,n?"text-danger hover:bg-danger-subtle":H.item[b?1:0],p),onClick:v=>{u?.(v),!v.defaultPrevented&&e!==void 0&&C.select(e)}},R=v=>t(Y,{label:v,icon:a,description:f,badge:_,count:h,shortcut:g,on:b,danger:n}),d=c&&o.isValidElement(i)?i.props.children:i,T=c&&o.isValidElement(i)?t(re,{ref:O,...E,...k,children:o.cloneElement(i,void 0,R(i.props.children))}):t("button",{ref:O,type:"button",...E,...k,children:R(i)});return C.iconsOnly&&typeof d=="string"?t(q,{label:d,side:"right",children:T}):T});be.displayName="MenuItem";function ve({label:e,defaultOpen:r=!1,open:n,onOpenChange:c,disabled:a,className:f,children:_,...h}){const g=o.useContext(B),p=o.useContext(K),[i,u]=o.useState(r),k=n??i,[O,C]=o.useState(0),m=o.useId(),b=o.useCallback(N=>{n===void 0&&u(N),c?.(N)},[n,c]),H=o.useMemo(()=>({reveal:()=>{b(!0),p?.reveal()},mark:N=>C(D=>D+N)}),[b,p]),E=O>0;o.useEffect(()=>{if(!(!E||!p))return p.mark(1),()=>p.mark(-1)},[E,p]);const R=A[g.look],d=k&&!g.iconsOnly,T=E&&!d,v=t("button",{type:"button","data-menu-item":"","data-menu-trigger":"","data-state":d?"open":"closed","aria-expanded":d,"aria-controls":m,disabled:a,className:l(Q,g.iconsOnly&&J,R.item[T?1:0],E&&d&&"text-text"),onClick:()=>{g.iconsOnly?(g.setCollapsed(!1),b(!0)):b(!k)},onKeyDown:N=>{N.key==="ArrowRight"?(N.preventDefault(),k?document.getElementById(m)?.querySelector($)?.focus():b(!0)):N.key==="ArrowLeft"&&k&&(N.preventDefault(),b(!1))},children:t(Y,{label:e,...h,on:T,trailing:t(ne,{className:l("!size-3.5 shrink-0 opacity-60 transition-transform duration-200",d&&"rotate-90"),"aria-hidden":!0})})});return w("div",{"data-menu-sub":"",className:f,children:[g.iconsOnly&&typeof e=="string"?t(q,{label:e,side:"right",children:v}):v,t("div",{id:m,"data-menu-sub-body":"","data-state":d?"open":"closed",inert:!d,className:l("grid transition-[grid-template-rows,opacity] duration-300 ease-[var(--ease)]",d?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:t("div",{className:"min-h-0 overflow-hidden",children:t("div",{className:"relative ml-[18px] flex flex-col gap-0.5 py-0.5 pl-3 before:absolute before:inset-y-1 before:left-0 before:w-px before:bg-border",children:t(K.Provider,{value:H,children:_})})})})]})}function ye({label:e,action:r,className:n,children:c}){const a=o.useId(),f=o.useContext(B);return f.iconsOnly?t("div",{role:"group","aria-label":typeof e=="string"?e:void 0,className:l("flex flex-col gap-0.5 [&:not(:first-child)]:before:mx-auto [&:not(:first-child)]:before:my-2 [&:not(:first-child)]:before:h-px [&:not(:first-child)]:before:w-6 [&:not(:first-child)]:before:bg-border",n),children:c}):A[f.look].rail?t("div",{role:"group","aria-label":typeof e=="string"?e:void 0,className:l("flex w-full flex-col items-center gap-0.5 [&:not(:first-child)]:before:my-1.5 [&:not(:first-child)]:before:h-px [&:not(:first-child)]:before:w-8 [&:not(:first-child)]:before:bg-border2",n),children:c}):w("div",{role:"group","aria-labelledby":e?a:void 0,className:l("flex flex-col gap-0.5 [&:not(:first-child)]:mt-2",n),children:[e?w("div",{className:"flex items-center justify-between gap-2 px-2.5 pb-1 pt-1.5",children:[t("p",{id:a,className:"ov",children:e}),r]}):null,c]})}function we({className:e}){return t("div",{role:"separator",className:l("mx-1 my-1.5 h-px shrink-0 bg-border",e)})}function pe({className:e}){const r=o.useContext(B),n=r.collapsed?"Expand menu":"Collapse menu";return t(q,{label:n,shortcut:r.shortcut?"\u2318B":void 0,side:"right",children:t("button",{type:"button","aria-label":n,"aria-expanded":!r.collapsed,onClick:()=>r.setCollapsed(!r.collapsed),className:l("grid size-7 shrink-0 cursor-pointer place-items-center rounded-[calc(7px*var(--radius-scale))] text-muted outline-none transition-colors hover:bg-hover hover:text-text focus-visible:ring-2 focus-visible:ring-primary/45 [&_svg]:size-4",e),children:r.collapsed?t(ae,{}):t(oe,{})})})}export{ce as Menu,pe as MenuCollapseTrigger,ye as MenuGroup,be as MenuItem,we as MenuSeparator,ve as MenuSub};
@@ -0,0 +1,51 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Pagination — moving through a long list a page at a time.
4
+ *
5
+ * The page numbers keep their shape as you move: first, last, the pages
6
+ * beside the current one, and an ellipsis for the rest, so the row never
7
+ * jumps in width. Give `total` and it says "21–40 of 312"; give `pageSizes`
8
+ * and the reader picks how many per page.
9
+ *
10
+ * Looks:
11
+ * outline — the default: bordered buttons. Tables and lists.
12
+ * pill — one track, the current page lifted in it and sliding.
13
+ * gradient — the current page in the brand gradient, words on the arrows. Galleries, catalogues.
14
+ * underline — numbers on a line, a gradient bar sliding under the current one. Quiet pages.
15
+ * dots — a dot per page, the current one stretched. Onboarding, cards, short sets.
16
+ * jumper — "Page [ 4 ] of 120": type a number and go. Very long lists.
17
+ * minimal — previous, "Page 3 of 16", next. Narrow places and phones.
18
+ */
19
+ export type PaginationVariant = "outline" | "pill" | "gradient" | "underline" | "dots" | "jumper" | "minimal";
20
+ /**
21
+ * The numbers to draw: page numbers and "gap" markers, always the same number
22
+ * of slots once there are enough pages. Exported for custom layouts.
23
+ */
24
+ export declare function pageRange(page: number, count: number, siblings?: number, boundaries?: number): (number | "gap")[];
25
+ export interface PaginationProps {
26
+ page: number;
27
+ onPageChange: (page: number) => void;
28
+ /** Number of pages. Or give `total` and `pageSize`. */
29
+ pageCount?: number;
30
+ /** Number of rows in all; shows "21–40 of 312". */
31
+ total?: number;
32
+ pageSize?: number;
33
+ /** Offer these page sizes; needs `onPageSizeChange`. */
34
+ pageSizes?: number[];
35
+ onPageSizeChange?: (size: number) => void;
36
+ variant?: PaginationVariant;
37
+ siblings?: number;
38
+ /** First / last page buttons. */
39
+ edges?: boolean;
40
+ size?: "sm" | "md";
41
+ labels?: {
42
+ previous?: string;
43
+ next?: string;
44
+ page?: string;
45
+ of?: string;
46
+ perPage?: string;
47
+ goTo?: string;
48
+ };
49
+ className?: string;
50
+ }
51
+ export declare function Pagination({ page, onPageChange, pageCount, total, pageSize, pageSizes, onPageSizeChange, variant, siblings, edges, size, labels, className, }: PaginationProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as a,jsxs as u}from"react/jsx-runtime";import{ChevronLeft as q,ChevronRight as z,ChevronsLeft as B,ChevronsRight as G}from"lucide-react";import*as v from"react";import{cn as d}from"../../lib/utils.js";function W(o,s,c=1,r=1){const m=(b,x)=>x<b?[]:Array.from({length:x-b+1},(k,M)=>b+M),y=m(1,Math.min(r,s)),p=m(Math.max(s-r+1,r+1),s),n=Math.max(Math.min(o-c,s-r-c*2-1),r+2),w=Math.min(Math.max(o+c,r+c*2+2),p.length>0?p[0]-2:s-1);return[...y,...n>r+2?["gap"]:r+1<s-r?[r+1]:[],...m(n,w),...w<s-r-1?["gap"]:s-r>r?[s-r]:[],...p]}function K({page:o,onPageChange:s,pageCount:c,total:r,pageSize:m=20,pageSizes:y,onPageSizeChange:p,variant:n="outline",siblings:w=1,edges:b=!1,size:x="md",labels:k,className:M}){const l=Math.max(1,c??(r!==void 0?Math.ceil(r/m):1)),g=e=>s(Math.min(l,Math.max(1,e))),i={previous:"Previous",next:"Next",page:"Page",of:"of",perPage:"per page",goTo:"Go to page",...k},S=x==="sm"?"h-8 min-w-8 text-[12.5px]":"h-9 min-w-9 text-[13px]",R=W(o,l,w),P=n==="pill"||n==="underline",T=v.useRef(null),[f,F]=v.useState(null);v.useLayoutEffect(()=>{if(!P)return;const e=T.current?.querySelector('[aria-current="page"]');F(e?{x:e.offsetLeft,w:e.offsetWidth}:null)},[P,o,l,x]);const[C,N]=v.useState(String(o));v.useEffect(()=>N(String(o)),[o]);const $=d("inline-flex cursor-pointer items-center justify-center gap-1 rounded-ctl px-2 font-medium outline-none transition-[background-color,color,border-color,box-shadow,transform] duration-150","focus-visible:ring-2 focus-visible:ring-primary/40 disabled:pointer-events-none disabled:opacity-40 [&_svg]:size-4",S),_=(e,t)=>{const L=t?e<0?1:l:o+e,V=e<0?o<=1:o>=l,j=t?e<0?B:G:e<0?q:z,D=t?e<0?"First page":"Last page":e<0?i.previous:i.next,E=!t&&(n==="minimal"||n==="gradient");return u("button",{type:"button","aria-label":D,disabled:V,onClick:()=>g(L),className:d($,n==="outline"||n==="jumper"?"border border-border bg-raised text-body shadow-[var(--lit)] hover:bg-hover hover:text-text":n==="dots"?"rounded-full border border-border bg-raised text-body shadow-[var(--lit)] hover:bg-hover hover:text-text":"text-body hover:bg-hover hover:text-text",E&&"px-3"),children:[e<0?a(j,{}):null,E?a("span",{className:"hidden sm:inline",children:D}):null,e>0?a(j,{}):null]})},I=r!==void 0?(o-1)*m+1:0,A=r!==void 0?Math.min(r,o*m):0,H=e=>{const t=e===o;return a("button",{type:"button","aria-label":`${i.page} ${e}`,"aria-current":t?"page":void 0,onClick:()=>g(e),className:d($,"num",n==="pill"&&"h-7 min-w-7 rounded-[calc(8px*var(--radius-scale))]",n==="outline"&&(t?"border border-primary bg-primary text-white shadow-[0_4px_12px_-4px_color-mix(in_srgb,var(--primary)_60%,transparent)]":"border border-border bg-raised text-body shadow-[var(--lit)] hover:bg-hover hover:text-text"),n==="pill"&&(t?"text-text":"text-muted hover:text-text"),n==="gradient"&&(t?"scale-105 rounded-full bg-[linear-gradient(135deg,var(--brand-1),var(--brand-2))] text-white shadow-[inset_0_1px_0_rgba(255,255,255,.25),0_6px_16px_-6px_var(--brand-1)]":"rounded-full text-body hover:bg-hover hover:text-text"),n==="underline"&&(t?"font-semibold text-primary":"text-muted hover:text-text")),children:e},e)};let h;if(n==="minimal")h=u("span",{className:"num px-2 text-[13px] text-muted",children:[i.page," ",a("span",{className:"font-semibold text-text",children:o})," ",i.of," ",l]});else if(n==="jumper")h=u("form",{className:"flex items-center gap-2 px-1 text-[13px] text-muted",onSubmit:e=>{e.preventDefault();const t=parseInt(C,10);Number.isFinite(t)?g(t):N(String(o))},children:[i.page,a("input",{value:C,inputMode:"numeric","aria-label":i.goTo,onChange:e=>N(e.target.value.replace(/\D/g,"")),onBlur:()=>{const e=parseInt(C,10);Number.isFinite(e)&&e!==o?g(e):N(String(o))},className:d("num rounded-ctl border border-border2 bg-raised text-center font-semibold text-text outline-none transition-[border-color,box-shadow] focus:border-primary focus:ring-2 focus:ring-primary/20",x==="sm"?"h-8 w-11":"h-9 w-12")}),i.of," ",a("span",{className:"num font-semibold text-text",children:l})]});else if(n==="dots"){const e=l<=12?Array.from({length:l},(t,L)=>L+1):R.filter(t=>t!=="gap");h=a("div",{className:"flex items-center gap-1.5 px-2",children:e.map(t=>a("button",{type:"button","aria-label":`${i.page} ${t}`,"aria-current":t===o?"page":void 0,onClick:()=>g(t),className:d("h-2 cursor-pointer rounded-full outline-none transition-[width,background-color] duration-300 ease-[var(--ease)] focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2",t===o?"w-6 bg-[linear-gradient(90deg,var(--brand-1),var(--brand-2))]":"w-2 bg-border2 hover:bg-muted")},t))})}else h=u("div",{ref:T,className:d("relative isolate flex items-center gap-1",n==="pill"&&"rounded-[calc(11px*var(--radius-scale))] border border-border bg-hover p-1",n==="underline"&&"border-b border-border"),children:[P&&f?a("span",{"aria-hidden":!0,className:d("absolute left-0 transition-[transform,width] duration-300 ease-[cubic-bezier(.3,.7,.2,1)]",n==="pill"?"inset-y-1 -z-10 rounded-[calc(8px*var(--radius-scale))] bg-raised shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.08),0_2px_8px_-2px_rgba(5,8,22,.16)]":"-bottom-px h-0.5 rounded-full bg-[linear-gradient(90deg,var(--brand-1),var(--brand-2))]"),style:{transform:`translateX(${n==="underline"?f.x+6:f.x}px)`,width:n==="underline"?f.w-12:f.w}}):null,R.map((e,t)=>e==="gap"?a("span",{"aria-hidden":!0,className:d("grid place-items-center text-muted",S),children:"\u2026"},`g${t}`):H(e))]});return u("nav",{"aria-label":"Pagination",className:d("flex flex-wrap items-center justify-between gap-x-4 gap-y-2",M),children:[r!==void 0?u("p",{className:"num text-[12.5px] text-muted",children:[u("span",{className:"font-medium text-text",children:[r===0?0:I.toLocaleString(),"\u2013",A.toLocaleString()]})," ",i.of," ",r.toLocaleString()]}):null,u("div",{className:"flex items-center gap-1",children:[b?_(-1,!0):null,_(-1),h,_(1),b?_(1,!0):null]}),y&&p?u("label",{className:"flex items-center gap-2 text-[12.5px] text-muted",children:[a("select",{value:m,onChange:e=>p(Number(e.target.value)),className:"h-8 cursor-pointer rounded-ctl border border-border2 bg-raised pl-2 pr-6 text-[12.5px] text-text outline-none focus:border-primary focus:ring-2 focus:ring-primary/20",children:y.map(e=>a("option",{value:e,children:e},e))}),i.perPage]}):null]})}export{K as Pagination,W as pageRange};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as p}from"react/jsx-runtime";import{ArrowBigUpDash as k,Eye as C,EyeOff as L}from"lucide-react";import*as i from"react";import{cn as u}from"../../lib/utils.js";import{Input as E}from"./input.js";const M=[{label:"Too short",tone:"bg-danger",text:"text-danger"},{label:"Weak",tone:"bg-danger",text:"text-danger"},{label:"Fair",tone:"bg-warning",text:"text-warning"},{label:"Good",tone:"bg-[#4f9d2a]",text:"text-[#4f9d2a]"},{label:"Strong",tone:"bg-success",text:"text-success"}];function P(s){if(s.length<6)return 0;const a=[/[a-z]/,/[A-Z]/,/\d/,/[^A-Za-z0-9]/].filter(d=>d.test(s)).length;let n=s.length>=12?2:s.length>=8?1:0;return n+=Math.max(0,a-1),Math.min(4,Math.max(1,n))}const z=i.forwardRef(({className:s,strength:a,onKeyUp:n,onKeyDown:d,onBlur:w,onChange:h,value:o,defaultValue:m,...v},y)=>{const[r,S]=i.useState(!1),[g,f]=i.useState(!1),[N,I]=i.useState(String(m??"")),l=o!==void 0?String(o):N,x=P(l),c=M[x],b=e=>f(e.getModifierState?.("CapsLock")??!1);return p("div",{className:u("w-full",s),children:[t(E,{ref:y,type:r?"text":"password",autoComplete:a?"new-password":"current-password",spellCheck:!1,value:o,defaultValue:m,onChange:e=>{o===void 0&&I(e.target.value),h?.(e)},onKeyUp:e=>{b(e),n?.(e)},onKeyDown:e=>{b(e),d?.(e)},onBlur:e=>{f(!1),w?.(e)},trailing:p("span",{className:"flex items-center gap-1",children:[g?p("span",{title:"Caps Lock is on",className:"grid size-6 place-items-center rounded-[6px] bg-warning-subtle text-warning animate-[wm-pop_180ms_var(--ease)] [&_svg]:!size-3.5",children:[t(k,{}),t("span",{className:"sr-only",children:"Caps Lock is on"})]}):null,t("button",{type:"button",onClick:()=>S(e=>!e),"aria-label":r?"Hide password":"Show password","aria-pressed":r,className:"grid size-7 cursor-pointer place-items-center rounded-[6px] text-muted transition-colors hover:bg-hover hover:text-text",children:r?t(L,{}):t(C,{})})]}),className:g?"pr-[72px]":"pr-11",...v}),a?p("div",{className:"mt-2 flex items-center gap-3","aria-live":"polite",children:[t("div",{className:"flex flex-1 gap-1",children:[1,2,3,4].map(e=>t("span",{className:"h-1 flex-1 overflow-hidden rounded-full bg-hover",children:t("span",{className:u("block h-full rounded-full transition-[width,background-color] duration-300",c.tone),style:{width:l&&x>=e?"100%":"0%"}})},e))}),t("span",{className:u("w-16 text-right text-[11.5px] font-medium",l?c.text:"text-muted"),children:l?c.label:"Strength"})]}):null]})});z.displayName="PasswordInput";export{z as PasswordInput,P as passwordScore};
1
+ "use client";import{jsx as t,jsxs as p}from"react/jsx-runtime";import{ArrowBigUpDash as k,Eye as C,EyeOff as L}from"lucide-react";import*as i from"react";import{cn as u}from"../../lib/utils.js";import{Input as E}from"./input.js";const M=[{label:"Too short",tone:"bg-danger",text:"text-danger"},{label:"Weak",tone:"bg-danger",text:"text-danger"},{label:"Fair",tone:"bg-warning",text:"text-warning"},{label:"Good",tone:"bg-[#4f9d2a]",text:"text-[#4f9d2a]"},{label:"Strong",tone:"bg-success",text:"text-success"}];function P(a){if(a.length<6)return 0;const s=[/[a-z]/,/[A-Z]/,/\d/,/[^A-Za-z0-9]/].filter(c=>c.test(a)).length;let n=a.length>=12?2:a.length>=8?1:0;return n+=Math.max(0,s-1),Math.min(4,Math.max(1,n))}const z=i.forwardRef(({className:a,strength:s,onKeyUp:n,onKeyDown:c,onBlur:w,onChange:h,value:o,defaultValue:m,...v},y)=>{const[r,S]=i.useState(!1),[g,f]=i.useState(!1),[N,I]=i.useState(String(m??"")),l=o!==void 0?String(o):N,x=P(l),d=M[x],b=e=>f(e.getModifierState?.("CapsLock")??!1);return p("div",{className:u("w-full",a),children:[t(E,{ref:y,type:r?"text":"password",autoComplete:s?"new-password":"current-password",spellCheck:!1,value:o,defaultValue:m,onChange:e=>{o===void 0&&I(e.target.value),h?.(e)},onKeyUp:e=>{b(e),n?.(e)},onKeyDown:e=>{b(e),c?.(e)},onBlur:e=>{f(!1),w?.(e)},trailing:p("span",{className:"flex items-center gap-1",children:[g?p("span",{title:"Caps Lock is on",className:"grid size-6 place-items-center rounded-[calc(6px*var(--radius-scale))] bg-warning-subtle text-warning animate-[wm-pop_180ms_var(--ease)] [&_svg]:!size-3.5",children:[t(k,{}),t("span",{className:"sr-only",children:"Caps Lock is on"})]}):null,t("button",{type:"button",onClick:()=>S(e=>!e),"aria-label":r?"Hide password":"Show password","aria-pressed":r,className:"grid size-7 cursor-pointer place-items-center rounded-[calc(6px*var(--radius-scale))] text-muted transition-colors hover:bg-hover hover:text-text",children:r?t(L,{}):t(C,{})})]}),className:g?"pr-[72px]":"pr-11",...v}),s?p("div",{className:"mt-2 flex items-center gap-3","aria-live":"polite",children:[t("div",{className:"flex flex-1 gap-1",children:[1,2,3,4].map(e=>t("span",{className:"h-1 flex-1 overflow-hidden rounded-full bg-hover",children:t("span",{className:u("block h-full rounded-full transition-[width,background-color] duration-300",d.tone),style:{width:l&&x>=e?"100%":"0%"}})},e))}),t("span",{className:u("w-16 text-right text-[11.5px] font-medium",l?d.text:"text-muted"),children:l?d.label:"Strength"})]}):null]})});z.displayName="PasswordInput";export{z as PasswordInput,P as passwordScore};
@@ -1 +1 @@
1
- "use client";import{jsx as u,jsxs as z}from"react/jsx-runtime";import*as c from"react";import{cn as y}from"../../lib/utils.js";const N={boxed:"rounded-[10px] border border-border2 bg-raised shadow-[inset_0_1px_1px_rgba(5,8,22,.05)] focus:border-primary focus:ring-[3px] focus:ring-primary/20 data-[filled]:border-border2",split:"rounded-[10px] border border-border2 bg-raised shadow-[inset_0_1px_1px_rgba(5,8,22,.05)] focus:border-primary focus:ring-[3px] focus:ring-primary/20",underline:"rounded-none border-0 border-b-2 border-border2 bg-transparent focus:border-primary"};function O({length:n=6,value:p,defaultValue:w="",onValueChange:h,onComplete:v,type:f="numeric",mask:_,variant:b="boxed",size:P="md",error:l,disabled:k,autoFocus:D,"aria-label":I="Verification code",className:C}){const[V,A]=c.useState(w.slice(0,n)),i=(p??V).slice(0,n),m=c.useRef([]),F=f==="numeric"?/\d/:/[a-z0-9]/i,g=t=>{p===void 0&&A(t),h?.(t),t.length===n&&!t.includes(" ")&&v?.(t)},d=t=>{const e=m.current[Math.max(0,Math.min(n-1,t))];e?.focus(),e?.select()},x=(t,e)=>{const o=[...e].filter(a=>F.test(a)).map(a=>a.toUpperCase());if(!o.length)return;const r=Array.from({length:n},(a,s)=>i[s]??" ");o.slice(0,n-t).forEach((a,s)=>r[t+s]=a),g(r.join("").trimEnd()),d(t+o.length)},M=Math.ceil(n/2),R=P==="lg";return u("div",{role:"group","aria-label":I,className:y("flex items-center gap-2",l&&"wm-shake",C),children:Array.from({length:n},(t,e)=>{const o=i[e]&&i[e]!==" "?i[e]:"";return z(c.Fragment,{children:[b==="split"&&e===M?u("span",{"aria-hidden":!0,className:"h-0.5 w-3 rounded-full bg-border2"}):null,u("input",{ref:r=>{m.current[e]=r},"aria-label":`Character ${e+1} of ${n}`,inputMode:f==="numeric"?"numeric":"text",autoComplete:e===0?"one-time-code":"off",autoFocus:D&&e===0,disabled:k,type:_?"password":"text",value:o,"data-filled":o?"":void 0,"aria-invalid":l||void 0,onFocus:r=>r.target.select(),onChange:r=>{const a=r.target.value.replace(o,"")||r.target.value;x(e,a.length>1?a:a.slice(-1))},onPaste:r=>{r.preventDefault(),x(e,r.clipboardData.getData("text"))},onKeyDown:r=>{if(r.key==="Backspace"){r.preventDefault();const a=Array.from({length:n},(B,E)=>i[E]??" "),s=o?e:e-1;if(s<0)return;a[s]=" ",g(a.join("").trimEnd()),d(s)}else r.key==="ArrowLeft"?(r.preventDefault(),d(e-1)):r.key==="ArrowRight"&&(r.preventDefault(),d(e+1))},className:y("num text-center font-semibold text-text caret-primary outline-none transition-[border-color,box-shadow,transform] duration-150","disabled:cursor-not-allowed disabled:opacity-50 data-[filled]:animate-[wm-pop_160ms_var(--ease)]",R?"h-14 w-12 text-[22px]":"h-11 w-10 text-[18px]",N[b],l&&"border-danger focus:border-danger focus:ring-danger/20 data-[filled]:border-danger")})]},e)})})}export{O as PinInput};
1
+ "use client";import{jsx as u,jsxs as z}from"react/jsx-runtime";import*as c from"react";import{cn as y}from"../../lib/utils.js";const N={boxed:"rounded-[calc(10px*var(--radius-scale))] border border-border2 bg-raised shadow-[inset_0_1px_1px_rgba(5,8,22,.05)] focus:border-primary focus:ring-[3px] focus:ring-primary/20 data-[filled]:border-border2",split:"rounded-[calc(10px*var(--radius-scale))] border border-border2 bg-raised shadow-[inset_0_1px_1px_rgba(5,8,22,.05)] focus:border-primary focus:ring-[3px] focus:ring-primary/20",underline:"rounded-none border-0 border-b-2 border-border2 bg-transparent focus:border-primary"};function O({length:n=6,value:p,defaultValue:v="",onValueChange:w,onComplete:h,type:f="numeric",mask:_,variant:b="boxed",size:P="md",error:l,disabled:k,autoFocus:D,"aria-label":I="Verification code",className:C}){const[V,A]=c.useState(v.slice(0,n)),i=(p??V).slice(0,n),m=c.useRef([]),F=f==="numeric"?/\d/:/[a-z0-9]/i,g=t=>{p===void 0&&A(t),w?.(t),t.length===n&&!t.includes(" ")&&h?.(t)},d=t=>{const e=m.current[Math.max(0,Math.min(n-1,t))];e?.focus(),e?.select()},x=(t,e)=>{const o=[...e].filter(a=>F.test(a)).map(a=>a.toUpperCase());if(!o.length)return;const r=Array.from({length:n},(a,s)=>i[s]??" ");o.slice(0,n-t).forEach((a,s)=>r[t+s]=a),g(r.join("").trimEnd()),d(t+o.length)},M=Math.ceil(n/2),R=P==="lg";return u("div",{role:"group","aria-label":I,className:y("flex items-center gap-2",l&&"wm-shake",C),children:Array.from({length:n},(t,e)=>{const o=i[e]&&i[e]!==" "?i[e]:"";return z(c.Fragment,{children:[b==="split"&&e===M?u("span",{"aria-hidden":!0,className:"h-0.5 w-3 rounded-full bg-border2"}):null,u("input",{ref:r=>{m.current[e]=r},"aria-label":`Character ${e+1} of ${n}`,inputMode:f==="numeric"?"numeric":"text",autoComplete:e===0?"one-time-code":"off",autoFocus:D&&e===0,disabled:k,type:_?"password":"text",value:o,"data-filled":o?"":void 0,"aria-invalid":l||void 0,onFocus:r=>r.target.select(),onChange:r=>{const a=r.target.value.replace(o,"")||r.target.value;x(e,a.length>1?a:a.slice(-1))},onPaste:r=>{r.preventDefault(),x(e,r.clipboardData.getData("text"))},onKeyDown:r=>{if(r.key==="Backspace"){r.preventDefault();const a=Array.from({length:n},(B,E)=>i[E]??" "),s=o?e:e-1;if(s<0)return;a[s]=" ",g(a.join("").trimEnd()),d(s)}else r.key==="ArrowLeft"?(r.preventDefault(),d(e-1)):r.key==="ArrowRight"&&(r.preventDefault(),d(e+1))},className:y("num text-center font-semibold text-text caret-primary outline-none transition-[border-color,box-shadow,transform] duration-150","disabled:cursor-not-allowed disabled:opacity-50 data-[filled]:animate-[wm-pop_160ms_var(--ease)]",R?"h-14 w-12 text-[22px]":"h-11 w-10 text-[18px]",N[b],l&&"border-danger focus:border-danger focus:ring-danger/20 data-[filled]:border-danger")})]},e)})})}export{O as PinInput};
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as d}from"react/jsx-runtime";import*as e from"@radix-ui/react-popover";import*as v from"react";import{cn as p}from"../../lib/utils.js";const g=e.Root,x=e.Trigger,P=e.Anchor,s={default:{box:"border-border bg-raised",arrow:"fill-[var(--raised)]"},glass:{box:"border-white/40 bg-raised/70 backdrop-blur-xl backdrop-saturate-150 dark:border-white/10",arrow:"fill-[var(--raised)] opacity-80"},dark:{box:"border-white/10 bg-[#140d33] text-[#d6d8e6] [--text:#f5f6fa] [--body:#d6d8e6] [--muted:#9aa1bd] [--border:rgba(255,255,255,.1)] [--hover:rgba(255,255,255,.08)]",arrow:"fill-[#140d33]"},brand:{box:"border-transparent bg-[linear-gradient(135deg,#1437d3,#7560fd)] text-white/90 [--text:#ffffff] [--body:rgba(255,255,255,.9)] [--muted:rgba(255,255,255,.72)] [--border:rgba(255,255,255,.2)] [--hover:rgba(255,255,255,.12)]",arrow:"fill-[#4a4ce8]"}},f=v.forwardRef(({className:i,align:t="start",sideOffset:r=6,variant:a="default",arrow:n=!1,children:l,...b},c)=>o(e.Portal,{children:d(e.Content,{ref:c,"data-pop":"",align:t,sideOffset:n?r+2:r,className:p("z-50 w-72 rounded-dlg border p-3 shadow-elev3 outline-none",s[a].box,i),...b,children:[l,n?o(e.Arrow,{width:14,height:7,className:s[a].arrow}):null]})}));f.displayName="PopoverContent";function u({title:i,description:t,icon:r,className:a}){return d("div",{className:p("mb-2.5 flex items-start gap-2.5",a),children:[r?o("span",{className:"mt-px grid size-7 shrink-0 place-items-center rounded-[8px] bg-[var(--hover)] text-[var(--text)] [&_svg]:size-4",children:r}):null,d("div",{className:"min-w-0",children:[o("p",{className:"text-[13.5px] font-semibold text-text",children:i}),t?o("p",{className:"mt-0.5 text-[12.5px] leading-[18px] text-muted",children:t}):null]})]})}export{g as Popover,P as PopoverAnchor,f as PopoverContent,u as PopoverHeader,x as PopoverTrigger};
1
+ "use client";import{jsx as o,jsxs as n}from"react/jsx-runtime";import*as r from"@radix-ui/react-popover";import*as c from"react";import{cn as s}from"../../lib/utils.js";const g=r.Root,x=r.Trigger,P=r.Anchor,p={default:{box:"border-border bg-raised",arrow:"fill-[var(--raised)]"},glass:{box:"border-white/40 bg-raised/70 backdrop-blur-xl backdrop-saturate-150 dark:border-white/10",arrow:"fill-[var(--raised)] opacity-80"},dark:{box:"border-white/10 bg-[var(--ink)] text-[#d6d8e6] [--text:#f5f6fa] [--body:#d6d8e6] [--muted:#9aa1bd] [--border:rgba(255,255,255,.1)] [--hover:rgba(255,255,255,.08)]",arrow:"fill-[var(--ink)]"},brand:{box:"border-transparent bg-[linear-gradient(135deg,var(--brand-1),var(--brand-2))] text-white/90 [--text:#ffffff] [--body:rgba(255,255,255,.9)] [--muted:rgba(255,255,255,.72)] [--border:rgba(255,255,255,.2)] [--hover:rgba(255,255,255,.12)]",arrow:"fill-[color-mix(in_srgb,var(--brand-1)_50%,var(--brand-2))]"}},m=c.forwardRef(({className:i,align:t="start",sideOffset:e=6,variant:a="default",arrow:d=!1,children:l,...b},v)=>o(r.Portal,{children:n(r.Content,{ref:v,"data-pop":"",align:t,sideOffset:d?e+2:e,className:s("z-50 w-72 rounded-dlg border p-3 shadow-elev3 outline-none",p[a].box,i),...b,children:[l,d?o(r.Arrow,{width:14,height:7,className:p[a].arrow}):null]})}));m.displayName="PopoverContent";function u({title:i,description:t,icon:e,className:a}){return n("div",{className:s("mb-2.5 flex items-start gap-2.5",a),children:[e?o("span",{className:"mt-px grid size-7 shrink-0 place-items-center rounded-[calc(8px*var(--radius-scale))] bg-[var(--hover)] text-[var(--text)] [&_svg]:size-4",children:e}):null,n("div",{className:"min-w-0",children:[o("p",{className:"text-[13.5px] font-semibold text-text",children:i}),t?o("p",{className:"mt-0.5 text-[12.5px] leading-[18px] text-muted",children:t}):null]})]})}export{g as Popover,P as PopoverAnchor,m as PopoverContent,u as PopoverHeader,x as PopoverTrigger};
@@ -1 +1 @@
1
- "use client";import{jsx as a,jsxs as l}from"react/jsx-runtime";import*as w from"react";import{cn as s}from"../../lib/utils.js";const v={neutral:"bg-muted",info:"bg-primary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",accent:"bg-accent"},x={neutral:"var(--muted)",info:"var(--primary)",success:"var(--success)",warning:"var(--warning)",danger:"var(--danger)",accent:"var(--accent)"},p={sm:"h-1.5",md:"h-2.5",lg:"h-3.5"};function N({value:i,tone:e="info",className:o,label:m,variant:n="bar",size:d="sm",segments:c=5,showValue:g=!1}){const t=typeof i=="number",r=t?Math.max(0,Math.min(100,i)):0,u=n==="segmented"?a("div",{className:s("flex w-full gap-1",p[d]),children:Array.from({length:c},(f,h)=>{const b=Math.max(0,Math.min(1,r/100*c-h));return a("div",{className:"h-full flex-1 overflow-hidden rounded-full bg-hover",children:a("div",{className:s("h-full rounded-full transition-[width] duration-500 ease-wave",v[e]),style:{width:`${b*100}%`}})},h)})}):a("div",{className:s("relative w-full overflow-hidden rounded-full bg-hover",p[d]),children:a("div",{className:s("relative h-full overflow-hidden rounded-full transition-[width] duration-500 ease-wave",!t&&"wm-indeterminate absolute w-2/5",n==="gradient"?"bg-[linear-gradient(90deg,#1437d3,#7560fd)]":v[e],n==="striped"&&"wm-stripes"),style:t?{width:`${r}%`}:void 0,children:n==="gradient"?a("span",{className:"wm-sheen absolute inset-y-0 w-1/3 bg-[linear-gradient(90deg,transparent,rgba(255,255,255,.45),transparent)]"}):null})});return l("div",{role:"progressbar","aria-valuenow":t?r:void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-label":m,className:s("flex w-full items-center gap-3",o),children:[u,g&&t?l("span",{className:"num w-10 shrink-0 text-right text-[12px] font-medium text-text",children:[Math.round(r),"%"]}):null]})}function k({value:i,size:e=64,thickness:o=6,tone:m="info",gradient:n=!1,label:d,children:c,className:g}){const t=Math.max(0,Math.min(100,i)),r=(e-o)/2,u=2*Math.PI*r,f=w.useId().replace(/:/g,"");return l("div",{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":d,className:s("relative inline-grid shrink-0 place-items-center",g),style:{width:e,height:e},children:[l("svg",{width:e,height:e,className:"-rotate-90",children:[n?a("defs",{children:l("linearGradient",{id:`${f}-g`,x1:"0",y1:"0",x2:"1",y2:"1",children:[a("stop",{offset:"0",stopColor:"#1437d3"}),a("stop",{offset:"1",stopColor:"#7560fd"})]})}):null,a("circle",{cx:e/2,cy:e/2,r,fill:"none",stroke:"var(--hover)",strokeWidth:o}),a("circle",{cx:e/2,cy:e/2,r,fill:"none",stroke:n?`url(#${f}-g)`:x[m],strokeWidth:o,strokeLinecap:"round",strokeDasharray:u,strokeDashoffset:u*(1-t/100),style:{transition:"stroke-dashoffset 600ms var(--ease)"}})]}),a("span",{className:"num absolute text-[13px] font-semibold text-text",style:{fontSize:Math.max(11,e*.22)},children:c??`${Math.round(t)}%`})]})}export{N as Progress,k as ProgressRing};
1
+ "use client";import{jsx as a,jsxs as l}from"react/jsx-runtime";import*as w from"react";import{cn as s}from"../../lib/utils.js";const v={neutral:"bg-muted",info:"bg-primary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",accent:"bg-accent"},x={neutral:"var(--muted)",info:"var(--primary)",success:"var(--success)",warning:"var(--warning)",danger:"var(--danger)",accent:"var(--accent)"},p={sm:"h-1.5",md:"h-2.5",lg:"h-3.5"};function N({value:i,tone:e="info",className:o,label:m,variant:n="bar",size:d="sm",segments:c=5,showValue:g=!1}){const r=typeof i=="number",t=r?Math.max(0,Math.min(100,i)):0,u=n==="segmented"?a("div",{className:s("flex w-full gap-1",p[d]),children:Array.from({length:c},(f,h)=>{const b=Math.max(0,Math.min(1,t/100*c-h));return a("div",{className:"h-full flex-1 overflow-hidden rounded-full bg-hover",children:a("div",{className:s("h-full rounded-full transition-[width] duration-500 ease-wave",v[e]),style:{width:`${b*100}%`}})},h)})}):a("div",{className:s("relative w-full overflow-hidden rounded-full bg-hover",p[d]),children:a("div",{className:s("relative h-full overflow-hidden rounded-full transition-[width] duration-500 ease-wave",!r&&"wm-indeterminate absolute w-2/5",n==="gradient"?"bg-[linear-gradient(90deg,var(--brand-1),var(--brand-2))]":v[e],n==="striped"&&"wm-stripes"),style:r?{width:`${t}%`}:void 0,children:n==="gradient"?a("span",{className:"wm-sheen absolute inset-y-0 w-1/3 bg-[linear-gradient(90deg,transparent,rgba(255,255,255,.45),transparent)]"}):null})});return l("div",{role:"progressbar","aria-valuenow":r?t:void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-label":m,className:s("flex w-full items-center gap-3",o),children:[u,g&&r?l("span",{className:"num w-10 shrink-0 text-right text-[12px] font-medium text-text",children:[Math.round(t),"%"]}):null]})}function k({value:i,size:e=64,thickness:o=6,tone:m="info",gradient:n=!1,label:d,children:c,className:g}){const r=Math.max(0,Math.min(100,i)),t=(e-o)/2,u=2*Math.PI*t,f=w.useId().replace(/:/g,"");return l("div",{role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":d,className:s("relative inline-grid shrink-0 place-items-center",g),style:{width:e,height:e},children:[l("svg",{width:e,height:e,className:"-rotate-90",children:[n?a("defs",{children:l("linearGradient",{id:`${f}-g`,x1:"0",y1:"0",x2:"1",y2:"1",children:[a("stop",{offset:"0",style:{stopColor:"var(--brand-1)"}}),a("stop",{offset:"1",style:{stopColor:"var(--brand-2)"}})]})}):null,a("circle",{cx:e/2,cy:e/2,r:t,fill:"none",stroke:"var(--hover)",strokeWidth:o}),a("circle",{cx:e/2,cy:e/2,r:t,fill:"none",stroke:n?`url(#${f}-g)`:x[m],strokeWidth:o,strokeLinecap:"round",strokeDasharray:u,strokeDashoffset:u*(1-r/100),style:{transition:"stroke-dashoffset 600ms var(--ease)"}})]}),a("span",{className:"num absolute text-[13px] font-semibold text-text",style:{fontSize:Math.max(11,e*.22)},children:c??`${Math.round(r)}%`})]})}export{N as Progress,k as ProgressRing};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as n from"@radix-ui/react-radio-group";import{Check as m}from"lucide-react";import*as l from"react";import{cn as i}from"../../lib/utils.js";const u=l.forwardRef(({className:o,orientation:t,...a},r)=>e(n.Root,{ref:r,orientation:t,className:i(t==="horizontal"?"flex flex-wrap gap-x-5 gap-y-2":"grid gap-2.5",o),...a}));u.displayName="RadioGroup";const b="peer grid size-4 shrink-0 cursor-pointer place-items-center rounded-full border border-border2 bg-raised outline-none shadow-[inset_0_1px_1px_rgba(5,8,22,.06)] transition-[background-color,border-color,box-shadow] duration-150 hover:border-primary/60 focus-visible:ring-2 focus-visible:ring-primary/30 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:shadow-[0_1px_3px_rgba(79,70,229,.4)] disabled:cursor-not-allowed disabled:opacity-50",x=l.forwardRef(({className:o,label:t,description:a,disabled:r,...d},c)=>{const p=e(n.Item,{ref:c,disabled:r,className:i(b,t?"mt-0.5":null,!t&&o),...d,children:e(n.Indicator,{className:"size-1.5 rounded-full bg-white animate-[wm-pop_180ms_var(--ease)]"})});return t?s("label",{className:i("group flex cursor-pointer items-start gap-2.5",r&&"cursor-not-allowed opacity-60",o),children:[p,s("span",{className:"min-w-0",children:[e("span",{className:"block text-[13px] font-medium leading-5 text-text",children:t}),a?e("span",{className:"block text-[12px] leading-[17px] text-muted",children:a}):null]})]}):p});x.displayName="RadioGroupItem";const R=l.forwardRef(({className:o,title:t,description:a,icon:r,aside:d,...c},p)=>s(n.Item,{ref:p,className:i("group relative flex w-full cursor-pointer items-start gap-3 rounded-[12px] border border-border bg-raised p-3.5 pr-10 text-left outline-none","transition-[border-color,background-color,box-shadow] duration-200 hover:border-border2","focus-visible:ring-2 focus-visible:ring-primary/35","data-[state=checked]:border-primary data-[state=checked]:bg-[linear-gradient(180deg,var(--primary-subtle),transparent_120%)] data-[state=checked]:shadow-[0_0_0_3px_var(--primary-subtle),0_6px_16px_-8px_rgba(79,70,229,.35)]","disabled:cursor-not-allowed disabled:opacity-50",o),...c,children:[r?e("span",{className:i("grid size-9 shrink-0 place-items-center rounded-[10px] border border-border bg-surface text-muted transition-colors duration-200 [&_svg]:size-[18px]","group-data-[state=checked]:border-primary/25 group-data-[state=checked]:bg-raised group-data-[state=checked]:text-primary"),children:r}):null,s("span",{className:"min-w-0 flex-1",children:[s("span",{className:"flex items-center justify-between gap-3",children:[e("span",{className:"truncate text-[13.5px] font-semibold text-text",children:t}),d?e("span",{className:"num shrink-0 text-[13px] font-semibold text-text",children:d}):null]}),a?e("span",{className:"mt-0.5 block text-[12px] leading-[17px] text-muted",children:a}):null]}),e("span",{"aria-hidden":!0,className:i("absolute right-3.5 top-3.5 grid size-[18px] place-items-center rounded-full border border-border2 bg-raised text-white transition-[background-color,border-color] duration-200","group-data-[state=checked]:border-primary group-data-[state=checked]:bg-primary"),children:e(m,{className:"size-3 scale-0 transition-transform duration-200 ease-[cubic-bezier(.3,1.6,.5,1)] group-data-[state=checked]:scale-100",strokeWidth:3.2})})]}));R.displayName="RadioCard";export{R as RadioCard,u as RadioGroup,x as RadioGroupItem};
1
+ "use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as n from"@radix-ui/react-radio-group";import{Check as m}from"lucide-react";import*as l from"react";import{cn as i}from"../../lib/utils.js";const u=l.forwardRef(({className:o,orientation:r,...a},t)=>e(n.Root,{ref:t,orientation:r,className:i(r==="horizontal"?"flex flex-wrap gap-x-5 gap-y-2":"grid gap-2.5",o),...a}));u.displayName="RadioGroup";const b="peer grid size-4 shrink-0 cursor-pointer place-items-center rounded-full border border-border2 bg-raised outline-none shadow-[inset_0_1px_1px_rgba(5,8,22,.06)] transition-[background-color,border-color,box-shadow] duration-150 hover:border-primary/60 focus-visible:ring-2 focus-visible:ring-primary/30 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:shadow-[0_1px_3px_color-mix(in_srgb,var(--primary)_40%,transparent)] disabled:cursor-not-allowed disabled:opacity-50",x=l.forwardRef(({className:o,label:r,description:a,disabled:t,...d},c)=>{const p=e(n.Item,{ref:c,disabled:t,className:i(b,r?"mt-0.5":null,!r&&o),...d,children:e(n.Indicator,{className:"size-1.5 rounded-full bg-white animate-[wm-pop_180ms_var(--ease)]"})});return r?s("label",{className:i("group flex cursor-pointer items-start gap-2.5",t&&"cursor-not-allowed opacity-60",o),children:[p,s("span",{className:"min-w-0",children:[e("span",{className:"block text-[13px] font-medium leading-5 text-text",children:r}),a?e("span",{className:"block text-[12px] leading-[17px] text-muted",children:a}):null]})]}):p});x.displayName="RadioGroupItem";const R=l.forwardRef(({className:o,title:r,description:a,icon:t,aside:d,...c},p)=>s(n.Item,{ref:p,className:i("group relative flex w-full cursor-pointer items-start gap-3 rounded-[calc(12px*var(--radius-scale))] border border-border bg-raised p-3.5 pr-10 text-left outline-none","transition-[border-color,background-color,box-shadow] duration-200 hover:border-border2","focus-visible:ring-2 focus-visible:ring-primary/35","data-[state=checked]:border-primary data-[state=checked]:bg-[linear-gradient(180deg,var(--primary-subtle),transparent_120%)] data-[state=checked]:shadow-[0_0_0_3px_var(--primary-subtle),0_6px_16px_-8px_color-mix(in_srgb,var(--primary)_35%,transparent)]","disabled:cursor-not-allowed disabled:opacity-50",o),...c,children:[t?e("span",{className:i("grid size-9 shrink-0 place-items-center rounded-[calc(10px*var(--radius-scale))] border border-border bg-surface text-muted transition-colors duration-200 [&_svg]:size-[18px]","group-data-[state=checked]:border-primary/25 group-data-[state=checked]:bg-raised group-data-[state=checked]:text-primary"),children:t}):null,s("span",{className:"min-w-0 flex-1",children:[s("span",{className:"flex items-center justify-between gap-3",children:[e("span",{className:"truncate text-[13.5px] font-semibold text-text",children:r}),d?e("span",{className:"num shrink-0 text-[13px] font-semibold text-text",children:d}):null]}),a?e("span",{className:"mt-0.5 block text-[12px] leading-[17px] text-muted",children:a}):null]}),e("span",{"aria-hidden":!0,className:i("absolute right-3.5 top-3.5 grid size-[18px] place-items-center rounded-full border border-border2 bg-raised text-white transition-[background-color,border-color] duration-200","group-data-[state=checked]:border-primary group-data-[state=checked]:bg-primary"),children:e(m,{className:"size-3 scale-0 transition-transform duration-200 ease-[cubic-bezier(.3,1.6,.5,1)] group-data-[state=checked]:scale-100",strokeWidth:3.2})})]}));R.displayName="RadioCard";export{R as RadioCard,u as RadioGroup,x as RadioGroupItem};
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Rating — a score out of five (or `max`): a review of a car park, how a
4
+ * session went.
5
+ *
6
+ * Hovering previews the score before it is given; arrows, Home and End set it
7
+ * from the keyboard (it is a slider to a screen reader). `allowHalf` takes
8
+ * half steps. `readOnly` draws a score, with `count` for "4.6 (128)".
9
+ * `labels` names each score ("Poor" … "Excellent") beside the stars.
10
+ */
11
+ export interface RatingProps {
12
+ value?: number;
13
+ defaultValue?: number;
14
+ onValueChange?: (value: number) => void;
15
+ max?: number;
16
+ allowHalf?: boolean;
17
+ readOnly?: boolean;
18
+ icon?: "star" | "heart";
19
+ size?: "sm" | "md" | "lg";
20
+ /** One word per whole score, from 1. */
21
+ labels?: string[];
22
+ /** Read-only: the number of ratings behind the score. */
23
+ count?: number;
24
+ "aria-label"?: string;
25
+ className?: string;
26
+ }
27
+ export declare function Rating({ value, defaultValue, onValueChange, max, allowHalf, readOnly, icon, size, labels, count, "aria-label": ariaLabel, className, }: RatingProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as r,jsxs as f}from"react/jsx-runtime";import{Heart as E,Star as I}from"lucide-react";import*as P from"react";import{cn as l}from"../../lib/utils.js";const T={sm:14,md:20,lg:28};function X({value:p,defaultValue:A=0,onValueChange:C,max:i=5,allowHalf:h=!1,readOnly:t=!1,icon:g="star",size:v="md",labels:u,count:x,"aria-label":H="Rating",className:L}){const[S,_]=P.useState(A),n=p??S,[b,w]=P.useState(null),m=b??n,N=h?.5:1,M=g==="heart"?E:I,o=T[v],D=g==="heart"?"text-rose-500":"text-amber-400",a=s=>{const e=Math.min(i,Math.max(0,s));p===void 0&&_(e),C?.(e)},R=(s,e)=>{if(!h)return e+1;const c=s.currentTarget.getBoundingClientRect();return s.clientX-c.left<c.width/2?e+.5:e+1},$=u&&m>0?u[Math.ceil(m)-1]:null;return f("div",{className:l("inline-flex items-center gap-2",L),children:[r("div",{role:t?"img":"slider","aria-label":t?`${n} out of ${i}`:H,"aria-valuemin":t?void 0:0,"aria-valuemax":t?void 0:i,"aria-valuenow":t?void 0:n,"aria-valuetext":t?void 0:`${n} of ${i}${u&&n?`, ${u[Math.ceil(n)-1]}`:""}`,tabIndex:t?void 0:0,onKeyDown:s=>{if(t)return;const e=s.key;if(e==="ArrowRight"||e==="ArrowUp")a(n+N);else if(e==="ArrowLeft"||e==="ArrowDown")a(n-N);else if(e==="Home")a(0);else if(e==="End")a(i);else return;s.preventDefault()},onPointerLeave:()=>w(null),className:l("inline-flex items-center rounded-[6px] outline-none focus-visible:ring-2 focus-visible:ring-primary/40",v==="sm"?"gap-0.5":"gap-1"),children:Array.from({length:i},(s,e)=>{const c=Math.max(0,Math.min(1,m-e));return f("span",{onPointerMove:t?void 0:d=>w(R(d,e)),onClick:t?void 0:d=>{const k=R(d,e);a(k===n?0:k)},className:l("relative inline-grid shrink-0 place-items-center",!t&&"cursor-pointer transition-transform duration-150 hover:scale-110 active:scale-95"),style:{width:o,height:o},children:[r(M,{className:"text-border2",style:{width:o,height:o},strokeWidth:1.6}),r("span",{className:"absolute inset-0 overflow-hidden transition-[width] duration-150",style:{width:`${c*100}%`},children:r(M,{className:l(D,"drop-shadow-[0_1px_2px_rgba(245,158,11,.35)]"),fill:"currentColor",style:{width:o,height:o},strokeWidth:1.6})})]},e)})}),t?f("span",{className:"num text-[13px] text-muted",children:[r("span",{className:"font-semibold text-text",children:n.toFixed(1)}),x!==void 0?` (${x.toLocaleString()})`:null]}):$?r("span",{className:l("text-[12.5px] font-medium transition-colors",b!==null?"text-muted":"text-text"),children:$}):null]})}export{X as Rating};
@@ -0,0 +1,17 @@
1
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
2
+ import * as React from "react";
3
+ /**
4
+ * ScrollArea — a box that scrolls with a thin scrollbar of the system's own,
5
+ * the same on every OS, over the content instead of beside it (no layout
6
+ * shift when it appears).
7
+ *
8
+ * `fade` softens the edges that have more to show, so it is obvious the list
9
+ * goes on; the fade goes away at the end you have reached.
10
+ */
11
+ export interface ScrollAreaProps extends React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> {
12
+ orientation?: "vertical" | "horizontal" | "both";
13
+ fade?: boolean;
14
+ /** Class for the scrolling viewport (padding goes here). */
15
+ viewportClassName?: string;
16
+ }
17
+ export declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps & React.RefAttributes<HTMLDivElement>>;