@cascivo/react 1.0.0 → 1.2.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 (646) hide show
  1. package/README.md +5 -4
  2. package/dist/accordion/accordion.js +1 -114
  3. package/dist/accordion/accordion.module.js +1 -10
  4. package/dist/action-sheet/action-sheet.css +1 -1
  5. package/dist/action-sheet/action-sheet.js +1 -91
  6. package/dist/action-sheet/action-sheet.module.js +1 -12
  7. package/dist/alert/alert.js +1 -55
  8. package/dist/alert/alert.module.js +1 -11
  9. package/dist/alert-dialog/alert-dialog.css +1 -1
  10. package/dist/alert-dialog/alert-dialog.js +1 -66
  11. package/dist/alert-dialog/alert-dialog.module.js +1 -11
  12. package/dist/app-shell/app-shell.css +1 -1
  13. package/dist/app-shell/app-shell.js +1 -85
  14. package/dist/app-shell/app-shell.module.js +1 -12
  15. package/dist/aspect-ratio/aspect-ratio.js +1 -20
  16. package/dist/aspect-ratio/aspect-ratio.module.js +1 -6
  17. package/dist/avatar/avatar.js +1 -57
  18. package/dist/avatar/avatar.module.js +1 -8
  19. package/dist/avatar-group/avatar-group.js +1 -24
  20. package/dist/avatar-group/avatar-group.module.js +1 -6
  21. package/dist/badge/badge.js +1 -22
  22. package/dist/badge/badge.module.js +1 -3
  23. package/dist/blockquote/blockquote.js +1 -16
  24. package/dist/blockquote/blockquote.module.js +1 -6
  25. package/dist/bottom-sheet/bottom-sheet.js +1 -111
  26. package/dist/bottom-sheet/bottom-sheet.module.js +1 -14
  27. package/dist/brand/logo/logo.css +1 -0
  28. package/dist/brand/logo/logo.js +1 -0
  29. package/dist/brand/logo/logo.module.js +2 -0
  30. package/dist/breadcrumb/breadcrumb.js +1 -28
  31. package/dist/breadcrumb/breadcrumb.module.js +1 -3
  32. package/dist/button/button.css +1 -1
  33. package/dist/button/button.js +1 -35
  34. package/dist/button/button.module.js +1 -6
  35. package/dist/button-group/button-group.js +1 -39
  36. package/dist/button-group/button-group.module.js +1 -3
  37. package/dist/calendar/calendar-date.js +1 -0
  38. package/dist/calendar/calendar.css +1 -1
  39. package/dist/calendar/calendar.js +1 -199
  40. package/dist/calendar/calendar.module.js +1 -14
  41. package/dist/card/card.js +1 -53
  42. package/dist/card/card.module.js +1 -12
  43. package/dist/carousel/carousel.css +1 -1
  44. package/dist/carousel/carousel.js +1 -138
  45. package/dist/carousel/carousel.module.js +1 -13
  46. package/dist/chat-bubble/chat-bubble.js +1 -31
  47. package/dist/chat-bubble/chat-bubble.module.js +1 -11
  48. package/dist/checkbox/checkbox.js +1 -39
  49. package/dist/checkbox/checkbox.module.js +1 -8
  50. package/dist/checkbox-card/checkbox-card.css +1 -1
  51. package/dist/checkbox-card/checkbox-card.js +1 -50
  52. package/dist/checkbox-card/checkbox-card.module.js +1 -11
  53. package/dist/code/code.js +1 -14
  54. package/dist/code/code.module.js +1 -3
  55. package/dist/code-snippet/code-snippet.js +2 -121
  56. package/dist/code-snippet/code-snippet.module.js +1 -17
  57. package/dist/code-snippet/highlight.js +1 -67
  58. package/dist/collapsible/collapsible.js +1 -47
  59. package/dist/collapsible/collapsible.module.js +1 -7
  60. package/dist/color-picker/color-picker.css +1 -1
  61. package/dist/color-picker/color-picker.js +1 -272
  62. package/dist/color-picker/color-picker.module.js +1 -18
  63. package/dist/color-picker/color.js +1 -0
  64. package/dist/combobox/combobox.css +1 -1
  65. package/dist/combobox/combobox.js +1 -170
  66. package/dist/combobox/combobox.module.js +1 -19
  67. package/dist/combobox/list-nav.js +1 -0
  68. package/dist/combobox/option-list.js +1 -0
  69. package/dist/command-menu/command-menu.js +1 -421
  70. package/dist/command-menu/command-menu.module.js +1 -34
  71. package/dist/comparison/comparison.js +1 -69
  72. package/dist/comparison/comparison.module.js +1 -9
  73. package/dist/contained-list/contained-list.js +1 -41
  74. package/dist/contained-list/contained-list.module.js +1 -11
  75. package/dist/context-menu/context-menu.js +1 -93
  76. package/dist/context-menu/context-menu.module.js +1 -7
  77. package/dist/copy-button/copy-button.js +1 -60
  78. package/dist/copy-button/copy-button.module.js +1 -6
  79. package/dist/data-list/data-list.js +1 -25
  80. package/dist/data-list/data-list.module.js +1 -8
  81. package/dist/data-table/column-filter.js +1 -0
  82. package/dist/data-table/column-layout.js +1 -0
  83. package/dist/data-table/data-table.css +1 -1
  84. package/dist/data-table/data-table.js +1 -398
  85. package/dist/data-table/data-table.module.js +1 -33
  86. package/dist/data-table/grid-keys.js +1 -0
  87. package/dist/data-table/row-group.js +1 -0
  88. package/dist/data-table/row-search.js +1 -0
  89. package/dist/data-table/row-sort.js +1 -0
  90. package/dist/data-table/to-csv.js +3 -0
  91. package/dist/data-table/virtual-window.js +1 -0
  92. package/dist/date-picker/date-picker.css +1 -1
  93. package/dist/date-picker/date-picker.js +1 -224
  94. package/dist/date-picker/date-picker.module.js +1 -23
  95. package/dist/date-picker/parse-date.js +1 -0
  96. package/dist/date-range-picker/date-range-picker.js +1 -196
  97. package/dist/date-range-picker/date-range-picker.module.js +1 -18
  98. package/dist/dock/dock.css +1 -1
  99. package/dist/dock/dock.js +1 -34
  100. package/dist/dock/dock.module.js +1 -8
  101. package/dist/drawer/drawer.js +1 -96
  102. package/dist/drawer/drawer.module.js +1 -13
  103. package/dist/dropdown/dropdown.css +1 -1
  104. package/dist/dropdown/dropdown.js +1 -110
  105. package/dist/dropdown/dropdown.module.js +1 -9
  106. package/dist/editable/editable.js +1 -76
  107. package/dist/editable/editable.module.js +1 -11
  108. package/dist/empty-state/empty-state.js +1 -32
  109. package/dist/empty-state/empty-state.module.js +1 -9
  110. package/dist/fab/fab.css +1 -1
  111. package/dist/fab/fab.js +1 -93
  112. package/dist/fab/fab.module.js +1 -12
  113. package/dist/field/field.css +1 -1
  114. package/dist/field/field.js +1 -53
  115. package/dist/field/field.module.js +1 -7
  116. package/dist/file-uploader/file-uploader.css +1 -1
  117. package/dist/file-uploader/file-uploader.js +1 -123
  118. package/dist/file-uploader/file-uploader.module.js +1 -18
  119. package/dist/filter/filter.css +1 -1
  120. package/dist/filter/filter.js +1 -35
  121. package/dist/filter/filter.module.js +1 -6
  122. package/dist/form/form.js +1 -95
  123. package/dist/form/form.module.js +1 -3
  124. package/dist/header/header.js +1 -44
  125. package/dist/header/header.module.js +1 -11
  126. package/dist/header-panel/header-panel.js +1 -72
  127. package/dist/header-panel/header-panel.module.js +1 -9
  128. package/dist/heading/heading.css +1 -1
  129. package/dist/heading/heading.js +1 -22
  130. package/dist/heading/heading.module.js +1 -3
  131. package/dist/hover-card/hover-card.css +1 -1
  132. package/dist/hover-card/hover-card.js +1 -84
  133. package/dist/hover-card/hover-card.module.js +1 -6
  134. package/dist/icon-button/icon-button.js +1 -19
  135. package/dist/icon-button/icon-button.module.js +1 -3
  136. package/dist/image/image.css +1 -1
  137. package/dist/image/image.js +1 -64
  138. package/dist/image/image.module.js +1 -9
  139. package/dist/index.d.ts +1521 -38
  140. package/dist/indicator/indicator.js +1 -16
  141. package/dist/indicator/indicator.module.js +1 -6
  142. package/dist/infinite-scroll/infinite-scroll.js +1 -49
  143. package/dist/infinite-scroll/infinite-scroll.module.js +1 -7
  144. package/dist/inline-loading/inline-loading.js +1 -74
  145. package/dist/inline-loading/inline-loading.module.js +1 -9
  146. package/dist/input/input.css +1 -1
  147. package/dist/input/input.js +1 -56
  148. package/dist/input/input.module.js +1 -9
  149. package/dist/input-group/input-group.css +1 -1
  150. package/dist/input-group/input-group.js +1 -39
  151. package/dist/input-group/input-group.module.js +1 -9
  152. package/dist/item/item.js +1 -50
  153. package/dist/item/item.module.js +1 -10
  154. package/dist/join/join.js +1 -12
  155. package/dist/join/join.module.js +1 -3
  156. package/dist/kbd/kbd.js +1 -14
  157. package/dist/kbd/kbd.module.js +1 -3
  158. package/dist/label/label.js +1 -23
  159. package/dist/label/label.module.js +1 -7
  160. package/dist/large-title-header/large-title-header.js +1 -38
  161. package/dist/large-title-header/large-title-header.module.js +1 -12
  162. package/dist/layouts/src/auto-grid/auto-grid.js +1 -17
  163. package/dist/layouts/src/auto-grid/auto-grid.module.js +1 -4
  164. package/dist/layouts/src/center/center.js +1 -16
  165. package/dist/layouts/src/center/center.module.js +1 -3
  166. package/dist/layouts/src/columns/columns.js +1 -21
  167. package/dist/layouts/src/columns/columns.module.js +1 -6
  168. package/dist/layouts/src/flex/flex.css +1 -1
  169. package/dist/layouts/src/flex/flex.js +1 -20
  170. package/dist/layouts/src/flex/flex.module.js +1 -3
  171. package/dist/layouts/src/grid/grid.css +1 -1
  172. package/dist/layouts/src/grid/grid.js +1 -55
  173. package/dist/layouts/src/grid/grid.module.js +1 -7
  174. package/dist/layouts/src/page-header/page-header.js +1 -31
  175. package/dist/layouts/src/page-header/page-header.module.js +1 -10
  176. package/dist/layouts/src/spacer/spacer.js +1 -17
  177. package/dist/layouts/src/spacer/spacer.module.js +1 -3
  178. package/dist/link/link.css +1 -1
  179. package/dist/link/link.js +1 -22
  180. package/dist/link/link.module.js +1 -3
  181. package/dist/list/list.js +1 -21
  182. package/dist/list/list.module.js +1 -6
  183. package/dist/log-viewer/log-viewer.css +1 -1
  184. package/dist/log-viewer/log-viewer.js +2 -184
  185. package/dist/log-viewer/log-viewer.module.js +1 -16
  186. package/dist/menu/menu.js +1 -126
  187. package/dist/menu/menu.module.js +1 -8
  188. package/dist/menu-button/menu-button.js +1 -92
  189. package/dist/menu-button/menu-button.module.js +1 -8
  190. package/dist/menubar/menubar.js +1 -103
  191. package/dist/menubar/menubar.module.js +1 -8
  192. package/dist/modal/modal.css +1 -1
  193. package/dist/modal/modal.js +1 -76
  194. package/dist/modal/modal.module.js +1 -12
  195. package/dist/multi-select/list-nav.js +1 -0
  196. package/dist/multi-select/multi-select.css +1 -1
  197. package/dist/multi-select/multi-select.js +1 -106
  198. package/dist/multi-select/multi-select.module.js +1 -15
  199. package/dist/multi-select/option-list.js +1 -0
  200. package/dist/native-select/native-select.css +1 -1
  201. package/dist/native-select/native-select.js +1 -37
  202. package/dist/native-select/native-select.module.js +1 -7
  203. package/dist/navigation-menu/navigation-menu.js +1 -99
  204. package/dist/navigation-menu/navigation-menu.module.js +1 -10
  205. package/dist/node/accordion/accordion.js +1 -114
  206. package/dist/node/accordion/accordion.module.js +1 -10
  207. package/dist/node/action-sheet/action-sheet.js +1 -91
  208. package/dist/node/action-sheet/action-sheet.module.js +1 -12
  209. package/dist/node/alert/alert.js +1 -55
  210. package/dist/node/alert/alert.module.js +1 -11
  211. package/dist/node/alert-dialog/alert-dialog.js +1 -66
  212. package/dist/node/alert-dialog/alert-dialog.module.js +1 -11
  213. package/dist/node/app-shell/app-shell.js +1 -85
  214. package/dist/node/app-shell/app-shell.module.js +1 -12
  215. package/dist/node/aspect-ratio/aspect-ratio.js +1 -20
  216. package/dist/node/aspect-ratio/aspect-ratio.module.js +1 -6
  217. package/dist/node/avatar/avatar.js +1 -57
  218. package/dist/node/avatar/avatar.module.js +1 -8
  219. package/dist/node/avatar-group/avatar-group.js +1 -24
  220. package/dist/node/avatar-group/avatar-group.module.js +1 -6
  221. package/dist/node/badge/badge.js +1 -22
  222. package/dist/node/badge/badge.module.js +1 -3
  223. package/dist/node/blockquote/blockquote.js +1 -16
  224. package/dist/node/blockquote/blockquote.module.js +1 -6
  225. package/dist/node/bottom-sheet/bottom-sheet.js +1 -111
  226. package/dist/node/bottom-sheet/bottom-sheet.module.js +1 -14
  227. package/dist/node/brand/logo/logo.js +1 -0
  228. package/dist/node/brand/logo/logo.module.js +1 -0
  229. package/dist/node/breadcrumb/breadcrumb.js +1 -28
  230. package/dist/node/breadcrumb/breadcrumb.module.js +1 -3
  231. package/dist/node/button/button.js +1 -35
  232. package/dist/node/button/button.module.js +1 -6
  233. package/dist/node/button-group/button-group.js +1 -39
  234. package/dist/node/button-group/button-group.module.js +1 -3
  235. package/dist/node/calendar/calendar-date.js +1 -0
  236. package/dist/node/calendar/calendar.js +1 -199
  237. package/dist/node/calendar/calendar.module.js +1 -14
  238. package/dist/node/card/card.js +1 -53
  239. package/dist/node/card/card.module.js +1 -12
  240. package/dist/node/carousel/carousel.js +1 -138
  241. package/dist/node/carousel/carousel.module.js +1 -13
  242. package/dist/node/chat-bubble/chat-bubble.js +1 -31
  243. package/dist/node/chat-bubble/chat-bubble.module.js +1 -11
  244. package/dist/node/checkbox/checkbox.js +1 -39
  245. package/dist/node/checkbox/checkbox.module.js +1 -8
  246. package/dist/node/checkbox-card/checkbox-card.js +1 -50
  247. package/dist/node/checkbox-card/checkbox-card.module.js +1 -11
  248. package/dist/node/code/code.js +1 -14
  249. package/dist/node/code/code.module.js +1 -3
  250. package/dist/node/code-snippet/code-snippet.js +2 -121
  251. package/dist/node/code-snippet/code-snippet.module.js +1 -17
  252. package/dist/node/code-snippet/highlight.js +1 -67
  253. package/dist/node/collapsible/collapsible.js +1 -47
  254. package/dist/node/collapsible/collapsible.module.js +1 -7
  255. package/dist/node/color-picker/color-picker.js +1 -272
  256. package/dist/node/color-picker/color-picker.module.js +1 -18
  257. package/dist/node/color-picker/color.js +1 -0
  258. package/dist/node/combobox/combobox.js +1 -170
  259. package/dist/node/combobox/combobox.module.js +1 -19
  260. package/dist/node/combobox/list-nav.js +1 -0
  261. package/dist/node/combobox/option-list.js +1 -0
  262. package/dist/node/command-menu/command-menu.js +1 -421
  263. package/dist/node/command-menu/command-menu.module.js +1 -34
  264. package/dist/node/comparison/comparison.js +1 -69
  265. package/dist/node/comparison/comparison.module.js +1 -9
  266. package/dist/node/contained-list/contained-list.js +1 -41
  267. package/dist/node/contained-list/contained-list.module.js +1 -11
  268. package/dist/node/context-menu/context-menu.js +1 -93
  269. package/dist/node/context-menu/context-menu.module.js +1 -7
  270. package/dist/node/copy-button/copy-button.js +1 -60
  271. package/dist/node/copy-button/copy-button.module.js +1 -6
  272. package/dist/node/data-list/data-list.js +1 -25
  273. package/dist/node/data-list/data-list.module.js +1 -8
  274. package/dist/node/data-table/column-filter.js +1 -0
  275. package/dist/node/data-table/column-layout.js +1 -0
  276. package/dist/node/data-table/data-table.js +1 -398
  277. package/dist/node/data-table/data-table.module.js +1 -33
  278. package/dist/node/data-table/grid-keys.js +1 -0
  279. package/dist/node/data-table/row-group.js +1 -0
  280. package/dist/node/data-table/row-search.js +1 -0
  281. package/dist/node/data-table/row-sort.js +1 -0
  282. package/dist/node/data-table/to-csv.js +3 -0
  283. package/dist/node/data-table/virtual-window.js +1 -0
  284. package/dist/node/date-picker/date-picker.js +1 -224
  285. package/dist/node/date-picker/date-picker.module.js +1 -23
  286. package/dist/node/date-picker/parse-date.js +1 -0
  287. package/dist/node/date-range-picker/date-range-picker.js +1 -196
  288. package/dist/node/date-range-picker/date-range-picker.module.js +1 -18
  289. package/dist/node/dock/dock.js +1 -34
  290. package/dist/node/dock/dock.module.js +1 -8
  291. package/dist/node/drawer/drawer.js +1 -96
  292. package/dist/node/drawer/drawer.module.js +1 -13
  293. package/dist/node/dropdown/dropdown.js +1 -110
  294. package/dist/node/dropdown/dropdown.module.js +1 -9
  295. package/dist/node/editable/editable.js +1 -76
  296. package/dist/node/editable/editable.module.js +1 -11
  297. package/dist/node/empty-state/empty-state.js +1 -32
  298. package/dist/node/empty-state/empty-state.module.js +1 -9
  299. package/dist/node/fab/fab.js +1 -93
  300. package/dist/node/fab/fab.module.js +1 -12
  301. package/dist/node/field/field.js +1 -53
  302. package/dist/node/field/field.module.js +1 -7
  303. package/dist/node/file-uploader/file-uploader.js +1 -123
  304. package/dist/node/file-uploader/file-uploader.module.js +1 -18
  305. package/dist/node/filter/filter.js +1 -35
  306. package/dist/node/filter/filter.module.js +1 -6
  307. package/dist/node/form/form.js +1 -95
  308. package/dist/node/form/form.module.js +1 -3
  309. package/dist/node/header/header.js +1 -44
  310. package/dist/node/header/header.module.js +1 -11
  311. package/dist/node/header-panel/header-panel.js +1 -72
  312. package/dist/node/header-panel/header-panel.module.js +1 -9
  313. package/dist/node/heading/heading.js +1 -22
  314. package/dist/node/heading/heading.module.js +1 -3
  315. package/dist/node/hover-card/hover-card.js +1 -84
  316. package/dist/node/hover-card/hover-card.module.js +1 -6
  317. package/dist/node/icon-button/icon-button.js +1 -19
  318. package/dist/node/icon-button/icon-button.module.js +1 -3
  319. package/dist/node/image/image.js +1 -64
  320. package/dist/node/image/image.module.js +1 -9
  321. package/dist/node/indicator/indicator.js +1 -16
  322. package/dist/node/indicator/indicator.module.js +1 -6
  323. package/dist/node/infinite-scroll/infinite-scroll.js +1 -49
  324. package/dist/node/infinite-scroll/infinite-scroll.module.js +1 -7
  325. package/dist/node/inline-loading/inline-loading.js +1 -74
  326. package/dist/node/inline-loading/inline-loading.module.js +1 -9
  327. package/dist/node/input/input.js +1 -56
  328. package/dist/node/input/input.module.js +1 -9
  329. package/dist/node/input-group/input-group.js +1 -39
  330. package/dist/node/input-group/input-group.module.js +1 -9
  331. package/dist/node/item/item.js +1 -50
  332. package/dist/node/item/item.module.js +1 -10
  333. package/dist/node/join/join.js +1 -12
  334. package/dist/node/join/join.module.js +1 -3
  335. package/dist/node/kbd/kbd.js +1 -14
  336. package/dist/node/kbd/kbd.module.js +1 -3
  337. package/dist/node/label/label.js +1 -23
  338. package/dist/node/label/label.module.js +1 -7
  339. package/dist/node/large-title-header/large-title-header.js +1 -38
  340. package/dist/node/large-title-header/large-title-header.module.js +1 -12
  341. package/dist/node/layouts/src/auto-grid/auto-grid.js +1 -17
  342. package/dist/node/layouts/src/auto-grid/auto-grid.module.js +1 -4
  343. package/dist/node/layouts/src/center/center.js +1 -16
  344. package/dist/node/layouts/src/center/center.module.js +1 -3
  345. package/dist/node/layouts/src/columns/columns.js +1 -21
  346. package/dist/node/layouts/src/columns/columns.module.js +1 -6
  347. package/dist/node/layouts/src/flex/flex.js +1 -20
  348. package/dist/node/layouts/src/flex/flex.module.js +1 -3
  349. package/dist/node/layouts/src/grid/grid.js +1 -55
  350. package/dist/node/layouts/src/grid/grid.module.js +1 -7
  351. package/dist/node/layouts/src/page-header/page-header.js +1 -31
  352. package/dist/node/layouts/src/page-header/page-header.module.js +1 -10
  353. package/dist/node/layouts/src/spacer/spacer.js +1 -17
  354. package/dist/node/layouts/src/spacer/spacer.module.js +1 -3
  355. package/dist/node/link/link.js +1 -22
  356. package/dist/node/link/link.module.js +1 -3
  357. package/dist/node/list/list.js +1 -21
  358. package/dist/node/list/list.module.js +1 -6
  359. package/dist/node/log-viewer/log-viewer.js +2 -184
  360. package/dist/node/log-viewer/log-viewer.module.js +1 -16
  361. package/dist/node/menu/menu.js +1 -126
  362. package/dist/node/menu/menu.module.js +1 -8
  363. package/dist/node/menu-button/menu-button.js +1 -92
  364. package/dist/node/menu-button/menu-button.module.js +1 -8
  365. package/dist/node/menubar/menubar.js +1 -103
  366. package/dist/node/menubar/menubar.module.js +1 -8
  367. package/dist/node/modal/modal.js +1 -76
  368. package/dist/node/modal/modal.module.js +1 -12
  369. package/dist/node/multi-select/list-nav.js +1 -0
  370. package/dist/node/multi-select/multi-select.js +1 -106
  371. package/dist/node/multi-select/multi-select.module.js +1 -15
  372. package/dist/node/multi-select/option-list.js +1 -0
  373. package/dist/node/native-select/native-select.js +1 -37
  374. package/dist/node/native-select/native-select.module.js +1 -7
  375. package/dist/node/navigation-menu/navigation-menu.js +1 -99
  376. package/dist/node/navigation-menu/navigation-menu.module.js +1 -10
  377. package/dist/node/notification/notification.js +1 -140
  378. package/dist/node/notification/notification.module.js +1 -11
  379. package/dist/node/number-input/number-input.js +1 -148
  380. package/dist/node/number-input/number-input.module.js +1 -12
  381. package/dist/node/otp-input/otp-input.js +1 -70
  382. package/dist/node/otp-input/otp-input.module.js +1 -6
  383. package/dist/node/overflow-menu/overflow-menu.js +1 -70
  384. package/dist/node/overflow-menu/overflow-menu.module.js +1 -7
  385. package/dist/node/pagination/pagination.js +1 -92
  386. package/dist/node/pagination/pagination.module.js +1 -11
  387. package/dist/node/password-input/password-input.js +1 -81
  388. package/dist/node/password-input/password-input.module.js +1 -11
  389. package/dist/node/popover/popover.js +1 -51
  390. package/dist/node/popover/popover.module.js +1 -6
  391. package/dist/node/popover/use-popover.js +1 -55
  392. package/dist/node/progress/progress.js +1 -16
  393. package/dist/node/progress/progress.module.js +1 -6
  394. package/dist/node/progress-bar/progress-bar.js +1 -42
  395. package/dist/node/progress-bar/progress-bar.module.js +1 -11
  396. package/dist/node/progress-circle/progress-circle.js +1 -46
  397. package/dist/node/progress-circle/progress-circle.module.js +1 -9
  398. package/dist/node/progress-indicator/progress-indicator.js +1 -34
  399. package/dist/node/progress-indicator/progress-indicator.module.js +1 -10
  400. package/dist/node/prose/prose.js +1 -13
  401. package/dist/node/prose/prose.module.js +1 -3
  402. package/dist/node/pull-to-refresh/pull-to-refresh.js +1 -82
  403. package/dist/node/pull-to-refresh/pull-to-refresh.module.js +1 -9
  404. package/dist/node/qr-code/encode.js +1 -583
  405. package/dist/node/qr-code/qr-code.js +1 -41
  406. package/dist/node/qr-code/qr-code.module.js +1 -6
  407. package/dist/node/radial-progress/radial-progress.js +1 -27
  408. package/dist/node/radial-progress/radial-progress.module.js +1 -6
  409. package/dist/node/radio/radio.js +1 -49
  410. package/dist/node/radio/radio.module.js +1 -9
  411. package/dist/node/radio-card/radio-card.js +1 -64
  412. package/dist/node/radio-card/radio-card.module.js +1 -11
  413. package/dist/node/rating-group/rating-group.js +1 -37
  414. package/dist/node/rating-group/rating-group.module.js +1 -6
  415. package/dist/node/react/src/index.js +1 -141
  416. package/dist/node/relative-time/relative-time.js +1 -66
  417. package/dist/node/relative-time/relative-time.module.js +1 -3
  418. package/dist/node/reorder-list/reorder-list.js +1 -143
  419. package/dist/node/reorder-list/reorder-list.module.js +1 -11
  420. package/dist/node/resizable/resizable.js +1 -80
  421. package/dist/node/resizable/resizable.module.js +1 -8
  422. package/dist/node/scroll-area/scroll-area.js +1 -38
  423. package/dist/node/scroll-area/scroll-area.module.js +1 -3
  424. package/dist/node/search/search.js +1 -96
  425. package/dist/node/search/search.module.js +1 -9
  426. package/dist/node/segmented-control/segmented-control.js +1 -43
  427. package/dist/node/segmented-control/segmented-control.module.js +1 -6
  428. package/dist/node/select/select.js +1 -73
  429. package/dist/node/select/select.module.js +1 -11
  430. package/dist/node/separator/separator.js +1 -19
  431. package/dist/node/separator/separator.module.js +1 -3
  432. package/dist/node/sheet/sheet.js +1 -49
  433. package/dist/node/sheet/sheet.module.js +1 -9
  434. package/dist/node/shell-header/shell-header.js +1 -169
  435. package/dist/node/shell-header/shell-header.module.js +1 -24
  436. package/dist/node/side-nav/side-nav.js +1 -334
  437. package/dist/node/side-nav/side-nav.module.js +1 -31
  438. package/dist/node/skeleton/skeleton.js +1 -23
  439. package/dist/node/skeleton/skeleton.module.js +1 -7
  440. package/dist/node/skip-nav/skip-nav.js +1 -28
  441. package/dist/node/skip-nav/skip-nav.module.js +1 -3
  442. package/dist/node/slider/slider.js +1 -30
  443. package/dist/node/slider/slider.module.js +1 -7
  444. package/dist/node/spinner/spinner.js +1 -18
  445. package/dist/node/spinner/spinner.module.js +1 -6
  446. package/dist/node/stack/stack.js +1 -17
  447. package/dist/node/stack/stack.module.js +1 -6
  448. package/dist/node/stat/stat.js +1 -41
  449. package/dist/node/stat/stat.module.js +1 -11
  450. package/dist/node/status/status.js +1 -25
  451. package/dist/node/status/status.module.js +1 -7
  452. package/dist/node/steps/steps.js +1 -35
  453. package/dist/node/steps/steps.module.js +1 -8
  454. package/dist/node/structured-list/structured-list.js +1 -102
  455. package/dist/node/structured-list/structured-list.module.js +1 -12
  456. package/dist/node/swap/swap.js +1 -36
  457. package/dist/node/swap/swap.module.js +1 -7
  458. package/dist/node/swipe-item/swipe-item.js +1 -62
  459. package/dist/node/swipe-item/swipe-item.module.js +1 -12
  460. package/dist/node/switcher/switcher.js +1 -32
  461. package/dist/node/switcher/switcher.module.js +1 -8
  462. package/dist/node/tabs/tabs.js +1 -98
  463. package/dist/node/tabs/tabs.module.js +1 -8
  464. package/dist/node/tag/tag.js +1 -33
  465. package/dist/node/tag/tag.module.js +1 -6
  466. package/dist/node/tags-input/tags-input.js +1 -68
  467. package/dist/node/tags-input/tags-input.module.js +1 -8
  468. package/dist/node/text/text.js +1 -16
  469. package/dist/node/text/text.module.js +1 -3
  470. package/dist/node/textarea/textarea.js +1 -58
  471. package/dist/node/textarea/textarea.module.js +1 -9
  472. package/dist/node/tile/tile.js +1 -39
  473. package/dist/node/tile/tile.module.js +1 -7
  474. package/dist/node/time-picker/time-picker.js +1 -64
  475. package/dist/node/time-picker/time-picker.module.js +1 -9
  476. package/dist/node/timeline/timeline.js +1 -55
  477. package/dist/node/timeline/timeline.module.js +1 -11
  478. package/dist/node/toast/toast.js +1 -85
  479. package/dist/node/toast/toast.module.js +1 -11
  480. package/dist/node/toc/toc.js +1 -43
  481. package/dist/node/toc/toc.module.js +1 -3
  482. package/dist/node/toc/use-toc-from-region.js +1 -18
  483. package/dist/node/toggle/toggle.js +1 -42
  484. package/dist/node/toggle/toggle.module.js +1 -8
  485. package/dist/node/toggle-group/toggle-group.js +1 -55
  486. package/dist/node/toggle-group/toggle-group.module.js +1 -6
  487. package/dist/node/toggletip/toggletip.js +1 -49
  488. package/dist/node/toggletip/toggletip.module.js +1 -7
  489. package/dist/node/tooltip/tooltip.js +1 -58
  490. package/dist/node/tooltip/tooltip.module.js +1 -6
  491. package/dist/node/tree-view/tree-view.js +1 -201
  492. package/dist/node/tree-view/tree-view.module.js +1 -13
  493. package/dist/node/user/user.js +1 -35
  494. package/dist/node/user/user.module.js +1 -9
  495. package/dist/node/virtual-list/virtual-list.js +1 -40
  496. package/dist/node/virtual-list/virtual-list.module.js +1 -7
  497. package/dist/node/visually-hidden/visually-hidden.js +1 -2
  498. package/dist/node/wheel-picker/wheel-picker.js +1 -84
  499. package/dist/node/wheel-picker/wheel-picker.module.js +1 -8
  500. package/dist/notification/notification.js +1 -140
  501. package/dist/notification/notification.module.js +1 -11
  502. package/dist/number-input/number-input.js +1 -148
  503. package/dist/number-input/number-input.module.js +1 -12
  504. package/dist/otp-input/otp-input.js +1 -70
  505. package/dist/otp-input/otp-input.module.js +1 -6
  506. package/dist/overflow-menu/overflow-menu.js +1 -70
  507. package/dist/overflow-menu/overflow-menu.module.js +1 -7
  508. package/dist/pagination/pagination.js +1 -92
  509. package/dist/pagination/pagination.module.js +1 -11
  510. package/dist/password-input/password-input.js +1 -81
  511. package/dist/password-input/password-input.module.js +1 -11
  512. package/dist/popover/popover.js +1 -51
  513. package/dist/popover/popover.module.js +1 -6
  514. package/dist/popover/use-popover.js +1 -55
  515. package/dist/progress/progress.css +1 -1
  516. package/dist/progress/progress.js +1 -16
  517. package/dist/progress/progress.module.js +1 -6
  518. package/dist/progress-bar/progress-bar.css +1 -1
  519. package/dist/progress-bar/progress-bar.js +1 -42
  520. package/dist/progress-bar/progress-bar.module.js +1 -11
  521. package/dist/progress-circle/progress-circle.js +1 -46
  522. package/dist/progress-circle/progress-circle.module.js +1 -9
  523. package/dist/progress-indicator/progress-indicator.css +1 -1
  524. package/dist/progress-indicator/progress-indicator.js +1 -34
  525. package/dist/progress-indicator/progress-indicator.module.js +1 -10
  526. package/dist/prose/prose.css +1 -1
  527. package/dist/prose/prose.js +1 -13
  528. package/dist/prose/prose.module.js +1 -3
  529. package/dist/pull-to-refresh/pull-to-refresh.js +1 -82
  530. package/dist/pull-to-refresh/pull-to-refresh.module.js +1 -9
  531. package/dist/qr-code/encode.js +1 -583
  532. package/dist/qr-code/qr-code.js +1 -41
  533. package/dist/qr-code/qr-code.module.js +1 -6
  534. package/dist/radial-progress/radial-progress.js +1 -27
  535. package/dist/radial-progress/radial-progress.module.js +1 -6
  536. package/dist/radio/radio.js +1 -49
  537. package/dist/radio/radio.module.js +1 -9
  538. package/dist/radio-card/radio-card.css +1 -1
  539. package/dist/radio-card/radio-card.js +1 -64
  540. package/dist/radio-card/radio-card.module.js +1 -11
  541. package/dist/rating-group/rating-group.js +1 -37
  542. package/dist/rating-group/rating-group.module.js +1 -6
  543. package/dist/react/src/index.js +1 -141
  544. package/dist/relative-time/relative-time.js +1 -66
  545. package/dist/relative-time/relative-time.module.js +1 -3
  546. package/dist/reorder-list/reorder-list.css +1 -1
  547. package/dist/reorder-list/reorder-list.js +1 -143
  548. package/dist/reorder-list/reorder-list.module.js +1 -11
  549. package/dist/resizable/resizable.js +1 -80
  550. package/dist/resizable/resizable.module.js +1 -8
  551. package/dist/scroll-area/scroll-area.css +1 -1
  552. package/dist/scroll-area/scroll-area.js +1 -38
  553. package/dist/scroll-area/scroll-area.module.js +1 -3
  554. package/dist/search/search.js +1 -96
  555. package/dist/search/search.module.js +1 -9
  556. package/dist/segmented-control/segmented-control.js +1 -43
  557. package/dist/segmented-control/segmented-control.module.js +1 -6
  558. package/dist/select/select.js +1 -73
  559. package/dist/select/select.module.js +1 -11
  560. package/dist/separator/separator.js +1 -19
  561. package/dist/separator/separator.module.js +1 -3
  562. package/dist/sheet/sheet.js +1 -49
  563. package/dist/sheet/sheet.module.js +1 -9
  564. package/dist/shell-header/shell-header.css +1 -1
  565. package/dist/shell-header/shell-header.js +1 -169
  566. package/dist/shell-header/shell-header.module.js +1 -24
  567. package/dist/side-nav/side-nav.css +1 -1
  568. package/dist/side-nav/side-nav.js +1 -334
  569. package/dist/side-nav/side-nav.module.js +1 -31
  570. package/dist/skeleton/skeleton.css +1 -1
  571. package/dist/skeleton/skeleton.js +1 -23
  572. package/dist/skeleton/skeleton.module.js +1 -7
  573. package/dist/skip-nav/skip-nav.js +1 -28
  574. package/dist/skip-nav/skip-nav.module.js +1 -3
  575. package/dist/slider/slider.js +1 -30
  576. package/dist/slider/slider.module.js +1 -7
  577. package/dist/spinner/spinner.css +1 -1
  578. package/dist/spinner/spinner.js +1 -18
  579. package/dist/spinner/spinner.module.js +1 -6
  580. package/dist/stack/stack.js +1 -17
  581. package/dist/stack/stack.module.js +1 -6
  582. package/dist/stat/stat.js +1 -41
  583. package/dist/stat/stat.module.js +1 -11
  584. package/dist/status/status.css +1 -1
  585. package/dist/status/status.js +1 -25
  586. package/dist/status/status.module.js +1 -7
  587. package/dist/steps/steps.css +1 -1
  588. package/dist/steps/steps.js +1 -35
  589. package/dist/steps/steps.module.js +1 -8
  590. package/dist/structured-list/structured-list.js +1 -102
  591. package/dist/structured-list/structured-list.module.js +1 -12
  592. package/dist/styles.css +401 -55
  593. package/dist/swap/swap.css +1 -1
  594. package/dist/swap/swap.js +1 -36
  595. package/dist/swap/swap.module.js +1 -7
  596. package/dist/swipe-item/swipe-item.js +1 -62
  597. package/dist/swipe-item/swipe-item.module.js +1 -12
  598. package/dist/switcher/switcher.js +1 -32
  599. package/dist/switcher/switcher.module.js +1 -8
  600. package/dist/tabs/tabs.js +1 -98
  601. package/dist/tabs/tabs.module.js +1 -8
  602. package/dist/tag/tag.js +1 -33
  603. package/dist/tag/tag.module.js +1 -6
  604. package/dist/tags-input/tags-input.js +1 -68
  605. package/dist/tags-input/tags-input.module.js +1 -8
  606. package/dist/text/text.css +1 -1
  607. package/dist/text/text.js +1 -16
  608. package/dist/text/text.module.js +1 -3
  609. package/dist/textarea/textarea.css +1 -1
  610. package/dist/textarea/textarea.js +1 -58
  611. package/dist/textarea/textarea.module.js +1 -9
  612. package/dist/tile/tile.css +1 -1
  613. package/dist/tile/tile.js +1 -39
  614. package/dist/tile/tile.module.js +1 -7
  615. package/dist/time-picker/time-picker.js +1 -64
  616. package/dist/time-picker/time-picker.module.js +1 -9
  617. package/dist/timeline/timeline.js +1 -55
  618. package/dist/timeline/timeline.module.js +1 -11
  619. package/dist/toast/toast.css +1 -1
  620. package/dist/toast/toast.js +1 -85
  621. package/dist/toast/toast.module.js +1 -11
  622. package/dist/toc/toc.css +1 -1
  623. package/dist/toc/toc.js +1 -43
  624. package/dist/toc/toc.module.js +1 -3
  625. package/dist/toc/use-toc-from-region.js +1 -18
  626. package/dist/toggle/toggle.js +1 -42
  627. package/dist/toggle/toggle.module.js +1 -8
  628. package/dist/toggle-group/toggle-group.js +1 -55
  629. package/dist/toggle-group/toggle-group.module.js +1 -6
  630. package/dist/toggletip/toggletip.js +1 -49
  631. package/dist/toggletip/toggletip.module.js +1 -7
  632. package/dist/tooltip/tooltip.css +1 -1
  633. package/dist/tooltip/tooltip.js +1 -58
  634. package/dist/tooltip/tooltip.module.js +1 -6
  635. package/dist/tree-view/tree-view.css +1 -1
  636. package/dist/tree-view/tree-view.js +1 -201
  637. package/dist/tree-view/tree-view.module.js +1 -13
  638. package/dist/user/user.js +1 -35
  639. package/dist/user/user.module.js +1 -9
  640. package/dist/virtual-list/virtual-list.js +1 -40
  641. package/dist/virtual-list/virtual-list.module.js +1 -7
  642. package/dist/visually-hidden/visually-hidden.js +1 -2
  643. package/dist/wheel-picker/wheel-picker.js +1 -84
  644. package/dist/wheel-picker/wheel-picker.module.js +1 -8
  645. package/package.json +4 -4
  646. package/readme.body.md +3 -2
