@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
|
@@ -6,6 +6,7 @@ import { Check, Minus } from "lucide-react";
|
|
|
6
6
|
import { cn } from "../../lib/utils.js";
|
|
7
7
|
import { useFieldIdentity } from "../../lib/field-a11y.js";
|
|
8
8
|
import { CheckboxGroup } from "./checkbox-group.js";
|
|
9
|
+
import { withOwnHitTarget } from "./choice-hit-target.js";
|
|
9
10
|
function CheckboxGlyph({ state }) {
|
|
10
11
|
return state === "indeterminate" ? /* @__PURE__ */ jsx(Minus, { className: "ui-checkbox-icon", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Check, { className: "ui-checkbox-icon", "aria-hidden": "true" });
|
|
11
12
|
}
|
|
@@ -96,6 +97,7 @@ const CheckboxRoot = React.forwardRef((props, ref) => {
|
|
|
96
97
|
"peer ui-checkbox data-[invalid]:border-destructive data-[state=checked]:border-primary data-[state=checked]:text-primary-foreground inline-flex shrink-0 items-center justify-center shadow-xs transition-shadow outline-none",
|
|
97
98
|
className
|
|
98
99
|
),
|
|
100
|
+
render: (domProps) => /* @__PURE__ */ jsx("label", { ...domProps, children: withOwnHitTarget(domProps.children) }),
|
|
99
101
|
onChange: (next) => {
|
|
100
102
|
setUncontrolled(next);
|
|
101
103
|
onCheckedChange?.(next);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* THE PAINTED BOX OF A CHOICE CONTROL IS ITS OWN HIT TARGET (gh#476).
|
|
4
|
+
*
|
|
5
|
+
* react-aria-components renders the real `<input>` inside a `VisuallyHidden` span, and that span
|
|
6
|
+
* carries its geometry as an INLINE style: `position:absolute; width:1px; height:1px;
|
|
7
|
+
* clip:rect(0 0 0 0); clip-path:inset(50%)`, pinned at the label's top-left. The thing a user
|
|
8
|
+
* sees and aims at is the `<label>` wrapped around it, so every pointer landing on the control
|
|
9
|
+
* hits the LABEL, and the input's own hit area is a 13x13 box at a different origin than the
|
|
10
|
+
* 16x16 one that is painted.
|
|
11
|
+
*
|
|
12
|
+
* Measured on `data-entry-checkbox` before this helper existed: of 49 points scanned across the
|
|
13
|
+
* box, **0** reached the input, 46 reached the label; Playwright `check()` / `uncheck()` without
|
|
14
|
+
* `force` timed out on `<label data-slot="checkbox"> intercepts pointer events`, the same check a
|
|
15
|
+
* browser applies to a real pointer. `force: true` passed, which is the tell: the control is
|
|
16
|
+
* functional, it is simply covered.
|
|
17
|
+
*
|
|
18
|
+
* An inline style can only be beaten with `!important`, so the WRAPPER is replaced instead of
|
|
19
|
+
* fought. The `render` prop hands over the DOM children react-aria built; the VisuallyHidden
|
|
20
|
+
* element among them becomes a `.ui-choice-input` span that control.css sizes to the painted box.
|
|
21
|
+
* The `<input>` itself — its props, its ref, its keyboard handling, its place in the a11y tree —
|
|
22
|
+
* is passed through untouched, so this is a geometry change and nothing else.
|
|
23
|
+
*/
|
|
24
|
+
export declare function withOwnHitTarget(children: React.ReactNode): React.ReactNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { VisuallyHidden } from "react-aria-components";
|
|
4
|
+
function withOwnHitTarget(children) {
|
|
5
|
+
return React.Children.map(
|
|
6
|
+
children,
|
|
7
|
+
(child) => React.isValidElement(child) && child.type === VisuallyHidden ? /* @__PURE__ */ jsx("span", { "data-slot": "choice-input", className: "ui-choice-input", children: child.props.children }) : child
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
withOwnHitTarget
|
|
12
|
+
};
|
|
@@ -59,3 +59,11 @@ export declare function applyMaxTagCount<T extends {
|
|
|
59
59
|
omitted: T[];
|
|
60
60
|
overflow: React.ReactNode | undefined;
|
|
61
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* Split a run of text on antd's `tokenSeparators` — the contract behind "paste a column out of a
|
|
64
|
+
* spreadsheet and get one value per line".
|
|
65
|
+
*
|
|
66
|
+
* Shared by `TagInput` and the tags/multiple `Select`: they are the two controls that turn typing
|
|
67
|
+
* into several values, and two copies of this would be two answers to "what is a separator".
|
|
68
|
+
*/
|
|
69
|
+
export declare function splitByTokenSeparators(text: string, separators: string[]): string[];
|
|
@@ -31,9 +31,18 @@ function applyMaxTagCount(items, maxTagCount, maxTagPlaceholder) {
|
|
|
31
31
|
const overflow = typeof maxTagPlaceholder === "function" ? maxTagPlaceholder(omitted.map(({ value, label }) => ({ value, label }))) : maxTagPlaceholder;
|
|
32
32
|
return { visible, omitted, overflow };
|
|
33
33
|
}
|
|
34
|
+
function escapeForCharClass(character) {
|
|
35
|
+
return character.replace(/[\\\]^-]/g, "\\$&");
|
|
36
|
+
}
|
|
37
|
+
function splitByTokenSeparators(text, separators) {
|
|
38
|
+
if (!separators.length) return [text];
|
|
39
|
+
const pattern = new RegExp(`[${separators.map(escapeForCharClass).join("")}]`);
|
|
40
|
+
return text.split(pattern);
|
|
41
|
+
}
|
|
34
42
|
export {
|
|
35
43
|
applyMaxTagCount,
|
|
36
44
|
controlSurfaceAttrs,
|
|
37
45
|
resolveAllowClear,
|
|
38
|
-
resolveAriaInvalid
|
|
46
|
+
resolveAriaInvalid,
|
|
47
|
+
splitByTokenSeparators
|
|
39
48
|
};
|
|
@@ -2,8 +2,15 @@ import * as React from "react";
|
|
|
2
2
|
import type { DatePickerProp } from "../../props/components/data-entry.prop.js";
|
|
3
3
|
export type { DatePickerProp, DatePickerProp as DatePickerProps, } from "../../props/components/data-entry.prop.js";
|
|
4
4
|
/**
|
|
5
|
-
* DatePicker — WAI-ARIA date combobox. A real, typeable `<input>` holds the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* DatePicker — ONE date control, WAI-ARIA date combobox. A real, typeable `<input>` holds the
|
|
6
|
+
* value (form-submittable via `name`, screen-reader friendly, e2e-testable by filling the input);
|
|
7
|
+
* the panel is the visual affordance.
|
|
8
|
+
*
|
|
9
|
+
* Two axes: `picker` sets the GRANULARITY (day · week · month · quarter · year), `range` sets the
|
|
10
|
+
* CARDINALITY (one date, `multiple` dates, or a two-endpoint `DateRange`). This replaces the four
|
|
11
|
+
* components this package used to ship — `DateRangePicker`, `MonthPicker`, `MonthRangePicker` were
|
|
12
|
+
* separate copies of this same machine, and every one of them had drifted: a disabled picker that
|
|
13
|
+
* still opened, bounds that greyed a chevron and clamped nothing, an unhandled Enter key, and a
|
|
14
|
+
* `name` that submitted `2026/03`. Written once, those are fixed on all eight combinations.
|
|
8
15
|
*/
|
|
9
16
|
export declare function DatePicker(props: DatePickerProp): React.JSX.Element;
|