@epilot/zenith-react 0.2.0-next.3 → 0.2.0-next.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 (269) hide show
  1. package/README.md +25 -0
  2. package/codemods/README.md +168 -0
  3. package/codemods/migrate/base-elements/accordion.ts +132 -0
  4. package/codemods/migrate/base-elements/alert.ts +81 -0
  5. package/codemods/migrate/base-elements/avatar.ts +116 -0
  6. package/codemods/migrate/base-elements/button.ts +188 -0
  7. package/codemods/migrate/base-elements/checkbox.ts +17 -0
  8. package/codemods/migrate/base-elements/chip.ts +87 -0
  9. package/codemods/migrate/base-elements/chip360.ts +162 -0
  10. package/codemods/migrate/base-elements/circular-progress.ts +73 -0
  11. package/codemods/migrate/base-elements/dialog.ts +323 -0
  12. package/codemods/migrate/base-elements/divider.ts +61 -0
  13. package/codemods/migrate/base-elements/feedback-message.ts +95 -0
  14. package/codemods/migrate/base-elements/icon-button.ts +203 -0
  15. package/codemods/migrate/base-elements/index.ts +55 -0
  16. package/codemods/migrate/base-elements/mui-props.ts +29 -0
  17. package/codemods/migrate/base-elements/notification.ts +98 -0
  18. package/codemods/migrate/base-elements/paper.ts +78 -0
  19. package/codemods/migrate/base-elements/select.ts +328 -0
  20. package/codemods/migrate/base-elements/shared.ts +910 -0
  21. package/codemods/migrate/base-elements/skeleton.ts +83 -0
  22. package/codemods/migrate/base-elements/switch.ts +19 -0
  23. package/codemods/migrate/base-elements/tabs.ts +222 -0
  24. package/codemods/migrate/base-elements/text-field.ts +425 -0
  25. package/codemods/migrate/base-elements/toggle-button.ts +185 -0
  26. package/codemods/migrate/base-elements/tooltip.ts +231 -0
  27. package/codemods/migrate/base-elements/typography.ts +247 -0
  28. package/codemods/migrate/base-elements/unsupported.ts +277 -0
  29. package/codemods/migrate/from-base-elements.ts +20 -0
  30. package/codemods/migrate/from-volt.ts +20 -0
  31. package/codemods/migrate/lib/imports.ts +399 -0
  32. package/codemods/migrate/lib/jsx.ts +313 -0
  33. package/codemods/migrate/lib/run-migration.ts +528 -0
  34. package/codemods/migrate/lib/source.ts +6 -0
  35. package/codemods/migrate/lib/todo.ts +107 -0
  36. package/codemods/migrate/lib/types.ts +114 -0
  37. package/codemods/migrate/volt/class-helpers.ts +37 -0
  38. package/codemods/migrate/volt/index.ts +18 -0
  39. package/codemods/migrate/volt/pagination.ts +26 -0
  40. package/codemods/migrate/volt/same-name.ts +293 -0
  41. package/codemods/migrate/volt/stylesheets.ts +18 -0
  42. package/codemods/migrate/volt/tanstack-types.ts +20 -0
  43. package/codemods/radix-to-base-ui.ts +389 -0
  44. package/dist/_virtual/_zenith-runtime-family_accordion.js +7 -0
  45. package/dist/_virtual/_zenith-runtime-family_accordion.js.map +1 -0
  46. package/dist/_virtual/_zenith-runtime-family_alert-dialog.js +7 -0
  47. package/dist/_virtual/_zenith-runtime-family_alert-dialog.js.map +1 -0
  48. package/dist/_virtual/_zenith-runtime-family_avatar.js +7 -0
  49. package/dist/_virtual/_zenith-runtime-family_avatar.js.map +1 -0
  50. package/dist/_virtual/_zenith-runtime-family_button.js +7 -0
  51. package/dist/_virtual/_zenith-runtime-family_button.js.map +1 -0
  52. package/dist/_virtual/_zenith-runtime-family_checkbox.js +7 -0
  53. package/dist/_virtual/_zenith-runtime-family_checkbox.js.map +1 -0
  54. package/dist/_virtual/_zenith-runtime-family_csp-provider.js +7 -0
  55. package/dist/_virtual/_zenith-runtime-family_csp-provider.js.map +1 -0
  56. package/dist/_virtual/_zenith-runtime-family_dialog.js +7 -0
  57. package/dist/_virtual/_zenith-runtime-family_dialog.js.map +1 -0
  58. package/dist/_virtual/_zenith-runtime-family_direction-provider.js +8 -0
  59. package/dist/_virtual/_zenith-runtime-family_direction-provider.js.map +1 -0
  60. package/dist/_virtual/_zenith-runtime-family_menu.js +7 -0
  61. package/dist/_virtual/_zenith-runtime-family_menu.js.map +1 -0
  62. package/dist/_virtual/_zenith-runtime-family_merge-props.js +11 -0
  63. package/dist/_virtual/_zenith-runtime-family_merge-props.js.map +1 -0
  64. package/dist/_virtual/_zenith-runtime-family_popover.js +7 -0
  65. package/dist/_virtual/_zenith-runtime-family_popover.js.map +1 -0
  66. package/dist/_virtual/_zenith-runtime-family_radio-group.js +7 -0
  67. package/dist/_virtual/_zenith-runtime-family_radio-group.js.map +1 -0
  68. package/dist/_virtual/_zenith-runtime-family_radio.js +7 -0
  69. package/dist/_virtual/_zenith-runtime-family_radio.js.map +1 -0
  70. package/dist/_virtual/_zenith-runtime-family_scroll-area.js +7 -0
  71. package/dist/_virtual/_zenith-runtime-family_scroll-area.js.map +1 -0
  72. package/dist/_virtual/_zenith-runtime-family_select.js +7 -0
  73. package/dist/_virtual/_zenith-runtime-family_select.js.map +1 -0
  74. package/dist/_virtual/_zenith-runtime-family_separator.js +7 -0
  75. package/dist/_virtual/_zenith-runtime-family_separator.js.map +1 -0
  76. package/dist/_virtual/_zenith-runtime-family_switch.js +7 -0
  77. package/dist/_virtual/_zenith-runtime-family_switch.js.map +1 -0
  78. package/dist/_virtual/_zenith-runtime-family_tabs.js +7 -0
  79. package/dist/_virtual/_zenith-runtime-family_tabs.js.map +1 -0
  80. package/dist/_virtual/_zenith-runtime-family_toast.js +7 -0
  81. package/dist/_virtual/_zenith-runtime-family_toast.js.map +1 -0
  82. package/dist/_virtual/_zenith-runtime-family_toggle-group.js +7 -0
  83. package/dist/_virtual/_zenith-runtime-family_toggle-group.js.map +1 -0
  84. package/dist/_virtual/_zenith-runtime-family_toggle.js +7 -0
  85. package/dist/_virtual/_zenith-runtime-family_toggle.js.map +1 -0
  86. package/dist/_virtual/_zenith-runtime-family_tooltip.js +7 -0
  87. package/dist/_virtual/_zenith-runtime-family_tooltip.js.map +1 -0
  88. package/dist/_virtual/_zenith-runtime-family_use-render.js +7 -0
  89. package/dist/_virtual/_zenith-runtime-family_use-render.js.map +1 -0
  90. package/dist/components/accordion/accordion.js +179 -96
  91. package/dist/components/accordion/accordion.js.map +1 -1
  92. package/dist/components/alert-dialog/alert-dialog.js +243 -206
  93. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  94. package/dist/components/avatar/avatar.js +94 -82
  95. package/dist/components/avatar/avatar.js.map +1 -1
  96. package/dist/components/badge/badge.js +11 -11
  97. package/dist/components/breadcrumb/breadcrumb.js +69 -70
  98. package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
  99. package/dist/components/button/button.js +119 -102
  100. package/dist/components/button/button.js.map +1 -1
  101. package/dist/components/checkbox/checkbox.js +68 -51
  102. package/dist/components/checkbox/checkbox.js.map +1 -1
  103. package/dist/components/date-range-picker/date-range-picker.js +100 -90
  104. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  105. package/dist/components/date-time-picker/date-time-picker-input.js +118 -108
  106. package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
  107. package/dist/components/date-time-picker/date-time-picker-panel.js +91 -94
  108. package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
  109. package/dist/components/dialog/dialog.js +238 -228
  110. package/dist/components/dialog/dialog.js.map +1 -1
  111. package/dist/components/drawer/drawer.js +259 -321
  112. package/dist/components/drawer/drawer.js.map +1 -1
  113. package/dist/components/dropdown-menu/dropdown-menu.js +533 -279
  114. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
  115. package/dist/components/field/field-combobox.js +87 -77
  116. package/dist/components/field/field-combobox.js.map +1 -1
  117. package/dist/components/list/list-sortable.js +104 -0
  118. package/dist/components/list/list-sortable.js.map +1 -0
  119. package/dist/components/list/list.js +246 -324
  120. package/dist/components/list/list.js.map +1 -1
  121. package/dist/components/option-card/option-card.js +121 -117
  122. package/dist/components/option-card/option-card.js.map +1 -1
  123. package/dist/components/pill/pill.js +7 -7
  124. package/dist/components/popover/popover.js +223 -127
  125. package/dist/components/popover/popover.js.map +1 -1
  126. package/dist/components/radio/radio-group-base.js +54 -0
  127. package/dist/components/radio/radio-group-base.js.map +1 -0
  128. package/dist/components/radio/radio.js +71 -60
  129. package/dist/components/radio/radio.js.map +1 -1
  130. package/dist/components/scroll-area/scroll-area.js +142 -108
  131. package/dist/components/scroll-area/scroll-area.js.map +1 -1
  132. package/dist/components/scroll-overflow/scroll-overflow.js +156 -127
  133. package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
  134. package/dist/components/segmented-control/segmented-control.js +93 -81
  135. package/dist/components/segmented-control/segmented-control.js.map +1 -1
  136. package/dist/components/select/select.js +485 -310
  137. package/dist/components/select/select.js.map +1 -1
  138. package/dist/components/separator/separator.js.map +1 -1
  139. package/dist/components/slot/compose-as-child.js +15 -12
  140. package/dist/components/slot/compose-as-child.js.map +1 -1
  141. package/dist/components/switch/switch.js +75 -68
  142. package/dist/components/switch/switch.js.map +1 -1
  143. package/dist/components/table/table-pagination.js +212 -175
  144. package/dist/components/table/table-pagination.js.map +1 -1
  145. package/dist/components/tabs/tabs.js +193 -190
  146. package/dist/components/tabs/tabs.js.map +1 -1
  147. package/dist/components/toast/toast.js +610 -148
  148. package/dist/components/toast/toast.js.map +1 -1
  149. package/dist/components/toggle/toggle-group.js +143 -32
  150. package/dist/components/toggle/toggle-group.js.map +1 -1
  151. package/dist/components/toggle/toggle.js +83 -53
  152. package/dist/components/toggle/toggle.js.map +1 -1
  153. package/dist/components/tooltip/tooltip.js +298 -138
  154. package/dist/components/tooltip/tooltip.js.map +1 -1
  155. package/dist/index.d.ts +2335 -2129
  156. package/dist/index.js +24 -23
  157. package/dist/list/sortable/index.d.ts +29 -0
  158. package/dist/list/sortable/index.js +5 -0
  159. package/dist/{_virtual → list/sortable}/index.js.map +1 -1
  160. package/dist/packages/tokens/dist/delivery/index.js +10 -10
  161. package/dist/packages/tokens/dist/delivery/index.js.map +1 -1
  162. package/dist/packages/tokens/dist/generated/core.generated.js +6 -15
  163. package/dist/packages/tokens/dist/generated/core.generated.js.map +1 -1
  164. package/dist/packages/tokens/dist/generated/palette.generated.js +4 -5
  165. package/dist/packages/tokens/dist/generated/palette.generated.js.map +1 -1
  166. package/dist/packages/tokens/dist/generated/palette.meta.generated.js +5 -0
  167. package/dist/packages/tokens/dist/generated/palette.meta.generated.js.map +1 -0
  168. package/dist/packages/tokens/dist/install.js +40 -17
  169. package/dist/packages/tokens/dist/install.js.map +1 -1
  170. package/dist/renderer/runtime-contract.generated.js +8 -0
  171. package/dist/renderer/runtime-contract.generated.js.map +1 -0
  172. package/dist/renderer/served.js +34 -0
  173. package/dist/renderer/served.js.map +1 -0
  174. package/dist/tokens/core.meta.generated.js +2 -2
  175. package/dist/tokens/core.meta.generated.js.map +1 -1
  176. package/dist/tokens/index.d.ts +1028 -1028
  177. package/dist/tokens/index.js +863 -863
  178. package/dist/tokens/index.js.map +1 -1
  179. package/dist/tokens/palette.meta.generated.js +5 -0
  180. package/dist/tokens/palette.meta.generated.js.map +1 -0
  181. package/dist/tokens.json +1 -1
  182. package/dist/vendor/.bun/@radix-ui_react-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-dialog/dist/index.js +57 -62
  183. package/dist/vendor/.bun/@radix-ui_react-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-dialog/dist/index.js.map +1 -1
  184. package/dist/vendor/.bun/@radix-ui_react-slot@1.2.3_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js +32 -38
  185. package/dist/vendor/.bun/@radix-ui_react-slot@1.2.3_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js.map +1 -1
  186. package/package.json +28 -21
  187. package/scripts/migration-diagnostics-core.mjs +18 -10
  188. package/scripts/migration-diagnostics.mjs +31 -8
  189. package/dist/_virtual/index.js +0 -6
  190. package/dist/_virtual/index2.js +0 -5
  191. package/dist/_virtual/index2.js.map +0 -1
  192. package/dist/_virtual/use-sync-external-store-shim.development.js +0 -5
  193. package/dist/_virtual/use-sync-external-store-shim.development.js.map +0 -1
  194. package/dist/_virtual/use-sync-external-store-shim.production.js +0 -5
  195. package/dist/_virtual/use-sync-external-store-shim.production.js.map +0 -1
  196. package/dist/tokens/palette.generated.js +0 -5
  197. package/dist/tokens/palette.generated.js.map +0 -1
  198. package/dist/vendor/.bun/@floating-ui_core@1.8.0/vendor/@floating-ui/core/dist/floating-ui.core.js +0 -512
  199. package/dist/vendor/.bun/@floating-ui_core@1.8.0/vendor/@floating-ui/core/dist/floating-ui.core.js.map +0 -1
  200. package/dist/vendor/.bun/@floating-ui_dom@1.8.0/vendor/@floating-ui/dom/dist/floating-ui.dom.js +0 -396
  201. package/dist/vendor/.bun/@floating-ui_dom@1.8.0/vendor/@floating-ui/dom/dist/floating-ui.dom.js.map +0 -1
  202. package/dist/vendor/.bun/@floating-ui_react-dom@2.1.9_6f4b9a1cfb20c0ae/vendor/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -233
  203. package/dist/vendor/.bun/@floating-ui_react-dom@2.1.9_6f4b9a1cfb20c0ae/vendor/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +0 -1
  204. package/dist/vendor/.bun/@floating-ui_utils@0.2.12/vendor/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -137
  205. package/dist/vendor/.bun/@floating-ui_utils@0.2.12/vendor/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +0 -1
  206. package/dist/vendor/.bun/@floating-ui_utils@0.2.12/vendor/@floating-ui/utils/dist/floating-ui.utils.js +0 -129
  207. package/dist/vendor/.bun/@floating-ui_utils@0.2.12/vendor/@floating-ui/utils/dist/floating-ui.utils.js.map +0 -1
  208. package/dist/vendor/.bun/@radix-ui_number@1.1.1/vendor/@radix-ui/number/dist/index.js +0 -7
  209. package/dist/vendor/.bun/@radix-ui_number@1.1.1/vendor/@radix-ui/number/dist/index.js.map +0 -1
  210. package/dist/vendor/.bun/@radix-ui_react-accordion@1.2.12_2b23df507bdda662/vendor/@radix-ui/react-accordion/dist/index.js +0 -240
  211. package/dist/vendor/.bun/@radix-ui_react-accordion@1.2.12_2b23df507bdda662/vendor/@radix-ui/react-accordion/dist/index.js.map +0 -1
  212. package/dist/vendor/.bun/@radix-ui_react-alert-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-alert-dialog/dist/index.js +0 -128
  213. package/dist/vendor/.bun/@radix-ui_react-alert-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-alert-dialog/dist/index.js.map +0 -1
  214. package/dist/vendor/.bun/@radix-ui_react-arrow@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-arrow/dist/index.js +0 -25
  215. package/dist/vendor/.bun/@radix-ui_react-arrow@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-arrow/dist/index.js.map +0 -1
  216. package/dist/vendor/.bun/@radix-ui_react-avatar@1.1.10_2b23df507bdda662/vendor/@radix-ui/react-avatar/dist/index.js +0 -76
  217. package/dist/vendor/.bun/@radix-ui_react-avatar@1.1.10_2b23df507bdda662/vendor/@radix-ui/react-avatar/dist/index.js.map +0 -1
  218. package/dist/vendor/.bun/@radix-ui_react-checkbox@1.3.3_2b23df507bdda662/vendor/@radix-ui/react-checkbox/dist/index.js +0 -252
  219. package/dist/vendor/.bun/@radix-ui_react-checkbox@1.3.3_2b23df507bdda662/vendor/@radix-ui/react-checkbox/dist/index.js.map +0 -1
  220. package/dist/vendor/.bun/@radix-ui_react-collapsible@1.1.12_2b23df507bdda662/vendor/@radix-ui/react-collapsible/dist/index.js +0 -121
  221. package/dist/vendor/.bun/@radix-ui_react-collapsible@1.1.12_2b23df507bdda662/vendor/@radix-ui/react-collapsible/dist/index.js.map +0 -1
  222. package/dist/vendor/.bun/@radix-ui_react-collection@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-collection/dist/index.js +0 -49
  223. package/dist/vendor/.bun/@radix-ui_react-collection@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-collection/dist/index.js.map +0 -1
  224. package/dist/vendor/.bun/@radix-ui_react-direction@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-direction/dist/index.js +0 -11
  225. package/dist/vendor/.bun/@radix-ui_react-direction@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-direction/dist/index.js.map +0 -1
  226. package/dist/vendor/.bun/@radix-ui_react-dropdown-menu@2.1.16_2b23df507bdda662/vendor/@radix-ui/react-dropdown-menu/dist/index.js +0 -228
  227. package/dist/vendor/.bun/@radix-ui_react-dropdown-menu@2.1.16_2b23df507bdda662/vendor/@radix-ui/react-dropdown-menu/dist/index.js.map +0 -1
  228. package/dist/vendor/.bun/@radix-ui_react-menu@2.1.16_2b23df507bdda662/vendor/@radix-ui/react-menu/dist/index.js +0 -653
  229. package/dist/vendor/.bun/@radix-ui_react-menu@2.1.16_2b23df507bdda662/vendor/@radix-ui/react-menu/dist/index.js.map +0 -1
  230. package/dist/vendor/.bun/@radix-ui_react-popover@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-popover/dist/index.js +0 -244
  231. package/dist/vendor/.bun/@radix-ui_react-popover@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-popover/dist/index.js.map +0 -1
  232. package/dist/vendor/.bun/@radix-ui_react-popper@1.2.8_2b23df507bdda662/vendor/@radix-ui/react-popper/dist/index.js +0 -222
  233. package/dist/vendor/.bun/@radix-ui_react-popper@1.2.8_2b23df507bdda662/vendor/@radix-ui/react-popper/dist/index.js.map +0 -1
  234. package/dist/vendor/.bun/@radix-ui_react-radio-group@1.3.8_2b23df507bdda662/vendor/@radix-ui/react-radio-group/dist/index.js +0 -239
  235. package/dist/vendor/.bun/@radix-ui_react-radio-group@1.3.8_2b23df507bdda662/vendor/@radix-ui/react-radio-group/dist/index.js.map +0 -1
  236. package/dist/vendor/.bun/@radix-ui_react-roving-focus@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-roving-focus/dist/index.js +0 -184
  237. package/dist/vendor/.bun/@radix-ui_react-roving-focus@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-roving-focus/dist/index.js.map +0 -1
  238. package/dist/vendor/.bun/@radix-ui_react-scroll-area@1.2.10_2b23df507bdda662/vendor/@radix-ui/react-scroll-area/dist/index.js +0 -535
  239. package/dist/vendor/.bun/@radix-ui_react-scroll-area@1.2.10_2b23df507bdda662/vendor/@radix-ui/react-scroll-area/dist/index.js.map +0 -1
  240. package/dist/vendor/.bun/@radix-ui_react-select@2.2.6_2b23df507bdda662/vendor/@radix-ui/react-select/dist/index.js +0 -863
  241. package/dist/vendor/.bun/@radix-ui_react-select@2.2.6_2b23df507bdda662/vendor/@radix-ui/react-select/dist/index.js.map +0 -1
  242. package/dist/vendor/.bun/@radix-ui_react-slot@1.2.4_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js +0 -63
  243. package/dist/vendor/.bun/@radix-ui_react-slot@1.2.4_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js.map +0 -1
  244. package/dist/vendor/.bun/@radix-ui_react-switch@1.2.6_2b23df507bdda662/vendor/@radix-ui/react-switch/dist/index.js +0 -133
  245. package/dist/vendor/.bun/@radix-ui_react-switch@1.2.6_2b23df507bdda662/vendor/@radix-ui/react-switch/dist/index.js.map +0 -1
  246. package/dist/vendor/.bun/@radix-ui_react-tabs@1.1.13_2b23df507bdda662/vendor/@radix-ui/react-tabs/dist/index.js +0 -164
  247. package/dist/vendor/.bun/@radix-ui_react-tabs@1.1.13_2b23df507bdda662/vendor/@radix-ui/react-tabs/dist/index.js.map +0 -1
  248. package/dist/vendor/.bun/@radix-ui_react-toggle-group@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-toggle-group/dist/index.js +0 -138
  249. package/dist/vendor/.bun/@radix-ui_react-toggle-group@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-toggle-group/dist/index.js.map +0 -1
  250. package/dist/vendor/.bun/@radix-ui_react-toggle@1.1.10_2b23df507bdda662/vendor/@radix-ui/react-toggle/dist/index.js +0 -34
  251. package/dist/vendor/.bun/@radix-ui_react-toggle@1.1.10_2b23df507bdda662/vendor/@radix-ui/react-toggle/dist/index.js.map +0 -1
  252. package/dist/vendor/.bun/@radix-ui_react-tooltip@1.2.8_2b23df507bdda662/vendor/@radix-ui/react-tooltip/dist/index.js +0 -340
  253. package/dist/vendor/.bun/@radix-ui_react-tooltip@1.2.8_2b23df507bdda662/vendor/@radix-ui/react-tooltip/dist/index.js.map +0 -1
  254. package/dist/vendor/.bun/@radix-ui_react-use-is-hydrated@0.1.0_0ac650c021fb1b59/vendor/@radix-ui/react-use-is-hydrated/dist/index.js +0 -16
  255. package/dist/vendor/.bun/@radix-ui_react-use-is-hydrated@0.1.0_0ac650c021fb1b59/vendor/@radix-ui/react-use-is-hydrated/dist/index.js.map +0 -1
  256. package/dist/vendor/.bun/@radix-ui_react-use-previous@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-previous/dist/index.js +0 -9
  257. package/dist/vendor/.bun/@radix-ui_react-use-previous@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-previous/dist/index.js.map +0 -1
  258. package/dist/vendor/.bun/@radix-ui_react-use-size@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-size/dist/index.js +0 -28
  259. package/dist/vendor/.bun/@radix-ui_react-use-size@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-size/dist/index.js.map +0 -1
  260. package/dist/vendor/.bun/@radix-ui_react-visually-hidden@1.2.3_2b23df507bdda662/vendor/@radix-ui/react-visually-hidden/dist/index.js +0 -33
  261. package/dist/vendor/.bun/@radix-ui_react-visually-hidden@1.2.3_2b23df507bdda662/vendor/@radix-ui/react-visually-hidden/dist/index.js.map +0 -1
  262. package/dist/vendor/.bun/sonner@2.0.7_6f4b9a1cfb20c0ae/vendor/sonner/dist/index.js +0 -747
  263. package/dist/vendor/.bun/sonner@2.0.7_6f4b9a1cfb20c0ae/vendor/sonner/dist/index.js.map +0 -1
  264. package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -68
  265. package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
  266. package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -56
  267. package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
  268. package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/shim/index.js +0 -11
  269. package/dist/vendor/.bun/use-sync-external-store@1.7.0_62547eec5a2188e3/vendor/use-sync-external-store/shim/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { capTrim } from \"../../styles/text-box\"\nimport * as tokens from \"../../tokens\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\n/**\n * Base UI's type declarations resolve `react` from the hoisted root's `@types/react` (v19), while\n * this package pins `@types/react` 18 in its own node_modules. Re-typing the primitive onto OUR\n * `React` keeps the button's pass-through props and ref on one React type for this package.\n */\n/**\n * A native `<button>`, no primitive.\n *\n * v1's only Radix use here is `Slot`, purely to implement `asChild`, and this does the same. Base\n * UI's button primitive supplied nothing v1 had: it added a dependency, and with it the\n * `@types/react` 19 requirement, for a plain element.\n */\nconst ButtonBase = \"button\" as const\n\nconst useStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontWeight: tokens.fontWeightSemibold,\n whiteSpace: \"nowrap\",\n transitionProperty: \"all\",\n cursor: \"pointer\",\n flexShrink: 0,\n // Disabled keeps pointer events so a Tooltip can still explain why, but shows none of the\n // hover or press feedback (every variant guards those with `:not(:disabled)`) and no pointer.\n \":disabled\": { opacity: 0.5, cursor: \"not-allowed\" },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.focusRing,\n },\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \"& svg\": {\n flexShrink: 0,\n pointerEvents: \"none\",\n color: \"currentColor\",\n },\n },\n label: capTrim,\n primary: {\n backgroundColor: tokens.accentSolid,\n color: tokens.accentContrast,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSolidHover },\n \":active:not(:disabled)\": { backgroundColor: tokens.accentSolidHover },\n },\n secondary: {\n backgroundColor: tokens.accentSoft,\n color: tokens.accentOnSoft,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoftHover },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: tokens.accentA11,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoft },\n },\n ghost: {\n backgroundColor: \"transparent\",\n color: tokens.grayA12,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoft },\n },\n primaryDestructive: {\n backgroundColor: tokens.errorSolid,\n color: tokens.errorContrast,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSolidHover },\n \":active:not(:disabled)\": { backgroundColor: tokens.errorSolidHover },\n },\n secondaryDestructive: {\n backgroundColor: tokens.errorSoft,\n color: tokens.errorOnSoft,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSoftHover },\n },\n tertiaryDestructive: {\n backgroundColor: \"transparent\",\n color: tokens.errorA11,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSoft },\n },\n xs: {\n ...boxModel,\n ...shorthands.paddingInline(\"0.5rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n // Cap trimming removes the line-height's leading from direct text. Keep the established\n // 24px control geometry explicitly instead of relying on that incidental text height.\n minHeight: \"1.5rem\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n gap: \"4px\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n sm: {\n ...boxModel,\n ...shorthands.paddingInline(tokens.spacingElement3),\n ...shorthands.paddingBlock(\"0.25rem\"),\n // As above, the fixed 28px size is part of Button's contract, independent of its label box.\n minHeight: \"1.75rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n gap: \"0.375rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n base: {\n ...boxModel,\n // Density-bound (DENSITY-SPEC.md §2.4, WP9B1-ACCEPTANCE-WP9B2A): padding-inline is the\n // compact/comfortable lever; min-height is floored by the fixed line-height + padding-block\n // below and cannot shrink, so it is bound too (compact === normal, comfortable raised via an\n // explicit minHeight above the natural content box, same mechanism `lg` already uses).\n ...shorthands.paddingInline(tokens.buttonBasePaddingInline),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: tokens.buttonBaseMinHeight,\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n ...boxModel,\n ...shorthands.paddingInline(\"1.25rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"2.5rem\",\n fontSize: tokens.textLg,\n lineHeight: tokens.leadingLg,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n iconXs: {\n ...boxModel,\n width: \"1.5rem\",\n height: \"1.5rem\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n iconSm: {\n ...boxModel,\n width: \"1.75rem\",\n height: \"1.75rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n icon: {\n ...boxModel,\n // Density-bound: a fixed square, no line-height floor (unlike `base`), so compact/comfortable\n // both move freely (DENSITY-SPEC.md §2.4).\n width: tokens.buttonIconSize,\n height: tokens.buttonIconSize,\n \"& svg\": { width: \"1.125rem\", height: \"1.125rem\" },\n },\n iconLg: {\n ...boxModel,\n width: \"2.5rem\",\n height: \"2.5rem\",\n \"& svg\": { width: \"1.5rem\", height: \"1.5rem\" },\n },\n normal: { borderRadius: tokens.radiusLg },\n rounded: { borderRadius: \"9999px\" },\n})\n\ntype FlatButtonChild = {\n node: React.ReactNode\n keyPath: string\n}\n\n/**\n * Fragments do not create boxes, so flatten them to the same leaf order the flex container sees.\n * React.Children.toArray handles nested arrays and gives keyed elements a stable local key; the\n * parent fragment path keeps equal keys from separate fragment scopes distinct.\n */\nfunction flattenButtonChildren(\n children: React.ReactNode,\n parentPath = \"button\"\n): FlatButtonChild[] {\n return React.Children.toArray(children).flatMap((node, index) => {\n const localKey =\n React.isValidElement(node) && node.key !== null\n ? String(node.key)\n : String(index)\n const keyPath = `${parentPath}/${localKey}`\n\n if (\n React.isValidElement<{ children?: React.ReactNode }>(node) &&\n node.type === React.Fragment\n ) {\n return flattenButtonChildren(node.props.children, keyPath)\n }\n\n return [{ node, keyPath }]\n })\n}\n\n/**\n * A flex container's direct text becomes an anonymous flex item, which `text-box` cannot select.\n * Recreate exactly those contiguous text runs as real label boxes. Consumer elements stay direct\n * children and whitespace-only runs stay raw, preserving today's element order and flex gaps.\n */\nfunction wrapButtonTextRuns(\n children: React.ReactNode,\n labelClassName: string\n): React.ReactNode[] {\n const output: React.ReactNode[] = []\n let textRun: FlatButtonChild[] = []\n\n const flushTextRun = () => {\n if (!textRun.length) return\n\n const whitespaceOnly = textRun.every(\n ({ node }) => typeof node === \"string\" && node.trim() === \"\"\n )\n if (whitespaceOnly) {\n output.push(...textRun.map(({ node }) => node))\n } else {\n output.push(\n <span\n key={`button-label:${textRun[0].keyPath}`}\n data-slot=\"button-label\"\n className={labelClassName}\n >\n {textRun.map(({ node }) => node)}\n </span>\n )\n }\n textRun = []\n }\n\n for (const child of flattenButtonChildren(children)) {\n if (typeof child.node === \"string\" || typeof child.node === \"number\") {\n textRun.push(child)\n continue\n }\n\n flushTextRun()\n output.push(\n React.isValidElement(child.node)\n ? React.cloneElement(child.node, { key: child.keyPath })\n : child.node\n )\n }\n flushTextRun()\n\n return output\n}\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\" | \"ghost\"\nexport type ButtonSize =\n \"xs\" | \"sm\" | \"base\" | \"lg\" | \"icon-xs\" | \"icon-sm\" | \"icon\" | \"icon-lg\"\nexport type ButtonShape = \"normal\" | \"rounded\"\n\nexport type ButtonProps = Omit<\n React.ComponentProps<\"button\">,\n \"variant\" | \"size\" | \"shape\" | \"destructive\" | \"className\" | \"render\"\n> & {\n variant?: ButtonVariant\n size?: ButtonSize\n shape?: ButtonShape\n destructive?: boolean\n className?: string\n /**\n * Render the child element instead of a `button`, keeping Button's styling and slot markers.\n * v1 supports this and consumers rely on it to wrap links; it was dropped here while the package\n * was briefly on Base UI, and restored once it moved back to Radix.\n */\n asChild?: boolean\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n variant = \"primary\",\n size = \"base\",\n shape = \"rounded\",\n destructive = false,\n className,\n asChild = false,\n children,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const variantSlot:\n | ButtonVariant\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\" =\n destructive && variant !== \"ghost\"\n ? (`${variant}Destructive` as\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\")\n : variant\n const sizeSlot:\n \"xs\" | \"sm\" | \"base\" | \"lg\" | \"iconXs\" | \"iconSm\" | \"icon\" | \"iconLg\" = (\n {\n xs: \"xs\",\n sm: \"sm\",\n base: \"base\",\n lg: \"lg\",\n \"icon-xs\": \"iconXs\",\n \"icon-sm\": \"iconSm\",\n icon: \"icon\",\n \"icon-lg\": \"iconLg\",\n } as const\n )[size]\n\n const Root = asChild ? Slot : ButtonBase\n const content = asChild\n ? children\n : wrapButtonTextRuns(children, styles.label)\n\n return (\n <Root\n ref={ref}\n data-slot=\"button\"\n {...{ [SLOT_ATTR]: \"button\" }}\n className={mergeClasses(\n styles.root,\n styles[variantSlot],\n styles[sizeSlot],\n styles[shape],\n className\n )}\n {...props}\n >\n {content}\n </Root>\n )\n }\n)\n"],"names":["ButtonBase","useStyles","makeZenithStyles","nativeControl","tokens.fontWeightSemibold","tokens.focusRing","capTrim","tokens.accentSolid","tokens.accentContrast","tokens.accentSolidHover","tokens.accentSoft","tokens.accentOnSoft","tokens.accentSoftHover","tokens.accentA11","tokens.grayA12","tokens.errorSolid","tokens.errorContrast","tokens.errorSolidHover","tokens.errorSoft","tokens.errorOnSoft","tokens.errorSoftHover","tokens.errorA11","boxModel","shorthands","tokens.textXs","tokens.leadingXs","tokens.spacingElement3","tokens.textSm","tokens.leadingSm","tokens.buttonBasePaddingInline","tokens.buttonBaseMinHeight","tokens.textBase","tokens.leadingBase","tokens.textLg","tokens.leadingLg","tokens.buttonIconSize","tokens.radiusLg","flattenButtonChildren","children","parentPath","React","node","index","localKey","keyPath","wrapButtonTextRuns","labelClassName","output","textRun","flushTextRun","jsx","child","Button","variant","size","shape","destructive","className","asChild","props","ref","styles","variantSlot","sizeSlot","Root","Slot","content","SLOT_ATTR","mergeClasses"],"mappings":";;;;;;;;AAuBA,MAAMA,KAAa,UAEbC,KAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAYC;AAAAA,IACZ,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,QAAQ;AAAA,IACR,YAAY;AAAA;AAAA;AAAA,IAGZ,aAAa,EAAE,SAAS,KAAK,QAAQ,cAAA;AAAA,IACrC,kBAAkB;AAAA,MAChB,cAAc;AAAA,MACd,cAAc;AAAA,MACd,eAAe;AAAA,MACf,cAAcC;AAAAA,IAAO;AAAA,IAEvB,2CAA2C;AAAA,MACzC,oBAAoB;AAAA,IAAA;AAAA,IAEtB,SAAS;AAAA,MACP,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,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;"}
