@tribepad/themis 1.0.2 → 1.0.4

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 (84) hide show
  1. package/dist/elements/Checkbox/index.js +1 -1
  2. package/dist/elements/Checkbox/index.js.map +1 -1
  3. package/dist/elements/Checkbox/index.mjs +1 -1
  4. package/dist/elements/Checkbox/index.mjs.map +1 -1
  5. package/dist/elements/CheckboxGroup/index.js +1 -1
  6. package/dist/elements/CheckboxGroup/index.js.map +1 -1
  7. package/dist/elements/CheckboxGroup/index.mjs +1 -1
  8. package/dist/elements/CheckboxGroup/index.mjs.map +1 -1
  9. package/dist/elements/DatePicker/index.js +1 -1
  10. package/dist/elements/DatePicker/index.js.map +1 -1
  11. package/dist/elements/DatePicker/index.mjs +1 -1
  12. package/dist/elements/DatePicker/index.mjs.map +1 -1
  13. package/dist/elements/FileField/index.js +1 -1
  14. package/dist/elements/FileField/index.js.map +1 -1
  15. package/dist/elements/FileField/index.mjs +1 -1
  16. package/dist/elements/FileField/index.mjs.map +1 -1
  17. package/dist/elements/NumberField/NumberField.variants.d.ts +1 -1
  18. package/dist/elements/NumberField/index.js +1 -1
  19. package/dist/elements/NumberField/index.js.map +1 -1
  20. package/dist/elements/NumberField/index.mjs +1 -1
  21. package/dist/elements/NumberField/index.mjs.map +1 -1
  22. package/dist/elements/OTPInput/index.js +1 -1
  23. package/dist/elements/OTPInput/index.js.map +1 -1
  24. package/dist/elements/OTPInput/index.mjs +1 -1
  25. package/dist/elements/OTPInput/index.mjs.map +1 -1
  26. package/dist/elements/Progress/index.js +1 -1
  27. package/dist/elements/Progress/index.js.map +1 -1
  28. package/dist/elements/Progress/index.mjs +1 -1
  29. package/dist/elements/Progress/index.mjs.map +1 -1
  30. package/dist/elements/RadioGroup/index.js +1 -1
  31. package/dist/elements/RadioGroup/index.js.map +1 -1
  32. package/dist/elements/RadioGroup/index.mjs +1 -1
  33. package/dist/elements/RadioGroup/index.mjs.map +1 -1
  34. package/dist/elements/Resizable/index.js +1 -1
  35. package/dist/elements/Resizable/index.js.map +1 -1
  36. package/dist/elements/Resizable/index.mjs +1 -1
  37. package/dist/elements/Resizable/index.mjs.map +1 -1
  38. package/dist/elements/Select/index.js +1 -1
  39. package/dist/elements/Select/index.js.map +1 -1
  40. package/dist/elements/Select/index.mjs +1 -1
  41. package/dist/elements/Select/index.mjs.map +1 -1
  42. package/dist/elements/Switch/index.js +1 -1
  43. package/dist/elements/Switch/index.js.map +1 -1
  44. package/dist/elements/Switch/index.mjs +1 -1
  45. package/dist/elements/Switch/index.mjs.map +1 -1
  46. package/dist/elements/Table/index.js +1 -1
  47. package/dist/elements/Table/index.js.map +1 -1
  48. package/dist/elements/Table/index.mjs +1 -1
  49. package/dist/elements/Table/index.mjs.map +1 -1
  50. package/dist/elements/Tabs/Tabs.d.ts +5 -3
  51. package/dist/elements/Tabs/Tabs.d.ts.map +1 -1
  52. package/dist/elements/Tabs/Tabs.types.d.ts +15 -0
  53. package/dist/elements/Tabs/Tabs.types.d.ts.map +1 -1
  54. package/dist/elements/Tabs/index.js +1 -1
  55. package/dist/elements/Tabs/index.js.map +1 -1
  56. package/dist/elements/Tabs/index.mjs +1 -1
  57. package/dist/elements/Tabs/index.mjs.map +1 -1
  58. package/dist/elements/TimeField/index.js +1 -1
  59. package/dist/elements/TimeField/index.js.map +1 -1
  60. package/dist/elements/TimeField/index.mjs +1 -1
  61. package/dist/elements/TimeField/index.mjs.map +1 -1
  62. package/dist/elements/index.js +1 -1
  63. package/dist/elements/index.js.map +1 -1
  64. package/dist/elements/index.mjs +1 -1
  65. package/dist/elements/index.mjs.map +1 -1
  66. package/dist/index.js +2 -2
  67. package/dist/index.js.map +1 -1
  68. package/dist/index.mjs +2 -2
  69. package/dist/index.mjs.map +1 -1
  70. package/dist/styles/index.js +1 -1
  71. package/dist/styles/index.js.map +1 -1
  72. package/dist/styles/index.mjs +1 -1
  73. package/dist/styles/index.mjs.map +1 -1
  74. package/dist/styles/shared-variants.d.ts +3 -3
  75. package/dist/styles/shared-variants.d.ts.map +1 -1
  76. package/dist/tailwind-source.css +8 -0
  77. package/package.json +7 -6
  78. package/src/elements/AlertDialog/AlertDialog.stories.tsx +1 -1
  79. package/src/elements/CheckboxGroup/CheckboxGroup.stories.tsx +3 -3
  80. package/src/elements/Combobox/Combobox.stories.tsx +1 -1
  81. package/src/elements/FileField/FileField.stories.tsx +1 -1
  82. package/src/elements/Progress/Progress.stories.tsx +6 -1
  83. package/src/elements/RadioGroup/RadioGroup.stories.tsx +2 -2
  84. package/src/elements/Tabs/Tabs.stories.tsx +45 -1
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- 'use strict';var react=require('react'),reactAriaComponents=require('react-aria-components'),lucideReact=require('lucide-react'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod');var q=classVarianceAuthority.cva(["flex","w-full","items-center","justify-between","rounded-md","border","bg-[var(--content-background)]","text-[var(--content-foreground)]","transition-colors","duration-200","outline-none","focus-visible:ring-2","focus-visible:ring-[var(--ring)]","focus-visible:ring-offset-2","hover:bg-[var(--accent)]/10","disabled:cursor-not-allowed","disabled:opacity-50","data-[loading=true]:cursor-wait","truncate"],{variants:{size:{sm:"h-9 px-3 text-sm min-h-[44px]",default:"h-11 px-4 text-base min-h-[44px]",lg:"h-14 px-5 text-lg min-h-[44px]"},isInvalid:{true:"border-[var(--destructive)]",false:"border-[var(--input)] hover:border-[var(--input)]/80"}},defaultVariants:{size:"default",isInvalid:false}}),F=classVarianceAuthority.cva(["relative","flex","w-full","cursor-pointer","select-none","items-center","rounded-sm","outline-none","transition-colors","pl-8","pr-2","hover:bg-[var(--accent)]","hover:text-[var(--accent-foreground)]","focus:bg-[var(--accent)]","focus:text-[var(--accent-foreground)]","data-[selected=true]:bg-[var(--accent)]","data-[selected=true]:text-[var(--accent-foreground)]","data-[disabled=true]:pointer-events-none","data-[disabled=true]:opacity-50","data-[disabled=true]:text-[var(--menu-muted)]"],{variants:{size:{sm:"h-9 py-1.5 text-sm min-h-[44px]",default:"h-11 py-2 text-base min-h-[44px]",lg:"h-14 py-3 text-lg min-h-[44px]"}},defaultVariants:{size:"default"}}),K=classVarianceAuthority.cva(["z-50","w-[--trigger-width]","rounded-md","border","border-[var(--menu-border)]","bg-[var(--menu-background)]","text-[var(--menu-foreground)]","shadow-md","outline-none","overflow-auto","data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:zoom-in-95","data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:zoom-out-95"],{variants:{size:{sm:"max-h-[200px] p-1",default:"max-h-[300px] p-1",lg:"max-h-[400px] p-1"}},defaultVariants:{size:"default"}}),G=classVarianceAuthority.cva(["px-2","py-1.5","text-xs","font-semibold","text-[var(--menu-muted)]","uppercase","tracking-wider"],{variants:{size:{sm:"px-2 py-1 text-[10px]",default:"px-2 py-1.5 text-xs",lg:"px-3 py-2 text-sm"}},defaultVariants:{size:"default"}}),J=classVarianceAuthority.cva(["flex","items-center","gap-1.5","text-sm","font-medium","text-[var(--destructive)]","mt-1.5"],{variants:{size:{sm:"text-xs mt-1",default:"text-sm mt-1.5",lg:"text-base mt-2"}},defaultVariants:{size:"default"}});function X({ariaSelectProps:s,triggerContent:r,triggerRef:n,label:o,description:c,isRequired:u,isDisabled:d,isLoading:a,errorMessage:i,size:p,emptyStateMessage:N,childCount:b,children:v}){let f=react.useId(),y=react.useId(),h=react.useId(),S=!!i;return jsxRuntime.jsxs(reactAriaComponents.Select,{...s,isInvalid:S,children:[jsxRuntime.jsxs(reactAriaComponents.Label,{id:f,className:"text-sm font-medium text-[var(--content-foreground)]",children:[o,u&&jsxRuntime.jsx("span",{className:"text-[var(--destructive)] ml-1",children:"*"})]}),c&&jsxRuntime.jsx(reactAriaComponents.Text,{id:y,slot:"description",className:"text-sm text-[var(--menu-muted)] mt-1",children:c}),jsxRuntime.jsxs(reactAriaComponents.Button,{ref:n,className:q({size:p,isInvalid:S}),"aria-labelledby":f,"aria-describedby":c?y:i?h:void 0,"data-loading":a,...u&&{"aria-required":"true"},...a&&{"aria-busy":"true"},...(d||a)&&{"aria-disabled":"true"},children:[r,a?jsxRuntime.jsx(lucideReact.Loader2,{className:"h-4 w-4 animate-spin text-[var(--menu-muted)]","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 text-[var(--menu-muted)]","aria-hidden":"true"})]}),jsxRuntime.jsx(reactAriaComponents.FieldError,{id:h,className:J({size:p}),children:({validationErrors:g})=>{let m=i||g.join(" ");return m?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-4 w-4","aria-hidden":"true"}),m]}):null}}),jsxRuntime.jsx(reactAriaComponents.Popover,{className:K({size:p}),children:jsxRuntime.jsxs(reactAriaComponents.ListBox,{className:"outline-none",children:[a&&b>0&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:3}).map((g,m)=>jsxRuntime.jsx("div",{className:"h-11 px-4 py-2",children:jsxRuntime.jsx("div",{className:"h-4 bg-[var(--accent-background)] rounded animate-pulse"})},`skeleton-${m}`))}),!a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[v,b===0&&jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{id:"__empty__",textValue:"empty",isDisabled:true,className:"py-6 text-center text-sm text-[var(--menu-muted)] cursor-default pointer-events-none",children:jsxRuntime.jsx("span",{role:"status",children:N||"No options available"})})]})]})})]})}var Y=react.forwardRef(({label:s,placeholder:r,description:n,value:o,defaultValue:c,isOpen:u,isDisabled:d=false,isRequired:a=false,disabledKeys:i,validate:p,validationBehavior:N="aria",errorMessage:b,isLoading:v=false,emptyStateMessage:f,name:y,size:h="default",onChange:S,onOpenChange:g,className:m,children:M,...P},k)=>{let R=react.Children.count(M);return R>1e3&&console.warn("Select has >1000 items. Consider using Autocomplete component for better performance."),jsxRuntime.jsx(X,{ariaSelectProps:{value:o,defaultValue:c,onChange:C=>{S&&S(C);},placeholder:r,disabledKeys:i,isOpen:u,onOpenChange:g,isDisabled:d||v,isRequired:a,name:y,validate:p,validationBehavior:N,className:m,...P},triggerContent:jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:"flex-1 text-left truncate"}),triggerRef:k,label:s,description:n,isRequired:a,isDisabled:d,isLoading:v,errorMessage:b,size:h,emptyStateMessage:f,childCount:R,children:M})});Y.displayName="Select";var Z=react.forwardRef(({label:s,placeholder:r,description:n,value:o,defaultValue:c,selectionMode:u="multiple",isOpen:d,isDisabled:a=false,isRequired:i=false,disabledKeys:p,validate:N,validationBehavior:b="aria",errorMessage:v,isLoading:f=false,emptyStateMessage:y,name:h,size:S="default",onChange:g,onOpenChange:m,className:M,children:P,...k},R)=>{let C=react.Children.count(P);C>1e3&&console.warn("Select has >1000 items. Consider using Autocomplete component for better performance.");let O=react.useMemo(()=>{let z=new Map,I=te=>{react.Children.forEach(te,$=>{if(react.isValidElement($)){let V=$;if(V.type===H||V.props?.value){let _=V.props.value,j=V.props.children;_&&typeof j=="string"&&z.set(_,j);}V.props?.children&&I(V.props.children);}});};return I(P),z},[P]),ee=react.useMemo(()=>!o||!Array.isArray(o)||o.length===0?r||"":o.length<=2?o.map(I=>O.get(I)||I).join(", "):`${o.length} items selected`,[o,O,r]);return jsxRuntime.jsx(X,{ariaSelectProps:{value:o,defaultValue:c,onChange:z=>{g&&g(z);},selectionMode:"multiple",disabledKeys:p,isOpen:d,onOpenChange:m,isDisabled:a||f,isRequired:i,name:h,validate:N,validationBehavior:b,className:M,...k},triggerContent:jsxRuntime.jsx("span",{className:"flex-1 text-left truncate",children:ee}),triggerRef:R,label:s,description:n,isRequired:i,isDisabled:a,isLoading:f,errorMessage:v,size:S,emptyStateMessage:y,childCount:C,children:P})});Z.displayName="MultiSelect";var H=react.memo(function({children:r,textValue:n,value:o,isDisabled:c=false,className:u,...d}){if(!n&&typeof r!="string"){let a="Select.Item with custom children requires textValue prop for accessibility";if(process.env.NODE_ENV==="development")throw new Error(a);console.warn(a);}return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{id:o,textValue:n||(typeof r=="string"?r:void 0),className:`${F({size:"default"})} ${u||""}`,isDisabled:c,...d,children:({isSelected:a,selectionMode:i,isDisabled:p})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="multiple"?jsxRuntime.jsx(lucideReact.CheckSquare,{className:`absolute left-2 h-4 w-4 ${a?"visible":"invisible"}`,"aria-hidden":"true"}):a&&jsxRuntime.jsx(lucideReact.Check,{className:"absolute left-2 h-4 w-4","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:p?"text-[var(--menu-muted)]":"",children:r})]})})});H.displayName="SelectItem";function T({children:s,className:r,...n}){return jsxRuntime.jsx(reactAriaComponents.ListBoxSection,{className:`border-t border-[var(--border)] first:border-t-0 ${r||""}`,...n,children:s})}T.displayName="SelectSection";function D({children:s,className:r,...n}){return jsxRuntime.jsx(reactAriaComponents.Header,{className:`${G({size:"default"})} ${r||""}`,...n,children:s})}D.displayName="SelectHeader";var ve=Object.assign(Y,{Item:H,Section:T,Header:D}),ye=Object.assign(Z,{Item:H,Section:T,Header:D});var B=zod.z.object({className:zod.z.string().optional(),children:zod.z.any().optional(),id:zod.z.string().optional(),"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),"aria-describedby":zod.z.string().optional(),"aria-live":zod.z.enum(["off","polite","assertive"]).optional(),"aria-hidden":zod.z.boolean().optional(),"data-testid":zod.z.string().optional()});var he=zod.z.enum(["sm","default","lg"]),Pe=zod.z.enum(["single","multiple"]),Ve=zod.z.enum(["native","aria"]),Ne=B.extend({label:zod.z.string(),placeholder:zod.z.string().optional(),description:zod.z.string().optional(),value:zod.z.union([zod.z.string(),zod.z.array(zod.z.string())]).optional(),defaultValue:zod.z.union([zod.z.string(),zod.z.array(zod.z.string())]).optional(),selectionMode:Pe.optional().default("single"),isOpen:zod.z.boolean().optional(),isDisabled:zod.z.boolean().optional().default(false),isRequired:zod.z.boolean().optional().default(false),disabledKeys:zod.z.array(zod.z.string()).optional(),validate:zod.z.custom().optional(),validationBehavior:Ve.optional().default("aria"),errorMessage:zod.z.string().optional(),isLoading:zod.z.boolean().optional().default(false),emptyStateMessage:zod.z.string().optional(),name:zod.z.string().optional(),size:he.optional().default("default"),onChange:zod.z.custom().optional(),onOpenChange:zod.z.custom().optional(),children:zod.z.custom()}),ze=B.extend({value:zod.z.string(),textValue:zod.z.string().optional(),isDisabled:zod.z.boolean().optional().default(false),children:zod.z.custom(),className:zod.z.string().optional()}),Ie=B.extend({children:zod.z.custom(),className:zod.z.string().optional()}),we=B.extend({children:zod.z.custom(),className:zod.z.string().optional()});exports.MultiSelect=ye;exports.Select=ve;exports.SelectHeaderPropsSchema=we;exports.SelectItemPropsSchema=ze;exports.SelectPropsSchema=Ne;exports.SelectSectionPropsSchema=Ie;//# sourceMappingURL=index.js.map
2
+ 'use strict';var react=require('react'),reactAriaComponents=require('react-aria-components'),lucideReact=require('lucide-react'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod');var q=classVarianceAuthority.cva(["flex","w-full","items-center","justify-between","rounded-md","border","bg-[var(--content-background)]","text-[var(--content-foreground)]","transition-colors","duration-200","outline-none","focus-visible:ring-2","focus-visible:ring-[var(--ring)]","focus-visible:ring-offset-2","hover:bg-[var(--accent)]/10","disabled:cursor-not-allowed","disabled:opacity-50","data-[loading=true]:cursor-wait","truncate"],{variants:{size:{sm:"h-9 px-3 text-sm min-h-[44px]",default:"h-11 px-4 text-base min-h-[44px]",lg:"h-14 px-5 text-lg min-h-[44px]"},isInvalid:{true:"border-[var(--destructive-background)]",false:"border-[var(--input-border)] hover:border-[var(--input-border)]/80"}},defaultVariants:{size:"default",isInvalid:false}}),F=classVarianceAuthority.cva(["relative","flex","w-full","cursor-pointer","select-none","items-center","rounded-sm","outline-none","transition-colors","pl-8","pr-2","hover:bg-[var(--accent)]","hover:text-[var(--accent-foreground)]","focus:bg-[var(--accent)]","focus:text-[var(--accent-foreground)]","data-[selected=true]:bg-[var(--accent)]","data-[selected=true]:text-[var(--accent-foreground)]","data-[disabled=true]:pointer-events-none","data-[disabled=true]:opacity-50","data-[disabled=true]:text-[var(--menu-muted)]"],{variants:{size:{sm:"h-9 py-1.5 text-sm min-h-[44px]",default:"h-11 py-2 text-base min-h-[44px]",lg:"h-14 py-3 text-lg min-h-[44px]"}},defaultVariants:{size:"default"}}),K=classVarianceAuthority.cva(["z-50","w-[--trigger-width]","rounded-md","border","border-[var(--menu-border)]","bg-[var(--menu-background)]","text-[var(--menu-foreground)]","shadow-md","outline-none","overflow-auto","data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:zoom-in-95","data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:zoom-out-95"],{variants:{size:{sm:"max-h-[200px] p-1",default:"max-h-[300px] p-1",lg:"max-h-[400px] p-1"}},defaultVariants:{size:"default"}}),G=classVarianceAuthority.cva(["px-2","py-1.5","text-xs","font-semibold","text-[var(--menu-muted)]","uppercase","tracking-wider"],{variants:{size:{sm:"px-2 py-1 text-[10px]",default:"px-2 py-1.5 text-xs",lg:"px-3 py-2 text-sm"}},defaultVariants:{size:"default"}}),J=classVarianceAuthority.cva(["flex","items-center","gap-1.5","text-sm","font-medium","text-[var(--destructive-background)]","mt-1.5"],{variants:{size:{sm:"text-xs mt-1",default:"text-sm mt-1.5",lg:"text-base mt-2"}},defaultVariants:{size:"default"}});function X({ariaSelectProps:s,triggerContent:r,triggerRef:n,label:o,description:c,isRequired:u,isDisabled:d,isLoading:a,errorMessage:i,size:p,emptyStateMessage:N,childCount:b,children:v}){let f=react.useId(),y=react.useId(),h=react.useId(),S=!!i;return jsxRuntime.jsxs(reactAriaComponents.Select,{...s,isInvalid:S,children:[jsxRuntime.jsxs(reactAriaComponents.Label,{id:f,className:"text-sm font-medium text-[var(--content-foreground)]",children:[o,u&&jsxRuntime.jsx("span",{className:"text-[var(--destructive-background)] ml-1",children:"*"})]}),c&&jsxRuntime.jsx(reactAriaComponents.Text,{id:y,slot:"description",className:"text-sm text-[var(--menu-muted)] mt-1",children:c}),jsxRuntime.jsxs(reactAriaComponents.Button,{ref:n,className:q({size:p,isInvalid:S}),"aria-labelledby":f,"aria-describedby":c?y:i?h:void 0,"data-loading":a,...u&&{"aria-required":"true"},...a&&{"aria-busy":"true"},...(d||a)&&{"aria-disabled":"true"},children:[r,a?jsxRuntime.jsx(lucideReact.Loader2,{className:"h-4 w-4 animate-spin text-[var(--menu-muted)]","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 text-[var(--menu-muted)]","aria-hidden":"true"})]}),jsxRuntime.jsx(reactAriaComponents.FieldError,{id:h,className:J({size:p}),children:({validationErrors:g})=>{let m=i||g.join(" ");return m?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-4 w-4","aria-hidden":"true"}),m]}):null}}),jsxRuntime.jsx(reactAriaComponents.Popover,{className:K({size:p}),children:jsxRuntime.jsxs(reactAriaComponents.ListBox,{className:"outline-none",children:[a&&b>0&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:3}).map((g,m)=>jsxRuntime.jsx("div",{className:"h-11 px-4 py-2",children:jsxRuntime.jsx("div",{className:"h-4 bg-[var(--accent-background)] rounded animate-pulse"})},`skeleton-${m}`))}),!a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[v,b===0&&jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{id:"__empty__",textValue:"empty",isDisabled:true,className:"py-6 text-center text-sm text-[var(--menu-muted)] cursor-default pointer-events-none",children:jsxRuntime.jsx("span",{role:"status",children:N||"No options available"})})]})]})})]})}var Y=react.forwardRef(({label:s,placeholder:r,description:n,value:o,defaultValue:c,isOpen:u,isDisabled:d=false,isRequired:a=false,disabledKeys:i,validate:p,validationBehavior:N="aria",errorMessage:b,isLoading:v=false,emptyStateMessage:f,name:y,size:h="default",onChange:S,onOpenChange:g,className:m,children:M,...P},H)=>{let R=react.Children.count(M);return R>1e3&&console.warn("Select has >1000 items. Consider using Autocomplete component for better performance."),jsxRuntime.jsx(X,{ariaSelectProps:{value:o,defaultValue:c,onChange:C=>{S&&S(C);},placeholder:r,disabledKeys:i,isOpen:u,onOpenChange:g,isDisabled:d||v,isRequired:a,name:y,validate:p,validationBehavior:N,className:m,...P},triggerContent:jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:"flex-1 text-left truncate"}),triggerRef:H,label:s,description:n,isRequired:a,isDisabled:d,isLoading:v,errorMessage:b,size:h,emptyStateMessage:f,childCount:R,children:M})});Y.displayName="Select";var Z=react.forwardRef(({label:s,placeholder:r,description:n,value:o,defaultValue:c,selectionMode:u="multiple",isOpen:d,isDisabled:a=false,isRequired:i=false,disabledKeys:p,validate:N,validationBehavior:b="aria",errorMessage:v,isLoading:f=false,emptyStateMessage:y,name:h,size:S="default",onChange:g,onOpenChange:m,className:M,children:P,...H},R)=>{let C=react.Children.count(P);C>1e3&&console.warn("Select has >1000 items. Consider using Autocomplete component for better performance.");let O=react.useMemo(()=>{let z=new Map,I=te=>{react.Children.forEach(te,$=>{if(react.isValidElement($)){let V=$;if(V.type===k||V.props?.value){let _=V.props.value,j=V.props.children;_&&typeof j=="string"&&z.set(_,j);}V.props?.children&&I(V.props.children);}});};return I(P),z},[P]),ee=react.useMemo(()=>!o||!Array.isArray(o)||o.length===0?r||"":o.length<=2?o.map(I=>O.get(I)||I).join(", "):`${o.length} items selected`,[o,O,r]);return jsxRuntime.jsx(X,{ariaSelectProps:{value:o,defaultValue:c,onChange:z=>{g&&g(z);},selectionMode:"multiple",disabledKeys:p,isOpen:d,onOpenChange:m,isDisabled:a||f,isRequired:i,name:h,validate:N,validationBehavior:b,className:M,...H},triggerContent:jsxRuntime.jsx("span",{className:"flex-1 text-left truncate",children:ee}),triggerRef:R,label:s,description:n,isRequired:i,isDisabled:a,isLoading:f,errorMessage:v,size:S,emptyStateMessage:y,childCount:C,children:P})});Z.displayName="MultiSelect";var k=react.memo(function({children:r,textValue:n,value:o,isDisabled:c=false,className:u,...d}){if(!n&&typeof r!="string"){let a="Select.Item with custom children requires textValue prop for accessibility";if(process.env.NODE_ENV==="development")throw new Error(a);console.warn(a);}return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{id:o,textValue:n||(typeof r=="string"?r:void 0),className:`${F({size:"default"})} ${u||""}`,isDisabled:c,...d,children:({isSelected:a,selectionMode:i,isDisabled:p})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="multiple"?jsxRuntime.jsx(lucideReact.CheckSquare,{className:`absolute left-2 h-4 w-4 ${a?"visible":"invisible"}`,"aria-hidden":"true"}):a&&jsxRuntime.jsx(lucideReact.Check,{className:"absolute left-2 h-4 w-4","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:p?"text-[var(--menu-muted)]":"",children:r})]})})});k.displayName="SelectItem";function T({children:s,className:r,...n}){return jsxRuntime.jsx(reactAriaComponents.ListBoxSection,{className:`border-t border-[var(--border)] first:border-t-0 ${r||""}`,...n,children:s})}T.displayName="SelectSection";function D({children:s,className:r,...n}){return jsxRuntime.jsx(reactAriaComponents.Header,{className:`${G({size:"default"})} ${r||""}`,...n,children:s})}D.displayName="SelectHeader";var ve=Object.assign(Y,{Item:k,Section:T,Header:D}),ye=Object.assign(Z,{Item:k,Section:T,Header:D});var B=zod.z.object({className:zod.z.string().optional(),children:zod.z.any().optional(),id:zod.z.string().optional(),"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),"aria-describedby":zod.z.string().optional(),"aria-live":zod.z.enum(["off","polite","assertive"]).optional(),"aria-hidden":zod.z.boolean().optional(),"data-testid":zod.z.string().optional()});var he=zod.z.enum(["sm","default","lg"]),Pe=zod.z.enum(["single","multiple"]),Ve=zod.z.enum(["native","aria"]),Ne=B.extend({label:zod.z.string(),placeholder:zod.z.string().optional(),description:zod.z.string().optional(),value:zod.z.union([zod.z.string(),zod.z.array(zod.z.string())]).optional(),defaultValue:zod.z.union([zod.z.string(),zod.z.array(zod.z.string())]).optional(),selectionMode:Pe.optional().default("single"),isOpen:zod.z.boolean().optional(),isDisabled:zod.z.boolean().optional().default(false),isRequired:zod.z.boolean().optional().default(false),disabledKeys:zod.z.array(zod.z.string()).optional(),validate:zod.z.custom().optional(),validationBehavior:Ve.optional().default("aria"),errorMessage:zod.z.string().optional(),isLoading:zod.z.boolean().optional().default(false),emptyStateMessage:zod.z.string().optional(),name:zod.z.string().optional(),size:he.optional().default("default"),onChange:zod.z.custom().optional(),onOpenChange:zod.z.custom().optional(),children:zod.z.custom()}),ze=B.extend({value:zod.z.string(),textValue:zod.z.string().optional(),isDisabled:zod.z.boolean().optional().default(false),children:zod.z.custom(),className:zod.z.string().optional()}),Ie=B.extend({children:zod.z.custom(),className:zod.z.string().optional()}),we=B.extend({children:zod.z.custom(),className:zod.z.string().optional()});exports.MultiSelect=ye;exports.Select=ve;exports.SelectHeaderPropsSchema=we;exports.SelectItemPropsSchema=ze;exports.SelectPropsSchema=Ne;exports.SelectSectionPropsSchema=Ie;//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/elements/Select/Select.styles.ts","../../../src/elements/Select/Select.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/Select/Select.types.ts"],"names":["selectTriggerVariants","cva","selectItemVariants","selectPopoverVariants","selectSectionVariants","selectErrorVariants","SelectBase","ariaSelectProps","triggerContent","triggerRef","label","description","isRequired","isDisabled","isLoading","errorMessage","size","emptyStateMessage","childCount","children","labelId","useId","descriptionId","errorId","isInvalid","jsxs","AriaSelect","Label","jsx","Text","Button","Loader2","ChevronDown","FieldError","validationErrors","displayError","Fragment","AlertCircle","Popover","ListBox","_","i","ListBoxItem","SelectRoot","forwardRef","placeholder","value","defaultValue","isOpen","disabledKeys","validate","validationBehavior","name","onChange","onOpenChange","className","props","ref","Children","key","SelectValue","MultiSelectRoot","_selectionMode","valueToLabelMap","useMemo","map","processChildren","nodes","child","isValidElement","element","SelectItem","itemValue","itemChildren","displayValue","v","keys","memo","textValue","message","isSelected","selectionMode","itemDisabled","CheckSquare","Check","SelectSection","ListBoxSection","SelectHeader","Header","Select","MultiSelect","BaseComponentPropsSchema","z","SelectSizeSchema","SelectionModeSchema","ValidationBehaviorSchema","SelectPropsSchema","SelectItemPropsSchema","SelectSectionPropsSchema","SelectHeaderPropsSchema"],"mappings":"uPAQO,IAAMA,CAAAA,CAAwBC,2BACnC,CAEE,MAAA,CACA,SACA,cAAA,CACA,iBAAA,CACA,aACA,QAAA,CACA,gCAAA,CACA,mCACA,mBAAA,CACA,cAAA,CACA,cAAA,CAEA,sBAAA,CACA,mCACA,6BAAA,CAEA,6BAAA,CAEA,8BACA,qBAAA,CAEA,iCAAA,CAEA,UACF,CAAA,CACA,CACE,SAAU,CACR,IAAA,CAAM,CAGJ,EAAA,CAAI,+BAAA,CACJ,QAAS,kCAAA,CACT,EAAA,CAAI,gCACN,CAAA,CACA,SAAA,CAAW,CACT,IAAA,CAAM,8BACN,KAAA,CAAO,sDACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,SAAA,CACN,UAAW,KACb,CACF,CACF,CAAA,CAQaC,CAAAA,CAAqBD,2BAChC,CAEE,UAAA,CACA,OACA,QAAA,CACA,gBAAA,CACA,aAAA,CACA,cAAA,CACA,aACA,cAAA,CACA,mBAAA,CAEA,OACA,MAAA,CAEA,0BAAA,CACA,wCAEA,0BAAA,CACA,uCAAA,CAEA,0CACA,sDAAA,CAEA,0CAAA,CACA,kCACA,+CACF,CAAA,CACA,CACE,QAAA,CAAU,CACR,KAAM,CAEJ,EAAA,CAAI,iCAAA,CACJ,OAAA,CAAS,mCACT,EAAA,CAAI,gCACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,SACR,CACF,CACF,CAAA,CAQa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G7D,SAAUA,KAAAA,CAAE,MAAA,EACd,CAAC,EAaYK,EAAAA,CAAwBN,CAAAA,CAAyB,OAAO,CAEnE,KAAA,CAAOC,MAAE,MAAA,EAAO,CAGhB,UAAWA,KAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAG/B,WAAYA,KAAAA,CAAE,OAAA,GAAU,QAAA,EAAS,CAAE,OAAA,CAAQ,KAAK,EAGhD,QAAA,CAAUA,KAAAA,CAAE,QAAkB,CAG9B,SAAA,CAAWA,MAAE,MAAA,EAAO,CAAE,UACxB,CAAC,EAUYM,EAAAA,CAA2BP,CAAAA,CAAyB,OAAO,CAEtE,QAAA,CAAUC,MAAE,MAAA,EAAkB,CAG9B,UAAWA,KAAAA,CAAE,MAAA,GAAS,QAAA,EACxB,CAAC,CAAA,CASYO,EAAAA,CAA0BR,EAAyB,MAAA,CAAO,CAErE,SAAUC,KAAAA,CAAE,MAAA,GAGZ,SAAA,CAAWA,KAAAA,CAAE,QAAO,CAAE,QAAA,EACxB,CAAC","file":"index.js","sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\n/**\n * CVA Variants for Select Trigger Button\n *\n * Styles the trigger button that opens the select popover.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectTriggerVariants = cva(\n [\n // Base styles\n 'flex',\n 'w-full',\n 'items-center',\n 'justify-between',\n 'rounded-md',\n 'border',\n 'bg-[var(--content-background)]',\n 'text-[var(--content-foreground)]',\n 'transition-colors',\n 'duration-200',\n 'outline-none',\n // Focus ring (WCAG 2.2 AAA - 7:1 contrast)\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n // Hover state\n 'hover:bg-[var(--accent)]/10',\n // Disabled state\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n // Loading state\n 'data-[loading=true]:cursor-wait',\n // Truncate text\n 'truncate',\n ],\n {\n variants: {\n size: {\n // All sizes use 44px minimum touch target for WCAG 2.2 AAA compliance\n // Visual height varies but touch area remains accessible\n sm: 'h-9 px-3 text-sm min-h-[44px]',\n default: 'h-11 px-4 text-base min-h-[44px]',\n lg: 'h-14 px-5 text-lg min-h-[44px]',\n },\n isInvalid: {\n true: 'border-[var(--destructive)]',\n false: 'border-[var(--input)] hover:border-[var(--input)]/80',\n },\n },\n defaultVariants: {\n size: 'default',\n isInvalid: false,\n },\n }\n);\n\n/**\n * CVA Variants for Select Items\n *\n * Styles individual selectable items within the listbox.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectItemVariants = cva(\n [\n // Base styles\n 'relative',\n 'flex',\n 'w-full',\n 'cursor-pointer',\n 'select-none',\n 'items-center',\n 'rounded-sm',\n 'outline-none',\n 'transition-colors',\n // Padding for checkmark icon (left side)\n 'pl-8',\n 'pr-2',\n // Hover state\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n // Focus state\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n // Selected state\n 'data-[selected=true]:bg-[var(--accent)]',\n 'data-[selected=true]:text-[var(--accent-foreground)]',\n // Disabled state\n 'data-[disabled=true]:pointer-events-none',\n 'data-[disabled=true]:opacity-50',\n 'data-[disabled=true]:text-[var(--menu-muted)]',\n ],\n {\n variants: {\n size: {\n // All sizes use 44px minimum touch target for WCAG 2.2 AAA compliance\n sm: 'h-9 py-1.5 text-sm min-h-[44px]',\n default: 'h-11 py-2 text-base min-h-[44px]',\n lg: 'h-14 py-3 text-lg min-h-[44px]',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Select Popover\n *\n * Styles the popover container that holds the listbox.\n * Uses menu tokens to match Dropdown styling.\n */\nexport const selectPopoverVariants = cva(\n [\n // Base styles - use menu tokens to match Dropdown styling\n 'z-50',\n 'w-[--trigger-width]',\n 'rounded-md',\n 'border',\n 'border-[var(--menu-border)]',\n 'bg-[var(--menu-background)]',\n 'text-[var(--menu-foreground)]',\n 'shadow-md',\n 'outline-none',\n 'overflow-auto',\n // Animations\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n ],\n {\n variants: {\n size: {\n sm: 'max-h-[200px] p-1',\n default: 'max-h-[300px] p-1',\n lg: 'max-h-[400px] p-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Section Headers\n *\n * Styles the non-interactive section header labels within grouped selects.\n */\nexport const selectSectionVariants = cva(\n [\n 'px-2',\n 'py-1.5',\n 'text-xs',\n 'font-semibold',\n 'text-[var(--menu-muted)]',\n 'uppercase',\n 'tracking-wider',\n ],\n {\n variants: {\n size: {\n sm: 'px-2 py-1 text-[10px]',\n default: 'px-2 py-1.5 text-xs',\n lg: 'px-3 py-2 text-sm',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Error Messages\n *\n * Styles the error message displayed below the select trigger.\n */\nexport const selectErrorVariants = cva(\n [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-sm',\n 'font-medium',\n 'text-[var(--destructive)]',\n 'mt-1.5',\n ],\n {\n variants: {\n size: {\n sm: 'text-xs mt-1',\n default: 'text-sm mt-1.5',\n lg: 'text-base mt-2',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * Type exports for variant props.\n * Allows TypeScript inference of variant combinations.\n */\nexport type SelectTriggerVariantProps = VariantProps<typeof selectTriggerVariants>;\nexport type SelectItemVariantProps = VariantProps<typeof selectItemVariants>;\nexport type SelectPopoverVariantProps = VariantProps<typeof selectPopoverVariants>;\nexport type SelectSectionVariantProps = VariantProps<typeof selectSectionVariants>;\nexport type SelectErrorVariantProps = VariantProps<typeof selectErrorVariants>;\n","'use client';\n\n/**\n * Select Component - Implementation\n *\n * Accessible select/dropdown component combining React Aria primitives with ShadCN styling.\n * Follows Themis library patterns with compound component structure.\n *\n * Architecture:\n * - SelectBase: Internal component containing shared label, description, trigger, error, and listbox rendering.\n * - SelectRoot: Single selection wrapper (thin layer over SelectBase).\n * - MultiSelectRoot: Multiple selection wrapper with display value logic (thin layer over SelectBase).\n * - SelectItem, SelectSection, SelectHeader: Compound sub-components.\n *\n * @see select-prd.md (Full requirements)\n * @see Select.types.ts (Zod schemas)\n * @see Select.styles.ts (CVA variant definitions)\n * @see plan.md (Implementation plan)\n */\n\nimport {\n forwardRef,\n memo,\n Children,\n useId,\n useMemo,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport {\n Select as AriaSelect,\n Label,\n Button,\n SelectValue,\n Popover,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Header,\n Text,\n FieldError,\n} from 'react-aria-components';\nimport { Check, CheckSquare, ChevronDown, Loader2, AlertCircle } from 'lucide-react';\nimport type {\n SelectProps,\n SelectItemProps,\n SelectSectionProps,\n SelectHeaderProps,\n SelectSize,\n} from './Select.types';\nimport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n// Re-export CVA variants so existing imports from './Select' continue to work\nexport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n/**\n * Internal props for SelectBase.\n * Extends the shared props with selection-mode-specific configuration.\n */\ninterface SelectBaseProps {\n /** The AriaSelect props to spread onto the root element */\n ariaSelectProps: Record<string, unknown>;\n /** Content to render inside the trigger button (SelectValue for single, span for multi) */\n triggerContent: ReactNode;\n /** Ref to forward to the trigger button */\n triggerRef: Ref<HTMLButtonElement>;\n /** Label text */\n label: string;\n /** Optional description text */\n description?: string;\n /** Whether the field is required */\n isRequired: boolean;\n /** Whether the field is disabled */\n isDisabled: boolean;\n /** Whether the field is in a loading state */\n isLoading: boolean;\n /** Error message to display */\n errorMessage?: string;\n /** Size variant */\n size: SelectSize;\n /** Empty state message override */\n emptyStateMessage?: string;\n /** Child count (pre-computed by parent) */\n childCount: number;\n /** Children to render in the listbox */\n children: ReactNode;\n}\n\n/**\n * SelectBase - Internal shared rendering component\n *\n * Contains the shared rendering logic for label, description, trigger button,\n * error message, and popover/listbox that both SelectRoot and MultiSelectRoot use.\n * This is not exported as part of the public API.\n */\nfunction SelectBase({\n ariaSelectProps,\n triggerContent,\n triggerRef,\n label,\n description,\n isRequired,\n isDisabled,\n isLoading,\n errorMessage,\n size,\n emptyStateMessage,\n childCount,\n children,\n}: SelectBaseProps): ReactElement {\n // Generate unique IDs for accessibility\n const labelId = useId();\n const descriptionId = useId();\n const errorId = useId();\n\n // Determine if invalid based on errorMessage\n const isInvalid = Boolean(errorMessage);\n\n return (\n <AriaSelect\n {...ariaSelectProps}\n isInvalid={isInvalid}\n >\n {/* Label */}\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && <span className=\"text-[var(--destructive)] ml-1\">*</span>}\n </Label>\n\n {/* Description (if provided) */}\n {description && (\n <Text id={descriptionId} slot=\"description\" className=\"text-sm text-[var(--menu-muted)] mt-1\">\n {description}\n </Text>\n )}\n\n {/* Trigger Button */}\n <Button\n ref={triggerRef}\n className={selectTriggerVariants({ size, isInvalid })}\n aria-labelledby={labelId}\n aria-describedby={description ? descriptionId : errorMessage ? errorId : undefined}\n data-loading={isLoading}\n {...(isRequired && { 'aria-required': 'true' })}\n {...(isLoading && { 'aria-busy': 'true' })}\n {...((isDisabled || isLoading) && { 'aria-disabled': 'true' })}\n >\n {triggerContent}\n\n {/* Loading spinner or chevron icon */}\n {isLoading ? (\n <Loader2 className=\"h-4 w-4 animate-spin text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n ) : (\n <ChevronDown className=\"h-4 w-4 text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n )}\n </Button>\n\n {/* Error Message */}\n <FieldError id={errorId} className={selectErrorVariants({ size })}>\n {({ validationErrors }) => {\n // Display custom errorMessage if provided, otherwise show validation errors\n const displayError = errorMessage || validationErrors.join(' ');\n return displayError ? (\n <>\n <AlertCircle className=\"h-4 w-4\" aria-hidden=\"true\" />\n {displayError}\n </>\n ) : null;\n }}\n </FieldError>\n\n {/* Popover with ListBox */}\n <Popover className={selectPopoverVariants({ size })}>\n <ListBox className=\"outline-none\">\n {/* Loading skeleton (if loading and has children) */}\n {isLoading && childCount > 0 && (\n <>\n {Array.from({ length: 3 }).map((_, i) => (\n <div\n key={`skeleton-${i}`}\n className=\"h-11 px-4 py-2\"\n >\n <div className=\"h-4 bg-[var(--accent-background)] rounded animate-pulse\" />\n </div>\n ))}\n </>\n )}\n\n {/* Items or empty state */}\n {!isLoading && (\n <>\n {children}\n {/* Empty state - render as disabled item so popover can open */}\n {childCount === 0 && (\n <ListBoxItem\n id=\"__empty__\"\n textValue=\"empty\"\n isDisabled\n className=\"py-6 text-center text-sm text-[var(--menu-muted)] cursor-default pointer-events-none\"\n >\n <span role=\"status\">\n {emptyStateMessage || 'No options available'}\n </span>\n </ListBoxItem>\n )}\n </>\n )}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n}\n\n/**\n * Select Root Component (Single Selection Only)\n *\n * Main select component with controlled/uncontrolled modes for single selection.\n * For multiple selection, use MultiSelect component.\n * Delegates shared rendering to SelectBase.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst SelectRoot = forwardRef<HTMLButtonElement, Omit<SelectProps, 'selectionMode'>>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items (Decision 22: Large Item Count Handling)\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string,\n defaultValue: defaultValue as string,\n onChange: (key: unknown) => {\n if (onChange) {\n onChange(key as string);\n }\n },\n placeholder,\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={<SelectValue className=\"flex-1 text-left truncate\" />}\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nSelectRoot.displayName = 'Select';\n\n/**\n * MultiSelect Root Component (Multiple Selection)\n *\n * Select component for multiple selection. Uses different API from single Select.\n * Delegates shared rendering to SelectBase, adding multi-select display value logic.\n *\n * @see select-prd.md US-6 (Multiple Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst MultiSelectRoot = forwardRef<HTMLButtonElement, SelectProps>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n selectionMode: _selectionMode = 'multiple',\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n // Build value-to-label map for display (memoized to prevent recreation on every render)\n const valueToLabelMap = useMemo(() => {\n const map = new Map<string, string>();\n const processChildren = (nodes: ReactNode): void => {\n Children.forEach(nodes, (child) => {\n if (isValidElement(child)) {\n const element = child as ReactElement<{ value?: string; children?: ReactNode }>;\n if (element.type === SelectItem || element.props?.value) {\n const itemValue = element.props.value;\n const itemChildren = element.props.children;\n if (itemValue && typeof itemChildren === 'string') {\n map.set(itemValue, itemChildren);\n }\n }\n if (element.props?.children) {\n processChildren(element.props.children);\n }\n }\n });\n };\n processChildren(children);\n return map;\n }, [children]);\n\n // Multi-select display logic (Decision 5: Multi-select threshold)\n // Memoized to prevent recalculation on every render\n const displayValue = useMemo(() => {\n if (!value || !Array.isArray(value) || value.length === 0) {\n return placeholder || '';\n }\n\n if (value.length <= 2) {\n // Show item labels for 1-2 items\n const labels = value.map(v => valueToLabelMap.get(v as string) || v);\n return labels.join(', ');\n }\n\n // Show count for 3+ items\n return `${value.length} items selected`;\n }, [value, valueToLabelMap, placeholder]);\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string[],\n defaultValue: defaultValue as string[],\n onChange: (keys: unknown) => {\n if (onChange) {\n onChange(keys as string[]);\n }\n },\n selectionMode: 'multiple',\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={\n <span className=\"flex-1 text-left truncate\">\n {displayValue}\n </span>\n }\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nMultiSelectRoot.displayName = 'MultiSelect';\n\n/**\n * Select.Item Component\n *\n * Individual selectable item with checkmark icon.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 6 (Left-side checkmark)\n * @see plan.md Decision 23 (textValue required for custom children)\n */\nconst SelectItem = memo(function SelectItem({ children, textValue, value, isDisabled = false, className, ...props }: SelectItemProps): ReactElement {\n // Validate textValue for custom children (Decision 23)\n if (!textValue && typeof children !== 'string') {\n const message = 'Select.Item with custom children requires textValue prop for accessibility';\n if (process.env.NODE_ENV === 'development') {\n throw new Error(message);\n } else {\n console.warn(message);\n }\n }\n\n return (\n <ListBoxItem\n id={value}\n textValue={textValue || (typeof children === 'string' ? children : undefined)}\n className={`${selectItemVariants({ size: 'default' })} ${className || ''}`}\n isDisabled={isDisabled}\n {...props}\n >\n {({ isSelected, selectionMode, isDisabled: itemDisabled }) => (\n <>\n {/* Checkmark icon (left side) - Decision 6 */}\n {selectionMode === 'multiple' ? (\n <CheckSquare\n className={`absolute left-2 h-4 w-4 ${isSelected ? 'visible' : 'invisible'}`}\n aria-hidden=\"true\"\n />\n ) : (\n isSelected && <Check className=\"absolute left-2 h-4 w-4\" aria-hidden=\"true\" />\n )}\n <span className={itemDisabled ? 'text-[var(--menu-muted)]' : ''}>\n {children}\n </span>\n </>\n )}\n </ListBoxItem>\n );\n});\n\nSelectItem.displayName = 'SelectItem';\n\n/**\n * Select.Section Component\n *\n * Groups related items with optional header.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectSection({ children, className, ...props }: SelectSectionProps): ReactElement {\n return (\n <ListBoxSection className={`border-t border-[var(--border)] first:border-t-0 ${className || ''}`} {...props}>\n {children}\n </ListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n\n/**\n * Select.Header Component\n *\n * Section header with non-interactive label.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectHeader({ children, className, ...props }: SelectHeaderProps): ReactElement {\n return (\n <Header className={`${selectSectionVariants({ size: 'default' })} ${className || ''}`} {...props}>\n {children}\n </Header>\n );\n}\n\nSelectHeader.displayName = 'SelectHeader';\n\n/**\n * Compound Component Exports\n *\n * Uses Object.assign() for compound components (e.g., Select.Item, Select.Section).\n * Named exports (SelectItem, SelectSection, SelectHeader) are also available below\n * for better tree-shaking. Prefer named exports in new code.\n *\n * @deprecated (v2) The Object.assign compound pattern will be removed in v2.\n * Migrate to named imports: `import { SelectItem, SelectSection, SelectHeader } from '...'`\n *\n * @see GUIDE.mdx (Compound component pattern)\n */\nexport const Select = Object.assign(SelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\nexport const MultiSelect = Object.assign(MultiSelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\n// Named exports for individual components (preferred for tree-shaking)\nexport { SelectRoot, MultiSelectRoot, SelectItem, SelectSection, SelectHeader };\n","import { z } from 'zod';\n\n/**\n * Base props schema for all Themis components\n * Ensures consistent accessibility and styling APIs across the library\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements)\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AA minimum)\n */\nexport const BaseComponentPropsSchema = z.object({\n // Styling\n className: z.string().optional(),\n\n // React\n children: z.any().optional(), // ReactNode not directly supported by Zod\n id: z.string().optional(),\n\n // Accessibility (WCAG 2.2 AA requirements)\n 'aria-label': z.string().optional(),\n 'aria-labelledby': z.string().optional(),\n 'aria-describedby': z.string().optional(),\n 'aria-live': z.enum(['off', 'polite', 'assertive']).optional(),\n 'aria-hidden': z.boolean().optional(),\n\n // Testing & Development\n 'data-testid': z.string().optional(),\n});\n\nexport type BaseComponentProps = z.infer<typeof BaseComponentPropsSchema>;\n","import { z } from 'zod';\nimport { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\nimport type { ReactNode } from 'react';\nimport type {\n SelectProps as AriaSelectProps,\n ListBoxItemProps as AriaListBoxItemProps,\n} from 'react-aria-components';\n\n/**\n * Select size variants\n *\n * @see select-prd.md US-9 (Visual States - Size Variants)\n * @see plan.md Decision 4 (Include sm size with warning for desktop-only)\n */\nexport const SelectSizeSchema = z.enum(['sm', 'default', 'lg']);\nexport type SelectSize = z.infer<typeof SelectSizeSchema>;\n\n/**\n * Select selection mode\n *\n * @see select-prd.md US-6 (Multiple Selection)\n */\nexport const SelectionModeSchema = z.enum(['single', 'multiple']);\nexport type SelectionMode = z.infer<typeof SelectionModeSchema>;\n\n/**\n * Select validation behavior\n *\n * @see select-prd.md US-4 (Validation and Error Messages)\n */\nexport const ValidationBehaviorSchema = z.enum(['native', 'aria']);\nexport type ValidationBehavior = z.infer<typeof ValidationBehaviorSchema>;\n\n/**\n * Select root component props schema\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see select-prd.md US-4 (Validation and Error Messages)\n * @see select-prd.md US-5 (Disabled States)\n * @see select-prd.md US-6 (Multiple Selection)\n * @see select-prd.md US-7 (Async Data Loading)\n * @see select-prd.md US-10 (Form Integration)\n */\nexport const SelectPropsSchema = BaseComponentPropsSchema.extend({\n // Display props (US-1)\n label: z.string(), // Required for accessibility\n placeholder: z.string().optional(),\n description: z.string().optional(),\n\n // Selection props (US-1, US-6)\n value: z.union([z.string(), z.array(z.string())]).optional(),\n defaultValue: z.union([z.string(), z.array(z.string())]).optional(),\n selectionMode: SelectionModeSchema.optional().default('single'),\n\n // State props (US-1, US-5)\n isOpen: z.boolean().optional(),\n isDisabled: z.boolean().optional().default(false),\n isRequired: z.boolean().optional().default(false),\n disabledKeys: z.array(z.string()).optional(),\n\n // Validation props (US-4)\n validate: z\n .custom<(value: string | string[]) => string | undefined>()\n .optional(),\n validationBehavior: ValidationBehaviorSchema.optional().default('aria'),\n errorMessage: z.string().optional(),\n\n // Loading state (US-7)\n isLoading: z.boolean().optional().default(false),\n emptyStateMessage: z.string().optional(),\n\n // Form integration (US-10)\n name: z.string().optional(),\n\n // Size variant (US-9)\n size: SelectSizeSchema.optional().default('default'),\n\n // Event handlers (US-1)\n onChange: z\n .custom<(value: string | string[]) => void>()\n .optional(),\n onOpenChange: z.custom<(isOpen: boolean) => void>().optional(),\n\n // Children (Select.Item, Select.Section components)\n children: z.custom<ReactNode>(),\n});\n\nexport type SelectProps = z.infer<typeof SelectPropsSchema> &\n Omit<AriaSelectProps<object>, keyof z.infer<typeof SelectPropsSchema>>;\n\n/**\n * Select.Item props schema\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see select-prd.md US-5 (Disabled States)\n * @see select-prd.md US-8 (Custom Value Rendering)\n * @see plan.md Decision 23 (textValue required for custom children)\n */\nexport const SelectItemPropsSchema = BaseComponentPropsSchema.extend({\n // Item value (required)\n value: z.string(),\n\n // Text value for typeahead and accessibility (required for custom children)\n textValue: z.string().optional(),\n\n // Disabled state\n isDisabled: z.boolean().optional().default(false),\n\n // Item content\n children: z.custom<ReactNode>(),\n\n // Optional className for custom styling\n className: z.string().optional(),\n});\n\nexport type SelectItemProps = z.infer<typeof SelectItemPropsSchema> &\n Omit<AriaListBoxItemProps, keyof z.infer<typeof SelectItemPropsSchema>>;\n\n/**\n * Select.Section props schema\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nexport const SelectSectionPropsSchema = BaseComponentPropsSchema.extend({\n // Section content (typically Select.Header + Select.Item components)\n children: z.custom<ReactNode>(),\n\n // Optional className for custom styling\n className: z.string().optional(),\n});\n\nexport type SelectSectionProps = z.infer<typeof SelectSectionPropsSchema>;\n\n/**\n * Select.Header props schema (for section headers)\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nexport const SelectHeaderPropsSchema = BaseComponentPropsSchema.extend({\n // Header text\n children: z.custom<ReactNode>(),\n\n // Optional className for header styling\n className: z.string().optional(),\n});\n\nexport type SelectHeaderProps = z.infer<typeof SelectHeaderPropsSchema>;\n\n/**\n * CVA variant configuration types\n * Used for class-variance-authority integration\n */\nexport type SelectVariantSize = SelectSize;\nexport type SelectVariantSelectionMode = SelectionMode;\n"]}
1
+ {"version":3,"sources":["../../../src/elements/Select/Select.styles.ts","../../../src/elements/Select/Select.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/Select/Select.types.ts"],"names":["selectTriggerVariants","cva","selectItemVariants","selectPopoverVariants","selectSectionVariants","selectErrorVariants","SelectBase","ariaSelectProps","triggerContent","triggerRef","label","description","isRequired","isDisabled","isLoading","errorMessage","size","emptyStateMessage","childCount","children","labelId","useId","descriptionId","errorId","isInvalid","jsxs","AriaSelect","Label","jsx","Text","Button","Loader2","ChevronDown","FieldError","validationErrors","displayError","Fragment","AlertCircle","Popover","ListBox","_","i","ListBoxItem","SelectRoot","forwardRef","placeholder","value","defaultValue","isOpen","disabledKeys","validate","validationBehavior","name","onChange","onOpenChange","className","props","ref","Children","key","SelectValue","MultiSelectRoot","_selectionMode","valueToLabelMap","useMemo","map","processChildren","nodes","child","isValidElement","element","SelectItem","itemValue","itemChildren","displayValue","v","keys","memo","textValue","message","isSelected","selectionMode","itemDisabled","CheckSquare","Check","SelectSection","ListBoxSection","SelectHeader","Header","Select","MultiSelect","BaseComponentPropsSchema","z","SelectSizeSchema","SelectionModeSchema","ValidationBehaviorSchema","SelectPropsSchema","SelectItemPropsSchema","SelectSectionPropsSchema","SelectHeaderPropsSchema"],"mappings":"uPAQO,IAAMA,CAAAA,CAAwBC,2BACnC,CAEE,MAAA,CACA,SACA,cAAA,CACA,iBAAA,CACA,aACA,QAAA,CACA,gCAAA,CACA,mCACA,mBAAA,CACA,cAAA,CACA,cAAA,CAEA,sBAAA,CACA,mCACA,6BAAA,CAEA,6BAAA,CAEA,8BACA,qBAAA,CAEA,iCAAA,CAEA,UACF,CAAA,CACA,CACE,SAAU,CACR,IAAA,CAAM,CAGJ,EAAA,CAAI,+BAAA,CACJ,QAAS,kCAAA,CACT,EAAA,CAAI,gCACN,CAAA,CACA,SAAA,CAAW,CACT,IAAA,CAAM,yCACN,KAAA,CAAO,oEACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,SAAA,CACN,UAAW,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,OAAA,CAAQ,MAAM,EACtE,YAAA,CAAcH,KAAAA,CAAE,QAAO,CAAE,QAAA,GAGzB,SAAA,CAAWA,KAAAA,CAAE,SAAQ,CAAE,QAAA,GAAW,OAAA,CAAQ,KAAK,EAC/C,iBAAA,CAAmBA,KAAAA,CAAE,QAAO,CAAE,QAAA,GAG9B,IAAA,CAAMA,KAAAA,CAAE,QAAO,CAAE,QAAA,EAAS,CAG1B,IAAA,CAAMC,GAAiB,QAAA,EAAS,CAAE,QAAQ,SAAS,CAAA,CAGnD,SAAUD,KAAAA,CACP,MAAA,GACA,QAAA,EAAS,CACZ,aAAcA,KAAAA,CAAE,MAAA,GAAoC,QAAA,EAAS,CAG7D,SAAUA,KAAAA,CAAE,MAAA,EACd,CAAC,EAaYK,EAAAA,CAAwBN,CAAAA,CAAyB,OAAO,CAEnE,KAAA,CAAOC,MAAE,MAAA,EAAO,CAGhB,UAAWA,KAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAG/B,WAAYA,KAAAA,CAAE,OAAA,GAAU,QAAA,EAAS,CAAE,OAAA,CAAQ,KAAK,EAGhD,QAAA,CAAUA,KAAAA,CAAE,QAAkB,CAG9B,SAAA,CAAWA,MAAE,MAAA,EAAO,CAAE,UACxB,CAAC,EAUYM,EAAAA,CAA2BP,CAAAA,CAAyB,OAAO,CAEtE,QAAA,CAAUC,MAAE,MAAA,EAAkB,CAG9B,UAAWA,KAAAA,CAAE,MAAA,GAAS,QAAA,EACxB,CAAC,CAAA,CASYO,EAAAA,CAA0BR,EAAyB,MAAA,CAAO,CAErE,SAAUC,KAAAA,CAAE,MAAA,GAGZ,SAAA,CAAWA,KAAAA,CAAE,QAAO,CAAE,QAAA,EACxB,CAAC","file":"index.js","sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\n/**\n * CVA Variants for Select Trigger Button\n *\n * Styles the trigger button that opens the select popover.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectTriggerVariants = cva(\n [\n // Base styles\n 'flex',\n 'w-full',\n 'items-center',\n 'justify-between',\n 'rounded-md',\n 'border',\n 'bg-[var(--content-background)]',\n 'text-[var(--content-foreground)]',\n 'transition-colors',\n 'duration-200',\n 'outline-none',\n // Focus ring (WCAG 2.2 AAA - 7:1 contrast)\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n // Hover state\n 'hover:bg-[var(--accent)]/10',\n // Disabled state\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n // Loading state\n 'data-[loading=true]:cursor-wait',\n // Truncate text\n 'truncate',\n ],\n {\n variants: {\n size: {\n // All sizes use 44px minimum touch target for WCAG 2.2 AAA compliance\n // Visual height varies but touch area remains accessible\n sm: 'h-9 px-3 text-sm min-h-[44px]',\n default: 'h-11 px-4 text-base min-h-[44px]',\n lg: 'h-14 px-5 text-lg min-h-[44px]',\n },\n isInvalid: {\n true: 'border-[var(--destructive-background)]',\n false: 'border-[var(--input-border)] hover:border-[var(--input-border)]/80',\n },\n },\n defaultVariants: {\n size: 'default',\n isInvalid: false,\n },\n }\n);\n\n/**\n * CVA Variants for Select Items\n *\n * Styles individual selectable items within the listbox.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectItemVariants = cva(\n [\n // Base styles\n 'relative',\n 'flex',\n 'w-full',\n 'cursor-pointer',\n 'select-none',\n 'items-center',\n 'rounded-sm',\n 'outline-none',\n 'transition-colors',\n // Padding for checkmark icon (left side)\n 'pl-8',\n 'pr-2',\n // Hover state\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n // Focus state\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n // Selected state\n 'data-[selected=true]:bg-[var(--accent)]',\n 'data-[selected=true]:text-[var(--accent-foreground)]',\n // Disabled state\n 'data-[disabled=true]:pointer-events-none',\n 'data-[disabled=true]:opacity-50',\n 'data-[disabled=true]:text-[var(--menu-muted)]',\n ],\n {\n variants: {\n size: {\n // All sizes use 44px minimum touch target for WCAG 2.2 AAA compliance\n sm: 'h-9 py-1.5 text-sm min-h-[44px]',\n default: 'h-11 py-2 text-base min-h-[44px]',\n lg: 'h-14 py-3 text-lg min-h-[44px]',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Select Popover\n *\n * Styles the popover container that holds the listbox.\n * Uses menu tokens to match Dropdown styling.\n */\nexport const selectPopoverVariants = cva(\n [\n // Base styles - use menu tokens to match Dropdown styling\n 'z-50',\n 'w-[--trigger-width]',\n 'rounded-md',\n 'border',\n 'border-[var(--menu-border)]',\n 'bg-[var(--menu-background)]',\n 'text-[var(--menu-foreground)]',\n 'shadow-md',\n 'outline-none',\n 'overflow-auto',\n // Animations\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n ],\n {\n variants: {\n size: {\n sm: 'max-h-[200px] p-1',\n default: 'max-h-[300px] p-1',\n lg: 'max-h-[400px] p-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Section Headers\n *\n * Styles the non-interactive section header labels within grouped selects.\n */\nexport const selectSectionVariants = cva(\n [\n 'px-2',\n 'py-1.5',\n 'text-xs',\n 'font-semibold',\n 'text-[var(--menu-muted)]',\n 'uppercase',\n 'tracking-wider',\n ],\n {\n variants: {\n size: {\n sm: 'px-2 py-1 text-[10px]',\n default: 'px-2 py-1.5 text-xs',\n lg: 'px-3 py-2 text-sm',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Error Messages\n *\n * Styles the error message displayed below the select trigger.\n */\nexport const selectErrorVariants = cva(\n [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-sm',\n 'font-medium',\n 'text-[var(--destructive-background)]',\n 'mt-1.5',\n ],\n {\n variants: {\n size: {\n sm: 'text-xs mt-1',\n default: 'text-sm mt-1.5',\n lg: 'text-base mt-2',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * Type exports for variant props.\n * Allows TypeScript inference of variant combinations.\n */\nexport type SelectTriggerVariantProps = VariantProps<typeof selectTriggerVariants>;\nexport type SelectItemVariantProps = VariantProps<typeof selectItemVariants>;\nexport type SelectPopoverVariantProps = VariantProps<typeof selectPopoverVariants>;\nexport type SelectSectionVariantProps = VariantProps<typeof selectSectionVariants>;\nexport type SelectErrorVariantProps = VariantProps<typeof selectErrorVariants>;\n","'use client';\n\n/**\n * Select Component - Implementation\n *\n * Accessible select/dropdown component combining React Aria primitives with ShadCN styling.\n * Follows Themis library patterns with compound component structure.\n *\n * Architecture:\n * - SelectBase: Internal component containing shared label, description, trigger, error, and listbox rendering.\n * - SelectRoot: Single selection wrapper (thin layer over SelectBase).\n * - MultiSelectRoot: Multiple selection wrapper with display value logic (thin layer over SelectBase).\n * - SelectItem, SelectSection, SelectHeader: Compound sub-components.\n *\n * @see select-prd.md (Full requirements)\n * @see Select.types.ts (Zod schemas)\n * @see Select.styles.ts (CVA variant definitions)\n * @see plan.md (Implementation plan)\n */\n\nimport {\n forwardRef,\n memo,\n Children,\n useId,\n useMemo,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport {\n Select as AriaSelect,\n Label,\n Button,\n SelectValue,\n Popover,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Header,\n Text,\n FieldError,\n} from 'react-aria-components';\nimport { Check, CheckSquare, ChevronDown, Loader2, AlertCircle } from 'lucide-react';\nimport type {\n SelectProps,\n SelectItemProps,\n SelectSectionProps,\n SelectHeaderProps,\n SelectSize,\n} from './Select.types';\nimport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n// Re-export CVA variants so existing imports from './Select' continue to work\nexport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n/**\n * Internal props for SelectBase.\n * Extends the shared props with selection-mode-specific configuration.\n */\ninterface SelectBaseProps {\n /** The AriaSelect props to spread onto the root element */\n ariaSelectProps: Record<string, unknown>;\n /** Content to render inside the trigger button (SelectValue for single, span for multi) */\n triggerContent: ReactNode;\n /** Ref to forward to the trigger button */\n triggerRef: Ref<HTMLButtonElement>;\n /** Label text */\n label: string;\n /** Optional description text */\n description?: string;\n /** Whether the field is required */\n isRequired: boolean;\n /** Whether the field is disabled */\n isDisabled: boolean;\n /** Whether the field is in a loading state */\n isLoading: boolean;\n /** Error message to display */\n errorMessage?: string;\n /** Size variant */\n size: SelectSize;\n /** Empty state message override */\n emptyStateMessage?: string;\n /** Child count (pre-computed by parent) */\n childCount: number;\n /** Children to render in the listbox */\n children: ReactNode;\n}\n\n/**\n * SelectBase - Internal shared rendering component\n *\n * Contains the shared rendering logic for label, description, trigger button,\n * error message, and popover/listbox that both SelectRoot and MultiSelectRoot use.\n * This is not exported as part of the public API.\n */\nfunction SelectBase({\n ariaSelectProps,\n triggerContent,\n triggerRef,\n label,\n description,\n isRequired,\n isDisabled,\n isLoading,\n errorMessage,\n size,\n emptyStateMessage,\n childCount,\n children,\n}: SelectBaseProps): ReactElement {\n // Generate unique IDs for accessibility\n const labelId = useId();\n const descriptionId = useId();\n const errorId = useId();\n\n // Determine if invalid based on errorMessage\n const isInvalid = Boolean(errorMessage);\n\n return (\n <AriaSelect\n {...ariaSelectProps}\n isInvalid={isInvalid}\n >\n {/* Label */}\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && <span className=\"text-[var(--destructive-background)] ml-1\">*</span>}\n </Label>\n\n {/* Description (if provided) */}\n {description && (\n <Text id={descriptionId} slot=\"description\" className=\"text-sm text-[var(--menu-muted)] mt-1\">\n {description}\n </Text>\n )}\n\n {/* Trigger Button */}\n <Button\n ref={triggerRef}\n className={selectTriggerVariants({ size, isInvalid })}\n aria-labelledby={labelId}\n aria-describedby={description ? descriptionId : errorMessage ? errorId : undefined}\n data-loading={isLoading}\n {...(isRequired && { 'aria-required': 'true' })}\n {...(isLoading && { 'aria-busy': 'true' })}\n {...((isDisabled || isLoading) && { 'aria-disabled': 'true' })}\n >\n {triggerContent}\n\n {/* Loading spinner or chevron icon */}\n {isLoading ? (\n <Loader2 className=\"h-4 w-4 animate-spin text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n ) : (\n <ChevronDown className=\"h-4 w-4 text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n )}\n </Button>\n\n {/* Error Message */}\n <FieldError id={errorId} className={selectErrorVariants({ size })}>\n {({ validationErrors }) => {\n // Display custom errorMessage if provided, otherwise show validation errors\n const displayError = errorMessage || validationErrors.join(' ');\n return displayError ? (\n <>\n <AlertCircle className=\"h-4 w-4\" aria-hidden=\"true\" />\n {displayError}\n </>\n ) : null;\n }}\n </FieldError>\n\n {/* Popover with ListBox */}\n <Popover className={selectPopoverVariants({ size })}>\n <ListBox className=\"outline-none\">\n {/* Loading skeleton (if loading and has children) */}\n {isLoading && childCount > 0 && (\n <>\n {Array.from({ length: 3 }).map((_, i) => (\n <div\n key={`skeleton-${i}`}\n className=\"h-11 px-4 py-2\"\n >\n <div className=\"h-4 bg-[var(--accent-background)] rounded animate-pulse\" />\n </div>\n ))}\n </>\n )}\n\n {/* Items or empty state */}\n {!isLoading && (\n <>\n {children}\n {/* Empty state - render as disabled item so popover can open */}\n {childCount === 0 && (\n <ListBoxItem\n id=\"__empty__\"\n textValue=\"empty\"\n isDisabled\n className=\"py-6 text-center text-sm text-[var(--menu-muted)] cursor-default pointer-events-none\"\n >\n <span role=\"status\">\n {emptyStateMessage || 'No options available'}\n </span>\n </ListBoxItem>\n )}\n </>\n )}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n}\n\n/**\n * Select Root Component (Single Selection Only)\n *\n * Main select component with controlled/uncontrolled modes for single selection.\n * For multiple selection, use MultiSelect component.\n * Delegates shared rendering to SelectBase.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst SelectRoot = forwardRef<HTMLButtonElement, Omit<SelectProps, 'selectionMode'>>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items (Decision 22: Large Item Count Handling)\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string,\n defaultValue: defaultValue as string,\n onChange: (key: unknown) => {\n if (onChange) {\n onChange(key as string);\n }\n },\n placeholder,\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={<SelectValue className=\"flex-1 text-left truncate\" />}\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nSelectRoot.displayName = 'Select';\n\n/**\n * MultiSelect Root Component (Multiple Selection)\n *\n * Select component for multiple selection. Uses different API from single Select.\n * Delegates shared rendering to SelectBase, adding multi-select display value logic.\n *\n * @see select-prd.md US-6 (Multiple Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst MultiSelectRoot = forwardRef<HTMLButtonElement, SelectProps>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n selectionMode: _selectionMode = 'multiple',\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n // Build value-to-label map for display (memoized to prevent recreation on every render)\n const valueToLabelMap = useMemo(() => {\n const map = new Map<string, string>();\n const processChildren = (nodes: ReactNode): void => {\n Children.forEach(nodes, (child) => {\n if (isValidElement(child)) {\n const element = child as ReactElement<{ value?: string; children?: ReactNode }>;\n if (element.type === SelectItem || element.props?.value) {\n const itemValue = element.props.value;\n const itemChildren = element.props.children;\n if (itemValue && typeof itemChildren === 'string') {\n map.set(itemValue, itemChildren);\n }\n }\n if (element.props?.children) {\n processChildren(element.props.children);\n }\n }\n });\n };\n processChildren(children);\n return map;\n }, [children]);\n\n // Multi-select display logic (Decision 5: Multi-select threshold)\n // Memoized to prevent recalculation on every render\n const displayValue = useMemo(() => {\n if (!value || !Array.isArray(value) || value.length === 0) {\n return placeholder || '';\n }\n\n if (value.length <= 2) {\n // Show item labels for 1-2 items\n const labels = value.map(v => valueToLabelMap.get(v as string) || v);\n return labels.join(', ');\n }\n\n // Show count for 3+ items\n return `${value.length} items selected`;\n }, [value, valueToLabelMap, placeholder]);\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string[],\n defaultValue: defaultValue as string[],\n onChange: (keys: unknown) => {\n if (onChange) {\n onChange(keys as string[]);\n }\n },\n selectionMode: 'multiple',\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={\n <span className=\"flex-1 text-left truncate\">\n {displayValue}\n </span>\n }\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nMultiSelectRoot.displayName = 'MultiSelect';\n\n/**\n * Select.Item Component\n *\n * Individual selectable item with checkmark icon.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 6 (Left-side checkmark)\n * @see plan.md Decision 23 (textValue required for custom children)\n */\nconst SelectItem = memo(function SelectItem({ children, textValue, value, isDisabled = false, className, ...props }: SelectItemProps): ReactElement {\n // Validate textValue for custom children (Decision 23)\n if (!textValue && typeof children !== 'string') {\n const message = 'Select.Item with custom children requires textValue prop for accessibility';\n if (process.env.NODE_ENV === 'development') {\n throw new Error(message);\n } else {\n console.warn(message);\n }\n }\n\n return (\n <ListBoxItem\n id={value}\n textValue={textValue || (typeof children === 'string' ? children : undefined)}\n className={`${selectItemVariants({ size: 'default' })} ${className || ''}`}\n isDisabled={isDisabled}\n {...props}\n >\n {({ isSelected, selectionMode, isDisabled: itemDisabled }) => (\n <>\n {/* Checkmark icon (left side) - Decision 6 */}\n {selectionMode === 'multiple' ? (\n <CheckSquare\n className={`absolute left-2 h-4 w-4 ${isSelected ? 'visible' : 'invisible'}`}\n aria-hidden=\"true\"\n />\n ) : (\n isSelected && <Check className=\"absolute left-2 h-4 w-4\" aria-hidden=\"true\" />\n )}\n <span className={itemDisabled ? 'text-[var(--menu-muted)]' : ''}>\n {children}\n </span>\n </>\n )}\n </ListBoxItem>\n );\n});\n\nSelectItem.displayName = 'SelectItem';\n\n/**\n * Select.Section Component\n *\n * Groups related items with optional header.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectSection({ children, className, ...props }: SelectSectionProps): ReactElement {\n return (\n <ListBoxSection className={`border-t border-[var(--border)] first:border-t-0 ${className || ''}`} {...props}>\n {children}\n </ListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n\n/**\n * Select.Header Component\n *\n * Section header with non-interactive label.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectHeader({ children, className, ...props }: SelectHeaderProps): ReactElement {\n return (\n <Header className={`${selectSectionVariants({ size: 'default' })} ${className || ''}`} {...props}>\n {children}\n </Header>\n );\n}\n\nSelectHeader.displayName = 'SelectHeader';\n\n/**\n * Compound Component Exports\n *\n * Uses Object.assign() for compound components (e.g., Select.Item, Select.Section).\n * Named exports (SelectItem, SelectSection, SelectHeader) are also available below\n * for better tree-shaking. Prefer named exports in new code.\n *\n * @deprecated (v2) The Object.assign compound pattern will be removed in v2.\n * Migrate to named imports: `import { SelectItem, SelectSection, SelectHeader } from '...'`\n *\n * @see GUIDE.mdx (Compound component pattern)\n */\nexport const Select = Object.assign(SelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\nexport const MultiSelect = Object.assign(MultiSelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\n// Named exports for individual components (preferred for tree-shaking)\nexport { SelectRoot, MultiSelectRoot, SelectItem, SelectSection, SelectHeader };\n","import { z } from 'zod';\n\n/**\n * Base props schema for all Themis components\n * Ensures consistent accessibility and styling APIs across the library\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements)\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AA minimum)\n */\nexport const BaseComponentPropsSchema = z.object({\n // Styling\n className: z.string().optional(),\n\n // React\n children: z.any().optional(), // ReactNode not directly supported by Zod\n id: z.string().optional(),\n\n // Accessibility (WCAG 2.2 AA requirements)\n 'aria-label': z.string().optional(),\n 'aria-labelledby': z.string().optional(),\n 'aria-describedby': z.string().optional(),\n 'aria-live': z.enum(['off', 'polite', 'assertive']).optional(),\n 'aria-hidden': z.boolean().optional(),\n\n // Testing & Development\n 'data-testid': z.string().optional(),\n});\n\nexport type BaseComponentProps = z.infer<typeof BaseComponentPropsSchema>;\n","import { z } from 'zod';\nimport { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\nimport type { ReactNode } from 'react';\nimport type {\n SelectProps as AriaSelectProps,\n ListBoxItemProps as AriaListBoxItemProps,\n} from 'react-aria-components';\n\n/**\n * Select size variants\n *\n * @see select-prd.md US-9 (Visual States - Size Variants)\n * @see plan.md Decision 4 (Include sm size with warning for desktop-only)\n */\nexport const SelectSizeSchema = z.enum(['sm', 'default', 'lg']);\nexport type SelectSize = z.infer<typeof SelectSizeSchema>;\n\n/**\n * Select selection mode\n *\n * @see select-prd.md US-6 (Multiple Selection)\n */\nexport const SelectionModeSchema = z.enum(['single', 'multiple']);\nexport type SelectionMode = z.infer<typeof SelectionModeSchema>;\n\n/**\n * Select validation behavior\n *\n * @see select-prd.md US-4 (Validation and Error Messages)\n */\nexport const ValidationBehaviorSchema = z.enum(['native', 'aria']);\nexport type ValidationBehavior = z.infer<typeof ValidationBehaviorSchema>;\n\n/**\n * Select root component props schema\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see select-prd.md US-4 (Validation and Error Messages)\n * @see select-prd.md US-5 (Disabled States)\n * @see select-prd.md US-6 (Multiple Selection)\n * @see select-prd.md US-7 (Async Data Loading)\n * @see select-prd.md US-10 (Form Integration)\n */\nexport const SelectPropsSchema = BaseComponentPropsSchema.extend({\n // Display props (US-1)\n label: z.string(), // Required for accessibility\n placeholder: z.string().optional(),\n description: z.string().optional(),\n\n // Selection props (US-1, US-6)\n value: z.union([z.string(), z.array(z.string())]).optional(),\n defaultValue: z.union([z.string(), z.array(z.string())]).optional(),\n selectionMode: SelectionModeSchema.optional().default('single'),\n\n // State props (US-1, US-5)\n isOpen: z.boolean().optional(),\n isDisabled: z.boolean().optional().default(false),\n isRequired: z.boolean().optional().default(false),\n disabledKeys: z.array(z.string()).optional(),\n\n // Validation props (US-4)\n validate: z\n .custom<(value: string | string[]) => string | undefined>()\n .optional(),\n validationBehavior: ValidationBehaviorSchema.optional().default('aria'),\n errorMessage: z.string().optional(),\n\n // Loading state (US-7)\n isLoading: z.boolean().optional().default(false),\n emptyStateMessage: z.string().optional(),\n\n // Form integration (US-10)\n name: z.string().optional(),\n\n // Size variant (US-9)\n size: SelectSizeSchema.optional().default('default'),\n\n // Event handlers (US-1)\n onChange: z\n .custom<(value: string | string[]) => void>()\n .optional(),\n onOpenChange: z.custom<(isOpen: boolean) => void>().optional(),\n\n // Children (Select.Item, Select.Section components)\n children: z.custom<ReactNode>(),\n});\n\nexport type SelectProps = z.infer<typeof SelectPropsSchema> &\n Omit<AriaSelectProps<object>, keyof z.infer<typeof SelectPropsSchema>>;\n\n/**\n * Select.Item props schema\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see select-prd.md US-5 (Disabled States)\n * @see select-prd.md US-8 (Custom Value Rendering)\n * @see plan.md Decision 23 (textValue required for custom children)\n */\nexport const SelectItemPropsSchema = BaseComponentPropsSchema.extend({\n // Item value (required)\n value: z.string(),\n\n // Text value for typeahead and accessibility (required for custom children)\n textValue: z.string().optional(),\n\n // Disabled state\n isDisabled: z.boolean().optional().default(false),\n\n // Item content\n children: z.custom<ReactNode>(),\n\n // Optional className for custom styling\n className: z.string().optional(),\n});\n\nexport type SelectItemProps = z.infer<typeof SelectItemPropsSchema> &\n Omit<AriaListBoxItemProps, keyof z.infer<typeof SelectItemPropsSchema>>;\n\n/**\n * Select.Section props schema\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nexport const SelectSectionPropsSchema = BaseComponentPropsSchema.extend({\n // Section content (typically Select.Header + Select.Item components)\n children: z.custom<ReactNode>(),\n\n // Optional className for custom styling\n className: z.string().optional(),\n});\n\nexport type SelectSectionProps = z.infer<typeof SelectSectionPropsSchema>;\n\n/**\n * Select.Header props schema (for section headers)\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nexport const SelectHeaderPropsSchema = BaseComponentPropsSchema.extend({\n // Header text\n children: z.custom<ReactNode>(),\n\n // Optional className for header styling\n className: z.string().optional(),\n});\n\nexport type SelectHeaderProps = z.infer<typeof SelectHeaderPropsSchema>;\n\n/**\n * CVA variant configuration types\n * Used for class-variance-authority integration\n */\nexport type SelectVariantSize = SelectSize;\nexport type SelectVariantSelectionMode = SelectionMode;\n"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import {forwardRef,Children,useMemo,memo,useId,isValidElement}from'react';import {SelectValue,ListBoxItem,Select,Label,Text,Button,FieldError,Popover,ListBox,Header,ListBoxSection}from'react-aria-components';import {CheckSquare,Check,Loader2,ChevronDown,AlertCircle}from'lucide-react';import {cva}from'class-variance-authority';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {z}from'zod';var q=cva(["flex","w-full","items-center","justify-between","rounded-md","border","bg-[var(--content-background)]","text-[var(--content-foreground)]","transition-colors","duration-200","outline-none","focus-visible:ring-2","focus-visible:ring-[var(--ring)]","focus-visible:ring-offset-2","hover:bg-[var(--accent)]/10","disabled:cursor-not-allowed","disabled:opacity-50","data-[loading=true]:cursor-wait","truncate"],{variants:{size:{sm:"h-9 px-3 text-sm min-h-[44px]",default:"h-11 px-4 text-base min-h-[44px]",lg:"h-14 px-5 text-lg min-h-[44px]"},isInvalid:{true:"border-[var(--destructive)]",false:"border-[var(--input)] hover:border-[var(--input)]/80"}},defaultVariants:{size:"default",isInvalid:false}}),F=cva(["relative","flex","w-full","cursor-pointer","select-none","items-center","rounded-sm","outline-none","transition-colors","pl-8","pr-2","hover:bg-[var(--accent)]","hover:text-[var(--accent-foreground)]","focus:bg-[var(--accent)]","focus:text-[var(--accent-foreground)]","data-[selected=true]:bg-[var(--accent)]","data-[selected=true]:text-[var(--accent-foreground)]","data-[disabled=true]:pointer-events-none","data-[disabled=true]:opacity-50","data-[disabled=true]:text-[var(--menu-muted)]"],{variants:{size:{sm:"h-9 py-1.5 text-sm min-h-[44px]",default:"h-11 py-2 text-base min-h-[44px]",lg:"h-14 py-3 text-lg min-h-[44px]"}},defaultVariants:{size:"default"}}),K=cva(["z-50","w-[--trigger-width]","rounded-md","border","border-[var(--menu-border)]","bg-[var(--menu-background)]","text-[var(--menu-foreground)]","shadow-md","outline-none","overflow-auto","data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:zoom-in-95","data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:zoom-out-95"],{variants:{size:{sm:"max-h-[200px] p-1",default:"max-h-[300px] p-1",lg:"max-h-[400px] p-1"}},defaultVariants:{size:"default"}}),G=cva(["px-2","py-1.5","text-xs","font-semibold","text-[var(--menu-muted)]","uppercase","tracking-wider"],{variants:{size:{sm:"px-2 py-1 text-[10px]",default:"px-2 py-1.5 text-xs",lg:"px-3 py-2 text-sm"}},defaultVariants:{size:"default"}}),J=cva(["flex","items-center","gap-1.5","text-sm","font-medium","text-[var(--destructive)]","mt-1.5"],{variants:{size:{sm:"text-xs mt-1",default:"text-sm mt-1.5",lg:"text-base mt-2"}},defaultVariants:{size:"default"}});function X({ariaSelectProps:s,triggerContent:r,triggerRef:n,label:o,description:c,isRequired:u,isDisabled:d,isLoading:a,errorMessage:i,size:p,emptyStateMessage:N,childCount:b,children:v}){let f=useId(),y=useId(),h=useId(),S=!!i;return jsxs(Select,{...s,isInvalid:S,children:[jsxs(Label,{id:f,className:"text-sm font-medium text-[var(--content-foreground)]",children:[o,u&&jsx("span",{className:"text-[var(--destructive)] ml-1",children:"*"})]}),c&&jsx(Text,{id:y,slot:"description",className:"text-sm text-[var(--menu-muted)] mt-1",children:c}),jsxs(Button,{ref:n,className:q({size:p,isInvalid:S}),"aria-labelledby":f,"aria-describedby":c?y:i?h:void 0,"data-loading":a,...u&&{"aria-required":"true"},...a&&{"aria-busy":"true"},...(d||a)&&{"aria-disabled":"true"},children:[r,a?jsx(Loader2,{className:"h-4 w-4 animate-spin text-[var(--menu-muted)]","aria-hidden":"true"}):jsx(ChevronDown,{className:"h-4 w-4 text-[var(--menu-muted)]","aria-hidden":"true"})]}),jsx(FieldError,{id:h,className:J({size:p}),children:({validationErrors:g})=>{let m=i||g.join(" ");return m?jsxs(Fragment,{children:[jsx(AlertCircle,{className:"h-4 w-4","aria-hidden":"true"}),m]}):null}}),jsx(Popover,{className:K({size:p}),children:jsxs(ListBox,{className:"outline-none",children:[a&&b>0&&jsx(Fragment,{children:Array.from({length:3}).map((g,m)=>jsx("div",{className:"h-11 px-4 py-2",children:jsx("div",{className:"h-4 bg-[var(--accent-background)] rounded animate-pulse"})},`skeleton-${m}`))}),!a&&jsxs(Fragment,{children:[v,b===0&&jsx(ListBoxItem,{id:"__empty__",textValue:"empty",isDisabled:true,className:"py-6 text-center text-sm text-[var(--menu-muted)] cursor-default pointer-events-none",children:jsx("span",{role:"status",children:N||"No options available"})})]})]})})]})}var Y=forwardRef(({label:s,placeholder:r,description:n,value:o,defaultValue:c,isOpen:u,isDisabled:d=false,isRequired:a=false,disabledKeys:i,validate:p,validationBehavior:N="aria",errorMessage:b,isLoading:v=false,emptyStateMessage:f,name:y,size:h="default",onChange:S,onOpenChange:g,className:m,children:M,...P},k)=>{let R=Children.count(M);return R>1e3&&console.warn("Select has >1000 items. Consider using Autocomplete component for better performance."),jsx(X,{ariaSelectProps:{value:o,defaultValue:c,onChange:C=>{S&&S(C);},placeholder:r,disabledKeys:i,isOpen:u,onOpenChange:g,isDisabled:d||v,isRequired:a,name:y,validate:p,validationBehavior:N,className:m,...P},triggerContent:jsx(SelectValue,{className:"flex-1 text-left truncate"}),triggerRef:k,label:s,description:n,isRequired:a,isDisabled:d,isLoading:v,errorMessage:b,size:h,emptyStateMessage:f,childCount:R,children:M})});Y.displayName="Select";var Z=forwardRef(({label:s,placeholder:r,description:n,value:o,defaultValue:c,selectionMode:u="multiple",isOpen:d,isDisabled:a=false,isRequired:i=false,disabledKeys:p,validate:N,validationBehavior:b="aria",errorMessage:v,isLoading:f=false,emptyStateMessage:y,name:h,size:S="default",onChange:g,onOpenChange:m,className:M,children:P,...k},R)=>{let C=Children.count(P);C>1e3&&console.warn("Select has >1000 items. Consider using Autocomplete component for better performance.");let O=useMemo(()=>{let z=new Map,I=te=>{Children.forEach(te,$=>{if(isValidElement($)){let V=$;if(V.type===H||V.props?.value){let _=V.props.value,j=V.props.children;_&&typeof j=="string"&&z.set(_,j);}V.props?.children&&I(V.props.children);}});};return I(P),z},[P]),ee=useMemo(()=>!o||!Array.isArray(o)||o.length===0?r||"":o.length<=2?o.map(I=>O.get(I)||I).join(", "):`${o.length} items selected`,[o,O,r]);return jsx(X,{ariaSelectProps:{value:o,defaultValue:c,onChange:z=>{g&&g(z);},selectionMode:"multiple",disabledKeys:p,isOpen:d,onOpenChange:m,isDisabled:a||f,isRequired:i,name:h,validate:N,validationBehavior:b,className:M,...k},triggerContent:jsx("span",{className:"flex-1 text-left truncate",children:ee}),triggerRef:R,label:s,description:n,isRequired:i,isDisabled:a,isLoading:f,errorMessage:v,size:S,emptyStateMessage:y,childCount:C,children:P})});Z.displayName="MultiSelect";var H=memo(function({children:r,textValue:n,value:o,isDisabled:c=false,className:u,...d}){if(!n&&typeof r!="string"){let a="Select.Item with custom children requires textValue prop for accessibility";if(process.env.NODE_ENV==="development")throw new Error(a);console.warn(a);}return jsx(ListBoxItem,{id:o,textValue:n||(typeof r=="string"?r:void 0),className:`${F({size:"default"})} ${u||""}`,isDisabled:c,...d,children:({isSelected:a,selectionMode:i,isDisabled:p})=>jsxs(Fragment,{children:[i==="multiple"?jsx(CheckSquare,{className:`absolute left-2 h-4 w-4 ${a?"visible":"invisible"}`,"aria-hidden":"true"}):a&&jsx(Check,{className:"absolute left-2 h-4 w-4","aria-hidden":"true"}),jsx("span",{className:p?"text-[var(--menu-muted)]":"",children:r})]})})});H.displayName="SelectItem";function T({children:s,className:r,...n}){return jsx(ListBoxSection,{className:`border-t border-[var(--border)] first:border-t-0 ${r||""}`,...n,children:s})}T.displayName="SelectSection";function D({children:s,className:r,...n}){return jsx(Header,{className:`${G({size:"default"})} ${r||""}`,...n,children:s})}D.displayName="SelectHeader";var ve=Object.assign(Y,{Item:H,Section:T,Header:D}),ye=Object.assign(Z,{Item:H,Section:T,Header:D});var B=z.object({className:z.string().optional(),children:z.any().optional(),id:z.string().optional(),"aria-label":z.string().optional(),"aria-labelledby":z.string().optional(),"aria-describedby":z.string().optional(),"aria-live":z.enum(["off","polite","assertive"]).optional(),"aria-hidden":z.boolean().optional(),"data-testid":z.string().optional()});var he=z.enum(["sm","default","lg"]),Pe=z.enum(["single","multiple"]),Ve=z.enum(["native","aria"]),Ne=B.extend({label:z.string(),placeholder:z.string().optional(),description:z.string().optional(),value:z.union([z.string(),z.array(z.string())]).optional(),defaultValue:z.union([z.string(),z.array(z.string())]).optional(),selectionMode:Pe.optional().default("single"),isOpen:z.boolean().optional(),isDisabled:z.boolean().optional().default(false),isRequired:z.boolean().optional().default(false),disabledKeys:z.array(z.string()).optional(),validate:z.custom().optional(),validationBehavior:Ve.optional().default("aria"),errorMessage:z.string().optional(),isLoading:z.boolean().optional().default(false),emptyStateMessage:z.string().optional(),name:z.string().optional(),size:he.optional().default("default"),onChange:z.custom().optional(),onOpenChange:z.custom().optional(),children:z.custom()}),ze=B.extend({value:z.string(),textValue:z.string().optional(),isDisabled:z.boolean().optional().default(false),children:z.custom(),className:z.string().optional()}),Ie=B.extend({children:z.custom(),className:z.string().optional()}),we=B.extend({children:z.custom(),className:z.string().optional()});export{ye as MultiSelect,ve as Select,we as SelectHeaderPropsSchema,ze as SelectItemPropsSchema,Ne as SelectPropsSchema,Ie as SelectSectionPropsSchema};//# sourceMappingURL=index.mjs.map
2
+ import {forwardRef,Children,useMemo,memo,useId,isValidElement}from'react';import {SelectValue,ListBoxItem,Select,Label,Text,Button,FieldError,Popover,ListBox,Header,ListBoxSection}from'react-aria-components';import {CheckSquare,Check,Loader2,ChevronDown,AlertCircle}from'lucide-react';import {cva}from'class-variance-authority';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {z}from'zod';var q=cva(["flex","w-full","items-center","justify-between","rounded-md","border","bg-[var(--content-background)]","text-[var(--content-foreground)]","transition-colors","duration-200","outline-none","focus-visible:ring-2","focus-visible:ring-[var(--ring)]","focus-visible:ring-offset-2","hover:bg-[var(--accent)]/10","disabled:cursor-not-allowed","disabled:opacity-50","data-[loading=true]:cursor-wait","truncate"],{variants:{size:{sm:"h-9 px-3 text-sm min-h-[44px]",default:"h-11 px-4 text-base min-h-[44px]",lg:"h-14 px-5 text-lg min-h-[44px]"},isInvalid:{true:"border-[var(--destructive-background)]",false:"border-[var(--input-border)] hover:border-[var(--input-border)]/80"}},defaultVariants:{size:"default",isInvalid:false}}),F=cva(["relative","flex","w-full","cursor-pointer","select-none","items-center","rounded-sm","outline-none","transition-colors","pl-8","pr-2","hover:bg-[var(--accent)]","hover:text-[var(--accent-foreground)]","focus:bg-[var(--accent)]","focus:text-[var(--accent-foreground)]","data-[selected=true]:bg-[var(--accent)]","data-[selected=true]:text-[var(--accent-foreground)]","data-[disabled=true]:pointer-events-none","data-[disabled=true]:opacity-50","data-[disabled=true]:text-[var(--menu-muted)]"],{variants:{size:{sm:"h-9 py-1.5 text-sm min-h-[44px]",default:"h-11 py-2 text-base min-h-[44px]",lg:"h-14 py-3 text-lg min-h-[44px]"}},defaultVariants:{size:"default"}}),K=cva(["z-50","w-[--trigger-width]","rounded-md","border","border-[var(--menu-border)]","bg-[var(--menu-background)]","text-[var(--menu-foreground)]","shadow-md","outline-none","overflow-auto","data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:zoom-in-95","data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:zoom-out-95"],{variants:{size:{sm:"max-h-[200px] p-1",default:"max-h-[300px] p-1",lg:"max-h-[400px] p-1"}},defaultVariants:{size:"default"}}),G=cva(["px-2","py-1.5","text-xs","font-semibold","text-[var(--menu-muted)]","uppercase","tracking-wider"],{variants:{size:{sm:"px-2 py-1 text-[10px]",default:"px-2 py-1.5 text-xs",lg:"px-3 py-2 text-sm"}},defaultVariants:{size:"default"}}),J=cva(["flex","items-center","gap-1.5","text-sm","font-medium","text-[var(--destructive-background)]","mt-1.5"],{variants:{size:{sm:"text-xs mt-1",default:"text-sm mt-1.5",lg:"text-base mt-2"}},defaultVariants:{size:"default"}});function X({ariaSelectProps:s,triggerContent:r,triggerRef:n,label:o,description:c,isRequired:u,isDisabled:d,isLoading:a,errorMessage:i,size:p,emptyStateMessage:N,childCount:b,children:v}){let f=useId(),y=useId(),h=useId(),S=!!i;return jsxs(Select,{...s,isInvalid:S,children:[jsxs(Label,{id:f,className:"text-sm font-medium text-[var(--content-foreground)]",children:[o,u&&jsx("span",{className:"text-[var(--destructive-background)] ml-1",children:"*"})]}),c&&jsx(Text,{id:y,slot:"description",className:"text-sm text-[var(--menu-muted)] mt-1",children:c}),jsxs(Button,{ref:n,className:q({size:p,isInvalid:S}),"aria-labelledby":f,"aria-describedby":c?y:i?h:void 0,"data-loading":a,...u&&{"aria-required":"true"},...a&&{"aria-busy":"true"},...(d||a)&&{"aria-disabled":"true"},children:[r,a?jsx(Loader2,{className:"h-4 w-4 animate-spin text-[var(--menu-muted)]","aria-hidden":"true"}):jsx(ChevronDown,{className:"h-4 w-4 text-[var(--menu-muted)]","aria-hidden":"true"})]}),jsx(FieldError,{id:h,className:J({size:p}),children:({validationErrors:g})=>{let m=i||g.join(" ");return m?jsxs(Fragment,{children:[jsx(AlertCircle,{className:"h-4 w-4","aria-hidden":"true"}),m]}):null}}),jsx(Popover,{className:K({size:p}),children:jsxs(ListBox,{className:"outline-none",children:[a&&b>0&&jsx(Fragment,{children:Array.from({length:3}).map((g,m)=>jsx("div",{className:"h-11 px-4 py-2",children:jsx("div",{className:"h-4 bg-[var(--accent-background)] rounded animate-pulse"})},`skeleton-${m}`))}),!a&&jsxs(Fragment,{children:[v,b===0&&jsx(ListBoxItem,{id:"__empty__",textValue:"empty",isDisabled:true,className:"py-6 text-center text-sm text-[var(--menu-muted)] cursor-default pointer-events-none",children:jsx("span",{role:"status",children:N||"No options available"})})]})]})})]})}var Y=forwardRef(({label:s,placeholder:r,description:n,value:o,defaultValue:c,isOpen:u,isDisabled:d=false,isRequired:a=false,disabledKeys:i,validate:p,validationBehavior:N="aria",errorMessage:b,isLoading:v=false,emptyStateMessage:f,name:y,size:h="default",onChange:S,onOpenChange:g,className:m,children:M,...P},H)=>{let R=Children.count(M);return R>1e3&&console.warn("Select has >1000 items. Consider using Autocomplete component for better performance."),jsx(X,{ariaSelectProps:{value:o,defaultValue:c,onChange:C=>{S&&S(C);},placeholder:r,disabledKeys:i,isOpen:u,onOpenChange:g,isDisabled:d||v,isRequired:a,name:y,validate:p,validationBehavior:N,className:m,...P},triggerContent:jsx(SelectValue,{className:"flex-1 text-left truncate"}),triggerRef:H,label:s,description:n,isRequired:a,isDisabled:d,isLoading:v,errorMessage:b,size:h,emptyStateMessage:f,childCount:R,children:M})});Y.displayName="Select";var Z=forwardRef(({label:s,placeholder:r,description:n,value:o,defaultValue:c,selectionMode:u="multiple",isOpen:d,isDisabled:a=false,isRequired:i=false,disabledKeys:p,validate:N,validationBehavior:b="aria",errorMessage:v,isLoading:f=false,emptyStateMessage:y,name:h,size:S="default",onChange:g,onOpenChange:m,className:M,children:P,...H},R)=>{let C=Children.count(P);C>1e3&&console.warn("Select has >1000 items. Consider using Autocomplete component for better performance.");let O=useMemo(()=>{let z=new Map,I=te=>{Children.forEach(te,$=>{if(isValidElement($)){let V=$;if(V.type===k||V.props?.value){let _=V.props.value,j=V.props.children;_&&typeof j=="string"&&z.set(_,j);}V.props?.children&&I(V.props.children);}});};return I(P),z},[P]),ee=useMemo(()=>!o||!Array.isArray(o)||o.length===0?r||"":o.length<=2?o.map(I=>O.get(I)||I).join(", "):`${o.length} items selected`,[o,O,r]);return jsx(X,{ariaSelectProps:{value:o,defaultValue:c,onChange:z=>{g&&g(z);},selectionMode:"multiple",disabledKeys:p,isOpen:d,onOpenChange:m,isDisabled:a||f,isRequired:i,name:h,validate:N,validationBehavior:b,className:M,...H},triggerContent:jsx("span",{className:"flex-1 text-left truncate",children:ee}),triggerRef:R,label:s,description:n,isRequired:i,isDisabled:a,isLoading:f,errorMessage:v,size:S,emptyStateMessage:y,childCount:C,children:P})});Z.displayName="MultiSelect";var k=memo(function({children:r,textValue:n,value:o,isDisabled:c=false,className:u,...d}){if(!n&&typeof r!="string"){let a="Select.Item with custom children requires textValue prop for accessibility";if(process.env.NODE_ENV==="development")throw new Error(a);console.warn(a);}return jsx(ListBoxItem,{id:o,textValue:n||(typeof r=="string"?r:void 0),className:`${F({size:"default"})} ${u||""}`,isDisabled:c,...d,children:({isSelected:a,selectionMode:i,isDisabled:p})=>jsxs(Fragment,{children:[i==="multiple"?jsx(CheckSquare,{className:`absolute left-2 h-4 w-4 ${a?"visible":"invisible"}`,"aria-hidden":"true"}):a&&jsx(Check,{className:"absolute left-2 h-4 w-4","aria-hidden":"true"}),jsx("span",{className:p?"text-[var(--menu-muted)]":"",children:r})]})})});k.displayName="SelectItem";function T({children:s,className:r,...n}){return jsx(ListBoxSection,{className:`border-t border-[var(--border)] first:border-t-0 ${r||""}`,...n,children:s})}T.displayName="SelectSection";function D({children:s,className:r,...n}){return jsx(Header,{className:`${G({size:"default"})} ${r||""}`,...n,children:s})}D.displayName="SelectHeader";var ve=Object.assign(Y,{Item:k,Section:T,Header:D}),ye=Object.assign(Z,{Item:k,Section:T,Header:D});var B=z.object({className:z.string().optional(),children:z.any().optional(),id:z.string().optional(),"aria-label":z.string().optional(),"aria-labelledby":z.string().optional(),"aria-describedby":z.string().optional(),"aria-live":z.enum(["off","polite","assertive"]).optional(),"aria-hidden":z.boolean().optional(),"data-testid":z.string().optional()});var he=z.enum(["sm","default","lg"]),Pe=z.enum(["single","multiple"]),Ve=z.enum(["native","aria"]),Ne=B.extend({label:z.string(),placeholder:z.string().optional(),description:z.string().optional(),value:z.union([z.string(),z.array(z.string())]).optional(),defaultValue:z.union([z.string(),z.array(z.string())]).optional(),selectionMode:Pe.optional().default("single"),isOpen:z.boolean().optional(),isDisabled:z.boolean().optional().default(false),isRequired:z.boolean().optional().default(false),disabledKeys:z.array(z.string()).optional(),validate:z.custom().optional(),validationBehavior:Ve.optional().default("aria"),errorMessage:z.string().optional(),isLoading:z.boolean().optional().default(false),emptyStateMessage:z.string().optional(),name:z.string().optional(),size:he.optional().default("default"),onChange:z.custom().optional(),onOpenChange:z.custom().optional(),children:z.custom()}),ze=B.extend({value:z.string(),textValue:z.string().optional(),isDisabled:z.boolean().optional().default(false),children:z.custom(),className:z.string().optional()}),Ie=B.extend({children:z.custom(),className:z.string().optional()}),we=B.extend({children:z.custom(),className:z.string().optional()});export{ye as MultiSelect,ve as Select,we as SelectHeaderPropsSchema,ze as SelectItemPropsSchema,Ne as SelectPropsSchema,Ie as SelectSectionPropsSchema};//# sourceMappingURL=index.mjs.map
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/elements/Select/Select.styles.ts","../../../src/elements/Select/Select.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/Select/Select.types.ts"],"names":["selectTriggerVariants","cva","selectItemVariants","selectPopoverVariants","selectSectionVariants","selectErrorVariants","SelectBase","ariaSelectProps","triggerContent","triggerRef","label","description","isRequired","isDisabled","isLoading","errorMessage","size","emptyStateMessage","childCount","children","labelId","useId","descriptionId","errorId","isInvalid","jsxs","AriaSelect","Label","jsx","Text","Button","Loader2","ChevronDown","FieldError","validationErrors","displayError","Fragment","AlertCircle","Popover","ListBox","_","i","ListBoxItem","SelectRoot","forwardRef","placeholder","value","defaultValue","isOpen","disabledKeys","validate","validationBehavior","name","onChange","onOpenChange","className","props","ref","Children","key","SelectValue","MultiSelectRoot","_selectionMode","valueToLabelMap","useMemo","map","processChildren","nodes","child","isValidElement","element","SelectItem","itemValue","itemChildren","displayValue","v","keys","memo","textValue","message","isSelected","selectionMode","itemDisabled","CheckSquare","Check","SelectSection","ListBoxSection","SelectHeader","Header","Select","MultiSelect","BaseComponentPropsSchema","z","SelectSizeSchema","SelectionModeSchema","ValidationBehaviorSchema","SelectPropsSchema","SelectItemPropsSchema","SelectSectionPropsSchema","SelectHeaderPropsSchema"],"mappings":"8YAQO,IAAMA,CAAAA,CAAwBC,IACnC,CAEE,MAAA,CACA,SACA,cAAA,CACA,iBAAA,CACA,aACA,QAAA,CACA,gCAAA,CACA,mCACA,mBAAA,CACA,cAAA,CACA,cAAA,CAEA,sBAAA,CACA,mCACA,6BAAA,CAEA,6BAAA,CAEA,8BACA,qBAAA,CAEA,iCAAA,CAEA,UACF,CAAA,CACA,CACE,SAAU,CACR,IAAA,CAAM,CAGJ,EAAA,CAAI,+BAAA,CACJ,QAAS,kCAAA,CACT,EAAA,CAAI,gCACN,CAAA,CACA,SAAA,CAAW,CACT,IAAA,CAAM,8BACN,KAAA,CAAO,sDACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,SAAA,CACN,UAAW,KACb,CACF,CACF,CAAA,CAQaC,CAAAA,CAAqBD,IAChC,CAEE,UAAA,CACA,OACA,QAAA,CACA,gBAAA,CACA,aAAA,CACA,cAAA,CACA,aACA,cAAA,CACA,mBAAA,CAEA,OACA,MAAA,CAEA,0BAAA,CACA,wCAEA,0BAAA,CACA,uCAAA,CAEA,0CACA,sDAAA,CAEA,0CAAA,CACA,kCACA,+CACF,CAAA,CACA,CACE,QAAA,CAAU,CACR,KAAM,CAEJ,EAAA,CAAI,iCAAA,CACJ,OAAA,CAAS,mCACT,EAAA,CAAI,gCACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,SACR,CACF,CACF,CAAA,CAQaE,EAAwBF,GAAAA,CACnC,CAEE,OACA,qBAA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AyB,OAAO,CAEnE,KAAA,CAAOC,EAAE,MAAA,EAAO,CAGhB,UAAWA,CAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAG/B,WAAYA,CAAAA,CAAE,OAAA,GAAU,QAAA,EAAS,CAAE,OAAA,CAAQ,KAAK,EAGhD,QAAA,CAAUA,CAAAA,CAAE,QAAkB,CAG9B,SAAA,CAAWA,EAAE,MAAA,EAAO,CAAE,UACxB,CAAC,EAUYM,EAAAA,CAA2BP,CAAAA,CAAyB,OAAO,CAEtE,QAAA,CAAUC,EAAE,MAAA,EAAkB,CAG9B,UAAWA,CAAAA,CAAE,MAAA,GAAS,QAAA,EACxB,CAAC,CAAA,CASYO,EAAAA,CAA0BR,EAAyB,MAAA,CAAO,CAErE,SAAUC,CAAAA,CAAE,MAAA,GAGZ,SAAA,CAAWA,CAAAA,CAAE,QAAO,CAAE,QAAA,EACxB,CAAC","file":"index.mjs","sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\n/**\n * CVA Variants for Select Trigger Button\n *\n * Styles the trigger button that opens the select popover.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectTriggerVariants = cva(\n [\n // Base styles\n 'flex',\n 'w-full',\n 'items-center',\n 'justify-between',\n 'rounded-md',\n 'border',\n 'bg-[var(--content-background)]',\n 'text-[var(--content-foreground)]',\n 'transition-colors',\n 'duration-200',\n 'outline-none',\n // Focus ring (WCAG 2.2 AAA - 7:1 contrast)\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n // Hover state\n 'hover:bg-[var(--accent)]/10',\n // Disabled state\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n // Loading state\n 'data-[loading=true]:cursor-wait',\n // Truncate text\n 'truncate',\n ],\n {\n variants: {\n size: {\n // All sizes use 44px minimum touch target for WCAG 2.2 AAA compliance\n // Visual height varies but touch area remains accessible\n sm: 'h-9 px-3 text-sm min-h-[44px]',\n default: 'h-11 px-4 text-base min-h-[44px]',\n lg: 'h-14 px-5 text-lg min-h-[44px]',\n },\n isInvalid: {\n true: 'border-[var(--destructive)]',\n false: 'border-[var(--input)] hover:border-[var(--input)]/80',\n },\n },\n defaultVariants: {\n size: 'default',\n isInvalid: false,\n },\n }\n);\n\n/**\n * CVA Variants for Select Items\n *\n * Styles individual selectable items within the listbox.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectItemVariants = cva(\n [\n // Base styles\n 'relative',\n 'flex',\n 'w-full',\n 'cursor-pointer',\n 'select-none',\n 'items-center',\n 'rounded-sm',\n 'outline-none',\n 'transition-colors',\n // Padding for checkmark icon (left side)\n 'pl-8',\n 'pr-2',\n // Hover state\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n // Focus state\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n // Selected state\n 'data-[selected=true]:bg-[var(--accent)]',\n 'data-[selected=true]:text-[var(--accent-foreground)]',\n // Disabled state\n 'data-[disabled=true]:pointer-events-none',\n 'data-[disabled=true]:opacity-50',\n 'data-[disabled=true]:text-[var(--menu-muted)]',\n ],\n {\n variants: {\n size: {\n // All sizes use 44px minimum touch target for WCAG 2.2 AAA compliance\n sm: 'h-9 py-1.5 text-sm min-h-[44px]',\n default: 'h-11 py-2 text-base min-h-[44px]',\n lg: 'h-14 py-3 text-lg min-h-[44px]',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Select Popover\n *\n * Styles the popover container that holds the listbox.\n * Uses menu tokens to match Dropdown styling.\n */\nexport const selectPopoverVariants = cva(\n [\n // Base styles - use menu tokens to match Dropdown styling\n 'z-50',\n 'w-[--trigger-width]',\n 'rounded-md',\n 'border',\n 'border-[var(--menu-border)]',\n 'bg-[var(--menu-background)]',\n 'text-[var(--menu-foreground)]',\n 'shadow-md',\n 'outline-none',\n 'overflow-auto',\n // Animations\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n ],\n {\n variants: {\n size: {\n sm: 'max-h-[200px] p-1',\n default: 'max-h-[300px] p-1',\n lg: 'max-h-[400px] p-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Section Headers\n *\n * Styles the non-interactive section header labels within grouped selects.\n */\nexport const selectSectionVariants = cva(\n [\n 'px-2',\n 'py-1.5',\n 'text-xs',\n 'font-semibold',\n 'text-[var(--menu-muted)]',\n 'uppercase',\n 'tracking-wider',\n ],\n {\n variants: {\n size: {\n sm: 'px-2 py-1 text-[10px]',\n default: 'px-2 py-1.5 text-xs',\n lg: 'px-3 py-2 text-sm',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Error Messages\n *\n * Styles the error message displayed below the select trigger.\n */\nexport const selectErrorVariants = cva(\n [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-sm',\n 'font-medium',\n 'text-[var(--destructive)]',\n 'mt-1.5',\n ],\n {\n variants: {\n size: {\n sm: 'text-xs mt-1',\n default: 'text-sm mt-1.5',\n lg: 'text-base mt-2',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * Type exports for variant props.\n * Allows TypeScript inference of variant combinations.\n */\nexport type SelectTriggerVariantProps = VariantProps<typeof selectTriggerVariants>;\nexport type SelectItemVariantProps = VariantProps<typeof selectItemVariants>;\nexport type SelectPopoverVariantProps = VariantProps<typeof selectPopoverVariants>;\nexport type SelectSectionVariantProps = VariantProps<typeof selectSectionVariants>;\nexport type SelectErrorVariantProps = VariantProps<typeof selectErrorVariants>;\n","'use client';\n\n/**\n * Select Component - Implementation\n *\n * Accessible select/dropdown component combining React Aria primitives with ShadCN styling.\n * Follows Themis library patterns with compound component structure.\n *\n * Architecture:\n * - SelectBase: Internal component containing shared label, description, trigger, error, and listbox rendering.\n * - SelectRoot: Single selection wrapper (thin layer over SelectBase).\n * - MultiSelectRoot: Multiple selection wrapper with display value logic (thin layer over SelectBase).\n * - SelectItem, SelectSection, SelectHeader: Compound sub-components.\n *\n * @see select-prd.md (Full requirements)\n * @see Select.types.ts (Zod schemas)\n * @see Select.styles.ts (CVA variant definitions)\n * @see plan.md (Implementation plan)\n */\n\nimport {\n forwardRef,\n memo,\n Children,\n useId,\n useMemo,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport {\n Select as AriaSelect,\n Label,\n Button,\n SelectValue,\n Popover,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Header,\n Text,\n FieldError,\n} from 'react-aria-components';\nimport { Check, CheckSquare, ChevronDown, Loader2, AlertCircle } from 'lucide-react';\nimport type {\n SelectProps,\n SelectItemProps,\n SelectSectionProps,\n SelectHeaderProps,\n SelectSize,\n} from './Select.types';\nimport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n// Re-export CVA variants so existing imports from './Select' continue to work\nexport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n/**\n * Internal props for SelectBase.\n * Extends the shared props with selection-mode-specific configuration.\n */\ninterface SelectBaseProps {\n /** The AriaSelect props to spread onto the root element */\n ariaSelectProps: Record<string, unknown>;\n /** Content to render inside the trigger button (SelectValue for single, span for multi) */\n triggerContent: ReactNode;\n /** Ref to forward to the trigger button */\n triggerRef: Ref<HTMLButtonElement>;\n /** Label text */\n label: string;\n /** Optional description text */\n description?: string;\n /** Whether the field is required */\n isRequired: boolean;\n /** Whether the field is disabled */\n isDisabled: boolean;\n /** Whether the field is in a loading state */\n isLoading: boolean;\n /** Error message to display */\n errorMessage?: string;\n /** Size variant */\n size: SelectSize;\n /** Empty state message override */\n emptyStateMessage?: string;\n /** Child count (pre-computed by parent) */\n childCount: number;\n /** Children to render in the listbox */\n children: ReactNode;\n}\n\n/**\n * SelectBase - Internal shared rendering component\n *\n * Contains the shared rendering logic for label, description, trigger button,\n * error message, and popover/listbox that both SelectRoot and MultiSelectRoot use.\n * This is not exported as part of the public API.\n */\nfunction SelectBase({\n ariaSelectProps,\n triggerContent,\n triggerRef,\n label,\n description,\n isRequired,\n isDisabled,\n isLoading,\n errorMessage,\n size,\n emptyStateMessage,\n childCount,\n children,\n}: SelectBaseProps): ReactElement {\n // Generate unique IDs for accessibility\n const labelId = useId();\n const descriptionId = useId();\n const errorId = useId();\n\n // Determine if invalid based on errorMessage\n const isInvalid = Boolean(errorMessage);\n\n return (\n <AriaSelect\n {...ariaSelectProps}\n isInvalid={isInvalid}\n >\n {/* Label */}\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && <span className=\"text-[var(--destructive)] ml-1\">*</span>}\n </Label>\n\n {/* Description (if provided) */}\n {description && (\n <Text id={descriptionId} slot=\"description\" className=\"text-sm text-[var(--menu-muted)] mt-1\">\n {description}\n </Text>\n )}\n\n {/* Trigger Button */}\n <Button\n ref={triggerRef}\n className={selectTriggerVariants({ size, isInvalid })}\n aria-labelledby={labelId}\n aria-describedby={description ? descriptionId : errorMessage ? errorId : undefined}\n data-loading={isLoading}\n {...(isRequired && { 'aria-required': 'true' })}\n {...(isLoading && { 'aria-busy': 'true' })}\n {...((isDisabled || isLoading) && { 'aria-disabled': 'true' })}\n >\n {triggerContent}\n\n {/* Loading spinner or chevron icon */}\n {isLoading ? (\n <Loader2 className=\"h-4 w-4 animate-spin text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n ) : (\n <ChevronDown className=\"h-4 w-4 text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n )}\n </Button>\n\n {/* Error Message */}\n <FieldError id={errorId} className={selectErrorVariants({ size })}>\n {({ validationErrors }) => {\n // Display custom errorMessage if provided, otherwise show validation errors\n const displayError = errorMessage || validationErrors.join(' ');\n return displayError ? (\n <>\n <AlertCircle className=\"h-4 w-4\" aria-hidden=\"true\" />\n {displayError}\n </>\n ) : null;\n }}\n </FieldError>\n\n {/* Popover with ListBox */}\n <Popover className={selectPopoverVariants({ size })}>\n <ListBox className=\"outline-none\">\n {/* Loading skeleton (if loading and has children) */}\n {isLoading && childCount > 0 && (\n <>\n {Array.from({ length: 3 }).map((_, i) => (\n <div\n key={`skeleton-${i}`}\n className=\"h-11 px-4 py-2\"\n >\n <div className=\"h-4 bg-[var(--accent-background)] rounded animate-pulse\" />\n </div>\n ))}\n </>\n )}\n\n {/* Items or empty state */}\n {!isLoading && (\n <>\n {children}\n {/* Empty state - render as disabled item so popover can open */}\n {childCount === 0 && (\n <ListBoxItem\n id=\"__empty__\"\n textValue=\"empty\"\n isDisabled\n className=\"py-6 text-center text-sm text-[var(--menu-muted)] cursor-default pointer-events-none\"\n >\n <span role=\"status\">\n {emptyStateMessage || 'No options available'}\n </span>\n </ListBoxItem>\n )}\n </>\n )}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n}\n\n/**\n * Select Root Component (Single Selection Only)\n *\n * Main select component with controlled/uncontrolled modes for single selection.\n * For multiple selection, use MultiSelect component.\n * Delegates shared rendering to SelectBase.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst SelectRoot = forwardRef<HTMLButtonElement, Omit<SelectProps, 'selectionMode'>>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items (Decision 22: Large Item Count Handling)\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string,\n defaultValue: defaultValue as string,\n onChange: (key: unknown) => {\n if (onChange) {\n onChange(key as string);\n }\n },\n placeholder,\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={<SelectValue className=\"flex-1 text-left truncate\" />}\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nSelectRoot.displayName = 'Select';\n\n/**\n * MultiSelect Root Component (Multiple Selection)\n *\n * Select component for multiple selection. Uses different API from single Select.\n * Delegates shared rendering to SelectBase, adding multi-select display value logic.\n *\n * @see select-prd.md US-6 (Multiple Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst MultiSelectRoot = forwardRef<HTMLButtonElement, SelectProps>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n selectionMode: _selectionMode = 'multiple',\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n // Build value-to-label map for display (memoized to prevent recreation on every render)\n const valueToLabelMap = useMemo(() => {\n const map = new Map<string, string>();\n const processChildren = (nodes: ReactNode): void => {\n Children.forEach(nodes, (child) => {\n if (isValidElement(child)) {\n const element = child as ReactElement<{ value?: string; children?: ReactNode }>;\n if (element.type === SelectItem || element.props?.value) {\n const itemValue = element.props.value;\n const itemChildren = element.props.children;\n if (itemValue && typeof itemChildren === 'string') {\n map.set(itemValue, itemChildren);\n }\n }\n if (element.props?.children) {\n processChildren(element.props.children);\n }\n }\n });\n };\n processChildren(children);\n return map;\n }, [children]);\n\n // Multi-select display logic (Decision 5: Multi-select threshold)\n // Memoized to prevent recalculation on every render\n const displayValue = useMemo(() => {\n if (!value || !Array.isArray(value) || value.length === 0) {\n return placeholder || '';\n }\n\n if (value.length <= 2) {\n // Show item labels for 1-2 items\n const labels = value.map(v => valueToLabelMap.get(v as string) || v);\n return labels.join(', ');\n }\n\n // Show count for 3+ items\n return `${value.length} items selected`;\n }, [value, valueToLabelMap, placeholder]);\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string[],\n defaultValue: defaultValue as string[],\n onChange: (keys: unknown) => {\n if (onChange) {\n onChange(keys as string[]);\n }\n },\n selectionMode: 'multiple',\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={\n <span className=\"flex-1 text-left truncate\">\n {displayValue}\n </span>\n }\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nMultiSelectRoot.displayName = 'MultiSelect';\n\n/**\n * Select.Item Component\n *\n * Individual selectable item with checkmark icon.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 6 (Left-side checkmark)\n * @see plan.md Decision 23 (textValue required for custom children)\n */\nconst SelectItem = memo(function SelectItem({ children, textValue, value, isDisabled = false, className, ...props }: SelectItemProps): ReactElement {\n // Validate textValue for custom children (Decision 23)\n if (!textValue && typeof children !== 'string') {\n const message = 'Select.Item with custom children requires textValue prop for accessibility';\n if (process.env.NODE_ENV === 'development') {\n throw new Error(message);\n } else {\n console.warn(message);\n }\n }\n\n return (\n <ListBoxItem\n id={value}\n textValue={textValue || (typeof children === 'string' ? children : undefined)}\n className={`${selectItemVariants({ size: 'default' })} ${className || ''}`}\n isDisabled={isDisabled}\n {...props}\n >\n {({ isSelected, selectionMode, isDisabled: itemDisabled }) => (\n <>\n {/* Checkmark icon (left side) - Decision 6 */}\n {selectionMode === 'multiple' ? (\n <CheckSquare\n className={`absolute left-2 h-4 w-4 ${isSelected ? 'visible' : 'invisible'}`}\n aria-hidden=\"true\"\n />\n ) : (\n isSelected && <Check className=\"absolute left-2 h-4 w-4\" aria-hidden=\"true\" />\n )}\n <span className={itemDisabled ? 'text-[var(--menu-muted)]' : ''}>\n {children}\n </span>\n </>\n )}\n </ListBoxItem>\n );\n});\n\nSelectItem.displayName = 'SelectItem';\n\n/**\n * Select.Section Component\n *\n * Groups related items with optional header.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectSection({ children, className, ...props }: SelectSectionProps): ReactElement {\n return (\n <ListBoxSection className={`border-t border-[var(--border)] first:border-t-0 ${className || ''}`} {...props}>\n {children}\n </ListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n\n/**\n * Select.Header Component\n *\n * Section header with non-interactive label.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectHeader({ children, className, ...props }: SelectHeaderProps): ReactElement {\n return (\n <Header className={`${selectSectionVariants({ size: 'default' })} ${className || ''}`} {...props}>\n {children}\n </Header>\n );\n}\n\nSelectHeader.displayName = 'SelectHeader';\n\n/**\n * Compound Component Exports\n *\n * Uses Object.assign() for compound components (e.g., Select.Item, Select.Section).\n * Named exports (SelectItem, SelectSection, SelectHeader) are also available below\n * for better tree-shaking. Prefer named exports in new code.\n *\n * @deprecated (v2) The Object.assign compound pattern will be removed in v2.\n * Migrate to named imports: `import { SelectItem, SelectSection, SelectHeader } from '...'`\n *\n * @see GUIDE.mdx (Compound component pattern)\n */\nexport const Select = Object.assign(SelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\nexport const MultiSelect = Object.assign(MultiSelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\n// Named exports for individual components (preferred for tree-shaking)\nexport { SelectRoot, MultiSelectRoot, SelectItem, SelectSection, SelectHeader };\n","import { z } from 'zod';\n\n/**\n * Base props schema for all Themis components\n * Ensures consistent accessibility and styling APIs across the library\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements)\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AA minimum)\n */\nexport const BaseComponentPropsSchema = z.object({\n // Styling\n className: z.string().optional(),\n\n // React\n children: z.any().optional(), // ReactNode not directly supported by Zod\n id: z.string().optional(),\n\n // Accessibility (WCAG 2.2 AA requirements)\n 'aria-label': z.string().optional(),\n 'aria-labelledby': z.string().optional(),\n 'aria-describedby': z.string().optional(),\n 'aria-live': z.enum(['off', 'polite', 'assertive']).optional(),\n 'aria-hidden': z.boolean().optional(),\n\n // Testing & Development\n 'data-testid': z.string().optional(),\n});\n\nexport type BaseComponentProps = z.infer<typeof BaseComponentPropsSchema>;\n","import { z } from 'zod';\nimport { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\nimport type { ReactNode } from 'react';\nimport type {\n SelectProps as AriaSelectProps,\n ListBoxItemProps as AriaListBoxItemProps,\n} from 'react-aria-components';\n\n/**\n * Select size variants\n *\n * @see select-prd.md US-9 (Visual States - Size Variants)\n * @see plan.md Decision 4 (Include sm size with warning for desktop-only)\n */\nexport const SelectSizeSchema = z.enum(['sm', 'default', 'lg']);\nexport type SelectSize = z.infer<typeof SelectSizeSchema>;\n\n/**\n * Select selection mode\n *\n * @see select-prd.md US-6 (Multiple Selection)\n */\nexport const SelectionModeSchema = z.enum(['single', 'multiple']);\nexport type SelectionMode = z.infer<typeof SelectionModeSchema>;\n\n/**\n * Select validation behavior\n *\n * @see select-prd.md US-4 (Validation and Error Messages)\n */\nexport const ValidationBehaviorSchema = z.enum(['native', 'aria']);\nexport type ValidationBehavior = z.infer<typeof ValidationBehaviorSchema>;\n\n/**\n * Select root component props schema\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see select-prd.md US-4 (Validation and Error Messages)\n * @see select-prd.md US-5 (Disabled States)\n * @see select-prd.md US-6 (Multiple Selection)\n * @see select-prd.md US-7 (Async Data Loading)\n * @see select-prd.md US-10 (Form Integration)\n */\nexport const SelectPropsSchema = BaseComponentPropsSchema.extend({\n // Display props (US-1)\n label: z.string(), // Required for accessibility\n placeholder: z.string().optional(),\n description: z.string().optional(),\n\n // Selection props (US-1, US-6)\n value: z.union([z.string(), z.array(z.string())]).optional(),\n defaultValue: z.union([z.string(), z.array(z.string())]).optional(),\n selectionMode: SelectionModeSchema.optional().default('single'),\n\n // State props (US-1, US-5)\n isOpen: z.boolean().optional(),\n isDisabled: z.boolean().optional().default(false),\n isRequired: z.boolean().optional().default(false),\n disabledKeys: z.array(z.string()).optional(),\n\n // Validation props (US-4)\n validate: z\n .custom<(value: string | string[]) => string | undefined>()\n .optional(),\n validationBehavior: ValidationBehaviorSchema.optional().default('aria'),\n errorMessage: z.string().optional(),\n\n // Loading state (US-7)\n isLoading: z.boolean().optional().default(false),\n emptyStateMessage: z.string().optional(),\n\n // Form integration (US-10)\n name: z.string().optional(),\n\n // Size variant (US-9)\n size: SelectSizeSchema.optional().default('default'),\n\n // Event handlers (US-1)\n onChange: z\n .custom<(value: string | string[]) => void>()\n .optional(),\n onOpenChange: z.custom<(isOpen: boolean) => void>().optional(),\n\n // Children (Select.Item, Select.Section components)\n children: z.custom<ReactNode>(),\n});\n\nexport type SelectProps = z.infer<typeof SelectPropsSchema> &\n Omit<AriaSelectProps<object>, keyof z.infer<typeof SelectPropsSchema>>;\n\n/**\n * Select.Item props schema\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see select-prd.md US-5 (Disabled States)\n * @see select-prd.md US-8 (Custom Value Rendering)\n * @see plan.md Decision 23 (textValue required for custom children)\n */\nexport const SelectItemPropsSchema = BaseComponentPropsSchema.extend({\n // Item value (required)\n value: z.string(),\n\n // Text value for typeahead and accessibility (required for custom children)\n textValue: z.string().optional(),\n\n // Disabled state\n isDisabled: z.boolean().optional().default(false),\n\n // Item content\n children: z.custom<ReactNode>(),\n\n // Optional className for custom styling\n className: z.string().optional(),\n});\n\nexport type SelectItemProps = z.infer<typeof SelectItemPropsSchema> &\n Omit<AriaListBoxItemProps, keyof z.infer<typeof SelectItemPropsSchema>>;\n\n/**\n * Select.Section props schema\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nexport const SelectSectionPropsSchema = BaseComponentPropsSchema.extend({\n // Section content (typically Select.Header + Select.Item components)\n children: z.custom<ReactNode>(),\n\n // Optional className for custom styling\n className: z.string().optional(),\n});\n\nexport type SelectSectionProps = z.infer<typeof SelectSectionPropsSchema>;\n\n/**\n * Select.Header props schema (for section headers)\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nexport const SelectHeaderPropsSchema = BaseComponentPropsSchema.extend({\n // Header text\n children: z.custom<ReactNode>(),\n\n // Optional className for header styling\n className: z.string().optional(),\n});\n\nexport type SelectHeaderProps = z.infer<typeof SelectHeaderPropsSchema>;\n\n/**\n * CVA variant configuration types\n * Used for class-variance-authority integration\n */\nexport type SelectVariantSize = SelectSize;\nexport type SelectVariantSelectionMode = SelectionMode;\n"]}
1
+ {"version":3,"sources":["../../../src/elements/Select/Select.styles.ts","../../../src/elements/Select/Select.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/Select/Select.types.ts"],"names":["selectTriggerVariants","cva","selectItemVariants","selectPopoverVariants","selectSectionVariants","selectErrorVariants","SelectBase","ariaSelectProps","triggerContent","triggerRef","label","description","isRequired","isDisabled","isLoading","errorMessage","size","emptyStateMessage","childCount","children","labelId","useId","descriptionId","errorId","isInvalid","jsxs","AriaSelect","Label","jsx","Text","Button","Loader2","ChevronDown","FieldError","validationErrors","displayError","Fragment","AlertCircle","Popover","ListBox","_","i","ListBoxItem","SelectRoot","forwardRef","placeholder","value","defaultValue","isOpen","disabledKeys","validate","validationBehavior","name","onChange","onOpenChange","className","props","ref","Children","key","SelectValue","MultiSelectRoot","_selectionMode","valueToLabelMap","useMemo","map","processChildren","nodes","child","isValidElement","element","SelectItem","itemValue","itemChildren","displayValue","v","keys","memo","textValue","message","isSelected","selectionMode","itemDisabled","CheckSquare","Check","SelectSection","ListBoxSection","SelectHeader","Header","Select","MultiSelect","BaseComponentPropsSchema","z","SelectSizeSchema","SelectionModeSchema","ValidationBehaviorSchema","SelectPropsSchema","SelectItemPropsSchema","SelectSectionPropsSchema","SelectHeaderPropsSchema"],"mappings":"8YAQO,IAAMA,CAAAA,CAAwBC,IACnC,CAEE,MAAA,CACA,SACA,cAAA,CACA,iBAAA,CACA,aACA,QAAA,CACA,gCAAA,CACA,mCACA,mBAAA,CACA,cAAA,CACA,cAAA,CAEA,sBAAA,CACA,mCACA,6BAAA,CAEA,6BAAA,CAEA,8BACA,qBAAA,CAEA,iCAAA,CAEA,UACF,CAAA,CACA,CACE,SAAU,CACR,IAAA,CAAM,CAGJ,EAAA,CAAI,+BAAA,CACJ,QAAS,kCAAA,CACT,EAAA,CAAI,gCACN,CAAA,CACA,SAAA,CAAW,CACT,IAAA,CAAM,yCACN,KAAA,CAAO,oEACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,SAAA,CACN,UAAW,KACb,CACF,CACF,CAAA,CAQaC,CAAAA,CAAqBD,IAChC,CAEE,UAAA,CACA,OACA,QA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,CAAE,QAAA,GAAW,OAAA,CAAQ,KAAK,EAC/C,iBAAA,CAAmBA,CAAAA,CAAE,QAAO,CAAE,QAAA,GAG9B,IAAA,CAAMA,CAAAA,CAAE,QAAO,CAAE,QAAA,EAAS,CAG1B,IAAA,CAAMC,GAAiB,QAAA,EAAS,CAAE,QAAQ,SAAS,CAAA,CAGnD,SAAUD,CAAAA,CACP,MAAA,GACA,QAAA,EAAS,CACZ,aAAcA,CAAAA,CAAE,MAAA,GAAoC,QAAA,EAAS,CAG7D,SAAUA,CAAAA,CAAE,MAAA,EACd,CAAC,EAaYK,EAAAA,CAAwBN,CAAAA,CAAyB,OAAO,CAEnE,KAAA,CAAOC,EAAE,MAAA,EAAO,CAGhB,UAAWA,CAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAG/B,WAAYA,CAAAA,CAAE,OAAA,GAAU,QAAA,EAAS,CAAE,OAAA,CAAQ,KAAK,EAGhD,QAAA,CAAUA,CAAAA,CAAE,QAAkB,CAG9B,SAAA,CAAWA,EAAE,MAAA,EAAO,CAAE,UACxB,CAAC,EAUYM,EAAAA,CAA2BP,CAAAA,CAAyB,OAAO,CAEtE,QAAA,CAAUC,EAAE,MAAA,EAAkB,CAG9B,UAAWA,CAAAA,CAAE,MAAA,GAAS,QAAA,EACxB,CAAC,CAAA,CASYO,EAAAA,CAA0BR,EAAyB,MAAA,CAAO,CAErE,SAAUC,CAAAA,CAAE,MAAA,GAGZ,SAAA,CAAWA,CAAAA,CAAE,QAAO,CAAE,QAAA,EACxB,CAAC","file":"index.mjs","sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\n/**\n * CVA Variants for Select Trigger Button\n *\n * Styles the trigger button that opens the select popover.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectTriggerVariants = cva(\n [\n // Base styles\n 'flex',\n 'w-full',\n 'items-center',\n 'justify-between',\n 'rounded-md',\n 'border',\n 'bg-[var(--content-background)]',\n 'text-[var(--content-foreground)]',\n 'transition-colors',\n 'duration-200',\n 'outline-none',\n // Focus ring (WCAG 2.2 AAA - 7:1 contrast)\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n // Hover state\n 'hover:bg-[var(--accent)]/10',\n // Disabled state\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n // Loading state\n 'data-[loading=true]:cursor-wait',\n // Truncate text\n 'truncate',\n ],\n {\n variants: {\n size: {\n // All sizes use 44px minimum touch target for WCAG 2.2 AAA compliance\n // Visual height varies but touch area remains accessible\n sm: 'h-9 px-3 text-sm min-h-[44px]',\n default: 'h-11 px-4 text-base min-h-[44px]',\n lg: 'h-14 px-5 text-lg min-h-[44px]',\n },\n isInvalid: {\n true: 'border-[var(--destructive-background)]',\n false: 'border-[var(--input-border)] hover:border-[var(--input-border)]/80',\n },\n },\n defaultVariants: {\n size: 'default',\n isInvalid: false,\n },\n }\n);\n\n/**\n * CVA Variants for Select Items\n *\n * Styles individual selectable items within the listbox.\n * All sizes enforce 44px minimum touch targets for WCAG 2.2 AAA compliance.\n */\nexport const selectItemVariants = cva(\n [\n // Base styles\n 'relative',\n 'flex',\n 'w-full',\n 'cursor-pointer',\n 'select-none',\n 'items-center',\n 'rounded-sm',\n 'outline-none',\n 'transition-colors',\n // Padding for checkmark icon (left side)\n 'pl-8',\n 'pr-2',\n // Hover state\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n // Focus state\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n // Selected state\n 'data-[selected=true]:bg-[var(--accent)]',\n 'data-[selected=true]:text-[var(--accent-foreground)]',\n // Disabled state\n 'data-[disabled=true]:pointer-events-none',\n 'data-[disabled=true]:opacity-50',\n 'data-[disabled=true]:text-[var(--menu-muted)]',\n ],\n {\n variants: {\n size: {\n // All sizes use 44px minimum touch target for WCAG 2.2 AAA compliance\n sm: 'h-9 py-1.5 text-sm min-h-[44px]',\n default: 'h-11 py-2 text-base min-h-[44px]',\n lg: 'h-14 py-3 text-lg min-h-[44px]',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Select Popover\n *\n * Styles the popover container that holds the listbox.\n * Uses menu tokens to match Dropdown styling.\n */\nexport const selectPopoverVariants = cva(\n [\n // Base styles - use menu tokens to match Dropdown styling\n 'z-50',\n 'w-[--trigger-width]',\n 'rounded-md',\n 'border',\n 'border-[var(--menu-border)]',\n 'bg-[var(--menu-background)]',\n 'text-[var(--menu-foreground)]',\n 'shadow-md',\n 'outline-none',\n 'overflow-auto',\n // Animations\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n ],\n {\n variants: {\n size: {\n sm: 'max-h-[200px] p-1',\n default: 'max-h-[300px] p-1',\n lg: 'max-h-[400px] p-1',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Section Headers\n *\n * Styles the non-interactive section header labels within grouped selects.\n */\nexport const selectSectionVariants = cva(\n [\n 'px-2',\n 'py-1.5',\n 'text-xs',\n 'font-semibold',\n 'text-[var(--menu-muted)]',\n 'uppercase',\n 'tracking-wider',\n ],\n {\n variants: {\n size: {\n sm: 'px-2 py-1 text-[10px]',\n default: 'px-2 py-1.5 text-xs',\n lg: 'px-3 py-2 text-sm',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * CVA Variants for Error Messages\n *\n * Styles the error message displayed below the select trigger.\n */\nexport const selectErrorVariants = cva(\n [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-sm',\n 'font-medium',\n 'text-[var(--destructive-background)]',\n 'mt-1.5',\n ],\n {\n variants: {\n size: {\n sm: 'text-xs mt-1',\n default: 'text-sm mt-1.5',\n lg: 'text-base mt-2',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n);\n\n/**\n * Type exports for variant props.\n * Allows TypeScript inference of variant combinations.\n */\nexport type SelectTriggerVariantProps = VariantProps<typeof selectTriggerVariants>;\nexport type SelectItemVariantProps = VariantProps<typeof selectItemVariants>;\nexport type SelectPopoverVariantProps = VariantProps<typeof selectPopoverVariants>;\nexport type SelectSectionVariantProps = VariantProps<typeof selectSectionVariants>;\nexport type SelectErrorVariantProps = VariantProps<typeof selectErrorVariants>;\n","'use client';\n\n/**\n * Select Component - Implementation\n *\n * Accessible select/dropdown component combining React Aria primitives with ShadCN styling.\n * Follows Themis library patterns with compound component structure.\n *\n * Architecture:\n * - SelectBase: Internal component containing shared label, description, trigger, error, and listbox rendering.\n * - SelectRoot: Single selection wrapper (thin layer over SelectBase).\n * - MultiSelectRoot: Multiple selection wrapper with display value logic (thin layer over SelectBase).\n * - SelectItem, SelectSection, SelectHeader: Compound sub-components.\n *\n * @see select-prd.md (Full requirements)\n * @see Select.types.ts (Zod schemas)\n * @see Select.styles.ts (CVA variant definitions)\n * @see plan.md (Implementation plan)\n */\n\nimport {\n forwardRef,\n memo,\n Children,\n useId,\n useMemo,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport {\n Select as AriaSelect,\n Label,\n Button,\n SelectValue,\n Popover,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Header,\n Text,\n FieldError,\n} from 'react-aria-components';\nimport { Check, CheckSquare, ChevronDown, Loader2, AlertCircle } from 'lucide-react';\nimport type {\n SelectProps,\n SelectItemProps,\n SelectSectionProps,\n SelectHeaderProps,\n SelectSize,\n} from './Select.types';\nimport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n// Re-export CVA variants so existing imports from './Select' continue to work\nexport {\n selectTriggerVariants,\n selectItemVariants,\n selectPopoverVariants,\n selectSectionVariants,\n selectErrorVariants,\n} from './Select.styles';\n\n/**\n * Internal props for SelectBase.\n * Extends the shared props with selection-mode-specific configuration.\n */\ninterface SelectBaseProps {\n /** The AriaSelect props to spread onto the root element */\n ariaSelectProps: Record<string, unknown>;\n /** Content to render inside the trigger button (SelectValue for single, span for multi) */\n triggerContent: ReactNode;\n /** Ref to forward to the trigger button */\n triggerRef: Ref<HTMLButtonElement>;\n /** Label text */\n label: string;\n /** Optional description text */\n description?: string;\n /** Whether the field is required */\n isRequired: boolean;\n /** Whether the field is disabled */\n isDisabled: boolean;\n /** Whether the field is in a loading state */\n isLoading: boolean;\n /** Error message to display */\n errorMessage?: string;\n /** Size variant */\n size: SelectSize;\n /** Empty state message override */\n emptyStateMessage?: string;\n /** Child count (pre-computed by parent) */\n childCount: number;\n /** Children to render in the listbox */\n children: ReactNode;\n}\n\n/**\n * SelectBase - Internal shared rendering component\n *\n * Contains the shared rendering logic for label, description, trigger button,\n * error message, and popover/listbox that both SelectRoot and MultiSelectRoot use.\n * This is not exported as part of the public API.\n */\nfunction SelectBase({\n ariaSelectProps,\n triggerContent,\n triggerRef,\n label,\n description,\n isRequired,\n isDisabled,\n isLoading,\n errorMessage,\n size,\n emptyStateMessage,\n childCount,\n children,\n}: SelectBaseProps): ReactElement {\n // Generate unique IDs for accessibility\n const labelId = useId();\n const descriptionId = useId();\n const errorId = useId();\n\n // Determine if invalid based on errorMessage\n const isInvalid = Boolean(errorMessage);\n\n return (\n <AriaSelect\n {...ariaSelectProps}\n isInvalid={isInvalid}\n >\n {/* Label */}\n <Label id={labelId} className=\"text-sm font-medium text-[var(--content-foreground)]\">\n {label}\n {isRequired && <span className=\"text-[var(--destructive-background)] ml-1\">*</span>}\n </Label>\n\n {/* Description (if provided) */}\n {description && (\n <Text id={descriptionId} slot=\"description\" className=\"text-sm text-[var(--menu-muted)] mt-1\">\n {description}\n </Text>\n )}\n\n {/* Trigger Button */}\n <Button\n ref={triggerRef}\n className={selectTriggerVariants({ size, isInvalid })}\n aria-labelledby={labelId}\n aria-describedby={description ? descriptionId : errorMessage ? errorId : undefined}\n data-loading={isLoading}\n {...(isRequired && { 'aria-required': 'true' })}\n {...(isLoading && { 'aria-busy': 'true' })}\n {...((isDisabled || isLoading) && { 'aria-disabled': 'true' })}\n >\n {triggerContent}\n\n {/* Loading spinner or chevron icon */}\n {isLoading ? (\n <Loader2 className=\"h-4 w-4 animate-spin text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n ) : (\n <ChevronDown className=\"h-4 w-4 text-[var(--menu-muted)]\" aria-hidden=\"true\" />\n )}\n </Button>\n\n {/* Error Message */}\n <FieldError id={errorId} className={selectErrorVariants({ size })}>\n {({ validationErrors }) => {\n // Display custom errorMessage if provided, otherwise show validation errors\n const displayError = errorMessage || validationErrors.join(' ');\n return displayError ? (\n <>\n <AlertCircle className=\"h-4 w-4\" aria-hidden=\"true\" />\n {displayError}\n </>\n ) : null;\n }}\n </FieldError>\n\n {/* Popover with ListBox */}\n <Popover className={selectPopoverVariants({ size })}>\n <ListBox className=\"outline-none\">\n {/* Loading skeleton (if loading and has children) */}\n {isLoading && childCount > 0 && (\n <>\n {Array.from({ length: 3 }).map((_, i) => (\n <div\n key={`skeleton-${i}`}\n className=\"h-11 px-4 py-2\"\n >\n <div className=\"h-4 bg-[var(--accent-background)] rounded animate-pulse\" />\n </div>\n ))}\n </>\n )}\n\n {/* Items or empty state */}\n {!isLoading && (\n <>\n {children}\n {/* Empty state - render as disabled item so popover can open */}\n {childCount === 0 && (\n <ListBoxItem\n id=\"__empty__\"\n textValue=\"empty\"\n isDisabled\n className=\"py-6 text-center text-sm text-[var(--menu-muted)] cursor-default pointer-events-none\"\n >\n <span role=\"status\">\n {emptyStateMessage || 'No options available'}\n </span>\n </ListBoxItem>\n )}\n </>\n )}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n}\n\n/**\n * Select Root Component (Single Selection Only)\n *\n * Main select component with controlled/uncontrolled modes for single selection.\n * For multiple selection, use MultiSelect component.\n * Delegates shared rendering to SelectBase.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst SelectRoot = forwardRef<HTMLButtonElement, Omit<SelectProps, 'selectionMode'>>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items (Decision 22: Large Item Count Handling)\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string,\n defaultValue: defaultValue as string,\n onChange: (key: unknown) => {\n if (onChange) {\n onChange(key as string);\n }\n },\n placeholder,\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={<SelectValue className=\"flex-1 text-left truncate\" />}\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nSelectRoot.displayName = 'Select';\n\n/**\n * MultiSelect Root Component (Multiple Selection)\n *\n * Select component for multiple selection. Uses different API from single Select.\n * Delegates shared rendering to SelectBase, adding multi-select display value logic.\n *\n * @see select-prd.md US-6 (Multiple Selection)\n * @see plan.md Decision 28 (Ref forwarding to trigger button)\n */\nconst MultiSelectRoot = forwardRef<HTMLButtonElement, SelectProps>(\n (\n {\n // Display props\n label,\n placeholder,\n description,\n\n // Selection props\n value,\n defaultValue,\n selectionMode: _selectionMode = 'multiple',\n\n // State props\n isOpen,\n isDisabled = false,\n isRequired = false,\n disabledKeys,\n\n // Validation props\n validate,\n validationBehavior = 'aria',\n errorMessage,\n\n // Loading state\n isLoading = false,\n emptyStateMessage,\n\n // Form integration\n name,\n\n // Size variant\n size = 'default',\n\n // Event handlers\n onChange,\n onOpenChange,\n\n // Standard props\n className,\n children,\n ...props\n },\n ref\n ) => {\n // Warn if >1000 items\n const childCount = Children.count(children);\n if (childCount > 1000) {\n console.warn(\n 'Select has >1000 items. Consider using Autocomplete component for better performance.'\n );\n }\n\n // Build value-to-label map for display (memoized to prevent recreation on every render)\n const valueToLabelMap = useMemo(() => {\n const map = new Map<string, string>();\n const processChildren = (nodes: ReactNode): void => {\n Children.forEach(nodes, (child) => {\n if (isValidElement(child)) {\n const element = child as ReactElement<{ value?: string; children?: ReactNode }>;\n if (element.type === SelectItem || element.props?.value) {\n const itemValue = element.props.value;\n const itemChildren = element.props.children;\n if (itemValue && typeof itemChildren === 'string') {\n map.set(itemValue, itemChildren);\n }\n }\n if (element.props?.children) {\n processChildren(element.props.children);\n }\n }\n });\n };\n processChildren(children);\n return map;\n }, [children]);\n\n // Multi-select display logic (Decision 5: Multi-select threshold)\n // Memoized to prevent recalculation on every render\n const displayValue = useMemo(() => {\n if (!value || !Array.isArray(value) || value.length === 0) {\n return placeholder || '';\n }\n\n if (value.length <= 2) {\n // Show item labels for 1-2 items\n const labels = value.map(v => valueToLabelMap.get(v as string) || v);\n return labels.join(', ');\n }\n\n // Show count for 3+ items\n return `${value.length} items selected`;\n }, [value, valueToLabelMap, placeholder]);\n\n return (\n <SelectBase\n ariaSelectProps={{\n value: value as string[],\n defaultValue: defaultValue as string[],\n onChange: (keys: unknown) => {\n if (onChange) {\n onChange(keys as string[]);\n }\n },\n selectionMode: 'multiple',\n disabledKeys,\n isOpen,\n onOpenChange,\n isDisabled: isDisabled || isLoading,\n isRequired,\n name,\n validate: validate as ((value: unknown) => true | string | null | undefined) | undefined,\n validationBehavior,\n className,\n ...props,\n }}\n triggerContent={\n <span className=\"flex-1 text-left truncate\">\n {displayValue}\n </span>\n }\n triggerRef={ref}\n label={label}\n description={description}\n isRequired={isRequired}\n isDisabled={isDisabled}\n isLoading={isLoading}\n errorMessage={errorMessage}\n size={size}\n emptyStateMessage={emptyStateMessage}\n childCount={childCount}\n >\n {children}\n </SelectBase>\n );\n }\n);\n\nMultiSelectRoot.displayName = 'MultiSelect';\n\n/**\n * Select.Item Component\n *\n * Individual selectable item with checkmark icon.\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see plan.md Decision 6 (Left-side checkmark)\n * @see plan.md Decision 23 (textValue required for custom children)\n */\nconst SelectItem = memo(function SelectItem({ children, textValue, value, isDisabled = false, className, ...props }: SelectItemProps): ReactElement {\n // Validate textValue for custom children (Decision 23)\n if (!textValue && typeof children !== 'string') {\n const message = 'Select.Item with custom children requires textValue prop for accessibility';\n if (process.env.NODE_ENV === 'development') {\n throw new Error(message);\n } else {\n console.warn(message);\n }\n }\n\n return (\n <ListBoxItem\n id={value}\n textValue={textValue || (typeof children === 'string' ? children : undefined)}\n className={`${selectItemVariants({ size: 'default' })} ${className || ''}`}\n isDisabled={isDisabled}\n {...props}\n >\n {({ isSelected, selectionMode, isDisabled: itemDisabled }) => (\n <>\n {/* Checkmark icon (left side) - Decision 6 */}\n {selectionMode === 'multiple' ? (\n <CheckSquare\n className={`absolute left-2 h-4 w-4 ${isSelected ? 'visible' : 'invisible'}`}\n aria-hidden=\"true\"\n />\n ) : (\n isSelected && <Check className=\"absolute left-2 h-4 w-4\" aria-hidden=\"true\" />\n )}\n <span className={itemDisabled ? 'text-[var(--menu-muted)]' : ''}>\n {children}\n </span>\n </>\n )}\n </ListBoxItem>\n );\n});\n\nSelectItem.displayName = 'SelectItem';\n\n/**\n * Select.Section Component\n *\n * Groups related items with optional header.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectSection({ children, className, ...props }: SelectSectionProps): ReactElement {\n return (\n <ListBoxSection className={`border-t border-[var(--border)] first:border-t-0 ${className || ''}`} {...props}>\n {children}\n </ListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n\n/**\n * Select.Header Component\n *\n * Section header with non-interactive label.\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nfunction SelectHeader({ children, className, ...props }: SelectHeaderProps): ReactElement {\n return (\n <Header className={`${selectSectionVariants({ size: 'default' })} ${className || ''}`} {...props}>\n {children}\n </Header>\n );\n}\n\nSelectHeader.displayName = 'SelectHeader';\n\n/**\n * Compound Component Exports\n *\n * Uses Object.assign() for compound components (e.g., Select.Item, Select.Section).\n * Named exports (SelectItem, SelectSection, SelectHeader) are also available below\n * for better tree-shaking. Prefer named exports in new code.\n *\n * @deprecated (v2) The Object.assign compound pattern will be removed in v2.\n * Migrate to named imports: `import { SelectItem, SelectSection, SelectHeader } from '...'`\n *\n * @see GUIDE.mdx (Compound component pattern)\n */\nexport const Select = Object.assign(SelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\nexport const MultiSelect = Object.assign(MultiSelectRoot, {\n Item: SelectItem,\n Section: SelectSection,\n Header: SelectHeader,\n});\n\n// Named exports for individual components (preferred for tree-shaking)\nexport { SelectRoot, MultiSelectRoot, SelectItem, SelectSection, SelectHeader };\n","import { z } from 'zod';\n\n/**\n * Base props schema for all Themis components\n * Ensures consistent accessibility and styling APIs across the library\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements)\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AA minimum)\n */\nexport const BaseComponentPropsSchema = z.object({\n // Styling\n className: z.string().optional(),\n\n // React\n children: z.any().optional(), // ReactNode not directly supported by Zod\n id: z.string().optional(),\n\n // Accessibility (WCAG 2.2 AA requirements)\n 'aria-label': z.string().optional(),\n 'aria-labelledby': z.string().optional(),\n 'aria-describedby': z.string().optional(),\n 'aria-live': z.enum(['off', 'polite', 'assertive']).optional(),\n 'aria-hidden': z.boolean().optional(),\n\n // Testing & Development\n 'data-testid': z.string().optional(),\n});\n\nexport type BaseComponentProps = z.infer<typeof BaseComponentPropsSchema>;\n","import { z } from 'zod';\nimport { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\nimport type { ReactNode } from 'react';\nimport type {\n SelectProps as AriaSelectProps,\n ListBoxItemProps as AriaListBoxItemProps,\n} from 'react-aria-components';\n\n/**\n * Select size variants\n *\n * @see select-prd.md US-9 (Visual States - Size Variants)\n * @see plan.md Decision 4 (Include sm size with warning for desktop-only)\n */\nexport const SelectSizeSchema = z.enum(['sm', 'default', 'lg']);\nexport type SelectSize = z.infer<typeof SelectSizeSchema>;\n\n/**\n * Select selection mode\n *\n * @see select-prd.md US-6 (Multiple Selection)\n */\nexport const SelectionModeSchema = z.enum(['single', 'multiple']);\nexport type SelectionMode = z.infer<typeof SelectionModeSchema>;\n\n/**\n * Select validation behavior\n *\n * @see select-prd.md US-4 (Validation and Error Messages)\n */\nexport const ValidationBehaviorSchema = z.enum(['native', 'aria']);\nexport type ValidationBehavior = z.infer<typeof ValidationBehaviorSchema>;\n\n/**\n * Select root component props schema\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see select-prd.md US-4 (Validation and Error Messages)\n * @see select-prd.md US-5 (Disabled States)\n * @see select-prd.md US-6 (Multiple Selection)\n * @see select-prd.md US-7 (Async Data Loading)\n * @see select-prd.md US-10 (Form Integration)\n */\nexport const SelectPropsSchema = BaseComponentPropsSchema.extend({\n // Display props (US-1)\n label: z.string(), // Required for accessibility\n placeholder: z.string().optional(),\n description: z.string().optional(),\n\n // Selection props (US-1, US-6)\n value: z.union([z.string(), z.array(z.string())]).optional(),\n defaultValue: z.union([z.string(), z.array(z.string())]).optional(),\n selectionMode: SelectionModeSchema.optional().default('single'),\n\n // State props (US-1, US-5)\n isOpen: z.boolean().optional(),\n isDisabled: z.boolean().optional().default(false),\n isRequired: z.boolean().optional().default(false),\n disabledKeys: z.array(z.string()).optional(),\n\n // Validation props (US-4)\n validate: z\n .custom<(value: string | string[]) => string | undefined>()\n .optional(),\n validationBehavior: ValidationBehaviorSchema.optional().default('aria'),\n errorMessage: z.string().optional(),\n\n // Loading state (US-7)\n isLoading: z.boolean().optional().default(false),\n emptyStateMessage: z.string().optional(),\n\n // Form integration (US-10)\n name: z.string().optional(),\n\n // Size variant (US-9)\n size: SelectSizeSchema.optional().default('default'),\n\n // Event handlers (US-1)\n onChange: z\n .custom<(value: string | string[]) => void>()\n .optional(),\n onOpenChange: z.custom<(isOpen: boolean) => void>().optional(),\n\n // Children (Select.Item, Select.Section components)\n children: z.custom<ReactNode>(),\n});\n\nexport type SelectProps = z.infer<typeof SelectPropsSchema> &\n Omit<AriaSelectProps<object>, keyof z.infer<typeof SelectPropsSchema>>;\n\n/**\n * Select.Item props schema\n *\n * @see select-prd.md US-1 (Basic Single Selection)\n * @see select-prd.md US-5 (Disabled States)\n * @see select-prd.md US-8 (Custom Value Rendering)\n * @see plan.md Decision 23 (textValue required for custom children)\n */\nexport const SelectItemPropsSchema = BaseComponentPropsSchema.extend({\n // Item value (required)\n value: z.string(),\n\n // Text value for typeahead and accessibility (required for custom children)\n textValue: z.string().optional(),\n\n // Disabled state\n isDisabled: z.boolean().optional().default(false),\n\n // Item content\n children: z.custom<ReactNode>(),\n\n // Optional className for custom styling\n className: z.string().optional(),\n});\n\nexport type SelectItemProps = z.infer<typeof SelectItemPropsSchema> &\n Omit<AriaListBoxItemProps, keyof z.infer<typeof SelectItemPropsSchema>>;\n\n/**\n * Select.Section props schema\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nexport const SelectSectionPropsSchema = BaseComponentPropsSchema.extend({\n // Section content (typically Select.Header + Select.Item components)\n children: z.custom<ReactNode>(),\n\n // Optional className for custom styling\n className: z.string().optional(),\n});\n\nexport type SelectSectionProps = z.infer<typeof SelectSectionPropsSchema>;\n\n/**\n * Select.Header props schema (for section headers)\n *\n * @see select-prd.md US-3 (Grouped Options with Sections)\n */\nexport const SelectHeaderPropsSchema = BaseComponentPropsSchema.extend({\n // Header text\n children: z.custom<ReactNode>(),\n\n // Optional className for header styling\n className: z.string().optional(),\n});\n\nexport type SelectHeaderProps = z.infer<typeof SelectHeaderPropsSchema>;\n\n/**\n * CVA variant configuration types\n * Used for class-variance-authority integration\n */\nexport type SelectVariantSize = SelectSize;\nexport type SelectVariantSelectionMode = SelectionMode;\n"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- 'use strict';var react=require('react'),reactAriaComponents=require('react-aria-components'),classVarianceAuthority=require('class-variance-authority'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod');function o(...s){return tailwindMerge.twMerge(clsx.clsx(s))}var u="data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2",A="data-[pressed]:scale-[0.97]";var V="data-[hovered]:shadow-md";var l="hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground",h="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",m="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";var S=`${u} ${A} ${V} ${l} ${h} ${m}`;var w=classVarianceAuthority.cva("inline-flex shrink-0 cursor-pointer items-center justify-center min-h-[44px] min-w-[44px] disabled:cursor-not-allowed disabled:opacity-50 data-[readonly]:cursor-default",{variants:{},defaultVariants:{}}),g=classVarianceAuthority.cva("relative inline-flex shrink-0 items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background",{variants:{variant:{default:"bg-[var(--input)] data-[selected]:bg-[var(--primary)]",destructive:"bg-[var(--input)] data-[selected]:bg-[var(--destructive)]"},size:{sm:"h-5 w-9",default:"h-6 w-11",lg:"h-7 w-14"}},defaultVariants:{variant:"default",size:"default"}}),b=classVarianceAuthority.cva("pointer-events-none absolute left-0.5 rounded-full bg-[var(--content-background)] shadow-lg ring-0 transition-transform data-[selected]:translate-x-full",{variants:{size:{sm:"h-4 w-4",default:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{size:"default"}}),x=react.memo(react.forwardRef(({className:s,variant:y,size:d,label:r,description:n,isDisabled:p,isReadOnly:f,...E},N)=>jsxRuntime.jsx(reactAriaComponents.Switch,{ref:N,isDisabled:p,isReadOnly:f,className:i=>o("group inline-flex items-center gap-2",p&&"cursor-not-allowed opacity-50",s),...E,children:i=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:o(w()),"data-selected":i.isSelected||void 0,"data-readonly":f||void 0,children:jsxRuntime.jsx("div",{className:o(g({variant:y,size:d}),S),"data-selected":i.isSelected||void 0,children:jsxRuntime.jsx("div",{className:o(b({size:d})),"data-selected":i.isSelected||void 0})})}),(r||n)&&jsxRuntime.jsxs("div",{className:"flex flex-col",children:[r&&jsxRuntime.jsx("span",{className:"text-sm font-medium text-[var(--content-foreground)]",children:r}),n&&jsxRuntime.jsx("span",{className:"text-xs text-[var(--menu-muted)]",children:n})]})]})})));x.displayName="Switch";var T=zod.z.object({className:zod.z.string().optional(),children:zod.z.any().optional(),id:zod.z.string().optional(),"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),"aria-describedby":zod.z.string().optional(),"aria-live":zod.z.enum(["off","polite","assertive"]).optional(),"aria-hidden":zod.z.boolean().optional(),"data-testid":zod.z.string().optional()});var I=T.extend({isSelected:zod.z.boolean().optional(),defaultSelected:zod.z.boolean().optional().default(false),onChange:zod.z.function().optional(),variant:zod.z.enum(["default","destructive"]).optional().default("default"),size:zod.z.enum(["sm","default","lg"]).optional().default("default"),isDisabled:zod.z.boolean().optional().default(false),isReadOnly:zod.z.boolean().optional().default(false),label:zod.z.string().optional(),description:zod.z.string().optional(),onFocus:zod.z.function().optional(),onBlur:zod.z.function().optional(),onFocusChange:zod.z.function().optional(),autoFocus:zod.z.boolean().optional()});exports.Switch=x;exports.SwitchPropsSchema=I;exports.switchOuterVariants=w;exports.switchThumbVariants=b;exports.switchTrackVariants=g;//# sourceMappingURL=index.js.map
2
+ 'use strict';var react=require('react'),reactAriaComponents=require('react-aria-components'),classVarianceAuthority=require('class-variance-authority'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod');function o(...r){return tailwindMerge.twMerge(clsx.clsx(r))}var u="data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2",A="data-[pressed]:scale-[0.97]";var V="data-[hovered]:shadow-md";var l="hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground",h="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",m="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";var S=`${u} ${A} ${V} ${l} ${h} ${m}`;var w=classVarianceAuthority.cva("inline-flex shrink-0 cursor-pointer items-center justify-center min-h-[44px] min-w-[44px] disabled:cursor-not-allowed disabled:opacity-50 data-[readonly]:cursor-default",{variants:{},defaultVariants:{}}),g=classVarianceAuthority.cva("relative inline-flex shrink-0 items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background",{variants:{variant:{default:"bg-[var(--input-background)] data-[selected]:bg-[var(--primary)]",destructive:"bg-[var(--input-background)] data-[selected]:bg-[var(--destructive-background)]"},size:{sm:"h-5 w-9",default:"h-6 w-11",lg:"h-7 w-14"}},defaultVariants:{variant:"default",size:"default"}}),b=classVarianceAuthority.cva("pointer-events-none absolute left-0.5 rounded-full bg-[var(--content-background)] shadow-lg ring-0 transition-transform data-[selected]:translate-x-full",{variants:{size:{sm:"h-4 w-4",default:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{size:"default"}}),x=react.memo(react.forwardRef(({className:r,variant:y,size:d,label:s,description:n,isDisabled:p,isReadOnly:f,...E},N)=>jsxRuntime.jsx(reactAriaComponents.Switch,{ref:N,isDisabled:p,isReadOnly:f,className:i=>o("group inline-flex items-center gap-2",p&&"cursor-not-allowed opacity-50",r),...E,children:i=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:o(w()),"data-selected":i.isSelected||void 0,"data-readonly":f||void 0,children:jsxRuntime.jsx("div",{className:o(g({variant:y,size:d}),S),"data-selected":i.isSelected||void 0,children:jsxRuntime.jsx("div",{className:o(b({size:d})),"data-selected":i.isSelected||void 0})})}),(s||n)&&jsxRuntime.jsxs("div",{className:"flex flex-col",children:[s&&jsxRuntime.jsx("span",{className:"text-sm font-medium text-[var(--content-foreground)]",children:s}),n&&jsxRuntime.jsx("span",{className:"text-xs text-[var(--menu-muted)]",children:n})]})]})})));x.displayName="Switch";var T=zod.z.object({className:zod.z.string().optional(),children:zod.z.any().optional(),id:zod.z.string().optional(),"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),"aria-describedby":zod.z.string().optional(),"aria-live":zod.z.enum(["off","polite","assertive"]).optional(),"aria-hidden":zod.z.boolean().optional(),"data-testid":zod.z.string().optional()});var I=T.extend({isSelected:zod.z.boolean().optional(),defaultSelected:zod.z.boolean().optional().default(false),onChange:zod.z.function().optional(),variant:zod.z.enum(["default","destructive"]).optional().default("default"),size:zod.z.enum(["sm","default","lg"]).optional().default("default"),isDisabled:zod.z.boolean().optional().default(false),isReadOnly:zod.z.boolean().optional().default(false),label:zod.z.string().optional(),description:zod.z.string().optional(),onFocus:zod.z.function().optional(),onBlur:zod.z.function().optional(),onFocusChange:zod.z.function().optional(),autoFocus:zod.z.boolean().optional()});exports.Switch=x;exports.SwitchPropsSchema=I;exports.switchOuterVariants=w;exports.switchThumbVariants=b;exports.switchTrackVariants=g;//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map