@aivex/ui 1.2.0-dev.35 → 1.2.0-dev.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +68 -0
  2. package/dist/{Button-DLfTdKpW.js → Button-CuvXiYtX.js} +1381 -1436
  3. package/dist/Button-CuvXiYtX.js.map +1 -0
  4. package/dist/Button-DXf0LWOC.cjs +2 -0
  5. package/dist/Button-DXf0LWOC.cjs.map +1 -0
  6. package/dist/IconButton-CrrS0BMg.cjs +2 -0
  7. package/dist/{IconButton-CfbfwHu2.cjs.map → IconButton-CrrS0BMg.cjs.map} +1 -1
  8. package/dist/{IconButton-CQG1Pw51.js → IconButton-DusjiWye.js} +14 -13
  9. package/dist/{IconButton-CQG1Pw51.js.map → IconButton-DusjiWye.js.map} +1 -1
  10. package/dist/comment.cjs +1 -1
  11. package/dist/comment.cjs.map +1 -1
  12. package/dist/comment.js +51 -41
  13. package/dist/comment.js.map +1 -1
  14. package/dist/components/Calendar/Calendar.d.ts +13 -2
  15. package/dist/components/Calendar/Calendar.test.d.ts +1 -0
  16. package/dist/components/Calendar/date.d.ts +2 -2
  17. package/dist/components/Calendar/date.test.d.ts +1 -0
  18. package/dist/components/Calendar/index.d.ts +1 -1
  19. package/dist/components/Drawer/Drawer.d.ts +2 -1
  20. package/dist/components/ShapeEditor/_components/SettingsPanel.d.ts +1 -2
  21. package/dist/components/ShapeEditor/_model/strings.d.ts +1 -0
  22. package/dist/components/ShapeEditor/_renderers/types.d.ts +2 -1
  23. package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +0 -1
  24. package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.ts +4 -4
  25. package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.ts +9 -0
  26. package/dist/components/ShapeEditor/_state/useSelectionActions.d.ts +1 -1
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +1351 -1389
  31. package/dist/index.js.map +1 -1
  32. package/dist/keyboard-9B-R6uN0.cjs +2 -0
  33. package/dist/keyboard-9B-R6uN0.cjs.map +1 -0
  34. package/dist/{Switch-D7Dzld4x.js → keyboard-DUqwZll5.js} +178 -105
  35. package/dist/keyboard-DUqwZll5.js.map +1 -0
  36. package/dist/shape-editor.cjs +1 -1
  37. package/dist/shape-editor.cjs.map +1 -1
  38. package/dist/shape-editor.js +1549 -1554
  39. package/dist/shape-editor.js.map +1 -1
  40. package/dist/styles.css +1 -1
  41. package/dist/utils/keyboard.d.ts +3 -0
  42. package/dist/utils/useModalAutoFocus.d.ts +5 -0
  43. package/dist/utils.cjs +2 -0
  44. package/dist/utils.cjs.map +1 -0
  45. package/dist/utils.js +59 -0
  46. package/dist/utils.js.map +1 -0
  47. package/package.json +20 -22
  48. package/dist/Button-BcJuLWuX.cjs +0 -2
  49. package/dist/Button-BcJuLWuX.cjs.map +0 -1
  50. package/dist/Button-DLfTdKpW.js.map +0 -1
  51. package/dist/IconButton-CfbfwHu2.cjs +0 -2
  52. package/dist/Switch-BTWZAzgl.cjs +0 -2
  53. package/dist/Switch-BTWZAzgl.cjs.map +0 -1
  54. package/dist/Switch-D7Dzld4x.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ const e=require(`./Button-DXf0LWOC.cjs`),t=require(`./utils.cjs`);let n=require(`class-variance-authority`),r=require(`react/jsx-runtime`),i=require(`@radix-ui/react-dropdown-menu`);i=e.pa(i,1);let a=require(`react`),o=require(`@radix-ui/react-popover`);o=e.pa(o,1);let s=require(`@radix-ui/react-slider`);s=e.pa(s,1);let c=require(`@radix-ui/react-switch`);c=e.pa(c,1);var l=(0,n.cva)(`aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:w-full aivex:items-center aivex:gap-md aivex:px-md aivex:py-sm aivex:text-label-lg aivex:rounded-md aivex:transition-colors aivex:cursor-pointer aivex:select-none aivex:outline-none aivex:data-[disabled]:opacity-disable aivex:data-[disabled]:pointer-events-none`,{variants:{danger:{true:`aivex:text-text-danger`,false:`aivex:text-text-primary`}},defaultVariants:{danger:!1}}),u=t.cn(`aivex:flex aivex:flex-col aivex:rounded-md aivex:bg-bg-primary aivex:p-md aivex:overflow-clip`,`aivex:shadow-md aivex:border aivex:border-border-subtle aivex:min-w-[160px]`,`aivex:z-50 aivex:outline-none`,`aivex:data-[state=open]:animate-in aivex:data-[state=closed]:animate-out`,`aivex:data-[state=closed]:fade-out-0 aivex:data-[state=open]:fade-in-0`,`aivex:data-[state=closed]:zoom-out-95 aivex:data-[state=open]:zoom-in-95`);function d(e){return(0,r.jsx)(i.Root,{...e})}function f({ref:e,...t}){return(0,r.jsx)(i.Trigger,{ref:e,...t})}function p({className:e,sideOffset:n=4,ref:a,...o}){return(0,r.jsx)(i.Portal,{children:(0,r.jsx)(i.Content,{ref:a,sideOffset:n,className:t.cn(u,e),...o})})}function m({className:e,ref:n,...a}){return(0,r.jsx)(i.Group,{ref:n,className:t.cn(`aivex:flex aivex:flex-col`,e),...a})}function h({className:e,ref:n,...a}){return(0,r.jsx)(i.Separator,{ref:n,className:t.cn(`aivex:h-px aivex:bg-border-subtle aivex:w-full aivex:my-xs`,e),...a})}function g({className:e,ref:n,...a}){return(0,r.jsx)(i.Label,{ref:n,className:t.cn(`aivex:px-md aivex:py-2xs aivex:text-label-md aivex:text-text-tertiary aivex:select-none`,e),...a})}function _({className:n,label:a,icon:o,danger:s=!1,asChild:c,children:u,ref:d,...f}){if(c)return(0,r.jsx)(i.Item,{ref:d,asChild:!0,className:t.cn(l({danger:s}),n),...f,children:u});let p=a??u;return(0,r.jsxs)(i.Item,{ref:d,className:t.cn(l({danger:s}),n),...f,children:[(0,r.jsx)(e.fa,{variant:s?`danger`:`default`}),o&&(0,r.jsx)(`span`,{className:t.cn(`aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0`,s?`aivex:text-icon-danger`:`aivex:text-icon-secondary`),children:o}),(0,r.jsx)(`span`,{className:`aivex:flex-1 aivex:min-w-0 aivex:truncate aivex:text-left`,children:p})]})}function v({className:n,label:a,icon:o,children:s,ref:c,...u}){let d=a??s;return(0,r.jsxs)(i.CheckboxItem,{ref:c,className:t.cn(l(),n),...u,children:[(0,r.jsx)(e.fa,{variant:`default`}),(0,r.jsx)(T,{children:(0,r.jsx)(i.ItemIndicator,{children:(0,r.jsx)(e.dt,{size:20})})}),o&&(0,r.jsx)(`span`,{className:`aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary`,children:o}),(0,r.jsx)(`span`,{className:`aivex:flex-1 aivex:min-w-0 aivex:truncate aivex:text-left`,children:d})]})}function y({className:e,ref:n,...a}){return(0,r.jsx)(i.RadioGroup,{ref:n,className:t.cn(`aivex:flex aivex:flex-col`,e),...a})}function b({className:n,label:a,icon:o,children:s,ref:c,...u}){let d=a??s;return(0,r.jsxs)(i.RadioItem,{ref:c,className:t.cn(l(),n),...u,children:[(0,r.jsx)(e.fa,{variant:`default`}),(0,r.jsx)(T,{children:(0,r.jsx)(i.ItemIndicator,{children:(0,r.jsx)(e.dt,{size:20})})}),o&&(0,r.jsx)(`span`,{className:`aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary`,children:o}),(0,r.jsx)(`span`,{className:`aivex:flex-1 aivex:min-w-0 aivex:truncate aivex:text-left`,children:d})]})}function x({className:e,ref:n,...i}){return(0,r.jsx)(`span`,{ref:n,className:t.cn(`aivex:inline-flex aivex:items-center aivex:justify-center aivex:min-h-5 aivex:min-w-5 aivex:px-2xs aivex:rounded-xs aivex:border aivex:border-border-subtle aivex:text-label-md aivex:text-text-tertiary aivex:ml-auto`,e),...i})}function S(e){return(0,r.jsx)(i.Sub,{...e})}function C({className:n,label:a,icon:o,children:s,ref:c,...u}){let d=a??s;return(0,r.jsxs)(i.SubTrigger,{ref:c,className:t.cn(l(),n),...u,children:[(0,r.jsx)(e.fa,{variant:`default`}),o&&(0,r.jsx)(`span`,{className:`aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary`,children:o}),(0,r.jsx)(`span`,{className:`aivex:flex-1 aivex:min-w-0 aivex:truncate aivex:text-left`,children:d}),(0,r.jsx)(`span`,{className:`aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary`,children:(0,r.jsx)(e.Wt,{size:16})})]})}function w({className:e,sideOffset:n=4,ref:a,...o}){return(0,r.jsx)(i.Portal,{children:(0,r.jsx)(i.SubContent,{ref:a,sideOffset:n,className:t.cn(u,e),...o})})}function T({children:e}){return(0,r.jsx)(`span`,{"aria-hidden":!0,className:`aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:w-5 aivex:h-5 aivex:text-icon-primary`,children:e})}var E=Object.assign(d,{Trigger:f,Content:p,Item:_,Group:m,Separator:h,Label:g,CheckboxItem:v,RadioGroup:y,RadioItem:b,Sub:S,SubTrigger:C,SubContent:w,Shortcut:x}),D=t.cn(`aivex:flex aivex:flex-col aivex:gap-lg aivex:w-[277px] aivex:max-h-[448px] aivex:p-xl`,`aivex:bg-bg-primary aivex:border aivex:border-border-subtle aivex:rounded-xl aivex:shadow-md aivex:overflow-clip`,`aivex:z-50 aivex:outline-none`,`aivex:data-[state=open]:animate-in aivex:data-[state=closed]:animate-out`,`aivex:data-[state=closed]:fade-out-0 aivex:data-[state=open]:fade-in-0`,`aivex:data-[state=closed]:zoom-out-95 aivex:data-[state=open]:zoom-in-95`);function O(e){return(0,r.jsx)(o.Root,{...e})}function k({ref:e,...t}){return(0,r.jsx)(o.Trigger,{ref:e,...t})}function A(e){return(0,r.jsx)(o.Anchor,{...e})}function j({ref:e,...t}){return(0,r.jsx)(o.Close,{ref:e,...t})}function M({className:e,sideOffset:n=8,align:i=`start`,ref:a,...s}){return(0,r.jsx)(o.Portal,{children:(0,r.jsx)(o.Content,{ref:a,sideOffset:n,align:i,className:t.cn(D,e),...s})})}function N({className:e,ref:n,...i}){return(0,r.jsx)(`div`,{ref:n,className:t.cn(`aivex:w-full aivex:px-xs aivex:text-body-md-medium aivex:text-text-primary aivex:truncate`,e),...i})}function P({className:e,ref:n,...i}){return(0,r.jsx)(`div`,{ref:n,className:t.cn(`aivex:flex aivex:min-h-0 aivex:w-full aivex:flex-1 aivex:flex-col aivex:gap-md aivex:overflow-y-auto`,e),...i})}function F({className:e,start:n,children:i,ref:a,...o}){return(0,r.jsxs)(`div`,{ref:a,className:t.cn(`aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-md`,e),...o,children:[n&&(0,r.jsx)(`div`,{className:`aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:items-start aivex:justify-center`,children:n}),i]})}var I=Object.assign(O,{Trigger:k,Anchor:A,Close:j,Content:M,Title:N,Body:P,Footer:F}),L=(0,n.cva)(`aivex:shrink-0`,{variants:{strength:{basic:``,bold:``},direction:{horizontal:`aivex:w-full`,vertical:`aivex:h-full`}},compoundVariants:[{strength:`basic`,direction:`horizontal`,className:`aivex:border-t aivex:border-border-default`},{strength:`basic`,direction:`vertical`,className:`aivex:border-l aivex:border-border-default`},{strength:`bold`,direction:`horizontal`,className:`aivex:border-t-2 aivex:border-border-subtle`},{strength:`bold`,direction:`vertical`,className:`aivex:border-l-2 aivex:border-border-subtle`}],defaultVariants:{strength:`basic`,direction:`horizontal`}});function R({className:e,strength:n,direction:i,ref:a,...o}){return(0,r.jsx)(`hr`,{ref:a,"aria-orientation":i===`vertical`?`vertical`:`horizontal`,className:t.cn(L({strength:n,direction:i}),e),...o})}function z({className:e,trackClassName:n,trackRootClassName:i,thumbClassName:o,defaultValue:c=[50],value:l,min:u=0,max:d=100,step:f=1,onValueChange:p,ref:m,...h}){let g=l!==void 0,[_,v]=(0,a.useState)(c),y=g?l:_,b=e=>{g||v(e),p?.(e)},x=(0,a.useMemo)(()=>{let e=d-u||1;return[...y].sort((e,t)=>e-t).map(t=>(t-u)/e*100)},[y,u,d]),S=(0,a.useMemo)(()=>{let e=[0,...x,100];return e.slice(0,-1).map((t,n)=>({left:t,width:e[n+1]-t}))},[x]);return(0,r.jsxs)(s.Root,{ref:m,className:t.cn(`aivex:relative aivex:flex aivex:w-full aivex:touch-none aivex:select-none aivex:items-center aivex:outline-none`,`aivex:data-[disabled]:pointer-events-none aivex:data-[disabled]:opacity-disable`,e),defaultValue:c,value:l,min:u,max:d,step:f,onValueChange:b,...h,children:[(0,r.jsx)(s.Track,{className:t.cn(`aivex:relative aivex:h-2 aivex:w-full aivex:grow aivex:overflow-hidden aivex:rounded-full aivex:bg-bg-tertiary`,i),children:S.map(({left:e,width:i},a)=>{let o=a===+(x.length>=2)?`aivex:bg-bg-brand`:`aivex:bg-bg-tertiary`;return(0,r.jsx)(`div`,{className:t.cn(`aivex:absolute aivex:top-0 aivex:h-full aivex:rounded-full`,typeof n==`string`?n:n?.(a)??o),style:{left:`${e}%`,width:`${i}%`}},a)})}),y.map((e,n)=>(0,r.jsx)(s.Thumb,{className:t.cn(`aivex:z-10 aivex:block aivex:h-6 aivex:w-6 aivex:box-border aivex:rounded-full aivex:border-2 aivex:border-border-brand aivex:bg-bg-primary aivex:shadow-sm`,`aivex:cursor-pointer aivex:transition-transform aivex:hover:scale-110`,`aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand`,`aivex:disabled:pointer-events-none`,typeof o==`string`?o:o?.(n))},n))]})}var B=(0,n.cva)(`aivex:relative aivex:inline-flex aivex:shrink-0 aivex:items-center aivex:rounded-full aivex:transition-colors aivex:duration-200 aivex:cursor-pointer aivex:bg-bg-tertiary aivex:data-[state=checked]:bg-bg-brand aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand aivex:disabled:cursor-not-allowed aivex:disabled:opacity-disable`,{variants:{size:{sm:`aivex:w-6 aivex:h-4`,md:`aivex:w-8 aivex:h-5`,lg:`aivex:w-10 aivex:h-6`}},defaultVariants:{size:`md`}}),V={sm:`aivex:w-2.5 aivex:h-2.5 aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[11px]`,md:`aivex:w-3.5 aivex:h-3.5 aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[15px]`,lg:`aivex:w-[18px] aivex:h-[18px] aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[19px]`},H={sm:`aivex:h-4`,md:`aivex:h-5`,lg:`aivex:h-6`};function U({className:e,label:n,size:i=`md`,disabled:o,id:s,ref:l,...u}){let d=i??`md`,f=(0,a.useId)(),p=s??f;return(0,r.jsxs)(`span`,{className:t.cn(`aivex:inline-flex aivex:items-center aivex:gap-md`,o&&`aivex:opacity-disable`),children:[(0,r.jsx)(c.Root,{ref:l,id:p,disabled:o,className:t.cn(B({size:d}),e),...u,children:(0,r.jsx)(c.Thumb,{className:t.cn(`aivex:block aivex:rounded-full aivex:bg-white aivex:shadow-[var(--aivex-elevation-sm)] aivex:transition-transform aivex:duration-200 aivex:will-change-transform`,V[d])})}),n&&(0,r.jsx)(`label`,{htmlFor:p,className:t.cn(`aivex:inline-flex aivex:items-center aivex:cursor-pointer aivex:select-none aivex:text-label-lg aivex:text-text-primary`,o&&`aivex:cursor-not-allowed`,H[d]),children:n})]})}function W(e,t){if(!e||!(t instanceof Element)||!e.contains(t))return!1;let n=t.closest(`[role="dialog"],[role="alertdialog"],[role="menu"],[role="listbox"]`);return!n||n.contains(e)}function G(e){return e instanceof HTMLElement?e.isContentEditable||!!e.closest(`input,textarea,select,[role="textbox"]`):!1}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return G}});
