@godxjp/ui 19.6.0 → 20.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/README.md +8 -2
  2. package/dist/app/theme-axes.d.ts +2 -0
  3. package/dist/app/theme-axes.js +45 -0
  4. package/dist/components/charts/chart-cartesian.d.ts +2 -1
  5. package/dist/components/charts/chart-cartesian.js +52 -3
  6. package/dist/components/charts/chart-category-axis.d.ts +55 -0
  7. package/dist/components/charts/chart-category-axis.js +93 -0
  8. package/dist/components/charts/chart-frame.d.ts +10 -1
  9. package/dist/components/charts/chart-frame.js +19 -3
  10. package/dist/components/charts/compact-bar-trend.d.ts +1 -1
  11. package/dist/components/charts/compact-bar-trend.js +2 -0
  12. package/dist/components/charts/pie-chart.d.ts +1 -1
  13. package/dist/components/charts/pie-chart.js +12 -1
  14. package/dist/components/charts/recharts-peer.d.ts +49 -0
  15. package/dist/components/charts/recharts-peer.js +45 -0
  16. package/dist/components/data-display/card.d.ts +14 -3
  17. package/dist/components/data-display/card.js +22 -4
  18. package/dist/components/data-display/code-block.js +6 -2
  19. package/dist/components/data-display/collapsible.d.ts +23 -4
  20. package/dist/components/data-display/collapsible.js +119 -4
  21. package/dist/components/data-display/data-table.d.ts +39 -4
  22. package/dist/components/data-display/data-table.js +802 -270
  23. package/dist/components/data-display/descriptions.d.ts +27 -6
  24. package/dist/components/data-display/descriptions.js +58 -17
  25. package/dist/components/data-display/index.d.ts +5 -1
  26. package/dist/components/data-display/index.js +4 -0
  27. package/dist/components/data-display/legend.d.ts +15 -0
  28. package/dist/components/data-display/legend.js +11 -0
  29. package/dist/components/data-display/list-row.d.ts +10 -1
  30. package/dist/components/data-display/list-row.js +8 -2
  31. package/dist/components/data-display/popover.d.ts +60 -7
  32. package/dist/components/data-display/popover.js +268 -39
  33. package/dist/components/data-display/progress.d.ts +50 -2
  34. package/dist/components/data-display/progress.js +57 -9
  35. package/dist/components/data-display/range-timeline.d.ts +38 -0
  36. package/dist/components/data-display/range-timeline.js +161 -0
  37. package/dist/components/data-display/scroll-area.js +13 -2
  38. package/dist/components/data-display/service-launcher-card.js +10 -10
  39. package/dist/components/data-display/table.d.ts +11 -3
  40. package/dist/components/data-display/table.js +48 -18
  41. package/dist/components/data-display/tree-list.js +4 -9
  42. package/dist/components/data-entry/calendar.d.ts +2 -2
  43. package/dist/components/data-entry/calendar.js +79 -33
  44. package/dist/components/data-entry/cascader.d.ts +1 -1
  45. package/dist/components/data-entry/cascader.js +188 -24
  46. package/dist/components/data-entry/checkbox.d.ts +19 -6
  47. package/dist/components/data-entry/checkbox.js +55 -16
  48. package/dist/components/data-entry/choice-option.d.ts +1 -1
  49. package/dist/components/data-entry/color-picker.d.ts +1 -1
  50. package/dist/components/data-entry/color-picker.js +17 -5
  51. package/dist/components/data-entry/control-appearance.d.ts +64 -0
  52. package/dist/components/data-entry/control-appearance.js +39 -0
  53. package/dist/components/data-entry/control-surface.d.ts +61 -0
  54. package/dist/components/data-entry/control-surface.js +39 -0
  55. package/dist/components/data-entry/date-picker.d.ts +1 -1
  56. package/dist/components/data-entry/date-picker.js +344 -113
  57. package/dist/components/data-entry/date-range-picker.d.ts +2 -2
  58. package/dist/components/data-entry/date-range-picker.js +278 -140
  59. package/dist/components/data-entry/field.js +0 -1
  60. package/dist/components/data-entry/form-field.d.ts +1 -1
  61. package/dist/components/data-entry/form-field.js +39 -4
  62. package/dist/components/data-entry/form.d.ts +4 -0
  63. package/dist/components/data-entry/form.js +5 -3
  64. package/dist/components/data-entry/index.d.ts +7 -3
  65. package/dist/components/data-entry/index.js +10 -1
  66. package/dist/components/data-entry/input-otp.d.ts +1 -1
  67. package/dist/components/data-entry/input.d.ts +12 -34
  68. package/dist/components/data-entry/input.js +92 -24
  69. package/dist/components/data-entry/label.d.ts +3 -2
  70. package/dist/components/data-entry/label.js +23 -10
  71. package/dist/components/data-entry/month-picker.d.ts +2 -2
  72. package/dist/components/data-entry/month-picker.js +47 -10
  73. package/dist/components/data-entry/month-range-picker.d.ts +2 -2
  74. package/dist/components/data-entry/month-range-picker.js +51 -11
  75. package/dist/components/data-entry/number-input.d.ts +7 -0
  76. package/dist/components/data-entry/number-input.js +147 -98
  77. package/dist/components/data-entry/password-input.d.ts +1 -1
  78. package/dist/components/data-entry/radio.d.ts +1 -1
  79. package/dist/components/data-entry/radio.js +61 -13
  80. package/dist/components/data-entry/search-input.d.ts +1 -1
  81. package/dist/components/data-entry/search-input.js +16 -2
  82. package/dist/components/data-entry/search-select.d.ts +2 -2
  83. package/dist/components/data-entry/search-select.js +209 -78
  84. package/dist/components/data-entry/select.d.ts +22 -4
  85. package/dist/components/data-entry/select.js +215 -163
  86. package/dist/components/data-entry/slider.d.ts +9 -1
  87. package/dist/components/data-entry/slider.js +87 -9
  88. package/dist/components/data-entry/switch.d.ts +3 -0
  89. package/dist/components/data-entry/switch.js +29 -3
  90. package/dist/components/data-entry/textarea.d.ts +14 -56
  91. package/dist/components/data-entry/textarea.js +80 -33
  92. package/dist/components/data-entry/time-picker.d.ts +2 -2
  93. package/dist/components/data-entry/time-picker.js +333 -109
  94. package/dist/components/data-entry/time-range-picker.d.ts +5 -0
  95. package/dist/components/data-entry/time-range-picker.js +89 -0
  96. package/dist/components/data-entry/transfer.d.ts +1 -1
  97. package/dist/components/data-entry/transfer.js +99 -31
  98. package/dist/components/data-entry/tree-select-strategy.d.ts +1 -1
  99. package/dist/components/data-entry/tree-select.d.ts +1 -1
  100. package/dist/components/data-entry/tree-select.js +197 -92
  101. package/dist/components/data-entry/tree-utils.d.ts +1 -1
  102. package/dist/components/data-entry/tree-utils.js +7 -14
  103. package/dist/components/data-entry/upload-files.d.ts +2 -0
  104. package/dist/components/data-entry/upload-files.js +31 -0
  105. package/dist/components/data-entry/upload-request.d.ts +4 -0
  106. package/dist/components/data-entry/upload-request.js +53 -0
  107. package/dist/components/data-entry/upload-types.d.ts +28 -0
  108. package/dist/components/data-entry/upload-types.js +2 -0
  109. package/dist/components/data-entry/upload.d.ts +2 -2
  110. package/dist/components/data-entry/upload.js +482 -117
  111. package/dist/components/feedback/dialog.d.ts +105 -38
  112. package/dist/components/feedback/dialog.js +268 -193
  113. package/dist/components/feedback/overlay-close-focus.d.ts +31 -0
  114. package/dist/components/feedback/overlay-close-focus.js +31 -0
  115. package/dist/components/feedback/overlay-header-tone.d.ts +1 -1
  116. package/dist/components/feedback/sheet.d.ts +53 -11
  117. package/dist/components/feedback/sheet.js +150 -81
  118. package/dist/components/feedback/tooltip.d.ts +51 -7
  119. package/dist/components/feedback/tooltip.js +107 -25
  120. package/dist/components/general/button.d.ts +1 -1
  121. package/dist/components/general/button.js +7 -3
  122. package/dist/components/general/index.d.ts +1 -0
  123. package/dist/components/general/index.js +2 -0
  124. package/dist/components/general/logo.d.ts +17 -0
  125. package/dist/components/general/logo.js +22 -16
  126. package/dist/components/general/typography.d.ts +3 -0
  127. package/dist/components/general/typography.js +15 -1
  128. package/dist/components/general/visually-hidden.d.ts +3 -0
  129. package/dist/components/general/visually-hidden.js +9 -0
  130. package/dist/components/layout/app-launcher.d.ts +34 -0
  131. package/dist/components/layout/app-launcher.js +228 -0
  132. package/dist/components/layout/app-shell.d.ts +3 -1
  133. package/dist/components/layout/app-shell.js +69 -12
  134. package/dist/components/layout/aspect-ratio.js +0 -1
  135. package/dist/components/layout/auth-divider.js +0 -1
  136. package/dist/components/layout/breadcrumb.d.ts +14 -2
  137. package/dist/components/layout/breadcrumb.js +46 -4
  138. package/dist/components/layout/flex.d.ts +1 -1
  139. package/dist/components/layout/flex.js +41 -3
  140. package/dist/components/layout/index.d.ts +3 -0
  141. package/dist/components/layout/index.js +5 -1
  142. package/dist/components/layout/nav-surface.d.ts +26 -0
  143. package/dist/components/layout/nav-surface.js +17 -0
  144. package/dist/components/layout/org-switcher.d.ts +5 -1
  145. package/dist/components/layout/org-switcher.js +25 -4
  146. package/dist/components/layout/page-container.d.ts +1 -1
  147. package/dist/components/layout/page-container.js +5 -3
  148. package/dist/components/layout/responsive-grid.d.ts +16 -2
  149. package/dist/components/layout/responsive-grid.js +29 -2
  150. package/dist/components/layout/separator.js +0 -1
  151. package/dist/components/layout/sidebar.js +4 -1
  152. package/dist/components/layout/split-pane.d.ts +14 -1
  153. package/dist/components/layout/split-pane.js +26 -13
  154. package/dist/components/layout/topbar-item.d.ts +3 -0
  155. package/dist/components/layout/topbar-item.js +19 -5
  156. package/dist/components/layout/topbar.d.ts +1 -1
  157. package/dist/components/layout/topbar.js +27 -6
  158. package/dist/components/navigation/app-setting-picker.js +21 -2
  159. package/dist/components/navigation/app-setting-toggle.d.ts +16 -0
  160. package/dist/components/navigation/app-setting-toggle.js +96 -0
  161. package/dist/components/navigation/dropdown-menu.d.ts +227 -18
  162. package/dist/components/navigation/dropdown-menu.js +402 -118
  163. package/dist/components/navigation/index.d.ts +2 -0
  164. package/dist/components/navigation/index.js +2 -0
  165. package/dist/components/navigation/pagination-utils.d.ts +2 -1
  166. package/dist/components/navigation/pagination.d.ts +2 -2
  167. package/dist/components/navigation/pagination.js +155 -83
  168. package/dist/components/navigation/steps.d.ts +2 -2
  169. package/dist/components/navigation/steps.js +29 -4
  170. package/dist/components/navigation/tabs.d.ts +29 -16
  171. package/dist/components/navigation/tabs.js +374 -144
  172. package/dist/components/ui/accordion.d.ts +50 -5
  173. package/dist/components/ui/accordion.js +239 -33
  174. package/dist/components/ui/aspect-ratio.d.ts +23 -2
  175. package/dist/components/ui/aspect-ratio.js +15 -13
  176. package/dist/components/ui/avatar.d.ts +29 -4
  177. package/dist/components/ui/avatar.js +111 -25
  178. package/dist/components/ui/hover-card.d.ts +42 -4
  179. package/dist/components/ui/hover-card.js +183 -27
  180. package/dist/components/ui/input-otp.d.ts +26 -28
  181. package/dist/components/ui/input-otp.js +50 -7
  182. package/dist/components/ui/label.js +0 -1
  183. package/dist/components/ui/password-input.d.ts +36 -2
  184. package/dist/components/ui/password-input.js +27 -7
  185. package/dist/components/ui/rating.d.ts +25 -0
  186. package/dist/components/ui/rating.js +67 -27
  187. package/dist/components/ui/segmented.d.ts +12 -3
  188. package/dist/components/ui/segmented.js +17 -2
  189. package/dist/components/ui/separator.d.ts +12 -2
  190. package/dist/components/ui/separator.js +30 -9
  191. package/dist/components/ui/tag-input.d.ts +45 -0
  192. package/dist/components/ui/tag-input.js +109 -27
  193. package/dist/components/ui/toggle-group.d.ts +50 -5
  194. package/dist/components/ui/toggle-group.js +79 -20
  195. package/dist/components/ui/toggle.d.ts +31 -5
  196. package/dist/components/ui/toggle.js +42 -3
  197. package/dist/form/form-context.d.ts +29 -0
  198. package/dist/form/form-context.js +44 -4
  199. package/dist/form/form-field-array.d.ts +22 -0
  200. package/dist/form/form-field-array.js +50 -0
  201. package/dist/form/form-field-control.d.ts +2 -1
  202. package/dist/form/form-field-control.js +116 -40
  203. package/dist/form/form-root.d.ts +2 -1
  204. package/dist/form/form-root.js +142 -23
  205. package/dist/form/index.d.ts +3 -1
  206. package/dist/form/index.js +12 -1
  207. package/dist/i18n/messages/en.json +64 -5
  208. package/dist/i18n/messages/ja.json +64 -5
  209. package/dist/i18n/messages/vi.json +64 -5
  210. package/dist/inertia/index.d.ts +20 -0
  211. package/dist/inertia/index.js +60 -1
  212. package/dist/lib/control-styles.d.ts +25 -3
  213. package/dist/lib/control-styles.js +9 -3
  214. package/dist/lib/datetime/picker-format.d.ts +8 -0
  215. package/dist/lib/datetime/picker-format.js +54 -0
  216. package/dist/lib/slot.d.ts +32 -0
  217. package/dist/lib/slot.js +22 -0
  218. package/dist/lib/variants.d.ts +22 -3
  219. package/dist/lib/variants.js +56 -1
  220. package/dist/props/components/app.prop.d.ts +25 -1
  221. package/dist/props/components/charts.prop.d.ts +21 -0
  222. package/dist/props/components/data-display.prop.d.ts +72 -4
  223. package/dist/props/components/data-entry.prop.d.ts +718 -46
  224. package/dist/props/components/form.prop.d.ts +142 -4
  225. package/dist/props/components/general.prop.d.ts +17 -1
  226. package/dist/props/components/index.d.ts +3 -3
  227. package/dist/props/components/layout.prop.d.ts +281 -11
  228. package/dist/props/components/navigation.prop.d.ts +114 -4
  229. package/dist/props/registry.d.ts +397 -11
  230. package/dist/props/registry.js +526 -11
  231. package/dist/props/vocabulary/content.prop.d.ts +1 -1
  232. package/dist/props/vocabulary/data.prop.d.ts +179 -1
  233. package/dist/props/vocabulary/index.d.ts +5 -5
  234. package/dist/props/vocabulary/interaction.prop.d.ts +68 -3
  235. package/dist/props/vocabulary/layout.prop.d.ts +57 -1
  236. package/dist/props/vocabulary/navigation.prop.d.ts +40 -0
  237. package/dist/props/vocabulary/shared.prop.d.ts +33 -0
  238. package/dist/styles/badge-layout.css +2 -1
  239. package/dist/styles/card-layout.css +26 -4
  240. package/dist/styles/chart-layout.css +15 -0
  241. package/dist/styles/control.css +657 -15
  242. package/dist/styles/core.css +5 -2
  243. package/dist/styles/data-display-layout.css +313 -6
  244. package/dist/styles/data-entry-layout.css +13 -0
  245. package/dist/styles/focus-ring.css +4 -0
  246. package/dist/styles/index.css +5 -2
  247. package/dist/styles/layout.css +327 -4
  248. package/dist/styles/navigation-layout.css +227 -0
  249. package/dist/styles/shell-layout.css +369 -13
  250. package/dist/styles/table-layout.css +95 -6
  251. package/dist/styles/text-layout.css +10 -4
  252. package/dist/tokens/base.css +2 -1
  253. package/dist/tokens/components/badge.css +1 -0
  254. package/dist/tokens/components/chart.css +6 -0
  255. package/dist/tokens/components/control.css +79 -2
  256. package/dist/tokens/components/data-display.css +20 -0
  257. package/dist/tokens/components/descriptions.css +11 -0
  258. package/dist/tokens/components/flex.css +8 -0
  259. package/dist/tokens/components/navigation.css +55 -0
  260. package/dist/tokens/components/shell.css +53 -3
  261. package/dist/tokens/components/table.css +14 -0
  262. package/dist/tokens/foundation.css +2 -0
  263. package/dist/tokens/semantic/layout.css +9 -0
  264. package/docs/COMPONENTS.md +9 -3
  265. package/docs/CONSUMER-RULES.md +13 -0
  266. package/docs/DESIGN-AUTHORITY.md +145 -83
  267. package/docs/DEVELOPMENT.md +4 -3
  268. package/docs/FORMS.md +151 -6
  269. package/docs/FRAME-COVERAGE-REPORT.md +32 -17
  270. package/docs/README.md +15 -15
  271. package/docs/STANDARDS-vocabulary-tokens.md +1 -1
  272. package/docs/TESTING.md +15 -6
  273. package/docs/WHAT-BELONGS-HERE.md +179 -0
  274. package/docs/charts/cjk-category-axis.tsx +81 -0
  275. package/docs/data-display/card/index.tsx +22 -0
  276. package/docs/data-display/data-table/examples/antd-parity.tsx +257 -0
  277. package/docs/data-display/data-table/index.tsx +23 -0
  278. package/docs/data-display/descriptions.tsx +41 -0
  279. package/docs/data-display/legend.tsx +145 -0
  280. package/docs/data-display/progress.tsx +32 -0
  281. package/docs/data-display/scroll-area.tsx +31 -25
  282. package/docs/data-display/table.tsx +104 -45
  283. package/docs/data-display/timeline.tsx +41 -0
  284. package/docs/data-entry/date-picker.tsx +85 -0
  285. package/docs/data-entry/date-range-picker.tsx +26 -0
  286. package/docs/data-entry/form-dynamic-fields.tsx +199 -0
  287. package/docs/data-entry/form.tsx +74 -4
  288. package/docs/data-entry/input-otp.tsx +24 -0
  289. package/docs/data-entry/input.tsx +46 -1
  290. package/docs/data-entry/month-range-picker.tsx +1 -1
  291. package/docs/data-entry/segmented.tsx +1 -1
  292. package/docs/data-entry/select.tsx +29 -2
  293. package/docs/data-entry/switch.tsx +41 -0
  294. package/docs/data-entry/textarea.tsx +38 -0
  295. package/docs/data-entry/time-picker.tsx +85 -1
  296. package/docs/data-entry/time-range-picker.tsx +55 -0
  297. package/docs/data-entry/transfer.tsx +17 -0
  298. package/docs/data-entry/upload.tsx +56 -12
  299. package/docs/feedback/sheet.tsx +1 -1
  300. package/docs/feedback/tooltip.tsx +1 -1
  301. package/docs/general/activity.tsx +2 -2
  302. package/docs/general/button/index.tsx +14 -1
  303. package/docs/general/typography.tsx +14 -1
  304. package/docs/layout/app-launcher.tsx +151 -0
  305. package/docs/layout/app-shell-arrangements.tsx +225 -0
  306. package/docs/layout/app-shell.tsx +11 -0
  307. package/docs/layout/aspect-ratio.tsx +1 -1
  308. package/docs/layout/flex.tsx +50 -0
  309. package/docs/layout/responsive-grid.tsx +21 -1
  310. package/docs/layout/topbar.tsx +5 -9
  311. package/docs/navigation/app-setting-picker.tsx +37 -1
  312. package/docs/navigation/app-setting-toggle.tsx +111 -0
  313. package/docs/navigation/breadcrumb.tsx +48 -0
  314. package/docs/navigation/dropdown-menu.tsx +21 -0
  315. package/docs/navigation/pagination.tsx +52 -0
  316. package/docs/navigation/steps.tsx +37 -0
  317. package/docs/navigation/tabs.tsx +97 -1
  318. package/docs/query/button-refetch.tsx +1 -0
  319. package/package.json +28 -8
  320. package/scripts/_agent-setup.mjs +182 -3
  321. package/scripts/consumer-rule.md +98 -0
  322. package/scripts/guinea-pig-skill.md +322 -0
  323. package/scripts/init-guinea-pig.mjs +84 -0
  324. package/scripts/postinstall.mjs +13 -2
  325. package/scripts/ui-audit.mjs +351 -37
  326. /package/dist/tokens/{antd.generated.css → derived.css} +0 -0
