@entifix/react-controls 0.18.2 → 0.20.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 (328) hide show
  1. package/README.md +13 -5
  2. package/dist/i18n/catalog/en.d.ts.map +1 -1
  3. package/dist/i18n/catalog/en.js +68 -10
  4. package/dist/i18n/catalog/en.js.map +1 -1
  5. package/dist/i18n/catalog/es.d.ts +76 -5
  6. package/dist/i18n/catalog/es.d.ts.map +1 -1
  7. package/dist/i18n/catalog/es.js +74 -10
  8. package/dist/i18n/catalog/es.js.map +1 -1
  9. package/dist/i18n/catalog/index.d.ts +126 -10
  10. package/dist/i18n/catalog/index.d.ts.map +1 -1
  11. package/dist/i18n/entity-labels.d.ts +14 -0
  12. package/dist/i18n/entity-labels.d.ts.map +1 -1
  13. package/dist/i18n/entity-labels.js +15 -0
  14. package/dist/i18n/entity-labels.js.map +1 -1
  15. package/dist/i18n/i18n-context.js +2 -2
  16. package/dist/i18n/i18n-context.js.map +1 -1
  17. package/dist/index.d.ts +13 -2
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +13 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/primitives.d.ts +7 -1
  22. package/dist/primitives.d.ts.map +1 -1
  23. package/dist/primitives.js +7 -1
  24. package/dist/primitives.js.map +1 -1
  25. package/dist/theme/index.d.ts +1 -0
  26. package/dist/theme/index.d.ts.map +1 -1
  27. package/dist/theme/index.js +1 -0
  28. package/dist/theme/index.js.map +1 -1
  29. package/dist/theme/theme-context.d.ts +35 -7
  30. package/dist/theme/theme-context.d.ts.map +1 -1
  31. package/dist/theme/theme-context.js +109 -21
  32. package/dist/theme/theme-context.js.map +1 -1
  33. package/dist/theme/theme-cookie.d.ts +9 -0
  34. package/dist/theme/theme-cookie.d.ts.map +1 -0
  35. package/dist/theme/theme-cookie.js +8 -0
  36. package/dist/theme/theme-cookie.js.map +1 -0
  37. package/dist/theme/theme-script.d.ts +8 -5
  38. package/dist/theme/theme-script.d.ts.map +1 -1
  39. package/dist/theme/theme-script.js +24 -10
  40. package/dist/theme/theme-script.js.map +1 -1
  41. package/dist/theme/types.d.ts +19 -3
  42. package/dist/theme/types.d.ts.map +1 -1
  43. package/dist/theme/types.js.map +1 -1
  44. package/dist/ui/actions/action-surfaces.d.ts +1 -1
  45. package/dist/ui/actions/action-surfaces.js +1 -1
  46. package/dist/ui/actions/action-surfaces.js.map +1 -1
  47. package/dist/ui/actions/error-actions.d.ts +32 -0
  48. package/dist/ui/actions/error-actions.d.ts.map +1 -0
  49. package/dist/ui/actions/error-actions.js +40 -0
  50. package/dist/ui/actions/error-actions.js.map +1 -0
  51. package/dist/ui/actions/index.d.ts +2 -0
  52. package/dist/ui/actions/index.d.ts.map +1 -1
  53. package/dist/ui/actions/index.js +2 -0
  54. package/dist/ui/actions/index.js.map +1 -1
  55. package/dist/ui/actions/shortcut.d.ts +13 -0
  56. package/dist/ui/actions/shortcut.d.ts.map +1 -0
  57. package/dist/ui/actions/shortcut.js +18 -0
  58. package/dist/ui/actions/shortcut.js.map +1 -0
  59. package/dist/ui/actions/use-verb-invoker.d.ts +50 -0
  60. package/dist/ui/actions/use-verb-invoker.d.ts.map +1 -0
  61. package/dist/ui/actions/use-verb-invoker.js +93 -0
  62. package/dist/ui/actions/use-verb-invoker.js.map +1 -0
  63. package/dist/ui/atoms/alert/alert-dismiss.d.ts +9 -0
  64. package/dist/ui/atoms/alert/alert-dismiss.d.ts.map +1 -0
  65. package/dist/ui/atoms/alert/alert-dismiss.js +28 -0
  66. package/dist/ui/atoms/alert/alert-dismiss.js.map +1 -0
  67. package/dist/ui/atoms/alert/alert.d.ts +24 -0
  68. package/dist/ui/atoms/alert/alert.d.ts.map +1 -0
  69. package/dist/ui/atoms/alert/alert.js +50 -0
  70. package/dist/ui/atoms/alert/alert.js.map +1 -0
  71. package/dist/ui/atoms/alert/index.d.ts +3 -0
  72. package/dist/ui/atoms/alert/index.d.ts.map +1 -0
  73. package/dist/ui/atoms/alert/index.js +4 -0
  74. package/dist/ui/atoms/alert/index.js.map +1 -0
  75. package/dist/ui/atoms/alert/tone.d.ts +8 -0
  76. package/dist/ui/atoms/alert/tone.d.ts.map +1 -0
  77. package/dist/ui/atoms/alert/tone.js +11 -0
  78. package/dist/ui/atoms/alert/tone.js.map +1 -0
  79. package/dist/ui/atoms/button/button-recipe.js +1 -1
  80. package/dist/ui/atoms/button/button-recipe.js.map +1 -1
  81. package/dist/ui/atoms/button/index.d.ts +1 -0
  82. package/dist/ui/atoms/button/index.d.ts.map +1 -1
  83. package/dist/ui/atoms/button/index.js +1 -0
  84. package/dist/ui/atoms/button/index.js.map +1 -1
  85. package/dist/ui/atoms/button/submit-button.d.ts +13 -0
  86. package/dist/ui/atoms/button/submit-button.d.ts.map +1 -0
  87. package/dist/ui/atoms/button/submit-button.js +29 -0
  88. package/dist/ui/atoms/button/submit-button.js.map +1 -0
  89. package/dist/ui/atoms/cell-value/cell-value.d.ts +6 -1
  90. package/dist/ui/atoms/cell-value/cell-value.d.ts.map +1 -1
  91. package/dist/ui/atoms/cell-value/cell-value.js +48 -16
  92. package/dist/ui/atoms/cell-value/cell-value.js.map +1 -1
  93. package/dist/ui/atoms/field/checkbox.d.ts.map +1 -1
  94. package/dist/ui/atoms/field/checkbox.js +21 -1
  95. package/dist/ui/atoms/field/checkbox.js.map +1 -1
  96. package/dist/ui/atoms/field/field.js +1 -1
  97. package/dist/ui/atoms/field/field.js.map +1 -1
  98. package/dist/ui/atoms/field-control/field-control.d.ts +7 -1
  99. package/dist/ui/atoms/field-control/field-control.d.ts.map +1 -1
  100. package/dist/ui/atoms/field-control/field-control.js +25 -3
  101. package/dist/ui/atoms/field-control/field-control.js.map +1 -1
  102. package/dist/ui/atoms/money/index.d.ts +4 -0
  103. package/dist/ui/atoms/money/index.d.ts.map +1 -0
  104. package/dist/ui/atoms/money/index.js +5 -0
  105. package/dist/ui/atoms/money/index.js.map +1 -0
  106. package/dist/ui/atoms/money/money-input.d.ts +19 -0
  107. package/dist/ui/atoms/money/money-input.d.ts.map +1 -0
  108. package/dist/ui/atoms/money/money-input.js +75 -0
  109. package/dist/ui/atoms/money/money-input.js.map +1 -0
  110. package/dist/ui/atoms/money/money-math.d.ts +21 -0
  111. package/dist/ui/atoms/money/money-math.d.ts.map +1 -0
  112. package/dist/ui/atoms/money/money-math.js +36 -0
  113. package/dist/ui/atoms/money/money-math.js.map +1 -0
  114. package/dist/ui/atoms/money/money.d.ts +19 -0
  115. package/dist/ui/atoms/money/money.d.ts.map +1 -0
  116. package/dist/ui/atoms/money/money.js +26 -0
  117. package/dist/ui/atoms/money/money.js.map +1 -0
  118. package/dist/ui/atoms/number-input/index.d.ts +3 -0
  119. package/dist/ui/atoms/number-input/index.d.ts.map +1 -0
  120. package/dist/ui/atoms/number-input/index.js +4 -0
  121. package/dist/ui/atoms/number-input/index.js.map +1 -0
  122. package/dist/ui/atoms/number-input/number-input.d.ts +10 -0
  123. package/dist/ui/atoms/number-input/number-input.d.ts.map +1 -0
  124. package/dist/ui/atoms/number-input/number-input.js +23 -0
  125. package/dist/ui/atoms/number-input/number-input.js.map +1 -0
  126. package/dist/ui/atoms/number-input/quantity-input.d.ts +29 -0
  127. package/dist/ui/atoms/number-input/quantity-input.d.ts.map +1 -0
  128. package/dist/ui/atoms/number-input/quantity-input.js +100 -0
  129. package/dist/ui/atoms/number-input/quantity-input.js.map +1 -0
  130. package/dist/ui/atoms/skeleton/skeleton.js +1 -1
  131. package/dist/ui/atoms/skeleton/skeleton.js.map +1 -1
  132. package/dist/ui/atoms/status-tag/index.d.ts +2 -0
  133. package/dist/ui/atoms/status-tag/index.d.ts.map +1 -0
  134. package/dist/ui/atoms/status-tag/index.js +3 -0
  135. package/dist/ui/atoms/status-tag/index.js.map +1 -0
  136. package/dist/ui/atoms/status-tag/status-tag.d.ts +17 -0
  137. package/dist/ui/atoms/status-tag/status-tag.d.ts.map +1 -0
  138. package/dist/ui/atoms/status-tag/status-tag.js +37 -0
  139. package/dist/ui/atoms/status-tag/status-tag.js.map +1 -0
  140. package/dist/ui/atoms/switch/switch.d.ts.map +1 -1
  141. package/dist/ui/atoms/switch/switch.js +6 -3
  142. package/dist/ui/atoms/switch/switch.js.map +1 -1
  143. package/dist/ui/atoms/table/table.d.ts +12 -3
  144. package/dist/ui/atoms/table/table.d.ts.map +1 -1
  145. package/dist/ui/atoms/table/table.js +59 -10
  146. package/dist/ui/atoms/table/table.js.map +1 -1
  147. package/dist/ui/atoms/text/text.d.ts +2 -2
  148. package/dist/ui/atoms/text/text.d.ts.map +1 -1
  149. package/dist/ui/atoms/text/text.js.map +1 -1
  150. package/dist/ui/molecules/action-bar/action-bar.d.ts +76 -0
  151. package/dist/ui/molecules/action-bar/action-bar.d.ts.map +1 -0
  152. package/dist/ui/molecules/action-bar/action-bar.js +218 -0
  153. package/dist/ui/molecules/action-bar/action-bar.js.map +1 -0
  154. package/dist/ui/molecules/action-bar/index.d.ts +2 -0
  155. package/dist/ui/molecules/action-bar/index.d.ts.map +1 -0
  156. package/dist/ui/molecules/action-bar/index.js +3 -0
  157. package/dist/ui/molecules/action-bar/index.js.map +1 -0
  158. package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts +11 -2
  159. package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts.map +1 -1
  160. package/dist/ui/molecules/breadcrumbs/breadcrumbs.js +9 -7
  161. package/dist/ui/molecules/breadcrumbs/breadcrumbs.js.map +1 -1
  162. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.d.ts.map +1 -1
  163. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js +8 -10
  164. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js.map +1 -1
  165. package/dist/ui/molecules/bulk-result/bulk-result.d.ts +3 -3
  166. package/dist/ui/molecules/bulk-result/bulk-result.js +4 -4
  167. package/dist/ui/molecules/bulk-result/bulk-result.js.map +1 -1
  168. package/dist/ui/molecules/column-settings/column-settings.js +1 -1
  169. package/dist/ui/molecules/column-settings/column-settings.js.map +1 -1
  170. package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts +24 -9
  171. package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts.map +1 -1
  172. package/dist/ui/molecules/confirm-dialog/confirm-dialog.js +38 -13
  173. package/dist/ui/molecules/confirm-dialog/confirm-dialog.js.map +1 -1
  174. package/dist/ui/molecules/description-list/description-list.d.ts +17 -0
  175. package/dist/ui/molecules/description-list/description-list.d.ts.map +1 -0
  176. package/dist/ui/molecules/description-list/description-list.js +36 -0
  177. package/dist/ui/molecules/description-list/description-list.js.map +1 -0
  178. package/dist/ui/molecules/description-list/index.d.ts +2 -0
  179. package/dist/ui/molecules/description-list/index.d.ts.map +1 -0
  180. package/dist/ui/molecules/description-list/index.js +3 -0
  181. package/dist/ui/molecules/description-list/index.js.map +1 -0
  182. package/dist/ui/molecules/drawer/drawer.js +3 -3
  183. package/dist/ui/molecules/drawer/drawer.js.map +1 -1
  184. package/dist/ui/molecules/empty-state/empty-state.d.ts +15 -0
  185. package/dist/ui/molecules/empty-state/empty-state.d.ts.map +1 -0
  186. package/dist/ui/molecules/empty-state/empty-state.js +29 -0
  187. package/dist/ui/molecules/empty-state/empty-state.js.map +1 -0
  188. package/dist/ui/molecules/empty-state/index.d.ts +2 -0
  189. package/dist/ui/molecules/empty-state/index.d.ts.map +1 -0
  190. package/dist/ui/molecules/empty-state/index.js +3 -0
  191. package/dist/ui/molecules/empty-state/index.js.map +1 -0
  192. package/dist/ui/molecules/entity-link-input/entity-link-input.d.ts.map +1 -1
  193. package/dist/ui/molecules/entity-link-input/entity-link-input.js +7 -4
  194. package/dist/ui/molecules/entity-link-input/entity-link-input.js.map +1 -1
  195. package/dist/ui/molecules/entity-link-picker/entity-link-picker.js +2 -2
  196. package/dist/ui/molecules/entity-link-picker/entity-link-picker.js.map +1 -1
  197. package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts +33 -20
  198. package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts.map +1 -1
  199. package/dist/ui/molecules/entity-record-card/entity-record-card.js +53 -20
  200. package/dist/ui/molecules/entity-record-card/entity-record-card.js.map +1 -1
  201. package/dist/ui/molecules/filter-builder/filter-builder.d.ts +8 -2
  202. package/dist/ui/molecules/filter-builder/filter-builder.d.ts.map +1 -1
  203. package/dist/ui/molecules/filter-builder/filter-builder.js +14 -5
  204. package/dist/ui/molecules/filter-builder/filter-builder.js.map +1 -1
  205. package/dist/ui/molecules/filter-chips/filter-chips.d.ts +16 -0
  206. package/dist/ui/molecules/filter-chips/filter-chips.d.ts.map +1 -0
  207. package/dist/ui/molecules/filter-chips/filter-chips.js +73 -0
  208. package/dist/ui/molecules/filter-chips/filter-chips.js.map +1 -0
  209. package/dist/ui/molecules/filter-chips/index.d.ts +2 -0
  210. package/dist/ui/molecules/filter-chips/index.d.ts.map +1 -0
  211. package/dist/ui/molecules/filter-chips/index.js +3 -0
  212. package/dist/ui/molecules/filter-chips/index.js.map +1 -0
  213. package/dist/ui/molecules/media-gallery/index.d.ts +2 -0
  214. package/dist/ui/molecules/media-gallery/index.d.ts.map +1 -0
  215. package/dist/ui/molecules/media-gallery/index.js +3 -0
  216. package/dist/ui/molecules/media-gallery/index.js.map +1 -0
  217. package/dist/ui/molecules/media-gallery/media-gallery.d.ts +31 -0
  218. package/dist/ui/molecules/media-gallery/media-gallery.d.ts.map +1 -0
  219. package/dist/ui/molecules/media-gallery/media-gallery.js +64 -0
  220. package/dist/ui/molecules/media-gallery/media-gallery.js.map +1 -0
  221. package/dist/ui/molecules/menu/menu.d.ts +11 -1
  222. package/dist/ui/molecules/menu/menu.d.ts.map +1 -1
  223. package/dist/ui/molecules/menu/menu.js +68 -6
  224. package/dist/ui/molecules/menu/menu.js.map +1 -1
  225. package/dist/ui/molecules/nav-menu/nav-menu.js +4 -4
  226. package/dist/ui/molecules/nav-menu/nav-menu.js.map +1 -1
  227. package/dist/ui/molecules/pagination/pagination.d.ts +5 -0
  228. package/dist/ui/molecules/pagination/pagination.d.ts.map +1 -1
  229. package/dist/ui/molecules/pagination/pagination.js +35 -18
  230. package/dist/ui/molecules/pagination/pagination.js.map +1 -1
  231. package/dist/ui/molecules/region-state/index.d.ts +2 -0
  232. package/dist/ui/molecules/region-state/index.d.ts.map +1 -0
  233. package/dist/ui/molecules/region-state/index.js +3 -0
  234. package/dist/ui/molecules/region-state/index.js.map +1 -0
  235. package/dist/ui/molecules/region-state/region-state.d.ts +42 -0
  236. package/dist/ui/molecules/region-state/region-state.d.ts.map +1 -0
  237. package/dist/ui/molecules/region-state/region-state.js +83 -0
  238. package/dist/ui/molecules/region-state/region-state.js.map +1 -0
  239. package/dist/ui/molecules/segmented-nav/segment-classes.d.ts +3 -3
  240. package/dist/ui/molecules/segmented-nav/segment-classes.d.ts.map +1 -1
  241. package/dist/ui/molecules/segmented-nav/segment-classes.js +2 -2
  242. package/dist/ui/molecules/segmented-nav/segment-classes.js.map +1 -1
  243. package/dist/ui/molecules/segmented-nav/segmented-nav.d.ts +14 -4
  244. package/dist/ui/molecules/segmented-nav/segmented-nav.d.ts.map +1 -1
  245. package/dist/ui/molecules/segmented-nav/segmented-nav.js +6 -5
  246. package/dist/ui/molecules/segmented-nav/segmented-nav.js.map +1 -1
  247. package/dist/ui/molecules/split-view/split-view.js +3 -3
  248. package/dist/ui/molecules/split-view/split-view.js.map +1 -1
  249. package/dist/ui/molecules/tab-strip/tab-strip.d.ts +51 -12
  250. package/dist/ui/molecules/tab-strip/tab-strip.d.ts.map +1 -1
  251. package/dist/ui/molecules/tab-strip/tab-strip.js +125 -34
  252. package/dist/ui/molecules/tab-strip/tab-strip.js.map +1 -1
  253. package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts +3 -1
  254. package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts.map +1 -1
  255. package/dist/ui/molecules/table-toolbar/table-toolbar.js +3 -2
  256. package/dist/ui/molecules/table-toolbar/table-toolbar.js.map +1 -1
  257. package/dist/ui/molecules/toast-region/toast-region.d.ts +63 -19
  258. package/dist/ui/molecules/toast-region/toast-region.d.ts.map +1 -1
  259. package/dist/ui/molecules/toast-region/toast-region.js +129 -42
  260. package/dist/ui/molecules/toast-region/toast-region.js.map +1 -1
  261. package/dist/ui/organisms/command-palette/command-palette.d.ts.map +1 -1
  262. package/dist/ui/organisms/command-palette/command-palette.js +25 -18
  263. package/dist/ui/organisms/command-palette/command-palette.js.map +1 -1
  264. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.d.ts.map +1 -1
  265. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js +8 -3
  266. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js.map +1 -1
  267. package/dist/ui/organisms/entity-form/entity-form.d.ts +1 -1
  268. package/dist/ui/organisms/entity-form/entity-form.d.ts.map +1 -1
  269. package/dist/ui/organisms/entity-form/entity-form.js +325 -215
  270. package/dist/ui/organisms/entity-form/entity-form.js.map +1 -1
  271. package/dist/ui/organisms/entity-form/entity-form.types.d.ts +8 -0
  272. package/dist/ui/organisms/entity-form/entity-form.types.d.ts.map +1 -1
  273. package/dist/ui/organisms/entity-form/entity-form.types.js.map +1 -1
  274. package/dist/ui/organisms/entity-table/entity-table.d.ts +1 -1
  275. package/dist/ui/organisms/entity-table/entity-table.d.ts.map +1 -1
  276. package/dist/ui/organisms/entity-table/entity-table.js +334 -198
  277. package/dist/ui/organisms/entity-table/entity-table.js.map +1 -1
  278. package/dist/ui/organisms/entity-table/entity-table.types.d.ts +19 -4
  279. package/dist/ui/organisms/entity-table/entity-table.types.d.ts.map +1 -1
  280. package/dist/ui/organisms/entity-table/entity-table.types.js.map +1 -1
  281. package/dist/ui/organisms/entity-table/header-sort.d.ts +18 -0
  282. package/dist/ui/organisms/entity-table/header-sort.d.ts.map +1 -0
  283. package/dist/ui/organisms/entity-table/header-sort.js +54 -0
  284. package/dist/ui/organisms/entity-table/header-sort.js.map +1 -0
  285. package/dist/ui/organisms/entity-table/pivot.d.ts +25 -0
  286. package/dist/ui/organisms/entity-table/pivot.d.ts.map +1 -0
  287. package/dist/ui/organisms/entity-table/pivot.js +106 -0
  288. package/dist/ui/organisms/entity-table/pivot.js.map +1 -0
  289. package/dist/ui/organisms/entity-table/use-result-announcement.d.ts +13 -0
  290. package/dist/ui/organisms/entity-table/use-result-announcement.d.ts.map +1 -0
  291. package/dist/ui/organisms/entity-table/use-result-announcement.js +31 -0
  292. package/dist/ui/organisms/entity-table/use-result-announcement.js.map +1 -0
  293. package/dist/ui/organisms/top-bar/live-indicator.d.ts +11 -0
  294. package/dist/ui/organisms/top-bar/live-indicator.d.ts.map +1 -0
  295. package/dist/ui/organisms/top-bar/live-indicator.js +46 -0
  296. package/dist/ui/organisms/top-bar/live-indicator.js.map +1 -0
  297. package/dist/ui/organisms/top-bar/top-bar.d.ts +11 -2
  298. package/dist/ui/organisms/top-bar/top-bar.d.ts.map +1 -1
  299. package/dist/ui/organisms/top-bar/top-bar.js +14 -5
  300. package/dist/ui/organisms/top-bar/top-bar.js.map +1 -1
  301. package/dist/ui/organisms/wizard/wizard.d.ts +1 -1
  302. package/dist/ui/organisms/wizard/wizard.d.ts.map +1 -1
  303. package/dist/ui/organisms/wizard/wizard.js +7 -1
  304. package/dist/ui/organisms/wizard/wizard.js.map +1 -1
  305. package/dist/ui/organisms/wizard/wizard.types.d.ts +8 -0
  306. package/dist/ui/organisms/wizard/wizard.types.d.ts.map +1 -1
  307. package/dist/ui/organisms/wizard/wizard.types.js.map +1 -1
  308. package/dist/ui/utils/live-updates.d.ts +24 -0
  309. package/dist/ui/utils/live-updates.d.ts.map +1 -0
  310. package/dist/ui/utils/live-updates.js +20 -0
  311. package/dist/ui/utils/live-updates.js.map +1 -0
  312. package/dist/ui/utils/use-focus-on-arrival.d.ts +14 -0
  313. package/dist/ui/utils/use-focus-on-arrival.d.ts.map +1 -0
  314. package/dist/ui/utils/use-focus-on-arrival.js +42 -0
  315. package/dist/ui/utils/use-focus-on-arrival.js.map +1 -0
  316. package/dist/ui/utils/use-hotkey.d.ts +44 -25
  317. package/dist/ui/utils/use-hotkey.d.ts.map +1 -1
  318. package/dist/ui/utils/use-hotkey.js +80 -48
  319. package/dist/ui/utils/use-hotkey.js.map +1 -1
  320. package/package.json +5 -5
  321. package/dist/ui/molecules/split-button/index.d.ts +0 -2
  322. package/dist/ui/molecules/split-button/index.d.ts.map +0 -1
  323. package/dist/ui/molecules/split-button/index.js +0 -3
  324. package/dist/ui/molecules/split-button/index.js.map +0 -1
  325. package/dist/ui/molecules/split-button/split-button.d.ts +0 -21
  326. package/dist/ui/molecules/split-button/split-button.d.ts.map +0 -1
  327. package/dist/ui/molecules/split-button/split-button.js +0 -35
  328. package/dist/ui/molecules/split-button/split-button.js.map +0 -1