2
+ //# sourceMappingURL=keyboard-9B-R6uN0.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboard-9B-R6uN0.cjs","names":[],"sources":["../src/components/Menu/Menu.tsx","../src/components/Popover/Popover.tsx","../src/components/Divider/Divider.tsx","../src/components/Slider/Slider.tsx","../src/components/Switch/Switch.tsx","../src/utils/keyboard.ts"],"sourcesContent":["\"use client\";\n\nimport * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport { cva } from \"class-variance-authority\";\nimport type { ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\nimport { CheckIcon, DirectionRightIcon } from \"@/components/Icon\";\nimport { InteractionLayer } from \"@/components/InteractionLayer\";\nimport { cn } from \"@/utils/cn\";\n\n// ─── menuItemVariants ─────────────────────────────────────────────────────────\n\nconst menuItemVariants = cva(\n \"aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:w-full aivex:items-center aivex:gap-md aivex:px-md aivex:py-sm aivex:text-label-lg aivex:rounded-md aivex:transition-colors aivex:cursor-pointer aivex:select-none aivex:outline-none aivex:data-[disabled]:opacity-disable aivex:data-[disabled]:pointer-events-none\",\n {\n variants: {\n danger: {\n true: \"aivex:text-text-danger\",\n false: \"aivex:text-text-primary\",\n },\n },\n defaultVariants: {\n danger: false,\n },\n },\n);\n\nconst contentClassName = cn(\n \"aivex:flex aivex:flex-col aivex:rounded-md aivex:bg-bg-primary aivex:p-md aivex:overflow-clip\",\n \"aivex:shadow-md aivex:border aivex:border-border-subtle aivex:min-w-[160px]\",\n \"aivex:z-50 aivex:outline-none\",\n \"aivex:data-[state=open]:animate-in aivex:data-[state=closed]:animate-out\",\n \"aivex:data-[state=closed]:fade-out-0 aivex:data-[state=open]:fade-in-0\",\n \"aivex:data-[state=closed]:zoom-out-95 aivex:data-[state=open]:zoom-in-95\",\n);\n\n// ─── Root ─────────────────────────────────────────────────────────────────────\n\ntype MenuRootProps = ComponentPropsWithoutRef<typeof DropdownMenu.Root>;\n\nfunction MenuRoot(props: MenuRootProps) {\n return <DropdownMenu.Root {...props} />;\n}\n\n// ─── Trigger ──────────────────────────────────────────────────────────────────\n\ntype MenuTriggerProps = ComponentPropsWithoutRef<typeof DropdownMenu.Trigger> & {\n ref?: Ref<HTMLButtonElement>;\n};\n\nfunction MenuTrigger({ ref, ...props }: MenuTriggerProps) {\n return <DropdownMenu.Trigger ref={ref} {...props} />;\n}\n\n// ─── Content ──────────────────────────────────────────────────────────────────\n\ntype MenuContentProps = ComponentPropsWithoutRef<typeof DropdownMenu.Content> & {\n ref?: Ref<HTMLDivElement>;\n};\n\nfunction MenuContent({ className, sideOffset = 4, ref, ...props }: MenuContentProps) {\n return (\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(contentClassName, className)}\n {...props}\n />\n </DropdownMenu.Portal>\n );\n}\n\n// ─── Group ────────────────────────────────────────────────────────────────────\n\ntype MenuGroupProps = ComponentPropsWithoutRef<typeof DropdownMenu.Group> & {\n ref?: Ref<HTMLDivElement>;\n};\n\nfunction MenuGroup({ className, ref, ...props }: MenuGroupProps) {\n return (\n <DropdownMenu.Group\n ref={ref}\n className={cn(\"aivex:flex aivex:flex-col\", className)}\n {...props}\n />\n );\n}\n\n// ─── Separator ────────────────────────────────────────────────────────────────\n\ntype MenuSeparatorProps = ComponentPropsWithoutRef<typeof DropdownMenu.Separator> & {\n ref?: Ref<HTMLDivElement>;\n};\n\nfunction MenuSeparator({ className, ref, ...props }: MenuSeparatorProps) {\n return (\n <DropdownMenu.Separator\n ref={ref}\n className={cn(\"aivex:h-px aivex:bg-border-subtle aivex:w-full aivex:my-xs\", className)}\n {...props}\n />\n );\n}\n\n// ─── Label ────────────────────────────────────────────────────────────────────\n\ntype MenuLabelProps = ComponentPropsWithoutRef<typeof DropdownMenu.Label> & {\n ref?: Ref<HTMLDivElement>;\n};\n\nfunction MenuLabel({ className, ref, ...props }: MenuLabelProps) {\n return (\n <DropdownMenu.Label\n ref={ref}\n className={cn(\n \"aivex:px-md aivex:py-2xs aivex:text-label-md aivex:text-text-tertiary aivex:select-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\n// ─── Item ─────────────────────────────────────────────────────────────────────\n\ninterface MenuItemProps\n extends Omit<ComponentPropsWithoutRef<typeof DropdownMenu.Item>, \"children\"> {\n /** label/icon으로 렌더할 때 사용. asChild 모드에선 무시 */\n label?: ReactNode;\n icon?: ReactNode;\n danger?: boolean;\n /** Radix asChild — 자식 컴포넌트(Link 등)에 메뉴 동작/스타일 위임 */\n asChild?: boolean;\n children?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction MenuItem({\n className,\n label,\n icon,\n danger = false,\n asChild,\n children,\n ref,\n ...props\n}: MenuItemProps) {\n if (asChild) {\n return (\n <DropdownMenu.Item\n ref={ref}\n asChild\n className={cn(menuItemVariants({ danger }), className)}\n {...props}\n >\n {children}\n </DropdownMenu.Item>\n );\n }\n const content = label ?? children;\n return (\n <DropdownMenu.Item ref={ref} className={cn(menuItemVariants({ danger }), className)} {...props}>\n <InteractionLayer variant={danger ? \"danger\" : \"default\"} />\n {icon && (\n <span\n className={cn(\n \"aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0\",\n danger ? \"aivex:text-icon-danger\" : \"aivex:text-icon-secondary\",\n )}\n >\n {icon}\n </span>\n )}\n <span className=\"aivex:flex-1 aivex:min-w-0 aivex:truncate aivex:text-left\">{content}</span>\n </DropdownMenu.Item>\n );\n}\n\n// ─── CheckboxItem ─────────────────────────────────────────────────────────────\n\ninterface MenuCheckboxItemProps extends ComponentPropsWithoutRef<typeof DropdownMenu.CheckboxItem> {\n label?: ReactNode;\n icon?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction MenuCheckboxItem({\n className,\n label,\n icon,\n children,\n ref,\n ...props\n}: MenuCheckboxItemProps) {\n const content = label ?? children;\n return (\n <DropdownMenu.CheckboxItem ref={ref} className={cn(menuItemVariants(), className)} {...props}>\n <InteractionLayer variant=\"default\" />\n <CheckSlot>\n <DropdownMenu.ItemIndicator>\n <CheckIcon size={20} />\n </DropdownMenu.ItemIndicator>\n </CheckSlot>\n {icon && (\n <span className=\"aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary\">\n {icon}\n </span>\n )}\n <span className=\"aivex:flex-1 aivex:min-w-0 aivex:truncate aivex:text-left\">{content}</span>\n </DropdownMenu.CheckboxItem>\n );\n}\n\n// ─── RadioGroup ───────────────────────────────────────────────────────────────\n\ntype MenuRadioGroupProps = ComponentPropsWithoutRef<typeof DropdownMenu.RadioGroup> & {\n ref?: Ref<HTMLDivElement>;\n};\n\nfunction MenuRadioGroup({ className, ref, ...props }: MenuRadioGroupProps) {\n return (\n <DropdownMenu.RadioGroup\n ref={ref}\n className={cn(\"aivex:flex aivex:flex-col\", className)}\n {...props}\n />\n );\n}\n\n// ─── RadioItem ────────────────────────────────────────────────────────────────\n\ninterface MenuRadioItemProps extends ComponentPropsWithoutRef<typeof DropdownMenu.RadioItem> {\n label?: ReactNode;\n icon?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction MenuRadioItem({ className, label, icon, children, ref, ...props }: MenuRadioItemProps) {\n const content = label ?? children;\n return (\n <DropdownMenu.RadioItem ref={ref} className={cn(menuItemVariants(), className)} {...props}>\n <InteractionLayer variant=\"default\" />\n <CheckSlot>\n <DropdownMenu.ItemIndicator>\n <CheckIcon size={20} />\n </DropdownMenu.ItemIndicator>\n </CheckSlot>\n {icon && (\n <span className=\"aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary\">\n {icon}\n </span>\n )}\n <span className=\"aivex:flex-1 aivex:min-w-0 aivex:truncate aivex:text-left\">{content}</span>\n </DropdownMenu.RadioItem>\n );\n}\n\n// ─── Shortcut ─────────────────────────────────────────────────────────────────\n\ntype MenuShortcutProps = ComponentPropsWithoutRef<\"span\"> & {\n ref?: Ref<HTMLSpanElement>;\n};\n\nfunction MenuShortcut({ className, ref, ...props }: MenuShortcutProps) {\n return (\n <span\n ref={ref}\n className={cn(\n \"aivex:inline-flex aivex:items-center aivex:justify-center aivex:min-h-5 aivex:min-w-5 aivex:px-2xs aivex:rounded-xs aivex:border aivex:border-border-subtle aivex:text-label-md aivex:text-text-tertiary aivex:ml-auto\",\n className,\n )}\n {...props}\n />\n );\n}\n\n// ─── Sub ──────────────────────────────────────────────────────────────────────\n\ntype MenuSubProps = ComponentPropsWithoutRef<typeof DropdownMenu.Sub>;\n\nfunction MenuSub(props: MenuSubProps) {\n return <DropdownMenu.Sub {...props} />;\n}\n\ninterface MenuSubTriggerProps extends ComponentPropsWithoutRef<typeof DropdownMenu.SubTrigger> {\n label?: ReactNode;\n icon?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction MenuSubTrigger({ className, label, icon, children, ref, ...props }: MenuSubTriggerProps) {\n const content = label ?? children;\n return (\n <DropdownMenu.SubTrigger ref={ref} className={cn(menuItemVariants(), className)} {...props}>\n <InteractionLayer variant=\"default\" />\n {icon && (\n <span className=\"aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary\">\n {icon}\n </span>\n )}\n <span className=\"aivex:flex-1 aivex:min-w-0 aivex:truncate aivex:text-left\">{content}</span>\n <span className=\"aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary\">\n <DirectionRightIcon size={16} />\n </span>\n </DropdownMenu.SubTrigger>\n );\n}\n\ntype MenuSubContentProps = ComponentPropsWithoutRef<typeof DropdownMenu.SubContent> & {\n ref?: Ref<HTMLDivElement>;\n};\n\nfunction MenuSubContent({ className, sideOffset = 4, ref, ...props }: MenuSubContentProps) {\n return (\n <DropdownMenu.Portal>\n <DropdownMenu.SubContent\n ref={ref}\n sideOffset={sideOffset}\n className={cn(contentClassName, className)}\n {...props}\n />\n </DropdownMenu.Portal>\n );\n}\n\n// ─── Internal: CheckSlot ──────────────────────────────────────────────────────\n\n/** 체크 아이콘 자리(20px) — indicator는 활성 시에만 보이지만 자리는 항상 확보 */\nfunction CheckSlot({ children }: { children: ReactNode }) {\n return (\n <span\n aria-hidden\n className=\"aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:w-5 aivex:h-5 aivex:text-icon-primary\"\n >\n {children}\n </span>\n );\n}\n\n// ─── Compound export ──────────────────────────────────────────────────────────\n\nconst Menu = Object.assign(MenuRoot, {\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Group: MenuGroup,\n Separator: MenuSeparator,\n Label: MenuLabel,\n CheckboxItem: MenuCheckboxItem,\n RadioGroup: MenuRadioGroup,\n RadioItem: MenuRadioItem,\n Sub: MenuSub,\n SubTrigger: MenuSubTrigger,\n SubContent: MenuSubContent,\n Shortcut: MenuShortcut,\n});\n\nexport type {\n MenuCheckboxItemProps,\n MenuContentProps,\n MenuGroupProps,\n MenuItemProps,\n MenuLabelProps,\n MenuRadioGroupProps,\n MenuRadioItemProps,\n MenuRootProps,\n MenuSeparatorProps,\n MenuShortcutProps,\n MenuSubContentProps,\n MenuSubProps,\n MenuSubTriggerProps,\n MenuTriggerProps,\n};\nexport { Menu };\n","\"use client\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport type { ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\nimport { cn } from \"@/utils/cn\";\n\n// ─── Content shell ─────────────────────────────────────────────────────────────\n\nconst contentClassName = cn(\n \"aivex:flex aivex:flex-col aivex:gap-lg aivex:w-[277px] aivex:max-h-[448px] aivex:p-xl\",\n \"aivex:bg-bg-primary aivex:border aivex:border-border-subtle aivex:rounded-xl aivex:shadow-md aivex:overflow-clip\",\n \"aivex:z-50 aivex:outline-none\",\n \"aivex:data-[state=open]:animate-in aivex:data-[state=closed]:animate-out\",\n \"aivex:data-[state=closed]:fade-out-0 aivex:data-[state=open]:fade-in-0\",\n \"aivex:data-[state=closed]:zoom-out-95 aivex:data-[state=open]:zoom-in-95\",\n);\n\n// ─── Root ─────────────────────────────────────────────────────────────────────\n\ntype PopoverRootProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>;\n\nfunction PopoverRoot(props: PopoverRootProps) {\n return <PopoverPrimitive.Root {...props} />;\n}\n\n// ─── Trigger ──────────────────────────────────────────────────────────────────\n\ntype PopoverTriggerProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger> & {\n ref?: Ref<HTMLButtonElement>;\n};\n\n/** asChild로 ToggleButton 등 임의의 요소를 트리거로 사용할 수 있습니다. */\nfunction PopoverTrigger({ ref, ...props }: PopoverTriggerProps) {\n return <PopoverPrimitive.Trigger ref={ref} {...props} />;\n}\n\n// ─── Anchor ───────────────────────────────────────────────────────────────────\n\ntype PopoverAnchorProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor>;\n\n/** 트리거와 다른 요소를 기준으로 위치를 잡고 싶을 때 사용합니다. */\nfunction PopoverAnchor(props: PopoverAnchorProps) {\n return <PopoverPrimitive.Anchor {...props} />;\n}\n\n// ─── Close ────────────────────────────────────────────────────────────────────\n\ntype PopoverCloseProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Close> & {\n ref?: Ref<HTMLButtonElement>;\n};\n\n/** asChild로 감싸면 하단 버튼 클릭 시 팝오버가 닫힙니다. */\nfunction PopoverClose({ ref, ...props }: PopoverCloseProps) {\n return <PopoverPrimitive.Close ref={ref} {...props} />;\n}\n\n// ─── Content ──────────────────────────────────────────────────────────────────\n\ntype PopoverContentProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n ref?: Ref<HTMLDivElement>;\n};\n\nfunction PopoverContent({\n className,\n sideOffset = 8,\n align = \"start\",\n ref,\n ...props\n}: PopoverContentProps) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n align={align}\n className={cn(contentClassName, className)}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\n// ─── Title ────────────────────────────────────────────────────────────────────\n\ntype PopoverTitleProps = ComponentPropsWithoutRef<\"div\"> & {\n ref?: Ref<HTMLDivElement>;\n};\n\nfunction PopoverTitle({ className, ref, ...props }: PopoverTitleProps) {\n return (\n <div\n ref={ref}\n className={cn(\n \"aivex:w-full aivex:px-xs aivex:text-body-md-medium aivex:text-text-primary aivex:truncate\",\n className,\n )}\n {...props}\n />\n );\n}\n\n// ─── Body (ItemArea) ────────────────────────────────────────────────────────────\n\ntype PopoverBodyProps = ComponentPropsWithoutRef<\"div\"> & {\n ref?: Ref<HTMLDivElement>;\n};\n\n/** 검색창·목록 등 자유롭게 들어가는 스크롤 영역입니다. */\nfunction PopoverBody({ className, ref, ...props }: PopoverBodyProps) {\n return (\n <div\n ref={ref}\n className={cn(\n \"aivex:flex aivex:min-h-0 aivex:w-full aivex:flex-1 aivex:flex-col aivex:gap-md aivex:overflow-y-auto\",\n className,\n )}\n {...props}\n />\n );\n}\n\n// ─── Footer (BtnContainer) ──────────────────────────────────────────────────────\n\ninterface PopoverFooterProps extends ComponentPropsWithoutRef<\"div\"> {\n /** 좌측에 넓게 붙는 영역(예: 옵션 tertiary 버튼). 지정 시 나머지 버튼은 우측 정렬됩니다. */\n start?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction PopoverFooter({ className, start, children, ref, ...props }: PopoverFooterProps) {\n return (\n <div\n ref={ref}\n className={cn(\n \"aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-md\",\n className,\n )}\n {...props}\n >\n {start && (\n <div className=\"aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:items-start aivex:justify-center\">\n {start}\n </div>\n )}\n {children}\n </div>\n );\n}\n\n// ─── Compound export ──────────────────────────────────────────────────────────\n\nconst Popover = Object.assign(PopoverRoot, {\n Trigger: PopoverTrigger,\n Anchor: PopoverAnchor,\n Close: PopoverClose,\n Content: PopoverContent,\n Title: PopoverTitle,\n Body: PopoverBody,\n Footer: PopoverFooter,\n});\n\nexport type {\n PopoverAnchorProps,\n PopoverBodyProps,\n PopoverCloseProps,\n PopoverContentProps,\n PopoverFooterProps,\n PopoverRootProps,\n PopoverTitleProps,\n PopoverTriggerProps,\n};\nexport { Popover };\n","import { cva, type VariantProps } from \"class-variance-authority\";\nimport type { HTMLAttributes, Ref } from \"react\";\nimport { cn } from \"@/utils/cn\";\n\nconst dividerVariants = cva(\"aivex:shrink-0\", {\n variants: {\n strength: {\n basic: \"\",\n bold: \"\",\n },\n direction: {\n horizontal: \"aivex:w-full\",\n vertical: \"aivex:h-full\",\n },\n },\n compoundVariants: [\n {\n strength: \"basic\",\n direction: \"horizontal\",\n className: \"aivex:border-t aivex:border-border-default\",\n },\n {\n strength: \"basic\",\n direction: \"vertical\",\n className: \"aivex:border-l aivex:border-border-default\",\n },\n {\n strength: \"bold\",\n direction: \"horizontal\",\n className: \"aivex:border-t-2 aivex:border-border-subtle\",\n },\n {\n strength: \"bold\",\n direction: \"vertical\",\n className: \"aivex:border-l-2 aivex:border-border-subtle\",\n },\n ],\n defaultVariants: {\n strength: \"basic\",\n direction: \"horizontal\",\n },\n});\n\nexport interface DividerProps\n extends HTMLAttributes<HTMLHRElement>,\n VariantProps<typeof dividerVariants> {\n ref?: Ref<HTMLHRElement>;\n}\n\nfunction Divider({ className, strength, direction, ref, ...props }: DividerProps) {\n return (\n <hr\n ref={ref}\n aria-orientation={direction === \"vertical\" ? \"vertical\" : \"horizontal\"}\n className={cn(dividerVariants({ strength, direction }), className)}\n {...props}\n />\n );\n}\n\nexport { Divider, dividerVariants };\n","import * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport type { ComponentPropsWithoutRef, Ref } from \"react\";\nimport { useMemo, useState } from \"react\";\nimport { cn } from \"@/utils/cn\";\n\nexport interface SliderProps extends ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {\n trackClassName?: string | ((index: number) => string | undefined);\n /** 트랙 자체(높이 등)를 한 번씩 다르게 써야 하는 호스트를 위한 국소 오버라이드. */\n trackRootClassName?: string;\n thumbClassName?: string | ((index: number) => string | undefined);\n ref?: Ref<HTMLSpanElement>;\n}\n\nfunction Slider({\n className,\n trackClassName,\n trackRootClassName,\n thumbClassName,\n defaultValue = [50],\n value,\n min = 0,\n max = 100,\n step = 1,\n onValueChange,\n ref,\n ...props\n}: SliderProps) {\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState<number[]>(defaultValue);\n const currentValues = isControlled ? value : internalValue;\n\n const handleValueChange = (newValue: number[]) => {\n if (!isControlled) {\n setInternalValue(newValue);\n }\n onValueChange?.(newValue);\n };\n\n const percentages = useMemo(() => {\n const range = max - min || 1;\n const sortedValues = [...currentValues].sort((a, b) => a - b);\n\n return sortedValues.map((currentValue) => ((currentValue - min) / range) * 100);\n }, [currentValues, min, max]);\n\n const segments = useMemo(() => {\n const points = [0, ...percentages, 100];\n\n return points.slice(0, -1).map((left, index) => ({\n left,\n width: points[index + 1] - left,\n }));\n }, [percentages]);\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n \"aivex:relative aivex:flex aivex:w-full aivex:touch-none aivex:select-none aivex:items-center aivex:outline-none\",\n \"aivex:data-[disabled]:pointer-events-none aivex:data-[disabled]:opacity-disable\",\n className,\n )}\n defaultValue={defaultValue}\n value={value}\n min={min}\n max={max}\n step={step}\n onValueChange={handleValueChange}\n {...props}\n >\n <SliderPrimitive.Track\n className={cn(\n \"aivex:relative aivex:h-2 aivex:w-full aivex:grow aivex:overflow-hidden aivex:rounded-full aivex:bg-bg-tertiary\",\n trackRootClassName,\n )}\n >\n {segments.map(({ left, width }, index) => {\n const activeIndex = percentages.length >= 2 ? 1 : 0;\n const defaultSegmentClassName =\n index === activeIndex ? \"aivex:bg-bg-brand\" : \"aivex:bg-bg-tertiary\";\n\n return (\n <div\n key={index}\n className={cn(\n \"aivex:absolute aivex:top-0 aivex:h-full aivex:rounded-full\",\n typeof trackClassName === \"string\"\n ? trackClassName\n : (trackClassName?.(index) ?? defaultSegmentClassName),\n )}\n style={{ left: `${left}%`, width: `${width}%` }}\n />\n );\n })}\n </SliderPrimitive.Track>\n {currentValues.map((_, index) => (\n <SliderPrimitive.Thumb\n key={index}\n className={cn(\n \"aivex:z-10 aivex:block aivex:h-6 aivex:w-6 aivex:box-border aivex:rounded-full aivex:border-2 aivex:border-border-brand aivex:bg-bg-primary aivex:shadow-sm\",\n \"aivex:cursor-pointer aivex:transition-transform aivex:hover:scale-110\",\n \"aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand\",\n \"aivex:disabled:pointer-events-none\",\n typeof thumbClassName === \"string\" ? thumbClassName : thumbClassName?.(index),\n )}\n />\n ))}\n </SliderPrimitive.Root>\n );\n}\n\nexport { Slider };\n","import * as SwitchPrimitive from \"@radix-ui/react-switch\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { type ComponentPropsWithoutRef, type Ref, useId } from \"react\";\nimport { cn } from \"@/utils/cn\";\n\nconst switchTrackVariants = cva(\n // off 트랙은 bg/tertiary(반투명 채움) — border/default를 쓰면 테두리색이 면으로 깔려 탁해진다.\n \"aivex:relative aivex:inline-flex aivex:shrink-0 aivex:items-center aivex:rounded-full aivex:transition-colors aivex:duration-200 aivex:cursor-pointer aivex:bg-bg-tertiary aivex:data-[state=checked]:bg-bg-brand aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand aivex:disabled:cursor-not-allowed aivex:disabled:opacity-disable\",\n {\n variants: {\n size: {\n sm: \"aivex:w-6 aivex:h-4\",\n md: \"aivex:w-8 aivex:h-5\",\n lg: \"aivex:w-10 aivex:h-6\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n);\n\ntype SwitchSize = NonNullable<VariantProps<typeof switchTrackVariants>[\"size\"]>;\n\n// 시안 규칙: 노브는 트랙 상하좌우 3px 안쪽 → 노브 = 트랙 높이 - 6.\n// md(32×20, 노브 14px)가 시안 SM과 정확히 일치하고, sm·lg는 같은 규칙으로 맞춘다.\nconst thumbClass: Record<SwitchSize, string> = {\n sm: \"aivex:w-2.5 aivex:h-2.5 aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[11px]\",\n md: \"aivex:w-3.5 aivex:h-3.5 aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[15px]\",\n lg: \"aivex:w-[18px] aivex:h-[18px] aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[19px]\",\n};\n\nconst switchLabelSizeClass: Record<SwitchSize, string> = {\n sm: \"aivex:h-4\",\n md: \"aivex:h-5\",\n lg: \"aivex:h-6\",\n};\n\nexport interface SwitchProps\n extends Omit<\n ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>,\n \"asChild\" | \"children\" | \"onCheckedChange\"\n >,\n VariantProps<typeof switchTrackVariants> {\n label?: string;\n // 배포된 선언을 소비할 때도 콜백 인자의 contextual typing을 보존한다.\n onCheckedChange?: (checked: boolean) => void;\n ref?: Ref<HTMLButtonElement>;\n}\n\nfunction Switch({ className, label, size = \"md\", disabled, id, ref, ...props }: SwitchProps) {\n const resolvedSize = size ?? \"md\";\n const generatedId = useId();\n const switchId = id ?? generatedId;\n\n return (\n <span\n className={cn(\n \"aivex:inline-flex aivex:items-center aivex:gap-md\",\n disabled && \"aivex:opacity-disable\",\n )}\n >\n <SwitchPrimitive.Root\n ref={ref}\n id={switchId}\n disabled={disabled}\n className={cn(switchTrackVariants({ size: resolvedSize }), className)}\n {...props}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n \"aivex:block aivex:rounded-full aivex:bg-white aivex:shadow-[var(--aivex-elevation-sm)] aivex:transition-transform aivex:duration-200 aivex:will-change-transform\",\n thumbClass[resolvedSize],\n )}\n />\n </SwitchPrimitive.Root>\n {label && (\n <label\n htmlFor={switchId}\n className={cn(\n \"aivex:inline-flex aivex:items-center aivex:cursor-pointer aivex:select-none aivex:text-label-lg aivex:text-text-primary\",\n disabled && \"aivex:cursor-not-allowed\",\n switchLabelSizeClass[resolvedSize],\n )}\n >\n {label}\n </label>\n )}\n </span>\n );\n}\n\nexport { Switch };\n","/** 현재 DOM 영역에 발생한 키만 처리하고 중첩된 대화상자·메뉴에는 양보한다. */\nexport function isShortcutTarget(host: HTMLElement | null, target: EventTarget | null): boolean {\n if (!host || !(target instanceof Element) || !host.contains(target)) return false;\n const boundary = target.closest(\n '[role=\"dialog\"],[role=\"alertdialog\"],[role=\"menu\"],[role=\"listbox\"]',\n );\n return !boundary || boundary.contains(host);\n}\n\nexport function isEditableTarget(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n return target.isContentEditable || !!target.closest('input,textarea,select,[role=\"textbox\"]');\n}\n"],"mappings":"kXAWA,IAAM,GAAA,EAAA,EAAA,KACJ,0UACA,CACE,SAAU,CACR,OAAQ,CACN,KAAM,yBACN,MAAO,0BACR,CACF,CACD,gBAAiB,CACf,OAAQ,GACT,CACF,CACF,CAEK,EAAmB,EAAA,GACvB,gGACA,8EACA,gCACA,2EACA,yEACA,2EACD,CAMD,SAAS,EAAS,EAAsB,CACtC,OAAO,EAAA,EAAA,KAAC,EAAa,KAAd,CAAmB,GAAI,EAAS,CAAA,CASzC,SAAS,EAAY,CAAE,MAAK,GAAG,GAA2B,CACxD,OAAO,EAAA,EAAA,KAAC,EAAa,QAAd,CAA2B,MAAK,GAAI,EAAS,CAAA,CAStD,SAAS,EAAY,CAAE,YAAW,aAAa,EAAG,MAAK,GAAG,GAA2B,CACnF,OACE,EAAA,EAAA,KAAC,EAAa,OAAd,CAAA,UACE,EAAA,EAAA,KAAC,EAAa,QAAd,CACO,MACO,aACZ,UAAW,EAAA,GAAG,EAAkB,EAAU,CAC1C,GAAI,EACJ,CAAA,CACkB,CAAA,CAU1B,SAAS,EAAU,CAAE,YAAW,MAAK,GAAG,GAAyB,CAC/D,OACE,EAAA,EAAA,KAAC,EAAa,MAAd,CACO,MACL,UAAW,EAAA,GAAG,4BAA6B,EAAU,CACrD,GAAI,EACJ,CAAA,CAUN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ACA,GAAY,wBACb,UAJH,EAME,EAAA,EAAA,KAAC,EAAgB,KAAjB,CACO,MACL,GAAI,EACM,WACV,UAAW,EAAA,GAAG,EAAoB,CAAE,KAAM,EAAc,CAAC,CAAE,EAAU,CACrE,GAAI,YAEJ,EAAA,EAAA,KAAC,EAAgB,MAAjB,CACE,UAAW,EAAA,GACT,mKACA,EAAW,GACZ,CACD,CAAA,CACmB,CAAA,CACtB,IACC,EAAA,EAAA,KAAC,QAAD,CACE,QAAS,EACT,UAAW,EAAA,GACT,0HACA,GAAY,2BACZ,EAAqB,GACtB,UAEA,EACK,CAAA,CAEL,GCrFX,SAAgB,EAAiB,EAA0B,EAAqC,CAC9F,GAAI,CAAC,GAAQ,EAAE,aAAkB,UAAY,CAAC,EAAK,SAAS,EAAO,CAAE,MAAO,GAC5E,IAAM,EAAW,EAAO,QACtB,sEACD,CACD,MAAO,CAAC,GAAY,EAAS,SAAS,EAAK,CAG7C,SAAgB,EAAiB,EAAqC,CAEpE,OADM,aAAkB,YACjB,EAAO,mBAAqB,CAAC,CAAC,EAAO,QAAQ,yCAAyC,CADhD"}
@@ -1,91 +1,93 @@
1
- import { Wt as e, dt as t, fa as n, pa as r } from "./Button-DLfTdKpW.js";
1
+ import { cn as e } from "./utils.js";
2
+ import { Wt as t, dt as n, fa as r } from "./Button-CuvXiYtX.js";
2
3
  import { cva as i } from "class-variance-authority";