@@ -1,8 +1,14 @@
1
1
  import * as React from "react";
2
2
  import type { DescriptionsLayoutProp } from "../../props/vocabulary/interaction.prop.js";
3
+ import type { DescriptionsColumnProp, DescriptionsItemsProp, DescriptionsSpanProp } from "../../props/vocabulary/data.prop.js";
3
4
  export type { DescriptionsLayoutProp };
4
5
  export interface DescriptionsProps {
5
- columns?: 1 | 2 | 3;
6
+ /**
7
+ * Column count. A plain `1 | 2 | 3` keeps this library's own responsive ladder exactly as it
8
+ * was; any other number, or antd's `{ sm, md, lg, xl }` responsive object, drives the
9
+ * token-published grid instead (antd `column`).
10
+ */
11
+ columns?: DescriptionsColumnProp;
6
12
  /** Label placement within each item. Default `vertical` (label over value). */
7
13
  layout?: DescriptionsLayoutProp;
8
14
  /**
@@ -10,19 +16,34 @@ export interface DescriptionsProps {
10
16
  * it there would read as a mistake, exactly like `Form`'s own contract.
11
17
  */
12
18
  labelAlign?: "start" | "end";
19
+ /**
20
+ * Draw the grid as a bordered table (antd `bordered`): an outer frame, a rule between every
21
+ * cell, and a shaded label cell. Colour and rhythm come from the `--descriptions-*` tokens.
22
+ */
23
+ bordered?: boolean;
24
+ /**
25
+ * Declarative items (antd `items`) — an alternative to composing `Descriptions.Item` children.
26
+ * Both work; `items` renders first, then any children after it.
27
+ */
28
+ items?: DescriptionsItemsProp;
13
29
  className?: string;
14
- children: React.ReactNode;
30
+ children?: React.ReactNode;
15
31
  }
