@lerianstudio/sindarian-ui 2.0.0-beta.1 → 2.0.0-beta.11

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 (140) hide show
  1. package/dist/components/breadcrumb/index.d.ts.map +1 -1
  2. package/dist/components/breadcrumb/index.js +25 -1
  3. package/dist/components/card/account-card/index.js +5 -5
  4. package/dist/components/card/basic-card/index.d.ts.map +1 -1
  5. package/dist/components/card/basic-card/index.js +2 -2
  6. package/dist/components/card/entity-card/index.js +1 -1
  7. package/dist/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  8. package/dist/components/dialog/confirmation-dialog/index.js +4 -1
  9. package/dist/components/entity-box/index.d.ts +18 -2
  10. package/dist/components/entity-box/index.d.ts.map +1 -1
  11. package/dist/components/entity-box/index.js +32 -4
  12. package/dist/components/form/file-upload-field/index.d.ts +11 -2
  13. package/dist/components/form/file-upload-field/index.d.ts.map +1 -1
  14. package/dist/components/form/file-upload-field/index.js +8 -3
  15. package/dist/components/form/input-field/index.d.ts +41 -2
  16. package/dist/components/form/input-field/index.d.ts.map +1 -1
  17. package/dist/components/form/input-field/index.js +73 -15
  18. package/dist/components/form/password-field/index.d.ts +5 -1
  19. package/dist/components/form/password-field/index.d.ts.map +1 -1
  20. package/dist/components/form/password-field/index.js +2 -2
  21. package/dist/components/form/select-field/index.d.ts +9 -1
  22. package/dist/components/form/select-field/index.d.ts.map +1 -1
  23. package/dist/components/form/select-field/index.js +2 -2
  24. package/dist/components/page-header/index.js +1 -1
  25. package/dist/components/table/id-table-cell.d.ts +5 -1
  26. package/dist/components/table/id-table-cell.d.ts.map +1 -1
  27. package/dist/components/table/id-table-cell.js +48 -6
  28. package/dist/components/ui/autocomplete/index.d.ts +24 -0
  29. package/dist/components/ui/autocomplete/index.d.ts.map +1 -1
  30. package/dist/components/ui/autocomplete/index.js +24 -0
  31. package/dist/components/ui/badge/index.d.ts +11 -7
  32. package/dist/components/ui/badge/index.d.ts.map +1 -1
  33. package/dist/components/ui/badge/index.js +20 -8
  34. package/dist/components/ui/button/styles.css +31 -1
  35. package/dist/components/ui/calendar/index.d.ts.map +1 -1
  36. package/dist/components/ui/calendar/index.js +7 -1
  37. package/dist/components/ui/copy-field/index.d.ts.map +1 -1
  38. package/dist/components/ui/copy-field/index.js +1 -1
  39. package/dist/components/ui/file-upload/index.d.ts +235 -9
  40. package/dist/components/ui/file-upload/index.d.ts.map +1 -1
  41. package/dist/components/ui/file-upload/index.js +354 -17
  42. package/dist/components/ui/form.d.ts +4 -0
  43. package/dist/components/ui/form.d.ts.map +1 -1
  44. package/dist/components/ui/form.js +48 -6
  45. package/dist/components/ui/input/styles.css +75 -3
  46. package/dist/components/ui/sheet/index.d.ts.map +1 -1
  47. package/dist/components/ui/sheet/index.js +2 -2
  48. package/dist/components/ui/sidebar/index.d.ts +1 -0
  49. package/dist/components/ui/sidebar/index.d.ts.map +1 -1
  50. package/dist/components/ui/sidebar/index.js +1 -0
  51. package/dist/components/ui/sidebar/sidebar-expand-button.d.ts +1 -1
  52. package/dist/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
  53. package/dist/components/ui/sidebar/sidebar-expand-button.js +15 -1
  54. package/dist/components/ui/sidebar/sidebar-item.d.ts +1 -1
  55. package/dist/components/ui/sidebar/sidebar-item.d.ts.map +1 -1
  56. package/dist/components/ui/sidebar/sidebar-item.js +28 -4
  57. package/dist/components/ui/sidebar/sidebar-provider.d.ts +37 -0
  58. package/dist/components/ui/sidebar/sidebar-provider.d.ts.map +1 -1
  59. package/dist/components/ui/sidebar/sidebar-provider.js +125 -4
  60. package/dist/components/ui/sidebar/sidebar-root.d.ts +38 -1
  61. package/dist/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
  62. package/dist/components/ui/sidebar/sidebar-root.js +100 -5
  63. package/dist/components/ui/sidebar/sidebar-trigger.d.ts +18 -0
  64. package/dist/components/ui/sidebar/sidebar-trigger.d.ts.map +1 -0
  65. package/dist/components/ui/sidebar/sidebar-trigger.js +30 -0
  66. package/dist/components/ui/toggle-group/index.d.ts +1 -1
  67. package/dist/components/ui/toggle-group/index.d.ts.map +1 -1
  68. package/dist/components/ui/toggle-group/index.js +73 -4
  69. package/dist/enterprise/number-input/index.d.ts.map +1 -1
  70. package/dist/enterprise/number-input/index.js +1 -1
  71. package/dist/esm/components/breadcrumb/index.d.ts.map +1 -1
  72. package/dist/esm/components/breadcrumb/index.js +25 -1
  73. package/dist/esm/components/card/account-card/index.js +5 -5
  74. package/dist/esm/components/card/basic-card/index.d.ts.map +1 -1
  75. package/dist/esm/components/card/basic-card/index.js +2 -2
  76. package/dist/esm/components/card/entity-card/index.js +1 -1
  77. package/dist/esm/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  78. package/dist/esm/components/dialog/confirmation-dialog/index.js +4 -1
  79. package/dist/esm/components/entity-box/index.d.ts +18 -2
  80. package/dist/esm/components/entity-box/index.d.ts.map +1 -1
  81. package/dist/esm/components/entity-box/index.js +29 -4
  82. package/dist/esm/components/form/file-upload-field/index.d.ts +11 -2
  83. package/dist/esm/components/form/file-upload-field/index.d.ts.map +1 -1
  84. package/dist/esm/components/form/file-upload-field/index.js +8 -3
  85. package/dist/esm/components/form/input-field/index.d.ts +41 -2
  86. package/dist/esm/components/form/input-field/index.d.ts.map +1 -1
  87. package/dist/esm/components/form/input-field/index.js +73 -15
  88. package/dist/esm/components/form/password-field/index.d.ts +5 -1
  89. package/dist/esm/components/form/password-field/index.d.ts.map +1 -1
  90. package/dist/esm/components/form/password-field/index.js +2 -2
  91. package/dist/esm/components/form/select-field/index.d.ts +9 -1
  92. package/dist/esm/components/form/select-field/index.d.ts.map +1 -1
  93. package/dist/esm/components/form/select-field/index.js +2 -2
  94. package/dist/esm/components/page-header/index.js +1 -1
  95. package/dist/esm/components/table/id-table-cell.d.ts +5 -1
  96. package/dist/esm/components/table/id-table-cell.d.ts.map +1 -1
  97. package/dist/esm/components/table/id-table-cell.js +48 -3
  98. package/dist/esm/components/ui/autocomplete/index.d.ts +24 -0
  99. package/dist/esm/components/ui/autocomplete/index.d.ts.map +1 -1
  100. package/dist/esm/components/ui/autocomplete/index.js +24 -0
  101. package/dist/esm/components/ui/badge/index.d.ts +11 -7
  102. package/dist/esm/components/ui/badge/index.d.ts.map +1 -1
  103. package/dist/esm/components/ui/badge/index.js +20 -8
  104. package/dist/esm/components/ui/calendar/index.d.ts.map +1 -1
  105. package/dist/esm/components/ui/calendar/index.js +8 -2
  106. package/dist/esm/components/ui/copy-field/index.d.ts.map +1 -1
  107. package/dist/esm/components/ui/copy-field/index.js +1 -1
  108. package/dist/esm/components/ui/file-upload/index.d.ts +235 -9
  109. package/dist/esm/components/ui/file-upload/index.d.ts.map +1 -1
  110. package/dist/esm/components/ui/file-upload/index.js +353 -17
  111. package/dist/esm/components/ui/form.d.ts +4 -0
  112. package/dist/esm/components/ui/form.d.ts.map +1 -1
  113. package/dist/esm/components/ui/form.js +48 -6
  114. package/dist/esm/components/ui/sheet/index.d.ts.map +1 -1
  115. package/dist/esm/components/ui/sheet/index.js +2 -2
  116. package/dist/esm/components/ui/sidebar/index.d.ts +1 -0
  117. package/dist/esm/components/ui/sidebar/index.d.ts.map +1 -1
  118. package/dist/esm/components/ui/sidebar/index.js +1 -0
  119. package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts +1 -1
  120. package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
  121. package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +15 -1
  122. package/dist/esm/components/ui/sidebar/sidebar-item.d.ts +1 -1
  123. package/dist/esm/components/ui/sidebar/sidebar-item.d.ts.map +1 -1
  124. package/dist/esm/components/ui/sidebar/sidebar-item.js +28 -4
  125. package/dist/esm/components/ui/sidebar/sidebar-provider.d.ts +37 -0
  126. package/dist/esm/components/ui/sidebar/sidebar-provider.d.ts.map +1 -1
  127. package/dist/esm/components/ui/sidebar/sidebar-provider.js +122 -1
  128. package/dist/esm/components/ui/sidebar/sidebar-root.d.ts +38 -1
  129. package/dist/esm/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
  130. package/dist/esm/components/ui/sidebar/sidebar-root.js +102 -7
  131. package/dist/esm/components/ui/sidebar/sidebar-trigger.d.ts +18 -0
  132. package/dist/esm/components/ui/sidebar/sidebar-trigger.d.ts.map +1 -0
  133. package/dist/esm/components/ui/sidebar/sidebar-trigger.js +26 -0
  134. package/dist/esm/components/ui/toggle-group/index.d.ts +1 -1
  135. package/dist/esm/components/ui/toggle-group/index.d.ts.map +1 -1
  136. package/dist/esm/components/ui/toggle-group/index.js +73 -4
  137. package/dist/esm/enterprise/number-input/index.d.ts.map +1 -1
  138. package/dist/esm/enterprise/number-input/index.js +1 -1
  139. package/dist/globals.css +77 -31
  140. package/package.json +5 -3
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,cAAc,EAAE,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,WAAW,eAAe,sBAoBpD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,cAAc,EAAE,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,WAAW,eAAe,sBAmDpD,CAAA"}
@@ -8,6 +8,30 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const breadcrumb_1 = require("../../components/ui/breadcrumb");
10
10
  const Breadcrumb = ({ paths }) => {
11
- return ((0, jsx_runtime_1.jsx)(breadcrumb_1.Breadcrumb, { children: (0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbList, { children: paths.map((path, index) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbItem, { children: path.href ? ((0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbLink, { href: path.href, children: path.name })) : ((0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbPage, { children: path.name })) }), (0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbSeparator, {})] }, index))) }) }));
11
+ const last = paths.length - 1;
12
+ return ((0, jsx_runtime_1.jsx)(breadcrumb_1.Breadcrumb, { children: (0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbList, { children: paths.map((path, index) => {
13
+ /**
14
+ * ⛔ THE LAST CRUMB IS THE PAGE, whatever the caller passed.
15
+ *
16
+ * The page marker used to be a side effect of the caller omitting
17
+ * `href`, and nothing in `getBreadcrumbPaths` makes the last entry
18
+ * omit one. A trail whose final entry carried an href therefore had
19
+ * no `aria-current="page"` anywhere — a screen reader could not tell
20
+ * which of three links was the page being read — and the crumb was a
21
+ * live link back to the page the reader is already on.
22
+ *
23
+ * ⚠️ AND AN HREF-LESS ANCESTOR IS NOT A SWITCHED-OFF LINK. It used
24
+ * to reach `BreadcrumbPage` too, which hard-codes `role="link"
25
+ * aria-disabled="true"` — the right shape for the page you are ON,
26
+ * a destination that exists and simply is not navigable from here.
27
+ * An ancestor with no href is a grouping label: there is no page
28
+ * behind it, so "Settings, link, dimmed" told the reader a
29
+ * destination was unavailable to them rather than that it was never
30
+ * a destination, and inflated the link count of the trail. It is
31
+ * plain text now, and only the last crumb is the page.
32
+ */
33
+ const isLast = index === last;
34
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbItem, { children: path.href && !isLast ? ((0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbLink, { href: path.href, children: path.name })) : isLast ? ((0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbPage, { children: path.name })) : ((0, jsx_runtime_1.jsx)("span", { className: "breadcrumb-page", children: path.name })) }), !isLast && (0, jsx_runtime_1.jsx)(breadcrumb_1.BreadcrumbSeparator, {})] }, index));
35
+ }) }) }));
12
36
  };