@@ -1,49 +1 @@
1
- import e from "./radio.module.js";
2
- import { cn as t } from "@cascivo/core/pure";
3
- import { Children as n, cloneElement as r, forwardRef as i, isValidElement as a } from "react";
4
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
- //#region ../components/src/radio/radio.tsx
6
- var c = i(function({ label: n, ariaLabel: r, className: i, id: a, disabled: c, value: l, ...u }, d) {
7
- let f = a ?? (n ? `cascade-radio-${l}` : void 0);
8
- return /* @__PURE__ */ s("label", {
9
- className: t(e.wrapper, i),
10
- "data-disabled": c || void 0,
11
- children: [
12
- /* @__PURE__ */ o("input", {
13
- id: f,
14
- type: "radio",
15
- value: l,
16
- className: e.input,
17
- disabled: c,
18
- ref: d,
19
- ...u,
20
- "aria-label": u["aria-label"] ?? r
21
- }),
22
- /* @__PURE__ */ o("span", {
23
- className: e.control,
24
- "aria-hidden": "true"
25
- }),
26
- n && /* @__PURE__ */ o("span", {
27
- className: e.label,
28
- children: n
29
- })
30
- ]
31
- });
32
- });
33
- function l({ name: i, value: s, defaultValue: c, onChange: l, orientation: u = "vertical", className: d, children: f }) {
34
- let p = s !== void 0;
35
- return /* @__PURE__ */ o("div", {
36
- role: "radiogroup",
37
- "data-orientation": u,
38
- className: t(e.group, d),
39
- children: n.map(f, (e) => {
40
- if (!a(e)) return e;
41
- let t = e, n = t.props.value, o = { name: i };
42
- return p ? o.checked = n === s : c !== void 0 && (o.defaultChecked = n === c), l && (o.onChange = (e) => {
43
- e.target.checked && l(n);
44
- }), r(t, o);
45
- })
46
- });
47
- }
48
- //#endregion
49
- export { c as Radio, l as RadioGroup };
1
+ import e from"./radio.module.js";import{cn as t}from"@cascivo/core/pure";import{Children as n,cloneElement as r,forwardRef as i,isValidElement as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=i(function({label:n,ariaLabel:r,className:i,id:a,disabled:c,value:l,...u},d){let f=a??(n?`cascade-radio-${l}`:void 0);return s(`label`,{className:t(e.wrapper,i),"data-disabled":c||void 0,children:[o(`input`,{id:f,type:`radio`,value:l,className:e.input,disabled:c,ref:d,...u,"aria-label":u[`aria-label`]??r}),o(`span`,{className:e.control,"aria-hidden":`true`}),n&&o(`span`,{className:e.label,children:n})]})});function RadioGroup({name:i,value:s,defaultValue:c,onChange:l,orientation:u=`vertical`,className:d,children:f}){let p=s!==void 0;return o(`div`,{role:`radiogroup`,"data-orientation":u,className:t(e.group,d),children:n.map(f,e=>{if(!a(e))return e;let t=e,n=t.props.value,o={name:i};return p?o.checked=n===s:c!==void 0&&(o.defaultChecked=n===c),l&&(o.onChange=e=>{e.target.checked&&l(n)}),r(t,o)})})}export{c as Radio,RadioGroup};
@@ -1,10 +1,2 @@
1
1
  import './radio.css';
2
- var e = {
3
- group: "_group_1jh68_2",
4
- wrapper: "_wrapper_1jh68_15",
5
- input: "_input_1jh68_28",
6
- control: "_control_1jh68_41",
7
- label: "_label_1jh68_80"
8
- };
9
- //#endregion
10
- export { e as default };
2
+ var e={group:`_group_1jh68_2`,wrapper:`_wrapper_1jh68_15`,input:`_input_1jh68_28`,control:`_control_1jh68_41`,label:`_label_1jh68_80`};export{e as default};
@@ -1 +1 @@
1
- @layer cascivo.component{._group_1290l_2{gap:var(--cascivo-space-3);display:grid}._card_1290l_7{gap:var(--cascivo-space-3);padding:var(--cascivo-space-4);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-surface);background:var(--cascivo-color-bg);cursor:pointer;align-items:flex-start;transition:border-color .12s,background-color .12s;display:flex}._card_1290l_7:hover:not([data-disabled]){border-color:var(--cascivo-color-border-strong)}._card_1290l_7:has(input:checked){border-color:var(--cascivo-color-accent);background:color-mix(in oklch, var(--cascivo-color-accent) 4%, var(--cascivo-color-bg))}._card_1290l_7:has(input:focus-visible){box-shadow:var(--cascivo-focus-ring)}._card_1290l_7[data-disabled]{opacity:.5;cursor:not-allowed}._input_1290l_39{clip-path:inset(50%);white-space:nowrap;block-size:1px;inline-size:1px;position:absolute;overflow:hidden}._glyph_1290l_48{border:1px solid var(--cascivo-color-border-strong);border-radius:var(--cascivo-radius-full);flex:none;block-size:1rem;inline-size:1rem;margin-block-start:2px;transition:border-color .12s,background-color .12s}._card_1290l_7:has(input:checked) ._glyph_1290l_48{border-color:var(--cascivo-color-accent);background:radial-gradient(circle, var(--cascivo-color-accent) 0 35%, transparent 40%)}._body_1290l_65{gap:var(--cascivo-space-1);flex-direction:column;display:flex}._title_1290l_71{font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);color:var(--cascivo-color-text)}._description_1290l_77{font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text-subtle)}}
1
+ @layer cascivo.component{._group_km0as_2{gap:var(--cascivo-space-3);display:grid}._card_km0as_7{gap:var(--cascivo-space-3);padding:var(--cascivo-space-4);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-surface);background:var(--cascivo-color-bg);cursor:pointer;transition:border-color var(--cascivo-duration-100) ease, background-color var(--cascivo-duration-100) ease;align-items:flex-start;display:flex}._card_km0as_7:hover:not([data-disabled]){border-color:var(--cascivo-color-border-strong)}._card_km0as_7:has(input:checked){border-color:var(--cascivo-color-accent);background:color-mix(in oklch, var(--cascivo-color-accent) 4%, var(--cascivo-color-bg))}._card_km0as_7:has(input:focus-visible){box-shadow:var(--cascivo-focus-ring)}._card_km0as_7[data-disabled]{opacity:.5;cursor:not-allowed}._input_km0as_39{clip-path:inset(50%);white-space:nowrap;block-size:1px;inline-size:1px;position:absolute;overflow:hidden}._glyph_km0as_48{border:1px solid var(--cascivo-color-border-strong);border-radius:var(--cascivo-radius-full);block-size:1rem;inline-size:1rem;transition:border-color var(--cascivo-duration-100) ease, background-color var(--cascivo-duration-100) ease;flex:none;margin-block-start:2px}._card_km0as_7:has(input:checked) ._glyph_km0as_48{border-color:var(--cascivo-color-accent);background:radial-gradient(circle, var(--cascivo-color-accent) 0 35%, transparent 40%)}._body_km0as_65{gap:var(--cascivo-space-1);flex-direction:column;display:flex}._title_km0as_71{font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);color:var(--cascivo-color-text)}._description_km0as_77{font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text-subtle)}}
@@ -1,64 +1 @@
1
- "use client";
2
-
3
- import e from "./radio-card.module.js";
4
- import { createContext as t, forwardRef as n } from "react";
5
- import { cn as r } from "@cascivo/core";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- //#region ../components/src/radio-card/radio-card.tsx
8
- var o = t({ name: "" });
9
- function s({ name: t, label: n, value: a, defaultValue: s, onValueChange: c, children: l, className: u }) {
10
- return /* @__PURE__ */ i(o.Provider, {
11
- value: {
12
- name: t,
13
- value: a,
14
- defaultValue: s,
15
- onValueChange: c
16
- },
17
- children: /* @__PURE__ */ i("div", {
18
- role: "radiogroup",
19
- "aria-label": n,
20
- className: r(e.group, u),
21
- children: l
22
- })
23
- });
24
- }
25
- var c = n(function({ value: t, title: n, description: r, disabled: s, hideIndicator: c, ...l }, u) {
26
- return /* @__PURE__ */ i(o.Consumer, { children: (o) => /* @__PURE__ */ a("label", {
27
- className: e.card,
28
- "data-disabled": s || void 0,
29
- children: [
30
- /* @__PURE__ */ i("input", {
31
- type: "radio",
32
- className: e.input,
33
- name: o.name,
34
- value: t,
35
- disabled: s,
36
- ...o.value === void 0 ? {
37
- defaultChecked: o.defaultValue === t,
38
- onChange: () => o.onValueChange?.(t)
39
- } : {
40
- checked: o.value === t,
41
- onChange: () => o.onValueChange?.(t)
42
- },
43
- ref: u,
44
- ...l
45
- }),
46
- !c && /* @__PURE__ */ i("span", {
47
- className: e.glyph,
48
- "aria-hidden": "true"
49
- }),
50
- /* @__PURE__ */ a("span", {
51
- className: e.body,
52
- children: [/* @__PURE__ */ i("span", {
53
- className: e.title,
54
- children: n
55
- }), r && /* @__PURE__ */ i("span", {
56
- className: e.description,
57
- children: r
58
- })]
59
- })
60
- ]
61
- }) });
62
- });
63
- //#endregion
64
- export { c as RadioCard, s as RadioCardGroup };
1
+ "use client";import e from"./radio-card.module.js";import{createContext as t,forwardRef as n}from"react";import{cn as r}from"@cascivo/core";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=t({name:``});function RadioCardGroup({name:t,label:n,value:a,defaultValue:s,onValueChange:c,children:l,className:u}){return i(o.Provider,{value:{name:t,value:a,defaultValue:s,onValueChange:c},children:i(`div`,{role:`radiogroup`,"aria-label":n,className:r(e.group,u),children:l})})}var s=n(function({value:t,title:n,description:r,disabled:s,hideIndicator:c,...l},u){return i(o.Consumer,{children:o=>a(`label`,{className:e.card,"data-disabled":s||void 0,children:[i(`input`,{type:`radio`,className:e.input,name:o.name,value:t,disabled:s,...o.value===void 0?{defaultChecked:o.defaultValue===t,onChange:()=>o.onValueChange?.(t)}:{checked:o.value===t,onChange:()=>o.onValueChange?.(t)},ref:u,...l}),!c&&i(`span`,{className:e.glyph,"aria-hidden":`true`}),a(`span`,{className:e.body,children:[i(`span`,{className:e.title,children:n}),r&&i(`span`,{className:e.description,children:r})]})]})})});export{s as RadioCard,RadioCardGroup};
@@ -1,12 +1,2 @@
1
1
  import './radio-card.css';
