themelia-react-ui 2.0.2 → 2.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 (435) hide show
  1. package/CHANGELOG.md +67 -7
  2. package/README.md +70 -37
  3. package/THIRD_PARTY_NOTICES.md +6 -12
  4. package/dist/{accordion-Cjb6sx0G.js → accordion-96o0pN62.js} +5 -5
  5. package/dist/{accordion-Cjb6sx0G.js.map → accordion-96o0pN62.js.map} +1 -1
  6. package/dist/action-menu-CHgs8vmj.js +281 -0
  7. package/dist/action-menu-CHgs8vmj.js.map +1 -0
  8. package/dist/{affordance-geometry.generated-tF36bREk.js → affordance-geometry.generated-B8yGOr8-.js} +7 -1
  9. package/dist/affordance-geometry.generated-B8yGOr8-.js.map +1 -0
  10. package/dist/{ai-artifact-DvTwDVyL.js → ai-artifact-BZUGwBq6.js} +277 -276
  11. package/dist/ai-artifact-BZUGwBq6.js.map +1 -0
  12. package/dist/{app-shell-C4FhvCqF.js → app-shell-D63ATkIK.js} +84 -83
  13. package/dist/app-shell-D63ATkIK.js.map +1 -0
  14. package/dist/{attachment-BxDfL2mw.js → attachment-DkoqHPPl.js} +7 -7
  15. package/dist/{attachment-BxDfL2mw.js.map → attachment-DkoqHPPl.js.map} +1 -1
  16. package/dist/{auth-ax2BqjrI.js → auth-D2FVZ1MH.js} +10 -10
  17. package/dist/{auth-ax2BqjrI.js.map → auth-D2FVZ1MH.js.map} +1 -1
  18. package/dist/{avatar-DAPlDvhJ.js → avatar-DWO_HHhB.js} +5 -5
  19. package/dist/{avatar-DAPlDvhJ.js.map → avatar-DWO_HHhB.js.map} +1 -1
  20. package/dist/{badge-HpFqoqSY.js → badge-DErMA7ul.js} +4 -4
  21. package/dist/{badge-HpFqoqSY.js.map → badge-DErMA7ul.js.map} +1 -1
  22. package/dist/base/accordion.js +1 -1
  23. package/dist/base/action-menu.js +1 -1
  24. package/dist/base/attachment.js +1 -1
  25. package/dist/base/avatar.js +1 -1
  26. package/dist/base/badge.js +1 -1
  27. package/dist/base/batch-action-bar.js +1 -1
  28. package/dist/base/buttons.js +1 -1
  29. package/dist/base/cards.js +2 -2
  30. package/dist/base/carousel.js +3 -3
  31. package/dist/base/cascader.js +13 -13
  32. package/dist/base/chart.js +1 -1
  33. package/dist/base/choice-inputs.js +2 -2
  34. package/dist/base/code-block.js +1 -1
  35. package/dist/base/combobox.js +2 -2
  36. package/dist/base/command.js +1 -1
  37. package/dist/base/copyable.js +1 -1
  38. package/dist/base/date-pickers.js +2 -2
  39. package/dist/base/display.js +6 -6
  40. package/dist/base/feedback.js +3 -3
  41. package/dist/base/forms-numeric.js +1 -1
  42. package/dist/base/forms.js +3 -3
  43. package/dist/base/inline-edit.js +10 -10
  44. package/dist/base/item.js +1 -1
  45. package/dist/base/media-gallery.js +1 -1
  46. package/dist/base/metadata-list.js +1 -1
  47. package/dist/base/navigation.js +6 -6
  48. package/dist/base/popover-menu.js +1 -1
  49. package/dist/base/popover.js +1 -1
  50. package/dist/base/qr-code.js +1 -1
  51. package/dist/base/repeaters.js +9 -9
  52. package/dist/base/sheet.js +1 -1
  53. package/dist/base/sidebar.js +1 -1
  54. package/dist/base/signature-pad.js +6 -6
  55. package/dist/base/skeleton.js +1 -1
  56. package/dist/base/spinner.js +4 -4
  57. package/dist/base/structure.js +1 -1
  58. package/dist/base/table.js +1 -1
  59. package/dist/base/text-inputs.js +2 -2
  60. package/dist/base/toaster.js +3 -3
  61. package/dist/base/tree.js +1 -1
  62. package/dist/base/upload-queue.js +1 -1
  63. package/dist/base/upload.js +3 -3
  64. package/dist/base/value-inputs.js +1 -1
  65. package/dist/{batch-action-bar-DnUJ21NQ.js → batch-action-bar-CdfIkCsV.js} +4 -4
  66. package/dist/{batch-action-bar-DnUJ21NQ.js.map → batch-action-bar-CdfIkCsV.js.map} +1 -1
  67. package/dist/blocks/admin.js +20 -20
  68. package/dist/blocks/admin.js.map +1 -1
  69. package/dist/blocks/ai.js +15 -15
  70. package/dist/blocks/analytics/usage-card.js +1 -1
  71. package/dist/blocks/analytics.js +17 -17
  72. package/dist/blocks/analytics.js.map +1 -1
  73. package/dist/blocks/collaboration.js +1 -1
  74. package/dist/blocks/commerce/receipt.js +1 -1
  75. package/dist/blocks/commerce.js +570 -567
  76. package/dist/blocks/commerce.js.map +1 -1
  77. package/dist/blocks/data-display.js +2 -2
  78. package/dist/blocks/onboarding.js +5 -5
  79. package/dist/blocks/planning.js +11 -11
  80. package/dist/blocks/timelines.js +1 -1
  81. package/dist/{breadcrumbs-C-oqs1sQ.js → breadcrumbs-B-WFKecD.js} +4 -4
  82. package/dist/{breadcrumbs-C-oqs1sQ.js.map → breadcrumbs-B-WFKecD.js.map} +1 -1
  83. package/dist/{button-DVzspB_G.js → button-DkmK-z8E.js} +2 -2
  84. package/dist/{button-DVzspB_G.js.map → button-DkmK-z8E.js.map} +1 -1
  85. package/dist/{buttons-DPZekJFu.js → buttons-BbfzgczK.js} +8 -8
  86. package/dist/{buttons-DPZekJFu.js.map → buttons-BbfzgczK.js.map} +1 -1
  87. package/dist/{cards-BaBZR-AU.js → cards-4JTWqvVe.js} +10 -10
  88. package/dist/cards-4JTWqvVe.js.map +1 -0
  89. package/dist/{chart-ZOYyK2xG.js → chart-C19flDQb.js} +4 -4
  90. package/dist/{chart-ZOYyK2xG.js.map → chart-C19flDQb.js.map} +1 -1
  91. package/dist/{checkbox-AWIhNhmo.js → checkbox-CzYUTPeJ.js} +9 -5
  92. package/dist/checkbox-CzYUTPeJ.js.map +1 -0
  93. package/dist/{choice-inputs-CNHvARCJ.js → choice-inputs-JLtij2y4.js} +182 -176
  94. package/dist/choice-inputs-JLtij2y4.js.map +1 -0
  95. package/dist/{code-block-DeneBJR_.js → code-block-CGNaUtAE.js} +7 -7
  96. package/dist/{code-block-DeneBJR_.js.map → code-block-CGNaUtAE.js.map} +1 -1
  97. package/dist/{collapsible-C-_l4hpy.js → collapsible-Do4G0zcC.js} +3 -3
  98. package/dist/{collapsible-C-_l4hpy.js.map → collapsible-Do4G0zcC.js.map} +1 -1
  99. package/dist/{collection-content-By56pLog.js → collection-content-C0e8SsTm.js} +3 -3
  100. package/dist/{collection-content-By56pLog.js.map → collection-content-C0e8SsTm.js.map} +1 -1
  101. package/dist/{combobox-C0EQW6dr.js → combobox-CBJDs6w_.js} +349 -347
  102. package/dist/combobox-CBJDs6w_.js.map +1 -0
  103. package/dist/{combobox-xCQ2RMNE.js → combobox-hbhSS18O.js} +158 -112
  104. package/dist/combobox-hbhSS18O.js.map +1 -0
  105. package/dist/{command-C25VMRII.js → command-D8NrBj-b.js} +7 -7
  106. package/dist/{command-C25VMRII.js.map → command-D8NrBj-b.js.map} +1 -1
  107. package/dist/{comments-BYYlTA8E.js → comments-Di4w0H_S.js} +383 -382
  108. package/dist/comments-Di4w0H_S.js.map +1 -0
  109. package/dist/components/base/action-menu/action-menu.d.ts +2 -0
  110. package/dist/components/base/cards/card.recipes.d.ts +12 -5
  111. package/dist/components/base/cards/smart-card.types.d.ts +12 -7
  112. package/dist/components/base/choice-inputs/checkbox.d.ts +7 -2
  113. package/dist/components/base/choice-inputs/switch-card.d.ts +7 -0
  114. package/dist/components/base/choice-inputs/toggle-field.d.ts +7 -0
  115. package/dist/components/base/combobox/combobox-field.d.ts +16 -0
  116. package/dist/components/base/date-pickers/datepicker.types.d.ts +7 -0
  117. package/dist/components/base/forms/controlled-form-field.d.ts +6 -6
  118. package/dist/components/base/forms/form-field.d.ts +5 -3
  119. package/dist/components/base/forms/index.d.ts +1 -0
  120. package/dist/components/base/forms/server-errors.d.ts +16 -0
  121. package/dist/components/base/forms/workflow.d.ts +5 -2
  122. package/dist/components/base/metadata-list/metadata-list.d.ts +3 -1
  123. package/dist/components/base/navigation/page-header/page-header.d.ts +4 -2
  124. package/dist/components/base/structure/composition.recipes.d.ts +17 -0
  125. package/dist/components/base/text-inputs/hooks/use-form-field-state.d.ts +7 -2
  126. package/dist/components/base/text-inputs/input.d.ts +4 -2
  127. package/dist/components/base/text-inputs/textarea.d.ts +4 -2
  128. package/dist/components/base/value-inputs/date-time-input.d.ts +2 -1
  129. package/dist/components/base/value-inputs/slider.d.ts +5 -1
  130. package/dist/components/base/value-inputs/tags-input.d.ts +5 -1
  131. package/dist/components/typography/text.styles.d.ts +26 -1
  132. package/dist/components/ui/combobox-dismiss.d.ts +16 -0
  133. package/dist/components/ui/combobox.d.ts +11 -6
  134. package/dist/components/ui/dialog.d.ts +1 -1
  135. package/dist/components/ui/popover.d.ts +1 -1
  136. package/dist/components/ui/sheet.d.ts +1 -1
  137. package/dist/composition.recipes-COdiFhxB.js +19 -0
  138. package/dist/composition.recipes-COdiFhxB.js.map +1 -0
  139. package/dist/containers-CRmHf7GP.js +104 -0
  140. package/dist/containers-CRmHf7GP.js.map +1 -0
  141. package/dist/{copyable-ClBuk_UK.js → copyable-CnGCZdX4.js} +4 -4
  142. package/dist/{copyable-ClBuk_UK.js.map → copyable-CnGCZdX4.js.map} +1 -1
  143. package/dist/{data-display-DT_khPl_.js → data-display-D4oujtx0.js} +239 -238
  144. package/dist/data-display-D4oujtx0.js.map +1 -0
  145. package/dist/{date-DCrsDTZc.js → date-Q7jnXxpk.js} +5 -5
  146. package/dist/{date-DCrsDTZc.js.map → date-Q7jnXxpk.js.map} +1 -1
  147. package/dist/{date-picker-ay0Pha_a.js → date-picker-zOt1oNss.js} +102 -90
  148. package/dist/date-picker-zOt1oNss.js.map +1 -0
  149. package/dist/date-pickers-cj8IXbDC.js +179 -0
  150. package/dist/date-pickers-cj8IXbDC.js.map +1 -0
  151. package/dist/{display-hAc1HjpI.js → display-BB4BL_-K.js} +8 -8
  152. package/dist/{display-hAc1HjpI.js.map → display-BB4BL_-K.js.map} +1 -1
  153. package/dist/{dropdown-menu-Cl4X7L5S.js → dropdown-menu-CjY8Vt7W.js} +8 -8
  154. package/dist/{dropdown-menu-Cl4X7L5S.js.map → dropdown-menu-CjY8Vt7W.js.map} +1 -1
  155. package/dist/features/activities.js +11 -11
  156. package/dist/features/ai-chat.js +9 -9
  157. package/dist/features/appointment-calendar.js +222 -220
  158. package/dist/features/appointment-calendar.js.map +1 -1
  159. package/dist/features/async-preview.js +8 -8
  160. package/dist/features/combobox.js +1 -1
  161. package/dist/features/comments.js +1 -1
  162. package/dist/features/data-view.js +10 -10
  163. package/dist/features/email-composer.js +275 -274
  164. package/dist/features/email-composer.js.map +1 -1
  165. package/dist/features/event-calendar.js +199 -198
  166. package/dist/features/event-calendar.js.map +1 -1
  167. package/dist/features/filters.js +1 -1
  168. package/dist/features/global-search.js +12 -12
  169. package/dist/features/kanban.js +4 -4
  170. package/dist/features/map.js +7 -7
  171. package/dist/features/media-library.js +623 -622
  172. package/dist/features/media-library.js.map +1 -1
  173. package/dist/features/mentions.js +1 -1
  174. package/dist/features/overlays.js +1 -1
  175. package/dist/features/products.js +973 -969
  176. package/dist/features/products.js.map +1 -1
  177. package/dist/features/questionnaire.js +12 -12
  178. package/dist/features/resource-assignment.js +8 -8
  179. package/dist/features/resource.js +113 -112
  180. package/dist/features/resource.js.map +1 -1
  181. package/dist/features/rich-text-editor.js +2 -2
  182. package/dist/features/schema-form.js +254 -253
  183. package/dist/features/schema-form.js.map +1 -1
  184. package/dist/features/suggestions.js +3 -3
  185. package/dist/features/sync.js +3 -3
  186. package/dist/features/table.js +1 -1
  187. package/dist/features/theme-tweaker.js +19 -19
  188. package/dist/features/theme-tweaker.js.map +1 -1
  189. package/dist/{feedback-BYIhtitP.js → feedback-DZNL5Lg1.js} +9 -9
  190. package/dist/{feedback-BYIhtitP.js.map → feedback-DZNL5Lg1.js.map} +1 -1
  191. package/dist/{field-affordance-recipes-DZhnIL_Y.js → field-affordance-recipes-DjwGx8eM.js} +2 -2
  192. package/dist/{field-affordance-recipes-DZhnIL_Y.js.map → field-affordance-recipes-DjwGx8eM.js.map} +1 -1
  193. package/dist/{filters-BGfvjP4d.js → filters-BcT-uoFy.js} +19 -19
  194. package/dist/{filters-BGfvjP4d.js.map → filters-BcT-uoFy.js.map} +1 -1
  195. package/dist/{form-field-CwH9y77i.js → form-field-CsgRmdit.js} +14 -8
  196. package/dist/form-field-CsgRmdit.js.map +1 -0
  197. package/dist/{form-sizing-BdP_Mf5p.js → form-sizing-NXgjkmBG.js} +3 -3
  198. package/dist/{form-sizing-BdP_Mf5p.js.map → form-sizing-NXgjkmBG.js.map} +1 -1
  199. package/dist/{forms-B9G_xwzi.js → forms-BV5m5aQF.js} +83 -65
  200. package/dist/forms-BV5m5aQF.js.map +1 -0
  201. package/dist/{forms-numeric-B_jraJaQ.js → forms-numeric-Cd33AKbD.js} +288 -288
  202. package/dist/forms-numeric-Cd33AKbD.js.map +1 -0
  203. package/dist/{header-CGXuhcRm.js → header-BA697l4a.js} +14 -14
  204. package/dist/{header-CGXuhcRm.js.map → header-BA697l4a.js.map} +1 -1
  205. package/dist/hooks/useFormErrors.d.ts +1 -1
  206. package/dist/{hooks-Dkz0K2WT.js → hooks-BQ-L7Uu2.js} +2 -2
  207. package/dist/{hooks-Dkz0K2WT.js.map → hooks-BQ-L7Uu2.js.map} +1 -1
  208. package/dist/{icon-badge-DYKIwvOV.js → icon-badge-COWbCCWu.js} +3 -3
  209. package/dist/{icon-badge-DYKIwvOV.js.map → icon-badge-COWbCCWu.js.map} +1 -1
  210. package/dist/index.js +2 -2
  211. package/dist/input-Cdw4k0fb.js +289 -0
  212. package/dist/input-Cdw4k0fb.js.map +1 -0
  213. package/dist/{input-CZw8iU99.js → input-DOPL5_QE.js} +3 -3
  214. package/dist/{input-CZw8iU99.js.map → input-DOPL5_QE.js.map} +1 -1
  215. package/dist/item-BvZ2DR_x.js +277 -0
  216. package/dist/item-BvZ2DR_x.js.map +1 -0
  217. package/dist/layout/app-shell.js +1 -1
  218. package/dist/layout/auth.js +1 -1
  219. package/dist/layout/containers.js +1 -1
  220. package/dist/layout/header.js +1 -1
  221. package/dist/layout/hooks.js +1 -1
  222. package/dist/layout/navigation.js +1 -1
  223. package/dist/layout/page.js +1 -1
  224. package/dist/layout/settings.js +1 -1
  225. package/dist/layout/sidebar.js +2 -2
  226. package/dist/layout/workspace.js +1 -1
  227. package/dist/layout.js +10 -10
  228. package/dist/lib/affordance-geometry.generated.d.ts +6 -0
  229. package/dist/lib/ui-provider/types.d.ts +1 -1
  230. package/dist/lib/use-popup-focus-recovery.d.ts +8 -0
  231. package/dist/lib/utils.js +1 -1
  232. package/dist/{media-gallery-3zIVLMWH.js → media-gallery-CSl5W1Fy.js} +6 -6
  233. package/dist/{media-gallery-3zIVLMWH.js.map → media-gallery-CSl5W1Fy.js.map} +1 -1
  234. package/dist/{mentions-utuUvH1K.js → mentions-RKOQaaIB.js} +8 -8
  235. package/dist/{mentions-utuUvH1K.js.map → mentions-RKOQaaIB.js.map} +1 -1
  236. package/dist/{message-DZ_ruyUV.js → message-INU2xsxu.js} +4 -4
  237. package/dist/{message-DZ_ruyUV.js.map → message-INU2xsxu.js.map} +1 -1
  238. package/dist/metadata-list-qVV7AVxa.js +443 -0
  239. package/dist/metadata-list-qVV7AVxa.js.map +1 -0
  240. package/dist/{navigation-BzhHI3lo.js → navigation-BQNcg1jT.js} +8 -8
  241. package/dist/{navigation-BzhHI3lo.js.map → navigation-BQNcg1jT.js.map} +1 -1
  242. package/dist/{navigation-Bnotn4AQ.js → navigation-DLF3E1IC.js} +7 -7
  243. package/dist/{navigation-Bnotn4AQ.js.map → navigation-DLF3E1IC.js.map} +1 -1
  244. package/dist/{navigation-row-recipes-BFLCk_Aq.js → navigation-row-recipes-WZEs-hYo.js} +2 -2
  245. package/dist/{navigation-row-recipes-BFLCk_Aq.js.map → navigation-row-recipes-WZEs-hYo.js.map} +1 -1
  246. package/dist/{number-DbV1Dija.js → number-E_OiIfJz.js} +5 -5
  247. package/dist/{number-DbV1Dija.js.map → number-E_OiIfJz.js.map} +1 -1
  248. package/dist/{overflow-tab-bar-CWY7Nogn.js → overflow-tab-bar-CrbqMteP.js} +107 -105
  249. package/dist/overflow-tab-bar-CrbqMteP.js.map +1 -0
  250. package/dist/{overlays-DNWmZrJ4.js → overlays-BlKynmde.js} +322 -319
  251. package/dist/overlays-BlKynmde.js.map +1 -0
  252. package/dist/page-CIwNUtGr.js +227 -0
  253. package/dist/page-CIwNUtGr.js.map +1 -0
  254. package/dist/page-header-commands-DFMlNYzN.js +128 -0
  255. package/dist/page-header-commands-DFMlNYzN.js.map +1 -0
  256. package/dist/{pagination-BL25hu2s.js → pagination-Ch8X_47u.js} +5 -5
  257. package/dist/{pagination-BL25hu2s.js.map → pagination-Ch8X_47u.js.map} +1 -1
  258. package/dist/{popover-menu-B9WWygpa.js → popover-menu-BYaCdFhf.js} +6 -6
  259. package/dist/{popover-menu-B9WWygpa.js.map → popover-menu-BYaCdFhf.js.map} +1 -1
  260. package/dist/{popover-7_m66eYW.js → popover-uwzX2vo7.js} +65 -63
  261. package/dist/popover-uwzX2vo7.js.map +1 -0
  262. package/dist/{primitives-BFK08r9M.js → primitives-Du64iDbb.js} +6 -6
  263. package/dist/{primitives-BFK08r9M.js.map → primitives-Du64iDbb.js.map} +1 -1
  264. package/dist/primitives.js +4 -4
  265. package/dist/{progress-B1VnCT0K.js → progress-BvF2oCdV.js} +5 -5
  266. package/dist/{progress-B1VnCT0K.js.map → progress-BvF2oCdV.js.map} +1 -1
  267. package/dist/{receipt-BVSOH3Xo.js → receipt-D789Jwyy.js} +6 -6
  268. package/dist/{receipt-BVSOH3Xo.js.map → receipt-D789Jwyy.js.map} +1 -1
  269. package/dist/{rich-text-GOUyKQ-s.js → rich-text-CLJEf76s.js} +4 -4
  270. package/dist/{rich-text-GOUyKQ-s.js.map → rich-text-CLJEf76s.js.map} +1 -1
  271. package/dist/{rich-text-editor-cRLC-eBK.js → rich-text-editor-Cm1dpUpQ.js} +10 -10
  272. package/dist/{rich-text-editor-cRLC-eBK.js.map → rich-text-editor-Cm1dpUpQ.js.map} +1 -1
  273. package/dist/{rich-text-editor-toolbar-DfXg0-VC.js → rich-text-editor-toolbar-L__e4x47.js} +4 -4
  274. package/dist/{rich-text-editor-toolbar-DfXg0-VC.js.map → rich-text-editor-toolbar-L__e4x47.js.map} +1 -1
  275. package/dist/{scroll-area-DcI-M1UT.js → scroll-area-La5RXsEk.js} +2 -2
  276. package/dist/{scroll-area-DcI-M1UT.js.map → scroll-area-La5RXsEk.js.map} +1 -1
  277. package/dist/{separator-Bom7NsGO.js → separator-DAEV0w65.js} +2 -2
  278. package/dist/{separator-Bom7NsGO.js.map → separator-DAEV0w65.js.map} +1 -1
  279. package/dist/{separator-BDV-Y648.js → separator-GNfPG-90.js} +3 -3
  280. package/dist/{separator-BDV-Y648.js.map → separator-GNfPG-90.js.map} +1 -1
  281. package/dist/services/actions.js +1 -1
  282. package/dist/settings-BA2iboic.js +174 -0
  283. package/dist/settings-BA2iboic.js.map +1 -0
  284. package/dist/{sheet-CGpB3omz.js → sheet-DoAxTb2J.js} +75 -73
  285. package/dist/sheet-DoAxTb2J.js.map +1 -0
  286. package/dist/{sidebar-A0ElHINE.js → sidebar-ByqKR_W5.js} +13 -13
  287. package/dist/{sidebar-A0ElHINE.js.map → sidebar-ByqKR_W5.js.map} +1 -1
  288. package/dist/{sidebar-CPx_7YBa.js → sidebar-D2iSnGJ7.js} +11 -11
  289. package/dist/{sidebar-CPx_7YBa.js.map → sidebar-D2iSnGJ7.js.map} +1 -1
  290. package/dist/{skeleton-Byjnt7qr.js → skeleton-CUj8O5Bd.js} +3 -3
  291. package/dist/{skeleton-Byjnt7qr.js.map → skeleton-CUj8O5Bd.js.map} +1 -1
  292. package/dist/smart-card-CqkzQsK-.js +614 -0
  293. package/dist/smart-card-CqkzQsK-.js.map +1 -0
  294. package/dist/{structure-BmisBK-3.js → structure-C0V0_Fyf.js} +3 -3
  295. package/dist/{structure-BmisBK-3.js.map → structure-C0V0_Fyf.js.map} +1 -1
  296. package/dist/{structure.recipes-EPz60cU8.js → structure.recipes-BB4-n58V.js} +2 -2
  297. package/dist/{structure.recipes-EPz60cU8.js.map → structure.recipes-BB4-n58V.js.map} +1 -1
  298. package/dist/style.css +1 -1
  299. package/dist/{table-DsfzoUia.js → table-CpvnzJn9.js} +3 -3
  300. package/dist/{table-DsfzoUia.js.map → table-CpvnzJn9.js.map} +1 -1
  301. package/dist/{table-BweFy_P9.js → table-DH7rozUv.js} +19 -19
  302. package/dist/{table-BweFy_P9.js.map → table-DH7rozUv.js.map} +1 -1
  303. package/dist/{tabs-CDocW5D1.js → tabs-eqVsJZWO.js} +7 -7
  304. package/dist/{tabs-CDocW5D1.js.map → tabs-eqVsJZWO.js.map} +1 -1
  305. package/dist/{text-inputs-f9Ia-aCi.js → text-inputs-DXItiR0O.js} +101 -98
  306. package/dist/text-inputs-DXItiR0O.js.map +1 -0
  307. package/dist/{text.styles-g4He6UIW.js → text.styles-B64My8RZ.js} +25 -10
  308. package/dist/text.styles-B64My8RZ.js.map +1 -0
  309. package/dist/theme.css +152 -112
  310. package/dist/{timelines-CwM_9IhD.js → timelines-DmtztAY_.js} +10 -10
  311. package/dist/{timelines-CwM_9IhD.js.map → timelines-DmtztAY_.js.map} +1 -1
  312. package/dist/{tooltip-yiRJUFjp.js → tooltip-B4hjKtoV.js} +3 -3
  313. package/dist/{tooltip-yiRJUFjp.js.map → tooltip-B4hjKtoV.js.map} +1 -1
  314. package/dist/{tree-WnKQzwbq.js → tree-CV11PURP.js} +8 -8
  315. package/dist/{tree-WnKQzwbq.js.map → tree-CV11PURP.js.map} +1 -1
  316. package/dist/typography/rich-text.js +1 -1
  317. package/dist/typography-CSyJrh28.js +117 -0
  318. package/dist/typography-CSyJrh28.js.map +1 -0
  319. package/dist/typography.js +1 -1
  320. package/dist/{ui-provider-C_U0Xma4.js → ui-provider-CQCuCBcy.js} +3 -3
  321. package/dist/ui-provider-CQCuCBcy.js.map +1 -0
  322. package/dist/ui-provider.js +1 -1
  323. package/dist/{upload-CXyxmQBP.js → upload-C9SA0X-8.js} +11 -11
  324. package/dist/{upload-CXyxmQBP.js.map → upload-C9SA0X-8.js.map} +1 -1
  325. package/dist/{upload-queue-Boscubn9.js → upload-queue-DhQJiSRc.js} +9 -9
  326. package/dist/{upload-queue-Boscubn9.js.map → upload-queue-DhQJiSRc.js.map} +1 -1
  327. package/dist/{usage-card-BhO5eqkX.js → usage-card-DVTRDmGz.js} +134 -133
  328. package/dist/usage-card-DVTRDmGz.js.map +1 -0
  329. package/dist/use-popup-focus-recovery-C0QPvgOR.js +36 -0
  330. package/dist/use-popup-focus-recovery-C0QPvgOR.js.map +1 -0
  331. package/dist/{utils-BRhFDwuU.js → utils-CF3c95Io.js} +68 -5
  332. package/dist/utils-CF3c95Io.js.map +1 -0
  333. package/dist/value-inputs-C0o70p-U.js +980 -0
  334. package/dist/value-inputs-C0o70p-U.js.map +1 -0
  335. package/dist/{value-typography-BP8OG6h5.js → value-typography-ClupF0Gz.js} +2 -2
  336. package/dist/{value-typography-BP8OG6h5.js.map → value-typography-ClupF0Gz.js.map} +1 -1
  337. package/dist/workspace-9EFVXUyk.js +410 -0
  338. package/dist/workspace-9EFVXUyk.js.map +1 -0
  339. package/docs/consumer-skill/SKILL.md +14 -129
  340. package/docs/consumer-skill/examples/app-layout.tsx +22 -12
  341. package/docs/consumer-skill/examples/authentication.tsx +77 -0
  342. package/docs/consumer-skill/examples/edit.tsx +30 -38
  343. package/docs/consumer-skill/examples/manifest.json +51 -1
  344. package/docs/consumer-skill/examples/rhf-bindings.tsx +86 -0
  345. package/docs/consumer-skill/examples/rhf-edit-page.tsx +141 -0
  346. package/docs/consumer-skill/examples/rhf-overlay-form.tsx +92 -0
  347. package/docs/consumer-skill/examples/rhf-transport.tsx +28 -0
  348. package/docs/consumer-skill/references/agents-md.md +17 -7
  349. package/docs/consumer-skill/references/authentication.md +42 -0
  350. package/docs/consumer-skill/references/component-contracts.json +319824 -0
  351. package/docs/consumer-skill/references/composition-mapping.md +92 -0
  352. package/docs/consumer-skill/references/composition.md +43 -19
  353. package/docs/consumer-skill/references/design-contract.md +32 -0
  354. package/docs/consumer-skill/references/discovery.md +84 -7
  355. package/docs/consumer-skill/references/installation.md +45 -35
  356. package/docs/consumer-skill/references/integration.md +6 -2
  357. package/docs/consumer-skill/references/public-api.json +1520 -66
  358. package/docs/consumer-skill/references/review.md +9 -4
  359. package/docs/consumer-skill/references/rhf-workflows.md +86 -0
  360. package/docs/consumer-skill/references/screen-archetypes.md +22 -0
  361. package/docs/consumer-skill/references/theming.md +8 -9
  362. package/docs/consumer-skill/references/tokens.json +12 -3
  363. package/docs/consumer-skill/references/workflows.md +7 -5
  364. package/docs/consumer-skill/scripts/composition-schema.d.mts +2 -0
  365. package/docs/consumer-skill/scripts/composition-schema.mjs +32 -0
  366. package/docs/consumer-skill/scripts/composition.mjs +198 -0
  367. package/docs/consumer-skill/scripts/discovery.mjs +42 -10
  368. package/docs/consumer-skill/scripts/inspect-component.mjs +11 -0
  369. package/docs/consumer-skill/scripts/inspect-tokens.mjs +11 -0
  370. package/docs/consumer-skill/scripts/inspection.mjs +138 -0
  371. package/docs/consumer-skill/scripts/map-composition.mjs +12 -0
  372. package/docs/consumer-skill/scripts/setup-skills.mjs +76 -0
  373. package/docs/consumer-skills/themelia-components/SKILL.md +30 -0
  374. package/docs/consumer-skills/themelia-composition/SKILL.md +35 -0
  375. package/docs/consumer-skills/themelia-forms/SKILL.md +12 -0
  376. package/docs/consumer-skills/themelia-foundation/SKILL.md +14 -0
  377. package/docs/consumer-skills/themelia-tokenization/SKILL.md +35 -0
  378. package/package.json +6 -4
  379. package/templates/README.md +39 -0
  380. package/templates/admin-shell-template.tsx +382 -0
  381. package/templates/analytics-operations-template.tsx +376 -0
  382. package/templates/customers-template.tsx +509 -0
  383. package/templates/index.ts +29 -0
  384. package/templates/orders-template.tsx +1102 -0
  385. package/templates/products-template.tsx +834 -0
  386. package/templates/user-permissions-template.tsx +450 -0
  387. package/dist/action-menu-CllU52Mm.js +0 -280
  388. package/dist/action-menu-CllU52Mm.js.map +0 -1
  389. package/dist/affordance-geometry.generated-tF36bREk.js.map +0 -1
  390. package/dist/ai-artifact-DvTwDVyL.js.map +0 -1
  391. package/dist/app-shell-C4FhvCqF.js.map +0 -1
  392. package/dist/cards-BaBZR-AU.js.map +0 -1
  393. package/dist/checkbox-AWIhNhmo.js.map +0 -1
  394. package/dist/choice-inputs-CNHvARCJ.js.map +0 -1
  395. package/dist/combobox-C0EQW6dr.js.map +0 -1
  396. package/dist/combobox-xCQ2RMNE.js.map +0 -1
  397. package/dist/comments-BYYlTA8E.js.map +0 -1
  398. package/dist/containers-Mu1LMGV1.js +0 -103
  399. package/dist/containers-Mu1LMGV1.js.map +0 -1
  400. package/dist/data-display-DT_khPl_.js.map +0 -1
  401. package/dist/date-picker-ay0Pha_a.js.map +0 -1
  402. package/dist/date-pickers-Ccw8DL2b.js +0 -175
  403. package/dist/date-pickers-Ccw8DL2b.js.map +0 -1
  404. package/dist/form-field-CwH9y77i.js.map +0 -1
  405. package/dist/forms-B9G_xwzi.js.map +0 -1
  406. package/dist/forms-numeric-B_jraJaQ.js.map +0 -1
  407. package/dist/input-DQdEd0YD.js +0 -263
  408. package/dist/input-DQdEd0YD.js.map +0 -1
  409. package/dist/item-K5_ghvze.js +0 -275
  410. package/dist/item-K5_ghvze.js.map +0 -1
  411. package/dist/metadata-list-8N16ZMW_.js +0 -405
  412. package/dist/metadata-list-8N16ZMW_.js.map +0 -1
  413. package/dist/overflow-tab-bar-CWY7Nogn.js.map +0 -1
  414. package/dist/overlays-DNWmZrJ4.js.map +0 -1
  415. package/dist/page-Bgl1F560.js +0 -224
  416. package/dist/page-Bgl1F560.js.map +0 -1
  417. package/dist/page-header-commands-DOb6WsfD.js +0 -126
  418. package/dist/page-header-commands-DOb6WsfD.js.map +0 -1
  419. package/dist/popover-7_m66eYW.js.map +0 -1
  420. package/dist/settings-ybnjVwbd.js +0 -171
  421. package/dist/settings-ybnjVwbd.js.map +0 -1
  422. package/dist/sheet-CGpB3omz.js.map +0 -1
  423. package/dist/smart-card-DiC5aac3.js +0 -604
  424. package/dist/smart-card-DiC5aac3.js.map +0 -1
  425. package/dist/text-inputs-f9Ia-aCi.js.map +0 -1
  426. package/dist/text.styles-g4He6UIW.js.map +0 -1
  427. package/dist/typography-UTnveOEy.js +0 -117
  428. package/dist/typography-UTnveOEy.js.map +0 -1
  429. package/dist/ui-provider-C_U0Xma4.js.map +0 -1
  430. package/dist/usage-card-BhO5eqkX.js.map +0 -1
  431. package/dist/utils-BRhFDwuU.js.map +0 -1
  432. package/dist/value-inputs-DXPDjvBU.js +0 -963
  433. package/dist/value-inputs-DXPDjvBU.js.map +0 -1
  434. package/dist/workspace-Cdrg7k9f.js +0 -408
  435. package/dist/workspace-Cdrg7k9f.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"choice-inputs-CNHvARCJ.js","names":["Select","SelectPrimitive","isScalar","baseui.SelectContent","baseui.SelectGroup","baseui.SelectItem","baseui.SelectLabel","baseui.SelectSeparator","Select","baseui.Select","baseui.SelectTrigger","baseui.SelectValue","Switch","SwitchPrimitive","Switch","SwitchPrimitive","React","Switch","isSimpleText","Switch","isSimpleText","GRID_COLS","isSimpleText","RadioGroupPrimitive","RadioPrimitive","React","RadioGroupPrimitive","RadioPrimitive","React","useTypographyConfig","useDensityConfig","resolveComponentScale","cn","Label","Text","textSizes","textLineHeights","focusRecipes","anchoredPositionMethod","motionRecipes","Stack","surfaceDividerRecipes","collectionRowClasses","popoverRecipes","collectionRecipes","CollectionLabel","CollectionContent","interactionRecipes","fieldStateRecipes","selectToggleRecipes","formControlSizeClasses","formLabelSizeClasses","formFieldTriggerClasses","formControlIconClasses","resolveFormControlSize","Checkbox","React$1","Select$2","Select","SelectGroup","props","className","SelectValue","SelectTrigger","size","children","ChevronDownIcon","iconClassName","SelectContent","resolvedContainer","useThemePortalContainer","container","alignItemWithTrigger","SelectScrollUpButton","SelectScrollDownButton","SelectLabel","SelectItem","CheckIcon","SelectSeparator","ChevronUpIcon","SELECT_POPUP_BEM","selectPopupItemSizeClasses","isScalar$1","value","SelectPopupContent","SelectPopupGroup","SelectPopupItem","density","defaultTextSize","selectPopupLabelSizeClasses","SelectPopupLabel","SelectPopupSeparator","defaultSelectStrings","CLEAR_VALUE","OPTION_VALUE_PREFIX","toInternalOptionValue","toInternalSelectedValue","toExternalValue","isScalar","typographyNode","DefaultOptionContent","option","Select$1","memo","forwardRef","isControlled","stringsProp","sizeProp","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaInvalid","triggerProps","strings","useStrings","defaultScale","resolvedPlaceholder","placeholder","internalOptions","useMemo","mapped","options","allowClear","internalValue","optionsByInternalValue","entry","normalizedValue","normalizedDefaultValue","defaultValue","handleValueChange","useCallback","externalValue","nextValue","onValueChange","serializeValue","invalid","selectedOption","currentValue","renderValue","contentClassName","rendered","renderOption","Switch$2","Switch","Switch$1","rest","resolvedAriaInvalid","resolvedInvalid","checked","choiceCardSizeTokens","choicePillSizeTokens","choiceListSizeTokens","choiceCardStateClasses","choiceControlTrackClasses","choiceCardMarkerClasses","choiceCardMarkerSlotClasses","SwitchCard","Icon","internal","setInternal","useState","labelLineClasses","generatedId","useId","id","name","hasDescription","description","describedById","handleToggle","disabled","newChecked","handleCardClick","label","hint","isSimpleText$3","ToggleField","controlTrackClasses","inputId","labelId","descriptionId","set","next","onRowClick","Control","kind","v","TextBlock","controlPosition","isSimpleText$2","GRID_COLS$1","CardCheckboxGroup","markerTrackClasses","selected","tokens","toggle","o","val","columns","optionLabel","isSelected","isDisabled","shouldIncludeHidden","nameAttr","CircleCheck","isSimpleText$1","GRID_COLS","CardRadioGroupImpl","gridClassName","RadioGroup","Radio","CardRadioGroup","isSimpleText","ListRadioGroup","rowPadding","NEXT_KEYS","PREVIOUS_KEYS","PillRadioGroup","buttonRefs","isEnabled","selectedIndex","tabStopIndex","handleClick","optionValue","enabled","index","current","button","event","rtl","forward","backward","position","fullWidth","node"],"sources":["../src/components/ui/select.tsx","../src/components/base/choice-inputs/select-popup.tsx","../src/components/base/choice-inputs/select.tsx","../src/components/ui/switch.tsx","../src/components/base/choice-inputs/switch.tsx","../src/components/base/choice-inputs/choice-types.ts","../src/components/base/choice-inputs/switch-card.tsx","../src/components/base/choice-inputs/toggle-field.tsx","../src/components/base/choice-inputs/card-checkbox-group.tsx","../src/components/base/choice-inputs/card-radio-group.tsx","../src/components/base/choice-inputs/list-radio-group.tsx","../src/components/base/choice-inputs/pill-radio-group.tsx"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { fieldStateRecipes } from '../../lib/field-state-recipes';\nimport { selectToggleRecipes } from '../../lib/field-affordance-recipes';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { surfaceDividerRecipes } from '../../lib/surface-recipes';\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\"\nimport { ChevronDownIcon, CheckIcon, ChevronUpIcon } from \"lucide-react\"\nimport * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Select = SelectPrimitive.Root\n\nfunction SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {\n return (\n <SelectPrimitive.Group\n data-slot=\"select-group\"\n className={cn(\"scroll-my-1\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {\n return (\n <SelectPrimitive.Value\n data-slot=\"select-value\"\n className={cn(\"flex flex-1 text-start\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n iconClassName,\n children,\n ...props\n}: SelectPrimitive.Trigger.Props & {\n size?: \"sm\" | \"default\"\n /** Chevron size; owners pass the matching control icon size. Defaults to the shared select-toggle glyph for `size`. */\n iconClassName?: string\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"box-border flex w-fit items-center justify-between gap-space-sm whitespace-nowrap rounded-inner border border-input bg-transparent px-control py-space-xs font-sans text-sm text-foreground shadow-none outline-none transition-[color,box-shadow]\",\n \"data-[placeholder]:text-muted-foreground data-[size=default]:h-control data-[size=sm]:h-control-sm\",\n fieldStateRecipes.focus,\n fieldStateRecipes.invalid,\n \"disabled:cursor-not-allowed disabled:opacity-50 data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n \"*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-space-sm [&_svg:not([class*='size-'])]:size-icon [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon\n render={\n <ChevronDownIcon aria-hidden=\"true\" className={cn(\"pointer-events-none shrink-0 text-muted-foreground\", selectToggleRecipes.icon[size === \"sm\" ? \"sm\" : \"md\"], iconClassName)} />\n }\n />\n </SelectPrimitive.Trigger>\n )\n}\n\nfunction SelectContent({\n className,\n container,\n children,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n alignItemWithTrigger = true,\n positionMethod = anchoredPositionMethod,\n ...props\n}: SelectPrimitive.Popup.Props &\n Pick<\n SelectPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"alignItemWithTrigger\" | \"positionMethod\"\n > & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n return (\n <SelectPrimitive.Portal container={resolvedContainer}>\n <SelectPrimitive.Positioner\n positionMethod={positionMethod}\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className=\"isolate z-50\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n data-align-trigger={alignItemWithTrigger}\n className={cn(\n motionRecipes.popup,\n 'data-[align-trigger=true]:transition-none data-[align-trigger=true]:duration-0 data-[align-trigger=true]:scale-100 data-[align-trigger=true]:translate-none data-[align-trigger=true]:opacity-100',\n \"relative isolate z-50 max-h-(--available-height) min-w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-radius bg-popover text-popover-foreground shadow-md\",\n surfaceDividerRecipes.anchored.shell,\n className\n )}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.List>{children}</SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: SelectPrimitive.GroupLabel.Props) {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={cn(\"px-row-x py-row-y-sm text-xs font-medium text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: SelectPrimitive.Item.Props) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className\n )}\n {...props}\n >\n <SelectPrimitive.ItemText className=\"flex min-w-0 flex-1 gap-space-sm\">\n {children}\n </SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator\n render={<span className=\"pointer-events-none flex shrink-0 items-center justify-center\" />}\n >\n <CheckIcon className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: SelectPrimitive.Separator.Props) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"pointer-events-none my-space-xs h-px\", surfaceDividerRecipes.anchored.separator, className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-button\"\n className={cn(\"bg-popover z-10 flex cursor-default items-center justify-center py-space-xs [&_svg:not([class*='size-'])]:size-icon top-0 w-full\", className)}\n {...props}\n >\n <ChevronUpIcon\n />\n </SelectPrimitive.ScrollUpArrow>\n )\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-button\"\n className={cn(\"bg-popover z-10 flex cursor-default items-center justify-center py-space-xs [&_svg:not([class*='size-'])]:size-icon bottom-0 w-full\", className)}\n {...props}\n >\n <ChevronDownIcon\n />\n </SelectPrimitive.ScrollDownArrow>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n","import { CollectionLabel } from '../popover/collection-content';\nimport type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport * as baseui from '../../ui/select';\nimport { Text } from '../../typography';\nimport { textSizes } from '../../typography/text.styles';\nimport { useTypographyConfig, type FormControlSize } from '../../../lib/ui-provider';\nimport { cn } from '../../../lib/utils';\nimport { collectionRecipes, collectionRowClasses, popoverRecipes, type CollectionDensity } from '../popover/popover.recipes';\n\nconst SELECT_POPUP_BEM = {\n\tcontent: 'select-popup--component',\n\tgroup: 'select-popup--group',\n\titem: 'select-popup--item',\n\tlabel: 'select-popup--label',\n\tseparator: 'select-popup--separator',\n} as const;\n\nconst selectPopupItemSizeClasses: Record<FormControlSize, string> = {\n\tsm: \"[&_svg:not([class*='size-'])]:size-icon-sm\",\n\tmd: \"[&_svg:not([class*='size-'])]:size-icon\",\n\tlg: \"[&_svg:not([class*='size-'])]:size-icon-lg\",\n};\n\nfunction isScalar(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/**\n * Private presentation layer for every Select-based form popup.\n *\n * It deliberately leaves Root/Trigger/Value state and form semantics with the\n * owning control, while centralizing the collection popup's compact surface inset, row\n * rhythm, option indicator clearance, icon sizing, and group anatomy.\n */\nexport function SelectPopupContent({\n\tclassName,\n\talign = 'start',\n\talignItemWithTrigger = false,\n\t...props\n}: ComponentPropsWithoutRef<typeof baseui.SelectContent>) {\n\treturn (\n\t\t<baseui.SelectContent\n\t\t\talign={align}\n\t\t\talignItemWithTrigger={alignItemWithTrigger}\n\t\t\tclassName={cn(\n\t\t\t\tSELECT_POPUP_BEM.content,\n\t\t\t\tpopoverRecipes.surface,\n\t\t\t\tpopoverRecipes.menu,\n\t\t\t\t'w-max min-w-(--anchor-width) max-w-(--available-width)',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function SelectPopupGroup({\n\tclassName,\n\t...props\n}: ComponentPropsWithoutRef<typeof baseui.SelectGroup>) {\n\treturn (\n\t\t<baseui.SelectGroup\n\t\t\tclassName={cn(SELECT_POPUP_BEM.group, 'p-0', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport interface SelectPopupItemProps\n\textends ComponentPropsWithoutRef<typeof baseui.SelectItem> {\n\t/** Match option typography, gap, icon, and indicator clearance to its trigger. */\n\tsize?: FormControlSize;\n\t/** Vertical option rhythm, independent from trigger/icon size. */\n\tdensity?: CollectionDensity;\n}\n\nexport function SelectPopupItem({\n\tchildren,\n\tclassName,\n\tsize = 'md',\n\tdensity = 'default',\n\t...props\n}: SelectPopupItemProps) {\n\tconst { defaultTextSize } = useTypographyConfig();\n\treturn (\n\t\t<baseui.SelectItem\n\t\t\tclassName={cn(\n\t\t\t\tSELECT_POPUP_BEM.item,\n\t\t\t\tcollectionRowClasses(density),\n\t\t\t\tcollectionRecipes.highlighted,\n\t\t\t\tcollectionRecipes.disabled,\n\t\t\t\tselectPopupItemSizeClasses[size],\n\t\t\t\ttextSizes[defaultTextSize ?? 'sm'],\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isScalar(children) ? <CollectionLabel>{children}</CollectionLabel> : children}\n\t\t</baseui.SelectItem>\n\t);\n}\n\nexport interface SelectPopupLabelProps\n\textends ComponentPropsWithoutRef<typeof baseui.SelectLabel> {\n\t/**\n\t * Owning control scale. Group captions sit one step below the option text:\n\t * `sm` and `md` use the compact caption size, `lg` the default text size.\n\t * Defaults to `md`.\n\t */\n\tsize?: FormControlSize;\n}\n\nconst selectPopupLabelSizeClasses: Record<FormControlSize, string> = {\n\tsm: 'text-xs',\n\tmd: 'text-xs',\n\tlg: 'text-sm',\n};\n\n/**\n * Group caption. Supporting copy rather than another option, so it uses the\n * secondary medium caption role shared with menu and command group captions.\n */\nexport function SelectPopupLabel({\n\tchildren,\n\tclassName,\n\tsize = 'md',\n\t...props\n}: SelectPopupLabelProps) {\n\treturn (\n\t\t<baseui.SelectLabel\n\t\t\tclassName={cn(\n\t\t\t\tSELECT_POPUP_BEM.label,\n\t\t\t\t'px-row-x py-row-y-sm font-medium text-muted-foreground',\n\t\t\t\tselectPopupLabelSizeClasses[size],\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isScalar(children) ? (\n\t\t\t\t<Text tag=\"span\" size=\"inherit\" type=\"inherit\" weight=\"inherit\" lineHeight=\"tight\">\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</baseui.SelectLabel>\n\t);\n}\n\nexport function SelectPopupSeparator({\n\tclassName,\n\t...props\n}: ComponentPropsWithoutRef<typeof baseui.SelectSeparator>) {\n\treturn (\n\t\t<baseui.SelectSeparator\n\t\t\tclassName={cn(\n\t\t\t\tSELECT_POPUP_BEM.separator,\n\t\t\t\tpopoverRecipes.separator,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import { CollectionContent } from '../popover/collection-content';\nimport {\n\tforwardRef,\n\tmemo,\n\tuseCallback,\n\tuseMemo,\n\ttype ComponentPropsWithoutRef,\n\ttype FocusEventHandler,\n\ttype ReactNode,\n\ttype Ref,\n} from 'react';\n\nimport * as baseui from '../../ui/select';\nimport { Text } from '../../typography';\nimport { useDensityConfig, type FormControlSize } from '../../../lib/ui-provider';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { selectToggleRecipes } from '../../../lib/field-affordance-recipes';\nimport type { CollectionDensity } from '../popover/popover.recipes';\n\nimport {\n\tformControlIconClasses,\n\tformFieldTriggerClasses,\n\tresolveFormControlSize,\n} from '../forms/form-sizing';\nimport {\n\tSelectPopupContent,\n\tSelectPopupGroup,\n\tSelectPopupItem,\n} from './select-popup';\n\nexport interface SelectStrings {\n\tplaceholder: string;\n}\n\nexport const defaultSelectStrings: SelectStrings = {\n\tplaceholder: 'Select an option',\n};\n\nexport interface SelectOption {\n\tvalue: string;\n\tlabel: string;\n\tdescription?: string;\n\ticon?: ReactNode;\n\tdisabled?: boolean;\n}\n\ntype BaseSelectTriggerProps = ComponentPropsWithoutRef<typeof baseui.SelectTrigger>;\n\ntype SelectTriggerProps = Omit<\n\tBaseSelectTriggerProps,\n\t| 'aria-describedby'\n\t| 'aria-invalid'\n\t| 'aria-label'\n\t| 'aria-labelledby'\n\t| 'children'\n\t| 'className'\n\t| 'defaultValue'\n\t| 'disabled'\n\t| 'form'\n\t| 'id'\n\t| 'name'\n\t| 'onBlur'\n\t| 'onChange'\n\t| 'onFocus'\n\t| 'required'\n\t| 'size'\n\t| 'value'\n>;\n\nexport interface SelectProps extends SelectTriggerProps {\n\t/** Popup option rhythm, independent from the trigger size. Defaults to default. */\n\tdensity?: CollectionDensity;\n\t/** Available options. An empty-string option clears the selection. */\n\toptions: SelectOption[];\n\n\t/** Placeholder text — overrides `strings.placeholder` when provided. */\n\tplaceholder?: string;\n\n\t/** String overrides (e.g. placeholder). */\n\tstrings?: StringsProp<SelectStrings>;\n\n\t/** Add a placeholder option that clears the current selection. */\n\tallowClear?: boolean;\n\n\t/** Error state for styling (passed from FormField). */\n\tinvalid?: boolean;\n\n\t/** Visual size. */\n\tsize?: FormControlSize;\n\n\t/** Additional class names for the trigger. */\n\tclassName?: string;\n\n\t/** Additional class names for the popup surface. */\n\tcontentClassName?: string;\n\n\t/** Canonical value callback. Returns `undefined` when the selection is cleared. */\n\tonValueChange?: (value: string | undefined) => void;\n\n\t/** Current value. Passing `value={undefined}` explicitly keeps the control controlled and clear. */\n\tvalue?: string | null;\n\n\t/** Initial value for an uncontrolled select. */\n\tdefaultValue?: string | null;\n\n\t/** Disabled state. */\n\tdisabled?: boolean;\n\n\t/** Read-only state. */\n\treadOnly?: boolean;\n\n\t/** Field name used by the hidden native input. */\n\tname?: string;\n\n\t/** The owning form id when the select is rendered outside that form. */\n\tform?: string;\n\n\t/** Native autocomplete hint forwarded to the hidden input. */\n\tautoComplete?: string;\n\n\t/** Ref to the hidden native input used for form submission. */\n\tinputRef?: Ref<HTMLInputElement>;\n\n\t/** Root id; Base UI applies it to the trigger/field contract. */\n\tid?: string;\n\n\t/** Required state. */\n\trequired?: boolean;\n\n\t/** Accessible label for externally-labelled or compact trigger contexts. */\n\t'aria-label'?: string;\n\n\t/** Ids of elements that label the trigger. */\n\t'aria-labelledby'?: string;\n\n\t/** Ids of elements that describe the trigger. */\n\t'aria-describedby'?: string;\n\n\t/** Native invalid state forwarded to the trigger. `invalid` takes precedence. */\n\t'aria-invalid'?: BaseSelectTriggerProps['aria-invalid'];\n\n\t/** Native focus callback forwarded to the trigger. */\n\tonFocus?: FocusEventHandler<HTMLButtonElement>;\n\n\t/** Native blur callback forwarded to the trigger. */\n\tonBlur?: FocusEventHandler<HTMLButtonElement>;\n\n\t/** Open state (controlled). */\n\topen?: boolean;\n\n\t/** Default open state. */\n\tdefaultOpen?: boolean;\n\n\t/** Open change handler. */\n\tonOpenChange?: (open: boolean) => void;\n\n\t/** Called after the popup's opening or closing animation completes. */\n\tonOpenChangeComplete?: (open: boolean) => void;\n\n\t/** Whether the open popup should isolate interaction from the rest of the page. */\n\tmodal?: boolean;\n\n\t/** Whether pointer movement should highlight popup options. */\n\thighlightItemOnHover?: boolean;\n\n\t/** Replace the default icon/label/description option presentation. */\n\trenderOption?: (option: SelectOption) => ReactNode;\n\n\t/** Replace the trigger value presentation. Receives `undefined` for the placeholder state. */\n\trenderValue?: (option: SelectOption | undefined) => ReactNode;\n}\n\ninterface InternalSelectOption {\n\tinternalValue: string;\n\toption: SelectOption;\n}\n\n// Base UI reserves the empty string for an empty native form value. Encoding every\n// real option keeps consumer values collision-free, including values that happen to\n// equal this component's clear sentinel.\nconst CLEAR_VALUE = '__admin_ui_select_clear__';\nconst OPTION_VALUE_PREFIX = '__admin_ui_select_option__:';\n\nfunction toInternalOptionValue(value: string): string {\n\treturn value === '' ? CLEAR_VALUE : `${OPTION_VALUE_PREFIX}${value}`;\n}\n\nfunction toInternalSelectedValue(value: string | null | undefined): string | null {\n\tif (value === '' || value === null || value === undefined) return null;\n\treturn `${OPTION_VALUE_PREFIX}${value}`;\n}\n\nfunction toExternalValue(value: string | null): string | undefined {\n\tif (value === null || value === CLEAR_VALUE) return undefined;\n\tif (value.startsWith(OPTION_VALUE_PREFIX)) return value.slice(OPTION_VALUE_PREFIX.length);\n\treturn undefined;\n}\n\nfunction isScalar(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nfunction typographyNode(value: ReactNode, className?: string): ReactNode {\n\tif (!isScalar(value)) return value;\n\n\treturn (\n\t\t<Text tag=\"span\" size=\"inherit\" lineHeight=\"tight\" className={cn('text-inherit', className)}>\n\t\t\t{value}\n\t\t</Text>\n\t);\n}\n\nfunction DefaultOptionContent({ option, size }: { option: SelectOption; size: FormControlSize }) {\n return <CollectionContent label={option.label} description={option.description} leading={option.icon} leadingDecorative wrap\n className=\"select--option-content\" leadingClassName={cn('select--option-icon',formControlIconClasses[size])}\n bodyClassName=\"select--option-text text-start\" labelClassName=\"select--option-label block\"\n descriptionClassName=\"select--option-description line-clamp-2\"/>;\n}\n\n/**\n * Canonical finite-option form control. `Select` owns the single Base UI state\n * engine used by both standard and descriptive option presentations.\n */\nexport const Select = memo(\n\tforwardRef<HTMLButtonElement, SelectProps>(function Select(props, ref) {\n\t\tconst isControlled = Object.prototype.hasOwnProperty.call(props, 'value');\n\t\tconst {\n\t\t\toptions,\n\t\t\tdensity,\n\t\t\tplaceholder,\n\t\t\tstrings: stringsProp,\n\t\t\tallowClear = false,\n\t\t\tinvalid,\n\t\t\tsize: sizeProp,\n\t\t\tclassName,\n\t\t\tcontentClassName,\n\t\t\tonValueChange,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tdefaultOpen,\n\t\t\topen,\n\t\t\tonOpenChange,\n\t\t\tonOpenChangeComplete,\n\t\t\tmodal,\n\t\t\thighlightItemOnHover,\n\t\t\tname,\n\t\t\tform,\n\t\t\tautoComplete,\n\t\t\tinputRef,\n\t\t\tid,\n\t\t\trequired,\n\t\t\t'aria-label': ariaLabel,\n\t\t\t'aria-labelledby': ariaLabelledBy,\n\t\t\t'aria-describedby': ariaDescribedBy,\n\t\t\t'aria-invalid': ariaInvalid,\n\t\t\tonFocus,\n\t\t\tonBlur,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\trenderOption,\n\t\t\trenderValue,\n\t\t\t...triggerProps\n\t\t} = props;\n\t\tconst strings = useStrings(defaultSelectStrings, stringsProp);\n\t\tconst { defaultScale } = useDensityConfig();\n\t\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\t\tconst resolvedPlaceholder = placeholder ?? strings.placeholder;\n\n\t\tconst internalOptions = useMemo<InternalSelectOption[]>(() => {\n\t\t\tconst mapped = options.map((option) => ({\n\t\t\t\toption,\n\t\t\t\tinternalValue: toInternalOptionValue(option.value),\n\t\t\t}));\n\n\t\t\tif (allowClear && !mapped.some(({ internalValue }) => internalValue === CLEAR_VALUE)) {\n\t\t\t\tmapped.unshift({\n\t\t\t\t\tinternalValue: CLEAR_VALUE,\n\t\t\t\t\toption: { value: '', label: resolvedPlaceholder },\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn mapped;\n\t\t}, [allowClear, options, resolvedPlaceholder]);\n\n\t\tconst optionsByInternalValue = useMemo(\n\t\t\t() => new Map(internalOptions.map((entry) => [entry.internalValue, entry.option])),\n\t\t\t[internalOptions],\n\t\t);\n\t\tconst normalizedValue = toInternalSelectedValue(value);\n\t\tconst normalizedDefaultValue = toInternalSelectedValue(defaultValue);\n\n\t\tconst handleValueChange = useCallback(\n\t\t\t(nextValue: string | null) => {\n\t\t\t\tconst externalValue = toExternalValue(nextValue);\n\t\t\t\tonValueChange?.(externalValue);\n\t\t\t},\n\t\t\t[onValueChange],\n\t\t);\n\n\t\tconst serializeValue = useCallback((internalValue: string) => {\n\t\t\treturn toExternalValue(internalValue) ?? '';\n\t\t}, []);\n\n\t\tconst controlledValueProps = isControlled ? { value: normalizedValue } : {};\n\n\t\treturn (\n\t\t\t<baseui.Select\n\t\t\t\tonValueChange={handleValueChange}\n\t\t\t\tdisabled={disabled}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tdefaultOpen={defaultOpen}\n\t\t\t\topen={open}\n\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\tonOpenChangeComplete={onOpenChangeComplete}\n\t\t\t\tmodal={modal}\n\t\t\t\thighlightItemOnHover={highlightItemOnHover}\n\t\t\t\tname={name}\n\t\t\t\tform={form}\n\t\t\t\tautoComplete={autoComplete}\n\t\t\t\tinputRef={inputRef}\n\t\t\t\tid={id}\n\t\t\t\trequired={required}\n\t\t\t\tdefaultValue={normalizedDefaultValue}\n\t\t\t\titemToStringValue={serializeValue}\n\t\t\t\t{...controlledValueProps}\n\t\t\t>\n\t\t\t\t<baseui.SelectTrigger\n\t\t\t\t\tref={ref}\n\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\t\taria-invalid={invalid ? true : ariaInvalid}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\ticonClassName={selectToggleRecipes.icon[size]}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'select--component select--trigger',\n\t\t\t\t\t\tformFieldTriggerClasses(size),\n\t\t\t\t\t\t'data-[placeholder]:text-muted-foreground',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...triggerProps}\n\t\t\t\t>\n\t\t\t\t\t<baseui.SelectValue className=\"select--value min-w-0\">\n\t\t\t\t\t\t{(currentValue: string | null) => {\n\t\t\t\t\t\t\tconst selectedOption = currentValue && currentValue !== CLEAR_VALUE\n\t\t\t\t\t\t\t\t? optionsByInternalValue.get(currentValue)\n\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\tconst rendered = renderValue\n\t\t\t\t\t\t\t\t? renderValue(selectedOption)\n\t\t\t\t\t\t\t\t: selectedOption?.label ?? resolvedPlaceholder;\n\n\t\t\t\t\t\t\treturn typographyNode(rendered, 'min-w-0 truncate');\n\t\t\t\t\t\t}}\n\t\t\t\t\t</baseui.SelectValue>\n\t\t\t\t</baseui.SelectTrigger>\n\t\t\t\t<SelectPopupContent className={cn('select--content', contentClassName)}>\n\t\t\t\t\t<SelectPopupGroup className=\"select--group\">\n\t\t\t\t\t\t{internalOptions.map(({ internalValue, option }) => {\n\t\t\t\t\t\t\tconst rendered = renderOption?.(option);\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<SelectPopupItem\n\t\t\t\t\t\t\t\t\tkey={internalValue}\n\t\t\t\t\t\t\t\t\tvalue={internalValue}\n\t\t\t\t\t\t\t\t\tlabel={option.label}\n\t\t\t\t\t\t\t\t\taria-label={option.label}\n\t\t\t\t\t\t\t\t\tdisabled={option.disabled}\n\t\t\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\t\t\tdensity={density}\n\t\t\t\t\t\t\t\t\tclassName=\"select--item\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{renderOption\n\t\t\t\t\t\t\t\t\t\t? typographyNode(rendered, 'select--option-custom')\n\t\t\t\t\t\t\t\t\t\t: <DefaultOptionContent option={option} size={size} />}\n\t\t\t\t\t\t\t\t</SelectPopupItem>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</SelectPopupGroup>\n\t\t\t\t</SelectPopupContent>\n\t\t\t</baseui.Select>\n\t\t);\n\t}),\n);\n\nSelect.displayName = 'Select';\n","import { Switch as SwitchPrimitive } from \"@base-ui/react/switch\"\n\nimport { cn } from \"../../lib/utils\"\nimport { focusRecipes } from \"../../lib/focus-recipes\"\nimport { fieldStateRecipes } from \"../../lib/field-state-recipes\"\n\n/**\n * Raw switch recipe. The unchecked track is the shared `--input` control\n * boundary; focus is the shared focus frame, and invalid follows the field-state\n * contract (destructive border, destructive halo on focus) like every field.\n */\nfunction Switch({\n className,\n size = \"default\",\n ...props\n}: SwitchPrimitive.Root.Props & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n data-size={size}\n className={cn(\n \"peer group/switch relative box-border inline-flex shrink-0 items-center rounded-full border border-transparent outline-none transition-[background-color,border-color,box-shadow]\",\n \"data-checked:bg-primary data-unchecked:bg-input\",\n \"data-[size=default]:h-5 data-[size=default]:w-9 data-[size=sm]:h-4 data-[size=sm]:w-7\",\n focusRecipes.frame,\n fieldStateRecipes.invalid,\n \"after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"bg-background rounded-full shadow-sm group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[16px] group-data-[size=sm]/switch:data-checked:translate-x-[12px] group-data-[size=default]/switch:data-unchecked:translate-x-0.5 group-data-[size=sm]/switch:data-unchecked:translate-x-0.5 pointer-events-none block ring-0 transition-transform motion-reduce:transition-none\"\n />\n </SwitchPrimitive.Root>\n )\n}\n\nexport { Switch }\n","/**\n * Switch — canonical boolean switch wrapper around the internal shadcn primitive.\n *\n * `onValueChange` is the package-wide value callback.\n */\nimport { forwardRef, type ComponentProps } from 'react';\n\nimport { Switch as SwitchPrimitive } from '../../ui/switch';\nimport { useDensityConfig, type ComponentScale } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { cn } from '../../../lib/utils';\n\ntype BaseSwitchProps = ComponentProps<typeof SwitchPrimitive>;\ntype SwitchElement = React.ElementRef<typeof SwitchPrimitive>;\n\nexport interface SwitchProps extends Omit<BaseSwitchProps, 'onCheckedChange' | 'size'> {\n\t/** Component scale. Falls back to `UIProvider.density.defaultScale`. */\n\tsize?: ComponentScale;\n\t/** Controlled checked state. */\n\tchecked?: boolean;\n\t/** Initial checked state for uncontrolled usage. */\n\tdefaultChecked?: boolean;\n\t/** Disable interaction and native form participation changes. */\n\tdisabled?: boolean;\n\t/** Prevent changes while retaining the current submitted value. */\n\treadOnly?: boolean;\n\t/** Require the switch to be checked for native form validation. */\n\trequired?: boolean;\n\t/** Hidden input name used during native form submission. */\n\tname?: string;\n\t/** Hidden input value submitted while checked. */\n\tvalue?: string;\n\t/** Optional value submitted while unchecked. */\n\tuncheckedValue?: string;\n\t/** Associate the hidden input with a form by id. */\n\tform?: string;\n\t/** Canonical boolean value callback. */\n\tonValueChange?: (checked: boolean) => void;\n\n\t/** Error state for styling (passed from FormField). */\n\tinvalid?: boolean;\n}\n\n/** Canonical boolean control with native form state and value-first callbacks. */\nexport const Switch = forwardRef<SwitchElement, SwitchProps>(function Switch(\n\t{\n\t\tonValueChange,\n\t\tsize: sizeProp,\n\t\tinvalid,\n\t\tclassName,\n\t\tid,\n\t\tname,\n\t\t'aria-invalid': ariaInvalid,\n\t\t...rest\n\t},\n\tref,\n) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\tconst resolvedAriaInvalid = invalid ? true : ariaInvalid;\n\tconst resolvedInvalid = resolvedAriaInvalid !== undefined && resolvedAriaInvalid !== false && resolvedAriaInvalid !== 'false';\n\n\treturn (\n\t\t<SwitchPrimitive\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t\tid={id}\n\t\t\tname={name}\n\t\t\tonCheckedChange={(checked) => onValueChange?.(checked)}\n\t\t\tsize={size === 'sm' ? 'sm' : 'default'}\n\t\t\taria-invalid={resolvedAriaInvalid}\n\t\t\tclassName={cn(\n\t\t\t\t'switch--component',\n\t\t\t\tsize === 'lg' && 'h-6! w-11! [&_[data-slot=switch-thumb]]:size-5! [&[data-checked]_[data-slot=switch-thumb]]:translate-x-[20px]!',\n\t\t\t\tresolvedInvalid && 'data-unchecked:border-destructive',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t/>\n\t);\n});\n\nSwitch.displayName = 'Switch';\n","/**\n * Shared types for choice-style form fields (CardRadio, CardCheckbox,\n * ListRadio, PillRadio). Each variant exports its own `Option` type that\n * extends `ChoiceOptionBase`, so consumers see one consistent option shape\n * across the family.\n *\n * Sizes follow the package component scale (`sm | md | lg`). CardRadio and\n * CardCheckbox additionally accept `size` to drive padding, icon size, and type\n * scale through shared form/display variables.\n */\nimport type { ComponentType, ReactNode } from 'react';\nimport type { ComponentScale } from '../../../lib/ui-provider';\nimport { focusRecipes } from '../../../lib/focus-recipes';\nimport { interactionRecipes } from '../../../lib/interaction-recipes';\n\nexport type ChoiceSize = ComponentScale;\n\nexport interface ChoiceOptionBase<TValue extends string = string> {\n\tvalue: TValue;\n\tlabel: ReactNode;\n\tdescription?: ReactNode;\n\ticon?: ComponentType<{ className?: string }>;\n\tdisabled?: boolean;\n}\n\nexport interface ChoiceGroupBaseProps {\n\t/** Supporting/error descriptions associated with the group. */\n\t'aria-describedby'?: string;\n\t/** Form field name (also used for hidden inputs and aria grouping). */\n\tname?: string;\n\t/** Disable the entire group. */\n\tdisabled?: boolean;\n\t/** Show error styling. */\n\tinvalid?: boolean;\n\t/** Density / control size. Defaults from `useDensityConfig().defaultScale`. */\n\tsize?: ChoiceSize;\n\tclassName?: string;\n}\n\n/**\n * Padding / icon-size token map shared across CardRadio + CardCheckbox so the\n * two variants line up visually when placed side-by-side.\n */\nexport const choiceCardSizeTokens: Record<\n\tChoiceSize,\n\t{ padding: string; iconBox: string; iconSize: string; gap: string }\n> = {\n\tsm: { padding: 'p-surface-xs', iconBox: 'size-avatar-sm', iconSize: 'size-icon-sm', gap: 'gap-space-sm' },\n\tmd: { padding: 'p-surface', iconBox: 'size-avatar', iconSize: 'size-icon', gap: 'gap-space-md' },\n\tlg: { padding: 'p-surface-lg', iconBox: 'size-avatar-lg', iconSize: 'size-icon-lg', gap: 'gap-space-lg' },\n};\n\n/**\n * Pill height / horizontal padding tokens. Shared across PillRadioGroup\n * and any future toggle-bar variant so they stack cleanly.\n */\nexport const choicePillSizeTokens: Record<ChoiceSize, string> = {\n\tsm: 'h-control-sm px-control-sm text-pxs',\n\tmd: 'h-control px-control text-sm',\n\tlg: 'h-control-lg px-control text-sm',\n};\n\n/**\n * Row padding tokens for ListRadio and any future inline list variant.\n */\nexport const choiceListSizeTokens: Record<ChoiceSize, string> = {\n\tsm: 'px-row-x py-row-y-sm',\n\tmd: 'px-row-x py-row-y',\n\tlg: 'px-row-x py-row-y-lg',\n};\n\n/**\n * Shared option-card states for CardRadioGroup and CardCheckboxGroup: the resting\n * `border-border` divider (declared beside `border` by each owner) steps up to the\n * control boundary on hover, and keyboard focus draws the shared focus frame.\n * Selection and validation are added by each owner as data/aria variants, so they\n * keep their border while focused.\n */\nexport const choiceCardStateClasses = `${interactionRecipes.tileHover} ${focusRecipes.frame}`;\n\n/** Optional option glyph: one neutral tile in every state, so colour stays for meaning. */\nexport const choiceCardIconClasses = 'inline-flex shrink-0 items-center justify-center rounded-inner bg-muted text-muted-foreground';\n\n/**\n * A control track exactly one label line tall. Pair it with the label's own text\n * role (size and leading) and align the row to its start: a checkbox, radio,\n * switch or selection marker then centres on the label's first line at every\n * scale, whether or not the label wraps.\n */\nexport const choiceControlTrackClasses = 'flex h-lh shrink-0 items-center';\n\n/**\n * Shared selected-card marker, derived from action geometry. It sits in a\n * `choiceControlTrackClasses` track beside the option label, inside a slot that\n * keeps its width while unselected so selecting never rewraps the label.\n */\nexport const choiceCardMarkerClasses = 'size-action-sm shrink-0 text-primary-foreground fill-primary stroke-primary-foreground';\nexport const choiceCardMarkerSlotClasses = 'inline-flex size-action-sm shrink-0 items-center justify-center';\n","/**\n * SwitchCard — bordered settings card with an icon, title, optional\n * description, optional hint, and a trailing switch. The whole card is\n * clickable and toggles the switch; clicking inside the actual switch only\n * toggles once. The on state draws the primary border; the switch itself carries the state.\n *\n * Use for top-of-list \"feature\" toggles where the switch needs more visual\n * weight than a `ToggleField`. For dense rows, prefer `ToggleField`.\n */\nimport { type LucideIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { useCallback, useId, useMemo, useState } from 'react';\nimport { Stack } from '../structure';\nimport { Label, Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\nimport { fieldStateRecipes } from '../../../lib/field-state-recipes';\nimport { useDensityConfig } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { formLabelSizeClasses } from '../forms/form-sizing';\n\nimport { choiceCardIconClasses, choiceControlTrackClasses } from './choice-types';\nimport { Switch } from './switch';\n\nexport interface SwitchCardProps {\n\t/** Additional supporting/error descriptions associated with the editable control. */\n\t'aria-describedby'?: string;\n\t/** Card title, also the switch's accessible name. */\n\tlabel: string;\n\t/** Supporting sentence under the label. */\n\tdescription?: string;\n\t/** Short guidance below the description. */\n\thint?: string;\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n\t/** Form field name, forwarded for native submits. */\n\tname?: string;\n\t/** Whether the switch is on. Controlled. */\n\tvalue?: boolean;\n\t/** Initial switch state for uncontrolled use. */\n\tdefaultValue?: boolean;\n\tonValueChange?: (checked: boolean) => void;\n\t/** Disables the switch and mutes the card. */\n\tdisabled?: boolean;\n\t/** Applies the invalid styling. */\n\tinvalid?: boolean;\n\tclassName?: string;\n}\n\nexport const SwitchCard = React.forwardRef<HTMLDivElement, SwitchCardProps>(function SwitchCard({\n\t'aria-describedby': ariaDescribedBy,\n\tlabel,\n\tdescription,\n\thint,\n\ticon: Icon,\n\tname,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tdisabled = false,\n\tinvalid,\n\tclassName,\n}: SwitchCardProps, ref) {\n\tconst isControlled = value !== undefined;\n\tconst [internal, setInternal] = useState<boolean>(defaultValue ?? false);\n\tconst checked = isControlled ? value ?? false : internal;\n\tconst { defaultScale } = useDensityConfig();\n\t// The switch track is one label line tall, so the switch centres on the title's first line.\n\tconst labelLineClasses = formLabelSizeClasses[resolveComponentScale(undefined, defaultScale)];\n\tconst generatedId = useId();\n\tconst id = useMemo(() => name ?? generatedId, [name, generatedId]);\n\n\tconst hasDescription = typeof description === 'string' && description.trim() !== '';\n\tconst describedById = hasDescription ? `${id}-description` : undefined;\n\n\tconst handleToggle = useCallback(\n\t\t(newChecked: boolean) => {\n\t\t\tif (disabled) return;\n\t\t\tif (!isControlled) setInternal(newChecked);\n\t\t\tonValueChange?.(newChecked);\n\t\t},\n\t\t[disabled, isControlled, onValueChange],\n\t);\n\n\tconst handleCardClick = useCallback(\n\t\t(e: React.MouseEvent) => {\n\t\t\tif ((e.target as HTMLElement).closest('[role=\"switch\"]')) return;\n\t\t\thandleToggle(!checked);\n\t\t},\n\t\t[checked, handleToggle],\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\taria-invalid={invalid || undefined}\n\t\t\tonClick={handleCardClick}\n\t\t\tclassName={cn('switch-card--component', \n\t\t\t\t'group relative flex items-start gap-space-lg rounded-radius border bg-card text-card-foreground p-surface transition-[background,border-color,box-shadow] duration-150',\n\t\t\t\t// Same resting, hover, selected and invalid states as the choice cards.\n\t\t\t\t'border-border',\n\t\t\t\tchecked && 'border-primary',\n\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t!disabled && 'cursor-pointer hover:border-input',\n\t\t\t\tdisabled && 'cursor-not-allowed opacity-50',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{!!name && (\n\t\t\t\t<input\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={checked ? '1' : '0'}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{!!Icon && (\n\t\t\t\t<span className={cn('switch-card--icon size-control', choiceCardIconClasses)}>\n\t\t\t\t\t<Icon className=\"size-icon\" />\n\t\t\t\t</span>\n\t\t\t)}\n\n\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t<Label\n\t\t\t\t\thtmlFor={id}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'block text-inherit',\n\t\t\t\t\t\tdisabled ? 'cursor-not-allowed' : 'cursor-pointer',\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t\t{!!hasDescription && (\n\t\t\t\t\t<Text id={describedById} size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t\t{!!hint && (\n\t\t\t\t\t<Text size=\"xs\" type=\"discrete\">\n\t\t\t\t\t\t{hint}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t\t</Stack>\n\n\t\t\t<div className={cn('switch-card--control', choiceControlTrackClasses, labelLineClasses)}>\n\t\t\t\t<Switch\n\t\t\t\t\t// The card owns the disabled fade; the switch keeps native disabled behavior.\n\t\t\t\t\tclassName=\"data-disabled:opacity-100\"\n\t\t\t\t\tid={id}\n\t\t\t\t\tchecked={checked}\n\t\t\t\t\tonValueChange={handleToggle}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={invalid}\n\t\t\t\t\taria-label={label}\n\t\t\t\t\taria-describedby={[ariaDescribedBy, describedById].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n});\n\nSwitchCard.displayName = 'SwitchCard';\n","/**\n * ToggleField — inline label-and-control row for switches and checkboxes.\n *\n * Pattern: a left-aligned descriptive label/description block with the\n * control sitting on the trailing edge. Use for settings rows (e.g. \"Email\n * notifications\" + switch) where a full SwitchCard is too heavy and a bare\n * `Switch` + `<label>` is too brittle. The whole row is clickable and\n * keyboard-accessible.\n *\n * Two control kinds: `'switch'` (default) and `'checkbox'`. Both honour\n * controlled `value` / `defaultValue` / `onValueChange`. Strings are passed via\n * standard React props rather than a `strings` object — there are no\n * defaults to override.\n */\nimport type { ReactNode } from 'react';\nimport { forwardRef, useCallback, useId, useState } from 'react';\n\nimport { Stack } from '../structure';\nimport { Label, Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\nimport { useDensityConfig } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { formLabelSizeClasses } from '../forms/form-sizing';\n\nimport { Checkbox } from './checkbox';\nimport { choiceControlTrackClasses } from './choice-types';\nimport { Switch } from './switch';\n\nexport type ToggleFieldKind = 'switch' | 'checkbox';\n\nexport interface ToggleFieldProps {\n\t/** Additional supporting/error descriptions associated with the editable control. */\n\t'aria-describedby'?: string;\n\t/** Control label. */\n\tlabel: ReactNode;\n\t/** Supporting sentence under the label. */\n\tdescription?: ReactNode;\n\t/** Which control renders — a switch or a checkbox. */\n\tkind?: ToggleFieldKind;\n\t/** Whether the control is on. Controlled. */\n\tvalue?: boolean;\n\t/** Initial state for uncontrolled use. */\n\tdefaultValue?: boolean;\n\tonValueChange?: (checked: boolean) => void;\n\t/** Disables the control. */\n\tdisabled?: boolean;\n\t/** Applies the invalid styling. */\n\tinvalid?: boolean;\n\t/** Form field name, forwarded for native submits. */\n\tname?: string;\n\tclassName?: string;\n\t/** Place the control on the leading edge instead of trailing (default). */\n\tcontrolPosition?: 'leading' | 'trailing';\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport const ToggleField = forwardRef<HTMLDivElement, ToggleFieldProps>(function ToggleField({\n\t'aria-describedby': ariaDescribedBy,\n\tlabel,\n\tdescription,\n\tkind = 'switch',\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tdisabled = false,\n\tinvalid = false,\n\tname,\n\tclassName,\n\tcontrolPosition = 'trailing',\n}: ToggleFieldProps, ref) {\n\tconst isControlled = value !== undefined;\n\tconst [internal, setInternal] = useState<boolean>(defaultValue ?? false);\n\tconst checked = isControlled ? value ?? false : internal;\n\tconst { defaultScale } = useDensityConfig();\n\t// The control track is exactly one label line tall, so a switch or checkbox\n\t// centres on the label's first line at every scale, wrapped or not.\n\tconst controlTrackClasses = cn('toggle-field--control', choiceControlTrackClasses, formLabelSizeClasses[resolveComponentScale(undefined, defaultScale)]);\n\tconst inputId = useId();\n\tconst labelId = `${inputId}-label`;\n\tconst hasDescription = description !== null && description !== undefined && description !== false;\n\tconst descriptionId = hasDescription ? `${inputId}-description` : undefined;\n\n\tconst set = useCallback(\n\t\t(next: boolean) => {\n\t\t\tif (disabled) return;\n\t\t\tif (!isControlled) setInternal(next);\n\t\t\tonValueChange?.(next);\n\t\t},\n\t\t[disabled, isControlled, onValueChange],\n\t);\n\n\tconst onRowClick = (e: React.MouseEvent) => {\n\t\t// Avoid double-toggle when clicking the control itself.\n\t\tconst target = e.target as HTMLElement;\n\t\tif (target.closest('[role=\"switch\"], [role=\"checkbox\"], input[type=\"checkbox\"]')) return;\n\t\tset(!checked);\n\t};\n\n\tconst Control =\n\t\tkind === 'switch' ? (\n\t\t\t<Switch\n\t\t\t\t// The row already expands the hit area; a horizontal switch hit\n\t\t\t\t// extension would overflow when this field sits at a surface edge.\n\t\t\t\tclassName=\"after:inset-x-0\"\n\t\t\t\tid={inputId}\n\t\t\t\tname={name}\n\t\t\t\tchecked={checked}\n\t\t\t\tonValueChange={set}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tinvalid={invalid}\n\t\t\t\taria-labelledby={labelId}\n\t\t\t\taria-describedby={[ariaDescribedBy, descriptionId].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t) : (\n\t\t\t<Checkbox\n\t\t\t\tid={inputId}\n\t\t\t\tname={name}\n\t\t\t\tchecked={checked}\n\t\t\t\tonCheckedChange={(v) => set(v === true)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\taria-labelledby={labelId}\n\t\t\t\taria-describedby={[ariaDescribedBy, descriptionId].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t);\n\n\tconst TextBlock = (\n\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t<div id={labelId}>\n\t\t\t\t{isSimpleText(label) ? (\n\t\t\t\t\t<Label\n\t\t\t\t\t\thtmlFor={inputId}\n\t\t\t\t\t\tdata-disabled={disabled || undefined}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t// Leading is left to `Label` so this sits on the same\n\t\t\t\t\t\t\t// baseline rhythm as the switch, checkbox, and switch-card\n\t\t\t\t\t\t\t// labels; `leading-snug` here made it the only inline\n\t\t\t\t\t\t\t// control label in the package at 19.25px.\n\t\t\t\t\t\t\t'block text-inherit data-disabled:opacity-50',\n\t\t\t\t\t\t\tdisabled ? 'cursor-not-allowed' : 'cursor-pointer',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</Label>\n\t\t\t\t) : label}\n\t\t\t</div>\n\t\t\t{hasDescription && (\n\t\t\t\t<div id={descriptionId}>\n\t\t\t\t\t{isSimpleText(description) ? (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t) : description}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Stack>\n\t);\n\n\treturn (\n\t\t<Stack\n\t\t\tref={ref}\n\t\t\tdirection=\"horizontal\"\n\t\t\talign=\"start\"\n\t\t\twrap={false}\n\t\t\tgap=\"md\"\n\t\t\trole=\"group\"\n\t\t\tonClick={onRowClick}\n\t\t\tclassName={cn('toggle-field--component rounded-radius py-row-y',\n\t\t\t\tdisabled && 'pointer-events-none',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{controlPosition === 'leading' && <div className={controlTrackClasses}>{Control}</div>}\n\t\t\t{TextBlock}\n\t\t\t{controlPosition === 'trailing' && <div className={controlTrackClasses}>{Control}</div>}\n\t\t</Stack>\n\t);\n});\n\nToggleField.displayName = 'ToggleField';\n","/**\n * CardCheckboxGroup — multi-select group rendered as a grid of card-shaped\n * options with title, optional description, and optional leading icon.\n * Use for a small set of feature flags / preferences where each option\n * benefits from extra context that a flat checkbox list can't carry.\n *\n * Pairs with `CardRadioGroup` (single-select). Both share spacing tokens\n * from `./choice-types` so they line up when used side-by-side.\n */\nimport { CircleCheck, type LucideIcon } from 'lucide-react';\nimport { forwardRef, useState, useCallback, useMemo, type ReactNode } from 'react';\nimport { Text } from '../../typography';\nimport { Stack } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { fieldStateRecipes } from '../../../lib/field-state-recipes';\nimport { useDensityConfig, useTypographyConfig } from '../../../lib/ui-provider';\nimport { textLineHeights, textSizes } from '../../typography/text.styles';\nimport { resolveFormControlSize } from '../forms/form-sizing';\nimport {\n\tchoiceCardSizeTokens,\n\tchoiceCardIconClasses,\n\tchoiceCardMarkerClasses,\n\tchoiceCardMarkerSlotClasses,\n\tchoiceCardStateClasses,\n\tchoiceControlTrackClasses,\n\ttype ChoiceGroupBaseProps,\n\ttype ChoiceOptionBase,\n} from './choice-types';\n\nexport interface CardCheckboxOption extends ChoiceOptionBase {\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n}\n\nexport interface CardCheckboxGroupProps extends ChoiceGroupBaseProps {\n\t/** Choices offered. */\n\toptions: CardCheckboxOption[];\n\t/** Current value. Controlled. */\n\tvalue?: string[];\n\t/** Initial value for uncontrolled use. */\n\tdefaultValue?: string[];\n\tonValueChange?: (values: string[]) => void;\n\t/** How many columns the grid uses. */\n\tcolumns?: 1 | 2 | 3 | 4;\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/*\n * Container widths, not viewport widths — a choice-card group is as likely to\n * sit in a settings rail or a drawer as at page width, and keyed to the screen\n * it laid three cards across a 300px column.\n *\n * 384/576/672 puts every tier clear of the widths this actually renders at: the\n * shipped three-up group is 672px wide, so the three-column step sits 96px\n * below it rather than exactly on it, and 384 keeps the two-column step above\n * every mobile mount (316px).\n */\nconst GRID_COLS: Record<NonNullable<CardCheckboxGroupProps['columns']>, string> = {\n\t1: 'grid grid-cols-1 gap-space-md',\n\t2: 'grid grid-cols-1 gap-space-md @sm/card-checkbox-group:grid-cols-2',\n\t3: 'grid grid-cols-1 gap-space-md @sm/card-checkbox-group:grid-cols-2 @xl/card-checkbox-group:grid-cols-3',\n\t4: 'grid grid-cols-1 gap-space-md @sm/card-checkbox-group:grid-cols-2 @2xl/card-checkbox-group:grid-cols-4',\n};\n\nexport const CardCheckboxGroup = forwardRef<HTMLDivElement, CardCheckboxGroupProps>(function CardCheckboxGroup({\n\t'aria-describedby': ariaDescribedBy,\n\toptions,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tname,\n\tcolumns = 3,\n\tinvalid,\n\tdisabled,\n\tsize: sizeProp,\n\tclassName,\n}: CardCheckboxGroupProps, ref) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst { defaultTextSize } = useTypographyConfig();\n\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\t// The marker track is one line of the option label's own text role tall, so\n\t// the selected check centres on the label's first line.\n\tconst markerTrackClasses = cn('card-checkbox-group--marker', choiceControlTrackClasses, textSizes[defaultTextSize ?? 'sm'], textLineHeights.normal);\n\n\tconst isControlled = value !== undefined;\n\tconst [internal, setInternal] = useState<string[]>(defaultValue ?? []);\n\tconst selected = useMemo(\n\t\t() => (isControlled ? value ?? [] : internal),\n\t\t[internal, isControlled, value],\n\t);\n\tconst tokens = choiceCardSizeTokens[size];\n\n\tconst toggle = useCallback(\n\t\t(val: string) => {\n\t\t\tif (disabled) return;\n\t\t\tif (options.find((o) => o.value === val)?.disabled) return;\n\t\t\tconst exists = selected.includes(val);\n\t\t\tconst next = exists ? selected.filter((v) => v !== val) : [...selected, val];\n\t\t\tif (!isControlled) setInternal(next);\n\t\t\tonValueChange?.(next);\n\t\t},\n\t\t[disabled, options, selected, isControlled, onValueChange],\n\t);\n\n\treturn (\n\t\t/*\n\t\t * The root exists to be the query container: an element cannot match its\n\t\t * own container query, so the grid whose columns react sits inside the\n\t\t * element being measured.\n\t\t */\n\t\t<div ref={ref} className={cn('card-checkbox-group--component @container/card-checkbox-group', className)}>\n\t\t\t<div\n\t\t\t\tclassName={cn('card-checkbox-group--grid', GRID_COLS[columns])}\n\t\t\t\trole=\"group\"\n\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\taria-disabled={disabled || undefined}\n\t\t\t>\n\t\t\t\t{options.map((option) => {\n\t\t\t\t\tconst Icon = option.icon;\n\t\t\t\t\tconst optionLabel = option.label;\n\t\t\t\t\tconst isSelected = selected.includes(option.value);\n\t\t\t\t\tconst isDisabled = disabled || option.disabled;\n\t\t\t\t\tconst shouldIncludeHidden = Boolean(name) && isSelected;\n\t\t\t\t\tconst nameAttr = name ? `${name}[]` : undefined;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div key={option.value} className=\"relative\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\t\t\t\tname={nameAttr}\n\t\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\t\tdisabled={!shouldIncludeHidden}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\taria-pressed={isSelected}\n\t\t\t\t\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\t\t\t\t\tonClick={() => toggle(option.value)}\n\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\tdata-selected={isSelected}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'box-border group relative flex w-full flex-col items-start text-start outline-none cursor-pointer',\n\t\t\t\t\t\t\t\t\t'rounded-radius border border-border bg-card text-card-foreground transition-[color,box-shadow,background,border-color] duration-150',\n\t\t\t\t\t\t\t\t\tchoiceCardStateClasses,\n\t\t\t\t\t\t\t\t\t'data-[selected=true]:border-primary',\n\t\t\t\t\t\t\t\t\ttokens.padding,\n\t\t\t\t\t\t\t\t\ttokens.gap,\n\t\t\t\t\t\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t\t\t\t\t\t'disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t\t<span className={cn(choiceCardIconClasses, tokens.iconBox)}>\n\t\t\t\t\t\t\t\t\t\t<Icon className={tokens.iconSize} />\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<span className={cn('card-checkbox-group--body flex w-full min-w-0 items-start', tokens.gap)}>\n\t\t\t\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t{isSimpleText(optionLabel) ? (\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" type=\"inherit\" weight=\"medium\">\n\t\t\t\t\t\t\t\t\t\t\t{optionLabel}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t) : optionLabel}\n\t\t\t\t\t\t\t\t\t{!!option.description && (\n\t\t\t\t\t\t\t\t\t\tisSimpleText(option.description) ? (\n\t\t\t\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t\t\t\t\t{option.description}\n\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t) : option.description\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t<span aria-hidden=\"true\" className={markerTrackClasses}>\n\t\t\t\t\t\t\t\t\t<span className={choiceCardMarkerSlotClasses}>\n\t\t\t\t\t\t\t\t\t\t<CircleCheck\n\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\tchoiceCardMarkerClasses,\n\t\t\t\t\t\t\t\t\t\t\t\t!isSelected && 'hidden',\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</div>\n\t);\n});\n\nCardCheckboxGroup.displayName = 'CardCheckboxGroup';\n","/**\n * CardRadioGroup — single-select radio group rendered as a grid of card-shaped\n * options with title, optional description, and optional leading icon. Built\n * on `@base-ui/react/radio` for accessibility (keyboard navigation, focus\n * management, native form participation).\n *\n * Pairs with `CardCheckboxGroup` (multi-select). Shares spacing tokens from\n * `./choice-types`.\n */\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio';\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';\nimport { CircleCheck, type LucideIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { memo, useMemo, type ReactNode } from 'react';\nimport { Text } from '../../typography';\nimport { Stack } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { fieldStateRecipes } from '../../../lib/field-state-recipes';\nimport { useDensityConfig, useTypographyConfig } from '../../../lib/ui-provider';\nimport { textLineHeights, textSizes } from '../../typography/text.styles';\nimport { resolveFormControlSize } from '../forms/form-sizing';\nimport {\n\tchoiceCardSizeTokens,\n\tchoiceCardIconClasses,\n\tchoiceCardMarkerClasses,\n\tchoiceCardMarkerSlotClasses,\n\tchoiceCardStateClasses,\n\tchoiceControlTrackClasses,\n\ttype ChoiceGroupBaseProps,\n\ttype ChoiceOptionBase,\n} from './choice-types';\n\nexport interface CardRadioOption extends ChoiceOptionBase {\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n}\n\nexport interface CardRadioGroupProps extends ChoiceGroupBaseProps {\n\t/** Choices offered. */\n\toptions: CardRadioOption[];\n\t/** Current value. Controlled. */\n\tvalue?: string;\n\t/** Initial value for uncontrolled use. */\n\tdefaultValue?: string;\n\tonValueChange?: (value: string) => void;\n\t/** How many columns the grid uses. */\n\tcolumns?: 1 | 2 | 3 | 4;\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/*\n * Container widths, not viewport widths — a choice-card group is as likely to\n * sit in a settings rail or a drawer as at page width, and keyed to the screen\n * it laid three cards across a 300px column.\n *\n * 384/576/672 puts every tier clear of the widths this actually renders at: the\n * shipped three-up group is 672px wide, so the three-column step sits 96px\n * below it rather than exactly on it, and 384 keeps the two-column step above\n * every mobile mount (316px).\n */\nconst GRID_COLS: Record<NonNullable<CardRadioGroupProps['columns']>, string> = {\n\t1: 'grid grid-cols-1 gap-space-md',\n\t2: 'grid grid-cols-1 gap-space-md @sm/card-radio-group:grid-cols-2',\n\t3: 'grid grid-cols-1 gap-space-md @sm/card-radio-group:grid-cols-2 @xl/card-radio-group:grid-cols-3',\n\t4: 'grid grid-cols-1 gap-space-md @sm/card-radio-group:grid-cols-2 @2xl/card-radio-group:grid-cols-4',\n};\n\nfunction CardRadioGroupImpl({\n\t'aria-describedby': ariaDescribedBy,\n\toptions,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tname,\n\tcolumns = 3,\n\tinvalid,\n\tdisabled,\n\tsize: sizeProp,\n\tclassName,\n}: CardRadioGroupProps, ref: React.ForwardedRef<HTMLDivElement>) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst { defaultTextSize } = useTypographyConfig();\n\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\t// The marker track is one line of the option label's own text role tall, so\n\t// the selected check centres on the label's first line.\n\tconst markerTrackClasses = cn('card-radio-group--marker', choiceControlTrackClasses, textSizes[defaultTextSize ?? 'sm'], textLineHeights.normal);\n\n\tconst tokens = choiceCardSizeTokens[size];\n\tconst gridClassName = useMemo(() => cn('card-radio-group--grid', GRID_COLS[columns]), [columns]);\n\n\treturn (\n\t\t/*\n\t\t * The root exists to be the query container: an element cannot match its\n\t\t * own container query, so the grid whose columns react sits inside the\n\t\t * element being measured.\n\t\t */\n\t\t<div ref={ref} className={cn('card-radio-group--component @container/card-radio-group', className)}>\n\t\t\t<RadioGroupPrimitive\n\t\t\t\tvalue={value}\n\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\tonValueChange={(val) => val && onValueChange?.(val)}\n\t\t\t\tname={name}\n\t\t\t\tdisabled={disabled}\n\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\tclassName={gridClassName}\n\t\t\t>\n\t\t\t\t{options.map((option) => {\n\t\t\t\t\tconst Icon = option.icon;\n\t\t\t\t\tconst optionLabel = option.label;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<RadioPrimitive.Root\n\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t\tdisabled={disabled || option.disabled}\n\t\t\t\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'box-border relative group flex flex-col text-start outline-none cursor-pointer',\n\t\t\t\t\t\t\t\t'rounded-radius border border-border bg-card text-card-foreground transition-[color,box-shadow,background,border-color] duration-150',\n\t\t\t\t\t\t\t\tchoiceCardStateClasses,\n\t\t\t\t\t\t\t\t'data-[checked]:border-primary',\n\t\t\t\t\t\t\t\ttokens.padding,\n\t\t\t\t\t\t\t\ttokens.gap,\n\t\t\t\t\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t\t\t\t\t// The radio root is a span, so state comes from Base UI's attribute.\n\t\t\t\t\t\t\t\t'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t<span className={cn(choiceCardIconClasses, tokens.iconBox)}>\n\t\t\t\t\t\t\t\t\t<Icon className={tokens.iconSize} />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<span className={cn('card-radio-group--body flex w-full min-w-0 items-start', tokens.gap)}>\n\t\t\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t{isSimpleText(optionLabel) ? (\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" type=\"inherit\" weight=\"medium\">\n\t\t\t\t\t\t\t\t\t\t{optionLabel}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t) : optionLabel}\n\t\t\t\t\t\t\t\t{!!option.description && (\n\t\t\t\t\t\t\t\t\tisSimpleText(option.description) ? (\n\t\t\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t\t\t\t{option.description}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t) : option.description\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t<span aria-hidden=\"true\" className={markerTrackClasses}>\n\t\t\t\t\t\t\t\t<span className={choiceCardMarkerSlotClasses}>\n\t\t\t\t\t\t\t\t\t<RadioPrimitive.Indicator\n\t\t\t\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t\t\t\t<CircleCheck className={choiceCardMarkerClasses} />\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</RadioPrimitive.Root>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</RadioGroupPrimitive>\n\t\t</div>\n\t);\n}\n\nexport const CardRadioGroup = memo(React.forwardRef<HTMLDivElement, CardRadioGroupProps>(CardRadioGroupImpl));\nCardRadioGroup.displayName = 'CardRadioGroup';\n","/**\n * ListRadioGroup — single-select radio group rendered as a vertical list with\n * dividers between rows. Use when options have descriptive secondary text and\n * read better as a stack than a grid (e.g. plan tiers, role definitions).\n *\n * Pairs with `CardRadioGroup` for grid-style choices and `PillRadioGroup` for\n * inline compact toggles.\n */\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio';\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';\nimport { forwardRef } from 'react';\nimport { Text } from '../../typography';\nimport { textSizes } from '../../typography/text.styles';\nimport { Stack } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { fieldStateRecipes } from '../../../lib/field-state-recipes';\nimport { useDensityConfig, useTypographyConfig } from '../../../lib/ui-provider';\nimport { resolveFormControlSize } from '../forms/form-sizing';\nimport {\n\tchoiceControlTrackClasses,\n\tchoiceListSizeTokens,\n\ttype ChoiceGroupBaseProps,\n\ttype ChoiceOptionBase,\n} from './choice-types';\nimport { interactionRecipes } from '../../../lib/interaction-recipes';\n\nexport interface ListRadioOption extends ChoiceOptionBase {}\n\nexport interface ListRadioGroupProps extends ChoiceGroupBaseProps {\n\t/** Choices offered. */\n\toptions: ListRadioOption[];\n\t/** Current value. Controlled. */\n\tvalue?: string;\n\t/** Initial value for uncontrolled use. */\n\tdefaultValue?: string;\n\tonValueChange?: (value: string) => void;\n}\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport const ListRadioGroup = forwardRef<HTMLDivElement, ListRadioGroupProps>(function ListRadioGroup({\n\toptions,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tname,\n\tinvalid,\n\tdisabled,\n\tsize: sizeProp,\n\tclassName,\n}: ListRadioGroupProps, ref) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst { defaultTextSize } = useTypographyConfig();\n\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\n\tconst rowPadding = choiceListSizeTokens[size];\n\t// The radio track is one line of the label's own text role tall, so the\n\t// circle centres on the first line whether or not the label wraps.\n\tconst labelLineClasses = cn(textSizes[defaultTextSize ?? 'sm'], 'leading-tight');\n\treturn (\n\t\t<RadioGroupPrimitive\n\t\t\tref={ref}\n\t\t\tvalue={value}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tonValueChange={(val) => val && onValueChange?.(val)}\n\t\t\tname={name}\n\t\t\tdisabled={disabled}\n\t\t\taria-invalid={invalid || undefined}\n\t\t\tclassName={cn('list-radio-group--component', \n\t\t\t\t'overflow-hidden rounded-radius border border-border [&>[role=radio]~[role=radio]]:border-t [&>[role=radio]~[role=radio]]:border-border',\n\t\t\t\t// Validation marks the group frame once, never each radio; the focused\n\t\t\t\t// row's radio draws the focus frame.\n\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t// A disabled group dims once; its rows do not dim again.\n\t\t\t\tdisabled && 'pointer-events-none opacity-50',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{options.map((option) => (\n\t\t\t\t<RadioPrimitive.Root\n\t\t\t\t\tkey={option.value}\n\t\t\t\t\tvalue={option.value}\n\t\t\t\t\tdisabled={disabled || option.disabled}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'box-border group flex w-full items-start gap-space-lg text-start outline-none cursor-pointer',\n\t\t\t\t\t\t`transition-colors ${interactionRecipes.rowHover}`,\n\t\t\t\t\t\t'data-disabled:cursor-not-allowed',\n\t\t\t\t\t\t!disabled && 'data-disabled:opacity-50',\n\t\t\t\t\t\trowPadding,\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<span aria-hidden=\"true\" className={cn('list-radio-group--track', choiceControlTrackClasses, labelLineClasses)}>\n\t\t\t\t\t\t{/* Selection reads from the radio itself: the shared control\n\t\t\t\t\t\t boundary, the primary ring and dot when checked, and the shared\n\t\t\t\t\t\t focus frame when the row has keyboard focus. */}\n\t\t\t\t\t\t<span className={cn(\n\t\t\t\t\t\t\t'list-radio-group--radio box-border flex size-4 items-center justify-center rounded-full border border-input transition-[border-color,box-shadow]',\n\t\t\t\t\t\t\t'group-data-[checked]:border-primary group-focus-visible:border-ring group-focus-visible:ring-3 group-focus-visible:ring-ring/50',\n\t\t\t\t\t\t)}>\n\t\t\t\t\t\t\t<RadioPrimitive.Indicator className=\"list-radio-group--dot size-2 rounded-full bg-primary\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<Stack gap=\"dense\" className=\"flex-1 min-w-0\">\n\t\t\t\t\t\t{isSimpleText(option.label) ? (\n\t\t\t\t\t\t\t<Text tag=\"span\" weight=\"medium\" lineHeight=\"tight\" className=\"block\">\n\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : option.label}\n\t\t\t\t\t\t{!!option.description && (\n\t\t\t\t\t\t\tisSimpleText(option.description) ? (\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"block\">\n\t\t\t\t\t\t\t\t\t{option.description}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) : option.description\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</RadioPrimitive.Root>\n\t\t\t))}\n\t\t</RadioGroupPrimitive>\n\t);\n});\n\nListRadioGroup.displayName = 'ListRadioGroup';\n","/**\n * PillRadioGroup — compact, inline single-select rendered as connected pill\n * buttons. Best for 2–4 options where a full `<Select>` is too heavy and\n * cards are too tall (e.g. timeframe toggles, view-mode switchers).\n *\n * Custom-styled buttons rather than the shadcn ToggleGroup primitive: the\n * primitive strips inner rounding when spacing=0, which doesn't match this\n * design system's pill connector style.\n *\n * Keyboard follows the native radio-group pattern: the group is one Tab stop\n * (the selected pill, or the first enabled one), the arrow keys move to the\n * previous/next enabled pill and select it, Home/End jump to the ends, and\n * Space/Enter select the focused pill (or clear it when `allowClear` is set).\n */\nimport * as React from 'react';\n\nimport { Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\nimport { fieldStateRecipes } from '../../../lib/field-state-recipes';\nimport { useDensityConfig } from '../../../lib/ui-provider';\nimport { formControlSizeClasses, resolveFormControlSize } from '../forms/form-sizing';\nimport {\n\tchoicePillSizeTokens,\n\ttype ChoiceGroupBaseProps,\n\ttype ChoiceOptionBase,\n} from './choice-types';\nimport { focusRecipes } from '../../../lib/focus-recipes';\n\nexport interface PillRadioGroupOption extends ChoiceOptionBase {}\n\nexport interface PillRadioGroupProps\n\textends Omit<ChoiceGroupBaseProps, 'name'> {\n\t/** Form field name, forwarded for native submits. */\n\tname: string;\n\t/** Current value. Controlled. */\n\tvalue: string | null | undefined;\n\t/** Choices offered. */\n\toptions: PillRadioGroupOption[];\n\tonValueChange: (value: string | null) => void;\n\t/** Allow deselecting (click active pill to clear). Default false. */\n\tallowClear?: boolean;\n\t/** Stretch pills to fill the container. */\n\tfullWidth?: boolean;\n\t/** Accessible name of the group when no visible label is associated with it. */\n\t'aria-label'?: string;\n\t/** Id of a visible label that names the group. */\n\t'aria-labelledby'?: string;\n}\n\nconst NEXT_KEYS = new Set(['ArrowRight', 'ArrowDown']);\nconst PREVIOUS_KEYS = new Set(['ArrowLeft', 'ArrowUp']);\n\nexport const PillRadioGroup = React.forwardRef<HTMLDivElement, PillRadioGroupProps>(function PillRadioGroup({\n\tname,\n\tvalue,\n\toptions,\n\tonValueChange,\n\tallowClear = false,\n\tsize: sizeProp,\n\tfullWidth = false,\n\tdisabled = false,\n\tinvalid = false,\n\tclassName,\n\t'aria-label': ariaLabel,\n\t'aria-labelledby': ariaLabelledBy,\n\t'aria-describedby': ariaDescribedBy,\n}: PillRadioGroupProps, ref) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\tconst buttonRefs = React.useRef<Array<HTMLButtonElement | null>>([]);\n\n\tconst isEnabled = React.useCallback(\n\t\t(option: PillRadioGroupOption) => !disabled && !option.disabled,\n\t\t[disabled],\n\t);\n\tconst selectedIndex = options.findIndex((option) => option.value === value);\n\t// One Tab stop: the selected enabled pill, otherwise the first enabled one.\n\tconst tabStopIndex = selectedIndex >= 0 && isEnabled(options[selectedIndex])\n\t\t? selectedIndex\n\t\t: options.findIndex(isEnabled);\n\n\tconst handleClick = React.useCallback(\n\t\t(optionValue: string) => {\n\t\t\tif (optionValue === value) {\n\t\t\t\tif (allowClear) onValueChange(null);\n\t\t\t} else {\n\t\t\t\tonValueChange(optionValue);\n\t\t\t}\n\t\t},\n\t\t[allowClear, onValueChange, value],\n\t);\n\n\tconst handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n\t\tconst enabled = options.map((option, index) => (isEnabled(option) ? index : -1)).filter((index) => index >= 0);\n\t\tif (!enabled.length) return;\n\t\tconst current = buttonRefs.current.findIndex((button) => button === event.target);\n\t\tif (current < 0) return;\n\t\tconst rtl = getComputedStyle(event.currentTarget).direction === 'rtl';\n\t\tconst forward = rtl ? new Set(['ArrowLeft', 'ArrowDown']) : NEXT_KEYS;\n\t\tconst backward = rtl ? new Set(['ArrowRight', 'ArrowUp']) : PREVIOUS_KEYS;\n\t\tconst position = enabled.indexOf(current);\n\t\tlet next: number | undefined;\n\t\tif (forward.has(event.key)) next = enabled[(position + 1) % enabled.length];\n\t\telse if (backward.has(event.key)) next = enabled[(position - 1 + enabled.length) % enabled.length];\n\t\telse if (event.key === 'Home') next = enabled[0];\n\t\telse if (event.key === 'End') next = enabled[enabled.length - 1];\n\t\tif (next === undefined) return;\n\t\tevent.preventDefault();\n\t\tbuttonRefs.current[next]?.focus();\n\t\t// Moving within a radio group selects, as native radios do.\n\t\tif (options[next].value !== value) onValueChange(options[next].value);\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tdata-name={name}\n\t\t\trole=\"radiogroup\"\n\t\t\taria-label={ariaLabel}\n\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\taria-describedby={ariaDescribedBy}\n\t\t\taria-invalid={invalid || undefined}\n\t\t\taria-disabled={disabled || undefined}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tclassName={cn('pill-radio-group--component',\n\t\t\t\t'border-input inline-flex items-center overflow-hidden rounded-inner border',\n\t\t\t\tformControlSizeClasses[size],\n\t\t\t\tfullWidth ? 'w-full' : 'w-fit self-start',\n\t\t\t\t// The group is the field frame: validation marks it once, and the\n\t\t\t\t// focused pill draws the inset focus recipe inside it.\n\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t// A disabled group dims once; its pills do not dim again.\n\t\t\t\tdisabled && 'pointer-events-none opacity-50',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{options.map((option, index) => {\n\t\t\t\tconst isSelected = option.value === value;\n\t\t\t\tconst Icon = option.icon;\n\t\t\t\tconst optionLabel =\n\t\t\t\t\ttypeof option.label === 'string' ? option.label : undefined;\n\t\t\t\treturn (\n\t\t\t\t\t<button\n\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\tref={(node) => { buttonRefs.current[index] = node; }}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\trole=\"radio\"\n\t\t\t\t\t\taria-checked={isSelected}\n\t\t\t\t\t\taria-label={optionLabel || option.value}\n\t\t\t\t\t\tdisabled={disabled || option.disabled}\n\t\t\t\t\t\ttabIndex={index === tabStopIndex ? 0 : -1}\n\t\t\t\t\t\tonClick={() => handleClick(option.value)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'box-border inline-flex select-none items-center justify-center border-0 p-0 font-sans font-medium transition-colors',\n\t\t\t\t\t\t\t// Inset, so the frame's clipped rounded corners never cut the ring.\n\t\t\t\t\t\t\t`outline-none focus-visible:z-10 ${focusRecipes.inset}`,\n\t\t\t\t\t\t\t'disabled:pointer-events-none',\n\t\t\t\t\t\t\t!disabled && 'disabled:opacity-50',\n\t\t\t\t\t\t\tchoicePillSizeTokens[size],\n\t\t\t\t\t\t\t'h-full min-h-0',\n\t\t\t\t\t\t\tfullWidth && 'flex-1',\n\t\t\t\t\t\t\tindex > 0 && 'border-input border-s',\n\t\t\t\t\t\t\tisSelected\n\t\t\t\t\t\t\t\t? 'bg-primary text-primary-foreground focus-visible:inset-ring-primary-foreground focus-visible:ring-primary-foreground/50'\n\t\t\t\t\t\t\t\t: 'bg-background text-foreground hover:bg-muted',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{!!Icon && <Icon className={cn(size === 'sm' ? 'size-icon-sm' : 'size-icon', option.label && 'me-space-sm')} />}\n\t\t\t\t\t\t{typeof option.label === 'string' || typeof option.label === 'number' || typeof option.label === 'bigint' ? (\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : option.label}\n\t\t\t\t\t</button>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n});\n\nPillRadioGroup.displayName = 'PillRadioGroup';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAMA,KAASC,EAAgB;AAE/B,SAAS0D,EAAY,EAAE,cAAW,GAAGC,KAAsC;CACzE,OACE,kBAAC3D,EAAgB,OAAjB;EACE,aAAU;EACV,WAAW+B,EAAG,eAAe6B,CAAS;EACtC,GAAID;CACL,CAAA;AAEL;AAEA,SAASE,GAAY,EAAE,cAAW,GAAGF,KAAsC;CACzE,OACE,kBAAC3D,EAAgB,OAAjB;EACE,aAAU;EACV,WAAW+B,EAAG,0BAA0B6B,CAAS;EACjD,GAAID;CACL,CAAA;AAEL;AAEA,SAASG,GAAc,EACrB,cACA,UAAO,WACP,kBACA,aACA,GAAGH,KAKF;CACD,OACE,kBAAC3D,EAAgB,SAAjB;EACE,aAAU;EACV,aAAW+D;EACX,WAAWhC,EACT,sPACA,sGACAgB,EAAkB,OAClBA,EAAkB,SAClB,6GACA,gPACAa,CACF;EACA,GAAID;EAZN,UAAA,CAcGK,GACD,kBAAChE,EAAgB,MAAjB,EACE,QACE,kBAACiE,GAAD;GAAiB,eAAY;GAAO,WAAWlC,EAAG,sDAAsDiB,EAAoB,KAAKe,MAAS,OAAO,OAAO,OAAOG,CAAa;EAAI,CAAA,EAEnL,CAAA,CACsB;;AAE7B;AAEA,SAASC,GAAc,EACrB,cACA,cACA,aACA,UAAO,UACP,gBAAa,GACb,WAAQ,UACR,iBAAc,GACd,0BAAuB,IACvB,oBAAiB9B,GACjB,GAAGsB,KAKuC;CAC1C,IAAMS,IAAoBC,EAAwBC,CAAS;CAC3D,OACE,kBAACtE,EAAgB,QAAjB;EAAwB,WAAWoE;EACjC,UAAA,kBAACpE,EAAgB,YAAjB;GACkB;GACV;GACM;GACL;GACM;GACS;GACtB,WAAU;GAEV,UAAA,kBAACA,EAAgB,OAAjB;IACE,aAAU;IACV,sBAAoBuE;IACpB,WAAWxC,EACXO,EAAc,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EAAG,+BACb,8EACAkB,EAAuBc,IACvByK,IAAY,WAAW,oBAGvBzL,EAAkB,SAElB0H,KAAY,kCACZ7G,CACD;EAEC,UAAA4D,EAAQ,KAAK,GAAQ,MAAU;GAC/B,IAAM+E,IAAanG,EAAO,UAAUlB,GAC9B0E,IAAOxD,EAAO,MACdkG,IACL,OAAOlG,EAAO,SAAU,WAAWA,EAAO,QAAQ,KAAA;GACnD,OACC,kBAAC,UAAD;IAEC,MAAM,MAAS;KAAE,EAAW,QAAQ4H,KAASS;IAAM;IACnD,MAAK;IACL,MAAK;IACL,gBAAclC;IACd,cAAYD,KAAelG,EAAO;IAClC,UAAUqE,KAAYrE,EAAO;IAC7B,UAAU4H,MAAUJ,IAAe,IAAI;IACvC,eAAeC,EAAYzH,EAAO,KAAK;IACvC,WAAWrE,EACV,uHAEA,mCAAmCK,EAAa,SAChD,gCACA,CAACqI,KAAY,uBACbpB,GAAqBtF,IACrB,kBACAyK,KAAa,UACbR,IAAQ,KAAK,yBACbzB,IACG,4HACA,8CACJ;IAvBD,UAAA,CAyBE,CAAC,CAAC3C,KAAQ,kBAACA,GAAD,EAAM,WAAW7H,EAAGgC,MAAS,OAAO,iBAAiB,aAAaqC,EAAO,SAAS,aAAa,EAAI,CAAA,GAC7G,OAAOA,EAAO,SAAU,YAAY,OAAOA,EAAO,SAAU,YAAY,OAAOA,EAAO,SAAU,WAChG,kBAACnE,GAAD;KAAM,KAAI;KAAO,MAAK;KAAU,QAAO;KAAS,YAAW;KAAQ,WAAU;KAC3E,UAAAmE,EAAO;IACH,CAAA,IACHA,EAAO,KACJ;GA9BF,GAAAA,EAAO,KA8BL;EAEV,CAAC;CACG,CAAA;AAEP,CAAC;AAED,GAAe,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"combobox-C0EQW6dr.js","names":["_Fragment","_Fragment","React","ComboboxPrimitive","Combobox","BaseCombobox","Combobox","useDensityConfig","resolveComponentScale","cn","Button","Text","Stack","markRecipes","ErrorState","layerRecipes","fieldAffordanceRecipes","selectToggleRecipes","ComboboxStatus","ComboboxPositioner","ComboboxGroup","ComboboxItem","ComboboxList","ComboboxEmpty","ComboboxCollection","ComboboxChipsInput","ComboboxPopup","ComboboxChips","ComboboxChip","Combobox$2","ComboboxGroupLabel","ComboboxPortal","formControlMinHeightClasses","formControlPaddingClasses","Input","ScrollArea","useDebouncedCallback","React$1","Fragment$1","defaultComboboxStrings","itemLabel","CREATE_OPTION_SYMBOL","isCreateOption","item","getCreateOptionValue","createCreateOption","inputValue","LoadingMore","loading","className","Loader2","text","StatusText","StatusContent","trimmed","searchValue","strings","minSearchLength","remaining","primitiveSizeByComboboxSize","emptyClassByComboboxSize","ComboboxDropdown","positionerClassName","portalContainer","primitiveSize","size","showStatus","showEmpty","items","loadingMore","applyFooter","content","listRef","groupedItems","group","groupItems","groupLabel","renderGroupLabel","DisplayLabel","getItemDisabled","renderItemContent","getItemReactKey","createOptionItem","ErrorMessage","_size","error","escapeRegExp","str","HighlightedText","highlight","regex","parts","cursor","isMatch","index","key","part","highlightClassName","useDebouncedSearch","emitSearch","value","debounceMs","useGroupedItems","useMemo","getItemGroup","groups","groupKey","existing","useLoadMore","isLoadingRef","useRef","cooldownRef","requestLoadMore","onLoadMore","useEffect","useCallback","hasMore","event","scrollTop","clientHeight","scrollHeight","useComboboxStrings","useStrings","custom","hasExactMatch","normalizedSearch","getItemLabel","useComboboxCore","stringsProp","getKey","getItemKey","trimmedSearch","showListContent","listEl","handleScroll","baseItems","ensuredItems","merged","itemKey","ensured","showCreateOption","creatable","onCreate","PlusIcon","renderItem","label","highlightMatch","resolveComboboxSize","sizeProp","defaultScale","primitiveComboboxSizeBySize","getComboboxFormSize","ComboboxInputField","Combobox","clearable","required","clearLabel","XIcon","toggleLabel","ChevronDownIcon","Combobox$1","formSize","hasError","invalid","core","selectedValue","isOpen","setIsOpen","useState","handleOpenChange","nextOpen","clearSearchOnClose","onSearchValueChange","onOpenChange","displayInputValue","handleValueChange","onSelectedValueChange","details","reason","MultiCombobox","primitiveComboboxSize","containerRef","draftValues","setDraftValues","selectedValues","internalOpen","setInternalOpen","isOpenControlled","open","resolvedOpen","applyButton","setOpen","next","regularValues","createValue","values","onSelectedValuesChange","closeOnSelect","handleApply","onApply","handleCancel","onCancel","visibleValues","chipsPlaceholder","defaultAsyncResourceComboboxStrings","isSimpleText","AsyncResourceCombobox","props","isControlled","internalValue","setInternalValue","defaultValue","setSearchValue","setItems","isLoading","setIsLoading","fetchError","setFetchError","retryCount","setRetryCount","requestIdRef","nextValue","onValueChange","runFetch","fetcher","context","requestId","nextItems","onAfterFetch","nextError","onError","disabled","preload","controller","limit","retry","count","renderOption","description","getDescription","meta","getMeta","getLabel","resolvedError","errorMessage","hasFetchError","errorNode","renderError"],"sources":["../src/components/features/combobox/combobox.strings.ts","../src/components/features/combobox/constants.ts","../src/components/features/combobox/components/loading-more.tsx","../src/components/features/combobox/components/status-content.tsx","../src/components/features/combobox/components/combobox-dropdown.tsx","../src/components/features/combobox/components/error-message.tsx","../src/components/features/combobox/components/highlighted-text.tsx","../src/components/features/combobox/hooks/use-debounced-search.ts","../src/components/features/combobox/hooks/use-grouped-items.ts","../src/components/features/combobox/hooks/use-load-more.ts","../src/components/features/combobox/hooks/use-combobox-core.tsx","../src/components/features/combobox/combobox.tsx","../src/components/features/combobox/async-resource-combobox.tsx"],"sourcesContent":["/**\n * Default user-facing strings for `<Combobox>`.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <Combobox strings={{ noResults: t('search.empty') }} … />\n *\n * Templates use `{placeholder}` tokens — the component substitutes them at\n * render time. Function-valued strings would also work; we keep templates\n * here for the constants file.\n */\nimport type { ComboboxStrings } from './types';\n\nexport const defaultComboboxStrings = {\n\tplaceholder: 'Search...',\n\tclear: 'Clear selection',\n\ttoggle: 'Open options',\n\tdismiss: 'Dismiss',\n\tremoveSelection: (itemLabel: string) => `Remove ${itemLabel}`,\n\tsearching: 'Loading...',\n\tnoResults: 'No results found.',\n\ttypeToSearch: 'Type at least {min} characters to search...',\n\ttypeMore: 'Type {remaining} more character{s} to search...',\n\tcreateNew: 'Create {value}',\n\tloadingMore: 'Loading...',\n\tapply: 'Apply',\n\tcancel: 'Cancel',\n} satisfies ComboboxStrings;\n\nexport type { ComboboxStrings };\n","/**\n * Constants and default values for the Combobox component.\n *\n * Default strings live in `./combobox.strings.ts` per rule 19.\n */\n\nexport { defaultComboboxStrings } from './combobox.strings';\n\n// ============================================================================\n// Default Values\n// ============================================================================\n\nexport const DEFAULT_MIN_SEARCH_LENGTH = 3;\n/** Re-exported so the combobox shares the library-wide debounce window. */\nexport { DEFAULT_DEBOUNCE_MS } from '../../../hooks/use-debounced-callback';\nexport const DEFAULT_SIZE = 'md';\nexport const LOAD_MORE_THRESHOLD = 0.8;\nexport const LOAD_MORE_DEBOUNCE_MS = 100;\nexport const LOAD_MORE_COOLDOWN_MS = 500;\n\n// ============================================================================\n// Symbols\n// ============================================================================\n\nexport const CREATE_OPTION_SYMBOL = Symbol('combobox-create-option');\n\n// ============================================================================\n// Type Guards\n// ============================================================================\n\nexport function isCreateOption<T>(item: T): item is T & { [CREATE_OPTION_SYMBOL]: string } {\n\treturn (\n\t\ttypeof item === 'object' &&\n\t\titem !== null &&\n\t\tCREATE_OPTION_SYMBOL in (item as object)\n\t);\n}\n\nexport function getCreateOptionValue<T>(item: T): string {\n\tif (!isCreateOption(item)) {\n\t\tthrow new Error('Item is not a create option');\n\t}\n\treturn (item as { [CREATE_OPTION_SYMBOL]: string })[CREATE_OPTION_SYMBOL];\n}\n\nexport function createCreateOption<T>(inputValue: string): T {\n\treturn { [CREATE_OPTION_SYMBOL]: inputValue } as unknown as T;\n}\n","/**\n * LoadingMore Component\n */\n\nimport { Loader2 } from 'lucide-react';\nimport * as React from 'react';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nexport interface LoadingMoreProps {\n\t/** Shows the pending indicator. */\n\tloading: boolean;\n\t/** Visible label. */\n\ttext: string;\n\tclassName?: string;\n}\n\nexport function LoadingMore({\n\tloading,\n\ttext,\n\tclassName,\n}: LoadingMoreProps): React.ReactElement | null {\n\tif (!loading) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tjustify=\"center\"\n\t\t\twrap={false}\n\t\t\tclassName={cn('loading-more--component', \n\t\t\t\t'px-control py-space-xs text-xs text-muted-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\trole=\"status\"\n\t\t\taria-live=\"polite\"\n\t\t>\n\t\t\t<Loader2 className=\"size-icon-sm animate-spin\" aria-hidden=\"true\" />\n\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"text-inherit\">\n\t\t\t\t{text}\n\t\t\t</Text>\n\t\t</Stack>\n\t);\n}\n\nLoadingMore.displayName = 'LoadingMore';\n","/**\n * StatusContent Component\n */\n\nimport { Loader2 } from 'lucide-react';\nimport * as React from 'react';\nimport { Text } from '../../../typography';\nimport type { ComboboxStrings } from '../types';\n\nfunction StatusText({ children }: { children: string }) {\n\treturn (\n\t\t<Text tag=\"span\" size=\"inherit\" type=\"secondary\" className=\"text-inherit\">\n\t\t\t{children}\n\t\t</Text>\n\t);\n}\n\nexport interface StatusContentProps {\n\t/** Whether results are being fetched. */\n\tloading?: boolean;\n\t/** Current search text. */\n\tsearchValue: string;\n\t/** Characters required before the list becomes active. */\n\tminSearchLength: number;\n\t/** How many options matched, deciding between the empty and results copy. */\n\titemCount: number;\n\t/** Resolved copy for the status rows. */\n\tstrings: ComboboxStrings;\n}\n\nexport function StatusContent({\n\tloading,\n\tsearchValue,\n\tminSearchLength,\n\titemCount,\n\tstrings,\n}: StatusContentProps): React.ReactNode {\n\tconst trimmed = searchValue.trim();\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Loader2 className=\"size-icon-sm animate-spin\" />\n\t\t\t\t<StatusText>{strings.searching}</StatusText>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif (trimmed === '') {\n\t\tif (strings.typeToSearch.includes('{min}')) {\n\t\t\treturn (\n\t\t\t\t<StatusText>\n\t\t\t\t\t{strings.typeToSearch.replace('{min}', String(minSearchLength))}\n\t\t\t\t</StatusText>\n\t\t\t);\n\t\t}\n\t\treturn <StatusText>{strings.typeToSearch}</StatusText>;\n\t}\n\n\tif (trimmed.length < minSearchLength) {\n\t\tconst remaining = minSearchLength - trimmed.length;\n\t\tif (strings.typeMore.includes('{remaining}') || strings.typeMore.includes('{s}')) {\n\t\t\treturn (\n\t\t\t\t<StatusText>\n\t\t\t\t\t{strings.typeMore\n\t\t\t\t\t\t.replace('{remaining}', String(remaining))\n\t\t\t\t\t\t.replace('{s}', remaining !== 1 ? 's' : '')}\n\t\t\t\t</StatusText>\n\t\t\t);\n\t\t}\n\t\treturn <StatusText>{strings.typeMore}</StatusText>;\n\t}\n\n\tif (itemCount === 0) {\n\t\treturn null;\n\t}\n\n\treturn null;\n}\n\nStatusContent.displayName = 'StatusContent';\n","/**\n * Shared ComboboxDropdown Component\n *\n * Renders the dropdown content for both single and multiple selection variants.\n * Extracts shared rendering logic to reduce duplication.\n */\n\nimport * as React from 'react';\n\nimport {\n\tComboboxPortal,\n\tComboboxPositioner,\n\tComboboxPopup,\n\tComboboxEmpty,\n\tComboboxList,\n\tComboboxItem,\n\tComboboxStatus,\n\tComboboxGroup,\n\tComboboxGroupLabel,\n\tComboboxCollection,\n} from '../../../base/combobox';\nimport { Button } from '../../../base/buttons';\nimport { ScrollArea } from '../../../base/display/scroll-area';\nimport { Stack } from '../../../base/structure';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport { DEFAULT_SIZE } from '../constants';\nimport type { ComboboxStrings, ComboboxSize } from '../types';\nimport { LoadingMore } from './loading-more';\nimport { StatusContent } from './status-content';\nimport { layerRecipes } from '../../../../lib/layer-recipes';\n\nconst primitiveSizeByComboboxSize: Record<ComboboxSize, 'sm' | 'md' | 'lg'> = {\n\tsm: 'sm',\n\tmd: 'md',\n\tlg: 'lg',\n};\n\nconst emptyClassByComboboxSize: Record<ComboboxSize, string> = {\n\tsm: 'flex min-h-control-sm items-center justify-center px-row-x py-row-y text-center text-pxs leading-tight text-muted-foreground',\n\tmd: 'flex min-h-control items-center justify-center px-row-x py-row-y text-center text-sm leading-tight text-muted-foreground',\n\tlg: 'flex min-h-control-lg items-center justify-center px-row-x py-row-y-lg text-center text-sm leading-tight text-muted-foreground',\n};\n\nexport interface ComboboxDropdownProps<T> {\n\t// Display state\n\t/** Whether results are being fetched. */\n\tloading: boolean;\n\t/** Whether the status row replaces the list — while loading, or below `minSearchLength`. */\n\tshowStatus: boolean;\n\t/** Whether the no-results row shows. */\n\tshowEmpty: boolean;\n\n\t// Search\n\t/** Current search text, used to highlight matches. */\n\tsearchValue: string;\n\t/** Characters required before the list becomes active. */\n\tminSearchLength: number;\n\n\t// Items\n\t/** Options to render, including the create row when offered. */\n\titems: T[];\n\t/** Options bucketed by group name, or `null` when grouping is off. */\n\tgroupedItems: Map<string, T[]> | null;\n\t/** The synthetic create row, or `null` when it is not offered. */\n\tcreateOptionItem: T | null;\n\n\t// Rendering\n\t/** Renders one option's content. */\n\trenderItemContent: (item: T) => React.ReactNode;\n\t/** Returns the React key for an option. */\n\tgetItemReactKey: (item: T) => string;\n\t/** Marks individual options unselectable while still rendering them. */\n\tgetItemDisabled?: (item: T) => boolean;\n\t/** Renders a group heading. */\n\trenderGroupLabel?: (group: string) => React.ReactNode;\n\n\t// Load more\n\t/** Whether the next page is being fetched. */\n\tloadingMore?: boolean;\n\n\t// Strings\n\t/** Resolved copy for the status, empty, and create rows. */\n\tstrings: ComboboxStrings;\n\n\t// Size\n\t/** Row density, matching the trigger's size. */\n\tsize?: ComboboxSize;\n\n\t// Portal\n\t/** Mounts the dropdown inside this element instead of the default portal root. */\n\tportalContainer?: React.RefObject<HTMLElement | null>;\n\n\t// Refs\n\t/** Ref to the scrollable list, used for scroll-triggered pagination. */\n\tlistRef: React.RefObject<HTMLDivElement | null>;\n\n\t// Multiple selection anchor\n\t/** Element the dropdown positions against. */\n\tanchor?: React.RefObject<HTMLElement | null>;\n\n\t/** Optional apply / cancel footer for the apply-button workflow. */\n\tapplyFooter?: {\n\t\tapplyLabel: string;\n\t\tcancelLabel: string;\n\t\tonApply: () => void;\n\t\tonCancel: () => void;\n\t};\n}\n\nexport function ComboboxDropdown<T>({\n\tloading,\n\tshowStatus,\n\tshowEmpty,\n\tsearchValue,\n\tminSearchLength,\n\titems,\n\tgroupedItems,\n\tcreateOptionItem,\n\trenderItemContent,\n\tgetItemReactKey,\n\tgetItemDisabled,\n\trenderGroupLabel,\n\tloadingMore,\n\tstrings,\n\tsize = DEFAULT_SIZE,\n\tportalContainer,\n\tlistRef,\n\tanchor,\n\tapplyFooter,\n}: ComboboxDropdownProps<T>): React.ReactElement | null {\n\tconst positionerClassName = portalContainer != null ? layerRecipes.nestedOverlay : undefined;\n\tconst primitiveSize = primitiveSizeByComboboxSize[size];\n\tconst hasPopupContent =\n\t\tshowStatus ||\n\t\tshowEmpty ||\n\t\titems.length > 0 ||\n\t\tBoolean(loadingMore) ||\n\t\tBoolean(applyFooter);\n\t// An exclusive inline error has no dropdown rows. Mounting a zero-height\n\t// popup still starts Base UI focus management and hides its Retry sibling.\n\tif (!hasPopupContent) return null;\n\n\tconst content = (\n\t\t<ComboboxPositioner\n\t\t\tanchor={anchor}\n\t\t\tclassName={positionerClassName}\n\t\t>\n\t\t\t<ComboboxPopup\n\t\t\t\taria-busy={loading || undefined}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'combobox-dropdown--popup',\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{/* Status message */}\n\t\t\t\t{!!showStatus && (\n\t\t\t\t\t<ComboboxStatus className=\"gap-space-sm px-control py-space-xs text-xs text-muted-foreground\">\n\t\t\t\t\t\t<StatusContent\n\t\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\t\tsearchValue={searchValue}\n\t\t\t\t\t\t\tminSearchLength={minSearchLength}\n\t\t\t\t\t\t\titemCount={items.length}\n\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ComboboxStatus>\n\t\t\t\t)}\n\n\t\t\t\t{/* Empty state */}\n\t\t\t\t{!!showEmpty && (\n\t\t\t\t\t<ComboboxEmpty className={emptyClassByComboboxSize[size]}>\n\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" type=\"secondary\" className=\"text-inherit\">\n\t\t\t\t\t\t\t{strings.noResults}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</ComboboxEmpty>\n\t\t\t\t)}\n\n\t\t\t\t{/* Items list */}\n\t\t\t\t<ScrollArea\n\t\t\t\t\tviewportRef={listRef}\n\t\t\t\t\tclassName=\"max-h-[min(20rem,var(--available-height))]\"\n\t\t\t\t>\n\t\t\t\t\t<ComboboxList className=\"combobox-dropdown--list max-h-none overflow-visible\">\n\t\t\t\t\t\t{groupedItems ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{Array.from(groupedItems.entries()).map(([group, groupItems]) => {\n\t\t\t\t\t\t\t\t\tconst groupLabel =\n\t\t\t\t\t\t\t\t\t\ttypeof renderGroupLabel === 'function'\n\t\t\t\t\t\t\t\t\t\t\t? renderGroupLabel(group)\n\t\t\t\t\t\t\t\t\t\t\t: group;\n\t\t\t\t\t\t\t\t\tconst groupLabelContent =\n\t\t\t\t\t\t\t\t\t\ttypeof groupLabel === 'string' || typeof groupLabel === 'number' || typeof groupLabel === 'bigint'\n\t\t\t\t\t\t\t\t\t\t\t? <DisplayLabel>{groupLabel}</DisplayLabel>\n\t\t\t\t\t\t\t\t\t\t\t: groupLabel;\n\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ComboboxGroup className=\"combobox-dropdown--group p-0\" key={group} items={groupItems}>\n\t\t\t\t\t\t\t\t\t\t\t<ComboboxGroupLabel>{groupLabelContent}</ComboboxGroupLabel>\n\t\t\t\t\t\t\t\t\t\t\t<ComboboxCollection>\n\t\t\t\t\t\t\t\t\t\t\t\t{(item: T) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ComboboxItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={getItemReactKey(item)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={item}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize={primitiveSize}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={getItemDisabled?.(item)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{renderItemContent(item)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ComboboxItem>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t</ComboboxCollection>\n\t\t\t\t\t\t\t\t\t\t</ComboboxGroup>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})}\n\n\t\t\t\t\t\t\t\t{createOptionItem != null && (\n\t\t\t\t\t\t\t\t\t<ComboboxItem\n\t\t\t\t\t\t\t\t\t\tkey={getItemReactKey(createOptionItem)}\n\t\t\t\t\t\t\t\t\t\tvalue={createOptionItem}\n\t\t\t\t\t\t\t\t\t\tsize={primitiveSize}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{renderItemContent(createOptionItem)}\n\t\t\t\t\t\t\t\t\t</ComboboxItem>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ComboboxCollection>\n\t\t\t\t\t\t\t\t{(item: T) => (\n\t\t\t\t\t\t\t\t\t<ComboboxItem\n\t\t\t\t\t\t\t\t\t\tkey={getItemReactKey(item)}\n\t\t\t\t\t\t\t\t\t\tvalue={item}\n\t\t\t\t\t\t\t\t\t\tsize={primitiveSize}\n\t\t\t\t\t\t\t\t\t\tdisabled={getItemDisabled?.(item)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{renderItemContent(item)}\n\t\t\t\t\t\t\t\t\t</ComboboxItem>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</ComboboxCollection>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ComboboxList>\n\t\t\t\t</ScrollArea>\n\n\t\t\t\t{/* Loading more indicator */}\n\t\t\t\t<LoadingMore\n\t\t\t\t\tloading={!!loadingMore}\n\t\t\t\t\ttext={strings.loadingMore}\n\t\t\t\t/>\n\n\t\t\t\t{/* Apply / cancel footer (multi-select with applyButton). */}\n\t\t\t\t{!!applyFooter && (\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" justify=\"end\" wrap={false} className=\"border-t border-border/60 px-control py-space-xs\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\tapplyFooter.onCancel();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{applyFooter.cancelLabel}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\tapplyFooter.onApply();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{applyFooter.applyLabel}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\t\t\t</ComboboxPopup>\n\t\t</ComboboxPositioner>\n\t);\n\n\tif (portalContainer) {\n\t\treturn <ComboboxPortal container={portalContainer}>{content}</ComboboxPortal>;\n\t}\n\n\treturn <ComboboxPortal>{content}</ComboboxPortal>;\n}\n\nComboboxDropdown.displayName = 'ComboboxDropdown';\n","/**\n * ErrorMessage Component\n */\n\nimport * as React from 'react';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\nimport type { ComboboxSize } from '../types';\n\nexport interface ErrorMessageProps {\n\terror?: string;\n\t/** Size preset. */\n\tsize: ComboboxSize;\n\tclassName?: string;\n}\n\nexport function ErrorMessage({\n\terror,\n\tsize: _size,\n\tclassName,\n}: ErrorMessageProps): React.ReactElement | null {\n\tif (!error) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t// `xs` at every control size, matching `FormField` and the date pickers.\n\t\t// Leaving the default size unpinned resolved to `sm`, which made the\n\t\t// combobox the one control whose error text grew as the control grew.\n\t\t<Text\n\t\t\ttag=\"p\"\n\t\t\tsize=\"xs\"\n\t\t\ttype=\"error\"\n\t\t\tclassName={cn('error-message--component', className)}\n\t\t\trole=\"alert\"\n\t\t\taria-live=\"polite\"\n\t\t>\n\t\t\t{error}\n\t\t</Text>\n\t);\n}\n\nErrorMessage.displayName = 'ErrorMessage';\n","/**\n * HighlightedText Component\n */\n\nimport * as React from 'react';\nimport { Text } from '../../../typography';\nimport { markRecipes } from '../../../../lib/tone-recipes';\n\nexport interface HighlightedTextProps {\n\t/** Visible label. */\n\ttext: string;\n\thighlight: string;\n\thighlightClassName?: string;\n}\n\nfunction escapeRegExp(str: string): string {\n\treturn str.replace(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&');\n}\n\nexport function HighlightedText({\n\ttext,\n\thighlight,\n\thighlightClassName = markRecipes.match,\n}: HighlightedTextProps): React.ReactNode {\n\tif (!highlight.trim()) {\n\t\treturn (\n\t\t\t<Text tag=\"span\" size=\"inherit\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t{text}\n\t\t\t</Text>\n\t\t);\n\t}\n\n\tconst regex = new RegExp(`(${escapeRegExp(highlight)})`, 'gi');\n\tconst parts = text.split(regex);\n\tlet cursor = 0;\n\n\treturn (\n\t\t<Text tag=\"span\" size=\"inherit\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t{parts.map((part, index) => {\n\t\t\t\tconst isMatch = index % 2 === 1;\n\t\t\t\tconst key = String(cursor);\n\t\t\t\tcursor += part.length;\n\n\t\t\t\tif (isMatch) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<mark key={key} className={highlightClassName}>\n\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t</mark>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn <React.Fragment key={key}>{part}</React.Fragment>;\n\t\t\t})}\n\t\t</Text>\n\t);\n}\n\nHighlightedText.displayName = 'HighlightedText';\n","/**\n * Hook for debounced search functionality\n */\n\nimport { useEffect } from 'react';\nimport { useDebouncedCallback } from '../../../../hooks/use-debounced-callback';\nimport { DEFAULT_DEBOUNCE_MS, DEFAULT_MIN_SEARCH_LENGTH } from '../constants';\n\nexport interface UseDebouncedSearchOptions {\n\tsearchValue: string;\n\tonSearch: ((value: string) => void) | undefined;\n\tdebounceMs?: number;\n\tminSearchLength?: number;\n}\n\nexport function useDebouncedSearch({\n\tsearchValue,\n\tonSearch,\n\tdebounceMs = DEFAULT_DEBOUNCE_MS,\n\tminSearchLength = DEFAULT_MIN_SEARCH_LENGTH,\n}: UseDebouncedSearchOptions): void {\n\t// `useDebouncedCallback` holds `onSearch` in a ref, so `emitSearch` keeps a\n\t// stable identity even though consumers pass a new inline callback every\n\t// render. Depending on the raw `onSearch` here re-ran the effect on every\n\t// render and — when it triggered a state update — caused an infinite fetch\n\t// loop.\n\tconst emitSearch = useDebouncedCallback((value: string) => {\n\t\tonSearch?.(value);\n\t}, debounceMs);\n\n\tuseEffect(() => {\n\t\tconst trimmed = searchValue.trim();\n\t\tif (trimmed.length < minSearchLength) return;\n\n\t\temitSearch(trimmed);\n\t\treturn emitSearch.cancel;\n\t}, [searchValue, minSearchLength, emitSearch]);\n}\n","/**\n * Hook for grouping items by category\n */\n\nimport { useMemo } from 'react';\n\nexport interface UseGroupedItemsOptions<T> {\n\titems: T[];\n\tgetItemGroup: ((item: T) => string) | undefined;\n}\n\nexport type GroupedItemsResult<T> = Map<string, T[]> | null;\n\nexport function useGroupedItems<T>({\n\titems,\n\tgetItemGroup,\n}: UseGroupedItemsOptions<T>): GroupedItemsResult<T> {\n\treturn useMemo(() => {\n\t\tif (!getItemGroup) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst groups = new Map<string, T[]>();\n\n\t\tfor (const item of items) {\n\t\t\tconst groupKey = getItemGroup(item);\n\t\t\tconst existing = groups.get(groupKey);\n\n\t\t\tif (existing) {\n\t\t\t\texisting.push(item);\n\t\t\t} else {\n\t\t\t\tgroups.set(groupKey, [item]);\n\t\t\t}\n\t\t}\n\n\t\treturn groups;\n\t}, [items, getItemGroup]);\n}\n","/**\n * Hook for infinite scroll / load more functionality\n */\n\nimport { useCallback, useEffect, useRef } from 'react';\nimport { useDebouncedCallback } from '../../../../hooks/use-debounced-callback';\nimport {\n\tLOAD_MORE_THRESHOLD,\n\tLOAD_MORE_DEBOUNCE_MS,\n\tLOAD_MORE_COOLDOWN_MS,\n} from '../constants';\n\nexport interface UseLoadMoreOptions {\n\thasMore: boolean | undefined;\n\tonLoadMore: (() => void) | undefined;\n\tloadingMore: boolean | undefined;\n}\n\nexport interface UseLoadMoreReturn {\n\thandleScroll: (event: Event) => void;\n}\n\nexport function useLoadMore({\n\thasMore,\n\tonLoadMore,\n\tloadingMore,\n}: UseLoadMoreOptions): UseLoadMoreReturn {\n\tconst isLoadingRef = useRef(false);\n\tconst cooldownRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n\tconst requestLoadMore = useDebouncedCallback(() => {\n\t\tisLoadingRef.current = true;\n\t\tonLoadMore?.();\n\n\t\t// Cooldown, not a debounce: it keeps a second page from being requested\n\t\t// while the first is still in flight.\n\t\tif (cooldownRef.current) clearTimeout(cooldownRef.current);\n\t\tcooldownRef.current = setTimeout(() => {\n\t\t\tisLoadingRef.current = false;\n\t\t\tcooldownRef.current = null;\n\t\t}, LOAD_MORE_COOLDOWN_MS);\n\t}, LOAD_MORE_DEBOUNCE_MS);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (cooldownRef.current) clearTimeout(cooldownRef.current);\n\t\t};\n\t}, []);\n\n\tconst handleScroll = useCallback(\n\t\t(event: Event) => {\n\t\t\tif (!hasMore || !onLoadMore || loadingMore || isLoadingRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst target = event.target as HTMLElement;\n\t\t\tconst { scrollHeight, scrollTop, clientHeight } = target;\n\t\t\tconst scrollPercentage = (scrollTop + clientHeight) / scrollHeight;\n\n\t\t\tif (scrollPercentage >= LOAD_MORE_THRESHOLD) {\n\t\t\t\trequestLoadMore();\n\t\t\t}\n\t\t},\n\t\t[hasMore, onLoadMore, loadingMore, requestLoadMore]\n\t);\n\n\treturn { handleScroll };\n}\n","/**\n * Headless state and rendering contract shared by the canonical comboboxes.\n *\n * Extracts shared logic between single and multiple selection variants\n * to reduce duplication and ensure consistent behavior.\n */\n\nimport { PlusIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { useRef, useMemo, useEffect, useCallback } from 'react';\nimport { Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\n\nimport { HighlightedText } from '../components/highlighted-text';\nimport { defaultComboboxStrings } from '../combobox.strings';\nimport {\n\tDEFAULT_MIN_SEARCH_LENGTH,\n\tDEFAULT_DEBOUNCE_MS,\n\tisCreateOption,\n\tgetCreateOptionValue,\n\tcreateCreateOption,\n} from '../constants';\nimport type { ComboboxStrings, ComboboxSharedProps } from '../types';\nimport { useDebouncedSearch } from './use-debounced-search';\nimport { useGroupedItems } from './use-grouped-items';\nimport { useLoadMore } from './use-load-more';\n\nimport { cn } from '../../../../lib/utils';\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface UseComboboxCoreOptions<T> extends ComboboxSharedProps<T> {\n\t/** Items that should always be included (selected items) */\n\tensuredItems?: T[];\n}\n\nexport interface UseComboboxCoreReturn<T> {\n\t// Resolved values\n\tstrings: ComboboxStrings;\n\tgetKey: (item: T) => string;\n\ttrimmedSearch: string;\n\n\t// Refs\n\tlistRef: React.RefObject<HTMLDivElement | null>;\n\n\t// Items\n\tbaseItems: T[];\n\tallItems: T[];\n\tgroupedItems: Map<string, T[]> | null;\n\tcreateOptionItem: T | null;\n\n\t// Display state\n\tshowStatus: boolean;\n\tshowEmpty: boolean;\n\tshowCreateOption: boolean;\n\n\t// Handlers\n\trenderItemContent: (item: T) => React.ReactNode;\n\titemToStringLabel: (item: T) => string;\n\tgetItemReactKey: (item: T) => string;\n\n\t// Scroll handling\n\thandleScroll: (event: Event) => void;\n}\n\n// ============================================================================\n// Hook Implementation\n// ============================================================================\n\nfunction useComboboxStrings(custom?: StringsProp<ComboboxStrings>): ComboboxStrings {\n\treturn useStrings(defaultComboboxStrings, custom);\n}\n\nfunction hasExactMatch<T>(\n\titems: T[],\n\tsearchValue: string,\n\tgetItemLabel: (item: T) => string\n): boolean {\n\tconst normalizedSearch = searchValue.toLowerCase();\n\treturn items.some(\n\t\t(item) => getItemLabel(item).toLowerCase() === normalizedSearch\n\t);\n}\n\nexport function useComboboxCore<T>({\n\t// Core props\n\titems,\n\tsearchValue,\n\tgetItemLabel,\n\tgetItemKey,\n\tloading = false,\n\tshowListContent = true,\n\tminSearchLength = DEFAULT_MIN_SEARCH_LENGTH,\n\tstrings: stringsProp,\n\trenderItem,\n\n\t// Debounced Search\n\tonSearch,\n\tdebounceMs = DEFAULT_DEBOUNCE_MS,\n\n\t// Creatable\n\tcreatable,\n\tonCreate,\n\n\t// Grouped Items\n\tgetItemGroup,\n\n\t// Load More\n\thasMore,\n\tonLoadMore,\n\tloadingMore,\n\n\t// Highlight Match\n\thighlightMatch,\n\n\t\t// Ensured items (selected items that should always be included)\n\tensuredItems = [],\n}: UseComboboxCoreOptions<T>): UseComboboxCoreReturn<T> {\n\t// -------------------------------------------------------------------------\n\t// Setup\n\t// -------------------------------------------------------------------------\n\n\tconst strings = useComboboxStrings(stringsProp);\n\tconst getKey = getItemKey ?? getItemLabel;\n\tconst listRef = useRef<HTMLDivElement | null>(null);\n\tconst trimmedSearch = searchValue.trim();\n\tconst showStatus = showListContent && (loading || trimmedSearch.length < minSearchLength);\n\n\t// -------------------------------------------------------------------------\n\t// Hooks\n\t// -------------------------------------------------------------------------\n\n\tuseDebouncedSearch({\n\t\tsearchValue,\n\t\tonSearch,\n\t\tdebounceMs,\n\t\tminSearchLength,\n\t});\n\n\tconst { handleScroll } = useLoadMore({\n\t\thasMore: showListContent && !showStatus ? hasMore : false,\n\t\tonLoadMore,\n\t\tloadingMore,\n\t});\n\n\t// Attach scroll listener\n\tuseEffect(() => {\n\t\tconst listEl = listRef.current;\n\t\tif (!showListContent || showStatus || !listEl || !hasMore || !onLoadMore) return;\n\n\t\tlistEl.addEventListener('scroll', handleScroll);\n\t\treturn () => listEl.removeEventListener('scroll', handleScroll);\n\t}, [handleScroll, hasMore, onLoadMore, showListContent, showStatus]);\n\n\t// -------------------------------------------------------------------------\n\t// Computed Values\n\t// -------------------------------------------------------------------------\n\n\t// Merge ensured items with fetched items\n\tconst baseItems = useMemo(() => {\n\t\tif (!showListContent || showStatus) return [];\n\t\tif (ensuredItems.length === 0) return items;\n\n\t\tconst merged = [...ensuredItems];\n\t\titems.forEach((item) => {\n\t\t\tconst itemKey = getKey(item);\n\t\t\tif (!ensuredItems.some((ensured) => getKey(ensured) === itemKey)) {\n\t\t\t\tmerged.push(item);\n\t\t\t}\n\t\t});\n\t\treturn merged;\n\t}, [items, ensuredItems, getKey, showListContent, showStatus]);\n\n\t// Group items if grouping is enabled\n\tconst groupedItems = useGroupedItems({\n\t\titems: baseItems,\n\t\tgetItemGroup,\n\t});\n\n\t// Determine if create option should be shown\n\tconst showCreateOption = useMemo(() => {\n\t\tif (!showListContent || showStatus) return false;\n\t\tif (!creatable || !onCreate) return false;\n\t\tif (trimmedSearch.length < minSearchLength) return false;\n\t\treturn !hasExactMatch(baseItems, trimmedSearch, getItemLabel);\n\t}, [creatable, onCreate, trimmedSearch, minSearchLength, baseItems, getItemLabel, showListContent, showStatus]);\n\n\tconst createOptionItem = useMemo(() => {\n\t\tif (!showCreateOption) return null;\n\t\treturn createCreateOption<T>(trimmedSearch);\n\t}, [showCreateOption, trimmedSearch]);\n\n\t// Build final items array with create option\n\tconst allItems = useMemo(() => {\n\t\tif (createOptionItem) return [...baseItems, createOptionItem];\n\t\treturn baseItems;\n\t}, [baseItems, createOptionItem]);\n\n\t// Status display conditions\n\tconst showEmpty =\n\t\tshowListContent &&\n\t\t!loading &&\n\t\ttrimmedSearch.length >= minSearchLength &&\n\t\titems.length === 0 &&\n\t\t!showCreateOption;\n\n\t// -------------------------------------------------------------------------\n\t// Handlers\n\t// -------------------------------------------------------------------------\n\n\tconst renderItemContent = useCallback(\n\t\t(item: T): React.ReactNode => {\n\t\t\t// Handle create option\n\t\t\tif (isCreateOption(item)) {\n\t\t\t\tconst value = getCreateOptionValue(item);\n\t\t\t\treturn (\n\t\t\t\t\t<span className={cn('combobox-core--component', 'flex items-center gap-space-sm')}>\n\t\t\t\t\t\t<PlusIcon className=\"size-icon-sm\" />\n\t\t\t\t\t\t{strings.createNew.includes('{value}') ? (\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t\t\t\t{strings.createNew.replace('{value}', value)}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span className=\"inline-flex items-center gap-space-sm\">\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t\t\t\t\t{strings.createNew}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t\t\t\t\t{value}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Custom renderer takes precedence\n\t\t\tif (renderItem) {\n\t\t\t\treturn renderItem(item);\n\t\t\t}\n\n\t\t\t// Default rendering with optional highlighting\n\t\t\tconst label = getItemLabel(item);\n\t\t\tif (highlightMatch && trimmedSearch) {\n\t\t\t\treturn <HighlightedText text={label} highlight={trimmedSearch} />;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t{label}\n\t\t\t\t</Text>\n\t\t\t);\n\t\t},\n\t\t[strings.createNew, renderItem, getItemLabel, highlightMatch, trimmedSearch]\n\t);\n\n\tconst itemToStringLabel = useCallback(\n\t\t(item: T): string => {\n\t\t\tif (isCreateOption(item)) {\n\t\t\t\treturn getCreateOptionValue(item);\n\t\t\t}\n\t\t\treturn getItemLabel(item);\n\t\t},\n\t\t[getItemLabel]\n\t);\n\n\tconst getItemReactKey = useCallback(\n\t\t(item: T): string => {\n\t\t\tif (isCreateOption(item)) return `__create__:${getCreateOptionValue(item)}`;\n\t\t\treturn String(getKey(item));\n\t\t},\n\t\t[getKey]\n\t);\n\n\treturn {\n\t\tstrings,\n\t\tgetKey,\n\t\ttrimmedSearch,\n\t\tlistRef,\n\t\tbaseItems,\n\t\tallItems,\n\t\tgroupedItems,\n\t\tcreateOptionItem,\n\t\tshowStatus,\n\t\tshowEmpty,\n\t\tshowCreateOption,\n\t\trenderItemContent,\n\t\titemToStringLabel,\n\t\tgetItemReactKey,\n\t\thandleScroll,\n\t};\n}\n","import { Stack } from '../../base/structure';\n/**\n * Combobox Components\n *\n * A feature-rich, API-driven combobox built on Base UI with shadcn styling.\n * Supports single and multiple selection, form integration, debounced search,\n * grouping, pagination, and more.\n *\n * This version uses shared hooks and components to eliminate duplication\n * between single and multiple selection variants.\n */\n\nimport * as React from 'react';\nimport { useRef, useCallback, useEffect, useState } from 'react';\nimport { ChevronDownIcon, XIcon } from 'lucide-react';\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';\n\nimport {\n\tComboboxRoot as BaseCombobox,\n\tComboboxChips,\n\tComboboxChip,\n\tComboboxChipsInput,\n} from '../../base/combobox';\nimport { Button } from '../../base/buttons';\nimport { Input } from '../../base/text-inputs';\nimport { Text } from '../../typography';\nimport { useDensityConfig, type FormControlSize } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { cn } from '../../../lib/utils';\nimport { fieldAffordanceRecipes, selectToggleRecipes } from '../../../lib/field-affordance-recipes';\n\nimport { ComboboxDropdown } from './components/combobox-dropdown';\nimport { ErrorMessage } from './components/error-message';\nimport {\n\tformControlMinHeightClasses,\n\tformControlPaddingClasses,\n} from '../../base/forms/form-sizing';\nimport {\n\tDEFAULT_MIN_SEARCH_LENGTH,\n\tDEFAULT_SIZE,\n\tisCreateOption,\n\tgetCreateOptionValue,\n} from './constants';\n\nimport { useComboboxCore } from './hooks/use-combobox-core';\nimport { defaultComboboxStrings } from './combobox.strings';\nimport type {\n\tComboboxProps,\n\tMultiComboboxProps,\n\tComboboxSize,\n} from './types';\n\nfunction resolveComboboxSize(\n\tsizeProp: ComboboxSize | undefined,\n\tdefaultScale: FormControlSize | undefined,\n): ComboboxSize {\n\treturn resolveComponentScale(sizeProp, defaultScale, DEFAULT_SIZE);\n};\n\n\nconst primitiveComboboxSizeBySize: Record<ComboboxSize, 'sm' | 'md' | 'lg'> = {\n\tsm: 'sm',\n\tmd: 'md',\n\tlg: 'lg',\n};\n\nfunction getComboboxFormSize(size: ComboboxSize): FormControlSize {\n\treturn size;\n}\n\ninterface ComboboxInputFieldProps {\n\tplaceholder: string;\n\tclearLabel: string;\n\ttoggleLabel: string;\n\tsize: FormControlSize;\n\terror?: boolean;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\tclearable?: boolean;\n\tclassName?: string;\n\tonBlur?: () => void;\n}\n\nfunction ComboboxInputField({\n\tplaceholder,\n\tclearLabel,\n\ttoggleLabel,\n\tsize,\n\terror,\n\trequired,\n\tdisabled,\n\tclearable = true,\n\tclassName,\n\tonBlur,\n}: ComboboxInputFieldProps): React.ReactElement {\n\treturn (\n\t\t<div className=\"relative\">\n\t\t\t<ComboboxPrimitive.Input\n\t\t\t\trender={\n\t\t\t\t\t<Input\n\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\tinvalid={error}\n\t\t\t\t\t\tclassName={cn(clearable ? selectToggleRecipes.clearPadding[size] : selectToggleRecipes.padding[size], className)}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\taria-invalid={error || undefined}\n\t\t\t\taria-required={required}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tonBlur={onBlur}\n\t\t\t/>\n\t\t\t<div className={cn('absolute inset-y-0 flex items-center gap-space-xs text-muted-foreground', selectToggleRecipes.track[size])}>\n\t\t\t\t{clearable ? (\n\t\t\t\t\t<ComboboxPrimitive.Clear\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tclassName={cn(fieldAffordanceRecipes.target,fieldAffordanceRecipes.focus,fieldAffordanceRecipes.clear)}\n\t\t\t\t\t\t\t\taria-label={clearLabel}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<XIcon className={fieldAffordanceRecipes.icon} aria-hidden=\"true\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<ComboboxPrimitive.Trigger\n\t\t\t\t\trender={\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tclassName={cn(fieldAffordanceRecipes.target,fieldAffordanceRecipes.focus,fieldAffordanceRecipes.toggle)}\n\t\t\t\t\t\t\taria-label={toggleLabel}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<ChevronDownIcon className={cn('shrink-0', selectToggleRecipes.icon[size])} aria-hidden=\"true\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n// ============================================================================\n// Single Selection Component\n// ============================================================================\n\nexport function Combobox<T>({\n\t// Core props\n\titems,\n\tselectedValue,\n\tonSelectedValueChange,\n\tclearSearchOnClose = true,\n\tsearchValue,\n\tonSearchValueChange,\n\tgetItemLabel,\n\tgetItemKey,\n\tloading = false,\n\tshowListContent = true,\n\tminSearchLength = DEFAULT_MIN_SEARCH_LENGTH,\n\tstrings: stringsProp,\n\tdisabled = false,\n\tclassName,\n\tclearable = true,\n\trenderItem,\n\tportalContainer,\n\n\t// Form Integration\n\tname,\n\tinvalid,\n\terror,\n\trequired,\n\tonBlur,\n\n\t// Debounced Search\n\tonSearch,\n\tdebounceMs,\n\n\t// Creatable\n\tcreatable,\n\tonCreate,\n\n\t// Grouped Items\n\tgetItemGroup,\n\trenderGroupLabel,\n\n\t// Load More\n\thasMore,\n\tonLoadMore,\n\tloadingMore,\n\n\t// Disable individual items\n\tgetItemDisabled,\n\n\t// Highlight Match\n\thighlightMatch,\n\n\t// Size\n\tsize: sizeProp,\n\n\t// Controlled Open\n\topen,\n\tonOpenChange,\n}: ComboboxProps<T>): React.ReactElement {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComboboxSize(sizeProp, defaultScale);\n\tconst formSize = getComboboxFormSize(size);\n\tconst hasError = invalid || Boolean(error);\n\n\t// Use shared core hook\n\tconst core = useComboboxCore({\n\t\titems,\n\t\tsearchValue,\n\t\tonSearchValueChange,\n\t\tgetItemLabel,\n\t\tgetItemKey,\n\t\tloading,\n\t\tshowListContent,\n\t\tminSearchLength,\n\t\tstrings: stringsProp,\n\t\trenderItem,\n\t\tonSearch,\n\t\tdebounceMs,\n\t\tcreatable,\n\t\tonCreate,\n\t\tgetItemGroup,\n\t\thasMore,\n\t\tonLoadMore,\n\t\tloadingMore,\n\t\thighlightMatch,\n\t\tsize,\n\t\t// Include selected value in items list\n\t\tensuredItems: selectedValue ? [selectedValue] : [],\n\t});\n\n\t// Track open state so we can show the selected label when closed\n\tconst [isOpen, setIsOpen] = useState(false);\n\tconst handleOpenChange = useCallback(\n\t\t(nextOpen: boolean) => {\n\t\t\tsetIsOpen(nextOpen);\n\t\t\tif (!nextOpen && clearSearchOnClose) {\n\t\t\t\t// Clear search when closing so next open starts fresh\n\t\t\t\tonSearchValueChange('');\n\t\t\t}\n\t\t\tonOpenChange?.(nextOpen);\n\t\t},\n\t\t[clearSearchOnClose, onOpenChange, onSearchValueChange],\n\t);\n\n\t// When closed with a selected value, show the label; when open, show search text\n\tconst displayInputValue = isOpen\n\t\t? searchValue\n\t\t: (selectedValue ? core.itemToStringLabel(selectedValue) : '');\n\n\t// Handle value change, including create option\n\tconst handleValueChange = useCallback(\n\t\t(value: T | null): void => {\n\t\t\tif (value && isCreateOption(value)) {\n\t\t\t\tconst inputValue = getCreateOptionValue(value);\n\t\t\t\tonCreate?.(inputValue);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonSelectedValueChange(value);\n\t\t},\n\t\t[onSelectedValueChange, onCreate]\n\t);\n\n\treturn (\n\t\t<Stack gap=\"dense\" className=\"combobox--component\">\n\t\t\t<BaseCombobox\n\t\t\t\tdismissLabel={core.strings.dismiss}\n\t\t\t\titems={core.allItems}\n\t\t\t\tvalue={selectedValue}\n\t\t\t\tonValueChange={(value, details) => {\n\t\t\t\t\t// Escape on a closed field must not erase the chosen value; let the\n\t\t\t\t\t// surrounding dialog or drawer handle the key instead.\n\t\t\t\t\tif (details.reason === 'escape-key') { details.allowPropagation(); return; }\n\t\t\t\t\thandleValueChange(value);\n\t\t\t\t}}\n\t\t\t\tinputValue={displayInputValue}\n\t\t\t\tonInputValueChange={(value, details) => {\n\t\t\t\t\tconst { reason } = details;\n\t\t\t\t\tif (reason === 'escape-key') { details.allowPropagation(); return; }\n\t\t\t\t\tif (reason === 'item-press') {\n\t\t\t\t\t\tonSearchValueChange('');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonSearchValueChange(value);\n\t\t\t\t}}\n\t\t\t\titemToStringLabel={core.itemToStringLabel}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tfilter={null}\n\t\t\t\tname={name}\n\t\t\t\trequired={required}\n\t\t\t\topen={open}\n\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t>\n\t\t\t\t<ComboboxInputField\n\t\t\t\t\tplaceholder={core.strings.placeholder}\n\t\t\t\t\tclearLabel={core.strings.clear}\n\t\t\t\t\ttoggleLabel={core.strings.toggle}\n\t\t\t\t\tclassName={className}\n\t\t\t\t\tsize={formSize}\n\t\t\t\t\terror={hasError}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tclearable={clearable}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t/>\n\n\t\t\t\t<ComboboxDropdown\n\t\t\t\t\tloading={loading}\n\t\t\t\t\tshowStatus={core.showStatus}\n\t\t\t\t\tshowEmpty={core.showEmpty}\n\t\t\t\t\tsearchValue={searchValue}\n\t\t\t\t\tminSearchLength={minSearchLength}\n\t\t\t\t\titems={core.allItems}\n\t\t\t\t\tgroupedItems={core.groupedItems}\n\t\t\t\t\tcreateOptionItem={core.createOptionItem}\n\t\t\t\t\trenderItemContent={core.renderItemContent}\n\t\t\t\t\tgetItemReactKey={core.getItemReactKey}\n\t\t\t\t\tgetItemDisabled={getItemDisabled}\n\t\t\t\t\trenderGroupLabel={renderGroupLabel}\n\t\t\t\t\tloadingMore={showListContent && !core.showStatus ? loadingMore : false}\n\t\t\t\t\tstrings={core.strings}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tportalContainer={portalContainer}\n\t\t\t\t\tlistRef={core.listRef}\n\t\t\t\t/>\n\t\t\t</BaseCombobox>\n\n\t\t\t<ErrorMessage error={error} size={size} />\n\t\t</Stack>\n\t);\n}\n\n// ============================================================================\n// Multiple Selection Component\n// ============================================================================\n\nexport function MultiCombobox<T>({\n\t// Core props\n\titems,\n\tselectedValues,\n\tonSelectedValuesChange,\n\tsearchValue,\n\tonSearchValueChange,\n\tgetItemLabel,\n\tgetItemKey,\n\tloading = false,\n\tshowListContent = true,\n\tminSearchLength = DEFAULT_MIN_SEARCH_LENGTH,\n\tstrings: stringsProp,\n\tdisabled = false,\n\tclassName,\n\trenderItem,\n\tportalContainer,\n\n\t// Form Integration\n\tname,\n\tinvalid,\n\terror,\n\trequired,\n\tonBlur,\n\n\t// Debounced Search\n\tonSearch,\n\tdebounceMs,\n\n\t// Creatable\n\tcreatable,\n\tonCreate,\n\n\t// Grouped Items\n\tgetItemGroup,\n\trenderGroupLabel,\n\n\t// Load More\n\thasMore,\n\tonLoadMore,\n\tloadingMore,\n\n\t// Disable individual items\n\tgetItemDisabled,\n\n\t// Highlight Match\n\thighlightMatch,\n\n\t// Size\n\tsize: sizeProp,\n\n\t// Controlled Open\n\topen,\n\tonOpenChange,\n\n\t// Behaviour\n\tcloseOnSelect = false,\n\tapplyButton = false,\n\tonApply,\n\tonCancel,\n}: MultiComboboxProps<T>): React.ReactElement {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComboboxSize(sizeProp, defaultScale);\n\tconst formSize = getComboboxFormSize(size);\n\tconst primitiveComboboxSize = primitiveComboboxSizeBySize[size];\n\tconst hasError = invalid || Boolean(error);\n\tconst containerRef = useRef<HTMLDivElement | null>(null);\n\tconst getKey = getItemKey ?? getItemLabel;\n\n\t// Draft state — only used in `applyButton` mode. Tracks the user's\n\t// in-progress selection so we can commit it on Apply or revert on\n\t// Cancel. When apply mode is OFF, we pass selections through immediately.\n\tconst [draftValues, setDraftValues] = useState<T[]>(selectedValues);\n\tconst [internalOpen, setInternalOpen] = useState(false);\n\tconst isOpenControlled = open !== undefined;\n\tconst resolvedOpen = isOpenControlled ? open : internalOpen;\n\n\tuseEffect(() => {\n\t\tif (applyButton) setDraftValues(selectedValues);\n\t}, [applyButton, selectedValues]);\n\n\tconst setOpen = useCallback(\n\t\t(next: boolean) => {\n\t\t\tif (!isOpenControlled) setInternalOpen(next);\n\t\t\tonOpenChange?.(next);\n\t\t},\n\t\t[isOpenControlled, onOpenChange],\n\t);\n\n\t// Use shared core hook\n\tconst core = useComboboxCore({\n\t\titems,\n\t\tsearchValue,\n\t\tonSearchValueChange,\n\t\tgetItemLabel,\n\t\tgetItemKey,\n\t\tloading,\n\t\tshowListContent,\n\t\tminSearchLength,\n\t\tstrings: stringsProp,\n\t\trenderItem,\n\t\tonSearch,\n\t\tdebounceMs,\n\t\tcreatable,\n\t\tonCreate,\n\t\tgetItemGroup,\n\t\thasMore,\n\t\tonLoadMore,\n\t\tloadingMore,\n\t\thighlightMatch,\n\t\tsize,\n\t\t// Include selected values in items list\n\t\tensuredItems: selectedValues,\n\t});\n\n\t// Handle value change, filtering out create options\n\tconst handleValueChange = useCallback(\n\t\t(values: T[]): void => {\n\t\t\tconst regularValues: T[] = [];\n\t\t\tlet createValue: string | null = null;\n\n\t\t\tfor (const value of values) {\n\t\t\t\tif (isCreateOption(value)) {\n\t\t\t\t\tcreateValue = getCreateOptionValue(value);\n\t\t\t\t} else {\n\t\t\t\t\tregularValues.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (createValue) {\n\t\t\t\tonCreate?.(createValue);\n\t\t\t}\n\n\t\t\tconst next = (regularValues.length !== values.length || !createValue) ? regularValues : null;\n\t\t\tif (next) {\n\t\t\t\tif (applyButton) {\n\t\t\t\t\tsetDraftValues(next);\n\t\t\t\t} else {\n\t\t\t\t\tonSelectedValuesChange(next);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (closeOnSelect) {\n\t\t\t\tsetOpen(false);\n\t\t\t}\n\t\t},\n\t\t[onSelectedValuesChange, onCreate, applyButton, closeOnSelect, setOpen],\n\t);\n\n\tconst handleApply = useCallback(() => {\n\t\tif (applyButton) onSelectedValuesChange(draftValues);\n\t\tonApply?.();\n\t\tsetOpen(false);\n\t}, [applyButton, draftValues, onApply, onSelectedValuesChange, setOpen]);\n\n\tconst handleCancel = useCallback(() => {\n\t\tif (applyButton) setDraftValues(selectedValues);\n\t\tonCancel?.();\n\t\tsetOpen(false);\n\t}, [applyButton, selectedValues, onCancel, setOpen]);\n\n\tconst visibleValues = applyButton ? draftValues : selectedValues;\n\tconst chipsPlaceholder = visibleValues.length > 0 ? undefined : core.strings.placeholder;\n\n\treturn (\n\t\t<Stack gap=\"dense\" className=\"combobox--component\">\n\t\t\t<BaseCombobox\n\t\t\t\tdismissLabel={core.strings.dismiss}\n\t\t\t\titems={core.allItems}\n\t\t\t\tmultiple\n\t\t\t\tvalue={visibleValues}\n\t\t\t\tonValueChange={(value, details) => {\n\t\t\t\t\t// Escape on a closed field must not erase the chosen value; let the\n\t\t\t\t\t// surrounding dialog or drawer handle the key instead.\n\t\t\t\t\tif (details.reason === 'escape-key') { details.allowPropagation(); return; }\n\t\t\t\t\thandleValueChange(value);\n\t\t\t\t}}\n\t\t\t\tinputValue={searchValue}\n\t\t\t\tonInputValueChange={(value, details) => {\n\t\t\t\t\tconst { reason } = details;\n\t\t\t\t\tif (reason === 'escape-key') { details.allowPropagation(); return; }\n\t\t\t\t\tif (reason === 'item-press') {\n\t\t\t\t\t\tonSearchValueChange('');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonSearchValueChange(value);\n\t\t\t\t}}\n\t\t\t\titemToStringLabel={core.itemToStringLabel}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tfilter={null}\n\t\t\t\tname={name}\n\t\t\t\trequired={required}\n\t\t\t\topen={resolvedOpen}\n\t\t\t\tonOpenChange={(next) => {\n\t\t\t\t\t// In apply-button mode, closing without committing should\n\t\t\t\t\t// revert the draft so the next open starts clean.\n\t\t\t\t\tif (!next && applyButton) setDraftValues(selectedValues);\n\t\t\t\t\tsetOpen(next);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<ComboboxChips\n\t\t\t\t\tref={containerRef}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\tformControlMinHeightClasses[formSize],\n\t\t\t\t\t\tformControlPaddingClasses[formSize],\n\t\t\t\t\t\tformSize === 'sm' ? 'text-pxs' : 'text-sm',\n\t\t\t\t\t\t'bg-transparent !shadow-none',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\tsize={primitiveComboboxSize}\n\t\t\t\t\terror={hasError}\n\t\t\t\t>\n\t\t\t\t\t{visibleValues.map((item) => (\n\t\t\t\t\t\t<ComboboxChip key={getKey(item)} strings={{ remove: (core.strings.removeSelection ?? defaultComboboxStrings.removeSelection)(getItemLabel(item)) }}>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"inherit\"\n\t\t\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\t\t\tlineHeight=\"tight\"\n\t\t\t\t\t\t\t\tclassName=\"combobox--chip-label text-inherit\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{getItemLabel(item)}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</ComboboxChip>\n\t\t\t\t\t))}\n\t\t\t\t\t<ComboboxChipsInput\n\t\t\t\t\t\tplaceholder={chipsPlaceholder}\n\t\t\t\t\t\taria-invalid={hasError || undefined}\n\t\t\t\t\t\taria-required={required}\n\t\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\t/>\n\t\t\t\t</ComboboxChips>\n\n\t\t\t\t<ComboboxDropdown\n\t\t\t\t\tloading={loading}\n\t\t\t\t\tshowStatus={core.showStatus}\n\t\t\t\t\tshowEmpty={core.showEmpty}\n\t\t\t\t\tsearchValue={searchValue}\n\t\t\t\t\tminSearchLength={minSearchLength}\n\t\t\t\t\titems={core.allItems}\n\t\t\t\t\tgroupedItems={core.groupedItems}\n\t\t\t\t\tcreateOptionItem={core.createOptionItem}\n\t\t\t\t\trenderItemContent={core.renderItemContent}\n\t\t\t\t\tgetItemReactKey={core.getItemReactKey}\n\t\t\t\t\tgetItemDisabled={getItemDisabled}\n\t\t\t\t\trenderGroupLabel={renderGroupLabel}\n\t\t\t\t\tloadingMore={showListContent && !core.showStatus ? loadingMore : false}\n\t\t\t\t\tstrings={core.strings}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tportalContainer={portalContainer}\n\t\t\t\t\tlistRef={core.listRef}\n\t\t\t\t\tanchor={containerRef}\n\t\t\t\t\tapplyFooter={showListContent && applyButton ? {\n\t\t\t\t\t\tapplyLabel: core.strings.apply,\n\t\t\t\t\t\tcancelLabel: core.strings.cancel,\n\t\t\t\t\t\tonApply: handleApply,\n\t\t\t\t\t\tonCancel: handleCancel,\n\t\t\t\t\t} : undefined}\n\t\t\t\t/>\n\t\t\t</BaseCombobox>\n\n\t\t\t<ErrorMessage error={error} size={size} />\n\t\t</Stack>\n\t);\n}\n\nCombobox.displayName = 'Combobox';\nMultiCombobox.displayName = 'MultiCombobox';\n","import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';\n\nimport { ErrorState } from '../../base/feedback';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\nimport { useDebouncedCallback } from '../../../hooks/use-debounced-callback';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { Combobox } from './combobox';\nimport { defaultComboboxStrings } from './combobox.strings';\nimport { DEFAULT_DEBOUNCE_MS } from './constants';\nimport type { ComboboxSize, ComboboxStrings, ComboboxProps } from './types';\n\nexport interface AsyncResourceComboboxFetcherArgs {\n\tquery: string;\n\tlimit: number;\n\tsignal?: AbortSignal;\n}\n\nexport type AsyncResourceComboboxFetcher<T> = (\n\targs: AsyncResourceComboboxFetcherArgs,\n) => Promise<T[]>;\n\nexport interface AsyncResourceComboboxStrings extends ComboboxStrings {\n\terror: string;\n\tretry: string;\n}\n\nexport const defaultAsyncResourceComboboxStrings: AsyncResourceComboboxStrings = {\n\t...defaultComboboxStrings,\n\terror: 'Unable to load options.',\n\tretry: 'Retry',\n};\n\nexport interface AsyncResourceComboboxRenderOptionContext {\n\tquery: string;\n\tisSelected: boolean;\n}\n\nexport interface AsyncResourceComboboxRenderErrorContext {\n\terror: unknown;\n\tquery: string;\n\tretry: () => void;\n}\n\nexport interface AsyncResourceComboboxProps<T>\n\textends Omit<\n\t\tComboboxProps<T>,\n\t\t| 'items'\n\t\t| 'selectedValue'\n\t\t| 'onSelectedValueChange'\n\t\t| 'clearSearchOnClose'\n\t\t| 'searchValue'\n\t\t| 'onSearchValueChange'\n\t\t| 'getItemLabel'\n\t\t| 'getItemKey'\n\t\t| 'loading'\n\t\t| 'showListContent'\n\t\t| 'renderItem'\n\t\t| 'strings'\n\t\t| 'error'\n\t\t| 'debounceMs'\n\t> {\n\t/**\n\t * Loads options for the current query. This component owns the request\n\t * lifecycle: calls are debounced by `debounceMs`, the previous request is\n\t * aborted through `args.signal`, and out-of-order responses are discarded, so\n\t * the fetcher only needs to resolve or reject.\n\t *\n\t * A rejection clears the fetched list and presents the localized error as an\n\t * exclusive state, suppressing the ordinary no-results row. Honour\n\t * `args.signal` so aborts do not surface as errors.\n\t */\n\tfetcher: AsyncResourceComboboxFetcher<T>;\n\t/** Selected item, for controlled use. Omit entirely to let the component own selection. */\n\tvalue?: T | null;\n\t/** Initial selection for uncontrolled use. Ignored once `value` is passed. */\n\tdefaultValue?: T | null;\n\t/** Fired with the new selection in both controlled and uncontrolled modes. */\n\tonValueChange?: (value: T | null) => void;\n\t/** Fired after a successful fetch with the items received and the request that produced them. */\n\tonAfterFetch?: (items: T[], context: AsyncResourceComboboxFetcherArgs) => void;\n\t/** Fired when the fetcher rejects. Aborted and superseded requests never reach this. */\n\tonError?: (error: unknown, context: AsyncResourceComboboxFetcherArgs) => void;\n\t/** Stable identity for an item. Also decides which option reads as selected. */\n\tgetKey: (item: T) => string;\n\t/** Primary display label for an item. */\n\tgetLabel: (item: T) => string;\n\t/** Secondary text beside the label in the default option row. */\n\tgetDescription?: (item: T) => ReactNode;\n\t/** Tertiary, dimmed text after the description in the default option row. */\n\tgetMeta?: (item: T) => ReactNode;\n\t/**\n\t * Replaces the entire default option row, including the label. When set,\n\t * `getLabel`, `getDescription`, and `getMeta` no longer affect rendering\n\t * (`getLabel` is still used for the input's text value).\n\t */\n\trenderOption?: (item: T, context: AsyncResourceComboboxRenderOptionContext) => ReactNode;\n\t/**\n\t * Page size passed to the fetcher as `args.limit`. Default: `10`.\n\t *\n\t * Advisory only — the component does not truncate the returned array, so the\n\t * fetcher is responsible for honouring it.\n\t */\n\tlimit?: number;\n\t/** Quiet period before a query is issued, in milliseconds. Default: `300`. */\n\tdebounceMs?: number;\n\t/**\n\t * Characters required before a query is issued. Default: `0` here, rather\n\t * than the `3` used by the synchronous comboboxes — resource lookup is\n\t * expected to be browsable from the first keystroke alongside `preload`.\n\t *\n\t * An empty input is governed by `preload`, not by this threshold.\n\t */\n\tminSearchLength?: number;\n\t/**\n\t * Fetches with an empty query so options are available before typing.\n\t * Default: `true`. Set `false` to require a query first.\n\t */\n\tpreload?: boolean;\n\t/** Replaces the default error copy shown when the fetcher rejects. */\n\terrorMessage?: ReactNode;\n\t/** Replaces the package error state while retaining the failed query and retry action. */\n\trenderError?: (context: AsyncResourceComboboxRenderErrorContext) => ReactNode;\n\t/** Overrides the combobox copy, including the async-only `error` message. */\n\tstrings?: StringsProp<AsyncResourceComboboxStrings>;\n\t/** Trigger density. Falls back to `UIProvider.density.defaultScale`, then `md`. */\n\tsize?: ComboboxSize;\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport function AsyncResourceCombobox<T>({\n\tfetcher,\n\tvalue,\n\tdefaultValue = null,\n\tonValueChange,\n\tonAfterFetch,\n\tonError,\n\tgetKey,\n\tgetLabel,\n\tgetDescription,\n\tgetMeta,\n\trenderOption,\n\tlimit = 10,\n\tdebounceMs = DEFAULT_DEBOUNCE_MS,\n\tpreload = true,\n\tminSearchLength = 0,\n\terrorMessage,\n\trenderError,\n\tstrings: stringsProp,\n\tdisabled,\n\tsize,\n\t...props\n}: AsyncResourceComboboxProps<T>) {\n\tconst strings = useStrings(defaultAsyncResourceComboboxStrings, stringsProp);\n\tconst isControlled = value !== undefined;\n\tconst [internalValue, setInternalValue] = useState<T | null>(defaultValue);\n\tconst selectedValue = isControlled ? value : internalValue;\n\tconst [searchValue, setSearchValue] = useState('');\n\tconst [items, setItems] = useState<T[]>([]);\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst [fetchError, setFetchError] = useState<{ error: unknown; query: string } | null>(null);\n\tconst [retryCount, setRetryCount] = useState(0);\n\tconst requestIdRef = useRef(0);\n\tconst trimmedSearch = searchValue.trim();\n\n\tconst handleValueChange = useCallback(\n\t\t(nextValue: T | null) => {\n\t\t\tif (!isControlled) {\n\t\t\t\tsetInternalValue(nextValue);\n\t\t\t}\n\t\t\tonValueChange?.(nextValue);\n\t\t},\n\t\t[isControlled, onValueChange],\n\t);\n\n\t// `fetcher`, `onAfterFetch` and `onError` are almost always inline, so their\n\t// identities change on every render. Listing them in the effect below re-ran\n\t// it every render, and because the fetch sets state that re-render was\n\t// self-sustaining — an unbounded request loop. `useDebouncedCallback` holds\n\t// them in a ref and returns a stable function, so the effect only re-runs on\n\t// a real query change.\n\tconst runFetch = useDebouncedCallback(\n\t\t(requestId: number, context: AsyncResourceComboboxFetcherArgs) => {\n\t\t\tsetIsLoading(true);\n\t\t\tsetFetchError(null);\n\n\t\t\tfetcher(context)\n\t\t\t\t.then((nextItems) => {\n\t\t\t\t\tif (context.signal?.aborted || requestIdRef.current !== requestId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetItems(nextItems);\n\t\t\t\t\tonAfterFetch?.(nextItems, context);\n\t\t\t\t})\n\t\t\t\t.catch((nextError: unknown) => {\n\t\t\t\t\tif (context.signal?.aborted || requestIdRef.current !== requestId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetItems([]);\n\t\t\t\t\tsetFetchError({ error: nextError, query: context.query });\n\t\t\t\t\tonError?.(nextError, context);\n\t\t\t\t})\n\t\t\t\t.finally(() => {\n\t\t\t\t\tif (!context.signal?.aborted && requestIdRef.current === requestId) {\n\t\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t},\n\t\tdebounceMs,\n\t);\n\n\tuseEffect(() => {\n\t\tif (disabled) return;\n\n\t\tconst shouldFetch =\n\t\t\ttrimmedSearch.length > 0\n\t\t\t\t? trimmedSearch.length >= minSearchLength\n\t\t\t\t: preload;\n\n\t\tif (!shouldFetch) {\n\t\t\tsetItems([]);\n\t\t\tsetIsLoading(false);\n\t\t\tsetFetchError(null);\n\t\t\treturn;\n\t\t}\n\n\t\tconst requestId = requestIdRef.current + 1;\n\t\trequestIdRef.current = requestId;\n\t\tconst controller = new AbortController();\n\n\t\trunFetch(requestId, {\n\t\t\tquery: trimmedSearch,\n\t\t\tlimit,\n\t\t\tsignal: controller.signal,\n\t\t});\n\n\t\treturn () => {\n\t\t\trunFetch.cancel();\n\t\t\tcontroller.abort();\n\t\t};\n\t}, [\n\t\tdisabled,\n\t\tlimit,\n\t\tminSearchLength,\n\t\tpreload,\n\t\tretryCount,\n\t\trunFetch,\n\t\ttrimmedSearch,\n\t]);\n\n\tconst retry = useCallback(() => {\n\t\tif (!fetchError) return;\n\t\tsetSearchValue(fetchError.query);\n\t\tsetRetryCount((count) => count + 1);\n\t}, [fetchError]);\n\n\tconst renderItem = useCallback(\n\t\t(item: T) => {\n\t\t\tif (renderOption) {\n\t\t\t\treturn renderOption(item, {\n\t\t\t\t\tquery: trimmedSearch,\n\t\t\t\t\tisSelected: selectedValue ? getKey(selectedValue) === getKey(item) : false,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst description = getDescription?.(item);\n\t\t\tconst meta = getMeta?.(item);\n\n\t\t\treturn (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<span />}\n\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\twrap={false}\n\t\t\t\t\tclassName=\"async-resource-combobox--option leading-tight\"\n\t\t\t\t>\n\t\t\t\t\t<Text type=\"inherit\"\n\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\tsize={size === 'sm' ? 'pxs' : undefined}\n\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\tclassName=\"min-w-0 shrink truncate\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{getLabel(item)}\n\t\t\t\t\t</Text>\n\t\t\t\t\t{(!!description || !!meta) && (\n\t\t\t\t\t\t<span className=\"inline-flex min-w-0 flex-1 items-center gap-space-sm overflow-hidden text-muted-foreground\">\n\t\t\t\t\t\t\t{!!description && (isSimpleText(description) ? (\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"min-w-0 truncate\">\n\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) : description)}\n\t\t\t\t\t\t\t{!!meta && (isSimpleText(meta) ? (\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"min-w-0 truncate\">\n\t\t\t\t\t\t\t\t\t{meta}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) : meta)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t);\n\t\t},\n\t\t[getDescription, getKey, getLabel, getMeta, renderOption, selectedValue, size, trimmedSearch],\n\t);\n\n\tconst resolvedError = useMemo(() => {\n\t\tif (!fetchError) return undefined;\n\t\treturn errorMessage ?? strings.error;\n\t}, [errorMessage, fetchError, strings.error]);\n\tconst hasFetchError = fetchError !== null;\n\tconst errorNode = fetchError\n\t\t? renderError?.({ error: fetchError.error, query: fetchError.query, retry }) ?? (\n\t\t\t<ErrorState\n\t\t\t\tvariant=\"inline\"\n\t\t\t\ttitle={resolvedError}\n\t\t\t\tonRetry={retry}\n\t\t\t\tretryLabel={strings.retry}\n\t\t\t\tclassName=\"async-resource-combobox--error mt-space-sm\"\n\t\t\t/>\n\t\t)\n\t\t: null;\n\n\treturn (\n\t\t<div\n\t\t\tdata-component=\"async-resource-combobox\"\n\t\t\tdata-slot=\"async-resource-combobox\"\n\t\t\tclassName={cn('async-resource-combobox--component', props.className)}\n\t\t>\n\t\t\t<Combobox\n\t\t\t\t{...props}\n\t\t\t\tclassName={undefined}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tsize={size}\n\t\t\t\titems={items}\n\t\t\t\tselectedValue={selectedValue ?? null}\n\t\t\t\tonSelectedValueChange={handleValueChange}\n\t\t\t\tclearSearchOnClose={false}\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tonSearchValueChange={setSearchValue}\n\t\t\t\tgetItemLabel={getLabel}\n\t\t\t\tgetItemKey={getKey}\n\t\t\t\tloading={!hasFetchError && isLoading}\n\t\t\t\tshowListContent={!hasFetchError}\n\t\t\t\tminSearchLength={minSearchLength}\n\t\t\t\tstrings={strings}\n\t\t\t\trenderItem={renderItem}\n\t\t\t/>\n\t\t\t{errorNode}\n\t\t</div>\n\t);\n}\n\nAsyncResourceCombobox.displayName = 'AsyncResourceCombobox';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAaA,IAAauC,IAAyB;CACrC,aAAa;CACb,OAAO;CACP,QAAQ;CACR,SAAS;CACT,kBAAkB,MAAsB,UAAUC;CAClD,WAAW;CACX,WAAW;CACX,cAAc;CACd,UAAU;CACV,WAAW;CACX,aAAa;CACb,OAAO;CACP,QAAQ;AACT,GCHaC,IAAuB,OAAO,wBAAwB;AAMnE,SAAgBC,EAAkB,GAAyD;CAC1F,OACC,OAAOC,KAAS,cAChBA,KACAF,KAAyBE;AAE3B;AAEA,SAAgBC,EAAwB,GAAiB;CACxD,IAAI,CAACF,EAAeC,CAAI,GACvB,MAAU,MAAM,6BAA6B;CAE9C,OAAQA,EAA4CF;AACrD;AAEA,SAAgBI,EAAsB,GAAuB;CAC5D,OAAO,GAAGJ,IAAuBK,EAAW;AAC7C;;;AC7BA,SAAgBC,GAAY,EAC3B,YACA,SACA,gBAC+C;CAK/C,OAJKC,IAKJ,kBAACpC,GAAD;EACC,WAAU;EACV,KAAI;EACJ,SAAQ;EACR,MAAM;EACN,WAAWH,EAAG,2BACb,wDACAwC,CACD;EACA,MAAK;EACL,aAAU;EAVX,UAAA,CAYC,kBAACC,GAAD;GAAS,WAAU;GAA4B,eAAY;EAAQ,CAAA,GACnE,kBAACvC,GAAD;GAAM,KAAI;GAAO,MAAK;GAAK,MAAK;GAAY,WAAU;GACpD,UAAAwC;EACI,CAAA,CACA;MApBA;AAsBT;AAEA,GAAY,cAAc;;;ACvC1B,SAASC,EAAW,EAAE,eAAkC;CACvD,OACC,kBAACzC,GAAD;EAAM,KAAI;EAAO,MAAK;EAAU,MAAK;EAAY,WAAU;EACzD;CACI,CAAA;AAER;AAeA,SA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,SAAS;EAHpE,UAAA,CAKC,kBAACzM,IAAD;GACC,GAAIyM;GACJ,WAAW,KAAA;GACD;GACJ;GACC;GACP,eAAe1C,KAAiB;GAChC,uBAAuBU;GACvB,oBAAoB;GACP;GACb,qBAAqBqC;GACrB,cAAc8B;GACd,YAAYjH;GACZ,SAAS,CAACoH,MAAiB/B;GAC3B,iBAAiB,CAAC+B;GACD;GACR;GACG;EACZ,CAAA,GACAC,EACG;;AAEP;AAEA,GAAsB,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"combobox-xCQ2RMNE.js","names":["Combobox","ComboboxPrimitive","ComboboxInput","ComboboxTrigger","ComboboxClear","ComboboxInputTrigger","ComboboxPopup","ComboboxItem","ComboboxSeparator","ComboboxChip","InputTrigger","Clear","Chip","Popup","Input","Trigger","Item","Separator","useTypographyConfig","useThemePortalContainer","cn","affordanceGeometry","anchoredPositionMethod","motionRecipes","surfaceDividerRecipes","surfaceInsetClasses","collectionRowClasses","popoverRecipes","collectionRecipes","CollectionLabel","modalBackdropRecipe","fieldStateRecipes","fieldAffordanceRecipes","selectToggleRecipes","FieldClearGlyph","editableTextSizeClasses","Combobox$1","Combobox","ComboboxInput$1","props","className","ComboboxTrigger$1","children","ChevronDownIcon","ComboboxValue","placeholder","ComboboxClear$1","inputSizeClasses","ComboboxInputTrigger$1","size","showClear","error","clearLabel","toggleLabel","ComboboxPortal","resolvedContainer","container","ComboboxPositioner","ComboboxPopup$1","ComboboxList","itemIndicatorSizeClasses","ComboboxItem$1","CheckIcon","ComboboxItemIndicator","ComboboxEmpty","ComboboxStatus","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxSeparator$1","chipsSizeClasses","ComboboxChips","ComboboxChip$1","removeLabel","ComboboxChipsInput","ComboboxBackdrop","ComboboxArrow","useComboboxFilter","defaultComboboxControlStrings","ComboboxInputTrigger","stringsProp","strings","useStrings","createElement","ComboboxClear","ComboboxChip","ComboboxPopup","ComboboxInput","ComboboxTrigger","densityBySize","ComboboxItem","content","density","textSizes","defaultTextSize","ComboboxSeparator"],"sources":["../src/components/ui/combobox.tsx","../src/components/base/combobox/combobox.strings.ts","../src/components/base/combobox/index.ts"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { fieldStateRecipes } from '../../lib/field-state-recipes';\nimport { FieldClearGlyph, fieldAffordanceRecipes, selectToggleRecipes } from '../../lib/field-affordance-recipes';\nimport { editableTextSizeClasses } from '../../lib/editable-text-recipe';\nimport { affordanceGeometry } from '../../lib/affordance-geometry.generated';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { surfaceDividerRecipes } from '../../lib/surface-recipes';\nimport { modalBackdropRecipe } from './overlay.recipes';\nimport { useThemePortalContainer } from '../../lib/theme-scope';\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';\nimport { CheckIcon, ChevronDownIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { cn } from '../../lib/utils';\n\nconst Combobox = ComboboxPrimitive.Root;\n\nfunction ComboboxInput({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Input.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Input\n\t\t\tdata-slot=\"combobox-input\"\n\t\t\tclassName={cn(\n\t\t\t\t'font-sans text-foreground',\n\t\t\t\t'box-border border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-control w-full min-w-0 rounded-inner border bg-background px-control shadow-none transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\taffordanceGeometry.controlTextMinHeight,\n\t\t\t\taffordanceGeometry.controlBlockPadding.md,\n\t\t\t\teditableTextSizeClasses.md,\n\t\t\t\tfieldStateRecipes.focus,\n\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction ComboboxTrigger({\n\tclassName,\n\tchildren,\n\t...props\n}: ComboboxPrimitive.Trigger.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Trigger\n\t\t\tdata-slot=\"combobox-trigger\"\n\t\t\tclassName={cn(\n\t\t\t\t'font-sans text-foreground',\n\t\t\t\t'box-border border-input file:text-foreground placeholder:text-muted-foreground flex h-control w-full items-center justify-between rounded-inner border bg-background px-control shadow-none transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\t'text-sm',\n\t\t\t\taffordanceGeometry.controlTextMinHeight,\n\t\t\t\taffordanceGeometry.controlBlockPadding.md,\n\t\t\t\tfieldStateRecipes.focus,\n\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t'[&>span]:line-clamp-1',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ComboboxPrimitive.Icon className=\"flex\">\n\t\t\t\t<ChevronDownIcon className={cn(selectToggleRecipes.icon.md, 'text-muted-foreground')} />\n\t\t\t</ComboboxPrimitive.Icon>\n\t\t</ComboboxPrimitive.Trigger>\n\t);\n}\n\nfunction ComboboxValue({\n\tplaceholder,\n\t...props\n}: ComboboxPrimitive.Value.Props & { placeholder?: React.ReactNode }) {\n\treturn (\n\t\t<ComboboxPrimitive.Value\n\t\t\tdata-slot=\"combobox-value\"\n\t\t\tplaceholder={\n\t\t\t\t!!placeholder && <span className=\"text-muted-foreground\">{placeholder}</span>\n\t\t\t}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction ComboboxClear({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Clear.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Clear\n\t\t\tdata-slot=\"combobox-clear\"\n\t\t\tclassName={cn(\n\t\t\t\tfieldAffordanceRecipes.target,\n\t\t\t\tfieldAffordanceRecipes.focus,\n\t\t\t\tfieldAffordanceRecipes.clear,\n\t\t\t\tfieldAffordanceRecipes.centered,\n\t\t\t\t'end-control-icon',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t\t<FieldClearGlyph aria-hidden=\"true\" className={fieldAffordanceRecipes.icon} />\n\t\t</ComboboxPrimitive.Clear>\n\t);\n}\n\nexport type ComboboxSize = 'sm' | 'md' | 'lg';\n\nconst inputSizeClasses: Record<ComboboxSize, string> = {\n\tsm: 'h-control-sm ps-control-sm',\n\tmd: 'h-control ps-control',\n\tlg: 'h-control-lg ps-control',\n};\n\n\n// Toggle-only text clearance, track offset and chevron scale come from the\n// shared select-toggle recipe, so this input, the Select trigger and the\n// feature Combobox centre their chevrons in the same place.\n\ntype ComboboxInputTriggerProps = Omit<ComboboxPrimitive.Input.Props, 'size'> & {\n\tshowClear?: boolean;\n\tclearLabel?: string;\n\ttoggleLabel?: string;\n\tsize?: ComboboxSize;\n\terror?: boolean;\n};\n\nfunction ComboboxInputTrigger({\n\tclassName,\n\tshowClear = false,\n\tclearLabel,\n\ttoggleLabel,\n\tsize = 'md',\n\terror,\n\t...props\n}: ComboboxInputTriggerProps) {\n\treturn (\n\t\t<div className=\"relative h-fit\">\n\t\t\t<ComboboxPrimitive.Input\n\t\t\t\tdata-slot=\"combobox-input\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'font-sans text-foreground',\n\t\t\t\t\t'box-border border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground w-full min-w-0 rounded-inner border bg-background shadow-none transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\t\tfieldStateRecipes.focus,\n\t\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t\tinputSizeClasses[size],\n\t\t\t\t\taffordanceGeometry.controlTextMinHeight,\n\t\t\t\t\taffordanceGeometry.controlBlockPadding[size],\n\t\t\t\t\teditableTextSizeClasses[size],\n\t\t\t\t\tshowClear ? selectToggleRecipes.clearPadding[size] : selectToggleRecipes.padding[size],\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\taria-invalid={error || undefined}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'absolute top-1/2 -translate-y-1/2 flex items-center gap-space-xs text-muted-foreground',\n\t\t\t\t\tselectToggleRecipes.track[size]\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{!!showClear && (\n <ComboboxPrimitive.Clear\n\t\t\t\t\t\taria-label={clearLabel}\n\t\t\t\t\t\tdata-slot=\"combobox-clear\"\n\t\t\t\t\t\tclassName={cn(fieldAffordanceRecipes.target,fieldAffordanceRecipes.focus,fieldAffordanceRecipes.clear)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<FieldClearGlyph aria-hidden=\"true\" className={fieldAffordanceRecipes.icon} />\n\t\t\t\t\t</ComboboxPrimitive.Clear>\n )}\n\t\t\t\t<ComboboxPrimitive.Trigger aria-label={toggleLabel} className={cn(fieldAffordanceRecipes.target,fieldAffordanceRecipes.focus,fieldAffordanceRecipes.toggle)}>\n\t\t\t\t\t<ChevronDownIcon aria-hidden=\"true\" className={cn('shrink-0', selectToggleRecipes.icon[size])} />\n\t\t\t\t</ComboboxPrimitive.Trigger>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n// Portal\nfunction ComboboxPortal({ container, ...props }: ComboboxPrimitive.Portal.Props) {\n\tconst resolvedContainer = useThemePortalContainer(container);\n\treturn <ComboboxPrimitive.Portal container={resolvedContainer} {...props} />;\n}\n\n// Positioner\nfunction ComboboxPositioner({\n\tclassName,\n\tpositionMethod = anchoredPositionMethod,\n\tsideOffset = 4,\n\t...props\n}: ComboboxPrimitive.Positioner.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Positioner\n\t\t\tpositionMethod={positionMethod}\n\t\t\tdata-slot=\"combobox-positioner\"\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn('z-50 outline-none', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Popup (content)\nfunction ComboboxPopup({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Popup.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Popup\n\t\t\tdata-slot=\"combobox-popup\"\n\t\t\tclassName={cn(\n\t\t\t\t'w-[var(--anchor-width)] min-w-[8rem] max-w-[var(--available-width)] max-h-[min(var(--available-height),24rem)]',\n\t\t\t\t'overflow-hidden rounded-radius bg-popover text-popover-foreground shadow-md',\n\t\t\t\tsurfaceDividerRecipes.anchored.shell,\n\t\t\t\t'origin-[var(--transform-origin)]',\n\t\t\t\tmotionRecipes.popup,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// List\nfunction ComboboxList({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.List.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.List\n\t\t\tdata-slot=\"combobox-list\"\n\t\t\tclassName={cn(\n\t\t\t\t'max-h-[min(24rem,var(--available-height))] overflow-y-auto overscroll-contain p-surface-xs',\n\t\t\t\t'outline-none empty:hidden',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Item\n//\n// Layout: `[content][indicator]` with the selection check pinned to the\n// right (`justify-between`). Consumers render leading icons naturally inside\n// `renderItem` — the `gap` between icon and label is set by the consumer.\nconst itemIndicatorSizeClasses: Record<ComboboxSize, string> = {\n\tsm: 'size-icon-sm',\n\tmd: 'size-icon',\n\tlg: 'size-icon-lg',\n};\n\nfunction ComboboxItem({\n\tclassName,\n\tchildren,\n\tsize = 'md',\n\t...props\n}: ComboboxPrimitive.Item.Props & { size?: ComboboxSize }) {\n\treturn (\n\t\t<ComboboxPrimitive.Item\n\t\t\tdata-slot=\"combobox-item\"\n\t\t\tclassName={cn(\n\t\t\t\t'flex w-full cursor-default select-none items-center justify-between outline-none',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"flex min-w-0 flex-1 items-center gap-space-sm truncate\">\n\t\t\t\t{children}\n\t\t\t</span>\n\t\t\t<ComboboxPrimitive.ItemIndicator\n\t\t\t\tclassName={cn(\n\t\t\t\t\t// The selection check uses the row's own ink, as Select options do.\n\t\t\t\t\t'flex shrink-0 items-center justify-center',\n\t\t\t\t\titemIndicatorSizeClasses[size]\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<CheckIcon className={itemIndicatorSizeClasses[size]} />\n\t\t\t</ComboboxPrimitive.ItemIndicator>\n\t\t</ComboboxPrimitive.Item>\n\t);\n}\n\n// Item Indicator (standalone)\nfunction ComboboxItemIndicator({\n\tclassName,\n\tchildren,\n\t...props\n}: ComboboxPrimitive.ItemIndicator.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.ItemIndicator\n\t\t\tdata-slot=\"combobox-item-indicator\"\n\t\t\tclassName={cn(className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children ?? <CheckIcon className=\"size-icon\" />}\n\t\t</ComboboxPrimitive.ItemIndicator>\n\t);\n}\n\n// Empty\nfunction ComboboxEmpty({\n\tclassName,\n\tchildren,\n\t...props\n}: ComboboxPrimitive.Empty.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Empty\n\t\t\tdata-slot=\"combobox-empty\"\n\t\t\tclassName={cn(\n\t\t\t\t'px-row-x py-space-xl text-center text-sm text-muted-foreground empty:hidden',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</ComboboxPrimitive.Empty>\n\t);\n}\n\n// Status (for async loading states)\nfunction ComboboxStatus({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Status.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Status\n\t\t\tdata-slot=\"combobox-status\"\n\t\t\tclassName={cn(\n\t\t\t\t'flex items-center gap-space-sm px-row-x py-row-y text-sm text-muted-foreground empty:hidden',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Group\nfunction ComboboxGroup({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Group.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Group\n\t\t\tdata-slot=\"combobox-group\"\n\t\t\tclassName={cn('overflow-hidden p-0', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Group Label\nfunction ComboboxGroupLabel({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.GroupLabel.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.GroupLabel\n\t\t\tdata-slot=\"combobox-group-label\"\n\t\t\tclassName={cn('px-row-x py-row-y-sm text-xs font-medium text-muted-foreground', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Collection (for rendering items)\nconst ComboboxCollection = ComboboxPrimitive.Collection;\n\n// Separator\nfunction ComboboxSeparator({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Separator.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Separator\n\t\t\tdata-slot=\"combobox-separator\"\n\t\t\tclassName={cn('my-space-xs h-px', surfaceDividerRecipes.anchored.separator, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Chips container (for multiple selection)\nconst chipsSizeClasses: Record<ComboboxSize, string> = {\n\tsm: 'min-h-control-sm gap-space-xs px-control-sm py-space-xs text-sm',\n\tmd: 'min-h-control gap-space-xs px-control py-space-xs text-sm',\n\tlg: 'min-h-control-lg gap-space-sm px-control py-space-xs text-sm',\n};\n\nfunction ComboboxChips({\n\tclassName,\n\tsize = 'md',\n\terror,\n\t...props\n}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & {\n\tsize?: ComboboxSize;\n\terror?: boolean;\n}) {\n\treturn (\n\t\t<ComboboxPrimitive.Chips\n\t\t\tdata-slot=\"combobox-chips\"\n\t\t\tclassName={cn(\n\t\t\t\t'font-sans text-foreground',\n\t\t\t\t'box-border flex flex-wrap items-center rounded-inner border border-input bg-background shadow-none transition-[color,box-shadow] outline-none',\n\t\t\t\t'has-[:focus-visible]:border-ring has-[:focus-visible]:ring-3 has-[:focus-visible]:ring-ring/50',\n\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t'aria-invalid:has-[:focus-visible]:border-destructive aria-invalid:has-[:focus-visible]:ring-destructive/30 dark:aria-invalid:has-[:focus-visible]:ring-destructive/50',\n\t\t\t\tchipsSizeClasses[size],\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\taria-invalid={error || undefined}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Chip\nfunction ComboboxChip({\n\tclassName,\n\tchildren,\n\tremoveLabel,\n\t...props\n}: ComboboxPrimitive.Chip.Props & { removeLabel?: string }) {\n\treturn (\n\t\t<ComboboxPrimitive.Chip\n\t\t\tdata-slot=\"combobox-chip\"\n\t\t\tclassName={cn(\n\t\t\t\t'inline-flex items-center gap-space-xs rounded-inner bg-secondary px-control-xs py-space-xs text-xs font-medium text-secondary-foreground',\n\t\t\t\t'data-[highlighted]:bg-primary data-[highlighted]:text-primary-foreground',\n\t\t\t\t'focus-within:bg-primary focus-within:text-primary-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ComboboxPrimitive.ChipRemove aria-label={removeLabel} className={cn(fieldAffordanceRecipes.inline, fieldAffordanceRecipes.focus, 'text-inherit opacity-70 hover:opacity-100')}>\n\t\t\t\t<FieldClearGlyph aria-hidden=\"true\" className={fieldAffordanceRecipes.icon} />\n\t\t\t</ComboboxPrimitive.ChipRemove>\n\t\t</ComboboxPrimitive.Chip>\n\t);\n}\n\n// Chips Input\nfunction ComboboxChipsInput({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Input.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Input\n\t\t\tdata-slot=\"combobox-chips-input\"\n\t\t\tclassName={cn(\n\t\t\t\t'box-border min-h-lh min-w-[80px] flex-1 border-0 bg-transparent p-0 font-sans text-foreground outline-none placeholder:text-muted-foreground',\n\t\t\t\teditableTextSizeClasses.md,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Backdrop (for modal)\nfunction ComboboxBackdrop({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Backdrop.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Backdrop\n\t\t\tdata-slot=\"combobox-backdrop\"\n\t\t\tclassName={cn(modalBackdropRecipe, \n\t\t\t\tmotionRecipes.backdrop,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Arrow\nfunction ComboboxArrow({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Arrow.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Arrow\n\t\t\tdata-slot=\"combobox-arrow\"\n\t\t\tclassName={cn('fill-popover', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// useFilter hook re-export\nconst useComboboxFilter = ComboboxPrimitive.useFilter;\n\nexport {\n\tCombobox,\n\tComboboxInput,\n\tComboboxInputTrigger,\n\tComboboxTrigger,\n\tComboboxValue,\n\tComboboxClear,\n\tComboboxPortal,\n\tComboboxPositioner,\n\tComboboxPopup,\n\tComboboxList,\n\tComboboxItem,\n\tComboboxItemIndicator,\n\tComboboxEmpty,\n\tComboboxStatus,\n\tComboboxGroup,\n\tComboboxGroupLabel,\n\tComboboxCollection,\n\tComboboxSeparator,\n\tComboboxChips,\n\tComboboxChip,\n\tComboboxChipsInput,\n\tComboboxBackdrop,\n\tComboboxArrow,\n\tuseComboboxFilter,\n};\n","/** Accessible labels owned by the base combobox's generated controls. */\nexport interface ComboboxControlStrings {\n\tclear: string;\n\ttoggle: string;\n\tremove: string;\n}\n\nexport const defaultComboboxControlStrings: ComboboxControlStrings = {\n\tclear: 'Clear selection',\n\ttoggle: 'Open options',\n\tremove: 'Remove selection',\n};\n","import { CollectionLabel } from '../popover/collection-content';\n/**\n * Base wrapper for `ui/combobox`.\n *\n * This family is the sole importer of `@/components/ui/combobox`: it re-exports\n * the Base UI combobox anatomy with shared recipes and accessible control labels\n * so every other layer composes the parts without reaching into `ui/`. The searchable recipe built on top of this\n * anatomy — `Combobox`, `MultiCombobox`, `AsyncResourceCombobox`, and the\n * headless hooks — lives in `features/combobox`.\n *\n * The compound root is exported as `ComboboxRoot` so the canonical `Combobox`\n * name stays with the opinionated feature component.\n */\nexport {\n\tCombobox as ComboboxRoot,\n\tComboboxValue,\n\tComboboxPortal,\n\tComboboxPositioner,\n\tComboboxList,\n\tComboboxItemIndicator,\n\tComboboxEmpty,\n\tComboboxStatus,\n\tComboboxGroup,\n\tComboboxGroupLabel,\n\tComboboxCollection,\n\tComboboxChips,\n\tComboboxChipsInput,\n\tComboboxBackdrop,\n\tComboboxArrow,\n\tuseComboboxFilter,\n} from '../../ui/combobox';\n\n\nimport { createElement, type ComponentProps } from 'react';\nimport { ComboboxItem as Item, ComboboxPopup as Popup, ComboboxInput as Input, ComboboxInputTrigger as InputTrigger, ComboboxClear as Clear, ComboboxChip as Chip, ComboboxTrigger as Trigger, ComboboxSeparator as Separator } from '../../ui/combobox';\nimport { cn } from '../../../lib/utils';\nimport { collectionRecipes, collectionRowClasses, popoverRecipes, surfaceInsetClasses, type CollectionDensity } from '../popover/popover.recipes';\nimport { useTypographyConfig } from '../../../lib/ui-provider';\nimport { textSizes } from '../../typography/text.styles';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { defaultComboboxControlStrings, type ComboboxControlStrings } from './combobox.strings';\n\nexport { defaultComboboxControlStrings, type ComboboxControlStrings } from './combobox.strings';\n\nexport type ComboboxInputTriggerProps = Omit<ComponentProps<typeof InputTrigger>, 'clearLabel' | 'toggleLabel'> & {\n /** Accessible labels for the generated clear and toggle buttons. */\n strings?: StringsProp<Pick<ComboboxControlStrings, 'clear' | 'toggle'>>;\n};\n\nexport function ComboboxInputTrigger({ strings: stringsProp, ...props }: ComboboxInputTriggerProps) {\n const strings = useStrings(defaultComboboxControlStrings, stringsProp);\n return createElement(InputTrigger, { ...props, clearLabel: strings.clear, toggleLabel: strings.toggle });\n}\n\nexport type ComboboxClearProps = ComponentProps<typeof Clear> & {\n /** Accessible label; an explicit aria-label takes precedence. */\n strings?: StringsProp<Pick<ComboboxControlStrings, 'clear'>>;\n};\n\nexport function ComboboxClear({ strings: stringsProp, ...props }: ComboboxClearProps) {\n const strings = useStrings(defaultComboboxControlStrings, stringsProp);\n return createElement(Clear, { 'aria-label': strings.clear, ...props });\n}\n\nexport type ComboboxChipProps = Omit<ComponentProps<typeof Chip>, 'removeLabel'> & {\n /** Accessible label for the generated removal button. */\n strings?: StringsProp<Pick<ComboboxControlStrings, 'remove'>>;\n};\n\nexport function ComboboxChip({ strings: stringsProp, ...props }: ComboboxChipProps) {\n const strings = useStrings(defaultComboboxControlStrings, stringsProp);\n return createElement(Chip, { ...props, removeLabel: strings.remove });\n}\n\nexport function ComboboxPopup({ className, ...props }: ComponentProps<typeof Popup>) {\n // The list owns the collection inset so mixed search/status/footer regions stay flush.\n return createElement(Popup, { ...props, className: cn(popoverRecipes.surface, surfaceInsetClasses.flush, className) });\n}\nexport function ComboboxInput({ className, ...props }: ComponentProps<typeof Input>) {\n return createElement(Input, { ...props, className: cn('rounded-inner', className) });\n}\nexport function ComboboxTrigger({ className, ...props }: ComponentProps<typeof Trigger>) {\n return createElement(Trigger, { ...props, className: cn('rounded-inner', className) });\n}\n\nconst densityBySize = { sm: 'compact', md: 'default', lg: 'comfortable' } as const;\n\nexport function ComboboxItem({ className, size = 'md', density = densityBySize[size], children, ...props }: ComponentProps<typeof Item> & {\n /** Vertical option rhythm. Defaults to the owning control size's rhythm. */\n density?: CollectionDensity;\n}) {\n const { defaultTextSize } = useTypographyConfig();\n const content = typeof children === 'string' || typeof children === 'number' || typeof children === 'bigint' ? createElement(CollectionLabel, { children }) : children;\n return createElement(Item, { ...props, children: content, size, className: cn(collectionRowClasses(density), collectionRecipes.highlighted, collectionRecipes.disabled, textSizes[defaultTextSize ?? 'sm'], className) });\n}\n\n/** Shared collection divider, preserving Base UI separator semantics. */\nexport function ComboboxSeparator({ className, ...props }: ComponentProps<typeof Separator>) {\n return createElement(Separator, { ...props, className: cn(popoverRecipes.separator, className) });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAcA,IAAMA,IAAWC,EAAkB;AAEnC,SAASC,EAAc,EACtB,cACA,GAAGqC,KAC8B;CACjC,OACC,kBAACtC,EAAkB,OAAnB;EACC,aAAU;EACV,WAAWmB,EACV,6BACA,mbACAC,EAAmB,sBACnBA,EAAmB,oBAAoB,IACvCc,EAAwB,IACxBJ,EAAkB,OAClBA,EAAkB,SAClBS,CACD;EACA,GAAID;CACJ,CAAA;AAEH;AAEA,SAASpC,EAAgB,EACxB,cACA,aACA,GAAGoC,KACgC;CACnC,OACC,kBAACtC,EAAkB,SAAnB;EACC,aAAU;EACV,WAAWmB,EACV,6BACA,uTACA,WACAC,EAAmB,sBACnBA,EAAmB,oBAAoB,IACvCU,EAAkB,OAClBA,EAAkB,SAClB,yBACAS,CACD;EACA,GAAID;EAbL,UAAA,CAeEG,GACD,kBAACzC,EAAkB,MAAnB;GAAwB,WAAU;GACjC,UAAA,kBAAC0C,GAAD,EAAiB,WAAWvB,EAAGa,EAAoB,KAAK,IAAI,uBAAuB,EAAI,CAAA;EAChE,CAAA,CACE;;AAE7B;AAEA,SAASW,EAAc,EACtB,gBACA,GAAGL,KACkE;CACrE,OACC,kBAACtC,EAAkB,OAAnB;EACC,aAAU;EACV,aACC,CAAC,CAAC4C,KAAe,kBAAC,QAAD;GAAM,WAAU;GAAyB,UAAAA;EAAkB,CAAA;EAE7E,GAAIN;CACJ,CAAA;AAEH;AAEA,SAASnC,EAAc,EACtB,cACA,GAAGmC,KAC8B;CACjC,OACC,kBAACtC,EAAkB,OAAnB;EACC,aAAU;EACV,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