13
37
  exports.Breadcrumb = Breadcrumb;
@@ -39,7 +39,7 @@ function AccountBalanceCardHeader({ className, ...props }) {
39
39
  return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "account-balance-card-header", className: (0, utils_1.cn)('flex flex-col', className), ...props }));
40
40
  }
41
41
  function AccountBalanceCardTitle({ className, ...props }) {
42
- return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "account-balance-card-title", className: (0, utils_1.cn)('text-shadcn-600 text-lg font-bold', className), ...props }));
42
+ return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "account-balance-card-title", className: (0, utils_1.cn)('text-foreground text-lg font-bold', className), ...props }));
43
43
  }
44
44
  function AccountBalanceCardDeleteButton({ className, ...props }) {
45
45
  return ((0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { variant: "outline", size: "small", rounded: true, "data-slot": "account-balance-card-delete-button", className: (0, utils_1.cn)('absolute top-3 right-3', className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Trash, { className: "text-muted-foreground h-4 w-4" }) }));
@@ -51,19 +51,19 @@ function AccountBalanceCardLoading({ className, ...props }) {
51
51
  return ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { "data-slot": "account-balance-card-loading", className: (0, utils_1.cn)('bg-muted mt-3 h-3 w-full rounded-md', className), ...props }));
52
52
  }