16
- export declare function Descriptions({ columns, layout, labelAlign, className, children, }: DescriptionsProps): React.JSX.Element;
32
+ export declare function Descriptions({ columns, layout, labelAlign, bordered, items, className, children, }: DescriptionsProps): React.JSX.Element;
17
33
  export declare namespace Descriptions {
18
- var Item: ({ label, mono, span, className, children, }: DescriptionsItemProps) => React.JSX.Element;
34
+ export { DescriptionsItem as Item };
19
35
  }
20
36
  export interface DescriptionsItemProps {
21
37
  label: React.ReactNode;
22
38
  /** Use mono spacing for IDs, paths, JSON. */
23
39
  mono?: boolean;
24
- /** Span full row(s) when value is long. */
25
- span?: 2 | 3;
40
+ /**
41
+ * Span full row(s) when the value is long. `2` / `3` keep the ladder they have always painted;
42
+ * `"filled"` takes the whole remaining row (antd), and a responsive `{ sm, md, lg, xl }` object
43
+ * spans a different number of columns per step.
44
+ */
45
+ span?: DescriptionsSpanProp;
26
46
  className?: string;
27
47
  children: React.ReactNode;
28
48
  }
49
+ declare function DescriptionsItem({ label, mono, span, className, children }: DescriptionsItemProps): React.JSX.Element;
@@ -4,45 +4,85 @@ import * as React from "react";
4
4
  import { cn } from "../../lib/utils.js";
