@lerianstudio/sindarian-ui 2.0.0-beta.25 → 2.0.0-beta.26

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 (305) hide show
  1. package/dist/charts/chart.js +4 -231
  2. package/dist/charts/index.js +1 -11
  3. package/dist/components/breadcrumb/get-breadcrumb-paths.js +1 -18
  4. package/dist/components/breadcrumb/index.js +1 -37
  5. package/dist/components/card/account-card/index.js +1 -69
  6. package/dist/components/card/basic-card/index.js +1 -20
  7. package/dist/components/card/dashboard-card/index.js +1 -20
  8. package/dist/components/card/entity-card/index.js +1 -68
  9. package/dist/components/card/index.js +1 -20
  10. package/dist/components/dialog/confirmation-dialog/index.js +1 -96
  11. package/dist/components/dialog/confirmation-dialog/use-confirm-dialog.js +1 -55
  12. package/dist/components/dialog/index.js +1 -19
  13. package/dist/components/dialog/large-dialog/index.js +1 -21
  14. package/dist/components/entity-box/index.js +1 -67
  15. package/dist/components/entity-data-table/index.js +1 -20
  16. package/dist/components/form/combo-box-field/index.js +1 -35
  17. package/dist/components/form/country-field/index.js +1 -11
  18. package/dist/components/form/date-picker-field/index.js +1 -83
  19. package/dist/components/form/date-range-field/index.js +1 -58
  20. package/dist/components/form/date-time-picker-field/index.js +1 -114
  21. package/dist/components/form/file-upload-field/index.js +1 -69
  22. package/dist/components/form/index.js +1 -31
  23. package/dist/components/form/input-field/index.js +1 -96
  24. package/dist/components/form/otp-field/index.js +1 -19
  25. package/dist/components/form/pagination-limit-field/index.js +1 -10
  26. package/dist/components/form/password-field/index.js +1 -16
  27. package/dist/components/form/radio-group-field/index.js +1 -36
  28. package/dist/components/form/renderable-label.js +1 -57
  29. package/dist/components/form/select-field/index.js +1 -68
  30. package/dist/components/form/state-field/index.js +1 -42
  31. package/dist/components/form/switch-field/index.js +1 -16
  32. package/dist/components/form/textarea-field/index.js +1 -23
  33. package/dist/components/page/index.js +1 -20
  34. package/dist/components/page-header/index.js +1 -80
  35. package/dist/components/pagination/index.js +1 -10
  36. package/dist/components/table/id-table-cell.js +1 -109
  37. package/dist/components/table/index.js +1 -19
  38. package/dist/components/table/locked-table-actions.js +1 -41
  39. package/dist/components/table/name-table-cell.js +1 -58
  40. package/dist/components/ui/accordion/index.js +1 -62
  41. package/dist/components/ui/alert/index.js +1 -45
  42. package/dist/components/ui/alert-dialog/index.js +1 -84
  43. package/dist/components/ui/autocomplete/index.js +1 -440
  44. package/dist/components/ui/autosize-textarea/index.js +1 -89
  45. package/dist/components/ui/avatar/index.js +1 -51
  46. package/dist/components/ui/badge/index.js +1 -83
  47. package/dist/components/ui/breadcrumb/index.js +1 -35
  48. package/dist/components/ui/button/index.js +1 -65
  49. package/dist/components/ui/calendar/index.js +1 -118
  50. package/dist/components/ui/card/index.js +1 -32
  51. package/dist/components/ui/checkbox/index.js +1 -44
  52. package/dist/components/ui/collapsible/index.js +1 -50
  53. package/dist/components/ui/command/index.js +1 -95
  54. package/dist/components/ui/copy-field/index.js +1 -163
  55. package/dist/components/ui/dialog/index.js +1 -80
  56. package/dist/components/ui/dropdown-menu/index.js +1 -110
  57. package/dist/components/ui/field/index.js +1 -82
  58. package/dist/components/ui/file-upload/index.js +1 -574
  59. package/dist/components/ui/form.js +1 -162
  60. package/dist/components/ui/hover-card/index.js +1 -51
  61. package/dist/components/ui/icon-button/index.js +1 -35
  62. package/dist/components/ui/input/adornment.js +1 -21
  63. package/dist/components/ui/input/index.js +1 -99
  64. package/dist/components/ui/label/index.js +1 -45
  65. package/dist/components/ui/lerian-wordmark/index.js +1 -7
  66. package/dist/components/ui/loading-button/index.js +1 -9
  67. package/dist/components/ui/multiple-select/index.js +1 -235
  68. package/dist/components/ui/otp-input/index.js +1 -62
  69. package/dist/components/ui/paper/index.js +1 -8
  70. package/dist/components/ui/paper-collapsible/index.js +1 -24
  71. package/dist/components/ui/popover/index.js +1 -55
  72. package/dist/components/ui/progress/index.js +1 -66
  73. package/dist/components/ui/qr-code/index.js +1 -27
  74. package/dist/components/ui/radio-group/index.js +1 -48
  75. package/dist/components/ui/scroll-area/index.js +1 -49
  76. package/dist/components/ui/select/index.js +1 -119
  77. package/dist/components/ui/separator/index.js +1 -43
  78. package/dist/components/ui/sheet/index.js +1 -136
  79. package/dist/components/ui/sidebar/index.js +1 -27
  80. package/dist/components/ui/sidebar/next-router.cjs +1 -119
  81. package/dist/components/ui/sidebar/sidebar-back-button.js +1 -8
  82. package/dist/components/ui/sidebar/sidebar-components.js +1 -23
  83. package/dist/components/ui/sidebar/sidebar-expand-button.js +1 -49
  84. package/dist/components/ui/sidebar/sidebar-item-button.js +1 -21
  85. package/dist/components/ui/sidebar/sidebar-item-collapsible.js +1 -52
  86. package/dist/components/ui/sidebar/sidebar-item-icon-button.js +1 -18
  87. package/dist/components/ui/sidebar/sidebar-item.js +1 -44
  88. package/dist/components/ui/sidebar/sidebar-provider.js +1 -201
  89. package/dist/components/ui/sidebar/sidebar-root.js +1 -130
  90. package/dist/components/ui/sidebar/sidebar-router.js +1 -126
  91. package/dist/components/ui/sidebar/sidebar-trigger.js +1 -57
  92. package/dist/components/ui/skeleton/index.js +1 -8
  93. package/dist/components/ui/stepper/index.js +1 -29
  94. package/dist/components/ui/switch/index.js +1 -43
  95. package/dist/components/ui/table/index.js +1 -56
  96. package/dist/components/ui/tabs/index.js +1 -55
  97. package/dist/components/ui/textarea/index.js +1 -8
  98. package/dist/components/ui/time-picker/index.js +1 -85
  99. package/dist/components/ui/toast/index.js +1 -3
  100. package/dist/components/ui/toast/toaster.js +1 -16
  101. package/dist/components/ui/toggle-group/index.js +1 -156
  102. package/dist/components/ui/tooltip/index.js +1 -81
  103. package/dist/domain/blotter/index.js +1 -20
  104. package/dist/domain/delinquency-aging/aging-buckets.js +1 -120
  105. package/dist/domain/delinquency-aging/index.js +1 -222
  106. package/dist/domain/figure/index.js +1 -19
  107. package/dist/domain/format.js +1 -137
  108. package/dist/domain/index.js +1 -43
  109. package/dist/domain/key-id/index.js +1 -174
  110. package/dist/domain/ledger-sheet/index.js +1 -28
  111. package/dist/domain/money-diff.js +1 -48
  112. package/dist/domain/money-math.js +1 -104
  113. package/dist/domain/money-text/index.js +1 -123
  114. package/dist/domain/section-label/index.js +1 -17
  115. package/dist/domain/status-rail/index.js +1 -76
  116. package/dist/domain/threshold-gauge/index.js +1 -161
  117. package/dist/enterprise/alert-banner/index.js +1 -24
  118. package/dist/enterprise/app-shell/index.js +1 -87
  119. package/dist/enterprise/cursor-pager/index.js +1 -26
  120. package/dist/enterprise/data-table/column-size.js +1 -103
  121. package/dist/enterprise/data-table/index.js +1 -345
  122. package/dist/enterprise/date-range-picker/index.js +1 -115
  123. package/dist/enterprise/detail-panel/index.js +1 -20
  124. package/dist/enterprise/empty-state/index.js +1 -14
  125. package/dist/enterprise/index.js +1 -39
  126. package/dist/enterprise/number-input/index.js +1 -252
  127. package/dist/enterprise/search-input/index.js +1 -121
  128. package/dist/enterprise/stat-card/index.js +1 -75
  129. package/dist/enterprise/status-badge/index.js +1 -120
  130. package/dist/enterprise/use-is-mobile.js +1 -68
  131. package/dist/enterprise/virtualized-table/index.js +1 -141
  132. package/dist/esm/charts/chart.js +4 -190
  133. package/dist/esm/charts/index.js +1 -3
  134. package/dist/esm/components/breadcrumb/get-breadcrumb-paths.js +1 -12
  135. package/dist/esm/components/breadcrumb/index.js +1 -30
  136. package/dist/esm/components/card/account-card/index.js +1 -53
  137. package/dist/esm/components/card/basic-card/index.js +1 -14
  138. package/dist/esm/components/card/dashboard-card/index.js +1 -14
  139. package/dist/esm/components/card/entity-card/index.js +1 -52
  140. package/dist/esm/components/card/index.js +1 -4
  141. package/dist/esm/components/dialog/confirmation-dialog/index.js +1 -60
  142. package/dist/esm/components/dialog/confirmation-dialog/use-confirm-dialog.js +1 -49
  143. package/dist/esm/components/dialog/index.js +1 -3
  144. package/dist/esm/components/dialog/large-dialog/index.js +1 -16
  145. package/dist/esm/components/entity-box/index.js +1 -56
  146. package/dist/esm/components/entity-data-table/index.js +1 -17
  147. package/dist/esm/components/form/combo-box-field/index.js +1 -28
  148. package/dist/esm/components/form/country-field/index.js +1 -7
  149. package/dist/esm/components/form/date-picker-field/index.js +1 -43
  150. package/dist/esm/components/form/date-range-field/index.js +1 -18
  151. package/dist/esm/components/form/date-time-picker-field/index.js +1 -74
  152. package/dist/esm/components/form/file-upload-field/index.js +1 -65
  153. package/dist/esm/components/form/index.js +1 -15
  154. package/dist/esm/components/form/input-field/index.js +1 -92
  155. package/dist/esm/components/form/otp-field/index.js +1 -15
  156. package/dist/esm/components/form/pagination-limit-field/index.js +1 -6
  157. package/dist/esm/components/form/password-field/index.js +1 -10
  158. package/dist/esm/components/form/radio-group-field/index.js +1 -32
  159. package/dist/esm/components/form/renderable-label.js +1 -54
  160. package/dist/esm/components/form/select-field/index.js +1 -64
  161. package/dist/esm/components/form/state-field/index.js +1 -35
  162. package/dist/esm/components/form/switch-field/index.js +1 -12
  163. package/dist/esm/components/form/textarea-field/index.js +1 -19
  164. package/dist/esm/components/page/index.js +1 -15
  165. package/dist/esm/components/page-header/index.js +1 -71
  166. package/dist/esm/components/pagination/index.js +1 -6
  167. package/dist/esm/components/table/id-table-cell.js +1 -105
  168. package/dist/esm/components/table/index.js +1 -3
  169. package/dist/esm/components/table/locked-table-actions.js +1 -37
  170. package/dist/esm/components/table/name-table-cell.js +1 -54
  171. package/dist/esm/components/ui/accordion/index.js +1 -24
  172. package/dist/esm/components/ui/alert/index.js +1 -38
  173. package/dist/esm/components/ui/alert-dialog/index.js +1 -39
  174. package/dist/esm/components/ui/autocomplete/index.js +1 -392
  175. package/dist/esm/components/ui/autosize-textarea/index.js +1 -51
  176. package/dist/esm/components/ui/avatar/index.js +1 -14
  177. package/dist/esm/components/ui/badge/index.js +1 -79
  178. package/dist/esm/components/ui/breadcrumb/index.js +1 -27
  179. package/dist/esm/components/ui/button/index.js +1 -60
  180. package/dist/esm/components/ui/calendar/index.js +1 -82
  181. package/dist/esm/components/ui/card/index.js +1 -24
  182. package/dist/esm/components/ui/checkbox/index.js +1 -9
  183. package/dist/esm/components/ui/collapsible/index.js +1 -13
  184. package/dist/esm/components/ui/command/index.js +1 -51
  185. package/dist/esm/components/ui/copy-field/index.js +1 -127
  186. package/dist/esm/components/ui/dialog/index.js +1 -36
  187. package/dist/esm/components/ui/dropdown-menu/index.js +1 -60
  188. package/dist/esm/components/ui/field/index.js +1 -71
  189. package/dist/esm/components/ui/file-upload/index.js +1 -536
  190. package/dist/esm/components/ui/form.js +1 -118
  191. package/dist/esm/components/ui/hover-card/index.js +1 -14
  192. package/dist/esm/components/ui/icon-button/index.js +1 -31
  193. package/dist/esm/components/ui/input/adornment.js +1 -17
  194. package/dist/esm/components/ui/input/index.js +1 -60
  195. package/dist/esm/components/ui/label/index.js +1 -10
  196. package/dist/esm/components/ui/lerian-wordmark/index.js +1 -4
  197. package/dist/esm/components/ui/loading-button/index.js +1 -7
  198. package/dist/esm/components/ui/multiple-select/index.js +1 -196
  199. package/dist/esm/components/ui/otp-input/index.js +1 -21
  200. package/dist/esm/components/ui/paper/index.js +1 -5
  201. package/dist/esm/components/ui/paper-collapsible/index.js +1 -19
  202. package/dist/esm/components/ui/popover/index.js +1 -17
  203. package/dist/esm/components/ui/progress/index.js +1 -31
  204. package/dist/esm/components/ui/qr-code/index.js +1 -24
  205. package/dist/esm/components/ui/radio-group/index.js +1 -12
  206. package/dist/esm/components/ui/scroll-area/index.js +1 -13
  207. package/dist/esm/components/ui/select/index.js +1 -74
  208. package/dist/esm/components/ui/separator/index.js +1 -8
  209. package/dist/esm/components/ui/sheet/index.js +1 -92
  210. package/dist/esm/components/ui/sidebar/index.js +1 -11
  211. package/dist/esm/components/ui/sidebar/next-router.cjs +1 -119
  212. package/dist/esm/components/ui/sidebar/sidebar-back-button.js +1 -5
  213. package/dist/esm/components/ui/sidebar/sidebar-components.js +1 -15
  214. package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +1 -42
  215. package/dist/esm/components/ui/sidebar/sidebar-item-button.js +1 -18
  216. package/dist/esm/components/ui/sidebar/sidebar-item-collapsible.js +1 -44
  217. package/dist/esm/components/ui/sidebar/sidebar-item-icon-button.js +1 -14
  218. package/dist/esm/components/ui/sidebar/sidebar-item.js +1 -40
  219. package/dist/esm/components/ui/sidebar/sidebar-provider.js +1 -193
  220. package/dist/esm/components/ui/sidebar/sidebar-root.js +1 -126
  221. package/dist/esm/components/ui/sidebar/sidebar-router.js +1 -89
  222. package/dist/esm/components/ui/sidebar/sidebar-trigger.js +1 -53
  223. package/dist/esm/components/ui/skeleton/index.js +1 -6
  224. package/dist/esm/components/ui/stepper/index.js +1 -20
  225. package/dist/esm/components/ui/switch/index.js +1 -8
  226. package/dist/esm/components/ui/table/index.js +1 -44
  227. package/dist/esm/components/ui/tabs/index.js +1 -17
  228. package/dist/esm/components/ui/textarea/index.js +1 -6
  229. package/dist/esm/components/ui/time-picker/index.js +1 -49
  230. package/dist/esm/components/ui/toast/index.js +1 -2
  231. package/dist/esm/components/ui/toast/toaster.js +1 -13
  232. package/dist/esm/components/ui/toggle-group/index.js +1 -120
  233. package/dist/esm/components/ui/tooltip/index.js +1 -43
  234. package/dist/esm/domain/blotter/index.js +1 -16
  235. package/dist/esm/domain/delinquency-aging/aging-buckets.js +1 -115
  236. package/dist/esm/domain/delinquency-aging/index.js +1 -218
  237. package/dist/esm/domain/figure/index.js +1 -15
  238. package/dist/esm/domain/format.js +1 -128
  239. package/dist/esm/domain/index.js +1 -19
  240. package/dist/esm/domain/key-id/index.js +1 -169
  241. package/dist/esm/domain/ledger-sheet/index.js +1 -24
  242. package/dist/esm/domain/money-diff.js +1 -45
  243. package/dist/esm/domain/money-math.js +1 -98
  244. package/dist/esm/domain/money-text/index.js +1 -118
  245. package/dist/esm/domain/section-label/index.js +1 -14
  246. package/dist/esm/domain/status-rail/index.js +1 -71
  247. package/dist/esm/domain/threshold-gauge/index.js +1 -157
  248. package/dist/esm/enterprise/alert-banner/index.js +1 -21
  249. package/dist/esm/enterprise/app-shell/index.js +1 -51
  250. package/dist/esm/enterprise/cursor-pager/index.js +1 -23
  251. package/dist/esm/enterprise/data-table/column-size.js +1 -97
  252. package/dist/esm/enterprise/data-table/index.js +1 -342
  253. package/dist/esm/enterprise/date-range-picker/index.js +1 -112
  254. package/dist/esm/enterprise/detail-panel/index.js +1 -17
  255. package/dist/esm/enterprise/empty-state/index.js +1 -11
  256. package/dist/esm/enterprise/index.js +1 -22
  257. package/dist/esm/enterprise/number-input/index.js +1 -214
  258. package/dist/esm/enterprise/search-input/index.js +1 -85
  259. package/dist/esm/enterprise/stat-card/index.js +1 -72
  260. package/dist/esm/enterprise/status-badge/index.js +1 -116
  261. package/dist/esm/enterprise/use-is-mobile.js +1 -31
  262. package/dist/esm/enterprise/virtualized-table/index.js +1 -138
  263. package/dist/esm/hooks/use-click-away.js +1 -22
  264. package/dist/esm/hooks/use-pagination.js +1 -38
  265. package/dist/esm/hooks/use-stepper.js +1 -22
  266. package/dist/esm/hooks/use-time.js +1 -13
  267. package/dist/esm/hooks/use-toast.js +1 -107
  268. package/dist/esm/index.js +1 -77
  269. package/dist/esm/lib/storage/get-storage-object.js +1 -17
  270. package/dist/esm/lib/storage/get-storage.js +1 -14
  271. package/dist/esm/lib/storage/index.js +1 -2
  272. package/dist/esm/lib/typography.js +1 -31
  273. package/dist/esm/lib/utils.js +1 -41
  274. package/dist/esm/theme/get-theme-script.js +1 -41
  275. package/dist/esm/theme/index.js +1 -4
  276. package/dist/esm/theme/mode-toggle.js +1 -45
  277. package/dist/esm/theme/theme-provider.js +1 -122
  278. package/dist/esm/toast/helpers.js +1 -36
  279. package/dist/esm/toast/index.js +1 -4
  280. package/dist/esm/types/metadata-type.js +1 -1
  281. package/dist/esm/utils/countries.cjs +1 -17
  282. package/dist/esm/utils/country-utils.js +1 -18
  283. package/dist/esm/utils/currency-codes.js +1 -181
  284. package/dist/hooks/use-click-away.js +1 -29
  285. package/dist/hooks/use-pagination.js +1 -41
  286. package/dist/hooks/use-stepper.js +1 -26
  287. package/dist/hooks/use-time.js +1 -20
  288. package/dist/hooks/use-toast.js +1 -111
  289. package/dist/index.js +1 -96
  290. package/dist/lib/storage/get-storage-object.js +1 -23
  291. package/dist/lib/storage/get-storage.js +1 -17
  292. package/dist/lib/storage/index.js +1 -18
  293. package/dist/lib/typography.js +1 -34
  294. package/dist/lib/utils.js +1 -45
  295. package/dist/theme/get-theme-script.js +1 -44
  296. package/dist/theme/index.js +1 -11
  297. package/dist/theme/mode-toggle.js +1 -48
  298. package/dist/theme/theme-provider.js +1 -160
  299. package/dist/toast/helpers.js +1 -41
  300. package/dist/toast/index.js +1 -10
  301. package/dist/types/metadata-type.js +1 -2
  302. package/dist/utils/countries.cjs +1 -17
  303. package/dist/utils/country-utils.js +1 -25
  304. package/dist/utils/currency-codes.js +1 -184
  305. package/package.json +4 -3
