@lerianstudio/sindarian-ui 2.0.0-beta.2 → 2.0.0-beta.21

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 (227) hide show
  1. package/LICENSE +93 -0
  2. package/README.md +52 -1
  3. package/dist/components/breadcrumb/index.d.ts.map +1 -1
  4. package/dist/components/breadcrumb/index.js +25 -1
  5. package/dist/components/card/account-card/index.js +5 -5
  6. package/dist/components/card/basic-card/index.d.ts.map +1 -1
  7. package/dist/components/card/basic-card/index.js +2 -2
  8. package/dist/components/card/entity-card/index.js +1 -1
  9. package/dist/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  10. package/dist/components/dialog/confirmation-dialog/index.js +4 -1
  11. package/dist/components/entity-box/index.d.ts +18 -2
  12. package/dist/components/entity-box/index.d.ts.map +1 -1
  13. package/dist/components/entity-box/index.js +32 -4
  14. package/dist/components/form/date-picker-field/index.js +1 -1
  15. package/dist/components/form/date-range-field/index.js +1 -1
  16. package/dist/components/form/date-time-picker-field/index.js +1 -1
  17. package/dist/components/form/password-field/index.d.ts +5 -1
  18. package/dist/components/form/password-field/index.d.ts.map +1 -1
  19. package/dist/components/form/password-field/index.js +2 -2
  20. package/dist/components/form/select-field/index.d.ts +15 -1
  21. package/dist/components/form/select-field/index.d.ts.map +1 -1
  22. package/dist/components/form/select-field/index.js +28 -3
  23. package/dist/components/form/switch-field/index.d.ts.map +1 -1
  24. package/dist/components/form/switch-field/index.js +6 -1
  25. package/dist/components/page/index.d.ts +35 -1
  26. package/dist/components/page/index.d.ts.map +1 -1
  27. package/dist/components/page/index.js +6 -2
  28. package/dist/components/page-header/index.js +1 -1
  29. package/dist/components/table/id-table-cell.d.ts +13 -1
  30. package/dist/components/table/id-table-cell.d.ts.map +1 -1
  31. package/dist/components/table/id-table-cell.js +99 -9
  32. package/dist/components/table/index.d.ts +1 -0
  33. package/dist/components/table/index.d.ts.map +1 -1
  34. package/dist/components/table/index.js +1 -0
  35. package/dist/components/table/locked-table-actions.d.ts +24 -0
  36. package/dist/components/table/locked-table-actions.d.ts.map +1 -1
  37. package/dist/components/table/locked-table-actions.js +31 -1
  38. package/dist/components/table/name-table-cell.d.ts +57 -4
  39. package/dist/components/table/name-table-cell.d.ts.map +1 -1
  40. package/dist/components/table/name-table-cell.js +50 -2
  41. package/dist/components/ui/autocomplete/index.d.ts +24 -0
  42. package/dist/components/ui/autocomplete/index.d.ts.map +1 -1
  43. package/dist/components/ui/autocomplete/index.js +24 -0
  44. package/dist/components/ui/badge/index.d.ts +11 -7
  45. package/dist/components/ui/badge/index.d.ts.map +1 -1
  46. package/dist/components/ui/badge/index.js +20 -8
  47. package/dist/components/ui/button/index.d.ts +3 -3
  48. package/dist/components/ui/copy-field/index.d.ts +25 -1
  49. package/dist/components/ui/copy-field/index.d.ts.map +1 -1
  50. package/dist/components/ui/copy-field/index.js +16 -8
  51. package/dist/components/ui/dialog/index.d.ts +1 -1
  52. package/dist/components/ui/dialog/index.d.ts.map +1 -1
  53. package/dist/components/ui/dialog/index.js +2 -2
  54. package/dist/components/ui/file-upload/index.d.ts +159 -0
  55. package/dist/components/ui/file-upload/index.d.ts.map +1 -1
  56. package/dist/components/ui/file-upload/index.js +308 -6
  57. package/dist/components/ui/icon-button/index.d.ts +1 -1
  58. package/dist/components/ui/icon-button/styles.css +42 -0
  59. package/dist/components/ui/input/styles.css +79 -4
  60. package/dist/components/ui/lerian-wordmark/index.d.ts +6 -0
  61. package/dist/components/ui/lerian-wordmark/index.d.ts.map +1 -0
  62. package/dist/components/ui/lerian-wordmark/index.js +7 -0
  63. package/dist/components/ui/otp-input/index.js +1 -1
  64. package/dist/components/ui/radio-group/index.js +1 -1
  65. package/dist/components/ui/select/index.d.ts.map +1 -1
  66. package/dist/components/ui/select/index.js +8 -4
  67. package/dist/components/ui/select/styles.css +1 -1
  68. package/dist/components/ui/sheet/index.d.ts +42 -0
  69. package/dist/components/ui/sheet/index.d.ts.map +1 -1
  70. package/dist/components/ui/sheet/index.js +47 -14
  71. package/dist/components/ui/sidebar/index.d.ts +1 -0
  72. package/dist/components/ui/sidebar/index.d.ts.map +1 -1
  73. package/dist/components/ui/sidebar/index.js +1 -0
  74. package/dist/components/ui/sidebar/sidebar-expand-button.d.ts +1 -1
  75. package/dist/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
  76. package/dist/components/ui/sidebar/sidebar-expand-button.js +15 -1
  77. package/dist/components/ui/sidebar/sidebar-item.d.ts +1 -1
  78. package/dist/components/ui/sidebar/sidebar-item.d.ts.map +1 -1
  79. package/dist/components/ui/sidebar/sidebar-item.js +28 -4
  80. package/dist/components/ui/sidebar/sidebar-provider.d.ts +58 -0
  81. package/dist/components/ui/sidebar/sidebar-provider.d.ts.map +1 -1
  82. package/dist/components/ui/sidebar/sidebar-provider.js +146 -4
  83. package/dist/components/ui/sidebar/sidebar-root.d.ts +38 -1
  84. package/dist/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
  85. package/dist/components/ui/sidebar/sidebar-root.js +111 -5
  86. package/dist/components/ui/sidebar/sidebar-trigger.d.ts +45 -0
  87. package/dist/components/ui/sidebar/sidebar-trigger.d.ts.map +1 -0
  88. package/dist/components/ui/sidebar/sidebar-trigger.js +57 -0
  89. package/dist/components/ui/textarea/index.js +1 -1
  90. package/dist/components/ui/toast/toaster.d.ts +5 -1
  91. package/dist/components/ui/toast/toaster.d.ts.map +1 -1
  92. package/dist/components/ui/toast/toaster.js +3 -2
  93. package/dist/enterprise/data-table/index.d.ts +77 -7
  94. package/dist/enterprise/data-table/index.d.ts.map +1 -1
  95. package/dist/enterprise/data-table/index.js +56 -11
  96. package/dist/enterprise/date-range-picker/index.js +4 -4
  97. package/dist/enterprise/number-input/index.d.ts.map +1 -1
  98. package/dist/enterprise/number-input/index.js +1 -1
  99. package/dist/esm/components/breadcrumb/index.d.ts.map +1 -1
  100. package/dist/esm/components/breadcrumb/index.js +25 -1
  101. package/dist/esm/components/card/account-card/index.js +5 -5
  102. package/dist/esm/components/card/basic-card/index.d.ts.map +1 -1
  103. package/dist/esm/components/card/basic-card/index.js +2 -2
  104. package/dist/esm/components/card/entity-card/index.js +1 -1
  105. package/dist/esm/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  106. package/dist/esm/components/dialog/confirmation-dialog/index.js +4 -1
  107. package/dist/esm/components/entity-box/index.d.ts +18 -2
  108. package/dist/esm/components/entity-box/index.d.ts.map +1 -1
  109. package/dist/esm/components/entity-box/index.js +29 -4
  110. package/dist/esm/components/form/date-picker-field/index.js +1 -1
  111. package/dist/esm/components/form/date-range-field/index.js +1 -1
  112. package/dist/esm/components/form/date-time-picker-field/index.js +1 -1
  113. package/dist/esm/components/form/password-field/index.d.ts +5 -1
  114. package/dist/esm/components/form/password-field/index.d.ts.map +1 -1
  115. package/dist/esm/components/form/password-field/index.js +2 -2
  116. package/dist/esm/components/form/select-field/index.d.ts +15 -1
  117. package/dist/esm/components/form/select-field/index.d.ts.map +1 -1
  118. package/dist/esm/components/form/select-field/index.js +29 -4
  119. package/dist/esm/components/form/switch-field/index.d.ts.map +1 -1
  120. package/dist/esm/components/form/switch-field/index.js +7 -2
  121. package/dist/esm/components/page/index.d.ts +35 -1
  122. package/dist/esm/components/page/index.d.ts.map +1 -1
  123. package/dist/esm/components/page/index.js +6 -2
  124. package/dist/esm/components/page-header/index.js +1 -1
  125. package/dist/esm/components/table/id-table-cell.d.ts +13 -1
  126. package/dist/esm/components/table/id-table-cell.d.ts.map +1 -1
  127. package/dist/esm/components/table/id-table-cell.js +100 -7
  128. package/dist/esm/components/table/index.d.ts +1 -0
  129. package/dist/esm/components/table/index.d.ts.map +1 -1
  130. package/dist/esm/components/table/index.js +1 -0
  131. package/dist/esm/components/table/locked-table-actions.d.ts +24 -0
  132. package/dist/esm/components/table/locked-table-actions.d.ts.map +1 -1
  133. package/dist/esm/components/table/locked-table-actions.js +31 -1
  134. package/dist/esm/components/table/name-table-cell.d.ts +57 -4
  135. package/dist/esm/components/table/name-table-cell.d.ts.map +1 -1
  136. package/dist/esm/components/table/name-table-cell.js +50 -2
  137. package/dist/esm/components/ui/autocomplete/index.d.ts +24 -0
  138. package/dist/esm/components/ui/autocomplete/index.d.ts.map +1 -1
  139. package/dist/esm/components/ui/autocomplete/index.js +24 -0
  140. package/dist/esm/components/ui/badge/index.d.ts +11 -7
  141. package/dist/esm/components/ui/badge/index.d.ts.map +1 -1
  142. package/dist/esm/components/ui/badge/index.js +20 -8
  143. package/dist/esm/components/ui/button/index.d.ts +3 -3
  144. package/dist/esm/components/ui/copy-field/index.d.ts +25 -1
  145. package/dist/esm/components/ui/copy-field/index.d.ts.map +1 -1
  146. package/dist/esm/components/ui/copy-field/index.js +16 -8
  147. package/dist/esm/components/ui/dialog/index.d.ts +1 -1
  148. package/dist/esm/components/ui/dialog/index.d.ts.map +1 -1
  149. package/dist/esm/components/ui/dialog/index.js +3 -3
  150. package/dist/esm/components/ui/file-upload/index.d.ts +159 -0
  151. package/dist/esm/components/ui/file-upload/index.d.ts.map +1 -1
  152. package/dist/esm/components/ui/file-upload/index.js +307 -5
  153. package/dist/esm/components/ui/icon-button/index.d.ts +1 -1
  154. package/dist/esm/components/ui/lerian-wordmark/index.d.ts +6 -0
  155. package/dist/esm/components/ui/lerian-wordmark/index.d.ts.map +1 -0
  156. package/dist/esm/components/ui/lerian-wordmark/index.js +4 -0
  157. package/dist/esm/components/ui/otp-input/index.js +1 -1
  158. package/dist/esm/components/ui/radio-group/index.js +1 -1
  159. package/dist/esm/components/ui/select/index.d.ts.map +1 -1
  160. package/dist/esm/components/ui/select/index.js +8 -4
  161. package/dist/esm/components/ui/sheet/index.d.ts +42 -0
  162. package/dist/esm/components/ui/sheet/index.d.ts.map +1 -1
  163. package/dist/esm/components/ui/sheet/index.js +48 -15
  164. package/dist/esm/components/ui/sidebar/index.d.ts +1 -0
  165. package/dist/esm/components/ui/sidebar/index.d.ts.map +1 -1
  166. package/dist/esm/components/ui/sidebar/index.js +1 -0
  167. package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts +1 -1
  168. package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
  169. package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +15 -1
  170. package/dist/esm/components/ui/sidebar/sidebar-item.d.ts +1 -1
  171. package/dist/esm/components/ui/sidebar/sidebar-item.d.ts.map +1 -1
  172. package/dist/esm/components/ui/sidebar/sidebar-item.js +28 -4
  173. package/dist/esm/components/ui/sidebar/sidebar-provider.d.ts +58 -0
  174. package/dist/esm/components/ui/sidebar/sidebar-provider.d.ts.map +1 -1
  175. package/dist/esm/components/ui/sidebar/sidebar-provider.js +143 -1
  176. package/dist/esm/components/ui/sidebar/sidebar-root.d.ts +38 -1
  177. package/dist/esm/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
  178. package/dist/esm/components/ui/sidebar/sidebar-root.js +113 -7
  179. package/dist/esm/components/ui/sidebar/sidebar-trigger.d.ts +45 -0
  180. package/dist/esm/components/ui/sidebar/sidebar-trigger.d.ts.map +1 -0
  181. package/dist/esm/components/ui/sidebar/sidebar-trigger.js +53 -0
  182. package/dist/esm/components/ui/textarea/index.js +1 -1
  183. package/dist/esm/components/ui/toast/toaster.d.ts +5 -1
  184. package/dist/esm/components/ui/toast/toaster.d.ts.map +1 -1
  185. package/dist/esm/components/ui/toast/toaster.js +3 -2
  186. package/dist/esm/enterprise/data-table/index.d.ts +77 -7
  187. package/dist/esm/enterprise/data-table/index.d.ts.map +1 -1
  188. package/dist/esm/enterprise/data-table/index.js +57 -12
  189. package/dist/esm/enterprise/date-range-picker/index.js +4 -4
  190. package/dist/esm/enterprise/number-input/index.d.ts.map +1 -1
  191. package/dist/esm/enterprise/number-input/index.js +1 -1
  192. package/dist/esm/hooks/use-toast.d.ts +18 -2
  193. package/dist/esm/hooks/use-toast.d.ts.map +1 -1
  194. package/dist/esm/hooks/use-toast.js +60 -16
  195. package/dist/esm/index.d.ts +3 -0
  196. package/dist/esm/index.d.ts.map +1 -1
  197. package/dist/esm/index.js +3 -0
  198. package/dist/esm/lib/utils.d.ts +2 -0
  199. package/dist/esm/lib/utils.d.ts.map +1 -1
  200. package/dist/esm/lib/utils.js +10 -0
  201. package/dist/esm/toast/helpers.d.ts +13 -0
  202. package/dist/esm/toast/helpers.d.ts.map +1 -1
  203. package/dist/esm/toast/helpers.js +8 -1
  204. package/dist/fonts/OFL.txt +96 -0
  205. package/dist/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
  206. package/dist/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
  207. package/dist/fonts/ibm-plex-serif-latin-400.woff2 +0 -0
  208. package/dist/fonts/ibm-plex-serif-latin-500.woff2 +0 -0
  209. package/dist/fonts/inter-latin.woff2 +0 -0
  210. package/dist/fonts.css +46 -0
  211. package/dist/globals.css +62 -362
  212. package/dist/hooks/use-toast.d.ts +18 -2
  213. package/dist/hooks/use-toast.d.ts.map +1 -1
  214. package/dist/hooks/use-toast.js +61 -16
  215. package/dist/index.d.ts +3 -0
  216. package/dist/index.d.ts.map +1 -1
  217. package/dist/index.js +3 -0
  218. package/dist/lib/utils.d.ts +2 -0
  219. package/dist/lib/utils.d.ts.map +1 -1
  220. package/dist/lib/utils.js +11 -0
  221. package/dist/public/wordmark.svg +1 -0
  222. package/dist/standalone.css +10 -0
  223. package/dist/toast/helpers.d.ts +13 -0
  224. package/dist/toast/helpers.d.ts.map +1 -1
  225. package/dist/toast/helpers.js +8 -1
  226. package/dist/tokens.css +367 -0
  227. package/package.json +9 -6
