@godxjp/ui 18.5.0 → 18.7.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/dist/components/charts/compact-bar-trend.d.ts +2 -1
- package/dist/components/charts/index.d.ts +4 -1
- package/dist/components/data-display/data-table.d.ts +25 -4
- package/dist/components/data-display/data-table.js +13 -2
- package/dist/components/data-display/empty-state.js +1 -1
- package/dist/components/data-display/index.d.ts +1 -1
- package/dist/components/data-display/list-row.d.ts +19 -0
- package/dist/components/data-display/list-row.js +2 -0
- package/dist/components/data-display/qr-code.d.ts +1 -1
- package/dist/components/data-display/table.d.ts +47 -2
- package/dist/components/data-display/table.js +29 -4
- package/dist/components/data-entry/command.d.ts +10 -10
- package/dist/components/data-entry/index.d.ts +1 -0
- package/dist/components/data-entry/input-otp.d.ts +1 -0
- package/dist/components/feedback/alert.d.ts +20 -2
- package/dist/components/feedback/alert.js +11 -1
- package/dist/components/feedback/dialog.d.ts +14 -1
- package/dist/components/feedback/dialog.js +4 -0
- package/dist/components/feedback/index.d.ts +3 -3
- package/dist/components/feedback/index.js +5 -1
- package/dist/components/general/logo.d.ts +7 -1
- package/dist/components/general/logo.js +1 -1
- package/dist/components/layout/app-shell.d.ts +1 -1
- package/dist/components/layout/app-shell.js +55 -46
- package/dist/components/layout/auth-account-summary.d.ts +5 -0
- package/dist/components/layout/auth-account-summary.js +31 -0
- package/dist/components/layout/auth-shell.d.ts +5 -2
- package/dist/components/layout/centered-shell.d.ts +1 -1
- package/dist/components/layout/centered-shell.js +28 -19
- package/dist/components/layout/error-surface.d.ts +35 -0
- package/dist/components/layout/error-surface.js +155 -0
- package/dist/components/layout/flex.d.ts +1 -1
- package/dist/components/layout/flex.js +4 -0
- package/dist/components/layout/index.d.ts +7 -0
- package/dist/components/layout/index.js +6 -0
- package/dist/components/layout/page-container.d.ts +1 -1
- package/dist/components/layout/page-container.js +23 -41
- package/dist/components/layout/page-header.d.ts +22 -0
- package/dist/components/layout/page-header.js +89 -0
- package/dist/components/navigation/filter-bar.d.ts +2 -2
- package/dist/components/navigation/filter-bar.js +44 -1
- package/dist/components/navigation/index.d.ts +1 -1
- package/dist/components/navigation/steps.js +38 -19
- package/dist/components/navigation/tabs.js +12 -3
- package/dist/components/ui/avatar.d.ts +2 -1
- package/dist/components/ui/avatar.js +2 -1
- package/dist/components/ui/input-otp.d.ts +4 -1
- package/dist/components/ui/input-otp.js +2 -1
- package/dist/components/ui/toggle-group.d.ts +7 -4
- package/dist/components/ui/toggle-group.js +32 -21
- package/dist/email/brand-mark.d.ts +21 -5
- package/dist/email/brand-mark.js +5 -0
- package/dist/email/color.d.ts +2 -1
- package/dist/email/geometry.d.ts +9 -1
- package/dist/email/geometry.js +1 -0
- package/dist/email/index.d.ts +6 -1
- package/dist/email/index.js +6 -0
- package/dist/email/inline-style.d.ts +7 -5
- package/dist/email/inline-style.js +5 -0
- package/dist/email/tokens.generated.d.ts +40 -20
- package/dist/email/tokens.generated.js +40 -20
- package/dist/email/urgency.d.ts +22 -0
- package/dist/email/urgency.js +14 -0
- package/dist/i18n/messages/en.json +26 -1
- package/dist/i18n/messages/ja.json +23 -1
- package/dist/i18n/messages/vi.json +23 -1
- package/dist/props/components/data-display.prop.d.ts +63 -1
- package/dist/props/components/data-entry.prop.d.ts +6 -0
- package/dist/props/components/feedback.prop.d.ts +6 -0
- package/dist/props/components/index.d.ts +1 -1
- package/dist/props/components/layout.prop.d.ts +244 -4
- package/dist/props/components/navigation.prop.d.ts +57 -1
- package/dist/props/registry.d.ts +205 -5
- package/dist/props/registry.js +270 -6
- package/dist/props/vocabulary/data.prop.d.ts +27 -0
- package/dist/props/vocabulary/index.d.ts +3 -3
- package/dist/props/vocabulary/interaction.prop.d.ts +19 -2
- package/dist/props/vocabulary/layout.prop.d.ts +41 -7
- package/dist/styles/alert-layout.css +36 -0
- package/dist/styles/control.css +28 -0
- package/dist/styles/data-display-layout.css +26 -0
- package/dist/styles/layout.css +212 -0
- package/dist/styles/logo-layout.css +42 -9
- package/dist/styles/navigation-layout.css +109 -0
- package/dist/styles/shell-layout.css +336 -0
- package/dist/styles/table-layout.css +164 -1
- package/dist/theme/dxs.canonical.css +5 -4
- package/dist/tokens/axes.css +4 -3
- package/dist/tokens/base.css +1 -0
- package/dist/tokens/components/data-display.css +13 -0
- package/dist/tokens/components/email.css +43 -16
- package/dist/tokens/components/error-surface.css +36 -0
- package/dist/tokens/components/feedback.css +20 -0
- package/dist/tokens/components/list-row.css +20 -0
- package/dist/tokens/components/logo.css +52 -10
- package/dist/tokens/components/navigation.css +41 -0
- package/dist/tokens/components/shell.css +109 -0
- package/dist/tokens/components/table.css +45 -0
- package/dist/tokens/foundation.css +26 -0
- package/dist/tokens/semantic/layout.css +38 -0
- package/package.json +8 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** Layout component prop types — @see docs/COMPONENTS.md#layout */
|
|
2
2
|
import type * as React from "react";
|
|
3
3
|
import type { ComponentType, ReactNode, SVGProps } from "react";
|
|
4
|
-
import type { BreadcrumbProp, TitleProp, SubtitleProp, ExtraProp, FooterProp, PageDensityProp, PageContainerVariantProp, CenteredShellWidthProp, CenteredShellAlignProp, AuthShellPresetProp, BreakpointProp, GapProp, ClassNameProp, ChildrenProp, IdProp } from "../vocabulary/index.js";
|
|
4
|
+
import type { BreadcrumbProp, TitleProp, SubtitleProp, ExtraProp, FooterProp, PageDensityProp, PageContainerVariantProp, CenteredShellWidthProp, CenteredShellAlignProp, CenteredShellPresetProp, ErrorSurfaceModeProp, ErrorSurfaceStatusProp, AuthShellPresetProp, BreakpointProp, GapProp, ClassNameProp, ChildrenProp, IdProp, DisabledProp, DescriptionProp, ActionProp, IconProp, HeadingLevelProp } from "../vocabulary/index.js";
|
|
5
|
+
import type { EmptyStateToneProp } from "./data-display.prop.js";
|
|
5
6
|
/**
|
|
6
7
|
* Arrangement of the page header's title band and its `extra` slot below the 640px step.
|
|
7
8
|
* `stack` (default) is the historical arrangement — `extra` drops onto its own full-width line
|
|
@@ -9,10 +10,69 @@ import type { BreadcrumbProp, TitleProp, SubtitleProp, ExtraProp, FooterProp, Pa
|
|
|
9
10
|
* `--page-header-extra-measure` measure, letting the title/subtitle wrap into what is left.
|
|
10
11
|
*/
|
|
11
12
|
export type PageContainerHeaderLayoutProp = "stack" | "responsive-inline";
|
|
13
|
+
/** Whole-page semantic composition owned by PageContainer. */
|
|
14
|
+
export type PageContainerPresetProp = "default" | "admin-collection";
|
|
15
|
+
/**
|
|
16
|
+
* Bounded page MEASURE — the shared inline cap applied to the page header AND body together, so
|
|
17
|
+
* the header `extra` action ends on the same edge as the body surface. Orthogonal to
|
|
18
|
+
* `PageContainerVariantProp` (chrome) and to `PageContainerHeaderLayoutProp`, so a quiet
|
|
19
|
+
* `variant="ghost"` feed can finally have a bounded measure too (gh#245 / gh#247).
|
|
20
|
+
*
|
|
21
|
+
* `default` applies NO cap — the page is fluid exactly as before. `narrow` / `medium` read the
|
|
22
|
+
* `--page-measure-{narrow,medium}` tokens (42rem / 48rem OUTER, i.e. 624px / 720px VISIBLE surface
|
|
23
|
+
* once the package-owned page gutters are subtracted). Both are maxes, so a compact viewport stays
|
|
24
|
+
* fluid at the compact gutter.
|
|
25
|
+
*/
|
|
26
|
+
export type PageContainerMeasureProp = "default" | "narrow" | "medium";
|
|
27
|
+
/**
|
|
28
|
+
* @see PageHeader — the canonical page title band, extracted from PageContainer so a consumer can
|
|
29
|
+
* mount the SAME token-owned geometry outside a full page shell (a Sheet detail, a MasterDetail
|
|
30
|
+
* pane, a tab body) instead of re-authoring `.ui-page-header` CSS locally (gh#255).
|
|
31
|
+
*/
|
|
32
|
+
export type PageHeaderProp = {
|
|
33
|
+
title: TitleProp;
|
|
34
|
+
subtitle?: SubtitleProp;
|
|
35
|
+
/**
|
|
36
|
+
* Status / meta band rendered INLINE with the title (a `Badge` tone, an ID, a timestamp).
|
|
37
|
+
* Omitted → the title band emits its historical single-`<h1>` DOM, so no existing page moves.
|
|
38
|
+
*/
|
|
39
|
+
meta?: ReactNode;
|
|
40
|
+
/** Trailing action region — buttons, a search field, an overflow menu. */
|
|
41
|
+
extra?: ExtraProp;
|
|
42
|
+
breadcrumb?: BreadcrumbProp;
|
|
43
|
+
/**
|
|
44
|
+
* Override the breadcrumb `<nav>` landmark's accessible name. Defaults to a localized
|
|
45
|
+
* "Breadcrumb". Needed when more than one header (each with its own `breadcrumb`) renders on the
|
|
46
|
+
* same page/view — two `<nav>` landmarks sharing one name/role fail axe's `landmark-unique`
|
|
47
|
+
* (WCAG 2.4.1 / 1.3.1).
|
|
48
|
+
*/
|
|
49
|
+
breadcrumbLabel?: string;
|
|
50
|
+
/** Kebab/DOM-style alias of `breadcrumbLabel` (same landmark-unique override). */
|
|
51
|
+
breadcrumbAriaLabel?: string;
|
|
52
|
+
linkComponent?: React.ElementType;
|
|
53
|
+
/**
|
|
54
|
+
* How the title band and `extra` share the header row below the 640px step. Defaults to
|
|
55
|
+
* `stack`. @see PageContainerHeaderLayoutProp
|
|
56
|
+
*/
|
|
57
|
+
layout?: PageContainerHeaderLayoutProp;
|
|
58
|
+
/**
|
|
59
|
+
* Pending state for the title band while the page's own data resolves. Renders the title/subtitle
|
|
60
|
+
* /meta as `Skeleton` placeholders and marks the header `aria-busy`, keeping the `<h1>` in the
|
|
61
|
+
* document with an accessible name (an empty heading is an axe violation) so the page's heading
|
|
62
|
+
* outline never disappears mid-load. Breadcrumbs and `extra` are NOT skeletonised — they come
|
|
63
|
+
* from the route, not the record.
|
|
64
|
+
*/
|
|
65
|
+
loading?: boolean;
|
|
66
|
+
className?: ClassNameProp;
|
|
67
|
+
};
|
|
12
68
|
/** @see PageContainer */
|
|
13
69
|
export type PageContainerProp = {
|
|
14
70
|
title: TitleProp;
|
|
15
71
|
subtitle?: SubtitleProp;
|
|
72
|
+
/** Status / meta band rendered inline with the title. @see PageHeaderProp.meta */
|
|
73
|
+
meta?: ReactNode;
|
|
74
|
+
/** Skeletonise the title band while the page record loads. @see PageHeaderProp.loading */
|
|
75
|
+
headerLoading?: boolean;
|
|
16
76
|
extra?: ExtraProp;
|
|
17
77
|
footer?: FooterProp;
|
|
18
78
|
breadcrumb?: BreadcrumbProp;
|
|
@@ -28,6 +88,12 @@ export type PageContainerProp = {
|
|
|
28
88
|
linkComponent?: React.ElementType;
|
|
29
89
|
density?: PageDensityProp;
|
|
30
90
|
variant?: PageContainerVariantProp;
|
|
91
|
+
/**
|
|
92
|
+
* Whole-page composition contract. `admin-collection` sets the header-to-toolbar rhythm,
|
|
93
|
+
* collection search measure, control height and table density once for the entire subtree.
|
|
94
|
+
* Geometry remains token-owned and service-themeable; no child needs a sizing override.
|
|
95
|
+
*/
|
|
96
|
+
preset?: PageContainerPresetProp;
|
|
31
97
|
/**
|
|
32
98
|
* How the title band and `extra` share the header row below the 640px step. Defaults to
|
|
33
99
|
* `stack` — the historical arrangement, where `extra` wraps onto its own full-width line under
|
|
@@ -36,6 +102,15 @@ export type PageContainerProp = {
|
|
|
36
102
|
* `--page-header-extra-measure`. At >=640px both arrangements are identical.
|
|
37
103
|
*/
|
|
38
104
|
headerLayout?: PageContainerHeaderLayoutProp;
|
|
105
|
+
/**
|
|
106
|
+
* Bounded page measure shared by the header and the body. Defaults to `default` — no cap, the
|
|
107
|
+
* historical fluid page. `narrow` (624px surface) / `medium` (720px surface) cap BOTH bands to
|
|
108
|
+
* one token-owned measure (`--page-measure-{narrow,medium}`), so a header action ends flush with
|
|
109
|
+
* the body surface instead of at the page edge. Orthogonal to `variant`, so `variant="ghost"`
|
|
110
|
+
* quiet chrome composes with a bounded measure (gh#245 / gh#247). Unlike `variant="narrow"`,
|
|
111
|
+
* which caps only the body.
|
|
112
|
+
*/
|
|
113
|
+
measure?: PageContainerMeasureProp;
|
|
39
114
|
/** Pin footer to viewport bottom on scroll — pairs well with `variant="narrow"`. */
|
|
40
115
|
stickyFooter?: boolean;
|
|
41
116
|
/**
|
|
@@ -68,6 +143,20 @@ export type FlexProp = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
68
143
|
align?: FlexAlignProp;
|
|
69
144
|
justify?: FlexJustifyProp;
|
|
70
145
|
wrap?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Drop this region below a breakpoint step (`sm` 40rem · `md` 48rem · `lg` 64rem · `xl` 80rem).
|
|
148
|
+
* The ONE public way to make a layout region responsive without a page-local media query — a
|
|
149
|
+
* public header hides its anchor navigation below the tablet step with `hideBelow="md"` instead
|
|
150
|
+
* of a consumer `@media` rule (gh#252). Omit (the default) and no attribute is emitted, so no
|
|
151
|
+
* rule can match and the Flex is unchanged. The region is removed from the accessibility tree
|
|
152
|
+
* too, so keep its destinations reachable elsewhere at that width (a footer nav).
|
|
153
|
+
*/
|
|
154
|
+
hideBelow?: BreakpointProp;
|
|
155
|
+
/**
|
|
156
|
+
* The inverse of `hideBelow` — drop this region FROM a breakpoint step upwards, i.e. keep it
|
|
157
|
+
* only on the narrow side (a compact-only affordance). Omit for no attribute and no rule.
|
|
158
|
+
*/
|
|
159
|
+
hideFrom?: BreakpointProp;
|
|
71
160
|
};
|
|
72
161
|
export type ResponsiveGridColumnsProp = number | {
|
|
73
162
|
sm?: number;
|
|
@@ -136,6 +225,17 @@ export type AppShellProp = {
|
|
|
136
225
|
breadcrumb?: ReactNode;
|
|
137
226
|
footer?: ReactNode;
|
|
138
227
|
sidebarCollapsed?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Responsive navigation strategy below the canonical 900px shell breakpoint.
|
|
230
|
+
*
|
|
231
|
+
* - `"drawer"` (default) hides the docked sidebar and exposes the accessible mobile Sheet.
|
|
232
|
+
* - `"docked"` keeps the sidebar grid track, footer/account region and active navigation in the
|
|
233
|
+
* shell at narrow widths. The sidebar width remains owned by `--app-shell-sidebar-width`.
|
|
234
|
+
*
|
|
235
|
+
* Use `"docked"` only when the product's approved responsive contract explicitly retains the
|
|
236
|
+
* rail; it intentionally suppresses the redundant mobile drawer trigger.
|
|
237
|
+
*/
|
|
238
|
+
responsiveNavigation?: "drawer" | "docked";
|
|
139
239
|
/**
|
|
140
240
|
* Navigation shown in the mobile drawer at the DXS 900px breakpoint, where the docked sidebar is
|
|
141
241
|
* hidden. AppShell OWNS the drawer: it renders a hamburger trigger in the topbar and a focus-
|
|
@@ -176,10 +276,23 @@ export type AuthShellProp = {
|
|
|
176
276
|
/**
|
|
177
277
|
* Named flow MEASURE — the page geometry contract for one canonical hosted-identity flow: the
|
|
178
278
|
* auth card's max-width plus the desktop and mobile page gutters, all owned by component tokens
|
|
179
|
-
* (`--auth-shell-{device,context,recovery}-*`). Selecting a preset replaces every
|
|
180
|
-
*
|
|
279
|
+
* (`--auth-shell-{login,device,context,recovery}-*`). Selecting a preset replaces every
|
|
280
|
+
* consumer-side geometry override.
|
|
181
281
|
*
|
|
182
282
|
* - `"default"` (default) — the shell's own measure; nothing changes.
|
|
283
|
+
* - `"login"` — SCR-001's 360px card at x=540/332/15 and y=363/363/353 for the canonical
|
|
284
|
+
* 1440x900, 1024x900 and 390x844 viewports. The identity occupies a package-owned anchor slot,
|
|
285
|
+
* so standalone, one-line requester and wrapped two-line requester states keep the same card
|
|
286
|
+
* position without truncating or inventing requester data. Pass AuthIdentity, Card and
|
|
287
|
+
* AuthFooter as direct children (an anchor may wrap AuthIdentity).
|
|
288
|
+
* - `"registration"` — the 360px sign-up measure with a 15px inline gutter at 390px (the same
|
|
289
|
+
* page rhythm as `"login"`, so sign-in → sign-up never jumps on a phone). The ONLY preset whose
|
|
290
|
+
* column is START-aligned: a registration card is the tallest surface in the hosted-identity
|
|
291
|
+
* set (name · email · password · confirm · strength · consent · submit · providers), and a
|
|
292
|
+
* vertically centred tall card overflows ABOVE the scroll origin on a short viewport, putting
|
|
293
|
+
* its first field out of reach. It is also the only preset with a footer-clearance knob of its
|
|
294
|
+
* own, so the legal/consent footer never sits flush against the submit button. Carries the full
|
|
295
|
+
* password form and the pending-email confirmation state with no consumer geometry CSS.
|
|
183
296
|
* - `"device-authorization"` — 380px card measure with a 5px inline page gutter at a 390px
|
|
184
297
|
* viewport (canonical device-grant artboard).
|
|
185
298
|
* - `"context-selection"` — 25rem card measure on desktop/tablet, edge-to-edge on mobile, and a
|
|
@@ -190,7 +303,7 @@ export type AuthShellProp = {
|
|
|
190
303
|
* · passkey-failure), whose title and description sit INSIDE the bordered surface.
|
|
191
304
|
*
|
|
192
305
|
* Orthogonal to `variant`: presets are applied AFTER it, so `variant="canonical"` keeps owning
|
|
193
|
-
* control density and heading size while the preset re-measures the page.
|
|
306
|
+
* control density and heading size while the preset re-measures/anchors the page.
|
|
194
307
|
*/
|
|
195
308
|
preset?: AuthShellPresetProp;
|
|
196
309
|
/**
|
|
@@ -241,6 +354,20 @@ export type AuthIdentityProp = {
|
|
|
241
354
|
requester?: ReactNode;
|
|
242
355
|
className?: ClassNameProp;
|
|
243
356
|
};
|
|
357
|
+
/**
|
|
358
|
+
* @see AuthAccountSummary — compact signed-in identity row for hosted authentication surfaces.
|
|
359
|
+
* It owns avatar fallback, bidi-safe email truncation and the keyboard action geometry; the
|
|
360
|
+
* consumer owns the authoritative email, localized action label and navigation handler.
|
|
361
|
+
*/
|
|
362
|
+
export type AuthAccountSummaryProp = {
|
|
363
|
+
email: string;
|
|
364
|
+
avatarSrc?: string;
|
|
365
|
+
avatarFallback?: ReactNode;
|
|
366
|
+
actionLabel: ReactNode;
|
|
367
|
+
onAction: () => void;
|
|
368
|
+
disabled?: DisabledProp;
|
|
369
|
+
className?: ClassNameProp;
|
|
370
|
+
};
|
|
244
371
|
/**
|
|
245
372
|
* @see CenteredShell — authenticated, no-sidebar, centred-column page shell (hosted-ID "My Page",
|
|
246
373
|
* account / self-service, standalone settings). A padded top bar with real actions (banner) reusing
|
|
@@ -276,6 +403,119 @@ export type CenteredShellProp = {
|
|
|
276
403
|
* a long localized message is never clipped.
|
|
277
404
|
*/
|
|
278
405
|
align?: CenteredShellAlignProp;
|
|
406
|
+
/**
|
|
407
|
+
* Whole-page shell contract. `"default"` (the default) emits no attribute and keeps the shell's
|
|
408
|
+
* exact box. `"public-landing"` owns the PUBLIC landing geometry — one content measure shared by
|
|
409
|
+
* the header bar, the centred column and the footer, the section rhythm, the flat public-surface
|
|
410
|
+
* card chrome and the hero `h1` tier — from `--centered-shell-landing-*` tokens, so a landing
|
|
411
|
+
* composition (header · hero · sections · legal footer) needs no page-local CSS and no descendant
|
|
412
|
+
* selector against shell internals (gh#252).
|
|
413
|
+
*/
|
|
414
|
+
preset?: CenteredShellPresetProp;
|
|
415
|
+
className?: ClassNameProp;
|
|
416
|
+
};
|
|
417
|
+
/**
|
|
418
|
+
* @see ErrorSurface — the optional maintenance / planned-outage timing slot (503, occasionally a
|
|
419
|
+
* planned 500).
|
|
420
|
+
*
|
|
421
|
+
* `start` / `end` are **ISO-8601 instants** and `timeZone` an **IANA** zone id: the surface formats
|
|
422
|
+
* them with `Intl.DateTimeFormat(locale, …).formatRange()` (CLDR), so ja / en / vi each read
|
|
423
|
+
* natively. NEVER pass a pre-formatted string like `"18:00 - 20:00 JST"` — it cannot localize, and
|
|
424
|
+
* the machine-readable value is what lands in `<time dateTime>`.
|
|
425
|
+
*
|
|
426
|
+
* `progress` is server-sent on purpose: deriving "how far through the window are we" from the
|
|
427
|
+
* client clock makes SSR and hydration disagree, and an exception page must be readable before
|
|
428
|
+
* hydration.
|
|
429
|
+
*/
|
|
430
|
+
export type ErrorSurfaceMaintenanceProp = {
|
|
431
|
+
/** Window start as an ISO-8601 instant (`2026-08-02T18:00:00Z`). Also the `<time dateTime>` value. */
|
|
432
|
+
start: string;
|
|
433
|
+
/** Window end as an ISO-8601 instant. Omit for an open-ended outage — a single instant is shown. */
|
|
434
|
+
end?: string;
|
|
435
|
+
/**
|
|
436
|
+
* IANA time zone id (`Asia/Tokyo`) the window is presented in. Omit to use the runtime zone —
|
|
437
|
+
* pass it explicitly whenever the page is server-rendered, or SSR and client output diverge.
|
|
438
|
+
*/
|
|
439
|
+
timeZone?: string;
|
|
440
|
+
/**
|
|
441
|
+
* Completion of the maintenance window as a **percentage 0–100**, rendered as a labelled
|
|
442
|
+
* `Progress` meter. Server-sent (see above); omit for an outage with no published progress.
|
|
443
|
+
*/
|
|
444
|
+
progress?: number;
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* @see ErrorSurface — the package-owned semantic exception surface for 403 / 404 / 500 / 503.
|
|
448
|
+
*
|
|
449
|
+
* The `mode` is the SHELL CONTRACT, not a skin:
|
|
450
|
+
* - `mode="application"` (403/404) renders the surface as the **body** you put inside the
|
|
451
|
+
* `AppShell` the route already provides (normally within a `PageContainer`). It deliberately does
|
|
452
|
+
* NOT reconstruct navigation chrome: the sidebar, topbar and user menu are consumer-owned data,
|
|
453
|
+
* so the surface preserves the shell it is placed in instead of manufacturing a fake one.
|
|
454
|
+
* - `mode="system"` (500/503) owns the whole page: it renders `CenteredShell align="center"`, so
|
|
455
|
+
* the viewport-centred geometry at 1440 / 1024 / 390 stays package-owned and a consumer never
|
|
456
|
+
* writes `min-h-dvh`, a flex-centring class or a media query.
|
|
457
|
+
*
|
|
458
|
+
* `action` is **exactly one** recovery action, enforced structurally by a single slot (a second
|
|
459
|
+
* element is dropped with a development error). Support contact belongs in `description`, not in a
|
|
460
|
+
* second CTA.
|
|
461
|
+
*
|
|
462
|
+
* All product COPY stays consumer-owned (`title` / `description` / `action` come from the app's own
|
|
463
|
+
* `t()`); the surface owns only its own metadata labels, which it localizes itself.
|
|
464
|
+
*/
|
|
465
|
+
export type ErrorSurfaceProp = {
|
|
466
|
+
/** Where the surface lives — `application` = AppShell body (403/404), `system` = own page (500/503). */
|
|
467
|
+
mode: ErrorSurfaceModeProp;
|
|
468
|
+
/** HTTP status presented. Drives the default `icon`, `tone` and the rendered status code. */
|
|
469
|
+
status: ErrorSurfaceStatusProp;
|
|
470
|
+
/** Headline. Consumer-owned copy from the app's `t()` — the library ships no product text. */
|
|
471
|
+
title: TitleProp;
|
|
472
|
+
/** Supporting sentence under the title. Put support-contact guidance here, never in a 2nd CTA. */
|
|
473
|
+
description?: DescriptionProp;
|
|
474
|
+
/**
|
|
475
|
+
* The ONE recovery action (a `Button`, or a `Button asChild` wrapping a router `Link`). A single
|
|
476
|
+
* slot IS the enforcement: pass more than one element and only the first renders, with a
|
|
477
|
+
* development-time error.
|
|
478
|
+
*/
|
|
479
|
+
action: ActionProp;
|
|
480
|
+
/** Override the status-derived icon (403 ShieldAlert · 404 SearchX · 500 ServerCrash · 503 Wrench). */
|
|
481
|
+
icon?: IconProp;
|
|
482
|
+
/** Override the status-derived tone (403/503 `warning` · 404 `muted` · 500 `destructive`). */
|
|
483
|
+
tone?: EmptyStateToneProp;
|
|
484
|
+
/**
|
|
485
|
+
* Semantic heading level of `title`. Defaults to `2` in `application` mode (a `PageContainer`
|
|
486
|
+
* `h1` sits above it) and `1` in `system` mode (the surface IS the page). Choose it to keep the
|
|
487
|
+
* outline valid, never for size.
|
|
488
|
+
*/
|
|
489
|
+
titleLevel?: HeadingLevelProp;
|
|
490
|
+
/**
|
|
491
|
+
* Support correlation id for the failure, rendered as a monospace/tabular metadata row so it can
|
|
492
|
+
* be read out or copied accurately. Pass the bare id — the localized label is the surface's.
|
|
493
|
+
*/
|
|
494
|
+
requestId?: string;
|
|
495
|
+
/**
|
|
496
|
+
* The permission / role the viewer is missing (403). Pass the bare permission name
|
|
497
|
+
* (`reports.view`) — the surface renders the localized "Required permission" label around it.
|
|
498
|
+
*/
|
|
499
|
+
permission?: ReactNode;
|
|
500
|
+
/**
|
|
501
|
+
* The organization / tenant the failed request was scoped to. Disambiguates a 403 caused by
|
|
502
|
+
* being in the wrong workspace from one caused by a missing role.
|
|
503
|
+
*/
|
|
504
|
+
organization?: ReactNode;
|
|
505
|
+
/** Optional planned-outage timing + progress (503). ISO-8601 + IANA, formatted with `Intl`. */
|
|
506
|
+
maintenance?: ErrorSurfaceMaintenanceProp;
|
|
507
|
+
/**
|
|
508
|
+
* `system` mode only — brand slot above the status code (a `Logo`). Ignored in `application`
|
|
509
|
+
* mode, where the shell already shows the product brand.
|
|
510
|
+
*/
|
|
511
|
+
brand?: ReactNode;
|
|
512
|
+
/** `system` mode only — the page footer (contentinfo): copyright, status page, locale switch. */
|
|
513
|
+
footer?: FooterProp;
|
|
514
|
+
/**
|
|
515
|
+
* `system` mode only — measure of the centred column (`CenteredShell` width tier). Default `sm`.
|
|
516
|
+
*/
|
|
517
|
+
width?: CenteredShellWidthProp;
|
|
518
|
+
id?: IdProp;
|
|
279
519
|
className?: ClassNameProp;
|
|
280
520
|
};
|
|
281
521
|
/** @see Sidebar */
|
|
@@ -7,10 +7,62 @@ import type { ChildrenProp, ClassNameProp, DisabledProp, HasActiveFiltersProp, I
|
|
|
7
7
|
* bounded row that scrolls inline, so a wide filter set never pushes the list below the fold.
|
|
8
8
|
*/
|
|
9
9
|
export type FilterBarOverflowProp = "wrap" | "scroll";
|
|
10
|
+
/**
|
|
11
|
+
* One APPLIED filter, rendered as a removable chip under the control row (#258).
|
|
12
|
+
*
|
|
13
|
+
* The chip is the visible record of a filter that is already in effect — it is NOT the control that
|
|
14
|
+
* sets it. `label` is caller-localized text (the bar never interprets or formats domain values);
|
|
15
|
+
* omit `onRemove` for a chip the user may not lift (a scope locked by the route or by permission),
|
|
16
|
+
* and the chip renders as a static token with no dead button.
|
|
17
|
+
*/
|
|
18
|
+
export type FilterBarChipProp = {
|
|
19
|
+
/** Stable identity — also the argument passed back to {@link ToolbarProp.onChipRemove}. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Already-localized chip text, e.g. "状態: 未払い". */
|
|
22
|
+
label: string;
|
|
23
|
+
/**
|
|
24
|
+
* Per-chip removal. Omit for a chip the user cannot lift; the bar then renders no remove control
|
|
25
|
+
* rather than a disabled one, so nothing focusable is dead.
|
|
26
|
+
*/
|
|
27
|
+
onRemove?: () => void;
|
|
28
|
+
};
|
|
10
29
|
/** @see Toolbar */
|
|
11
30
|
export type ToolbarProp = {
|
|
12
31
|
onClear?: OnClearFiltersProp;
|
|
13
32
|
hasActiveFilters?: HasActiveFiltersProp;
|
|
33
|
+
/**
|
|
34
|
+
* The search control (#258). A slot, not a rendered input: the bar owns its MEASURE
|
|
35
|
+
* (`--filter-bar-search-width`) and its position at the START of the row, while the caller
|
|
36
|
+
* still chooses the real primitive (`SearchInput`, or a `Select showSearch` for scoped search)
|
|
37
|
+
* and owns its debounce and value. Passing the control as a child instead is what produced the
|
|
38
|
+
* inconsistent search widths the issue was filed against.
|
|
39
|
+
*/
|
|
40
|
+
search?: ChildrenProp;
|
|
41
|
+
/**
|
|
42
|
+
* Applied filters as removable chips (#258). The bar owns the CHIP LIFECYCLE — chips render
|
|
43
|
+
* below the control row, each with an accessible remove control, and the row disappears entirely
|
|
44
|
+
* when the array is empty (never an empty reserved strip). It owns no state: removing a chip
|
|
45
|
+
* calls back and the caller re-renders the array.
|
|
46
|
+
*/
|
|
47
|
+
chips?: readonly FilterBarChipProp[];
|
|
48
|
+
/**
|
|
49
|
+
* Called with the chip's `id` when its remove control is activated. Fires in addition to that
|
|
50
|
+
* chip's own `onRemove`, so a caller may handle removal per chip, centrally, or both.
|
|
51
|
+
*/
|
|
52
|
+
onChipRemove?: (id: string) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Number of records the current filters resolve to (#258). Rendered in a POLITE LIVE REGION and
|
|
55
|
+
* formatted with `Intl.NumberFormat` + CLDR plurals for the active locale — which is the point:
|
|
56
|
+
* a sighted user sees the table change, and this is what tells everyone else that filtering
|
|
57
|
+
* happened. Omit when the count is unknown or still loading.
|
|
58
|
+
*/
|
|
59
|
+
resultCount?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Trailing action region (#258) — export, column settings, a saved-view menu. Rendered AFTER the
|
|
62
|
+
* reset control, so "clear filters" never sits at the end of the row beside an unrelated primary
|
|
63
|
+
* action. The bar owns the ordering; the caller owns the controls.
|
|
64
|
+
*/
|
|
65
|
+
actions?: ChildrenProp;
|
|
14
66
|
/**
|
|
15
67
|
* Pin the strip to the top of its scroll container while the list scrolls beneath it
|
|
16
68
|
* (list-page filter bars, #197). Opt-in — default `false` keeps the toolbar quiet. Tune
|
|
@@ -85,7 +137,11 @@ export type StepsProp = {
|
|
|
85
137
|
defaultValue?: number;
|
|
86
138
|
status?: StepStatusProp;
|
|
87
139
|
orientation?: "horizontal" | "vertical";
|
|
88
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Marker appearance. `inline` renders the compact numbered auth/device progress row without the
|
|
142
|
+
* icon rail while preserving the same status and current-step semantics.
|
|
143
|
+
*/
|
|
144
|
+
type?: "default" | "dot" | "inline";
|
|
89
145
|
size?: "md" | "sm";
|
|
90
146
|
titlePlacement?: "horizontal" | "vertical";
|
|
91
147
|
onValueChange?: (value: number) => void;
|