@@ -1,42 +1 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.StateField = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = __importDefault(require("react"));
9
- const country_utils_1 = require("../../../utils/country-utils");
10
- const react_hook_form_1 = require("react-hook-form");
11
- const form_1 = require("../../../components/ui/form");
12
- const button_1 = require("../../../components/ui/button");
13
- const utils_1 = require("../../../lib/utils");
14
- const popover_1 = require("../../../components/ui/popover");
15
- const lucide_react_1 = require("lucide-react");
16
- const command_1 = require("../../../components/ui/command");
17
- function StateComboBox({ value, placeholder, onChange, countryName, emptyMessage, readOnly }) {
18
- const [open, setOpen] = react_1.default.useState(false);
19
- const form = (0, react_hook_form_1.useFormContext)();
20
- const country = form.watch(countryName);
21
- const options = react_1.default.useMemo(() => {
22
- const states = (0, country_utils_1.getStateCountry)(country)?.map((state) => ({
23
- value: state.code,
24
- label: state.name
25
- }));
26
- if (!states) {
27
- onChange?.('');
28
- }
29
- return states ?? [];
30
- }, [country, onChange]);
31
- const getDisplayValue = react_1.default.useCallback((value) => {
32
- return options.find((option) => option.value === value)?.label ?? null;
33
- }, [options]);
34
- return ((0, jsx_runtime_1.jsxs)(popover_1.Popover, { open: readOnly ? false : open, onOpenChange: readOnly ? () => { } : setOpen, children: [(0, jsx_runtime_1.jsx)(popover_1.PopoverTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", role: "combobox", "aria-expanded": readOnly ? false : open, readOnly: readOnly, tabIndex: 0, className: (0, utils_1.cn)('border-input-border bg-input hover:bg-input text-foreground h-10 w-full justify-between rounded-md border px-4 py-2 pl-6 text-left text-base font-normal focus:ring-2 focus:ring-offset-0 focus:outline-none', !value && 'text-muted-foreground'), children: [getDisplayValue(value) ?? placeholder, !readOnly && ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" }))] }) }), (0, jsx_runtime_1.jsx)(popover_1.PopoverContent, { className: "w-(--radix-popover-trigger-width) p-0", children: (0, jsx_runtime_1.jsxs)(command_1.Command, { children: [(0, jsx_runtime_1.jsx)(command_1.CommandInput, { placeholder: placeholder }), (0, jsx_runtime_1.jsxs)(command_1.CommandList, { children: [(0, jsx_runtime_1.jsx)(command_1.CommandEmpty, { children: emptyMessage }), (0, jsx_runtime_1.jsx)(command_1.CommandGroup, { children: options.map((option) => ((0, jsx_runtime_1.jsx)(command_1.CommandItem, { value: option.value, keywords: [option.label], onSelect: (currentValue) => {
35
- onChange?.(value !== currentValue ? currentValue : '');
36
- setOpen(false);
37
- }, children: option.label }, option.value))) })] })] }) })] }));
38
- }
39
- const StateField = ({ countryName = 'address.country', label, placeholder, emptyMessage, required, readOnly, ...others }) => {
40
- return ((0, jsx_runtime_1.jsx)(form_1.FormField, { ...others, name: others.name, render: ({ field }) => ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [label && (0, jsx_runtime_1.jsx)(form_1.FormLabel, { children: label }), (0, jsx_runtime_1.jsx)(StateComboBox, { countryName: countryName, placeholder: placeholder, emptyMessage: emptyMessage, readOnly: readOnly, ...field }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {})] })) }));
41
- };
42
- exports.StateField = StateField;
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(exports,"__esModule",{value:true});exports.StateField=void 0;const jsx_runtime_1=require("react/jsx-runtime");const react_1=__importDefault(require("react"));const country_utils_1=require("../../../utils/country-utils");const react_hook_form_1=require("react-hook-form");const form_1=require("../../../components/ui/form");const button_1=require("../../../components/ui/button");const utils_1=require("../../../lib/utils");const popover_1=require("../../../components/ui/popover");const lucide_react_1=require("lucide-react");const command_1=require("../../../components/ui/command");function StateComboBox({value:e,placeholder:n,onChange:s,countryName:i,emptyMessage:c,readOnly:r}){const[u,a]=react_1.default.useState(false);const m=(0,react_hook_form_1.useFormContext)();const d=m.watch(i);const l=react_1.default.useMemo(()=>{const t=(0,country_utils_1.getStateCountry)(d)?.map(o=>({value:o.code,label:o.name}));if(!t){s?.("")}return t??[]},[d,s]);const p=react_1.default.useCallback(t=>{return l.find(o=>o.value===t)?.label??null},[l]);return(0,jsx_runtime_1.jsxs)(popover_1.Popover,{open:r?false:u,onOpenChange:r?()=>{}:a,children:[(0,jsx_runtime_1.jsx)(popover_1.PopoverTrigger,{asChild:true,children:(0,jsx_runtime_1.jsxs)(button_1.Button,{variant:"outline",role:"combobox","aria-expanded":r?false:u,readOnly:r,tabIndex:0,className:(0,utils_1.cn)("border-input-border bg-input hover:bg-input text-foreground h-10 w-full justify-between rounded-md border px-4 py-2 pl-6 text-left text-base font-normal focus:ring-2 focus:ring-offset-0 focus:outline-none",!e&&"text-muted-foreground"),children:[p(e)??n,!r&&(0,jsx_runtime_1.jsx)(lucide_react_1.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,jsx_runtime_1.jsx)(popover_1.PopoverContent,{className:"w-(--radix-popover-trigger-width) p-0",children:(0,jsx_runtime_1.jsxs)(command_1.Command,{children:[(0,jsx_runtime_1.jsx)(command_1.CommandInput,{placeholder:n}),(0,jsx_runtime_1.jsxs)(command_1.CommandList,{children:[(0,jsx_runtime_1.jsx)(command_1.CommandEmpty,{children:c}),(0,jsx_runtime_1.jsx)(command_1.CommandGroup,{children:l.map(t=>(0,jsx_runtime_1.jsx)(command_1.CommandItem,{value:t.value,keywords:[t.label],onSelect:o=>{s?.(e!==o?o:"");a(false)},children:t.label},t.value))})]})]})})]})}const StateField=({countryName:e="address.country",label:n,placeholder:s,emptyMessage:i,required:c,readOnly:r,...u})=>{return(0,jsx_runtime_1.jsx)(form_1.FormField,{...u,name:u.name,render:({field:a})=>(0,jsx_runtime_1.jsxs)(form_1.FormItem,{required:c,children:[n&&(0,jsx_runtime_1.jsx)(form_1.FormLabel,{children:n}),(0,jsx_runtime_1.jsx)(StateComboBox,{countryName:e,placeholder:s,emptyMessage:i,readOnly:r,...a}),(0,jsx_runtime_1.jsx)(form_1.FormMessage,{})]})})};exports.StateField=StateField;
@@ -1,16 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwitchField = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const form_1 = require("../../../components/ui/form");
6
- const switch_1 = require("../../../components/ui/switch");
7
- const tooltip_1 = require("../../../components/ui/tooltip");
8
- const SwitchField = ({ label, name, control, labelExtra, tooltip, required, disabled, disabledTooltip, 'data-testid': dataTestId }) => {
9
- return ((0, jsx_runtime_1.jsx)(form_1.FormField, { name: name, control: control, render: ({ field }) => {
10
- // FormControl stamps the id the label points at on its direct child,
11
- // so it must wrap the Switch itself, never the tooltip around it.
12
- const control = ((0, jsx_runtime_1.jsx)(form_1.FormControl, { children: (0, jsx_runtime_1.jsx)(switch_1.Switch, { checked: field.value, onCheckedChange: field.onChange, disabled: disabled, "data-testid": dataTestId }) }));
13
- return ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [label && ((0, jsx_runtime_1.jsx)(form_1.FormLabel, { extra: tooltip ? (0, jsx_runtime_1.jsx)(form_1.FormTooltip, { children: tooltip }) : labelExtra, children: label })), (0, jsx_runtime_1.jsx)("div", { className: "relative", children: disabled && disabledTooltip ? ((0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)("div", { className: "inline-flex w-auto", children: control }) }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { children: disabledTooltip })] })) : (control) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {})] }));
14
- } }));
15
- };
16
- exports.SwitchField = SwitchField;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SwitchField=void 0;const jsx_runtime_1=require("react/jsx-runtime");const form_1=require("../../../components/ui/form");const switch_1=require("../../../components/ui/switch");const tooltip_1=require("../../../components/ui/tooltip");const SwitchField=({label:e,name:n,control:c,labelExtra:l,tooltip:r,required:d,disabled:t,disabledTooltip:o,"data-testid":h})=>{return(0,jsx_runtime_1.jsx)(form_1.FormField,{name:n,control:c,render:({field:i})=>{const s=(0,jsx_runtime_1.jsx)(form_1.FormControl,{children:(0,jsx_runtime_1.jsx)(switch_1.Switch,{checked:i.value,onCheckedChange:i.onChange,disabled:t,"data-testid":h})});return(0,jsx_runtime_1.jsxs)(form_1.FormItem,{required:d,children:[e&&(0,jsx_runtime_1.jsx)(form_1.FormLabel,{extra:r?(0,jsx_runtime_1.jsx)(form_1.FormTooltip,{children:r}):l,children:e}),(0,jsx_runtime_1.jsx)("div",{className:"relative",children:t&&o?(0,jsx_runtime_1.jsxs)(tooltip_1.Tooltip,{children:[(0,jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger,{asChild:true,children:(0,jsx_runtime_1.jsx)("div",{className:"inline-flex w-auto",children:s})}),(0,jsx_runtime_1.jsx)(tooltip_1.TooltipContent,{children:o})]}):s}),(0,jsx_runtime_1.jsx)(form_1.FormMessage,{})]})}})};exports.SwitchField=SwitchField;
@@ -1,23 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextareaField = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const form_1 = require("../../../components/ui/form");
6
- const textarea_1 = require("../../../components/ui/textarea");
7
- const renderable_label_1 = require("../../../components/form/renderable-label");
8
- const TextareaField = ({ control, name, label, description, placeholder, tooltip, required, disabled, readOnly, rows, className, 'data-testid': dataTestId, 'aria-label': ariaLabelProp }) => {
9
- const showLabel = (0, renderable_label_1.hasRenderableLabel)(label);
10
- // An empty or whitespace-only aria-label is worse than none: it names the
11
- // control "". Drop it so the attribute never reaches the DOM.
12
- const ariaLabel = ariaLabelProp?.trim() ? ariaLabelProp : undefined;
13
- // The type cannot rule out `label=""`, so this is the only signal a developer
14
- // gets that the control shipped nameless.
15
- if (process.env.NODE_ENV !== 'production' && !showLabel && !ariaLabel) {
16
- console.error(`TextareaField "${name}" has no accessible name: pass a non-empty label or aria-label.`);
17
- }
18
- return ((0, jsx_runtime_1.jsx)(form_1.FormField, { control: control, name: name,
19
- // Controller-level, not just on the element: this is what keeps a
20
- // disabled field out of the submitted values.
21
- disabled: disabled, render: ({ field }) => ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [showLabel && ((0, jsx_runtime_1.jsx)(form_1.FormLabel, { extra: tooltip ? (0, jsx_runtime_1.jsx)(form_1.FormTooltip, { children: tooltip }) : undefined, children: label })), (0, jsx_runtime_1.jsx)(form_1.FormControl, { children: (0, jsx_runtime_1.jsx)(textarea_1.Textarea, { placeholder: placeholder, readOnly: readOnly, rows: rows, className: className, "data-testid": dataTestId, "aria-label": ariaLabel, ...field }) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {}), description && (0, jsx_runtime_1.jsx)(form_1.FormDescription, { children: description })] })) }));
22
- };
23
- exports.TextareaField = TextareaField;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.TextareaField=void 0;const jsx_runtime_1=require("react/jsx-runtime");const form_1=require("../../../components/ui/form");const textarea_1=require("../../../components/ui/textarea");const renderable_label_1=require("../../../components/form/renderable-label");const TextareaField=({control:l,name:e,label:r,description:a,placeholder:i,tooltip:s,required:d,disabled:c,readOnly:x,rows:m,className:u,"data-testid":b,"aria-label":o})=>{const t=(0,renderable_label_1.hasRenderableLabel)(r);const n=o?.trim()?o:void 0;if(process.env.NODE_ENV!=="production"&&!t&&!n){console.error(`TextareaField "${e}" has no accessible name: pass a non-empty label or aria-label.`)}return(0,jsx_runtime_1.jsx)(form_1.FormField,{control:l,name:e,disabled:c,render:({field:F})=>(0,jsx_runtime_1.jsxs)(form_1.FormItem,{required:d,children:[t&&(0,jsx_runtime_1.jsx)(form_1.FormLabel,{extra:s?(0,jsx_runtime_1.jsx)(form_1.FormTooltip,{children:s}):void 0,children:r}),(0,jsx_runtime_1.jsx)(form_1.FormControl,{children:(0,jsx_runtime_1.jsx)(textarea_1.Textarea,{placeholder:i,readOnly:x,rows:m,className:u,"data-testid":b,"aria-label":n,...F})}),(0,jsx_runtime_1.jsx)(form_1.FormMessage,{}),a&&(0,jsx_runtime_1.jsx)(form_1.FormDescription,{children:a})]})})};exports.TextareaField=TextareaField;
@@ -1,20 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageRoot = PageRoot;
4
- exports.PageView = PageView;
5
- exports.PageContent = PageContent;
6
- const jsx_runtime_1 = require("react/jsx-runtime");
7
- const utils_1 = require("../../lib/utils");
8
- function PageRoot({ className, ...props }) {
9
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-root", className: (0, utils_1.cn)('text-foreground bg-body-surface flex h-screen min-h-screen w-full flex-col overflow-y-auto', className), ...props }));
10
- }
11
- function PageView({ className, ...props }) {
12
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-view", className: (0, utils_1.cn)('flex min-h-0 flex-1', className), ...props }));
13
- }
14
- function PageContent({ className, padding = 'default', ...props }) {
15
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-content",
16
- // Order is the contract, not a style: `className` last is what lets a
17
- // caller's `p-0` beat `p-16` and a caller's `max-sm:p-0` replace the
18
- // compact rule instead of stacking with it.
19
- className: (0, utils_1.cn)('flex grow flex-col overflow-y-auto p-16', padding === 'compact' && 'max-sm:p-4', className), ...props }));
20
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.PageRoot=PageRoot;exports.PageView=PageView;exports.PageContent=PageContent;const jsx_runtime_1=require("react/jsx-runtime");const utils_1=require("../../lib/utils");function PageRoot({className:e,...t}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"page-root",className:(0,utils_1.cn)("text-foreground bg-body-surface flex h-screen min-h-screen w-full flex-col overflow-y-auto",e),...t})}function PageView({className:e,...t}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"page-view",className:(0,utils_1.cn)("flex min-h-0 flex-1",e),...t})}function PageContent({className:e,padding:t="default",...o}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"page-content",className:(0,utils_1.cn)("flex grow flex-col overflow-y-auto p-16",t==="compact"&&"max-sm:p-4",e),...o})}
@@ -1,80 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageHeaderActionButtons = PageHeaderActionButtons;
4
- exports.PageHeaderWrapper = PageHeaderWrapper;
5
- exports.PageHeader = PageHeader;
6
- exports.PageHeaderInfoTitle = PageHeaderInfoTitle;
7
- exports.PageHeaderInfoTooltip = PageHeaderInfoTooltip;
8
- exports.PageHeaderCollapsibleInfoTrigger = PageHeaderCollapsibleInfoTrigger;
9
- exports.PageHeaderCollapsibleInfo = PageHeaderCollapsibleInfo;
10
- const jsx_runtime_1 = require("react/jsx-runtime");
11
- const utils_1 = require("../../lib/utils");
12
- const react_1 = require("react");
13
- const collapsible_1 = require("../../components/ui/collapsible");
14
- const button_1 = require("../ui/button");
15
- const lucide_react_1 = require("lucide-react");
16
- const tooltip_1 = require("../../components/ui/tooltip");
17
- const use_toast_1 = require("../../hooks/use-toast");
18
- const react_tooltip_1 = require("@radix-ui/react-tooltip");
19
- const PageHeaderContext = (0, react_1.createContext)({ isOpen: false });
20
- function PageHeaderActionButtons({ className, ...props }) {
21
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-header-action-buttons", className: (0, utils_1.cn)('flex min-w-0 flex-wrap items-center gap-8', className), ...props }));
22
- }
23
- function PageHeaderWrapper({ className, ...props }) {
24
- const { isOpen } = (0, react_1.useContext)(PageHeaderContext);
25
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-header-wrapper", className: (0, utils_1.cn)('flex items-start justify-between', isOpen && 'border-b', className), ...props }));
26
- }
27
- function PageHeader({ children, className, rootClassName }) {
28
- const [isOpen, setIsOpen] = (0, react_1.useState)(false);
29
- return ((0, jsx_runtime_1.jsx)(PageHeaderContext.Provider, { value: { isOpen }, children: (0, jsx_runtime_1.jsx)("div", { "data-slot": "page-header", className: (0, utils_1.cn)('mt-12', isOpen && 'mb-12', rootClassName), children: (0, jsx_runtime_1.jsx)(collapsible_1.Collapsible, { open: isOpen, onOpenChange: setIsOpen, className: className, children: children }) }) }));
30
- }
31
- function PageHeaderInfoTitle({ title, subtitle, className, containerClassName, children, as: Heading = 'h1' }) {
32
- return ((0, jsx_runtime_1.jsxs)("div", { "data-slot": "page-header-info-title",
33
- /*
34
- Two utilities and one deliberate absence.
35
-
36
- `flex-1` (basis 0) is #170: flex shrinking is shared in proportion to
37
- flex-basis, so a title box at basis auto (its max-content width, which
38
- a long subtitle inflates) absorbed almost none of the overflow and
39
- starved the action row into one button per line. At basis 0 the line's
40
- hypothetical size is the action row alone, so the row keeps its natural
41
- width and the title grows into what is left, wrapping at spaces.
42
-
43
- NO `min-w-0` is #174, and the absence is the fix. A flex item's
44
- automatic minimum size is its own min-content, so left alone the box
45
- cannot be squeezed below its longest word (of the title, the subtitle,
46
- or a child chip) and nothing can overflow horizontally at any width.
47
- beta.5 carried `min-w-0`, which waives that minimum: on Matcher's
48
- exception-detail masthead the box collapsed to 68px and the `h1`
49
- painted straight out of it and across the action row. That is gone.
50
-
51
- A fixed floor was the other candidate and is wrong: any `sm:` gate keys
52
- on the VIEWPORT while the overflow condition is the MASTHEAD width, so
53
- a 1024px viewport with a 320px side panel open (a ~332px masthead)
54
- would keep a 320px floor and scroll the body sideways.
55
-
56
- The measured trade: on a masthead carrying a 520px action row the title
57
- box shrinks to its longest word and the subtitle wraps to about three
58
- lines. The remedy there is fewer controls in the action slot, not a
59
- wider floor. A consumer that wants the collapse back passes
60
- `containerClassName="min-w-0"`. jsdom does not lay out, so the geometry
61
- is verified downstream.
62
- */
63
- className: (0, utils_1.cn)('mb-12 flex flex-1 flex-col gap-4', containerClassName), children: [(0, jsx_runtime_1.jsx)(Heading, { className: (0, utils_1.cn)('text-foreground text-4xl font-bold', className), "data-testid": "title", children: title }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("p", { className: "text-muted-foreground text-sm font-medium", children: subtitle }) }), react_1.Children.toArray(children).length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-wrap items-center gap-2", children: children })) : null] }));
64
- }
65
- function PageHeaderInfoTooltip({ subtitle }) {
66
- const { toast } = (0, use_toast_1.useToast)();
67
- const handleCopyToClipboard = (value) => {
68
- navigator.clipboard.writeText(value);
69
- toast({
70
- description: 'Copied to clipboard!'
71
- });
72
- };
73
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-header-info-tooltip", children: (0, jsx_runtime_1.jsx)(tooltip_1.TooltipProvider, { children: (0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { delayDuration: 300, children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { onClick: () => handleCopyToClipboard(subtitle), children: (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { size: 16, className: "cursor-pointer" }) }), (0, jsx_runtime_1.jsxs)(tooltip_1.TooltipContent, { className: "bg-shadcn-600 border-none", arrowPadding: 0, children: [(0, jsx_runtime_1.jsx)("p", { className: "text-shadcn-300 text-sm font-medium", children: subtitle }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-white", children: "Click to copy" }), (0, jsx_runtime_1.jsx)(react_tooltip_1.Arrow, { height: 8, width: 15 })] })] }) }) }));
74
- }
75
- function PageHeaderCollapsibleInfoTrigger({ question }) {
76
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-header-collapsible-info-trigger", children: (0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "link", className: "flex gap-2 pr-0", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-foreground text-sm font-medium", children: question }), (0, jsx_runtime_1.jsx)(lucide_react_1.HelpCircle, { className: "h-4 w-4" })] }) }) }));
77
- }
78
- function PageHeaderCollapsibleInfo({ question, answer, seeMore, href }) {
79
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "page-header-collapsible-info", children: (0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleContent, { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full justify-between pt-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mt-12 flex grow flex-col gap-3 pr-6", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-foreground text-xl font-bold", children: question }), (0, jsx_runtime_1.jsxs)("p", { className: "text-muted-foreground text-sm leading-relaxed font-medium", children: [answer, seeMore && href && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [' ', (0, jsx_runtime_1.jsxs)("a", { target: "_blank", rel: "noopener noreferrer", href: href, className: "text-muted-foreground font-medium", children: [(0, jsx_runtime_1.jsx)("span", { className: "underline underline-offset-4", children: seeMore }), (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { size: 16, className: "ml-1 inline align-middle" })] })] }))] })] }), (0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "link", className: "cursor-pointer self-start", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { size: 24, className: "text-muted-foreground" }) }) })] }) }) }));
80
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.PageHeaderActionButtons=PageHeaderActionButtons;exports.PageHeaderWrapper=PageHeaderWrapper;exports.PageHeader=PageHeader;exports.PageHeaderInfoTitle=PageHeaderInfoTitle;exports.PageHeaderInfoTooltip=PageHeaderInfoTooltip;exports.PageHeaderCollapsibleInfoTrigger=PageHeaderCollapsibleInfoTrigger;exports.PageHeaderCollapsibleInfo=PageHeaderCollapsibleInfo;const jsx_runtime_1=require("react/jsx-runtime");const utils_1=require("../../lib/utils");const react_1=require("react");const collapsible_1=require("../../components/ui/collapsible");const button_1=require("../ui/button");const lucide_react_1=require("lucide-react");const tooltip_1=require("../../components/ui/tooltip");const use_toast_1=require("../../hooks/use-toast");const react_tooltip_1=require("@radix-ui/react-tooltip");const PageHeaderContext=(0,react_1.createContext)({isOpen:false});function PageHeaderActionButtons({className:e,...t}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"page-header-action-buttons",className:(0,utils_1.cn)("flex min-w-0 flex-wrap items-center gap-8",e),...t})}function PageHeaderWrapper({className:e,...t}){const{isOpen:r}=(0,react_1.useContext)(PageHeaderContext);return(0,jsx_runtime_1.jsx)("div",{"data-slot":"page-header-wrapper",className:(0,utils_1.cn)("flex items-start justify-between",r&&"border-b",e),...t})}function PageHeader({children:e,className:t,rootClassName:r}){const[s,a]=(0,react_1.useState)(false);return(0,jsx_runtime_1.jsx)(PageHeaderContext.Provider,{value:{isOpen:s},children:(0,jsx_runtime_1.jsx)("div",{"data-slot":"page-header",className:(0,utils_1.cn)("mt-12",s&&"mb-12",r),children:(0,jsx_runtime_1.jsx)(collapsible_1.Collapsible,{open:s,onOpenChange:a,className:t,children:e})})})}function PageHeaderInfoTitle({title:e,subtitle:t,className:r,containerClassName:s,children:a,as:l="h1"}){return(0,jsx_runtime_1.jsxs)("div",{"data-slot":"page-header-info-title",className:(0,utils_1.cn)("mb-12 flex flex-1 flex-col gap-4",s),children:[(0,jsx_runtime_1.jsx)(l,{className:(0,utils_1.cn)("text-foreground text-4xl font-bold",r),"data-testid":"title",children:e}),(0,jsx_runtime_1.jsx)("div",{className:"flex items-center gap-2",children:(0,jsx_runtime_1.jsx)("p",{className:"text-muted-foreground text-sm font-medium",children:t})}),react_1.Children.toArray(a).length>0?(0,jsx_runtime_1.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:a}):null]})}function PageHeaderInfoTooltip({subtitle:e}){const{toast:t}=(0,use_toast_1.useToast)();const r=s=>{navigator.clipboard.writeText(s);t({description:"Copied to clipboard!"})};return(0,jsx_runtime_1.jsx)("div",{"data-slot":"page-header-info-tooltip",children:(0,jsx_runtime_1.jsx)(tooltip_1.TooltipProvider,{children:(0,jsx_runtime_1.jsxs)(tooltip_1.Tooltip,{delayDuration:300,children:[(0,jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger,{onClick:()=>r(e),children:(0,jsx_runtime_1.jsx)(lucide_react_1.Copy,{size:16,className:"cursor-pointer"})}),(0,jsx_runtime_1.jsxs)(tooltip_1.TooltipContent,{className:"bg-shadcn-600 border-none",arrowPadding:0,children:[(0,jsx_runtime_1.jsx)("p",{className:"text-shadcn-300 text-sm font-medium",children:e}),(0,jsx_runtime_1.jsx)("p",{className:"text-center text-white",children:"Click to copy"}),(0,jsx_runtime_1.jsx)(react_tooltip_1.Arrow,{height:8,width:15})]})]})})})}function PageHeaderCollapsibleInfoTrigger({question:e}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"page-header-collapsible-info-trigger",children:(0,jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger,{asChild:true,children:(0,jsx_runtime_1.jsxs)(button_1.Button,{variant:"link",className:"flex gap-2 pr-0",children:[(0,jsx_runtime_1.jsx)("span",{className:"text-foreground text-sm font-medium",children:e}),(0,jsx_runtime_1.jsx)(lucide_react_1.HelpCircle,{className:"h-4 w-4"})]})})})}function PageHeaderCollapsibleInfo({question:e,answer:t,seeMore:r,href:s}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"page-header-collapsible-info",children:(0,jsx_runtime_1.jsx)(collapsible_1.CollapsibleContent,{children:(0,jsx_runtime_1.jsxs)("div",{className:"flex w-full justify-between pt-6",children:[(0,jsx_runtime_1.jsxs)("div",{className:"mt-12 flex grow flex-col gap-3 pr-6",children:[(0,jsx_runtime_1.jsx)("h2",{className:"text-foreground text-xl font-bold",children:e}),(0,jsx_runtime_1.jsxs)("p",{className:"text-muted-foreground text-sm leading-relaxed font-medium",children:[t,r&&s&&(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[" ",(0,jsx_runtime_1.jsxs)("a",{target:"_blank",rel:"noopener noreferrer",href:s,className:"text-muted-foreground font-medium",children:[(0,jsx_runtime_1.jsx)("span",{className:"underline underline-offset-4",children:r}),(0,jsx_runtime_1.jsx)(lucide_react_1.ExternalLink,{size:16,className:"ml-1 inline align-middle"})]})]})]})]}),(0,jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger,{asChild:true,children:(0,jsx_runtime_1.jsx)(button_1.Button,{variant:"link",className:"cursor-pointer self-start",children:(0,jsx_runtime_1.jsx)(lucide_react_1.ChevronUp,{size:24,className:"text-muted-foreground"})})})]})})})}
@@ -1,10 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Pagination = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const button_1 = require("../ui/button");
6
- const lucide_react_1 = require("lucide-react");
7
- const Pagination = ({ page, limit, total = 0, previousLabel, nextLabel, nextPage, previousPage }) => {
8
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-end space-x-2", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", size: "small", onClick: previousPage, disabled: page <= 1, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { size: 16 }), iconPlacement: "start", children: previousLabel }), (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", size: "small", onClick: nextPage, disabled: total < limit, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 }), iconPlacement: "end", children: nextLabel })] }));
9
- };
10
- exports.Pagination = Pagination;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Pagination=void 0;const jsx_runtime_1=require("react/jsx-runtime");const button_1=require("../ui/button");const lucide_react_1=require("lucide-react");const Pagination=({page:e,limit:t,total:i=0,previousLabel:n,nextLabel:s,nextPage:r,previousPage:o})=>{return(0,jsx_runtime_1.jsxs)("div",{className:"flex items-center justify-end space-x-2",children:[(0,jsx_runtime_1.jsx)(button_1.Button,{variant:"outline",size:"small",onClick:o,disabled:e<=1,icon:(0,jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft,{size:16}),iconPlacement:"start",children:n}),(0,jsx_runtime_1.jsx)(button_1.Button,{variant:"outline",size:"small",onClick:r,disabled:i<t,icon:(0,jsx_runtime_1.jsx)(lucide_react_1.ChevronRight,{size:16}),iconPlacement:"end",children:s})]})};exports.Pagination=Pagination;
@@ -1,109 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IdTableCell = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const table_1 = require("../../components/ui/table");
6
- const tooltip_1 = require("../../components/ui/tooltip");
7
- const lucide_react_1 = require("lucide-react");
8
- /**
9
- * ⛔ TRUNCATE IN THE MIDDLE, NEVER FROM THE START.
10
- *
11
- * This cell renders UUIDs, and a ledger hands out long runs of them from a
12
- * shared prefix — `00000000-0000-0000-0000-00000000000{1,2,3}`. Keeping the
13
- * first 13 characters, which is what `truncate(id, { length: 16 })` did,
14
- * rendered every one of those rows as the same string: the only part that told
15
- * them apart was the part that was dropped, and the reader had to hover each
16
- * row in turn to find the one they wanted.
17
- *
18
- * Both ends carry information — the head says which family the id belongs to,
19
- * the tail says which member — so both ends stay.
20
- */
21
- const DEFAULT_HEAD = 8;
22
- const DEFAULT_TAIL = 4;
23
- /**
24
- * ⛔ A BAD LENGTH CANNOT THROW HERE. This runs in a render path, so refusing a
25
- * malformed prop would unmount the whole table rather than one cell — a
26
- * consumer computing `head` from data gets a broken cell, not a broken screen.
27
- *
28
- * `String.slice` reads a negative number as an offset from the END, so a
29
- * negative `head` kept nearly the entire id and put an ellipsis in the middle
30
- * of it, and `NaN` read as 0 and dropped the head — the exact failure middle
31
- * truncation exists to prevent, and one character LONGER than the untruncated
32
- * id. Clamped to a non-negative whole number; anything non-finite falls back
33
- * to the default, which a caller passing `NaN` has already bypassed.
34
- */
35
- function charCount(value, fallback) {
36
- return Number.isFinite(value) ? Math.max(0, Math.trunc(value)) : fallback;
37
- }
38
- function truncateMiddle(id, head, tail) {
39
- const start = charCount(head, DEFAULT_HEAD);
40
- const end = charCount(tail, DEFAULT_TAIL);
41
- // No ellipsis unless it actually saves characters: at head + tail + 1 the
42
- // truncation is the same length as the id and hides a character for nothing.
43
- return id.length <= start + end + 1
44
- ? id
45
- : `${id.slice(0, start)}…${id.slice(id.length - end)}`;
46
- }
47
- const IdTableCell = ({ id, onCopy, head = DEFAULT_HEAD, tail = DEFAULT_TAIL, copyLabel = 'Copy id', ...others }) => {
48
- /**
49
- * ⛔ THE COPY ACTION IS A NAMED BUTTON, NEVER A HANDLER ON THE `<td>`.
50
- *
51
- * On the cell it had no role, no tab stop and no accessible name: an
52
- * operator who does not use a pointer could not copy an id from any table
53
- * built on this kit, and a screen reader announced the cell as plain text.
54
- * It also made the id column the one cell in a row-activating table that
55
- * silently swallowed the click that opens the record.
56
- */
57
- const handleCopyToClipboard = async (event) => {
58
- // A row that opens a record on click must not also open it on a copy.
59
- event.stopPropagation();
60
- // The same guard `CopyField` uses: an insecure context, and a browser
61
- // without the API, both leave `navigator.clipboard` undefined, and the
62
- // only thing this cell would otherwise do about it is throw an unhandled
63
- // rejection out of a click handler. There is no input here to select as a
64
- // fallback, so a silent no-op is the whole of what it can honestly offer.
65
- if (!id || typeof navigator.clipboard?.writeText !== 'function') {
66
- return;
67
- }
68
- try {
69
- // The WHOLE id, never what is rendered. The cell is the only place most
70
- // consoles expose it, and a truncated id pasted into a query matches
71
- // nothing.
72
- await navigator.clipboard.writeText(id);
73
- onCopy?.(id);
74
- }
75
- catch {
76
- // The browser refused the write: nothing reached the clipboard, so
77
- // `onCopy` — which consumers hang their "copied" toast off — must not
78
- // claim otherwise.
79
- }
80
- };
81
- return ((0, jsx_runtime_1.jsx)(table_1.TableCell
82
- // The tooltip is the styled affordance; `title` is the fallback that
83
- // survives without it — a printed page, a portal that has not mounted,
84
- // and the cell padding outside the trigger.
85
- , {
86
- // The tooltip is the styled affordance; `title` is the fallback that
87
- // survives without it — a printed page, a portal that has not mounted,
88
- // and the cell padding outside the trigger.
89
- title: id, ...others, children: (0, jsx_runtime_1.jsxs)(table_1.TableCellWrapper, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipProvider, { children: (0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { delayDuration: 300, children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { children: id ? truncateMiddle(id, head, tail) : id }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { children: id })] }) }), id ? ((0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": copyLabel, onClick: handleCopyToClipboard,
90
- // ⛔ THREE RULES HERE, AND EVERY ONE IS A WAY THE CONTROL
91
- // DISAPPEARS RATHER THAN A DECORATION.
92
- //
93
- // `focus-visible:opacity-100`: a keyboard stop the operator cannot
94
- // see is the same dead end the `<td>` handler was.
95
- //
96
- // `[@media(hover:none)]:opacity-100`: a phone or a tablet has no
97
- // pointer to hover with, so `group-hover` never fires and the only
98
- // control that copies an id stayed fully transparent — invisible
99
- // AND unexplained on the one device where the id is hardest to
100
- // read off the screen. Written as an arbitrary variant because the
101
- // kit's Tailwind theme defines no named one.
102
- //
103
- // `size-6` with `-my-0.5`: WCAG 2.5.8 wants 24×24 CSS px, and the
104
- // glyph alone is 14. The negative margin pulls the button's outer
105
- // box back to the 20px line box of the cell's `text-sm` text, so
106
- // the target grows without the row growing under it.
107
- className: "focus-visible:ring-ring -my-0.5 ml-4 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm opacity-0 transition-opacity group-hover/table-cell:opacity-100 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:outline-none [@media(hover:none)]:opacity-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "size-3.5" }) })) : null] }) }));
108
- };
109
- exports.IdTableCell = IdTableCell;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.IdTableCell=void 0;const jsx_runtime_1=require("react/jsx-runtime");const table_1=require("../../components/ui/table");const tooltip_1=require("../../components/ui/tooltip");const lucide_react_1=require("lucide-react");const DEFAULT_HEAD=8;const DEFAULT_TAIL=4;function charCount(e,t){return Number.isFinite(e)?Math.max(0,Math.trunc(e)):t}function truncateMiddle(e,t,n){const o=charCount(t,DEFAULT_HEAD);const r=charCount(n,DEFAULT_TAIL);return e.length<=o+r+1?e:`${e.slice(0,o)}\u2026${e.slice(e.length-r)}`}const IdTableCell=({id:e,onCopy:t,head:n=DEFAULT_HEAD,tail:o=DEFAULT_TAIL,copyLabel:r="Copy id",...i})=>{const l=async s=>{s.stopPropagation();if(!e||typeof navigator.clipboard?.writeText!=="function"){return}try{await navigator.clipboard.writeText(e);t?.(e)}catch{}};return(0,jsx_runtime_1.jsx)(table_1.TableCell,{title:e,...i,children:(0,jsx_runtime_1.jsxs)(table_1.TableCellWrapper,{children:[(0,jsx_runtime_1.jsx)(tooltip_1.TooltipProvider,{children:(0,jsx_runtime_1.jsxs)(tooltip_1.Tooltip,{delayDuration:300,children:[(0,jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger,{children:e?truncateMiddle(e,n,o):e}),(0,jsx_runtime_1.jsx)(tooltip_1.TooltipContent,{children:e})]})}),e?(0,jsx_runtime_1.jsx)("button",{type:"button","aria-label":r,onClick:l,className:"focus-visible:ring-ring -my-0.5 ml-4 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm opacity-0 transition-opacity group-hover/table-cell:opacity-100 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:outline-none [@media(hover:none)]:opacity-100",children:(0,jsx_runtime_1.jsx)(lucide_react_1.Copy,{className:"size-3.5"})}):null]})})};exports.IdTableCell=IdTableCell;
@@ -1,19 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./id-table-cell"), exports);
18
- __exportStar(require("./locked-table-actions"), exports);
19
- __exportStar(require("./name-table-cell"), exports);
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(i,t,e,r){if(r===void 0)r=e;var n=Object.getOwnPropertyDescriptor(t,e);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[e]}}}Object.defineProperty(i,r,n)}):(function(i,t,e,r){if(r===void 0)r=e;i[r]=t[e]}));var __exportStar=this&&this.__exportStar||function(i,t){for(var e in i)if(e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e))__createBinding(t,i,e)};Object.defineProperty(exports,"__esModule",{value:true});__exportStar(require("./id-table-cell"),exports);__exportStar(require("./locked-table-actions"),exports);__exportStar(require("./name-table-cell"),exports);
@@ -1,41 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LockedTableActions = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const lucide_react_1 = require("lucide-react");
6
- const tooltip_1 = require("../../components/ui/tooltip");
7
- const utils_1 = require("../../lib/utils");
8
- /**
9
- * Where a row's action menu would be, on a record the ledger will not let
10
- * anyone change — an external account, in double-entry terms.
11
- *
12
- * ⛔ THE TRIGGER IS A BUTTON. It used to be a `<div>`, so the ONLY explanation
13
- * of why the menu is gone lived in a tooltip that a keyboard could not open and
14
- * a screen reader had nothing to attach to: the row simply had one control
15
- * fewer, unexplained.
16
- *
17
- * `aria-disabled`, not the `disabled` attribute: a truly disabled button takes
18
- * no focus and fires no pointer events, so it would announce as unavailable and
19
- * then refuse to open the tooltip that says WHY — the same dead end in a
20
- * different shape. This one is reachable, announces its reason as its name,
21
- * opens the tooltip on focus as well as hover, and does nothing when pressed.
22
- *
23
- * ⛔ DOING NOTHING TAKES A HANDLER. `aria-disabled` is a promise to the
24
- * accessibility tree, not to the DOM: the press really does dispatch a click,
25
- * and a click bubbles. Consumers put this where a row's action menu would be,
26
- * in rows that open the record — so with no handler of its own the one control
27
- * that says "you cannot change this" would open the record it refuses to
28
- * change, from a pointer and, because a button turns Enter and Space into
29
- * clicks, from a keyboard too.
30
- */
31
- const LockedTableActions = ({ message, className }) => {
32
- return ((0, jsx_runtime_1.jsx)(tooltip_1.TooltipProvider, { children: (0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)("button", { type: "button", "aria-disabled": "true", "aria-label": message, onClick: (event) => {
33
- event.preventDefault();
34
- event.stopPropagation();
35
- }, className: (0, utils_1.cn)('border-border bg-muted flex size-9 items-center justify-center rounded-md border',
36
- // Reachable is half the fix: a `border` over a `bg-muted` can
37
- // swallow the browser's default outline entirely, and the other
38
- // two cells in this table carry the same ring.
39
- 'focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none', className), children: (0, jsx_runtime_1.jsx)(lucide_react_1.LockIcon, { size: 14, className: "text-muted-foreground" }) }) }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { side: "left", children: message })] }) }));
40
- };
41
- exports.LockedTableActions = LockedTableActions;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.LockedTableActions=void 0;const jsx_runtime_1=require("react/jsx-runtime");const lucide_react_1=require("lucide-react");const tooltip_1=require("../../components/ui/tooltip");const utils_1=require("../../lib/utils");const LockedTableActions=({message:e,className:i})=>{return(0,jsx_runtime_1.jsx)(tooltip_1.TooltipProvider,{children:(0,jsx_runtime_1.jsxs)(tooltip_1.Tooltip,{children:[(0,jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger,{asChild:true,children:(0,jsx_runtime_1.jsx)("button",{type:"button","aria-disabled":"true","aria-label":e,onClick:t=>{t.preventDefault();t.stopPropagation()},className:(0,utils_1.cn)("border-border bg-muted flex size-9 items-center justify-center rounded-md border","focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",i),children:(0,jsx_runtime_1.jsx)(lucide_react_1.LockIcon,{size:14,className:"text-muted-foreground"})})}),(0,jsx_runtime_1.jsx)(tooltip_1.TooltipContent,{side:"left",children:e})]})})};exports.LockedTableActions=LockedTableActions;
@@ -1,58 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NameTableCell = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const lucide_react_1 = require("lucide-react");
6
- const table_1 = require("../ui/table");
7
- /**
8
- * The name column, which is how an operator opens a record from a list.
9
- *
10
- * ⛔ THE CLICK IS A BUTTON, NEVER THE `<td>`. The cell had no click prop at
11
- * all, so a consumer wanting a clickable name put `onClick` on the `<td>`
12
- * through the spread props: a pointer user saw an affordance under a
13
- * `<p class="cursor-pointer">`, and a keyboard or screen-reader user got a
14
- * table cell with no control in it — the row's only route to the record was
15
- * unreachable. `onClick` is now `Omit`ed from the inherited cell props, so the
16
- * `<td>` handler is unrepresentable and the compiler says so at the call site.
17
- *
18
- * And with no handler there is no pointer cursor: text that says it is
19
- * clickable and is not is worse than plain text.
20
- *
21
- * ⛔ AN INTERACTIVE CELL CANNOT BE ANONYMOUS. `name` renders INSIDE the button,
22
- * so whatever it renders is the button's accessible name — and a `ReactNode` is
23
- * free to render no text at all, which announces as a bare "button" and leaves
24
- * the row's only route to its record as unreachable as the `<td>` handler
25
- * above. The props are a union rather than a comment: a text `name` names the
26
- * button by itself, anything else has to pass `buttonLabel`, and a cell with no
27
- * handler is exempt because it holds no control.
28
- *
29
- * `buttonLabel` and not an inherited `aria-label`, which the spread puts on the
30
- * `<td>` — naming the CELL, never the control inside it.
31
- *
32
- * ⛔ AND THE UNION STILL LETS THE EMPTY STRING THROUGH, because every string
33
- * type does. `name=""` satisfies the text arm and `buttonLabel=" "` satisfies
34
- * the labelled one, so the last word is the component's, below.
35
- */
36
- const NameTableCell = ({ name, onClick, buttonLabel, ...props }) => {
37
- // Whitespace names nothing. An `aria-label` of " " is worse than none: it
38
- // OVERRIDES the text inside the button, so a perfectly good name is replaced
39
- // by silence. Drop it and the text content names the control again.
40
- const label = buttonLabel?.trim() ? buttonLabel : undefined;
41
- // Only a text `name` can name the button by itself. Any other node is opaque
42
- // here — which is why the type demands a label for it in the first place.
43
- const textName = typeof name === 'string' ? name.trim() : '';
44
- const named = Boolean(label) || textName !== '';
45
- // ⛔ AN UNNAMED BUTTON LOSES ITS HANDLER, IT DOES NOT SHIP. The two failures
46
- // are not symmetric: a button announcing "" is invisible to the developer who
47
- // wrote it and fatal to the operator who cannot use a mouse, while a name
48
- // that does not open its record shows itself on the very first render. So the
49
- // cell degrades to the plain text it can still display correctly, and says so
50
- // where a developer will see it. Never throws: one nameless row must not take
51
- // the whole table down.
52
- if (process.env.NODE_ENV !== 'production' && onClick && !named) {
53
- console.error(`NameTableCell has no accessible name: \`${typeof name === 'string' ? 'name' : 'buttonLabel'}\` is empty, so its click handler was dropped rather than render a button announcing "".`);
54
- }
55
- const opensRecord = onClick && named;
56
- return ((0, jsx_runtime_1.jsx)(table_1.TableCell, { ...props, children: (0, jsx_runtime_1.jsxs)(table_1.TableCellWrapper, { children: [opensRecord ? ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClick, "aria-label": label, className: "focus-visible:ring-ring cursor-pointer rounded-sm text-left focus-visible:ring-2 focus-visible:outline-none", children: name })) : ((0, jsx_runtime_1.jsx)("p", { children: name })), (0, jsx_runtime_1.jsx)(table_1.TableCellAction, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Search, { className: "size-3.5" }) })] }) }));
57
- };
58
- exports.NameTableCell = NameTableCell;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NameTableCell=void 0;const jsx_runtime_1=require("react/jsx-runtime");const lucide_react_1=require("lucide-react");const table_1=require("../ui/table");const NameTableCell=({name:e,onClick:r,buttonLabel:t,...n})=>{const s=t?.trim()?t:void 0;const i=typeof e==="string"?e.trim():"";const l=Boolean(s)||i!=="";if(process.env.NODE_ENV!=="production"&&r&&!l){console.error(`NameTableCell has no accessible name: \`${typeof e==="string"?"name":"buttonLabel"}\` is empty, so its click handler was dropped rather than render a button announcing "".`)}const o=r&&l;return(0,jsx_runtime_1.jsx)(table_1.TableCell,{...n,children:(0,jsx_runtime_1.jsxs)(table_1.TableCellWrapper,{children:[o?(0,jsx_runtime_1.jsx)("button",{type:"button",onClick:r,"aria-label":s,className:"focus-visible:ring-ring cursor-pointer rounded-sm text-left focus-visible:ring-2 focus-visible:outline-none",children:e}):(0,jsx_runtime_1.jsx)("p",{children:e}),(0,jsx_runtime_1.jsx)(table_1.TableCellAction,{children:(0,jsx_runtime_1.jsx)(lucide_react_1.Search,{className:"size-3.5"})})]})})};exports.NameTableCell=NameTableCell;
@@ -1,62 +1 @@
1
- 'use client';
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.Accordion = Accordion;
38
- exports.AccordionItem = AccordionItem;
39
- exports.AccordionTrigger = AccordionTrigger;
40
- exports.AccordionContent = AccordionContent;
41
- const jsx_runtime_1 = require("react/jsx-runtime");
42
- const AccordionPrimitive = __importStar(require("@radix-ui/react-accordion"));
43
- const lucide_react_1 = require("lucide-react");
44
- const utils_1 = require("../../../lib/utils");
45
- function Accordion({ ...props }) {
46
- return (0, jsx_runtime_1.jsx)(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
47
- }
48
- function AccordionItem({ className, ...props }) {
49
- return ((0, jsx_runtime_1.jsx)(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: (0, utils_1.cn)('border-b last:border-b-0', className), ...props }));
50
- }
51
- /**
52
- * `asChild` is deliberately omitted: the trigger always renders the caller's
53
- * children PLUS the chevron, and Radix's Slot cannot merge onto two children —
54
- * it throws at runtime. Legacy sindarian-x carried the same two-child shape, so
55
- * `asChild` never worked there either; here it is a compile error instead.
56
- */
57
- function AccordionTrigger({ className, children, ...props }) {
58
- return ((0, jsx_runtime_1.jsx)(AccordionPrimitive.Header, { className: "flex", children: (0, jsx_runtime_1.jsxs)(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: (0, utils_1.cn)('focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-colors outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180', className), ...props, children: [children, (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })] }) }));
59
- }
60
- function AccordionContent({ className, children, ...props }) {
61
- return ((0, jsx_runtime_1.jsx)(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "motion-safe:data-[state=closed]:animate-accordion-up motion-safe:data-[state=open]:animate-accordion-down overflow-hidden text-sm", ...props, children: (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('pt-0 pb-4', className), children: children }) }));
62
- }
1
+ "use client";"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(t,n,i)}):(function(t,e,r,n){if(n===void 0)n=r;t[n]=e[r]}));var __setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}):function(t,e){t["default"]=e});var __importStar=this&&this.__importStar||(function(){var t=function(e){t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i))n[n.length]=i;return n};return t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var n=t(e),i=0;i<n.length;i++)if(n[i]!=="default")__createBinding(r,e,n[i])}__setModuleDefault(r,e);return r}})();Object.defineProperty(exports,"__esModule",{value:true});exports.Accordion=Accordion;exports.AccordionItem=AccordionItem;exports.AccordionTrigger=AccordionTrigger;exports.AccordionContent=AccordionContent;const jsx_runtime_1=require("react/jsx-runtime");const AccordionPrimitive=__importStar(require("@radix-ui/react-accordion"));const lucide_react_1=require("lucide-react");const utils_1=require("../../../lib/utils");function Accordion({...t}){return(0,jsx_runtime_1.jsx)(AccordionPrimitive.Root,{"data-slot":"accordion",...t})}function AccordionItem({className:t,...e}){return(0,jsx_runtime_1.jsx)(AccordionPrimitive.Item,{"data-slot":"accordion-item",className:(0,utils_1.cn)("border-b last:border-b-0",t),...e})}function AccordionTrigger({className:t,children:e,...r}){return(0,jsx_runtime_1.jsx)(AccordionPrimitive.Header,{className:"flex",children:(0,jsx_runtime_1.jsxs)(AccordionPrimitive.Trigger,{"data-slot":"accordion-trigger",className:(0,utils_1.cn)("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-colors outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",t),...r,children:[e,(0,jsx_runtime_1.jsx)(lucide_react_1.ChevronDown,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function AccordionContent({className:t,children:e,...r}){return(0,jsx_runtime_1.jsx)(AccordionPrimitive.Content,{"data-slot":"accordion-content",className:"motion-safe:data-[state=closed]:animate-accordion-up motion-safe:data-[state=open]:animate-accordion-down overflow-hidden text-sm",...r,children:(0,jsx_runtime_1.jsx)("div",{className:(0,utils_1.cn)("pt-0 pb-4",t),children:e})})}
@@ -1,45 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Alert = Alert;
4
- exports.AlertTitle = AlertTitle;
5
- exports.AlertDescription = AlertDescription;
6
- exports.AlertActions = AlertActions;
7
- exports.AlertTopAction = AlertTopAction;
8
- exports.AlertClose = AlertClose;
9
- const jsx_runtime_1 = require("react/jsx-runtime");
10
- const class_variance_authority_1 = require("class-variance-authority");
11
- const utils_1 = require("../../../lib/utils");
12
- const icon_button_1 = require("../icon-button");
13
- const lucide_react_1 = require("lucide-react");
14
- const alertVariants = (0, class_variance_authority_1.cva)('alert', {
15
- variants: {
16
- variant: {
17
- default: '',
18
- informative: 'alert-informative',
19
- destructive: 'alert-destructive',
20
- warning: 'alert-warning',
21
- success: 'alert-success'
22
- }
23
- },
24
- defaultVariants: {
25
- variant: 'default'
26
- }
27
- });
28
- function Alert({ className, variant, ...props }) {
29
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "alert", role: "alert", className: (0, utils_1.cn)(alertVariants({ variant }), className), ...props }));
30
- }
31
- function AlertTitle({ className, ...props }) {
32
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "alert-title", className: (0, utils_1.cn)('alert-title', className), ...props }));
33
- }
34
- function AlertDescription({ className, ...props }) {
35
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "alert-description", className: (0, utils_1.cn)('alert-description', className), ...props }));
36
- }
37
- function AlertActions({ className, ...props }) {
38
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "alert-actions", className: (0, utils_1.cn)('alert-actions', className), ...props }));
39
- }
40
- function AlertTopAction({ className, ...props }) {
41
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "alert-top-action", className: (0, utils_1.cn)('alert-top-action', className), ...props }));
42
- }
43
- function AlertClose({ className, ...props }) {
44
- return ((0, jsx_runtime_1.jsx)(AlertTopAction, { children: (0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { className: (0, utils_1.cn)('alert-close', className), variant: "outline", size: "small", rounded: true, ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, {}) }) }));
45
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Alert=Alert;exports.AlertTitle=AlertTitle;exports.AlertDescription=AlertDescription;exports.AlertActions=AlertActions;exports.AlertTopAction=AlertTopAction;exports.AlertClose=AlertClose;const jsx_runtime_1=require("react/jsx-runtime");const class_variance_authority_1=require("class-variance-authority");const utils_1=require("../../../lib/utils");const icon_button_1=require("../icon-button");const lucide_react_1=require("lucide-react");const alertVariants=(0,class_variance_authority_1.cva)("alert",{variants:{variant:{default:"",informative:"alert-informative",destructive:"alert-destructive",warning:"alert-warning",success:"alert-success"}},defaultVariants:{variant:"default"}});function Alert({className:t,variant:e,...r}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,utils_1.cn)(alertVariants({variant:e}),t),...r})}function AlertTitle({className:t,...e}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"alert-title",className:(0,utils_1.cn)("alert-title",t),...e})}function AlertDescription({className:t,...e}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"alert-description",className:(0,utils_1.cn)("alert-description",t),...e})}function AlertActions({className:t,...e}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"alert-actions",className:(0,utils_1.cn)("alert-actions",t),...e})}function AlertTopAction({className:t,...e}){return(0,jsx_runtime_1.jsx)("div",{"data-slot":"alert-top-action",className:(0,utils_1.cn)("alert-top-action",t),...e})}function AlertClose({className:t,...e}){return(0,jsx_runtime_1.jsx)(AlertTopAction,{children:(0,jsx_runtime_1.jsx)(icon_button_1.IconButton,{className:(0,utils_1.cn)("alert-close",t),variant:"outline",size:"small",rounded:true,...e,children:(0,jsx_runtime_1.jsx)(lucide_react_1.X,{})})})}