53
53
  function AccountBalanceCardEmpty({ className, ...props }) {
54
- return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "account-balance-card-empty", className: (0, utils_1.cn)('text-shadcn-500 mt-3 text-center text-sm font-normal', className), ...props }));
54
+ return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "account-balance-card-empty", className: (0, utils_1.cn)('text-muted-foreground mt-3 text-center text-sm font-normal', className), ...props }));
55
55
  }
56
56
  function AccountBalanceCardInfo({ className, assetCode, value, children: _children, ref, ...props }) {
57
- return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, "data-slot": "account-balance-card-info", className: (0, utils_1.cn)('text-shadcn-500 mt-3 flex flex-row items-center justify-between text-sm font-normal', className), ...props, children: [(0, jsx_runtime_1.jsx)("p", { children: assetCode }), (0, jsx_runtime_1.jsx)("p", { children: value })] }));
57
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, "data-slot": "account-balance-card-info", className: (0, utils_1.cn)('text-muted-foreground mt-3 flex flex-row items-center justify-between text-sm font-normal', className), ...props, children: [(0, jsx_runtime_1.jsx)("p", { children: assetCode }), (0, jsx_runtime_1.jsx)("p", { children: value })] }));
58
58
  }
59
59
  function AccountBalanceCardUpdateButton({ className: _className, loading, timestamp, loadingLabel = 'Updating...', updatedInLabel = 'Updated in', updatedLabel = 'Updated', onRefresh, children: _children, ref, ...props }) {
60
60
  const _time = (0, use_time_1.useTime)({ interval: 1000 * 60 });
61
61
  const updated = react_1.default.useMemo(() => {
62
62
  return !(0, dayjs_1.default)(timestamp).isBefore((0, dayjs_1.default)().subtract(1, 'minute'));
63
63
  }, [_time, timestamp]);
64
- return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex flex-row items-center justify-end gap-2", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-shadcn-500 text-xs font-medium", children: [loading && loadingLabel, !loading && !updated && updatedInLabel, !loading && updated && updatedLabel] }), !loading && updated && ((0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "text-system-success-h1a h-4 w-4" })), (!updated || loading) && ((0, jsx_runtime_1.jsx)(button_1.Button, { ref: ref, variant: "link", "data-slot": "account-balance-card-update-button", className: "h-3 p-0", onClick: onRefresh, disabled: loading, ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)('size-4', { 'motion-safe:animate-spin': loading }) }) }))] }));
64
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex flex-row items-center justify-end gap-2", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-muted-foreground text-xs font-medium", children: [loading && loadingLabel, !loading && !updated && updatedInLabel, !loading && updated && updatedLabel] }), !loading && updated && ((0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "text-system-success-h1a h-4 w-4" })), (!updated || loading) && ((0, jsx_runtime_1.jsx)(button_1.Button, { ref: ref, variant: "link", "data-slot": "account-balance-card-update-button", className: "h-3 p-0", onClick: onRefresh, disabled: loading, ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)('size-4', { 'motion-safe:animate-spin': loading }) }) }))] }));
65
65
  }
66
66
  function AccountBalanceCardTrigger({ className, openLabel, closeLabel, children: _children, ...props }) {
67
67
  const { open } = react_1.default.useContext(AccountBalanceCardContext);
68
- return ((0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "link", "data-slot": "account-balance-card-trigger", className: (0, utils_1.cn)('text-shadcn-600/40 h-4 p-0 text-xs', className), ...props, children: !open ? openLabel : closeLabel }) }));
68
+ return ((0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "link", "data-slot": "account-balance-card-trigger", className: (0, utils_1.cn)('text-muted-foreground h-4 p-0 text-xs', className), ...props, children: !open ? openLabel : closeLabel }) }));
69
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/card/basic-card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAO7B;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBAO5B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAO7B;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAE7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/card/basic-card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAO7B;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBAO5B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAU7B;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAE7B"}
@@ -10,10 +10,10 @@ function BasicCard({ className, ...props }) {
10
10
  return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('bg-card flex flex-col rounded-lg p-6', className), ...props }));
11
11
  }
12
12
  function BasicCardTitle({ className, ...props }) {
13
- return ((0, jsx_runtime_1.jsx)("h2", { className: (0, utils_1.cn)('text-shadcn-600 mb-4 text-sm font-medium', className), ...props }));
13
+ return ((0, jsx_runtime_1.jsx)("h2", { className: (0, utils_1.cn)('text-foreground mb-4 text-sm font-medium', className), ...props }));
14
14
  }
15
15
  function BasicCardContent({ className, ...props }) {
16
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('text-shadcn-500 mb-6 text-sm font-medium', className), ...props }));
16
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('text-muted-foreground mb-6 text-sm font-medium', className), ...props }));
17
17
  }
18
18
  function BasicCardAction({ className, ...props }) {
19
19
  return (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('flex flex-col', className), ...props });
@@ -61,7 +61,7 @@ function EntityCardDescription({ className, ...props }) {
61
61
  return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "entity-card-description", className: (0, utils_1.cn)('text-muted-foreground text-xs font-medium', className), ...props }));
62
62
  }
63
63
  function EntityCardList({ className, ...props }) {
64
- return ((0, jsx_runtime_1.jsx)("ul", { "data-slot": "entity-card-list", className: (0, utils_1.cn)('text-shadcn-500 mx-2 list-inside list-disc space-y-1 text-xs font-medium', className), ...props }));
64
+ return ((0, jsx_runtime_1.jsx)("ul", { "data-slot": "entity-card-list", className: (0, utils_1.cn)('text-muted-foreground mx-2 list-inside list-disc space-y-1 text-xs font-medium', className), ...props }));
65
65
  }