@@ -1,4 +1,38 @@
1
1
  export declare function PageRoot({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
2
2
  export declare function PageView({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
3
- export declare function PageContent({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
3
+ export type PageContentProps = React.ComponentProps<'div'> & {
4
+ /**
5
+ * How much room the container spends on padding.
6
+ *
7
+ * `'default'` is 64px a side at every width, and it is what every consumer
8
+ * that does not ask for anything gets, class for class.
9
+ *
10
+ * `'compact'` adds 16px a side below `sm` (640px) and changes nothing above
11
+ * it. On a 390px phone the default spends 128px — a third of the screen —
12
+ * before the page has drawn anything: measured at 390 on ten Product Console
13
+ * screens across Midaz, Pix, Payments, Reporter, Tracer, Flowker and
14
+ * Settings, each was left with 262px of content, and the pages adding their
15
+ * own `px-24` inside it were down to 70px, which is where a transaction
16
+ * receipt's amount ran off its card.
17
+ *
18
+ * WHY `max-sm:p-4` AND NOT THE MOBILE-FIRST `p-4 sm:p-16`. A base `p-4`
19
+ * REPLACES `p-16` for every caller, and `sm:p-16` then re-imposes 64px at
20
+ * desktop on the pages that deliberately asked for something else — a
21
+ * full-bleed page would grow a 64px frame at 1440. `max-sm:` only ADDS a rule
22
+ * below `sm`, so every call site renders identically from 640px up, whatever
23
+ * padding it passes.
24
+ *
25
+ * HOW A CALLER OPTS OUT. Pass the phone value too: `className="p-0
26
+ * max-sm:p-0"`. `cn` is tailwind-merge, so the caller's `max-sm:p-0` replaces
27
+ * this rule rather than stacking with it.
28
+ *
29
+ * AND AN AXIS PADDING HAS TO REPEAT ITSELF: `className="px-6 max-sm:px-6"`,
30
+ * never `px-6` alone. tailwind-merge does not treat `max-sm:p-4` and `px-6`
31
+ * as the same group, so it drops neither, and CSS then gives the media-query
32
+ * rule the last word — a lone `px-6` is silently 16px on both axes on a
33
+ * phone.
34
+ */
35
+ padding?: 'default' | 'compact';
36
+ };
37
+ export declare function PageContent({ className, padding, ...props }: PageContentProps): import("react").JSX.Element;
4
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/page/index.tsx"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAW5E;AAED,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAQ5E;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAQ7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/page/index.tsx"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAW5E;AAED,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAQ5E;AAED,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CAChC,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,gBAAgB,+BAelB"}
@@ -11,6 +11,10 @@ function PageRoot({ className, ...props }) {
11
11
  function PageView({ className, ...props }) {
12
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
13
  }
14
- function PageContent({ className, ...props }) {
15
- 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', className), ...props }));
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 }));
16
20
  }
@@ -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
  }
@@ -2,6 +2,18 @@ import { TableCell } from '../../components/ui/table';
2
2
  export type IdTableCellProps = Omit<React.ComponentProps<typeof TableCell>, 'onCopy'> & {
3
3
  id?: string;
4
4
  onCopy?: (id: string) => void;
5
+ /** Characters kept from the start of the id. */
6
+ head?: number;
7
+ /** Characters kept from the end of the id. */
8
+ tail?: number;
9
+ /**
10
+ * Accessible name for the copy button. Override for localization; the kit
11
+ * ships no i18n. The id is deliberately NOT interpolated into it — a column
12
+ * of thirty rows would announce thirty different names for the same action,
13
+ * and the id is already the cell's text and its `title`.
14
+ * @defaultValue 'Copy id'
15
+ */
16
+ copyLabel?: string;
5
17
  };
6
- export declare const IdTableCell: ({ id, onCopy, ...others }: IdTableCellProps) => import("react").JSX.Element;
18
+ export declare const IdTableCell: ({ id, onCopy, head, tail, copyLabel, ...others }: IdTableCellProps) => import("react").JSX.Element;
7
19
  //# sourceMappingURL=id-table-cell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"id-table-cell.d.ts","sourceRoot":"","sources":["../../../src/components/table/id-table-cell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGV,MAAM,uBAAuB,CAAA;AAU9B,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EACtC,QAAQ,CACT,GAAG;IACF,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,2BAA2B,gBAAgB,gCAqBtE,CAAA"}
1
+ {"version":3,"file":"id-table-cell.d.ts","sourceRoot":"","sources":["../../../src/components/table/id-table-cell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,uBAAuB,CAAA;AASnE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EACtC,QAAQ,CACT,GAAG;IACF,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AA6CD,eAAO,MAAM,WAAW,GAAI,kDAOzB,gBAAgB,gCAqFlB,CAAA"}
@@ -1,19 +1,109 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.IdTableCell = void 0;
7
4
  const jsx_runtime_1 = require("react/jsx-runtime");
8
5
  const table_1 = require("../../components/ui/table");
9
6
  const tooltip_1 = require("../../components/ui/tooltip");
10
- const truncate_js_1 = __importDefault(require("lodash/truncate.js"));
11
7
  const lucide_react_1 = require("lucide-react");
12
- const IdTableCell = ({ id, onCopy, ...others }) => {
13
- const handleCopyToClipboard = () => {
14
- navigator.clipboard.writeText(id);
15
- onCopy?.(id);
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
+ }
16
80
  };
17
- return ((0, jsx_runtime_1.jsx)(table_1.TableCell, { onClick: handleCopyToClipboard, ...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: (0, truncate_js_1.default)(id, { length: 16 }) }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { children: id })] }) }), (0, jsx_runtime_1.jsx)(table_1.TableCellAction, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "size-3.5" }) })] }) }));
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] }) }));
18
108
  };