5
5
  const DescriptionsLayoutContext = React.createContext({
6
6
  layout: "vertical",
7
- labelAlign: "start"
7
+ labelAlign: "start",
8
+ bordered: false
8
9
  });
10
+ const BREAKPOINT_LADDER = ["sm", "md", "lg", "xl"];
11
+ function responsiveVars(name, base, steps) {
12
+ const vars = { [`${name}-base`]: base };
13
+ for (const step of BREAKPOINT_LADDER) {
14
+ const value = steps[step];
15
+ if (value !== void 0) vars[`${name}-${step}`] = value;
16
+ }
17
+ return vars;
18
+ }
19
+ const LEGACY_COLUMN_CLASS = {
20
+ 1: "grid-cols-1",
21
+ 2: "grid-cols-1 sm:grid-cols-2",
22
+ 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
23
+ };
9
24
  function Descriptions({
10
25
  columns = 2,
11
26
  layout = "vertical",
12
27
  labelAlign = "start",
28
+ bordered = false,
29
+ items,
13
30
  className,
14
31
  children
15
32
  }) {
16
- const colsClass = columns === 1 ? "grid-cols-1" : columns === 3 ? "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1 sm:grid-cols-2";
17
- const context = React.useMemo(() => ({ layout, labelAlign }), [layout, labelAlign]);
18
- return /* @__PURE__ */ jsx(DescriptionsLayoutContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
33
+ const legacyColumns = typeof columns === "number" ? LEGACY_COLUMN_CLASS[columns] : void 0;
34
+ const responsiveColumns = legacyColumns === void 0 ? typeof columns === "number" ? { sm: Math.min(columns, 2), lg: columns } : columns : void 0;
35
+ const context = React.useMemo(
36
+ () => ({ layout, labelAlign, bordered }),
37
+ [layout, labelAlign, bordered]
38
+ );
39
+ return /* @__PURE__ */ jsx(DescriptionsLayoutContext.Provider, { value: context, children: /* @__PURE__ */ jsxs(
19
40
  "dl",
20
41
  {
21
42
  "data-slot": "descriptions",
22
- "data-columns": columns,
43
+ "data-columns": typeof columns === "number" ? columns : void 0,
44
+ "data-columns-responsive": responsiveColumns ? "" : void 0,
45
+ "data-bordered": bordered ? "" : void 0,
46
+ style: responsiveColumns ? responsiveVars("--descriptions-column-count", 1, responsiveColumns) : void 0,
23
47
  className: cn(
24
48
  "grid gap-x-[var(--descriptions-column-gap)] gap-y-[var(--descriptions-row-gap)]",
25
- colsClass,
49
+ legacyColumns,
26
50
  className
27
51
  ),
28
- children
52
+ children: [
53
+ items?.map((item, index) => /* @__PURE__ */ jsx(
54
+ DescriptionsItem,
55
+ {
56
+ label: item.label,
57
+ mono: item.mono,
58
+ span: item.span,
59
+ className: item.className,
60
+ children: item.children ?? item.value
61
+ },
62
+ item.key ?? index
63
+ )),
64
+ children
65
+ ]
29
66
  }
30
67
  ) });
31
68
  }
32
- Descriptions.Item = function DescriptionsItem({
33
- label,
34
- mono,
35
- span,
36
- className,
37
- children
38
- }) {
69
+ const LEGACY_SPAN_CLASS = {
70
+ 2: "sm:col-span-2",
71
+ 3: "sm:col-span-2 lg:col-span-3"
72
+ };
73
+ function DescriptionsItem({ label, mono, span, className, children }) {
39
74
  const { layout, labelAlign } = React.useContext(DescriptionsLayoutContext);
40
- const spanClass = span === 2 ? "sm:col-span-2" : span === 3 ? "sm:col-span-2 lg:col-span-3" : "";
75
+ const legacySpan = typeof span === "number" ? LEGACY_SPAN_CLASS[span] : void 0;
76
+ const responsiveSpan = span !== void 0 && span !== "filled" && legacySpan === void 0 ? typeof span === "number" ? { sm: span } : span : void 0;
41
77
  const endAlignedLabel = layout === "horizontal" && labelAlign === "end";
42
78
  return /* @__PURE__ */ jsxs(
43
79
  "div",
44
80
  {
45
81
  "data-slot": "descriptions-item",
82
+ "data-layout": layout,
83
+ "data-span": span === "filled" ? "filled" : void 0,
84
+ "data-span-responsive": responsiveSpan ? "" : void 0,
85
+ style: responsiveSpan ? responsiveVars("--descriptions-item-span", 1, responsiveSpan) : void 0,
46
86
  className: cn(
47
87
  layout === "horizontal" ? (
48
88
  // Label beside value — a token-aligned label column so the values line up. The
@@ -54,7 +94,7 @@ Descriptions.Item = function DescriptionsItem({
54
94
  // FormField / Form so the label→value gap is consistent everywhere.
55
95
  "grid gap-[var(--field-label-gap)]"
56
96
  ),
57
- spanClass,
97
+ legacySpan,
58
98
  className
59
99
  ),
60
100
  children: [
@@ -86,7 +126,8 @@ Descriptions.Item = function DescriptionsItem({
86
126
  ]
87
127
  }
88
128
  );
89
- };
129
+ }
130
+ Descriptions.Item = DescriptionsItem;
90
131
  export {
91
132
  Descriptions
92
133
  };
@@ -1,5 +1,7 @@
1
1
  export { Badge, StatusBadge } from "./badge.js";
2
2
  export type { BadgeProps } from "./badge.js";
3
+ export { Legend } from "./legend.js";
4
+ export type { LegendItemProp, LegendProp, LegendProps } from "./legend.js";
3
5
  export { ListRow } from "./list-row.js";
4
6
  export type { ListRowProps, ListRowDensity } from "./list-row.js";
5
7
  export { CredentialReveal } from "./credential-reveal.js";
@@ -23,7 +25,7 @@ export { CodeBlock } from "./code-block.js";
23
25
  export type { CodeBlockProp, CodeBlockProps } from "./code-block.js";
24
26
  export { Prose } from "./prose.js";
25
27
  export type { ProseProp, ProseProps } from "./prose.js";
26
- export type { ProgressProps, ProgressTone } from "./progress.js";
28
+ export type { ProgressProps, ProgressSegment, ProgressTone } from "./progress.js";
27
29
  export { TreeList } from "./tree-list.js";
28
30
  export type { TreeListItem, TreeListProps } from "./tree-list.js";
29
31
  export { Timeline } from "./timeline.js";
@@ -39,3 +41,5 @@ export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious
39
41
  export type { CarouselApi } from "./carousel.js";
40
42
  export { PermissionMatrix } from "./permission-matrix.js";
41
43
  export type { PermissionMatrixGrantsProp, PermissionMatrixPermissionProp, PermissionMatrixProp, PermissionMatrixProps, PermissionMatrixRoleProp, } from "./permission-matrix.js";
44
+ export { RangeTimeline } from "./range-timeline.js";
45
+ export type { RangeTimelineProps, RangeTimelineRow } from "./range-timeline.js";
@@ -1,4 +1,5 @@
1
1
  import { Badge, StatusBadge } from "./badge.js";
2
+ import { Legend } from "./legend.js";
2
3
  import { ListRow } from "./list-row.js";
3
4
  import { CredentialReveal } from "./credential-reveal.js";
4
5
  import { QrCode } from "./qr-code.js";
@@ -53,6 +54,7 @@ import {
53
54
  useCarousel
54
55
  } from "./carousel.js";
55
56
  import { PermissionMatrix } from "./permission-matrix.js";
57
+ import { RangeTimeline } from "./range-timeline.js";
56
58
  export {
57
59
  Accordion,
58
60
  AccordionContent,
@@ -88,6 +90,7 @@ export {
88
90
  HoverCard,
89
91
  HoverCardContent,
90
92
  HoverCardTrigger,
93
+ Legend,
91
94
  ListRow,
92
95
  PermissionMatrix,
93
96
  Popover,
@@ -100,6 +103,7 @@ export {
100
103
  Progress,
101
104
  Prose,
102
105
  QrCode,
106
+ RangeTimeline,
103
107
  ScrollArea,
104
108
  ScrollBar,
105
109
  ServiceCatalogCta,
@@ -0,0 +1,15 @@
1
+ import type { LegendProp } from "../../props/components/data-display.prop.js";
2
+ export type { LegendItemProp, LegendProp, LegendProp as LegendProps } from "../../props/components/data-display.prop.js";
3
+ /**
4
+ * Legend — the KEY for a set of tones: which colour means what.
5
+ *
6
+ * Pair it with anything that encodes meaning as colour and cannot repeat the words on every mark:
7
+ * a `Progress` breakdown, a chart, a status column. It is the reason a colour-coded surface can
8
+ * satisfy WCAG 1.4.1 — the tone is never the only carrier of the meaning, because the key spells
9
+ * it out once in words.
10
+ *
11
+ * The swatch is `aria-hidden`: it is the same information as the label beside it, and a screen
12
+ * reader announcing "square, overdue" twice per key is noise. What reaches assistive tech is a
13
+ * plain list of the labels, which is exactly what the key says.
14
+ */
15
+ export declare function Legend({ items, className, ...props }: LegendProp): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils.js";
3
+ function Legend({ items, className, ...props }) {
4
+ return /* @__PURE__ */ jsx("ul", { className: cn("ui-legend", className), ...props, children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "ui-legend-item", children: [
5
+ /* @__PURE__ */ jsx("span", { className: "ui-legend-swatch", "data-tone": item.tone, "aria-hidden": "true" }),
6
+ item.label
7
+ ] }, index)) });
8
+ }
9
+ export {
10
+ Legend
11
+ };
@@ -13,7 +13,16 @@ export type ListRowDensity = ListRowDensityProp;
13
13
  * justify-between border-b …">`.
14
14
  */
15
15
  export interface ListRowProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
16
- /** Render element — `div` (default) or `li` when the parent is a `<ul>`/`<ol>`. */
16
+ /**
17
+ * Render element — `div` (default) or `li` when the parent is a `<ul>`/`<ol>`.
18
+ *
19
+ * With `asChild`, the child owns the row element, so `as` steps out and becomes the
20
+ * LIST ITEM around it: `<li data-slot="list-row-item"><a data-slot="list-row">`. That is
21
+ * the only reading under which both props can hold at once, and it is the shape a list
22
+ * of links needs — the alternative, wrapping the row yourself, moves every row into a
23
+ * wrapper of its own and the row-to-row divider (keyed on `:not(:last-child)` among
24
+ * siblings) stops matching entirely.
25
+ */
17
26
  as?: "div" | "li";
18
27
  /** Use the supplied link as the entire row. Do not nest interactive trailing controls. */
19
28
  asChild?: boolean;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { Slot } from "@radix-ui/react-slot";
4
+ import { Slot } from "../../lib/slot.js";
5
5
  import { useTranslation } from "../../i18n/use-translation.js";
6
6
  import { cn } from "../../lib/utils.js";
7
7
  import { Text } from "../general/typography.js";
@@ -22,6 +22,7 @@ const ListRow = React.forwardRef(
22
22
  ...props
23
23
  }, ref) => {
24
24
  const { t } = useTranslation();
25
+ const item = asChild && as !== "div" ? as : null;
25
26
  const Comp = asChild ? Slot : as;
26
27
  const truncate = overflow !== "wrap";
27
28
  const content = /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -33,7 +34,7 @@ const ListRow = React.forwardRef(
33
34
  ] }),
34
35
  trailing != null ? /* @__PURE__ */ jsx("span", { "data-slot": "list-row-trailing", children: trailing }) : null
35
36
  ] });