66
66
  function EntityCardFooter({ className, children, ...props }) {
67
67
  return ((0, jsx_runtime_1.jsxs)("div", { "data-slot": "entity-card-footer", className: (0, utils_1.cn)('text-muted-foreground flex flex-col gap-2 text-xs font-medium', className), ...props, children: [(0, jsx_runtime_1.jsx)(separator_1.Separator, {}), (0, jsx_runtime_1.jsx)("div", { className: "[&>svg]:text-muted-foreground flex flex-row items-center gap-2 [&>svg]:size-4 [&>svg]:stroke-[1.5]", children: children })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/confirmation-dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAuD9B,KAAK,6BAA6B,GAAG;IACnC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;IAC3D;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,KAAK,8BAA8B,GAC/B;IACE,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB,GACD;IACE,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB;yEACqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAEL,MAAM,MAAM,uBAAuB,GAAG,6BAA6B,GACjE,8BAA8B,CAAA;AAEhC,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,YAAY,EACZ,KAAY,EACZ,WAAkB,EAClB,OAAmB,EACnB,OAAO,EACP,SAAoB,EACpB,QAAmB,EACnB,YAAY,EACZ,WAAW,EACX,YAAY,EACb,EAAE,uBAAuB,qBA8FzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/confirmation-dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAuD9B,KAAK,6BAA6B,GAAG;IACnC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;IAC3D;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,KAAK,8BAA8B,GAC/B;IACE,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB,GACD;IACE,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB;yEACqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAEL,MAAM,MAAM,uBAAuB,GAAG,6BAA6B,GACjE,8BAA8B,CAAA;AAEhC,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,YAAY,EACZ,KAAY,EACZ,WAAkB,EAClB,OAAmB,EACnB,OAAO,EACP,SAAoB,EACpB,QAAmB,EACnB,YAAY,EACZ,WAAW,EACX,YAAY,EACb,EAAE,uBAAuB,qBAiGzB"}
@@ -89,5 +89,8 @@ function ConfirmationDialog({ open, onOpenChange, title = null, description = nu
89
89
  if (busy) {
90
90
  event.preventDefault();
91
91
  }
92
- }, children: [(0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogHeader, { className: "flex-row items-center", children: [(0, jsx_runtime_1.jsx)(ConfirmationDialogIcon, { variant: variant }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4", children: [title == null || title === false || title === true || title === '' ? ((0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogTitle, { className: "sr-only", children: confirmLabel || 'Confirm' })) : ((0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogTitle, { children: title })), description == null ? null : ((0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogDescription, { children: description }))] })] }), pendingLabel ? ((0, jsx_runtime_1.jsx)("span", { role: "status", className: "sr-only", children: busy ? pendingLabel : '' })) : null, (0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogFooter, { className: "gap-4", children: [(0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogCancel, { asChild: true, variant: "secondary", children: (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: onCancel, disabled: busy, variant: "secondary", size: "small", children: cancelLabel ?? 'Cancel' }) }), (0, jsx_runtime_1.jsx)(loading_button_1.LoadingButton, { loading: busy, onClick: handleConfirm, variant: "primary", size: "small", "data-testid": "confirm", children: confirmLabel ?? 'Confirm' })] })] }) }));
92
+ }, children: [(0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogHeader, { className: "flex-row items-center", children: [(0, jsx_runtime_1.jsx)(ConfirmationDialogIcon, { variant: variant }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4", children: [title == null ||
93
+ title === false ||
94
+ title === true ||
95
+ title === '' ? ((0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogTitle, { className: "sr-only", children: confirmLabel || 'Confirm' })) : ((0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogTitle, { children: title })), description == null ? null : ((0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogDescription, { children: description }))] })] }), pendingLabel ? ((0, jsx_runtime_1.jsx)("span", { role: "status", className: "sr-only", children: busy ? pendingLabel : '' })) : null, (0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogFooter, { className: "gap-4", children: [(0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogCancel, { asChild: true, variant: "secondary", children: (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: onCancel, disabled: busy, variant: "secondary", size: "small", children: cancelLabel ?? 'Cancel' }) }), (0, jsx_runtime_1.jsx)(loading_button_1.LoadingButton, { loading: busy, onClick: handleConfirm, variant: "primary", size: "small", "data-testid": "confirm", children: confirmLabel ?? 'Confirm' })] })] }) }));
93
96
  }
@@ -1,8 +1,24 @@
1
1
  import React from 'react';
2
2
  import { CollapsibleContentProps, CollapsibleProps, CollapsibleTriggerProps } from '@radix-ui/react-collapsible';
3
3
  declare function EntityBox({ className, children, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
4
- declare function EntityBoxCollapsible({ className, ...props }: CollapsibleProps): React.JSX.Element;
5
- declare function EntityBoxCollapsibleTrigger(props: CollapsibleTriggerProps): React.JSX.Element;
4
+ declare function EntityBoxCollapsible({ className, open, defaultOpen, onOpenChange, ...props }: CollapsibleProps): React.JSX.Element;
5
+ export type EntityBoxCollapsibleTriggerProps = CollapsibleTriggerProps & {
6
+ /** Accessible name while the box is closed. */
7
+ expandLabel?: string;
8
+ /** Accessible name while the box is open. */
9
+ collapseLabel?: string;
10
+ };
11
+ /**
12
+ * ⛔ THIS TRIGGER HAS NO TEXT NODE. It is a `Settings2` glyph inside a Button,
13
+ * so without an `aria-label` a screen reader announced "button" and nothing
14
+ * else (SC 4.1.2) — and this is the control that opens the filter panel on
15
+ * every console list page.
16
+ *
17
+ * The name describes the ACTION and Radix's `aria-expanded` carries the state,
18
+ * so the two halves do not repeat each other. English defaults because no
19
+ * consumer passes a label today; a translated console overrides both.
20
+ */
21
+ declare function EntityBoxCollapsibleTrigger({ expandLabel, collapseLabel, 'aria-label': ariaLabel, ...props }: EntityBoxCollapsibleTriggerProps): React.JSX.Element;
6
22
  declare function EntityBoxCollapsibleContent({ children, ...props }: CollapsibleContentProps): React.JSX.Element;
7
23
  export interface EntityBoxHeaderProps extends React.ComponentProps<'div'> {
8
24
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/entity-box/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,6BAA6B,CAAA;AAIpC,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAa7B;AAED,iBAAS,oBAAoB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,qBAUtE;AAED,iBAAS,2BAA2B,CAAC,KAAK,EAAE,uBAAuB,qBAQlE;AAED,iBAAS,2BAA2B,CAAC,EACnC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,uBAAuB,qBAOzB;AAED,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACvE,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC9B;;;;;;;OAOG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC/B;AAED,iBAAS,oBAAoB,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,EACT,EAAE,EAAE,OAAc,EAClB,GAAG,KAAK,EACT,EAAE,oBAAoB,qBAkCtB;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAU7B;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAa7B;AAED,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EACjB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/entity-box/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,6BAA6B,CAAA;AAIpC,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAa7B;AAYD,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,gBAAgB,qBAoBlB;AAED,MAAM,MAAM,gCAAgC,GAAG,uBAAuB,GAAG;IACvE,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;;;;GASG;AACH,iBAAS,2BAA2B,CAAC,EACnC,WAAsB,EACtB,aAA0B,EAC1B,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACT,EAAE,gCAAgC,qBAclC;AAED,iBAAS,2BAA2B,CAAC,EACnC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,uBAAuB,qBAOzB;AAED,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACvE,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC9B;;;;;;;OAOG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC/B;AAED,iBAAS,oBAAoB,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,EACT,EAAE,EAAE,OAAc,EAClB,GAAG,KAAK,EACT,EAAE,oBAAoB,qBAkCtB;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAU7B;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAa7B;AAED,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EACjB,CAAA"}
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.EntityBox = EntityBox;
4
7
  exports.EntityBoxCollapsible = EntityBoxCollapsible;
@@ -8,6 +11,7 @@ exports.EntityBoxHeaderTitle = EntityBoxHeaderTitle;
8
11
  exports.EntityBoxBanner = EntityBoxBanner;
9
12
  exports.EntityBoxActions = EntityBoxActions;
10
13
  const jsx_runtime_1 = require("react/jsx-runtime");
14
+ const react_1 = __importDefault(require("react"));
11
15
  const utils_1 = require("../../lib/utils");
12
16
  const tooltip_1 = require("../ui/tooltip");
13
17
  const lucide_react_1 = require("lucide-react");
@@ -17,11 +21,35 @@ const separator_1 = require("../ui/separator");
17
21
  function EntityBox({ className, children, ...props }) {
18
22
  return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "entity-box", className: (0, utils_1.cn)('shadow-entity-box bg-card mb-2 flex items-center justify-between rounded-lg p-6', className), ...props, children: children }));
19
23
  }
20
- function EntityBoxCollapsible({ className, ...props }) {
21
- return ((0, jsx_runtime_1.jsx)(collapsible_1.Collapsible, { className: (0, utils_1.cn)('shadow-entity-box bg-card mb-2 flex flex-col rounded-lg', className), ...props }));
24
+ /**
25
+ * The open state, republished for the trigger.
26
+ *
27
+ * Radix keeps it in a context it does not export, and the trigger one element
28
+ * down needs it to say what activating it will DO. Mirroring it here rather
29
+ * than forcing every consumer to lift the state: all ten console call sites
30
+ * render `<EntityBoxCollapsible>` uncontrolled.
31
+ */
32
+ const EntityBoxCollapsibleContext = react_1.default.createContext(false);
33
+ function EntityBoxCollapsible({ className, open, defaultOpen, onOpenChange, ...props }) {
34
+ const [uncontrolled, setUncontrolled] = react_1.default.useState(defaultOpen ?? false);
35
+ return ((0, jsx_runtime_1.jsx)(EntityBoxCollapsibleContext.Provider, { value: open ?? uncontrolled, children: (0, jsx_runtime_1.jsx)(collapsible_1.Collapsible, { className: (0, utils_1.cn)('shadow-entity-box bg-card mb-2 flex flex-col rounded-lg', className), open: open, defaultOpen: defaultOpen, onOpenChange: (next) => {
36
+ setUncontrolled(next);
37
+ onOpenChange?.(next);
38
+ }, ...props }) }));
22
39
  }
23
- function EntityBoxCollapsibleTrigger(props) {
24
- return ((0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { ...props, asChild: true, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "secondary", className: "h-[34px] w-[34px] p-2", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Settings2, { size: 16 }) }) }));
40
+ /**
41
+ * ⛔ THIS TRIGGER HAS NO TEXT NODE. It is a `Settings2` glyph inside a Button,
42
+ * so without an `aria-label` a screen reader announced "button" and nothing
43
+ * else (SC 4.1.2) — and this is the control that opens the filter panel on
44
+ * every console list page.
45
+ *
46
+ * The name describes the ACTION and Radix's `aria-expanded` carries the state,
47
+ * so the two halves do not repeat each other. English defaults because no
48
+ * consumer passes a label today; a translated console overrides both.
49
+ */
50
+ function EntityBoxCollapsibleTrigger({ expandLabel = 'Expand', collapseLabel = 'Collapse', 'aria-label': ariaLabel, ...props }) {
51
+ const open = react_1.default.useContext(EntityBoxCollapsibleContext);
52
+ return ((0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { ...props, asChild: true, children: (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "secondary", className: "h-[34px] w-[34px] p-2", "aria-label": ariaLabel ?? (open ? collapseLabel : expandLabel), children: (0, jsx_runtime_1.jsx)(lucide_react_1.Settings2, { size: 16, "aria-hidden": true }) }) }));
25
53
  }