19
109
  exports.IdTableCell = IdTableCell;
@@ -1,3 +1,4 @@
1
1
  export * from './id-table-cell';
2
+ export * from './locked-table-actions';
2
3
  export * from './name-table-cell';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA"}
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./id-table-cell"), exports);
18
+ __exportStar(require("./locked-table-actions"), exports);
18
19
  __exportStar(require("./name-table-cell"), exports);
@@ -1,7 +1,31 @@
1
1
  import React from 'react';
2
2
  export type LockedTableActionsProps = {
3
+ /** Why this record cannot be changed. It is the control's accessible name as well as the tooltip's text. */
3
4
  message: string;
4
5
  className?: string;
5
6
  };
7
+ /**
8
+ * Where a row's action menu would be, on a record the ledger will not let
9
+ * anyone change — an external account, in double-entry terms.
10
+ *
11
+ * ⛔ THE TRIGGER IS A BUTTON. It used to be a `<div>`, so the ONLY explanation
12
+ * of why the menu is gone lived in a tooltip that a keyboard could not open and
13
+ * a screen reader had nothing to attach to: the row simply had one control
14
+ * fewer, unexplained.
15
+ *
16
+ * `aria-disabled`, not the `disabled` attribute: a truly disabled button takes
17
+ * no focus and fires no pointer events, so it would announce as unavailable and
18
+ * then refuse to open the tooltip that says WHY — the same dead end in a
19
+ * different shape. This one is reachable, announces its reason as its name,
20
+ * opens the tooltip on focus as well as hover, and does nothing when pressed.
21
+ *
22
+ * ⛔ DOING NOTHING TAKES A HANDLER. `aria-disabled` is a promise to the
23
+ * accessibility tree, not to the DOM: the press really does dispatch a click,
24
+ * and a click bubbles. Consumers put this where a row's action menu would be,
25
+ * in rows that open the record — so with no handler of its own the one control
26
+ * that says "you cannot change this" would open the record it refuses to
27
+ * change, from a pointer and, because a button turns Enter and Space into
28
+ * clicks, from a keyboard too.
29
+ */
6
30
  export declare const LockedTableActions: ({ message, className }: LockedTableActionsProps) => React.JSX.Element;
