@cloudflare/kumo 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/ai/USAGE.md +38 -32
  3. package/ai/component-registry.json +123 -120
  4. package/ai/component-registry.md +203 -63
  5. package/ai/schemas.ts +1 -1
  6. package/dist/.build-complete +1 -1
  7. package/dist/ai/schemas.d.ts +40 -48
  8. package/dist/ai/schemas.d.ts.map +1 -1
  9. package/dist/ai/schemas.js +2 -2
  10. package/dist/ai/schemas.js.map +1 -1
  11. package/dist/chunks/badge-dan90i0rzy4pwa1j.js +102 -0
  12. package/dist/chunks/badge-dan90i0rzy4pwa1j.js.map +1 -0
  13. package/dist/chunks/{banner-nz0eryqnz3qd86ln.js → banner-eiwcnk7ts21s3bnb.js} +4 -4
  14. package/dist/chunks/{banner-nz0eryqnz3qd86ln.js.map → banner-eiwcnk7ts21s3bnb.js.map} +1 -1
  15. package/dist/chunks/{breadcrumbs-cjgn3w4drahvqnuj.js → breadcrumbs-k39s28qx05vbxxth.js} +2 -2
  16. package/dist/chunks/{breadcrumbs-cjgn3w4drahvqnuj.js.map → breadcrumbs-k39s28qx05vbxxth.js.map} +1 -1
  17. package/dist/chunks/{button-odxi0hp4fvi5i2w3.js → button-cdxnqcgzwko8ooha.js} +15 -15
  18. package/dist/chunks/button-cdxnqcgzwko8ooha.js.map +1 -0
  19. package/dist/chunks/{checkbox-dx8x0rzv582yjv7n.js → checkbox-kt1uojk2f9e0d0h1.js} +13 -13
  20. package/dist/chunks/checkbox-kt1uojk2f9e0d0h1.js.map +1 -0
  21. package/dist/chunks/{clipboard-text-kyk51d1ze7zvdn4q.js → clipboard-text-vcbvmtne4zjk4b18.js} +4 -4
  22. package/dist/chunks/{clipboard-text-kyk51d1ze7zvdn4q.js.map → clipboard-text-vcbvmtne4zjk4b18.js.map} +1 -1
  23. package/dist/chunks/{code-liq1g6f5lhee305d.js → code-cz0w1y5z4h29a9eg.js} +18 -18
  24. package/dist/chunks/code-cz0w1y5z4h29a9eg.js.map +1 -0
  25. package/dist/chunks/{combobox-9fhjzprab46csmon.js → combobox-he2hd9e2ruknq5mp.js} +4 -4
  26. package/dist/chunks/{combobox-9fhjzprab46csmon.js.map → combobox-he2hd9e2ruknq5mp.js.map} +1 -1
  27. package/dist/chunks/{command-palette-kenx2bbdzd4kpx36.js → command-palette-jc1w07jwakxvj23a.js} +4 -4
  28. package/dist/chunks/{command-palette-kenx2bbdzd4kpx36.js.map → command-palette-jc1w07jwakxvj23a.js.map} +1 -1
  29. package/dist/chunks/{dialog-e05ysa8t2fklw065.js → dialog-oqh8l3l3zutpibxx.js} +3 -3
  30. package/dist/chunks/{dialog-e05ysa8t2fklw065.js.map → dialog-oqh8l3l3zutpibxx.js.map} +1 -1
  31. package/dist/chunks/{dropdown-g587px7zv3ssaxr4.js → dropdown-ncwhcd912vmone8k.js} +2 -2
  32. package/dist/chunks/{dropdown-g587px7zv3ssaxr4.js.map → dropdown-ncwhcd912vmone8k.js.map} +1 -1
  33. package/dist/chunks/{empty-fuz1un7r7mbz0kim.js → empty-cj898km1r8xwuw44.js} +2 -2
  34. package/dist/chunks/{empty-fuz1un7r7mbz0kim.js.map → empty-cj898km1r8xwuw44.js.map} +1 -1
  35. package/dist/chunks/{field-fq504lyu7ttsh5m9.js → field-krp6z6vfbkrvufz2.js} +3 -3
  36. package/dist/chunks/{field-fq504lyu7ttsh5m9.js.map → field-krp6z6vfbkrvufz2.js.map} +1 -1
  37. package/dist/chunks/input-area-no30c09udyjxshu5.js +78 -0
  38. package/dist/chunks/input-area-no30c09udyjxshu5.js.map +1 -0
  39. package/dist/chunks/{input-group-hbebbyh8fo6aqydn.js → input-group-lxdd09p60cf27pe1.js} +26 -26
  40. package/dist/chunks/input-group-lxdd09p60cf27pe1.js.map +1 -0
  41. package/dist/chunks/{input-kvhyo3p4859bexvx.js → input-h48k3uagzrgb98au.js} +40 -36
  42. package/dist/chunks/input-h48k3uagzrgb98au.js.map +1 -0
  43. package/dist/chunks/{label-j9owppbgnn35mebg.js → label-latndvb1ngem7we8.js} +3 -3
  44. package/dist/chunks/{label-j9owppbgnn35mebg.js.map → label-latndvb1ngem7we8.js.map} +1 -1
  45. package/dist/chunks/{link-hmmf3k1xn6rm72rt.js → link-hn5ejal7nhh0o0b4.js} +2 -2
  46. package/dist/chunks/{link-hmmf3k1xn6rm72rt.js.map → link-hn5ejal7nhh0o0b4.js.map} +1 -1
  47. package/dist/chunks/{loader-m5wfmqwgucrr4i5v.js → loader-hr2w7cpqeev3p3vl.js} +9 -6
  48. package/dist/chunks/loader-hr2w7cpqeev3p3vl.js.map +1 -0
  49. package/dist/chunks/{menubar-abojnm0uwjuni8ok.js → menubar-f1pilzooe5mue7c4.js} +2 -2
  50. package/dist/chunks/{menubar-abojnm0uwjuni8ok.js.map → menubar-f1pilzooe5mue7c4.js.map} +1 -1
  51. package/dist/chunks/{meter-i84dte2f82qmvn7y.js → meter-gfa1hz9fhjnvx784.js} +2 -2
  52. package/dist/chunks/{meter-i84dte2f82qmvn7y.js.map → meter-gfa1hz9fhjnvx784.js.map} +1 -1
  53. package/dist/chunks/pagination-cu5lm6p5dxuycta4.js +243 -0
  54. package/dist/chunks/pagination-cu5lm6p5dxuycta4.js.map +1 -0
  55. package/dist/chunks/{popover-i951xjcgezeqr4iv.js → popover-h300w4vit0s2ayej.js} +7 -7
  56. package/dist/chunks/{popover-i951xjcgezeqr4iv.js.map → popover-h300w4vit0s2ayej.js.map} +1 -1
  57. package/dist/chunks/{radio-l2vkcue40d84fmo1.js → radio-jouttv89lbvhs55r.js} +37 -37
  58. package/dist/chunks/radio-jouttv89lbvhs55r.js.map +1 -0
  59. package/dist/chunks/select-kva5ru5f673kah1m.js +179 -0
  60. package/dist/chunks/select-kva5ru5f673kah1m.js.map +1 -0
  61. package/dist/chunks/{sensitive-input-kznmknpp5h1grc6k.js → sensitive-input-hd4tpqkzifad1yca.js} +34 -34
  62. package/dist/chunks/{sensitive-input-kznmknpp5h1grc6k.js.map → sensitive-input-hd4tpqkzifad1yca.js.map} +1 -1
  63. package/dist/chunks/{sidebar-jepeq7gaf4issuw6.js → sidebar-hljy3ssm8itc0ucx.js} +5 -5
  64. package/dist/chunks/sidebar-hljy3ssm8itc0ucx.js.map +1 -0
  65. package/dist/chunks/{surface-blo81kgy9g0sexgm.js → surface-cilvbyhmyujz1bee.js} +2 -2
  66. package/dist/chunks/{surface-blo81kgy9g0sexgm.js.map → surface-cilvbyhmyujz1bee.js.map} +1 -1
  67. package/dist/chunks/{switch-i0zwcp3wq6vsxm1c.js → switch-ihaydbzem62bey4p.js} +106 -104
  68. package/dist/chunks/switch-ihaydbzem62bey4p.js.map +1 -0
  69. package/dist/chunks/{table-nrcw19tlpduayukl.js → table-inweecadl3her7pd.js} +9 -9
  70. package/dist/chunks/{table-nrcw19tlpduayukl.js.map → table-inweecadl3her7pd.js.map} +1 -1
  71. package/dist/chunks/{tabs-bw92jb303zxw7w4f.js → tabs-e7eh7l3mpk3xgmwq.js} +15 -15
  72. package/dist/chunks/{tabs-bw92jb303zxw7w4f.js.map → tabs-e7eh7l3mpk3xgmwq.js.map} +1 -1
  73. package/dist/chunks/{toast-lrnwby56drs7vtae.js → toast-bpz6iaq54u9jmuu8.js} +30 -30
  74. package/dist/chunks/{toast-lrnwby56drs7vtae.js.map → toast-bpz6iaq54u9jmuu8.js.map} +1 -1
  75. package/dist/chunks/{tooltip-cit9ltlxfuhwctuj.js → tooltip-belkznz8t8333h5f.js} +20 -16
  76. package/dist/chunks/tooltip-belkznz8t8333h5f.js.map +1 -0
  77. package/dist/chunks/{vendor-base-ui-n30qblevnpk9cc5c.js → vendor-base-ui-k7bzesq81ie36nya.js} +34 -31
  78. package/dist/chunks/{vendor-base-ui-n30qblevnpk9cc5c.js.map → vendor-base-ui-k7bzesq81ie36nya.js.map} +1 -1
  79. package/dist/code.js +1 -1
  80. package/dist/components/badge.js +1 -1
  81. package/dist/components/banner.js +1 -1
  82. package/dist/components/breadcrumbs.js +1 -1
  83. package/dist/components/button.js +1 -1
  84. package/dist/components/checkbox.js +1 -1
  85. package/dist/components/clipboard-text.js +1 -1
  86. package/dist/components/code.js +1 -1
  87. package/dist/components/combobox.js +1 -1
  88. package/dist/components/command-palette.js +1 -1
  89. package/dist/components/dialog.js +1 -1
  90. package/dist/components/dropdown.js +1 -1
  91. package/dist/components/empty.js +1 -1
  92. package/dist/components/field.js +1 -1
  93. package/dist/components/input.js +3 -3
  94. package/dist/components/label.js +1 -1
  95. package/dist/components/link.js +1 -1
  96. package/dist/components/loader.js +1 -1
  97. package/dist/components/menubar.js +1 -1
  98. package/dist/components/meter.js +1 -1
  99. package/dist/components/pagination.js +1 -1
  100. package/dist/components/popover.js +1 -1
  101. package/dist/components/radio.js +1 -1
  102. package/dist/components/select.js +1 -1
  103. package/dist/components/sensitive-input.js +1 -1
  104. package/dist/components/sidebar.js +1 -1
  105. package/dist/components/surface.js +1 -1
  106. package/dist/components/switch.js +1 -1
  107. package/dist/components/table.js +1 -1
  108. package/dist/components/tabs.js +1 -1
  109. package/dist/components/toast.js +2 -2
  110. package/dist/components/tooltip.js +1 -1
  111. package/dist/index.js +38 -38
  112. package/dist/primitives/accordion.js +1 -1
  113. package/dist/primitives/alert-dialog.js +1 -1
  114. package/dist/primitives/autocomplete.js +1 -1
  115. package/dist/primitives/avatar.js +1 -1
  116. package/dist/primitives/button.js +1 -1
  117. package/dist/primitives/checkbox-group.js +1 -1
  118. package/dist/primitives/checkbox.js +1 -1
  119. package/dist/primitives/collapsible.js +1 -1
  120. package/dist/primitives/combobox.js +1 -1
  121. package/dist/primitives/context-menu.js +1 -1
  122. package/dist/primitives/csp-provider.js +1 -1
  123. package/dist/primitives/dialog.js +1 -1
  124. package/dist/primitives/direction-provider.js +1 -1
  125. package/dist/primitives/drawer.js +1 -1
  126. package/dist/primitives/field.js +1 -1
  127. package/dist/primitives/fieldset.js +1 -1
  128. package/dist/primitives/form.js +1 -1
  129. package/dist/primitives/input.js +1 -1
  130. package/dist/primitives/menu.js +1 -1
  131. package/dist/primitives/menubar.js +1 -1
  132. package/dist/primitives/meter.js +1 -1
  133. package/dist/primitives/navigation-menu.js +1 -1
  134. package/dist/primitives/number-field.js +1 -1
  135. package/dist/primitives/popover.js +1 -1
  136. package/dist/primitives/preview-card.js +1 -1
  137. package/dist/primitives/progress.js +1 -1
  138. package/dist/primitives/radio-group.js +1 -1
  139. package/dist/primitives/radio.js +1 -1
  140. package/dist/primitives/scroll-area.js +1 -1
  141. package/dist/primitives/select.js +1 -1
  142. package/dist/primitives/separator.js +1 -1
  143. package/dist/primitives/slider.js +1 -1
  144. package/dist/primitives/switch.js +1 -1
  145. package/dist/primitives/tabs.js +1 -1
  146. package/dist/primitives/toast.js +1 -1
  147. package/dist/primitives/toggle-group.js +1 -1
  148. package/dist/primitives/toggle.js +1 -1
  149. package/dist/primitives/toolbar.js +1 -1
  150. package/dist/primitives/tooltip.js +1 -1
  151. package/dist/primitives.js +1 -1
  152. package/dist/scripts/theme-generator/config.d.ts.map +1 -1
  153. package/dist/scripts/theme-generator/config.js +29 -110
  154. package/dist/scripts/theme-generator/config.js.map +1 -1
  155. package/dist/src/components/badge/badge.d.ts +61 -79
  156. package/dist/src/components/badge/badge.d.ts.map +1 -1
  157. package/dist/src/components/banner/banner.d.ts +3 -3
  158. package/dist/src/components/button/button.d.ts +2 -2
  159. package/dist/src/components/checkbox/checkbox.d.ts +1 -1
  160. package/dist/src/components/code/code.d.ts.map +1 -1
  161. package/dist/src/components/input/input-area.d.ts.map +1 -1
  162. package/dist/src/components/input/input.d.ts +1 -2
  163. package/dist/src/components/input/input.d.ts.map +1 -1
  164. package/dist/src/components/loader/loader.d.ts +7 -1
  165. package/dist/src/components/loader/loader.d.ts.map +1 -1
  166. package/dist/src/components/pagination/pagination.d.ts +11 -1
  167. package/dist/src/components/pagination/pagination.d.ts.map +1 -1
  168. package/dist/src/components/radio/radio.d.ts +1 -1
  169. package/dist/src/components/select/select.d.ts +66 -2
  170. package/dist/src/components/select/select.d.ts.map +1 -1
  171. package/dist/src/components/sensitive-input/sensitive-input.d.ts +1 -1
  172. package/dist/src/components/switch/switch.d.ts.map +1 -1
  173. package/dist/src/components/toast/toast.d.ts +1 -1
  174. package/dist/src/components/tooltip/tooltip.d.ts +11 -1
  175. package/dist/src/components/tooltip/tooltip.d.ts.map +1 -1
  176. package/dist/styles/kumo-binding.css +3 -0
  177. package/dist/styles/kumo-standalone.css +1 -1
  178. package/dist/styles/theme-fedramp.css +3 -3
  179. package/dist/styles/theme-kumo.css +61 -122
  180. package/package.json +1 -1
  181. package/scripts/component-registry/index.test.ts +4 -4
  182. package/scripts/component-registry/metadata.ts +3 -3
  183. package/scripts/theme-generator/config.ts +29 -110
  184. package/dist/chunks/badge-n80t3z8u9ttlxi20.js +0 -120
  185. package/dist/chunks/badge-n80t3z8u9ttlxi20.js.map +0 -1
  186. package/dist/chunks/button-odxi0hp4fvi5i2w3.js.map +0 -1
  187. package/dist/chunks/checkbox-dx8x0rzv582yjv7n.js.map +0 -1
  188. package/dist/chunks/code-liq1g6f5lhee305d.js.map +0 -1
  189. package/dist/chunks/input-area-nq40szg9110on89c.js +0 -74
  190. package/dist/chunks/input-area-nq40szg9110on89c.js.map +0 -1
  191. package/dist/chunks/input-group-hbebbyh8fo6aqydn.js.map +0 -1
  192. package/dist/chunks/input-kvhyo3p4859bexvx.js.map +0 -1
  193. package/dist/chunks/loader-m5wfmqwgucrr4i5v.js.map +0 -1
  194. package/dist/chunks/pagination-pbd7qqik97ac0l7m.js +0 -224
  195. package/dist/chunks/pagination-pbd7qqik97ac0l7m.js.map +0 -1
  196. package/dist/chunks/radio-l2vkcue40d84fmo1.js.map +0 -1
  197. package/dist/chunks/select-paedwa3nlhpq82ua.js +0 -132
  198. package/dist/chunks/select-paedwa3nlhpq82ua.js.map +0 -1
  199. package/dist/chunks/sidebar-jepeq7gaf4issuw6.js.map +0 -1
  200. package/dist/chunks/switch-i0zwcp3wq6vsxm1c.js.map +0 -1
  201. package/dist/chunks/tooltip-cit9ltlxfuhwctuj.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-group-hbebbyh8fo6aqydn.js","sources":["../../src/components/input/input-group.tsx"],"sourcesContent":["import { type PropsWithChildren, useContext } from \"react\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport {\n Input as InputExternal,\n type InputProps,\n inputVariants,\n} from \"./input\";\nimport { type ButtonProps, Button as ButtonExternal } from \"../button/button\";\n\nexport const KUMO_INPUT_GROUP_VARIANTS = {\n focusMode: {\n container: {\n classes: \"\",\n description: \"Focus indicator on container (default behavior)\",\n },\n individual: {\n classes: \"\",\n description: \"Focus indicators on individual elements\",\n },\n },\n} as const;\n\nexport const KUMO_INPUT_GROUP_DEFAULT_VARIANTS = {\n focusMode: \"container\",\n} as const;\n\nexport type KumoInputGroupFocusMode =\n keyof typeof KUMO_INPUT_GROUP_VARIANTS.focusMode;\n\nexport interface KumoInputGroupVariantsProps {\n focusMode?: KumoInputGroupFocusMode;\n}\n\ninterface InputGroupRootProps extends KumoInputGroupVariantsProps {\n className?: string;\n size?: \"xs\" | \"sm\" | \"base\" | \"lg\" | undefined;\n}\n\ninterface InputGroupContextValue extends InputGroupRootProps {\n inputId: string;\n descriptionId: string;\n}\n\nconst InputGroupContext = React.createContext<InputGroupContextValue | null>(\n null,\n);\n\nfunction Root({\n size,\n children,\n className,\n focusMode = KUMO_INPUT_GROUP_DEFAULT_VARIANTS.focusMode,\n}: PropsWithChildren<InputGroupRootProps>) {\n const inputId = React.useId();\n const descriptionId = React.useId();\n const contextValue = React.useMemo(\n () => ({ size, inputId, descriptionId, focusMode }),\n [size, inputId, descriptionId, focusMode],\n );\n\n const isIndividualFocus = focusMode === \"individual\";\n\n return (\n <InputGroupContext.Provider value={contextValue}>\n <div\n className={cn(\n inputVariants({ size, parentFocusIndicator: !isIndividualFocus }),\n \"flex w-full gap-0 border-0 px-0\",\n isIndividualFocus\n ? \"isolate overflow-visible\"\n : \"overflow-hidden shadow-xs ring ring-kumo-line focus-within:ring-kumo-ring\",\n className,\n )}\n >\n {children}\n </div>\n </InputGroupContext.Provider>\n );\n}\n\nfunction Label({ children }: PropsWithChildren<{}>) {\n const context = useContext(InputGroupContext);\n const isIndividualFocus = context?.focusMode === \"individual\";\n\n return (\n <label\n htmlFor={context?.inputId}\n className={cn(\n \"flex h-full items-center p-0 px-2 text-kumo-subtle\",\n isIndividualFocus &&\n \"first:rounded-l-[inherit] last:rounded-r-[inherit]\",\n )}\n >\n {children}\n </label>\n );\n}\n\nfunction Input(props: InputProps) {\n const context = useContext(InputGroupContext);\n const isIndividualFocus = context?.focusMode === \"individual\";\n\n return (\n <InputExternal\n id={context?.inputId}\n aria-describedby={context?.descriptionId}\n size={context?.size}\n {...props}\n className={cn(\n \"flex h-full items-center rounded-none border-0 bg-kumo-base font-sans\",\n \"grow px-2\",\n isIndividualFocus\n ? \"relative ring ring-kumo-line first:rounded-l-[inherit] last:rounded-r-[inherit] focus:z-1 focus:outline\"\n : \"focus:border-kumo-fill\",\n props.className,\n )}\n />\n );\n}\n\nfunction Description({ children }: PropsWithChildren<{}>) {\n const context = useContext(InputGroupContext);\n const isIndividualFocus = context?.focusMode === \"individual\";\n\n return (\n <span\n id={context?.descriptionId}\n className={cn(\n \"flex h-full items-center p-0 px-2 text-kumo-subtle\",\n isIndividualFocus &&\n \"first:rounded-l-[inherit] last:rounded-r-[inherit]\",\n )}\n >\n {children}\n </span>\n );\n}\n\nfunction Button({\n children,\n className,\n ...props\n}: PropsWithChildren<ButtonProps>) {\n const context = useContext(InputGroupContext);\n const isIndividualFocus = context?.focusMode === \"individual\";\n\n return (\n <ButtonExternal\n {...props}\n size={context?.size}\n className={cn(\n \"h-full! rounded-none disabled:bg-kumo-overlay disabled:text-kumo-inactive!\",\n isIndividualFocus &&\n \"relative ring ring-kumo-line first:rounded-l-[inherit] last:rounded-r-[inherit] focus:z-1 focus:outline\",\n className,\n )}\n >\n {children}\n </ButtonExternal>\n );\n}\n\nexport const InputGroup = Object.assign(Root, {\n Label,\n Input,\n Button,\n Description,\n});\n"],"names":["KUMO_INPUT_GROUP_DEFAULT_VARIANTS","InputGroupContext","React","Root","size","children","className","focusMode","inputId","descriptionId","contextValue","isIndividualFocus","jsx","cn","inputVariants","Label","context","useContext","Input","props","InputExternal","Description","Button","ButtonExternal","InputGroup"],"mappings":";;;;;;;AAuBO,MAAMA,IAAoC;AAAA,EAC/C,WAAW;AACb,GAmBMC,IAAoBC,EAAM;AAAA,EAC9B;AACF;AAEA,SAASC,EAAK;AAAA,EACZ,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAYP,EAAkC;AAChD,GAA2C;AACzC,QAAMQ,IAAUN,EAAM,MAAA,GAChBO,IAAgBP,EAAM,MAAA,GACtBQ,IAAeR,EAAM;AAAA,IACzB,OAAO,EAAE,MAAAE,GAAM,SAAAI,GAAS,eAAAC,GAAe,WAAAF,EAAA;AAAA,IACvC,CAACH,GAAMI,GAASC,GAAeF,CAAS;AAAA,EAAA,GAGpCI,IAAoBJ,MAAc;AAExC,SACE,gBAAAK,EAACX,EAAkB,UAAlB,EAA2B,OAAOS,GACjC,UAAA,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTC,EAAc,EAAE,MAAAV,GAAM,sBAAsB,CAACO,GAAmB;AAAA,QAChE;AAAA,QACAA,IACI,6BACA;AAAA,QACJL;AAAA,MAAA;AAAA,MAGD,UAAAD;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;AAEA,SAASU,EAAM,EAAE,UAAAV,KAAmC;AAClD,QAAMW,IAAUC,EAAWhB,CAAiB,GACtCU,IAAoBK,GAAS,cAAc;AAEjD,SACE,gBAAAJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAASI,GAAS;AAAA,MAClB,WAAWH;AAAA,QACT;AA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"file":"input-kvhyo3p4859bexvx.js","sources":["../../src/components/input/input.tsx"],"sourcesContent":["import { cn } from \"../../utils/cn\";\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport { Input as BaseInput } from \"@base-ui/react/input\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\n\n/** Input size and variant definitions mapping names to their Tailwind classes. */\nexport const KUMO_INPUT_VARIANTS = {\n size: {\n xs: {\n classes: \"h-5 gap-1 rounded-sm px-1.5 text-xs\",\n description: \"Extra small input for compact UIs\",\n },\n sm: {\n classes: \"h-6.5 gap-1 rounded-md px-2 text-xs\",\n description: \"Small input for secondary fields\",\n },\n base: {\n classes: \"h-9 gap-1.5 rounded-lg px-3 text-base\",\n description: \"Default input size\",\n },\n lg: {\n classes: \"h-10 gap-2 rounded-lg px-4 text-base\",\n description: \"Large input for prominent fields\",\n },\n },\n variant: {\n default: {\n classes: \"focus:ring-kumo-ring\",\n description: \"Default input appearance\",\n },\n error: {\n classes: \"!ring-kumo-danger focus:ring-kumo-danger\",\n description: \"Error state for validation failures\",\n },\n },\n} as const;\n\nexport const KUMO_INPUT_DEFAULT_VARIANTS = {\n size: \"base\",\n variant: \"default\",\n} as const;\n\nexport const KUMO_INPUT_STYLING = {\n dimensions: {\n xs: { height: 20, paddingX: 6, fontSize: 12, borderRadius: 2, width: 160 },\n sm: { height: 26, paddingX: 8, fontSize: 12, borderRadius: 6, width: 200 },\n base: {\n height: 36,\n paddingX: 12,\n fontSize: 16,\n borderRadius: 8,\n width: 280,\n },\n lg: { height: 40, paddingX: 16, fontSize: 16, borderRadius: 8, width: 320 },\n },\n baseTokens: {\n background: \"color-secondary\",\n text: \"text-color-surface\",\n placeholder: \"text-color-muted\",\n ring: \"color-border\",\n },\n stateTokens: {\n focus: { ring: \"color-active\" },\n error: { ring: \"color-error\" },\n disabled: { opacity: 0.5, text: \"text-color-muted\" },\n },\n} as const;\n\n// Derived types from KUMO_INPUT_VARIANTS\nexport type KumoInputSize = keyof typeof KUMO_INPUT_VARIANTS.size;\nexport type KumoInputVariant = keyof typeof KUMO_INPUT_VARIANTS.variant;\n\nexport interface KumoInputVariantsProps {\n /**\n * Input size.\n * - `\"xs\"` — Extra small for compact UIs\n * - `\"sm\"` — Small for secondary fields\n * - `\"base\"` — Default size\n * - `\"lg\"` — Large for prominent fields\n * @default \"base\"\n */\n size?: KumoInputSize;\n /**\n * Visual variant.\n * - `\"default\"` — Standard input\n * - `\"error\"` — Error state for validation failures\n * @default \"default\"\n */\n variant?: KumoInputVariant;\n parentFocusIndicator?: boolean;\n focusIndicator?: boolean;\n}\n\n// Omit native `size` attribute (number) to avoid conflict with our custom `size` variant\ntype BaseInputProps = Omit<ComponentPropsWithoutRef<typeof BaseInput>, \"size\">;\n\nexport function inputVariants({\n variant = KUMO_INPUT_DEFAULT_VARIANTS.variant,\n size = KUMO_INPUT_DEFAULT_VARIANTS.size,\n parentFocusIndicator = false,\n focusIndicator = false,\n}: KumoInputVariantsProps = {}) {\n return cn(\n // Base styles\n \"border-0 bg-kumo-control text-kumo-default ring ring-kumo-line\",\n // Disabled state and placeholder styles (using vanilla CSS class for Chrome compatibility)\n \"kumo-input-placeholder disabled:text-kumo-subtle\",\n // Apply size styles from KUMO_INPUT_VARIANTS\n KUMO_INPUT_VARIANTS.size[size].classes,\n // Apply variant styles from KUMO_INPUT_VARIANTS\n KUMO_INPUT_VARIANTS.variant[variant].classes,\n // Focus state handling\n parentFocusIndicator && \"focus-within:ring-kumo-ring\",\n focusIndicator && \"focus:ring-kumo-ring\",\n );\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>((props, ref) => {\n const {\n className,\n size = \"base\",\n variant = \"default\",\n label,\n labelTooltip,\n description,\n error,\n ...inputProps\n } = props;\n\n // Extract required from inputProps to pass to Field for label decoration\n const { required } = inputProps;\n\n // A11y enforcement: warn in dev if no accessible name provided\n if (process.env.NODE_ENV !== \"production\") {\n const hasLabel = Boolean(label);\n const hasPlaceholderAndAriaLabel = Boolean(\n inputProps.placeholder && inputProps[\"aria-label\"],\n );\n const hasAriaLabelledBy = Boolean(inputProps[\"aria-labelledby\"]);\n\n if (!hasLabel && !hasPlaceholderAndAriaLabel && !hasAriaLabelledBy) {\n console.warn(\n \"[Kumo Input]: Input must have an accessible name. Provide either:\\n\" +\n \" - label prop: <Input label='Email' />\\n\" +\n \" - placeholder + aria-label: <Input placeholder='Email' aria-label='Email address' />\\n\" +\n \" - aria-labelledby for custom label association\",\n );\n }\n }\n\n const input = (\n <BaseInput\n ref={ref}\n className={cn(\n inputVariants({ size, variant, focusIndicator: true }),\n className,\n )}\n {...inputProps}\n />\n );\n\n // Render with Field wrapper if label is provided\n if (label) {\n return (\n <Field\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {input}\n </Field>\n );\n }\n\n // Render bare input without Field wrapper\n return input;\n});\n\nInput.displayName = \"Input\";\n\n/**\n * Input component props with accessibility guidance.\n *\n * **Accessible Name Required:** Input should have one of:\n * 1. `label` prop (recommended) - enables Field wrapper with label/description/error\n * 2. `placeholder` + `aria-label` - for bare inputs with visual placeholder\n * 3. `aria-labelledby` - for custom label association\n *\n * Missing accessible names will trigger console warnings in development.\n *\n * @example\n * // Recommended: Built-in Field wrapper\n * <Input label=\"Email\" placeholder=\"you@example.com\" />\n *\n * @example\n * // Bare input with placeholder and aria-label\n * <Input placeholder=\"Search...\" aria-label=\"Search products\" />\n *\n * @example\n * // Custom label association\n * <label id=\"email-label\">Email</label>\n * <Input aria-labelledby=\"email-label\" />\n *\n * @example\n * // With description and error\n * <Input\n * label=\"Password\"\n * description=\"Must be at least 8 characters\"\n * error=\"Password is too short\"\n * variant=\"error\"\n * />\n */\nexport type InputProps = Pick<KumoInputVariantsProps, \"size\" | \"variant\"> &\n BaseInputProps & {\n /** Label content for the input (enables Field wrapper) - can be a string or any React node */\n label?: ReactNode;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the input */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n };\n"],"names":["KUMO_INPUT_VARIANTS","KUMO_INPUT_DEFAULT_VARIANTS","inputVariants","variant","size","parentFocusIndicator","focusIndicator","cn","Input","forwardRef","props","ref","className","label","labelTooltip","description","error","inputProps","required","hasLabel","hasPlaceholderAndAriaLabel","hasAriaLabelledBy","input","jsx","BaseInput","Field"],"mappings":";;;;;;AAUO,MAAMA,IAAsB;AAAA,EACjC,MAAM;AAAA,IACJ,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAAA,EAEF,SAAS;AAAA,IACP,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,OAAO;AAAA,MACL,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAEaC,IAA8B;AAAA,EACzC,MAAM;AAAA,EACN,SAAS;AACX;AAwDO,SAASC,EAAc;AAAA,EAC5B,SAAAC,IAAUF,EAA4B;AAAA,EACtC,MAAAG,IAAOH,EAA4B;AAAA,EACnC,sBAAAI,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AACnB,IAA4B,IAAI;AAC9B,SAAOC;AAAA;AAAA,IAEL;AAAA;AAAA,IAEA;AAAA;AAAA,IAEAP,EAAoB,KAAKI,CAAI,EAAE;AAAA;AAAA,IAE/BJ,EAAoB,QAAQG,CAAO,EAAE;AAAA;AAAA,IAErCE,KAAwB;AAAA,IACxBC,KAAkB;AAAA,EAAA;AAEtB;AAEO,MAAME,IAAQC,EAAyC,CAACC,GAAOC,MAAQ;AAC5E,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,MAAAR,IAAO;AAAA,IACP,SAAAD,IAAU;AAAA,IACV,OAAAU;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDP,GAGE,EAAE,UAAAQ,MAAaD;AAGrB,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAME,IAAW,EAAQN,GACnBO,IAA6B,GACjCH,EAAW,eAAeA,EAAW,YAAY,IAE7CI,IAAoB,EAAQJ,EAAW,iBAAiB;AAE9D,IAAI,CAACE,KAAY,CAACC,KAA8B,CAACC,KAC/C,QAAQ;AAAA,MACN;AAAA;AAAA;AAAA;AAAA,IAAA;AAAA,EAMN;AAEA,QAAMC,IACJ,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAb;AAAA,MACA,WAAWJ;AAAA,QACTL,EAAc,EAAE,MAAAE,GAAM,SAAAD,GAAS,gBAAgB,IAAM;AAAA,QACrDS;AAAA,MAAA;AAAA,MAED,GAAGK;AAAA,IAAA;AAAA,EAAA;AAKR,SAAIJ,IAEA,gBAAAU;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,OAAAZ;AAAA,MACA,UAAAK;AAAA,MACA,cAAAJ;AAAA,MACA,aAAAC;AAAA,MACA,OACEC,IACI,OAAOA,KAAU,WACf,EAAE,SAASA,GAAO,OAAO,GAAA,IACzBA,IACF;AAAA,MAGL,UAAAM;AAAA,IAAA;AAAA,EAAA,IAMAA;AACT,CAAC;AAEDd,EAAM,cAAc;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader-m5wfmqwgucrr4i5v.js","sources":["../../src/components/loader/loader.tsx"],"sourcesContent":["/** Loader size variant definitions mapping sizes to their pixel values. */\nexport const KUMO_LOADER_VARIANTS = {\n size: {\n sm: {\n value: 16,\n description: \"Small loader for inline use\",\n },\n base: {\n value: 24,\n description: \"Default loader size\",\n },\n lg: {\n value: 32,\n description: \"Large loader for prominent loading states\",\n },\n },\n} as const;\n\nexport const KUMO_LOADER_DEFAULT_VARIANTS = {\n size: \"base\",\n} as const;\n\n// Derived types from KUMO_LOADER_VARIANTS\nexport type KumoLoaderSize = keyof typeof KUMO_LOADER_VARIANTS.size;\n\nexport interface KumoLoaderVariantsProps {\n /**\n * Size of the loader. Use a preset name or a custom pixel number.\n * - `\"sm\"` — 16px, small loader for inline use\n * - `\"base\"` — 24px, default loader size\n * - `\"lg\"` — 32px, large loader for prominent loading states\n * @default \"base\"\n */\n size?: KumoLoaderSize | number;\n}\n\nexport function loaderVariants({\n size = KUMO_LOADER_DEFAULT_VARIANTS.size,\n}: KumoLoaderVariantsProps = {}): number {\n if (typeof size === \"number\") return size;\n return KUMO_LOADER_VARIANTS.size[size].value;\n}\n\n/**\n * Loader component props.\n *\n * @example\n * ```tsx\n * <Loader />\n * <Loader size=\"sm\" />\n * <Loader size={24} />\n * ```\n */\nexport interface LoaderProps {\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n /**\n * Size of the spinner. Use a preset name or a custom pixel number.\n * - `\"sm\"` — 16px, for inline use\n * - `\"base\"` — 24px, default size\n * - `\"lg\"` — 32px, for prominent loading states\n * @default \"base\"\n */\n size?: KumoLoaderSize | number;\n}\n\n/**\n * Animated circular spinner for indicating loading states.\n *\n * @example\n * ```tsx\n * <Loader />\n * ```\n */\nexport const Loader = ({\n className,\n size = KUMO_LOADER_DEFAULT_VARIANTS.size,\n}: LoaderProps) => {\n const sizeValue = loaderVariants({ size });\n return (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n className={className}\n style={{ height: sizeValue, width: sizeValue }}\n >\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"9.5\"\n fill=\"none\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n >\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n from=\"0 12 12\"\n to=\"360 12 12\"\n dur=\"2s\"\n repeatCount=\"indefinite\"\n />\n <animate\n attributeName=\"stroke-dasharray\"\n values=\"0 150;42 150;42 150\"\n keyTimes=\"0;0.5;1\"\n dur=\"1.5s\"\n repeatCount=\"indefinite\"\n />\n <animate\n attributeName=\"stroke-dashoffset\"\n values=\"0;-16;-59\"\n keyTimes=\"0;0.5;1\"\n dur=\"1.5s\"\n repeatCount=\"indefinite\"\n />\n </circle>\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"9.5\"\n fill=\"none\"\n opacity={0.1}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n};\n"],"names":["KUMO_LOADER_VARIANTS","KUMO_LOADER_DEFAULT_VARIANTS","loaderVariants","size","Loader","className","sizeValue","jsxs","jsx"],"mappings":";;AACO,MAAMA,IAAuB;AAAA,EAClC,MAAM;AAAA,IACJ,IAAI;AAAA,MACF,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,IAAI;AAAA,MACF,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAEaC,IAA+B;AAAA,EAC1C,MAAM;AACR;AAgBO,SAASC,EAAe;AAAA,EAC7B,MAAAC,IAAOF,EAA6B;AACtC,IAA6B,IAAY;AACvC,SAAI,OAAOE,KAAS,WAAiBA,IAC9BH,EAAqB,KAAKG,CAAI,EAAE;AACzC;AAiCO,MAAMC,IAAS,CAAC;AAAA,EACrB,WAAAC;AAAA,EACA,MAAAF,IAAOF,EAA6B;AACtC,MAAmB;AACjB,QAAMK,IAAYJ,EAAe,EAAE,MAAAC,GAAM;AACzC,SACE,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,QAAO;AAAA,MACP,WAAAF;AAAA,MACA,OAAO,EAAE,QAAQC,GAAW,OAAOA,EAAA;AAAA,MAEnC,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAG;AAAA,YACH,GAAE;AAAA,YACF,MAAK;AAAA,YACL,aAAY;AAAA,YACZ,eAAc;AAAA,YAEd,UAAA;AAAA,cAAA,gBAAAC;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,eAAc;AAAA,kBACd,MAAK;AAAA,kBACL,MAAK;AAAA,kBACL,IAAG;AAAA,kBACH,KAAI;AAAA,kBACJ,aAAY;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEd,gBAAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,eAAc;AAAA,kBACd,QAAO;AAAA,kBACP,UAAS;AAAA,kBACT,KAAI;AAAA,kBACJ,aAAY;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEd,gBAAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,eAAc;AAAA,kBACd,QAAO;AAAA,kBACP,UAAS;AAAA,kBACT,KAAI;AAAA,kBACJ,aAAY;AAAA,gBAAA;AAAA,cAAA;AAAA,YACd;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,gBAAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAG;AAAA,YACH,GAAE;AAAA,YACF,MAAK;AAAA,YACL,SAAS;AAAA,YACT,aAAY;AAAA,YACZ,eAAc;AAAA,UAAA;AAAA,QAAA;AAAA,MAChB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,224 +0,0 @@
