@womp/kookie-ui 0.23.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/components.css +190 -185
  2. package/dist/cjs/components/_internal/base-button.d.ts +11 -1
  3. package/dist/cjs/components/_internal/base-button.d.ts.map +1 -1
  4. package/dist/cjs/components/_internal/base-button.js +1 -1
  5. package/dist/cjs/components/_internal/base-button.js.map +4 -4
  6. package/dist/cjs/components/_internal/menu-context.d.ts +2 -0
  7. package/dist/cjs/components/_internal/menu-context.d.ts.map +1 -1
  8. package/dist/cjs/components/_internal/menu-context.js +1 -1
  9. package/dist/cjs/components/_internal/menu-context.js.map +3 -3
  10. package/dist/cjs/components/_internal/pane-chrome.d.ts +17 -2
  11. package/dist/cjs/components/_internal/pane-chrome.d.ts.map +1 -1
  12. package/dist/cjs/components/_internal/pane-chrome.js +1 -1
  13. package/dist/cjs/components/_internal/pane-chrome.js.map +4 -4
  14. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  15. package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
  16. package/dist/cjs/components/accordion.d.ts +2 -2
  17. package/dist/cjs/components/accordion.d.ts.map +1 -1
  18. package/dist/cjs/components/accordion.js +1 -1
  19. package/dist/cjs/components/accordion.js.map +4 -4
  20. package/dist/cjs/components/alert-dialog.d.ts.map +1 -1
  21. package/dist/cjs/components/alert-dialog.js +1 -1
  22. package/dist/cjs/components/alert-dialog.js.map +3 -3
  23. package/dist/cjs/components/avatar.d.ts +1 -1
  24. package/dist/cjs/components/avatar.d.ts.map +1 -1
  25. package/dist/cjs/components/avatar.js +1 -1
  26. package/dist/cjs/components/avatar.js.map +3 -3
  27. package/dist/cjs/components/avatar.props.d.ts +8 -0
  28. package/dist/cjs/components/avatar.props.d.ts.map +1 -1
  29. package/dist/cjs/components/avatar.props.js +1 -1
  30. package/dist/cjs/components/avatar.props.js.map +2 -2
  31. package/dist/cjs/components/blockquote.d.ts +1 -1
  32. package/dist/cjs/components/blockquote.d.ts.map +1 -1
  33. package/dist/cjs/components/blockquote.js +1 -1
  34. package/dist/cjs/components/blockquote.js.map +4 -4
  35. package/dist/cjs/components/button.js +1 -1
  36. package/dist/cjs/components/button.js.map +4 -4
  37. package/dist/cjs/components/chatbar.d.ts.map +1 -1
  38. package/dist/cjs/components/chatbar.js +1 -1
  39. package/dist/cjs/components/chatbar.js.map +4 -4
  40. package/dist/cjs/components/checkbox-group.d.ts.map +1 -1
  41. package/dist/cjs/components/checkbox-group.js +1 -1
  42. package/dist/cjs/components/checkbox-group.js.map +3 -3
  43. package/dist/cjs/components/checkbox-group.primitive.d.ts +12 -5
  44. package/dist/cjs/components/checkbox-group.primitive.d.ts.map +1 -1
  45. package/dist/cjs/components/checkbox-group.primitive.js +1 -1
  46. package/dist/cjs/components/checkbox-group.primitive.js.map +3 -3
  47. package/dist/cjs/components/checkbox.js +1 -1
  48. package/dist/cjs/components/checkbox.js.map +3 -3
  49. package/dist/cjs/components/chip.d.ts.map +1 -1
  50. package/dist/cjs/components/chip.js +1 -1
  51. package/dist/cjs/components/chip.js.map +3 -3
  52. package/dist/cjs/components/code.d.ts.map +1 -1
  53. package/dist/cjs/components/code.js +1 -1
  54. package/dist/cjs/components/code.js.map +2 -2
  55. package/dist/cjs/components/combobox.js +1 -1
  56. package/dist/cjs/components/combobox.js.map +3 -3
  57. package/dist/cjs/components/context-menu.d.ts.map +1 -1
  58. package/dist/cjs/components/context-menu.js +1 -1
  59. package/dist/cjs/components/context-menu.js.map +4 -4
  60. package/dist/cjs/components/dialog.d.ts +1 -1
  61. package/dist/cjs/components/dialog.d.ts.map +1 -1
  62. package/dist/cjs/components/dialog.js +1 -1
  63. package/dist/cjs/components/dialog.js.map +3 -3
  64. package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
  65. package/dist/cjs/components/dropdown-menu.js +1 -1
  66. package/dist/cjs/components/dropdown-menu.js.map +4 -4
  67. package/dist/cjs/components/icons.d.ts +3 -1
  68. package/dist/cjs/components/icons.d.ts.map +1 -1
  69. package/dist/cjs/components/icons.js +1 -1
  70. package/dist/cjs/components/icons.js.map +3 -3
  71. package/dist/cjs/components/index.d.ts +1 -1
  72. package/dist/cjs/components/index.d.ts.map +1 -1
  73. package/dist/cjs/components/index.js +2 -10
  74. package/dist/cjs/components/index.js.map +4 -4
  75. package/dist/cjs/components/message-scroller.d.ts.map +1 -1
  76. package/dist/cjs/components/message-scroller.js +1 -1
  77. package/dist/cjs/components/message-scroller.js.map +4 -4
  78. package/dist/cjs/components/navbar.d.ts.map +1 -1
  79. package/dist/cjs/components/navbar.js +1 -1
  80. package/dist/cjs/components/navbar.js.map +3 -3
  81. package/dist/cjs/components/notice.d.ts +4 -1
  82. package/dist/cjs/components/notice.d.ts.map +1 -1
  83. package/dist/cjs/components/notice.js +1 -1
  84. package/dist/cjs/components/notice.js.map +4 -4
  85. package/dist/cjs/components/progress.d.ts.map +1 -1
  86. package/dist/cjs/components/progress.js +1 -1
  87. package/dist/cjs/components/progress.js.map +3 -3
  88. package/dist/cjs/components/schemas/button.schema.d.ts +2 -2
  89. package/dist/cjs/components/schemas/toggle.schema.d.ts +1 -1
  90. package/dist/cjs/components/scroll-area.d.ts +3 -1
  91. package/dist/cjs/components/scroll-area.d.ts.map +1 -1
  92. package/dist/cjs/components/scroll-area.js +1 -1
  93. package/dist/cjs/components/scroll-area.js.map +4 -4
  94. package/dist/cjs/components/segmented-control.d.ts +3 -1
  95. package/dist/cjs/components/segmented-control.d.ts.map +1 -1
  96. package/dist/cjs/components/segmented-control.js +1 -1
  97. package/dist/cjs/components/segmented-control.js.map +3 -3
  98. package/dist/cjs/components/select.d.ts.map +1 -1
  99. package/dist/cjs/components/select.js +1 -1
  100. package/dist/cjs/components/select.js.map +3 -3
  101. package/dist/cjs/components/separator.d.ts.map +1 -1
  102. package/dist/cjs/components/separator.js +1 -1
  103. package/dist/cjs/components/separator.js.map +3 -3
  104. package/dist/cjs/components/sheet.d.ts +1 -0
  105. package/dist/cjs/components/sheet.d.ts.map +1 -1
  106. package/dist/cjs/components/sheet.js +1 -1
  107. package/dist/cjs/components/sheet.js.map +3 -3
  108. package/dist/cjs/components/shell.d.ts +12 -1
  109. package/dist/cjs/components/shell.d.ts.map +1 -1
  110. package/dist/cjs/components/shell.js +1 -1
  111. package/dist/cjs/components/shell.js.map +4 -4
  112. package/dist/cjs/components/sidebar.d.ts.map +1 -1
  113. package/dist/cjs/components/sidebar.js +1 -1
  114. package/dist/cjs/components/sidebar.js.map +4 -4
  115. package/dist/cjs/components/slider.d.ts.map +1 -1
  116. package/dist/cjs/components/slider.js +1 -1
  117. package/dist/cjs/components/slider.js.map +3 -3
  118. package/dist/cjs/components/spinner.d.ts.map +1 -1
  119. package/dist/cjs/components/spinner.js +1 -1
  120. package/dist/cjs/components/spinner.js.map +3 -3
  121. package/dist/cjs/components/table.d.ts.map +1 -1
  122. package/dist/cjs/components/table.js +1 -1
  123. package/dist/cjs/components/table.js.map +4 -4
  124. package/dist/cjs/components/tabs.d.ts.map +1 -1
  125. package/dist/cjs/components/tabs.js +1 -1
  126. package/dist/cjs/components/tabs.js.map +2 -2
  127. package/dist/cjs/components/text-area.js +1 -1
  128. package/dist/cjs/components/text-area.js.map +2 -2
  129. package/dist/cjs/components/text-field.js +2 -2
  130. package/dist/cjs/components/text-field.js.map +2 -2
  131. package/dist/cjs/components/toggle.d.ts +3 -2
  132. package/dist/cjs/components/toggle.d.ts.map +1 -1
  133. package/dist/cjs/components/toggle.js +1 -9
  134. package/dist/cjs/components/toggle.js.map +4 -4
  135. package/dist/cjs/components/toolbar.d.ts +80 -8
  136. package/dist/cjs/components/toolbar.d.ts.map +1 -1
  137. package/dist/cjs/components/toolbar.js +1 -1
  138. package/dist/cjs/components/toolbar.js.map +4 -4
  139. package/dist/cjs/components/virtual-menu.d.ts +3 -5
  140. package/dist/cjs/components/virtual-menu.d.ts.map +1 -1
  141. package/dist/cjs/components/virtual-menu.js +1 -1
  142. package/dist/cjs/components/virtual-menu.js.map +3 -3
  143. package/dist/cjs/helpers/extract-margin-props.d.ts +7 -7
  144. package/dist/cjs/hooks/use-scroll-edges.d.ts +4 -2
  145. package/dist/cjs/hooks/use-scroll-edges.d.ts.map +1 -1
  146. package/dist/cjs/hooks/use-scroll-edges.js +1 -1
  147. package/dist/cjs/hooks/use-scroll-edges.js.map +3 -3
  148. package/dist/cjs/index.js +5 -5
  149. package/dist/cjs/index.js.map +4 -4
  150. package/dist/cjs/props/index.js +1 -1
  151. package/dist/cjs/props/index.js.map +2 -2
  152. package/dist/esm/chunk-3VTS4C63.js +2 -0
  153. package/dist/esm/chunk-3VTS4C63.js.map +7 -0
  154. package/dist/esm/chunk-3WE4E2WQ.js +2 -0
  155. package/dist/esm/chunk-3WE4E2WQ.js.map +7 -0
  156. package/dist/esm/chunk-3XUY5WFA.js +2 -0
  157. package/dist/esm/chunk-3XUY5WFA.js.map +7 -0
  158. package/dist/esm/chunk-3XZOE2IQ.js +2 -0
  159. package/dist/esm/chunk-3XZOE2IQ.js.map +7 -0
  160. package/dist/esm/chunk-432YLNB3.js +2 -0
  161. package/dist/esm/chunk-432YLNB3.js.map +7 -0
  162. package/dist/esm/chunk-4QKZYCCH.js +2 -0
  163. package/dist/esm/chunk-4QKZYCCH.js.map +7 -0
  164. package/dist/esm/chunk-4R5EMVB3.js +2 -0
  165. package/dist/esm/chunk-4R5EMVB3.js.map +7 -0
  166. package/dist/esm/chunk-4ZOVV3TY.js +2 -0
  167. package/dist/esm/chunk-4ZOVV3TY.js.map +7 -0
  168. package/dist/esm/{chunk-IX5HIHVI.js → chunk-62ZGP4ET.js} +2 -2
  169. package/dist/esm/{chunk-IX5HIHVI.js.map → chunk-62ZGP4ET.js.map} +3 -3
  170. package/dist/esm/chunk-BGAJ2MDF.js +2 -0
  171. package/dist/esm/chunk-BGAJ2MDF.js.map +7 -0
  172. package/dist/esm/chunk-CHPT42BY.js +2 -0
  173. package/dist/esm/{chunk-Y3JYEEFB.js.map → chunk-CHPT42BY.js.map} +2 -2
  174. package/dist/esm/{chunk-KS4U4VPH.js → chunk-CMHUK7OG.js} +2 -2
  175. package/dist/esm/{chunk-KS4U4VPH.js.map → chunk-CMHUK7OG.js.map} +2 -2
  176. package/dist/esm/chunk-CN6F4REJ.js +2 -0
  177. package/dist/esm/chunk-CN6F4REJ.js.map +7 -0
  178. package/dist/esm/chunk-DUTZUWZP.js +2 -0
  179. package/dist/esm/chunk-DUTZUWZP.js.map +7 -0
  180. package/dist/esm/chunk-FDJV5RXX.js +2 -0
  181. package/dist/esm/chunk-FDJV5RXX.js.map +7 -0
  182. package/dist/esm/chunk-G2JD52O5.js +2 -0
  183. package/dist/esm/{chunk-23KT3D2Z.js.map → chunk-G2JD52O5.js.map} +3 -3
  184. package/dist/esm/{chunk-6DDOR73D.js → chunk-G4ETY2NP.js} +2 -2
  185. package/dist/esm/chunk-GPOCLDBR.js +2 -0
  186. package/dist/esm/chunk-GPOCLDBR.js.map +7 -0
  187. package/dist/esm/chunk-GYP66ZK2.js +2 -0
  188. package/dist/esm/chunk-GYP66ZK2.js.map +7 -0
  189. package/dist/esm/chunk-H5BYPX6V.js +2 -0
  190. package/dist/esm/chunk-H5BYPX6V.js.map +7 -0
  191. package/dist/esm/chunk-H5G7UECV.js +2 -0
  192. package/dist/esm/chunk-H5G7UECV.js.map +7 -0
  193. package/dist/esm/chunk-I4FLQELQ.js +2 -0
  194. package/dist/esm/chunk-I4FLQELQ.js.map +7 -0
  195. package/dist/esm/chunk-JYQGCXXI.js +2 -0
  196. package/dist/esm/chunk-JYQGCXXI.js.map +7 -0
  197. package/dist/esm/chunk-KA5UE2VN.js +2 -0
  198. package/dist/esm/chunk-KA5UE2VN.js.map +7 -0
  199. package/dist/esm/{chunk-QGCXTULQ.js → chunk-KEGCX5VM.js} +2 -2
  200. package/dist/esm/chunk-KVHKPUZ2.js +2 -0
  201. package/dist/esm/chunk-KVHKPUZ2.js.map +7 -0
  202. package/dist/esm/{chunk-FFG32ERA.js → chunk-N3WBEQWL.js} +3 -3
  203. package/dist/esm/chunk-N3WBEQWL.js.map +7 -0
  204. package/dist/esm/{chunk-HKPXDQ2B.js → chunk-NC3CJUE3.js} +2 -2
  205. package/dist/esm/chunk-P2MV6HLA.js +2 -0
  206. package/dist/esm/{chunk-7SS4UUJH.js.map → chunk-P2MV6HLA.js.map} +3 -3
  207. package/dist/esm/chunk-PALE5UWK.js +2 -0
  208. package/dist/esm/{chunk-DSPYHO3L.js.map → chunk-PALE5UWK.js.map} +2 -2
  209. package/dist/esm/chunk-PDMCLVYT.js +2 -0
  210. package/dist/esm/chunk-PDMCLVYT.js.map +7 -0
  211. package/dist/esm/chunk-PM6QY3JO.js +2 -0
  212. package/dist/esm/{chunk-ZEX2DECM.js.map → chunk-PM6QY3JO.js.map} +3 -3
  213. package/dist/esm/chunk-RKZVXVBN.js +2 -0
  214. package/dist/esm/chunk-RKZVXVBN.js.map +7 -0
  215. package/dist/esm/chunk-TXQZ5HLV.js +2 -0
  216. package/dist/esm/chunk-TXQZ5HLV.js.map +7 -0
  217. package/dist/esm/chunk-UKASIY6M.js +2 -0
  218. package/dist/esm/chunk-UKASIY6M.js.map +7 -0
  219. package/dist/esm/{chunk-OJQNLROL.js → chunk-UY6WJUNA.js} +2 -2
  220. package/dist/esm/chunk-V5O3TF57.js +2 -0
  221. package/dist/esm/{chunk-3KQE2PSJ.js.map → chunk-V5O3TF57.js.map} +3 -3
  222. package/dist/esm/chunk-VUNCI6A6.js +2 -0
  223. package/dist/esm/chunk-VUNCI6A6.js.map +7 -0
  224. package/dist/esm/{chunk-JBHRV364.js → chunk-VUPIJNG2.js} +2 -2
  225. package/dist/esm/chunk-W6BN5QLH.js +2 -0
  226. package/dist/esm/{chunk-ZNDCZM5A.js.map → chunk-W6BN5QLH.js.map} +2 -2
  227. package/dist/esm/chunk-WG5ORTIW.js +2 -0
  228. package/dist/esm/chunk-WG5ORTIW.js.map +7 -0
  229. package/dist/esm/chunk-WMVR2XBR.js +2 -0
  230. package/dist/esm/{chunk-XKSU3NLG.js.map → chunk-WMVR2XBR.js.map} +2 -2
  231. package/dist/esm/{chunk-NNZTSXKH.js → chunk-WX7SX5BN.js} +2 -2
  232. package/dist/esm/chunk-XOACTIBL.js +2 -0
  233. package/dist/esm/chunk-XOACTIBL.js.map +7 -0
  234. package/dist/esm/components/_internal/base-button.d.ts +11 -1
  235. package/dist/esm/components/_internal/base-button.d.ts.map +1 -1
  236. package/dist/esm/components/_internal/base-button.js +1 -1
  237. package/dist/esm/components/_internal/menu-context.d.ts +2 -0
  238. package/dist/esm/components/_internal/menu-context.d.ts.map +1 -1
  239. package/dist/esm/components/_internal/menu-context.js +1 -1
  240. package/dist/esm/components/_internal/pane-chrome.d.ts +17 -2
  241. package/dist/esm/components/_internal/pane-chrome.d.ts.map +1 -1
  242. package/dist/esm/components/_internal/pane-chrome.js +1 -1
  243. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  244. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  245. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  246. package/dist/esm/components/accordion.d.ts +2 -2
  247. package/dist/esm/components/accordion.d.ts.map +1 -1
  248. package/dist/esm/components/accordion.js +1 -1
  249. package/dist/esm/components/alert-dialog.d.ts.map +1 -1
  250. package/dist/esm/components/alert-dialog.js +1 -1
  251. package/dist/esm/components/avatar.d.ts +1 -1
  252. package/dist/esm/components/avatar.d.ts.map +1 -1
  253. package/dist/esm/components/avatar.js +1 -1
  254. package/dist/esm/components/avatar.props.d.ts +8 -0
  255. package/dist/esm/components/avatar.props.d.ts.map +1 -1
  256. package/dist/esm/components/avatar.props.js +1 -1
  257. package/dist/esm/components/blockquote.d.ts +1 -1
  258. package/dist/esm/components/blockquote.d.ts.map +1 -1
  259. package/dist/esm/components/blockquote.js +1 -1
  260. package/dist/esm/components/button.js +1 -1
  261. package/dist/esm/components/chatbar.d.ts.map +1 -1
  262. package/dist/esm/components/chatbar.js +1 -1
  263. package/dist/esm/components/checkbox-group.d.ts.map +1 -1
  264. package/dist/esm/components/checkbox-group.js +1 -1
  265. package/dist/esm/components/checkbox-group.primitive.d.ts +12 -5
  266. package/dist/esm/components/checkbox-group.primitive.d.ts.map +1 -1
  267. package/dist/esm/components/checkbox-group.primitive.js +1 -1
  268. package/dist/esm/components/checkbox.js +1 -1
  269. package/dist/esm/components/chip.d.ts.map +1 -1
  270. package/dist/esm/components/chip.js +1 -1
  271. package/dist/esm/components/code.d.ts.map +1 -1
  272. package/dist/esm/components/code.js +1 -1
  273. package/dist/esm/components/combobox.js +1 -1
  274. package/dist/esm/components/context-menu.d.ts.map +1 -1
  275. package/dist/esm/components/context-menu.js +1 -1
  276. package/dist/esm/components/dialog.d.ts +1 -1
  277. package/dist/esm/components/dialog.d.ts.map +1 -1
  278. package/dist/esm/components/dialog.js +1 -1
  279. package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
  280. package/dist/esm/components/dropdown-menu.js +1 -1
  281. package/dist/esm/components/icons.d.ts +3 -1
  282. package/dist/esm/components/icons.d.ts.map +1 -1
  283. package/dist/esm/components/icons.js +1 -1
  284. package/dist/esm/components/index.d.ts +1 -1
  285. package/dist/esm/components/index.d.ts.map +1 -1
  286. package/dist/esm/components/index.js +1 -1
  287. package/dist/esm/components/message-scroller.d.ts.map +1 -1
  288. package/dist/esm/components/message-scroller.js +1 -1
  289. package/dist/esm/components/navbar.d.ts.map +1 -1
  290. package/dist/esm/components/navbar.js +1 -1
  291. package/dist/esm/components/notice.d.ts +4 -1
  292. package/dist/esm/components/notice.d.ts.map +1 -1
  293. package/dist/esm/components/notice.js +1 -1
  294. package/dist/esm/components/progress.d.ts.map +1 -1
  295. package/dist/esm/components/progress.js +1 -1
  296. package/dist/esm/components/schemas/button.schema.d.ts +2 -2
  297. package/dist/esm/components/schemas/toggle.schema.d.ts +1 -1
  298. package/dist/esm/components/scroll-area.d.ts +3 -1
  299. package/dist/esm/components/scroll-area.d.ts.map +1 -1
  300. package/dist/esm/components/scroll-area.js +1 -1
  301. package/dist/esm/components/segmented-control.d.ts +3 -1
  302. package/dist/esm/components/segmented-control.d.ts.map +1 -1
  303. package/dist/esm/components/segmented-control.js +1 -1
  304. package/dist/esm/components/select.d.ts.map +1 -1
  305. package/dist/esm/components/select.js +1 -1
  306. package/dist/esm/components/separator.d.ts.map +1 -1
  307. package/dist/esm/components/separator.js +1 -1
  308. package/dist/esm/components/sheet.d.ts +1 -0
  309. package/dist/esm/components/sheet.d.ts.map +1 -1
  310. package/dist/esm/components/sheet.js +1 -1
  311. package/dist/esm/components/shell.d.ts +12 -1
  312. package/dist/esm/components/shell.d.ts.map +1 -1
  313. package/dist/esm/components/shell.js +1 -1
  314. package/dist/esm/components/sidebar.d.ts.map +1 -1
  315. package/dist/esm/components/sidebar.js +1 -1
  316. package/dist/esm/components/slider.d.ts.map +1 -1
  317. package/dist/esm/components/slider.js +1 -1
  318. package/dist/esm/components/spinner.d.ts.map +1 -1
  319. package/dist/esm/components/spinner.js +1 -1
  320. package/dist/esm/components/table.d.ts.map +1 -1
  321. package/dist/esm/components/table.js +1 -1
  322. package/dist/esm/components/tabs.d.ts.map +1 -1
  323. package/dist/esm/components/tabs.js +1 -1
  324. package/dist/esm/components/text-area.js +1 -1
  325. package/dist/esm/components/text-field.js +1 -1
  326. package/dist/esm/components/toggle.d.ts +3 -2
  327. package/dist/esm/components/toggle.d.ts.map +1 -1
  328. package/dist/esm/components/toggle.js +1 -1
  329. package/dist/esm/components/toolbar.d.ts +80 -8
  330. package/dist/esm/components/toolbar.d.ts.map +1 -1
  331. package/dist/esm/components/toolbar.js +1 -1
  332. package/dist/esm/components/virtual-menu.d.ts +3 -5
  333. package/dist/esm/components/virtual-menu.d.ts.map +1 -1
  334. package/dist/esm/components/virtual-menu.js +1 -1
  335. package/dist/esm/helpers/extract-margin-props.d.ts +7 -7
  336. package/dist/esm/hooks/index.js +1 -1
  337. package/dist/esm/hooks/use-scroll-edges.d.ts +4 -2
  338. package/dist/esm/hooks/use-scroll-edges.d.ts.map +1 -1
  339. package/dist/esm/hooks/use-scroll-edges.js +1 -1
  340. package/dist/esm/index.js +1 -1
  341. package/dist/esm/props/index.js +1 -1
  342. package/package.json +1 -1
  343. package/src/components/_internal/base-button.tsx +51 -12
  344. package/src/components/_internal/base-sidebar-menu.css +8 -0
  345. package/src/components/_internal/menu-context.tsx +11 -0
  346. package/src/components/_internal/pane-chrome.tsx +45 -8
  347. package/src/components/accordion.css +35 -3
  348. package/src/components/accordion.tsx +12 -16
  349. package/src/components/alert-dialog.tsx +59 -161
  350. package/src/components/avatar.props.tsx +6 -0
  351. package/src/components/avatar.tsx +57 -71
  352. package/src/components/blockquote.tsx +8 -9
  353. package/src/components/chatbar.tsx +27 -20
  354. package/src/components/checkbox-group.primitive.tsx +40 -51
  355. package/src/components/checkbox-group.tsx +1 -9
  356. package/src/components/chip.css +18 -20
  357. package/src/components/chip.tsx +3 -4
  358. package/src/components/code.tsx +3 -2
  359. package/src/components/context-menu.tsx +23 -5
  360. package/src/components/dialog.tsx +59 -160
  361. package/src/components/dropdown-menu.tsx +8 -5
  362. package/src/components/icons.tsx +11 -1
  363. package/src/components/index.tsx +7 -0
  364. package/src/components/message-scroller.tsx +48 -26
  365. package/src/components/navbar.tsx +34 -69
  366. package/src/components/notice.tsx +6 -3
  367. package/src/components/progress.tsx +6 -3
  368. package/src/components/scroll-area.css +28 -2
  369. package/src/components/scroll-area.tsx +49 -3
  370. package/src/components/segmented-control.css +8 -130
  371. package/src/components/segmented-control.tsx +36 -5
  372. package/src/components/select.tsx +23 -3
  373. package/src/components/separator.tsx +13 -1
  374. package/src/components/sheet.css +7 -6
  375. package/src/components/sheet.tsx +76 -143
  376. package/src/components/shell.css +14 -0
  377. package/src/components/shell.tsx +29 -8
  378. package/src/components/sidebar.tsx +27 -16
  379. package/src/components/slider.tsx +51 -32
  380. package/src/components/spinner.tsx +10 -2
  381. package/src/components/table.tsx +18 -5
  382. package/src/components/tabs.css +34 -0
  383. package/src/components/tabs.tsx +0 -2
  384. package/src/components/text-area.css +2 -1
  385. package/src/components/text-area.tsx +1 -1
  386. package/src/components/text-field.tsx +1 -1
  387. package/src/components/toggle.tsx +21 -39
  388. package/src/components/toolbar.css +34 -0
  389. package/src/components/toolbar.tsx +432 -23
  390. package/src/components/virtual-menu.tsx +110 -37
  391. package/src/hooks/use-scroll-edges.ts +11 -2
  392. package/src/styles/utilities/truncate.css +10 -0
  393. package/styles.css +195 -185
  394. package/utilities.css +5 -0
  395. package/dist/esm/chunk-23KT3D2Z.js +0 -2
  396. package/dist/esm/chunk-3JA7SJDT.js +0 -2
  397. package/dist/esm/chunk-3JA7SJDT.js.map +0 -7
  398. package/dist/esm/chunk-3KQE2PSJ.js +0 -2
  399. package/dist/esm/chunk-5BWLY27A.js +0 -2
  400. package/dist/esm/chunk-5BWLY27A.js.map +0 -7
  401. package/dist/esm/chunk-6CK7UTNH.js +0 -2
  402. package/dist/esm/chunk-6CK7UTNH.js.map +0 -7
  403. package/dist/esm/chunk-6RK26HIY.js +0 -2
  404. package/dist/esm/chunk-6RK26HIY.js.map +0 -7
  405. package/dist/esm/chunk-7ESWH773.js +0 -2
  406. package/dist/esm/chunk-7ESWH773.js.map +0 -7
  407. package/dist/esm/chunk-7SS4UUJH.js +0 -2
  408. package/dist/esm/chunk-AB3QCCUM.js +0 -2
  409. package/dist/esm/chunk-AB3QCCUM.js.map +0 -7
  410. package/dist/esm/chunk-BEP4AH5V.js +0 -2
  411. package/dist/esm/chunk-BEP4AH5V.js.map +0 -7
  412. package/dist/esm/chunk-BOL3VVSN.js +0 -2
  413. package/dist/esm/chunk-BOL3VVSN.js.map +0 -7
  414. package/dist/esm/chunk-DBROSD2J.js +0 -2
  415. package/dist/esm/chunk-DBROSD2J.js.map +0 -7
  416. package/dist/esm/chunk-DSPYHO3L.js +0 -2
  417. package/dist/esm/chunk-E2D2VWUI.js +0 -2
  418. package/dist/esm/chunk-E2D2VWUI.js.map +0 -7
  419. package/dist/esm/chunk-EMNSA65L.js +0 -2
  420. package/dist/esm/chunk-EMNSA65L.js.map +0 -7
  421. package/dist/esm/chunk-FFG32ERA.js.map +0 -7
  422. package/dist/esm/chunk-FHPHEIYJ.js +0 -2
  423. package/dist/esm/chunk-FHPHEIYJ.js.map +0 -7
  424. package/dist/esm/chunk-FJFBM7HW.js +0 -2
  425. package/dist/esm/chunk-FJFBM7HW.js.map +0 -7
  426. package/dist/esm/chunk-FYT7TYGS.js +0 -2
  427. package/dist/esm/chunk-FYT7TYGS.js.map +0 -7
  428. package/dist/esm/chunk-GLV7VGBH.js +0 -2
  429. package/dist/esm/chunk-GLV7VGBH.js.map +0 -7
  430. package/dist/esm/chunk-HIKMKGPT.js +0 -2
  431. package/dist/esm/chunk-HIKMKGPT.js.map +0 -7
  432. package/dist/esm/chunk-L2R62BOB.js +0 -2
  433. package/dist/esm/chunk-L2R62BOB.js.map +0 -7
  434. package/dist/esm/chunk-LHIS3UKQ.js +0 -2
  435. package/dist/esm/chunk-LHIS3UKQ.js.map +0 -7
  436. package/dist/esm/chunk-NQDMTOGB.js +0 -2
  437. package/dist/esm/chunk-NQDMTOGB.js.map +0 -7
  438. package/dist/esm/chunk-Q6MFPATL.js +0 -2
  439. package/dist/esm/chunk-Q6MFPATL.js.map +0 -7
  440. package/dist/esm/chunk-QOHJIF25.js +0 -2
  441. package/dist/esm/chunk-QOHJIF25.js.map +0 -7
  442. package/dist/esm/chunk-R4XJNQX5.js +0 -2
  443. package/dist/esm/chunk-R4XJNQX5.js.map +0 -7
  444. package/dist/esm/chunk-UE3HATOA.js +0 -2
  445. package/dist/esm/chunk-UE3HATOA.js.map +0 -7
  446. package/dist/esm/chunk-V32EP3S7.js +0 -2
  447. package/dist/esm/chunk-V32EP3S7.js.map +0 -7
  448. package/dist/esm/chunk-XKSU3NLG.js +0 -2
  449. package/dist/esm/chunk-XRCMPBAY.js +0 -2
  450. package/dist/esm/chunk-XRCMPBAY.js.map +0 -7
  451. package/dist/esm/chunk-Y3JYEEFB.js +0 -2
  452. package/dist/esm/chunk-YZM54IJE.js +0 -2
  453. package/dist/esm/chunk-YZM54IJE.js.map +0 -7
  454. package/dist/esm/chunk-ZEX2DECM.js +0 -2
  455. package/dist/esm/chunk-ZJI2IK7C.js +0 -2
  456. package/dist/esm/chunk-ZJI2IK7C.js.map +0 -7
  457. package/dist/esm/chunk-ZNDCZM5A.js +0 -2
  458. /package/dist/esm/{chunk-6DDOR73D.js.map → chunk-G4ETY2NP.js.map} +0 -0
  459. /package/dist/esm/{chunk-QGCXTULQ.js.map → chunk-KEGCX5VM.js.map} +0 -0
  460. /package/dist/esm/{chunk-HKPXDQ2B.js.map → chunk-NC3CJUE3.js.map} +0 -0
  461. /package/dist/esm/{chunk-OJQNLROL.js.map → chunk-UY6WJUNA.js.map} +0 -0
  462. /package/dist/esm/{chunk-JBHRV364.js.map → chunk-VUPIJNG2.js.map} +0 -0
  463. /package/dist/esm/{chunk-NNZTSXKH.js.map → chunk-WX7SX5BN.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/components/progress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,gBAAgB,GAAG,eAAe,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACjE,UAAU,aACR,SAAQ,qBAAqB,CAAC,OAAO,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC,EACrF,gBAAgB;IAClB,QAAQ,CAAC,EAAE,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM,IAAI,CAAC;CACzC;AACD,QAAA,MAAM,QAAQ,sFA0BZ,CAAC;AAGH,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/components/progress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,gBAAgB,GAAG,eAAe,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACjE,UAAU,aACR,SAAQ,qBAAqB,CAAC,OAAO,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC,EACrF,gBAAgB;IAClB,QAAQ,CAAC,EAAE,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM,IAAI,CAAC;CACzC;AACD,QAAA,MAAM,QAAQ,sFA6BZ,CAAC;AAGH,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var E=Object.create;var g=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var W=(t,e)=>{for(var s in e)g(t,s,{get:e[s],enumerable:!0})},h=(t,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of K(e))!U.call(t,i)&&i!==s&&g(t,i,{get:()=>e[i],enumerable:!(a=G(e,i))||a.enumerable});return t};var P=(t,e,s)=>(s=t!=null?E(B(t)):{},h(e||!t||!t.__esModule?g(s,"default",{value:t,enumerable:!0}):s,t)),A=t=>h(g({},"__esModule",{value:!0}),t);var X={};W(X,{Progress:()=>$});module.exports=A(X);var m=P(require("react")),w=P(require("classnames")),S=require("radix-ui");var q=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"];var C={color:{type:"enum",values:q,default:void 0}};var I=["none","small","medium","large","full"],N={radius:{type:"enum",values:I,default:void 0}};var M=["surface","soft","outline"],T={variant:{type:"enum",className:"kui-variant",values:M,default:"surface"},...C,...N,duration:{type:"string"}};var O=P(require("classnames"));var z=[],Y=new Set;function _(t){let e=Object.assign({},...t),s=[],a=[],i=new Set;for(let p in e){let r=e[p],o=r.values??z,f={key:p,type:r.type,default:r.default,hasDefault:r.default!==void 0,responsive:"responsive"in r,className:r.className,customProperties:r.customProperties,parseValue:r.parseValue,values:o,valueSet:o.length>0?new Set(o):Y,enumValueSet:r.type==="enum"?new Set([r.default,...o]):void 0};r.className?(s.push(f),i.add(p)):(f.hasDefault||r.type==="enum")&&a.push(f)}return{styling:s,passthrough:a,stylingKeys:i}}var L={children:new WeakMap};function x(t){let e=L;for(let s=0;s<t.length;s++){let a=t[s],i=e.children.get(a);i===void 0&&(i={children:new WeakMap},e.children.set(a,i)),e=i}return e.compiled??(e.compiled=_(t))}var F=["initial","xs","sm","md","lg","xl"],D=new Set(F);function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var H=new Set(["initial","xs","sm","md","lg","xl"]);function d(t){if(typeof t!="object"||t===null)return!1;for(let e in t)if(H.has(e))return!0;return!1}function y(t,e,s){return e!==void 0?e.has(s):t.includes(s)}function V({className:t,customProperties:e,...s}){let a=v({allowArbitraryValues:!0,className:t,...s}),i=J({customProperties:e,...s});return[a,i]}function v({allowArbitraryValues:t,value:e,className:s,propValues:a,propValueSet:i,parseValue:p=r=>r}){if(e){if(typeof e=="string")return y(a,i,e)?k(s,e,p):t?s:void 0;if(d(e)){let r=e,o=[];for(let f in r){if(!R(r,f)||!D.has(f))continue;let n=r[f];if(n!==void 0){if(y(a,i,n)){let l=k(s,n,p),u=f==="initial"?l:`${f}:${l}`;o.push(u)}else if(t){let l=f==="initial"?s:`${f}:${s}`;o.push(l)}}}return o.length>0?o.join(" "):""}if(t)return s}}function k(t,e,s){let a=t?"-":"",i=s(e),p=i?.startsWith("-"),r=p?"-":"",o=p?i?.substring(1):i;return`${r}${t}${a}${o}`}function J({customProperties:t,value:e,propValues:s,propValueSet:a,parseValue:i=p=>p}){if(!e||typeof e=="string"&&y(s,a,e))return;let p;if(typeof e=="string"){let r=i(e);p={};for(let o of t)p[o]=r;return p}if(d(e)){let r=e;for(let o in r){if(!R(r,o)||!D.has(o))continue;let f=r[o];if(f===void 0||y(s,a,f))continue;let n=i(f);p??(p={});for(let l of t){let u=o==="initial"?l:`${l}-${o}`;p[u]=n}}}return p??{}}function c(...t){let e;for(let s of t)s&&(e===void 0&&(e={}),Object.assign(e,s));return e}function Q(t,e){let s=t.initial,a=!1;return e.hasDefault&&s===void 0&&(s=e.default,a=!0),e.enumValueSet!==void 0&&!e.enumValueSet.has(s)&&(s=e.default,a=!0),a?{...t,initial:s}:t}function j(t,...e){let{styling:s,passthrough:a,stylingKeys:i}=x(e),p={};for(let f in t)i.has(f)||(p[f]=t[f]);for(let f=0;f<a.length;f++){let n=a[f],l=p[n.key];if(l===void 0){n.hasDefault&&(p[n.key]=n.default);continue}n.enumValueSet!==void 0&&!n.enumValueSet.has(l)&&!d(l)&&(p[n.key]=n.default)}let r,o=[];for(let f=0;f<s.length;f++){let n=s[f],l=t[n.key];if(l===void 0&&n.hasDefault&&(l=n.default),n.enumValueSet!==void 0&&!n.enumValueSet.has(l)&&!d(l)&&(l=n.default),!!l){if(d(l)){if(!n.responsive)continue;l=Q(l,n)}if(n.type==="enum"){let u=v({allowArbitraryValues:!1,value:l,className:n.className,propValues:n.values,propValueSet:n.valueSet,parseValue:n.parseValue});u&&o.push(u);continue}if(n.type==="string"||n.type==="enum | string"){let[u,b]=V({className:n.className,customProperties:n.customProperties,propValues:n.type==="string"?[]:n.values,propValueSet:n.type==="string"?void 0:n.valueSet,parseValue:n.parseValue,value:l});b&&(r=c(r,b)),u&&o.push(u);continue}if(n.type==="boolean"){o.push(n.className);continue}}}return p.className=(0,O.default)(o.length>0?o.join(" "):void 0,t.className),p.style=c(r,t.style),p}var $=m.forwardRef((t,e)=>{let{className:s,style:a,color:i,radius:p,duration:r,...o}=j(t,T);return m.createElement(S.Progress.Root,{"data-accent-color":i,"data-radius":p,ref:e,className:(0,w.default)("kui-ProgressRoot",s),style:c({"--progress-duration":"value"in o?void 0:r,"--progress-value":"value"in o?o.value:void 0,"--progress-max":"max"in o?o.max:void 0},a),...o,asChild:!1},m.createElement(S.Progress.Indicator,{className:"kui-ProgressIndicator"}))});$.displayName="Progress";