7
31
  //# sourceMappingURL=locked-table-actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"locked-table-actions.d.ts","sourceRoot":"","sources":["../../../src/components/table/locked-table-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,wBAGhC,uBAAuB,sBAkBzB,CAAA"}
1
+ {"version":3,"file":"locked-table-actions.d.ts","sourceRoot":"","sources":["../../../src/components/table/locked-table-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,MAAM,MAAM,uBAAuB,GAAG;IACpC,4GAA4G;IAC5G,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,kBAAkB,GAAI,wBAGhC,uBAAuB,sBA6BzB,CAAA"}
@@ -5,7 +5,37 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const lucide_react_1 = require("lucide-react");
6
6
  const tooltip_1 = require("../../components/ui/tooltip");
7
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
+ */
8
31
  const LockedTableActions = ({ message, className }) => {
9
- 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)("div", { className: (0, utils_1.cn)('border-border bg-muted flex size-9 items-center justify-center rounded-md border', 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 })] }) }));
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 })] }) }));
10
40
  };
11
41
  exports.LockedTableActions = LockedTableActions;
@@ -1,6 +1,59 @@
1
1
  import { TableCell } from '../ui/table';
2
- export type NameTableCellProps = React.ComponentProps<typeof TableCell> & {
3
- name?: string | React.ReactNode;
4
- };
5
- export declare const NameTableCell: ({ name, ...props }: NameTableCellProps) => import("react").JSX.Element;
2
+ /** Opens the record. Lands on a real button, never on the `<td>`. */
3
+ type OpenRecord = React.MouseEventHandler<HTMLButtonElement>;
4
+ export type NameTableCellProps = Omit<React.ComponentProps<typeof TableCell>, 'onClick'> &
5
+ /**
6
+ * Three shapes, and the only one missing is an interactive cell that can
7
+ * carry no accessible name.
8
+ *
9
+ * 1. A text `name` IS the button's accessible name, so the handler is free
10
+ * and `buttonLabel` merely overrides what the button announces.
11
+ * 2. Anything else rendered inside the button — a badge, an icon, an italic
12
+ * placeholder — may carry no text at all, so it has to name its button.
13
+ * 3. No handler, no control: text in a table has nothing to name.
14
+ */
15
+ ({
16
+ name: string;
17
+ onClick?: OpenRecord;
18
+ buttonLabel?: string;
19
+ } | {
20
+ name?: React.ReactNode;
21
+ onClick: OpenRecord;
22
+ buttonLabel: string;
23
+ } | {
24
+ name?: React.ReactNode;
25
+ onClick?: never;
26
+ buttonLabel?: never;
27
+ });
28
+ /**
29
+ * The name column, which is how an operator opens a record from a list.
30
+ *
31
+ * ⛔ THE CLICK IS A BUTTON, NEVER THE `<td>`. The cell had no click prop at
32
+ * all, so a consumer wanting a clickable name put `onClick` on the `<td>`
33
+ * through the spread props: a pointer user saw an affordance under a
34
+ * `<p class="cursor-pointer">`, and a keyboard or screen-reader user got a
35
+ * table cell with no control in it — the row's only route to the record was
36
+ * unreachable. `onClick` is now `Omit`ed from the inherited cell props, so the
37
+ * `<td>` handler is unrepresentable and the compiler says so at the call site.
38
+ *
39
+ * And with no handler there is no pointer cursor: text that says it is
40
+ * clickable and is not is worse than plain text.
41
+ *
42
+ * ⛔ AN INTERACTIVE CELL CANNOT BE ANONYMOUS. `name` renders INSIDE the button,
43
+ * so whatever it renders is the button's accessible name — and a `ReactNode` is
44
+ * free to render no text at all, which announces as a bare "button" and leaves
45
+ * the row's only route to its record as unreachable as the `<td>` handler
46
+ * above. The props are a union rather than a comment: a text `name` names the
47
+ * button by itself, anything else has to pass `buttonLabel`, and a cell with no
48
+ * handler is exempt because it holds no control.
49
+ *
50
+ * `buttonLabel` and not an inherited `aria-label`, which the spread puts on the
51
+ * `<td>` — naming the CELL, never the control inside it.
52
+ *
53
+ * ⛔ AND THE UNION STILL LETS THE EMPTY STRING THROUGH, because every string
54
+ * type does. `name=""` satisfies the text arm and `buttonLabel=" "` satisfies
55
+ * the labelled one, so the last word is the component's, below.
56
+ */
57
+ export declare const NameTableCell: ({ name, onClick, buttonLabel, ...props }: NameTableCellProps) => import("react").JSX.Element;
58
+ export {};
6
59
  //# sourceMappingURL=name-table-cell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"name-table-cell.d.ts","sourceRoot":"","sources":["../../../src/components/table/name-table-cell.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAqC,MAAM,aAAa,CAAA;AAE1E,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IACxE,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,oBAAoB,kBAAkB,gCAWnE,CAAA"}
