@korzun/design 0.0.4 → 0.0.6
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/AGENTS.md +3 -0
- package/dist/component/card/index.d.ts +13 -2
- package/dist/component/card/index.d.ts.map +1 -1
- package/dist/component/card/index.js +1 -0
- package/dist/component/card/index.js.map +1 -1
- package/dist/component/card/style.d.ts.map +1 -1
- package/dist/component/card/style.js +3 -1
- package/dist/component/card/style.js.map +1 -1
- package/dist/component/card-divider/index.d.ts +15 -0
- package/dist/component/card-divider/index.d.ts.map +1 -1
- package/dist/component/card-divider/index.js +4 -0
- package/dist/component/card-divider/index.js.map +1 -1
- package/dist/component/card-row/index.d.ts +5 -0
- package/dist/component/card-row/index.d.ts.map +1 -1
- package/dist/component/card-row/index.js +1 -0
- package/dist/component/card-row/index.js.map +1 -1
- package/dist/component/card-row/style.js +1 -1
- package/dist/component/card-row/style.js.map +1 -1
- package/dist/component/collapsible-section/index.d.ts +8 -3
- package/dist/component/collapsible-section/index.d.ts.map +1 -1
- package/dist/component/collapsible-section/index.js +1 -0
- package/dist/component/collapsible-section/index.js.map +1 -1
- package/dist/component/empty-state/index.d.ts +2 -2
- package/dist/component/empty-state/index.d.ts.map +1 -1
- package/dist/component/empty-state/index.js.map +1 -1
- package/dist/component/index.d.ts +10 -10
- package/dist/component/index.d.ts.map +1 -1
- package/dist/component/index.js.map +1 -1
- package/dist/component/meta-line/index.d.ts +1 -1
- package/dist/component/meta-line/index.d.ts.map +1 -1
- package/dist/component/meta-line/index.js.map +1 -1
- package/dist/component/metadata/index.d.ts +2 -0
- package/dist/component/metadata/index.d.ts.map +1 -1
- package/dist/component/metadata/index.js +1 -0
- package/dist/component/metadata/index.js.map +1 -1
- package/dist/component/metadata-list/index.d.ts +6 -2
- package/dist/component/metadata-list/index.d.ts.map +1 -1
- package/dist/component/metadata-list/index.js +1 -0
- package/dist/component/metadata-list/index.js.map +1 -1
- package/dist/component/nav-desktop/index.d.ts +6 -0
- package/dist/component/nav-desktop/index.d.ts.map +1 -1
- package/dist/component/nav-desktop/index.js +5 -2
- package/dist/component/nav-desktop/index.js.map +1 -1
- package/dist/component/nav-mobile/index.d.ts +11 -3
- package/dist/component/nav-mobile/index.d.ts.map +1 -1
- package/dist/component/nav-mobile/index.js +5 -0
- package/dist/component/nav-mobile/index.js.map +1 -1
- package/dist/component/nav-types.d.ts +4 -0
- package/dist/component/nav-types.d.ts.map +1 -1
- package/dist/component/nav-types.js.map +1 -1
- package/dist/component/page/index.d.ts +10 -2
- package/dist/component/page/index.d.ts.map +1 -1
- package/dist/component/page/index.js +1 -0
- package/dist/component/page/index.js.map +1 -1
- package/dist/component/progress-indicator/index.d.ts +4 -2
- package/dist/component/progress-indicator/index.d.ts.map +1 -1
- package/dist/component/progress-indicator/index.js +1 -0
- package/dist/component/progress-indicator/index.js.map +1 -1
- package/dist/component/tag/index.d.ts +6 -3
- package/dist/component/tag/index.d.ts.map +1 -1
- package/dist/component/tag/index.js +1 -0
- package/dist/component/tag/index.js.map +1 -1
- package/dist/component/theme-setting/index.d.ts +6 -0
- package/dist/component/theme-setting/index.d.ts.map +1 -1
- package/dist/component/theme-setting/index.js +4 -0
- package/dist/component/theme-setting/index.js.map +1 -1
- package/dist/component/top-fade/index.d.ts +7 -0
- package/dist/component/top-fade/index.d.ts.map +1 -1
- package/dist/component/top-fade/index.js +5 -2
- package/dist/component/top-fade/index.js.map +1 -1
- package/dist/control/action-menu-list/index.d.ts +7 -0
- package/dist/control/action-menu-list/index.d.ts.map +1 -1
- package/dist/control/action-menu-list/index.js.map +1 -1
- package/dist/control/back-button/index.d.ts +9 -2
- package/dist/control/back-button/index.d.ts.map +1 -1
- package/dist/control/back-button/index.js +4 -0
- package/dist/control/back-button/index.js.map +1 -1
- package/dist/control/button/index.d.ts +30 -1
- package/dist/control/button/index.d.ts.map +1 -1
- package/dist/control/button/index.js +4 -0
- package/dist/control/button/index.js.map +1 -1
- package/dist/control/chips-input/index.d.ts +20 -0
- package/dist/control/chips-input/index.d.ts.map +1 -1
- package/dist/control/chips-input/index.js +4 -0
- package/dist/control/chips-input/index.js.map +1 -1
- package/dist/control/confirm-modal/index.d.ts +15 -2
- package/dist/control/confirm-modal/index.d.ts.map +1 -1
- package/dist/control/confirm-modal/index.js +4 -0
- package/dist/control/confirm-modal/index.js.map +1 -1
- package/dist/control/date-time-input/index.d.ts +4 -0
- package/dist/control/date-time-input/index.d.ts.map +1 -1
- package/dist/control/date-time-input/index.js.map +1 -1
- package/dist/control/field-list/index.d.ts +20 -2
- package/dist/control/field-list/index.d.ts.map +1 -1
- package/dist/control/field-list/index.js +4 -0
- package/dist/control/field-list/index.js.map +1 -1
- package/dist/control/index.d.ts +16 -21
- package/dist/control/index.d.ts.map +1 -1
- package/dist/control/index.js +5 -5
- package/dist/control/index.js.map +1 -1
- package/dist/control/number-input/index.d.ts +12 -0
- package/dist/control/number-input/index.d.ts.map +1 -1
- package/dist/control/number-input/index.js +4 -0
- package/dist/control/number-input/index.js.map +1 -1
- package/dist/control/page-actions-bar/index.d.ts +11 -3
- package/dist/control/page-actions-bar/index.d.ts.map +1 -1
- package/dist/control/page-actions-bar/index.js +5 -1
- package/dist/control/page-actions-bar/index.js.map +1 -1
- package/dist/control/page-actions-menu/index.d.ts +6 -1
- package/dist/control/page-actions-menu/index.d.ts.map +1 -1
- package/dist/control/page-actions-menu/index.js +4 -0
- package/dist/control/page-actions-menu/index.js.map +1 -1
- package/dist/control/page-footer-actions/index.d.ts +16 -2
- package/dist/control/page-footer-actions/index.d.ts.map +1 -1
- package/dist/control/page-footer-actions/index.js +4 -0
- package/dist/control/page-footer-actions/index.js.map +1 -1
- package/dist/control/popover/index.d.ts +6 -3
- package/dist/control/popover/index.d.ts.map +1 -1
- package/dist/control/popover/index.js +2 -0
- package/dist/control/popover/index.js.map +1 -1
- package/dist/control/segmented-control/index.d.ts +10 -3
- package/dist/control/segmented-control/index.d.ts.map +1 -1
- package/dist/control/segmented-control/index.js.map +1 -1
- package/dist/control/select/index.d.ts +17 -0
- package/dist/control/select/index.d.ts.map +1 -1
- package/dist/control/select/index.js +4 -0
- package/dist/control/select/index.js.map +1 -1
- package/dist/control/switch/index.d.ts +16 -2
- package/dist/control/switch/index.d.ts.map +1 -1
- package/dist/control/switch/index.js +4 -0
- package/dist/control/switch/index.js.map +1 -1
- package/dist/control/switch/style.d.ts.map +1 -1
- package/dist/control/switch/style.js +1 -3
- package/dist/control/switch/style.js.map +1 -1
- package/dist/control/text-area/index.d.ts +15 -0
- package/dist/control/text-area/index.d.ts.map +1 -1
- package/dist/control/text-area/index.js +4 -0
- package/dist/control/text-area/index.js.map +1 -1
- package/dist/control/text-input/index.d.ts +23 -1
- package/dist/control/text-input/index.d.ts.map +1 -1
- package/dist/control/text-input/index.js +4 -0
- package/dist/control/text-input/index.js.map +1 -1
- package/dist/control/use-modal-dialog/index.d.ts +7 -1
- package/dist/control/use-modal-dialog/index.d.ts.map +1 -1
- package/dist/control/use-modal-dialog/index.js +5 -0
- package/dist/control/use-modal-dialog/index.js.map +1 -1
- package/dist/theme/theme.d.ts +2 -0
- package/dist/theme/theme.d.ts.map +1 -1
- package/dist/theme/theme.js +5 -0
- package/dist/theme/theme.js.map +1 -1
- package/docs/component/card-row.md +11 -12
- package/docs/component/card.md +4 -5
- package/docs/control/confirm-modal.md +1 -2
- package/docs/control/segmented-control.md +2 -2
- package/docs/corners.md +4 -4
- package/docs/philosophy.md +1 -1
- package/docs/theme.md +1 -0
- package/docs/tokens.md +1 -0
- package/package.json +1 -1
- package/src/component/card/index.tsx +14 -2
- package/src/component/card/style.ts +3 -1
- package/src/component/card-divider/index.tsx +15 -6
- package/src/component/card-row/index.tsx +6 -0
- package/src/component/card-row/style.ts +1 -1
- package/src/component/collapsible-section/index.tsx +8 -2
- package/src/component/empty-state/index.tsx +2 -2
- package/src/component/index.ts +10 -10
- package/src/component/meta-line/index.tsx +1 -1
- package/src/component/metadata/index.tsx +6 -1
- package/src/component/metadata-list/index.tsx +13 -2
- package/src/component/nav-desktop/index.tsx +6 -2
- package/src/component/nav-mobile/index.tsx +11 -3
- package/src/component/nav-types.ts +4 -0
- package/src/component/page/index.tsx +11 -1
- package/src/component/progress-indicator/index.tsx +4 -1
- package/src/component/tag/index.tsx +6 -3
- package/src/component/theme-setting/index.tsx +7 -0
- package/src/component/top-fade/index.tsx +8 -2
- package/src/control/action-menu-list/index.tsx +7 -0
- package/src/control/back-button/index.tsx +9 -1
- package/src/control/button/index.tsx +39 -5
- package/src/control/chips-input/index.tsx +20 -3
- package/src/control/confirm-modal/index.tsx +15 -1
- package/src/control/date-time-input/index.tsx +4 -0
- package/src/control/field-list/index.tsx +20 -1
- package/src/control/index.ts +39 -22
- package/src/control/number-input/index.tsx +12 -0
- package/src/control/page-actions-bar/index.tsx +16 -2
- package/src/control/page-actions-menu/index.tsx +6 -1
- package/src/control/page-footer-actions/index.tsx +16 -1
- package/src/control/popover/index.tsx +6 -2
- package/src/control/segmented-control/index.tsx +10 -3
- package/src/control/select/index.tsx +17 -1
- package/src/control/switch/index.tsx +17 -1
- package/src/control/switch/style.ts +1 -3
- package/src/control/text-area/index.tsx +15 -0
- package/src/control/text-input/index.tsx +25 -0
- package/src/control/use-modal-dialog/index.ts +11 -2
- package/src/theme/theme.ts +7 -0
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { Metadata as MetadataComponent } from '../metadata/index.js';
|
|
2
2
|
import { useStyle } from './style.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
type
|
|
4
|
+
/** One labelled value in a `MetadataList`. */
|
|
5
|
+
export type Metadata = {
|
|
6
|
+
/** Label, shown faint and CSS-capitalized. Keep it unique within a list (it is part of the key). */
|
|
7
|
+
title: string;
|
|
8
|
+
/** The value. Truncated with an ellipsis at `theme.size.metadataValue`; never wraps. */
|
|
9
|
+
value: string | React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type MetadataListProps = {
|
|
12
|
+
/** The pairs, in order. Every entry renders, even with an empty value: filter first. */
|
|
13
|
+
metadata: Metadata[];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** A wrapping row of small labelled values, typically a `Card` body describing one record. */
|
|
6
17
|
export const MetadataList = ({ metadata }: MetadataListProps) => {
|
|
7
18
|
const styles = useStyle();
|
|
8
19
|
const metadataElements = metadata.map(({ title, value }) => (
|
|
@@ -5,11 +5,15 @@ import type { NavItem } from '../nav-types.js';
|
|
|
5
5
|
import { useStyle } from './style.js';
|
|
6
6
|
|
|
7
7
|
export interface NavDesktopProps {
|
|
8
|
+
/** Destinations, rendered in order and keyed by `to`. Each item's `active` is yours to compute. */
|
|
8
9
|
items: NavItem[];
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Wide navigation bar pinned to the top of the viewport (desktop only). The active
|
|
14
|
+
* link is marked with a gray underline. Hidden below the mobile breakpoint.
|
|
15
|
+
* Must render inside a react-router router.
|
|
16
|
+
*/
|
|
13
17
|
export const NavDesktop = ({ items }: NavDesktopProps) => {
|
|
14
18
|
const styles = useStyle();
|
|
15
19
|
|
|
@@ -16,9 +16,12 @@ import { useStyle } from './style.js';
|
|
|
16
16
|
* instead of one bar fading out while a different one fades in.
|
|
17
17
|
*/
|
|
18
18
|
export interface NavPill {
|
|
19
|
-
/** Destinations shown while this side is expanded. */
|
|
19
|
+
/** Destinations shown while this side is expanded. `[]` makes the side permanently a circle. */
|
|
20
20
|
items: NavItem[];
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* The single destination it collapses to. Its `label` is the circle's `aria-label`; its
|
|
23
|
+
* `badge` shows only while collapsed; its `active` lights the circle.
|
|
24
|
+
*/
|
|
22
25
|
collapsed: NavItem;
|
|
23
26
|
}
|
|
24
27
|
|
|
@@ -27,7 +30,7 @@ export interface NavMobileProps {
|
|
|
27
30
|
main: NavPill;
|
|
28
31
|
/** The right-hand side: settings. */
|
|
29
32
|
settings: NavPill;
|
|
30
|
-
/** Which side is expanded; the other is a circle. */
|
|
33
|
+
/** Which side is expanded; the other is a circle. Derive it from the route. */
|
|
31
34
|
expanded: 'main' | 'settings';
|
|
32
35
|
}
|
|
33
36
|
|
|
@@ -71,6 +74,11 @@ const sameBox = (a: LensBox | null, b: LensBox | null): boolean =>
|
|
|
71
74
|
// animating — so the two never fight: a side is a circle when it is not the
|
|
72
75
|
// expanded side OR the bar is minimized. The other side's circle is left as it
|
|
73
76
|
// is, like the search button iOS keeps beside its minimized bar.
|
|
77
|
+
/**
|
|
78
|
+
* The bottom navigation on phones: two frosted pills, one expanded into tabs and one a
|
|
79
|
+
* circle; scrolling down minimizes it. Must render inside a react-router router, and every
|
|
80
|
+
* `Page` under it needs `bottomNav`.
|
|
81
|
+
*/
|
|
74
82
|
export const NavMobile = ({ main, settings, expanded }: NavMobileProps) => {
|
|
75
83
|
const styles = useStyle();
|
|
76
84
|
const { key } = useLocation();
|
|
@@ -4,9 +4,13 @@ import type { IconProps } from '../icon/index.js';
|
|
|
4
4
|
|
|
5
5
|
/** A single navigation destination, shared by the desktop and mobile layouts. */
|
|
6
6
|
export interface NavItem {
|
|
7
|
+
/** Route path passed to react-router `<Link to>`. Must be unique within a list (it is the key). */
|
|
7
8
|
to: string;
|
|
9
|
+
/** Visible text. */
|
|
8
10
|
label: string;
|
|
11
|
+
/** An icon component (`HomeIcon`), not an element. */
|
|
9
12
|
Icon: (props: IconProps) => ReactElement;
|
|
13
|
+
/** You compute this from the route; the nav does not match routes. Sets `aria-current="page"`. */
|
|
10
14
|
active: boolean;
|
|
11
15
|
/** A count of pending fixes, or `'dot'` for "active, nothing to decide yet". */
|
|
12
16
|
badge?: number | 'dot';
|
|
@@ -8,9 +8,17 @@ import { PageActionsMenu, type PageActionItem } from '../../control/page-actions
|
|
|
8
8
|
import { PageFooterActions, type FooterAction } from '../../control/page-footer-actions/index.js';
|
|
9
9
|
import { useStyle, PageType, PageTypeValue } from './style.js';
|
|
10
10
|
|
|
11
|
-
type
|
|
11
|
+
export type { PageTypeValue };
|
|
12
|
+
|
|
13
|
+
export type PageProps = PropsWithChildren<{
|
|
14
|
+
/** `'default'` (default) or `'minimal'`, which drops all layout styles and the header row. */
|
|
12
15
|
type?: PageTypeValue;
|
|
16
|
+
/** Route path for the back button. **Mobile only**: there is no back button on desktop. */
|
|
13
17
|
back?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Page-level actions. Desktop: `primary` items as buttons, the rest in a "More…" menu.
|
|
20
|
+
* Mobile: all in a floating menu.
|
|
21
|
+
*/
|
|
14
22
|
headerActions?: PageActionItem[];
|
|
15
23
|
/** Overrides the overflow trigger's label (default "More…") on the desktop
|
|
16
24
|
* action bar — e.g. "Actions" when every action lives in the menu. */
|
|
@@ -26,6 +34,7 @@ type PageProps = PropsWithChildren<{
|
|
|
26
34
|
* slot it lines up with every other page's actions instead.
|
|
27
35
|
*/
|
|
28
36
|
header?: React.ReactNode;
|
|
37
|
+
/** Sticky footer buttons. */
|
|
29
38
|
footerActions?: FooterAction[];
|
|
30
39
|
/** Sets `document.title` when given; the title is not restored on unmount. Leave it
|
|
31
40
|
* out when the app manages the title itself. */
|
|
@@ -35,6 +44,7 @@ type PageProps = PropsWithChildren<{
|
|
|
35
44
|
bottomNav?: boolean;
|
|
36
45
|
}>;
|
|
37
46
|
|
|
47
|
+
/** The `<main>` of every screen: a centred column of Cards, plus back button, header and footer actions. */
|
|
38
48
|
export const Page = ({
|
|
39
49
|
children,
|
|
40
50
|
type = PageType.default as PageTypeValue,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useStyle } from './style.js';
|
|
2
2
|
|
|
3
|
-
type ProgressIndicatorProps = {
|
|
3
|
+
export type ProgressIndicatorProps = {
|
|
4
|
+
/** A **fraction from 0 to 1**, not a percentage (`0.42` shows "42%"). Clamped to 0–1. */
|
|
4
5
|
value: number;
|
|
5
6
|
/**
|
|
6
7
|
* Required, not defaulted (2026-08-13 final review, M-1): `role=
|
|
@@ -12,6 +13,7 @@ type ProgressIndicatorProps = {
|
|
|
12
13
|
* ${title}`.
|
|
13
14
|
*/
|
|
14
15
|
ariaLabel: string;
|
|
16
|
+
/** Width and height of the SVG in px (default 40). The label's font size does not scale. */
|
|
15
17
|
size?: number;
|
|
16
18
|
};
|
|
17
19
|
|
|
@@ -28,6 +30,7 @@ const sectorPath = (pct: number): string => {
|
|
|
28
30
|
return `M ${CX} ${CY} L ${CX} ${CY - R_INNER} A ${R_INNER} ${R_INNER} 0 ${largeArc} 1 ${x} ${y} Z`;
|
|
29
31
|
};
|
|
30
32
|
|
|
33
|
+
/** A small pie-style progress mark plus a "Not started" / "N%" / "Completed" label. */
|
|
31
34
|
export const ProgressIndicator = ({ value, ariaLabel, size = 40 }: ProgressIndicatorProps) => {
|
|
32
35
|
const style = useStyle();
|
|
33
36
|
const clamped = Math.min(100, Math.max(0, value * 100));
|
|
@@ -4,15 +4,18 @@ import { type TagTone, useStyle } from './style.js';
|
|
|
4
4
|
|
|
5
5
|
export type { TagTone };
|
|
6
6
|
|
|
7
|
-
interface TagProps {
|
|
7
|
+
export interface TagProps {
|
|
8
|
+
/** The label. */
|
|
8
9
|
children: React.ReactNode;
|
|
10
|
+
/** Makes it a button (focusable, Enter/Space, pointer cursor). Receives no event. */
|
|
9
11
|
onClick?: () => void;
|
|
10
|
-
/** `sm` renders a compact chip that fits within a normal text line height. */
|
|
12
|
+
/** `sm` renders a compact chip that fits within a normal text line height. Default `'md'`. */
|
|
11
13
|
size?: 'sm' | 'md';
|
|
12
|
-
/** Colour, from the theme's `color.chip` tokens. `neutral` is a quiet grey. */
|
|
14
|
+
/** Colour, from the theme's `color.chip` tokens (default `'subject'`). `neutral` is a quiet grey. */
|
|
13
15
|
tone?: TagTone;
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
/** A small coloured chip for a category, status, or value. Optionally clickable. */
|
|
16
19
|
export const Tag = ({ children, onClick, size = 'md', tone = 'subject' }: TagProps) => {
|
|
17
20
|
const style = useStyle();
|
|
18
21
|
return (
|
|
@@ -8,6 +8,13 @@ const OPTIONS = [
|
|
|
8
8
|
{ value: 'auto', label: 'Auto' },
|
|
9
9
|
] as const;
|
|
10
10
|
|
|
11
|
+
/** ThemeSetting takes no props. */
|
|
12
|
+
export type ThemeSettingProps = Record<string, never>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A ready-made "Appearance" `Card` with a Light / Dark / Auto switch bound to the theme. Takes no
|
|
16
|
+
* props; does nothing without a `ThemeProvider` above it.
|
|
17
|
+
*/
|
|
11
18
|
export const ThemeSetting = () => {
|
|
12
19
|
const [setting, setSetting] = useThemeSetting();
|
|
13
20
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { useStyle } from './style.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/** TopFade takes no props. */
|
|
4
|
+
export type TopFadeProps = Record<string, never>;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Mobile-only scrim: a fixed frosted-glass layer at the top of the viewport that blurs
|
|
8
|
+
* scrolling content beneath the device status bar and fades out below it (Safari-style).
|
|
9
|
+
* Takes no props. Render once, only in the installed app (`isStandalone()`).
|
|
10
|
+
*/
|
|
5
11
|
export const TopFade = () => {
|
|
6
12
|
const styles = useStyle();
|
|
7
13
|
return <div className={styles.root} aria-hidden="true" />;
|
|
@@ -22,12 +22,19 @@ export interface PageActionIntentProps {
|
|
|
22
22
|
onTouchStart: () => void;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/** One page action, shared by `PageActionsBar` and `PageActionsMenu`. */
|
|
25
26
|
export interface PageActionItem {
|
|
27
|
+
/** Button or menu text. Must be unique: it is the React key. */
|
|
26
28
|
label: string;
|
|
29
|
+
/** Receives no event. In a menu, the menu closes first. */
|
|
27
30
|
onClick: () => void;
|
|
31
|
+
/** Red text or treatment. Styling only; it does not add a separator. */
|
|
28
32
|
danger?: boolean;
|
|
33
|
+
/** Greys the item out and blocks selection. */
|
|
29
34
|
disabled?: boolean;
|
|
35
|
+
/** `PageActionsBar` only: render as an inline Button instead of in the overflow menu. */
|
|
30
36
|
primary?: boolean;
|
|
37
|
+
/** `PageActionsBar` primary items only: side of the bar; anything but `'leading'` is trailing. */
|
|
31
38
|
align?: 'leading' | 'trailing';
|
|
32
39
|
/** Fires ahead of `onClick`, on intent to click — see
|
|
33
40
|
* `PageActionIntentProps`. Used to prefetch what selecting this item is
|
|
@@ -4,10 +4,18 @@ import { useNavigate } from 'react-router';
|
|
|
4
4
|
import { ChevronIcon } from '../../icon/index.js';
|
|
5
5
|
import { useStyle } from './style.js';
|
|
6
6
|
|
|
7
|
-
interface BackButtonProps {
|
|
7
|
+
export interface BackButtonProps {
|
|
8
|
+
/**
|
|
9
|
+
* Path to navigate to. Pushes a new history entry (it does not go back in
|
|
10
|
+
* history), asking the destination to restore its scroll position.
|
|
11
|
+
*/
|
|
8
12
|
to: string;
|
|
9
13
|
}
|
|
10
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Round glass "Back" button that navigates to `to`. Mobile-only (hidden at
|
|
17
|
+
* 641px and up); needs a react-router router. Prefer `Page back="…"`.
|
|
18
|
+
*/
|
|
11
19
|
export function BackButton({ to }: BackButtonProps) {
|
|
12
20
|
const styles = useStyle();
|
|
13
21
|
const navigate = useNavigate();
|
|
@@ -6,10 +6,18 @@ import { IconProps, SpinnerIcon } from '../../icon/index.js';
|
|
|
6
6
|
import { ButtonType, ButtonTypeValue, ButtonRadius, ButtonRadiusValue, useStyle } from './style.js';
|
|
7
7
|
|
|
8
8
|
type ButtonVariant =
|
|
9
|
-
| {
|
|
10
|
-
|
|
9
|
+
| {
|
|
10
|
+
/** Red treatment for destructive actions. Mutually exclusive with `success`. */
|
|
11
|
+
danger?: boolean;
|
|
12
|
+
success?: false | undefined;
|
|
13
|
+
}
|
|
14
|
+
| {
|
|
15
|
+
/** Green treatment. Mutually exclusive with `danger`. */
|
|
16
|
+
success?: boolean;
|
|
17
|
+
danger?: false | undefined;
|
|
18
|
+
};
|
|
11
19
|
|
|
12
|
-
type ButtonProps = React.PropsWithChildren<
|
|
20
|
+
export type ButtonProps = React.PropsWithChildren<
|
|
13
21
|
{
|
|
14
22
|
/**
|
|
15
23
|
* Accessible name when the visible children are not distinguishing enough
|
|
@@ -19,23 +27,49 @@ type ButtonProps = React.PropsWithChildren<
|
|
|
19
27
|
ariaLabel?: string;
|
|
20
28
|
/** For a disclosure button: the state of what it controls, and its id. */
|
|
21
29
|
ariaExpanded?: boolean;
|
|
30
|
+
/** For a disclosure button: the id of the element it controls. */
|
|
22
31
|
ariaControls?: string;
|
|
32
|
+
/** Extra class; win specificity with `'&&'` in your sheet, never `!important`. */
|
|
23
33
|
className?: string;
|
|
34
|
+
/** Greys the button out and blocks clicks. */
|
|
24
35
|
disabled?: boolean;
|
|
36
|
+
/** Id of the `<form>` to submit, for a `submit` button outside its form. */
|
|
25
37
|
form?: string;
|
|
38
|
+
/** Shows a spinner in place of the icons and blocks clicks. */
|
|
26
39
|
loading?: boolean;
|
|
27
|
-
|
|
28
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Applies to the default (div) mode only. In submit mode it is ignored:
|
|
42
|
+
* native form submission (driven by the associated <form>) fires instead.
|
|
43
|
+
* Receives no event.
|
|
44
|
+
*/
|
|
29
45
|
onClick?: () => void;
|
|
46
|
+
/** Icon component shown before the label (`prefix={SearchIcon}`), not an element. */
|
|
30
47
|
prefix?: ComponentType<IconProps>;
|
|
48
|
+
/** The surface the button sits on: `'background'` (default), `'card'`, `'inset'`, `'modal'`. */
|
|
31
49
|
radius?: ButtonRadiusValue;
|
|
50
|
+
/**
|
|
51
|
+
* Render a native `<button type="submit">`; also spins while the enclosing
|
|
52
|
+
* form action is pending. `onClick` is then ignored.
|
|
53
|
+
*/
|
|
32
54
|
submit?: boolean;
|
|
55
|
+
/** Icon component shown after the label (`suffix={ChevronIcon}`), not an element. */
|
|
33
56
|
suffix?: ComponentType<IconProps>;
|
|
57
|
+
/** Passed through; forced to -1 while disabled or loading (div mode). */
|
|
34
58
|
tabIndex?: number;
|
|
59
|
+
/** Native tooltip; passed through. */
|
|
35
60
|
title?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Visual variant (`'default'`, `'primary'`, `'text'`, `'link'`, `'dashed'`),
|
|
63
|
+
* not the HTML `type`. Use `submit` for a submit button.
|
|
64
|
+
*/
|
|
36
65
|
type?: ButtonTypeValue;
|
|
37
66
|
} & ButtonVariant
|
|
38
67
|
>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Clickable action with a visual variant, optional icons, and a loading state.
|
|
71
|
+
* Renders a `<div role="button">`, or a native submit `<button>` when `submit` is set.
|
|
72
|
+
*/
|
|
39
73
|
export const Button = ({
|
|
40
74
|
ariaLabel,
|
|
41
75
|
ariaExpanded,
|
|
@@ -6,25 +6,42 @@ import type { Theme } from '../../theme/index.js';
|
|
|
6
6
|
import { Popover } from '../popover/index.js';
|
|
7
7
|
import { useStyle } from './style.js';
|
|
8
8
|
|
|
9
|
+
/** A chip colour family: a key of `theme.color.chip` (`'subject'`, `'user'`, `'neutral'`, …). */
|
|
9
10
|
export type ChipColor = keyof Theme['color']['chip'];
|
|
10
11
|
|
|
11
12
|
export type ChipsInputProps = {
|
|
13
|
+
/** The chips. Controlled: you own the array. */
|
|
12
14
|
value: string[];
|
|
15
|
+
/** Suggestion pool (pass `[]` for none); chosen values are hidden, matching is case-insensitive substring. */
|
|
13
16
|
suggestions: string[];
|
|
17
|
+
/** Receives the whole new array, not an event. */
|
|
14
18
|
onChange: (values: string[]) => void;
|
|
19
|
+
/** Shown only while there are no chips. */
|
|
15
20
|
placeholder?: string;
|
|
21
|
+
/** Enter or Tab adds the typed text as a chip (default `true`); `false` allows suggestions only. */
|
|
16
22
|
allowCustom?: boolean;
|
|
23
|
+
/** Disables typing and the chip remove buttons. */
|
|
17
24
|
disabled?: boolean;
|
|
25
|
+
/** Field label. Ignored in the default `block` layout; set `layout` to show it. */
|
|
18
26
|
label?: string;
|
|
27
|
+
/** `'block'` (default) is the bare box with no label; `'horizontal'`/`'vertical'` add the label row. */
|
|
19
28
|
layout?: 'horizontal' | 'vertical' | 'block';
|
|
29
|
+
/** Set on the text input only: form data gets the half-typed text, not the chips. */
|
|
20
30
|
name?: string;
|
|
31
|
+
/** Chip colour family from `theme.color.chip`. Default `'subject'`. */
|
|
21
32
|
chipColor?: ChipColor;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Matches the control's height to a standard form input (removes the roomier
|
|
35
|
+
* min-height and slims the chips). Used when the field sits inline with other
|
|
36
|
+
* inputs, e.g. the device form; the book-edit Subjects field leaves it off.
|
|
37
|
+
*/
|
|
25
38
|
dense?: boolean;
|
|
26
39
|
};
|
|
27
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Controlled tag field: chips inside an input box with a filtered suggestion
|
|
43
|
+
* dropdown. Enter adds a chip; Backspace on an empty field removes the last.
|
|
44
|
+
*/
|
|
28
45
|
export const ChipsInput = ({
|
|
29
46
|
value,
|
|
30
47
|
suggestions,
|
|
@@ -5,19 +5,33 @@ import { Button } from '../button/index.js';
|
|
|
5
5
|
import { useModalDialog } from '../use-modal-dialog/index.js';
|
|
6
6
|
import { useStyle } from './style.js';
|
|
7
7
|
|
|
8
|
-
type ConfirmModalProps = PropsWithChildren<{
|
|
8
|
+
export type ConfirmModalProps = PropsWithChildren<{
|
|
9
|
+
/** Cancel button label. Default `'Cancel'`. */
|
|
9
10
|
cancelText?: string;
|
|
11
|
+
/** Disables only the Confirm button (e.g. until a checkbox is ticked). */
|
|
10
12
|
confirmDisabled?: boolean;
|
|
13
|
+
/** Confirm button label. Default `'Confirm'`. */
|
|
11
14
|
confirmText?: string;
|
|
15
|
+
/** Red Confirm button; also tints `icon` red. */
|
|
12
16
|
danger?: boolean;
|
|
17
|
+
/** Icon component shown before the title (`icon={AlertOctagonIcon}`), not an element. */
|
|
13
18
|
icon?: React.ComponentType<IconProps>;
|
|
19
|
+
/** Controls visibility. Keep the modal mounted and toggle this. */
|
|
14
20
|
isOpen?: boolean;
|
|
21
|
+
/** Spinner on Confirm; disables both buttons and blocks Escape and backdrop dismissal. */
|
|
15
22
|
loading?: boolean;
|
|
23
|
+
/** Called by Cancel, Escape, and a backdrop click; receives no event. Close the modal here. */
|
|
16
24
|
onCancel?: () => void;
|
|
25
|
+
/** Receives no event and does not close the modal: set `isOpen` to `false` yourself. */
|
|
17
26
|
onConfirm?: () => void;
|
|
27
|
+
/** Header text. Default `'Confirm action'`. */
|
|
18
28
|
title?: string;
|
|
19
29
|
}>;
|
|
20
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Ready-made yes/no modal on a native `<dialog>`: title, body (`children`),
|
|
33
|
+
* Cancel and Confirm. Always mounted; controlled by `isOpen`.
|
|
34
|
+
*/
|
|
21
35
|
export function ConfirmModal({
|
|
22
36
|
cancelText = 'Cancel',
|
|
23
37
|
children,
|
|
@@ -5,9 +5,13 @@ import { composeIsoDate, splitIsoDate } from './iso-date.js';
|
|
|
5
5
|
import { useStyle } from './style.js';
|
|
6
6
|
|
|
7
7
|
export type DateTimeInputProps = {
|
|
8
|
+
/** Linked to the date input; the time input is labelled `${label} time` (or `Time`). */
|
|
8
9
|
label?: string;
|
|
10
|
+
/** Default `'horizontal'`; `horizontal`/`vertical` paint a card-header row. */
|
|
9
11
|
layout?: 'horizontal' | 'vertical' | 'inline';
|
|
12
|
+
/** The date input's `name`; the time input is `${name}Time`. Form data holds two fields, not the composed value. */
|
|
10
13
|
name: string;
|
|
14
|
+
/** Receives the recomposed ISO string (time in UTC), or `undefined` when the date is cleared; not an event. */
|
|
11
15
|
onChange?: (newValue: string | undefined) => void;
|
|
12
16
|
/**
|
|
13
17
|
* An ISO 8601 date string as the server stores it: a bare date, a
|
|
@@ -4,22 +4,41 @@ import { NumberInput } from '../number-input/index.js';
|
|
|
4
4
|
import { TextInput } from '../text-input/index.js';
|
|
5
5
|
import { useStyle } from './style.js';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* One column of a `FieldList`: a `TextInput` (`'text'`) or `NumberInput`
|
|
9
|
+
* (`'number'`) per row, keyed by `key`. `validate` receives the raw text.
|
|
10
|
+
*/
|
|
7
11
|
export type ColumnDescriptor =
|
|
8
12
|
| { type: 'text'; key: string; placeholder?: string; validate?: (v: string) => boolean }
|
|
9
13
|
| { type: 'number'; key: string; placeholder?: string; validate?: (v: string) => boolean };
|
|
10
14
|
|
|
15
|
+
/** A `FieldList` row: a stable unique `_key` plus one value per column key. */
|
|
11
16
|
export type FieldRow = { _key: string } & Record<string, string | number | undefined>;
|
|
12
17
|
|
|
13
|
-
type FieldListProps = {
|
|
18
|
+
export type FieldListProps = {
|
|
19
|
+
/** Text of the dashed add button ("Add identifier"). */
|
|
14
20
|
addLabel: string;
|
|
21
|
+
/** One input per column per row; inputs have no labels, so use `placeholder`. */
|
|
15
22
|
columns: ColumnDescriptor[];
|
|
23
|
+
/** Append a row with a fresh `_key`. Receives no event. */
|
|
16
24
|
onAdd: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* `string` from a text column, `number` from a number column, `undefined`
|
|
27
|
+
* when emptied. Not called while that field's `validate` fails.
|
|
28
|
+
*/
|
|
17
29
|
onChange: (rowKey: string, fieldKey: string, newValue: string | number | undefined) => void;
|
|
30
|
+
/** Remove the row with this `_key`. */
|
|
18
31
|
onRemove: (rowKey: string) => void;
|
|
32
|
+
/** `fieldName` is `${rowKey}.${columnKey}`. Fires only when validity flips. */
|
|
19
33
|
onValidChange?: (fieldName: string, isValid: boolean) => void;
|
|
34
|
+
/** `_key` must be stable and unique: it is the React key and part of each input's `name`. */
|
|
20
35
|
rows: FieldRow[];
|
|
21
36
|
};
|
|
22
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Editable list of rows, each a set of text/number inputs with a remove button,
|
|
40
|
+
* plus a dashed add button. Belongs in a `Card` body (add button is `radius="card"`).
|
|
41
|
+
*/
|
|
23
42
|
export const FieldList = ({
|
|
24
43
|
addLabel,
|
|
25
44
|
columns,
|
package/src/control/index.ts
CHANGED
|
@@ -1,23 +1,40 @@
|
|
|
1
|
-
export { BackButton } from './back-button/index.js';
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
export { BackButton, type BackButtonProps } from './back-button/index.js';
|
|
2
|
+
export {
|
|
3
|
+
Button,
|
|
4
|
+
type ButtonProps,
|
|
5
|
+
type ButtonRadiusValue,
|
|
6
|
+
type ButtonTypeValue,
|
|
7
|
+
} from './button/index.js';
|
|
8
|
+
export { ChipsInput, type ChipColor, type ChipsInputProps } from './chips-input/index.js';
|
|
9
|
+
export { ConfirmModal, type ConfirmModalProps } from './confirm-modal/index.js';
|
|
10
|
+
export { DateTimeInput, type DateTimeInputProps } from './date-time-input/index.js';
|
|
11
|
+
export {
|
|
12
|
+
FieldList,
|
|
13
|
+
type ColumnDescriptor,
|
|
14
|
+
type FieldListProps,
|
|
15
|
+
type FieldRow,
|
|
16
|
+
} from './field-list/index.js';
|
|
17
|
+
export { NumberInput, type NumberInputProps } from './number-input/index.js';
|
|
18
|
+
export { PageActionsBar, type PageActionsBarProps } from './page-actions-bar/index.js';
|
|
19
|
+
export {
|
|
20
|
+
PageActionsMenu,
|
|
21
|
+
type PageActionIntentProps,
|
|
22
|
+
type PageActionItem,
|
|
23
|
+
type PageActionsMenuProps,
|
|
24
|
+
} from './page-actions-menu/index.js';
|
|
25
|
+
export {
|
|
26
|
+
PageFooterActions,
|
|
27
|
+
type FooterAction,
|
|
28
|
+
type PageFooterActionsProps,
|
|
29
|
+
} from './page-footer-actions/index.js';
|
|
30
|
+
export { Popover, type PopoverProps } from './popover/index.js';
|
|
31
|
+
export { Select, type SelectOption, type SelectProps } from './select/index.js';
|
|
32
|
+
export {
|
|
33
|
+
SegmentedControl,
|
|
34
|
+
type SegmentedControlProps,
|
|
35
|
+
type SegmentedOption,
|
|
36
|
+
} from './segmented-control/index.js';
|
|
37
|
+
export { Switch, type SwitchProps, type SwitchRadiusValue } from './switch/index.js';
|
|
38
|
+
export { TextArea, type TextAreaProps } from './text-area/index.js';
|
|
39
|
+
export { TextInput, type TextInputAction, type TextInputProps } from './text-input/index.js';
|
|
17
40
|
export { useModalDialog } from './use-modal-dialog/index.js';
|
|
18
|
-
|
|
19
|
-
export type { DateTimeInputProps } from './date-time-input/index.js';
|
|
20
|
-
export type { ColumnDescriptor, FieldRow } from './field-list/index.js';
|
|
21
|
-
export type { FooterAction } from './page-footer-actions/index.js';
|
|
22
|
-
export type { PageActionIntentProps, PageActionItem } from './page-actions-menu/index.js';
|
|
23
|
-
export type { SelectOption, SelectProps } from './select/index.js';
|
|
@@ -5,16 +5,28 @@ import { isNumeric } from '../../utils.js';
|
|
|
5
5
|
import { useStyle } from './style.js';
|
|
6
6
|
|
|
7
7
|
export type NumberInputProps = {
|
|
8
|
+
/** Required key: pass `label={undefined}` for none. Not linked to the input (no `htmlFor`). */
|
|
8
9
|
label: string | undefined;
|
|
10
|
+
/** Default `'horizontal'`; `horizontal`/`vertical` paint a card-header row. */
|
|
9
11
|
layout?: 'horizontal' | 'vertical' | 'inline';
|
|
12
|
+
/** The input's `name` and the key passed to `onValidChange`. */
|
|
10
13
|
name: string;
|
|
14
|
+
/** Receives `parseFloat(text)`, or `undefined` when emptied; not called while `validate` fails. */
|
|
11
15
|
onChange?: (newValue: number | undefined) => void;
|
|
16
|
+
/** Called with `name` and the new validity; fires only when validity flips. */
|
|
12
17
|
onValidChange?: (fieldName: string, newValid: boolean) => void;
|
|
18
|
+
/** Placeholder text for the input. */
|
|
13
19
|
placeholder?: string;
|
|
20
|
+
/** Receives the raw text. Replacing it drops the default empty-or-numeric check, so include one. */
|
|
14
21
|
validate?: (newValue: string) => boolean;
|
|
22
|
+
/** Current number. Re-syncs into the field only when the prop changes. */
|
|
15
23
|
value: number | undefined;
|
|
16
24
|
};
|
|
17
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Text field that reports a number: a plain `<input>` (no `type="number"`)
|
|
28
|
+
* that calls `onChange` with the parsed value while the text validates.
|
|
29
|
+
*/
|
|
18
30
|
export const NumberInput = ({
|
|
19
31
|
label,
|
|
20
32
|
layout = 'horizontal',
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { useCallback, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
ActionMenuList,
|
|
5
|
+
type PageActionIntentProps,
|
|
6
|
+
type PageActionItem,
|
|
7
|
+
} from '../action-menu-list/index.js';
|
|
4
8
|
import { useDismiss } from '../action-menu-list/use-dismiss.js';
|
|
5
9
|
import { Button } from '../button/index.js';
|
|
6
10
|
import { useStyle } from './style.js';
|
|
7
11
|
|
|
8
|
-
|
|
12
|
+
export type { PageActionIntentProps, PageActionItem };
|
|
13
|
+
|
|
14
|
+
export interface PageActionsBarProps {
|
|
15
|
+
/**
|
|
16
|
+
* `primary` items render as inline Buttons (`align: 'leading'` on the left),
|
|
17
|
+
* the rest in the overflow menu. Labels must be unique.
|
|
18
|
+
*/
|
|
9
19
|
items: PageActionItem[];
|
|
10
20
|
/** Visible label (and accessible name) for the overflow trigger. Defaults to
|
|
11
21
|
* "More…" — pass e.g. "Actions" on a page whose whole action set lives in the
|
|
@@ -13,6 +23,10 @@ interface PageActionsBarProps {
|
|
|
13
23
|
actionsLabel?: string;
|
|
14
24
|
}
|
|
15
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Desktop page-header action row: primary items as inline Buttons, the rest
|
|
28
|
+
* behind a "More…" overflow menu. Usually rendered by `Page headerActions`.
|
|
29
|
+
*/
|
|
16
30
|
export function PageActionsBar({ items, actionsLabel }: PageActionsBarProps) {
|
|
17
31
|
const styles = useStyle();
|
|
18
32
|
const [open, setOpen] = useState(false);
|
|
@@ -11,10 +11,15 @@ import { useStyle } from './style.js';
|
|
|
11
11
|
|
|
12
12
|
export type { PageActionIntentProps, PageActionItem };
|
|
13
13
|
|
|
14
|
-
interface PageActionsMenuProps {
|
|
14
|
+
export interface PageActionsMenuProps {
|
|
15
|
+
/** All items appear in the menu, in order; `primary` and `align` are ignored here. Labels must be unique. */
|
|
15
16
|
items: PageActionItem[];
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Mobile page-header "More actions" button that opens a glass menu of
|
|
21
|
+
* `items`. Usually rendered by `Page headerActions`.
|
|
22
|
+
*/
|
|
18
23
|
export function PageActionsMenu({ items }: PageActionsMenuProps) {
|
|
19
24
|
const styles = useStyle();
|
|
20
25
|
const [open, setOpen] = useState(false);
|
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import { Button } from '../button/index.js';
|
|
2
2
|
import { useStyle } from './style.js';
|
|
3
3
|
|
|
4
|
+
/** One button in a `PageFooterActions` row. */
|
|
4
5
|
export interface FooterAction {
|
|
6
|
+
/** Button text; may change between renders (`Save` → `Saving…`) without remounting. */
|
|
5
7
|
label: string;
|
|
8
|
+
/** Required even for a `submit` item, and ignored there (pass `() => {}`). Receives no event. */
|
|
6
9
|
onClick: () => void;
|
|
10
|
+
/** Greys the button out and blocks clicks. */
|
|
7
11
|
disabled?: boolean;
|
|
12
|
+
/** Spinner; blocks clicks. */
|
|
8
13
|
loading?: boolean;
|
|
14
|
+
/** Red treatment. */
|
|
9
15
|
danger?: boolean;
|
|
16
|
+
/** Renders `type="primary"`; otherwise `type="default"`. */
|
|
10
17
|
emphasis?: boolean;
|
|
18
|
+
/** Side of the row; default `'trailing'`. */
|
|
11
19
|
align?: 'leading' | 'trailing';
|
|
20
|
+
/** Render a native submit button (`onClick` is then ignored). */
|
|
12
21
|
submit?: boolean;
|
|
22
|
+
/** Id of the `<form>` to submit; needed because the row sits outside the form. */
|
|
13
23
|
form?: string;
|
|
14
24
|
}
|
|
15
25
|
|
|
16
|
-
interface PageFooterActionsProps {
|
|
26
|
+
export interface PageFooterActionsProps {
|
|
27
|
+
/** Rendered in order within each side (leading, then trailing). */
|
|
17
28
|
items: FooterAction[];
|
|
18
29
|
}
|
|
19
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Row of page-level buttons below the cards, split into leading and trailing
|
|
33
|
+
* sides. Sits on the page background; don't put it inside a `Card`.
|
|
34
|
+
*/
|
|
20
35
|
export function PageFooterActions({ items }: PageFooterActionsProps) {
|
|
21
36
|
const styles = useStyle();
|
|
22
37
|
const leading = items.filter((item) => item.align === 'leading');
|