@murumets-ee/ui 0.109.0 → 0.111.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +0 -1
- package/dist/index.mjs +0 -1
- package/package.json +1 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -425,4 +425,3 @@ declare const TableCell: import("react").ForwardRefExoticComponent<TdHTMLAttribu
|
|
|
425
425
|
declare const Textarea: import("react").ForwardRefExoticComponent<TextareaHTMLAttributes<HTMLTextAreaElement> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
426
426
|
//#endregion
|
|
427
427
|
export { Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DataTable, DataTableColumnHeader, type DataTableColumnHeaderLabels, type DataTableColumnMove, DataTableViewOptions, type DataTableViewOptionsLabels, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Icon, IconPicker, type IconPickerProps, type IconProps, Input, Label, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Select, Separator, Skeleton, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Textarea, Toaster, cn, nextColumnSort, prewarmIcons, setIconEndpoint, toast, usePrewarmIcons };
|
|
428
|
-
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -2,4 +2,3 @@
|
|
|
2
2
|
import{clsx as e}from"clsx";import{twMerge as t}from"tailwind-merge";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";import{Slot as a}from"@radix-ui/react-slot";import{ArrowDown as o,ArrowLeft as s,ArrowRight as c,ArrowUp as l,Check as u,ChevronLeft as d,ChevronRight as f,ChevronsLeft as p,ChevronsRight as m,ChevronsUpDown as h,EllipsisVertical as g,EyeOff as _,Loader2 as v,Minus as y,Settings2 as b,X as x}from"lucide-react";import*as S from"react";import{createContext as ee,forwardRef as C,useContext as te,useEffect as ne,useId as re,useMemo as ie,useRef as ae,useState as w}from"react";import*as oe from"recharts";import*as se from"@radix-ui/react-checkbox";import*as T from"@radix-ui/react-collapsible";import{flexRender as ce,getCoreRowModel as le,getFilteredRowModel as ue,getPaginationRowModel as de,getSortedRowModel as fe,useReactTable as pe}from"@tanstack/react-table";import*as E from"@radix-ui/react-dropdown-menu";import*as D from"@radix-ui/react-dialog";import{Controller as me,FormProvider as he,useFormContext as ge}from"react-hook-form";import*as _e from"@radix-ui/react-label";import*as O from"@radix-ui/react-popover";import*as ve from"@radix-ui/react-separator";import{Toaster as ye,toast as be}from"sonner";function k(...n){return t(e(n))}const xe={default:`border-transparent bg-primary text-primary-foreground shadow-xs`,secondary:`border-transparent bg-secondary text-secondary-foreground`,destructive:`border-transparent bg-destructive text-destructive-foreground shadow-xs`,outline:`text-foreground`};function Se({className:e,variant:t=`default`,...n}){return r(`div`,{className:k(`inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold`,`transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,xe[t],e),...n})}const Ce={default:`bg-primary text-primary-foreground shadow-xs hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90`,outline:`border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},we={default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`},A=C(({className:e,variant:t=`default`,size:n=`default`,loading:o=!1,asChild:s=!1,disabled:c,children:l,type:u=`button`,...d},f)=>{let p=k(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium`,`transition-colors cursor-pointer`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:pointer-events-none disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0`,Ce[t],we[n],e);return s?r(a,{ref:f,className:p,...d,children:l}):i(`button`,{ref:f,disabled:c||o,className:p,type:u,...d,children:[o&&r(v,{className:`h-4 w-4 animate-spin`}),l]})});A.displayName=`Button`;const Te=C(({className:e,...t},n)=>r(`div`,{ref:n,className:k(`rounded-xl border bg-card text-card-foreground shadow-sm`,e),...t}));Te.displayName=`Card`;const Ee=C(({className:e,...t},n)=>r(`div`,{ref:n,className:k(`flex flex-col space-y-1.5 p-6`,e),...t}));Ee.displayName=`CardHeader`;const De=C(({className:e,...t},n)=>r(`div`,{ref:n,className:k(`font-semibold leading-none tracking-tight`,e),...t}));De.displayName=`CardTitle`;const Oe=C(({className:e,...t},n)=>r(`div`,{ref:n,className:k(`text-sm text-muted-foreground`,e),...t}));Oe.displayName=`CardDescription`;const ke=C(({className:e,...t},n)=>r(`div`,{ref:n,className:k(`p-6 pt-0`,e),...t}));ke.displayName=`CardContent`;const Ae=C(({className:e,...t},n)=>r(`div`,{ref:n,className:k(`flex items-center p-6 pt-0`,e),...t}));Ae.displayName=`CardFooter`;const je={light:``,dark:`.dark`},Me={width:320,height:200},j=/^[a-zA-Z0-9_-]+$/,Ne=/^[#a-zA-Z0-9 ,.()/%-]+$/,Pe=/\burl\s*\(/i,Fe=S.createContext(null);function Ie(){let e=S.useContext(Fe);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function Le(e,t){if(!j.test(e))return null;let n=Object.entries(t).filter(([,e])=>e.theme??e.color);if(!n.length)return null;let r=Object.entries(je).map(([t,r])=>{let i=n.map(([e,n])=>{if(!j.test(e))return null;let r=n.theme?.[t]??n.color;return!r||!Ne.test(r)||Pe.test(r)?null:` --color-${e}: ${r};`}).filter(e=>e!==null);return i.length?`${r} [data-chart=${e}] {\n${i.join(`
|
|
3
3
|
`)}\n}`:null}).filter(e=>e!==null);return r.length?r.join(`
|
|
4
4
|
`):null}function Re(e){if(e&&typeof e==`object`&&`fill`in e&&typeof e.fill==`string`)return e.fill}function ze({id:e,className:t,children:n,config:a,initialDimension:o=Me,nonce:s,...c}){let l=S.useId(),u=`chart-${(e&&j.test(e)?e:null)??l.replace(/:/g,``)}`;return r(Fe.Provider,{value:{config:a},children:i(`div`,{"data-slot":`chart`,"data-chart":u,className:k(`flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,t),...c,children:[r(Be,{id:u,config:a,nonce:s}),r(oe.ResponsiveContainer,{initialDimension:o,children:n})]})})}const Be=({id:e,config:t,nonce:n})=>{let i=Le(e,t);return i?r(`style`,{nonce:n,dangerouslySetInnerHTML:{__html:i}}):null},Ve=oe.Tooltip;function He({active:e,payload:t,className:a,indicator:o=`dot`,hideLabel:s=!1,hideIndicator:c=!1,label:l,labelFormatter:u,labelClassName:d,formatter:f,color:p,nameKey:m,labelKey:h}){let{config:g}=Ie(),_=S.useMemo(()=>{if(s||!t?.length)return null;let[e]=t,n=Ue(g,e,`${h??e?.dataKey??e?.name??`value`}`),i=!h&&typeof l==`string`?g[l]?.label??l:n?.label;return u?r(`div`,{className:k(`font-medium`,d),children:u(i,t)}):i?r(`div`,{className:k(`font-medium`,d),children:i}):null},[l,u,t,s,d,g,h]);if(!e||!t?.length)return null;let v=t.length===1&&o!==`dot`;return i(`div`,{className:k(`grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl`,a),children:[v?null:_,r(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let a=`${m??e.name??e.dataKey??`value`}`,s=Ue(g,e,a),l=p??Re(e.payload)??e.color;return r(`div`,{className:k(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground`,o===`dot`&&`items-center`),children:f&&e?.value!==void 0&&e.name?f(e.value,e.name,e,t,e.payload):i(n,{children:[s?.icon?r(s.icon,{}):!c&&r(`div`,{className:k(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":o===`dot`,"w-1":o===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":o===`dashed`,"my-0.5":v&&o===`dashed`}),style:{"--color-bg":l,"--color-border":l}}),i(`div`,{className:k(`flex flex-1 justify-between leading-none`,v?`items-end`:`items-center`),children:[i(`div`,{className:`grid gap-1.5`,children:[v?_:null,r(`span`,{className:`text-muted-foreground`,children:s?.label??e.name})]}),e.value!=null&&r(`span`,{className:`font-mono font-medium text-foreground tabular-nums`,children:typeof e.value==`number`?e.value.toLocaleString():String(e.value)})]})]})},a)})})]})}function Ue(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}const We=C(({className:e,...t},n)=>r(se.Root,{ref:n,className:k(`group peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow-xs`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,`data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,`data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground`,e),...t,children:i(se.Indicator,{className:`flex items-center justify-center text-current`,children:[r(u,{className:`h-3.5 w-3.5 group-data-[state=indeterminate]:hidden`}),r(y,{className:`hidden h-3.5 w-3.5 group-data-[state=indeterminate]:block`})]})}));We.displayName=`Checkbox`;const Ge=T.Root,Ke=T.CollapsibleTrigger,qe=T.CollapsibleContent,M=C(({className:e,type:t,...n},i)=>r(`input`,{type:t,ref:i,className:k(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs`,`transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground`,`placeholder:text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...n}));M.displayName=`Input`;const N=C(({className:e,...t},n)=>r(`div`,{className:`relative w-full overflow-auto`,children:r(`table`,{ref:n,className:k(`w-full caption-bottom text-sm`,e),...t})}));N.displayName=`Table`;const P=C(({className:e,...t},n)=>r(`thead`,{ref:n,className:k(`[&_tr]:border-b`,e),...t}));P.displayName=`TableHeader`;const F=C(({className:e,...t},n)=>r(`tbody`,{ref:n,className:k(`[&_tr:last-child]:border-0`,e),...t}));F.displayName=`TableBody`;const Je=C(({className:e,...t},n)=>r(`tfoot`,{ref:n,className:k(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,e),...t}));Je.displayName=`TableFooter`;const I=C(({className:e,...t},n)=>r(`tr`,{ref:n,className:k(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...t}));I.displayName=`TableRow`;const L=C(({className:e,...t},n)=>r(`th`,{ref:n,className:k(`h-10 px-2 text-left align-middle font-medium text-muted-foreground`,`[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t}));L.displayName=`TableHead`;const R=C(({className:e,...t},n)=>r(`td`,{ref:n,className:k(`p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t}));R.displayName=`TableCell`;const Ye=C(({className:e,...t},n)=>r(`caption`,{ref:n,className:k(`mt-4 text-sm text-muted-foreground`,e),...t}));Ye.displayName=`TableCaption`;function Xe({table:e,className:t}){let n=e.getFilteredSelectedRowModel().rows.length,a=e.getFilteredRowModel().rows.length;return i(`div`,{className:k(`flex items-center justify-between px-2`,t),children:[r(`div`,{className:`flex-1 text-sm text-muted-foreground`,children:n>0&&i(`span`,{children:[n,` of `,a,` row(s) selected`]})}),i(`div`,{className:`flex items-center space-x-6 lg:space-x-8`,children:[r(`div`,{className:`flex items-center space-x-2`,children:i(`p`,{className:`text-sm font-medium`,children:[`Page `,e.getState().pagination.pageIndex+1,` of `,e.getPageCount()]})}),i(`div`,{className:`flex items-center space-x-2`,children:[i(A,{variant:`outline`,size:`icon`,className:`hidden h-8 w-8 lg:flex`,onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:[r(`span`,{className:`sr-only`,children:`Go to first page`}),r(p,{className:`h-4 w-4`})]}),i(A,{variant:`outline`,size:`icon`,className:`h-8 w-8`,onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[r(`span`,{className:`sr-only`,children:`Go to previous page`}),r(d,{className:`h-4 w-4`})]}),i(A,{variant:`outline`,size:`icon`,className:`h-8 w-8`,onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[r(`span`,{className:`sr-only`,children:`Go to next page`}),r(f,{className:`h-4 w-4`})]}),i(A,{variant:`outline`,size:`icon`,className:`hidden h-8 w-8 lg:flex`,onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:[r(`span`,{className:`sr-only`,children:`Go to last page`}),r(m,{className:`h-4 w-4`})]})]})]})]})}const z=E.Root,B=E.Trigger,Ze=E.Portal,V=C(({className:e,sideOffset:t=4,...n},i)=>r(E.Portal,{children:r(E.Content,{ref:i,sideOffset:t,className:k(`z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2`,`data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));V.displayName=`DropdownMenuContent`;const H=C(({className:e,inset:t,...n},i)=>r(E.Item,{ref:i,className:k(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none`,`transition-colors focus:bg-accent focus:text-accent-foreground`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));H.displayName=`DropdownMenuItem`;const U=C(({className:e,children:t,checked:n,...a},o)=>i(E.CheckboxItem,{ref:o,className:k(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none`,`transition-colors focus:bg-accent focus:text-accent-foreground`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n!==void 0&&{checked:n},...a,children:[r(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:r(E.ItemIndicator,{children:r(u,{className:`h-4 w-4`})})}),t]}));U.displayName=`DropdownMenuCheckboxItem`;const W=C(({className:e,inset:t,...n},i)=>r(E.Label,{ref:i,className:k(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));W.displayName=`DropdownMenuLabel`;const G=C(({className:e,...t},n)=>r(E.Separator,{ref:n,className:k(`-mx-1 my-1 h-px bg-muted`,e),...t}));G.displayName=`DropdownMenuSeparator`;const Qe=C(({className:e,inset:t,children:n,...a},o)=>i(E.SubTrigger,{ref:o,className:k(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none`,`focus:bg-accent data-[state=open]:bg-accent`,`[&_svg]:pointer-events-none [&_svg]:shrink-0`,t&&`pl-8`,e),...a,children:[n,r(f,{className:`ml-auto h-4 w-4`})]}));Qe.displayName=`DropdownMenuSubTrigger`;const $e=C(({className:e,...t},n)=>r(E.SubContent,{ref:n,className:k(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2`,`data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));$e.displayName=`DropdownMenuSubContent`;const et={trigger:`View`,heading:`Toggle columns`};function tt(e){return e.getAllLeafColumns().filter(e=>e.getCanHide())}function nt({table:e,labels:t,columnTitle:n}){let a={trigger:t?.trigger??et.trigger,heading:t?.heading??et.heading};return i(z,{children:[r(B,{asChild:!0,children:i(A,{variant:`outline`,size:`sm`,className:`ml-auto hidden h-8 lg:flex`,children:[r(b,{className:`mr-2 h-4 w-4`}),a.trigger]})}),i(V,{align:`end`,className:`w-[180px]`,children:[r(W,{children:a.heading}),r(G,{}),tt(e).map(e=>{let t=n?.(e);return r(U,{className:t===void 0?`capitalize`:void 0,checked:e.getIsVisible(),onCheckedChange:t=>e.toggleVisibility(!!t),children:t??e.id},e.id)})]})]})}function rt({columns:e,data:t,searchKey:n,searchPlaceholder:a=`Filter...`,pageSize:o=10,emptyMessage:s=`No results.`,classNames:c}){let[l,u]=w([]),[d,f]=w([]),[p,m]=w({}),[h,g]=w({}),_=pe({data:t,columns:e,state:{sorting:l,columnFilters:d,columnVisibility:p,rowSelection:h},onSortingChange:u,onColumnFiltersChange:f,onColumnVisibilityChange:m,onRowSelectionChange:g,getCoreRowModel:le(),getSortedRowModel:fe(),getFilteredRowModel:ue(),getPaginationRowModel:de(),initialState:{pagination:{pageSize:o}}});return i(`div`,{className:k(`space-y-4`,c?.root),children:[i(`div`,{className:k(`flex items-center justify-between`,c?.toolbar),children:[r(`div`,{className:`flex flex-1 items-center space-x-2`,children:n&&r(M,{placeholder:a,value:_.getColumn(n)?.getFilterValue()??``,onChange:e=>_.getColumn(n)?.setFilterValue(e.target.value),className:`h-8 w-[150px] lg:w-[250px]`})}),r(nt,{table:_})]}),r(`div`,{className:k(`rounded-md border`,c?.table),children:i(N,{children:[r(P,{children:_.getHeaderGroups().map(e=>r(I,{children:e.headers.map(e=>r(L,{colSpan:e.colSpan,children:e.isPlaceholder?null:ce(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),r(F,{children:_.getRowModel().rows.length>0?_.getRowModel().rows.map(e=>r(I,{"data-state":e.getIsSelected()&&`selected`,children:e.getVisibleCells().map(e=>r(R,{children:ce(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):r(I,{children:r(R,{colSpan:e.length,className:`h-24 text-center`,children:s})})})]})}),r(Xe,{table:_,className:c?.pagination})]})}const K={sortAscending:`Sort ascending`,sortDescending:`Sort descending`,clearSort:`Clear sort`,moveLeft:`Move left`,moveRight:`Move right`,hide:`Hide`,columnOptions:e=>`${e} column options`};function it(e){return e===!1?`asc`:e===`asc`?`desc`:!1}function at({column:e,title:t,className:a,move:u,labels:d}){let[f,p]=w(!1),m={sortAscending:d?.sortAscending??K.sortAscending,sortDescending:d?.sortDescending??K.sortDescending,clearSort:d?.clearSort??K.clearSort,moveLeft:d?.moveLeft??K.moveLeft,moveRight:d?.moveRight??K.moveRight,hide:d?.hide??K.hide,columnOptions:d?.columnOptions??K.columnOptions},v=e.getCanSort(),y=e.getCanHide(),b=e.getIsSorted();return v||y||u!==void 0?i(`div`,{className:k(`group/column-header flex items-center gap-1`,a),children:[v?i(A,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8`,onClick:()=>{let t=it(b);t===!1?e.clearSorting():e.toggleSorting(t===`desc`)},onContextMenu:e=>{e.preventDefault(),p(!0)},children:[r(`span`,{children:t}),b===`desc`?r(o,{className:`h-4 w-4`}):b===`asc`?r(l,{className:`h-4 w-4`}):r(h,{className:`h-4 w-4 text-muted-foreground/60`})]}):r(`span`,{children:t}),i(z,{open:f,onOpenChange:p,children:[r(B,{asChild:!0,children:r(A,{variant:`ghost`,size:`icon`,"aria-label":m.columnOptions(t),className:k(`h-6 w-6 text-muted-foreground`,`opacity-0 group-hover/column-header:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,`[@media(hover:none)]:opacity-100`),children:r(g,{className:`h-3.5 w-3.5`})})}),i(V,{align:`start`,children:[v&&i(n,{children:[i(H,{onClick:()=>e.toggleSorting(!1),children:[r(l,{className:`mr-2 h-3.5 w-3.5 text-muted-foreground/70`}),m.sortAscending]}),i(H,{onClick:()=>e.toggleSorting(!0),children:[r(o,{className:`mr-2 h-3.5 w-3.5 text-muted-foreground/70`}),m.sortDescending]}),b!==!1&&i(H,{onClick:()=>e.clearSorting(),children:[r(x,{className:`mr-2 h-3.5 w-3.5 text-muted-foreground/70`}),m.clearSort]})]}),u&&i(n,{children:[v&&r(G,{}),i(H,{disabled:!u.canMoveLeft,onClick:()=>u.onMove(-1),children:[r(s,{className:`mr-2 h-3.5 w-3.5 text-muted-foreground/70`}),m.moveLeft]}),i(H,{disabled:!u.canMoveRight,onClick:()=>u.onMove(1),children:[r(c,{className:`mr-2 h-3.5 w-3.5 text-muted-foreground/70`}),m.moveRight]})]}),y&&i(n,{children:[(v||u)&&r(G,{}),i(H,{onClick:()=>e.toggleVisibility(!1),children:[r(_,{className:`mr-2 h-3.5 w-3.5 text-muted-foreground/70`}),m.hide]})]})]})]})]}):r(`div`,{className:k(a),children:t})}const ot=D.Root,st=D.Trigger,ct=D.Close,lt=D.Portal,ut=C(({className:e,...t},n)=>r(D.Overlay,{ref:n,className:k(`fixed inset-0 z-50 bg-black/80`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));ut.displayName=`DialogOverlay`;const q=C(({className:e,children:t,closeLabel:n=`Close`,...a},o)=>i(lt,{children:[r(ut,{}),i(D.Content,{ref:o,className:k(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%]`,`gap-4 border bg-background p-6 shadow-lg sm:rounded-lg`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]`,`data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,e),...a,children:[t,i(D.Close,{className:k(`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity`,`hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,`disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,`cursor-pointer`),children:[r(x,{className:`h-4 w-4`}),r(`span`,{className:`sr-only`,children:n})]})]})]}));q.displayName=`DialogContent`;function dt({className:e,...t}){return r(`div`,{className:k(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t})}function ft({className:e,...t}){return r(`div`,{className:k(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t})}const J=C(({className:e,...t},n)=>r(D.Title,{ref:n,className:k(`text-lg font-semibold leading-none tracking-tight`,e),...t}));J.displayName=`DialogTitle`;const pt=C(({className:e,...t},n)=>r(D.Description,{ref:n,className:k(`text-sm text-muted-foreground`,e),...t}));pt.displayName=`DialogDescription`;const Y=C(({className:e,...t},n)=>r(_e.Root,{ref:n,className:k(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e),...t}));Y.displayName=`Label`;const mt=he,ht=ee({});function gt(e){return r(ht.Provider,{value:{name:e.name},children:r(me,{...e})})}const _t=ee({});function X(){let e=te(ht),t=te(_t),{getFieldState:n,formState:r}=ge(),i=n(e.name,r),{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...i}}const vt=C(({className:e,...t},n)=>{let i=re();return r(_t.Provider,{value:{id:i},children:r(`div`,{ref:n,className:k(`space-y-2`,e),...t})})});vt.displayName=`FormItem`;const yt=C(({className:e,...t},n)=>{let{error:i,formItemId:a}=X();return r(Y,{ref:n,className:k(i&&`text-destructive`,e),htmlFor:a,...t})});yt.displayName=`FormLabel`;const bt=C(({...e},t)=>{let{error:n,formItemId:i,formDescriptionId:o,formMessageId:s}=X();return r(a,{ref:t,id:i,"aria-describedby":n?`${o} ${s}`:o,"aria-invalid":!!n,...e})});bt.displayName=`FormControl`;const xt=C(({className:e,...t},n)=>{let{formDescriptionId:i}=X();return r(`p`,{ref:n,id:i,className:k(`text-[0.8rem] text-muted-foreground`,e),...t})});xt.displayName=`FormDescription`;const St=C(({className:e,children:t,...n},i)=>{let{error:a,formMessageId:o}=X(),s=a?String(a.message):t;return s?r(`p`,{ref:i,id:o,role:a?`alert`:void 0,className:k(`text-[0.8rem] font-medium text-destructive`,e),...n,children:s}):null});St.displayName=`FormMessage`;let Z=`/api/admin/icons`;function Ct(e){let t=e.replace(/\/+$/,``);t!==Z&&(Z=t,Q.clear(),$=null)}const Q=new Map;function wt(e){let t=new AbortController,n=setTimeout(()=>t.abort(),1e4);return fetch(e,{signal:t.signal}).finally(()=>clearTimeout(n))}function Tt(e){let t=Q.get(e);if(t instanceof Promise)return t;if(t!==void 0)return Promise.resolve(t);let n=wt(`${Z}/${encodeURIComponent(e)}`).then(async t=>{if(t.ok){let n=await t.text();return Q.set(e,n),n}return t.status===404?Q.set(e,null):Q.delete(e),null}).catch(()=>(Q.delete(e),null));return Q.set(e,n),n}function Et(e){let t=wt(`${Z}?names=${encodeURIComponent(e.join(`,`))}`).then(e=>e.ok?e.json():null).catch(()=>null);for(let n of e){let e=t.then(e=>{if(e===null)return Q.delete(n),null;let t=e[n],r=typeof t==`string`?t:null;return Q.set(n,r),r});Q.set(n,e)}return t.then(()=>void 0)}async function Dt(e){if(typeof window>`u`)return;let t=e.filter(e=>Q.get(e)===void 0);if(t.length===0)return;let n=[];for(let e=0;e<t.length;e+=128)n.push(t.slice(e,e+128));await Promise.all(n.map(Et))}function Ot(e,t=!0){let n=ae(``),r=e.join(`,`);t&&r&&n.current!==r&&(n.current=r,Dt(e))}let $=null;function kt(){return $||=fetch(Z).then(e=>e.ok?e.json():[]).catch(()=>[]),$}function At({name:e,className:t,size:n}){let[i,a]=w(null);ne(()=>{if(!e){a(null);return}let t=Q.get(e);if(typeof t==`string`||t===null){a(t);return}let n=!0;return Tt(e).then(e=>{n&&a(e)}),()=>{n=!1}},[e]);let o=ie(()=>i?{__html:i}:null,[i]);return o?r(`span`,{className:t,style:{display:`inline-flex`,lineHeight:0,...n==null?{}:{width:n,height:n}},dangerouslySetInnerHTML:o,"aria-hidden":`true`}):null}const jt=C(function({value:e,onChange:t,placeholder:a=`Pick icon`,className:o,disabled:s,id:c,...l},u){let[d,f]=w(!1),[p,m]=w(``),[h,g]=w([]),[_,v]=w(!1),y=re();ne(()=>{if(!d||h.length>0)return;let e=!0;return v(!0),kt().then(t=>{e&&(g(t),v(!1))}),()=>{e=!1}},[d,h.length]);let b=ie(()=>{let e=p.trim().toLowerCase(),t=e?h.filter(t=>t.includes(e)):h;return{shown:t.slice(0,90),total:t.length}},[p,h]);Ot(b.shown,d);let x=e=>{t(e),f(!1),m(``)};return i(n,{children:[r(A,{ref:u,id:c,type:`button`,variant:`outline`,size:`icon`,disabled:s,onClick:()=>f(!0),title:e??a,"aria-label":e?`Icon: ${e}`:a,className:o,...l,children:e?r(At,{name:e,size:16}):r(`span`,{"aria-hidden":!0,className:`text-base leading-none text-muted-foreground`,children:`+`})}),r(ot,{open:d,onOpenChange:f,children:i(q,{className:`max-w-lg`,children:[r(dt,{children:r(J,{children:`Choose an icon`})}),r(`label`,{htmlFor:y,className:`sr-only`,children:`Search icons`}),r(M,{id:y,autoFocus:!0,value:p,onChange:e=>m(e.target.value),placeholder:`Search icons…`}),i(`div`,{className:`grid max-h-72 grid-cols-8 gap-1 overflow-auto p-0.5`,children:[r(`button`,{type:`button`,title:`No icon`,"aria-label":`No icon`,onClick:()=>x(void 0),className:k(`flex aspect-square items-center justify-center rounded-md border border-border text-[10px] text-muted-foreground hover:bg-accent`,!e&&`ring-2 ring-ring`),children:`none`}),b.shown.map(t=>r(`button`,{type:`button`,title:t,"aria-label":t,onClick:()=>x(t),className:k(`flex aspect-square items-center justify-center rounded-md border border-transparent hover:bg-accent hover:border-border`,t===e&&`ring-2 ring-ring`),children:r(At,{name:t,size:18})},t))]}),r(`div`,{className:`text-xs text-muted-foreground`,children:_?`Loading icons…`:p?`${b.total} match${b.total===1?``:`es`}${b.total>90?` (showing 90)`:``}`:`${h.length} icons — type to search`})]})})]})}),Mt=O.Root,Nt=O.Trigger,Pt=O.Anchor,Ft=O.Close,It=C(({className:e,align:t=`center`,sideOffset:n=4,...i},a)=>r(O.Portal,{children:r(O.Content,{ref:a,align:t,sideOffset:n,className:k(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2`,`data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})}));It.displayName=O.Content.displayName;const Lt=C(({className:e,children:t,...n},i)=>r(`select`,{ref:i,className:k(`flex h-9 w-full rounded-md border border-input bg-background text-foreground px-3 py-1 text-sm shadow-xs`,`transition-colors`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:t}));Lt.displayName=`Select`;const Rt=C(({className:e,orientation:t=`horizontal`,decorative:n=!0,...i},a)=>r(ve.Root,{ref:a,decorative:n,orientation:t,className:k(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));Rt.displayName=`Separator`;function zt({className:e,...t}){return r(`div`,{className:k(`animate-pulse rounded-md bg-muted`,e),...t})}const Bt={background:`var(--color-background)`,color:`var(--color-foreground)`,border:`1px solid var(--color-border)`},Vt={error:`sonner-error`,success:`sonner-success`};function Ht({toastOptions:e,...t}){return r(ye,{position:`bottom-right`,...t,toastOptions:{...e,style:{...Bt,...e?.style},classNames:{...Vt,...e?.classNames}}})}const Ut=C(({className:e,...t},n)=>r(`textarea`,{ref:n,className:k(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs`,`placeholder:text-muted-foreground`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...t}));Ut.displayName=`Textarea`;export{Se as Badge,A as Button,Te as Card,ke as CardContent,Oe as CardDescription,Ae as CardFooter,Ee as CardHeader,De as CardTitle,ze as ChartContainer,Ve as ChartTooltip,He as ChartTooltipContent,We as Checkbox,Ge as Collapsible,qe as CollapsibleContent,Ke as CollapsibleTrigger,rt as DataTable,at as DataTableColumnHeader,nt as DataTableViewOptions,ot as Dialog,ct as DialogClose,q as DialogContent,pt as DialogDescription,ft as DialogFooter,dt as DialogHeader,J as DialogTitle,st as DialogTrigger,z as DropdownMenu,U as DropdownMenuCheckboxItem,V as DropdownMenuContent,H as DropdownMenuItem,W as DropdownMenuLabel,Ze as DropdownMenuPortal,G as DropdownMenuSeparator,B as DropdownMenuTrigger,mt as Form,bt as FormControl,xt as FormDescription,gt as FormField,vt as FormItem,yt as FormLabel,St as FormMessage,At as Icon,jt as IconPicker,M as Input,Y as Label,Mt as Popover,Pt as PopoverAnchor,Ft as PopoverClose,It as PopoverContent,Nt as PopoverTrigger,Lt as Select,Rt as Separator,zt as Skeleton,N as Table,F as TableBody,R as TableCell,L as TableHead,P as TableHeader,I as TableRow,Ut as Textarea,Ht as Toaster,k as cn,it as nextColumnSort,Dt as prewarmIcons,Ct as setIconEndpoint,be as toast,Ot as usePrewarmIcons};
|
|
5
|
-
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
package/dist/index.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/badge.tsx","../src/button.tsx","../src/card.tsx","../src/chart.tsx","../src/checkbox.tsx","../src/collapsible.tsx","../src/data-table/data-table.tsx","../src/data-table/data-table-column-header.tsx","../src/data-table/data-table-view-options.tsx","../src/dialog.tsx","../src/dropdown-menu.tsx","../src/form.tsx","../src/icon.tsx","../src/icon-picker.tsx","../src/input.tsx","../src/label.tsx","../src/lib/cn.ts","../src/popover.tsx","../src/select.tsx","../src/separator.tsx","../src/skeleton.tsx","../src/sonner.tsx","../src/table.tsx","../src/textarea.tsx"],"mappings":";;;;;;;;;;;;;;;;;;UAGiB,UAAA,SAAmB,cAAc,CAAC,cAAA;EACjD,OAAA;AAAA;AAAA,iBAUc,KAAA,CAAA;EAAQ,SAAA;EAAW,OAAA;EAAA,GAAwB;AAAA,GAAS,UAAA,+BAAU,GAAA,CAAA,OAAA;;;UCT7D,WAAA,SAAoB,oBAAoB,CAAC,iBAAA;EACxD,OAAA;EACA,IAAA;EACA,OAAA;EACA,OAAA;AAAA;AAAA,cAoBW,MAAA,kBAAM,yBAAA,CAAA,WAAA,mBAAA,aAAA,CAAA,iBAAA;;;cC1BN,IAAA,kBAAI,yBAAA,C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AW,yBAAA,CAAA,cAAA,CAAA,uBAAA,oBAAA,aAAA,CAAA,uBAAA;AAAA,cAQX,SAAA,kBAAS,yBAAA,CAAA,cAAA,CAAA,uBAAA,oBAAA,aAAA,CAAA,uBAAA;AAAA,cAoBT,QAAA,kBAAQ,yBAAA,CAAA,cAAA,CAAA,mBAAA,oBAAA,aAAA,CAAA,mBAAA;AAAA,cAcR,SAAA,kBAAS,yBAAA,CAAA,gBAAA,CAAA,oBAAA,oBAAA,aAAA,CAAA,oBAAA;AAAA,cAeT,SAAA,kBAAS,yBAAA,CAAA,gBAAA,CAAA,oBAAA,oBAAA,aAAA,CAAA,oBAAA;;;cCvET,QAAA,kBAAQ,yBAAA,CAAA,sBAAA,CAAA,mBAAA,oBAAA,aAAA,CAAA,mBAAA"}
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["variantClasses","SonnerToaster"],"sources":["../src/lib/cn.ts","../src/badge.tsx","../src/button.tsx","../src/card.tsx","../src/chart.tsx","../src/checkbox.tsx","../src/collapsible.tsx","../src/input.tsx","../src/table.tsx","../src/data-table/data-table-pagination.tsx","../src/dropdown-menu.tsx","../src/data-table/data-table-view-options.tsx","../src/data-table/data-table.tsx","../src/data-table/data-table-column-header.tsx","../src/dialog.tsx","../src/label.tsx","../src/form.tsx","../src/icon.tsx","../src/icon-picker.tsx","../src/popover.tsx","../src/select.tsx","../src/separator.tsx","../src/skeleton.tsx","../src/sonner.tsx","../src/textarea.tsx"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import type { HTMLAttributes } from 'react'\nimport { cn } from './lib/cn'\n\nexport interface BadgeProps extends HTMLAttributes<HTMLDivElement> {\n variant?: 'default' | 'secondary' | 'destructive' | 'outline'\n}\n\nconst variantClasses: Record<NonNullable<BadgeProps['variant']>, string> = {\n default: 'border-transparent bg-primary text-primary-foreground shadow-xs',\n secondary: 'border-transparent bg-secondary text-secondary-foreground',\n destructive: 'border-transparent bg-destructive text-destructive-foreground shadow-xs',\n outline: 'text-foreground',\n}\n\nexport function Badge({ className, variant = 'default', ...props }: BadgeProps) {\n return (\n <div\n className={cn(\n 'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold',\n 'transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',\n variantClasses[variant],\n className,\n )}\n {...props}\n />\n )\n}\n","import { Slot } from '@radix-ui/react-slot'\nimport { Loader2 } from 'lucide-react'\nimport { type ButtonHTMLAttributes, forwardRef } from 'react'\nimport { cn } from './lib/cn'\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'\n size?: 'default' | 'sm' | 'lg' | 'icon'\n loading?: boolean\n asChild?: boolean\n}\n\nconst variantClasses: Record<NonNullable<ButtonProps['variant']>, string> = {\n default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',\n destructive: 'bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90',\n outline:\n 'border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground',\n secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n}\n\nconst sizeClasses: Record<NonNullable<ButtonProps['size']>, string> = {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-10 rounded-md px-8',\n icon: 'h-9 w-9',\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = 'default',\n size = 'default',\n loading = false,\n asChild = false,\n disabled,\n children,\n type = 'button',\n ...props\n },\n ref,\n ) => {\n const classes = cn(\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium',\n 'transition-colors cursor-pointer',\n 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n 'disabled:pointer-events-none disabled:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n variantClasses[variant],\n sizeClasses[size],\n className,\n )\n\n if (asChild) {\n return (\n <Slot ref={ref} className={classes} {...props}>\n {children}\n </Slot>\n )\n }\n\n return (\n <button ref={ref} disabled={disabled || loading} className={classes} type={type} {...props}>\n {loading && <Loader2 className=\"h-4 w-4 animate-spin\" />}\n {children}\n </button>\n )\n },\n)\n\nButton.displayName = 'Button'\n","import { forwardRef, type HTMLAttributes } from 'react'\nimport { cn } from './lib/cn'\n\nexport const Card = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('rounded-xl border bg-card text-card-foreground shadow-sm', className)}\n {...props}\n />\n ),\n)\nCard.displayName = 'Card'\n\nexport const CardHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />\n ),\n)\nCardHeader.displayName = 'CardHeader'\n\nexport const CardTitle = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n ),\n)\nCardTitle.displayName = 'CardTitle'\n\nexport const CardDescription = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />\n ),\n)\nCardDescription.displayName = 'CardDescription'\n\nexport const CardContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />\n ),\n)\nCardContent.displayName = 'CardContent'\n\nexport const CardFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />\n ),\n)\nCardFooter.displayName = 'CardFooter'\n","'use client'\n\n/**\n * Chart primitives for dashboard widgets.\n *\n * Vendored from shadcn/ui chart component (Recharts under the hood).\n * Provides ChartContainer (responsive wrapper), ChartTooltip, ChartTooltipContent.\n *\n * Usage: import Recharts components directly (Bar, BarChart, XAxis, etc.)\n * and wrap them in ChartContainer with a ChartConfig for theming.\n *\n * Security: ChartContainer's `id` prop and ChartConfig keys/colors are\n * inlined into a `<style dangerouslySetInnerHTML>` block to publish per-chart\n * CSS variables. Inputs that don't match the strict allowlists below are\n * silently dropped — DO NOT pass user-controllable strings as `id`, config\n * keys, or color values without validating upstream first.\n */\n\nimport * as React from 'react'\nimport type { TooltipValueType } from 'recharts'\nimport * as RechartsPrimitive from 'recharts'\n\nimport { cn } from './lib/cn'\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const\n\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const\ntype TooltipNameType = number | string\n\n/**\n * Allowlist for chart id prop and ChartConfig keys.\n * Inlined into both the [data-chart=...] attribute selector and the\n * --color-{key} CSS custom property name; deny anything that could break\n * out of the selector or property declaration.\n */\nconst SAFE_CHART_ID_OR_KEY = /^[a-zA-Z0-9_-]+$/\n\n/**\n * Allowlist for ChartConfig color values.\n * Permits hex/rgb/hsl/oklch/var()/keyword colors; denies `;`, `{`, `}`, `<`, `>`, `\"`, `\\`\n * and other characters that would let a value escape the rule body.\n */\nconst SAFE_CSS_COLOR_VALUE = /^[#a-zA-Z0-9 ,.()/%-]+$/\n\n/**\n * Bare `url(...)` values are also rejected — even though the per-chart custom\n * property is inert at the declaration site, it leaks into the cascade and is\n * fetched by any downstream rule that uses `var(--color-key)` in\n * `background-image` / `mask-image` / `cursor` / `border-image` / etc. That's\n * the fetch-on-attribute-selector exfil class the audit calls out, just laundered\n * through a custom property. `var()` is the consumer-intended escape hatch — it\n * doesn't trigger a network fetch on its own.\n */\nconst FORBIDDEN_COLOR_FUNCTION = /\\burl\\s*\\(/i\n\nexport type ChartConfig = Record<\n string,\n {\n label?: React.ReactNode\n icon?: React.ComponentType\n } & (\n | { color?: string; theme?: never }\n | { color?: never; theme: Record<keyof typeof THEMES, string> }\n )\n>\n\ntype ChartContextProps = {\n config: ChartConfig\n}\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null)\n\nfunction useChart() {\n const context = React.useContext(ChartContext)\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />')\n }\n\n return context\n}\n\n/**\n * Build the per-chart CSS rules emitted by `<ChartStyle>`.\n *\n * Returns `null` if there is nothing to emit. Drops individual config\n * entries whose key fails {@link SAFE_CHART_ID_OR_KEY} or whose color\n * value fails {@link SAFE_CSS_COLOR_VALUE} — silently, since those values\n * being present means a consumer is forwarding untrusted input.\n *\n * Exported for unit tests; not part of the package public API.\n */\nexport function buildChartCss(id: string, config: ChartConfig): string | null {\n if (!SAFE_CHART_ID_OR_KEY.test(id)) {\n return null\n }\n\n const colorConfig = Object.entries(config).filter(([, value]) => value.theme ?? value.color)\n if (!colorConfig.length) {\n return null\n }\n\n const blocks = Object.entries(THEMES)\n .map(([theme, prefix]) => {\n const lines = colorConfig\n .map(([key, itemConfig]) => {\n if (!SAFE_CHART_ID_OR_KEY.test(key)) {\n return null\n }\n const color =\n itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ?? itemConfig.color\n if (!color || !SAFE_CSS_COLOR_VALUE.test(color) || FORBIDDEN_COLOR_FUNCTION.test(color)) {\n return null\n }\n return ` --color-${key}: ${color};`\n })\n .filter((line): line is string => line !== null)\n\n if (!lines.length) {\n return null\n }\n return `${prefix} [data-chart=${id}] {\\n${lines.join('\\n')}\\n}`\n })\n .filter((block): block is string => block !== null)\n\n return blocks.length ? blocks.join('\\n') : null\n}\n\n/**\n * Recharts' `Payload.payload` is typed `any`, which cascades through\n * the indicator color resolution. Narrow once here so callers stay typed.\n */\nfunction getPayloadFill(payload: unknown): string | undefined {\n if (\n payload &&\n typeof payload === 'object' &&\n 'fill' in payload &&\n typeof (payload as { fill: unknown }).fill === 'string'\n ) {\n return (payload as { fill: string }).fill\n }\n return undefined\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n initialDimension = INITIAL_DIMENSION,\n nonce,\n ...props\n}: React.ComponentProps<'div'> & {\n config: ChartConfig\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children']\n initialDimension?: {\n width: number\n height: number\n }\n /** CSP nonce forwarded to the inline `<style>` element. */\n nonce?: string\n}) {\n const uniqueId = React.useId()\n const safeProvidedId = id && SAFE_CHART_ID_OR_KEY.test(id) ? id : null\n const chartId = `chart-${safeProvidedId ?? uniqueId.replace(/:/g, '')}`\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} nonce={nonce} />\n <RechartsPrimitive.ResponsiveContainer initialDimension={initialDimension}>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n )\n}\n\nconst ChartStyle = ({\n id,\n config,\n nonce,\n}: {\n id: string\n config: ChartConfig\n nonce?: string | undefined\n}) => {\n const css = buildChartCss(id, config)\n if (!css) {\n return null\n }\n\n return (\n // biome-ignore lint/security/noDangerouslySetInnerHtml: id/keys/colors validated by buildChartCss against SAFE_CHART_ID_OR_KEY + SAFE_CSS_COLOR_VALUE allowlists.\n <style nonce={nonce} dangerouslySetInnerHTML={{ __html: css }} />\n )\n}\n\nconst ChartTooltip = RechartsPrimitive.Tooltip\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean\n hideIndicator?: boolean\n indicator?: 'line' | 'dot' | 'dashed'\n nameKey?: string\n labelKey?: string\n } & Omit<\n RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>,\n 'accessibilityLayer'\n >) {\n const { config } = useChart()\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null\n }\n\n const [item] = payload\n const key = `${labelKey ?? item?.dataKey ?? item?.name ?? 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n const value =\n !labelKey && typeof label === 'string' ? (config[label]?.label ?? label) : itemConfig?.label\n\n if (labelFormatter) {\n return (\n <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>\n )\n }\n\n if (!value) {\n return null\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey])\n\n if (!active || !payload?.length) {\n return null\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot'\n\n return (\n <div\n className={cn(\n 'grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const lookupKey = `${nameKey ?? item.name ?? item.dataKey ?? 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, lookupKey)\n const indicatorColor = color ?? getPayloadFill(item.payload) ?? item.color\n\n return (\n <div\n key={lookupKey}\n className={cn(\n 'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n 'shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)',\n {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent':\n indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n },\n )}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label ?? item.name}\n </span>\n </div>\n {item.value != null && (\n <span className=\"font-mono font-medium text-foreground tabular-nums\">\n {typeof item.value === 'number'\n ? item.value.toLocaleString()\n : String(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined\n\n let configLabelKey: string = key\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key]\n}\n\nexport { ChartContainer, ChartTooltip, ChartTooltipContent }\n","import * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, forwardRef } from 'react'\nimport { cn } from './lib/cn'\n\n/**\n * A checkbox, including its third state. `checked=\"indeterminate\"` renders a\n * dash rather than the tick — \"some of these, not all\" has to look different\n * from \"all of these\", or a table header whose page is half-selected reads as\n * fully selected. Radix already reports it to assistive tech (`aria-checked=\n * \"mixed\"`); this is the half a sighted user sees.\n */\nexport const Checkbox = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow-xs',\n 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',\n 'data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n {/* Keyed on Radix's own `data-state`, so an uncontrolled\n `defaultChecked=\"indeterminate\"` gets the dash too. */}\n <Check className=\"h-3.5 w-3.5 group-data-[state=indeterminate]:hidden\" />\n <Minus className=\"hidden h-3.5 w-3.5 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\n\nCheckbox.displayName = 'Checkbox'\n","import * as CollapsiblePrimitive from '@radix-ui/react-collapsible'\n\n/**\n * Collapsible primitive (Radix). Used by the admin sidebar to fold nav groups\n * away (plan/config phase 03 §9). Controlled via `open` / `onOpenChange`, or\n * uncontrolled via `defaultOpen`.\n *\n * Minimal re-export (shadcn convention) — the consumer styles the trigger and\n * content. `CollapsibleContent` exposes the `--radix-collapsible-content-height`\n * CSS var for height-animated reveals when the consumer opts in.\n */\nexport const Collapsible = CollapsiblePrimitive.Root\nexport const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger\nexport const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent\n","import { forwardRef, type InputHTMLAttributes } from 'react'\nimport { cn } from './lib/cn'\n\nexport const Input = forwardRef<HTMLInputElement, InputHTMLAttributes<HTMLInputElement>>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n ref={ref}\n className={cn(\n 'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs',\n 'transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',\n 'placeholder:text-muted-foreground',\n 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n )\n },\n)\n\nInput.displayName = 'Input'\n","import {\n forwardRef,\n type HTMLAttributes,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n} from 'react'\nimport { cn } from './lib/cn'\n\nexport const Table = forwardRef<HTMLTableElement, HTMLAttributes<HTMLTableElement>>(\n ({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table ref={ref} className={cn('w-full caption-bottom text-sm', className)} {...props} />\n </div>\n ),\n)\nTable.displayName = 'Table'\n\nexport const TableHeader = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn('[&_tr]:border-b', className)} {...props} />\n))\nTableHeader.displayName = 'TableHeader'\n\nexport const TableBody = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody ref={ref} className={cn('[&_tr:last-child]:border-0', className)} {...props} />\n))\nTableBody.displayName = 'TableBody'\n\nexport const TableFooter = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn('border-t bg-muted/50 font-medium [&>tr]:last:border-b-0', className)}\n {...props}\n />\n))\nTableFooter.displayName = 'TableFooter'\n\nexport const TableRow = forwardRef<HTMLTableRowElement, HTMLAttributes<HTMLTableRowElement>>(\n ({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n 'border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted',\n className,\n )}\n {...props}\n />\n ),\n)\nTableRow.displayName = 'TableRow'\n\nexport const TableHead = forwardRef<HTMLTableCellElement, ThHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n 'h-10 px-2 text-left align-middle font-medium text-muted-foreground',\n '[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n ),\n)\nTableHead.displayName = 'TableHead'\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TdHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n ),\n)\nTableCell.displayName = 'TableCell'\n\nexport const TableCaption = forwardRef<\n HTMLTableCaptionElement,\n HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption ref={ref} className={cn('mt-4 text-sm text-muted-foreground', className)} {...props} />\n))\nTableCaption.displayName = 'TableCaption'\n","import type { Table } from '@tanstack/react-table'\nimport { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from 'lucide-react'\nimport { Button } from '../button'\nimport { cn } from '../lib/cn'\n\ninterface DataTablePaginationProps<TData> {\n table: Table<TData>\n className?: string | undefined\n}\n\nexport function DataTablePagination<TData>({ table, className }: DataTablePaginationProps<TData>) {\n const selectedCount = table.getFilteredSelectedRowModel().rows.length\n const totalCount = table.getFilteredRowModel().rows.length\n\n return (\n <div className={cn('flex items-center justify-between px-2', className)}>\n <div className=\"flex-1 text-sm text-muted-foreground\">\n {selectedCount > 0 && (\n <span>\n {selectedCount} of {totalCount} row(s) selected\n </span>\n )}\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </p>\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"hidden h-8 w-8 lg:flex\"\n onClick={() => table.setPageIndex(0)}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <ChevronsLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"h-8 w-8\"\n onClick={() => table.previousPage()}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"h-8 w-8\"\n onClick={() => table.nextPage()}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"hidden h-8 w-8 lg:flex\"\n onClick={() => table.setPageIndex(table.getPageCount() - 1)}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <ChevronsRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n </div>\n )\n}\n","import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { Check, ChevronRight } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, forwardRef, type HTMLAttributes } from 'react'\nimport { cn } from './lib/cn'\n\nexport const DropdownMenu = DropdownMenuPrimitive.Root\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\nexport const DropdownMenuGroup = DropdownMenuPrimitive.Group\nexport const DropdownMenuPortal = DropdownMenuPrimitive.Portal\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nexport const DropdownMenuContent = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n // Bounded by the space Radix measures between the trigger and the\n // viewport edge, and scrolls inside that — a long menu (an entity's View\n // menu lists every column: 20+ on Pages) used to run past the bottom of\n // the screen with its last items unreachable, because `overflow-hidden`\n // clipped rather than scrolled. Same fix upstream shadcn ships.\n 'z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2',\n 'data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = 'DropdownMenuContent'\n\nexport const DropdownMenuItem = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none',\n 'transition-colors focus:bg-accent focus:text-accent-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = 'DropdownMenuItem'\n\nexport const DropdownMenuCheckboxItem = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none',\n 'transition-colors focus:bg-accent focus:text-accent-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...(checked !== undefined && { checked })}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem'\n\nexport const DropdownMenuLabel = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = 'DropdownMenuLabel'\n\nexport const DropdownMenuSeparator = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator'\n\nexport const DropdownMenuSubTrigger = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & { inset?: boolean }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none',\n 'focus:bg-accent data-[state=open]:bg-accent',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger'\n\nexport const DropdownMenuSubContent = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2',\n 'data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent'\n\nexport function DropdownMenuShortcut({ className, ...props }: HTMLAttributes<HTMLSpanElement>) {\n return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />\n}\n","import type { Column, Table } from '@tanstack/react-table'\nimport { Settings2 } from 'lucide-react'\nimport { Button } from '../button'\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../dropdown-menu'\n\n/**\n * The words the View menu speaks — everything a person reads that is not a\n * column's own title.\n *\n * Same contract, and the same reason, as `DataTableColumnHeaderLabels`: this\n * package cannot know the request locale and must not, so the caller fills the\n * words where the locale IS known and the English below is only what an\n * unconfigured caller gets. `verify:interface-copy` does not scan this package,\n * which is how these two stayed English on an Estonian admin.\n */\nexport interface DataTableViewOptionsLabels {\n /** The button that opens the menu. */\n trigger: string\n /** The heading above the column list. */\n heading: string\n}\n\n/** What an unconfigured View menu says. */\nexport const DEFAULT_VIEW_OPTIONS_LABELS: DataTableViewOptionsLabels = {\n trigger: 'View',\n heading: 'Toggle columns',\n}\n\n/**\n * The columns this menu offers, in the table's current column ORDER — so after\n * a header drag the menu lists them the way the header shows them.\n *\n * Exported from this MODULE — deliberately not from the package barrel —\n * because it is the menu's whole editorial decision and the menu itself is a\n * Radix dropdown happy-dom cannot open: a test that re-implemented the\n * predicate in order to assert on it would go on passing after the predicate\n * changed, which is the failure mode the extraction exists to remove.\n *\n * ⚠️ NOT on `@murumets-ee/ui`'s barrel, and neither is\n * {@link DEFAULT_VIEW_OPTIONS_LABELS}. tsdown stamps that entry with a\n * `\"use client\"` banner, so React turns every VALUE export into a client\n * reference: a server module that imported and CALLED this would throw on\n * every RSC render, with `tsc`, vitest and every source-importing test green,\n * because the directive exists only in `dist/`. A component is safe there (it\n * is rendered, never invoked); a plain function is the trap this repo has hit\n * three times. Tests import it from source, which is all it was extracted for.\n *\n * `getCanHide()` and nothing else. It used to ALSO require\n * `accessorFn !== undefined`, which silently excluded every column built from\n * `id` + `cell` rather than an accessor — so a column could declare\n * `enableHiding: true` and never appear here, because the one control that\n * hides columns refused to list it. A column that says it can be hidden is\n * offered.\n */\nexport function hideableColumns<TData>(table: Table<TData>): Column<TData, unknown>[] {\n return table.getAllLeafColumns().filter((column) => column.getCanHide())\n}\n\ninterface DataTableViewOptionsProps<TData> {\n table: Table<TData>\n /** The menu's words. Any omitted fall back to {@link DEFAULT_VIEW_OPTIONS_LABELS}. */\n labels?: Partial<DataTableViewOptionsLabels> | undefined\n /**\n * A column's human title — the SAME string its header shows.\n *\n * Without it this menu falls back to the column's id under a CSS\n * `capitalize`, which is what it used to do unconditionally: `contentType`\n * renders as \"Contenttype\" (one word, so one letter is uppercased) while the\n * header two inches above already reads \"Content Type\". Same column, two\n * names, neither translated.\n */\n columnTitle?: ((column: Column<TData, unknown>) => string | undefined) | undefined\n}\n\nexport function DataTableViewOptions<TData>({\n table,\n labels,\n columnTitle,\n}: DataTableViewOptionsProps<TData>) {\n // Per key, not `{ ...DEFAULT, ...labels }`: a spread lets a caller's explicit\n // `undefined` erase a default and leave the button blank, and the docs promise\n // \"any omitted falls back\".\n const text: DataTableViewOptionsLabels = {\n trigger: labels?.trigger ?? DEFAULT_VIEW_OPTIONS_LABELS.trigger,\n heading: labels?.heading ?? DEFAULT_VIEW_OPTIONS_LABELS.heading,\n }\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <Settings2 className=\"mr-2 h-4 w-4\" />\n {text.trigger}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[180px]\">\n <DropdownMenuLabel>{text.heading}</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {hideableColumns(table).map((column) => {\n const title = columnTitle?.(column)\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n // `capitalize` only when falling back to the raw id — a real\n // title is already cased the way its language wants, and\n // capitalising \"Sisu tüüp\" is not this component's business.\n className={title === undefined ? 'capitalize' : undefined}\n checked={column.getIsVisible()}\n onCheckedChange={(value) => column.toggleVisibility(!!value)}\n >\n {title ?? column.id}\n </DropdownMenuCheckboxItem>\n )\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n","import {\n type ColumnDef,\n type ColumnFiltersState,\n flexRender,\n getCoreRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n type RowSelectionState,\n type SortingState,\n useReactTable,\n type VisibilityState,\n} from '@tanstack/react-table'\nimport { useState } from 'react'\nimport { Input } from '../input'\nimport { cn } from '../lib/cn'\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../table'\nimport { DataTablePagination } from './data-table-pagination'\nimport { DataTableViewOptions } from './data-table-view-options'\n\nexport interface DataTableClassNames {\n root?: string\n toolbar?: string\n table?: string\n pagination?: string\n}\n\nexport interface DataTableProps<TData, TValue> {\n columns: ColumnDef<TData, TValue>[]\n data: TData[]\n searchKey?: string\n searchPlaceholder?: string\n pageSize?: number\n emptyMessage?: string\n classNames?: DataTableClassNames\n}\n\nexport function DataTable<TData, TValue>({\n columns,\n data,\n searchKey,\n searchPlaceholder = 'Filter...',\n pageSize = 10,\n emptyMessage = 'No results.',\n classNames,\n}: DataTableProps<TData, TValue>) {\n const [sorting, setSorting] = useState<SortingState>([])\n const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([])\n const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({})\n const [rowSelection, setRowSelection] = useState<RowSelectionState>({})\n\n const table = useReactTable({\n data,\n columns,\n state: { sorting, columnFilters, columnVisibility, rowSelection },\n onSortingChange: setSorting,\n onColumnFiltersChange: setColumnFilters,\n onColumnVisibilityChange: setColumnVisibility,\n onRowSelectionChange: setRowSelection,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n initialState: { pagination: { pageSize } },\n })\n\n return (\n <div className={cn('space-y-4', classNames?.root)}>\n {/* Toolbar */}\n <div className={cn('flex items-center justify-between', classNames?.toolbar)}>\n <div className=\"flex flex-1 items-center space-x-2\">\n {searchKey && (\n <Input\n placeholder={searchPlaceholder}\n value={(table.getColumn(searchKey)?.getFilterValue() as string) ?? ''}\n onChange={(event) => table.getColumn(searchKey)?.setFilterValue(event.target.value)}\n className=\"h-8 w-[150px] lg:w-[250px]\"\n />\n )}\n </div>\n <DataTableViewOptions table={table} />\n </div>\n\n {/* Table */}\n <div className={cn('rounded-md border', classNames?.table)}>\n <Table>\n <TableHeader>\n {table.getHeaderGroups().map((headerGroup) => (\n <TableRow key={headerGroup.id}>\n {headerGroup.headers.map((header) => (\n <TableHead key={header.id} colSpan={header.colSpan}>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n </TableHead>\n ))}\n </TableRow>\n ))}\n </TableHeader>\n <TableBody>\n {table.getRowModel().rows.length > 0 ? (\n table.getRowModel().rows.map((row) => (\n <TableRow key={row.id} data-state={row.getIsSelected() && 'selected'}>\n {row.getVisibleCells().map((cell) => (\n <TableCell key={cell.id}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell colSpan={columns.length} className=\"h-24 text-center\">\n {emptyMessage}\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </div>\n\n {/* Pagination */}\n <DataTablePagination table={table} className={classNames?.pagination} />\n </div>\n )\n}\n","import type { Column, SortDirection } from '@tanstack/react-table'\nimport {\n ArrowDown,\n ArrowLeft,\n ArrowRight,\n ArrowUp,\n ChevronsUpDown,\n EllipsisVertical,\n EyeOff,\n X,\n} from 'lucide-react'\nimport { type MouseEvent, useState } from 'react'\nimport { Button } from '../button'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../dropdown-menu'\nimport { cn } from '../lib/cn'\n\n/**\n * Reordering one column from its header menu — the keyboard- and\n * assistive-tech-reachable twin of dragging the header.\n *\n * Supplied by whoever owns the column order; the header only draws the two\n * items and reports which way. Omit it and the items are not drawn.\n */\nexport interface DataTableColumnMove {\n /** Move this column one place towards the start (`-1`) or the end (`1`). */\n onMove: (delta: -1 | 1) => void\n canMoveLeft: boolean\n canMoveRight: boolean\n}\n\n/**\n * The words the header menu speaks — everything a person reads that is not the\n * column's own title.\n *\n * This package cannot know the request locale, and must not: it is a generic\n * component, and the demo pages use it with no translation stack at all. So the\n * words are a CONTRACT the caller fills (entity-table F021) — the admin list\n * resolves them where the locale is known and passes strings down, the same\n * route `columnLabels` and `filterLabels` take — and the English below is only\n * what an unconfigured caller gets. `verify:interface-copy` does not scan this\n * package, which is how seven of these stayed English on an Estonian admin.\n */\nexport interface DataTableColumnHeaderLabels {\n sortAscending: string\n sortDescending: string\n clearSort: string\n moveLeft: string\n moveRight: string\n hide: string\n /** The accessible name of the ⋮ button. A FUNCTION because it embeds the title, and word order is the language's to choose. */\n columnOptions: (title: string) => string\n}\n\n/** What an unconfigured header says. */\nexport const DEFAULT_COLUMN_HEADER_LABELS: DataTableColumnHeaderLabels = {\n sortAscending: 'Sort ascending',\n sortDescending: 'Sort descending',\n clearSort: 'Clear sort',\n moveLeft: 'Move left',\n moveRight: 'Move right',\n hide: 'Hide',\n columnOptions: (title) => `${title} column options`,\n}\n\ninterface DataTableColumnHeaderProps<TData, TValue> {\n column: Column<TData, TValue>\n title: string\n className?: string\n /** Offer \"Move left\" / \"Move right\" in the header menu. */\n move?: DataTableColumnMove | undefined\n /** The menu's words. Any omitted fall back to {@link DEFAULT_COLUMN_HEADER_LABELS}. */\n labels?: Partial<DataTableColumnHeaderLabels> | undefined\n}\n\n/**\n * The sort a header click moves to: unsorted → ascending → descending →\n * unsorted.\n *\n * Fixed, rather than TanStack's `getToggleSortingHandler`, which picks the\n * FIRST direction from the column's data (descending first for anything that\n * is not a string) — so the same click would mean different things on\n * different columns. Three states and the same order everywhere is the\n * convention MUI X and AG Grid both default to.\n */\nexport function nextColumnSort(current: false | SortDirection): false | SortDirection {\n if (current === false) return 'asc'\n if (current === 'asc') return 'desc'\n return false\n}\n\n/**\n * A column header: click the title to sort, and a menu — opened from the\n * button beside the title, or by right-clicking the title — for\n * the explicit sort directions, moving the column and hiding it.\n *\n * Every action goes through the TanStack `column`, so a table that controls\n * its own state (the admin entity list does) sees each one as an `onXChange`\n * and decides what it means; nothing here holds table state. The menu's open\n * flag is the one piece of state, and it is this component's own.\n */\nexport function DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n move,\n labels,\n}: DataTableColumnHeaderProps<TData, TValue>) {\n const [menuOpen, setMenuOpen] = useState(false)\n // Per key, not `{ ...DEFAULT, ...labels }`: a spread lets a caller's explicit\n // `undefined` (a JS caller, or a value that came from an optional lookup) ERASE a\n // default, leaving the menu item blank — and the docs promise \"any omitted falls back\".\n const text: DataTableColumnHeaderLabels = {\n sortAscending: labels?.sortAscending ?? DEFAULT_COLUMN_HEADER_LABELS.sortAscending,\n sortDescending: labels?.sortDescending ?? DEFAULT_COLUMN_HEADER_LABELS.sortDescending,\n clearSort: labels?.clearSort ?? DEFAULT_COLUMN_HEADER_LABELS.clearSort,\n moveLeft: labels?.moveLeft ?? DEFAULT_COLUMN_HEADER_LABELS.moveLeft,\n moveRight: labels?.moveRight ?? DEFAULT_COLUMN_HEADER_LABELS.moveRight,\n hide: labels?.hide ?? DEFAULT_COLUMN_HEADER_LABELS.hide,\n columnOptions: labels?.columnOptions ?? DEFAULT_COLUMN_HEADER_LABELS.columnOptions,\n }\n const canSort = column.getCanSort()\n const canHide = column.getCanHide()\n const sorted = column.getIsSorted()\n const hasMenu = canSort || canHide || move !== undefined\n\n if (!hasMenu) {\n return <div className={cn(className)}>{title}</div>\n }\n\n const cycleSort = () => {\n const next = nextColumnSort(sorted)\n if (next === false) column.clearSorting()\n else column.toggleSorting(next === 'desc')\n }\n\n // Right-clicking the title opens the SAME menu the ⋮ button does — anchored\n // to that button, so it appears in one place however it was opened. On the\n // title button rather than the whole header, because a context-menu handler\n // belongs on an interactive element; a column that cannot sort has no title\n // button and is reached through ⋮ alone.\n const openFromContextMenu = (event: MouseEvent) => {\n event.preventDefault()\n setMenuOpen(true)\n }\n\n return (\n <div className={cn('group/column-header flex items-center gap-1', className)}>\n {canSort ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"-ml-3 h-8\"\n onClick={cycleSort}\n onContextMenu={openFromContextMenu}\n >\n <span>{title}</span>\n {sorted === 'desc' ? (\n <ArrowDown className=\"h-4 w-4\" />\n ) : sorted === 'asc' ? (\n <ArrowUp className=\"h-4 w-4\" />\n ) : (\n <ChevronsUpDown className=\"h-4 w-4 text-muted-foreground/60\" />\n )}\n </Button>\n ) : (\n <span>{title}</span>\n )}\n <DropdownMenu open={menuOpen} onOpenChange={setMenuOpen}>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={text.columnOptions(title)}\n className={cn(\n 'h-6 w-6 text-muted-foreground',\n // Out of the way until the header is hovered or the button is\n // focused — present in the tab order the whole time — and\n // always shown on a touch screen, which has no hover.\n 'opacity-0 group-hover/column-header:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100',\n '[@media(hover:none)]:opacity-100',\n )}\n >\n <EllipsisVertical className=\"h-3.5 w-3.5\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n {canSort && (\n <>\n <DropdownMenuItem onClick={() => column.toggleSorting(false)}>\n <ArrowUp className=\"mr-2 h-3.5 w-3.5 text-muted-foreground/70\" />\n {text.sortAscending}\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => column.toggleSorting(true)}>\n <ArrowDown className=\"mr-2 h-3.5 w-3.5 text-muted-foreground/70\" />\n {text.sortDescending}\n </DropdownMenuItem>\n {sorted !== false && (\n <DropdownMenuItem onClick={() => column.clearSorting()}>\n <X className=\"mr-2 h-3.5 w-3.5 text-muted-foreground/70\" />\n {text.clearSort}\n </DropdownMenuItem>\n )}\n </>\n )}\n {move && (\n <>\n {canSort && <DropdownMenuSeparator />}\n <DropdownMenuItem disabled={!move.canMoveLeft} onClick={() => move.onMove(-1)}>\n <ArrowLeft className=\"mr-2 h-3.5 w-3.5 text-muted-foreground/70\" />\n {text.moveLeft}\n </DropdownMenuItem>\n <DropdownMenuItem disabled={!move.canMoveRight} onClick={() => move.onMove(1)}>\n <ArrowRight className=\"mr-2 h-3.5 w-3.5 text-muted-foreground/70\" />\n {text.moveRight}\n </DropdownMenuItem>\n </>\n )}\n {canHide && (\n <>\n {(canSort || move) && <DropdownMenuSeparator />}\n <DropdownMenuItem onClick={() => column.toggleVisibility(false)}>\n <EyeOff className=\"mr-2 h-3.5 w-3.5 text-muted-foreground/70\" />\n {text.hide}\n </DropdownMenuItem>\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n )\n}\n","import * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { X } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, forwardRef, type HTMLAttributes } from 'react'\nimport { cn } from './lib/cn'\n\nexport const Dialog = DialogPrimitive.Root\nexport const DialogTrigger = DialogPrimitive.Trigger\nexport const DialogClose = DialogPrimitive.Close\nexport const DialogPortal = DialogPrimitive.Portal\n\nexport const DialogOverlay = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-black/80',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className,\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = 'DialogOverlay'\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {\n /**\n * Accessible name of the corner × button. This package has no translator, so\n * the English default is only a fallback: a dialog shown in a translated admin\n * passes its own resolved string (images F003 — an et crop dialog announced\n * \"Close\" to screen-reader users while every visible string was Estonian).\n */\n closeLabel?: string\n}\n\nexport const DialogContent = forwardRef<HTMLDivElement, DialogContentProps>(\n ({ className, children, closeLabel = 'Close', ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%]',\n 'gap-4 border bg-background p-6 shadow-lg sm:rounded-lg',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n 'data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]',\n 'data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className={cn(\n 'absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity',\n 'hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',\n 'disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',\n 'cursor-pointer',\n )}\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">{closeLabel}</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n)\nDialogContent.displayName = 'DialogContent'\n\nexport function DialogHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)}\n {...props}\n />\n )\n}\n\nexport function DialogFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n )\n}\n\nexport const DialogTitle = forwardRef<\n HTMLHeadingElement,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = 'DialogTitle'\n\nexport const DialogDescription = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n))\nDialogDescription.displayName = 'DialogDescription'\n","import * as LabelPrimitive from '@radix-ui/react-label'\nimport { type ComponentPropsWithoutRef, forwardRef } from 'react'\nimport { cn } from './lib/cn'\n\nexport const Label = forwardRef<\n HTMLLabelElement,\n ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className,\n )}\n {...props}\n />\n))\n\nLabel.displayName = 'Label'\n","import type * as LabelPrimitive from '@radix-ui/react-label'\nimport { Slot } from '@radix-ui/react-slot'\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n forwardRef,\n type HTMLAttributes,\n useContext,\n useId,\n} from 'react'\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n} from 'react-hook-form'\nimport { Label } from './label'\nimport { cn } from './lib/cn'\n\n/* ---------- Form (re-export of FormProvider) ---------- */\n\n// rolldown-plugin-dts 0.25.x (PR #243 \"Preserve external import types\")\n// flagged TS2742 on a bare `export const Form = FormProvider`: the inferred\n// type of `Form` indirectly references `@types/react` via react-hook-form's\n// generics, and the bundler can't construct a portable type alias without an\n// explicit annotation. Pinning the type to `typeof FormProvider` is the\n// react-hook-form-recommended fix (see hook-form examples) and identical at\n// the value level.\nexport const Form: typeof FormProvider = FormProvider\n\n/* ---------- FormField context ---------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName\n}\n\nconst FormFieldContext = createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nexport function FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>(props: ControllerProps<TFieldValues, TName>) {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\n/* ---------- FormItem context ---------- */\n\ninterface FormItemContextValue {\n id: string\n}\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue)\n\n/* ---------- useFormField hook ---------- */\n\nexport function useFormField() {\n const fieldContext = useContext(FormFieldContext)\n const itemContext = useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\n/* ---------- FormItem ---------- */\n\nexport const FormItem = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = useId()\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n )\n },\n)\nFormItem.displayName = 'FormItem'\n\n/* ---------- FormLabel ---------- */\n\nexport const FormLabel = forwardRef<\n HTMLLabelElement,\n ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n return (\n <Label\n ref={ref}\n className={cn(error && 'text-destructive', className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = 'FormLabel'\n\n/* ---------- FormControl ---------- */\n\nexport const FormControl = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<typeof Slot>>(\n ({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n },\n)\nFormControl.displayName = 'FormControl'\n\n/* ---------- FormDescription ---------- */\n\nexport const FormDescription = forwardRef<\n HTMLParagraphElement,\n HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-[0.8rem] text-muted-foreground', className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = 'FormDescription'\n\n/* ---------- FormMessage ---------- */\n\nexport const FormMessage = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(\n ({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error.message) : children\n\n if (!body) return null\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n // Native constraint validation used to announce a rejected field to\n // screen readers for free; `noValidate` forms (settings-form) opt out\n // of that so every rejection funnels through this component instead\n // — role=\"alert\" keeps the announcement. Only set on a real\n // validation error, not the static-children fallback.\n role={error ? 'alert' : undefined}\n className={cn('text-[0.8rem] font-medium text-destructive', className)}\n {...props}\n >\n {body}\n </p>\n )\n },\n)\nFormMessage.displayName = 'FormMessage'\n","'use client'\n\n/**\n * `<Icon name>` — render a Lucide icon by kebab-case name, fetched **on demand**\n * as SVG data from the toolkit's icon endpoint (plan/config SD003).\n *\n * The client ships **zero icon code**: each icon's `<svg>` is fetched once from\n * `GET {endpoint}/{name}`, cached in-memory (shared across all `<Icon>`s) and by\n * the browser (`immutable`), then inlined so it inherits `currentColor` for\n * theming. Unknown/empty names render nothing. This replaces the crash-prone\n * `lucide-react/dynamic` approach (1500 lazy chunks crawled the library under\n * Turbopack — lucide #1576).\n *\n * Endpoint defaults to `/api/admin/icons` (the toolkit's admin API base). Apps\n * that mount the admin API elsewhere call {@link setIconEndpoint} once at boot.\n */\n\nimport { useEffect, useMemo, useRef, useState } from 'react'\n\nlet endpoint = '/api/admin/icons'\n\n/** Override the icon endpoint base (default `/api/admin/icons`). Call once at app boot. */\nexport function setIconEndpoint(base: string): void {\n const next = base.replace(/\\/+$/, '')\n if (next !== endpoint) {\n endpoint = next\n // Drop everything fetched from the previous backend — otherwise stale SVGs /\n // name lists from the old endpoint keep serving after the switch.\n cache.clear()\n namesPromise = null\n }\n}\n\n// Shared cache: name → svg string | null (known-missing) | in-flight Promise.\nconst cache = new Map<string, string | null | Promise<string | null>>()\n\n/**\n * Abort an icon request that stalls. Without this, a hung connection leaves the\n * in-flight `Promise` in the cache forever — the icon (or up to a whole batch of\n * them) never renders AND never retries. On abort the fetch rejects, so callers'\n * existing `.catch` clears the cache entry and the next render retries.\n */\nconst FETCH_TIMEOUT_MS = 10_000\nfunction fetchWithTimeout(url: string): Promise<Response> {\n const controller = new AbortController()\n const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS)\n return fetch(url, { signal: controller.signal }).finally(() => clearTimeout(timer))\n}\n\n/** Fetch + cache one icon's SVG (dedupes concurrent requests for the same name). */\nfunction fetchIconSvg(name: string): Promise<string | null> {\n const hit = cache.get(name)\n if (hit instanceof Promise) return hit\n if (hit !== undefined) return Promise.resolve(hit)\n const p = fetchWithTimeout(`${endpoint}/${encodeURIComponent(name)}`)\n .then(async (r) => {\n if (r.ok) {\n const svg = await r.text()\n cache.set(name, svg)\n return svg\n }\n // 404 = the icon genuinely doesn't exist → cache the miss so we don't refetch.\n // A transient failure (e.g. the route's 503 when icon data is briefly\n // unavailable) must NOT be cached as a permanent miss — otherwise one outage\n // blanks the icon for the rest of the session. Drop it so the next render retries.\n if (r.status === 404) cache.set(name, null)\n else cache.delete(name)\n return null\n })\n .catch(() => {\n // Network error — transient. Clear the in-flight entry so a retry can happen.\n cache.delete(name)\n return null\n })\n cache.set(name, p)\n return p\n}\n\n/**\n * Max icon names per batch request. MUST stay `<=` the server's batch cap\n * (`MAX_BATCH` in `@murumets-ee/admin-ui`'s `icon-routes.ts`) — a request larger\n * than the server cap is truncated, so the dropped names would be absent from the\n * response and get cached as permanent misses (blank forever). Larger sets are\n * split across multiple requests instead.\n */\nconst ICON_BATCH_MAX = 128\n\n/** Fetch one chunk (`<= ICON_BATCH_MAX` names) in a single request + seed the cache. */\nfunction prewarmChunk(chunk: readonly string[]): Promise<void> {\n // `null` sentinel = a successful response we can read a name→svg map from;\n // a rejected/failed fetch resolves the outer promise to `null` so we DON'T\n // cache a permanent miss (mirrors fetchIconSvg's transient-vs-404 handling).\n const batch: Promise<Record<string, string> | null> = fetchWithTimeout(\n `${endpoint}?names=${encodeURIComponent(chunk.join(','))}`,\n )\n .then((r) => (r.ok ? (r.json() as Promise<Record<string, string>>) : null))\n .catch(() => null)\n for (const name of chunk) {\n const p = batch.then((map) => {\n if (map === null) {\n // Transient failure — drop the in-flight entry so a later render retries\n // instead of blanking the icon for the rest of the session.\n cache.delete(name)\n return null\n }\n const svg = map[name]\n // Present → cache the SVG. Absent from the batch → a genuine miss; cache\n // `null` so the icon renders nothing without firing its own follow-up fetch.\n const val = typeof svg === 'string' ? svg : null\n cache.set(name, val)\n return val\n })\n cache.set(name, p)\n }\n return batch.then(() => undefined)\n}\n\n/**\n * Prewarm the shared cache for many icons in ONE request per {@link ICON_BATCH_MAX}\n * chunk (one request for any set up to the cap).\n *\n * Callers that render many `<Icon>`s at once — the picker grid, the sidebar, the\n * nav editor — MUST call this for their visible set *before those `<Icon>`s mount*,\n * so the set is fetched with a single batched request instead of one request per\n * cell. A grid of N cells each fetching its own SVG fires N same-IP requests in a\n * burst, which WAFs like CrowdSec read as a scan and ban the IP for (and is a\n * self-inflicted DoS). See the \"No Unbounded Fan-Out\" rule in CLAUDE.md.\n *\n * Only names not already cached are requested, so repeat opens/searches don't\n * re-fetch. Each requested name is seeded with a shared in-flight promise\n * synchronously (before the first `await`), so a concurrent per-name\n * {@link fetchIconSvg} (e.g. an `<Icon>` that mounts before this resolves) dedupes\n * onto the same batch request rather than firing its own — and a render-time caller\n * wins the race against its own child `<Icon>` effects.\n */\nexport async function prewarmIcons(names: readonly string[]): Promise<void> {\n // Browser-only. Callers seed this during render, and these are `'use client'`\n // components that Next.js ALSO server-renders on the initial load — where a\n // relative-URL `fetch` has no origin and rejects (\"Failed to parse URL\"). The\n // server render can't use a client cache anyway (the client re-seeds on mount),\n // so skip the wasted, guaranteed-failing request entirely rather than relying on\n // the `.catch` to swallow it.\n if (typeof window === 'undefined') return\n const missing = names.filter((n) => cache.get(n) === undefined)\n if (missing.length === 0) return\n // Split into chunks no larger than the server cap so no request is truncated.\n // Each chunk is ONE request, so this stays bounded — e.g. 300 names → 3 requests,\n // not 300 (the fan-out this exists to prevent). All chunks install their in-flight\n // cache entries synchronously here (before the await), preserving the race-win.\n const chunks: string[][] = []\n for (let i = 0; i < missing.length; i += ICON_BATCH_MAX) {\n chunks.push(missing.slice(i, i + ICON_BATCH_MAX))\n }\n await Promise.all(chunks.map(prewarmChunk))\n}\n\n/**\n * Seed the icon cache for `names` in one batched request DURING render — before the\n * `<Icon>` cells that consume them mount — so those cells dedupe onto the single\n * batch instead of each firing their own request (the fan-out {@link prewarmIcons}\n * exists to prevent). An effect can't do this: child effects run before the\n * parent's, losing the race.\n *\n * Shared by every site that renders many icons at once (picker grid, sidebar, nav\n * editor). A prev-tracker ref fires the seed once per distinct set;\n * {@link prewarmIcons} itself dedupes, no-ops when warm, and is browser-only. Pass\n * `enabled=false` to skip while a set isn't visible yet (e.g. a closed dialog).\n */\nexport function usePrewarmIcons(names: readonly string[], enabled = true): void {\n const seededKeyRef = useRef('')\n const key = names.join(',')\n if (enabled && key && seededKeyRef.current !== key) {\n seededKeyRef.current = key\n void prewarmIcons(names)\n }\n}\n\nlet namesPromise: Promise<readonly string[]> | null = null\n\n/** Fetch the full icon-name list (for pickers). Cached for the session. */\nexport function fetchIconNames(): Promise<readonly string[]> {\n if (!namesPromise) {\n namesPromise = fetch(endpoint)\n .then((r) => (r.ok ? (r.json() as Promise<readonly string[]>) : []))\n .catch(() => [])\n }\n return namesPromise\n}\n\nexport interface IconProps {\n /** Lucide kebab-case name (e.g. `panel-left`). Unknown/empty → renders nothing. */\n name?: string | null | undefined\n /** Sizing class applied to the wrapper (e.g. `h-4 w-4`). The SVG fills it. */\n className?: string | undefined\n /** Explicit pixel size (alternative to `className`). */\n size?: number | undefined\n}\n\nexport function Icon({ name, className, size }: IconProps): React.ReactElement | null {\n // Always start `null` so the server render and the client's FIRST render match\n // (the SVG is client-fetched data the server doesn't have — seeding from the\n // cache here causes a hydration mismatch). The effect populates it immediately\n // on a cache hit, or after the fetch.\n const [svg, setSvg] = useState<string | null>(null)\n\n // External-resource fetch (the sanctioned useEffect use): load the SVG on\n // demand, ignore the result if the name changed / unmounted before it lands.\n useEffect(() => {\n if (!name) {\n setSvg(null)\n return\n }\n const hit = cache.get(name)\n if (typeof hit === 'string' || hit === null) {\n setSvg(hit)\n return\n }\n let active = true\n fetchIconSvg(name).then((s) => {\n if (active) setSvg(s)\n })\n return () => {\n active = false\n }\n }, [name])\n\n // Memoize the dangerouslySetInnerHTML object — a fresh object identity on every\n // render makes React 19 re-apply innerHTML each time (PR #621 gotcha).\n const html = useMemo(() => (svg ? { __html: svg } : null), [svg])\n if (!html) return null\n\n return (\n <span\n className={className}\n style={{\n display: 'inline-flex',\n lineHeight: 0,\n ...(size != null ? { width: size, height: size } : {}),\n }}\n // biome-ignore lint/security/noDangerouslySetInnerHtml: SVG is from our own first-party icon endpoint (lucide data), not user input.\n dangerouslySetInnerHTML={html}\n aria-hidden=\"true\"\n />\n )\n}\n","'use client'\n\n/**\n * `<IconPicker>` — a searchable Lucide icon browser (plan/config SD003).\n *\n * On-demand by construction: the name list is fetched once when the dialog first\n * opens (not per mount — there can be many pickers on a page), search filters the\n * names client-side (just strings), and each visible cell renders `<Icon>`, which\n * fetches that one SVG on demand + caches it. No icon code/data ships in the\n * bundle; opening the picker never loads the whole set.\n *\n * Results are capped ({@link MAX_RESULTS}) so a broad query renders a bounded grid\n * — type to narrow. (Virtualized windowing is a future enhancement; the cap keeps\n * the request count + DOM bounded for v1.)\n */\n\nimport { forwardRef, useEffect, useId, useMemo, useState } from 'react'\nimport { Button } from './button'\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from './dialog'\nimport { fetchIconNames, Icon, usePrewarmIcons } from './icon'\nimport { Input } from './input'\nimport { cn } from './lib/cn'\n\nconst MAX_RESULTS = 90\n\nexport interface IconPickerProps {\n /** Current Lucide icon name, or empty. */\n value?: string | null | undefined\n /** Called with the chosen name, or `undefined` when cleared. */\n onChange: (name: string | undefined) => void\n /** Trigger text when no icon is selected. Default \"Pick icon\". */\n placeholder?: string\n /** Extra classes for the trigger button. */\n className?: string\n /** Disable the trigger. */\n disabled?: boolean\n /**\n * a11y props a form wrapper (e.g. shadcn `FormControl`) injects into the\n * trigger so the field stays linked to its label + validation message.\n */\n id?: string\n 'aria-describedby'?: string\n 'aria-invalid'?: React.AriaAttributes['aria-invalid']\n}\n\nexport const IconPicker = forwardRef<HTMLButtonElement, IconPickerProps>(function IconPicker(\n { value, onChange, placeholder = 'Pick icon', className, disabled, id, ...aria },\n ref,\n) {\n const [open, setOpen] = useState(false)\n const [query, setQuery] = useState('')\n const [names, setNames] = useState<readonly string[]>([])\n const [loading, setLoading] = useState(false)\n const searchId = useId()\n\n // Load the name list the first time the dialog opens (cached module-wide, so\n // multiple pickers share one request). Fetch is the sanctioned useEffect use.\n useEffect(() => {\n if (!open || names.length > 0) return\n let active = true\n setLoading(true)\n fetchIconNames().then((list) => {\n if (active) {\n setNames(list)\n setLoading(false)\n }\n })\n return () => {\n active = false\n }\n }, [open, names.length])\n\n const results = useMemo(() => {\n const needle = query.trim().toLowerCase()\n const matches = needle ? names.filter((n) => n.includes(needle)) : names\n return { shown: matches.slice(0, MAX_RESULTS), total: matches.length }\n }, [query, names])\n\n // Fetch the whole visible page in ONE batched request before the grid's `<Icon>`\n // cells mount, so they dedupe onto it instead of each firing their own — the\n // ≤90-cell burst that reads as a scan to WAFs like CrowdSec (the no-fan-out rule).\n // Only while the dialog is open (the grid isn't mounted otherwise).\n usePrewarmIcons(results.shown, open)\n\n const select = (name: string | undefined) => {\n onChange(name)\n setOpen(false)\n setQuery('')\n }\n\n return (\n <>\n {/* Fixed-width icon-only trigger: showing the variable-length icon NAME made\n rows ragged. The icon itself is the affordance; the name lives in the\n dialog + the tooltip. */}\n <Button\n ref={ref}\n id={id}\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n disabled={disabled}\n onClick={() => setOpen(true)}\n title={value ?? placeholder}\n aria-label={value ? `Icon: ${value}` : placeholder}\n className={className}\n {...aria}\n >\n {value ? (\n <Icon name={value} size={16} />\n ) : (\n <span aria-hidden className=\"text-base leading-none text-muted-foreground\">\n +\n </span>\n )}\n </Button>\n\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent className=\"max-w-lg\">\n <DialogHeader>\n <DialogTitle>Choose an icon</DialogTitle>\n </DialogHeader>\n {/* Placeholder text is not a reliable accessible name — give the\n search field a real label linked via `searchId`. */}\n <label htmlFor={searchId} className=\"sr-only\">\n Search icons\n </label>\n <Input\n id={searchId}\n autoFocus\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder=\"Search icons…\"\n />\n <div className=\"grid max-h-72 grid-cols-8 gap-1 overflow-auto p-0.5\">\n <button\n type=\"button\"\n title=\"No icon\"\n aria-label=\"No icon\"\n onClick={() => select(undefined)}\n className={cn(\n 'flex aspect-square items-center justify-center rounded-md border border-border text-[10px] text-muted-foreground hover:bg-accent',\n !value && 'ring-2 ring-ring',\n )}\n >\n none\n </button>\n {results.shown.map((name) => (\n <button\n key={name}\n type=\"button\"\n title={name}\n aria-label={name}\n onClick={() => select(name)}\n className={cn(\n 'flex aspect-square items-center justify-center rounded-md border border-transparent hover:bg-accent hover:border-border',\n name === value && 'ring-2 ring-ring',\n )}\n >\n <Icon name={name} size={18} />\n </button>\n ))}\n </div>\n <div className=\"text-xs text-muted-foreground\">\n {loading\n ? 'Loading icons…'\n : query\n ? `${results.total} match${results.total === 1 ? '' : 'es'}${\n results.total > MAX_RESULTS ? ` (showing ${MAX_RESULTS})` : ''\n }`\n : `${names.length} icons — type to search`}\n </div>\n </DialogContent>\n </Dialog>\n </>\n )\n})\n","import * as PopoverPrimitive from '@radix-ui/react-popover'\nimport { type ComponentPropsWithoutRef, forwardRef } from 'react'\nimport { cn } from './lib/cn'\n\nexport const Popover = PopoverPrimitive.Root\nexport const PopoverTrigger = PopoverPrimitive.Trigger\nexport const PopoverAnchor = PopoverPrimitive.Anchor\nexport const PopoverClose = PopoverPrimitive.Close\n\nexport const PopoverContent = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2',\n 'data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n","import { forwardRef, type SelectHTMLAttributes } from 'react'\nimport { cn } from './lib/cn'\n\nexport const Select = forwardRef<HTMLSelectElement, SelectHTMLAttributes<HTMLSelectElement>>(\n ({ className, children, ...props }, ref) => {\n return (\n <select\n ref={ref}\n className={cn(\n 'flex h-9 w-full rounded-md border border-input bg-background text-foreground px-3 py-1 text-sm shadow-xs',\n 'transition-colors',\n 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n {children}\n </select>\n )\n },\n)\n\nSelect.displayName = 'Select'\n","import * as SeparatorPrimitive from '@radix-ui/react-separator'\nimport { type ComponentPropsWithoutRef, forwardRef } from 'react'\nimport { cn } from './lib/cn'\n\nexport const Separator = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\n className,\n )}\n {...props}\n />\n))\n\nSeparator.displayName = 'Separator'\n","import type { HTMLAttributes } from 'react'\nimport { cn } from './lib/cn'\n\nexport function Skeleton({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('animate-pulse rounded-md bg-muted', className)} {...props} />\n}\n","/**\n * Toast notifications — wraps sonner with toolkit token styling.\n *\n * Usage:\n * import { Toaster, toast } from '@murumets-ee/ui'\n *\n * // In layout (once):\n * <Toaster />\n *\n * // Anywhere:\n * toast.success('Saved')\n * toast.error('Cannot delete: referenced by article')\n *\n * Consumer-provided `toastOptions.style` and `toastOptions.classNames` are\n * deep-merged with the toolkit defaults — overriding `error` doesn't drop\n * the `success` className, and overriding `background` doesn't drop the\n * border / color.\n */\n\nimport type { ComponentProps } from 'react'\nimport { Toaster as SonnerToaster, toast } from 'sonner'\n\nconst DEFAULT_STYLE = {\n background: 'var(--color-background)',\n color: 'var(--color-foreground)',\n border: '1px solid var(--color-border)',\n}\n\nconst DEFAULT_CLASS_NAMES = {\n error: 'sonner-error',\n success: 'sonner-success',\n}\n\nfunction Toaster({ toastOptions, ...props }: ComponentProps<typeof SonnerToaster>) {\n return (\n <SonnerToaster\n position=\"bottom-right\"\n {...props}\n toastOptions={{\n ...toastOptions,\n style: { ...DEFAULT_STYLE, ...toastOptions?.style },\n classNames: { ...DEFAULT_CLASS_NAMES, ...toastOptions?.classNames },\n }}\n />\n )\n}\n\nexport { Toaster, toast }\n","import { forwardRef, type TextareaHTMLAttributes } from 'react'\nimport { cn } from './lib/cn'\n\nexport const Textarea = forwardRef<\n HTMLTextAreaElement,\n TextareaHTMLAttributes<HTMLTextAreaElement>\n>(({ className, ...props }, ref) => {\n return (\n <textarea\n ref={ref}\n className={cn(\n 'flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs',\n 'placeholder:text-muted-foreground',\n 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n )\n})\n\nTextarea.displayName = 'Textarea'\n"],"mappings":";iuCAGA,SAAgB,EAAG,GAAG,EAAsB,CAC1C,OAAO,EAAQ,EAAK,CAAM,CAAC,CAC7B,CCEA,MAAMA,GAAqE,CACzE,QAAS,kEACT,UAAW,4DACX,YAAa,0EACb,QAAS,iBACX,EAEA,SAAgB,GAAM,CAAE,YAAW,UAAU,UAAW,GAAG,GAAqB,CAC9E,OACE,EAAC,MAAD,CACE,UAAW,EACT,iFACA,wFACAA,GAAe,GACf,CACF,EACA,GAAI,CACL,CAAA,CAEL,CCdA,MAAM,GAAsE,CAC1E,QAAS,mEACT,YAAa,+EACb,QACE,2FACF,UAAW,yEACX,MAAO,+CACP,KAAM,iDACR,EAEM,GAAgE,CACpE,QAAS,gBACT,GAAI,8BACJ,GAAI,uBACJ,KAAM,SACR,EAEa,EAAS,GAElB,CACE,YACA,UAAU,UACV,OAAO,UACP,UAAU,GACV,UAAU,GACV,WACA,WACA,OAAO,SACP,GAAG,GAEL,IACG,CACH,IAAM,EAAU,EACd,iGACA,mCACA,0EACA,mDACA,+CACA,GAAe,GACf,GAAY,GACZ,CACF,EAUA,OARI,EAEA,EAAC,EAAD,CAAW,MAAK,UAAW,EAAS,GAAI,EACrC,UACG,CAAA,EAKR,EAAC,SAAD,CAAa,MAAK,SAAU,G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