@@ -0,0 +1,21 @@
1
+ import type { MoneyFormat } from '@entifix/core';
2
+ export type MoneyUnit = MoneyFormat['unit'];
3
+ /**
4
+ * How many minor units a currency has, as `Intl` resolves it: 2 for GTQ and
5
+ * USD, 0 for JPY, 3 for KWD. Read from the platform rather than a table, so a
6
+ * currency nobody here thought of is still right.
7
+ */
8
+ export declare function fractionDigits(currency: string): number;
9
+ /** The amount in major units (64.99), whichever unit it is stored in. */
10
+ export declare function toMajorUnits(amount: number, currency: string, unit: MoneyUnit): number;
11
+ /** A major-unit amount back in the unit it is stored in, rounded to it. */
12
+ export declare function fromMajorUnits(major: number, currency: string, unit: MoneyUnit): number;
13
+ /**
14
+ * The amount as the reader's locale writes money: `Q64.99` in `en`, `64,99 GTQ`
15
+ * or similar in `es`. Never the bare stored number — a till once printed
16
+ * 6499 GTQ for 64,99.
17
+ */
18
+ export declare function formatMoney(amount: number, currency: string, unit: MoneyUnit, locale: string): string;
19
+ /** The currency a money member reads in: fixed, or the record's own member. */
20
+ export declare function currencyOf(money: MoneyFormat, record: Readonly<Record<string, unknown>> | undefined): string | undefined;
21
+ //# sourceMappingURL=money-math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"money-math.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/money/money-math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CASvD;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,SAAS,GACd,MAAM,CAER;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,SAAS,GACd,MAAM,CAKR;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,GACb,MAAM,CAIR;AAED,+EAA+E;AAC/E,wBAAgB,UAAU,CACxB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,GACpD,MAAM,GAAG,SAAS,CAIpB"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * How many minor units a currency has, as `Intl` resolves it: 2 for GTQ and
3
+ * USD, 0 for JPY, 3 for KWD. Read from the platform rather than a table, so a
4
+ * currency nobody here thought of is still right.
5
+ */ export function fractionDigits(currency) {
6
+ var _resolvedOptions_maximumFractionDigits;
7
+ // Always set for `style: 'currency'`; the fallback only satisfies the type.
8
+ /* v8 ignore next */ return (_resolvedOptions_maximumFractionDigits = new Intl.NumberFormat('en', {
9
+ style: 'currency',
10
+ currency
11
+ }).resolvedOptions().maximumFractionDigits) != null ? _resolvedOptions_maximumFractionDigits : 2;
12
+ }
13
+ /** The amount in major units (64.99), whichever unit it is stored in. */ export function toMajorUnits(amount, currency, unit) {
14
+ return unit === 'major' ? amount : amount / 10 ** fractionDigits(currency);
15
+ }
16
+ /** A major-unit amount back in the unit it is stored in, rounded to it. */ export function fromMajorUnits(major, currency, unit) {
17
+ const digits = fractionDigits(currency);
18
+ return unit === 'major' ? Number(major.toFixed(digits)) : Math.round(major * 10 ** digits);
19
+ }
20
+ /**
21
+ * The amount as the reader's locale writes money: `Q64.99` in `en`, `64,99 GTQ`
22
+ * or similar in `es`. Never the bare stored number — a till once printed
23
+ * 6499 GTQ for 64,99.
24
+ */ export function formatMoney(amount, currency, unit, locale) {
25
+ return new Intl.NumberFormat(locale, {
26
+ style: 'currency',
27
+ currency
28
+ }).format(toMajorUnits(amount, currency, unit));
29
+ }
30
+ /** The currency a money member reads in: fixed, or the record's own member. */ export function currencyOf(money, record) {
31
+ if (money.currency !== undefined) return money.currency;
32
+ const value = record == null ? void 0 : record[money.currencyMember];
33
+ return typeof value === 'string' && value !== '' ? value : undefined;
34
+ }
35
+
36
+ //# sourceMappingURL=money-math.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/money/money-math.ts"],"sourcesContent":["import type { MoneyFormat } from '@entifix/core';\n\nexport type MoneyUnit = MoneyFormat['unit'];\n\n/**\n * How many minor units a currency has, as `Intl` resolves it: 2 for GTQ and\n * USD, 0 for JPY, 3 for KWD. Read from the platform rather than a table, so a\n * currency nobody here thought of is still right.\n */\nexport function fractionDigits(currency: string): number {\n // Always set for `style: 'currency'`; the fallback only satisfies the type.\n /* v8 ignore next */\n return (\n new Intl.NumberFormat('en', {\n style: 'currency',\n currency,\n }).resolvedOptions().maximumFractionDigits ?? 2\n );\n}\n\n/** The amount in major units (64.99), whichever unit it is stored in. */\nexport function toMajorUnits(\n amount: number,\n currency: string,\n unit: MoneyUnit,\n): number {\n return unit === 'major' ? amount : amount / 10 ** fractionDigits(currency);\n}\n\n/** A major-unit amount back in the unit it is stored in, rounded to it. */\nexport function fromMajorUnits(\n major: number,\n currency: string,\n unit: MoneyUnit,\n): number {\n const digits = fractionDigits(currency);\n return unit === 'major'\n ? Number(major.toFixed(digits))\n : Math.round(major * 10 ** digits);\n}\n\n/**\n * The amount as the reader's locale writes money: `Q64.99` in `en`, `64,99 GTQ`\n * or similar in `es`. Never the bare stored number — a till once printed\n * 6499 GTQ for 64,99.\n */\nexport function formatMoney(\n amount: number,\n currency: string,\n unit: MoneyUnit,\n locale: string,\n): string {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(\n toMajorUnits(amount, currency, unit),\n );\n}\n\n/** The currency a money member reads in: fixed, or the record's own member. */\nexport function currencyOf(\n money: MoneyFormat,\n record: Readonly<Record<string, unknown>> | undefined,\n): string | undefined {\n if (money.currency !== undefined) return money.currency;\n const value = record?.[money.currencyMember];\n return typeof value === 'string' && value !== '' ? value : undefined;\n}\n"],"names":["fractionDigits","currency","Intl","NumberFormat","style","resolvedOptions","maximumFractionDigits","toMajorUnits","amount","unit","fromMajorUnits","major","digits","Number","toFixed","Math","round","formatMoney","locale","format","currencyOf","money","record","undefined","value","currencyMember"],"mappings":"AAIA;;;;CAIC,GACD,OAAO,SAASA,eAAeC,QAAgB;QAI3C;IAHF,4EAA4E;IAC5E,kBAAkB,GAClB,QACE,yCAAA,IAAIC,KAAKC,YAAY,CAAC,MAAM;QAC1BC,OAAO;QACPH;IACF,GAAGI,eAAe,GAAGC,qBAAqB,YAH1C,yCAG8C;AAElD;AAEA,uEAAuE,GACvE,OAAO,SAASC,aACdC,MAAc,EACdP,QAAgB,EAChBQ,IAAe;IAEf,OAAOA,SAAS,UAAUD,SAASA,SAAS,MAAMR,eAAeC;AACnE;AAEA,yEAAyE,GACzE,OAAO,SAASS,eACdC,KAAa,EACbV,QAAgB,EAChBQ,IAAe;IAEf,MAAMG,SAASZ,eAAeC;IAC9B,OAAOQ,SAAS,UACZI,OAAOF,MAAMG,OAAO,CAACF,WACrBG,KAAKC,KAAK,CAACL,QAAQ,MAAMC;AAC/B;AAEA;;;;CAIC,GACD,OAAO,SAASK,YACdT,MAAc,EACdP,QAAgB,EAChBQ,IAAe,EACfS,MAAc;IAEd,OAAO,IAAIhB,KAAKC,YAAY,CAACe,QAAQ;QAAEd,OAAO;QAAYH;IAAS,GAAGkB,MAAM,CAC1EZ,aAAaC,QAAQP,UAAUQ;AAEnC;AAEA,6EAA6E,GAC7E,OAAO,SAASW,WACdC,KAAkB,EAClBC,MAAqD;IAErD,IAAID,MAAMpB,QAAQ,KAAKsB,WAAW,OAAOF,MAAMpB,QAAQ;IACvD,MAAMuB,QAAQF,0BAAAA,MAAQ,CAACD,MAAMI,cAAc,CAAC;IAC5C,OAAO,OAAOD,UAAU,YAAYA,UAAU,KAAKA,QAAQD;AAC7D"}
@@ -0,0 +1,19 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ import { type MoneyUnit } from './money-math.js';
3
+ export interface MoneyProps extends Omit<ComponentPropsWithoutRef<'span'>, 'children'> {
4
+ amount: number;
5
+ /** ISO 4217, e.g. `GTQ`. */
6
+ currency: string;
7
+ /** Whether `amount` counts minor units (cents) or major ones. */
8
+ unit: MoneyUnit;
9
+ /** The reader's locale; a client caller reads it with the `useLocale` hook. */
10
+ locale: string;
11
+ }
12
+ /**
13
+ * An amount of money, formatted in the reader's locale with its currency.
14
+ * `unit: 'minor'` divides by the currency's own minor-unit count, so JPY and
15
+ * KWD are right too. Tabular figures, so a column of prices aligns on the
16
+ * digit. Server-safe.
17
+ */
18
+ export declare function Money({ amount, currency, unit, locale, className, ...props }: MoneyProps): import("react").JSX.Element;
19
+ //# sourceMappingURL=money.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/money/money.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,wBAAwB,CAAC,MAAM,CAAC,EAChC,UAAU,CACX;IACC,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,IAAI,EAAE,SAAS,CAAC;IAChB,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,EACpB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,UAAU,+BASZ"}
@@ -0,0 +1,26 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { cn } from '../../utils/cn.js';
5
+ import { formatMoney } from './money-math.js';
6
+ /**
7
+ * An amount of money, formatted in the reader's locale with its currency.
8
+ * `unit: 'minor'` divides by the currency's own minor-unit count, so JPY and
9
+ * KWD are right too. Tabular figures, so a column of prices aligns on the
10
+ * digit. Server-safe.
11
+ */ export function Money(_0) {
12
+ let { amount, currency, unit, locale, className } = _0, props = _object_without_properties_loose(_0, [
13
+ "amount",
14
+ "currency",
15
+ "unit",
16
+ "locale",
17
+ "className"
18
+ ]);
19
+ return /*#__PURE__*/ _jsx("span", _extends({
20
+ className: cn('whitespace-nowrap tabular-nums', className)
21
+ }, props, {
22
+ children: formatMoney(amount, currency, unit, locale)
23
+ }));
24
+ }
25
+
26
+ //# sourceMappingURL=money.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/money/money.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '../../utils/cn.js';\nimport { formatMoney, type MoneyUnit } from './money-math.js';\n\nexport interface MoneyProps extends Omit<\n ComponentPropsWithoutRef<'span'>,\n 'children'\n> {\n amount: number;\n /** ISO 4217, e.g. `GTQ`. */\n currency: string;\n /** Whether `amount` counts minor units (cents) or major ones. */\n unit: MoneyUnit;\n /** The reader's locale; a client caller reads it with the `useLocale` hook. */\n locale: string;\n}\n\n/**\n * An amount of money, formatted in the reader's locale with its currency.\n * `unit: 'minor'` divides by the currency's own minor-unit count, so JPY and\n * KWD are right too. Tabular figures, so a column of prices aligns on the\n * digit. Server-safe.\n */\nexport function Money({\n amount,\n currency,\n unit,\n locale,\n className,\n ...props\n}: MoneyProps) {\n return (\n <span\n className={cn('whitespace-nowrap tabular-nums', className)}\n {...props}\n >\n {formatMoney(amount, currency, unit, locale)}\n </span>\n );\n}\n"],"names":["cn","formatMoney","Money","amount","currency","unit","locale","className","props","span"],"mappings":";;;AAEA,SAASA,EAAE,QAAQ,oBAAoB;AACvC,SAASC,WAAW,QAAwB,kBAAkB;AAe9D;;;;;CAKC,GACD,OAAO,SAASC,MAAM,EAOT;QAPS,EACpBC,MAAM,EACNC,QAAQ,EACRC,IAAI,EACJC,MAAM,EACNC,SAAS,EAEE,OADRC;;;;;;;IAEH,qBACE,KAACC;QACCF,WAAWP,GAAG,kCAAkCO;OAC5CC;kBAEHP,YAAYE,QAAQC,UAAUC,MAAMC;;AAG3C"}
@@ -0,0 +1,3 @@
1
+ export * from './number-input.js';
2
+ export * from './quantity-input.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/number-input/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './number-input.js';
2
+ export * from './quantity-input.js';
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/number-input/index.ts"],"sourcesContent":["export * from './number-input.js';\nexport * from './quantity-input.js';\n"],"names":[],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,sBAAsB"}
@@ -0,0 +1,10 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ export type NumberInputProps = Omit<ComponentPropsWithoutRef<'input'>, 'type'>;
3
+ /**
4
+ * A number typed as text: `inputmode` brings up the numeric keyboard, and the
5
+ * value stays exactly what was typed, in the reader's own decimal separator,
6
+ * rather than a native `type="number"` that rejects `64,99` in a Spanish
7
+ * locale and spins on a scroll wheel. Tabular figures. Server-safe.
8
+ */
9
+ export declare function NumberInput({ className, inputMode, ...props }: NumberInputProps): import("react").JSX.Element;
10
+ //# sourceMappingURL=number-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-input.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/number-input/number-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAKtD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;AAE/E;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,SAAqB,EACrB,GAAG,KAAK,EACT,EAAE,gBAAgB,+BASlB"}
@@ -0,0 +1,23 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { cn } from '../../utils/cn.js';
5
+ import { TextInput } from '../field/field.js';
6
+ /**
7
+ * A number typed as text: `inputmode` brings up the numeric keyboard, and the
8
+ * value stays exactly what was typed, in the reader's own decimal separator,
9
+ * rather than a native `type="number"` that rejects `64,99` in a Spanish
10
+ * locale and spins on a scroll wheel. Tabular figures. Server-safe.
11
+ */ export function NumberInput(_0) {
12
+ let { className, inputMode = 'decimal' } = _0, props = _object_without_properties_loose(_0, [
13
+ "className",
14
+ "inputMode"
15
+ ]);
16
+ return /*#__PURE__*/ _jsx(TextInput, _extends({
17
+ type: "text",
18
+ inputMode: inputMode,
19
+ className: cn('tabular-nums', className)
20
+ }, props));
21
+ }
22
+
23
+ //# sourceMappingURL=number-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/number-input/number-input.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '../../utils/cn.js';\nimport { TextInput } from '../field/field.js';\n\nexport type NumberInputProps = Omit<ComponentPropsWithoutRef<'input'>, 'type'>;\n\n/**\n * A number typed as text: `inputmode` brings up the numeric keyboard, and the\n * value stays exactly what was typed, in the reader's own decimal separator,\n * rather than a native `type=\"number\"` that rejects `64,99` in a Spanish\n * locale and spins on a scroll wheel. Tabular figures. Server-safe.\n */\nexport function NumberInput({\n className,\n inputMode = 'decimal',\n ...props\n}: NumberInputProps) {\n return (\n <TextInput\n type=\"text\"\n inputMode={inputMode}\n className={cn('tabular-nums', className)}\n {...props}\n />\n );\n}\n"],"names":["cn","TextInput","NumberInput","className","inputMode","props","type"],"mappings":";;;AAEA,SAASA,EAAE,QAAQ,oBAAoB;AACvC,SAASC,SAAS,QAAQ,oBAAoB;AAI9C;;;;;CAKC,GACD,OAAO,SAASC,YAAY,EAIT;QAJS,EAC1BC,SAAS,EACTC,YAAY,SAAS,EAEJ,OADdC;;;;IAEH,qBACE,KAACJ;QACCK,MAAK;QACLF,WAAWA;QACXD,WAAWH,GAAG,gBAAgBG;OAC1BE;AAGV"}
@@ -0,0 +1,29 @@
1
+ export interface QuantityInputProps {
2
+ /** What is being counted; names the spinbutton and both of its buttons. */
3
+ label: string;
4
+ value: number;
5
+ onChange: (value: number) => void;
6
+ min?: number;
7
+ max?: number;
8
+ step?: number;
9
+ disabled?: boolean;
10
+ id?: string;
11
+ /**
12
+ * Posts the count with the form it sits in, under this name — a server
13
+ * action's form works without JavaScript, where the field is the only part
14
+ * a reader can change, so the field itself carries it. The server clamps
15
+ * what it receives: a typed value is only clamped here once committed.
16
+ */
17
+ name?: string;
18
+ className?: string;
19
+ }
20
+ /**
21
+ * A count, on the WAI-ARIA spinbutton pattern: Up and Down step it, Home and
22
+ * End jump to its bounds, and what is typed is committed on Enter or on
23
+ * leaving the field, clamped to the bounds. The − and + beside it are named
24
+ * "Decrease {label}" and "Increase {label}" and sit at `--target-min`; they are
25
+ * out of the Tab order, as the pattern has them, because the arrow keys
26
+ * already do what they do.
27
+ */
28
+ export declare function QuantityInput({ label, value, onChange, min, max, step, disabled, id, name, className, }: QuantityInputProps): import("react").JSX.Element;
29
+ //# sourceMappingURL=quantity-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quantity-input.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/number-input/quantity-input.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAO,EACP,GAAG,EACH,IAAQ,EACR,QAAgB,EAChB,EAAE,EACF,IAAI,EACJ,SAAS,GACV,EAAE,kBAAkB,+BA8EpB"}
@@ -0,0 +1,100 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from 'react';
4
+ import { useT } from '../../../i18n/index.js';
5
+ import { cn } from '../../utils/cn.js';
6
+ const STEP_BUTTON = 'flex min-h-(--target-min) min-w-(--target-min) shrink-0 items-center justify-center rounded-md border border-border-control bg-surface-elevated text-content hover:bg-surface disabled:cursor-not-allowed disabled:opacity-50';
7
+ /**
8
+ * A count, on the WAI-ARIA spinbutton pattern: Up and Down step it, Home and
9
+ * End jump to its bounds, and what is typed is committed on Enter or on
10
+ * leaving the field, clamped to the bounds. The − and + beside it are named
11
+ * "Decrease {label}" and "Increase {label}" and sit at `--target-min`; they are
12
+ * out of the Tab order, as the pattern has them, because the arrow keys
13
+ * already do what they do.
14
+ */ export function QuantityInput({ label, value, onChange, min = 0, max, step = 1, disabled = false, id, name, className }) {
15
+ const t = useT();
16
+ const [text, setText] = useState(String(value));
17
+ useEffect(()=>{
18
+ // eslint-disable-next-line react-hooks/set-state-in-effect -- the value moved from outside (a step, a reset)
19
+ setText(String(value));
20
+ }, [
21
+ value
22
+ ]);
23
+ const clamp = (next)=>Math.min(max != null ? max : Number.POSITIVE_INFINITY, Math.max(min, next));
24
+ const set = (next)=>{
25
+ const clamped = clamp(next);
26
+ setText(String(clamped));
27
+ if (clamped !== value) onChange(clamped);
28
+ };
29
+ const commit = ()=>{
30
+ const typed = Number.parseInt(text, 10);
31
+ set(Number.isNaN(typed) ? value : typed);
32
+ };
33
+ const onKeyDown = (event)=>{
34
+ const next = {
35
+ ArrowUp: value + step,
36
+ ArrowDown: value - step,
37
+ Home: min,
38
+ End: max
39
+ }[event.key];
40
+ if (event.key === 'Enter') {
41
+ commit();
42
+ return;
43
+ }
44
+ if (next === undefined) return;
45
+ event.preventDefault();
46
+ set(next);
47
+ };
48
+ return /*#__PURE__*/ _jsxs("span", {
49
+ className: cn('inline-flex items-center gap-3xs', className),
50
+ children: [
51
+ /*#__PURE__*/ _jsx("button", {
52
+ type: "button",
53
+ tabIndex: -1,
54
+ "aria-label": t('quantity.decrease', {
55
+ label
56
+ }),
57
+ disabled: disabled || value <= min,
58
+ onClick: ()=>set(value - step),
59
+ className: STEP_BUTTON,
60
+ children: /*#__PURE__*/ _jsx("span", {
61
+ "aria-hidden": "true",
62
+ children: "−"
63
+ })
64
+ }),
65
+ /*#__PURE__*/ _jsx("input", {
66
+ id: id,
67
+ name: name,
68
+ type: "text",
69
+ role: "spinbutton",
70
+ inputMode: "numeric",
71
+ "aria-label": label,
72
+ "aria-valuenow": value,
73
+ "aria-valuemin": min,
74
+ "aria-valuemax": max,
75
+ disabled: disabled,
76
+ value: text,
77
+ onChange: (event)=>setText(event.currentTarget.value),
78
+ onBlur: commit,
79
+ onKeyDown: onKeyDown,
80
+ className: "w-16 min-h-(--target-min) rounded-lg border border-border-control bg-surface-elevated px-2xs py-3xs text-center text-step-sm text-content tabular-nums focus-ring disabled:cursor-not-allowed disabled:opacity-50"
81
+ }),
82
+ /*#__PURE__*/ _jsx("button", {
83
+ type: "button",
84
+ tabIndex: -1,
85
+ "aria-label": t('quantity.increase', {
86
+ label
87
+ }),
88
+ disabled: disabled || max !== undefined && value >= max,
89
+ onClick: ()=>set(value + step),
90
+ className: STEP_BUTTON,
91
+ children: /*#__PURE__*/ _jsx("span", {
92
+ "aria-hidden": "true",
93
+ children: "+"
94
+ })
95
+ })
96
+ ]
97
+ });
98
+ }
99
+
100
+ //# sourceMappingURL=quantity-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/number-input/quantity-input.tsx"],"sourcesContent":["'use client';\n\nimport { type KeyboardEvent, useEffect, useState } from 'react';\n\nimport { useT } from '../../../i18n/index.js';\nimport { cn } from '../../utils/cn.js';\n\nexport interface QuantityInputProps {\n /** What is being counted; names the spinbutton and both of its buttons. */\n label: string;\n value: number;\n onChange: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n disabled?: boolean;\n id?: string;\n /**\n * Posts the count with the form it sits in, under this name — a server\n * action's form works without JavaScript, where the field is the only part\n * a reader can change, so the field itself carries it. The server clamps\n * what it receives: a typed value is only clamped here once committed.\n */\n name?: string;\n className?: string;\n}\n\nconst STEP_BUTTON =\n 'flex min-h-(--target-min) min-w-(--target-min) shrink-0 items-center justify-center rounded-md border border-border-control bg-surface-elevated text-content hover:bg-surface disabled:cursor-not-allowed disabled:opacity-50';\n\n/**\n * A count, on the WAI-ARIA spinbutton pattern: Up and Down step it, Home and\n * End jump to its bounds, and what is typed is committed on Enter or on\n * leaving the field, clamped to the bounds. The − and + beside it are named\n * \"Decrease {label}\" and \"Increase {label}\" and sit at `--target-min`; they are\n * out of the Tab order, as the pattern has them, because the arrow keys\n * already do what they do.\n */\nexport function QuantityInput({\n label,\n value,\n onChange,\n min = 0,\n max,\n step = 1,\n disabled = false,\n id,\n name,\n className,\n}: QuantityInputProps) {\n const t = useT();\n const [text, setText] = useState(String(value));\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- the value moved from outside (a step, a reset)\n setText(String(value));\n }, [value]);\n\n const clamp = (next: number) =>\n Math.min(max ?? Number.POSITIVE_INFINITY, Math.max(min, next));\n const set = (next: number) => {\n const clamped = clamp(next);\n setText(String(clamped));\n if (clamped !== value) onChange(clamped);\n };\n const commit = () => {\n const typed = Number.parseInt(text, 10);\n set(Number.isNaN(typed) ? value : typed);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n const next = {\n ArrowUp: value + step,\n ArrowDown: value - step,\n Home: min,\n End: max,\n }[event.key];\n if (event.key === 'Enter') {\n commit();\n return;\n }\n if (next === undefined) return;\n event.preventDefault();\n set(next);\n };\n\n return (\n <span className={cn('inline-flex items-center gap-3xs', className)}>\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={t('quantity.decrease', { label })}\n disabled={disabled || value <= min}\n onClick={() => set(value - step)}\n className={STEP_BUTTON}\n >\n <span aria-hidden=\"true\">−</span>\n </button>\n <input\n id={id}\n name={name}\n type=\"text\"\n role=\"spinbutton\"\n inputMode=\"numeric\"\n aria-label={label}\n aria-valuenow={value}\n aria-valuemin={min}\n aria-valuemax={max}\n disabled={disabled}\n value={text}\n onChange={event => setText(event.currentTarget.value)}\n onBlur={commit}\n onKeyDown={onKeyDown}\n className=\"w-16 min-h-(--target-min) rounded-lg border border-border-control bg-surface-elevated px-2xs py-3xs text-center text-step-sm text-content tabular-nums focus-ring disabled:cursor-not-allowed disabled:opacity-50\"\n />\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={t('quantity.increase', { label })}\n disabled={disabled || (max !== undefined && value >= max)}\n onClick={() => set(value + step)}\n className={STEP_BUTTON}\n >\n <span aria-hidden=\"true\">+</span>\n </button>\n </span>\n );\n}\n"],"names":["useEffect","useState","useT","cn","STEP_BUTTON","QuantityInput","label","value","onChange","min","max","step","disabled","id","name","className","t","text","setText","String","clamp","next","Math","Number","POSITIVE_INFINITY","set","clamped","commit","typed","parseInt","isNaN","onKeyDown","event","ArrowUp","ArrowDown","Home","End","key","undefined","preventDefault","span","button","type","tabIndex","aria-label","onClick","aria-hidden","input","role","inputMode","aria-valuenow","aria-valuemin","aria-valuemax","currentTarget","onBlur"],"mappings":"AAAA;;AAEA,SAA6BA,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAEhE,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAASC,EAAE,QAAQ,oBAAoB;AAsBvC,MAAMC,cACJ;AAEF;;;;;;;CAOC,GACD,OAAO,SAASC,cAAc,EAC5BC,KAAK,EACLC,KAAK,EACLC,QAAQ,EACRC,MAAM,CAAC,EACPC,GAAG,EACHC,OAAO,CAAC,EACRC,WAAW,KAAK,EAChBC,EAAE,EACFC,IAAI,EACJC,SAAS,EACU;IACnB,MAAMC,IAAId;IACV,MAAM,CAACe,MAAMC,QAAQ,GAAGjB,SAASkB,OAAOZ;IAExCP,UAAU;QACR,6GAA6G;QAC7GkB,QAAQC,OAAOZ;IACjB,GAAG;QAACA;KAAM;IAEV,MAAMa,QAAQ,CAACC,OACbC,KAAKb,GAAG,CAACC,cAAAA,MAAOa,OAAOC,iBAAiB,EAAEF,KAAKZ,GAAG,CAACD,KAAKY;IAC1D,MAAMI,MAAM,CAACJ;QACX,MAAMK,UAAUN,MAAMC;QACtBH,QAAQC,OAAOO;QACf,IAAIA,YAAYnB,OAAOC,SAASkB;IAClC;IACA,MAAMC,SAAS;QACb,MAAMC,QAAQL,OAAOM,QAAQ,CAACZ,MAAM;QACpCQ,IAAIF,OAAOO,KAAK,CAACF,SAASrB,QAAQqB;IACpC;IAEA,MAAMG,YAAY,CAACC;QACjB,MAAMX,OAAO;YACXY,SAAS1B,QAAQI;YACjBuB,WAAW3B,QAAQI;YACnBwB,MAAM1B;YACN2B,KAAK1B;QACP,CAAC,CAACsB,MAAMK,GAAG,CAAC;QACZ,IAAIL,MAAMK,GAAG,KAAK,SAAS;YACzBV;YACA;QACF;QACA,IAAIN,SAASiB,WAAW;QACxBN,MAAMO,cAAc;QACpBd,IAAIJ;IACN;IAEA,qBACE,MAACmB;QAAKzB,WAAWZ,GAAG,oCAAoCY;;0BACtD,KAAC0B;gBACCC,MAAK;gBACLC,UAAU,CAAC;gBACXC,cAAY5B,EAAE,qBAAqB;oBAAEV;gBAAM;gBAC3CM,UAAUA,YAAYL,SAASE;gBAC/BoC,SAAS,IAAMpB,IAAIlB,QAAQI;gBAC3BI,WAAWX;0BAEX,cAAA,KAACoC;oBAAKM,eAAY;8BAAO;;;0BAE3B,KAACC;gBACClC,IAAIA;gBACJC,MAAMA;gBACN4B,MAAK;gBACLM,MAAK;gBACLC,WAAU;gBACVL,cAAYtC;gBACZ4C,iBAAe3C;gBACf4C,iBAAe1C;gBACf2C,iBAAe1C;gBACfE,UAAUA;gBACVL,OAAOU;gBACPT,UAAUwB,CAAAA,QAASd,QAAQc,MAAMqB,aAAa,CAAC9C,KAAK;gBACpD+C,QAAQ3B;gBACRI,WAAWA;gBACXhB,WAAU;;0BAEZ,KAAC0B;gBACCC,MAAK;gBACLC,UAAU,CAAC;gBACXC,cAAY5B,EAAE,qBAAqB;oBAAEV;gBAAM;gBAC3CM,UAAUA,YAAaF,QAAQ4B,aAAa/B,SAASG;gBACrDmC,SAAS,IAAMpB,IAAIlB,QAAQI;gBAC3BI,WAAWX;0BAEX,cAAA,KAACoC;oBAAKM,eAAY;8BAAO;;;;;AAIjC"}
@@ -15,7 +15,7 @@ import { cn } from '../../utils/cn.js';
15
15
  return /*#__PURE__*/ _jsx("div", _extends({
16
16
  "aria-hidden": "true",
17
17
  "data-testid": "skeleton",
18
- className: cn('animate-pulse bg-border/60 motion-reduce:animate-none', shape === 'line' && 'h-[1em] rounded-full', shape === 'block' && 'rounded-md', shape === 'circle' && 'aspect-square rounded-full', className)
18
+ className: cn('animate-pulse bg-border/60 motion-reduce:animate-none', shape === 'line' && 'h-(--glyph-block) rounded-full', shape === 'block' && 'rounded-md', shape === 'circle' && 'aspect-square rounded-full', className)
19
19
  }, props));