3
4
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
5
  import * as s from "@radix-ui/react-dropdown-menu";
5
6
  import { useId as c, useMemo as l, useState as u } from "react";
6
- import * as d from "@radix-ui/react-slider";
7
- import * as f from "@radix-ui/react-switch";
7
+ import * as d from "@radix-ui/react-popover";
8
+ import * as f from "@radix-ui/react-slider";
9
+ import * as p from "@radix-ui/react-switch";
8
10
  //#region src/components/Menu/Menu.tsx
9
- var p = i("aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:w-full aivex:items-center aivex:gap-md aivex:px-md aivex:py-sm aivex:text-label-lg aivex:rounded-md aivex:transition-colors aivex:cursor-pointer aivex:select-none aivex:outline-none aivex:data-[disabled]:opacity-disable aivex:data-[disabled]:pointer-events-none", {
11
+ var m = i("aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:w-full aivex:items-center aivex:gap-md aivex:px-md aivex:py-sm aivex:text-label-lg aivex:rounded-md aivex:transition-colors aivex:cursor-pointer aivex:select-none aivex:outline-none aivex:data-[disabled]:opacity-disable aivex:data-[disabled]:pointer-events-none", {
10
12
  variants: { danger: {
11
13
  true: "aivex:text-text-danger",
12
14
  false: "aivex:text-text-primary"
13
15
  } },
14
16
  defaultVariants: { danger: !1 }
15
- }), m = r("aivex:flex aivex:flex-col aivex:rounded-md aivex:bg-bg-primary aivex:p-md aivex:overflow-clip", "aivex:shadow-md aivex:border aivex:border-border-subtle aivex:min-w-[160px]", "aivex:z-50 aivex:outline-none", "aivex:data-[state=open]:animate-in aivex:data-[state=closed]:animate-out", "aivex:data-[state=closed]:fade-out-0 aivex:data-[state=open]:fade-in-0", "aivex:data-[state=closed]:zoom-out-95 aivex:data-[state=open]:zoom-in-95");
16
- function h(e) {
17
+ }), h = e("aivex:flex aivex:flex-col aivex:rounded-md aivex:bg-bg-primary aivex:p-md aivex:overflow-clip", "aivex:shadow-md aivex:border aivex:border-border-subtle aivex:min-w-[160px]", "aivex:z-50 aivex:outline-none", "aivex:data-[state=open]:animate-in aivex:data-[state=closed]:animate-out", "aivex:data-[state=closed]:fade-out-0 aivex:data-[state=open]:fade-in-0", "aivex:data-[state=closed]:zoom-out-95 aivex:data-[state=open]:zoom-in-95");
18
+ function g(e) {
17
19
  return /* @__PURE__ */ a(s.Root, { ...e });
18
20
  }
19
- function g({ ref: e, ...t }) {
21
+ function _({ ref: e, ...t }) {
20
22
  return /* @__PURE__ */ a(s.Trigger, {
21
23
  ref: e,
22
24
  ...t
23
25
  });
24
26
  }
25
- function _({ className: e, sideOffset: t = 4, ref: n, ...i }) {
27
+ function v({ className: t, sideOffset: n = 4, ref: r, ...i }) {
26
28
  return /* @__PURE__ */ a(s.Portal, { children: /* @__PURE__ */ a(s.Content, {
27
- ref: n,
28
- sideOffset: t,
29
- className: r(m, e),
29
+ ref: r,
30
+ sideOffset: n,
31
+ className: e(h, t),
30
32
  ...i
31
33
  }) });
32
34
  }
33
- function v({ className: e, ref: t, ...n }) {
35
+ function y({ className: t, ref: n, ...r }) {
34
36
  return /* @__PURE__ */ a(s.Group, {
35
- ref: t,
36
- className: r("aivex:flex aivex:flex-col", e),
37
- ...n
37
+ ref: n,
38
+ className: e("aivex:flex aivex:flex-col", t),
39
+ ...r
38
40
  });
39
41
  }
40
- function y({ className: e, ref: t, ...n }) {
42
+ function b({ className: t, ref: n, ...r }) {
41
43
  return /* @__PURE__ */ a(s.Separator, {
42
- ref: t,
43
- className: r("aivex:h-px aivex:bg-border-subtle aivex:w-full aivex:my-xs", e),
44
- ...n
44
+ ref: n,
45
+ className: e("aivex:h-px aivex:bg-border-subtle aivex:w-full aivex:my-xs", t),
46
+ ...r
45
47
  });
46
48
  }
47
- function b({ className: e, ref: t, ...n }) {
49
+ function x({ className: t, ref: n, ...r }) {
48
50
  return /* @__PURE__ */ a(s.Label, {
49
- ref: t,
50
- className: r("aivex:px-md aivex:py-2xs aivex:text-label-md aivex:text-text-tertiary aivex:select-none", e),
51
- ...n
51
+ ref: n,
52
+ className: e("aivex:px-md aivex:py-2xs aivex:text-label-md aivex:text-text-tertiary aivex:select-none", t),
53
+ ...r
52
54
  });
53
55
  }
54
- function x({ className: e, label: t, icon: i, danger: c = !1, asChild: l, children: u, ref: d, ...f }) {
56
+ function S({ className: t, label: n, icon: i, danger: c = !1, asChild: l, children: u, ref: d, ...f }) {
55
57
  if (l) return /* @__PURE__ */ a(s.Item, {
56
58
  ref: d,
57
59
  asChild: !0,
58
- className: r(p({ danger: c }), e),
60
+ className: e(m({ danger: c }), t),
59
61
  ...f,
60
62
  children: u
61
63
  });
62
- let m = t ?? u;
64
+ let p = n ?? u;
63
65
  return /* @__PURE__ */ o(s.Item, {
64
66
  ref: d,
65
- className: r(p({ danger: c }), e),
67
+ className: e(m({ danger: c }), t),
66
68
  ...f,
67
69
  children: [
68
- /* @__PURE__ */ a(n, { variant: c ? "danger" : "default" }),
70
+ /* @__PURE__ */ a(r, { variant: c ? "danger" : "default" }),
69
71
  i && /* @__PURE__ */ a("span", {
70
- className: r("aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0", c ? "aivex:text-icon-danger" : "aivex:text-icon-secondary"),
72
+ className: e("aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0", c ? "aivex:text-icon-danger" : "aivex:text-icon-secondary"),
71
73
  children: i
72
74
  }),
73
75
  /* @__PURE__ */ a("span", {
74
76
  className: "aivex:flex-1 aivex:min-w-0 aivex:truncate aivex:text-left",
75
- children: m
77
+ children: p
76
78
  })
77
79
  ]
78
80
  });
79
81
  }
80
- function S({ className: e, label: i, icon: c, children: l, ref: u, ...d }) {
82
+ function C({ className: t, label: i, icon: c, children: l, ref: u, ...d }) {
81
83
  let f = i ?? l;
82
84
  return /* @__PURE__ */ o(s.CheckboxItem, {
83
85
  ref: u,
84
- className: r(p(), e),
86
+ className: e(m(), t),
85
87
  ...d,
86
88
  children: [
87
- /* @__PURE__ */ a(n, { variant: "default" }),
88
- /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a(s.ItemIndicator, { children: /* @__PURE__ */ a(t, { size: 20 }) }) }),
89
+ /* @__PURE__ */ a(r, { variant: "default" }),
90
+ /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(s.ItemIndicator, { children: /* @__PURE__ */ a(n, { size: 20 }) }) }),
89
91
  c && /* @__PURE__ */ a("span", {
90
92
  className: "aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary",
91
93
  children: c
@@ -97,22 +99,22 @@ function S({ className: e, label: i, icon: c, children: l, ref: u, ...d }) {
97
99
  ]
98
100
  });
99
101
  }
100
- function C({ className: e, ref: t, ...n }) {
102
+ function w({ className: t, ref: n, ...r }) {
101
103
  return /* @__PURE__ */ a(s.RadioGroup, {
102
- ref: t,
103
- className: r("aivex:flex aivex:flex-col", e),
104
- ...n
104
+ ref: n,
105
+ className: e("aivex:flex aivex:flex-col", t),
106
+ ...r
105
107
  });
106
108
  }
107
- function w({ className: e, label: i, icon: c, children: l, ref: u, ...d }) {
109
+ function T({ className: t, label: i, icon: c, children: l, ref: u, ...d }) {
108
110
  let f = i ?? l;
109
111
  return /* @__PURE__ */ o(s.RadioItem, {
110
112
  ref: u,
111
- className: r(p(), e),
113
+ className: e(m(), t),
112
114
  ...d,
113
115
  children: [
114
- /* @__PURE__ */ a(n, { variant: "default" }),
115
- /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a(s.ItemIndicator, { children: /* @__PURE__ */ a(t, { size: 20 }) }) }),
116
+ /* @__PURE__ */ a(r, { variant: "default" }),
117
+ /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(s.ItemIndicator, { children: /* @__PURE__ */ a(n, { size: 20 }) }) }),
116
118
  c && /* @__PURE__ */ a("span", {
117
119
  className: "aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary",
118
120
  children: c
@@ -124,24 +126,24 @@ function w({ className: e, label: i, icon: c, children: l, ref: u, ...d }) {
124
126
  ]
125
127
  });
126
128
  }
127
- function T({ className: e, ref: t, ...n }) {
129
+ function E({ className: t, ref: n, ...r }) {
128
130
  return /* @__PURE__ */ a("span", {
129
- ref: t,
130
- className: r("aivex:inline-flex aivex:items-center aivex:justify-center aivex:min-h-5 aivex:min-w-5 aivex:px-2xs aivex:rounded-xs aivex:border aivex:border-border-subtle aivex:text-label-md aivex:text-text-tertiary aivex:ml-auto", e),
131
- ...n
131
+ ref: n,
132
+ className: e("aivex:inline-flex aivex:items-center aivex:justify-center aivex:min-h-5 aivex:min-w-5 aivex:px-2xs aivex:rounded-xs aivex:border aivex:border-border-subtle aivex:text-label-md aivex:text-text-tertiary aivex:ml-auto", t),
133
+ ...r
132
134
  });
133
135
  }
134
- function E(e) {
136
+ function D(e) {
135
137
  return /* @__PURE__ */ a(s.Sub, { ...e });
136
138
  }
137
- function D({ className: t, label: i, icon: c, children: l, ref: u, ...d }) {
139
+ function O({ className: n, label: i, icon: c, children: l, ref: u, ...d }) {
138
140
  let f = i ?? l;
139
141
  return /* @__PURE__ */ o(s.SubTrigger, {
140
142
  ref: u,
141
- className: r(p(), t),
143
+ className: e(m(), n),
142
144
  ...d,
143
145
  children: [
144
- /* @__PURE__ */ a(n, { variant: "default" }),
146
+ /* @__PURE__ */ a(r, { variant: "default" }),
145
147
  c && /* @__PURE__ */ a("span", {
146
148
  className: "aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary",
147
149
  children: c
@@ -152,41 +154,102 @@ function D({ className: t, label: i, icon: c, children: l, ref: u, ...d }) {
152
154
  }),
153
155
  /* @__PURE__ */ a("span", {
154
156
  className: "aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:text-icon-secondary",
155
- children: /* @__PURE__ */ a(e, { size: 16 })
157
+ children: /* @__PURE__ */ a(t, { size: 16 })
156
158
  })
157
159
  ]
158
160
  });
159
161
  }
160
- function O({ className: e, sideOffset: t = 4, ref: n, ...i }) {
162
+ function k({ className: t, sideOffset: n = 4, ref: r, ...i }) {
161
163
  return /* @__PURE__ */ a(s.Portal, { children: /* @__PURE__ */ a(s.SubContent, {
162
- ref: n,
163
- sideOffset: t,
164
- className: r(m, e),
164
+ ref: r,
165
+ sideOffset: n,
166
+ className: e(h, t),
165
167
  ...i
166
168
  }) });
167
169
  }
168
- function k({ children: e }) {
170
+ function A({ children: e }) {
169
171
  return /* @__PURE__ */ a("span", {
170
172
  "aria-hidden": !0,
171
173
  className: "aivex:flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:w-5 aivex:h-5 aivex:text-icon-primary",
172
174
  children: e
173
175
  });
174
176
  }
175
- var A = Object.assign(h, {
176
- Trigger: g,
177
- Content: _,
178
- Item: x,
179
- Group: v,
180
- Separator: y,
181
- Label: b,
182
- CheckboxItem: S,
183
- RadioGroup: C,
184
- RadioItem: w,
185
- Sub: E,
186
- SubTrigger: D,
187
- SubContent: O,
188
- Shortcut: T
189
- }), j = i("aivex:shrink-0", {
177
+ var j = Object.assign(g, {
178
+ Trigger: _,
179
+ Content: v,
180
+ Item: S,
181
+ Group: y,
182
+ Separator: b,
183
+ Label: x,
184
+ CheckboxItem: C,
185
+ RadioGroup: w,
186
+ RadioItem: T,
187
+ Sub: D,
188
+ SubTrigger: O,
189
+ SubContent: k,
190
+ Shortcut: E
191
+ }), M = e("aivex:flex aivex:flex-col aivex:gap-lg aivex:w-[277px] aivex:max-h-[448px] aivex:p-xl", "aivex:bg-bg-primary aivex:border aivex:border-border-subtle aivex:rounded-xl aivex:shadow-md aivex:overflow-clip", "aivex:z-50 aivex:outline-none", "aivex:data-[state=open]:animate-in aivex:data-[state=closed]:animate-out", "aivex:data-[state=closed]:fade-out-0 aivex:data-[state=open]:fade-in-0", "aivex:data-[state=closed]:zoom-out-95 aivex:data-[state=open]:zoom-in-95");
192
+ function N(e) {
193
+ return /* @__PURE__ */ a(d.Root, { ...e });
194
+ }
195
+ function P({ ref: e, ...t }) {
196
+ return /* @__PURE__ */ a(d.Trigger, {
197
+ ref: e,
198
+ ...t
199
+ });
200
+ }
201
+ function F(e) {
202
+ return /* @__PURE__ */ a(d.Anchor, { ...e });
203
+ }
204
+ function I({ ref: e, ...t }) {
205
+ return /* @__PURE__ */ a(d.Close, {
206
+ ref: e,
207
+ ...t
208
+ });
209
+ }
210
+ function L({ className: t, sideOffset: n = 8, align: r = "start", ref: i, ...o }) {
211
+ return /* @__PURE__ */ a(d.Portal, { children: /* @__PURE__ */ a(d.Content, {
212
+ ref: i,
213
+ sideOffset: n,
214
+ align: r,
215
+ className: e(M, t),
216
+ ...o
217
+ }) });
218
+ }
219
+ function R({ className: t, ref: n, ...r }) {
220
+ return /* @__PURE__ */ a("div", {
221
+ ref: n,
222
+ className: e("aivex:w-full aivex:px-xs aivex:text-body-md-medium aivex:text-text-primary aivex:truncate", t),
223
+ ...r
224
+ });
225
+ }
226
+ function z({ className: t, ref: n, ...r }) {
227
+ return /* @__PURE__ */ a("div", {
228
+ ref: n,
229
+ className: e("aivex:flex aivex:min-h-0 aivex:w-full aivex:flex-1 aivex:flex-col aivex:gap-md aivex:overflow-y-auto", t),
230
+ ...r
231
+ });
232
+ }
233
+ function B({ className: t, start: n, children: r, ref: i, ...s }) {
234
+ return /* @__PURE__ */ o("div", {
235
+ ref: i,
236
+ className: e("aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-md", t),
237
+ ...s,
238
+ children: [n && /* @__PURE__ */ a("div", {
239
+ className: "aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:items-start aivex:justify-center",
240
+ children: n
241
+ }), r]
242
+ });
243
+ }
244
+ var V = Object.assign(N, {
245
+ Trigger: P,
246
+ Anchor: F,
247
+ Close: I,
248
+ Content: L,
249
+ Title: R,
250
+ Body: z,
251
+ Footer: B
252
+ }), H = i("aivex:shrink-0", {
190
253
  variants: {
191
254
  strength: {
192
255
  basic: "",
@@ -224,28 +287,28 @@ var A = Object.assign(h, {
224
287
  direction: "horizontal"
225
288
  }
226
289
  });
227
- function M({ className: e, strength: t, direction: n, ref: i, ...o }) {
290
+ function U({ className: t, strength: n, direction: r, ref: i, ...o }) {
228
291
  return /* @__PURE__ */ a("hr", {
229
292
  ref: i,
230
- "aria-orientation": n === "vertical" ? "vertical" : "horizontal",
231
- className: r(j({
232
- strength: t,
233
- direction: n
234
- }), e),
293
+ "aria-orientation": r === "vertical" ? "vertical" : "horizontal",
294
+ className: e(H({
295
+ strength: n,
296
+ direction: r
297
+ }), t),
235
298
  ...o
236
299
  });
237
300
  }
238
301
  //#endregion
239
302
  //#region src/components/Slider/Slider.tsx
240
- function N({ className: e, trackClassName: t, trackRootClassName: n, thumbClassName: i, defaultValue: s = [50], value: c, min: f = 0, max: p = 100, step: m = 1, onValueChange: h, ref: g, ..._ }) {
303
+ function W({ className: t, trackClassName: n, trackRootClassName: r, thumbClassName: i, defaultValue: s = [50], value: c, min: d = 0, max: p = 100, step: m = 1, onValueChange: h, ref: g, ..._ }) {
241
304
  let v = c !== void 0, [y, b] = u(s), x = v ? c : y, S = (e) => {
242
305
  v || b(e), h?.(e);
243
306
  }, C = l(() => {
244
- let e = p - f || 1;
245
- return [...x].sort((e, t) => e - t).map((t) => (t - f) / e * 100);
307
+ let e = p - d || 1;
308
+ return [...x].sort((e, t) => e - t).map((t) => (t - d) / e * 100);
246
309
  }, [
247
310
  x,
248
- f,
311
+ d,
249
312
  p
250
313
  ]), w = l(() => {
251
314
  let e = [
@@ -258,68 +321,78 @@ function N({ className: e, trackClassName: t, trackRootClassName: n, thumbClassN
258
321
  width: e[n + 1] - t
259
322
  }));
260
323
  }, [C]);
261
- return /* @__PURE__ */ o(d.Root, {
324
+ return /* @__PURE__ */ o(f.Root, {
262
325
  ref: g,
263
- className: r("aivex:relative aivex:flex aivex:w-full aivex:touch-none aivex:select-none aivex:items-center aivex:outline-none", "aivex:data-[disabled]:pointer-events-none aivex:data-[disabled]:opacity-disable", e),
326
+ className: e("aivex:relative aivex:flex aivex:w-full aivex:touch-none aivex:select-none aivex:items-center aivex:outline-none", "aivex:data-[disabled]:pointer-events-none aivex:data-[disabled]:opacity-disable", t),
264
327
  defaultValue: s,
265
328
  value: c,
266
- min: f,
329
+ min: d,
267
330
  max: p,
268
331
  step: m,
269
332
  onValueChange: S,
270
333
  ..._,
271
- children: [/* @__PURE__ */ a(d.Track, {
272
- className: r("aivex:relative aivex:h-2 aivex:w-full aivex:grow aivex:overflow-hidden aivex:rounded-full aivex:bg-bg-tertiary", n),
273
- children: w.map(({ left: e, width: n }, i) => {
334
+ children: [/* @__PURE__ */ a(f.Track, {
335
+ className: e("aivex:relative aivex:h-2 aivex:w-full aivex:grow aivex:overflow-hidden aivex:rounded-full aivex:bg-bg-tertiary", r),
336
+ children: w.map(({ left: t, width: r }, i) => {
274
337
  let o = i === +(C.length >= 2) ? "aivex:bg-bg-brand" : "aivex:bg-bg-tertiary";
275
338
  return /* @__PURE__ */ a("div", {
276
- className: r("aivex:absolute aivex:top-0 aivex:h-full aivex:rounded-full", typeof t == "string" ? t : t?.(i) ?? o),
339
+ className: e("aivex:absolute aivex:top-0 aivex:h-full aivex:rounded-full", typeof n == "string" ? n : n?.(i) ?? o),
277
340
  style: {
278
- left: `${e}%`,
279
- width: `${n}%`
341
+ left: `${t}%`,
342
+ width: `${r}%`
280
343
  }
281
344
  }, i);
282
345
  })
283
- }), x.map((e, t) => /* @__PURE__ */ a(d.Thumb, { className: r("aivex:z-10 aivex:block aivex:h-6 aivex:w-6 aivex:box-border aivex:rounded-full aivex:border-2 aivex:border-border-brand aivex:bg-bg-primary aivex:shadow-sm", "aivex:cursor-pointer aivex:transition-transform aivex:hover:scale-110", "aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand", "aivex:disabled:pointer-events-none", typeof i == "string" ? i : i?.(t)) }, t))]
346
+ }), x.map((t, n) => /* @__PURE__ */ a(f.Thumb, { className: e("aivex:z-10 aivex:block aivex:h-6 aivex:w-6 aivex:box-border aivex:rounded-full aivex:border-2 aivex:border-border-brand aivex:bg-bg-primary aivex:shadow-sm", "aivex:cursor-pointer aivex:transition-transform aivex:hover:scale-110", "aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand", "aivex:disabled:pointer-events-none", typeof i == "string" ? i : i?.(n)) }, n))]
284
347
  });
285
348
  }
286
349
  //#endregion
287
350
  //#region src/components/Switch/Switch.tsx
288
- var P = i("aivex:relative aivex:inline-flex aivex:shrink-0 aivex:items-center aivex:rounded-full aivex:transition-colors aivex:duration-200 aivex:cursor-pointer aivex:bg-bg-tertiary aivex:data-[state=checked]:bg-bg-brand aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand aivex:disabled:cursor-not-allowed aivex:disabled:opacity-disable", {
351
+ var G = i("aivex:relative aivex:inline-flex aivex:shrink-0 aivex:items-center aivex:rounded-full aivex:transition-colors aivex:duration-200 aivex:cursor-pointer aivex:bg-bg-tertiary aivex:data-[state=checked]:bg-bg-brand aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand aivex:disabled:cursor-not-allowed aivex:disabled:opacity-disable", {
289
352
  variants: { size: {
290
353
  sm: "aivex:w-6 aivex:h-4",
291
354
  md: "aivex:w-8 aivex:h-5",
292
355
  lg: "aivex:w-10 aivex:h-6"
293
356
  } },
294
357
  defaultVariants: { size: "md" }
295
- }), F = {
358
+ }), K = {
296
359
  sm: "aivex:w-2.5 aivex:h-2.5 aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[11px]",
297
360
  md: "aivex:w-3.5 aivex:h-3.5 aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[15px]",
298
361
  lg: "aivex:w-[18px] aivex:h-[18px] aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[19px]"
299
- }, I = {
362
+ }, q = {
300
363
  sm: "aivex:h-4",
301
364
  md: "aivex:h-5",
302
365
  lg: "aivex:h-6"
303
366
  };
304
- function L({ className: e, label: t, size: n = "md", disabled: i, id: s, ref: l, ...u }) {
305
- let d = n ?? "md", p = c(), m = s ?? p;
367
+ function J({ className: t, label: n, size: r = "md", disabled: i, id: s, ref: l, ...u }) {
368
+ let d = r ?? "md", f = c(), m = s ?? f;
306
369
  return /* @__PURE__ */ o("span", {
307
- className: r("aivex:inline-flex aivex:items-center aivex:gap-md", i && "aivex:opacity-disable"),
308
- children: [/* @__PURE__ */ a(f.Root, {
370
+ className: e("aivex:inline-flex aivex:items-center aivex:gap-md", i && "aivex:opacity-disable"),
371
+ children: [/* @__PURE__ */ a(p.Root, {
309
372
  ref: l,
310
373
  id: m,
311
374
  disabled: i,
312
- className: r(P({ size: d }), e),
375
+ className: e(G({ size: d }), t),
313
376
  ...u,
314
- children: /* @__PURE__ */ a(f.Thumb, { className: r("aivex:block aivex:rounded-full aivex:bg-white aivex:shadow-[var(--aivex-elevation-sm)] aivex:transition-transform aivex:duration-200 aivex:will-change-transform", F[d]) })
315
- }), t && /* @__PURE__ */ a("label", {
377
+ children: /* @__PURE__ */ a(p.Thumb, { className: e("aivex:block aivex:rounded-full aivex:bg-white aivex:shadow-[var(--aivex-elevation-sm)] aivex:transition-transform aivex:duration-200 aivex:will-change-transform", K[d]) })
378
+ }), n && /* @__PURE__ */ a("label", {
316
379
  htmlFor: m,
317
- className: r("aivex:inline-flex aivex:items-center aivex:cursor-pointer aivex:select-none aivex:text-label-lg aivex:text-text-primary", i && "aivex:cursor-not-allowed", I[d]),
318
- children: t
380
+ className: e("aivex:inline-flex aivex:items-center aivex:cursor-pointer aivex:select-none aivex:text-label-lg aivex:text-text-primary", i && "aivex:cursor-not-allowed", q[d]),
381
+ children: n
319
382
  })]
320
383
  });
321
384
  }
322
385
  //#endregion
323
- export { A as a, j as i, N as n, M as r, L as t };
386
+ //#region src/utils/keyboard.ts
387
+ function Y(e, t) {
388
+ if (!e || !(t instanceof Element) || !e.contains(t)) return !1;
389
+ let n = t.closest("[role=\"dialog\"],[role=\"alertdialog\"],[role=\"menu\"],[role=\"listbox\"]");
390
+ return !n || n.contains(e);
391
+ }
392
+ function X(e) {
393
+ return e instanceof HTMLElement ? e.isContentEditable || !!e.closest("input,textarea,select,[role=\"textbox\"]") : !1;
394
+ }
395
+ //#endregion
396
+ export { U as a, j as c, W as i, Y as n, H as o, J as r, V as s, X as t };
324
397
 
325
- //# sourceMappingURL=Switch-D7Dzld4x.js.map
398
+ //# sourceMappingURL=keyboard-DUqwZll5.js.map