@gtivr4/a1-design-system-react 0.4.1 → 0.6.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/package.json +2 -1
- package/src/components/accordion/Accordion.d.ts +20 -0
- package/src/components/banner/Banner.d.ts +19 -0
- package/src/components/bleed/Bleed.d.ts +17 -0
- package/src/components/blockquote/Blockquote.d.ts +23 -0
- package/src/components/breadcrumb/Breadcrumb.d.ts +22 -0
- package/src/components/button/Button.d.ts +17 -0
- package/src/components/button-container/ButtonContainer.d.ts +11 -0
- package/src/components/calendar/Calendar.d.ts +75 -0
- package/src/components/card/Card.d.ts +31 -0
- package/src/components/checkbox-group/CheckboxGroup.d.ts +37 -0
- package/src/components/choice-group/ChoiceGroup.d.ts +68 -0
- package/src/components/circular-progress/CircularProgress.d.ts +37 -0
- package/src/components/circular-progress/CircularProgress.jsx +85 -0
- package/src/components/circular-progress/circular-progress.css +104 -0
- package/src/components/cluster/Cluster.d.ts +21 -0
- package/src/components/code/Code.d.ts +15 -0
- package/src/components/data-table/DataTable.d.ts +83 -0
- package/src/components/definition-list/DefinitionList.d.ts +51 -0
- package/src/components/definition-list/DefinitionList.jsx +154 -0
- package/src/components/definition-list/definition-list.css +111 -0
- package/src/components/dialog/Dialog.d.ts +22 -0
- package/src/components/dialog/Dialog.jsx +57 -11
- package/src/components/dialog/dialog.css +36 -3
- package/src/components/divider/Divider.d.ts +22 -0
- package/src/components/field/SelectField.d.ts +22 -0
- package/src/components/field/TextField.d.ts +21 -0
- package/src/components/field/TextareaField.d.ts +28 -0
- package/src/components/field-row/FieldRow.d.ts +8 -0
- package/src/components/fieldset/Fieldset.d.ts +27 -0
- package/src/components/figure/Figure.d.ts +39 -0
- package/src/components/grid/Grid.d.ts +38 -0
- package/src/components/heading/Heading.d.ts +43 -0
- package/src/components/heading/Heading.jsx +2 -2
- package/src/components/icon/Icon.d.ts +35 -0
- package/src/components/icon/Icon.jsx +32 -3
- package/src/components/icon/icon.css +21 -1
- package/src/components/icon-button/IconButton.d.ts +14 -0
- package/src/components/inset/Inset.d.ts +17 -0
- package/src/components/inverse/Inverse.d.ts +9 -0
- package/src/components/link/Link.d.ts +15 -0
- package/src/components/list/List.d.ts +40 -0
- package/src/components/menu/Menu.d.ts +41 -0
- package/src/components/message/Message.d.ts +34 -0
- package/src/components/notification/Notification.d.ts +23 -0
- package/src/components/page-layout/PageLayout.d.ts +24 -0
- package/src/components/page-nav/PageNav.d.ts +19 -0
- package/src/components/pagination/Pagination.d.ts +19 -0
- package/src/components/paragraph/Paragraph.d.ts +23 -0
- package/src/components/radio-group/RadioGroup.d.ts +37 -0
- package/src/components/section/Section.d.ts +33 -0
- package/src/components/segmented-control/SegmentedControl.d.ts +23 -0
- package/src/components/side-nav/SideNav.d.ts +62 -0
- package/src/components/spacer/Spacer.d.ts +16 -0
- package/src/components/stack/Stack.d.ts +38 -0
- package/src/components/status-bar/StatusBar.d.ts +42 -0
- package/src/components/switch/Switch.d.ts +27 -0
- package/src/components/system-banner/SystemBanner.d.ts +17 -0
- package/src/components/tabs/Tabs.d.ts +53 -0
- package/src/index.js +2 -0
- package/src/tokens.css +22 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface FieldRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Lays out multiple field components side by side in a single row. */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare function FieldRow(props: FieldRowProps): React.ReactElement;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface FieldsetProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
4
|
+
/** `<legend>` text for the field group */
|
|
5
|
+
legend?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Size density applied to all child fields via context.
|
|
8
|
+
* Individual fields can override this.
|
|
9
|
+
*/
|
|
10
|
+
size?: "comfortable" | "default" | "compact";
|
|
11
|
+
/**
|
|
12
|
+
* Label position applied to all child fields via context.
|
|
13
|
+
* Individual fields can override this.
|
|
14
|
+
*/
|
|
15
|
+
labelPosition?: "above" | "before";
|
|
16
|
+
/**
|
|
17
|
+
* Show a "* Required field" note below the legend.
|
|
18
|
+
* Only shown for "default" and "compact" sizes (comfortable fields show inline badges).
|
|
19
|
+
* Default: false
|
|
20
|
+
*/
|
|
21
|
+
markRequired?: boolean;
|
|
22
|
+
/** Add a subtle surface background to the fieldset. Default: false */
|
|
23
|
+
surface?: boolean;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare function Fieldset(props: FieldsetProps): React.ReactElement;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type SpacingToken = 1 | 2 | 4 | 6 | 8 | 12 | 16 | 20 | 24 | 32 | 40 | 64 | 96 | 128;
|
|
4
|
+
|
|
5
|
+
export interface FigureProps extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
+
/** Image source URL */
|
|
7
|
+
src: string;
|
|
8
|
+
/** Image alt text. Pass "" for decorative images. */
|
|
9
|
+
alt?: string;
|
|
10
|
+
/** Caption text or React node rendered as `<figcaption>` */
|
|
11
|
+
caption?: React.ReactNode;
|
|
12
|
+
/** Render caption visually hidden (screen-reader only). Default: false */
|
|
13
|
+
captionSrOnly?: boolean;
|
|
14
|
+
/** Caption alignment. Default: "start" */
|
|
15
|
+
captionPosition?: "start" | "center";
|
|
16
|
+
/** Border radius on the image. */
|
|
17
|
+
radius?: "none" | "sm" | "md" | "lg";
|
|
18
|
+
/** Constrain figure width. */
|
|
19
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
20
|
+
/** Horizontal alignment of the figure. Default: "start" */
|
|
21
|
+
align?: "start" | "center" | "end";
|
|
22
|
+
/** Top margin. */
|
|
23
|
+
marginTop?: "sm" | "md" | "lg";
|
|
24
|
+
/** Bottom margin. */
|
|
25
|
+
marginBottom?: "sm" | "md" | "lg";
|
|
26
|
+
/**
|
|
27
|
+
* Pull the figure outside its container padding using `Bleed`.
|
|
28
|
+
* Pass `true` for symmetric bleed or a numeric spacing token for inline-only.
|
|
29
|
+
*/
|
|
30
|
+
bleed?: boolean | SpacingToken;
|
|
31
|
+
/** Extra class names on the `<figure>` element */
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Extra class names on the `<img>` element */
|
|
34
|
+
imgClassName?: string;
|
|
35
|
+
/** Inline styles for the `<img>` element */
|
|
36
|
+
imgStyle?: React.CSSProperties;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare function Figure(props: FigureProps): React.ReactElement;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type Breakpoints = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
type GapKey = "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | 1 | 2 | 4 | 6 | 8 | 12 | 16 | 20 | 24 | 32 | 40 | 64 | 96 | 128;
|
|
5
|
+
type ColSpan = number | "full";
|
|
6
|
+
|
|
7
|
+
export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Number of columns. Pass a number for a fixed count, or a responsive object.
|
|
10
|
+
* @example columns={{ xs: 1, md: 2, lg: 3 }}
|
|
11
|
+
*/
|
|
12
|
+
columns?: number | Partial<Record<Breakpoints, number>>;
|
|
13
|
+
/** Gap applied to both row and column. Semantic token ("sm"–"xxl") or numeric spacing value. */
|
|
14
|
+
gap?: GapKey;
|
|
15
|
+
/** Row gap override. Falls back to `gap`. */
|
|
16
|
+
rowGap?: GapKey;
|
|
17
|
+
/** Column gap override. Falls back to `gap`. */
|
|
18
|
+
columnGap?: GapKey;
|
|
19
|
+
/** Grid layout preset. Default: "default" */
|
|
20
|
+
layout?: "default" | "bento";
|
|
21
|
+
/** CSS value for `grid-auto-rows` */
|
|
22
|
+
autoRows?: string;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface GridItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
27
|
+
/**
|
|
28
|
+
* Column span. Pass a number, "full", or a responsive object.
|
|
29
|
+
* @example span={{ xs: "full", md: 2 }}
|
|
30
|
+
*/
|
|
31
|
+
span?: ColSpan | Partial<Record<Breakpoints, ColSpan>>;
|
|
32
|
+
/** Row span. Pass a number or a responsive object. */
|
|
33
|
+
rowSpan?: number | Partial<Record<Breakpoints, number>>;
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare function Grid(props: GridProps): React.ReactElement;
|
|
38
|
+
export declare function GridItem(props: GridItemProps): React.ReactElement;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type Breakpoints = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
type HeadingSize = "xxl" | "xl" | "lg" | "md" | "sm" | "xs";
|
|
5
|
+
type DisplaySize = "sm" | "md" | "lg" | "xl" | "xxl" | "jumbo" | "xJumbo";
|
|
6
|
+
|
|
7
|
+
export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
8
|
+
/** HTML heading level. Default: "h2" */
|
|
9
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span";
|
|
10
|
+
/**
|
|
11
|
+
* Typography type — drives the available size scale.
|
|
12
|
+
* "heading" uses the text hierarchy scale; "display" uses the larger editorial scale.
|
|
13
|
+
* Default: "heading"
|
|
14
|
+
*/
|
|
15
|
+
type?: "heading" | "display";
|
|
16
|
+
/**
|
|
17
|
+
* Size within the active type scale. Responsive object syntax supported.
|
|
18
|
+
* Heading sizes: xs | sm | md | lg | xl | xxl
|
|
19
|
+
* Display sizes: sm | md | lg | xl | xxl | jumbo | xJumbo
|
|
20
|
+
* @example size={{ xs: "lg", md: "xl" }}
|
|
21
|
+
*/
|
|
22
|
+
size?: HeadingSize | DisplaySize | Partial<Record<Breakpoints, HeadingSize | DisplaySize>>;
|
|
23
|
+
/** Text colour. Default: "default" */
|
|
24
|
+
color?: "default" | "muted" | "accent";
|
|
25
|
+
/** Add bottom margin. Useful when followed by body text. */
|
|
26
|
+
margin?: "sm" | "md" | "lg";
|
|
27
|
+
/** Apply text-wrap. "balance" distributes line lengths evenly — best for short headings. */
|
|
28
|
+
textWrap?: "balance";
|
|
29
|
+
/** Horizontal text alignment. "start"/"end" are logical aliases for LTR/RTL-safe alignment. */
|
|
30
|
+
align?: "left" | "center" | "right" | "start" | "end";
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface HeadingMarkProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
35
|
+
/** Visual decoration style. Default: "highlight" */
|
|
36
|
+
variant?: "highlight" | "underline";
|
|
37
|
+
/** Underline style (only applies when variant="underline"). Default: "swoop" */
|
|
38
|
+
underlineStyle?: "swoop" | "wave" | "sketch";
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export declare function Heading(props: HeadingProps): React.ReactElement;
|
|
43
|
+
export declare function HeadingMark(props: HeadingMarkProps): React.ReactElement;
|
|
@@ -4,7 +4,7 @@ const headingSizes = ["xxl", "xl", "lg", "md", "sm", "xs"];
|
|
|
4
4
|
const displaySizes = ["sm", "md", "lg", "xl", "xxl", "jumbo", "xJumbo"];
|
|
5
5
|
const colors = ["default", "muted", "accent"];
|
|
6
6
|
const margins = ["sm", "md", "lg"];
|
|
7
|
-
const
|
|
7
|
+
const elements = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "span"];
|
|
8
8
|
const breakpoints = ["xs", "sm", "md", "lg", "xl"];
|
|
9
9
|
const textWraps = ["balance"];
|
|
10
10
|
const aligns = ["left", "center", "right", "start", "end"];
|
|
@@ -50,7 +50,7 @@ export function Heading({
|
|
|
50
50
|
style,
|
|
51
51
|
...props
|
|
52
52
|
}) {
|
|
53
|
-
const resolvedAs =
|
|
53
|
+
const resolvedAs = elements.includes(Component) ? Component : "h2";
|
|
54
54
|
const isDisplay = type === "display";
|
|
55
55
|
const validSizes = isDisplay ? displaySizes : headingSizes;
|
|
56
56
|
const defaultSize = isDisplay ? "md" : (levelDefaults[resolvedAs] ?? "md");
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface IconProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** Material Symbols icon name (e.g. "check_circle", "home", "arrow_back") */
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* Icon size. "md" (default) inherits font-size from the parent.
|
|
8
|
+
* "xs"=16px, "sm"=20px, "md"=inherit, "lg"=32px, "xl"=40px, "jumbo"=64px, "xJumbo"=96px
|
|
9
|
+
*/
|
|
10
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "jumbo" | "xJumbo";
|
|
11
|
+
/**
|
|
12
|
+
* Icon color. Omit to inherit the current text color.
|
|
13
|
+
* Status values map to semantic status background tokens.
|
|
14
|
+
*/
|
|
15
|
+
color?: "muted" | "accent" | "inverse" | "success" | "error" | "warn" | "info";
|
|
16
|
+
/**
|
|
17
|
+
* Variable font weight axis (100–700).
|
|
18
|
+
* Default is set via CSS token `--a1-icon-weight`.
|
|
19
|
+
*/
|
|
20
|
+
weight?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Grade axis — adjusts visual weight without changing size (-25–200).
|
|
23
|
+
* Default is set via CSS token `--a1-icon-grade`.
|
|
24
|
+
*/
|
|
25
|
+
grade?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Optical size axis — adjusts detail level (20, 24, 40, 48).
|
|
28
|
+
* Default is set via CSS token `--a1-icon-opsz`.
|
|
29
|
+
*/
|
|
30
|
+
opticalSize?: 20 | 24 | 40 | 48;
|
|
31
|
+
/** Fill the icon shape. Default: false */
|
|
32
|
+
fill?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare function Icon(props: IconProps): React.ReactElement;
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import "./icon.css";
|
|
2
2
|
|
|
3
|
+
const SIZE_MAP = {
|
|
4
|
+
xs: "a1-icon-xs",
|
|
5
|
+
sm: "a1-icon-sm",
|
|
6
|
+
lg: "a1-icon-lg",
|
|
7
|
+
xl: "a1-icon-xl",
|
|
8
|
+
jumbo: "a1-icon-jumbo",
|
|
9
|
+
xJumbo: "a1-icon-xjumbo",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const COLOR_MAP = {
|
|
13
|
+
muted: "a1-icon-muted",
|
|
14
|
+
accent: "a1-icon-accent",
|
|
15
|
+
inverse: "a1-icon-inverse",
|
|
16
|
+
success: "a1-icon-success",
|
|
17
|
+
error: "a1-icon-error",
|
|
18
|
+
warn: "a1-icon-warn",
|
|
19
|
+
info: "a1-icon-info",
|
|
20
|
+
};
|
|
21
|
+
|
|
3
22
|
export function Icon({
|
|
4
23
|
name,
|
|
24
|
+
size,
|
|
25
|
+
color,
|
|
5
26
|
weight,
|
|
6
27
|
grade,
|
|
7
28
|
opticalSize,
|
|
@@ -17,11 +38,19 @@ export function Icon({
|
|
|
17
38
|
...(fill != null && { "--a1-icon-fill": fill ? 1 : 0 }),
|
|
18
39
|
};
|
|
19
40
|
|
|
41
|
+
const classes = [
|
|
42
|
+
"a1-icon",
|
|
43
|
+
"material-symbols-outlined",
|
|
44
|
+
SIZE_MAP[size],
|
|
45
|
+
COLOR_MAP[color],
|
|
46
|
+
className,
|
|
47
|
+
]
|
|
48
|
+
.filter(Boolean)
|
|
49
|
+
.join(" ");
|
|
50
|
+
|
|
20
51
|
return (
|
|
21
52
|
<span
|
|
22
|
-
className={
|
|
23
|
-
.filter(Boolean)
|
|
24
|
-
.join(" ")}
|
|
53
|
+
className={classes}
|
|
25
54
|
style={{ ...vars, ...style }}
|
|
26
55
|
aria-hidden="true"
|
|
27
56
|
{...props}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.a1-icon {
|
|
2
|
-
font-size: inherit;
|
|
2
|
+
font-size: var(--a1-icon-size, inherit);
|
|
3
3
|
line-height: 1;
|
|
4
4
|
user-select: none;
|
|
5
5
|
font-family: var(--a1-icon-font-family, 'Material Symbols Outlined');
|
|
@@ -9,3 +9,23 @@
|
|
|
9
9
|
"GRAD" var(--a1-icon-grade, 0),
|
|
10
10
|
"opsz" var(--a1-icon-opsz, var(--base-icon-optical-size));
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
/* ─── Sizes ───────────────────────────────────────────────────────────────── */
|
|
14
|
+
|
|
15
|
+
.a1-icon-xs { --a1-icon-size: var(--base-spacing-16); --a1-icon-opsz: 20; }
|
|
16
|
+
.a1-icon-sm { --a1-icon-size: var(--base-spacing-20); --a1-icon-opsz: 20; }
|
|
17
|
+
/* md = default (inherits from parent, ~24px) */
|
|
18
|
+
.a1-icon-lg { --a1-icon-size: var(--base-spacing-32); --a1-icon-opsz: 40; }
|
|
19
|
+
.a1-icon-xl { --a1-icon-size: var(--base-spacing-40); --a1-icon-opsz: 48; }
|
|
20
|
+
.a1-icon-jumbo { --a1-icon-size: var(--base-spacing-64); --a1-icon-opsz: 48; }
|
|
21
|
+
.a1-icon-xjumbo { --a1-icon-size: var(--base-spacing-96); --a1-icon-opsz: 48; }
|
|
22
|
+
|
|
23
|
+
/* ─── Colors ──────────────────────────────────────────────────────────────── */
|
|
24
|
+
|
|
25
|
+
.a1-icon-muted { color: var(--semantic-color-text-muted); }
|
|
26
|
+
.a1-icon-accent { color: var(--semantic-color-text-accent); }
|
|
27
|
+
.a1-icon-inverse { color: var(--semantic-color-text-inverse); }
|
|
28
|
+
.a1-icon-success { color: var(--semantic-color-status-success-background); }
|
|
29
|
+
.a1-icon-error { color: var(--semantic-color-status-error-background); }
|
|
30
|
+
.a1-icon-warn { color: var(--semantic-color-status-warn-background); }
|
|
31
|
+
.a1-icon-info { color: var(--semantic-color-status-info-background); }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/** Material Symbols icon name */
|
|
5
|
+
icon: string;
|
|
6
|
+
/** Accessible label (used as `aria-label` and visible tooltip) */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Visual style. Default: "tertiary" */
|
|
9
|
+
variant?: "tertiary" | "secondary" | "destructive" | "success";
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare function IconButton(props: IconButtonProps): React.ReactElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type SpacingToken = 1 | 2 | 4 | 6 | 8 | 12 | 16 | 20 | 24 | 32 | 40 | 64 | 96 | 128;
|
|
4
|
+
|
|
5
|
+
export interface InsetProps extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
+
/** Underlying element. Default: "div" */
|
|
7
|
+
as?: React.ElementType;
|
|
8
|
+
/** Base padding applied to all axes when no axis-specific value is set. Default: 16 */
|
|
9
|
+
space?: SpacingToken;
|
|
10
|
+
/** Block-axis (top/bottom) padding override. Falls back to `space`. */
|
|
11
|
+
block?: SpacingToken;
|
|
12
|
+
/** Inline-axis (left/right) padding override. Falls back to `space`. */
|
|
13
|
+
inline?: SpacingToken;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare function Inset(props: InsetProps): React.ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface InverseProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** Underlying element. Default: "div" */
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export declare function Inverse(props: InverseProps): React.ReactElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
|
+
/** Font size. Inherits from context when omitted. */
|
|
5
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
6
|
+
/** Font weight override. */
|
|
7
|
+
weight?: "normal" | "medium" | "semibold" | "bold";
|
|
8
|
+
/** Material Symbols icon name to show alongside the link text. */
|
|
9
|
+
icon?: string;
|
|
10
|
+
/** Position of the icon relative to the text. Default: "start" */
|
|
11
|
+
iconPosition?: "start" | "end";
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export declare function Link(props: LinkProps): React.ReactElement;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type Breakpoints = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
type ListSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
+
|
|
6
|
+
export interface ListProps extends React.HTMLAttributes<HTMLUListElement | HTMLOListElement> {
|
|
7
|
+
/** Underlying element — "ol" switches to ordered variant automatically. Default: "ul" */
|
|
8
|
+
as?: "ul" | "ol";
|
|
9
|
+
/**
|
|
10
|
+
* Font size. Responsive object syntax supported. Default: "md"
|
|
11
|
+
*/
|
|
12
|
+
size?: ListSize | Partial<Record<Breakpoints, ListSize>>;
|
|
13
|
+
/** Text colour. Default: "default" */
|
|
14
|
+
color?: "default" | "muted";
|
|
15
|
+
/**
|
|
16
|
+
* Material Symbols icon name applied to all list items.
|
|
17
|
+
* Setting `icon` automatically switches `variant` to "icon".
|
|
18
|
+
*/
|
|
19
|
+
icon?: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* List style. Auto-detected from `as` and `icon` when not set.
|
|
22
|
+
* "divider" renders items separated by horizontal rules.
|
|
23
|
+
*/
|
|
24
|
+
variant?: "unordered" | "ordered" | "icon" | "divider";
|
|
25
|
+
/** Bottom margin. */
|
|
26
|
+
marginBottom?: "sm" | "md" | "lg";
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ListItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
31
|
+
/**
|
|
32
|
+
* Per-item icon override. Pass `null` to suppress the list-level icon for this item.
|
|
33
|
+
* Omit to inherit from the parent `List`.
|
|
34
|
+
*/
|
|
35
|
+
icon?: string | null;
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare function List(props: ListProps): React.ReactElement;
|
|
40
|
+
export declare function ListItem(props: ListItemProps): React.ReactElement;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface MenuProps {
|
|
4
|
+
/** Whether the menu is open */
|
|
5
|
+
open: boolean;
|
|
6
|
+
/** Called when the menu should close */
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
/** Ref to the trigger element — used to position the menu below it */
|
|
9
|
+
anchorRef?: React.RefObject<HTMLElement>;
|
|
10
|
+
/** Accessible label for the menu `dialog` element */
|
|
11
|
+
"aria-label"?: string;
|
|
12
|
+
/** Additional CSS class names for the menu dialog */
|
|
13
|
+
className?: string;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface MenuSectionProps {
|
|
18
|
+
/** Optional section label shown above the items */
|
|
19
|
+
label?: string;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface MenuItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
24
|
+
/** Material Symbols icon name shown before the label */
|
|
25
|
+
icon?: string;
|
|
26
|
+
/** Keyboard shortcut hint displayed at the trailing end */
|
|
27
|
+
shortcut?: string;
|
|
28
|
+
/** Visual style. Default: "default" */
|
|
29
|
+
variant?: "default" | "destructive";
|
|
30
|
+
/** Marks this item as the current page. Adds a left-border indicator and aria-current="page". */
|
|
31
|
+
active?: boolean;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/** Renders as an anchor `<a>` when provided */
|
|
34
|
+
href?: string;
|
|
35
|
+
onClick?: React.MouseEventHandler;
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare function Menu(props: MenuProps): React.ReactElement;
|
|
40
|
+
export declare function MenuSection(props: MenuSectionProps): React.ReactElement;
|
|
41
|
+
export declare function MenuItem(props: MenuItemProps): React.ReactElement;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface MessageBadgeProps {
|
|
4
|
+
/** Semantic status colour. Default: "neutral" */
|
|
5
|
+
status?: "neutral" | "info" | "success" | "warn" | "error";
|
|
6
|
+
/** Reduce background opacity for a softer appearance. Default: false */
|
|
7
|
+
subtle?: boolean;
|
|
8
|
+
/** Size. Default: "md" */
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
/**
|
|
11
|
+
* Override the default status icon. Pass `null` to suppress the icon entirely.
|
|
12
|
+
*/
|
|
13
|
+
icon?: string | null;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface MessageEmptyStateProps {
|
|
18
|
+
/**
|
|
19
|
+
* Visual scale — matches the container this empty state lives in. Default: "section"
|
|
20
|
+
* page = largest (h1), section = medium (h2), card = compact (h3)
|
|
21
|
+
*/
|
|
22
|
+
scale?: "page" | "section" | "card";
|
|
23
|
+
/** Material Symbols icon name shown above the title. Default: "inbox" */
|
|
24
|
+
icon?: string;
|
|
25
|
+
/** Primary message */
|
|
26
|
+
title?: string;
|
|
27
|
+
/** Supporting description text */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Action element (e.g. a Button) */
|
|
30
|
+
action?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare function MessageBadge(props: MessageBadgeProps): React.ReactElement;
|
|
34
|
+
export declare function MessageEmptyState(props: MessageEmptyStateProps): React.ReactElement;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface NotificationProps {
|
|
4
|
+
/** Element the badge is anchored to */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Numeric count displayed in the badge */
|
|
7
|
+
count?: number;
|
|
8
|
+
/** Short text label — used when count is not set */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Show a dot with no content. Default: false */
|
|
11
|
+
dot?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Visual status colour. Default: "neutral"
|
|
14
|
+
* neutral | error | success | warn | info
|
|
15
|
+
*/
|
|
16
|
+
status?: "neutral" | "error" | "success" | "warn" | "info";
|
|
17
|
+
/** Badge anchor position. Default: "top-right" */
|
|
18
|
+
position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
19
|
+
/** Count above this value shows as {max}+. Default: 99 */
|
|
20
|
+
max?: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare function Notification(props: NotificationProps): React.ReactElement;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface PageLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Top header slot — rendered in a `<header>` landmark */
|
|
5
|
+
header?: React.ReactNode;
|
|
6
|
+
/** Bottom footer slot — rendered in a `<footer>` landmark */
|
|
7
|
+
footer?: React.ReactNode;
|
|
8
|
+
/** Side navigation panel — rendered in an `<aside>` landmark */
|
|
9
|
+
sidebar?: React.ReactNode;
|
|
10
|
+
/** Which side the sidebar occupies. Default: "start" */
|
|
11
|
+
sidebarPlacement?: "start" | "end";
|
|
12
|
+
/** Supplemental content panel (e.g. a table of contents) */
|
|
13
|
+
aside?: React.ReactNode;
|
|
14
|
+
/** Which side the aside occupies. Default: "end" */
|
|
15
|
+
asidePlacement?: "start" | "end";
|
|
16
|
+
/** Keep the header fixed at the top while content scrolls. Default: false */
|
|
17
|
+
stickyHeader?: boolean;
|
|
18
|
+
/** Constrain the layout to 100vh. Default: false */
|
|
19
|
+
viewportHeight?: boolean;
|
|
20
|
+
/** Main content */
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare function PageLayout(props: PageLayoutProps): React.ReactElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface PageNavSection {
|
|
4
|
+
/** Unique ID that matches the `id` on the corresponding heading/section element */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Label shown in the nav */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Heading nesting level for indentation. Default: 1 */
|
|
9
|
+
level?: 1 | 2;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface PageNavProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
/** List of page sections to link to */
|
|
14
|
+
sections?: PageNavSection[];
|
|
15
|
+
/** Accessible label for the `<nav>` and the visible heading. Default: "On this page" */
|
|
16
|
+
label?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare function PageNav(props: PageNavProps): React.ReactElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface PaginationProps {
|
|
4
|
+
/** Current page number (1-based) */
|
|
5
|
+
page: number;
|
|
6
|
+
/** Total number of pages */
|
|
7
|
+
totalPages: number;
|
|
8
|
+
/** Called with the new page number when a page button is clicked */
|
|
9
|
+
onChange?: (page: number) => void;
|
|
10
|
+
/**
|
|
11
|
+
* How many page numbers to show on each side of the current page.
|
|
12
|
+
* Default: 1
|
|
13
|
+
*/
|
|
14
|
+
siblings?: number;
|
|
15
|
+
/** Size of the pagination buttons. Default: "md" */
|
|
16
|
+
size?: "sm" | "md" | "lg";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare function Pagination(props: PaginationProps): React.ReactElement;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type Breakpoints = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
type ParagraphSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
+
|
|
6
|
+
export interface ParagraphProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
7
|
+
/** Underlying element. Default: "p" */
|
|
8
|
+
as?: React.ElementType;
|
|
9
|
+
/**
|
|
10
|
+
* Font size. Responsive object syntax supported. Default: "md"
|
|
11
|
+
* @example size={{ xs: "sm", md: "md" }}
|
|
12
|
+
*/
|
|
13
|
+
size?: ParagraphSize | Partial<Record<Breakpoints, ParagraphSize>>;
|
|
14
|
+
/** Text colour. Default: "default" */
|
|
15
|
+
color?: "default" | "muted";
|
|
16
|
+
/** Apply text-wrap. "balance" distributes line lengths evenly — use for short intro copy. */
|
|
17
|
+
textWrap?: "balance";
|
|
18
|
+
/** Horizontal text alignment. "start"/"end" are logical aliases for LTR/RTL-safe alignment. */
|
|
19
|
+
align?: "left" | "center" | "right" | "start" | "end";
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare function Paragraph(props: ParagraphProps): React.ReactElement;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface RadioOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
hint?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface RadioGroupProps {
|
|
11
|
+
/** Group legend */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Helper text */
|
|
14
|
+
hint?: string;
|
|
15
|
+
/** Error message */
|
|
16
|
+
error?: string;
|
|
17
|
+
/** Size density. Inherits from parent `Fieldset` when omitted. Default: "default" */
|
|
18
|
+
size?: "comfortable" | "default" | "compact";
|
|
19
|
+
required?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Render radios side by side. Default: false */
|
|
22
|
+
inline?: boolean;
|
|
23
|
+
/** Input name attribute shared by all radios */
|
|
24
|
+
name?: string;
|
|
25
|
+
/** Array of radio options */
|
|
26
|
+
options?: RadioOption[];
|
|
27
|
+
/** Controlled selected value */
|
|
28
|
+
value?: string | null;
|
|
29
|
+
/** Default selected value (uncontrolled). Default: null */
|
|
30
|
+
defaultValue?: string | null;
|
|
31
|
+
/** Called with the selected value string on change */
|
|
32
|
+
onChange?: (value: string) => void;
|
|
33
|
+
id?: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare function RadioGroup(props: RadioGroupProps): React.ReactElement;
|