20
20
  }
21
21
  /** A stack of line skeletons standing in for a block of text. */ export function SkeletonText({ lines = 3, className }) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ui/atoms/skeleton/skeleton.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\nexport type SkeletonShape = 'line' | 'block' | 'circle';\n\nexport interface SkeletonProps extends ComponentPropsWithoutRef<'div'> {\n /** `line` for text, `block` for panels, `circle` for avatars. */\n shape?: SkeletonShape;\n}\n\n/**\n * A loading placeholder. Pulses to read as \"content is coming\", holds still for\n * `prefers-reduced-motion`, and is `aria-hidden` so assistive tech skips it. Its\n * dimensions come from the caller (`className` / `style`) so it matches the real\n * content's geometry and the swap causes no layout shift.\n */\nexport function Skeleton({\n shape = 'block',\n className,\n ...props\n}: SkeletonProps) {\n return (\n <div\n aria-hidden=\"true\"\n data-testid=\"skeleton\"\n className={cn(\n 'animate-pulse bg-border/60 motion-reduce:animate-none',\n shape === 'line' && 'h-[1em] rounded-full',\n shape === 'block' && 'rounded-md',\n shape === 'circle' && 'aspect-square rounded-full',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface SkeletonTextProps {\n /** Number of shimmer lines; the last is shortened like a paragraph end. */\n lines?: number;\n className?: string;\n}\n\n/** A stack of line skeletons standing in for a block of text. */\nexport function SkeletonText({ lines = 3, className }: SkeletonTextProps) {\n return (\n <div className={cn('flex flex-col gap-2xs', className)}>\n {Array.from({ length: lines }, (_, index) => (\n <Skeleton\n key={index}\n shape=\"line\"\n className={index === lines - 1 ? 'w-2/3' : 'w-full'}\n />\n ))}\n </div>\n );\n}\n"],"names":["cn","Skeleton","shape","className","props","div","aria-hidden","data-testid","SkeletonText","lines","Array","from","length","_","index"],"mappings":";;;AAEA,SAASA,EAAE,QAAQ,oBAAoB;AASvC;;;;;CAKC,GACD,OAAO,SAASC,SAAS,EAIT;QAJS,EACvBC,QAAQ,OAAO,EACfC,SAAS,EAEK,OADXC;;;;IAEH,qBACE,KAACC;QACCC,eAAY;QACZC,eAAY;QACZJ,WAAWH,GACT,yDACAE,UAAU,UAAU,wBACpBA,UAAU,WAAW,cACrBA,UAAU,YAAY,8BACtBC;OAEEC;AAGV;AAQA,+DAA+D,GAC/D,OAAO,SAASI,aAAa,EAAEC,QAAQ,CAAC,EAAEN,SAAS,EAAqB;IACtE,qBACE,KAACE;QAAIF,WAAWH,GAAG,yBAAyBG;kBACzCO,MAAMC,IAAI,CAAC;YAAEC,QAAQH;QAAM,GAAG,CAACI,GAAGC,sBACjC,KAACb;gBAECC,OAAM;gBACNC,WAAWW,UAAUL,QAAQ,IAAI,UAAU;eAFtCK;;AAOf"}
