@walco-ai/claude-plugin-design-system 0.0.0-stage → 0.3.2
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/LICENSE +25 -0
- package/README.md +35 -2
- package/dist/breakpoints.d.ts +10 -0
- package/dist/components/AppHeader/AppHeader.d.ts +23 -0
- package/dist/components/Badge/Badge.d.ts +9 -0
- package/dist/components/Banner/Banner.d.ts +23 -0
- package/dist/components/Button/Button.d.ts +13 -0
- package/dist/components/Card/Card.d.ts +12 -0
- package/dist/components/ChangeBar/ChangeBar.d.ts +9 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/CollapsibleRow/CollapsibleRow.d.ts +24 -0
- package/dist/components/Field/Field.d.ts +18 -0
- package/dist/components/Figure/Figure.d.ts +10 -0
- package/dist/components/FilterChip/FilterChip.d.ts +14 -0
- package/dist/components/Icon/Icon.d.ts +12 -0
- package/dist/components/Icon/icons.d.ts +34 -0
- package/dist/components/IconButton/IconButton.d.ts +10 -0
- package/dist/components/Link/Link.d.ts +8 -0
- package/dist/components/LiveIndicator/LiveIndicator.d.ts +10 -0
- package/dist/components/PillButton/PillButton.d.ts +13 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +12 -0
- package/dist/components/Prose/Prose.d.ts +13 -0
- package/dist/components/Radio/Choice.d.ts +10 -0
- package/dist/components/Radio/Radio.d.ts +3 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +12 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +17 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +9 -0
- package/dist/components/StatusDot/StatusDot.d.ts +13 -0
- package/dist/components/Tabs/Tabs.d.ts +17 -0
- package/dist/components/TextArea/TextArea.d.ts +10 -0
- package/dist/components/TextField/TextField.d.ts +10 -0
- package/dist/components/TruncatedPath/TruncatedPath.d.ts +7 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +7 -0
- package/dist/fonts/OFL.txt +94 -0
- package/dist/fonts/fonts.css +91 -0
- package/dist/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-ext-400-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-ext-500-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-ext-600-normal.woff2 +0 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +662 -0
- package/dist/internal/cx.d.ts +2 -0
- package/dist/internal/tone.d.ts +2 -0
- package/dist/styles.css +1519 -0
- package/package.json +33 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nicolas Giammetta
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
The embedded fonts, IBM Plex Sans and IBM Plex Mono, are licensed under the
|
|
24
|
+
SIL Open Font License 1.1; see the OFL.txt file next to them. The icons come
|
|
25
|
+
from Lucide, licensed under the ISC License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# claude-plugin-design-system
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Design tokens, base components and patterns for the web interfaces of Claude Code plugins, so that every plugin interface looks and behaves alike. React components with TypeScript declarations, a light and a dark theme, IBM Plex fonts embedded.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --save-exact @walco-ai/claude-plugin-design-system
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`react` and `react-dom` are peer dependencies.
|
|
12
|
+
|
|
13
|
+
## Use
|
|
14
|
+
|
|
15
|
+
Import the stylesheet once, at the entry of the interface, then the components:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import "@walco-ai/claude-plugin-design-system/styles.css";
|
|
19
|
+
import { Button, iconSend } from "@walco-ai/claude-plugin-design-system";
|
|
20
|
+
|
|
21
|
+
<Button variant="primary" icon={iconSend}>Send</Button>;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The theme follows the system's light or dark preference; `data-theme="light"` or `data-theme="dark"` on any element forces one theme on its subtree. Style the interface's own parts with the semantic tokens the stylesheet defines (`var(--color-…)`, `var(--space-…)`, `var(--radius-…)`), never with literal values.
|
|
25
|
+
|
|
26
|
+
## Contents
|
|
27
|
+
|
|
28
|
+
- **Tokens**: surfaces, lines, text, accent and tones (neutral, info, accent, waiting, success, danger) in both themes; type, space, shapes and sizes.
|
|
29
|
+
- **Base components**: `Button` (primary, secondary, ghost; icon, loading), `IconButton`, `Link`, `TextField`, `TextArea`, `Radio`, `Checkbox`, `Icon`.
|
|
30
|
+
- **Icons**: a closed set from Lucide, one export per icon (`iconSend`, `iconPencil`, `iconClock`…), so that a bundle keeps only the icons it imports.
|
|
31
|
+
- **Patterns**: `Card`, `Badge`, `StatusBadge`, `CollapsibleRow`, `AppHeader`, `LiveIndicator`, `Banner`, `Figure`, `Prose`.
|
|
32
|
+
- **Rendered text**: `Prose` styles rich text an interface has already rendered, such as Markdown: paragraphs, headings, lists, code, tables, quotes and strikethrough. `density="block"` holds a long text; `density="inline"` holds a one-line text inside a row, such as a radio label, without block margins. Make its links with `Link`, for instance by mapping the renderer's `a` element to it.
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
MIT. Fonts: SIL Open Font License 1.1. Icons: Lucide, ISC License.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The widths in CSS pixels where a layout changes, the same as the --breakpoint-medium and --breakpoint-wide tokens.
|
|
3
|
+
* Custom properties cannot drive a media or a container query, so a layout reads these numbers instead: narrow below
|
|
4
|
+
* medium, medium from medium to below wide, wide from wide up.
|
|
5
|
+
*/
|
|
6
|
+
export declare const breakpoints: {
|
|
7
|
+
readonly medium: 720;
|
|
8
|
+
readonly wide: 1200;
|
|
9
|
+
};
|
|
10
|
+
export type Breakpoint = keyof typeof breakpoints;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { IconGlyph } from "../Icon/icons";
|
|
3
|
+
import { type Connection } from "../LiveIndicator/LiveIndicator";
|
|
4
|
+
export interface BreadcrumbItem {
|
|
5
|
+
label: string;
|
|
6
|
+
/** Leave it unset on the current page, the last item. */
|
|
7
|
+
href?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AppHeaderProps {
|
|
10
|
+
/** The interface's name. */
|
|
11
|
+
title: string;
|
|
12
|
+
/** An icon before the name. */
|
|
13
|
+
icon?: IconGlyph;
|
|
14
|
+
/** Where the page sits, the current page last. */
|
|
15
|
+
breadcrumb?: readonly BreadcrumbItem[];
|
|
16
|
+
/** Shows the live indicator when set. */
|
|
17
|
+
connection?: Connection;
|
|
18
|
+
/** Status badges and links at the end of the header. */
|
|
19
|
+
actions?: ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/** The bar at the top of an interface: its name, the breadcrumb, the live indicator and a few actions. */
|
|
23
|
+
export declare function AppHeader({ title, icon, breadcrumb, connection, actions, className }: AppHeaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import type { Tone } from "../../internal/tone";
|
|
3
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** neutral, info, accent (a recommendation), waiting (for the user), success or danger. */
|
|
5
|
+
tone?: Tone;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** A small label attached to an item, such as "Recommended" or "Revised". */
|
|
9
|
+
export declare function Badge({ tone, className, children, ...rest }: BadgeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type IconGlyph } from "../Icon/icons";
|
|
3
|
+
export type BannerVariant = "info" | "status";
|
|
4
|
+
export type BannerTone = "neutral" | "info" | "waiting" | "success" | "danger";
|
|
5
|
+
export interface BannerProps {
|
|
6
|
+
/** info: a message in a tinted box; status: a short status line, such as "Draft saved". */
|
|
7
|
+
variant?: BannerVariant;
|
|
8
|
+
tone?: BannerTone;
|
|
9
|
+
/** Replaces the tone's icon. */
|
|
10
|
+
icon?: IconGlyph;
|
|
11
|
+
/** A title before the message, in a heavier weight. */
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
/** Controls at the end of an info banner, such as a button that opens what the message is about. */
|
|
14
|
+
actions?: ReactNode;
|
|
15
|
+
/** Shows a dismiss button at the end of an info banner. */
|
|
16
|
+
onDismiss?: () => void;
|
|
17
|
+
/** The dismiss button's name; "Dismiss" by default. */
|
|
18
|
+
dismissLabel?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/** A message about the state of a view or an item, announced politely to assistive technologies. */
|
|
23
|
+
export declare function Banner({ variant, tone, icon, title, actions, onDismiss, dismissLabel, className, children }: BannerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { type IconGlyph } from "../Icon/icons";
|
|
3
|
+
export type ButtonVariant = "primary" | "secondary" | "ghost";
|
|
4
|
+
export interface ButtonProps extends Omit<ComponentProps<"button">, "children"> {
|
|
5
|
+
/** primary: the main action of a view; secondary: other actions; ghost: light actions in accent text. */
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
/** An icon before the label. */
|
|
8
|
+
icon?: IconGlyph;
|
|
9
|
+
/** While set, the action is running: a spinner replaces the icon, the button stays focusable and ignores clicks. */
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function Button({ variant, icon, loading, type, className, onClick, children, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type CardVariant = "default" | "subtle" | "dashed";
|
|
3
|
+
export type CardInset = "none" | "md" | "lg";
|
|
4
|
+
export interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** default: a white card on the ground; subtle: a quieter card for secondary content; dashed: a placeholder, such as a deferred item. */
|
|
6
|
+
variant?: CardVariant;
|
|
7
|
+
/** The space inside the card: none 0, md 16, lg 24. */
|
|
8
|
+
inset?: CardInset;
|
|
9
|
+
as?: "div" | "section" | "article" | "li" | "aside";
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function Card({ variant, inset, as: Tag, className, children, ...rest }: CardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ChangeBarProps {
|
|
2
|
+
added: number;
|
|
3
|
+
removed: number;
|
|
4
|
+
/** The number of cells; five by default. */
|
|
5
|
+
cells?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/** The share of lines added and removed, as a row of cells; decorative, so the counts must be given as text too. */
|
|
9
|
+
export declare function ChangeBar({ added, removed, cells, className }: ChangeBarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type CollapsibleRowVariant = "card" | "plain" | "row";
|
|
3
|
+
export interface CollapsibleRowProps {
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** Before the title, such as a badge naming the item's kind. */
|
|
6
|
+
leading?: ReactNode;
|
|
7
|
+
/** A short summary after the title, such as a count; in a row, at its end. */
|
|
8
|
+
meta?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* card: a bordered row on the ground; plain: a light toggle, such as "Closed items (3)"; row: a dense row of a list,
|
|
11
|
+
* whose content slides open below it.
|
|
12
|
+
*/
|
|
13
|
+
variant?: CollapsibleRowVariant;
|
|
14
|
+
/** Marks the row as the current one of its list. */
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
/** Controlled state; leave it unset to let the row keep its own. */
|
|
17
|
+
expanded?: boolean;
|
|
18
|
+
defaultExpanded?: boolean;
|
|
19
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** A row that shows or hides its content, collapsed by default. */
|
|
24
|
+
export declare function CollapsibleRow({ title, leading, meta, variant, selected, expanded, defaultExpanded, onExpandedChange, className, children, }: CollapsibleRowProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
/** What a labelled field receives from its frame: its id and the ids of the texts that describe it. */
|
|
3
|
+
export interface FieldControl {
|
|
4
|
+
id: string;
|
|
5
|
+
describedBy: string | undefined;
|
|
6
|
+
invalid: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface FieldProps {
|
|
9
|
+
id: string;
|
|
10
|
+
label: ReactNode;
|
|
11
|
+
hint: ReactNode | undefined;
|
|
12
|
+
error: ReactNode | undefined;
|
|
13
|
+
className: string | undefined;
|
|
14
|
+
children: (control: FieldControl) => ReactElement;
|
|
15
|
+
}
|
|
16
|
+
/** The frame shared by the text fields: a label above, the control, then a hint or an error below. */
|
|
17
|
+
export declare function Field({ id, label, hint, error, className, children }: FieldProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface FigureProps {
|
|
3
|
+
/** A line under the visual. */
|
|
4
|
+
caption?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
/** The visual: a diagram, a mockup, an image. */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** A frame around a visual, with an optional caption. */
|
|
10
|
+
export declare function Figure({ caption, className, children }: FigureProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import type { Tone } from "../../internal/tone";
|
|
3
|
+
export interface FilterChipProps extends Omit<ComponentProps<"button">, "children" | "aria-pressed" | "onClick"> {
|
|
4
|
+
/** Whether the filter applies. */
|
|
5
|
+
pressed: boolean;
|
|
6
|
+
onPressedChange: (pressed: boolean) => void;
|
|
7
|
+
/** The tone the chip takes while pressed, such as the tone of the state it filters on. */
|
|
8
|
+
tone?: Tone;
|
|
9
|
+
/** The number of items the filter matches, shown after the label. */
|
|
10
|
+
count?: number;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** A filter the user turns on or off: outlined while off, filled in its tone while on. */
|
|
14
|
+
export declare function FilterChip({ pressed, onPressedChange, tone, count, type, className, children, ...rest }: FilterChipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IconGlyph } from "./icons";
|
|
2
|
+
export type IconSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface IconProps {
|
|
4
|
+
/** One icon of the set, such as iconSend. */
|
|
5
|
+
icon: IconGlyph;
|
|
6
|
+
/** sm 14, md 16, lg 20. */
|
|
7
|
+
size?: IconSize;
|
|
8
|
+
/** Names the icon for assistive technologies; without it, the icon is decorative and hidden from them. */
|
|
9
|
+
label?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Icon({ icon, size, label, className }: IconProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type LucideIcon } from "lucide-react";
|
|
2
|
+
/**
|
|
3
|
+
* One icon of the design system's set. Only this package creates them, so the set stays closed; each icon is its own
|
|
4
|
+
* export, so a bundle keeps only the icons an interface imports.
|
|
5
|
+
*/
|
|
6
|
+
export declare class IconGlyph {
|
|
7
|
+
#private;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly component: LucideIcon;
|
|
10
|
+
constructor(name: string, component: LucideIcon);
|
|
11
|
+
}
|
|
12
|
+
export declare const iconArrowLeft: IconGlyph;
|
|
13
|
+
export declare const iconArrowRight: IconGlyph;
|
|
14
|
+
export declare const iconCheck: IconGlyph;
|
|
15
|
+
export declare const iconChevronDown: IconGlyph;
|
|
16
|
+
export declare const iconChevronRight: IconGlyph;
|
|
17
|
+
export declare const iconCircleAlert: IconGlyph;
|
|
18
|
+
export declare const iconCircleCheck: IconGlyph;
|
|
19
|
+
export declare const iconClock: IconGlyph;
|
|
20
|
+
export declare const iconCopy: IconGlyph;
|
|
21
|
+
export declare const iconDiagram: IconGlyph;
|
|
22
|
+
export declare const iconExternalLink: IconGlyph;
|
|
23
|
+
export declare const iconHistory: IconGlyph;
|
|
24
|
+
export declare const iconInfo: IconGlyph;
|
|
25
|
+
export declare const iconLoader: IconGlyph;
|
|
26
|
+
export declare const iconMessage: IconGlyph;
|
|
27
|
+
export declare const iconNotepad: IconGlyph;
|
|
28
|
+
export declare const iconPencil: IconGlyph;
|
|
29
|
+
export declare const iconPlus: IconGlyph;
|
|
30
|
+
export declare const iconRefresh: IconGlyph;
|
|
31
|
+
export declare const iconSearch: IconGlyph;
|
|
32
|
+
export declare const iconSend: IconGlyph;
|
|
33
|
+
export declare const iconTriangleAlert: IconGlyph;
|
|
34
|
+
export declare const iconX: IconGlyph;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import type { IconGlyph } from "../Icon/icons";
|
|
3
|
+
export type IconButtonVariant = "primary" | "secondary" | "ghost";
|
|
4
|
+
export interface IconButtonProps extends Omit<ComponentProps<"button">, "children" | "aria-label"> {
|
|
5
|
+
icon: IconGlyph;
|
|
6
|
+
/** The action's name: read by assistive technologies and shown as a tooltip. */
|
|
7
|
+
label: string;
|
|
8
|
+
variant?: IconButtonVariant;
|
|
9
|
+
}
|
|
10
|
+
export declare function IconButton({ icon, label, variant, type, title, className, ...rest }: IconButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export type LinkVariant = "accent" | "muted";
|
|
3
|
+
export interface LinkProps extends ComponentProps<"a"> {
|
|
4
|
+
href: string;
|
|
5
|
+
/** accent: a link in running text or a navigation link; muted: a secondary link, such as a breadcrumb step. */
|
|
6
|
+
variant?: LinkVariant;
|
|
7
|
+
}
|
|
8
|
+
export declare function Link({ variant, className, children, ...rest }: LinkProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type Connection = "live" | "offline";
|
|
2
|
+
export interface LiveIndicatorProps {
|
|
3
|
+
/** live: the page receives updates; offline: it lost its connection. */
|
|
4
|
+
connection: Connection;
|
|
5
|
+
/** The visible text; "Live" or "Offline" by default. */
|
|
6
|
+
label?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Whether the page is receiving live updates: a dot and a word. */
|
|
10
|
+
export declare function LiveIndicator({ connection, label, className }: LiveIndicatorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import type { Tone } from "../../internal/tone";
|
|
3
|
+
import type { IconGlyph } from "../Icon/icons";
|
|
4
|
+
export type PillButtonVariant = "tinted" | "outline";
|
|
5
|
+
export interface PillButtonProps extends Omit<ComponentProps<"button">, "children"> {
|
|
6
|
+
tone?: Tone;
|
|
7
|
+
/** tinted: the tone's background; outline: the surface, edged in the tone. */
|
|
8
|
+
variant?: PillButtonVariant;
|
|
9
|
+
icon?: IconGlyph;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** A compact rounded button for a small count or a short action, such as "+2" or "3 hidden". */
|
|
13
|
+
export declare function PillButton({ tone, variant, icon, type, className, children, ...rest }: PillButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface ProgressBarProps {
|
|
3
|
+
value: number;
|
|
4
|
+
max: number;
|
|
5
|
+
/** Names the bar for assistive technologies, such as "Tasks done". */
|
|
6
|
+
label: string;
|
|
7
|
+
/** A short text after the bar, such as "2/4". */
|
|
8
|
+
valueText?: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/** How far a task has gone: a short bar, filled in the running tone, in the success tone once complete. */
|
|
12
|
+
export declare function ProgressBar({ value, max, label, valueText, className }: ProgressBarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type ProseDensity = "block" | "inline";
|
|
3
|
+
export interface ProseProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* block: a long text in the full block grammar, such as a body rendered from Markdown;
|
|
6
|
+
* inline: a one-line text inside a row, such as a radio label or a list item, in the inline grammar only and without block margins.
|
|
7
|
+
*/
|
|
8
|
+
density?: ProseDensity;
|
|
9
|
+
/** The rendered text: paragraphs, headings, lists, code, tables, quotes, and links made with `Link`. */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** Styles rendered rich text, such as the output of a Markdown renderer, with the design system's tokens. */
|
|
13
|
+
export declare function Prose({ density, className, children, ...rest }: ProseProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
export interface ChoiceProps extends Omit<ComponentProps<"input">, "type" | "children"> {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
/** A second line under the label. */
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** A radio button or a checkbox with its label, the whole row being the touch target. */
|
|
8
|
+
export declare function Choice({ type, label, description, className, ...rest }: ChoiceProps & {
|
|
9
|
+
type: "radio" | "checkbox";
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type ScrollAxis = "vertical" | "horizontal" | "both";
|
|
3
|
+
export interface ScrollAreaProps {
|
|
4
|
+
/** Names the region for assistive technologies; it is focusable so that the keyboard can scroll it. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The directions the content may scroll in; vertical by default. */
|
|
7
|
+
axis?: ScrollAxis;
|
|
8
|
+
className?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/** A region that scrolls its content within itself, with thin scrollbars, reachable and scrollable by keyboard. */
|
|
12
|
+
export declare function ScrollArea({ label, axis, className, children }: ScrollAreaProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SwitchOption<T extends string> {
|
|
3
|
+
id: T;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export interface SegmentedControlProps<T extends string> {
|
|
7
|
+
options: readonly SwitchOption<T>[];
|
|
8
|
+
value: T;
|
|
9
|
+
onChange: (value: T) => void;
|
|
10
|
+
/** Names the group for assistive technologies. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Takes the width of its container, its options sharing it equally. */
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A choice between a few views, side by side in one track, the selected one filled; no option changes size. */
|
|
17
|
+
export declare function SegmentedControl<T extends string>({ options, value, onChange, label, fullWidth, className }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import type { Tone } from "../../internal/tone";
|
|
3
|
+
export interface StatusBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** waiting: the user has to act; info: someone else is working; success: done; neutral: closed or idle; danger: failed. */
|
|
5
|
+
tone: Tone;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** The status of an item or of a view, such as "Waiting for you" or "Confirmed". */
|
|
9
|
+
export declare function StatusBadge({ tone, className, children, ...rest }: StatusBadgeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The state a dot shows. info: running; queued: waiting for its turn; waiting: for the user; success: done;
|
|
3
|
+
* danger: failed; neutral: ready, not started; inactive: blocked or out of play.
|
|
4
|
+
*/
|
|
5
|
+
export type DotStatus = "neutral" | "info" | "queued" | "waiting" | "success" | "danger" | "inactive";
|
|
6
|
+
export interface StatusDotProps {
|
|
7
|
+
status: DotStatus;
|
|
8
|
+
/** The state's name, read by assistive technologies; without it, the dot is decorative. */
|
|
9
|
+
label?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/** A small dot in the tone of a state, filled for an active state, outlined for one that has not started. */
|
|
13
|
+
export declare function StatusDot({ status, label, className }: StatusDotProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { SwitchOption } from "../SegmentedControl/SegmentedControl";
|
|
3
|
+
export interface TabsProps<T extends string> {
|
|
4
|
+
tabs: readonly SwitchOption<T>[];
|
|
5
|
+
value: T;
|
|
6
|
+
onChange: (value: T) => void;
|
|
7
|
+
/** Names the tab list for assistive technologies. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** One panel per tab, keyed by the tab's id. */
|
|
10
|
+
panels: Readonly<Record<T, ReactNode>>;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Tabs sharing the full width over panels drawn in one grid cell: only the selected panel shows, the others stay laid
|
|
15
|
+
* out but hidden and inert, so the cell keeps the tallest panel's height and switching moves nothing below.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Tabs<T extends string>({ tabs, value, onChange, label, panels, className }: TabsProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
export interface TextAreaProps extends Omit<ComponentProps<"textarea">, "children" | "className"> {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
/** A help text below the field. */
|
|
5
|
+
hint?: ReactNode;
|
|
6
|
+
/** An error message below the field; the field shows its error state while it is set. */
|
|
7
|
+
error?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function TextArea({ label, hint, error, className, id, rows, ...rest }: TextAreaProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
export interface TextFieldProps extends Omit<ComponentProps<"input">, "children" | "className"> {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
/** A help text below the field. */
|
|
5
|
+
hint?: ReactNode;
|
|
6
|
+
/** An error message below the field; the field shows its error state while it is set. */
|
|
7
|
+
error?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function TextField({ label, hint, error, className, id, type, ...rest }: TextFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface TruncatedPathProps {
|
|
2
|
+
/** A path whose segments are separated by "/". */
|
|
3
|
+
path: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/** A file path on one line, shortened in its middle: the directory gives way first, the file name stays whole. */
|
|
7
|
+
export declare function TruncatedPath({ path, className }: TruncatedPathProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface VisuallyHiddenProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/** Text read by assistive technologies and never drawn, such as the full name of a compact item. */
|
|
7
|
+
export declare function VisuallyHidden({ className, children }: VisuallyHiddenProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
IBM Plex Sans: Copyright 2019 IBM Corp. All rights reserved.
|
|
2
|
+
IBM Plex Mono: Copyright 2017 IBM Corp. All rights reserved.
|
|
3
|
+
|
|
4
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
5
|
+
This license is copied below, and is also available with a FAQ at:
|
|
6
|
+
http://scripts.sil.org/OFL
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
11
|
+
-----------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
PREAMBLE
|
|
14
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
15
|
+
development of collaborative font projects, to support the font creation
|
|
16
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
17
|
+
open framework in which fonts may be shared and improved in partnership
|
|
18
|
+
with others.
|
|
19
|
+
|
|
20
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
21
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
22
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
23
|
+
redistributed and/or sold with any software provided that any reserved
|
|
24
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
25
|
+
however, cannot be released under any other type of license. The
|
|
26
|
+
requirement for fonts to remain under this license does not apply
|
|
27
|
+
to any document created using the fonts or their derivatives.
|
|
28
|
+
|
|
29
|
+
DEFINITIONS
|
|
30
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
31
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
32
|
+
include source files, build scripts and documentation.
|
|
33
|
+
|
|
34
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
35
|
+
copyright statement(s).
|
|
36
|
+
|
|
37
|
+
"Original Version" refers to the collection of Font Software components as
|
|
38
|
+
distributed by the Copyright Holder(s).
|
|
39
|
+
|
|
40
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
41
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
42
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
43
|
+
new environment.
|
|
44
|
+
|
|
45
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
46
|
+
writer or other person who contributed to the Font Software.
|
|
47
|
+
|
|
48
|
+
PERMISSION & CONDITIONS
|
|
49
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
50
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
51
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
52
|
+
Software, subject to the following conditions:
|
|
53
|
+
|
|
54
|
+
1) Neither the Font Software nor any of its individual components,
|
|
55
|
+
in Original or Modified Versions, may be sold by itself.
|
|
56
|
+
|
|
57
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
58
|
+
redistributed and/or sold with any software, provided that each copy
|
|
59
|
+
contains the above copyright notice and this license. These can be
|
|
60
|
+
included either as stand-alone text files, human-readable headers or
|
|
61
|
+
in the appropriate machine-readable metadata fields within text or
|
|
62
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
63
|
+
|
|
64
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
65
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
66
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
67
|
+
presented to the users.
|
|
68
|
+
|
|
69
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
70
|
+
Software shall not be used to promote, endorse or advertise any
|
|
71
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
72
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
73
|
+
permission.
|
|
74
|
+
|
|
75
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
76
|
+
must be distributed entirely under this license, and must not be
|
|
77
|
+
distributed under any other license. The requirement for fonts to
|
|
78
|
+
remain under this license does not apply to any document created
|
|
79
|
+
using the Font Software.
|
|
80
|
+
|
|
81
|
+
TERMINATION
|
|
82
|
+
This license becomes null and void if any of the above conditions are
|
|
83
|
+
not met.
|
|
84
|
+
|
|
85
|
+
DISCLAIMER
|
|
86
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
87
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
88
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
89
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
90
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
91
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
92
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
93
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
94
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|