1
+ {"version":3,"file":"button.js","sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { capTrim } from \"../../styles/text-box\"\nimport * as tokens from \"../../tokens\"\nimport { Button as ButtonPrimitive } from \"@base-ui/react/button\"\nimport { useRender } from \"@base-ui/react/use-render\"\n\n// `useRender` runs on every render to keep hook order stable; without an `asChild` child it is\n// disabled and this placeholder is never rendered.\nconst NO_SLOT_CHILD = <span />\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this). Radix's Slot normalised that, so the `asChild` shim has to as well.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\nconst useStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontWeight: tokens.fontWeightSemibold,\n whiteSpace: \"nowrap\",\n transitionProperty: \"all\",\n cursor: \"pointer\",\n flexShrink: 0,\n // Disabled keeps pointer events so a Tooltip can still explain why, but shows none of the\n // hover or press feedback (every variant guards those with `:not(:disabled)`) and no pointer.\n \":disabled\": { opacity: 0.5, cursor: \"not-allowed\" },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.focusRing,\n },\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \"& svg\": {\n flexShrink: 0,\n pointerEvents: \"none\",\n color: \"currentColor\",\n },\n },\n label: capTrim,\n primary: {\n backgroundColor: tokens.accentSolid,\n color: tokens.accentContrast,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSolidHover },\n \":active:not(:disabled)\": { backgroundColor: tokens.accentSolidHover },\n },\n secondary: {\n backgroundColor: tokens.accentSoft,\n color: tokens.accentOnSoft,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoftHover },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: tokens.accentA11,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoft },\n },\n ghost: {\n backgroundColor: \"transparent\",\n color: tokens.grayA12,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoft },\n },\n primaryDestructive: {\n backgroundColor: tokens.errorSolid,\n color: tokens.errorContrast,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSolidHover },\n \":active:not(:disabled)\": { backgroundColor: tokens.errorSolidHover },\n },\n secondaryDestructive: {\n backgroundColor: tokens.errorSoft,\n color: tokens.errorOnSoft,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSoftHover },\n },\n tertiaryDestructive: {\n backgroundColor: \"transparent\",\n color: tokens.errorA11,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSoft },\n },\n xs: {\n ...boxModel,\n ...shorthands.paddingInline(\"0.5rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n // Cap trimming removes the line-height's leading from direct text. Keep the established\n // 24px control geometry explicitly instead of relying on that incidental text height.\n minHeight: \"1.5rem\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n gap: \"4px\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n sm: {\n ...boxModel,\n ...shorthands.paddingInline(tokens.spacingElement3),\n ...shorthands.paddingBlock(\"0.25rem\"),\n // As above, the fixed 28px size is part of Button's contract, independent of its label box.\n minHeight: \"1.75rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n gap: \"0.375rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n base: {\n ...boxModel,\n // Density-bound (DENSITY-SPEC.md §2.4, WP9B1-ACCEPTANCE-WP9B2A): padding-inline is the\n // compact/comfortable lever; min-height is floored by the fixed line-height + padding-block\n // below and cannot shrink, so it is bound too (compact === normal, comfortable raised via an\n // explicit minHeight above the natural content box, same mechanism `lg` already uses).\n ...shorthands.paddingInline(tokens.buttonBasePaddingInline),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: tokens.buttonBaseMinHeight,\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n ...boxModel,\n ...shorthands.paddingInline(\"1.25rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"2.5rem\",\n fontSize: tokens.textLg,\n lineHeight: tokens.leadingLg,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n iconXs: {\n ...boxModel,\n width: \"1.5rem\",\n height: \"1.5rem\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n iconSm: {\n ...boxModel,\n width: \"1.75rem\",\n height: \"1.75rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n icon: {\n ...boxModel,\n // Density-bound: a fixed square, no line-height floor (unlike `base`), so compact/comfortable\n // both move freely (DENSITY-SPEC.md §2.4).\n width: tokens.buttonIconSize,\n height: tokens.buttonIconSize,\n \"& svg\": { width: \"1.125rem\", height: \"1.125rem\" },\n },\n iconLg: {\n ...boxModel,\n width: \"2.5rem\",\n height: \"2.5rem\",\n \"& svg\": { width: \"1.5rem\", height: \"1.5rem\" },\n },\n normal: { borderRadius: tokens.radiusLg },\n rounded: { borderRadius: \"9999px\" },\n})\n\ntype FlatButtonChild = {\n node: React.ReactNode\n keyPath: string\n}\n\n/**\n * Fragments do not create boxes, so flatten them to the same leaf order the flex container sees.\n * React.Children.toArray handles nested arrays and gives keyed elements a stable local key; the\n * parent fragment path keeps equal keys from separate fragment scopes distinct.\n */\nfunction flattenButtonChildren(\n children: React.ReactNode,\n parentPath = \"button\"\n): FlatButtonChild[] {\n return React.Children.toArray(children).flatMap((node, index) => {\n const localKey =\n React.isValidElement(node) && node.key !== null\n ? String(node.key)\n : String(index)\n const keyPath = `${parentPath}/${localKey}`\n\n if (\n React.isValidElement<{ children?: React.ReactNode }>(node) &&\n node.type === React.Fragment\n ) {\n return flattenButtonChildren(node.props.children, keyPath)\n }\n\n return [{ node, keyPath }]\n })\n}\n\n/**\n * A flex container's direct text becomes an anonymous flex item, which `text-box` cannot select.\n * Recreate exactly those contiguous text runs as real label boxes. Consumer elements stay direct\n * children and whitespace-only runs stay raw, preserving today's element order and flex gaps.\n */\nfunction wrapButtonTextRuns(\n children: React.ReactNode,\n labelClassName: string\n): React.ReactNode[] {\n const output: React.ReactNode[] = []\n let textRun: FlatButtonChild[] = []\n\n const flushTextRun = () => {\n if (!textRun.length) return\n\n const whitespaceOnly = textRun.every(\n ({ node }) => typeof node === \"string\" && node.trim() === \"\"\n )\n if (whitespaceOnly) {\n output.push(...textRun.map(({ node }) => node))\n } else {\n output.push(\n <span\n key={`button-label:${textRun[0].keyPath}`}\n data-slot=\"button-label\"\n className={labelClassName}\n >\n {textRun.map(({ node }) => node)}\n </span>\n )\n }\n textRun = []\n }\n\n for (const child of flattenButtonChildren(children)) {\n if (typeof child.node === \"string\" || typeof child.node === \"number\") {\n textRun.push(child)\n continue\n }\n\n flushTextRun()\n output.push(\n React.isValidElement(child.node)\n ? React.cloneElement(child.node, { key: child.keyPath })\n : child.node\n )\n }\n flushTextRun()\n\n return output\n}\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\" | \"ghost\"\nexport type ButtonSize =\n \"xs\" | \"sm\" | \"base\" | \"lg\" | \"icon-xs\" | \"icon-sm\" | \"icon\" | \"icon-lg\"\nexport type ButtonShape = \"normal\" | \"rounded\"\n\nexport type ButtonProps = Omit<\n React.ComponentProps<\"button\">,\n \"variant\" | \"size\" | \"shape\" | \"destructive\" | \"className\" | \"render\"\n> & {\n variant?: ButtonVariant\n size?: ButtonSize\n shape?: ButtonShape\n destructive?: boolean\n className?: string\n /**\n * Render the single child element instead of a `button`, keeping Button's styling and slot\n * markers. The child keeps its own semantics: a link stays a link. Without exactly one child\n * element, Button renders its `button`.\n */\n asChild?: boolean\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n variant = \"primary\",\n size = \"base\",\n shape = \"rounded\",\n destructive = false,\n className,\n asChild = false,\n children,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const variantSlot:\n | ButtonVariant\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\" =\n destructive && variant !== \"ghost\"\n ? (`${variant}Destructive` as\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\")\n : variant\n const sizeSlot:\n \"xs\" | \"sm\" | \"base\" | \"lg\" | \"iconXs\" | \"iconSm\" | \"icon\" | \"iconLg\" = (\n {\n xs: \"xs\",\n sm: \"sm\",\n base: \"base\",\n lg: \"lg\",\n \"icon-xs\": \"iconXs\",\n \"icon-sm\": \"iconSm\",\n icon: \"icon\",\n \"icon-lg\": \"iconLg\",\n } as const\n )[size]\n\n const rootClassName = mergeClasses(\n styles.root,\n styles[variantSlot],\n styles[sizeSlot],\n styles[shape],\n className\n )\n const slotChild = asChild ? onlySlotChild(children) : undefined\n\n // `asChild` decorates an element the caller owns, so it stays a plain prop merge as Radix's\n // Slot was. Base UI's button would give that element `role=\"button\"`, a tabindex and\n // Space-to-click, turning a link into a button for assistive technology.\n const slotted = useRender({\n render: slotChild ?? NO_SLOT_CHILD,\n props: {\n \"data-slot\": \"button\",\n [SLOT_ATTR]: \"button\",\n className: rootClassName,\n ...props,\n },\n ref,\n enabled: slotChild !== undefined,\n })\n if (slotted) return slotted\n\n return (\n <ButtonPrimitive\n ref={ref}\n data-slot=\"button\"\n {...{ [SLOT_ATTR]: \"button\" }}\n className={rootClassName}\n // Base UI's button defaults to `type=\"button\"`; a bare `<button>` submits its form, as this\n // component always did. A caller's or an overlay trigger's `type` still wins.\n type=\"submit\"\n {...props}\n >\n {wrapButtonTextRuns(children, styles.label)}\n </ButtonPrimitive>\n )\n }\n)\n"],"names":["NO_SLOT_CHILD","onlySlotChild","children","elements","React","useStyles","makeZenithStyles","nativeControl","tokens.fontWeightSemibold","tokens.focusRing","capTrim","tokens.accentSolid","tokens.accentContrast","tokens.accentSolidHover","tokens.accentSoft","tokens.accentOnSoft","tokens.accentSoftHover","tokens.accentA11","tokens.grayA12","tokens.errorSolid","tokens.errorContrast","tokens.errorSolidHover","tokens.errorSoft","tokens.errorOnSoft","tokens.errorSoftHover","tokens.errorA11","boxModel","shorthands","tokens.textXs","tokens.leadingXs","tokens.spacingElement3","tokens.textSm","tokens.leadingSm","tokens.buttonBasePaddingInline","tokens.buttonBaseMinHeight","tokens.textBase","tokens.leadingBase","tokens.textLg","tokens.leadingLg","tokens.buttonIconSize","tokens.radiusLg","flattenButtonChildren","parentPath","node","index","localKey","keyPath","wrapButtonTextRuns","labelClassName","output","textRun","flushTextRun","jsx","child","Button","variant","size","shape","destructive","className","asChild","props","ref","styles","variantSlot","sizeSlot","rootClassName","mergeClasses","slotChild","slotted","useRender","SLOT_ATTR","ButtonPrimitive"],"mappings":";;;;;;;;;AAcA,MAAMA,uBAAiB,QAAA,EAAK;AAI5B,SAASC,GAAcC,GAA2B;AAChD,QAAMC,IAAWC,EAAM,SAAS,QAAQF,CAAQ,EAAE,OAAOE,EAAM,cAAc;AAC7E,SAAOD,EAAS,WAAW,IAAIA,EAAS,CAAC,IAAI;AAC/C;AAEA,MAAME,KAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAYC;AAAAA,IACZ,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,QAAQ;AAAA,IACR,YAAY;AAAA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,CAAK;AAAA,MACZE;AAAA,IAAA,GAEIS,IAAYR,IAAU3D,GAAcC,CAAQ,IAAI,QAKhDmE,IAAUC,GAAU;AAAA,MACxB,QAAQF,KAAapE;AAAA,MACrB,OAAO;AAAA,QACL,aAAa;AAAA,QACb,CAACuE,CAAS,GAAG;AAAA,QACb,WAAWL;AAAA,QACX,GAAGL;AAAA,MAAA;AAAA,MAEL,KAAAC;AAAA,MACA,SAASM,MAAc;AAAA,IAAA,CACxB;AACD,WAAIC,KAGF,gBAAAjB;AAAA,MAACoB;AAAAA,MAAA;AAAA,QACC,KAAAV;AAAA,QACA,aAAU;AAAA,QACJ,CAACS,CAAS,GAAG;AAAA,QACnB,WAAWL;AAAA,QAGX,MAAK;AAAA,QACJ,GAAGL;AAAA,QAEH,UAAAd,GAAmB7C,GAAU6D,EAAO,KAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAGhD;AACF;"}
@@ -1,17 +1,17 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import * as n from "react";
3
- import { Checkbox as m, CheckboxIndicator as x } from "../../vendor/.bun/@radix-ui_react-checkbox@1.3.3_2b23df507bdda662/vendor/@radix-ui/react-checkbox/dist/index.js";
4
- import { SLOT_ATTR as i, mergeClasses as u, shorthands as e } from "@epilot/zenith-runtime/v1";
5
- import { makeZenithStyles as b } from "../../styles/make-styles.js";
6
- import { boxModel as p, nativeControl as f } from "../../styles/host-reset.js";
7
- import { accentContrast as g, accentSolid as k, accentOnSoft as C, accentA7 as s, focusRing as d, radiusSm as w, accentSoft as v, errorA8 as S, grayA4 as y } from "../../tokens/index.js";
8
- const T = n.forwardRef(function(r, t) {
2
+ import * as i from "react";
3
+ import { Checkbox as u } from "../../_virtual/_zenith-runtime-family_checkbox.js";
4
+ import { SLOT_ATTR as n, mergeClasses as C, shorthands as e } from "@epilot/zenith-runtime/v1";
5
+ import { makeZenithStyles as v } from "../../styles/make-styles.js";
6
+ import { boxModel as S, nativeControl as T } from "../../styles/host-reset.js";
7
+ import { accentContrast as y, accentSolid as q, accentOnSoft as R, accentA7 as b, focusRing as x, radiusSm as I, accentSoft as M, errorA8 as O, grayA4 as A } from "../../tokens/index.js";
8
+ const L = i.forwardRef(function(r, t) {
9
9
  return /* @__PURE__ */ o(
10
10
  "svg",
11
11
  {
12
12
  ref: t,
13
13
  "data-slot": "checkbox-check-icon",
14
- [i]: "checkbox-check-icon",
14
+ [n]: "checkbox-check-icon",
15
15
  xmlns: "http://www.w3.org/2000/svg",
16
16
  height: "24px",
17
17
  viewBox: "0 -960 960 960",
@@ -21,13 +21,13 @@ const T = n.forwardRef(function(r, t) {
21
21
  children: /* @__PURE__ */ o("path", { d: "m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z" })
22
22
  }
23
23
  );
24
- }), q = n.forwardRef(function(r, t) {
24
+ }), B = i.forwardRef(function(r, t) {
25
25
  return /* @__PURE__ */ o(
26
26
  "svg",
27
27
  {
28
28
  ref: t,
29
29
  "data-slot": "checkbox-minus-icon",
30
- [i]: "checkbox-minus-icon",
30
+ [n]: "checkbox-minus-icon",
31
31
  xmlns: "http://www.w3.org/2000/svg",
32
32
  height: "24px",
33
33
  viewBox: "0 -960 960 960",
@@ -37,17 +37,17 @@ const T = n.forwardRef(function(r, t) {
37
37
  children: /* @__PURE__ */ o("path", { d: "M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z" })
38
38
  }
39
39
  );
40
- }), R = b({
40
+ }), E = v({
41
41
  root: {
42
- ...f,
43
- ...e.border("1px", "solid", s),
44
- backgroundColor: v,
42
+ ...T,
43
+ ...e.border("1px", "solid", b),
44
+ backgroundColor: M,
45
45
  display: "inline-block",
46
46
  boxSizing: "border-box",
47
47
  width: "1rem",
48
48
  height: "1rem",
49
49
  flexShrink: 0,
50
- borderRadius: w,
50
+ borderRadius: I,
51
51
  // v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).
52
52
  boxShadow: "0 1px 2px 0 #0000000d",
53
53
  transitionProperty: "box-shadow",
@@ -60,34 +60,34 @@ const T = n.forwardRef(function(r, t) {
60
60
  outlineOffset: "2px",
61
61
  outlineWidth: "2px",
62
62
  outlineStyle: "solid",
63
- outlineColor: d
63
+ outlineColor: x
64
64
  },
65
65
  "&[data-disabled]": {
66
66
  cursor: "not-allowed",
67
67
  opacity: 0.5,
68
- ...e.borderColor(y)
68
+ ...e.borderColor(A)
69
69
  },
70
70
  "&[aria-invalid='true']": {
71
- outlineColor: d,
72
- ...e.borderColor(S)
71
+ outlineColor: x,
72
+ ...e.borderColor(O)
73
73
  },
74
- "&[data-state='indeterminate']": {
75
- backgroundColor: s,
74
+ "&[data-indeterminate]": {
75
+ backgroundColor: b,
76
76
  ...e.borderColor("transparent"),
77
- color: C
77
+ color: R
78
78
  },
79
- "&[data-state='checked']": {
80
- backgroundColor: k,
79
+ "&[data-checked]": {
80
+ backgroundColor: q,
81
81
  ...e.borderWidth("0px"),
82
- color: g
82
+ color: y
83
83
  },
84
- "&[data-state='checked'] svg, &[data-state='indeterminate'] svg": {
84
+ "&[data-checked] svg, &[data-indeterminate] svg": {
85
85
  width: "0.875rem",
86
86
  height: "0.875rem"
87
87
  }
88
88
  },
89
89
  indicator: {
90
- ...p,
90
+ ...S,
91
91
  display: "grid",
92
92
  placeContent: "center",
93
93
  height: "100%",
@@ -98,30 +98,47 @@ const T = n.forwardRef(function(r, t) {
98
98
  height: "0.875rem"
99
99
  }
100
100
  }
101
- }), z = n.forwardRef(function({ className: r, checked: t, ...l }, h) {
102
- const a = R();
103
- return /* @__PURE__ */ o(
104
- m,
105
- {
106
- ref: h,
107
- checked: t,
108
- "data-slot": "checkbox",
109
- [i]: "checkbox",
110
- className: u(a.root, r),
111
- ...l,
112
- children: /* @__PURE__ */ o(
113
- x,
114
- {
115
- "data-slot": "checkbox-indicator",
116
- [i]: "checkbox-indicator",
117
- className: a.indicator,
118
- children: t === "indeterminate" ? /* @__PURE__ */ o(q, {}) : /* @__PURE__ */ o(T, {})
119
- }
120
- )
121
- }
122
- );
123
- });
101
+ }), N = /* @__PURE__ */ o("button", {}), F = i.forwardRef(
102
+ function({
103
+ className: r,
104
+ checked: t,
105
+ defaultChecked: p,
106
+ onCheckedChange: c,
107
+ asChild: Z,
108
+ value: s,
109
+ ...f
110
+ }, g) {
111
+ const l = E(), [k, w] = i.useState(p ?? !1), a = t === void 0 ? k : t;
112
+ return /* @__PURE__ */ o(
113
+ u.Root,
114
+ {
115
+ ref: g,
116
+ nativeButton: !0,
117
+ render: N,
118
+ checked: a === !0,
119
+ indeterminate: a === "indeterminate",
120
+ onCheckedChange: (h, m) => {
121
+ c == null || c(h, m), m.isCanceled || w(h);
122
+ },
123
+ value: s === void 0 ? void 0 : String(s),
124
+ "data-slot": "checkbox",
125
+ [n]: "checkbox",
126
+ className: C(l.root, r),
127
+ ...f,
128
+ children: /* @__PURE__ */ o(
129
+ u.Indicator,
130
+ {
131
+ "data-slot": "checkbox-indicator",
132
+ [n]: "checkbox-indicator",
133
+ className: l.indicator,
134
+ children: a === "indeterminate" ? /* @__PURE__ */ o(B, {}) : /* @__PURE__ */ o(L, {})
135
+ }
136
+ )
137
+ }
138
+ );
139
+ }
140
+ );
124
141
  export {
125
- z as Checkbox
142
+ F as Checkbox
126
143
  };
127
144
  //# sourceMappingURL=checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\nconst CheckIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function CheckIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-check-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-check-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z\" />\n </svg>\n )\n})\n\nconst MinusIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function MinusIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-minus-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-minus-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z\" />\n </svg>\n )\n})\n\nconst useStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n ...shorthands.border(\"1px\", \"solid\", tokens.accentA7),\n backgroundColor: tokens.accentSoft,\n display: \"inline-block\",\n boxSizing: \"border-box\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n borderRadius: tokens.radiusSm,\n // v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).\n boxShadow: \"0 1px 2px 0 #0000000d\",\n transitionProperty: \"box-shadow\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.focusRing,\n },\n \"&[data-disabled]\": {\n cursor: \"not-allowed\",\n opacity: 0.5,\n ...shorthands.borderColor(tokens.grayA4),\n },\n \"&[aria-invalid='true']\": {\n outlineColor: tokens.focusRing,\n ...shorthands.borderColor(tokens.errorA8),\n },\n \"&[data-state='indeterminate']\": {\n backgroundColor: tokens.accentA7,\n ...shorthands.borderColor(\"transparent\"),\n color: tokens.accentOnSoft,\n },\n \"&[data-state='checked']\": {\n backgroundColor: tokens.accentSolid,\n ...shorthands.borderWidth(\"0px\"),\n color: tokens.accentContrast,\n },\n \"&[data-state='checked'] svg, &[data-state='indeterminate'] svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n indicator: {\n ...boxModel,\n display: \"grid\",\n placeContent: \"center\",\n height: \"100%\",\n color: \"currentColor\",\n transitionProperty: \"none\",\n \"& svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n})\n\nexport type CheckboxProps = React.ComponentProps<typeof CheckboxPrimitive.Root>\n\nexport const Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(function Checkbox({ className, checked, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n checked={checked}\n data-slot=\"checkbox\"\n {...{ [SLOT_ATTR]: \"checkbox\" }}\n className={mergeClasses(styles.root, className)}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n {...{ [SLOT_ATTR]: \"checkbox-indicator\" }}\n className={styles.indicator}\n >\n {checked === \"indeterminate\" ? <MinusIcon /> : <CheckIcon />}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n})\n"],"names":["CheckIcon","React","props","ref","jsx","SLOT_ATTR","MinusIcon","useStyles","makeZenithStyles","nativeControl","shorthands","tokens.accentA7","tokens.accentSoft","tokens.radiusSm","tokens.focusRing","tokens.grayA4","tokens.errorA8","tokens.accentOnSoft","tokens.accentSolid","tokens.accentContrast","boxModel","Checkbox","className","checked","styles","CheckboxPrimitive.Root","mergeClasses","CheckboxPrimitive.Indicator"],"mappings":";;;;;;;AASA,MAAMA,IAAYC,EAAM,WAGtB,SAAmBC,GAAOC,GAAK;AAC/B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GAAG;AAAA,MACnB,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAGH;AAAA,MAEJ,UAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,uJAAA,CAAuJ;AAAA,IAAA;AAAA,EAAA;AAGrK,CAAC,GAEKE,IAAYL,EAAM,WAGtB,SAAmBC,GAAOC,GAAK;AAC/B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GAAG;AAAA,MACnB,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAGH;AAAA,MAEJ,UAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,iHAAA,CAAiH;AAAA,IAAA;AAAA,EAAA;AAG/H,CAAC,GAEKG,IAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,GAAGC,EAAW,OAAO,OAAO,SAASC,CAAe;AAAA,IACpD,iBAAiBC;AAAAA,IACjB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,cAAcC;AAAAA;AAAAA,IAEd,WAAW;AAAA,IACX,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,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EJ,UAAA,gBAAAE;AAAA,QAACuB;AAAAA,QAAA;AAAA,UACC,aAAU;AAAA,UACJ,CAACtB,CAAS,GAAG;AAAA,UACnB,WAAWmB,EAAO;AAAA,UAEjB,gBAAY,kBAAkB,gBAAApB,EAACE,GAAA,EAAU,sBAAMN,GAAA,CAAA,CAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5D;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\nconst CheckIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function CheckIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-check-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-check-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z\" />\n </svg>\n )\n})\n\nconst MinusIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function MinusIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-minus-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-minus-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z\" />\n </svg>\n )\n})\n\nconst useStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n ...shorthands.border(\"1px\", \"solid\", tokens.accentA7),\n backgroundColor: tokens.accentSoft,\n display: \"inline-block\",\n boxSizing: \"border-box\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n borderRadius: tokens.radiusSm,\n // v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).\n boxShadow: \"0 1px 2px 0 #0000000d\",\n transitionProperty: \"box-shadow\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.focusRing,\n },\n \"&[data-disabled]\": {\n cursor: \"not-allowed\",\n opacity: 0.5,\n ...shorthands.borderColor(tokens.grayA4),\n },\n \"&[aria-invalid='true']\": {\n outlineColor: tokens.focusRing,\n ...shorthands.borderColor(tokens.errorA8),\n },\n \"&[data-indeterminate]\": {\n backgroundColor: tokens.accentA7,\n ...shorthands.borderColor(\"transparent\"),\n color: tokens.accentOnSoft,\n },\n \"&[data-checked]\": {\n backgroundColor: tokens.accentSolid,\n ...shorthands.borderWidth(\"0px\"),\n color: tokens.accentContrast,\n },\n \"&[data-checked] svg, &[data-indeterminate] svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n indicator: {\n ...boxModel,\n display: \"grid\",\n placeContent: \"center\",\n height: \"100%\",\n color: \"currentColor\",\n transitionProperty: \"none\",\n \"& svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n})\n\n/**\n * `checked` and `defaultChecked` accept the same three states as on Radix; Base UI models the third\n * as its own `indeterminate` boolean, which the wrapper sets.\n */\nexport type CheckboxCheckedState = boolean | \"indeterminate\"\n\n/**\n * What `onCheckedChange` receives as its second argument: Base UI's change details, declared in\n * Zenith so that none of Base UI's internals reach the published declarations, where TypeScript 4\n * cannot parse them.\n */\ntype CheckboxCheckedChangeDetails = {\n /** Why the checkbox changed. Base UI reports every checkbox change as `none`. */\n reason: \"none\"\n /** The native event behind the change. */\n event: Event\n /** Keeps the checkbox in its current state. */\n cancel: () => void\n /** Lets the event propagate where the checkbox would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n}\n\n/**\n * The checkbox props Base UI adds to a `<button>`'s, declared in Zenith with Base UI's types, apart\n * from the three-state `checked`, `defaultChecked` and `onCheckedChange`, which keep their Radix\n * shape. The root renders a native `<button>`, so the DOM attributes, handlers, `ref`, `key`,\n * `className`, `style` and `value` stay the button's, as they were on Radix; `render`,\n * `nativeButton`, `indeterminate` and `parent` are not part of the surface.\n */\ntype CheckboxRootProps = {\n /**\n * Whether the checkbox is currently checked, or `\"indeterminate\"`.\n *\n * To render an uncontrolled checkbox, use the `defaultChecked` prop instead.\n */\n checked?: CheckboxCheckedState | undefined\n /** Whether the checkbox is initially checked, or `\"indeterminate\"`. */\n defaultChecked?: CheckboxCheckedState | undefined\n /** Whether the component should ignore user interaction. */\n disabled?: boolean | undefined\n /** A ref to access the hidden `<input>` element. */\n inputRef?: React.Ref<HTMLInputElement> | undefined\n /** Identifies the field when a form is submitted. */\n name?: string | undefined\n /**\n * Identifies the form that owns the hidden input.\n * Useful when the checkbox is rendered outside the form.\n */\n form?: string | undefined\n /**\n * Event handler called when the checkbox is checked or unchecked. Clicking an indeterminate\n * checkbox reports `true`.\n */\n onCheckedChange?:\n | ((\n checked: CheckboxCheckedState,\n eventDetails: CheckboxCheckedChangeDetails\n ) => void)\n | undefined\n /** Whether the user should be unable to check or uncheck the checkbox. */\n readOnly?: boolean | undefined\n /** Whether the user must check the checkbox before submitting a form. */\n required?: boolean | undefined\n /**\n * The value submitted with the form when the checkbox is unchecked.\n * By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.\n */\n uncheckedValue?: string | undefined\n}\n\nexport type CheckboxProps = Omit<\n React.ComponentPropsWithRef<\"button\">,\n keyof CheckboxRootProps\n> &\n CheckboxRootProps & {\n /**\n * @deprecated Has no effect. The indicator is the checkbox's only child, so on Radix this\n * rendered the indicator as the checkbox rather than an element of yours. Remove it.\n */\n asChild?: boolean\n }\n\n// Base UI renders a <span> by default and moves the caller's id onto its hidden input. A native\n// button keeps the id, the HTMLButtonElement ref, native disabled and <label for> as Radix had them.\nconst ROOT_ELEMENT = <button />\n\nexport const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n function Checkbox(\n {\n className,\n checked,\n defaultChecked,\n onCheckedChange,\n asChild: _asChild,\n value,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n // Base UI has no third state to start from or to hold uncontrolled, so the state lives here\n // and Base UI is always controlled; a cancelled change leaves it as it was.\n const [uncontrolled, setUncontrolled] =\n React.useState<CheckboxCheckedState>(defaultChecked ?? false)\n const state = checked === undefined ? uncontrolled : checked\n\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n nativeButton\n render={ROOT_ELEMENT}\n checked={state === true}\n indeterminate={state === \"indeterminate\"}\n onCheckedChange={(next, details) => {\n onCheckedChange?.(next, details)\n if (!details.isCanceled) setUncontrolled(next)\n }}\n // Radix took the button's value type; Base UI submits a string, so it is converted here\n // the way the button's value attribute stringified it.\n value={value === undefined ? undefined : String(value)}\n data-slot=\"checkbox\"\n {...{ [SLOT_ATTR]: \"checkbox\" }}\n className={mergeClasses(styles.root, className)}\n // Base UI types the root's handlers for its default <span>; the element is the button\n // above, so the caller's button-typed handlers receive exactly the events they declare.\n {...(props as CheckboxPrimitive.Root.Props)}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n {...{ [SLOT_ATTR]: \"checkbox-indicator\" }}\n className={styles.indicator}\n >\n {state === \"indeterminate\" ? <MinusIcon /> : <CheckIcon />}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n }\n)\n"],"names":["CheckIcon","React","props","ref","jsx","SLOT_ATTR","MinusIcon","useStyles","makeZenithStyles","nativeControl","shorthands","tokens.accentA7","tokens.accentSoft","tokens.radiusSm","tokens.focusRing","tokens.grayA4","tokens.errorA8","tokens.accentOnSoft","tokens.accentSolid","tokens.accentContrast","boxModel","ROOT_ELEMENT","Checkbox","className","checked","defaultChecked","onCheckedChange","_asChild","value","styles","uncontrolled","setUncontrolled","state","CheckboxPrimitive","next","details","mergeClasses"],"mappings":";;;;;;;AASA,MAAMA,IAAYC,EAAM,WAGtB,SAAmBC,GAAOC,GAAK;AAC/B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GAAG;AAAA,MACnB,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAGH;AAAA,MAEJ,UAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,uJAAA,CAAuJ;AAAA,IAAA;AAAA,EAAA;AAGrK,CAAC,GAEKE,IAAYL,EAAM,WAGtB,SAAmBC,GAAOC,GAAK;AAC/B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GAAG;AAAA,MACnB,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAGH;AAAA,MAEJ,UAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,iHAAA,CAAiH;AAAA,IAAA;AAAA,EAAA;AAG/H,CAAC,GAEKG,IA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