1
+ {"version":3,"sources":["../../../../src/ui/atoms/skeleton/skeleton.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\nexport type SkeletonShape = 'line' | 'block' | 'circle';\n\nexport interface SkeletonProps extends ComponentPropsWithoutRef<'div'> {\n /** `line` for text, `block` for panels, `circle` for avatars. */\n shape?: SkeletonShape;\n}\n\n/**\n * A loading placeholder. Pulses to read as \"content is coming\", holds still for\n * `prefers-reduced-motion`, and is `aria-hidden` so assistive tech skips it. Its\n * dimensions come from the caller (`className` / `style`) so it matches the real\n * content's geometry and the swap causes no layout shift.\n */\nexport function Skeleton({\n shape = 'block',\n className,\n ...props\n}: SkeletonProps) {\n return (\n <div\n aria-hidden=\"true\"\n data-testid=\"skeleton\"\n className={cn(\n 'animate-pulse bg-border/60 motion-reduce:animate-none',\n shape === 'line' && 'h-(--glyph-block) rounded-full',\n shape === 'block' && 'rounded-md',\n shape === 'circle' && 'aspect-square rounded-full',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface SkeletonTextProps {\n /** Number of shimmer lines; the last is shortened like a paragraph end. */\n lines?: number;\n className?: string;\n}\n\n/** A stack of line skeletons standing in for a block of text. */\nexport function SkeletonText({ lines = 3, className }: SkeletonTextProps) {\n return (\n <div className={cn('flex flex-col gap-2xs', className)}>\n {Array.from({ length: lines }, (_, index) => (\n <Skeleton\n key={index}\n shape=\"line\"\n className={index === lines - 1 ? 'w-2/3' : 'w-full'}\n />\n ))}\n </div>\n );\n}\n"],"names":["cn","Skeleton","shape","className","props","div","aria-hidden","data-testid","SkeletonText","lines","Array","from","length","_","index"],"mappings":";;;AAEA,SAASA,EAAE,QAAQ,oBAAoB;AASvC;;;;;CAKC,GACD,OAAO,SAASC,SAAS,EAIT;QAJS,EACvBC,QAAQ,OAAO,EACfC,SAAS,EAEK,OADXC;;;;IAEH,qBACE,KAACC;QACCC,eAAY;QACZC,eAAY;QACZJ,WAAWH,GACT,yDACAE,UAAU,UAAU,kCACpBA,UAAU,WAAW,cACrBA,UAAU,YAAY,8BACtBC;OAEEC;AAGV;AAQA,+DAA+D,GAC/D,OAAO,SAASI,aAAa,EAAEC,QAAQ,CAAC,EAAEN,SAAS,EAAqB;IACtE,qBACE,KAACE;QAAIF,WAAWH,GAAG,yBAAyBG;kBACzCO,MAAMC,IAAI,CAAC;YAAEC,QAAQH;QAAM,GAAG,CAACI,GAAGC,sBACjC,KAACb;gBAECC,OAAM;gBACNC,WAAWW,UAAUL,QAAQ,IAAI,UAAU;eAFtCK;;AAOf"}
@@ -0,0 +1,2 @@
1
+ export * from './status-tag.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/status-tag/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './status-tag.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/status-tag/index.ts"],"sourcesContent":["export * from './status-tag.js';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB"}
@@ -0,0 +1,17 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { type Tone } from '../alert/tone.js';
3
+ export type StatusTagTone = Tone | 'neutral';
4
+ export interface StatusTagProps extends Omit<ComponentPropsWithoutRef<'span'>, 'children'> {
5
+ tone: StatusTagTone;
6
+ /** The status in words. Required and non-empty: colour is never the only carrier (WCAG 1.4.1). */
7
+ children: string;
8
+ /** A glyph before the words; decorative, so hidden from assistive technology. */
9
+ icon?: ReactNode;
10
+ }
11
+ /**
12
+ * A record's status as a small tag: a tone and the words for it. The words are
13
+ * mandatory, and an empty string throws rather than rendering a coloured dot
14
+ * that means something only to people who can see the colour. Server-safe.
15
+ */
16
+ export declare function StatusTag({ tone, icon, className, children, ...props }: StatusTagProps): import("react").JSX.Element;
17
+ //# sourceMappingURL=status-tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-tag.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/status-tag/status-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjE,OAAO,EAAE,KAAK,IAAI,EAAgB,MAAM,kBAAkB,CAAC;AAE3D,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC;AAO7C,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,wBAAwB,CAAC,MAAM,CAAC,EAChC,UAAU,CACX;IACC,IAAI,EAAE,aAAa,CAAC;IACpB,kGAAkG;IAClG,QAAQ,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,+BAoBhB"}
@@ -0,0 +1,37 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ import { cn } from '../../utils/cn.js';
5
+ import { TONE_SURFACE } from '../alert/tone.js';
6
+ const TONE_CLASS = _extends({}, TONE_SURFACE, {
7
+ neutral: 'border-border bg-surface text-content-muted'
8
+ });
9
+ /**
10
+ * A record's status as a small tag: a tone and the words for it. The words are
11
+ * mandatory, and an empty string throws rather than rendering a coloured dot
12
+ * that means something only to people who can see the colour. Server-safe.
13
+ */ export function StatusTag(_0) {
14
+ let { tone, icon, className, children } = _0, props = _object_without_properties_loose(_0, [
15
+ "tone",
16
+ "icon",
17
+ "className",
18
+ "children"
19
+ ]);
20
+ if (children.trim() === '') {
21
+ throw new Error('StatusTag needs its status in words: colour alone carries nothing for someone who cannot see it.');
22
+ }
23
+ return /*#__PURE__*/ _jsxs("span", _extends({
24
+ "data-tone": tone,
25
+ className: cn('inline-flex items-center gap-3xs rounded-full border px-2xs text-step-xs font-medium whitespace-nowrap', TONE_CLASS[tone], className)
26
+ }, props, {
27
+ children: [
28
+ icon !== undefined && /*#__PURE__*/ _jsx("span", {
29
+ "aria-hidden": "true",
30
+ children: icon
31
+ }),
32
+ children
33
+ ]
34
+ }));
35
+ }
36
+
37
+ //# sourceMappingURL=status-tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/status-tag/status-tag.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport { cn } from '../../utils/cn.js';\nimport { type Tone, TONE_SURFACE } from '../alert/tone.js';\n\nexport type StatusTagTone = Tone | 'neutral';\n\nconst TONE_CLASS: Record<StatusTagTone, string> = {\n ...TONE_SURFACE,\n neutral: 'border-border bg-surface text-content-muted',\n};\n\nexport interface StatusTagProps extends Omit<\n ComponentPropsWithoutRef<'span'>,\n 'children'\n> {\n tone: StatusTagTone;\n /** The status in words. Required and non-empty: colour is never the only carrier (WCAG 1.4.1). */\n children: string;\n /** A glyph before the words; decorative, so hidden from assistive technology. */\n icon?: ReactNode;\n}\n\n/**\n * A record's status as a small tag: a tone and the words for it. The words are\n * mandatory, and an empty string throws rather than rendering a coloured dot\n * that means something only to people who can see the colour. Server-safe.\n */\nexport function StatusTag({\n tone,\n icon,\n className,\n children,\n ...props\n}: StatusTagProps) {\n if (children.trim() === '') {\n throw new Error(\n 'StatusTag needs its status in words: colour alone carries nothing for someone who cannot see it.',\n );\n }\n return (\n <span\n data-tone={tone}\n className={cn(\n 'inline-flex items-center gap-3xs rounded-full border px-2xs text-step-xs font-medium whitespace-nowrap',\n TONE_CLASS[tone],\n className,\n )}\n {...props}\n >\n {icon !== undefined && <span aria-hidden=\"true\">{icon}</span>}\n {children}\n </span>\n );\n}\n"],"names":["cn","TONE_SURFACE","TONE_CLASS","neutral","StatusTag","tone","icon","className","children","props","trim","Error","span","data-tone","undefined","aria-hidden"],"mappings":";;;AAEA,SAASA,EAAE,QAAQ,oBAAoB;AACvC,SAAoBC,YAAY,QAAQ,mBAAmB;AAI3D,MAAMC,aAA4C,aAC7CD;IACHE,SAAS;;AAcX;;;;CAIC,GACD,OAAO,SAASC,UAAU,EAMT;QANS,EACxBC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,QAAQ,EAEO,OADZC;;;;;;IAEH,IAAID,SAASE,IAAI,OAAO,IAAI;QAC1B,MAAM,IAAIC,MACR;IAEJ;IACA,qBACE,MAACC;QACCC,aAAWR;QACXE,WAAWP,GACT,0GACAE,UAAU,CAACG,KAAK,EAChBE;OAEEE;;YAEHH,SAASQ,2BAAa,KAACF;gBAAKG,eAAY;0BAAQT;;YAChDE;;;AAGP"}
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/switch/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAejE;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC,GAAG;IACzE,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAgBA"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/switch/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAmBjE;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC,GAAG;IACzE,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAgBA"}
@@ -1,12 +1,15 @@
1
1
  import { _ as _extends } from "@swc/helpers/_/_extends";