1
+ "use strict";var E=Object.create;var g=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var W=(t,e)=>{for(var s in e)g(t,s,{get:e[s],enumerable:!0})},h=(t,e,s,f)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of K(e))!U.call(t,p)&&p!==s&&g(t,p,{get:()=>e[p],enumerable:!(f=G(e,p))||f.enumerable});return t};var P=(t,e,s)=>(s=t!=null?E(B(t)):{},h(e||!t||!t.__esModule?g(s,"default",{value:t,enumerable:!0}):s,t)),A=t=>h(g({},"__esModule",{value:!0}),t);var X={};W(X,{Progress:()=>$});module.exports=A(X);var m=P(require("react")),w=P(require("classnames")),S=require("radix-ui");var q=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"];var C={color:{type:"enum",values:q,default:void 0}};var I=["none","small","medium","large","full"],N={radius:{type:"enum",values:I,default:void 0}};var M=["surface","soft","outline"],T={variant:{type:"enum",className:"kui-variant",values:M,default:"surface"},...C,...N,duration:{type:"string"}};var O=P(require("classnames"));var z=[],Y=new Set;function _(t){let e=Object.assign({},...t),s=[],f=[],p=new Set;for(let a in e){let r=e[a],o=r.values??z,i={key:a,type:r.type,default:r.default,hasDefault:r.default!==void 0,responsive:"responsive"in r,className:r.className,customProperties:r.customProperties,parseValue:r.parseValue,values:o,valueSet:o.length>0?new Set(o):Y,enumValueSet:r.type==="enum"?new Set([r.default,...o]):void 0};r.className?(s.push(i),p.add(a)):(i.hasDefault||r.type==="enum")&&f.push(i)}return{styling:s,passthrough:f,stylingKeys:p}}var L={children:new WeakMap};function x(t){let e=L;for(let s=0;s<t.length;s++){let f=t[s],p=e.children.get(f);p===void 0&&(p={children:new WeakMap},e.children.set(f,p)),e=p}return e.compiled??(e.compiled=_(t))}var F=["initial","xs","sm","md","lg","xl"],D=new Set(F);function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var H=new Set(["initial","xs","sm","md","lg","xl"]);function d(t){if(typeof t!="object"||t===null)return!1;for(let e in t)if(H.has(e))return!0;return!1}function y(t,e,s){return e!==void 0?e.has(s):t.includes(s)}function V({className:t,customProperties:e,...s}){let f=v({allowArbitraryValues:!0,className:t,...s}),p=J({customProperties:e,...s});return[f,p]}function v({allowArbitraryValues:t,value:e,className:s,propValues:f,propValueSet:p,parseValue:a=r=>r}){if(e){if(typeof e=="string")return y(f,p,e)?k(s,e,a):t?s:void 0;if(d(e)){let r=e,o=[];for(let i in r){if(!R(r,i)||!D.has(i))continue;let n=r[i];if(n!==void 0){if(y(f,p,n)){let l=k(s,n,a),u=i==="initial"?l:`${i}:${l}`;o.push(u)}else if(t){let l=i==="initial"?s:`${i}:${s}`;o.push(l)}}}return o.length>0?o.join(" "):""}if(t)return s}}function k(t,e,s){let f=t?"-":"",p=s(e),a=p?.startsWith("-"),r=a?"-":"",o=a?p?.substring(1):p;return`${r}${t}${f}${o}`}function J({customProperties:t,value:e,propValues:s,propValueSet:f,parseValue:p=a=>a}){if(!e||typeof e=="string"&&y(s,f,e))return;let a;if(typeof e=="string"){let r=p(e);a={};for(let o of t)a[o]=r;return a}if(d(e)){let r=e;for(let o in r){if(!R(r,o)||!D.has(o))continue;let i=r[o];if(i===void 0||y(s,f,i))continue;let n=p(i);a??(a={});for(let l of t){let u=o==="initial"?l:`${l}-${o}`;a[u]=n}}}return a??{}}function c(...t){let e;for(let s of t)s&&(e===void 0&&(e={}),Object.assign(e,s));return e}function Q(t,e){let s=t.initial,f=!1;return e.hasDefault&&s===void 0&&(s=e.default,f=!0),e.enumValueSet!==void 0&&!e.enumValueSet.has(s)&&(s=e.default,f=!0),f?{...t,initial:s}:t}function j(t,...e){let{styling:s,passthrough:f,stylingKeys:p}=x(e),a={};for(let i in t)p.has(i)||(a[i]=t[i]);for(let i=0;i<f.length;i++){let n=f[i],l=a[n.key];if(l===void 0){n.hasDefault&&(a[n.key]=n.default);continue}n.enumValueSet!==void 0&&!n.enumValueSet.has(l)&&!d(l)&&(a[n.key]=n.default)}let r,o=[];for(let i=0;i<s.length;i++){let n=s[i],l=t[n.key];if(l===void 0&&n.hasDefault&&(l=n.default),n.enumValueSet!==void 0&&!n.enumValueSet.has(l)&&!d(l)&&(l=n.default),!!l){if(d(l)){if(!n.responsive)continue;l=Q(l,n)}if(n.type==="enum"){let u=v({allowArbitraryValues:!1,value:l,className:n.className,propValues:n.values,propValueSet:n.valueSet,parseValue:n.parseValue});u&&o.push(u);continue}if(n.type==="string"||n.type==="enum | string"){let[u,b]=V({className:n.className,customProperties:n.customProperties,propValues:n.type==="string"?[]:n.values,propValueSet:n.type==="string"?void 0:n.valueSet,parseValue:n.parseValue,value:l});b&&(r=c(r,b)),u&&o.push(u);continue}if(n.type==="boolean"){o.push(n.className);continue}}}return a.className=(0,O.default)(o.length>0?o.join(" "):void 0,t.className),a.style=c(r,t.style),a}var $=m.forwardRef((t,e)=>{let{className:s,style:f,color:p,radius:a,duration:r,...o}=j(t,T),i=o.value!=null;return m.createElement(S.Progress.Root,{"data-accent-color":p,"data-radius":a,ref:e,className:(0,w.default)("kui-ProgressRoot",s),style:c({"--progress-duration":i?void 0:r,"--progress-value":i?o.value:void 0,"--progress-max":o.max??void 0},f),...o,asChild:!1},m.createElement(S.Progress.Indicator,{className:"kui-ProgressIndicator"}))});$.displayName="Progress";
2
2
  //# sourceMappingURL=progress.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/progress.tsx", "../../../src/props/color.prop.ts", "../../../src/props/radius.prop.ts", "../../../src/components/progress.props.tsx", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\n\nimport { progressPropDefs } from './progress.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { mergeStyles } from '../helpers/merge-styles.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ProgressElement = React.ElementRef<typeof ProgressPrimitive.Root>;\ntype ProgressOwnProps = GetPropDefTypes<typeof progressPropDefs>;\ninterface ProgressProps\n extends ComponentPropsWithout<typeof ProgressPrimitive.Root, RemovedProps | 'children'>,\n ProgressOwnProps {\n duration?: `${number}s` | `${number}ms`;\n}\nconst Progress = React.forwardRef<ProgressElement, ProgressProps>((props, forwardedRef) => {\n const { className, style, color, radius, duration, ...progressProps } = extractProps(\n props,\n progressPropDefs\n );\n\n return (\n <ProgressPrimitive.Root\n data-accent-color={color}\n data-radius={radius}\n ref={forwardedRef}\n className={classNames('kui-ProgressRoot', className)}\n style={mergeStyles(\n {\n '--progress-duration': 'value' in progressProps ? undefined : duration,\n '--progress-value': 'value' in progressProps ? progressProps.value : undefined,\n '--progress-max': 'max' in progressProps ? progressProps.max : undefined,\n },\n style\n )}\n {...progressProps}\n asChild={false}\n >\n <ProgressPrimitive.Indicator className=\"kui-ProgressIndicator\" />\n </ProgressPrimitive.Root>\n );\n});\nProgress.displayName = 'Progress';\n\nexport { Progress };\nexport type { ProgressProps };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { colorPropDef } from '../props/color.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst variants = ['surface', 'soft', 'outline'] as const;\n\nconst progressPropDefs = {\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'surface' },\n ...colorPropDef,\n ...radiusPropDef,\n duration: { type: 'string' },\n} satisfies {\n variant: PropDef<(typeof variants)[number]>;\n duration: PropDef<string>;\n};\n\nexport { progressPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA8C,oBCC9C,IAAMC,EAAe,CAAC,OAAQ,OAAQ,SAAU,QAAS,SAAU,QAAS,SAAU,SAAU,MAAO,OAAQ,UAAW,OAAQ,OAAQ,SAAU,SAAU,OAAQ,SAAU,OAAQ,OAAQ,OAAQ,OAAQ,QAAS,QAAS,OAAQ,OAAQ,KAAK,EAIvP,IAAMC,EAAe,CACnB,MAAO,CACL,KAAM,OACN,OAAQC,EACR,QAAS,MACX,CACF,ECXA,IAAMC,EAAQ,CAAC,OAAQ,QAAS,SAAU,QAAS,MAAM,EAEnDC,EAAgB,CACpB,OAAQ,CACN,KAAM,OACN,OAAQD,EACR,QAAS,MACX,CACF,ECLA,IAAME,EAAW,CAAC,UAAW,OAAQ,SAAS,EAExCC,EAAmB,CACvB,QAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,OAAQD,EAAU,QAAS,SAAU,EACxF,GAAGE,EACH,GAAGC,EACH,SAAU,CAAE,KAAM,QAAS,CAC7B,ECZA,IAAAC,EAAuB,yBC0CvB,IAAMC,EAAkC,CAAC,EACnCC,EAAiC,IAAI,IAE3C,SAASC,EAAQC,EAAgE,CAC/E,IAAMC,EAAkC,OAAO,OAAO,CAAC,EAAG,GAAGD,CAAQ,EAC/DE,EAA6B,CAAC,EAC9BC,EAAiC,CAAC,EAClCC,EAAc,IAAI,IAExB,QAAWC,KAAOJ,EAAQ,CAGxB,IAAMK,EAAML,EAAOI,CAAG,EAShBE,EAASD,EAAI,QAAUT,EACvBW,EAA4B,CAChC,IAAAH,EACA,KAAMC,EAAI,KAC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UAAAC,EAAW,MAAAC,EAAO,MAAAC,EAAO,OAAAC,EAAQ,SAAAC,EAAU,GAAGC,CAAc,EAAIC,EACtER,EACAS,CACF,EAEA,OACE,gBAAC,EAAAC,SAAkB,KAAlB,CACC,oBAAmBN,EACnB,cAAaC,EACb,IAAKJ,EACL,aAAW,EAAAU,SAAW,mBAAoBT,CAAS,EACnD,MAAOU,EACL,CACE,sBAAuB,UAAWL,EAAgB,OAAYD,EAC9D,mBAAoB,UAAWC,EAAgBA,EAAc,MAAQ,OACrE,iBAAkB,QAASA,EAAgBA,EAAc,IAAM,MACjE,EACAJ,CACF,EACC,GAAGI,EACJ,QAAS,IAET,gBAAC,EAAAG,SAAkB,UAAlB,CAA4B,UAAU,wBAAwB,CACjE,CAEJ,CAAC,EACDX,EAAS,YAAc",