1
+ {"version":3,"file":"name-table-cell.d.ts","sourceRoot":"","sources":["../../../src/components/table/name-table-cell.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAqC,MAAM,aAAa,CAAA;AAE1E,qEAAqE;AACrE,KAAK,UAAU,GAAG,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;AAE5D,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EACtC,SAAS,CACV;AACC;;;;;;;;;GASG;AACH,CACI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,UAAU,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5D;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,OAAO,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACpE;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,CACnE,CAAA;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,aAAa,GAAI,0CAK3B,kBAAkB,gCAgDpB,CAAA"}
@@ -4,7 +4,55 @@ exports.NameTableCell = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const lucide_react_1 = require("lucide-react");
6
6
  const table_1 = require("../ui/table");
7
- const NameTableCell = ({ name, ...props }) => {
8
- return ((0, jsx_runtime_1.jsx)(table_1.TableCell, { ...props, children: (0, jsx_runtime_1.jsxs)(table_1.TableCellWrapper, { children: [(0, jsx_runtime_1.jsx)("p", { className: "cursor-pointer", children: name }), (0, jsx_runtime_1.jsx)(table_1.TableCellAction, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Search, { className: "size-3.5" }) })] }) }));
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" }) })] }) }));
9
57
  };
10
58
  exports.NameTableCell = NameTableCell;