2
2
  import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
- /** The label: the switch, then its text, on one line. */ const LABEL = 'inline-flex cursor-pointer items-center gap-3xs';
4
+ /** The label: the switch, then its text, on one line. */ const LABEL = 'inline-flex min-h-(--target-min) cursor-pointer items-center gap-3xs';
5
5
  /**
6
6
  * Off: an outlined track, its thumb muted at the start. On: filled with the
7
7
  * primary colour, its thumb the surface's, at the end.
8
- */ const TRACK = 'relative inline-flex h-[1.125rem] w-8 shrink-0 items-center rounded-full border border-content-muted bg-transparent transition-colors motion-reduce:transition-none peer-checked:border-primary peer-checked:bg-primary peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus-ring peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-checked:[&>span]:translate-x-[0.875rem] peer-checked:[&>span]:bg-surface';
9
- const THUMB = 'ml-[0.125rem] size-3 rounded-full bg-content-muted transition-[translate,background-color] motion-reduce:transition-none';
8
+ */ const TRACK = 'relative inline-flex h-4.5 w-8 shrink-0 items-center rounded-full border border-border-control bg-transparent transition-colors motion-reduce:transition-none peer-checked:border-primary peer-checked:bg-primary peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus-ring peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-checked:[&>span]:translate-x-3.5 peer-checked:[&>span]:bg-surface';
9
+ // Forced colours paint every background as Canvas, which would erase the
10
+ // thumb — the only thing that shows the switch's state there — so it takes
11
+ // the system's text colour instead.
12
+ const THUMB = 'ml-0.5 size-3 rounded-full bg-content-muted transition-[translate,background-color] motion-reduce:transition-none forced-colors:bg-[CanvasText]';
10
13
  /**
11
14
  * An on/off choice: a native checkbox announced as a switch, drawn as a track
12
15
  * and a thumb. The checkbox keeps the keyboard, the form and `onChange`; the
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ui/atoms/switch/switch.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\n/** The label: the switch, then its text, on one line. */\nconst LABEL = 'inline-flex cursor-pointer items-center gap-3xs';\n\n/**\n * Off: an outlined track, its thumb muted at the start. On: filled with the\n * primary colour, its thumb the surface's, at the end.\n */\nconst TRACK =\n 'relative inline-flex h-[1.125rem] w-8 shrink-0 items-center rounded-full border border-content-muted bg-transparent transition-colors motion-reduce:transition-none peer-checked:border-primary peer-checked:bg-primary peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus-ring peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-checked:[&>span]:translate-x-[0.875rem] peer-checked:[&>span]:bg-surface';\n\nconst THUMB =\n 'ml-[0.125rem] size-3 rounded-full bg-content-muted transition-[translate,background-color] motion-reduce:transition-none';\n\n/**\n * An on/off choice: a native checkbox announced as a switch, drawn as a track\n * and a thumb. The checkbox keeps the keyboard, the form and `onChange`; the\n * track only shows its state.\n */\nexport function Switch({\n children,\n className,\n ...input\n}: Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'role' | 'children'> & {\n children: ReactNode;\n}) {\n return (\n <label data-slot=\"switch\" className={className ?? LABEL}>\n <input\n {...input}\n type=\"checkbox\"\n role=\"switch\"\n data-slot=\"switch-input\"\n className=\"peer sr-only\"\n />\n <span data-slot=\"switch-track\" aria-hidden=\"true\" className={TRACK}>\n <span data-slot=\"switch-thumb\" className={THUMB} />\n </span>\n {children}\n </label>\n );\n}\n"],"names":["LABEL","TRACK","THUMB","Switch","children","className","input","label","data-slot","type","role","span","aria-hidden"],"mappings":";;;AAEA,uDAAuD,GACvD,MAAMA,QAAQ;AAEd;;;CAGC,GACD,MAAMC,QACJ;AAEF,MAAMC,QACJ;AAEF;;;;CAIC,GACD,OAAO,SAASC,OAAO,EAMtB;QANsB,EACrBC,QAAQ,EACRC,SAAS,EAIV,OAHIC;;;;IAIH,qBACE,MAACC;QAAMC,aAAU;QAASH,SAAS,EAAEA,oBAAAA,YAAaL;;0BAChD,KAACM,sBACKA;gBACJG,MAAK;gBACLC,MAAK;gBACLF,aAAU;gBACVH,WAAU;;0BAEZ,KAACM;gBAAKH,aAAU;gBAAeI,eAAY;gBAAOP,WAAWJ;0BAC3D,cAAA,KAACU;oBAAKH,aAAU;oBAAeH,WAAWH;;;YAE3CE;;;AAGP"}
1
+ {"version":3,"sources":["../../../../src/ui/atoms/switch/switch.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\n/** The label: the switch, then its text, on one line. */\nconst LABEL =\n 'inline-flex min-h-(--target-min) cursor-pointer items-center gap-3xs';\n\n/**\n * Off: an outlined track, its thumb muted at the start. On: filled with the\n * primary colour, its thumb the surface's, at the end.\n */\nconst TRACK =\n 'relative inline-flex h-4.5 w-8 shrink-0 items-center rounded-full border border-border-control bg-transparent transition-colors motion-reduce:transition-none peer-checked:border-primary peer-checked:bg-primary peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus-ring peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-checked:[&>span]:translate-x-3.5 peer-checked:[&>span]:bg-surface';\n\n// Forced colours paint every background as Canvas, which would erase the\n// thumb — the only thing that shows the switch's state there — so it takes\n// the system's text colour instead.\nconst THUMB =\n 'ml-0.5 size-3 rounded-full bg-content-muted transition-[translate,background-color] motion-reduce:transition-none forced-colors:bg-[CanvasText]';\n\n/**\n * An on/off choice: a native checkbox announced as a switch, drawn as a track\n * and a thumb. The checkbox keeps the keyboard, the form and `onChange`; the\n * track only shows its state.\n */\nexport function Switch({\n children,\n className,\n ...input\n}: Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'role' | 'children'> & {\n children: ReactNode;\n}) {\n return (\n <label data-slot=\"switch\" className={className ?? LABEL}>\n <input\n {...input}\n type=\"checkbox\"\n role=\"switch\"\n data-slot=\"switch-input\"\n className=\"peer sr-only\"\n />\n <span data-slot=\"switch-track\" aria-hidden=\"true\" className={TRACK}>\n <span data-slot=\"switch-thumb\" className={THUMB} />\n </span>\n {children}\n </label>\n );\n}\n"],"names":["LABEL","TRACK","THUMB","Switch","children","className","input","label","data-slot","type","role","span","aria-hidden"],"mappings":";;;AAEA,uDAAuD,GACvD,MAAMA,QACJ;AAEF;;;CAGC,GACD,MAAMC,QACJ;AAEF,yEAAyE;AACzE,2EAA2E;AAC3E,oCAAoC;AACpC,MAAMC,QACJ;AAEF;;;;CAIC,GACD,OAAO,SAASC,OAAO,EAMtB;QANsB,EACrBC,QAAQ,EACRC,SAAS,EAIV,OAHIC;;;;IAIH,qBACE,MAACC;QAAMC,aAAU;QAASH,SAAS,EAAEA,oBAAAA,YAAaL;;0BAChD,KAACM,sBACKA;gBACJG,MAAK;gBACLC,MAAK;gBACLF,aAAU;gBACVH,WAAU;;0BAEZ,KAACM;gBAAKH,aAAU;gBAAeI,eAAY;gBAAOP,WAAWJ;0BAC3D,cAAA,KAACU;oBAAKH,aAAU;oBAAeH,WAAWH;;;YAE3CE;;;AAGP"}
@@ -1,16 +1,25 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
2
2
  export interface TableProps extends ComponentPropsWithoutRef<'table'> {
3
3
  /** Class names for the scroll container wrapping the `<table>`. */
4
4
  containerClassName?: string;
5
+ /**
6
+ * What the table holds — "Clientes, 12 resultados". It names the table and,
7
+ * once the table overflows its container, the scroll region too.
8
+ */
9
+ caption?: ReactNode;
10
+ /** Class names for the caption; screen-reader only unless overridden. */
11
+ captionClassName?: string;
5
12
  }