2
- var e = {
3
- group: "_group_1290l_2",
4
- card: "_card_1290l_7",
5
- input: "_input_1290l_39",
6
- glyph: "_glyph_1290l_48",
7
- body: "_body_1290l_65",
8
- title: "_title_1290l_71",
9
- description: "_description_1290l_77"
10
- };
11
- //#endregion
12
- export { e as default };
2
+ var e={group:`_group_km0as_2`,card:`_card_km0as_7`,input:`_input_km0as_39`,glyph:`_glyph_km0as_48`,body:`_body_km0as_65`,title:`_title_km0as_71`,description:`_description_km0as_77`};export{e as default};
@@ -1,37 +1 @@
1
- "use client";
2
-
3
- import e from "./rating-group.module.js";
4
- import { cn as t } from "@cascivo/core";
5
- import { jsx as n } from "react/jsx-runtime";
6
- //#region ../components/src/rating-group/rating-group.tsx
7
- function r(e, t) {
8
- return `${e} of ${t} stars`;
9
- }
10
- function i({ value: i, onValueChange: a, max: o = 5, size: s = "md", disabled: c = !1, readOnly: l = !1, labels: u, className: d, ...f }) {
11
- let p = u?.rating ?? r, m = !c && !l && a !== void 0;
12
- return /* @__PURE__ */ n("div", {
13
- className: t(e.wrapper, d),
14
- "data-size": s,
15
- role: "radiogroup",
16
- ...f,
17
- children: Array.from({ length: o }, (t, r) => {
18
- let s = r + 1, l = s <= i;
19
- return /* @__PURE__ */ n("button", {
20
- type: "button",
21
- role: "radio",
22
- "aria-checked": s === i,
23
- "aria-label": p(s, o),
24
- className: e.star,
25
- "data-filled": l ? "" : void 0,
26
- "data-value": s,
27
- disabled: c,
28
- tabIndex: m ? 0 : -1,
29
- onClick: () => {
30
- m && a(s);
31
- }
32
- }, s);
33
- })
34
- });
35
- }
36
- //#endregion
37
- export { i as RatingGroup };
1
+ "use client";import e from"./rating-group.module.js";import{cn as t}from"@cascivo/core";import{jsx as n}from"react/jsx-runtime";function defaultRatingLabel(e,t){return`${e} of ${t} stars`}function RatingGroup({value:r,onValueChange:i,max:a=5,size:o=`md`,disabled:s=!1,readOnly:c=!1,labels:l,className:u,...d}){let f=l?.rating??defaultRatingLabel,p=!s&&!c&&i!==void 0;return n(`div`,{className:t(e.wrapper,u),"data-size":o,role:`radiogroup`,...d,children:Array.from({length:a},(t,o)=>{let c=o+1,l=c<=r;return n(`button`,{type:`button`,role:`radio`,"aria-checked":c===r,"aria-label":f(c,a),className:e.star,"data-filled":l?``:void 0,"data-value":c,disabled:s,tabIndex:p?0:-1,onClick:()=>{p&&i(c)}},c)})})}export{RatingGroup};
@@ -1,7 +1,2 @@
1
1
  import './rating-group.css';
