@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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
format as formatDate,
|
|
3
|
+
isValid,
|
|
4
|
+
parse,
|
|
5
|
+
startOfDay,
|
|
6
|
+
startOfWeek,
|
|
7
|
+
startOfMonth,
|
|
8
|
+
startOfQuarter,
|
|
9
|
+
startOfYear
|
|
10
|
+
} from "date-fns";
|
|
11
|
+
import { parseDateInput, toIsoDate } from "./parse.js";
|
|
12
|
+
function formatPickerDate(date, format, locale, withTime = false) {
|
|
13
|
+
if (!date || !isValid(date)) return "";
|
|
14
|
+
if (typeof format === "function") return format(date);
|
|
15
|
+
if (typeof format === "object") return new Intl.DateTimeFormat(locale, format).format(date);
|
|
16
|
+
if (typeof format === "string") return formatDate(date, format);
|
|
17
|
+
return withTime ? formatDate(date, "yyyy-MM-dd HH:mm") : toIsoDate(date);
|
|
18
|
+
}
|
|
19
|
+
function parsePickerDate(text, format, parser, withTime = false) {
|
|
20
|
+
const raw = text.trim();
|
|
21
|
+
if (!raw) return void 0;
|
|
22
|
+
const custom = parser?.(raw);
|
|
23
|
+
if (custom && isValid(custom)) return custom;
|
|
24
|
+
const pattern = typeof format === "string" ? format : withTime ? "yyyy-MM-dd HH:mm" : void 0;
|
|
25
|
+
if (pattern) {
|
|
26
|
+
const parsed = parse(raw, pattern, new Date(2e3, 0, 1));
|
|
27
|
+
if (isValid(parsed) && formatDate(parsed, pattern) === raw) return parsed;
|
|
28
|
+
}
|
|
29
|
+
if (withTime || !/^\d{4}-\d{2}-\d{2}$/.test(raw)) return void 0;
|
|
30
|
+
return parseDateInput(raw) ?? void 0;
|
|
31
|
+
}
|
|
32
|
+
function pickerDateAllowed(date, min, max, disabled) {
|
|
33
|
+
return isValid(date) && (!min || startOfDay(date) >= startOfDay(min)) && (!max || startOfDay(date) <= startOfDay(max)) && !disabled?.(date);
|
|
34
|
+
}
|
|
35
|
+
function pickerPeriodStart(date, picker, locale) {
|
|
36
|
+
switch (picker) {
|
|
37
|
+
case "week":
|
|
38
|
+
return startOfWeek(date, { locale });
|
|
39
|
+
case "month":
|
|
40
|
+
return startOfMonth(date);
|
|
41
|
+
case "quarter":
|
|
42
|
+
return startOfQuarter(date);
|
|
43
|
+
case "year":
|
|
44
|
+
return startOfYear(date);
|
|
45
|
+
default:
|
|
46
|
+
return date;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
formatPickerDate,
|
|
51
|
+
parsePickerDate,
|
|
52
|
+
pickerDateAllowed,
|
|
53
|
+
pickerPeriodStart
|
|
54
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface OverlayPortalProviderProps {
|
|
3
|
+
/**
|
|
4
|
+
* The element overlays are rendered into. Pass the shadow root, or any element inside it.
|
|
5
|
+
* `undefined` restores the default, so a subtree can opt back out.
|
|
6
|
+
*/
|
|
7
|
+
container: Element | undefined;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function OverlayPortalProvider({ container, children }: OverlayPortalProviderProps): React.JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* The container this overlay should render into. An explicit prop wins, so one panel can be placed
|
|
13
|
+
* elsewhere without unmounting the provider around it.
|
|
14
|
+
*
|
|
15
|
+
* Not exported from the public barrel: this is a contract between the provider and the overlays
|
|
16
|
+
* this library ships, not a knob for consumers — a consumer that needs the value has a provider.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useOverlayPortalContainer(override?: Element): Element | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { enableShadowDOM } from "react-stately/private/flags/flags";
|
|
5
|
+
const OverlayPortalContext = React.createContext(void 0);
|
|
6
|
+
enableShadowDOM();
|
|
7
|
+
function OverlayPortalProvider({ container, children }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(OverlayPortalContext.Provider, { value: container, children });
|
|
9
|
+
}
|
|
10
|
+
function useOverlayPortalContainer(override) {
|
|
11
|
+
const fromContext = React.useContext(OverlayPortalContext);
|
|
12
|
+
return override ?? fromContext;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
OverlayPortalProvider,
|
|
16
|
+
useOverlayPortalContainer
|
|
17
|
+
};
|
|
@@ -3,6 +3,7 @@ import type { Locale } from "date-fns";
|
|
|
3
3
|
import type { DayPickerProps } from "react-day-picker";
|
|
4
4
|
import type { AppLocale, AppRequestHeaders, AppTimeFormat, AppTimezone, AppTimezoneDefault, AppDateFormat } from "../../app/types.js";
|
|
5
5
|
import type { AppBrand, AppDensity, AppFontSize, AppTheme } from "../../app/theme-axes.js";
|
|
6
|
+
import type { AppPreferenceAxis } from "../../app/storage.js";
|
|
6
7
|
import type { AppSettingPickerAppearanceProp, AppSettingToggleAppearanceProp, ChildrenProp, ClassNameProp, DisabledProp, IdProp, NameProp, OnValueChangeProp, ValueProp } from "../vocabulary/index.js";
|
|
7
8
|
/** @see AppProvider */
|
|
8
9
|
export type AppProviderProp = {
|
|
@@ -26,8 +27,18 @@ export type AppProviderProp = {
|
|
|
26
27
|
timezoneOptions?: readonly AppTimezone[];
|
|
27
28
|
/** localStorage key. Default: `godxjp.app`. */
|
|
28
29
|
storageKey?: string;
|
|
29
|
-
/**
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Which viewer preferences survive a reload. `true` (default) every axis, `false` none, or a
|
|
32
|
+
* LIST of axes — `["theme", "density", "fontSize"]`.
|
|
33
|
+
*
|
|
34
|
+
* The list exists because the axes do not share an owner. `theme` / `brand` / `density` /
|
|
35
|
+
* `fontSize` / `scaling` are the VIEWER's and belong in this browser. `locale` / `timezone` /
|
|
36
|
+
* `timeFormat` / `dateFormat` are frequently the SERVER's, resolved per request from a cookie,
|
|
37
|
+
* an account row or a header — and a stored copy then WINS over the value the server just sent,
|
|
38
|
+
* because storage is read after the props. Faced with one all-or-nothing flag, that consumer
|
|
39
|
+
* sets `persist={false}` and loses the viewer's theme along with it; naming the axes keeps both.
|
|
40
|
+
*/
|
|
41
|
+
persist?: boolean | readonly AppPreferenceAxis[];
|
|
31
42
|
/**
|
|
32
43
|
* Initial theme choice. `"light"` / `"dark"` are written straight to `<html data-theme>`;
|
|
33
44
|
* `"system"` defers to `prefers-color-scheme` and is re-resolved whenever the OS changes.
|
|
@@ -22,6 +22,13 @@ type ChartCartesianBase = {
|
|
|
22
22
|
categoryKey: string;
|
|
23
23
|
/** Accessible name + visible caption for the chart. REQUIRED (role="img" needs a name). */
|
|
24
24
|
label: LabelProp;
|
|
25
|
+
/**
|
|
26
|
+
* Paint `label` as a visible caption above the plot. Set `false` when the chart already sits
|
|
27
|
+
* under a heading that says the same thing (a `CardTitle`, a section `<h2>`): the caption stays
|
|
28
|
+
* in the DOM as `sr-only`, so `role="img"` keeps its accessible name and only the duplicated
|
|
29
|
+
* visible title goes away.
|
|
30
|
+
*/
|
|
31
|
+
showCaption?: boolean;
|
|
25
32
|
/** Extra context appended to the screen-reader description. */
|
|
26
33
|
description?: DescriptionProp;
|
|
27
34
|
/** Canvas height preset — `xs|sm|md|lg`. Ignored when `height` is set. */
|
|
@@ -67,6 +74,13 @@ export type CompactBarTrendProp = {
|
|
|
67
74
|
valueKey: string;
|
|
68
75
|
/** Accessible name + visible caption for the chart. REQUIRED (role="img" needs a name). */
|
|
69
76
|
label: LabelProp;
|
|
77
|
+
/**
|
|
78
|
+
* Paint `label` as a visible caption above the plot. Set `false` when the chart already sits
|
|
79
|
+
* under a heading that says the same thing (a `CardTitle`, a section `<h2>`): the caption stays
|
|
80
|
+
* in the DOM as `sr-only`, so `role="img"` keeps its accessible name and only the duplicated
|
|
81
|
+
* visible title goes away.
|
|
82
|
+
*/
|
|
83
|
+
showCaption?: boolean;
|
|
70
84
|
/** Extra context appended to the screen-reader description. */
|
|
71
85
|
description?: DescriptionProp;
|
|
72
86
|
/** Plot-height tier — `xs|sm|md|lg`. Defaults to `xs` (dashboard summary-card density). */
|
|
@@ -107,6 +121,13 @@ export type PieChartProp = {
|
|
|
107
121
|
colors?: string[];
|
|
108
122
|
/** Accessible name + visible caption for the chart. REQUIRED. */
|
|
109
123
|
label: LabelProp;
|
|
124
|
+
/**
|
|
125
|
+
* Paint `label` as a visible caption above the plot. Set `false` when the chart already sits
|
|
126
|
+
* under a heading that says the same thing (a `CardTitle`, a section `<h2>`): the caption stays
|
|
127
|
+
* in the DOM as `sr-only`, so `role="img"` keeps its accessible name and only the duplicated
|
|
128
|
+
* visible title goes away.
|
|
129
|
+
*/
|
|
130
|
+
showCaption?: boolean;
|
|
110
131
|
/** Extra context appended to the screen-reader description. */
|
|
111
132
|
description?: DescriptionProp;
|
|
112
133
|
/** Canvas height preset — `xs|sm|md|lg`. Ignored when `height` is set. */
|
|
@@ -7,7 +7,9 @@ export type CodeBlockProp = {
|
|
|
7
7
|
/** Soft-wrap long lines (default true). `false` scrolls horizontally instead. */
|
|
8
8
|
wrap?: boolean;
|
|
9
9
|
/** Scroll inside the block past this height. Default `none` (grows with the content). */
|
|
10
|
-
maxHeight?: "sm" | "md" | "lg" | "none"
|
|
10
|
+
maxHeight?: "sm" | "md" | "lg" | "none" | {
|
|
11
|
+
value: string;
|
|
12
|
+
};
|
|
11
13
|
/** Type size. Default `sm`. */
|
|
12
14
|
size?: Extract<SizeProp, "xs" | "sm">;
|
|
13
15
|
/** Cosmetic: lands on `data-language`; no highlighter is bundled. */
|
|
@@ -26,7 +28,7 @@ export type ProseProp = {
|
|
|
26
28
|
className?: ClassNameProp;
|
|
27
29
|
children?: ChildrenProp;
|
|
28
30
|
};
|
|
29
|
-
import type { ActionProp, ClassNameProp, DescriptionProp, IconProp, TitleProp, ColumnDefProp, GetRowIdProp, OnRowClickProp, OnSelectChangeProp, OnSortChangeProp, OnTableDensityChangeProp, SelectedIdsProp, SortStateProp, TableDensityProp, TablePresetProp, BreakpointProp, DensityProp, ChildrenProp, ToneProp, AvatarShapeProp, HeadingLevelProp, HandlerProp, SizeProp, LabelProp, IdProp, DescriptionsLayoutProp } from "../vocabulary/index.js";
|
|
31
|
+
import type { ActionProp, ClassNameProp, DescriptionProp, IconProp, TitleProp, ColumnDefProp, GetRowIdProp, OnRowClickProp, OnSelectChangeProp, OnSortChangeProp, OnTableDensityChangeProp, SelectedIdsProp, SortStateProp, TableDensityProp, TablePresetProp, BreakpointProp, DensityProp, ChildrenProp, ToneProp, AvatarShapeProp, HeadingLevelProp, HandlerProp, SizeProp, LabelProp, IdProp, DescriptionsLayoutProp, DescriptionsColumnProp, DescriptionsSpanProp, DescriptionsItemsProp, SortDirectionProp, OnColumnFilterChangeProp, OnRowProp, TableExpandableProp, TableRowSelectionProp, TableScrollProp, TableStickyProp, TableSummaryProp } from "../vocabulary/index.js";
|
|
30
32
|
/**
|
|
31
33
|
* One key in a `Legend`: a tone, and the words that tone stands for.
|
|
32
34
|
*
|
|
@@ -77,18 +79,28 @@ export type EmptyStateProp = {
|
|
|
77
79
|
*/
|
|
78
80
|
export type DescriptionsProp = {
|
|
79
81
|
/** `Descriptions.Item` children — one label/value pair each. */
|
|
80
|
-
children
|
|
81
|
-
|
|
82
|
+
children?: React.ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Column count. `1 | 2 | 3` keeps this library's own mobile-first ladder; any other number, or
|
|
85
|
+
* antd's responsive `{ sm, md, lg, xl }` object, drives the token-published grid instead.
|
|
86
|
+
*/
|
|
87
|
+
columns?: DescriptionsColumnProp;
|
|
82
88
|
/** Label placement within each item. Default `vertical` (label over value). */
|
|
83
89
|
layout?: DescriptionsLayoutProp;
|
|
84
90
|
/** Label text alignment inside the label column. Applies only to `layout="horizontal"`. */
|
|
85
91
|
labelAlign?: "start" | "end";
|
|
92
|
+
/** Draw the grid as a bordered table with shaded label cells (antd `bordered`). */
|
|
93
|
+
bordered?: boolean;
|
|
94
|
+
/** Declarative items (antd `items`) — the alternative to composing `Descriptions.Item`. */
|
|
95
|
+
items?: DescriptionsItemsProp;
|
|
86
96
|
className?: ClassNameProp;
|
|
87
97
|
};
|
|
88
98
|
export type DescriptionsItemProp = {
|
|
89
99
|
label: React.ReactNode;
|
|
90
100
|
value: React.ReactNode;
|
|
91
101
|
mono?: boolean;
|
|
102
|
+
/** Columns this item occupies — number | `"filled"` | responsive object (antd `span`). */
|
|
103
|
+
span?: DescriptionsSpanProp;
|
|
92
104
|
};
|
|
93
105
|
/**
|
|
94
106
|
* @see Avatar
|
|
@@ -264,6 +276,26 @@ export type DataTableProp<T> = {
|
|
|
264
276
|
* measures. Default `"sm"`.
|
|
265
277
|
*/
|
|
266
278
|
collapseBelow?: BreakpointProp;
|
|
279
|
+
/** Full row-selection configuration (antd `rowSelection`). */
|
|
280
|
+
rowSelection?: TableRowSelectionProp<T>;
|
|
281
|
+
/** Expandable detail rows (antd `expandable`). */
|
|
282
|
+
expandable?: TableExpandableProp<T>;
|
|
283
|
+
/** Footer totals row, rendered in a real `<tfoot>` (antd `summary`). */
|
|
284
|
+
summary?: TableSummaryProp<T>;
|
|
285
|
+
/** Scroll envelope — `x` a minimum inline size, `y` a maximum body block size (antd `scroll`). */
|
|
286
|
+
scroll?: TableScrollProp;
|
|
287
|
+
/** Sticky header; the object form carries `offsetHeader` (antd `sticky`). */
|
|
288
|
+
sticky?: TableStickyProp;
|
|
289
|
+
/** Per-row DOM props merged onto the `<tr>` (antd `onRow`). */
|
|
290
|
+
onRow?: OnRowProp<T>;
|
|
291
|
+
/** Outer frame + vertical rules between columns (antd `bordered`). */
|
|
292
|
+
bordered?: boolean;
|
|
293
|
+
/** Explain the next sort step in a tooltip on sortable headers (antd `showSorterTooltip`). */
|
|
294
|
+
showSorterTooltip?: boolean;
|
|
295
|
+
/** Table-wide sort cycle; a column's own `sortDirections` wins (antd `sortDirections`). */
|
|
296
|
+
sortDirections?: SortDirectionProp[];
|
|
297
|
+
/** Column filters changed — pair with a column's `filteredValue` for server filtering. */
|
|
298
|
+
onFilterChange?: OnColumnFilterChangeProp;
|
|
267
299
|
className?: ClassNameProp;
|
|
268
300
|
children?: ChildrenProp;
|
|
269
301
|
};
|
|
@@ -362,7 +394,26 @@ export type PermissionMatrixProp = {
|
|
|
362
394
|
*/
|
|
363
395
|
export type ScrollAreaAnchorProp = "none" | "bottom";
|
|
364
396
|
/** @see ScrollArea */
|
|
397
|
+
/**
|
|
398
|
+
* @see ScrollArea — which AXES scroll. This is not decoration: Radix sets the viewport's
|
|
399
|
+
* `overflowX`/`overflowY` inline from which scrollbars are mounted, so an axis with no `ScrollBar`
|
|
400
|
+
* is `overflow: hidden` and its content is CLIPPED, not merely un-barred.
|
|
401
|
+
*
|
|
402
|
+
* `both` is a third value rather than an array or a pair of booleans because the axes are one
|
|
403
|
+
* decision — a pane scrolls down, across, or freely — and a closed union is what `check:prop-vocabulary`
|
|
404
|
+
* and the MCP catalog can carry.
|
|
405
|
+
*/
|
|
406
|
+
export type ScrollAreaOrientationProp = "vertical" | "horizontal" | "both";
|
|
365
407
|
export type ScrollAreaProp = {
|
|
408
|
+
/**
|
|
409
|
+
* Axes that scroll, and therefore which scrollbars render. Default `vertical` — the previous
|
|
410
|
+
* behaviour, unchanged.
|
|
411
|
+
*
|
|
412
|
+
* Reach for `horizontal` for a strip of non-shrinking columns (a board, a lane of cards): the
|
|
413
|
+
* viewport keeps its tab stop, so the strip is scrollable from the keyboard, and the consumer
|
|
414
|
+
* writes no overflow styling of its own.
|
|
415
|
+
*/
|
|
416
|
+
orientation?: ScrollAreaOrientationProp;
|
|
366
417
|
/**
|
|
367
418
|
* Ref to the element that actually SCROLLS — the Radix viewport — not the root. The root is
|
|
368
419
|
* `overflow: hidden` and never scrolls, so the component's own `ref` cannot serve.
|