1
- "use client";
2
- import { jsx as a, jsxs as g, Fragment as C } from "react/jsx-runtime";
3
- import { useState as O, useEffect as R, useMemo as b, createContext as T, useContext as _ } from "react";
4
- import { I as c } from "./input-group-hbebbyh8fo6aqydn.js";
5
- import { CaretDoubleLeftIcon as B, CaretLeftIcon as L, CaretRightIcon as D, CaretDoubleRightIcon as F } from "@phosphor-icons/react";
6
- import { c as u } from "./cn-ct4n7r74mh8y0f48.js";
7
- import { S as v } from "./select-paedwa3nlhpq82ua.js";
8
- const V = [25, 50, 100, 250], f = {
9
- controls: "full"
10
- }, h = T(null);
11
- function S() {
12
- const t = _(h);
13
- if (!t)
14
- throw new Error(
15
- "Pagination compound components must be used within a Pagination component"
16
- );
17
- return t;
18
- }
19
- function I({ children: t, className: l }) {
20
- const { page: n, perPage: e, totalCount: o, pageShowingRange: r } = S(), s = t ? t({ page: n, perPage: e, totalCount: o, pageShowingRange: r }) : o && o > 0 ? /* @__PURE__ */ g(C, { children: [
21
- "Showing ",
22
- /* @__PURE__ */ a("span", { className: "tabular-nums", children: r }),
23
- " of",
24
- " ",
25
- /* @__PURE__ */ a("span", { className: "tabular-nums", children: o })
26
- ] }) : null;
27
- return /* @__PURE__ */ a(
28
- "div",
29
- {
30
- "data-slot": "pagination-info",
31
- className: u("text-sm text-kumo-strong", l),
32
- children: s
33
- }
34
- );
35
- }
36
- I.displayName = "Pagination.Info";
37
- function w({
38
- value: t,
39
- onChange: l,
40
- options: n = V,
41
- label: e = "Per page:",
42
- className: o
43
- }) {
44
- return /* @__PURE__ */ g(
45
- "div",
46
- {
47
- "data-slot": "pagination-page-size",
48
- className: u("flex items-center gap-2", o),
49
- children: [
50
- e && /* @__PURE__ */ a("span", { className: "text-sm text-kumo-strong", children: e }),
51
- /* @__PURE__ */ a(
52
- v,
53
- {
54
- "aria-label": "Page size",
55
- value: t,
56
- onValueChange: (r) => l(r),
57
- children: n.map((r) => /* @__PURE__ */ a(v.Option, { value: r, children: r }, r))
58
- }
59
- )
60
- ]
61
- }
62
- );
63
- }
64
- w.displayName = "Pagination.PageSize";
65
- function P({
66
- controls: t = f.controls,
67
- className: l
68
- }) {
69
- const { page: n, maxPage: e, setPage: o, editingPage: r, setEditingPage: s } = S();
70
- return /* @__PURE__ */ a(
71
- "div",
72
- {
73
- "data-slot": "pagination-controls",
74
- className: u("grow flex flex-col items-end", l),
75
- children: /* @__PURE__ */ a("div", { children: /* @__PURE__ */ g(c, { focusMode: "individual", children: [
76
- t === "full" && /* @__PURE__ */ a(
77
- c.Button,
78
- {
79
- variant: "secondary",
80
- "aria-label": "First page",
81
- disabled: n <= 1,
82
- onClick: () => {
83
- o(1), s(1);
84
- },
85
- children: /* @__PURE__ */ a(B, { size: 16 })
86
- }
87
- ),
88
- /* @__PURE__ */ a(
89
- c.Button,
90
- {
91
- variant: "secondary",
92
- "aria-label": "Previous page",
93
- disabled: n <= 1,
94
- onClick: () => {
95
- const i = Math.max(n - 1, 1);
96
- o(i), s(i);
97
- },
98
- children: /* @__PURE__ */ a(L, { size: 16 })
99
- }
100
- ),
101
- t === "full" && /* @__PURE__ */ a(
102
- c.Input,
103
- {
104
- style: { width: 50 },
105
- className: "text-center",
106
- "aria-label": "Page number",
107
- value: r,
108
- onValueChange: (i) => {
109
- s(Number(i));
110
- },
111
- onBlur: () => {
112
- let i = Math.max(r, 1);
113
- i = Math.min(i, e), o(i), s(i);
114
- },
115
- autoComplete: "off",
116
- "data-1p-ignore": !0,
117
- "data-lpignore": "true",
118
- "data-form-type": "other"
119
- }
120
- ),
121
- /* @__PURE__ */ a(
122
- c.Button,
123
- {
124
- variant: "secondary",
125
- "aria-label": "Next page",
126
- disabled: n === e,
127
- onClick: () => {
128
- const i = Math.min(n + 1, e);
129
- o(i), s(i);
130
- },
131
- children: /* @__PURE__ */ a(D, { size: 16 })
132
- }
133
- ),
134
- t === "full" && /* @__PURE__ */ a(
135
- c.Button,
136
- {
137
- variant: "secondary",
138
- "aria-label": "Last page",
139
- disabled: n === e,
140
- onClick: () => {
141
- o(e), s(e);
142
- },
143
- children: /* @__PURE__ */ a(F, { size: 16 })
144
- }
145
- )
146
- ] }) })
147
- }
148
- );
149
- }
150
- P.displayName = "Pagination.Controls";
151
- function y({ className: t }) {
152
- return /* @__PURE__ */ a(
153
- "div",
154
- {
155
- "data-slot": "pagination-separator",
156
- className: u("mx-2 h-6 border-l border-kumo-line", t)
157
- }
158
- );
159
- }
160
- y.displayName = "Pagination.Separator";
161
- function M(t) {
162
- const { page: l = 1, perPage: n, totalCount: e, setPage: o, children: r, className: s } = t, i = "text" in t ? t.text : void 0, k = "controls" in t ? t.controls ?? f.controls : f.controls, [E, x] = O(1);
163
- R(() => {
164
- x(l);
165
- }, [l]);
166
- const d = b(() => {
167
- let m = l * (n ?? 1) - (n ?? 0) + 1, p = Math.min(l * (n ?? 0), e ?? 0);
168
- return Number.isNaN(m) && (m = 0), Number.isNaN(p) && (p = 0), `${m}-${p}`;
169
- }, [l, n, e]), z = b(() => Math.ceil((e ?? 1) / (n ?? 1)), [e, n]), N = {
170
- page: l,
171
- perPage: n,
172
- totalCount: e,
173
- maxPage: z,
174
- pageShowingRange: d,
175
- setPage: o,
176
- editingPage: E,
177
- setEditingPage: x
178
- };
179
- if (r)
180
- return /* @__PURE__ */ a(h.Provider, { value: N, children: /* @__PURE__ */ a(
181
- "div",
182
- {
183
- "data-slot": "pagination",
184
- className: u("flex items-center gap-2 w-full", s),
185
- children: r
186
- }
187
- ) });
188
- const A = () => i ? i({ page: l, perPage: n, totalCount: e, pageShowingRange: d }) : e && e > 0 ? /* @__PURE__ */ g(C, { children: [
189
- "Showing ",
190
- /* @__PURE__ */ a("span", { className: "tabular-nums", children: d }),
191
- " of",
192
- " ",
193
- /* @__PURE__ */ a("span", { className: "tabular-nums", children: e })
194
- ] }) : null;
195
- return /* @__PURE__ */ a(h.Provider, { value: N, children: /* @__PURE__ */ g(
196
- "div",
197
- {
198
- "data-slot": "pagination",
199
- className: u("flex items-center gap-2 w-full", s),
200
- children: [
201
- /* @__PURE__ */ a(
202
- "div",
203
- {
204
- "data-slot": "pagination-info",
205
- className: "grow text-sm text-kumo-strong",
206
- children: A()
207
- }
208
- ),
209
- /* @__PURE__ */ a(P, { controls: k })
210
- ]
211
- }
212
- ) });
213
- }
214
- M.displayName = "Pagination";
215
- const q = Object.assign(M, {
216
- Info: I,
217
- PageSize: w,
218
- Controls: P,
219
- Separator: y
220
- });
221
- export {
222
- q as P
223
- };
224
- //# sourceMappingURL=pagination-pbd7qqik97ac0l7m.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pagination-pbd7qqik97ac0l7m.js","sources":["../../src/components/pagination/pagination.tsx"],"sourcesContent":["import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useState,\n type ReactNode,\n} from \"react\";\nimport { InputGroup } from \"../input\";\nimport {\n CaretDoubleLeftIcon,\n CaretDoubleRightIcon,\n CaretLeftIcon,\n CaretRightIcon,\n} from \"@phosphor-icons/react\";\nimport { cn } from \"../../utils/cn\";\nimport { Select } from \"../select\";\n\nconst DEFAULT_PAGE_SIZE_OPTIONS = [25, 50, 100, 250] as const;\n\n/** Pagination controls variant definitions. */\nexport const KUMO_PAGINATION_VARIANTS = {\n controls: {\n full: {\n classes: \"\",\n description:\n \"Full pagination controls with first, previous, page input, next, and last buttons\",\n },\n simple: {\n classes: \"\",\n description:\n \"Simple pagination controls with only previous and next buttons\",\n },\n },\n} as const;\n\nexport type KumoPaginationControls =\n keyof typeof KUMO_PAGINATION_VARIANTS.controls;\n\nexport const KUMO_PAGINATION_DEFAULT_VARIANTS = {\n controls: \"full\",\n} as const;\n\nexport interface KumoPaginationVariantsProps {\n controls?: KumoPaginationControls;\n}\n\nexport function paginationVariants({\n controls = KUMO_PAGINATION_DEFAULT_VARIANTS.controls,\n}: KumoPaginationVariantsProps = {}) {\n return cn(\n \"flex items-center justify-between gap-2\",\n KUMO_PAGINATION_VARIANTS.controls[controls].classes,\n );\n}\n\n// ============================================================================\n// Pagination Context\n// ============================================================================\n\ninterface PaginationContextValue {\n page: number;\n perPage?: number;\n totalCount?: number;\n maxPage: number;\n pageShowingRange: string;\n setPage: (page: number) => void;\n editingPage: number;\n setEditingPage: (page: number) => void;\n}\n\nconst PaginationContext = createContext<PaginationContextValue | null>(null);\n\nfunction usePaginationContext() {\n const context = useContext(PaginationContext);\n if (!context) {\n throw new Error(\n \"Pagination compound components must be used within a Pagination component\",\n );\n }\n return context;\n}\n\n// ============================================================================\n// Pagination.Info\n// ============================================================================\n\nexport interface PaginationInfoProps {\n /** Custom render function for the info text */\n children?: (props: {\n page: number;\n perPage?: number;\n totalCount?: number;\n pageShowingRange: string;\n }) => ReactNode;\n /** Additional CSS classes */\n className?: string;\n}\n\nfunction PaginationInfo({ children, className }: PaginationInfoProps) {\n const { page, perPage, totalCount, pageShowingRange } =\n usePaginationContext();\n\n const content = children ? (\n children({ page, perPage, totalCount, pageShowingRange })\n ) : totalCount && totalCount > 0 ? (\n <>\n Showing <span className=\"tabular-nums\">{pageShowingRange}</span> of{\" \"}\n <span className=\"tabular-nums\">{totalCount}</span>\n </>\n ) : null;\n\n return (\n <div\n data-slot=\"pagination-info\"\n className={cn(\"text-sm text-kumo-strong\", className)}\n >\n {content}\n </div>\n );\n}\n\nPaginationInfo.displayName = \"Pagination.Info\";\n\n// ============================================================================\n// Pagination.PageSize\n// ============================================================================\n\nexport interface PaginationPageSizeProps {\n /** Current page size value */\n value: number;\n /** Callback when page size changes */\n onChange: (size: number) => void;\n /** Available page size options */\n options?: number[];\n /** Label text shown before the selector */\n label?: ReactNode;\n /** Additional CSS classes */\n className?: string;\n}\n\nfunction PaginationPageSize({\n value,\n onChange,\n options = DEFAULT_PAGE_SIZE_OPTIONS as unknown as number[],\n label = \"Per page:\",\n className,\n}: PaginationPageSizeProps) {\n return (\n <div\n data-slot=\"pagination-page-size\"\n className={cn(\"flex items-center gap-2\", className)}\n >\n {label && <span className=\"text-sm text-kumo-strong\">{label}</span>}\n <Select\n aria-label=\"Page size\"\n value={value}\n onValueChange={(v) => onChange(v as number)}\n >\n {options.map((size) => (\n <Select.Option key={size} value={size}>\n {size}\n </Select.Option>\n ))}\n </Select>\n </div>\n );\n}\n\nPaginationPageSize.displayName = \"Pagination.PageSize\";\n\n// ============================================================================\n// Pagination.Controls\n// ============================================================================\n\nexport interface PaginationControlsProps extends KumoPaginationVariantsProps {\n /** Additional CSS classes */\n className?: string;\n}\n\nfunction PaginationControls({\n controls = KUMO_PAGINATION_DEFAULT_VARIANTS.controls,\n className,\n}: PaginationControlsProps) {\n const { page, maxPage, setPage, editingPage, setEditingPage } =\n usePaginationContext();\n\n return (\n <div\n data-slot=\"pagination-controls\"\n className={cn(\"grow flex flex-col items-end\", className)}\n >\n <div>\n <InputGroup focusMode=\"individual\">\n {controls === \"full\" && (\n <InputGroup.Button\n variant=\"secondary\"\n aria-label=\"First page\"\n disabled={page <= 1}\n onClick={() => {\n setPage(1);\n setEditingPage(1);\n }}\n >\n <CaretDoubleLeftIcon size={16} />\n </InputGroup.Button>\n )}\n <InputGroup.Button\n variant=\"secondary\"\n aria-label=\"Previous page\"\n disabled={page <= 1}\n onClick={() => {\n const previousPage = Math.max(page - 1, 1);\n setPage(previousPage);\n setEditingPage(previousPage);\n }}\n >\n <CaretLeftIcon size={16} />\n </InputGroup.Button>\n {controls === \"full\" && (\n <InputGroup.Input\n style={{ width: 50 }}\n className=\"text-center\"\n aria-label=\"Page number\"\n value={editingPage}\n onValueChange={(value: string) => {\n setEditingPage(Number(value));\n }}\n onBlur={() => {\n let number = Math.max(editingPage, 1);\n number = Math.min(number, maxPage);\n setPage(number);\n setEditingPage(number);\n }}\n // Prevent password managers from auto-filling\n autoComplete=\"off\"\n data-1p-ignore\n data-lpignore=\"true\"\n data-form-type=\"other\"\n />\n )}\n <InputGroup.Button\n variant=\"secondary\"\n aria-label=\"Next page\"\n disabled={page === maxPage}\n onClick={() => {\n const nextPage = Math.min(page + 1, maxPage);\n setPage(nextPage);\n setEditingPage(nextPage);\n }}\n >\n <CaretRightIcon size={16} />\n </InputGroup.Button>\n {controls === \"full\" && (\n <InputGroup.Button\n variant=\"secondary\"\n aria-label=\"Last page\"\n disabled={page === maxPage}\n onClick={() => {\n setPage(maxPage);\n setEditingPage(maxPage);\n }}\n >\n <CaretDoubleRightIcon size={16} />\n </InputGroup.Button>\n )}\n </InputGroup>\n </div>\n </div>\n );\n}\n\nPaginationControls.displayName = \"Pagination.Controls\";\n\n// ============================================================================\n// Pagination.Separator\n// ============================================================================\n\nexport interface PaginationSeparatorProps {\n /** Additional CSS classes */\n className?: string;\n}\n\nfunction PaginationSeparator({ className }: PaginationSeparatorProps) {\n return (\n <div\n data-slot=\"pagination-separator\"\n className={cn(\"mx-2 h-6 border-l border-kumo-line\", className)}\n />\n );\n}\n\nPaginationSeparator.displayName = \"Pagination.Separator\";\n\n// ============================================================================\n// Pagination Root\n// ============================================================================\n\n/** Base props shared by both compound and legacy Pagination APIs */\ninterface PaginationBaseProps {\n /** Callback fired when the current page changes. */\n setPage: (page: number) => void;\n /**\n * Current page number (1-indexed).\n * @default 1\n */\n page?: number;\n /** Number of items displayed per page. */\n perPage?: number;\n /** Total number of items across all pages. */\n totalCount?: number;\n /** Additional CSS classes for the container */\n className?: string;\n}\n\n/**\n * Props for the compound component API (recommended).\n *\n * @example\n * ```tsx\n * <Pagination page={page} setPage={setPage} perPage={perPage} totalCount={500}>\n * <Pagination.Info />\n * <Pagination.PageSize value={perPage} onChange={setPerPage} />\n * <Pagination.Controls />\n * </Pagination>\n * ```\n */\nexport interface PaginationCompoundProps extends PaginationBaseProps {\n /**\n * Compound component children for custom layouts.\n * Use Pagination.Info, Pagination.PageSize, Pagination.Controls, and Pagination.Separator.\n */\n children: ReactNode;\n controls?: never;\n text?: never;\n}\n\n/**\n * Props for the legacy API (deprecated, use compound components instead).\n *\n * @deprecated Use the compound component API with children instead:\n * ```tsx\n * <Pagination page={page} setPage={setPage} perPage={perPage} totalCount={500}>\n * <Pagination.Info />\n * <Pagination.Controls />\n * </Pagination>\n * ```\n *\n * @example\n * ```tsx\n * // Legacy usage (deprecated)\n * <Pagination page={page} setPage={setPage} perPage={10} totalCount={100} />\n * ```\n */\nexport interface PaginationLegacyProps\n extends PaginationBaseProps,\n KumoPaginationVariantsProps {\n children?: never;\n /** @deprecated Use Pagination.Info with children prop instead */\n text?: (props: {\n page?: number;\n perPage?: number;\n totalCount?: number;\n pageShowingRange: string;\n }) => ReactNode;\n}\n\n/**\n * Pagination component props.\n *\n * Prefer the compound component API for new code:\n * @example\n * ```tsx\n * <Pagination page={page} setPage={setPage} perPage={perPage} totalCount={500}>\n * <Pagination.Info />\n * <Pagination.PageSize value={perPage} onChange={setPerPage} />\n * <Pagination.Controls />\n * </Pagination>\n * ```\n */\nexport type PaginationProps = PaginationCompoundProps | PaginationLegacyProps;\n\n/**\n * Page navigation controls with page count display.\n *\n * Supports both compound component and legacy patterns. Prefer compound components for new code:\n *\n * @example\n * // Compound component (recommended)\n * ```tsx\n * <Pagination page={page} setPage={setPage} perPage={perPage} totalCount={500}>\n * <Pagination.Info />\n * <Pagination.Separator />\n * <Pagination.PageSize value={perPage} onChange={setPerPage} />\n * <Pagination.Controls />\n * </Pagination>\n * ```\n *\n * @example\n * // Legacy (deprecated)\n * ```tsx\n * <Pagination page={page} setPage={setPage} perPage={10} totalCount={100} />\n * ```\n */\nfunction PaginationRoot(props: PaginationProps) {\n const { page = 1, perPage, totalCount, setPage, children, className } = props;\n\n // Extract legacy props (only present when children is not provided)\n const text = \"text\" in props ? props.text : undefined;\n const controls =\n \"controls\" in props\n ? (props.controls ?? KUMO_PAGINATION_DEFAULT_VARIANTS.controls)\n : KUMO_PAGINATION_DEFAULT_VARIANTS.controls;\n const [editingPage, setEditingPage] = useState<number>(1);\n\n useEffect(() => {\n setEditingPage(page);\n }, [page]);\n\n const pageShowingRange = useMemo(() => {\n let lower = page * (perPage ?? 1) - (perPage ?? 0) + 1;\n let upper = Math.min(page * (perPage ?? 0), totalCount ?? 0);\n\n if (Number.isNaN(lower)) lower = 0;\n if (Number.isNaN(upper)) upper = 0;\n\n return `${lower}-${upper}`;\n }, [page, perPage, totalCount]);\n\n const maxPage = useMemo(() => {\n return Math.ceil((totalCount ?? 1) / (perPage ?? 1));\n }, [totalCount, perPage]);\n\n const contextValue: PaginationContextValue = {\n page,\n perPage,\n totalCount,\n maxPage,\n pageShowingRange,\n setPage,\n editingPage,\n setEditingPage,\n };\n\n // Compound component mode: render children within context\n if (children) {\n return (\n <PaginationContext.Provider value={contextValue}>\n <div\n data-slot=\"pagination\"\n className={cn(\"flex items-center gap-2 w-full\", className)}\n >\n {children}\n </div>\n </PaginationContext.Provider>\n );\n }\n\n // Legacy mode: render default layout for backwards compatibility\n const getPaginationText = () => {\n if (text) {\n return text({ page, perPage, totalCount, pageShowingRange });\n } else if (totalCount && totalCount > 0) {\n return (\n <>\n Showing <span className=\"tabular-nums\">{pageShowingRange}</span> of{\" \"}\n <span className=\"tabular-nums\">{totalCount}</span>\n </>\n );\n }\n return null;\n };\n\n return (\n <PaginationContext.Provider value={contextValue}>\n <div\n data-slot=\"pagination\"\n className={cn(\"flex items-center gap-2 w-full\", className)}\n >\n <div\n data-slot=\"pagination-info\"\n className=\"grow text-sm text-kumo-strong\"\n >\n {getPaginationText()}\n </div>\n <PaginationControls controls={controls} />\n </div>\n </PaginationContext.Provider>\n );\n}\n\nPaginationRoot.displayName = \"Pagination\";\n\n// ============================================================================\n// Compound Component Export\n// ============================================================================\n\nexport const Pagination = Object.assign(PaginationRoot, {\n Info: PaginationInfo,\n PageSize: PaginationPageSize,\n Controls: PaginationControls,\n Separator: PaginationSeparator,\n});\n\nexport {\n PaginationInfo,\n PaginationPageSize,\n PaginationControls,\n PaginationSeparator,\n};\n"],"names":["DEFAULT_PAGE_SIZE_OPTIONS","KUMO_PAGINATION_DEFAULT_VARIANTS","PaginationContext","createContext","usePaginationContext","context","useContext","PaginationInfo","children","className","page","perPage","totalCount","pageShowingRange","content","jsxs","Fragment","jsx","cn","PaginationPageSize","value","onChange","options","label","Select","v","size","PaginationControls","controls","maxPage","setPage","editingPage","setEditingPage","InputGroup","CaretDoubleLeftIcon","previousPage","CaretLeftIcon","number","nextPage","CaretRightIcon","CaretDoubleRightIcon","PaginationSeparator","PaginationRoot","props","text","useState","useEffect","useMemo","lower","upper","contextValue","getPaginationText","Pagination"],"mappings":";;;;;;;AAkBA,MAAMA,IAA4B,CAAC,IAAI,IAAI,KAAK,GAAG,GAqBtCC,IAAmC;AAAA,EAC9C,UAAU;AACZ,GA8BMC,IAAoBC,EAA6C,IAAI;AAE3E,SAASC,IAAuB;AAC9B,QAAMC,IAAUC,EAAWJ,CAAiB;AAC5C,MAAI,CAACG;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAGJ,SAAOA;AACT;AAkBA,SAASE,EAAe,EAAE,UAAAC,GAAU,WAAAC,KAAkC;AACpE,QAAM,EAAE,MAAAC,GAAM,SAAAC,GAAS,YAAAC,GAAY,kBAAAC,EAAA,IACjCT,EAAA,GAEIU,IAAUN,IACdA,EAAS,EAAE,MAAAE,GAAM,SAAAC,GAAS,YAAAC,GAAY,kBAAAC,EAAA,CAAkB,IACtDD,KAAcA,IAAa,IAC7B,gBAAAG,EAAAC,GAAA,EAAE,UAAA;AAAA,IAAA;AAAA,IACQ,gBAAAC,EAAC,QAAA,EAAK,WAAU,gBAAgB,UAAAJ,GAAiB;AAAA,IAAO;AAAA,IAAI;AAAA,IACpE,gBAAAI,EAAC,QAAA,EAAK,WAAU,gBAAgB,UAAAL,EAAA,CAAW;AAAA,EAAA,EAAA,CAC7C,IACE;AAEJ,SACE,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC,EAAG,4BAA4BT,CAAS;AAAA,MAElD,UAAAK;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAP,EAAe,cAAc;AAmB7B,SAASY,EAAmB;AAAA,EAC1B,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC,IAAUtB;AAAA,EACV,OAAAuB,IAAQ;AAAA,EACR,WAAAd;AACF,GAA4B;AAC1B,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWG,EAAG,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AO,OAAOV,GAAgB;AAAA,EACtD,MAAMnC;AAAA,EACN,UAAUY;AAAA,EACV,UAAUQ;AAAA,EACV,WAAWc;AACb,CAAC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"radio-l2vkcue40d84fmo1.js","sources":["../../src/components/radio/radio.tsx"],"sourcesContent":["import { forwardRef, createContext, useContext, type ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Fieldset } from \"@base-ui/react/fieldset\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { Radio as BaseRadio } from \"@base-ui/react/radio\";\n\n/** Radio variant definitions mapping variant names to their Tailwind classes. */\nexport const KUMO_RADIO_VARIANTS = {\n variant: {\n default: {\n classes: \"ring-kumo-line\",\n description: \"Default radio appearance\",\n },\n error: {\n classes: \"ring-kumo-danger\",\n description: \"Error state for validation failures\",\n },\n },\n appearance: {\n default: {\n classes: \"\",\n description: \"Standard inline radio item\",\n },\n card: {\n classes:\n \"rounded-lg border border-kumo-ring bg-kumo-base p-3 transition-colors hover:bg-kumo-tint has-[[data-checked]]:border-kumo-interact has-[[data-checked]]:bg-kumo-tint\",\n description:\n \"Choice card appearance with border, padding, and highlighted selection state\",\n },\n },\n} as const;\n\nexport const KUMO_RADIO_DEFAULT_VARIANTS = {\n variant: \"default\",\n appearance: \"default\",\n} as const;\n\n// Derived types from KUMO_RADIO_VARIANTS\nexport type KumoRadioVariant = keyof typeof KUMO_RADIO_VARIANTS.variant;\nexport type KumoRadioAppearance = keyof typeof KUMO_RADIO_VARIANTS.appearance;\n\nexport interface KumoRadioVariantsProps {\n /**\n * Visual variant.\n * - `\"default\"` — Standard radio appearance\n * - `\"error\"` — Error state for validation failures\n * @default \"default\"\n */\n variant?: KumoRadioVariant;\n /**\n * Visual appearance.\n * - `\"default\"` — Standard inline radio item\n * - `\"card\"` — Choice card with border, padding, and highlighted selection state\n * @default \"default\"\n */\n appearance?: KumoRadioAppearance;\n}\n\nexport function radioVariants({\n variant = KUMO_RADIO_DEFAULT_VARIANTS.variant,\n appearance = KUMO_RADIO_DEFAULT_VARIANTS.appearance,\n}: KumoRadioVariantsProps = {}) {\n return cn(\n KUMO_RADIO_VARIANTS.variant[variant].classes,\n KUMO_RADIO_VARIANTS.appearance[appearance].classes,\n );\n}\n\n// Legacy type alias for backwards compatibility\nexport type RadioVariant = KumoRadioVariant;\n\n/** Position of the radio control relative to its label */\nexport type RadioControlPosition = \"start\" | \"end\";\n\n// Context for passing controlPosition and appearance from Group to Items\nconst RadioGroupContext = createContext<{\n controlPosition: RadioControlPosition;\n appearance: KumoRadioAppearance;\n}>({\n controlPosition: \"start\",\n appearance: \"default\",\n});\n\n/**\n * Radio group component props (with built-in Fieldset and RadioGroup)\n *\n * @example\n * // Basic usage\n * ```tsx\n * <Radio.Group legend=\"Notification preference\" defaultValue=\"email\">\n * <Radio.Item label=\"Email\" value=\"email\" />\n * <Radio.Item label=\"SMS\" value=\"sms\" />\n * <Radio.Item label=\"Push\" value=\"push\" />\n * </Radio.Group>\n * ```\n *\n * @example\n * // Horizontal layout\n * ```tsx\n * <Radio.Group legend=\"Size\" orientation=\"horizontal\" defaultValue=\"md\">\n * <Radio.Item label=\"Small\" value=\"sm\" />\n * <Radio.Item label=\"Medium\" value=\"md\" />\n * <Radio.Item label=\"Large\" value=\"lg\" />\n * </Radio.Group>\n * ```\n *\n * @example\n * // With error and description\n * ```tsx\n * <Radio.Group\n * legend=\"Payment method\"\n * error=\"Please select a payment method\"\n * description=\"Choose how you'd like to pay\"\n * >\n * <Radio.Item label=\"Credit Card\" value=\"card\" />\n * <Radio.Item label=\"PayPal\" value=\"paypal\" />\n * </Radio.Group>\n * ```\n *\n * @example\n * // Controlled\n * ```tsx\n * const [value, setValue] = useState(\"email\");\n * <Radio.Group legend=\"Contact\" value={value} onValueChange={setValue}>\n * <Radio.Item label=\"Email\" value=\"email\" />\n * <Radio.Item label=\"Phone\" value=\"phone\" />\n * </Radio.Group>\n * ```\n *\n * @example\n * // Label before radio (controlPosition=\"end\")\n * ```tsx\n * <Radio.Group legend=\"Options\" controlPosition=\"end\" defaultValue=\"a\">\n * <Radio.Item label=\"Option A\" value=\"a\" />\n * <Radio.Item label=\"Option B\" value=\"b\" />\n * </Radio.Group>\n * ```\n */\nexport interface RadioGroupProps {\n /** Legend text for the group (required for accessibility) */\n legend: string;\n /** Child Radio.Item components */\n children: ReactNode;\n /** Layout direction of the radio items */\n orientation?: \"vertical\" | \"horizontal\";\n /**\n * Visual appearance applied to all Radio.Item children.\n * - `\"default\"` — Standard inline radio items\n * - `\"card\"` — Choice card with border, padding, and highlighted selection state\n *\n * Individual items can override this with their own `appearance` prop.\n * @default \"default\"\n */\n appearance?: KumoRadioAppearance;\n /** Error message for the group */\n error?: string;\n /** Helper text for the group */\n description?: ReactNode;\n /** Value of the radio that should be initially selected (uncontrolled) */\n defaultValue?: string;\n /** Value of the radio that should be selected (controlled) */\n value?: string;\n /** Event handler called when radio value changes */\n onValueChange?: (value: string) => void;\n /** Whether all radios in the group are disabled */\n disabled?: boolean;\n /** Position of radio control relative to label: \"start\" (default) puts radio before label, \"end\" puts label before radio. Note: In card appearance, the control is always positioned at the end. */\n controlPosition?: RadioControlPosition;\n /** Form submission name for the radio group */\n name?: string;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * Individual radio item within a group\n *\n * @example\n * ```tsx\n * <Radio.Item label=\"Option A\" value=\"a\" />\n * ```\n *\n * @example\n * // Disabled item\n * ```tsx\n * <Radio.Item label=\"Unavailable\" value=\"unavailable\" disabled />\n * ```\n */\nexport type RadioItemProps = {\n /** Visual variant: \"default\" or \"error\" for validation failures */\n variant?: RadioVariant;\n /**\n * Visual appearance of the radio item.\n * - `\"default\"` — Standard inline radio item\n * - `\"card\"` — Choice card with border, padding, and highlighted selection state\n *\n * When set on an individual item, overrides the group-level `appearance`.\n * @default \"default\"\n */\n appearance?: KumoRadioAppearance;\n /** Label text displayed next to radio (required) */\n label: string;\n /** Description text displayed below the label (only visible in card appearance) */\n description?: ReactNode;\n /** Value of the radio (required) */\n value: string;\n /** Additional CSS classes for the label wrapper */\n className?: string;\n /** Whether the radio is disabled */\n disabled?: boolean;\n};\n\n// Radio.Item for use within Radio.Group\nconst RadioItem = forwardRef<HTMLButtonElement, RadioItemProps>(\n (\n {\n className,\n disabled,\n variant = \"default\",\n appearance: appearanceProp,\n label,\n description,\n value,\n },\n ref,\n ) => {\n const { controlPosition, appearance: groupAppearance } =\n useContext(RadioGroupContext);\n const appearance = appearanceProp ?? groupAppearance;\n const isCard = appearance === \"card\";\n\n // In card mode, default to \"end\" (radio on the right); otherwise follow group setting\n const effectiveControlPosition = isCard ? \"end\" : controlPosition;\n\n if (isCard) {\n return (\n <label\n className={cn(\n \"m-0 group relative flex items-start gap-3 rounded-lg border border-kumo-ring bg-kumo-base p-3 transition-colors has-[[data-checked]]:border-kumo-interact has-[[data-checked]]:bg-kumo-tint\",\n variant === \"error\" &&\n \"border-kumo-danger has-[[data-checked]]:border-kumo-danger has-[[data-checked]]:bg-kumo-base\",\n disabled\n ? \"cursor-not-allowed opacity-50\"\n : cn(\n \"has-[[data-disabled]]:cursor-not-allowed has-[[data-disabled]]:opacity-50 cursor-pointer\",\n variant !== \"error\" &&\n \"hover:not-has-[[data-disabled]]:bg-kumo-tint\",\n ),\n className,\n )}\n >\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span className=\"text-base font-medium text-kumo-default\">\n {label}\n </span>\n {description && (\n <span className=\"text-sm text-kumo-subtle\">{description}</span>\n )}\n </div>\n <BaseRadio.Root\n ref={ref}\n value={value}\n disabled={disabled}\n className={cn(\n \"relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-0 bg-kumo-base ring\",\n variant === \"error\" ? \"ring-kumo-danger\" : \"ring-kumo-line\",\n !disabled &&\n variant !== \"error\" &&\n \"group-hover:ring-kumo-ring focus-visible:ring-kumo-ring focus-visible:outline-offset-3\",\n !disabled &&\n variant === \"error\" &&\n \"focus-visible:ring-kumo-danger focus-visible:outline-offset-3\",\n \"data-[checked]:bg-kumo-contrast\",\n )}\n >\n <BaseRadio.Indicator\n keepMounted\n className=\"flex items-center justify-center\"\n >\n <span className=\"h-2 w-2 rounded-full bg-kumo-base\" />\n </BaseRadio.Indicator>\n </BaseRadio.Root>\n </label>\n );\n }\n\n return (\n <label\n className={cn(\n \"m-0 group relative inline-flex items-center gap-2\",\n // \"start\" (default): radio before label\n // \"end\": label before radio using flex-row-reverse\n effectiveControlPosition === \"end\" && \"flex-row-reverse justify-end\",\n disabled ? \"cursor-not-allowed opacity-50\" : \"cursor-pointer\",\n className,\n )}\n >\n <BaseRadio.Root\n ref={ref}\n value={value}\n disabled={disabled}\n className={cn(\n \"relative flex h-4 w-4 items-center justify-center rounded-full border-0 bg-kumo-base ring after:absolute after:-inset-x-3 after:-inset-y-2\",\n variant === \"error\" ? \"ring-kumo-danger\" : \"ring-kumo-line\",\n !disabled &&\n variant !== \"error\" &&\n \"group-hover:ring-kumo-ring focus-visible:ring-kumo-ring focus-visible:outline-offset-3\",\n !disabled &&\n variant === \"error\" &&\n \"focus-visible:ring-kumo-danger focus-visible:outline-offset-3\",\n \"data-[checked]:bg-kumo-contrast\",\n )}\n >\n <BaseRadio.Indicator\n keepMounted\n className=\"flex items-center justify-center\"\n >\n <span className=\"h-2 w-2 rounded-full bg-kumo-base\" />\n </BaseRadio.Indicator>\n </BaseRadio.Root>\n <span className=\"text-base text-kumo-default\">{label}</span>\n </label>\n );\n },\n);\n\nRadioItem.displayName = \"Radio.Item\";\n\n// Radio.Group with built-in Fieldset and RadioGroup\nfunction RadioGroup({\n legend,\n children,\n orientation = \"vertical\",\n appearance = \"default\",\n error,\n description,\n defaultValue,\n value,\n onValueChange,\n disabled,\n controlPosition = \"start\",\n name,\n className,\n}: RadioGroupProps) {\n return (\n <RadioGroupContext.Provider value={{ controlPosition, appearance }}>\n <BaseRadioGroup\n defaultValue={defaultValue}\n value={value}\n onValueChange={(newValue) => onValueChange?.(newValue)}\n disabled={disabled}\n name={name}\n >\n <Fieldset.Root\n disabled={disabled}\n className={cn(\"flex flex-col gap-4\", className)}\n >\n <Fieldset.Legend className=\"text-base font-medium text-kumo-default\">\n {legend}\n </Fieldset.Legend>\n <div\n className={cn(\n orientation === \"vertical\"\n ? cn(\"flex flex-col\", appearance === \"card\" ? \"gap-3\" : \"gap-2\")\n : appearance === \"card\"\n ? \"grid grid-cols-2 gap-3\"\n : \"flex flex-row flex-wrap gap-2\",\n )}\n >\n {children}\n </div>\n {error && <p className=\"text-sm text-kumo-danger\">{error}</p>}\n {description && (\n <p className=\"text-sm text-kumo-subtle\">{description}</p>\n )}\n </Fieldset.Root>\n </BaseRadioGroup>\n </RadioGroupContext.Provider>\n );\n}\n\nRadioGroup.displayName = \"Radio.Group\";\n\n// Export RadioGroup directly for external usage\nexport { RadioGroup };\n\n/**\n * Radio — radio button group for single-select choices.\n *\n * Compound component: `Radio.Group` (with built-in Fieldset) and `Radio.Item`.\n * Built on `@base-ui/react/radio-group` + `@base-ui/react/radio`.\n *\n * @example\n * ```tsx\n * <Radio.Group legend=\"Notification preference\" defaultValue=\"email\">\n * <Radio.Item label=\"Email\" value=\"email\" />\n * <Radio.Item label=\"SMS\" value=\"sms\" />\n * <Radio.Item label=\"Push\" value=\"push\" />\n * </Radio.Group>\n * ```\n */\nexport const Radio = Object.assign(RadioGroup, {\n Item: RadioItem,\n Group: RadioGroup,\n});\n"],"names":["KUMO_RADIO_VARIANTS","KUMO_RADIO_DEFAULT_VARIANTS","radioVariants","variant","appearance","cn","RadioGroupContext","createContext","RadioItem","forwardRef","className","disabled","appearanceProp","label","description","value","ref","controlPosition","groupAppearance","useContext","isCard","effectiveControlPosition","jsxs","jsx","BaseRadio.Root","BaseRadio.Indicator","RadioGroup","legend","children","orientation","error","defaultValue","onValueChange","name","BaseRadioGroup","newValue","Fieldset.Root","Fieldset.Legend","Radio"],"mappings":";;;;;AAOO,MAAMA,IAAsB;AAAA,EACjC,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AAAP,EAAC,KAAA,EAAE,WAAU,4BAA4B,UAAAO,GAAM;AAAA,YACxDhB,KACC,gBAAAS,EAAC,KAAA,EAAE,WAAU,4BAA4B,UAAAT,EAAA,CAAY;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAEzD;AAAA,EAAA,GAEJ;AAEJ;AAEAY,EAAW,cAAc;AAoBlB,MAAMY,IAAQ,OAAO,OAAOZ,GAAY;AAAA,EAC7C,MAAMlB;AAAA,EACN,OAAOkB;AACT,CAAC;"}
@@ -1,132 +0,0 @@
1
- "use client";
2
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
3
- import { CaretUpDownIcon as P, CheckIcon as V } from "@phosphor-icons/react";
4
- import { useId as A } from "react";
5
- import { c as v } from "./cn-ct4n7r74mh8y0f48.js";
6
- import { b as E } from "./button-odxi0hp4fvi5i2w3.js";
7
- import { S as D } from "./skeleton-line-epxenksfesr2fkcv.js";
8
- import { F as T } from "./field-fq504lyu7ttsh5m9.js";
9
- import { u as W } from "./portal-provider-hwmkdmkpvct0cb76.js";
10
- import { aV as _, aW as $, aX as B, aY as K, aZ as M, a_ as R, a$ as U, b0 as X, b1 as Y, b2 as Z } from "./vendor-base-ui-n30qblevnpk9cc5c.js";
11
- function y(t) {
12
- return Array.isArray(t) ? t : Object.entries(t).map(([o, a]) => ({
13
- value: o,
14
- label: a
15
- }));
16
- }
17
- function q(t) {
18
- return y(t).filter((a) => a.value !== null).map((a, n) => /* @__PURE__ */ e(
19
- S,
20
- {
21
- value: a.value,
22
- children: a.label
23
- },
24
- typeof a.value == "string" ? a.value : `option-${n}`
25
- ));
26
- }
27
- function G({
28
- children: t,
29
- className: o,
30
- renderValue: a,
31
- label: n,
32
- hideLabel: c,
33
- placeholder: d,
34
- loading: m,
35
- labelTooltip: x,
36
- description: s,
37
- error: i,
38
- required: I,
39
- container: k,
40
- ...l
41
- }) {
42
- const u = A(), N = W(), w = k ?? N ?? void 0, b = l, L = b["aria-label"], C = b["aria-labelledby"], F = typeof n == "string" ? n : d;
43
- process.env.NODE_ENV !== "production" && c !== void 0 && console.warn(
44
- '[Kumo Select]: `hideLabel` is deprecated. For hidden labels, use `aria-label` instead of `label` + `hideLabel={true}`.\n Migration:\n - For visible labels: <Select label="Country" /> (hideLabel no longer needed)\n - For hidden labels: <Select aria-label="Select a country" /> (remove label and hideLabel)'
45
- );
46
- const f = n && c !== !0, g = f ? void 0 : C ?? (n ? u : void 0), j = L ?? (g ? void 0 : F), z = l.items ? y(l.items) : void 0, O = t ?? (l.items ? q(l.items) : null), h = /* @__PURE__ */ r(
47
- _,
48
- {
49
- ...l,
50
- items: z,
51
- disabled: m || l.disabled,
52
- children: [
53
- /* @__PURE__ */ r(
54
- $,
55
- {
56
- className: v(
57
- E(),
58
- "justify-between font-normal",
59
- "focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-ring *:in-focus:opacity-100",
60
- l.disabled && "cursor-not-allowed opacity-50",
61
- o
62
- ),
63
- "aria-label": j,
64
- "aria-labelledby": g,
65
- children: [
66
- m ? /* @__PURE__ */ e(D, { className: "w-32" }) : /* @__PURE__ */ e(
67
- B,
68
- {
69
- placeholder: d,
70
- className: "min-w-0 truncate",
71
- children: a
72
- }
73
- ),
74
- /* @__PURE__ */ e(K, { className: "flex shrink-0 items-center", children: /* @__PURE__ */ e(P, {}) })
75
- ]
76
- }
77
- ),
78
- /* @__PURE__ */ e(M, { container: w, children: /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(
79
- U,
80
- {
81
- className: v(
82
- "overflow-hidden bg-kumo-base text-kumo-default",
83
- // background
84
- "rounded-lg shadow-lg ring ring-kumo-ring",
85
- // border part
86
- // 3px adjustment to account for padding + border differences
87
- "min-w-[calc(var(--anchor-width)+3px)] p-1.5"
88
- // spacing
89
- ),
90
- children: O
91
- }
92
- ) }) })
93
- ]
94
- }
95
- );
96
- if (f)
97
- return /* @__PURE__ */ e(
98
- T,
99
- {
100
- label: n,
101
- required: I,
102
- labelTooltip: x,
103
- description: s,
104
- error: i ? typeof i == "string" ? { message: i, match: !0 } : i : void 0,
105
- children: h
106
- }
107
- );
108
- const p = i ? typeof i == "string" ? { message: i } : i : void 0;
109
- return /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
110
- n && /* @__PURE__ */ e("span", { id: u, className: "sr-only", children: n }),
111
- h,
112
- p ? /* @__PURE__ */ e("span", { className: "text-sm text-kumo-danger", children: p.message }) : s && /* @__PURE__ */ e("span", { className: "text-sm leading-snug text-kumo-subtle", children: s })
113
- ] });
114
- }
115
- function S({ children: t, value: o }) {
116
- return /* @__PURE__ */ r(
117
- X,
118
- {
119
- value: o,
120
- className: "group flex cursor-pointer items-center justify-between gap-2 rounded px-2 py-1.5 text-base data-highlighted:bg-kumo-tint",
121
- children: [
122
- /* @__PURE__ */ e(Y, { children: t }),
123
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(V, {}) })
124
- ]
125
- }
126
- );
127
- }
128
- G.Option = S;
129
- export {
130
- G as S
131
- };
132
- //# sourceMappingURL=select-paedwa3nlhpq82ua.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"select-paedwa3nlhpq82ua.js","sources":["../../src/components/select/select.tsx"],"sourcesContent":["import { Select as SelectBase } from \"@base-ui/react/select\";\nimport { CaretUpDownIcon, CheckIcon } from \"@phosphor-icons/react\";\nimport { useId } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { buttonVariants } from \"../button\";\nimport { SkeletonLine } from \"../loader\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\nimport {\n usePortalContainer,\n type PortalContainer,\n} from \"../../utils/portal-provider\";\n\n/** Select variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_SELECT_VARIANTS = {\n // Select currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_SELECT_DEFAULT_VARIANTS = {} as const;\n\n/**\n * Select component styling metadata for Figma plugin code generation\n * Extracted from select.tsx implementation (source of truth)\n */\nexport const KUMO_SELECT_STYLING = {\n trigger: {\n height: 36, // h-9\n paddingX: 12, // px-3\n borderRadius: 8, // rounded-lg\n background: \"color-secondary\",\n text: \"text-color-surface\",\n ring: \"color-border\",\n fontSize: 16, // text-base\n fontWeight: 400, // font-normal\n },\n stateTokens: {\n focus: { ring: \"color-active\" },\n disabled: { opacity: 0.5 },\n },\n icons: {\n caret: { name: \"ph-caret-up-down\", size: 20 },\n check: { name: \"ph-check\", size: 20 },\n },\n popup: {\n background: \"color-secondary\",\n ring: \"color-border\",\n borderRadius: 8, // rounded-lg\n padding: 6, // p-1.5\n },\n option: {\n paddingX: 8, // px-2\n paddingY: 6, // py-1.5\n borderRadius: 4, // rounded\n fontSize: 16, // text-base\n highlightBackground: \"color-surface-secondary\",\n },\n} as const;\n\n// Derived types from KUMO_SELECT_VARIANTS\nexport interface KumoSelectVariantsProps {}\n\nexport function selectVariants(_props: KumoSelectVariantsProps = {}) {\n return cn(\n buttonVariants(),\n \"justify-between font-normal\",\n \"focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-ring *:in-focus:opacity-100\",\n );\n}\n\n/**\n * Normalizes items to array format for Base UI.\n * Object maps are converted to array format so Base UI can properly\n * handle value matching and placeholder display.\n */\nfunction normalizeItems<T>(\n items:\n | Record<string, ReactNode>\n | ReadonlyArray<{ label: ReactNode; value: T }>,\n): ReadonlyArray<{ label: ReactNode; value: T }> {\n if (Array.isArray(items)) {\n return items;\n }\n // Convert object map to array format\n return Object.entries(items).map(([key, label]) => ({\n value: key as T,\n label,\n }));\n}\n\n/**\n * Auto-generates Select.Option elements from items prop.\n * Only used when children are not explicitly provided.\n * Filters out null values (typically used for placeholders).\n */\nfunction renderOptionsFromItems<T>(\n items:\n | Record<string, ReactNode>\n | ReadonlyArray<{ label: ReactNode; value: T }>,\n): ReactNode {\n const normalizedItems = normalizeItems(items);\n\n // Filter out null values and render options\n return normalizedItems\n .filter((item) => item.value !== null)\n .map((item, index) => (\n <Option\n key={typeof item.value === \"string\" ? item.value : `option-${index}`}\n value={item.value}\n >\n {item.label}\n </Option>\n ));\n}\n\ntype SelectPropsGeneric<\n T,\n Multiple extends boolean | undefined = false,\n> = SelectBase.Root.Props<T, Multiple> &\n KumoSelectVariantsProps & {\n multiple?: Multiple;\n renderValue?: (value: Multiple extends true ? T[] : T) => ReactNode;\n className?: string;\n /**\n * Label content for the select.\n * When provided, enables the Field wrapper with a visible label.\n * For accessibility without a visible label, use `aria-label` instead.\n */\n label?: ReactNode;\n /**\n * @deprecated Use `aria-label` for hidden labels instead of `label` + `hideLabel={true}`.\n * When `label` is provided without `hideLabel`, the label is now visible by default (matching Input behavior).\n * This prop will be removed in a future version.\n */\n hideLabel?: boolean;\n placeholder?: string;\n loading?: boolean;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the select */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n /**\n * Container element for the portal. Use this to render the select inside\n * a Shadow DOM or custom container. Overrides `KumoPortalProvider` context.\n * @default document.body (or KumoPortalProvider container if set)\n */\n container?: PortalContainer;\n };\n\n/**\n * Select component props.\n *\n * **Accessible Name Required:** Select should have one of:\n * 1. `label` prop (recommended) - enables Field wrapper with visible label\n * 2. `aria-label` - for selects without visible label (accessibility-only)\n * 3. `aria-labelledby` - for custom label association\n *\n * @example\n * ```tsx\n * // With visible label (recommended)\n * <Select label=\"Country\" onValueChange={setValue}>\n * <Select.Option value=\"us\">United States</Select.Option>\n * <Select.Option value=\"uk\">United Kingdom</Select.Option>\n * </Select>\n *\n * // Without visible label (use aria-label for accessibility)\n * <Select aria-label=\"Select a country\" onValueChange={setValue}>\n * <Select.Option value=\"us\">United States</Select.Option>\n * </Select>\n * ```\n */\nexport interface SelectProps {\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n /**\n * Label content for the select.\n * When provided, enables the Field wrapper with a visible label above the select.\n * For accessibility without a visible label, use `aria-label` instead.\n */\n label?: ReactNode;\n /**\n * @deprecated Use `aria-label` for hidden labels instead of `label` + `hideLabel={true}`.\n * When `label` is provided without `hideLabel`, the label is now visible by default (matching Input behavior).\n * This prop will be removed in a future version.\n */\n hideLabel?: boolean;\n /** Placeholder text shown when no value is selected. */\n placeholder?: string;\n /** When `true`, shows a skeleton loader in place of the selected value. */\n loading?: boolean;\n /** Whether the select is disabled. */\n disabled?: boolean;\n /** Whether the select is required. When `false`, shows \"(optional)\" text. */\n required?: boolean;\n /** Tooltip content displayed next to the label via an info icon. */\n labelTooltip?: ReactNode;\n /** Currently selected value (controlled mode). */\n value?: unknown;\n /** Initial value for uncontrolled mode. */\n defaultValue?: unknown;\n /** Callback fired when the selected value changes. */\n onValueChange?: (value: unknown) => void;\n /** Enable multi-select mode. */\n multiple?: boolean;\n /** `Select.Option` elements to render in the dropdown. */\n children?: ReactNode;\n /** Helper text displayed below the select. */\n description?: ReactNode;\n /** Error message string or validation error object with `match` key. */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n}\n\n/**\n * Dropdown for selecting a value from a list of options.\n * Wraps Base UI Select with Kumo styling and optional Field integration.\n *\n * @example\n * ```tsx\n * <Select label=\"Fruit\" onValueChange={setFruit}>\n * <Select.Option value=\"apple\">Apple</Select.Option>\n * <Select.Option value=\"banana\">Banana</Select.Option>\n * </Select>\n * ```\n */\nexport function Select<T, Multiple extends boolean | undefined = false>({\n children,\n className,\n renderValue,\n label,\n hideLabel,\n placeholder,\n loading,\n labelTooltip,\n description,\n error,\n required,\n container: containerProp,\n ...props\n}: SelectPropsGeneric<T, Multiple> & { required?: boolean }) {\n const labelId = useId();\n const contextContainer = usePortalContainer();\n const container = containerProp ?? contextContainer ?? undefined;\n const propLookup = props as Record<string, unknown>;\n const ariaLabel = propLookup[\"aria-label\"] as string | undefined;\n const ariaLabelledby = propLookup[\"aria-labelledby\"] as string | undefined;\n // For aria-label, use string label or placeholder (ReactNode labels can't be used for aria-label)\n const fallbackLabel = typeof label === \"string\" ? label : placeholder;\n\n // Deprecation warning for hideLabel\n if (process.env.NODE_ENV !== \"production\" && hideLabel !== undefined) {\n console.warn(\n \"[Kumo Select]: `hideLabel` is deprecated. For hidden labels, use `aria-label` instead of `label` + `hideLabel={true}`.\\n\" +\n \" Migration:\\n\" +\n ' - For visible labels: <Select label=\"Country\" /> (hideLabel no longer needed)\\n' +\n ' - For hidden labels: <Select aria-label=\"Select a country\" /> (remove label and hideLabel)',\n );\n }\n\n // New behavior: label presence determines Field wrapper visibility (like Input)\n // hideLabel is only respected for backward compatibility when explicitly set to true\n const useFieldWrapper = label && hideLabel !== true;\n const triggerLabelledBy = useFieldWrapper\n ? undefined\n : (ariaLabelledby ?? (label ? labelId : undefined));\n const triggerAriaLabel =\n ariaLabel ?? (!triggerLabelledBy ? fallbackLabel : undefined);\n\n // Normalize items to array format for Base UI compatibility\n // This fixes placeholder not showing with object map items\n const normalizedItems = props.items ? normalizeItems(props.items) : undefined;\n\n // Auto-render children from items if children not provided\n const renderedChildren =\n children ?? (props.items ? renderOptionsFromItems(props.items) : null);\n\n const selectControl = (\n <SelectBase.Root\n {...props}\n items={normalizedItems}\n disabled={loading || props.disabled}\n >\n <SelectBase.Trigger\n className={cn(\n buttonVariants(),\n \"justify-between font-normal\",\n \"focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-ring *:in-focus:opacity-100\",\n props.disabled && \"cursor-not-allowed opacity-50\",\n className,\n )}\n aria-label={triggerAriaLabel}\n aria-labelledby={triggerLabelledBy}\n >\n {loading ? (\n <SkeletonLine className=\"w-32\" />\n ) : (\n <SelectBase.Value\n placeholder={placeholder}\n className=\"min-w-0 truncate\"\n >\n {renderValue}\n </SelectBase.Value>\n )}\n <SelectBase.Icon className=\"flex shrink-0 items-center\">\n <CaretUpDownIcon />\n </SelectBase.Icon>\n </SelectBase.Trigger>\n <SelectBase.Portal container={container}>\n <SelectBase.Positioner>\n <SelectBase.Popup\n className={cn(\n \"overflow-hidden bg-kumo-base text-kumo-default\", // background\n \"rounded-lg shadow-lg ring ring-kumo-ring\", // border part\n // 3px adjustment to account for padding + border differences\n \"min-w-[calc(var(--anchor-width)+3px)] p-1.5\", // spacing\n )}\n >\n {renderedChildren}\n </SelectBase.Popup>\n </SelectBase.Positioner>\n </SelectBase.Portal>\n </SelectBase.Root>\n );\n\n // Use Field wrapper when label is provided and not hidden\n if (useFieldWrapper) {\n return (\n <Field\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {selectControl}\n </Field>\n );\n }\n\n // Render with standalone label when label is hidden (sr-only)\n // Still show description/error for accessibility and UX\n const normalizedError = error\n ? typeof error === \"string\"\n ? { message: error, match: true as const }\n : error\n : undefined;\n\n return (\n <div className=\"grid gap-2\">\n {label && (\n <span id={labelId} className=\"sr-only\">\n {label}\n </span>\n )}\n {selectControl}\n {normalizedError ? (\n <span className=\"text-sm text-kumo-danger\">\n {normalizedError.message}\n </span>\n ) : (\n description && (\n <span className=\"text-sm leading-snug text-kumo-subtle\">\n {description}\n </span>\n )\n )}\n </div>\n );\n}\n\ntype OptionProps<T> = {\n children: ReactNode;\n value: T;\n};\n\nfunction Option<T>({ children, value }: OptionProps<T>) {\n return (\n <SelectBase.Item\n value={value}\n className=\"group flex cursor-pointer items-center justify-between gap-2 rounded px-2 py-1.5 text-base data-highlighted:bg-kumo-tint\"\n >\n <SelectBase.ItemText>{children}</SelectBase.ItemText>\n <SelectBase.ItemIndicator>\n <CheckIcon />\n </SelectBase.ItemIndicator>\n </SelectBase.Item>\n );\n}\n\nSelect.Option = Option;\n"],"names":["normalizeItems","items","key","label","renderOptionsFromItems","item","index","jsx","Option","Select","children","className","renderValue","hideLabel","placeholder","loading","labelTooltip","description","error","required","containerProp","props","labelId","useId","contextContainer","usePortalContainer","container","propLookup","ariaLabel","ariaLabelledby","fallbackLabel","useFieldWrapper","triggerLabelledBy","triggerAriaLabel","normalizedItems","renderedChildren","selectControl","jsxs","SelectBase.Root","SelectBase.Trigger","cn","buttonVariants","SkeletonLine","SelectBase.Value","SelectBase.Icon","CaretUpDownIcon","SelectBase.Portal","SelectBase.Positioner","SelectBase.Popup","Field","normalizedError","value","SelectBase.Item","SelectBase.ItemText","SelectBase.ItemIndicator","CheckIcon"],"mappings":";;;;;;;;;;AA0EA,SAASA,EACPC,GAG+C;AAC/C,SAAI,MAAM,QAAQA,CAAK,IACdA,IAGF,OAAO,QAAQA,CAAK,EAAE,IAAI,CAAC,CAACC,GAAKC,CAAK,OAAO;AAAA,IAClD,OAAOD;AAAA,IACP,OAAAC;AAAA,EAAA,EACA;AACJ;AAOA,SAASC,EACPH,GAGW;AAIX,SAHwBD,EAAeC,CAAK,EAIzC,OAAO,CAACI,MAASA,EAAK,UAAU,IAAI,EACpC,IAAI,CAACA,GAAMC,MACV,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MAEC,OAAOH,EAAK;AAAA,MAEX,UAAAA,EAAK;AAAA,IAAA;AAAA,IAHD,OAAOA,EAAK,SAAU,WAAWA,EAAK,QAAQ,UAAUC,CAAK;AAAA,EAAA,CAKrE;AACL;AAiHO,SAASG,EAAwD;AAAA,EACtE,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAT;AAAA,EACA,WAAAU;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAWC;AAAA,EACX,GAAGC;AACL,GAA6D;AAC3D,QAAMC,IAAUC,EAAA,GACVC,IAAmBC,EAAA,GACnBC,IAAYN,KAAiBI,KAAoB,QACjDG,IAAaN,GACbO,IAAYD,EAAW,YAAY,GACnCE,IAAiBF,EAAW,iBAAiB,GAE7CG,IAAgB,OAAO3B,KAAU,WAAWA,IAAQW;AAG1D,EAAI,QAAQ,IAAI,aAAa,gBAAgBD,MAAc,UACzD,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