26
54
  function EntityBoxCollapsibleContent({ children, ...props }) {
27
55
  return ((0, jsx_runtime_1.jsxs)(collapsible_1.CollapsibleContent, { ...props, children: [(0, jsx_runtime_1.jsx)(separator_1.Separator, { orientation: "horizontal" }), (0, jsx_runtime_1.jsx)("div", { className: "grid w-full grid-cols-3 p-6", children: children })] }));
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Control, FieldPathByValue, FieldValues } from 'react-hook-form';
3
- import { type FileUploadResult } from '../../../components/ui/file-upload';
3
+ import { type FileUploadError, type FileUploadLabels, type FileUploadResult } from '../../../components/ui/file-upload';
4
4
  import { type RenderableLabel } from '../../../components/form/renderable-label';
5
5
  type FileUploadFieldOwnProps<T extends FieldValues = FieldValues> = {
6
6
  control: Control<T>;
@@ -17,6 +17,15 @@ type FileUploadFieldOwnProps<T extends FieldValues = FieldValues> = {
17
17
  maxSizeBytes?: number;
18
18
  disabled?: boolean;
19
19
  className?: string;
20
+ /**
21
+ * Override the picker's user-visible copy. Threaded straight to FileUpload;
22
+ * omitted fields keep the English defaults. Note `labels.error` governs the
23
+ * PICKER's own size/type/read refusal only — resolver messages still come
24
+ * from the schema through FormMessage.
25
+ */
26
+ labels?: FileUploadLabels;
27
+ /** Observe size, type, and read failures after the form value is cleared. */
28
+ onError?: (error: FileUploadError) => void;
20
29
  /** Optional escape hatch to also observe the picked File/clear alongside the form's text value. */
21
30
  onSelect?: (result: FileUploadResult | null) => void;
22
31
  };
@@ -47,6 +56,6 @@ export type FileUploadFieldProps<T extends FieldValues = FieldValues> = FileUplo
47
56
  * rejection; on resolver failure the FormMessage announces. Both surfaces are
48
57
  * wired.
49
58
  */
50
- export declare const FileUploadField: <T extends FieldValues = FieldValues>({ control, name, label, description, tooltip, required, accept, maxSizeBytes, disabled, className, onSelect, "aria-label": ariaLabelProp }: FileUploadFieldProps<T>) => import("react").JSX.Element;
59
+ export declare const FileUploadField: <T extends FieldValues = FieldValues>({ control, name, label, description, tooltip, required, accept, maxSizeBytes, disabled, className, labels, onError, onSelect, "aria-label": ariaLabelProp }: FileUploadFieldProps<T>) => import("react").JSX.Element;
51
60
  export {};
52
61
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/file-upload-field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAWxE,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,oCAAoC,CAAA;AAE3C,KAAK,uBAAuB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI;IAClE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;IACnB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC7C,WAAW,CAAC,EAAE,SAAS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AAA;IACnB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC7C,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IAC1C,mGAAmG;IACnG,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAA;CACrD,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAClE,uBAAuB,CAAC,CAAC,CAAC,GACxB,CACI;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAC1C,CAAA;AAEL;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,6JAelE,oBAAoB,CAAC,CAAC,CAAC,gCAoFzB,CAAA"}
@@ -22,7 +22,7 @@ const renderable_label_1 = require("../../../components/form/renderable-label");
22
22
  * rejection; on resolver failure the FormMessage announces. Both surfaces are
23
23
  * wired.
24
24
  */
25
- const FileUploadField = ({ control, name, label, description, tooltip, required, accept, maxSizeBytes, disabled, className, onSelect, 'aria-label': ariaLabelProp }) => {
25
+ const FileUploadField = ({ control, name, label, description, tooltip, required, accept, maxSizeBytes, disabled, className, labels, onError, onSelect, 'aria-label': ariaLabelProp }) => {
26
26
  const [localValue, setLocalValue] = (0, react_1.useState)(null);
27
27
  const showLabel = (0, renderable_label_1.hasRenderableLabel)(label);
28
28
  // An empty or whitespace-only aria-label is worse than none: it names the
@@ -54,11 +54,16 @@ const FileUploadField = ({ control, name, label, description, tooltip, required,
54
54
  // value carries nothing else to tell them apart. Fix needs a reset epoch
55
55
  // from react-hook-form, or a form value richer than the file text.
56
56
  const shown = localValue && field.value === localValue.text ? localValue : null;
57
- return ((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)(file_upload_1.FileUpload, { ref: field.ref, name: field.name, onBlur: field.onBlur, "aria-label": ariaLabel, accept: accept, maxSizeBytes: maxSizeBytes, disabled: disabled, className: className, value: shown, onSelect: (result) => {
57
+ return ((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)(file_upload_1.FileUpload, { ref: field.ref, name: field.name, onBlur: field.onBlur, "aria-label": ariaLabel, labels: labels, accept: accept, maxSizeBytes: maxSizeBytes, disabled: disabled, className: className, value: shown, onSelect: (result) => {
58
58
  setLocalValue(result);
59
59
  field.onChange(result?.text ?? '');
60
60
  onSelect?.(result);
61
- }, onError: () => field.onChange('') }) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {}), description && (0, jsx_runtime_1.jsx)(form_1.FormDescription, { children: description })] }));
61
+ }, onError: (error) => {
62
+ setLocalValue(null);
63
+ field.onChange('');
64
+ onSelect?.(null);
65
+ onError?.(error);
66
+ } }) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {}), description && (0, jsx_runtime_1.jsx)(form_1.FormDescription, { children: description })] }));
62
67
  } }));
