@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.
- package/README.md +8 -2
- package/dist/app/theme-axes.d.ts +2 -0
- package/dist/app/theme-axes.js +45 -0
- package/dist/components/charts/chart-cartesian.d.ts +2 -1
- package/dist/components/charts/chart-cartesian.js +52 -3
- package/dist/components/charts/chart-category-axis.d.ts +55 -0
- package/dist/components/charts/chart-category-axis.js +93 -0
- package/dist/components/charts/chart-frame.d.ts +10 -1
- package/dist/components/charts/chart-frame.js +19 -3
- package/dist/components/charts/compact-bar-trend.d.ts +1 -1
- package/dist/components/charts/compact-bar-trend.js +2 -0
- package/dist/components/charts/pie-chart.d.ts +1 -1
- package/dist/components/charts/pie-chart.js +12 -1
- package/dist/components/charts/recharts-peer.d.ts +49 -0
- package/dist/components/charts/recharts-peer.js +45 -0
- package/dist/components/data-display/card.d.ts +14 -3
- package/dist/components/data-display/card.js +22 -4
- package/dist/components/data-display/code-block.js +6 -2
- package/dist/components/data-display/collapsible.d.ts +23 -4
- package/dist/components/data-display/collapsible.js +119 -4
- package/dist/components/data-display/data-table.d.ts +39 -4
- package/dist/components/data-display/data-table.js +802 -270
- package/dist/components/data-display/descriptions.d.ts +27 -6
- package/dist/components/data-display/descriptions.js +58 -17
- package/dist/components/data-display/index.d.ts +5 -1
- package/dist/components/data-display/index.js +4 -0
- package/dist/components/data-display/legend.d.ts +15 -0
- package/dist/components/data-display/legend.js +11 -0
- package/dist/components/data-display/list-row.d.ts +10 -1
- package/dist/components/data-display/list-row.js +8 -2
- package/dist/components/data-display/popover.d.ts +60 -7
- package/dist/components/data-display/popover.js +268 -39
- package/dist/components/data-display/progress.d.ts +50 -2
- package/dist/components/data-display/progress.js +57 -9
- package/dist/components/data-display/range-timeline.d.ts +38 -0
- package/dist/components/data-display/range-timeline.js +161 -0
- package/dist/components/data-display/scroll-area.js +13 -2
- package/dist/components/data-display/service-launcher-card.js +10 -10
- package/dist/components/data-display/table.d.ts +11 -3
- package/dist/components/data-display/table.js +48 -18
- package/dist/components/data-display/tree-list.js +4 -9
- package/dist/components/data-entry/calendar.d.ts +2 -2
- package/dist/components/data-entry/calendar.js +79 -33
- package/dist/components/data-entry/cascader.d.ts +1 -1
- package/dist/components/data-entry/cascader.js +188 -24
- package/dist/components/data-entry/checkbox.d.ts +19 -6
- package/dist/components/data-entry/checkbox.js +55 -16
- package/dist/components/data-entry/choice-option.d.ts +1 -1
- package/dist/components/data-entry/color-picker.d.ts +1 -1
- package/dist/components/data-entry/color-picker.js +17 -5
- package/dist/components/data-entry/control-appearance.d.ts +64 -0
- package/dist/components/data-entry/control-appearance.js +39 -0
- package/dist/components/data-entry/control-surface.d.ts +61 -0
- package/dist/components/data-entry/control-surface.js +39 -0
- package/dist/components/data-entry/date-picker.d.ts +1 -1
- package/dist/components/data-entry/date-picker.js +344 -113
- package/dist/components/data-entry/date-range-picker.d.ts +2 -2
- package/dist/components/data-entry/date-range-picker.js +278 -140
- package/dist/components/data-entry/field.js +0 -1
- package/dist/components/data-entry/form-field.d.ts +1 -1
- package/dist/components/data-entry/form-field.js +39 -4
- package/dist/components/data-entry/form.d.ts +4 -0
- package/dist/components/data-entry/form.js +5 -3
- package/dist/components/data-entry/index.d.ts +7 -3
- package/dist/components/data-entry/index.js +10 -1
- package/dist/components/data-entry/input-otp.d.ts +1 -1
- package/dist/components/data-entry/input.d.ts +12 -34
- package/dist/components/data-entry/input.js +92 -24
- package/dist/components/data-entry/label.d.ts +3 -2
- package/dist/components/data-entry/label.js +23 -10
- package/dist/components/data-entry/month-picker.d.ts +2 -2
- package/dist/components/data-entry/month-picker.js +47 -10
- package/dist/components/data-entry/month-range-picker.d.ts +2 -2
- package/dist/components/data-entry/month-range-picker.js +51 -11
- package/dist/components/data-entry/number-input.d.ts +7 -0
- package/dist/components/data-entry/number-input.js +147 -98
- package/dist/components/data-entry/password-input.d.ts +1 -1
- package/dist/components/data-entry/radio.d.ts +1 -1
- package/dist/components/data-entry/radio.js +61 -13
- package/dist/components/data-entry/search-input.d.ts +1 -1
- package/dist/components/data-entry/search-input.js +16 -2
- package/dist/components/data-entry/search-select.d.ts +2 -2
- package/dist/components/data-entry/search-select.js +209 -78
- package/dist/components/data-entry/select.d.ts +22 -4
- package/dist/components/data-entry/select.js +215 -163
- package/dist/components/data-entry/slider.d.ts +9 -1
- package/dist/components/data-entry/slider.js +87 -9
- package/dist/components/data-entry/switch.d.ts +3 -0
- package/dist/components/data-entry/switch.js +29 -3
- package/dist/components/data-entry/textarea.d.ts +14 -56
- package/dist/components/data-entry/textarea.js +80 -33
- package/dist/components/data-entry/time-picker.d.ts +2 -2
- package/dist/components/data-entry/time-picker.js +333 -109
- package/dist/components/data-entry/time-range-picker.d.ts +5 -0
- package/dist/components/data-entry/time-range-picker.js +89 -0
- package/dist/components/data-entry/transfer.d.ts +1 -1
- package/dist/components/data-entry/transfer.js +99 -31
- package/dist/components/data-entry/tree-select-strategy.d.ts +1 -1
- package/dist/components/data-entry/tree-select.d.ts +1 -1
- package/dist/components/data-entry/tree-select.js +197 -92
- package/dist/components/data-entry/tree-utils.d.ts +1 -1
- package/dist/components/data-entry/tree-utils.js +7 -14
- package/dist/components/data-entry/upload-files.d.ts +2 -0
- package/dist/components/data-entry/upload-files.js +31 -0
- package/dist/components/data-entry/upload-request.d.ts +4 -0
- package/dist/components/data-entry/upload-request.js +53 -0
- package/dist/components/data-entry/upload-types.d.ts +28 -0
- package/dist/components/data-entry/upload-types.js +2 -0
- package/dist/components/data-entry/upload.d.ts +2 -2
- package/dist/components/data-entry/upload.js +482 -117
- package/dist/components/feedback/dialog.d.ts +105 -38
- package/dist/components/feedback/dialog.js +268 -193
- package/dist/components/feedback/overlay-close-focus.d.ts +31 -0
- package/dist/components/feedback/overlay-close-focus.js +31 -0
- package/dist/components/feedback/overlay-header-tone.d.ts +1 -1
- package/dist/components/feedback/sheet.d.ts +53 -11
- package/dist/components/feedback/sheet.js +150 -81
- package/dist/components/feedback/tooltip.d.ts +51 -7
- package/dist/components/feedback/tooltip.js +107 -25
- package/dist/components/general/button.d.ts +1 -1
- package/dist/components/general/button.js +7 -3
- package/dist/components/general/index.d.ts +1 -0
- package/dist/components/general/index.js +2 -0
- package/dist/components/general/logo.d.ts +17 -0
- package/dist/components/general/logo.js +22 -16
- package/dist/components/general/typography.d.ts +3 -0
- package/dist/components/general/typography.js +15 -1
- package/dist/components/general/visually-hidden.d.ts +3 -0
- package/dist/components/general/visually-hidden.js +9 -0
- package/dist/components/layout/app-launcher.d.ts +34 -0
- package/dist/components/layout/app-launcher.js +228 -0
- package/dist/components/layout/app-shell.d.ts +3 -1
- package/dist/components/layout/app-shell.js +69 -12
- package/dist/components/layout/aspect-ratio.js +0 -1
- package/dist/components/layout/auth-divider.js +0 -1
- package/dist/components/layout/breadcrumb.d.ts +14 -2
- package/dist/components/layout/breadcrumb.js +46 -4
- package/dist/components/layout/flex.d.ts +1 -1
- package/dist/components/layout/flex.js +41 -3
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.js +5 -1
- package/dist/components/layout/nav-surface.d.ts +26 -0
- package/dist/components/layout/nav-surface.js +17 -0
- package/dist/components/layout/org-switcher.d.ts +5 -1
- package/dist/components/layout/org-switcher.js +25 -4
- package/dist/components/layout/page-container.d.ts +1 -1
- package/dist/components/layout/page-container.js +5 -3
- package/dist/components/layout/responsive-grid.d.ts +16 -2
- package/dist/components/layout/responsive-grid.js +29 -2
- package/dist/components/layout/separator.js +0 -1
- package/dist/components/layout/sidebar.js +4 -1
- package/dist/components/layout/split-pane.d.ts +14 -1
- package/dist/components/layout/split-pane.js +26 -13
- package/dist/components/layout/topbar-item.d.ts +3 -0
- package/dist/components/layout/topbar-item.js +19 -5
- package/dist/components/layout/topbar.d.ts +1 -1
- package/dist/components/layout/topbar.js +27 -6
- package/dist/components/navigation/app-setting-picker.js +21 -2
- package/dist/components/navigation/app-setting-toggle.d.ts +16 -0
- package/dist/components/navigation/app-setting-toggle.js +96 -0
- package/dist/components/navigation/dropdown-menu.d.ts +227 -18
- package/dist/components/navigation/dropdown-menu.js +402 -118
- package/dist/components/navigation/index.d.ts +2 -0
- package/dist/components/navigation/index.js +2 -0
- package/dist/components/navigation/pagination-utils.d.ts +2 -1
- package/dist/components/navigation/pagination.d.ts +2 -2
- package/dist/components/navigation/pagination.js +155 -83
- package/dist/components/navigation/steps.d.ts +2 -2
- package/dist/components/navigation/steps.js +29 -4
- package/dist/components/navigation/tabs.d.ts +29 -16
- package/dist/components/navigation/tabs.js +374 -144
- package/dist/components/ui/accordion.d.ts +50 -5
- package/dist/components/ui/accordion.js +239 -33
- package/dist/components/ui/aspect-ratio.d.ts +23 -2
- package/dist/components/ui/aspect-ratio.js +15 -13
- package/dist/components/ui/avatar.d.ts +29 -4
- package/dist/components/ui/avatar.js +111 -25
- package/dist/components/ui/hover-card.d.ts +42 -4
- package/dist/components/ui/hover-card.js +183 -27
- package/dist/components/ui/input-otp.d.ts +26 -28
- package/dist/components/ui/input-otp.js +50 -7
- package/dist/components/ui/label.js +0 -1
- package/dist/components/ui/password-input.d.ts +36 -2
- package/dist/components/ui/password-input.js +27 -7
- package/dist/components/ui/rating.d.ts +25 -0
- package/dist/components/ui/rating.js +67 -27
- package/dist/components/ui/segmented.d.ts +12 -3
- package/dist/components/ui/segmented.js +17 -2
- package/dist/components/ui/separator.d.ts +12 -2
- package/dist/components/ui/separator.js +30 -9
- package/dist/components/ui/tag-input.d.ts +45 -0
- package/dist/components/ui/tag-input.js +109 -27
- package/dist/components/ui/toggle-group.d.ts +50 -5
- package/dist/components/ui/toggle-group.js +79 -20
- package/dist/components/ui/toggle.d.ts +31 -5
- package/dist/components/ui/toggle.js +42 -3
- package/dist/form/form-context.d.ts +29 -0
- package/dist/form/form-context.js +44 -4
- package/dist/form/form-field-array.d.ts +22 -0
- package/dist/form/form-field-array.js +50 -0
- package/dist/form/form-field-control.d.ts +2 -1
- package/dist/form/form-field-control.js +116 -40
- package/dist/form/form-root.d.ts +2 -1
- package/dist/form/form-root.js +142 -23
- package/dist/form/index.d.ts +3 -1
- package/dist/form/index.js +12 -1
- package/dist/i18n/messages/en.json +64 -5
- package/dist/i18n/messages/ja.json +64 -5
- package/dist/i18n/messages/vi.json +64 -5
- package/dist/inertia/index.d.ts +20 -0
- package/dist/inertia/index.js +60 -1
- package/dist/lib/control-styles.d.ts +25 -3
- package/dist/lib/control-styles.js +9 -3
- package/dist/lib/datetime/picker-format.d.ts +8 -0
- package/dist/lib/datetime/picker-format.js +54 -0
- package/dist/lib/slot.d.ts +32 -0
- package/dist/lib/slot.js +22 -0
- package/dist/lib/variants.d.ts +22 -3
- package/dist/lib/variants.js +56 -1
- package/dist/props/components/app.prop.d.ts +25 -1
- package/dist/props/components/charts.prop.d.ts +21 -0
- package/dist/props/components/data-display.prop.d.ts +72 -4
- package/dist/props/components/data-entry.prop.d.ts +718 -46
- package/dist/props/components/form.prop.d.ts +142 -4
- package/dist/props/components/general.prop.d.ts +17 -1
- package/dist/props/components/index.d.ts +3 -3
- package/dist/props/components/layout.prop.d.ts +281 -11
- package/dist/props/components/navigation.prop.d.ts +114 -4
- package/dist/props/registry.d.ts +397 -11
- package/dist/props/registry.js +526 -11
- package/dist/props/vocabulary/content.prop.d.ts +1 -1
- package/dist/props/vocabulary/data.prop.d.ts +179 -1
- package/dist/props/vocabulary/index.d.ts +5 -5
- package/dist/props/vocabulary/interaction.prop.d.ts +68 -3
- package/dist/props/vocabulary/layout.prop.d.ts +57 -1
- package/dist/props/vocabulary/navigation.prop.d.ts +40 -0
- package/dist/props/vocabulary/shared.prop.d.ts +33 -0
- package/dist/styles/badge-layout.css +2 -1
- package/dist/styles/card-layout.css +26 -4
- package/dist/styles/chart-layout.css +15 -0
- package/dist/styles/control.css +657 -15
- package/dist/styles/core.css +5 -2
- package/dist/styles/data-display-layout.css +313 -6
- package/dist/styles/data-entry-layout.css +13 -0
- package/dist/styles/focus-ring.css +4 -0
- package/dist/styles/index.css +5 -2
- package/dist/styles/layout.css +327 -4
- package/dist/styles/navigation-layout.css +227 -0
- package/dist/styles/shell-layout.css +369 -13
- package/dist/styles/table-layout.css +95 -6
- package/dist/styles/text-layout.css +10 -4
- package/dist/tokens/base.css +2 -1
- package/dist/tokens/components/badge.css +1 -0
- package/dist/tokens/components/chart.css +6 -0
- package/dist/tokens/components/control.css +79 -2
- package/dist/tokens/components/data-display.css +20 -0
- package/dist/tokens/components/descriptions.css +11 -0
- package/dist/tokens/components/flex.css +8 -0
- package/dist/tokens/components/navigation.css +55 -0
- package/dist/tokens/components/shell.css +53 -3
- package/dist/tokens/components/table.css +14 -0
- package/dist/tokens/foundation.css +2 -0
- package/dist/tokens/semantic/layout.css +9 -0
- package/docs/COMPONENTS.md +9 -3
- package/docs/CONSUMER-RULES.md +13 -0
- package/docs/DESIGN-AUTHORITY.md +145 -83
- package/docs/DEVELOPMENT.md +4 -3
- package/docs/FORMS.md +151 -6
- package/docs/FRAME-COVERAGE-REPORT.md +32 -17
- package/docs/README.md +15 -15
- package/docs/STANDARDS-vocabulary-tokens.md +1 -1
- package/docs/TESTING.md +15 -6
- package/docs/WHAT-BELONGS-HERE.md +179 -0
- package/docs/charts/cjk-category-axis.tsx +81 -0
- package/docs/data-display/card/index.tsx +22 -0
- package/docs/data-display/data-table/examples/antd-parity.tsx +257 -0
- package/docs/data-display/data-table/index.tsx +23 -0
- package/docs/data-display/descriptions.tsx +41 -0
- package/docs/data-display/legend.tsx +145 -0
- package/docs/data-display/progress.tsx +32 -0
- package/docs/data-display/scroll-area.tsx +31 -25
- package/docs/data-display/table.tsx +104 -45
- package/docs/data-display/timeline.tsx +41 -0
- package/docs/data-entry/date-picker.tsx +85 -0
- package/docs/data-entry/date-range-picker.tsx +26 -0
- package/docs/data-entry/form-dynamic-fields.tsx +199 -0
- package/docs/data-entry/form.tsx +74 -4
- package/docs/data-entry/input-otp.tsx +24 -0
- package/docs/data-entry/input.tsx +46 -1
- package/docs/data-entry/month-range-picker.tsx +1 -1
- package/docs/data-entry/segmented.tsx +1 -1
- package/docs/data-entry/select.tsx +29 -2
- package/docs/data-entry/switch.tsx +41 -0
- package/docs/data-entry/textarea.tsx +38 -0
- package/docs/data-entry/time-picker.tsx +85 -1
- package/docs/data-entry/time-range-picker.tsx +55 -0
- package/docs/data-entry/transfer.tsx +17 -0
- package/docs/data-entry/upload.tsx +56 -12
- package/docs/feedback/sheet.tsx +1 -1
- package/docs/feedback/tooltip.tsx +1 -1
- package/docs/general/activity.tsx +2 -2
- package/docs/general/button/index.tsx +14 -1
- package/docs/general/typography.tsx +14 -1
- package/docs/layout/app-launcher.tsx +151 -0
- package/docs/layout/app-shell-arrangements.tsx +225 -0
- package/docs/layout/app-shell.tsx +11 -0
- package/docs/layout/aspect-ratio.tsx +1 -1
- package/docs/layout/flex.tsx +50 -0
- package/docs/layout/responsive-grid.tsx +21 -1
- package/docs/layout/topbar.tsx +5 -9
- package/docs/navigation/app-setting-picker.tsx +37 -1
- package/docs/navigation/app-setting-toggle.tsx +111 -0
- package/docs/navigation/breadcrumb.tsx +48 -0
- package/docs/navigation/dropdown-menu.tsx +21 -0
- package/docs/navigation/pagination.tsx +52 -0
- package/docs/navigation/steps.tsx +37 -0
- package/docs/navigation/tabs.tsx +97 -1
- package/docs/query/button-refetch.tsx +1 -0
- package/package.json +28 -8
- package/scripts/_agent-setup.mjs +182 -3
- package/scripts/consumer-rule.md +98 -0
- package/scripts/guinea-pig-skill.md +322 -0
- package/scripts/init-guinea-pig.mjs +84 -0
- package/scripts/postinstall.mjs +13 -2
- package/scripts/ui-audit.mjs +351 -37
- /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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
/**
|
|
25
|
-
|
|
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
|
|
17
|
-
const
|
|
18
|
-
|
|
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
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
/**
|
|
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 "
|
|
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
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
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 {};
|