@waveinno/ui 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +29 -11
- package/dist/components/brand/waveinno-logo.js +1 -1
- package/dist/components/charts/bar-list.js +1 -1
- package/dist/components/charts/heatmap.js +1 -1
- package/dist/components/patterns/activity-feed.js +1 -1
- package/dist/components/patterns/app-launcher.js +1 -1
- package/dist/components/patterns/data-table-edit.js +1 -1
- package/dist/components/patterns/data-table-filters.js +1 -1
- package/dist/components/patterns/data-table.js +1 -1
- package/dist/components/patterns/page-header.js +1 -1
- package/dist/components/patterns/page-hero.js +1 -1
- package/dist/components/patterns/stat-card.js +1 -1
- package/dist/components/patterns/timeline.js +1 -1
- package/dist/components/ui/alert.js +1 -1
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/badge.js +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/combobox.js +1 -1
- package/dist/components/ui/confirm-dialog.js +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/file-upload.js +1 -1
- package/dist/components/ui/kbd.js +1 -1
- package/dist/components/ui/menu.js +1 -1
- package/dist/components/ui/password-input.js +1 -1
- package/dist/components/ui/pin-input.js +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/progress.js +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/segmented.d.ts +1 -1
- package/dist/components/ui/segmented.js +1 -1
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/spinner.js +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/toast.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/use-router.d.ts +41 -0
- package/dist/hooks/use-router.js +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +1 -1
- package/dist/lib/theme.d.ts +48 -0
- package/dist/lib/theme.js +7 -0
- package/dist/next/index.d.ts +6 -0
- package/dist/next/index.js +1 -0
- package/dist/shell/app-shell.js +1 -1
- package/dist/shell/app-switcher.js +1 -1
- package/dist/shell/command-palette.js +1 -1
- package/dist/shell/icon-rail.js +1 -1
- package/dist/shell/mobile-nav.js +1 -1
- package/dist/shell/module-sidebar.js +1 -1
- package/dist/shell/notifications.js +1 -1
- package/dist/shell/placeholder-screen.js +1 -1
- package/dist/shell/topbar.js +1 -1
- package/dist/shell/use-active.js +1 -1
- package/dist/shell/user-menu.js +1 -1
- package/dist/styles.css +18 -5
- package/package.json +11 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as o}from"react/jsx-runtime";import{cva as
|
|
1
|
+
import{jsx as r,jsxs as o}from"react/jsx-runtime";import{cva as c}from"class-variance-authority";import{cn as s}from"../../lib/utils.js";const i=c("inline-flex items-center gap-[5px] h-[22px] px-[9px] rounded-full text-xs font-medium leading-none whitespace-nowrap",{variants:{tone:{neutral:"bg-hover text-muted",info:"bg-primary-subtle text-primary",success:"bg-success-subtle text-success",warning:"bg-warning-subtle text-warning",danger:"bg-danger-subtle text-danger",accent:"bg-primary-subtle text-accent"}},defaultVariants:{tone:"neutral"}}),u={neutral:"var(--muted)",info:"var(--primary)",success:"var(--success)",warning:"var(--warning)",danger:"var(--danger)",accent:"var(--accent)"},b={solid:"text-white bg-[var(--tone)] shadow-[inset_0_1px_0_rgba(255,255,255,.2)]",outline:"bg-transparent text-[var(--tone)] ring-1 ring-inset ring-[color-mix(in_srgb,var(--tone)_40%,transparent)]",dot:"bg-raised text-body ring-1 ring-inset ring-border",gradient:"text-white bg-[linear-gradient(135deg,var(--brand-1),var(--brand-2))] shadow-[inset_0_1px_0_rgba(255,255,255,.25),0_2px_8px_-2px_color-mix(in_srgb,var(--brand-1)_50%,transparent)]",live:""};function x({className:n,tone:t,dot:a=!0,variant:e="soft",style:g,children:l,...d}){const p=t??"neutral";return o("span",{className:s(i({tone:t}),e!=="soft"&&e!=="live"&&b[e],n),style:{"--tone":u[p],...g},...d,children:[a?o("span",{className:"relative grid size-1.5 shrink-0 place-items-center","aria-hidden":!0,children:[e==="live"?r("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-current opacity-60"}):null,r("i",{className:s("relative size-1.5 rounded-full",e==="dot"?"bg-[var(--tone)]":"bg-current")})]}):null,l]})}function _({label:n,tone:t="neutral",variant:a,className:e}){return r(x,{tone:t,variant:a,className:e,children:n})}function w({value:n,tone:t="neutral",className:a}){return r("span",{className:s("num inline-grid min-w-4 place-items-center rounded-full px-1 text-[10px] font-semibold leading-4 text-white",t==="danger"?"bg-danger":"bg-muted",a),children:n})}export{x as Badge,w as CountBadge,_ as StatusBadge,i as badgeVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as x,jsxs as f}from"react/jsx-runtime";import{Slot as d}from"@radix-ui/react-slot";import{cva as l}from"class-variance-authority";import{Loader2 as h}from"lucide-react";import*as m from"react";import{cn as s}from"../../lib/utils.js";const r=l("relative isolate inline-flex items-center justify-center gap-[7px] whitespace-nowrap rounded-ctl text-[13px] font-medium leading-none transition-[background-color,border-color,color,box-shadow,transform,filter] duration-150 ease-wave active:scale-[.98] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{primary:"bg-primary text-white hover:bg-primary-hover",secondary:"bg-raised text-text border border-border2 hover:bg-hover",ghost:"text-muted hover:bg-hover hover:text-text",subtle:"bg-primary-subtle text-primary hover:brightness-[.97]",danger:"bg-danger text-white hover:brightness-110",link:"text-primary underline-offset-4 hover:underline px-0",gradient:"overflow-hidden text-white bg-[linear-gradient(135deg,var(--brand-1),color-mix(in_srgb,var(--brand-1)_78%,#000)_40%,var(--brand-2))] shadow-[inset_0_1px_0_rgba(255,255,255,.3),0_1px_2px_rgba(5,8,22,.2),0_8px_20px_-8px_color-mix(in_srgb,var(--brand-1)_60%,transparent)] hover:brightness-110 hover:shadow-[inset_0_1px_0_rgba(255,255,255,.3),0_1px_2px_rgba(5,8,22,.2),0_12px_26px_-8px_color-mix(in_srgb,var(--brand-1)_70%,transparent)] after:absolute after:inset-y-0 after:-left-full after:w-1/2 after:-skew-x-12 after:bg-[linear-gradient(90deg,transparent,rgba(255,255,255,.35),transparent)] after:transition-[left] after:duration-700 hover:after:left-[150%]",glow:"bg-primary text-white shadow-[0_0_0_1px_color-mix(in_srgb,var(--primary)_40%,transparent),0_6px_22px_-4px_color-mix(in_srgb,var(--primary)_65%,transparent)] hover:shadow-[0_0_0_1px_color-mix(in_srgb,var(--primary)_55%,transparent),0_8px_30px_-4px_color-mix(in_srgb,var(--primary)_80%,transparent)] hover:bg-primary-hover",dark:"text-white bg-[linear-gradient(180deg,#2a1f66,#1a113e)] shadow-[inset_0_1px_0_rgba(255,255,255,.14),0_1px_2px_rgba(5,8,22,.3),0_6px_16px_-8px_rgba(26,17,62,.7)] hover:brightness-125 dark:ring-1 dark:ring-white/15",outline:"border border-primary/40 text-primary hover:bg-primary-subtle hover:border-primary",elevated:"bg-raised text-text shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.08),0_6px_16px_-6px_rgba(5,8,22,.18)] ring-1 ring-border hover:-translate-y-px hover:shadow-[var(--lit),0_2px_4px_rgba(5,8,22,.08),0_10px_22px_-8px_rgba(5,8,22,.25)]",glass:"text-white backdrop-blur-xl backdrop-saturate-150 [text-shadow:0_1px_1px_rgba(5,8,22,.3)] bg-[linear-gradient(180deg,rgba(255,255,255,.28),rgba(255,255,255,.1))] ring-1 ring-inset ring-white/40 shadow-[inset_0_1px_0_rgba(255,255,255,.5),inset_0_-1px_0_rgba(255,255,255,.08),0_8px_24px_-10px_rgba(5,8,22,.55)] hover:bg-[linear-gradient(180deg,rgba(255,255,255,.36),rgba(255,255,255,.16))] hover:ring-white/60",white:"bg-white text-[#1a113e] shadow-[inset_0_-1px_0_rgba(26,17,62,.08),0_1px_2px_rgba(5,8,22,.2),0_10px_24px_-10px_rgba(5,8,22,.6)] hover:bg-[#f4f5fb]"},shape:{default:"",pill:"rounded-full"},size:{default:"h-ctl px-[14px]",sm:"h-8 px-3 text-xs",lg:"h-11 px-5 text-sm",xl:"h-[52px] px-7 text-[15px] font-semibold [&_svg]:size-5",icon:"h-ctl w-ctl px-0",iconSm:"h-8 w-8 px-0"}},defaultVariants:{variant:"secondary",size:"default",shape:"default"}}),v=m.forwardRef(({className:e,variant:t,size:a,shape:o,asChild:b=!1,loading:i,children:n,disabled:g,...p},_)=>b?x(d,{ref:_,className:s(r({variant:t,size:a,shape:o}),e),...p,children:n}):f("button",{ref:_,className:s(r({variant:t,size:a,shape:o}),e),disabled:g||i,...p,children:[i?x(h,{className:"animate-spin"}):null,n]}));v.displayName="Button";export{v as Button,r as buttonVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"@radix-ui/react-checkbox";import{Check as a,Minus as c}from"lucide-react";import*as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"@radix-ui/react-checkbox";import{Check as a,Minus as c}from"lucide-react";import*as s from"react";import{cn as d}from"../../lib/utils.js";const m=s.forwardRef(({className:o,...t},i)=>e(r.Root,{ref:i,className:d("peer size-4 shrink-0 cursor-pointer rounded-[calc(4px*var(--radius-scale))] border border-border2 bg-raised transition-colors duration-100 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary disabled:cursor-not-allowed disabled:opacity-50",o),...t,children:e(r.Indicator,{className:"grid place-items-center text-white",children:t.checked==="indeterminate"?e(c,{className:"size-3",strokeWidth:3}):e(a,{className:"size-3",strokeWidth:3})})}));m.displayName="Checkbox";export{m as Checkbox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as $,jsx as t,jsxs as o}from"react/jsx-runtime";import{Check as q,ChevronsUpDown as F,Search as W,SearchX as G,X as R}from"lucide-react";import*as d from"react";import{cn as x}from"../../lib/utils.js";import{Popover as Q,PopoverContent as j,PopoverTrigger as J}from"./popover.js";const V={placeholder:"Choose\u2026",search:"Search\u2026",clear:"Clear",empty:r=>`Nothing matches \u201C${r}\u201D`,count:(r,a)=>`${r} of ${a}`,total:r=>`${r} options`},Y="\u09E6\u09E7\u09E8\u09E9\u09EA\u09EB\u09EC\u09ED\u09EE\u09EF";function h(r){return r.normalize("NFKD").replace(/[̀-ͯ]/g,"").replace(/[০-৯]/g,a=>String(Y.indexOf(a))).toLowerCase().trim()}function Z(r,a){const i=h(r.label);return i.startsWith(a)?0:i.split(/[\s\-–—(),./]+/).some(v=>v.startsWith(a))?1:[i,h(r.hint??""),...(r.keywords??[]).map(h)].some(v=>v.includes(a))?2:-1}function ee({text:r,q:a}){if(!a)return t($,{children:r});const i=h(r).indexOf(a);return i<0||h(r).length!==r.length?t($,{children:r}):o($,{children:[r.slice(0,i),t("mark",{className:"rounded-[3px] bg-primary-subtle px-px text-primary",children:r.slice(i,i+a.length)}),r.slice(i+a.length)]})}function ae({id:r,value:a,onChange:i,options:f,placeholder:v,searchPlaceholder:z,clearable:L=!1,disabled:E,className:H,contentClassName:I,hintInValue:O=!1,labels:B,"aria-invalid":U}){const u={...V,...B},[m,k]=d.useState(!1),[N,w]=d.useState(""),[p,D]=d.useState(0),K=d.useRef(null),y=d.useId(),c=f.find(e=>e.value===a)??null,g=h(N),A=d.useMemo(()=>g?f.map((e,s)=>({o:e,i:s,r:Z(e,g)})).filter(e=>e.r>=0).sort((e,s)=>e.r-s.r||e.i-s.i).map(e=>e.o):f,[f,g]),M=d.useMemo(()=>{const e=new Map;for(const s of A){const n=s.group??"";e.has(n)||e.set(n,[]),e.get(n).push(s)}return[...e.entries()]},[A]),l=d.useMemo(()=>M.flatMap(([,e])=>e),[M]);d.useEffect(()=>{if(!m)return;const e=g?l.findIndex(s=>!s.disabled):Math.max(0,l.findIndex(s=>s.value===a));D(e<0?0:e)},[m,g]),d.useEffect(()=>{if(!m)return;K.current?.querySelector(`[data-index="${p}"]`)?.scrollIntoView({block:"nearest"})},[p,m]);const P=e=>{e.disabled||(i(e.value),k(!1))},C=(e,s=p)=>{if(!l.length)return;let n=s;for(let b=0;b<l.length;b++)if(n=(n+e+l.length)%l.length,!l[n].disabled)return D(n)},X=e=>{if(e.key==="ArrowDown")C(1);else if(e.key==="ArrowUp")C(-1);else if(e.key==="Home")C(1,-1);else if(e.key==="End")C(-1,l.length);else if(e.key==="Enter")l[p]&&P(l[p]);else return;e.preventDefault()},_=e=>{k(e),e||w("")};let T=-1;return o(Q,{open:m,onOpenChange:_,children:[o("div",{className:x("relative",H),children:[t(J,{asChild:!0,disabled:E,children:o("button",{id:r,type:"button",role:"combobox","aria-expanded":m,"aria-controls":`${y}-list`,"aria-haspopup":"listbox","aria-invalid":U,onKeyDown:e=>{!m&&e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key!==" "?(w(e.key),k(!0),e.preventDefault()):!m&&(e.key==="ArrowDown"||e.key==="ArrowUp")&&(k(!0),e.preventDefault())},className:x("group flex h-ctl w-full cursor-pointer items-center gap-2 rounded-ctl border border-border2 bg-raised pl-3 text-left text-[13px] text-text outline-none transition-[border-color,box-shadow]","focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 data-[state=open]:border-primary data-[state=open]:ring-2 data-[state=open]:ring-primary/20","disabled:cursor-not-allowed disabled:bg-hover disabled:text-muted aria-[invalid=true]:border-danger",L&&c?"pr-14":"pr-8"),children:[c?.icon?t("span",{className:"grid shrink-0 place-items-center text-muted",children:c.icon}):null,o("span",{className:x("min-w-0 flex-1 truncate",!c&&"text-placeholder"),children:[c?c.label:v??u.placeholder,c&&O?o("span",{className:"ml-1.5 text-muted",children:["\xB7 ",typeof O=="function"?O(c):c.hint]}):null]})]})}),L&&c&&!E?t("button",{type:"button","aria-label":u.clear,onClick:()=>i(null),className:"absolute right-7 top-1/2 grid size-6 -translate-y-1/2 cursor-pointer place-items-center rounded-md text-muted hover:bg-hover hover:text-text",children:t(R,{className:"size-3.5"})}):null,t(F,{className:"pointer-events-none absolute right-2.5 top-1/2 size-4 -translate-y-1/2 text-muted"})]}),o(j,{align:"start",className:x("w-[var(--radix-popover-trigger-width)] min-w-[260px] overflow-hidden p-0",I),onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector("input")?.focus()},children:[o("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[t(W,{className:"size-4 shrink-0 text-muted"}),t("input",{value:N,onChange:e=>w(e.target.value),onKeyDown:X,placeholder:z??u.search,"aria-label":z??u.search,"aria-controls":`${y}-list`,"aria-activedescendant":l[p]?`${y}-${p}`:void 0,autoComplete:"off",spellCheck:!1,className:"h-11 min-w-0 flex-1 bg-transparent text-[13.5px] text-text outline-none placeholder:text-placeholder"}),N?t("button",{type:"button","aria-label":u.clear,onClick:()=>w(""),className:"grid size-6 cursor-pointer place-items-center rounded-md text-muted hover:bg-hover hover:text-text",children:t(R,{className:"size-3.5"})}):null]}),t("div",{ref:K,id:`${y}-list`,role:"listbox",className:"max-h-[296px] overflow-y-auto overscroll-contain p-1.5",children:l.length===0?o("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[t(G,{className:"size-6 text-muted"}),t("p",{className:"text-[13px] text-muted",children:u.empty(N)})]}):M.map(([e,s])=>o("div",{role:"group","aria-label":e||void 0,children:[e?t("p",{className:"sticky top-0 z-10 bg-raised px-2 pb-1 pt-2 text-[10.5px] font-semibold uppercase tracking-[0.08em] text-muted",children:e}):null,s.map(n=>{T++;const b=T,S=n.value===a;return o("div",{id:`${y}-${b}`,"data-index":b,role:"option","aria-selected":S,"aria-disabled":n.disabled,onMouseMove:()=>!n.disabled&&p!==b&&D(b),onClick:()=>P(n),className:x("flex cursor-pointer items-center gap-2.5 rounded-[8px] px-2 py-1.5 text-[13px]",b===p&&"bg-hover",n.disabled&&"cursor-not-allowed opacity-45"),children:[n.icon?t("span",{className:"grid size-7 shrink-0 place-items-center rounded-[7px] bg-surface text-muted",children:n.icon}):null,o("span",{className:"min-w-0 flex-1",children:[t("span",{className:x("block truncate text-text",S&&"font-medium"),children:t(ee,{text:n.label,q:g})}),n.hint?t("span",{className:"block truncate text-[11.5px] text-muted",children:n.hint}):null]}),t(q,{className:x("size-4 shrink-0 text-primary",!S&&"invisible")})]},n.value)})]},e||"_"))}),o("div",{className:"flex items-center justify-between border-t border-border bg-surface px-3 py-1.5 text-[11px] text-muted",children:[t("span",{className:"num",children:g?u.count(l.length,f.length):u.total(f.length)}),o("span",{className:"hidden items-center gap-1 sm:flex",children:[t("kbd",{className:"rounded border border-border bg-raised px-1 font-sans",children:"\u2191\u2193"}),t("kbd",{className:"rounded border border-border bg-raised px-1 font-sans",children:"\u21B5"}),t("kbd",{className:"rounded border border-border bg-raised px-1 font-sans",children:"esc"})]})]})]})]})}export{V as COMBOBOX_LABELS,ae as Combobox};
|
|
1
|
+
"use client";import{Fragment as $,jsx as t,jsxs as o}from"react/jsx-runtime";import{Check as q,ChevronsUpDown as F,Search as W,SearchX as G,X as R}from"lucide-react";import*as d from"react";import{cn as x}from"../../lib/utils.js";import{Popover as Q,PopoverContent as j,PopoverTrigger as J}from"./popover.js";const V={placeholder:"Choose\u2026",search:"Search\u2026",clear:"Clear",empty:r=>`Nothing matches \u201C${r}\u201D`,count:(r,a)=>`${r} of ${a}`,total:r=>`${r} options`},Y="\u09E6\u09E7\u09E8\u09E9\u09EA\u09EB\u09EC\u09ED\u09EE\u09EF";function h(r){return r.normalize("NFKD").replace(/[̀-ͯ]/g,"").replace(/[০-৯]/g,a=>String(Y.indexOf(a))).toLowerCase().trim()}function Z(r,a){const i=h(r.label);return i.startsWith(a)?0:i.split(/[\s\-–—(),./]+/).some(v=>v.startsWith(a))?1:[i,h(r.hint??""),...(r.keywords??[]).map(h)].some(v=>v.includes(a))?2:-1}function ee({text:r,q:a}){if(!a)return t($,{children:r});const i=h(r).indexOf(a);return i<0||h(r).length!==r.length?t($,{children:r}):o($,{children:[r.slice(0,i),t("mark",{className:"rounded-[3px] bg-primary-subtle px-px text-primary",children:r.slice(i,i+a.length)}),r.slice(i+a.length)]})}function ae({id:r,value:a,onChange:i,options:f,placeholder:v,searchPlaceholder:z,clearable:L=!1,disabled:E,className:H,contentClassName:I,hintInValue:O=!1,labels:B,"aria-invalid":U}){const u={...V,...B},[m,k]=d.useState(!1),[N,w]=d.useState(""),[p,D]=d.useState(0),K=d.useRef(null),y=d.useId(),c=f.find(e=>e.value===a)??null,g=h(N),A=d.useMemo(()=>g?f.map((e,s)=>({o:e,i:s,r:Z(e,g)})).filter(e=>e.r>=0).sort((e,s)=>e.r-s.r||e.i-s.i).map(e=>e.o):f,[f,g]),M=d.useMemo(()=>{const e=new Map;for(const s of A){const n=s.group??"";e.has(n)||e.set(n,[]),e.get(n).push(s)}return[...e.entries()]},[A]),l=d.useMemo(()=>M.flatMap(([,e])=>e),[M]);d.useEffect(()=>{if(!m)return;const e=g?l.findIndex(s=>!s.disabled):Math.max(0,l.findIndex(s=>s.value===a));D(e<0?0:e)},[m,g]),d.useEffect(()=>{if(!m)return;K.current?.querySelector(`[data-index="${p}"]`)?.scrollIntoView({block:"nearest"})},[p,m]);const P=e=>{e.disabled||(i(e.value),k(!1))},C=(e,s=p)=>{if(!l.length)return;let n=s;for(let b=0;b<l.length;b++)if(n=(n+e+l.length)%l.length,!l[n].disabled)return D(n)},X=e=>{if(e.key==="ArrowDown")C(1);else if(e.key==="ArrowUp")C(-1);else if(e.key==="Home")C(1,-1);else if(e.key==="End")C(-1,l.length);else if(e.key==="Enter")l[p]&&P(l[p]);else return;e.preventDefault()},_=e=>{k(e),e||w("")};let T=-1;return o(Q,{open:m,onOpenChange:_,children:[o("div",{className:x("relative",H),children:[t(J,{asChild:!0,disabled:E,children:o("button",{id:r,type:"button",role:"combobox","aria-expanded":m,"aria-controls":`${y}-list`,"aria-haspopup":"listbox","aria-invalid":U,onKeyDown:e=>{!m&&e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key!==" "?(w(e.key),k(!0),e.preventDefault()):!m&&(e.key==="ArrowDown"||e.key==="ArrowUp")&&(k(!0),e.preventDefault())},className:x("group flex h-ctl w-full cursor-pointer items-center gap-2 rounded-ctl border border-border2 bg-raised pl-3 text-left text-[13px] text-text outline-none transition-[border-color,box-shadow]","focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 data-[state=open]:border-primary data-[state=open]:ring-2 data-[state=open]:ring-primary/20","disabled:cursor-not-allowed disabled:bg-hover disabled:text-muted aria-[invalid=true]:border-danger",L&&c?"pr-14":"pr-8"),children:[c?.icon?t("span",{className:"grid shrink-0 place-items-center text-muted",children:c.icon}):null,o("span",{className:x("min-w-0 flex-1 truncate",!c&&"text-placeholder"),children:[c?c.label:v??u.placeholder,c&&O?o("span",{className:"ml-1.5 text-muted",children:["\xB7 ",typeof O=="function"?O(c):c.hint]}):null]})]})}),L&&c&&!E?t("button",{type:"button","aria-label":u.clear,onClick:()=>i(null),className:"absolute right-7 top-1/2 grid size-6 -translate-y-1/2 cursor-pointer place-items-center rounded-md text-muted hover:bg-hover hover:text-text",children:t(R,{className:"size-3.5"})}):null,t(F,{className:"pointer-events-none absolute right-2.5 top-1/2 size-4 -translate-y-1/2 text-muted"})]}),o(j,{align:"start",className:x("w-[var(--radix-popover-trigger-width)] min-w-[260px] overflow-hidden p-0",I),onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector("input")?.focus()},children:[o("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[t(W,{className:"size-4 shrink-0 text-muted"}),t("input",{value:N,onChange:e=>w(e.target.value),onKeyDown:X,placeholder:z??u.search,"aria-label":z??u.search,"aria-controls":`${y}-list`,"aria-activedescendant":l[p]?`${y}-${p}`:void 0,autoComplete:"off",spellCheck:!1,className:"h-11 min-w-0 flex-1 bg-transparent text-[13.5px] text-text outline-none placeholder:text-placeholder"}),N?t("button",{type:"button","aria-label":u.clear,onClick:()=>w(""),className:"grid size-6 cursor-pointer place-items-center rounded-md text-muted hover:bg-hover hover:text-text",children:t(R,{className:"size-3.5"})}):null]}),t("div",{ref:K,id:`${y}-list`,role:"listbox",className:"max-h-[296px] overflow-y-auto overscroll-contain p-1.5",children:l.length===0?o("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[t(G,{className:"size-6 text-muted"}),t("p",{className:"text-[13px] text-muted",children:u.empty(N)})]}):M.map(([e,s])=>o("div",{role:"group","aria-label":e||void 0,children:[e?t("p",{className:"sticky top-0 z-10 bg-raised px-2 pb-1 pt-2 text-[10.5px] font-semibold uppercase tracking-[0.08em] text-muted",children:e}):null,s.map(n=>{T++;const b=T,S=n.value===a;return o("div",{id:`${y}-${b}`,"data-index":b,role:"option","aria-selected":S,"aria-disabled":n.disabled,onMouseMove:()=>!n.disabled&&p!==b&&D(b),onClick:()=>P(n),className:x("flex cursor-pointer items-center gap-2.5 rounded-[calc(8px*var(--radius-scale))] px-2 py-1.5 text-[13px]",b===p&&"bg-hover",n.disabled&&"cursor-not-allowed opacity-45"),children:[n.icon?t("span",{className:"grid size-7 shrink-0 place-items-center rounded-[calc(7px*var(--radius-scale))] bg-surface text-muted",children:n.icon}):null,o("span",{className:"min-w-0 flex-1",children:[t("span",{className:x("block truncate text-text",S&&"font-medium"),children:t(ee,{text:n.label,q:g})}),n.hint?t("span",{className:"block truncate text-[11.5px] text-muted",children:n.hint}):null]}),t(q,{className:x("size-4 shrink-0 text-primary",!S&&"invisible")})]},n.value)})]},e||"_"))}),o("div",{className:"flex items-center justify-between border-t border-border bg-surface px-3 py-1.5 text-[11px] text-muted",children:[t("span",{className:"num",children:g?u.count(l.length,f.length):u.total(f.length)}),o("span",{className:"hidden items-center gap-1 sm:flex",children:[t("kbd",{className:"rounded border border-border bg-raised px-1 font-sans",children:"\u2191\u2193"}),t("kbd",{className:"rounded border border-border bg-raised px-1 font-sans",children:"\u21B5"}),t("kbd",{className:"rounded border border-border bg-raised px-1 font-sans",children:"esc"})]})]})]})]})}export{V as COMBOBOX_LABELS,ae as Combobox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as i from"@radix-ui/react-dialog";import{CircleAlert as L,ShieldAlert as $,Trash2 as A}from"lucide-react";import*as s from"react";import{cn as n}from"../../lib/utils.js";import{Button as C}from"./button.js";import{DialogOverlay as F}from"./dialog.js";import{Input as O}from"./input.js";function q({open:
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as i from"@radix-ui/react-dialog";import{CircleAlert as L,ShieldAlert as $,Trash2 as A}from"lucide-react";import*as s from"react";import{cn as n}from"../../lib/utils.js";import{Button as C}from"./button.js";import{DialogOverlay as F}from"./dialog.js";import{Input as O}from"./input.js";function q({open:c,onOpenChange:d,title:R,description:x,items:b,previewCount:D=3,confirmWord:l,confirmLabel:P,cancelLabel:k="Cancel",tone:T="danger",icon:z,onConfirm:B,labels:S}){const[p,f]=s.useState(""),[m,v]=s.useState(!1),[N,g]=s.useState(null),_=s.useRef(null);s.useEffect(()=>{c&&(f(""),g(null))},[c]);const y=!!l&&p.trim().toUpperCase()!==l.toUpperCase(),h={typeToConfirm:t=>`Type ${t} to confirm`,more:t=>`+ ${t} more`,...S},r=T==="danger",u=b?.slice(0,D)??[],w=(b?.length??0)-u.length;return e(i.Root,{open:c,onOpenChange:t=>!m&&d(t),children:a(i.Portal,{children:[e(F,{}),a(i.Content,{"data-dialog":"",onOpenAutoFocus:t=>{t.preventDefault(),_.current?.focus()},className:"fixed left-1/2 top-1/2 z-50 w-[calc(100vw-32px)] max-w-[440px] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-[calc(18px*var(--radius-scale))] border border-border bg-raised outline-none",children:[e("div",{"aria-hidden":!0,className:n("pointer-events-none absolute inset-x-0 top-0 h-28",r?"bg-[radial-gradient(70%_100%_at_50%_0%,var(--danger-subtle),transparent)]":"bg-[radial-gradient(70%_100%_at_50%_0%,var(--warning-subtle),transparent)]")}),a("div",{className:"relative px-6 pb-5 pt-7 text-center",children:[a("div",{className:"relative mx-auto mb-4 grid size-14 place-items-center",children:[e("span",{className:n("absolute inset-0 rounded-full",r?"bg-danger/10":"bg-warning/10")}),e("span",{className:n("absolute inset-[7px] rounded-full",r?"bg-danger/15":"bg-warning/15")}),e("span",{className:n("relative grid size-9 place-items-center rounded-full text-white shadow-[inset_0_1px_0_rgba(255,255,255,.3)]",r?"bg-[linear-gradient(180deg,#ef4444,#dc2626)] shadow-[0_6px_16px_-6px_rgba(220,38,38,.7)]":"bg-[linear-gradient(180deg,#f59e0b,#b45309)] shadow-[0_6px_16px_-6px_rgba(180,83,9,.7)]","[&_svg]:size-[18px]"),children:z??(r?e(A,{}):e($,{}))})]}),e(i.Title,{className:"disp text-[17px] font-semibold leading-6 text-text",children:R}),x?e(i.Description,{className:"mx-auto mt-1.5 max-w-[34ch] text-[13px] leading-5 text-muted",children:x}):null,u.length?a("ul",{className:"mt-4 space-y-1 rounded-[calc(12px*var(--radius-scale))] border border-border bg-surface p-2 text-left",children:[u.map((t,o)=>a("li",{className:"flex items-center gap-2 rounded-[calc(8px*var(--radius-scale))] px-2 py-1.5 text-[13px] text-body",children:[e("span",{className:n("size-1.5 shrink-0 rounded-full",r?"bg-danger":"bg-warning")}),e("span",{className:"truncate",children:t})]},`${t}-${o}`)),w>0?e("li",{className:"px-2 py-1 text-[12px] font-medium text-muted",children:h.more(w)}):null]}):null,l?a("div",{className:"mt-4 text-left",children:[e("label",{className:"mb-1.5 block text-[12px] font-medium text-muted",children:h.typeToConfirm(l).split(l).map((t,o,E)=>a(s.Fragment,{children:[t,o<E.length-1?e("b",{className:n("font-semibold",r?"text-danger":"text-warning"),children:l}):null]},o))}),e(O,{value:p,onChange:t=>f(t.target.value),autoComplete:"off",spellCheck:!1,className:"text-center font-medium tracking-[0.2em] uppercase",state:!y&&p?"success":"default"})]}):null,N?a("p",{role:"alert",className:"mt-3 flex items-center justify-center gap-1.5 text-[12.5px] text-danger",children:[e(L,{className:"size-3.5"})," ",N]}):null]}),a("div",{className:"relative grid grid-cols-2 gap-2 border-t border-border bg-surface/70 px-6 py-4",children:[e(C,{ref:_,disabled:m,onClick:()=>d(!1),children:k}),e(C,{variant:r?"danger":"primary",disabled:y,loading:m,className:n(r&&"shadow-[0_6px_16px_-8px_rgba(220,38,38,.8)]"),onClick:async()=>{v(!0),g(null);try{await B(),d(!1)}catch(t){g(t instanceof Error?t.message:String(t))}finally{v(!1)}},children:P})]})]})]})})}export{q as ConfirmDialog};
|
|
@@ -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
|
|
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
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as Q,jsx as
|
|
1
|
+
"use client";import{Fragment as Q,jsx as r,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 d from"react";import{cn as f}from"../../lib/utils.js";const k=t=>t<1024*1024?`${Math.max(1,Math.round(t/1024))} KB`:`${(t/1024/1024).toFixed(1)} MB`;function G(t,i){return i?i.split(",").some(u=>{const s=u.trim().toLowerCase();return s.startsWith(".")?t.name.toLowerCase().endsWith(s):s.endsWith("/*")?t.type.startsWith(s.slice(0,-1)):t.type===s}):!0}function O({file:t}){const i=t.name.toLowerCase();return t.type.startsWith("image/")?r(H,{}):/\.(csv|xlsx?|ods)$/.test(i)?r(K,{}):/\.(pdf|docx?|txt|md)$/.test(i)?r(X,{}):r(A,{})}function J({file:t}){const[i,u]=d.useState(null);return d.useEffect(()=>{if(!t.type.startsWith("image/"))return;const s=URL.createObjectURL(t);return u(s),()=>URL.revokeObjectURL(s)},[t]),r("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:i?r("img",{src:i,alt:"",className:"size-full object-cover"}):r(O,{file:t})})}function ee({value:t,defaultValue:i=[],onValueChange:u,accept:s,multiple:v=!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]=d.useState(i),g=t??V,[_,R]=d.useState([]),[x,y]=d.useState(!1),N=d.useRef(null),h=d.useRef(0),$=e=>{t===void 0&&P(e),u?.(e)},C=e=>{if(!e)return;const a=[],o=[];for(const c of Array.from(e))G(c,s)?m&&c.size>m?o.push({file:c,reason:`Over ${k(m)}`}):a.push(c):o.push({file:c,reason:"Not an accepted type"});let l=v?[...g,...a.filter(c=>!g.some(L=>L.name===c.name&&L.size===c.size))]:a.slice(0,1);p&&l.length>p&&(l.slice(p).forEach(c=>o.push({file:c,reason:`Only ${p} file${p>1?"s":""}`})),l=l.slice(0,p)),R(o),$(l)},S=e=>$(g.filter(a=>a!==e)),w=W??[s?.split(",").map(e=>e.trim().replace(/^\./,"").toUpperCase()).join(", "),m?`up to ${k(m)}`:null].filter(Boolean).join(" \xB7 "),D=r("input",{ref:N,type:"file",className:"sr-only",tabIndex:-1,accept:s,multiple:v,disabled:b,onChange:e=>{C(e.target.files),e.target.value=""}}),U={onDragEnter:e=>{e.preventDefault(),h.current+=1,y(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:()=>{h.current-=1,h.current<=0&&y(!1)},onDrop:e=>{e.preventDefault(),h.current=0,y(!1),b||C(e.dataTransfer.files)}};return n("div",{className:f("w-full space-y-2.5",B),children:[M==="dropzone"?n("button",{type:"button",disabled:b,onClick:()=>N.current?.click(),...U,className:f("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",x&&"border-primary bg-primary-subtle/50 shadow-[0_0_0_4px_var(--primary-subtle)]",b&&"cursor-not-allowed opacity-50"),children:[r("span",{className:f("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]",x?"-translate-y-1 scale-110":"group-hover:-translate-y-0.5"),children:r(j,{})}),r("span",{className:"text-[13.5px] font-semibold text-text",children:x?"Drop to add":z??n(Q,{children:[n("span",{className:"text-primary",children:["Choose ",v?"files":"a file"]})," or drag ",v?"them":"it"," here"]})}),w?r("span",{className:"text-[12px] text-muted",children:w}):null,D]}):n("div",{...U,className:f("flex items-center gap-3 rounded-ctl border border-dashed border-border2 bg-surface p-2 pl-3 transition-colors",x&&"border-primary bg-primary-subtle/50"),children:[r(j,{className:"size-4 shrink-0 text-muted"}),r("span",{className:"min-w-0 flex-1 truncate text-[12.5px] text-muted",children:x?"Drop to add":z??w??"Drag files here"}),r("button",{type:"button",disabled:b,onClick:()=>N.current?.click(),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"}),D]}),g.length||_.length?n("ul",{className:"space-y-1.5",children:[g.map(e=>{const a=I?.[e.name],o=T?.includes(e.name),l=a!==void 0&&a<100&&!o;return n("li",{className:"flex items-center gap-3 rounded-[calc(11px*var(--radius-scale))] border border-border bg-raised p-2 pr-2.5 animate-[wave-in_220ms_var(--ease)]",children:[r(J,{file:e}),n("span",{className:"min-w-0 flex-1",children:[r("span",{className:"block truncate text-[13px] font-medium text-text",children:e.name}),n("span",{className:f("num flex items-center gap-1.5 text-[11.5px]",o?"text-danger":"text-muted"),children:[k(e.size),o?" \xB7 Upload failed":a===100?" \xB7 Uploaded":l?` \xB7 ${Math.round(a)}%`:null]}),l?r("span",{className:"mt-1.5 block h-1 overflow-hidden rounded-full bg-hover",children:r("span",{className:"block h-full rounded-full bg-[linear-gradient(90deg,var(--brand-1),var(--brand-2))] transition-[width] duration-300",style:{width:`${a}%`}})}):null]}),o&&F?r("button",{type:"button",onClick:()=>F(e),"aria-label":`Retry ${e.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:r(q,{})}):null,r("button",{type:"button",onClick:()=>S(e),"aria-label":`Remove ${e.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:r(E,{})})]},`${e.name}-${e.size}-${e.lastModified}`)}),_.map(({file:e,reason:a})=>n("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:[r("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:r(O,{file:e})}),n("span",{className:"min-w-0 flex-1",children:[r("span",{className:"block truncate text-[13px] font-medium text-text",children:e.name}),n("span",{className:"text-[11.5px] text-danger",children:[a," \xB7 not added"]})]}),r("button",{type:"button",onClick:()=>R(o=>o.filter(l=>l.file!==e)),"aria-label":`Dismiss ${e.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:r(E,{})})]},`x-${e.name}-${e.size}`))]}):null]})}export{ee as FileUpload};
|
|
@@ -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
|
|
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};
|
|
@@ -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 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-[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}},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,c=0,i=t;for(;i&&i!==a;)n+=i.offsetLeft,c+=i.offsetTop,i=i.offsetParent;return i===a?{x:n,y:c,w:t.offsetWidth,h:t.offsetHeight}:null}const j=r.forwardRef(({variant:t="soft",value:a,defaultValue:n,onValueChange:c,heading:i,className:_,children:N,onKeyDown:v,...E},s)=>{const d=r.useRef(null),[H,l]=r.useState(n),L=a!==void 0?a:H,[x,f]=r.useState(null),b=r.useCallback(e=>{a===void 0&&l(e),c?.(e)},[a,c]),R=r.useMemo(()=>({look:t,value:L,select:b}),[t,L,b]);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 y=e=>{v?.(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:y,...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:c,count:i,shortcut:_,on:N,danger:v,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-[calc(9px*var(--radius-scale))] border transition-colors",v?"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",v?"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}),c]}),n?o("span",{className:u("mt-0.5 block truncate text-[11.5px] font-normal leading-4",v?"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-[calc(5px*var(--radius-scale))] 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-[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",G=r.forwardRef(({value:t,active:a,danger:n,asChild:c,icon:i,description:_,badge:N,count:v,shortcut:E,className:s,children:d,onClick:H,...l},L)=>{const x=r.useContext(P),f=r.useContext(O),b=!n&&(a??(t!==void 0&&x.value===t)),R=S[x.look];r.useEffect(()=>{if(!(!b||!f))return f.reveal(),f.mark(1),()=>f.mark(-1)},[b,f]);const y={"data-menu-item":"","data-active":b?"":void 0,"aria-current":b?"page":void 0,className:u(B,R.rail&&F,n?"text-danger hover:bg-danger-subtle":R.item[b?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:v,shortcut:E,on:b,danger:n});return c&&r.isValidElement(d)?o(V,{ref:L,...y,...l,children:r.cloneElement(d,void 0,k(d.props.children))}):o("button",{ref:L,type:"button",...y,...l,children:k(d)})});G.displayName="MenuItem";function J({label:t,defaultOpen:a=!1,open:n,onOpenChange:c,disabled:i,className:_,children:N,...v}){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(),b=r.useCallback(e=>{n===void 0&&H(e),c?.(e)},[n,c]),R=r.useMemo(()=>({reveal:()=>{b(!0),s?.reveal()},mark:e=>x(h=>h+e)}),[b,s]),y=L>0;r.useEffect(()=>{if(!(!y||!s))return s.mark(1),()=>s.mark(-1)},[y,s]);const k=S[E.look],w=y&&!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],y&&l&&"text-text"),onClick:()=>b(!l),onKeyDown:e=>{e.key==="ArrowRight"?(e.preventDefault(),l?document.getElementById(f)?.querySelector(I)?.focus():b(!0)):e.key==="ArrowLeft"&&l&&(e.preventDefault(),b(!1))},children:o(A,{label:t,...v,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:c}){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:c}):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,c]})}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 +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(
|
|
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:
|
|
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
|
|
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
|
|
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:
|
|
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};
|
|
@@ -19,7 +19,7 @@ declare const SIZES: {
|
|
|
19
19
|
declare const TRACK: {
|
|
20
20
|
readonly pill: "rounded-full border border-border bg-hover";
|
|
21
21
|
readonly solid: "rounded-full border border-border bg-hover";
|
|
22
|
-
readonly outline: "rounded-[10px] border border-border2 bg-raised";
|
|
22
|
+
readonly outline: "rounded-[calc(10px*var(--radius-scale))] border border-border2 bg-raised";
|
|
23
23
|
readonly glass: "rounded-full bg-[rgba(10,7,32,.22)] ring-1 ring-inset ring-white/15 shadow-[inset_0_1px_3px_rgba(5,8,22,.35)] backdrop-blur-md";
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as b,jsxs as y}from"react/jsx-runtime";import*as i from"react";import{cn as o}from"../../lib/utils.js";const
|
|
1
|
+
"use client";import{jsx as b,jsxs as y}from"react/jsx-runtime";import*as i from"react";import{cn as o}from"../../lib/utils.js";const h={sm:"px-2.5 py-1 text-[11px]",md:"h-8 px-3.5 text-[12.5px]",lg:"h-10 px-5 text-[13.5px]"},v={pill:"rounded-full border border-border bg-hover",solid:"rounded-full border border-border bg-hover",outline:"rounded-[calc(10px*var(--radius-scale))] border border-border2 bg-raised",glass:"rounded-full bg-[rgba(10,7,32,.22)] ring-1 ring-inset ring-white/15 shadow-[inset_0_1px_3px_rgba(5,8,22,.35)] backdrop-blur-md"},x={pill:"rounded-full bg-raised shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.08),0_2px_8px_-2px_rgba(5,8,22,.16)]",solid:"rounded-full bg-[linear-gradient(135deg,var(--brand-1),var(--brand-2))] shadow-[inset_0_1px_0_rgba(255,255,255,.25),0_4px_12px_-4px_color-mix(in_srgb,var(--brand-1)_60%,transparent)]",outline:"rounded-[calc(7px*var(--radius-scale))] bg-primary-subtle ring-1 ring-inset ring-primary/30",glass:"rounded-full bg-[linear-gradient(180deg,rgba(255,255,255,.34),rgba(255,255,255,.16))] ring-1 ring-inset ring-white/45 shadow-[inset_0_1px_0_rgba(255,255,255,.55),0_6px_14px_-6px_rgba(5,8,22,.45)] backdrop-blur-md"},w={pill:"text-text",solid:"text-white",outline:"text-primary",glass:"text-white [text-shadow:0_1px_1px_rgba(5,8,22,.25)]"},T={pill:"text-muted hover:text-text",solid:"text-muted hover:text-text",outline:"text-muted hover:text-text",glass:"text-white/65 hover:text-white"};function k({value:a,onChange:g,options:s,className:f,ariaLabel:_,variant:r="pill",size:d="sm",fullWidth:u=!1}){const p=i.useRef(null),[n,m]=i.useState(null);return i.useLayoutEffect(()=>{const e=p.current;if(!e)return;const t=()=>{const l=e.querySelector('[aria-checked="true"]');m(l?{left:l.offsetLeft,width:l.offsetWidth}:null)};t();const c=new ResizeObserver(t);return c.observe(e),()=>c.disconnect()},[a,s.length,d]),y("div",{ref:p,role:"radiogroup","aria-label":_,className:o("relative isolate items-center gap-0.5 p-[3px]",u?"flex w-full":"inline-flex",v[r],f),children:[n?b("span",{"aria-hidden":!0,className:o("absolute inset-y-[3px] -z-10 transition-[left,width] duration-300 ease-[cubic-bezier(.3,.7,.2,1)]",x[r]),style:{left:n.left,width:n.width}}):null,s.map(e=>{const t=e.value===a;return b("button",{type:"button",role:"radio","aria-checked":t,title:e.title,onClick:()=>g(e.value),className:o("inline-flex cursor-pointer items-center justify-center gap-1.5 rounded-full font-medium leading-none transition-colors duration-200 [&_svg]:size-3.5",h[d],u&&"flex-1",t?w[r]:T[r],t&&!n&&x[r]),children:e.label},e.value)})]})}export{k as Segmented};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import*as e from"@radix-ui/react-dialog";import{X as d}from"lucide-react";import*as p from"react";import{cn as g}from"../../lib/utils.js";const u=e.Root,x=e.Trigger,v=e.Close,b=p.forwardRef(({className:i,children:s,side:o="right",width:a="w-full sm:w-drawer",scrim:l=!0,hideClose:n,...m},c)=>r(e.Portal,{children:[l?t(e.Overlay,{"data-scrim":"",className:"fixed inset-0 z-50 bg-[rgba(5,8,22,.42)] backdrop-blur-[3px]"}):null,r(e.Content,{ref:c,"data-sheet":o,className:g("fixed inset-y-0 z-50 flex max-w-full flex-col border-border bg-raised shadow-elev3 outline-none",o==="right"?"right-0 max-sm:border-l sm:inset-y-2 sm:right-2 sm:rounded-[calc(16px*var(--radius-scale))] sm:border":"left-0 max-sm:border-r sm:inset-y-2 sm:left-2 sm:rounded-[calc(16px*var(--radius-scale))] sm:border",a,i),...m,children:[s,n?null:r(e.Close,{className:"absolute right-4 top-4 z-10 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:[t(d,{className:"size-4"}),t("span",{className:"sr-only",children:"Close"})]})]})]}));b.displayName="SheetContent";const C=e.Title,P=e.Description;export{u as Sheet,v as SheetClose,b as SheetContent,P as SheetDescription,C as SheetTitle,x as SheetTrigger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as v}from"react/jsx-runtime";import*as n from"@radix-ui/react-slider";import*as f from"react";import{cn as r}from"../../lib/utils.js";const N=18,P=f.forwardRef(({className:g,variant:h="default",marks:i,showValue:s="active",format:x=p=>p.toLocaleString(),value:u,defaultValue:d,onValueChange:
|
|
1
|
+
"use client";import{jsx as t,jsxs as v}from"react/jsx-runtime";import*as n from"@radix-ui/react-slider";import*as f from"react";import{cn as r}from"../../lib/utils.js";const N=18,P=f.forwardRef(({className:g,variant:h="default",marks:i,showValue:s="active",format:x=p=>p.toLocaleString(),value:u,defaultValue:d,onValueChange:_,min:o=0,max:b=100,...c},y)=>{const[p,w]=f.useState(d??[o]),a=u??p,m=e=>(e-o)/(b-o||1)*100,S=e=>`calc(${m(e)}% + ${N/2*(1-m(e)/50)}px)`,R=i?.some(e=>e.label!==void 0);return v(n.Root,{ref:y,value:u,defaultValue:d,onValueChange:e=>{u===void 0&&w(e),_?.(e)},min:o,max:b,className:r("relative flex w-full touch-none select-none items-center py-2 data-[disabled]:opacity-50",s==="always"&&"mt-7",i&&(R?"mb-6":"mb-2"),g),...c,children:[t(n.Track,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-hover shadow-[inset_0_1px_2px_rgba(5,8,22,.08)]",children:t(n.Range,{className:r("absolute h-full rounded-full",h==="gradient"?"bg-[linear-gradient(90deg,var(--brand-1),var(--brand-2))] shadow-[0_0_10px_color-mix(in_srgb,var(--brand-2)_45%,transparent)]":"bg-primary")})}),i?.map(e=>{const l=a.length>1?e.value>=a[0]&&e.value<=a[a.length-1]:e.value<=a[0];return v("span",{"aria-hidden":!0,className:"pointer-events-none absolute top-full -translate-x-1/2",style:{left:S(e.value)},children:[t("span",{className:r("mx-auto -mt-1.5 block h-1.5 w-px",l?"bg-primary/50":"bg-border2")}),e.label!==void 0?t("span",{className:"num mt-1 block whitespace-nowrap text-[11px] text-muted",children:e.label}):null]},e.value)}),a.map((e,l)=>t(n.Thumb,{"aria-label":a.length>1?l===0?"Minimum":"Maximum":c["aria-label"],className:r("group/thumb relative block size-[18px] cursor-grab rounded-full border-2 border-primary bg-white outline-none active:cursor-grabbing","shadow-[0_1px_3px_rgba(5,8,22,.25),0_0_0_0_var(--primary-subtle)] transition-[box-shadow,transform] duration-150","hover:shadow-[0_1px_3px_rgba(5,8,22,.25),0_0_0_6px_var(--primary-subtle)] focus-visible:shadow-[0_1px_3px_rgba(5,8,22,.25),0_0_0_6px_var(--primary-subtle)] active:scale-110"),children:s!=="never"?t("span",{className:r("num pointer-events-none absolute bottom-full left-1/2 mb-2.5 -translate-x-1/2 whitespace-nowrap rounded-[calc(7px*var(--radius-scale))] bg-[var(--ink)] px-2 py-1 text-[11.5px] font-semibold leading-none text-white shadow-elev2","after:absolute after:left-1/2 after:top-full after:-translate-x-1/2 after:border-4 after:border-transparent after:border-t-[var(--ink)]","transition-[opacity,transform] duration-150",s==="always"?"opacity-100":"translate-y-1 opacity-0 group-hover/thumb:translate-y-0 group-hover/thumb:opacity-100 group-focus-visible/thumb:translate-y-0 group-focus-visible/thumb:opacity-100 group-active/thumb:translate-y-0 group-active/thumb:opacity-100"),children:x(e)}):null},l))]})});P.displayName="Slider";export{P as Slider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as g}from"react/jsx-runtime";import{cn as l}from"../../lib/utils.js";const m={xs:12,sm:16,md:20,lg:28,xl:40};function b({variant:i="ring",size:d="md",tone:s="current",label:o="Loading",className:c}){const n=m[d],p=s==="brand"?"text-primary":void 0;let r;if(i==="ring"){const a=Math.max(2,Math.round(n/9));r=e("span",{className:"block animate-spin rounded-full [animation-duration:.75s]",style:{width:n,height:n,background:s==="brand"?"conic-gradient(from 90deg, transparent 10%, var(--brand-1) 60%, var(--brand-2))":"conic-gradient(from 90deg, transparent 10%, currentColor)",mask:`radial-gradient(farthest-side, transparent calc(100% - ${a+.5}px), #000 calc(100% - ${a}px))`,WebkitMask:`radial-gradient(farthest-side, transparent calc(100% - ${a+.5}px), #000 calc(100% - ${a}px))`}})}else if(i==="dots"){const a=Math.max(3,Math.round(n/4.5));r=e("span",{className:"flex items-center",style:{gap:a*.7,height:n},children:[0,1,2].map(t=>e("span",{className:"wm-dot block rounded-full bg-current",style:{width:a,height:a,animationDelay:`${t*140}ms`}},t))})}else{const a=Math.max(2,Math.round(n/8));r=e("span",{className:"flex items-center",style:{gap:a*.8,height:n},children:[0,1,2,3,4].map(t=>e("span",{className:l("wm-bar block h-full rounded-full",s==="brand"?"bg-[linear-gradient(180deg,var(--brand-2),var(--brand-1))]":"bg-current"),style:{width:a,animationDelay:`${t*90}ms`}},t))})}return g("span",{role:"status",className:l("inline-grid shrink-0 place-items-center",p,c),children:[r,e("span",{className:"sr-only",children:o})]})}export{b as Spinner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as l,jsxs as
|
|
1
|
+
"use client";import{jsx as l,jsxs as f}from"react/jsx-runtime";import*as c from"@radix-ui/react-tabs";import*as r from"react";import{cn as d}from"../../lib/utils.js";const v=r.createContext("underline"),L=c.Root,T={underline:"border-b border-border px-1",pill:"rounded-[calc(11px*var(--radius-scale))] border border-border bg-hover p-1",solid:"rounded-[calc(11px*var(--radius-scale))] border border-border bg-surface p-1",enclosed:"border-b border-border px-1"},h={underline:"bottom-[-1px] h-0.5 rounded-full bg-primary",pill:"inset-y-1 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,.14)]",solid:"inset-y-1 rounded-[calc(8px*var(--radius-scale))] bg-[linear-gradient(135deg,var(--brand-1),var(--brand-2))] shadow-[inset_0_1px_0_rgba(255,255,255,.25),0_4px_12px_-4px_color-mix(in_srgb,var(--brand-1)_55%,transparent)]",enclosed:""},R=r.forwardRef(({className:s,variant:e="underline",children:a,...b},o)=>{const i=r.useRef(null),[n,g]=r.useState(null);return r.useLayoutEffect(()=>{const t=i.current;if(!t||e==="enclosed")return;const p=()=>{const u=t.querySelector('[role="tab"][data-state="active"]');g(u?{left:u.offsetLeft,width:u.offsetWidth}:null)};p();const x=new MutationObserver(p);x.observe(t,{subtree:!0,attributes:!0,attributeFilter:["data-state"]});const m=new ResizeObserver(p);return m.observe(t),()=>{x.disconnect(),m.disconnect()}},[e]),l(v.Provider,{value:e,children:f(c.List,{ref:t=>{i.current=t,typeof o=="function"?o(t):o&&(o.current=t)},className:d("no-bar relative isolate flex items-center gap-0.5 overflow-x-auto",T[e],s),...b,children:[n&&e!=="enclosed"?l("span",{"aria-hidden":!0,className:d("absolute -z-10 transition-[left,width] duration-300 ease-[cubic-bezier(.3,.7,.2,1)]",h[e],e==="underline"&&"z-0"),style:{left:e==="underline"?n.left+6:n.left,width:e==="underline"?n.width-12:n.width}}):null,a]})})});R.displayName="TabsList";const y={underline:"px-2.5 py-2.5 text-muted hover:text-text data-[state=active]:text-primary",pill:"rounded-[calc(8px*var(--radius-scale))] px-3 py-1.5 text-muted hover:text-text data-[state=active]:text-text",solid:"rounded-[calc(8px*var(--radius-scale))] px-3.5 py-1.5 text-muted hover:text-text data-[state=active]:text-white",enclosed:"-mb-px rounded-t-[calc(9px*var(--radius-scale))] border border-transparent px-3.5 py-2 text-muted hover:bg-hover/60 hover:text-text data-[state=active]:border-border data-[state=active]:border-b-canvas data-[state=active]:bg-canvas data-[state=active]:text-text"},w={underline:"bg-hover text-muted group-data-[state=active]/tab:bg-primary-subtle group-data-[state=active]/tab:text-primary",pill:"bg-raised text-muted group-data-[state=active]/tab:bg-primary-subtle group-data-[state=active]/tab:text-primary",solid:"bg-hover text-muted group-data-[state=active]/tab:bg-white/20 group-data-[state=active]/tab:text-white",enclosed:"bg-hover text-muted"},_=r.forwardRef(({className:s,children:e,count:a,...b},o)=>{const i=r.useContext(v);return l(c.Trigger,{ref:o,className:d("group/tab relative shrink-0 cursor-pointer whitespace-nowrap text-[13px] font-medium transition-colors duration-200 [&_svg]:size-4",y[i],s),...b,children:f("span",{className:"flex items-center gap-1.5",children:[e,typeof a=="number"?l("span",{className:d("num rounded-full px-1.5 text-[10px] leading-4 transition-colors",w[i]),children:a}):null]})})});_.displayName="TabsTrigger";const C=r.forwardRef(({className:s,...e},a)=>l(c.Content,{ref:a,className:d("outline-none data-[state=active]:animate-[wave-in_220ms_var(--ease)]",s),...e}));C.displayName="TabsContent";export{L as Tabs,C as TabsContent,R as TabsList,_ as TabsTrigger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r}from"react/jsx-runtime";import{CircleAlert as
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import{CircleAlert as o,CircleCheck as n,Info as s,LoaderCircle as i,TriangleAlert as c}from"lucide-react";import{Toaster as d,toast as p}from"sonner";const e=(t,a)=>r("span",{className:"grid size-7 place-items-center rounded-[calc(8px*var(--radius-scale))] [&_svg]:size-4",style:{color:`var(--${t})`,background:`var(--${t}-subtle)`},children:a});function b({position:t="bottom-right",...a}){return r(d,{position:t,gap:10,icons:{success:e("success",r(n,{})),error:e("danger",r(o,{})),warning:e("warning",r(c,{})),info:e("info",r(s,{})),loading:e("primary",r(i,{className:"animate-spin"}))},toastOptions:{unstyled:!0,classNames:{toast:"group flex w-[356px] max-w-[calc(100vw-32px)] items-center gap-3 rounded-[calc(14px*var(--radius-scale))] border border-border bg-raised p-3 pr-4 text-[13px] text-text shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.06),0_16px_40px_-12px_rgba(5,8,22,.28)]",icon:"!m-0 !size-7 shrink-0 [&>svg]:hidden [&>span]:!grid [&>span]:!size-7 [&>span]:place-items-center",content:"min-w-0 flex-1",title:"font-semibold leading-[18px] text-text",description:"mt-0.5 text-[12.5px] leading-[17px] text-muted",actionButton:"ml-auto shrink-0 cursor-pointer self-center rounded-[calc(8px*var(--radius-scale))] bg-primary px-2.5 py-1.5 text-[12px] font-medium text-white transition-colors hover:bg-primary-hover",cancelButton:"shrink-0 cursor-pointer self-center rounded-[calc(8px*var(--radius-scale))] border border-border px-2.5 py-1.5 text-[12px] font-medium text-body transition-colors hover:bg-hover",closeButton:"!border-border !bg-raised !text-muted hover:!text-text",success:"bg-[image:radial-gradient(130%_140%_at_0%_0%,var(--success-subtle),transparent_55%)] border-[color-mix(in_srgb,var(--success)_22%,var(--border))]!",error:"bg-[image:radial-gradient(130%_140%_at_0%_0%,var(--danger-subtle),transparent_55%)] border-[color-mix(in_srgb,var(--danger)_22%,var(--border))]!",warning:"bg-[image:radial-gradient(130%_140%_at_0%_0%,var(--warning-subtle),transparent_55%)] border-[color-mix(in_srgb,var(--warning)_22%,var(--border))]!",info:"bg-[image:radial-gradient(130%_140%_at_0%_0%,var(--info-subtle),transparent_55%)] border-[color-mix(in_srgb,var(--info)_22%,var(--border))]!"}},...a})}export{b as Toaster,p as toast};
|
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./use-hotkey.js";export*from"./use-media-query.js";export*from"./use-mounted.js";
|
|
1
|
+
export*from"./use-hotkey.js";export*from"./use-media-query.js";export*from"./use-mounted.js";export*from"./use-router.js";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Routing without tying the package to one router.
|
|
4
|
+
*
|
|
5
|
+
* The shell and a few patterns need three things from the app's router: a
|
|
6
|
+
* link, the current path, and a way to navigate. They ask this adapter, and
|
|
7
|
+
* the app says which router answers:
|
|
8
|
+
*
|
|
9
|
+
* Next.js <NextRouterProvider> from "@waveinno/ui/next"
|
|
10
|
+
* React Router <RouterProvider adapter={{ Link, usePathname, useNavigate }}>
|
|
11
|
+
* nothing plain <a> links and full page loads, which work anywhere
|
|
12
|
+
*
|
|
13
|
+
* so the same components run in Next.js, Vite or any React app.
|
|
14
|
+
*/
|
|
15
|
+
export type RouterLinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
16
|
+
href: string;
|
|
17
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
18
|
+
};
|
|
19
|
+
export interface RouterAdapter {
|
|
20
|
+
/** Renders a link: gets `href`, `className`, `children` and anchor props. */
|
|
21
|
+
Link: React.ComponentType<RouterLinkProps>;
|
|
22
|
+
/** A hook returning the current path (Next's usePathname, React Router's useLocation().pathname). */
|
|
23
|
+
usePathname: () => string;
|
|
24
|
+
/** A hook returning a navigate function (Next's useRouter().push, React Router's useNavigate()). */
|
|
25
|
+
useNavigate: () => (href: string) => void;
|
|
26
|
+
}
|
|
27
|
+
/** The adapter used when none is provided: plain links, the browser's own location. */
|
|
28
|
+
export declare const browserRouter: RouterAdapter;
|
|
29
|
+
/** Tell the package which router the app uses. Put it above AppShell (or anything that links). */
|
|
30
|
+
export declare function RouterProvider({ adapter, children }: {
|
|
31
|
+
adapter: RouterAdapter;
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
}): React.JSX.Element;
|
|
34
|
+
/** The app's router, through the adapter: `{ Link, pathname, navigate }`. */
|
|
35
|
+
export declare function useRouterAdapter(): {
|
|
36
|
+
Link: React.ComponentType<RouterLinkProps>;
|
|
37
|
+
pathname: string;
|
|
38
|
+
navigate: (href: string) => void;
|
|
39
|
+
};
|
|
40
|
+
/** A link through the app's router: Next's Link in Next.js, React Router's in a Vite app, <a> otherwise. */
|
|
41
|
+
export declare function RouterLink(props: RouterLinkProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import*as r from"react";const i=e=>(window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e));function s(e){return o("a",{...e})}const u={Link:s,usePathname:()=>r.useSyncExternalStore(i,()=>window.location.pathname,()=>"/"),useNavigate:()=>r.useCallback(e=>window.location.assign(e),[])},n=r.createContext(u);function c({adapter:e,children:t}){return o(n.Provider,{value:e,children:t})}function p(){const e=r.useContext(n),t=e.usePathname(),a=e.useNavigate();return{Link:e.Link,pathname:t,navigate:a}}function R(e){const{Link:t}=r.useContext(n);return o(t,{...e})}export{R as RouterLink,c as RouterProvider,u as browserRouter,p as useRouterAdapter};
|