63
68
  };
64
69
  exports.FileUploadField = FileUploadField;
@@ -1,9 +1,48 @@
1
- import { HTMLInputTypeAttribute, ReactNode } from 'react';
1
+ import { type InputRef } from '../../../components/ui/input';
2
+ import { HTMLInputTypeAttribute, ReactNode, Ref } from 'react';
2
3
  import { Control, FieldValues } from 'react-hook-form';
3
4
  export type InputFieldProps<T extends FieldValues = FieldValues> = {
4
5
  className?: string;
5
6
  name: string;
6
7
  type?: HTMLInputTypeAttribute;
8
+ /**
9
+ * Announce the field's own invalidity. Reaches the rendered control on BOTH
10
+ * branches, so a field with no `control` — and therefore no react-hook-form
11
+ * error state — can still tell a screen reader it is invalid.
12
+ *
13
+ * ORed with the form's error, never overriding it: `false` here cannot
14
+ * suppress a live resolver error. Nobody asked to mute a real validation
15
+ * failure, and on a financial console a muted one is a wrong number reaching
16
+ * a money path.
17
+ *
18
+ * TypeScript exempts hyphenated JSX attributes from excess-property
19
+ * checking, so passing this used to compile and then vanish.
20
+ */
21
+ 'aria-invalid'?: boolean;
22
+ /** Lower bound, forwarded to the single-line control on both branches. */
23
+ min?: number | string;
24
+ /** Upper bound, forwarded to the single-line control on both branches. */
25
+ max?: number | string;
26
+ /** Increment, forwarded to the single-line control on both branches. */
27
+ step?: number | string;
28
+ /** Character ceiling, forwarded on both branches (single-line and textarea). */
29
+ maxLength?: number;
30
+ /** Browser autofill hint. `"off"` is the one a money field usually wants. */
31
+ autoComplete?: React.HTMLInputAutoCompleteAttribute;
32
+ /** Virtual-keyboard hint, e.g. `"numeric"` or `"decimal"`. Both branches. */
33
+ inputMode?: React.HTMLAttributes<HTMLElement>['inputMode'];
34
+ /** Native validation regex. Single-line only — a textarea has no `pattern`. */
35
+ pattern?: string;
36
+ /** Focus the control on mount. React focuses the node rather than emitting an attribute. */
37
+ autoFocus?: boolean;
38
+ /**
39
+ * Imperative handle on the rendered control: `focus()`/`blur()` on the
40
+ * single-line branch, the textarea node on the `textArea` branch (which
41
+ * satisfies the same shape). COMPOSED with react-hook-form's own ref when
42
+ * `control` is present, never replacing it — the form keeps the node it
43
+ * needs for `shouldFocusError`.
44
+ */
45
+ ref?: Ref<InputRef>;
7
46
  label?: ReactNode;
8
47
  tooltip?: string;
9
48
  labelExtra?: ReactNode;
@@ -32,5 +71,5 @@ export type InputFieldProps<T extends FieldValues = FieldValues> = {
32
71
  'data-testid'?: string;
33
72
  onChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
34
73
  };
35
- export declare const InputField: <T extends FieldValues = FieldValues>({ className, type, label, tooltip, labelExtra, placeholder, description, startAdornment, endAdornment, required, readOnly, minHeight, maxHeight, textArea, defaultValue, value, onChange, ...others }: InputFieldProps<T>) => import("react").JSX.Element;
74
+ export declare const InputField: <T extends FieldValues = FieldValues>({ className, type, label, tooltip, labelExtra, placeholder, description, startAdornment, endAdornment, required, readOnly, minHeight, maxHeight, textArea, defaultValue, value, onChange, min, max, step, maxLength, autoComplete, inputMode, pattern, autoFocus, ref, "aria-invalid": ariaInvalid, ...others }: InputFieldProps<T>) => import("react").JSX.Element;
36
75
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/input-field/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,OAAO,EAAkB,WAAW,EAAQ,MAAM,iBAAiB,CAAA;AAE5E,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI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AQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,CACT,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,KACzD,IAAI,CAAA;CACV,CAAA;AA4CD,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,iTA6B7D,eAAe,CAAC,CAAC,CAAC,gCAyHpB,CAAA"}
@@ -5,8 +5,59 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const autosize_textarea_1 = require("../../../components/ui/autosize-textarea");
6
6
  const form_1 = require("../../../components/ui/form");
7
7
  const input_1 = require("../../../components/ui/input");
8
- const InputField = ({ className, type, label, tooltip, labelExtra, placeholder, description, startAdornment, endAdornment, required, readOnly, minHeight, maxHeight, textArea, defaultValue, value, onChange, ...others }) => {
9
- const renderItem = (binding) => ((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)(form_1.FormControl, { children: textArea ? ((0, jsx_runtime_1.jsx)(autosize_textarea_1.AutosizeTextarea, { className: className, placeholder: placeholder, readOnly: readOnly, minHeight: minHeight, maxHeight: maxHeight, "data-testid": others['data-testid'], ...binding })) : ((0, jsx_runtime_1.jsx)(input_1.Input, { className: className, type: type, placeholder: placeholder, readOnly: readOnly, startAdornment: startAdornment, endAdornment: endAdornment, "data-testid": others['data-testid'], ...binding })) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {}), description && (0, jsx_runtime_1.jsx)(form_1.FormDescription, { children: description })] }));
8
+ const react_1 = require("react");
9
+ /**
10
+ * Fan one node out to several refs. React hands a node to ONE ref, so a
11
+ * consumer ref and react-hook-form's `field.ref` cannot both be passed
12
+ * directly — one silently wins. Only used when the consumer actually supplied
13
+ * a ref, so a field without one keeps `field.ref`'s own identity and React
14
+ * never re-attaches it.
15
+ */
16
+ function fanOutRef(...refs) {
17
+ return (node) => {
18
+ const cleanups = [];
19
+ for (const ref of refs) {
20
+ if (typeof ref === 'function') {
21
+ const cleanup = ref(node);
22
+ cleanups.push(typeof cleanup === 'function' ? cleanup : () => ref(null));
23
+ }
24
+ else if (ref) {
25
+ ;
26
+ ref.current = node;
27
+ cleanups.push(() => {
28
+ ;
29
+ ref.current = null;
30
+ });
31
+ }
32
+ }
33
+ return () => cleanups.forEach((cleanup) => cleanup());
34
+ };
35
+ }
36
+ const InputField = ({ className, type, label, tooltip, labelExtra, placeholder, description, startAdornment, endAdornment, required, readOnly, minHeight, maxHeight, textArea, defaultValue, value, onChange, min, max, step, maxLength, autoComplete, inputMode, pattern, autoFocus, ref, 'aria-invalid': ariaInvalid, ...others }) => {
37
+ // OR with the form's error, expressed through the Slot merge rather than by
38
+ // reading the form: FormControl already injects `aria-invalid={!!error}`, and
39
+ // a child prop only wins that merge when the KEY is present. So emit the key
40
+ // only for an explicit `true`, and let FormControl answer for every other
41
+ // case. `true || error` is true; `false || error` is whatever the form says,
42
+ // which is the whole point — an explicit `false` cannot mute a live error.
43
+ // With no `control` there is no error to OR against, so FormControl injects
44
+ // `false` and today's behaviour is unchanged.
45
+ const ariaInvalidProp = ariaInvalid ? { 'aria-invalid': true } : undefined;
46
+ const formRef = (0, react_1.useRef)(undefined);
47
+ const composedRef = (0, react_1.useMemo)(() => ref ? fanOutRef((node) => formRef.current?.(node), ref) : ref,
48
+ // `others.name` belongs here, and leaving it out is not a lint nit.
49
+ // react-hook-form hands a fresh `field.ref` for every name, and that ref
50
+ // only receives the element when React reattaches, which it does only when
51
+ // this callback's identity changes. Memoised on `ref` alone, one identity
52
+ // survived a name change, the new field never got its element, and
53
+ // `form.setFocus(newName)` then found nothing to focus and said nothing.
54
+ [ref, others.name]);
55
+ const renderItem = (binding) => ((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)(form_1.FormControl, { children: textArea ? ((0, jsx_runtime_1.jsx)(autosize_textarea_1.AutosizeTextarea, { className: className, placeholder: placeholder, readOnly: readOnly, minHeight: minHeight, maxHeight: maxHeight, maxLength: maxLength, autoComplete: autoComplete, inputMode: inputMode, autoFocus: autoFocus, "data-testid": others['data-testid'], ...ariaInvalidProp, ...binding })) : ((0, jsx_runtime_1.jsx)(input_1.Input, { className: className, type: type, placeholder: placeholder, readOnly: readOnly, startAdornment: startAdornment, endAdornment: endAdornment,
56
+ // Bounds belong to the single-line control only: `min`/`max`/`step`
57
+ // mean nothing on a textarea and would render as invalid markup.
58
+ min: min, max: max, step: step, maxLength: maxLength, autoComplete: autoComplete, inputMode: inputMode,
59
+ // Single-line only: `<textarea pattern>` is not a thing.
60
+ pattern: pattern, autoFocus: autoFocus, "data-testid": others['data-testid'], ...ariaInvalidProp, ...binding })) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {}), description && (0, jsx_runtime_1.jsx)(form_1.FormDescription, { children: description })] }));
10
61
  if (!others.control) {
11
62
  return renderItem({
12
63
  name: others.name,
@@ -14,7 +65,10 @@ const InputField = ({ className, type, label, tooltip, labelExtra, placeholder,
14
65
  // Controlled when the caller holds the value, uncontrolled when it only
15
66
  // seeds one — supplying both is what React warns about.
16
67
  ...(value !== undefined ? { value } : { defaultValue }),
17
- onChange: (e) => onChange?.(e)
68
+ onChange: (e) => onChange?.(e),
69
+ // Nothing else claims the node on this branch, so the consumer ref goes
70
+ // straight through. Without it there was no node to focus at all.
71
+ ref: ref
18
72
  });
19
73
  }
20
74
  return ((0, jsx_runtime_1.jsx)(form_1.FormField, { ...others, name: others.name,
@@ -22,17 +76,21 @@ const InputField = ({ className, type, label, tooltip, labelExtra, placeholder,
22
76
  // value painted on the box only makes the field LOOK filled while the
23
77
  // form still submits nothing for that name. Controller seeds its own
24
78
  // state from this, so `field.value` carries the seed on both branches.
25
- defaultValue: defaultValue, render: ({ field }) => renderItem({
26
- ...field,
27
- // Controlled from mount. react-hook-form hands `undefined` for any
28
- // name the form declares no default for; React then mounts the box
29
- // uncontrolled and flips it on the first keystroke, losing that
30
- // character.
31
- value: field.value ?? '',
32
- onChange: (e) => {
33
- field.onChange(e);
34
- onChange?.(e);
35
- }
36
- }) }));
79
+ defaultValue: defaultValue, render: ({ field }) => {
80
+ formRef.current = field.ref;
81
+ return renderItem({
82
+ ...field,
83
+ // Controlled from mount. react-hook-form hands `undefined` for any
84
+ // name the form declares no default for; React then mounts the box
85
+ // uncontrolled and flips it on the first keystroke, losing that
86
+ // character.
87
+ value: field.value ?? '',
88
+ onChange: (e) => {
89
+ field.onChange(e);
90
+ onChange?.(e);
91
+ },
92
+ ref: (ref ? composedRef : field.ref)
93
+ });
94
+ } }));
37
95
  };