2
- var e = {
3
- wrapper: "_wrapper_b346p_2",
4
- star: "_star_b346p_20"
5
- };
6
- //#endregion
7
- export { e as default };
2
+ var e={wrapper:`_wrapper_b346p_2`,star:`_star_b346p_20`};export{e as default};
@@ -1,141 +1 @@
1
- import { Spinner as ee } from "../../spinner/spinner.js";
2
- import { Button as te } from "../../button/button.js";
3
- import { Input as e } from "../../input/input.js";
4
- import { Card as t, CardContent as n, CardFooter as r, CardHeader as i, CardTitle as a } from "../../card/card.js";
5
- import { Badge as o } from "../../badge/badge.js";
6
- import { Modal as s } from "../../modal/modal.js";
7
- import { Separator as c } from "../../separator/separator.js";
8
- import { Alert as l } from "../../alert/alert.js";
9
- import { Avatar as u } from "../../avatar/avatar.js";
10
- import { AvatarGroup as d } from "../../avatar-group/avatar-group.js";
11
- import { User as f } from "../../user/user.js";
12
- import { Image as p } from "../../image/image.js";
13
- import { Textarea as m } from "../../textarea/textarea.js";
14
- import { Select as h } from "../../select/select.js";
15
- import { Checkbox as g } from "../../checkbox/checkbox.js";
16
- import { Radio as _, RadioGroup as v } from "../../radio/radio.js";
17
- import { Toggle as y } from "../../toggle/toggle.js";
18
- import { Slider as b } from "../../slider/slider.js";
19
- import { Tooltip as x } from "../../tooltip/tooltip.js";
20
- import { Dropdown as S } from "../../dropdown/dropdown.js";
21
- import { ToastProvider as C, dismissAllToasts as w, useToast as T } from "../../toast/toast.js";
22
- import { Tabs as E, TabsContent as D, TabsList as O, TabsTrigger as k } from "../../tabs/tabs.js";
23
- import { Accordion as A, AccordionContent as j, AccordionItem as M, AccordionTrigger as N } from "../../accordion/accordion.js";
24
- import { ActionSheet as P } from "../../action-sheet/action-sheet.js";
25
- import { Kbd as F } from "../../kbd/kbd.js";
26
- import { Link as I } from "../../link/link.js";
27
- import { Breadcrumb as L } from "../../breadcrumb/breadcrumb.js";
28
- import { Toc as R } from "../../toc/toc.js";
29
- import { useTocFromRegion as z } from "../../toc/use-toc-from-region.js";
30
- import { Header as B } from "../../header/header.js";
31
- import { usePopover as V } from "../../popover/use-popover.js";
32
- import { SideNav as H } from "../../side-nav/side-nav.js";
33
- import { Pagination as U } from "../../pagination/pagination.js";
34
- import { ProgressIndicator as W } from "../../progress-indicator/progress-indicator.js";
35
- import { Tag as G } from "../../tag/tag.js";
36
- import { Skeleton as K } from "../../skeleton/skeleton.js";
37
- import { ProgressBar as q } from "../../progress-bar/progress-bar.js";
38
- import { EmptyState as J } from "../../empty-state/empty-state.js";
39
- import { Fab as Y } from "../../fab/fab.js";
40
- import { OverflowMenu as X } from "../../overflow-menu/overflow-menu.js";
41
- import { Search as Z } from "../../search/search.js";
42
- import { NumberInput as Q } from "../../number-input/number-input.js";
43
- import { DataTable as ne } from "../../data-table/data-table.js";
44
- import { CommandMenu as re, fuzzyMatch as ie, fuzzyScore as ae } from "../../command-menu/command-menu.js";
45
- import { Form as oe, createForm as se, useForm as ce } from "../../form/form.js";
46
- import { Combobox as le } from "../../combobox/combobox.js";
47
- import { DatePicker as ue } from "../../date-picker/date-picker.js";
48
- import { FileUploader as de } from "../../file-uploader/file-uploader.js";
49
- import { TimePicker as fe } from "../../time-picker/time-picker.js";
50
- import { Popover as pe, PopoverContent as me, PopoverTrigger as he } from "../../popover/popover.js";
51
- import { Menu as ge, MenuItem as _e, MenuSeparator as ve, MenuTrigger as ye } from "../../menu/menu.js";
52
- import { AlertDialog as be } from "../../alert-dialog/alert-dialog.js";
53
- import { Sheet as xe } from "../../sheet/sheet.js";
54
- import { BottomSheet as Se } from "../../bottom-sheet/bottom-sheet.js";
55
- import { ContextMenu as Ce, ContextMenuItem as we } from "../../context-menu/context-menu.js";
56
- import { Comparison as Te } from "../../comparison/comparison.js";
57
- import { HoverCard as Ee, HoverCardContent as De, HoverCardTrigger as Oe } from "../../hover-card/hover-card.js";
58
- import { PasswordInput as ke } from "../../password-input/password-input.js";
59
- import { MultiSelect as Ae } from "../../multi-select/multi-select.js";
60
- import { TagsInput as je } from "../../tags-input/tags-input.js";
61
- import { OtpInput as Me } from "../../otp-input/otp-input.js";
62
- import { SegmentedControl as Ne } from "../../segmented-control/segmented-control.js";
63
- import { InputGroup as Pe, InputGroupAddon as Fe } from "../../input-group/input-group.js";
64
- import { RatingGroup as Ie } from "../../rating-group/rating-group.js";
65
- import { Editable as Le } from "../../editable/editable.js";
66
- import { RadioCard as Re, RadioCardGroup as ze } from "../../radio-card/radio-card.js";
67
- import { ShellHeader as Be } from "../../shell-header/shell-header.js";
68
- import { HeaderPanel as Ve } from "../../header-panel/header-panel.js";
69
- import { Switcher as He } from "../../switcher/switcher.js";
70
- import { CheckboxCard as Ue } from "../../checkbox-card/checkbox-card.js";
71
- import { CopyButton as We } from "../../copy-button/copy-button.js";
72
- import { Stat as Ge } from "../../stat/stat.js";
73
- import { Status as Ke } from "../../status/status.js";
74
- import "../../visually-hidden/visually-hidden.js";
75
- import { SkipNavLink as qe, SkipNavTarget as Je } from "../../skip-nav/skip-nav.js";
76
- import { Progress as Ye } from "../../progress/progress.js";
77
- import { ProgressCircle as Xe } from "../../progress-circle/progress-circle.js";
78
- import { Heading as Ze } from "../../heading/heading.js";
79
- import { Text as Qe } from "../../text/text.js";
80
- import { Code as $e } from "../../code/code.js";
81
- import { Blockquote as et } from "../../blockquote/blockquote.js";
82
- import { List as tt, ListItem as nt } from "../../list/list.js";
83
- import { LogViewer as rt } from "../../log-viewer/log-viewer.js";
84
- import { Prose as it } from "../../prose/prose.js";
85
- import { PullToRefresh as at } from "../../pull-to-refresh/pull-to-refresh.js";
86
- import { QrCode as ot } from "../../qr-code/qr-code.js";
87
- import { RelativeTime as st } from "../../relative-time/relative-time.js";
88
- import { Label as ct } from "../../label/label.js";
89
- import { Field as lt } from "../../field/field.js";
90
- import { Filter as ut } from "../../filter/filter.js";
91
- import { IconButton as dt } from "../../icon-button/icon-button.js";
92
- import { ButtonGroup as ft } from "../../button-group/button-group.js";
93
- import { ToggleGroup as $ } from "../../toggle-group/toggle-group.js";
94
- import { InlineLoading as pt } from "../../inline-loading/inline-loading.js";
95
- import { Notification as mt } from "../../notification/notification.js";
96
- import { ScrollArea as ht } from "../../scroll-area/scroll-area.js";
97
- import { Collapsible as gt } from "../../collapsible/collapsible.js";
98
- import { AspectRatio as _t } from "../../aspect-ratio/aspect-ratio.js";
99
- import { MenuButton as vt } from "../../menu-button/menu-button.js";
100
- import { Toggletip as yt } from "../../toggletip/toggletip.js";
101
- import { Menubar as bt } from "../../menubar/menubar.js";
102
- import { NavigationMenu as xt } from "../../navigation-menu/navigation-menu.js";
103
- import { TreeView as St, treeViewMessages as Ct } from "../../tree-view/tree-view.js";
104
- import { StructuredList as wt } from "../../structured-list/structured-list.js";
105
- import { ContainedList as Tt, ContainedListItem as Et } from "../../contained-list/contained-list.js";
106
- import { DataList as Dt } from "../../data-list/data-list.js";
107
- import { Timeline as Ot } from "../../timeline/timeline.js";
108
- import { Item as kt, ItemActions as At, ItemContent as jt, ItemDescription as Mt, ItemMedia as Nt, ItemTitle as Pt } from "../../item/item.js";
109
- import { Calendar as Ft } from "../../calendar/calendar.js";
110
- import { DateRangePicker as It } from "../../date-range-picker/date-range-picker.js";
111
- import { ColorPicker as Lt } from "../../color-picker/color-picker.js";
112
- import { Carousel as Rt } from "../../carousel/carousel.js";
113
- import { Resizable as zt } from "../../resizable/resizable.js";
114
- import { Dock as Bt } from "../../dock/dock.js";
115
- import { LargeTitleHeader as Vt } from "../../large-title-header/large-title-header.js";
116
- import { InfiniteScroll as Ht } from "../../infinite-scroll/infinite-scroll.js";
117
- import { ReorderList as Ut } from "../../reorder-list/reorder-list.js";
118
- import { VirtualList as Wt } from "../../virtual-list/virtual-list.js";
119
- import { WheelPicker as Gt } from "../../wheel-picker/wheel-picker.js";
120
- import { Drawer as Kt } from "../../drawer/drawer.js";
121
- import { NativeSelect as qt } from "../../native-select/native-select.js";
122
- import { CodeSnippet as Jt } from "../../code-snippet/code-snippet.js";
123
- import { Steps as Yt } from "../../steps/steps.js";
124
- import { Tile as Xt } from "../../tile/tile.js";
125
- import { Indicator as Zt } from "../../indicator/indicator.js";
126
- import { Join as Qt } from "../../join/join.js";
127
- import { Stack as $t } from "../../stack/stack.js";
128
- import { AppShell as en } from "../../app-shell/app-shell.js";
129
- import { ChatBubble as tn } from "../../chat-bubble/chat-bubble.js";
130
- import { RadialProgress as nn } from "../../radial-progress/radial-progress.js";
131
- import { Swap as rn } from "../../swap/swap.js";
132
- import { SwipeItem as an } from "../../swipe-item/swipe-item.js";
133
- import { Grid as on, GridItem as sn } from "../../layouts/src/grid/grid.js";
134
- import { Flex as cn } from "../../layouts/src/flex/flex.js";
135
- import { Columns as ln } from "../../layouts/src/columns/columns.js";
136
- import { Center as un } from "../../layouts/src/center/center.js";
137
- import { Spacer as dn } from "../../layouts/src/spacer/spacer.js";
138
- import { AutoGrid as fn } from "../../layouts/src/auto-grid/auto-grid.js";
139
- import { PageHeader as pn } from "../../layouts/src/page-header/page-header.js";
140
- import { DismissableLayer as mn, ErrorBoundary as hn, FocusScope as gn, Portal as _n, Presence as vn, Slot as yn, SuspenseBoundary as bn, ThemeProvider as xn, VisuallyHidden as Sn, applyTheme as Cn, batch as wn, cn as Tn, composeRefs as En, computePosition as Dn, computed as On, createMachine as kn, createScope as An, createStreamBuffer as jn, effect as Mn, getLinkComponent as Nn, mergeProps as Pn, setLinkComponent as Fn, setTheme as In, signal as Ln, themePreloadScript as Rn, themeSignal as zn, useAnchorPosition as Bn, useClipboard as Vn, useComputed as Hn, useControllableSignal as Un, useDisclosure as Wn, useEffectPropSignal as Gn, useId as Kn, useMachine as qn, useMediaQuery as Jn, useRovingFocus as Yn, useScope as Xn, useScrollLock as Zn, useSignal as Qn, useSignalEffect as $n, useSignals as er, useStreamBuffer as tr, useTheme as nr, useTypeahead as rr } from "@cascivo/core";
141
- export { A as Accordion, j as AccordionContent, M as AccordionItem, N as AccordionTrigger, P as ActionSheet, l as Alert, be as AlertDialog, en as AppShell, _t as AspectRatio, fn as AutoGrid, u as Avatar, d as AvatarGroup, o as Badge, et as Blockquote, Se as BottomSheet, L as Breadcrumb, te as Button, ft as ButtonGroup, Ft as Calendar, t as Card, n as CardContent, r as CardFooter, i as CardHeader, a as CardTitle, Rt as Carousel, un as Center, tn as ChatBubble, g as Checkbox, Ue as CheckboxCard, $e as Code, Jt as CodeSnippet, gt as Collapsible, Lt as ColorPicker, ln as Columns, le as Combobox, re as CommandMenu, Te as Comparison, Tt as ContainedList, Et as ContainedListItem, Ce as ContextMenu, we as ContextMenuItem, We as CopyButton, Dt as DataList, ne as DataTable, ue as DatePicker, It as DateRangePicker, mn as DismissableLayer, Bt as Dock, Kt as Drawer, S as Dropdown, Le as Editable, J as EmptyState, hn as ErrorBoundary, Y as Fab, lt as Field, de as FileUploader, ut as Filter, cn as Flex, gn as FocusScope, oe as Form, on as Grid, sn as GridItem, B as Header, Ve as HeaderPanel, Ze as Heading, Ee as HoverCard, De as HoverCardContent, Oe as HoverCardTrigger, dt as IconButton, p as Image, Zt as Indicator, Ht as InfiniteScroll, pt as InlineLoading, e as Input, Pe as InputGroup, Fe as InputGroupAddon, kt as Item, At as ItemActions, jt as ItemContent, Mt as ItemDescription, Nt as ItemMedia, Pt as ItemTitle, Qt as Join, F as Kbd, ct as Label, Vt as LargeTitleHeader, I as Link, tt as List, nt as ListItem, rt as LogViewer, ge as Menu, vt as MenuButton, _e as MenuItem, ve as MenuSeparator, ye as MenuTrigger, bt as Menubar, s as Modal, Ae as MultiSelect, qt as NativeSelect, xt as NavigationMenu, mt as Notification, Q as NumberInput, Me as OtpInput, X as OverflowMenu, pn as PageHeader, U as Pagination, ke as PasswordInput, pe as Popover, me as PopoverContent, he as PopoverTrigger, _n as Portal, vn as Presence, Ye as Progress, q as ProgressBar, Xe as ProgressCircle, W as ProgressIndicator, it as Prose, at as PullToRefresh, ot as QrCode, nn as RadialProgress, _ as Radio, Re as RadioCard, ze as RadioCardGroup, v as RadioGroup, Ie as RatingGroup, st as RelativeTime, Ut as ReorderList, zt as Resizable, ht as ScrollArea, Z as Search, Ne as SegmentedControl, h as Select, c as Separator, xe as Sheet, Be as ShellHeader, H as SideNav, K as Skeleton, qe as SkipNavLink, Je as SkipNavTarget, b as Slider, yn as Slot, dn as Spacer, ee as Spinner, $t as Stack, Ge as Stat, Ke as Status, Yt as Steps, wt as StructuredList, bn as SuspenseBoundary, rn as Swap, an as SwipeItem, y as Switch, He as Switcher, E as Tabs, D as TabsContent, O as TabsList, k as TabsTrigger, G as Tag, je as TagsInput, Qe as Text, m as Textarea, xn as ThemeProvider, Xt as Tile, fe as TimePicker, Ot as Timeline, C as ToastProvider, R as Toc, y as Toggle, $ as ToggleGroup, yt as Toggletip, x as Tooltip, St as TreeView, f as User, Wt as VirtualList, Sn as VisuallyHidden, Gt as WheelPicker, Cn as applyTheme, wn as batch, Tn as cn, En as composeRefs, Dn as computePosition, On as computed, se as createForm, kn as createMachine, An as createScope, jn as createStreamBuffer, w as dismissAllToasts, Mn as effect, ie as fuzzyMatch, ae as fuzzyScore, Nn as getLinkComponent, Pn as mergeProps, Fn as setLinkComponent, In as setTheme, Ln as signal, Rn as themePreloadScript, zn as themeSignal, Ct as treeViewMessages, Bn as useAnchorPosition, Vn as useClipboard, Hn as useComputed, Un as useControllableSignal, Wn as useDisclosure, Gn as useEffectPropSignal, ce as useForm, Kn as useId, qn as useMachine, Jn as useMediaQuery, V as usePopover, Yn as useRovingFocus, Xn as useScope, Zn as useScrollLock, Qn as useSignal, $n as useSignalEffect, er as useSignals, tr as useStreamBuffer, nr as useTheme, T as useToast, z as useTocFromRegion, rr as useTypeahead };
1
+ import{Spinner as ee}from"../../spinner/spinner.js";import{Button as te}from"../../button/button.js";import{Input as e}from"../../input/input.js";import{Card as t,CardContent as n,CardFooter as r,CardHeader as i,CardTitle as a}from"../../card/card.js";import{Badge as o}from"../../badge/badge.js";import{Modal as s}from"../../modal/modal.js";import{Separator as c}from"../../separator/separator.js";import{Logo as l}from"../../brand/logo/logo.js";import{Alert as u}from"../../alert/alert.js";import{Avatar as d}from"../../avatar/avatar.js";import{AvatarGroup as f}from"../../avatar-group/avatar-group.js";import{User as p}from"../../user/user.js";import{Image as m}from"../../image/image.js";import{Textarea as h}from"../../textarea/textarea.js";import{Select as g}from"../../select/select.js";import{Checkbox as _}from"../../checkbox/checkbox.js";import{Radio as v,RadioGroup as y}from"../../radio/radio.js";import{Toggle as b}from"../../toggle/toggle.js";import{Slider as x}from"../../slider/slider.js";import{Tooltip as S}from"../../tooltip/tooltip.js";import{Dropdown as C}from"../../dropdown/dropdown.js";import{ToastProvider as w,dismissAllToasts as T,useToast as E}from"../../toast/toast.js";import{Tabs as D,TabsContent as O,TabsList as k,TabsTrigger as A}from"../../tabs/tabs.js";import{Accordion as j,AccordionContent as M,AccordionItem as N,AccordionTrigger as P}from"../../accordion/accordion.js";import{ActionSheet as F}from"../../action-sheet/action-sheet.js";import{Kbd as I}from"../../kbd/kbd.js";import{Link as L}from"../../link/link.js";import{Breadcrumb as R}from"../../breadcrumb/breadcrumb.js";import{Toc as z}from"../../toc/toc.js";import{useTocFromRegion as B}from"../../toc/use-toc-from-region.js";import{Header as V}from"../../header/header.js";import{usePopover as H}from"../../popover/use-popover.js";import{SideNav as U}from"../../side-nav/side-nav.js";import{Pagination as W}from"../../pagination/pagination.js";import{ProgressIndicator as G}from"../../progress-indicator/progress-indicator.js";import{Tag as K}from"../../tag/tag.js";import{Skeleton as q}from"../../skeleton/skeleton.js";import{ProgressBar as J}from"../../progress-bar/progress-bar.js";import{EmptyState as Y}from"../../empty-state/empty-state.js";import{Fab as X}from"../../fab/fab.js";import{OverflowMenu as Z}from"../../overflow-menu/overflow-menu.js";import{Search as Q}from"../../search/search.js";import{NumberInput as ne}from"../../number-input/number-input.js";import{Editable as re}from"../../editable/editable.js";import{Popover as ie,PopoverContent as ae,PopoverTrigger as oe}from"../../popover/popover.js";import{DataTable as se}from"../../data-table/data-table.js";import{CommandMenu as ce,fuzzyMatch as le,fuzzyScore as ue}from"../../command-menu/command-menu.js";import{Form as de,createForm as fe,useForm as pe}from"../../form/form.js";import{Combobox as me}from"../../combobox/combobox.js";import{Calendar as he}from"../../calendar/calendar.js";import{DatePicker as ge}from"../../date-picker/date-picker.js";import{FileUploader as _e}from"../../file-uploader/file-uploader.js";import{TimePicker as ve}from"../../time-picker/time-picker.js";import{Menu as ye,MenuItem as be,MenuSeparator as xe,MenuTrigger as Se}from"../../menu/menu.js";import{AlertDialog as Ce}from"../../alert-dialog/alert-dialog.js";import{Sheet as we}from"../../sheet/sheet.js";import{BottomSheet as Te}from"../../bottom-sheet/bottom-sheet.js";import{ContextMenu as Ee,ContextMenuItem as De}from"../../context-menu/context-menu.js";import{Comparison as Oe}from"../../comparison/comparison.js";import{HoverCard as ke,HoverCardContent as Ae,HoverCardTrigger as je}from"../../hover-card/hover-card.js";import{PasswordInput as Me}from"../../password-input/password-input.js";import{MultiSelect as Ne}from"../../multi-select/multi-select.js";import{TagsInput as Pe}from"../../tags-input/tags-input.js";import{OtpInput as Fe}from"../../otp-input/otp-input.js";import{SegmentedControl as Ie}from"../../segmented-control/segmented-control.js";import{InputGroup as Le,InputGroupAddon as Re}from"../../input-group/input-group.js";import{RatingGroup as ze}from"../../rating-group/rating-group.js";import{RadioCard as Be,RadioCardGroup as Ve}from"../../radio-card/radio-card.js";import{ShellHeader as He}from"../../shell-header/shell-header.js";import{HeaderPanel as Ue}from"../../header-panel/header-panel.js";import{Switcher as We}from"../../switcher/switcher.js";import{CheckboxCard as Ge}from"../../checkbox-card/checkbox-card.js";import{CopyButton as Ke}from"../../copy-button/copy-button.js";import{Stat as qe}from"../../stat/stat.js";import{Status as Je}from"../../status/status.js";import"../../visually-hidden/visually-hidden.js";import{SkipNavLink as Ye,SkipNavTarget as Xe}from"../../skip-nav/skip-nav.js";import{Progress as Ze}from"../../progress/progress.js";import{ProgressCircle as Qe}from"../../progress-circle/progress-circle.js";import{Heading as $e}from"../../heading/heading.js";import{Text as et}from"../../text/text.js";import{Code as tt}from"../../code/code.js";import{Blockquote as nt}from"../../blockquote/blockquote.js";import{List as rt,ListItem as it}from"../../list/list.js";import{LogViewer as at}from"../../log-viewer/log-viewer.js";import{Prose as ot}from"../../prose/prose.js";import{PullToRefresh as st}from"../../pull-to-refresh/pull-to-refresh.js";import{QrCode as ct}from"../../qr-code/qr-code.js";import{RelativeTime as lt}from"../../relative-time/relative-time.js";import{Label as ut}from"../../label/label.js";import{Field as dt}from"../../field/field.js";import{Filter as ft}from"../../filter/filter.js";import{IconButton as $}from"../../icon-button/icon-button.js";import{ButtonGroup as pt}from"../../button-group/button-group.js";import{ToggleGroup as mt}from"../../toggle-group/toggle-group.js";import{InlineLoading as ht}from"../../inline-loading/inline-loading.js";import{Notification as gt}from"../../notification/notification.js";import{ScrollArea as _t}from"../../scroll-area/scroll-area.js";import{Collapsible as vt}from"../../collapsible/collapsible.js";import{AspectRatio as yt}from"../../aspect-ratio/aspect-ratio.js";import{MenuButton as bt}from"../../menu-button/menu-button.js";import{Toggletip as xt}from"../../toggletip/toggletip.js";import{Menubar as St}from"../../menubar/menubar.js";import{NavigationMenu as Ct}from"../../navigation-menu/navigation-menu.js";import{TreeView as wt,treeViewMessages as Tt}from"../../tree-view/tree-view.js";import{StructuredList as Et}from"../../structured-list/structured-list.js";import{ContainedList as Dt,ContainedListItem as Ot}from"../../contained-list/contained-list.js";import{DataList as kt,DataListItem as At}from"../../data-list/data-list.js";import{Timeline as jt}from"../../timeline/timeline.js";import{Item as Mt,ItemActions as Nt,ItemContent as Pt,ItemDescription as Ft,ItemMedia as It,ItemTitle as Lt}from"../../item/item.js";import{DateRangePicker as Rt}from"../../date-range-picker/date-range-picker.js";import{ColorPicker as zt}from"../../color-picker/color-picker.js";import{Carousel as Bt}from"../../carousel/carousel.js";import{Resizable as Vt}from"../../resizable/resizable.js";import{Dock as Ht}from"../../dock/dock.js";import{LargeTitleHeader as Ut}from"../../large-title-header/large-title-header.js";import{InfiniteScroll as Wt}from"../../infinite-scroll/infinite-scroll.js";import{ReorderList as Gt}from"../../reorder-list/reorder-list.js";import{VirtualList as Kt}from"../../virtual-list/virtual-list.js";import{WheelPicker as qt}from"../../wheel-picker/wheel-picker.js";import{Drawer as Jt}from"../../drawer/drawer.js";import{NativeSelect as Yt}from"../../native-select/native-select.js";import{CodeSnippet as Xt}from"../../code-snippet/code-snippet.js";import{Steps as Zt}from"../../steps/steps.js";import{Tile as Qt}from"../../tile/tile.js";import{Indicator as $t}from"../../indicator/indicator.js";import{Join as en}from"../../join/join.js";import{Stack as tn}from"../../stack/stack.js";import{AppShell as nn}from"../../app-shell/app-shell.js";import{ChatBubble as rn}from"../../chat-bubble/chat-bubble.js";import{RadialProgress as an}from"../../radial-progress/radial-progress.js";import{Swap as on}from"../../swap/swap.js";import{SwipeItem as sn}from"../../swipe-item/swipe-item.js";import{Grid as cn,GridItem as ln}from"../../layouts/src/grid/grid.js";import{Flex as un,FlexItem as dn}from"../../layouts/src/flex/flex.js";import{Columns as fn}from"../../layouts/src/columns/columns.js";import{Center as pn}from"../../layouts/src/center/center.js";import{Spacer as mn}from"../../layouts/src/spacer/spacer.js";import{AutoGrid as hn}from"../../layouts/src/auto-grid/auto-grid.js";import{PageHeader as gn}from"../../layouts/src/page-header/page-header.js";import{DismissableLayer as _n,ErrorBoundary as vn,FocusScope as yn,Portal as bn,Presence as xn,Slot as Sn,SuspenseBoundary as Cn,ThemeProvider as wn,VisuallyHidden as Tn,applyTheme as En,batch as Dn,cn as On,composeRefs as kn,computePosition as An,computed as jn,createMachine as Mn,createScope as Nn,createStreamBuffer as Pn,effect as Fn,getLinkComponent as In,mergeProps as Ln,setLinkComponent as Rn,setTheme as zn,signal as Bn,themePreloadScript as Vn,themeSignal as Hn,useAnchorPosition as Un,useClipboard as Wn,useComputed as Gn,useControllableSignal as Kn,useDisclosure as qn,useEffectPropSignal as Jn,useId as Yn,useMachine as Xn,useMediaQuery as Zn,useRovingFocus as Qn,useScope as $n,useScrollLock as er,useSignal as tr,useSignalEffect as nr,useSignals as rr,useStreamBuffer as ir,useTheme as ar,useTypeahead as or}from"@cascivo/core";export{j as Accordion,M as AccordionContent,N as AccordionItem,P as AccordionTrigger,F as ActionSheet,u as Alert,Ce as AlertDialog,nn as AppShell,yt as AspectRatio,hn as AutoGrid,d as Avatar,f as AvatarGroup,o as Badge,nt as Blockquote,Te as BottomSheet,R as Breadcrumb,te as Button,pt as ButtonGroup,he as Calendar,t as Card,n as CardContent,r as CardFooter,i as CardHeader,a as CardTitle,Bt as Carousel,pn as Center,rn as ChatBubble,_ as Checkbox,Ge as CheckboxCard,tt as Code,Xt as CodeSnippet,vt as Collapsible,zt as ColorPicker,fn as Columns,me as Combobox,ce as CommandMenu,Oe as Comparison,Dt as ContainedList,Ot as ContainedListItem,Ee as ContextMenu,De as ContextMenuItem,Ke as CopyButton,kt as DataList,At as DataListItem,se as DataTable,ge as DatePicker,Rt as DateRangePicker,_n as DismissableLayer,Ht as Dock,Jt as Drawer,C as Dropdown,re as Editable,Y as EmptyState,vn as ErrorBoundary,X as Fab,dt as Field,_e as FileUploader,ft as Filter,un as Flex,dn as FlexItem,yn as FocusScope,de as Form,cn as Grid,ln as GridItem,V as Header,Ue as HeaderPanel,$e as Heading,ke as HoverCard,Ae as HoverCardContent,je as HoverCardTrigger,$ as IconButton,m as Image,$t as Indicator,Wt as InfiniteScroll,ht as InlineLoading,e as Input,Le as InputGroup,Re as InputGroupAddon,Mt as Item,Nt as ItemActions,Pt as ItemContent,Ft as ItemDescription,It as ItemMedia,Lt as ItemTitle,en as Join,I as Kbd,ut as Label,Ut as LargeTitleHeader,L as Link,rt as List,it as ListItem,at as LogViewer,l as Logo,ye as Menu,bt as MenuButton,be as MenuItem,xe as MenuSeparator,Se as MenuTrigger,St as Menubar,s as Modal,Ne as MultiSelect,Yt as NativeSelect,Ct as NavigationMenu,gt as Notification,ne as NumberInput,Fe as OtpInput,Z as OverflowMenu,gn as PageHeader,W as Pagination,Me as PasswordInput,ie as Popover,ae as PopoverContent,oe as PopoverTrigger,bn as Portal,xn as Presence,Ze as Progress,J as ProgressBar,Qe as ProgressCircle,G as ProgressIndicator,ot as Prose,st as PullToRefresh,ct as QrCode,an as RadialProgress,v as Radio,Be as RadioCard,Ve as RadioCardGroup,y as RadioGroup,ze as RatingGroup,lt as RelativeTime,Gt as ReorderList,Vt as Resizable,_t as ScrollArea,Q as Search,Ie as SegmentedControl,g as Select,c as Separator,we as Sheet,He as ShellHeader,U as SideNav,q as Skeleton,Ye as SkipNavLink,Xe as SkipNavTarget,x as Slider,Sn as Slot,mn as Spacer,ee as Spinner,tn as Stack,qe as Stat,Je as Status,Zt as Steps,Et as StructuredList,Cn as SuspenseBoundary,on as Swap,sn as SwipeItem,b as Switch,We as Switcher,D as Tabs,O as TabsContent,k as TabsList,A as TabsTrigger,K as Tag,Pe as TagsInput,et as Text,h as Textarea,wn as ThemeProvider,Qt as Tile,ve as TimePicker,jt as Timeline,w as ToastProvider,z as Toc,b as Toggle,mt as ToggleGroup,xt as Toggletip,S as Tooltip,wt as TreeView,p as User,Kt as VirtualList,Tn as VisuallyHidden,qt as WheelPicker,En as applyTheme,Dn as batch,On as cn,kn as composeRefs,An as computePosition,jn as computed,fe as createForm,Mn as createMachine,Nn as createScope,Pn as createStreamBuffer,T as dismissAllToasts,Fn as effect,le as fuzzyMatch,ue as fuzzyScore,In as getLinkComponent,Ln as mergeProps,Rn as setLinkComponent,zn as setTheme,Bn as signal,Vn as themePreloadScript,Hn as themeSignal,Tt as treeViewMessages,Un as useAnchorPosition,Wn as useClipboard,Gn as useComputed,Kn as useControllableSignal,qn as useDisclosure,Jn as useEffectPropSignal,pe as useForm,Yn as useId,Xn as useMachine,Zn as useMediaQuery,H as usePopover,Qn as useRovingFocus,$n as useScope,er as useScrollLock,tr as useSignal,nr as useSignalEffect,rr as useSignals,ir as useStreamBuffer,ar as useTheme,E as useToast,B as useTocFromRegion,or as useTypeahead};
@@ -1,66 +1 @@
1
- "use client";
2
-
3
- import e from "./relative-time.module.js";
4
- import { cn as t, useSignal as n, useSignalEffect as r, useSignals as i } from "@cascivo/core";
5
- import { formatDate as a, formatRelativeTime as o } from "@cascivo/i18n";
6
- import { jsx as s } from "react/jsx-runtime";
7
- //#region ../components/src/relative-time/relative-time.tsx
8
- var c = 1e3, l = 60 * c, u = 60 * l, d = 24 * u, f = 7 * d, p = 30 * d, m = 365 * d;
9
- function h(e) {
10
- let t = Math.abs(e);
11
- return t < l ? {
12
- value: Math.round(e / c),
13
- unit: "second",
14
- nextUpdateMs: c
15
- } : t < u ? {
16
- value: Math.round(e / l),
17
- unit: "minute",
18
- nextUpdateMs: l
19
- } : t < d ? {
20
- value: Math.round(e / u),
21
- unit: "hour",
22
- nextUpdateMs: u
23
- } : t < f ? {
24
- value: Math.round(e / d),
25
- unit: "day",
26
- nextUpdateMs: d
27
- } : t < p ? {
28
- value: Math.round(e / f),
29
- unit: "week",
30
- nextUpdateMs: d
31
- } : t < m ? {
32
- value: Math.round(e / p),
33
- unit: "month",
34
- nextUpdateMs: d
35
- } : {
36
- value: Math.round(e / m),
37
- unit: "year",
38
- nextUpdateMs: d
39
- };
40
- }
41
- var g = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : Date.parse(e);
42
- function _({ date: c, sync: l = !0, now: u, format: d, className: f, ...p }) {
43
- i();
44
- let m = g(c), _ = u !== void 0, v = n(u ?? Date.now());
45
- _ && (v.value = u), r(() => {
46
- if (_ || typeof window > "u" || (v.value = Date.now(), !l)) return;
47
- let { nextUpdateMs: e } = h(m - v.value), t = window.setInterval(() => {
48
- v.value = Date.now();
49
- }, e);
50
- return () => window.clearInterval(t);
51
- });
52
- let { value: y, unit: b } = h(m - v.value), x = o(y, b, d);
53
- return /* @__PURE__ */ s("time", {
54
- dateTime: new Date(m).toISOString(),
55
- title: a(m, {
56
- dateStyle: "long",
57
- timeStyle: "short"
58
- }),
59
- className: t(e.relativeTime, f),
60
- suppressHydrationWarning: !0,
61
- ...p,
62
- children: x
63
- });
64
- }
65
- //#endregion
66
- export { _ as RelativeTime };
1
+ "use client";import e from"./relative-time.module.js";import{cn as t,useSignal as n,useSignalEffect as r,useSignals as i}from"@cascivo/core";import{formatDate as a,formatRelativeTime as o}from"@cascivo/i18n";import{jsx as s}from"react/jsx-runtime";var c=1e3,l=60*c,u=60*l,d=24*u,f=7*d,p=30*d,m=365*d;function selectUnit(e){let t=Math.abs(e);return t<l?{value:Math.round(e/c),unit:`second`,nextUpdateMs:c}:t<u?{value:Math.round(e/l),unit:`minute`,nextUpdateMs:l}:t<d?{value:Math.round(e/u),unit:`hour`,nextUpdateMs:u}:t<f?{value:Math.round(e/d),unit:`day`,nextUpdateMs:d}:t<p?{value:Math.round(e/f),unit:`week`,nextUpdateMs:d}:t<m?{value:Math.round(e/p),unit:`month`,nextUpdateMs:d}:{value:Math.round(e/m),unit:`year`,nextUpdateMs:d}}var toTimestamp=e=>e instanceof Date?e.getTime():typeof e==`number`?e:Date.parse(e);function RelativeTime({date:c,sync:l=!0,now:u,format:d,className:f,...p}){i();let m=toTimestamp(c),h=u!==void 0,g=n(u??Date.now());h&&(g.value=u),r(()=>{if(h||typeof window>`u`||(g.value=Date.now(),!l))return;let{nextUpdateMs:e}=selectUnit(m-g.value),t=window.setInterval(()=>{g.value=Date.now()},e);return()=>window.clearInterval(t)});let{value:_,unit:v}=selectUnit(m-g.value),y=o(_,v,d);return s(`time`,{dateTime:new Date(m).toISOString(),title:a(m,{dateStyle:`long`,timeStyle:`short`}),className:t(e.relativeTime,f),suppressHydrationWarning:!0,...p,children:y})}export{RelativeTime};
@@ -1,4 +1,2 @@
1
1
  import './relative-time.css';
