@godxjp/ui 20.0.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 +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 +2 -2
- package/dist/components/data-display/popover.js +61 -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 +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 +12 -1
- 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 +16 -19
- package/dist/components/general/button.d.ts +1 -1
- package/dist/components/general/button.js +5 -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 +228 -0
- package/dist/components/layout/app-shell.d.ts +2 -0
- package/dist/components/layout/app-shell.js +20 -7
- 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/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 +68 -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/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/messages/en.json +56 -5
- package/dist/i18n/messages/ja.json +56 -5
- package/dist/i18n/messages/vi.json +56 -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/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 +17 -1
- package/dist/props/components/index.d.ts +2 -2
- package/dist/props/components/layout.prop.d.ts +163 -6
- 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 +26 -4
- package/dist/styles/chart-layout.css +15 -0
- package/dist/styles/control.css +515 -14
- package/dist/styles/data-display-layout.css +241 -6
- package/dist/styles/data-entry-layout.css +13 -0
- package/dist/styles/layout.css +221 -4
- package/dist/styles/navigation-layout.css +227 -0
- package/dist/styles/shell-layout.css +229 -5
- 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 +79 -2
- 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 +50 -2
- package/dist/tokens/components/table.css +14 -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/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 +151 -0
- 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/package.json +19 -2
- package/scripts/_agent-setup.mjs +19 -2
- package/scripts/init-guinea-pig.mjs +26 -4
- package/scripts/ui-audit.mjs +243 -30
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @see docs/PROPS-VOCABULARY.md#data-collections
|
|
4
4
|
*/
|
|
5
5
|
import type * as React from "react";
|
|
6
|
-
import type { ColumnAlignProp, SortDirectionProp } from "./interaction.prop.js";
|
|
6
|
+
import type { BreakpointProp, ColumnAlignProp, SortDirectionProp } from "./interaction.prop.js";
|
|
7
7
|
import type { TableDensityProp } from "./layout.prop.js";
|
|
8
8
|
/** Generic row identifier extractor for tables with selection. */
|
|
9
9
|
export type GetRowIdProp<T> = (row: T) => string;
|
|
@@ -54,6 +54,45 @@ export type ColumnDefProp<T> = {
|
|
|
54
54
|
* — it takes the remaining space.
|
|
55
55
|
*/
|
|
56
56
|
priority?: TableColumnPriorityProp;
|
|
57
|
+
/**
|
|
58
|
+
* Freeze the column against a scroll edge (antd `ColumnType.fixed`). The offsets are MEASURED
|
|
59
|
+
* from the rendered header cells and published as `--table-fixed-offset`, so several adjacent
|
|
60
|
+
* fixed columns stack correctly at any width, in either writing direction. `pin: "end"` is the
|
|
61
|
+
* older spelling of `fixed: "end"` and still works.
|
|
62
|
+
*/
|
|
63
|
+
fixed?: ColumnFixedProp;
|
|
64
|
+
/**
|
|
65
|
+
* Hold the cell to ONE line and truncate the overflow (antd `ColumnType.ellipsis`). The full text
|
|
66
|
+
* is kept reachable as the cell's `title`, so nothing is silently lost.
|
|
67
|
+
*/
|
|
68
|
+
ellipsis?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Sort declaration (antd `ColumnType.sorter`). `sorter: true` is the same opt-in as `sortable`;
|
|
71
|
+
* a comparator sorts by it; `{ compare, multiple }` joins the MULTI-column sort, highest
|
|
72
|
+
* `multiple` first.
|
|
73
|
+
*/
|
|
74
|
+
sorter?: ColumnSorterProp<T>;
|
|
75
|
+
/** Controlled sort direction for THIS column (antd `sortOrder`). `null` = not sorted. */
|
|
76
|
+
sortOrder?: SortDirectionProp | null;
|
|
77
|
+
/** Initial uncontrolled sort direction (antd `defaultSortOrder`). */
|
|
78
|
+
defaultSortOrder?: SortDirectionProp;
|
|
79
|
+
/**
|
|
80
|
+
* The directions this column cycles through (antd `sortDirections`), in order; the cycle ends by
|
|
81
|
+
* clearing the sort. Default `["asc", "desc"]`.
|
|
82
|
+
*/
|
|
83
|
+
sortDirections?: SortDirectionProp[];
|
|
84
|
+
/** Explain the next sort step in a tooltip on the header (antd `showSorterTooltip`). */
|
|
85
|
+
showSorterTooltip?: boolean;
|
|
86
|
+
/** Filter menu options (antd `filters`). Presence of this array is what adds the filter icon. */
|
|
87
|
+
filters?: ColumnFilterItemProp[];
|
|
88
|
+
/** Controlled filter selection (antd `filteredValue`). `null` = no filter. */
|
|
89
|
+
filteredValue?: ColumnFilterStateProp | null;
|
|
90
|
+
/** Initial uncontrolled filter selection (antd `defaultFilteredValue`). */
|
|
91
|
+
defaultFilteredValue?: ColumnFilterStateProp;
|
|
92
|
+
/** `false` makes the menu single-select (antd `filterMultiple`). Default `true`. */
|
|
93
|
+
filterMultiple?: boolean;
|
|
94
|
+
/** Row predicate for one selected filter value (antd `onFilter`). Omit for server filtering. */
|
|
95
|
+
onFilter?: (value: ColumnFilterValueProp, row: T) => boolean;
|
|
57
96
|
};
|
|
58
97
|
/** Set of selected row IDs. */
|
|
59
98
|
export type SelectedIdsProp = Set<string>;
|
|
@@ -93,3 +132,142 @@ export type TableColumnPriorityProp = "primary" | "secondary" | "meta" | "action
|
|
|
93
132
|
* expresses its level instead of hand-rolling `style={{ paddingInlineStart }}` at the call site.
|
|
94
133
|
*/
|
|
95
134
|
export type TableCellIndentProp = number;
|
|
135
|
+
/**
|
|
136
|
+
* Sticky edge a column freezes against while the rest of the table scrolls horizontally. Logical,
|
|
137
|
+
* not physical: `"start"` is the inline-start edge (visual left in LTR, right in RTL). antd's
|
|
138
|
+
* `fixed` accepts the physical `left`/`right`; those cannot be mirrored for an RTL locale, which is
|
|
139
|
+
* why only the logical pair is published here.
|
|
140
|
+
*/
|
|
141
|
+
export type ColumnFixedProp = "start" | "end";
|
|
142
|
+
/** A value a column filter can carry — the closed set a `<Checkbox>`/`<Radio>` option can hold. */
|
|
143
|
+
export type ColumnFilterValueProp = string | number | boolean;
|
|
144
|
+
/** One option in a column's filter menu (antd `ColumnFilterItem`). */
|
|
145
|
+
export type ColumnFilterItemProp = {
|
|
146
|
+
text: React.ReactNode;
|
|
147
|
+
value: ColumnFilterValueProp;
|
|
148
|
+
};
|
|
149
|
+
/** The active filter selection for one column (antd `FilterValue`). */
|
|
150
|
+
export type ColumnFilterStateProp = ColumnFilterValueProp[];
|
|
151
|
+
/**
|
|
152
|
+
* Column-filter change handler — this library's split of the `filters` argument antd hands to the
|
|
153
|
+
* table-level `onChange`. Keyed by column, so a controlled `filteredValue` has somewhere to be
|
|
154
|
+
* driven from.
|
|
155
|
+
*/
|
|
156
|
+
export type OnColumnFilterChangeProp = (filters: Record<string, ColumnFilterStateProp>) => void;
|
|
157
|
+
/** Column comparator — the `compare` half of antd's `sorter`. */
|
|
158
|
+
export type ColumnCompareProp<T> = (a: T, b: T) => number;
|
|
159
|
+
/**
|
|
160
|
+
* Column sort declaration (antd `ColumnType.sorter`). `true` sorts on the column's own value;
|
|
161
|
+
* a function is the comparator; the object form adds `multiple`, the MULTI-COLUMN sort priority —
|
|
162
|
+
* a higher number sorts first, exactly as in antd.
|
|
163
|
+
*/
|
|
164
|
+
export type ColumnSorterProp<T> = boolean | ColumnCompareProp<T> | {
|
|
165
|
+
compare?: ColumnCompareProp<T>;
|
|
166
|
+
multiple?: number;
|
|
167
|
+
};
|
|
168
|
+
/** One entry in the selection-column dropdown (antd `SelectionItem`). */
|
|
169
|
+
export type TableSelectionItemProp = {
|
|
170
|
+
key: string;
|
|
171
|
+
text: React.ReactNode;
|
|
172
|
+
onSelect: (currentRowKeys: string[]) => void;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Row-selection configuration (antd `TableRowSelection`). The object form is the full surface;
|
|
176
|
+
* the older `selectable` / `selected` / `onSelectChange` triple stays and drives the same state.
|
|
177
|
+
*/
|
|
178
|
+
export type TableRowSelectionProp<T> = {
|
|
179
|
+
/** `"checkbox"` (default, multi) or `"radio"` (single). */
|
|
180
|
+
type?: "checkbox" | "radio";
|
|
181
|
+
selectedRowKeys?: string[];
|
|
182
|
+
defaultSelectedRowKeys?: string[];
|
|
183
|
+
onChange?: (selectedRowKeys: string[], selectedRows: T[]) => void;
|
|
184
|
+
/** Per-row checkbox overrides — the standard home for "this row cannot be selected". */
|
|
185
|
+
getCheckboxProps?: (row: T) => {
|
|
186
|
+
disabled?: boolean;
|
|
187
|
+
"aria-label"?: string;
|
|
188
|
+
};
|
|
189
|
+
/** Keep keys selected even once their row leaves `data` (server paging / filtering). */
|
|
190
|
+
preserveSelectedRowKeys?: boolean;
|
|
191
|
+
/** Extra bulk-select entries under the header checkbox. `true` = the built-in all/none/invert. */
|
|
192
|
+
selections?: TableSelectionItemProp[] | boolean;
|
|
193
|
+
hideSelectAll?: boolean;
|
|
194
|
+
columnTitle?: React.ReactNode;
|
|
195
|
+
};
|
|
196
|
+
/** Expandable-row configuration (antd/rc-table `ExpandableConfig`). */
|
|
197
|
+
export type TableExpandableProp<T> = {
|
|
198
|
+
/** Renders the detail panel for an expanded row. Omit and nothing is expandable. */
|
|
199
|
+
expandedRowRender?: (row: T, index: number, expanded: boolean) => React.ReactNode;
|
|
200
|
+
/** Rows this returns `false` for get no expand affordance. Default: every row is expandable. */
|
|
201
|
+
rowExpandable?: (row: T) => boolean;
|
|
202
|
+
defaultExpandAllRows?: boolean;
|
|
203
|
+
expandedRowKeys?: string[];
|
|
204
|
+
onExpandedRowsChange?: (expandedRowKeys: string[]) => void;
|
|
205
|
+
/** Clicking anywhere on the row toggles it (antd `expandRowByClick`). */
|
|
206
|
+
expandRowByClick?: boolean;
|
|
207
|
+
columnTitle?: React.ReactNode;
|
|
208
|
+
};
|
|
209
|
+
/** Footer totals row — receives the rows currently rendered (antd/rc-table `summary`). */
|
|
210
|
+
export type TableSummaryProp<T> = (rows: readonly T[]) => React.ReactNode;
|
|
211
|
+
/**
|
|
212
|
+
* Scroll envelope (antd `scroll`). `x` is the table's minimum inline size (it scrolls horizontally
|
|
213
|
+
* past it), `y` the body's maximum block size (it scrolls vertically past it). Both are published
|
|
214
|
+
* as the `--table-scroll-x` / `--table-scroll-y` custom properties, so the LENGTHS stay data while
|
|
215
|
+
* the geometry that reads them stays in the stylesheet.
|
|
216
|
+
*/
|
|
217
|
+
export type TableScrollProp = {
|
|
218
|
+
x?: number | string;
|
|
219
|
+
y?: number | string;
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* Sticky header (antd `sticky`). `true` pins the header to its scroll container; the object form
|
|
223
|
+
* adds the offset a page-level fixed topbar needs, published as `--table-sticky-offset`.
|
|
224
|
+
*/
|
|
225
|
+
export type TableStickyProp = boolean | {
|
|
226
|
+
offsetHeader?: number | string;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Per-row DOM props (antd `onRow`) — event handlers and attributes merged onto the `<tr>`.
|
|
230
|
+
* The `data-*` index signature is deliberate: the commonest reason to reach for `onRow` at all is
|
|
231
|
+
* to stamp a row key or an E2E hook onto the element, and `React.HTMLAttributes` alone rejects it.
|
|
232
|
+
*/
|
|
233
|
+
export type OnRowProp<T> = (row: T, index: number) => (React.HTMLAttributes<HTMLTableRowElement> & {
|
|
234
|
+
[dataAttribute: `data-${string}`]: string | number | boolean | undefined;
|
|
235
|
+
}) | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Pagination object surface (antd `TablePaginationConfig`). 1-BASED `current`, like antd — the
|
|
238
|
+
* TanStack-shaped `{ pageIndex, pageSize }` form the prop already accepted is still accepted and
|
|
239
|
+
* is told apart by its `pageIndex` field. `false` hides the pager entirely.
|
|
240
|
+
*/
|
|
241
|
+
export type TablePaginationProp = {
|
|
242
|
+
/** 1-based current page. */
|
|
243
|
+
current?: number;
|
|
244
|
+
pageSize?: number;
|
|
245
|
+
/** Total row count on the server — drives the page count under manual pagination. */
|
|
246
|
+
total?: number;
|
|
247
|
+
pageSizeOptions?: number[];
|
|
248
|
+
/** Default `true`. `false` drops the rows-per-page select. */
|
|
249
|
+
showSizeChanger?: boolean;
|
|
250
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Descriptions column count (antd `column`). A plain number keeps this library's own mobile-first
|
|
254
|
+
* ladder; the `{ sm, md, lg, xl }` object is antd's responsive form, expressed against this
|
|
255
|
+
* library's own `BreakpointProp` set.
|
|
256
|
+
*/
|
|
257
|
+
export type DescriptionsColumnProp = number | Partial<Record<BreakpointProp, number>>;
|
|
258
|
+
/**
|
|
259
|
+
* How many columns one Descriptions item occupies (antd `span`). `"filled"` takes the whole
|
|
260
|
+
* remaining row; the object form spans a different number of columns per breakpoint.
|
|
261
|
+
*/
|
|
262
|
+
export type DescriptionsSpanProp = number | "filled" | Partial<Record<BreakpointProp, number>>;
|
|
263
|
+
/** Declarative Descriptions items (antd `items`) — the alternative to composing children. */
|
|
264
|
+
export type DescriptionsItemsProp = {
|
|
265
|
+
key?: React.Key;
|
|
266
|
+
label: React.ReactNode;
|
|
267
|
+
/** The value. `children` is antd's name for it; `value` is this library's older one. */
|
|
268
|
+
children?: React.ReactNode;
|
|
269
|
+
value?: React.ReactNode;
|
|
270
|
+
mono?: boolean;
|
|
271
|
+
span?: DescriptionsSpanProp;
|
|
272
|
+
className?: string;
|
|
273
|
+
}[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Barrel — all vocabulary prop types. */
|
|
2
|
-
export type { ClassNameProp, ChildrenProp, IdProp, OpenProp, DefaultOpenProp, OnOpenChangeProp, HandlerProp, PendingProp, RequiredProp, DisabledProp, LabelProp, HelperProp, ErrorProp, ErrorBagProp, PlaceholderProp, NameProp, ValueProp, DefaultValueProp, OnValueChangeProp, OnChangeProp, OnClickProp, AsChildProp, FlushProp, WidthProp, ControlWidthProp, } from "./shared.prop.js";
|
|
2
|
+
export type { ClassNameProp, ChildrenProp, IdProp, OpenProp, DefaultOpenProp, OnOpenChangeProp, HandlerProp, PendingProp, RequiredProp, DisabledProp, LabelProp, HelperProp, ErrorProp, ErrorBagProp, PlaceholderProp, NameProp, ValueProp, DefaultValueProp, OnValueChangeProp, OnChangeProp, OnClickProp, AsChildProp, FlushProp, WidthProp, ControlWidthProp, AllowClearProp, MaxTagCountProp, MaxTagPlaceholderProp, NotFoundContentProp, PopupMatchWidthProp, } from "./shared.prop.js";
|
|
3
3
|
export type { TitleProp, SubtitleProp, StatusProp, DescriptionProp, ExtraProp, FooterProp, ActionProp, IconProp, ConfirmLabelProp, CancelLabelProp, ActionsProp, EmptyMessageProp, } from "./content.prop.js";
|
|
4
4
|
export type { PageDensityProp, PageContainerVariantProp, CenteredShellWidthProp, CenteredShellAlignProp, CenteredShellPresetProp, ErrorSurfaceModeProp, ErrorSurfaceStatusProp, AuthShellPresetProp, MobileShellHeightProp, OrientationProp, TableDensityProp, DensityProp, GapNameProp, PadProp, PadRawProp, PadSides, GapProp, GapStepProp, } from "./layout.prop.js";
|
|
5
|
-
export type { ButtonVariantProp, ButtonSizeProp, BadgeVariantProp, AppSettingPickerAppearanceProp, AppSettingToggleAppearanceProp, ShapeProp, AvatarShapeProp, TextSizeProp, TextToneProp, FontWeightProp, HeadingLevelProp, TextAlignProp, SizeProp, FormLayoutProp, DescriptionsLayoutProp, BreakpointProp, ConfirmVariantProp, ToneProp, AlertVariantProp, SortDirectionProp, ColumnAlignProp, SortStateProp, RevealDelayProp, ActivityVariantProp, ActivityAnnounceProp, } from "./interaction.prop.js";
|
|
6
|
-
export type { BreadcrumbItemProp, BreadcrumbProp } from "./navigation.prop.js";
|
|
7
|
-
export type { GetRowIdProp, OnRowClickProp, ColumnDefProp, TablePresetProp, TableColumnPriorityProp, TableCellIndentProp, SelectedIdsProp, OnSelectChangeProp, OnTableDensityChangeProp, OnSortChangeProp, OnSearchChangeProp, OnClearFiltersProp, HasActiveFiltersProp, StickyProp, } from "./data.prop.js";
|
|
5
|
+
export type { ButtonVariantProp, ButtonSizeProp, BadgeVariantProp, AppSettingPickerAppearanceProp, AppSettingToggleAppearanceProp, ShapeProp, AvatarShapeProp, TextSizeProp, TextToneProp, FontWeightProp, HeadingLevelProp, TextAlignProp, TextWhitespaceProp, SizeProp, ControlStatusProp, ControlVariantProp, FormLayoutProp, DescriptionsLayoutProp, BreakpointProp, ConfirmVariantProp, ToneProp, AlertVariantProp, SortDirectionProp, ColumnAlignProp, SortStateProp, RevealDelayProp, ActivityVariantProp, ActivityAnnounceProp, } from "./interaction.prop.js";
|
|
6
|
+
export type { BreadcrumbItemProp, BreadcrumbProp, BreadcrumbItemMenuProp, BreadcrumbItemMenuEntryProp, BreadcrumbSeparatorProp, BreadcrumbItemRenderProp, } from "./navigation.prop.js";
|
|
7
|
+
export type { GetRowIdProp, OnRowClickProp, ColumnDefProp, TablePresetProp, TableColumnPriorityProp, TableCellIndentProp, SelectedIdsProp, OnSelectChangeProp, OnTableDensityChangeProp, OnSortChangeProp, OnSearchChangeProp, OnClearFiltersProp, HasActiveFiltersProp, StickyProp, ColumnFixedProp, ColumnFilterValueProp, ColumnFilterItemProp, ColumnFilterStateProp, OnColumnFilterChangeProp, ColumnCompareProp, ColumnSorterProp, TableSelectionItemProp, TableRowSelectionProp, TableExpandableProp, TableSummaryProp, TableScrollProp, TableStickyProp, OnRowProp, TablePaginationProp, DescriptionsColumnProp, DescriptionsSpanProp, DescriptionsItemsProp, } from "./data.prop.js";
|
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
* Interaction & visual variant prop types.
|
|
3
3
|
* @see docs/PROPS-VOCABULARY.md#interaction-variants
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Button visual style.
|
|
7
|
+
*
|
|
8
|
+
* `bare` (gh#404) is the control WITHOUT geometry: a real button — hitbox, focus ring, keyboard
|
|
9
|
+
* semantics, `aria-label` — around content that already IS the shape (a `Badge`, a truncating
|
|
10
|
+
* title). Every other variant loads a height and an inline inset from its `size`, so wrapping a
|
|
11
|
+
* chip meant writing `className="h-auto p-0"`, an audit error with no legal replacement; `link`
|
|
12
|
+
* was not it either, since it still loads a size class and adds primary colour plus a hover
|
|
13
|
+
* underline. The 24×24 target WCAG 2.2 SC 2.5.8 requires is kept by a pseudo-element, so the box
|
|
14
|
+
* stays exactly as big as its content.
|
|
15
|
+
*/
|
|
16
|
+
export type ButtonVariantProp = "default" | "destructive" | "outline" | "dashed" | "secondary" | "ghost" | "link" | "bare";
|
|
7
17
|
/**
|
|
8
18
|
* Corner shape — maps to the radius tokens (default = control/component radius). Shared by Button
|
|
9
19
|
* + Badge.
|
|
@@ -29,6 +39,18 @@ export type FontWeightProp = "regular" | "medium" | "semibold" | "bold";
|
|
|
29
39
|
export type HeadingLevelProp = 1 | 2 | 3 | 4;
|
|
30
40
|
/** Inline text alignment (logical, RTL-safe). */
|
|
31
41
|
export type TextAlignProp = "start" | "center" | "end";
|
|
42
|
+
/**
|
|
43
|
+
* How a run of text treats the whitespace it was given.
|
|
44
|
+
*
|
|
45
|
+
* `normal` is CSS's own behaviour and the default: newlines and runs of spaces collapse. That is
|
|
46
|
+
* right for a label and wrong for text a PERSON typed into a textarea — a plain-text note, a
|
|
47
|
+
* pasted log, an issue description — where the line breaks and the indentation ARE content.
|
|
48
|
+
*
|
|
49
|
+
* `pre-wrap` keeps both and still wraps at the container's edge, so the block cannot force a
|
|
50
|
+
* horizontal scrollbar the way `pre` would. It is a closed union rather than a boolean because the
|
|
51
|
+
* remaining CSS keywords (`pre`, `pre-line`, `nowrap`) are values on the same axis, not more flags.
|
|
52
|
+
*/
|
|
53
|
+
export type TextWhitespaceProp = "normal" | "pre-wrap";
|
|
32
54
|
/** Badge visual style. */
|
|
33
55
|
export type BadgeVariantProp = "default" | "secondary" | "outline" | "dashed";
|
|
34
56
|
/**
|
|
@@ -61,6 +83,33 @@ export type AppSettingToggleAppearanceProp = "bar" | "icon";
|
|
|
61
83
|
export type SizeProp = "xs" | "sm" | "md" | "lg";
|
|
62
84
|
/** Button size preset; icon-only sizes are a documented Button subset. */
|
|
63
85
|
export type ButtonSizeProp = SizeProp | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
86
|
+
/**
|
|
87
|
+
* Validation state a data-entry control PAINTS — Ant Design's `status` axis, which
|
|
88
|
+
* docs/DESIGN-AUTHORITY.md names the taxonomy authority for this library.
|
|
89
|
+
*
|
|
90
|
+
* Two members, not antd's five. `error` and `warning` are the two antd paints from the prop alone;
|
|
91
|
+
* `success` and `validating` are only ever drawn together with antd's `hasFeedback` icon slot,
|
|
92
|
+
* which this library does not have (FormField owns the message and the icon), and `""` is antd's
|
|
93
|
+
* way of spelling "no status" in a required field — `undefined` already says that here.
|
|
94
|
+
*
|
|
95
|
+
* `error` and `aria-invalid` are the same state seen from two sides: a control given
|
|
96
|
+
* `status="error"` also reports `aria-invalid`, so the paint and the announcement can never drift.
|
|
97
|
+
* `warning` deliberately does NOT set `aria-invalid` — a warning is not a validity failure, and
|
|
98
|
+
* antd does not announce one either.
|
|
99
|
+
*/
|
|
100
|
+
export type ControlStatusProp = "error" | "warning";
|
|
101
|
+
/**
|
|
102
|
+
* How much chrome a data-entry control draws — Ant Design's `variant` axis.
|
|
103
|
+
* - `outlined` (default) — the historical field: boundary, surface and resting shadow.
|
|
104
|
+
* - `filled` — no boundary at rest, a tinted surface instead; the dense-form treatment.
|
|
105
|
+
* - `borderless` — neither boundary nor surface, for a field embedded in a box that already draws
|
|
106
|
+
* one (a composer inside a Card, an inline edit cell).
|
|
107
|
+
*
|
|
108
|
+
* antd's fourth member `underlined` is deliberately absent — see docs/DESIGN-AUTHORITY.md: a
|
|
109
|
+
* single bottom rule is a Material convention, and SmartHR (the Japanese-UI authority here) draws
|
|
110
|
+
* every form field as a full box.
|
|
111
|
+
*/
|
|
112
|
+
export type ControlVariantProp = "outlined" | "filled" | "borderless";
|
|
64
113
|
/** Form layout — label position relative to its control (Ant-style). */
|
|
65
114
|
export type FormLayoutProp = "vertical" | "horizontal" | "inline";
|
|
66
115
|
/** Descriptions layout — label over value (`vertical`) or beside it (`horizontal`); the
|
|
@@ -2,12 +2,52 @@
|
|
|
2
2
|
* Navigation & wayfinding prop types.
|
|
3
3
|
* @see docs/PROPS-VOCABULARY.md#navigation
|
|
4
4
|
*/
|
|
5
|
+
import type * as React from "react";
|
|
5
6
|
import type { LabelProp } from "./shared.prop.js";
|
|
7
|
+
/**
|
|
8
|
+
* One entry of the dropdown a breadcrumb segment can open (Ant Design
|
|
9
|
+
* `BreadcrumbItemType.menu.items`). `to` makes the entry a link, `onSelect` on the menu makes it
|
|
10
|
+
* a command; an entry with neither is inert.
|
|
11
|
+
*/
|
|
12
|
+
export type BreadcrumbItemMenuEntryProp = {
|
|
13
|
+
/** Stable identity, passed to `onSelect`. Also the React key. */
|
|
14
|
+
value: string;
|
|
15
|
+
label: LabelProp;
|
|
16
|
+
to?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Sibling picker hung off a breadcrumb segment (Ant Design `BreadcrumbItemType.menu`) — the
|
|
21
|
+
* "switch to another project at this level" affordance. The segment grows a disclosure chevron and
|
|
22
|
+
* becomes the menu trigger.
|
|
23
|
+
*/
|
|
24
|
+
export type BreadcrumbItemMenuProp = {
|
|
25
|
+
items: BreadcrumbItemMenuEntryProp[];
|
|
26
|
+
/** Fires with the chosen entry's `value`. Omit when every entry is a plain `to` link. */
|
|
27
|
+
onSelect?: (value: string) => void;
|
|
28
|
+
};
|
|
6
29
|
/** Single breadcrumb segment. */
|
|
7
30
|
export type BreadcrumbItemProp = {
|
|
8
31
|
label: LabelProp;
|
|
9
32
|
/** Router path — omit on current (last) segment. */
|
|
10
33
|
to?: string;
|
|
34
|
+
/** Ant Design `menu` — a sibling dropdown on this segment. @see BreadcrumbItemMenuProp */
|
|
35
|
+
menu?: BreadcrumbItemMenuProp;
|
|
11
36
|
};
|
|
12
37
|
/** Ordered breadcrumb trail above page title. */
|
|
13
38
|
export type BreadcrumbProp = BreadcrumbItemProp[];
|
|
39
|
+
/**
|
|
40
|
+
* Ant Design `separator` — what is drawn between two segments. Default is the chevron glyph; a
|
|
41
|
+
* string (`"/"`) or any node replaces it, and `""` removes the separator entirely.
|
|
42
|
+
*/
|
|
43
|
+
export type BreadcrumbSeparatorProp = React.ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Ant Design `itemRender` — replaces the anchor/text of ONE segment while the library keeps
|
|
46
|
+
* owning the `<nav>`/`<ol>`/`<li>` structure, the separators and `aria-current`. Use it to hand
|
|
47
|
+
* the trail a router `<Link>` (Inertia, react-router) instead of a bare `<a>`.
|
|
48
|
+
*/
|
|
49
|
+
export type BreadcrumbItemRenderProp = (item: BreadcrumbItemProp, info: {
|
|
50
|
+
index: number;
|
|
51
|
+
isLast: boolean;
|
|
52
|
+
items: BreadcrumbProp;
|
|
53
|
+
}) => React.ReactNode;
|
|
@@ -73,3 +73,36 @@ export type WidthProp = number | string;
|
|
|
73
73
|
* site (gh#375).
|
|
74
74
|
*/
|
|
75
75
|
export type ControlWidthProp = "full" | "auto" | "bounded";
|
|
76
|
+
/**
|
|
77
|
+
* antd `allowClear`: `true`/`false`, or the object form carrying a replacement icon and the
|
|
78
|
+
* accessible label for the clear control (antd 6.6.2, `BaseSelectProps.allowClear`).
|
|
79
|
+
*/
|
|
80
|
+
export type AllowClearProp = boolean | {
|
|
81
|
+
clearIcon?: React.ReactNode;
|
|
82
|
+
label?: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* antd `maxTagCount` — how many selected values stay visible before the rest collapse into the
|
|
86
|
+
* overflow node. `"responsive"` is NOT supported here (see the PR that introduced this type): it
|
|
87
|
+
* needs a per-frame width measurement of the value row, which this library resolves through
|
|
88
|
+
* container queries instead.
|
|
89
|
+
*/
|
|
90
|
+
export type MaxTagCountProp = number;
|
|
91
|
+
/**
|
|
92
|
+
* antd `maxTagPlaceholder` — the node standing in for the values `maxTagCount` hid. A function
|
|
93
|
+
* receives the omitted values so a consumer can render "+3 件" or a tooltip listing them.
|
|
94
|
+
*/
|
|
95
|
+
export type MaxTagPlaceholderProp = React.ReactNode | ((omitted: {
|
|
96
|
+
value: string;
|
|
97
|
+
label: React.ReactNode;
|
|
98
|
+
}[]) => React.ReactNode);
|
|
99
|
+
/**
|
|
100
|
+
* antd `notFoundContent` — the node shown when a popup has nothing to list. Supersedes the
|
|
101
|
+
* string-only `emptyMessage`, which stays for the common case.
|
|
102
|
+
*/
|
|
103
|
+
export type NotFoundContentProp = React.ReactNode;
|
|
104
|
+
/**
|
|
105
|
+
* antd `popupMatchSelectWidth`: `true` (default) locks the popup to the trigger's width, `false`
|
|
106
|
+
* lets it size to its content, and a number pins it to that many pixels.
|
|
107
|
+
*/
|
|
108
|
+
export type PopupMatchWidthProp = boolean | number;
|
|
@@ -447,11 +447,10 @@
|
|
|
447
447
|
line-height: var(--line-height-normal);
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
-
[data-slot="card"][data-service-launcher] {
|
|
450
|
+
[data-slot="card"][data-service-launcher] > [data-slot="card-content"] {
|
|
451
451
|
display: flex;
|
|
452
452
|
flex-direction: column;
|
|
453
453
|
gap: var(--card-service-launcher-space-gap);
|
|
454
|
-
padding: var(--card-space-inset);
|
|
455
454
|
}
|
|
456
455
|
|
|
457
456
|
[data-slot="service-launcher-heading"],
|
|
@@ -526,13 +525,16 @@
|
|
|
526
525
|
|
|
527
526
|
[data-slot="card"][data-service-catalog-cta] {
|
|
528
527
|
min-height: var(--card-service-launcher-cta-min-height);
|
|
528
|
+
border-style: dashed;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
[data-slot="card"][data-service-catalog-cta] > [data-slot="card-content"] {
|
|
532
|
+
flex: 1;
|
|
529
533
|
display: flex;
|
|
530
534
|
flex-direction: column;
|
|
531
535
|
align-items: center;
|
|
532
536
|
justify-content: center;
|
|
533
537
|
gap: var(--card-service-launcher-space-gap);
|
|
534
|
-
border-style: dashed;
|
|
535
|
-
padding: var(--card-space-inset);
|
|
536
538
|
text-align: center;
|
|
537
539
|
}
|
|
538
540
|
|
|
@@ -580,3 +582,23 @@
|
|
|
580
582
|
height: var(--control-height);
|
|
581
583
|
}
|
|
582
584
|
}
|
|
585
|
+
|
|
586
|
+
@layer components {
|
|
587
|
+
.ui-card-bar[data-surface="muted"] {
|
|
588
|
+
background: hsl(var(--muted));
|
|
589
|
+
}
|
|
590
|
+
.ui-card-bar[data-border="none"] {
|
|
591
|
+
border-block: 0;
|
|
592
|
+
}
|
|
593
|
+
.ui-card-bar[data-border="block-start"] {
|
|
594
|
+
border-block-end: 0;
|
|
595
|
+
border-block-start: var(--stroke-hairline) solid hsl(var(--border));
|
|
596
|
+
}
|
|
597
|
+
.ui-card-bar[data-border="block-end"] {
|
|
598
|
+
border-block-start: 0;
|
|
599
|
+
border-block-end: var(--stroke-hairline) solid hsl(var(--border));
|
|
600
|
+
}
|
|
601
|
+
.ui-card-bar[data-border="both"] {
|
|
602
|
+
border-block: var(--stroke-hairline) solid hsl(var(--border));
|
|
603
|
+
}
|
|
604
|
+
}
|
|
@@ -119,3 +119,18 @@
|
|
|
119
119
|
text-overflow: ellipsis;
|
|
120
120
|
white-space: nowrap;
|
|
121
121
|
}
|
|
122
|
+
|
|
123
|
+
.ui-chart-axis-probe {
|
|
124
|
+
position: fixed;
|
|
125
|
+
inset-block-start: 0;
|
|
126
|
+
inset-inline-start: 0;
|
|
127
|
+
visibility: hidden;
|
|
128
|
+
margin-inline-end: var(--chart-category-axis-gap);
|
|
129
|
+
font-size: var(--font-size-xs);
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
pointer-events: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.ui-chart-canvas [tabindex="-1"]:focus:not(:focus-visible) {
|
|
135
|
+
outline: none;
|
|
136
|
+
}
|