@gtivr4/a1-design-system-react 0.4.0 → 0.5.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/calendar/Calendar.jsx +76 -13
- package/src/components/calendar/calendar.css +71 -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/dialog/Dialog.d.ts +15 -0
- package/src/components/dialog/dialog.css +7 -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 +25 -0
- 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,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;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type Breakpoints = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
type PaddingSize = "lg" | "md" | "sm" | "xs" | "none";
|
|
5
|
+
type ResponsivePadding = PaddingSize | Partial<Record<Breakpoints, PaddingSize>>;
|
|
6
|
+
type AlignmentValue = "left" | "center" | "right";
|
|
7
|
+
type ResponsiveAlignment = AlignmentValue | Partial<Record<Breakpoints, AlignmentValue>>;
|
|
8
|
+
|
|
9
|
+
export interface SectionProps extends React.HTMLAttributes<HTMLElement> {
|
|
10
|
+
/** Underlying element. Default: "section" */
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
/** Block padding scale. Responsive object syntax supported. Default: "md" */
|
|
13
|
+
padding?: ResponsivePadding;
|
|
14
|
+
/** Background surface treatment */
|
|
15
|
+
surface?: "page" | "panel" | "raised";
|
|
16
|
+
/** Gap between direct children */
|
|
17
|
+
gap?: "xs" | "sm" | "md" | "lg";
|
|
18
|
+
/** Gradient overlay colour */
|
|
19
|
+
gradient?: "accent" | "highlight" | "info" | "success" | "warn";
|
|
20
|
+
/** Gradient origin. Default: "center" */
|
|
21
|
+
gradientPosition?: "top" | "top-right" | "right" | "bottom-right" | "bottom" | "bottom-left" | "left" | "top-left" | "center";
|
|
22
|
+
/** Apply inverse (dark) colour scheme to this section */
|
|
23
|
+
inverse?: boolean;
|
|
24
|
+
/** Constrain inner content to a max-width and centre it */
|
|
25
|
+
contentWidth?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
26
|
+
/** Force a specific height. "hero" fills 90svh minus the sticky header height and vertically centres content. */
|
|
27
|
+
height?: "screen" | "hero";
|
|
28
|
+
/** Horizontal layout alignment for direct children. Responsive object syntax supported. */
|
|
29
|
+
align?: ResponsiveAlignment;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare function Section(props: SectionProps): React.ReactElement;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface SegmentOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SegmentedControlProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/** Option list. Pass strings or `{ value, label, icon }` objects. */
|
|
12
|
+
options?: (string | SegmentOption)[];
|
|
13
|
+
/** Currently selected value (controlled) */
|
|
14
|
+
value?: string;
|
|
15
|
+
/** Called with the new value when an option is selected */
|
|
16
|
+
onChange?: (value: string) => void;
|
|
17
|
+
/** Stretch to fill the container width. Default: false */
|
|
18
|
+
fullWidth?: boolean;
|
|
19
|
+
/** Height scale. Default: "md" */
|
|
20
|
+
size?: "sm" | "md" | "lg";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare function SegmentedControl(props: SegmentedControlProps): React.ReactElement;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface SideNavProps {
|
|
4
|
+
/**
|
|
5
|
+
* Header slot. Pass a render function to receive the current `collapsed` state:
|
|
6
|
+
* `header={(collapsed) => <Logo collapsed={collapsed} />}`
|
|
7
|
+
*/
|
|
8
|
+
header?: React.ReactNode | ((collapsed: boolean) => React.ReactNode);
|
|
9
|
+
/** Footer slot — hidden when collapsed */
|
|
10
|
+
footer?: React.ReactNode | ((collapsed: boolean) => React.ReactNode);
|
|
11
|
+
/** `SideNavItem` and `SideNavGroup` elements */
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/** Controls overlay visibility on xs/sm/md viewports. Default: false */
|
|
14
|
+
open?: boolean;
|
|
15
|
+
/** Called when the scrim, Escape key, or close button is triggered */
|
|
16
|
+
onClose?: () => void;
|
|
17
|
+
/** Initial collapsed state for lg/xl (uncontrolled). Default: false */
|
|
18
|
+
defaultCollapsed?: boolean;
|
|
19
|
+
/** Controlled collapsed state for lg/xl */
|
|
20
|
+
collapsed?: boolean;
|
|
21
|
+
/** Called with next boolean when collapsed state changes */
|
|
22
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
23
|
+
/** Where the desktop collapse toggle appears. Default: "header" */
|
|
24
|
+
collapseButtonPlacement?: "header" | "footer";
|
|
25
|
+
/** Side of the layout the nav occupies. Default: "start" */
|
|
26
|
+
placement?: "start" | "end";
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface SideNavGroupProps {
|
|
31
|
+
/** Material Symbols icon (recommended for collapsed state) */
|
|
32
|
+
icon?: string;
|
|
33
|
+
/** Trigger label */
|
|
34
|
+
label: string;
|
|
35
|
+
/** Initial expanded state (uncontrolled). Default: false */
|
|
36
|
+
defaultOpen?: boolean;
|
|
37
|
+
/** Controlled expanded state */
|
|
38
|
+
open?: boolean;
|
|
39
|
+
/** Called with next boolean when toggled */
|
|
40
|
+
onOpenChange?: (open: boolean) => void;
|
|
41
|
+
className?: string;
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface SideNavItemProps {
|
|
46
|
+
/** Underlying element. Default: "a" */
|
|
47
|
+
as?: React.ElementType;
|
|
48
|
+
/** Material Symbols icon name */
|
|
49
|
+
icon?: string;
|
|
50
|
+
/** Visible label (also used as tooltip when collapsed) */
|
|
51
|
+
label: string;
|
|
52
|
+
/** Badge count shown next to the label */
|
|
53
|
+
badge?: string | number;
|
|
54
|
+
/** Mark as the current page. Default: false */
|
|
55
|
+
active?: boolean;
|
|
56
|
+
className?: string;
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare function SideNav(props: SideNavProps): React.ReactElement;
|
|
61
|
+
export declare function SideNavGroup(props: SideNavGroupProps): React.ReactElement;
|
|
62
|
+
export declare function SideNavItem(props: SideNavItemProps): React.ReactElement;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type Breakpoints = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
type SpacerSize = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
5
|
+
|
|
6
|
+
export interface SpacerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/**
|
|
8
|
+
* Space height. Responsive object syntax supported.
|
|
9
|
+
* xs=8px · sm=16px · md=24px · lg=40px · xl=64px · xxl=96px
|
|
10
|
+
* Default: "md"
|
|
11
|
+
* @example size={{ xs: "sm", md: "lg" }}
|
|
12
|
+
*/
|
|
13
|
+
size?: SpacerSize | Partial<Record<Breakpoints, SpacerSize>>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare function Spacer(props: SpacerProps): React.ReactElement;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type Breakpoints = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
type Direction = "column" | "column-reverse" | "row" | "row-reverse";
|
|
5
|
+
type Justify = "start" | "center" | "end" | "between" | "around" | "evenly";
|
|
6
|
+
type Align = "stretch" | "start" | "center" | "end" | "baseline";
|
|
7
|
+
type SemanticGap = "xs" | "sm" | "md" | "lg";
|
|
8
|
+
type SpacingToken = 1 | 2 | 4 | 6 | 8 | 12 | 16 | 20 | 24 | 32 | 40 | 64 | 96 | 128;
|
|
9
|
+
|
|
10
|
+
export interface StackProps extends React.HTMLAttributes<HTMLElement> {
|
|
11
|
+
/** Underlying element. Default: "div" */
|
|
12
|
+
as?: React.ElementType;
|
|
13
|
+
/**
|
|
14
|
+
* Flex direction. Responsive object syntax supported.
|
|
15
|
+
* Default: "column"
|
|
16
|
+
* @example direction={{ xs: "column", md: "row" }}
|
|
17
|
+
*/
|
|
18
|
+
direction?: Direction | Partial<Record<Breakpoints, Direction>>;
|
|
19
|
+
/**
|
|
20
|
+
* Gap between children. Use a semantic token ("xs"–"lg") or a numeric spacing value.
|
|
21
|
+
* Default: 16
|
|
22
|
+
*/
|
|
23
|
+
gap?: SemanticGap | SpacingToken;
|
|
24
|
+
/**
|
|
25
|
+
* Align-items. Default: "stretch"
|
|
26
|
+
*/
|
|
27
|
+
align?: Align;
|
|
28
|
+
/**
|
|
29
|
+
* Justify-content. Responsive object syntax supported.
|
|
30
|
+
* Default: "start"
|
|
31
|
+
*/
|
|
32
|
+
justify?: Justify | Partial<Record<Breakpoints, Justify>>;
|
|
33
|
+
/** Allow children to wrap. Default: false */
|
|
34
|
+
wrap?: boolean;
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare function Stack(props: StackProps): React.ReactElement;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface StatusBarProps {
|
|
4
|
+
/**
|
|
5
|
+
* Current value. Combined with max to compute the fill percentage.
|
|
6
|
+
* Ignored when indeterminate is true. Default: 0
|
|
7
|
+
*/
|
|
8
|
+
value?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Maximum value. Default: 100
|
|
11
|
+
*/
|
|
12
|
+
max?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Label displayed adjacent to the bar. Accepts any ReactNode — plain string,
|
|
15
|
+
* bold/inline markup, or composed components. Also provides the accessible
|
|
16
|
+
* name for the progressbar via aria-labelledby.
|
|
17
|
+
*
|
|
18
|
+
* @example <StatusBar label="Storage used" />
|
|
19
|
+
* @example <StatusBar label={<><strong>73%</strong> used</>} />
|
|
20
|
+
*/
|
|
21
|
+
label?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Position of the label relative to the bar.
|
|
24
|
+
* "above" and "below" use a column layout; "before" and "after" use a row
|
|
25
|
+
* layout and are RTL-aware ("before" = inline-start side). Default: "above"
|
|
26
|
+
*/
|
|
27
|
+
labelPosition?: "above" | "below" | "before" | "after";
|
|
28
|
+
/**
|
|
29
|
+
* Bar height. Default: "md"
|
|
30
|
+
*/
|
|
31
|
+
size?: "sm" | "md" | "lg";
|
|
32
|
+
/**
|
|
33
|
+
* Shows an animated loading sweep instead of a value-based fill.
|
|
34
|
+
* Removes aria-valuenow so assistive technology announces an indeterminate
|
|
35
|
+
* state. After 3 seconds a pause/resume button appears. Default: false
|
|
36
|
+
*/
|
|
37
|
+
indeterminate?: boolean;
|
|
38
|
+
/** Additional CSS class names applied to the root element. */
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export declare function StatusBar(props: StatusBarProps & React.HTMLAttributes<HTMLDivElement>): React.ReactElement;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface SwitchProps {
|
|
4
|
+
/** Visible label text */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Helper text shown below the switch */
|
|
7
|
+
hint?: string;
|
|
8
|
+
/** Error message */
|
|
9
|
+
error?: string;
|
|
10
|
+
/** Size density. Inherits from parent `Fieldset` when omitted. Default: "default" */
|
|
11
|
+
size?: "comfortable" | "default" | "compact";
|
|
12
|
+
/** Position of the label relative to the toggle. Default: "end" */
|
|
13
|
+
labelPosition?: "start" | "end";
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Controlled checked state */
|
|
16
|
+
checked?: boolean;
|
|
17
|
+
/** Initial checked state (uncontrolled). Default: false */
|
|
18
|
+
defaultChecked?: boolean;
|
|
19
|
+
/** Called with (checked, event) when the value changes */
|
|
20
|
+
onChange?: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
+
id?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
value?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare function Switch(props: SwitchProps): React.ReactElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface SystemBannerProps {
|
|
4
|
+
/** Semantic status colour. Default: "neutral" */
|
|
5
|
+
status?: "neutral" | "info" | "success" | "warn" | "error";
|
|
6
|
+
/** Bold title text */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Override the default status icon with any Material Symbols name */
|
|
9
|
+
icon?: string;
|
|
10
|
+
/** Action element rendered at the trailing end */
|
|
11
|
+
action?: React.ReactNode;
|
|
12
|
+
/** Called when the dismiss button is clicked. Omit to hide the dismiss button. */
|
|
13
|
+
onDismiss?: () => void;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare function SystemBanner(props: SystemBannerProps): React.ReactElement;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface TabsProps {
|
|
4
|
+
/** Currently active tab value (controlled) */
|
|
5
|
+
value: string;
|
|
6
|
+
/** Called with the new value when a tab is clicked */
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Visual style. Default: "line"
|
|
10
|
+
* line — underline indicator
|
|
11
|
+
* pills — filled pill buttons
|
|
12
|
+
* segment — segmented control style
|
|
13
|
+
* progress — step-progress indicator
|
|
14
|
+
* folder — browser-tab style folders
|
|
15
|
+
*/
|
|
16
|
+
variant?: "line" | "pills" | "segment" | "progress" | "folder";
|
|
17
|
+
/**
|
|
18
|
+
* Heading level for accessibility. Tabs at level 1 sit above level 2 tabs.
|
|
19
|
+
* Default: 1
|
|
20
|
+
*/
|
|
21
|
+
level?: 1 | 2;
|
|
22
|
+
className?: string;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface TabListProps {
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface TabProps {
|
|
31
|
+
/** Value identifier — must match the corresponding `TabPanel` value */
|
|
32
|
+
value: string;
|
|
33
|
+
/** Badge count shown next to the label */
|
|
34
|
+
count?: number;
|
|
35
|
+
/** Material Symbols icon name */
|
|
36
|
+
icon?: string;
|
|
37
|
+
/** Icon placement relative to the label. Default: "start" */
|
|
38
|
+
iconPosition?: "start" | "end" | "above";
|
|
39
|
+
/** Status indicator (used in "progress" variant) */
|
|
40
|
+
status?: "completed" | "error" | "warn";
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface TabPanelProps {
|
|
45
|
+
/** Value identifier — panel renders only when this matches the active `Tabs` value */
|
|
46
|
+
value: string;
|
|
47
|
+
children?: React.ReactNode;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export declare function Tabs(props: TabsProps): React.ReactElement;
|
|
51
|
+
export declare function TabList(props: TabListProps): React.ReactElement;
|
|
52
|
+
export declare function Tab(props: TabProps): React.ReactElement;
|
|
53
|
+
export declare function TabPanel(props: TabPanelProps): React.ReactElement;
|