@godxjp/ui 21.0.0 → 23.0.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 +4 -4
- package/dist/app/app-provider.js +2 -1
- package/dist/components/data-display/badge.d.ts +28 -1
- package/dist/components/data-display/badge.js +2 -0
- package/dist/components/data-display/data-table.d.ts +18 -2
- package/dist/components/data-display/data-table.js +4 -0
- package/dist/components/data-display/index.d.ts +1 -1
- package/dist/components/data-display/popover.d.ts +19 -1
- package/dist/components/data-display/popover.js +9 -1
- package/dist/components/data-display/progress.d.ts +37 -0
- package/dist/components/data-display/progress.js +57 -5
- package/dist/components/data-display/scroll-area.d.ts +24 -4
- package/dist/components/data-display/scroll-area.js +34 -72
- package/dist/components/data-entry/cascader.js +8 -6
- package/dist/components/data-entry/checkbox.js +2 -0
- package/dist/components/data-entry/choice-hit-target.d.ts +24 -0
- package/dist/components/data-entry/choice-hit-target.js +12 -0
- package/dist/components/data-entry/control-surface.d.ts +8 -0
- package/dist/components/data-entry/control-surface.js +10 -1
- package/dist/components/data-entry/date-picker.d.ts +10 -3
- package/dist/components/data-entry/date-picker.js +503 -238
- package/dist/components/data-entry/form-field.d.ts +1 -1
- package/dist/components/data-entry/form-field.js +7 -3
- package/dist/components/data-entry/form.js +10 -1
- package/dist/components/data-entry/index.d.ts +0 -6
- package/dist/components/data-entry/index.js +0 -6
- package/dist/components/data-entry/label.d.ts +14 -1
- package/dist/components/data-entry/label.js +6 -1
- package/dist/components/data-entry/radio.d.ts +27 -6
- package/dist/components/data-entry/radio.js +89 -43
- package/dist/components/data-entry/search-select.js +226 -89
- package/dist/components/data-entry/select.d.ts +76 -14
- package/dist/components/data-entry/select.js +497 -163
- package/dist/components/data-entry/slider.d.ts +3 -11
- package/dist/components/data-entry/slider.js +582 -93
- package/dist/components/data-entry/switch.d.ts +6 -3
- package/dist/components/data-entry/switch.js +36 -11
- package/dist/components/layout/mobile-shell.d.ts +1 -1
- package/dist/components/layout/mobile-shell.js +2 -0
- package/dist/components/navigation/dropdown-menu.d.ts +11 -3
- package/dist/components/navigation/dropdown-menu.js +190 -15
- package/dist/components/navigation/index.d.ts +0 -3
- package/dist/components/navigation/index.js +0 -78
- package/dist/components/navigation/steps.d.ts +1 -1
- package/dist/components/navigation/steps.js +3 -1
- package/dist/components/navigation/tabs-scroll.d.ts +27 -0
- package/dist/components/navigation/tabs-scroll.js +52 -1
- package/dist/components/navigation/tabs.d.ts +2 -2
- package/dist/components/navigation/tabs.js +88 -23
- package/dist/components/ui/index.d.ts +0 -4
- package/dist/components/ui/index.js +0 -4
- package/dist/components/ui/input-otp.d.ts +1 -1
- package/dist/components/ui/segmented.d.ts +15 -1
- package/dist/components/ui/segmented.js +15 -6
- package/dist/components/ui/tag-input.js +3 -5
- package/dist/i18n/messages/en.json +3 -2
- package/dist/i18n/messages/ja.json +3 -2
- package/dist/i18n/messages/vi.json +3 -2
- package/dist/lib/datetime/picker-format.d.ts +18 -0
- package/dist/lib/datetime/picker-format.js +35 -1
- package/dist/lib/field-a11y.d.ts +12 -0
- package/dist/lib/field-a11y.js +14 -1
- package/dist/lib/select-options.d.ts +21 -0
- package/dist/lib/select-options.js +46 -0
- package/dist/props/components/data-display.prop.d.ts +16 -6
- package/dist/props/components/data-entry.prop.d.ts +503 -129
- package/dist/props/components/index.d.ts +2 -2
- package/dist/props/components/layout.prop.d.ts +12 -1
- package/dist/props/components/navigation.prop.d.ts +93 -1
- package/dist/props/registry.d.ts +79 -16
- package/dist/props/registry.js +85 -15
- package/dist/props/vocabulary/data.prop.d.ts +12 -0
- package/dist/props/vocabulary/index.d.ts +2 -2
- package/dist/props/vocabulary/layout.prop.d.ts +11 -0
- package/dist/styles/badge-layout.css +4 -0
- package/dist/styles/card-layout.css +6 -6
- package/dist/styles/control.css +220 -29
- package/dist/styles/data-display-layout.css +94 -23
- package/dist/styles/focus-ring.css +6 -4
- package/dist/styles/fonts.css +88 -4
- package/dist/styles/navigation-layout.css +36 -236
- package/dist/styles/shell-layout.css +149 -139
- package/dist/styles/table-layout.css +41 -3
- package/dist/tokens/components/control.css +4 -0
- package/dist/tokens/components/data-display.css +9 -5
- package/dist/tokens/components/navigation.css +9 -5
- package/dist/tokens/components/scroll-area.css +7 -0
- package/dist/tokens/components/segmented.css +0 -2
- package/dist/tokens/components/shell.css +2 -0
- package/dist/tokens/components/table.css +3 -0
- package/dist/tokens/foundation.css +7 -0
- package/docs/COMPONENTS.md +14 -14
- package/docs/CONSUMER-RULES.md +24 -1
- package/docs/CUSTOMER-THEMING.md +7 -1
- package/docs/FRAME-COVERAGE-REPORT.md +5 -11
- package/docs/TOKENS.md +65 -0
- package/docs/data-display/badge.tsx +37 -0
- package/docs/data-display/data-table/index.tsx +45 -1
- package/docs/data-display/popover.tsx +43 -5
- package/docs/data-display/progress.tsx +28 -0
- package/docs/data-display/scroll-area.tsx +51 -45
- package/docs/data-entry/calendar.tsx +2 -2
- package/docs/data-entry/date-picker.tsx +144 -5
- package/docs/data-entry/form/examples/invoice-form.tsx +2 -2
- package/docs/data-entry/form-field/examples/a11y-contract.tsx +3 -5
- package/docs/data-entry/form.tsx +4 -4
- package/docs/data-entry/input-otp.tsx +5 -2
- package/docs/data-entry/number-input.tsx +31 -0
- package/docs/data-entry/segmented.tsx +143 -2
- package/docs/data-entry/select-matrix.tsx +1 -2
- package/docs/data-entry/select.tsx +108 -3
- package/docs/data-entry/slider.tsx +125 -47
- package/docs/feedback/dialog.tsx +1 -2
- package/docs/feedback/sheet.tsx +1 -2
- package/docs/layout/app-shell-states.tsx +143 -0
- package/docs/layout/mobile-shell.tsx +5 -0
- package/docs/navigation/dropdown-menu.tsx +75 -4
- package/docs/navigation/tabs.tsx +149 -0
- package/docs/roadmap/antd-parity.md +35 -34
- package/docs/roadmap/parity-audit-data-entry.md +196 -172
- package/docs/roadmap/parity-audit-layout-navigation-general.md +304 -310
- package/docs/roadmap/parity-backlog.md +8 -10
- package/docs/showcase/acme-portal.tsx +7 -0
- package/package.json +28 -64
- package/scripts/ui-audit.mjs +18 -5
- package/scripts/visual-audit-rules.mjs +0 -7
- package/scripts/visual-audit.mjs +6 -27
- package/dist/components/data-entry/date-range-picker.d.ts +0 -11
- package/dist/components/data-entry/date-range-picker.js +0 -349
- package/dist/components/data-entry/month-picker.d.ts +0 -10
- package/dist/components/data-entry/month-picker.js +0 -241
- package/dist/components/data-entry/month-range-picker.d.ts +0 -10
- package/dist/components/data-entry/month-range-picker.js +0 -301
- package/dist/components/navigation/context-menu.d.ts +0 -21
- package/dist/components/navigation/context-menu.js +0 -149
- package/dist/components/navigation/menubar.d.ts +0 -21
- package/dist/components/navigation/menubar.js +0 -136
- package/dist/components/navigation/navigation-menu.d.ts +0 -10
- package/dist/components/navigation/navigation-menu.js +0 -91
- package/dist/components/ui/context-menu.d.ts +0 -1
- package/dist/components/ui/context-menu.js +0 -2
- package/dist/components/ui/date-range-picker.d.ts +0 -1
- package/dist/components/ui/date-range-picker.js +0 -2
- package/dist/components/ui/menubar.d.ts +0 -1
- package/dist/components/ui/menubar.js +0 -2
- package/dist/components/ui/navigation-menu.d.ts +0 -1
- package/dist/components/ui/navigation-menu.js +0 -2
- package/docs/FRAME-A11Y-CI.md +0 -349
- package/docs/data-entry/date-range-picker.tsx +0 -175
- package/docs/data-entry/month-picker.tsx +0 -101
- package/docs/data-entry/month-range-picker.tsx +0 -115
- package/docs/navigation/context-menu.tsx +0 -128
- package/docs/navigation/menubar.tsx +0 -141
- package/docs/navigation/navigation-menu.tsx +0 -158
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function text(value) {
|
|
2
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "bigint") {
|
|
3
|
+
return String(value);
|
|
4
|
+
}
|
|
5
|
+
return "";
|
|
6
|
+
}
|
|
7
|
+
function groupChildren(option, optionsKey) {
|
|
8
|
+
const children = option[optionsKey];
|
|
9
|
+
return Array.isArray(children) ? children : void 0;
|
|
10
|
+
}
|
|
11
|
+
function normalizeSelectOptions(options, fieldNames) {
|
|
12
|
+
if (!options?.length) return [];
|
|
13
|
+
const labelKey = fieldNames?.label ?? "label";
|
|
14
|
+
const valueKey = fieldNames?.value ?? "value";
|
|
15
|
+
const optionsKey = fieldNames?.options ?? "options";
|
|
16
|
+
const groupLabelKey = fieldNames?.groupLabel ?? labelKey;
|
|
17
|
+
const disabledKey = fieldNames?.disabled ?? "disabled";
|
|
18
|
+
const flat = [];
|
|
19
|
+
const push = (raw, group) => {
|
|
20
|
+
const value = text(raw[valueKey]);
|
|
21
|
+
const label = text(raw[labelKey]);
|
|
22
|
+
flat.push({
|
|
23
|
+
...raw,
|
|
24
|
+
value,
|
|
25
|
+
// A row with no label reads as its own value — the id is at least identifiable, where an
|
|
26
|
+
// empty row is not selectable by sight or by type-to-select.
|
|
27
|
+
label: label || value,
|
|
28
|
+
disabled: raw[disabledKey] === true || void 0,
|
|
29
|
+
// A row inside a group takes the group's heading; a flat row keeps the `group` it declared.
|
|
30
|
+
group: group ?? (typeof raw.group === "string" ? raw.group : void 0)
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
for (const entry of options) {
|
|
34
|
+
const children = groupChildren(entry, optionsKey);
|
|
35
|
+
if (children) {
|
|
36
|
+
const heading = text(entry[groupLabelKey]) || void 0;
|
|
37
|
+
for (const child of children) push(child, heading);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
push(entry, void 0);
|
|
41
|
+
}
|
|
42
|
+
return flat;
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
normalizeSelectOptions
|
|
46
|
+
};
|
|
@@ -187,6 +187,13 @@ export type BadgeProp = {
|
|
|
187
187
|
icon?: React.ComponentType<{
|
|
188
188
|
className?: string;
|
|
189
189
|
}> | null;
|
|
190
|
+
/**
|
|
191
|
+
* Lining, fixed-width figures — for a chip whose content is a COUNT sitting in a column with
|
|
192
|
+
* other counts. The same axis `Text`, `TableCell` and `StatCard` already carry; its absence here
|
|
193
|
+
* was an asymmetry, not a decision. Off by default, because tabular figures are wider and a chip
|
|
194
|
+
* carrying words should not pay for them.
|
|
195
|
+
*/
|
|
196
|
+
tabular?: boolean;
|
|
190
197
|
className?: ClassNameProp;
|
|
191
198
|
children?: ChildrenProp;
|
|
192
199
|
};
|
|
@@ -396,9 +403,10 @@ export type PermissionMatrixProp = {
|
|
|
396
403
|
export type ScrollAreaAnchorProp = "none" | "bottom";
|
|
397
404
|
/** @see ScrollArea */
|
|
398
405
|
/**
|
|
399
|
-
* @see ScrollArea — which AXES scroll. This is not decoration:
|
|
400
|
-
*
|
|
401
|
-
* is
|
|
406
|
+
* @see ScrollArea — which AXES scroll. This is not decoration: it IS the `overflow` the element
|
|
407
|
+
* carries, so an axis this does not name is `hidden` and its content is CLIPPED, not merely
|
|
408
|
+
* un-barred. It is also the whole replacement for mounting a `<ScrollBar>`, which was how the
|
|
409
|
+
* Radix-era component was told to open a second axis.
|
|
402
410
|
*
|
|
403
411
|
* `both` is a third value rather than an array or a pair of booleans because the axes are one
|
|
404
412
|
* decision — a pane scrolls down, across, or freely — and a closed union is what `check:prop-vocabulary`
|
|
@@ -412,12 +420,14 @@ export type ScrollAreaProp = {
|
|
|
412
420
|
*
|
|
413
421
|
* Reach for `horizontal` for a strip of non-shrinking columns (a board, a lane of cards): the
|
|
414
422
|
* viewport keeps its tab stop, so the strip is scrollable from the keyboard, and the consumer
|
|
415
|
-
* writes no overflow styling of its own.
|
|
423
|
+
* writes no overflow styling of its own. `both` is what replaces a vertical area that also
|
|
424
|
+
* mounted `<ScrollBar orientation="horizontal" />`.
|
|
416
425
|
*/
|
|
417
426
|
orientation?: ScrollAreaOrientationProp;
|
|
418
427
|
/**
|
|
419
|
-
* Ref to the element that actually SCROLLS
|
|
420
|
-
*
|
|
428
|
+
* Ref to the element that actually SCROLLS. Since v23 that is the component's own element, so
|
|
429
|
+
* this and `ref` hand back the SAME node — it is kept because it names the thing precisely, and
|
|
430
|
+
* because the Radix-era shape (a root wrapping a separate viewport) made `ref` the wrong handle.
|
|
421
431
|
*/
|
|
422
432
|
viewportRef?: React.Ref<HTMLDivElement>;
|
|
423
433
|
/** Edge the viewport sticks to as content grows. Default `none` (inert). */
|