36
- return /* @__PURE__ */ jsx(
37
+ const row = /* @__PURE__ */ jsx(
37
38
  Comp,
38
39
  {
39
40
  ref,
@@ -47,6 +48,11 @@ const ListRow = React.forwardRef(
47
48
  children: asChild && React.isValidElement(children) ? React.cloneElement(children, void 0, content) : content
48
49
  }
49
50
  );
51
+ if (item === null) {
52
+ return row;
53
+ }
54
+ const Item = item;
55
+ return /* @__PURE__ */ jsx(Item, { "data-slot": "list-row-item", children: row });
50
56
  }
51
57
  );
52
58
  ListRow.displayName = "ListRow";
@@ -1,9 +1,28 @@
1
1
  import * as React from "react";
2
- import * as PopoverPrimitive from "@radix-ui/react-popover";
3
2
  import type { FlushProp } from "../../props/vocabulary/index.js";
4
- export declare function Popover(props: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
5
- export declare function PopoverTrigger(props: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
6
- export declare function PopoverAnchor(props: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
3
+ type Side = "top" | "right" | "bottom" | "left";
4
+ type Align = "start" | "center" | "end";
5
+ interface PopoverProps {
6
+ /** Trạng thái mở, có kiểm soát. */
7
+ open?: boolean;
8
+ /** Trạng thái mở ban đầu khi không kiểm soát. */
9
+ defaultOpen?: boolean;
10
+ /** Gọi khi trạng thái mở/đóng đổi. */
11
+ onOpenChange?: (open: boolean) => void;
12
+ /** Khoá tương tác ngoài panel và giam tiêu điểm, đúng như `modal` của Radix. */
13
+ modal?: boolean;
14
+ }
15
+ export declare function Popover({ open, defaultOpen, onOpenChange, modal, children, }: React.PropsWithChildren<PopoverProps>): React.JSX.Element;
16
+ interface PopoverTriggerProps extends React.ComponentPropsWithRef<"button"> {
17
+ /** Mượn thẻ của con thay vì dựng `<button>` riêng. */
18
+ asChild?: boolean;
19
+ }
20
+ export declare function PopoverTrigger({ asChild, onClick, ref, ...props }: PopoverTriggerProps): React.JSX.Element;
21
+ interface PopoverAnchorProps extends React.ComponentPropsWithRef<"span"> {
22
+ /** Mượn thẻ của con thay vì dựng `<span>` riêng. */
23
+ asChild?: boolean;
24
+ }
25
+ export declare function PopoverAnchor({ asChild, ref, ...props }: PopoverAnchorProps): React.JSX.Element;
7
26
  /**
8
27
  * The panel's CONTENT owns its inset — a Command list, a menu or a table that must run edge to
9
28
  * edge and draw its own separators across the full width. The popover drops its own padding by
@@ -14,8 +33,42 @@ export declare function PopoverAnchor(props: React.ComponentProps<typeof Popover
14
33
  type PopoverContentFlush = {
15
34
  flush?: FlushProp;
16
35
  };
17
- export declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & PopoverContentFlush & React.RefAttributes<HTMLDivElement>>;
36
+ interface PopoverContentProps extends React.ComponentPropsWithRef<"div">, PopoverContentFlush {
37
+ /** Cạnh của trigger mà panel bám vào. */
38
+ side?: Side;
39
+ /** Canh panel theo cạnh của trigger. */
40
+ align?: Align;
41
+ /** Khoảng cách theo trục chính, tính bằng px. */
42
+ sideOffset?: number;
43
+ /** Khoảng cách theo trục phụ, tính bằng px. */
44
+ alignOffset?: number;
45
+ /** Lật panel sang cạnh đối diện khi hết chỗ. */
46
+ avoidCollisions?: boolean;
47
+ /** Khoảng chừa với mép khung nhìn. RAC chỉ nhận một số; object lấy cạnh lớn nhất. */
48
+ collisionPadding?: number | Partial<Record<Side, number>>;
49
+ /** Không còn tác dụng trên nền RAC — giữ trong kiểu vì là API công khai. */
50
+ sticky?: "partial" | "always";
51
+ /** Không còn tác dụng trên nền RAC — giữ trong kiểu vì là API công khai. */
52
+ hideWhenDetached?: boolean;
53
+ /** Không còn tác dụng trên nền RAC — giữ trong kiểu vì là API công khai. */
54
+ forceMount?: true;
55
+ /**
56
+ * Chặn việc panel tự lấy tiêu điểm khi mở, bằng `event.preventDefault()`.
57
+ *
58
+ * Năm picker trong kho dựa vào đúng điều này để giữ tiêu điểm ở ô nhập, nên hành vi được chép
59
+ * tay từ Radix chứ không bỏ.
60
+ */
61
+ onOpenAutoFocus?: (event: Event) => void;
62
+ /**
63
+ * Chặn việc trả tiêu điểm về nơi nó đứng trước khi panel mở, bằng `event.preventDefault()`.
64
+ *
65
+ * Phát ở MỌI đường đóng (chọn một mục, Escape, bấm ra ngoài, Tab ra ngoài), nên consumer đưa
66
+ * được tiêu điểm tới đúng chỗ người dùng cần gõ tiếp thay vì để nó quay về trigger.
67
+ */
68
+ onCloseAutoFocus?: (event: Event) => void;
69
+ }
70
+ export declare function PopoverContent({ className, style, children, ref, flush, side, align, sideOffset, alignOffset, avoidCollisions, collisionPadding, sticky: _sticky, hideWhenDetached: _hideWhenDetached, forceMount: _forceMount, onOpenAutoFocus, onCloseAutoFocus, ...props }: PopoverContentProps): React.JSX.Element;
18
71
  export declare const PopoverHeader: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
19
- export declare const PopoverTitle: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
20
- export declare const PopoverDescription: ({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) => React.JSX.Element;
72
+ export declare const PopoverTitle: ({ className, id, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
73
+ export declare const PopoverDescription: ({ className, id, ...props }: React.HTMLAttributes<HTMLParagraphElement>) => React.JSX.Element;
21
74
  export {};