38
96
  exports.InputField = InputField;
@@ -9,6 +9,10 @@ export type PasswordFieldProps<TFieldValues extends FieldValues = FieldValues, T
9
9
  required?: boolean;
10
10
  disabled?: boolean;
11
11
  'data-testid'?: string;
12
+ /** Accessible name of the eye button while the password is hidden. */
13
+ showPasswordLabel?: string;
14
+ /** Accessible name of the eye button while the password is showing. */
15
+ hidePasswordLabel?: string;
12
16
  };
13
- export declare function PasswordField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, tooltip, placeholder, control, required, disabled, 'data-testid': dataTestId }: PasswordFieldProps<TFieldValues, TName>): React.JSX.Element;
17
+ export declare function PasswordField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, tooltip, placeholder, control, required, disabled, 'data-testid': dataTestId, showPasswordLabel, hidePasswordLabel }: PasswordFieldProps<TFieldValues, TName>): React.JSX.Element;
14
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/password-field/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAajE,MAAM,MAAM,kBAAkB,CAC5B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,IAC7D;IACF,IAAI,EAAE,KAAK,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,wBAAgB,aAAa,CAC3B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,EACA,IAAI,EACJ,KAAK,EACL,OAAO,EACP,WAAW,EACX,OAAO,EACP,QAAgB,EAChB,QAAgB,EAChB,aAAa,EAAE,UAAU,EAC1B,EAAE,kBAAkB,CAAC,YAAY,EAAE,KAAK,CAAC,qBA0CzC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/password-field/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAajE,MAAM,MAAM,kBAAkB,CAC5B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,IAC7D;IACF,IAAI,EAAE,KAAK,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,wBAAgB,aAAa,CAC3B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,EACA,IAAI,EACJ,KAAK,EACL,OAAO,EACP,WAAW,EACX,OAAO,EACP,QAAgB,EAChB,QAAgB,EAChB,aAAa,EAAE,UAAU,EACzB,iBAAmC,EACnC,iBAAmC,EACpC,EAAE,kBAAkB,CAAC,YAAY,EAAE,KAAK,CAAC,qBAuDzC"}
@@ -10,7 +10,7 @@ const form_1 = require("../../../components/ui/form");
10
10
  const input_1 = require("../../../components/ui/input");