6
13
  /**
7
14
  * Styled table primitive — no entity knowledge, no data fetching. `EntityTable`
8
15
  * composes these; anything rendering non-entity tabular data can use them too.
9
16
  *
10
17
  * Wide tables scroll inside their own container rather than pushing the page
11
- * sideways.
18
+ * sideways. A container that scrolls is a **focusable region** named by the
19
+ * caption, so a keyboard can scroll it — and one that fits is neither, so it
20
+ * adds no tab stop that does nothing.
12
21
  */
13
- export declare function Table({ className, containerClassName, ...props }: TableProps): import("react").JSX.Element;
22
+ export declare function Table({ className, containerClassName, caption, captionClassName, children, ...props }: TableProps): import("react").JSX.Element;
14
23
  export declare function TableHead({ className, ...props }: ComponentPropsWithoutRef<'thead'>): import("react").JSX.Element;
15
24
  export declare function TableBody({ className, ...props }: ComponentPropsWithoutRef<'tbody'>): import("react").JSX.Element;
16
25
  export declare function TableRow({ className, ...props }: ComponentPropsWithoutRef<'tr'>): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/table/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAItD,MAAM,WAAW,UAAW,SAAQ,wBAAwB,CAAC,OAAO,CAAC;IACnE,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BAiB5E;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAOnC;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAInC;AAED,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,IAAI,CAAC,+BAUhC;AAED,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAUxD,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAChD,wBAAwB,CAAC,IAAI,CAAC,EAC9B,OAAO,CACR;IACC,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,wBAAgB,eAAe,CAAC,EAC9B,KAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,+BAYtB;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,wBAAwB,CAAC,IAAI,CAAC,EAC9B,OAAO,CACR;IACC,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,+BAOhB;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,IAAI,CAAC,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,+BAatD"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/table/table.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,UAAW,SAAQ,wBAAwB,CAAC,OAAO,CAAC;IACnE,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAyBD;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,kBAAkB,EAClB,OAAO,EACP,gBAA4B,EAC5B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,UAAU,+BAoCZ;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAanC;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAInC;AAED,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,IAAI,CAAC,+BAUhC;AAED,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAUxD,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAChD,wBAAwB,CAAC,IAAI,CAAC,EAC9B,OAAO,CACR;IACC,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,wBAAgB,eAAe,CAAC,EAC9B,KAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,+BAYtB;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,wBAAwB,CAAC,IAAI,CAAC,EAC9B,OAAO,CACR;IACC,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,+BAOhB;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,IAAI,CAAC,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,+BAatD"}