6
- "names": ["progress_exports", "__export", "Progress", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "accentColors", "colorPropDef", "accentColors", "radii", "radiusPropDef", "variants", "progressPropDefs", "colorPropDef", "radiusPropDef", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "Progress", "props", "forwardedRef", "className", "style", "color", "radius", "duration", "progressProps", "extractProps", "progressPropDefs", "ProgressPrimitive", "classNames", "mergeStyles"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\n\nimport { progressPropDefs } from './progress.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { mergeStyles } from '../helpers/merge-styles.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ProgressElement = React.ElementRef<typeof ProgressPrimitive.Root>;\ntype ProgressOwnProps = GetPropDefTypes<typeof progressPropDefs>;\ninterface ProgressProps\n extends ComponentPropsWithout<typeof ProgressPrimitive.Root, RemovedProps | 'children'>,\n ProgressOwnProps {\n duration?: `${number}s` | `${number}ms`;\n}\nconst Progress = React.forwardRef<ProgressElement, ProgressProps>((props, forwardedRef) => {\n const { className, style, color, radius, duration, ...progressProps } = extractProps(\n props,\n progressPropDefs\n );\n\n // `null` and `undefined` both mean indeterminate, as in Radix, so both keep a custom duration.\n const isDeterminate = progressProps.value != null;\n\n return (\n <ProgressPrimitive.Root\n data-accent-color={color}\n data-radius={radius}\n ref={forwardedRef}\n className={classNames('kui-ProgressRoot', className)}\n style={mergeStyles(\n {\n '--progress-duration': isDeterminate ? undefined : duration,\n '--progress-value': isDeterminate ? progressProps.value : undefined,\n '--progress-max': progressProps.max ?? undefined,\n },\n style\n )}\n {...progressProps}\n asChild={false}\n >\n <ProgressPrimitive.Indicator className=\"kui-ProgressIndicator\" />\n </ProgressPrimitive.Root>\n );\n});\nProgress.displayName = 'Progress';\n\nexport { Progress };\nexport type { ProgressProps };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { colorPropDef } from '../props/color.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst variants = ['surface', 'soft', 'outline'] as const;\n\nconst progressPropDefs = {\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'surface' },\n ...colorPropDef,\n ...radiusPropDef,\n duration: { type: 'string' },\n} satisfies {\n variant: PropDef<(typeof variants)[number]>;\n duration: PropDef<string>;\n};\n\nexport { progressPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA8C,oBCC9C,IAAMC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ACnD,mBAAoBI,EAAgBH,EAAc,MAAQ,OAC1D,iBAAkBA,EAAc,KAAO,MACzC,EACAJ,CACF,EACC,GAAGI,EACJ,QAAS,IAET,gBAAC,EAAAI,SAAkB,UAAlB,CAA4B,UAAU,wBAAwB,CACjE,CAEJ,CAAC,EACDZ,EAAS,YAAc",
6
+ "names": ["progress_exports", "__export", "Progress", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "accentColors", "colorPropDef", "accentColors", "radii", "radiusPropDef", "variants", "progressPropDefs", "colorPropDef", "radiusPropDef", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "Progress", "props", "forwardedRef", "className", "style", "color", "radius", "duration", "progressProps", "extractProps", "progressPropDefs", "isDeterminate", "ProgressPrimitive", "classNames", "mergeStyles"]
7
7
  }
@@ -166,8 +166,8 @@ export declare const ButtonObjectSchema: z.ZodObject<{
166
166
  fullWidth: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
167
167
  tooltipAlign: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
168
168
  center: "center";
169
- start: "start";
170
169
  end: "end";
170
+ start: "start";
171
171
  }>>>;
172
172
  tooltipDelayDuration: z.ZodOptional<z.ZodNumber>;
173
173
  tooltipDisableHoverableContent: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -308,8 +308,8 @@ export declare const ButtonSchema: z.ZodObject<{
308
308
  fullWidth: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
309
309
  tooltipAlign: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
310
310
  center: "center";
311
- start: "start";
312
311
  end: "end";
312
+ start: "start";
313
313
  }>>>;
314
314
  tooltipDelayDuration: z.ZodOptional<z.ZodNumber>;
315
315
  tooltipDisableHoverableContent: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -148,8 +148,8 @@ export declare const ToggleSchema: z.ZodObject<{
148
148
  fullWidth: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
149
149
  tooltipAlign: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
150
150
  center: "center";
151
- start: "start";
152
151
  end: "end";
152
+ start: "start";
153
153
  }>>>;
154
154
  tooltipDelayDuration: z.ZodOptional<z.ZodNumber>;
155
155
  tooltipDisableHoverableContent: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -3,8 +3,10 @@ import { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';
3
3
  import { scrollAreaPropDefs } from './scroll-area.props.js';
4
4
  import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
5
5
  import type { GetPropDefTypes } from '../props/prop-def.js';
6
+ import type { WidthProps } from '../props/width.props.js';
7
+ import type { HeightProps } from '../props/height.props.js';
6
8
  type ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;
7
- interface ScrollAreaProps extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>, ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>, ScrollAreaOwnProps {
9
+ interface ScrollAreaProps extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>, ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>, ScrollAreaOwnProps, WidthProps, HeightProps {
8
10
  }
9
11
  declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps & React.RefAttributes<HTMLDivElement>>;
10
12
  export { ScrollArea };
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../../src/components/scroll-area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAK5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,kBAAkB,GAAG,eAAe,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACrE,UAAU,eACR,SAAQ,qBAAqB,CAAC,OAAO,mBAAmB,CAAC,IAAI,EAAE,YAAY,CAAC,EAC1E,qBAAqB,CAAC,OAAO,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,KAAK,CAAC,EAChF,kBAAkB;CAAG;AACzB,QAAA,MAAM,UAAU,wFAkEd,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../../src/components/scroll-area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,KAAK,kBAAkB,GAAG,eAAe,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACrE,UAAU,eACR,SAAQ,qBAAqB,CAAC,OAAO,mBAAmB,CAAC,IAAI,EAAE,YAAY,CAAC,EAC1E,qBAAqB,CAAC,OAAO,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,KAAK,CAAC,EAChF,kBAAkB,EAClB,UAAU,EACV,WAAW;CAAG;AAkClB,QAAA,MAAM,UAAU,wFAwEd,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var V=Object.create;var u=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var j=(r,e)=>{for(var o in e)u(r,o,{get:e[o],enumerable:!0})},P=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of O(e))!z.call(r,l)&&l!==o&&u(r,l,{get:()=>e[l],enumerable:!(t=F(e,l))||t.enumerable});return r};var d=(r,e,o)=>(o=r!=null?V(W(r)):{},P(e||!r||!r.__esModule?u(o,"default",{value:r,enumerable:!0}):o,r)),$=r=>P(u({},"__esModule",{value:!0}),r);var B={};j(B,{ScrollArea:()=>g});module.exports=$(B);var s=d(require("react")),x=d(require("classnames")),f=require("radix-ui"),C=require("radix-ui/internal");var A={asChild:{type:"boolean"}};var q=["none","small","medium","large","full"],R={radius:{type:"enum",values:q,default:void 0}};var G=["vertical","horizontal","both"],h={...A,...R,scrollbars:{type:"enum",values:G,default:"both"},fade:{type:"boolean",default:!1}};var y=d(require("react"));function E(r){let[e,o]=y.useState(null);return y.useEffect(()=>{if(!r||!e)return;let t=0,l=()=>{t=0;let c=Math.max(0,e.scrollTop),p=Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop);e.style.setProperty("--scroll-overflow-start",`${c}px`),e.style.setProperty("--scroll-overflow-end",`${p}px`)},i=()=>{t||(t=requestAnimationFrame(l))};l(),e.addEventListener("scroll",i,{passive:!0});let a=typeof ResizeObserver>"u"?null:new ResizeObserver(i);a?.observe(e);for(let c of Array.from(e.children))a?.observe(c);let n=typeof MutationObserver>"u"?null:new MutationObserver(i);return n?.observe(e,{childList:!0}),()=>{t&&cancelAnimationFrame(t),e.removeEventListener("scroll",i),a?.disconnect(),n?.disconnect(),e.style.removeProperty("--scroll-overflow-start"),e.style.removeProperty("--scroll-overflow-end")}},[r,e]),o}var b=d(require("react"));function w(){let[r,e]=b.useState(null);return b.useEffect(()=>{let o=r?.parentElement;if(!r||!o)return;let t=0,l=()=>{t=0;for(let a of o.querySelectorAll(":scope > .kui-ScrollAreaScrollbar > .kui-ScrollAreaThumb")){let n=a.parentElement,c=getComputedStyle(n);if(n.dataset.orientation==="horizontal"){let p=n.clientWidth-parseFloat(c.paddingLeft)-parseFloat(c.paddingRight),m=T(r.scrollLeft,r.scrollWidth-r.offsetWidth,p-a.offsetWidth);a.style.transform=`translate3d(${m}px, 0, 0)`}else{let p=n.clientHeight-parseFloat(c.paddingTop)-parseFloat(c.paddingBottom),m=T(r.scrollTop,r.scrollHeight-r.offsetHeight,p-a.offsetHeight);a.style.transform=`translate3d(0, ${m}px, 0)`}}},i=()=>{t||(t=requestAnimationFrame(l))};return r.addEventListener("scroll",i,{passive:!0}),()=>{t&&cancelAnimationFrame(t),r.removeEventListener("scroll",i)}},[r]),e}function T(r,e,o){return e<=0||o<=0?0:Math.min(Math.max(r,-e),e)/e*o}var S=d(require("react"));function D(r,e){let{asChild:o,children:t}=r;if(!o)return typeof e=="function"?e(t):e;let l=S.Children.only(t);return S.cloneElement(l,{children:typeof e=="function"?e(l.props.children):e})}var g=s.forwardRef((r,e)=>{let{asChild:o,children:t,className:l,style:i,type:a,scrollHideDelay:n=a!=="scroll"?0:void 0,dir:c,radius:p=h.radius.default,scrollbars:m=h.scrollbars.default,fade:v=h.fade.default,...N}=r,H=E(v),L=w(),k=(0,C.useComposedRefs)(e,H,L);return s.createElement(f.ScrollArea.Root,{type:a,scrollHideDelay:n,className:(0,x.default)("kui-ScrollAreaRoot",l),"data-fade":v?"":void 0,style:i,asChild:o},D({asChild:o,children:t},M=>s.createElement(s.Fragment,null,s.createElement(f.ScrollArea.Viewport,{...N,ref:k,className:"kui-ScrollAreaViewport"},M),s.createElement("div",{className:"kui-ScrollAreaViewportFocusRing"}),m!=="vertical"?s.createElement(f.ScrollArea.Scrollbar,{"data-radius":p,orientation:"horizontal",className:"kui-ScrollAreaScrollbar"},s.createElement(f.ScrollArea.Thumb,{className:"kui-ScrollAreaThumb"})):null,m!=="horizontal"?s.createElement(f.ScrollArea.Scrollbar,{"data-radius":p,orientation:"vertical",className:"kui-ScrollAreaScrollbar"},s.createElement(f.ScrollArea.Thumb,{className:"kui-ScrollAreaThumb"})):null,m==="both"?s.createElement(f.ScrollArea.Corner,{className:"kui-ScrollAreaCorner"}):null)))});g.displayName="ScrollArea";
1
+ "use strict";var Q=Object.create;var P=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var r in e)P(t,r,{get:e[r],enumerable:!0})},w=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of Z(e))!te.call(t,l)&&l!==r&&P(t,l,{get:()=>e[l],enumerable:!(s=X(e,l))||s.enumerable});return t};var g=(t,e,r)=>(r=t!=null?Q(ee(t)):{},w(e||!t||!t.__esModule?P(r,"default",{value:t,enumerable:!0}):r,t)),oe=t=>w(P({},"__esModule",{value:!0}),t);var ge={};re(ge,{ScrollArea:()=>B});module.exports=oe(ge);var c=g(require("react")),F=g(require("classnames")),d=require("radix-ui"),K=require("radix-ui/internal");var C={asChild:{type:"boolean"}};var se=["none","small","medium","large","full"],k={radius:{type:"enum",values:se,default:void 0}};var ne=["vertical","horizontal","both"],h={...C,...k,scrollbars:{type:"enum",values:ne,default:"both"},fade:{type:"boolean",default:!1}};var v=g(require("react"));function A(t){let[e,r]=v.useState(null);return v.useEffect(()=>{if(!t||!e)return;let s=0,l=()=>{s=0;let a=Math.max(0,e.scrollTop),o=Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop);e.style.setProperty("--scroll-overflow-start",`${a}px`),e.style.setProperty("--scroll-overflow-end",`${o}px`);let f=Math.abs(e.scrollLeft),u=Math.max(0,e.scrollWidth-e.clientWidth-f);e.style.setProperty("--scroll-overflow-x-start",`${f}px`),e.style.setProperty("--scroll-overflow-x-end",`${u}px`)},i=()=>{s||(s=requestAnimationFrame(l))};l(),e.addEventListener("scroll",i,{passive:!0});let n=typeof ResizeObserver>"u"?null:new ResizeObserver(i);n?.observe(e);for(let a of Array.from(e.children))n?.observe(a);let p=typeof MutationObserver>"u"?null:new MutationObserver(i);return p?.observe(e,{childList:!0}),()=>{s&&cancelAnimationFrame(s),e.removeEventListener("scroll",i),n?.disconnect(),p?.disconnect(),e.style.removeProperty("--scroll-overflow-start"),e.style.removeProperty("--scroll-overflow-end"),e.style.removeProperty("--scroll-overflow-x-start"),e.style.removeProperty("--scroll-overflow-x-end")}},[t,e]),r}var D=g(require("react"));function E(){let[t,e]=D.useState(null);return D.useEffect(()=>{let r=t?.parentElement;if(!t||!r)return;let s=0,l=()=>{s=0;for(let n of r.querySelectorAll(":scope > .kui-ScrollAreaScrollbar > .kui-ScrollAreaThumb")){let p=n.parentElement,a=getComputedStyle(p);if(p.dataset.orientation==="horizontal"){let o=p.clientWidth-parseFloat(a.paddingLeft)-parseFloat(a.paddingRight),f=V(t.scrollLeft,t.scrollWidth-t.offsetWidth,o-n.offsetWidth);n.style.transform=`translate3d(${f}px, 0, 0)`}else{let o=p.clientHeight-parseFloat(a.paddingTop)-parseFloat(a.paddingBottom),f=V(t.scrollTop,t.scrollHeight-t.offsetHeight,o-n.offsetHeight);n.style.transform=`translate3d(0, ${f}px, 0)`}}},i=()=>{s||(s=requestAnimationFrame(l))};return t.addEventListener("scroll",i,{passive:!0}),()=>{s&&cancelAnimationFrame(s),t.removeEventListener("scroll",i)}},[t]),e}function V(t,e,r){return e<=0||r<=0?0:Math.min(Math.max(t,-e),e)/e*r}var R=g(require("react"));function O(t,e){let{asChild:r,children:s}=t;if(!r)return typeof e=="function"?e(s):e;let l=R.Children.only(s);return R.cloneElement(l,{children:typeof e=="function"?e(l.props.children):e})}var M=g(require("classnames"));var ie=[],le=new Set;function ae(t){let e=Object.assign({},...t),r=[],s=[],l=new Set;for(let i in e){let n=e[i],p=n.values??ie,a={key:i,type:n.type,default:n.default,hasDefault:n.default!==void 0,responsive:"responsive"in n,className:n.className,customProperties:n.customProperties,parseValue:n.parseValue,values:p,valueSet:p.length>0?new Set(p):le,enumValueSet:n.type==="enum"?new Set([n.default,...p]):void 0};n.className?(r.push(a),l.add(i)):(a.hasDefault||n.type==="enum")&&s.push(a)}return{styling:r,passthrough:s,stylingKeys:l}}var pe={children:new WeakMap};function W(t){let e=pe;for(let r=0;r<t.length;r++){let s=t[r],l=e.children.get(s);l===void 0&&(l={children:new WeakMap},e.children.set(s,l)),e=l}return e.compiled??(e.compiled=ae(t))}var fe=["initial","xs","sm","md","lg","xl"],b=new Set(fe);function x(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var ce=new Set(["initial","xs","sm","md","lg","xl"]);function y(t){if(typeof t!="object"||t===null)return!1;for(let e in t)if(ce.has(e))return!0;return!1}function S(t,e,r){return e!==void 0?e.has(r):t.includes(r)}function j({className:t,customProperties:e,...r}){let s=T({allowArbitraryValues:!0,className:t,...r}),l=ue({customProperties:e,...r});return[s,l]}function T({allowArbitraryValues:t,value:e,className:r,propValues:s,propValueSet:l,parseValue:i=n=>n}){if(e){if(typeof e=="string")return S(s,l,e)?H(r,e,i):t?r:void 0;if(y(e)){let n=e,p=[];for(let a in n){if(!x(n,a)||!b.has(a))continue;let o=n[a];if(o!==void 0){if(S(s,l,o)){let f=H(r,o,i),u=a==="initial"?f:`${a}:${f}`;p.push(u)}else if(t){let f=a==="initial"?r:`${a}:${r}`;p.push(f)}}}return p.length>0?p.join(" "):""}if(t)return r}}function H(t,e,r){let s=t?"-":"",l=r(e),i=l?.startsWith("-"),n=i?"-":"",p=i?l?.substring(1):l;return`${n}${t}${s}${p}`}function ue({customProperties:t,value:e,propValues:r,propValueSet:s,parseValue:l=i=>i}){if(!e||typeof e=="string"&&S(r,s,e))return;let i;if(typeof e=="string"){let n=l(e);i={};for(let p of t)i[p]=n;return i}if(y(e)){let n=e;for(let p in n){if(!x(n,p)||!b.has(p))continue;let a=n[p];if(a===void 0||S(r,s,a))continue;let o=l(a);i??(i={});for(let f of t){let u=p==="initial"?f:`${f}-${p}`;i[u]=o}}}return i??{}}function N(...t){let e;for(let r of t)r&&(e===void 0&&(e={}),Object.assign(e,r));return e}function de(t,e){let r=t.initial,s=!1;return e.hasDefault&&r===void 0&&(r=e.default,s=!0),e.enumValueSet!==void 0&&!e.enumValueSet.has(r)&&(r=e.default,s=!0),s?{...t,initial:r}:t}function $(t,...e){let{styling:r,passthrough:s,stylingKeys:l}=W(e),i={};for(let a in t)l.has(a)||(i[a]=t[a]);for(let a=0;a<s.length;a++){let o=s[a],f=i[o.key];if(f===void 0){o.hasDefault&&(i[o.key]=o.default);continue}o.enumValueSet!==void 0&&!o.enumValueSet.has(f)&&!y(f)&&(i[o.key]=o.default)}let n,p=[];for(let a=0;a<r.length;a++){let o=r[a],f=t[o.key];if(f===void 0&&o.hasDefault&&(f=o.default),o.enumValueSet!==void 0&&!o.enumValueSet.has(f)&&!y(f)&&(f=o.default),!!f){if(y(f)){if(!o.responsive)continue;f=de(f,o)}if(o.type==="enum"){let u=T({allowArbitraryValues:!1,value:f,className:o.className,propValues:o.values,propValueSet:o.valueSet,parseValue:o.parseValue});u&&p.push(u);continue}if(o.type==="string"||o.type==="enum | string"){let[u,m]=j({className:o.className,customProperties:o.customProperties,propValues:o.type==="string"?[]:o.values,propValueSet:o.type==="string"?void 0:o.valueSet,parseValue:o.parseValue,value:f});m&&(n=N(n,m)),u&&p.push(u);continue}if(o.type==="boolean"){p.push(o.className);continue}}}return i.className=(0,M.default)(p.length>0?p.join(" "):void 0,t.className),i.style=N(n,t.style),i}var L={width:{type:"string",className:"kui-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"kui-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"kui-r-max-w",customProperties:["--max-width"],responsive:!0}};var G={height:{type:"string",className:"kui-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"kui-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"kui-r-max-h",customProperties:["--max-height"],responsive:!0}};var me='[role="menu"], [role="listbox"]';function ye(t,e){c.useEffect(()=>{if(!e||!t||t.closest(me))return;let r=0,s=()=>{r=0,t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")},l=()=>{r||(r=requestAnimationFrame(s))};s();let i=typeof ResizeObserver>"u"?null:new ResizeObserver(l);i?.observe(t);for(let n of Array.from(t.children))i?.observe(n);return()=>{r&&cancelAnimationFrame(r),i?.disconnect()}},[t,e])}var B=c.forwardRef((t,e)=>{let{asChild:r,children:s,className:l,style:i,type:n,scrollHideDelay:p=n!=="scroll"?0:void 0,dir:a,radius:o=h.radius.default,scrollbars:f=h.scrollbars.default,fade:u=h.fade.default,...m}=$(t,L,G),[q,z]=c.useState(null),U=A(u),I=E(),_=(0,K.useComposedRefs)(e,U,I,z);ye(q,m.tabIndex===void 0);let Y=m["aria-label"]!==void 0||m["aria-labelledby"]!==void 0;return c.createElement(d.ScrollArea.Root,{type:n,scrollHideDelay:p,dir:a,className:(0,F.default)("kui-ScrollAreaRoot",l),"data-fade":u?"":void 0,style:i,asChild:r},O({asChild:r,children:s},J=>c.createElement(c.Fragment,null,c.createElement(d.ScrollArea.Viewport,{role:Y?"region":void 0,...m,ref:_,className:"kui-ScrollAreaViewport"},J),c.createElement("div",{className:"kui-ScrollAreaViewportFocusRing"}),f!=="vertical"?c.createElement(d.ScrollArea.Scrollbar,{"data-radius":o,orientation:"horizontal",className:"kui-ScrollAreaScrollbar"},c.createElement(d.ScrollArea.Thumb,{className:"kui-ScrollAreaThumb"})):null,f!=="horizontal"?c.createElement(d.ScrollArea.Scrollbar,{"data-radius":o,orientation:"vertical",className:"kui-ScrollAreaScrollbar"},c.createElement(d.ScrollArea.Thumb,{className:"kui-ScrollAreaThumb"})):null,f==="both"?c.createElement(d.ScrollArea.Corner,{className:"kui-ScrollAreaCorner"}):null)))});B.displayName="ScrollArea";
2
2
  //# sourceMappingURL=scroll-area.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/scroll-area.tsx", "../../../src/props/as-child.prop.ts", "../../../src/props/radius.prop.ts", "../../../src/components/scroll-area.props.tsx", "../../../src/hooks/use-scroll-edges.ts", "../../../src/hooks/use-thumb-sync.ts", "../../../src/helpers/get-subtree.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { scrollAreaPropDefs } from './scroll-area.props.js';\nimport { useScrollEdges } from '../hooks/use-scroll-edges.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;\ntype ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;\ninterface ScrollAreaProps\n extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,\n ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,\n ScrollAreaOwnProps {}\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n style,\n type,\n scrollHideDelay = type !== 'scroll' ? 0 : undefined,\n dir,\n radius = scrollAreaPropDefs.radius.default,\n scrollbars = scrollAreaPropDefs.scrollbars.default,\n fade = scrollAreaPropDefs.fade.default,\n ...viewportProps\n } = props;\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport);\n\n return (\n <ScrollAreaPrimitive.Root\n type={type}\n scrollHideDelay={scrollHideDelay}\n className={classNames('kui-ScrollAreaRoot', className)}\n data-fade={fade ? '' : undefined}\n style={style}\n asChild={asChild}\n >\n {getSubtree({ asChild, children }, (children) => (\n <>\n <ScrollAreaPrimitive.Viewport\n {...viewportProps}\n ref={viewportRef}\n className=\"kui-ScrollAreaViewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n\n <div className=\"kui-ScrollAreaViewportFocusRing\" />\n\n {scrollbars !== 'vertical' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"horizontal\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars !== 'horizontal' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"vertical\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"kui-ScrollAreaCorner\" />\n ) : null}\n </>\n ))}\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport { ScrollArea };\nexport type { ScrollAreaProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst scrollbarsValues = ['vertical', 'horizontal', 'both'] as const;\n\nconst scrollAreaPropDefs = {\n ...asChildPropDef,\n ...radiusPropDef,\n scrollbars: { type: 'enum', values: scrollbarsValues, default: 'both' },\n /**\n * Fades the content toward the top and bottom edges while there is more content past them.\n * An edge with nothing hidden past it does not fade. A floating band over an edge can set\n * `--scroll-fade-start` or `--scroll-fade-end` to its height, so content fades as it passes\n * under the band.\n */\n fade: { type: 'boolean', default: false },\n} satisfies {\n scrollbars: PropDef<(typeof scrollbarsValues)[number]>;\n fade: PropDef<boolean>;\n};\n\nexport { scrollAreaPropDefs };\n", "import * as React from 'react';\n\n/**\n * Publishes how much content is hidden past each block edge of a scroller, as\n * `--scroll-overflow-start` and `--scroll-overflow-end` (px) on the element.\n * The scroll fade reads them, so an edge fades only while content is hidden\n * there, and the fade ramps in over the first pixels of scrolling.\n *\n * Writes happen at most once per frame, on scroll and when the element or its\n * content resizes. Nothing re-renders.\n */\nexport function useScrollEdges<T extends HTMLElement>(enabled: boolean) {\n const [element, setElement] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n if (!enabled || !element) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n const start = Math.max(0, element.scrollTop);\n const end = Math.max(0, element.scrollHeight - element.clientHeight - element.scrollTop);\n element.style.setProperty('--scroll-overflow-start', `${start}px`);\n element.style.setProperty('--scroll-overflow-end', `${end}px`);\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n write();\n element.addEventListener('scroll', schedule, { passive: true });\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n const mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(schedule);\n mutations?.observe(element, { childList: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n element.removeEventListener('scroll', schedule);\n observer?.disconnect();\n mutations?.disconnect();\n element.style.removeProperty('--scroll-overflow-start');\n element.style.removeProperty('--scroll-overflow-end');\n };\n }, [enabled, element]);\n\n return setElement;\n}\n", "import * as React from 'react';\n\n/**\n * Keeps a Radix ScrollArea's thumbs on the scroll position on every scroll.\n *\n * Radix moves a thumb from a requestAnimationFrame loop it starts on the first scroll event of a\n * burst. Next's production minifier compiles that self-calling loop away, so in a production\n * build the thumb moves once, sits while the content scrolls, and jumps when the next burst\n * starts. This writes the transform Radix would, at most once per frame. Nothing re-renders.\n *\n * Pass the hook's setter as a ref on `ScrollArea.Viewport`; the scrollbars are its siblings.\n */\nexport function useThumbSync<T extends HTMLElement>() {\n const [viewport, setViewport] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n const root = viewport?.parentElement;\n if (!viewport || !root) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n for (const thumb of root.querySelectorAll<HTMLElement>(':scope > .kui-ScrollAreaScrollbar > .kui-ScrollAreaThumb')) {\n const scrollbar = thumb.parentElement as HTMLElement;\n const style = getComputedStyle(scrollbar);\n if (scrollbar.dataset.orientation === 'horizontal') {\n const track = scrollbar.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);\n const offset = thumbOffset(viewport.scrollLeft, viewport.scrollWidth - viewport.offsetWidth, track - thumb.offsetWidth);\n thumb.style.transform = `translate3d(${offset}px, 0, 0)`;\n } else {\n const track = scrollbar.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n const offset = thumbOffset(viewport.scrollTop, viewport.scrollHeight - viewport.offsetHeight, track - thumb.offsetHeight);\n thumb.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n viewport.addEventListener('scroll', schedule, { passive: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n viewport.removeEventListener('scroll', schedule);\n };\n }, [viewport]);\n\n return setViewport;\n}\n\n/** Radix's mapping: scroll position over its range, onto the room the thumb has to travel. */\nfunction thumbOffset(position: number, range: number, travel: number) {\n if (range <= 0 || travel <= 0) return 0;\n // Right-to-left scrolls run from -range to 0; the thumb then travels from -travel to 0.\n const clamped = Math.min(Math.max(position, -range), range);\n return (clamped / range) * travel;\n}\n", "import * as React from 'react';\n\n/**\n * This is a helper function that is used when a component supports `asChild`\n * using the `Slot` component but its implementation contains nested DOM elements.\n *\n * Using it ensures if a consumer uses the `asChild` prop, the elements are in\n * correct order in the DOM, adopting the intended consumer `children`.\n */\nexport function getSubtree(\n options: { asChild: boolean | undefined; children: React.ReactNode },\n content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)\n) {\n const { asChild, children } = options;\n if (!asChild) return typeof content === 'function' ? content(children) : content;\n\n const firstChild = React.Children.only(children) as React.ReactElement;\n return React.cloneElement(firstChild, {\n // @ts-expect-error\n children: typeof content === 'function' ? content(firstChild.props.children) : content,\n });\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAkD,oBAClDC,EAAgC,6BCDhC,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECRA,IAAMC,EAAQ,CAAC,OAAQ,QAAS,SAAU,QAAS,MAAM,EAEnDC,EAAgB,CACpB,OAAQ,CACN,KAAM,OACN,OAAQD,EACR,QAAS,MACX,CACF,ECLA,IAAME,EAAmB,CAAC,WAAY,aAAc,MAAM,EAEpDC,EAAqB,CACzB,GAAGC,EACH,GAAGC,EACH,WAAY,CAAE,KAAM,OAAQ,OAAQH,EAAkB,QAAS,MAAO,EAOtE,KAAM,CAAE,KAAM,UAAW,QAAS,EAAM,CAC1C,EClBA,IAAAI,EAAuB,oBAWhB,SAASC,EAAsCC,EAAkB,CACtE,GAAM,CAACC,EAASC,CAAU,EAAU,WAAmB,IAAI,EAE3D,OAAM,YAAU,IAAM,CACpB,GAAI,CAACF,GAAW,CAACC,EAAS,OAC1B,IAAIE,EAAQ,EACNC,EAAQ,IAAM,CAClBD,EAAQ,EACR,IAAME,EAAQ,KAAK,IAAI,EAAGJ,EAAQ,SAAS,EACrCK,EAAM,KAAK,IAAI,EAAGL,EAAQ,aAAeA,EAAQ,aAAeA,EAAQ,SAAS,EACvFA,EAAQ,MAAM,YAAY,0BAA2B,GAAGI,CAAK,IAAI,EACjEJ,EAAQ,MAAM,YAAY,wBAAyB,GAAGK,CAAG,IAAI,CAC/D,EACMC,EAAW,IAAM,CAChBJ,IAAOA,EAAQ,sBAAsBC,CAAK,EACjD,EACAA,EAAM,EACNH,EAAQ,iBAAiB,SAAUM,EAAU,CAAE,QAAS,EAAK,CAAC,EAC9D,IAAMC,EAAW,OAAO,eAAmB,IAAc,KAAO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,KAApB,CACC,KAAMb,EACN,gBAAiBC,EACjB,aAAW,EAAAa,SAAW,qBAAsBhB,CAAS,EACrD,YAAWQ,EAAO,GAAK,OACvB,MAAOP,EACP,QAASH,GAERmB,EAAW,CAAE,QAAAnB,EAAS,SAAAC,CAAS,EAAIA,GAClC,gCACE,gBAAC,EAAAgB,WAAoB,SAApB,CACE,GAAGN,EACJ,IAAKK,EACL,UAAU,0BAETf,CACH,EAEA,gBAAC,OAAI,UAAU,kCAAkC,EAEhDQ,IAAe,WACd,gBAAC,EAAAQ,WAAoB,UAApB,CACC,cAAaV,EACb,YAAY,aACZ,UAAU,2BAEV,gBAAC,EAAAU,WAAoB,MAApB,CAA0B,UAAU,sBAAsB,CAC7D,EACE,KAEHR,IAAe,aACd,gBAAC,EAAAQ,WAAoB,UAApB,CACC,cAAaV,EACb,YAAY,WACZ,UAAU,2BAEV,gBAAC,EAAAU,WAAoB,MAApB,CAA0B,UAAU,sBAAsB,CAC7D,EACE,KAEHR,IAAe,OACd,gBAAC,EAAAQ,WAAoB,OAApB,CAA2B,UAAU,uBAAuB,EAC3D,IACN,CACD,CACH,CAEJ,CAAC,EACDpB,EAAW,YAAc",
6
- "names": ["scroll_area_exports", "__export", "ScrollArea", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_internal", "asChildPropDef", "radii", "radiusPropDef", "scrollbarsValues", "scrollAreaPropDefs", "asChildPropDef", "radiusPropDef", "React", "useScrollEdges", "enabled", "element", "setElement", "frame", "write", "start", "end", "schedule", "observer", "child", "mutations", "React", "useThumbSync", "viewport", "setViewport", "root", "frame", "write", "thumb", "scrollbar", "style", "track", "offset", "thumbOffset", "schedule", "position", "range", "travel", "React", "getSubtree", "options", "content", "asChild", "children", "firstChild", "ScrollArea", "props", "forwardedRef", "asChild", "children", "className", "style", "type", "scrollHideDelay", "dir", "radius", "scrollAreaPropDefs", "scrollbars", "fade", "viewportProps", "setEdgesElement", "useScrollEdges", "setThumbViewport", "useThumbSync", "viewportRef", "ScrollAreaPrimitive", "classNames", "getSubtree"]
3
+ "sources": ["../../../src/components/scroll-area.tsx", "../../../src/props/as-child.prop.ts", "../../../src/props/radius.prop.ts", "../../../src/components/scroll-area.props.tsx", "../../../src/hooks/use-scroll-edges.ts", "../../../src/hooks/use-thumb-sync.ts", "../../../src/helpers/get-subtree.ts", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/width.props.ts", "../../../src/props/height.props.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { scrollAreaPropDefs } from './scroll-area.props.js';\nimport { useScrollEdges } from '../hooks/use-scroll-edges.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\n\ntype ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;\ntype ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;\ninterface ScrollAreaProps\n extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,\n ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,\n ScrollAreaOwnProps,\n WidthProps,\n HeightProps {}\n\n/** Menus and listboxes move focus between their items, so a scroller inside one stays out of the tab order. */\nconst OWNS_FOCUS = '[role=\"menu\"], [role=\"listbox\"]';\n\n/**\n * Puts the viewport in the tab order while it has something to scroll, so a keyboard can reach it\n * and scroll it with the arrow keys. A `tabIndex` the caller set wins.\n */\nfunction useFocusableWhileScrollable(element: HTMLDivElement | null, enabled: boolean) {\n React.useEffect(() => {\n if (!enabled || !element || element.closest(OWNS_FOCUS)) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n const scrollable = element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;\n if (scrollable) element.setAttribute('tabindex', '0');\n else element.removeAttribute('tabindex');\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(update);\n };\n update();\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n return () => {\n if (frame) cancelAnimationFrame(frame);\n // The attribute stays: a caller who now sets `tabIndex` has already written it.\n observer?.disconnect();\n };\n }, [element, enabled]);\n}\n\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n style,\n type,\n scrollHideDelay = type !== 'scroll' ? 0 : undefined,\n dir,\n radius = scrollAreaPropDefs.radius.default,\n scrollbars = scrollAreaPropDefs.scrollbars.default,\n fade = scrollAreaPropDefs.fade.default,\n ...viewportProps\n } = extractProps(props, widthPropDefs, heightPropDefs);\n const [viewport, setViewport] = React.useState<HTMLDivElement | null>(null);\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport, setViewport);\n useFocusableWhileScrollable(viewport, viewportProps.tabIndex === undefined);\n // A named scroller is a region, so a screen reader can find it and say what it holds.\n const named = viewportProps['aria-label'] !== undefined || viewportProps['aria-labelledby'] !== undefined;\n\n return (\n <ScrollAreaPrimitive.Root\n type={type}\n scrollHideDelay={scrollHideDelay}\n dir={dir}\n className={classNames('kui-ScrollAreaRoot', className)}\n data-fade={fade ? '' : undefined}\n style={style}\n asChild={asChild}\n >\n {getSubtree({ asChild, children }, (children) => (\n <>\n <ScrollAreaPrimitive.Viewport\n role={named ? 'region' : undefined}\n {...viewportProps}\n ref={viewportRef}\n className=\"kui-ScrollAreaViewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n\n <div className=\"kui-ScrollAreaViewportFocusRing\" />\n\n {scrollbars !== 'vertical' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"horizontal\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars !== 'horizontal' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"vertical\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"kui-ScrollAreaCorner\" />\n ) : null}\n </>\n ))}\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport { ScrollArea };\nexport type { ScrollAreaProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst scrollbarsValues = ['vertical', 'horizontal', 'both'] as const;\n\nconst scrollAreaPropDefs = {\n ...asChildPropDef,\n ...radiusPropDef,\n scrollbars: { type: 'enum', values: scrollbarsValues, default: 'both' },\n /**\n * Fades the content toward the top and bottom edges while there is more content past them.\n * An edge with nothing hidden past it does not fade. A floating band over an edge can set\n * `--scroll-fade-start` or `--scroll-fade-end` to its height, so content fades as it passes\n * under the band.\n */\n fade: { type: 'boolean', default: false },\n} satisfies {\n scrollbars: PropDef<(typeof scrollbarsValues)[number]>;\n fade: PropDef<boolean>;\n};\n\nexport { scrollAreaPropDefs };\n", "import * as React from 'react';\n\n/**\n * Publishes how much content is hidden past each edge of a scroller, as\n * `--scroll-overflow-start` and `--scroll-overflow-end` (block axis) and\n * `--scroll-overflow-x-start` and `--scroll-overflow-x-end` (inline axis, from\n * the inline start, so right-to-left reads the same) in px on the element.\n * The scroll fade reads them, so an edge fades only while content is hidden\n * there, and the fade ramps in over the first pixels of scrolling.\n *\n * Writes happen at most once per frame, on scroll and when the element or its\n * content resizes. Nothing re-renders.\n */\nexport function useScrollEdges<T extends HTMLElement>(enabled: boolean) {\n const [element, setElement] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n if (!enabled || !element) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n const start = Math.max(0, element.scrollTop);\n const end = Math.max(0, element.scrollHeight - element.clientHeight - element.scrollTop);\n element.style.setProperty('--scroll-overflow-start', `${start}px`);\n element.style.setProperty('--scroll-overflow-end', `${end}px`);\n // scrollLeft runs negative in right-to-left, so its size is the distance from the inline start.\n const xStart = Math.abs(element.scrollLeft);\n const xEnd = Math.max(0, element.scrollWidth - element.clientWidth - xStart);\n element.style.setProperty('--scroll-overflow-x-start', `${xStart}px`);\n element.style.setProperty('--scroll-overflow-x-end', `${xEnd}px`);\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n write();\n element.addEventListener('scroll', schedule, { passive: true });\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n const mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(schedule);\n mutations?.observe(element, { childList: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n element.removeEventListener('scroll', schedule);\n observer?.disconnect();\n mutations?.disconnect();\n element.style.removeProperty('--scroll-overflow-start');\n element.style.removeProperty('--scroll-overflow-end');\n element.style.removeProperty('--scroll-overflow-x-start');\n element.style.removeProperty('--scroll-overflow-x-end');\n };\n }, [enabled, element]);\n\n return setElement;\n}\n", "import * as React from 'react';\n\n/**\n * Keeps a Radix ScrollArea's thumbs on the scroll position on every scroll.\n *\n * Radix moves a thumb from a requestAnimationFrame loop it starts on the first scroll event of a\n * burst. Next's production minifier compiles that self-calling loop away, so in a production\n * build the thumb moves once, sits while the content scrolls, and jumps when the next burst\n * starts. This writes the transform Radix would, at most once per frame. Nothing re-renders.\n *\n * Pass the hook's setter as a ref on `ScrollArea.Viewport`; the scrollbars are its siblings.\n */\nexport function useThumbSync<T extends HTMLElement>() {\n const [viewport, setViewport] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n const root = viewport?.parentElement;\n if (!viewport || !root) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n for (const thumb of root.querySelectorAll<HTMLElement>(':scope > .kui-ScrollAreaScrollbar > .kui-ScrollAreaThumb')) {\n const scrollbar = thumb.parentElement as HTMLElement;\n const style = getComputedStyle(scrollbar);\n if (scrollbar.dataset.orientation === 'horizontal') {\n const track = scrollbar.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);\n const offset = thumbOffset(viewport.scrollLeft, viewport.scrollWidth - viewport.offsetWidth, track - thumb.offsetWidth);\n thumb.style.transform = `translate3d(${offset}px, 0, 0)`;\n } else {\n const track = scrollbar.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n const offset = thumbOffset(viewport.scrollTop, viewport.scrollHeight - viewport.offsetHeight, track - thumb.offsetHeight);\n thumb.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n viewport.addEventListener('scroll', schedule, { passive: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n viewport.removeEventListener('scroll', schedule);\n };\n }, [viewport]);\n\n return setViewport;\n}\n\n/** Radix's mapping: scroll position over its range, onto the room the thumb has to travel. */\nfunction thumbOffset(position: number, range: number, travel: number) {\n if (range <= 0 || travel <= 0) return 0;\n // Right-to-left scrolls run from -range to 0; the thumb then travels from -travel to 0.\n const clamped = Math.min(Math.max(position, -range), range);\n return (clamped / range) * travel;\n}\n", "import * as React from 'react';\n\n/**\n * This is a helper function that is used when a component supports `asChild`\n * using the `Slot` component but its implementation contains nested DOM elements.\n *\n * Using it ensures if a consumer uses the `asChild` prop, the elements are in\n * correct order in the DOM, adopting the intended consumer `children`.\n */\nexport function getSubtree(\n options: { asChild: boolean | undefined; children: React.ReactNode },\n content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)\n) {\n const { asChild, children } = options;\n if (!asChild) return typeof content === 'function' ? content(children) : content;\n\n const firstChild = React.Children.only(children) as React.ReactElement;\n return React.cloneElement(firstChild, {\n // @ts-expect-error\n children: typeof content === 'function' ? content(firstChild.props.children) : content,\n });\n}\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst widthPropDefs = {\n /**\n * Sets the CSS **width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * width=\"100px\"\n * width={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/width\n */\n width: {\n type: 'string',\n className: 'kui-r-w',\n customProperties: ['--width'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minWidth=\"100px\"\n * minWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-width\n */\n minWidth: {\n type: 'string',\n className: 'kui-r-min-w',\n customProperties: ['--min-width'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxWidth=\"100px\"\n * maxWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n */\n maxWidth: {\n type: 'string',\n className: 'kui-r-max-w',\n customProperties: ['--max-width'],\n responsive: true,\n },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\ntype WidthProps = GetPropDefTypes<typeof widthPropDefs>;\n\nexport { widthPropDefs };\nexport type { WidthProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst heightPropDefs = {\n /**\n * Sets the CSS **height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * height=\"100px\"\n * height={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/height\n */\n height: {\n type: 'string',\n className: 'kui-r-h',\n customProperties: ['--height'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minHeight=\"100px\"\n * minHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-height\n */\n minHeight: {\n type: 'string',\n className: 'kui-r-min-h',\n customProperties: ['--min-height'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxHeight=\"100px\"\n * maxHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-height\n */\n maxHeight: {\n type: 'string',\n className: 'kui-r-max-h',\n customProperties: ['--max-height'],\n responsive: true,\n },\n} satisfies {\n height: PropDef<string>;\n minHeight: PropDef<string>;\n maxHeight: PropDef<string>;\n};\n\ntype HeightProps = GetPropDefTypes<typeof heightPropDefs>;\n\nexport { heightPropDefs };\nexport type { HeightProps };\n"],
5
+ "mappings": "gkBAAA,IAAAA,GAAA,GAAAC,GAAAD,GA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B,UAAU,sBAAsB,CAC7D,EACE,KAEHd,IAAe,OACd,gBAAC,EAAAc,WAAoB,OAApB,CAA2B,UAAU,uBAAuB,EAC3D,IACN,CACD,CACH,CAEJ,CAAC,EACD1B,EAAW,YAAc",
6
+ "names": ["scroll_area_exports", "__export", "ScrollArea", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_internal", "asChildPropDef", "radii", "radiusPropDef", "scrollbarsValues", "scrollAreaPropDefs", "asChildPropDef", "radiusPropDef", "React", "useScrollEdges", "enabled", "element", "setElement", "frame", "write", "start", "end", "xStart", "xEnd", "schedule", "observer", "child", "mutations", "React", "useThumbSync", "viewport", "setViewport", "root", "frame", "write", "thumb", "scrollbar", "style", "track", "offset", "thumbOffset", "schedule", "position", "range", "travel", "React", "getSubtree", "options", "content", "asChild", "children", "firstChild", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "widthPropDefs", "heightPropDefs", "OWNS_FOCUS", "useFocusableWhileScrollable", "element", "enabled", "frame", "update", "schedule", "observer", "child", "ScrollArea", "props", "forwardedRef", "asChild", "children", "className", "style", "type", "scrollHideDelay", "dir", "radius", "scrollAreaPropDefs", "scrollbars", "fade", "viewportProps", "extractProps", "widthPropDefs", "heightPropDefs", "viewport", "setViewport", "setEdgesElement", "useScrollEdges", "setThumbViewport", "useThumbSync", "viewportRef", "named", "ScrollAreaPrimitive", "classNames", "getSubtree"]
7
7
  }
@@ -12,10 +12,12 @@ interface SegmentedControlRootProps extends ComponentPropsWithout<'div', Removed
12
12
  declare const SegmentedControlRoot: React.ForwardRefExoticComponent<SegmentedControlRootProps & React.RefAttributes<HTMLDivElement>>;
13
13
  interface SegmentedControlItemOwnProps {
14
14
  value: string;
15
+ /** When true, this segment can't be selected. */
16
+ disabled?: boolean;
15
17
  /** When true, applies fixed square width for icon-only segments */
16
18
  iconOnly?: boolean;
17
19
  }
18
- interface SegmentedControlItemProps extends ComponentPropsWithout<typeof ToggleGroupPrimitive.Item, RemovedProps | 'disabled' | 'type' | 'value'>, SegmentedControlItemOwnProps {
20
+ interface SegmentedControlItemProps extends ComponentPropsWithout<typeof ToggleGroupPrimitive.Item, RemovedProps | 'type' | 'value'>, SegmentedControlItemOwnProps {
19
21
  }
20
22
  declare const SegmentedControlItem: React.ForwardRefExoticComponent<SegmentedControlItemProps & React.RefAttributes<HTMLButtonElement>>;
21
23
  export { SegmentedControlRoot as Root, SegmentedControlItem as Item };
@@ -1 +1 @@
1
- {"version":3,"file":"segmented-control.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAG/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAI5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,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A4B,GAAG,eAAe,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEzF,UAAU,yBACR,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,CAAC,EACxD,4BAA4B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAID,QAAA,MAAM,oBAAoB,kGAsEzB,CAAC;AAIF,UAAU,4BAA4B;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,yBACR,SAAQ,qBAAqB,CACzB,OAAO,oBAAoB,CAAC,IAAI,EAChC,YAAY,GAAG,MAAM,GAAG,OAAO,CAChC,EACD,4BAA4B;CAAG;AAEnC,QAAA,MAAM,oBAAoB,qGAkBzB,CAAC;AAIF,OAAO,EAAE,oBAAoB,IAAI,IAAI,EAAE,oBAAoB,IAAI,IAAI,EAAE,CAAC;AACtE,YAAY,EAAE,yBAAyB,IAAI,SAAS,EAAE,yBAAyB,IAAI,SAAS,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var K=Object.create;var g=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var A=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},N=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of M(e))!W.call(t,i)&&i!==n&&g(t,i,{get:()=>e[i],enumerable:!(s=B(e,i))||s.enumerable});return t};var y=(t,e,n)=>(n=t!=null?K(U(t)):{},N(e||!t||!t.__esModule?g(n,"default",{value:t,enumerable:!0}):n,t)),L=t=>N(g({},"__esModule",{value:!0}),t);var se={};A(se,{Item:()=>$,Root:()=>G});module.exports=L(se);var d=y(require("react")),b=y(require("classnames")),T=require("radix-ui"),E=require("radix-ui/internal");var q=["none","small","medium","large","full"],x={radius:{type:"enum",values:q,default:void 0}};var _=["1","2","3","4"],H=["horizontal","vertical"],S={disabled:{type:"boolean",className:"disabled",default:!1},size:{type:"enum",className:"kui-r-size",values:_,default:"2",responsive:!0},orientation:{type:"enum",className:"kui-r-orientation",values:H,default:"horizontal",responsive:!0},...x};var z=y(require("classnames"));var Y=[],F=new Set;function Z(t){let e=Object.assign({},...t),n=[],s=[],i=new Set;for(let a in e){let r=e[a],l=r.values??Y,p={key:a,type:r.type,default:r.default,hasDefault:r.default!==void 0,responsive:"responsive"in r,className:r.className,customProperties:r.customProperties,parseValue:r.parseValue,values:l,valueSet:l.length>0?new Set(l):F,enumValueSet:r.type==="enum"?new Set([r.default,...l]):void 0};r.className?(n.push(p),i.add(a)):(p.hasDefault||r.type==="enum")&&s.push(p)}return{styling:n,passthrough:s,stylingKeys:i}}var J={children:new WeakMap};function V(t){let e=J;for(let n=0;n<t.length;n++){let s=t[n],i=e.children.get(s);i===void 0&&(i={children:new WeakMap},e.children.set(s,i)),e=i}return e.compiled??(e.compiled=Z(t))}var Q=["initial","xs","sm","md","lg","xl"],D=new Set(Q);function v(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var X=new Set(["initial","xs","sm","md","lg","xl"]);function m(t){if(typeof t!="object"||t===null)return!1;for(let e in t)if(X.has(e))return!0;return!1}function P(t,e,n){return e!==void 0?e.has(n):t.includes(n)}function O({className:t,customProperties:e,...n}){let s=C({allowArbitraryValues:!0,className:t,...n}),i=ee({customProperties:e,...n});return[s,i]}function C({allowArbitraryValues:t,value:e,className:n,propValues:s,propValueSet:i,parseValue:a=r=>r}){if(e){if(typeof e=="string")return P(s,i,e)?k(n,e,a):t?n:void 0;if(m(e)){let r=e,l=[];for(let p in r){if(!v(r,p)||!D.has(p))continue;let o=r[p];if(o!==void 0){if(P(s,i,o)){let f=k(n,o,a),u=p==="initial"?f:`${p}:${f}`;l.push(u)}else if(t){let f=p==="initial"?n:`${p}:${n}`;l.push(f)}}}return l.length>0?l.join(" "):""}if(t)return n}}function k(t,e,n){let s=t?"-":"",i=n(e),a=i?.startsWith("-"),r=a?"-":"",l=a?i?.substring(1):i;return`${r}${t}${s}${l}`}function ee({customProperties:t,value:e,propValues:n,propValueSet:s,parseValue:i=a=>a}){if(!e||typeof e=="string"&&P(n,s,e))return;let a;if(typeof e=="string"){let r=i(e);a={};for(let l of t)a[l]=r;return a}if(m(e)){let r=e;for(let l in r){if(!v(r,l)||!D.has(l))continue;let p=r[l];if(p===void 0||P(n,s,p))continue;let o=i(p);a??(a={});for(let f of t){let u=l==="initial"?f:`${f}-${l}`;a[u]=o}}}return a??{}}function h(...t){let e;for(let n of t)n&&(e===void 0&&(e={}),Object.assign(e,n));return e}function te(t,e){let n=t.initial,s=!1;return e.hasDefault&&n===void 0&&(n=e.default,s=!0),e.enumValueSet!==void 0&&!e.enumValueSet.has(n)&&(n=e.default,s=!0),s?{...t,initial:n}:t}function w(t,...e){let{styling:n,passthrough:s,stylingKeys:i}=V(e),a={};for(let p in t)i.has(p)||(a[p]=t[p]);for(let p=0;p<s.length;p++){let o=s[p],f=a[o.key];if(f===void 0){o.hasDefault&&(a[o.key]=o.default);continue}o.enumValueSet!==void 0&&!o.enumValueSet.has(f)&&!m(f)&&(a[o.key]=o.default)}let r,l=[];for(let p=0;p<n.length;p++){let o=n[p],f=t[o.key];if(f===void 0&&o.hasDefault&&(f=o.default),o.enumValueSet!==void 0&&!o.enumValueSet.has(f)&&!m(f)&&(f=o.default),!!f){if(m(f)){if(!o.responsive)continue;f=te(f,o)}if(o.type==="enum"){let u=C({allowArbitraryValues:!1,value:f,className:o.className,propValues:o.values,propValueSet:o.valueSet,parseValue:o.parseValue});u&&l.push(u);continue}if(o.type==="string"||o.type==="enum | string"){let[u,c]=O({className:o.className,customProperties:o.customProperties,propValues:o.type==="string"?[]:o.values,propValueSet:o.type==="string"?void 0:o.valueSet,parseValue:o.parseValue,value:f});c&&(r=h(r,c)),u&&l.push(u);continue}if(o.type==="boolean"){l.push(o.className);continue}}}return a.className=(0,z.default)(l.length>0?l.join(" "):void 0,t.className),a.style=h(r,t.style),a}var R=y(require("react")),ne="2",I=R.createContext(ne);I.displayName="ThemeSizeContext";function oe(t,e){if(e.includes(t))return t;let n=Number(t),s=e[0],i=1/0;for(let a=0;a<e.length;a++){let r=Math.abs(Number(e[a])-n);r<i&&(i=r,s=e[a])}return s}function j(t,e){let n=R.useContext(I);if(t.size!==void 0)return t;let s=oe(n,e.values);return s===e.default?t:{...t,size:s}}var G=d.forwardRef((t,e)=>{let n=j(t,S.size),{className:s,children:i,radius:a,value:r,defaultValue:l,onValueChange:p,...o}=w(n,S),[f,u]=(0,E.useControllableState)({prop:r,onChange:p,defaultProp:l??""});return d.createElement(T.ToggleGroup.Root,{"data-disabled":n.disabled||void 0,"data-radius":a,ref:e,className:(0,b.default)("kui-SegmentedControlRoot",s),onValueChange:c=>{c&&u(c)},...o,type:"single",value:f,asChild:!1,disabled:!!n.disabled},i,d.createElement("div",{className:"kui-SegmentedControlIndicator"}))});G.displayName="SegmentedControl.Root";var $=d.forwardRef(({children:t,className:e,iconOnly:n,...s},i)=>d.createElement(T.ToggleGroup.Item,{ref:i,className:(0,b.default)("kui-reset","kui-SegmentedControlItem",e),"data-icon-only":n||void 0,...s,disabled:!1,asChild:!1},d.createElement("span",{className:"kui-SegmentedControlItemSeparator"}),d.createElement("span",{className:"kui-SegmentedControlItemLabel"},d.createElement("span",{className:"kui-SegmentedControlItemLabelActive"},t),d.createElement("span",{className:"kui-SegmentedControlItemLabelInactive","aria-hidden":!0},t))));$.displayName="SegmentedControl.Item";
1
+ "use strict";"use client";var _=Object.create;var y=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var Q=(t,e)=>{for(var n in e)y(t,n,{get:e[n],enumerable:!0})},w=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of F(e))!J.call(t,r)&&r!==n&&y(t,r,{get:()=>e[r],enumerable:!(s=Y(e,r))||s.enumerable});return t};var P=(t,e,n)=>(n=t!=null?_(Z(t)):{},w(e||!t||!t.__esModule?y(n,"default",{value:t,enumerable:!0}):n,t)),X=t=>w(y({},"__esModule",{value:!0}),t);var ce={};Q(ce,{Item:()=>B,Root:()=>K});module.exports=X(ce);var f=P(require("react")),N=P(require("classnames")),x=require("radix-ui"),D=require("radix-ui/internal");var ee=["none","small","medium","large","full"],O={radius:{type:"enum",values:ee,default:void 0}};var te=["1","2","3","4"],ne=["horizontal","vertical"],v={disabled:{type:"boolean",className:"disabled",default:!1},size:{type:"enum",className:"kui-r-size",values:te,default:"2",responsive:!0},orientation:{type:"enum",className:"kui-r-orientation",values:ne,default:"horizontal",responsive:!0},...O};var G=P(require("classnames"));var oe=[],se=new Set;function re(t){let e=Object.assign({},...t),n=[],s=[],r=new Set;for(let a in e){let i=e[a],l=i.values??oe,p={key:a,type:i.type,default:i.default,hasDefault:i.default!==void 0,responsive:"responsive"in i,className:i.className,customProperties:i.customProperties,parseValue:i.parseValue,values:l,valueSet:l.length>0?new Set(l):se,enumValueSet:i.type==="enum"?new Set([i.default,...l]):void 0};i.className?(n.push(p),r.add(a)):(p.hasDefault||i.type==="enum")&&s.push(p)}return{styling:n,passthrough:s,stylingKeys:r}}var ie={children:new WeakMap};function z(t){let e=ie;for(let n=0;n<t.length;n++){let s=t[n],r=e.children.get(s);r===void 0&&(r={children:new WeakMap},e.children.set(s,r)),e=r}return e.compiled??(e.compiled=re(t))}var ae=["initial","xs","sm","md","lg","xl"],h=new Set(ae);function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var pe=new Set(["initial","xs","sm","md","lg","xl"]);function c(t){if(typeof t!="object"||t===null)return!1;for(let e in t)if(pe.has(e))return!0;return!1}function R(t,e,n){return e!==void 0?e.has(n):t.includes(n)}function j({className:t,customProperties:e,...n}){let s=b({allowArbitraryValues:!0,className:t,...n}),r=le({customProperties:e,...n});return[s,r]}function b({allowArbitraryValues:t,value:e,className:n,propValues:s,propValueSet:r,parseValue:a=i=>i}){if(e){if(typeof e=="string")return R(s,r,e)?E(n,e,a):t?n:void 0;if(c(e)){let i=e,l=[];for(let p in i){if(!C(i,p)||!h.has(p))continue;let o=i[p];if(o!==void 0){if(R(s,r,o)){let u=E(n,o,a),d=p==="initial"?u:`${p}:${u}`;l.push(d)}else if(t){let u=p==="initial"?n:`${p}:${n}`;l.push(u)}}}return l.length>0?l.join(" "):""}if(t)return n}}function E(t,e,n){let s=t?"-":"",r=n(e),a=r?.startsWith("-"),i=a?"-":"",l=a?r?.substring(1):r;return`${i}${t}${s}${l}`}function le({customProperties:t,value:e,propValues:n,propValueSet:s,parseValue:r=a=>a}){if(!e||typeof e=="string"&&R(n,s,e))return;let a;if(typeof e=="string"){let i=r(e);a={};for(let l of t)a[l]=i;return a}if(c(e)){let i=e;for(let l in i){if(!C(i,l)||!h.has(l))continue;let p=i[l];if(p===void 0||R(n,s,p))continue;let o=r(p);a??(a={});for(let u of t){let d=l==="initial"?u:`${u}-${l}`;a[d]=o}}}return a??{}}function T(...t){let e;for(let n of t)n&&(e===void 0&&(e={}),Object.assign(e,n));return e}function ue(t,e){let n=t.initial,s=!1;return e.hasDefault&&n===void 0&&(n=e.default,s=!0),e.enumValueSet!==void 0&&!e.enumValueSet.has(n)&&(n=e.default,s=!0),s?{...t,initial:n}:t}function $(t,...e){let{styling:n,passthrough:s,stylingKeys:r}=z(e),a={};for(let p in t)r.has(p)||(a[p]=t[p]);for(let p=0;p<s.length;p++){let o=s[p],u=a[o.key];if(u===void 0){o.hasDefault&&(a[o.key]=o.default);continue}o.enumValueSet!==void 0&&!o.enumValueSet.has(u)&&!c(u)&&(a[o.key]=o.default)}let i,l=[];for(let p=0;p<n.length;p++){let o=n[p],u=t[o.key];if(u===void 0&&o.hasDefault&&(u=o.default),o.enumValueSet!==void 0&&!o.enumValueSet.has(u)&&!c(u)&&(u=o.default),!!u){if(c(u)){if(!o.responsive)continue;u=ue(u,o)}if(o.type==="enum"){let d=b({allowArbitraryValues:!1,value:u,className:o.className,propValues:o.values,propValueSet:o.valueSet,parseValue:o.parseValue});d&&l.push(d);continue}if(o.type==="string"||o.type==="enum | string"){let[d,g]=j({className:o.className,customProperties:o.customProperties,propValues:o.type==="string"?[]:o.values,propValueSet:o.type==="string"?void 0:o.valueSet,parseValue:o.parseValue,value:u});g&&(i=T(i,g)),d&&l.push(d);continue}if(o.type==="boolean"){l.push(o.className);continue}}}return a.className=(0,G.default)(l.length>0?l.join(" "):void 0,t.className),a.style=T(i,t.style),a}var S=P(require("react")),fe="2",A=S.createContext(fe);A.displayName="ThemeSizeContext";function de(t,e){if(e.includes(t))return t;let n=Number(t),s=e[0],r=1/0;for(let a=0;a<e.length;a++){let i=Math.abs(Number(e[a])-n);i<r&&(r=i,s=e[a])}return s}function M(t,e){let n=S.useContext(A);if(t.size!==void 0)return t;let s=de(n,e.values);return s===e.default?t:{...t,size:s}}var me=typeof window>"u"?f.useEffect:f.useLayoutEffect,K=f.forwardRef((t,e)=>{let n=M(t,v.size),{className:s,children:r,radius:a,value:i,defaultValue:l,onValueChange:p,style:o,...u}=$(n,v),[d,g]=(0,D.useControllableState)({prop:i,onChange:p,defaultProp:l??""}),V=f.useRef(null),L=(0,D.useComposedRefs)(e,V),k=f.Children.toArray(r).filter(f.isValidElement),U=k.length,W=Math.max(0,k.findIndex(m=>m.props.value===d));return me(()=>{let m=V.current;if(!m)return;let I=Array.from(m.querySelectorAll(":scope > .kui-SegmentedControlItem")),q=I.findIndex(H=>H.getAttribute("data-state")==="on");m.style.setProperty("--segmented-control-count",String(I.length||1)),m.style.setProperty("--segmented-control-index",String(Math.max(0,q)))}),f.createElement(x.ToggleGroup.Root,{"data-disabled":n.disabled||void 0,"data-radius":a,ref:L,style:{"--segmented-control-count":U||1,"--segmented-control-index":W,...o},className:(0,N.default)("kui-SegmentedControlRoot",s),onValueChange:m=>{m&&g(m)},...u,type:"single",value:d,asChild:!1,disabled:!!n.disabled},r,f.createElement("div",{className:"kui-SegmentedControlIndicator"}))});K.displayName="SegmentedControl.Root";var B=f.forwardRef(({children:t,className:e,iconOnly:n,...s},r)=>f.createElement(x.ToggleGroup.Item,{ref:r,className:(0,N.default)("kui-reset","kui-SegmentedControlItem",e),"data-icon-only":n||void 0,...s,asChild:!1},f.createElement("span",{className:"kui-SegmentedControlItemSeparator"}),f.createElement("span",{className:"kui-SegmentedControlItemLabel"},f.createElement("span",{className:"kui-SegmentedControlItemLabelActive"},t),f.createElement("span",{className:"kui-SegmentedControlItemLabelInactive","aria-hidden":!0},t))));B.displayName="SegmentedControl.Item";
2
2
  //# sourceMappingURL=segmented-control.js.map