11
11
  const lucide_react_1 = require("lucide-react");
12
12
  const icon_button_1 = require("../../../components/ui/icon-button");
13
- function PasswordField({ name, label, tooltip, placeholder, control, required = false, disabled = false, 'data-testid': dataTestId }) {
13
+ function PasswordField({ name, label, tooltip, placeholder, control, required = false, disabled = false, 'data-testid': dataTestId, showPasswordLabel = 'Show password', hidePasswordLabel = 'Hide password' }) {
14
14
  const [show, setShow] = react_1.default.useState(false);
15
- return ((0, jsx_runtime_1.jsx)(form_1.FormField, { control: control, name: name, render: ({ field }) => ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [(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)(input_1.Input, { ...field, type: show ? 'text' : 'password', placeholder: placeholder, endAdornment: (0, jsx_runtime_1.jsx)(input_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { type: "button", variant: "outline", rounded: true, onClick: () => setShow(!show), children: show ? (0, jsx_runtime_1.jsx)(lucide_react_1.EyeOff, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, {}) }) }), disabled: disabled, className: "pr-10", "data-testid": dataTestId }) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {})] })) }));
15
+ return ((0, jsx_runtime_1.jsx)(form_1.FormField, { control: control, name: name, render: ({ field }) => ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [(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)(input_1.Input, { ...field, type: show ? 'text' : 'password', placeholder: placeholder, endAdornment: (0, jsx_runtime_1.jsx)(input_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { type: "button", variant: "outline", rounded: true, "aria-label": show ? hidePasswordLabel : showPasswordLabel, onClick: () => setShow(!show), children: show ? (0, jsx_runtime_1.jsx)(lucide_react_1.EyeOff, { "aria-hidden": true }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, { "aria-hidden": true }) }) }), disabled: disabled, className: "pr-10", "data-testid": dataTestId }) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {})] })) }));
16
16
  }
@@ -13,7 +13,15 @@ type SelectFieldSharedProps<T extends FieldValues = FieldValues> = PropsWithChil
13
13
  * with `value` + `onChange`. */
14
14
  control?: Control<T>;
15
15
  required?: boolean;
16
+ /** Copy for the "nothing to pick" row. Defaults to "No options found." */
16
17
  emptyMessage?: string;
18
+ /**
19
+ * Placed on the field's own root box, merged with its spacing rather than
20
+ * replacing it. The root is the element a parent grid positions, so
21
+ * without this a consumer had to wrap the field in a spare div just to
22
+ * span a column.
23
+ */
24
+ className?: string;
17
25
  'data-testid'?: string;
18
26
  };
19
27
  /**
@@ -39,6 +47,6 @@ type SelectFieldModeProps = {
39
47
  onChange?: (value: string) => void;
40
48
  };
41
49
  export type SelectFieldProps<T extends FieldValues = FieldValues> = SelectFieldSharedProps<T> & SelectFieldModeProps;
42
- export declare const SelectField: <T extends FieldValues = FieldValues>({ name, label, tooltip, labelExtra, required, placeholder, description, disabled, readOnly, multi, control, value, children, emptyMessage, onChange, ...others }: SelectFieldProps<T>) => React.JSX.Element;
50
+ export declare const SelectField: <T extends FieldValues = FieldValues>({ name, label, tooltip, labelExtra, required, placeholder, description, disabled, readOnly, multi, control, value, children, emptyMessage, className, onChange, ...others }: SelectFieldProps<T>) => React.JSX.Element;
43
51
  export {};
44
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/select-field/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAO,EACL,OAAO,EAEP,WAAW,EAEZ,MAAM,iBAAiB,CAAA;AAExB,KAAK,sBAAsB,CAAC,CA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,CAAC,GAAG,oBAAoB,CAAA;AAWlD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,6KAkB9D,gBAAgB,CAAC,CAAC,CAAC,sBA6FrB,CAAA"}
@@ -6,14 +6,14 @@ const form_1 = require("../../../components/ui/form");
6
6
  const multiple_select_1 = require("../../../components/ui/multiple-select");
7
7
  const select_1 = require("../../../components/ui/select");
8
8
  const utils_1 = require("../../../lib/utils");
9
- const SelectField = ({ name, label, tooltip, labelExtra, required, placeholder, description, disabled, readOnly, multi, control, value, children, emptyMessage = 'No options found.', onChange, ...others }) => {
9
+ const SelectField = ({ name, label, tooltip, labelExtra, required, placeholder, description, disabled, readOnly, multi, control, value, children, emptyMessage = 'No options found.', className, onChange, ...others }) => {
10
10
  // The props union already pairs `multi` with the callback shape that branch
11
11
  // emits, but destructuring an intersection loses that correlation — TS sees
12
12
  // two unrelated callbacks. Both branches report through this one seam, each
13
13
  // with the payload its own union member declared.
14
14
  const emitChange = onChange;
15
15
  const renderItem = (field) => {
16
- 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 })), multi ? ((0, jsx_runtime_1.jsxs)(multiple_select_1.MultipleSelect, { onValueChange: (value) => {
16
+ return ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, className: className, 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 })), multi ? ((0, jsx_runtime_1.jsxs)(multiple_select_1.MultipleSelect, { onValueChange: (value) => {
17
17
  field.onChange(value);
18
18
  emitChange?.(value);
19
19
  }, disabled: disabled, ...field, children: [(0, jsx_runtime_1.jsx)(multiple_select_1.MultipleSelectTrigger, { readOnly: readOnly, children: (0, jsx_runtime_1.jsx)(multiple_select_1.MultipleSelectValue, { placeholder: placeholder }) }), (0, jsx_runtime_1.jsx)(multiple_select_1.MultipleSelectContent, { children: children })] })) : ((0, jsx_runtime_1.jsxs)(select_1.Select, { onValueChange: (value) => {
@@ -76,5 +76,5 @@ function PageHeaderCollapsibleInfoTrigger({ question }) {
76
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
77
  }
78
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-shadcn-500 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-shadcn-500" }) }) })] }) }) }));
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
80
  }