@godxjp/ui 20.0.0 → 20.2.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/app-provider.js +37 -21
- package/dist/app/index.d.ts +2 -0
- package/dist/app/index.js +2 -0
- package/dist/app/storage.d.ts +17 -0
- package/dist/app/storage.js +28 -0
- 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 +12 -1
- package/dist/components/data-display/card.js +22 -4
- package/dist/components/data-display/code-block.js +6 -2
- 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 +2 -0
- package/dist/components/data-display/index.js +2 -0
- package/dist/components/data-display/list-row.d.ts +10 -1
- package/dist/components/data-display/list-row.js +7 -1
- package/dist/components/data-display/popover.d.ts +9 -3
- package/dist/components/data-display/popover.js +65 -11
- 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 +14 -12
- package/dist/components/data-display/table.d.ts +71 -3
- package/dist/components/data-display/table.js +56 -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 +23 -3
- package/dist/components/data-entry/cascader.d.ts +1 -1
- package/dist/components/data-entry/cascader.js +188 -24
- 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 +1 -1
- package/dist/components/data-entry/date-range-picker.js +278 -140
- 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 +4 -2
- 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/month-picker.d.ts +1 -1
- package/dist/components/data-entry/month-picker.js +47 -10
- package/dist/components/data-entry/month-range-picker.d.ts +1 -1
- 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 +86 -28
- package/dist/components/data-entry/tree-select.d.ts +1 -1
- package/dist/components/data-entry/tree-select.js +201 -113
- 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 +475 -115
- package/dist/components/feedback/dialog.js +19 -19
- package/dist/components/feedback/sheet.js +3 -0
- package/dist/components/feedback/tooltip.js +3 -0
- package/dist/components/general/button.d.ts +2 -1
- package/dist/components/general/button.js +7 -1
- package/dist/components/general/index.d.ts +1 -0
- package/dist/components/general/index.js +2 -0
- 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 +261 -0
- package/dist/components/layout/app-shell.d.ts +3 -1
- package/dist/components/layout/app-shell.js +34 -14
- package/dist/components/layout/auth-shell.d.ts +1 -1
- package/dist/components/layout/auth-shell.js +2 -0
- 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 +23 -2
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.js +5 -1
- package/dist/components/layout/org-switcher.js +20 -1
- 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/sidebar.js +2 -1
- package/dist/components/layout/topbar-item.d.ts +3 -0
- package/dist/components/layout/topbar-item.js +18 -3
- package/dist/components/layout/topbar.d.ts +1 -1
- package/dist/components/layout/topbar.js +27 -6
- package/dist/components/navigation/dropdown-menu.d.ts +30 -2
- package/dist/components/navigation/dropdown-menu.js +73 -11
- 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 +5 -33
- package/dist/components/navigation/tabs.js +232 -64
- package/dist/components/ui/hover-card.js +3 -0
- package/dist/components/ui/input-otp.d.ts +26 -28
- package/dist/components/ui/input-otp.js +50 -7
- 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 +9 -0
- package/dist/components/ui/segmented.js +17 -2
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +13 -0
- package/dist/components/ui/tag-input.d.ts +45 -0
- package/dist/components/ui/tag-input.js +109 -27
- 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/index.d.ts +1 -1
- package/dist/i18n/index.js +3 -1
- package/dist/i18n/messages/en.json +59 -6
- package/dist/i18n/messages/ja.json +59 -6
- package/dist/i18n/messages/vi.json +59 -6
- package/dist/i18n/translate.d.ts +19 -0
- package/dist/i18n/translate.js +24 -0
- 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/overlay-portal.d.ts +18 -0
- package/dist/lib/overlay-portal.js +17 -0
- package/dist/props/components/app.prop.d.ts +13 -2
- package/dist/props/components/charts.prop.d.ts +21 -0
- package/dist/props/components/data-display.prop.d.ts +55 -4
- package/dist/props/components/data-entry.prop.d.ts +687 -43
- package/dist/props/components/form.prop.d.ts +142 -4
- package/dist/props/components/general.prop.d.ts +30 -1
- package/dist/props/components/index.d.ts +2 -2
- package/dist/props/components/layout.prop.d.ts +255 -8
- package/dist/props/components/navigation.prop.d.ts +113 -3
- package/dist/props/registry.d.ts +376 -10
- package/dist/props/registry.js +493 -9
- package/dist/props/vocabulary/data.prop.d.ts +179 -1
- package/dist/props/vocabulary/index.d.ts +4 -4
- package/dist/props/vocabulary/interaction.prop.d.ts +51 -2
- 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 +36 -5
- package/dist/styles/chart-layout.css +17 -1
- package/dist/styles/control.css +520 -14
- package/dist/styles/data-display-layout.css +248 -7
- package/dist/styles/data-entry-layout.css +13 -0
- package/dist/styles/layout.css +221 -4
- package/dist/styles/navigation-layout.css +230 -1
- package/dist/styles/shell-layout.css +690 -21
- package/dist/styles/table-layout.css +95 -6
- package/dist/styles/text-layout.css +5 -0
- package/dist/tokens/base.css +1 -0
- package/dist/tokens/components/badge.css +1 -0
- package/dist/tokens/components/chart.css +6 -0
- package/dist/tokens/components/control.css +81 -3
- package/dist/tokens/components/data-display.css +9 -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 +100 -5
- 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/CONSUMER-RULES.md +13 -0
- package/docs/DESIGN-AUTHORITY.md +43 -6
- package/docs/DEVELOPMENT.md +4 -3
- package/docs/FORMS.md +151 -6
- package/docs/FRAME-COVERAGE-REPORT.md +29 -16
- package/docs/README.md +1 -1
- package/docs/STANDARDS-vocabulary-tokens.md +1 -1
- package/docs/TESTING.md +15 -6
- 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/list-row.tsx +6 -6
- 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/select.tsx +27 -0
- 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/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 +195 -0
- package/docs/layout/app-shell-arrangements.tsx +5 -5
- package/docs/layout/app-shell.tsx +11 -0
- 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 +11 -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/docs/showcase/settings-security-mfa.tsx +3 -3
- package/package.json +24 -4
- package/scripts/_agent-setup.mjs +76 -9
- package/scripts/init-guinea-pig.mjs +26 -4
- package/scripts/ui-audit.mjs +243 -30
- package/scripts/visual-audit.mjs +45 -7
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import { Plus } from "lucide-react";
|
|
5
5
|
import { cn } from "../../lib/utils.js";
|
|
6
6
|
import { Badge } from "./badge.js";
|
|
7
|
-
import { Card } from "./card.js";
|
|
7
|
+
import { Card, CardContent } from "./card.js";
|
|
8
8
|
const ServiceLauncherCard = React.forwardRef(
|
|
9
9
|
({
|
|
10
10
|
className,
|
|
@@ -20,7 +20,7 @@ const ServiceLauncherCard = React.forwardRef(
|
|
|
20
20
|
...props
|
|
21
21
|
}, ref) => {
|
|
22
22
|
const Heading = `h${titleLevel}`;
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
24
|
Card,
|
|
25
25
|
{
|
|
26
26
|
ref,
|
|
@@ -29,24 +29,26 @@ const ServiceLauncherCard = React.forwardRef(
|
|
|
29
29
|
"data-service-launcher": "",
|
|
30
30
|
"data-unavailable": disabledReason != null ? "" : void 0,
|
|
31
31
|
...props,
|
|
32
|
-
children: [
|
|
32
|
+
children: /* @__PURE__ */ jsxs(CardContent, { solo: true, children: [
|
|
33
33
|
/* @__PURE__ */ jsxs("div", { "data-slot": "service-launcher-heading", children: [
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
34
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "service-launcher-identity", children: [
|
|
35
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "service-launcher-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(Icon, {}) }),
|
|
36
|
+
/* @__PURE__ */ jsx(Heading, { "data-slot": "service-launcher-title", children: title })
|
|
37
|
+
] }),
|
|
36
38
|
statusLabel != null ? /* @__PURE__ */ jsx(Badge, { tone: statusTone, "data-slot": "service-launcher-status", children: statusLabel }) : null
|
|
37
39
|
] }),
|
|
38
40
|
description != null ? /* @__PURE__ */ jsx("div", { "data-slot": "service-launcher-description", children: description }) : null,
|
|
39
41
|
metadata != null ? /* @__PURE__ */ jsx("div", { "data-slot": "service-launcher-metadata", children: metadata }) : null,
|
|
40
42
|
disabledReason != null ? /* @__PURE__ */ jsx("div", { "data-slot": "service-launcher-disabled-reason", children: disabledReason }) : null,
|
|
41
43
|
/* @__PURE__ */ jsx("div", { "data-slot": "service-launcher-action", children: action })
|
|
42
|
-
]
|
|
44
|
+
] })
|
|
43
45
|
}
|
|
44
46
|
);
|
|
45
47
|
}
|
|
46
48
|
);
|
|
47
49
|
ServiceLauncherCard.displayName = "ServiceLauncherCard";
|
|
48
50
|
const ServiceCatalogCta = React.forwardRef(
|
|
49
|
-
({ className, icon: Icon = Plus, title, action, ...props }, ref) => /* @__PURE__ */
|
|
51
|
+
({ className, icon: Icon = Plus, title, action, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
50
52
|
Card,
|
|
51
53
|
{
|
|
52
54
|
ref,
|
|
@@ -54,11 +56,11 @@ const ServiceCatalogCta = React.forwardRef(
|
|
|
54
56
|
className: cn("ui-service-catalog-cta", className),
|
|
55
57
|
"data-service-catalog-cta": "",
|
|
56
58
|
...props,
|
|
57
|
-
children: [
|
|
59
|
+
children: /* @__PURE__ */ jsxs(CardContent, { solo: true, children: [
|
|
58
60
|
/* @__PURE__ */ jsx(Icon, { "data-slot": "service-catalog-icon", "aria-hidden": "true" }),
|
|
59
61
|
/* @__PURE__ */ jsx("div", { "data-slot": "service-catalog-title", children: title }),
|
|
60
62
|
/* @__PURE__ */ jsx("div", { "data-slot": "service-catalog-action", children: action })
|
|
61
|
-
]
|
|
63
|
+
] })
|
|
62
64
|
}
|
|
63
65
|
)
|
|
64
66
|
);
|
|
@@ -68,7 +70,7 @@ function ServiceLauncherCardSkeleton({
|
|
|
68
70
|
label,
|
|
69
71
|
...props
|
|
70
72
|
}) {
|
|
71
|
-
return /* @__PURE__ */
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
72
74
|
Card,
|
|
73
75
|
{
|
|
74
76
|
density: "tight",
|
|
@@ -76,7 +78,7 @@ function ServiceLauncherCardSkeleton({
|
|
|
76
78
|
"data-service-launcher": "",
|
|
77
79
|
"aria-busy": "true",
|
|
78
80
|
...props,
|
|
79
|
-
children: [
|
|
81
|
+
children: /* @__PURE__ */ jsxs(CardContent, { solo: true, children: [
|
|
80
82
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: label }),
|
|
81
83
|
/* @__PURE__ */ jsxs("div", { "data-slot": "service-launcher-skeleton-heading", children: [
|
|
82
84
|
/* @__PURE__ */ jsx("span", { className: "ui-skeleton-block", "data-slot": "service-launcher-skeleton-icon" }),
|
|
@@ -86,7 +88,7 @@ function ServiceLauncherCardSkeleton({
|
|
|
86
88
|
/* @__PURE__ */ jsx("span", { className: "ui-skeleton-block", "data-slot": "service-launcher-skeleton-description" }),
|
|
87
89
|
/* @__PURE__ */ jsx("span", { className: "ui-skeleton-block", "data-slot": "service-launcher-skeleton-metadata" }),
|
|
88
90
|
/* @__PURE__ */ jsx("span", { className: "ui-skeleton-block", "data-slot": "service-launcher-skeleton-action" })
|
|
89
|
-
]
|
|
91
|
+
] })
|
|
90
92
|
}
|
|
91
93
|
);
|
|
92
94
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { BreakpointProp, FlushProp, TableCellIndentProp, TableColumnPriorityProp, TablePresetProp } from "../../props/vocabulary/index.js";
|
|
2
|
+
import type { BreakpointProp, FlushProp, TableCellIndentProp, TableColumnPriorityProp, TablePresetProp, WidthProp } from "../../props/vocabulary/index.js";
|
|
3
3
|
export type TableProps = React.HTMLAttributes<HTMLTableElement> & {
|
|
4
4
|
/**
|
|
5
5
|
* Whether the Table owns its own horizontal-scroll region (default `true`). When `true` a table
|
|
@@ -18,6 +18,36 @@ export type TableProps = React.HTMLAttributes<HTMLTableElement> & {
|
|
|
18
18
|
* table exactly as it is.
|
|
19
19
|
*/
|
|
20
20
|
preset?: TablePresetProp;
|
|
21
|
+
/**
|
|
22
|
+
* PER-INSTANCE column measures for `preset="action-collection"`, in place of re-pointing its
|
|
23
|
+
* `--table-action-collection-*` knobs from a consumer stylesheet.
|
|
24
|
+
*
|
|
25
|
+
* Those knobs are global by design, and that is exactly the problem: two collections on the same
|
|
26
|
+
* screen do not share a column budget. A console that widened `actions` globally so a Japanese
|
|
27
|
+
* status badge would stop breaking to one character per line — an SC 1.4.10 reflow failure —
|
|
28
|
+
* collapsed a sibling table's name column to ~15px in the same change. The only way out was a
|
|
29
|
+
* scoped class in consumer CSS, and the comment that shipped with it said so: "until the package
|
|
30
|
+
* can express a per-table measure, the retune stays on the collection needing it".
|
|
31
|
+
*
|
|
32
|
+
* Emitted as inline custom properties, the same contract `Flex width` uses for a call-site
|
|
33
|
+
* measurement: the value is a raw length the design system cannot know, so it rides in `style`
|
|
34
|
+
* and leaves `data-column-widths` on the DOM so each one stays countable.
|
|
35
|
+
*/
|
|
36
|
+
columnWidths?: {
|
|
37
|
+
/** `--table-action-collection-actions-width` — the row-action column above the collapse step. */
|
|
38
|
+
actions?: string;
|
|
39
|
+
/** `--table-action-collection-actions-width-compact` — the same column below it. */
|
|
40
|
+
actionsCompact?: string;
|
|
41
|
+
/** `--table-action-collection-meta-width-compact` — a `meta`-priority column below the step. */
|
|
42
|
+
metaCompact?: string;
|
|
43
|
+
/**
|
|
44
|
+
* `--table-action-collection-min-inline-size-compact` — the legibility FLOOR the compact tier
|
|
45
|
+
* keeps before the wrapper scrolls. The preset sizes its compact tier for one column per
|
|
46
|
+
* priority; a collection carrying several of the same priority needs a wider floor or its
|
|
47
|
+
* free-text column is squeezed toward zero.
|
|
48
|
+
*/
|
|
49
|
+
minInlineSizeCompact?: string;
|
|
50
|
+
};
|
|
21
51
|
/** Defaults to `"sm"` (40rem). Ignored while `preset` is `"default"`. */
|
|
22
52
|
collapseBelow?: BreakpointProp;
|
|
23
53
|
};
|
|
@@ -39,6 +69,36 @@ export declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes
|
|
|
39
69
|
* table exactly as it is.
|
|
40
70
|
*/
|
|
41
71
|
preset?: TablePresetProp;
|
|
72
|
+
/**
|
|
73
|
+
* PER-INSTANCE column measures for `preset="action-collection"`, in place of re-pointing its
|
|
74
|
+
* `--table-action-collection-*` knobs from a consumer stylesheet.
|
|
75
|
+
*
|
|
76
|
+
* Those knobs are global by design, and that is exactly the problem: two collections on the same
|
|
77
|
+
* screen do not share a column budget. A console that widened `actions` globally so a Japanese
|
|
78
|
+
* status badge would stop breaking to one character per line — an SC 1.4.10 reflow failure —
|
|
79
|
+
* collapsed a sibling table's name column to ~15px in the same change. The only way out was a
|
|
80
|
+
* scoped class in consumer CSS, and the comment that shipped with it said so: "until the package
|
|
81
|
+
* can express a per-table measure, the retune stays on the collection needing it".
|
|
82
|
+
*
|
|
83
|
+
* Emitted as inline custom properties, the same contract `Flex width` uses for a call-site
|
|
84
|
+
* measurement: the value is a raw length the design system cannot know, so it rides in `style`
|
|
85
|
+
* and leaves `data-column-widths` on the DOM so each one stays countable.
|
|
86
|
+
*/
|
|
87
|
+
columnWidths?: {
|
|
88
|
+
/** `--table-action-collection-actions-width` — the row-action column above the collapse step. */
|
|
89
|
+
actions?: string;
|
|
90
|
+
/** `--table-action-collection-actions-width-compact` — the same column below it. */
|
|
91
|
+
actionsCompact?: string;
|
|
92
|
+
/** `--table-action-collection-meta-width-compact` — a `meta`-priority column below the step. */
|
|
93
|
+
metaCompact?: string;
|
|
94
|
+
/**
|
|
95
|
+
* `--table-action-collection-min-inline-size-compact` — the legibility FLOOR the compact tier
|
|
96
|
+
* keeps before the wrapper scrolls. The preset sizes its compact tier for one column per
|
|
97
|
+
* priority; a collection carrying several of the same priority needs a wider floor or its
|
|
98
|
+
* free-text column is squeezed toward zero.
|
|
99
|
+
*/
|
|
100
|
+
minInlineSizeCompact?: string;
|
|
101
|
+
};
|
|
42
102
|
/** Defaults to `"sm"` (40rem). Ignored while `preset` is `"default"`. */
|
|
43
103
|
collapseBelow?: BreakpointProp;
|
|
44
104
|
} & React.RefAttributes<HTMLTableElement>>;
|
|
@@ -53,6 +113,14 @@ export declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttribu
|
|
|
53
113
|
type TableCellPriority = {
|
|
54
114
|
priority?: TableColumnPriorityProp;
|
|
55
115
|
};
|
|
116
|
+
/** Logical column alignment, wrapping and measure, shared by header and body cells.
|
|
117
|
+
* Numeric cells use tabular figures and end alignment unless align is explicit. */
|
|
118
|
+
type TableCellAxes = {
|
|
119
|
+
align?: "start" | "center" | "end";
|
|
120
|
+
numeric?: boolean;
|
|
121
|
+
wrap?: boolean;
|
|
122
|
+
width?: WidthProp;
|
|
123
|
+
};
|
|
56
124
|
/**
|
|
57
125
|
* Rendered into the DOM unconditionally (so it exists for the preset's CSS to reveal) but visually
|
|
58
126
|
* hidden above the collapse step, where the real `<th>` already carries the label — an ordinary
|
|
@@ -61,7 +129,7 @@ type TableCellPriority = {
|
|
|
61
129
|
type TableCellLabel = {
|
|
62
130
|
label?: React.ReactNode;
|
|
63
131
|
};
|
|
64
|
-
export declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & TableCellPriority & React.RefAttributes<HTMLTableCellElement>>;
|
|
132
|
+
export declare const TableHead: React.ForwardRefExoticComponent<Omit<React.ThHTMLAttributes<HTMLTableCellElement>, "align"> & TableCellPriority & TableCellAxes & React.RefAttributes<HTMLTableCellElement>>;
|
|
65
133
|
/**
|
|
66
134
|
* The cell's CONTENT owns its inset — an expanded detail panel, a nested table, a full-bleed media
|
|
67
135
|
* strip. The cell drops its own padding so the child reaches the cell edges; without it the only
|
|
@@ -79,5 +147,5 @@ type TableCellFlush = {
|
|
|
79
147
|
type TableCellIndent = {
|
|
80
148
|
indent?: TableCellIndentProp;
|
|
81
149
|
};
|
|
82
|
-
export declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & TableCellPriority & TableCellLabel & TableCellFlush & TableCellIndent & React.RefAttributes<HTMLTableCellElement>>;
|
|
150
|
+
export declare const TableCell: React.ForwardRefExoticComponent<Omit<React.TdHTMLAttributes<HTMLTableCellElement>, "align"> & TableCellPriority & TableCellLabel & TableCellFlush & TableCellIndent & TableCellAxes & React.RefAttributes<HTMLTableCellElement>>;
|
|
83
151
|
export {};
|
|
@@ -9,6 +9,7 @@ const Table = React.forwardRef(
|
|
|
9
9
|
bordered = false,
|
|
10
10
|
preset = "default",
|
|
11
11
|
collapseBelow = "sm",
|
|
12
|
+
columnWidths,
|
|
12
13
|
...props
|
|
13
14
|
}, ref) => (
|
|
14
15
|
// A table wider than its container scrolls horizontally in this wrapper; keep it
|
|
@@ -27,6 +28,13 @@ const Table = React.forwardRef(
|
|
|
27
28
|
),
|
|
28
29
|
"data-preset": preset === "default" ? void 0 : preset,
|
|
29
30
|
"data-collapse-below": preset === "default" ? void 0 : collapseBelow,
|
|
31
|
+
"data-column-widths": columnWidths ? "" : void 0,
|
|
32
|
+
style: columnWidths ? {
|
|
33
|
+
"--table-action-collection-actions-width": columnWidths.actions,
|
|
34
|
+
"--table-action-collection-actions-width-compact": columnWidths.actionsCompact,
|
|
35
|
+
"--table-action-collection-meta-width-compact": columnWidths.metaCompact,
|
|
36
|
+
"--table-action-collection-min-inline-size-compact": columnWidths.minInlineSizeCompact
|
|
37
|
+
} : void 0,
|
|
30
38
|
...scrollable ? { tabIndex: 0 } : {},
|
|
31
39
|
children: /* @__PURE__ */ jsx(
|
|
32
40
|
"table",
|
|
@@ -65,34 +73,64 @@ const TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
65
73
|
}
|
|
66
74
|
));
|
|
67
75
|
TableRow.displayName = "TableRow";
|
|
68
|
-
|
|
76
|
+
function cellWidth(width) {
|
|
77
|
+
if (width === void 0) return void 0;
|
|
78
|
+
return typeof width === "number" ? `${width}px` : width;
|
|
79
|
+
}
|
|
80
|
+
const TableHead = React.forwardRef(({ className, priority, align, numeric, wrap, width, style, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
69
81
|
"th",
|
|
70
82
|
{
|
|
71
83
|
ref,
|
|
72
84
|
"data-slot": "table-head",
|
|
73
85
|
"data-priority": priority,
|
|
86
|
+
"data-align": align,
|
|
87
|
+
"data-numeric": numeric ? "" : void 0,
|
|
88
|
+
"data-wrap": wrap ? "" : void 0,
|
|
74
89
|
className: cn(tableHeadHeightClass, className),
|
|
90
|
+
style: width === void 0 ? style : { ...style, inlineSize: cellWidth(width) },
|
|
75
91
|
...props
|
|
76
92
|
}
|
|
77
93
|
));
|
|
78
94
|
TableHead.displayName = "TableHead";
|
|
79
|
-
const TableCell = React.forwardRef(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
children
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
const TableCell = React.forwardRef(
|
|
96
|
+
({
|
|
97
|
+
className,
|
|
98
|
+
priority,
|
|
99
|
+
label,
|
|
100
|
+
flush,
|
|
101
|
+
indent,
|
|
102
|
+
align,
|
|
103
|
+
numeric,
|
|
104
|
+
wrap,
|
|
105
|
+
width,
|
|
106
|
+
children,
|
|
107
|
+
style,
|
|
108
|
+
...props
|
|
109
|
+
}, ref) => /* @__PURE__ */ jsxs(
|
|
110
|
+
"td",
|
|
111
|
+
{
|
|
112
|
+
ref,
|
|
113
|
+
"data-slot": "table-cell",
|
|
114
|
+
"data-priority": priority,
|
|
115
|
+
"data-flush": flush ? "" : void 0,
|
|
116
|
+
"data-indent": indent === void 0 ? void 0 : indent,
|
|
117
|
+
"data-align": align,
|
|
118
|
+
"data-numeric": numeric ? "" : void 0,
|
|
119
|
+
"data-wrap": wrap ? "" : void 0,
|
|
120
|
+
className: cn(className),
|
|
121
|
+
style: indent === void 0 && width === void 0 ? style : {
|
|
122
|
+
...style,
|
|
123
|
+
...indent === void 0 ? null : { "--table-cell-indent-level": indent },
|
|
124
|
+
...width === void 0 ? null : { inlineSize: cellWidth(width) }
|
|
125
|
+
},
|
|
126
|
+
...props,
|
|
127
|
+
children: [
|
|
128
|
+
label !== void 0 ? /* @__PURE__ */ jsx("span", { className: "ui-table-stacked-collection-label", "aria-hidden": "true", children: label }) : null,
|
|
129
|
+
children
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
);
|
|
96
134
|
TableCell.displayName = "TableCell";
|
|
97
135
|
export {
|
|
98
136
|
Table,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ChevronRight, Package } from "lucide-react";
|
|
4
3
|
import { Badge } from "./badge.js";
|
|
5
4
|
function TreeList({ items }) {
|
|
6
5
|
return /* @__PURE__ */ jsx("ul", { className: "ui-tree-list", children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
@@ -8,19 +7,15 @@ function TreeList({ items }) {
|
|
|
8
7
|
{
|
|
9
8
|
className: "ui-tree-item",
|
|
10
9
|
"data-active": item.active ? "true" : void 0,
|
|
11
|
-
"data-depth": item.depth ?? 0,
|
|
10
|
+
"data-depth": Math.max(0, item.depth ?? 0),
|
|
11
|
+
style: { "--tree-item-depth": Math.max(0, item.depth ?? 0) },
|
|
12
12
|
"aria-current": item.active ? "true" : void 0,
|
|
13
13
|
children: [
|
|
14
|
-
/* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" }),
|
|
15
|
-
/* @__PURE__ */ jsx(Package, { "aria-hidden": "true" }),
|
|
16
14
|
/* @__PURE__ */ jsxs("div", { className: "ui-tree-item-body", children: [
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
item.active ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Current: " }) : null,
|
|
19
|
-
item.title
|
|
20
|
-
] }),
|
|
15
|
+
/* @__PURE__ */ jsx("div", { className: "ui-tree-item-title", children: item.title }),
|
|
21
16
|
item.description ? /* @__PURE__ */ jsx("div", { className: "ui-tree-item-description", children: item.description }) : null
|
|
22
17
|
] }),
|
|
23
|
-
item.badge ? /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: item.badge }) : null
|
|
18
|
+
item.badge != null ? /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: item.badge }) : null
|
|
24
19
|
]
|
|
25
20
|
},
|
|
26
21
|
item.id
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { CalendarProp } from "../../props/components/data-entry.prop.js";
|
|
3
|
-
export type { CalendarProp, CalendarProp as CalendarProps, CalendarFooterProp, } from "../../props/components/data-entry.prop.js";
|
|
4
|
-
export declare function Calendar({ className, classNames, showOutsideDays, "aria-label": ariaLabel, labels, showToday, showClose, onClose, footer, width, bordered, month: monthProp, onMonthChange, ...props }: CalendarProp): React.JSX.Element;
|
|
3
|
+
export type { CalendarProp, CalendarProp as CalendarProps, CalendarCellRenderProp, CalendarFooterProp, } from "../../props/components/data-entry.prop.js";
|
|
4
|
+
export declare function Calendar({ className, classNames, showOutsideDays, "aria-label": ariaLabel, labels, showToday, showClose, onClose, footer, width, bordered, cellRender, month: monthProp, onMonthChange, locale: localeProp, ...props }: CalendarProp): React.JSX.Element;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp } from "lucide-react";
|
|
5
|
-
import { DayPicker, dateMatchModifiers } from "react-day-picker";
|
|
6
|
-
import { useTranslation } from "../../i18n/use-translation.js";
|
|
5
|
+
import { DayButton, DayPicker, dateMatchModifiers } from "react-day-picker";
|
|
6
|
+
import { usePickerLocales, useTranslation } from "../../i18n/use-translation.js";
|
|
7
7
|
import { cn } from "../../lib/utils.js";
|
|
8
8
|
import { controlIconSmClass } from "../../lib/control-styles.js";
|
|
9
9
|
import { Button, buttonVariants } from "../general/button.js";
|
|
@@ -23,11 +23,14 @@ function Calendar({
|
|
|
23
23
|
footer,
|
|
24
24
|
width = "auto",
|
|
25
25
|
bordered = false,
|
|
26
|
+
cellRender,
|
|
26
27
|
month: monthProp,
|
|
27
28
|
onMonthChange,
|
|
29
|
+
locale: localeProp,
|
|
28
30
|
...props
|
|
29
31
|
}) {
|
|
30
32
|
const { t } = useTranslation();
|
|
33
|
+
const { dayPickerLocale } = usePickerLocales(localeProp);
|
|
31
34
|
const [month, setMonth] = React.useState(monthProp ?? props.defaultMonth);
|
|
32
35
|
const today = startOfDay(props.today ?? /* @__PURE__ */ new Date());
|
|
33
36
|
const todayDisabled = props.startMonth != null && today < startOfMonth(props.startMonth) || props.endMonth != null && today > endOfMonth(props.endMonth) || props.disabled != null && dateMatchModifiers(today, props.disabled);
|
|
@@ -67,6 +70,7 @@ function Calendar({
|
|
|
67
70
|
return /* @__PURE__ */ jsx(
|
|
68
71
|
DayPicker,
|
|
69
72
|
{
|
|
73
|
+
locale: dayPickerLocale,
|
|
70
74
|
showOutsideDays,
|
|
71
75
|
"aria-label": ariaLabel,
|
|
72
76
|
month: showToday ? monthProp ?? month : monthProp,
|
|
@@ -77,7 +81,13 @@ function Calendar({
|
|
|
77
81
|
footer: footer ?? actions,
|
|
78
82
|
labels: {
|
|
79
83
|
...labels,
|
|
80
|
-
|
|
84
|
+
/*
|
|
85
|
+
* LOCALIZED, like every other string this component renders. It was an English literal
|
|
86
|
+
* built by template — so a Japanese calendar announced its own month controls as "Calendar
|
|
87
|
+
* navigation" while the two buttons INSIDE that container said 前の月へ and 次の月へ. Nothing
|
|
88
|
+
* failed and nothing warned; the only reader affected was the one using a screen reader.
|
|
89
|
+
*/
|
|
90
|
+
labelNav: labels?.labelNav ?? (() => t("dataEntry.calendar.nav", { label: ariaLabel ?? t("dataEntry.calendar.name") }))
|
|
81
91
|
},
|
|
82
92
|
className: cn("ui-calendar", className),
|
|
83
93
|
"data-width": width === "full" ? "full" : void 0,
|
|
@@ -169,6 +179,16 @@ function Calendar({
|
|
|
169
179
|
const Icon = orientation === "left" ? ChevronLeft : orientation === "up" ? ChevronUp : orientation === "down" ? ChevronDown : ChevronRight;
|
|
170
180
|
return /* @__PURE__ */ jsx(Icon, { className: cn("ui-calendar-chevron", chevronClassName), "aria-hidden": "true" });
|
|
171
181
|
},
|
|
182
|
+
/**
|
|
183
|
+
* `cellRender` WRAPS the library's own day button rather than replacing it (gh#390). The
|
|
184
|
+
* button carries the selection state, `aria-selected`, the disabled handling and its place
|
|
185
|
+
* in the grid's roving tabindex; handing a consumer a blank cell to rebuild would mean
|
|
186
|
+
* every 祝日 marker in every app re-derives all of that, and most would get it wrong.
|
|
187
|
+
* So the original node is passed in and the consumer decorates around it.
|
|
188
|
+
*/
|
|
189
|
+
...cellRender ? {
|
|
190
|
+
DayButton: (dayButtonProps) => /* @__PURE__ */ jsx(Fragment, { children: cellRender(dayButtonProps.day.date, { originNode: /* @__PURE__ */ jsx(DayButton, { ...dayButtonProps }) }) })
|
|
191
|
+
} : {},
|
|
172
192
|
/*
|
|
173
193
|
* A consumer's `components` MERGE with ours; they must not replace the object.
|
|
174
194
|
*
|
|
@@ -2,4 +2,4 @@ import * as React from "react";
|
|
|
2
2
|
import type { CascaderProp } from "../../props/components/data-entry.prop.js";
|
|
3
3
|
export type { CascaderProp, CascaderProp as CascaderProps, } from "../../props/components/data-entry.prop.js";
|
|
4
4
|
export type { TreeOption, TreeFieldNames } from "./tree-utils.js";
|
|
5
|
-
export declare function Cascader({ options: optionsProp, value, defaultValue, onValueChange, multiple, changeOnSelect, showSearch, placeholder, disabled, className, id, expandTrigger, fieldNames, allowClear, ...ariaProps }: CascaderProp): React.JSX.Element;
|
|
5
|
+
export declare function Cascader({ options: optionsProp, value, defaultValue, onValueChange, multiple, changeOnSelect, showSearch, placeholder, disabled, readOnly, name, className, id, expandTrigger, fieldNames, allowClear, size, status, variant, loading, open: openProp, defaultOpen, onOpenChange, showCheckedStrategy, loadData, displayRender, optionRender, maxTagCount, maxTagPlaceholder, notFoundContent, autoClearSearchValue, search: searchProp, onSearchChange, ...ariaProps }: CascaderProp): React.JSX.Element;
|