@@ -25,14 +25,29 @@ export type AutocompleteTriggerProps = React.ComponentProps<'div'> & {
25
25
  clearLabel?: string;
26
26
  };
27
27
  export declare function AutocompleteTrigger({ ref, className, onClear, clearLabel, children }: AutocompleteTriggerProps): React.JSX.Element;
28
+ export declare namespace AutocompleteTrigger {
29
+ var displayName: string;
30
+ }
28
31
  export declare function AutocompleteValue({ ref, className, value: valueProp, onValueChange, onBlur, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
32
+ export declare namespace AutocompleteValue {
33
+ var displayName: string;
34
+ }
29
35
  export type AutocompleteMultipleValueProps = React.ComponentProps<typeof CommandPrimitive.Input> & {
30
36
  /** Accessible label for each chip's remove button, prefixed to its value. */
31
37
  clearLabel?: string;
32
38
  };
33
39
  export declare function AutocompleteMultipleValue({ ref, className, clearLabel, ...props }: AutocompleteMultipleValueProps): React.JSX.Element;
40
+ export declare namespace AutocompleteMultipleValue {
41
+ var displayName: string;
42
+ }
34
43
  export declare function AutocompleteEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element | null;
44
+ export declare namespace AutocompleteEmpty {
45
+ var displayName: string;
46
+ }
35
47
  export declare function AutocompleteLoading({ className, ref, ...props }: React.ComponentProps<typeof CommandPrimitive.Loading>): React.JSX.Element;
48
+ export declare namespace AutocompleteLoading {
49
+ var displayName: string;
50
+ }
36
51
  export declare const SIDE_OPTIONS: string[];
37
52
  type Side = (typeof SIDE_OPTIONS)[number];
38
53
  export type AutocompleteContentProps = React.ComponentProps<typeof CommandPrimitive.List> & {
@@ -41,7 +56,13 @@ export type AutocompleteContentProps = React.ComponentProps<typeof CommandPrimit
41
56
  onPointerDownOutside?: (event: MouseEvent | TouchEvent) => void;
42
57
  };
43
58
  export declare function AutocompleteContent({ className, position, side, ref, children, onMouseEnter, onMouseLeave, onPointerDownOutside, ...props }: AutocompleteContentProps): React.JSX.Element;
59
+ export declare namespace AutocompleteContent {
60
+ var displayName: string;
61
+ }
44
62
  export declare function AutocompleteGroup({ className, ...props }: React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>): React.JSX.Element;
63
+ export declare namespace AutocompleteGroup {
64
+ var displayName: string;
65
+ }
45
66
  export type AutocompleteItemProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item> & {
46
67
  /** Text this option reads as wherever it is rendered outside the list (the
47
68
  * input, a chip and its remove button). Required only when the children are
@@ -78,5 +99,8 @@ export type AutocompleteProps = Omit<React.ComponentProps<typeof CommandPrimitiv
78
99
  multiple?: boolean;
79
100
  };
80
101
  export declare function Autocomplete({ ref, value, defaultValue, onValueChange, onClear, className, open: openProp, onOpenChange, showValue, readOnly, disabled, multiple, onKeyDown, children, ...props }: AutocompleteProps): React.JSX.Element;
102
+ export declare namespace Autocomplete {
103
+ var displayName: string;
104
+ }
81
105
  export {};
82
106
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/autocomplete/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAmB,MAAM,MAAM,CAAA;AAInE,MAAM,MAAM,uBAAuB,GACjC,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,GAAG;IAC3C,sCAAsC;IACtC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,CAAA;IAC7B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,cAAc,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,CAAC,IAAI,EAA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BAAiB,qBAmInB;yBAnJe,YAAY"}
@@ -414,3 +414,27 @@ function Autocomplete({ ref, value, defaultValue, onValueChange, onClear, classN
414
414
  onKeyDown?.(e);
415
415
  }, children: children }) }));
416
416
  }
417
+ /**
418
+ * ⛔ THE REST OF THE SET, FOR THE SAME REASON AS `AutocompleteItem` ABOVE.
419
+ *
420
+ * A function component's `name` is whatever the bundler left it — one letter in
421
+ * a production build — so any lookup written against `child.type` needs an
422
+ * explicit string to compare. `AutocompleteItem` is the only part the walk
423
+ * reads TODAY, and it is the part that shipped an empty option registry to
424
+ * every consumer while it was anonymous. Naming the whole set costs a line each
425
+ * and removes the next instance of that defect before it is written; it also
426
+ * makes these parts legible in a React tree, which `MultipleSelect` next door
427
+ * has always done.
428
+ *
429
+ * `__tests__`-style enumeration lives in `autocomplete.test.tsx`: it reads the
430
+ * module's exports rather than a list, so a new part added without a name fails
431
+ * without anyone remembering to extend anything.
432
+ */
433
+ Autocomplete.displayName = 'Autocomplete';
434
+ AutocompleteTrigger.displayName = 'AutocompleteTrigger';
435
+ AutocompleteValue.displayName = 'AutocompleteValue';
436
+ AutocompleteMultipleValue.displayName = 'AutocompleteMultipleValue';
437
+ AutocompleteContent.displayName = 'AutocompleteContent';
438
+ AutocompleteGroup.displayName = 'AutocompleteGroup';
439
+ AutocompleteEmpty.displayName = 'AutocompleteEmpty';
440
+ AutocompleteLoading.displayName = 'AutocompleteLoading';
@@ -1,12 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
- /**
4
- * `credit` is the accounting reading of a credit amount, NOT an alias of
5
- * `destructive` (an error/alarm). The credit role is a tint-and-ink pair:
6
- * `--credit-foreground` mirrors `--credit` by contract, so the red carries the
7
- * role as text over a tinted surface. Do not "fix" this into a solid
8
- * `bg-credit` fill — that renders red-on-red and is invisible.
9
- */
10
3
  /**
11
4
  * `gap-1` is load-bearing, not decoration: a badge holding a label AND an
12
5
  * element child (`ID<code>ctx-123</code>`) has nothing between them otherwise —
@@ -14,6 +7,17 @@ import { type VariantProps } from 'class-variance-authority';
14
7
  * anonymous flex item — so the screen reads `IDctx-123`. Consumers were pasting
15
8
  * `className="gap-1"` per call site; `cn` runs tailwind-merge, so an explicit
16
9
  * `gap-2` still wins. Single-child badges are unaffected: gap needs two items.
10
+ *
11
+ * `whitespace-nowrap` keeps the pill a pill. `rounded-full` draws the ends as
12
+ * semicircles sized to ONE line box, so a label that wraps stretches those caps
13
+ * over two lines and the shape reads as a rounded blob, not a token. It bit a
14
+ * consumer table whose column was sized to its content: `min-content` on
15
+ * wrappable text resolves to the WIDEST WORD, so a three-word group name landed
16
+ * at 112px wide and 46px tall against the 26px of a single-line badge. Nowrap
17
+ * also pins `min-content` to the full label, which is what lets a caller cap the
18
+ * box with `max-w-*` plus a truncating child and get an ellipsis. A caller that
19
+ * genuinely wants a wrapping badge passes `whitespace-normal`; tailwind-merge
20
+ * lets it win.
17
21
  */
18
22
  declare const badgeVariants: (props?: ({
19
23
  variant?: "default" | "secondary" | "outline" | "destructive" | "alert" | "success" | "active" | "inactive" | "credit" | "error" | "info" | "purple" | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE;;;;;;GAMG;AACH;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa;;;8EA6ClB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GACnD,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE5D,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,qBAsBzE;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,aAAa;;;8EAqDlB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GACnD,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE5D,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,qBAsBzE;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}