2
- var e = { relativeTime: "_relativeTime_ohxan_2" };
3
- //#endregion
4
- export { e as default };
2
+ var e={relativeTime:`_relativeTime_ohxan_2`};export{e as default};
@@ -1 +1 @@
1
- @layer cascivo.component{._root_1tie9_4{position:relative}._list_1tie9_8{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}._row_1tie9_16{align-items:center;gap:var(--cascivo-space-2);padding-inline:var(--cascivo-space-2);padding-block:var(--cascivo-space-2);border-block-end:1px solid var(--cascivo-border-subtle);background:var(--cascivo-color-surface);display:flex}._row_1tie9_16:last-child{border-block-end:none}._row_1tie9_16[data-active]{background:var(--cascivo-color-surface-2)}._handle_1tie9_34{padding:var(--cascivo-space-1);border-radius:var(--cascivo-radius-sm);color:var(--cascivo-color-text-muted);touch-action:none;cursor:grab;background:0 0;border:none;flex:none;justify-content:center;align-items:center;display:inline-flex}._handle_1tie9_34:focus-visible{outline:var(--cascivo-ring-width) solid var(--cascivo-ring-color);outline-offset:2px}._handle_1tie9_34[aria-pressed=true]{color:var(--cascivo-color-accent);cursor:grabbing}._handle_1tie9_34:disabled{opacity:var(--cascivo-disabled-opacity);cursor:not-allowed}@media (pointer:coarse){._handle_1tie9_34{min-inline-size:var(--cascivo-target-min-coarse,2.75rem);min-block-size:var(--cascivo-target-min-coarse,2.75rem)}}._grip_1tie9_69{block-size:1rem;inline-size:1rem}._label_1tie9_74{min-inline-size:0;color:var(--cascivo-color-foreground)}._srOnly_1tie9_79{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}}
1
+ @layer cascivo.component{._root_1vypz_4{position:relative}._list_1vypz_8{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}._row_1vypz_16{align-items:center;gap:var(--cascivo-space-2);padding-inline:var(--cascivo-space-2);padding-block:var(--cascivo-space-2);border-block-end:1px solid var(--cascivo-border-subtle);background:var(--cascivo-color-surface);display:flex}._row_1vypz_16:last-child{border-block-end:none}._row_1vypz_16[data-active]{background:var(--cascivo-color-surface-2)}._handle_1vypz_34{padding:var(--cascivo-space-1);border-radius:var(--cascivo-radius-sm);color:var(--cascivo-color-text-muted);touch-action:none;cursor:grab;background:0 0;border:none;flex:none;justify-content:center;align-items:center;display:inline-flex}._handle_1vypz_34:focus-visible{outline:var(--cascivo-ring-width) solid var(--cascivo-ring-color);outline-offset:2px}._handle_1vypz_34[aria-pressed=true]{color:var(--cascivo-color-accent-text);cursor:grabbing}._handle_1vypz_34:disabled{opacity:var(--cascivo-disabled-opacity);cursor:not-allowed}@media (pointer:coarse){._handle_1vypz_34{min-inline-size:var(--cascivo-target-min-coarse,2.75rem);min-block-size:var(--cascivo-target-min-coarse,2.75rem)}}._grip_1vypz_69{block-size:1rem;inline-size:1rem}._label_1vypz_74{min-inline-size:0;color:var(--cascivo-color-foreground)}._srOnly_1vypz_79{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}}
@@ -1,143 +1 @@
1
- "use client";
2
-
3
- import e from "./reorder-list.module.js";
4
- import { useRef as t } from "react";
5
- import { cn as n, useSignal as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
6
- import { builtin as o, t as s } from "@cascivo/i18n";
7
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
- //#region ../components/src/reorder-list/reorder-list.tsx
9
- function u(e) {
10
- return e.name ?? (typeof e.label == "string" ? e.label : e.id);
11
- }
12
- function d(e, t, n) {
13
- let r = e.slice(), [i] = r.splice(t, 1);
14
- return i && r.splice(n, 0, i), r;
15
- }
16
- function f({ value: f, onValueChange: p, disabled: m = !1, labels: h, className: g }) {
17
- a();
18
- let _ = t(null), v = r(null), y = r(""), b = t(f);
19
- b.current = f;
20
- let x = t(p);
21
- x.current = p;
22
- let S = t(m);
23
- S.current = m;
24
- let C = t(null), w = (e, t, n) => {
25
- y.value = e ? e.replace("{name}", n.name).replace("{position}", String(n.position)).replace("{total}", String(n.total)) : t;
26
- }, T = (e, t) => {
27
- let n = b.current, r = Math.max(0, Math.min(n.length - 1, t));
28
- if (r === e) return;
29
- let i = n[e];
30
- if (!i) return;
31
- x.current(d(n, e, r)), v.value = r;
32
- let a = {
33
- name: u(i),
34
- position: r + 1,
35
- total: n.length
36
- };
37
- w(h?.moved, s(o.reorderList.moved, a), a);
38
- }, E = (e) => {
39
- let t = b.current, n = t[e];
40
- if (!n) return;
41
- C.current = t, v.value = e;
42
- let r = {
43
- name: u(n),
44
- position: e + 1,
45
- total: t.length
46
- };
47
- w(h?.grabbed, s(o.reorderList.grabbed, r), r);
48
- }, D = () => {
49
- let e = v.value;
50
- if (e === null) return;
51
- let t = b.current, n = t[e];
52
- if (C.current = null, v.value = null, !n) return;
53
- let r = {
54
- name: u(n),
55
- position: e + 1,
56
- total: t.length
57
- };
58
- w(h?.dropped, s(o.reorderList.dropped, r), r);
59
- }, O = () => {
60
- let e = C.current, t = v.value;
61
- if (C.current = null, v.value = null, !e) return;
62
- x.current(e);
63
- let n = t === null ? void 0 : e[t], r = {
64
- name: n ? u(n) : "",
65
- position: (t ?? 0) + 1,
66
- total: e.length
67
- };
68
- w(h?.cancelled, s(o.reorderList.cancelled, r), r);
69
- }, k = (e, t) => {
70
- if (m) return;
71
- let n = v.value;
72
- if (e.key === " " || e.key === "Enter") {
73
- e.preventDefault(), n === t ? D() : E(t);
74
- return;
75
- }
76
- if (e.key === "Escape" && n !== null) {
77
- e.preventDefault(), O();
78
- return;
79
- }
80
- n === t && (e.key === "ArrowUp" ? (e.preventDefault(), T(t, t - 1)) : e.key === "ArrowDown" && (e.preventDefault(), T(t, t + 1)));
81
- };
82
- return i(() => {
83
- let e = _.current;
84
- if (!e || typeof window > "u") return;
85
- let t = (t) => {
86
- let n = v.value;
87
- if (n === null || S.current) return;
88
- let r = [...e.querySelectorAll("[data-reorder-row]")].findIndex((e) => {
89
- let n = e.getBoundingClientRect();
90
- return t.clientY >= n.top && t.clientY <= n.bottom;
91
- });
92
- r !== -1 && r !== n && T(n, r);
93
- }, n = () => {
94
- v.value !== null && C.current && D();
95
- };
96
- return window.addEventListener("pointermove", t), window.addEventListener("pointerup", n), window.addEventListener("pointercancel", n), () => {
97
- window.removeEventListener("pointermove", t), window.removeEventListener("pointerup", n), window.removeEventListener("pointercancel", n);
98
- };
99
- }), /* @__PURE__ */ l("div", {
100
- className: n(e.root, g),
101
- children: [/* @__PURE__ */ c("ul", {
102
- ref: _,
103
- className: e.list,
104
- children: f.map((t, n) => /* @__PURE__ */ l("li", {
105
- "data-reorder-row": "",
106
- "data-active": v.value === n ? "" : void 0,
107
- className: e.row,
108
- children: [/* @__PURE__ */ c("button", {
109
- type: "button",
110
- disabled: m,
111
- "aria-label": h?.handle ? h.handle.replace("{name}", u(t)) : s(o.reorderList.handle, { name: u(t) }),
112
- "aria-pressed": v.value === n,
113
- className: e.handle,
114
- onKeyDown: (e) => k(e, n),
115
- onPointerDown: () => {
116
- m || E(n);
117
- },
118
- children: /* @__PURE__ */ c("svg", {
119
- "aria-hidden": "true",
120
- viewBox: "0 0 16 16",
121
- className: e.grip,
122
- children: /* @__PURE__ */ c("path", {
123
- d: "M6 4h.01M10 4h.01M6 8h.01M10 8h.01M6 12h.01M10 12h.01",
124
- stroke: "currentColor",
125
- strokeWidth: "2",
126
- strokeLinecap: "round"
127
- })
128
- })
129
- }), /* @__PURE__ */ c("span", {
130
- className: e.label,
131
- children: t.label
132
- })]
133
- }, t.id))
134
- }), /* @__PURE__ */ c("span", {
135
- role: "status",
136
- "aria-live": "polite",
137
- className: e.srOnly,
138
- children: y.value
139
- })]
140
- });
141
- }
142
- //#endregion
143
- export { f as ReorderList };
1
+ "use client";import e from"./reorder-list.module.js";import{useRef as t}from"react";import{cn as n,useSignal as r,useSignalEffect as i,useSignals as a}from"@cascivo/core";import{builtin as o,t as s}from"@cascivo/i18n";import{jsx as c,jsxs as l}from"react/jsx-runtime";function nameOf(e){return e.name??(typeof e.label==`string`?e.label:e.id)}function move(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return i&&r.splice(n,0,i),r}function ReorderList({value:u,onValueChange:d,disabled:f=!1,labels:p,className:m}){a();let h=t(null),g=r(null),_=r(``),v=t(u);v.current=u;let y=t(d);y.current=d;let b=t(f);b.current=f;let x=t(null),announce=(e,t,n)=>{_.value=e?e.replace(`{name}`,n.name).replace(`{position}`,String(n.position)).replace(`{total}`,String(n.total)):t},reorder=(e,t)=>{let n=v.current,r=Math.max(0,Math.min(n.length-1,t));if(r===e)return;let i=n[e];if(!i)return;y.current(move(n,e,r)),g.value=r;let a={name:nameOf(i),position:r+1,total:n.length};announce(p?.moved,s(o.reorderList.moved,a),a)},grab=e=>{let t=v.current,n=t[e];if(!n)return;x.current=t,g.value=e;let r={name:nameOf(n),position:e+1,total:t.length};announce(p?.grabbed,s(o.reorderList.grabbed,r),r)},drop=()=>{let e=g.value;if(e===null)return;let t=v.current,n=t[e];if(x.current=null,g.value=null,!n)return;let r={name:nameOf(n),position:e+1,total:t.length};announce(p?.dropped,s(o.reorderList.dropped,r),r)},cancel=()=>{let e=x.current,t=g.value;if(x.current=null,g.value=null,!e)return;y.current(e);let n=t===null?void 0:e[t],r={name:n?nameOf(n):``,position:(t??0)+1,total:e.length};announce(p?.cancelled,s(o.reorderList.cancelled,r),r)},onHandleKeyDown=(e,t)=>{if(f)return;let n=g.value;if(e.key===` `||e.key===`Enter`){e.preventDefault(),n===t?drop():grab(t);return}if(e.key===`Escape`&&n!==null){e.preventDefault(),cancel();return}n===t&&(e.key===`ArrowUp`?(e.preventDefault(),reorder(t,t-1)):e.key===`ArrowDown`&&(e.preventDefault(),reorder(t,t+1)))};return i(()=>{let e=h.current;if(!e||typeof window>`u`)return;let onMove=t=>{let n=g.value;if(n===null||b.current)return;let r=[...e.querySelectorAll(`[data-reorder-row]`)].findIndex(e=>{let n=e.getBoundingClientRect();return t.clientY>=n.top&&t.clientY<=n.bottom});r!==-1&&r!==n&&reorder(n,r)},onUp=()=>{g.value!==null&&x.current&&drop()};return window.addEventListener(`pointermove`,onMove),window.addEventListener(`pointerup`,onUp),window.addEventListener(`pointercancel`,onUp),()=>{window.removeEventListener(`pointermove`,onMove),window.removeEventListener(`pointerup`,onUp),window.removeEventListener(`pointercancel`,onUp)}}),l(`div`,{className:n(e.root,m),children:[c(`ul`,{ref:h,className:e.list,children:u.map((t,n)=>l(`li`,{"data-reorder-row":``,"data-active":g.value===n?``:void 0,className:e.row,children:[c(`button`,{type:`button`,disabled:f,"aria-label":p?.handle?p.handle.replace(`{name}`,nameOf(t)):s(o.reorderList.handle,{name:nameOf(t)}),"aria-pressed":g.value===n,className:e.handle,onKeyDown:e=>onHandleKeyDown(e,n),onPointerDown:()=>{f||grab(n)},children:c(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,className:e.grip,children:c(`path`,{d:`M6 4h.01M10 4h.01M6 8h.01M10 8h.01M6 12h.01M10 12h.01`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})})}),c(`span`,{className:e.label,children:t.label})]},t.id))}),c(`span`,{role:`status`,"aria-live":`polite`,className:e.srOnly,children:_.value})]})}export{ReorderList};