@sovereignfs/ui 0.21.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/LICENSE +661 -0
- package/NOTICE +24 -0
- package/dist/Avatar.module.css +38 -0
- package/dist/Badge.module.css +88 -0
- package/dist/Button.module.css +77 -0
- package/dist/Card.module.css +34 -0
- package/dist/Dialog.module.css +188 -0
- package/dist/Drawer.module.css +30 -0
- package/dist/EmptyState.module.css +27 -0
- package/dist/FormField.module.css +28 -0
- package/dist/Icon.module.css +22 -0
- package/dist/Input.module.css +37 -0
- package/dist/NavTabs.module.css +48 -0
- package/dist/PageHeader.module.css +32 -0
- package/dist/Popover.module.css +44 -0
- package/dist/SegmentedControl.module.css +53 -0
- package/dist/Select.module.css +69 -0
- package/dist/Spinner.module.css +39 -0
- package/dist/SystemBanner.module.css +67 -0
- package/dist/Tabs.module.css +49 -0
- package/dist/Toast.module.css +130 -0
- package/dist/Toggle.module.css +52 -0
- package/dist/Tooltip.module.css +51 -0
- package/dist/index.d.ts +327 -0
- package/dist/index.js +1370 -0
- package/dist/tokens/primitives.css +99 -0
- package/dist/tokens/semantic.css +111 -0
- package/dist/tokens.css +5 -0
- package/package.json +50 -0
- package/src/components/Avatar/Avatar.module.css +38 -0
- package/src/components/Avatar/Avatar.tsx +42 -0
- package/src/components/Badge/Badge.module.css +88 -0
- package/src/components/Badge/Badge.stories.tsx +118 -0
- package/src/components/Badge/Badge.tsx +59 -0
- package/src/components/Badge/__tests__/Badge.test.tsx +64 -0
- package/src/components/Button/Button.module.css +77 -0
- package/src/components/Button/Button.stories.tsx +76 -0
- package/src/components/Button/Button.tsx +36 -0
- package/src/components/Button/__tests__/Button.test.tsx +37 -0
- package/src/components/Card/Card.module.css +34 -0
- package/src/components/Card/Card.tsx +34 -0
- package/src/components/Dialog/Dialog.module.css +188 -0
- package/src/components/Dialog/Dialog.stories.tsx +97 -0
- package/src/components/Dialog/Dialog.tsx +137 -0
- package/src/components/Dialog/__tests__/Dialog.test.tsx +73 -0
- package/src/components/Drawer/Drawer.module.css +30 -0
- package/src/components/Drawer/Drawer.stories.tsx +88 -0
- package/src/components/Drawer/Drawer.tsx +103 -0
- package/src/components/Drawer/__tests__/Drawer.test.tsx +56 -0
- package/src/components/EmptyState/EmptyState.module.css +27 -0
- package/src/components/EmptyState/EmptyState.tsx +27 -0
- package/src/components/FormField/FormField.module.css +28 -0
- package/src/components/FormField/FormField.tsx +53 -0
- package/src/components/Icon/Icon.module.css +22 -0
- package/src/components/Icon/Icon.stories.tsx +94 -0
- package/src/components/Icon/Icon.tsx +43 -0
- package/src/components/Icon/__tests__/Icon.test.tsx +40 -0
- package/src/components/Icon/icons/activity.tsx +20 -0
- package/src/components/Icon/icons/alert-triangle.tsx +22 -0
- package/src/components/Icon/icons/bell.tsx +21 -0
- package/src/components/Icon/icons/check.tsx +20 -0
- package/src/components/Icon/icons/chevron-down.tsx +20 -0
- package/src/components/Icon/icons/chevron-left.tsx +20 -0
- package/src/components/Icon/icons/chevron-right.tsx +20 -0
- package/src/components/Icon/icons/chevron-up.tsx +20 -0
- package/src/components/Icon/icons/eye-off.tsx +23 -0
- package/src/components/Icon/icons/eye.tsx +21 -0
- package/src/components/Icon/icons/grid-2x2.tsx +22 -0
- package/src/components/Icon/icons/house.tsx +21 -0
- package/src/components/Icon/icons/index.ts +122 -0
- package/src/components/Icon/icons/info.tsx +22 -0
- package/src/components/Icon/icons/lock.tsx +21 -0
- package/src/components/Icon/icons/log-out.tsx +22 -0
- package/src/components/Icon/icons/mail.tsx +21 -0
- package/src/components/Icon/icons/package.tsx +23 -0
- package/src/components/Icon/icons/pencil.tsx +21 -0
- package/src/components/Icon/icons/plus.tsx +21 -0
- package/src/components/Icon/icons/rotate-ccw.tsx +21 -0
- package/src/components/Icon/icons/search.tsx +21 -0
- package/src/components/Icon/icons/settings.tsx +21 -0
- package/src/components/Icon/icons/shield.tsx +20 -0
- package/src/components/Icon/icons/sliders-horizontal.tsx +28 -0
- package/src/components/Icon/icons/terminal.tsx +19 -0
- package/src/components/Icon/icons/trash-2.tsx +24 -0
- package/src/components/Icon/icons/user.tsx +21 -0
- package/src/components/Icon/icons/x.tsx +21 -0
- package/src/components/Input/Input.module.css +37 -0
- package/src/components/Input/Input.stories.tsx +86 -0
- package/src/components/Input/Input.tsx +14 -0
- package/src/components/Input/__tests__/Input.test.tsx +22 -0
- package/src/components/NavTabs/NavTabs.module.css +48 -0
- package/src/components/NavTabs/NavTabs.tsx +33 -0
- package/src/components/PageHeader/PageHeader.module.css +32 -0
- package/src/components/PageHeader/PageHeader.tsx +21 -0
- package/src/components/Popover/Popover.module.css +44 -0
- package/src/components/Popover/Popover.stories.tsx +232 -0
- package/src/components/Popover/Popover.tsx +75 -0
- package/src/components/Popover/__tests__/Popover.test.tsx +98 -0
- package/src/components/SegmentedControl/SegmentedControl.module.css +53 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +118 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +56 -0
- package/src/components/SegmentedControl/__tests__/SegmentedControl.test.tsx +63 -0
- package/src/components/Select/Select.module.css +69 -0
- package/src/components/Select/Select.stories.tsx +115 -0
- package/src/components/Select/Select.tsx +40 -0
- package/src/components/Select/__tests__/Select.test.tsx +59 -0
- package/src/components/Spinner/Spinner.module.css +39 -0
- package/src/components/Spinner/Spinner.tsx +23 -0
- package/src/components/SystemBanner/SystemBanner.module.css +67 -0
- package/src/components/SystemBanner/SystemBanner.stories.tsx +86 -0
- package/src/components/SystemBanner/SystemBanner.tsx +50 -0
- package/src/components/SystemBanner/__tests__/SystemBanner.test.tsx +50 -0
- package/src/components/Tabs/Tabs.module.css +49 -0
- package/src/components/Tabs/Tabs.stories.tsx +100 -0
- package/src/components/Tabs/Tabs.tsx +46 -0
- package/src/components/Tabs/__tests__/Tabs.test.tsx +45 -0
- package/src/components/Toast/Toast.module.css +130 -0
- package/src/components/Toast/Toast.stories.tsx +191 -0
- package/src/components/Toast/Toast.tsx +139 -0
- package/src/components/Toggle/Toggle.module.css +52 -0
- package/src/components/Toggle/Toggle.stories.tsx +95 -0
- package/src/components/Toggle/Toggle.tsx +39 -0
- package/src/components/Toggle/__tests__/Toggle.test.tsx +47 -0
- package/src/components/Tooltip/Tooltip.module.css +51 -0
- package/src/components/Tooltip/Tooltip.tsx +30 -0
- package/src/css-modules.d.ts +4 -0
- package/src/index.ts +45 -0
- package/src/stories/Avatar.stories.tsx +44 -0
- package/src/stories/Card.stories.tsx +35 -0
- package/src/stories/DesignSystemOverview.stories.tsx +1683 -0
- package/src/stories/EmptyState.stories.tsx +33 -0
- package/src/stories/FormField.stories.tsx +47 -0
- package/src/stories/MobilePatterns.stories.tsx +1285 -0
- package/src/stories/NavTabs.stories.tsx +35 -0
- package/src/stories/PageHeader.stories.tsx +31 -0
- package/src/stories/Spinner.stories.tsx +25 -0
- package/src/stories/TokenGallery.stories.tsx +355 -0
- package/src/stories/Tooltip.stories.tsx +59 -0
- package/src/tokens/primitives.css +99 -0
- package/src/tokens/semantic.css +111 -0
- package/src/tokens.css +5 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes, SelectHTMLAttributes, ReactElement, InputHTMLAttributes, HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type BadgeVariant = 'role' | 'status' | 'mono';
|
|
5
|
+
type BadgeStatus = 'active' | 'enabled' | 'deactivated' | 'failed' | 'invited' | 'pending' | 'neutral';
|
|
6
|
+
interface BadgeProps {
|
|
7
|
+
variant?: BadgeVariant;
|
|
8
|
+
/** Only relevant when variant="status" — determines the dot colour. */
|
|
9
|
+
status?: BadgeStatus;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Badge — compact label for roles, lifecycle states, and type/version tags.
|
|
14
|
+
*
|
|
15
|
+
* - `role` neutral surface + border, semibold — for Owner / Admin / User
|
|
16
|
+
* - `status` tinted chip with leading colour dot — for Active / Deactivated / etc.
|
|
17
|
+
* - `mono` monospace font, neutral surface — for platform / community / v0.1.0
|
|
18
|
+
*/
|
|
19
|
+
declare function Badge({ variant, status, children }: BadgeProps): react.JSX.Element;
|
|
20
|
+
|
|
21
|
+
type IconName = 'house' | 'settings' | 'log-out' | 'chevron-right' | 'chevron-left' | 'chevron-down' | 'chevron-up' | 'x' | 'check' | 'plus' | 'trash-2' | 'pencil' | 'rotate-ccw' | 'search' | 'user' | 'shield' | 'lock' | 'eye' | 'eye-off' | 'mail' | 'bell' | 'activity' | 'package' | 'grid-2x2' | 'info' | 'alert-triangle' | 'sliders-horizontal' | 'terminal';
|
|
22
|
+
|
|
23
|
+
/** Decorative icon — visually meaningful but described by surrounding text. */
|
|
24
|
+
type DecorativeProps = {
|
|
25
|
+
'aria-hidden': true;
|
|
26
|
+
'aria-label'?: never;
|
|
27
|
+
};
|
|
28
|
+
/** Meaningful icon — standalone affordance that requires a label for screen readers. */
|
|
29
|
+
type MeaningfulProps = {
|
|
30
|
+
'aria-label': string;
|
|
31
|
+
'aria-hidden'?: never;
|
|
32
|
+
};
|
|
33
|
+
interface IconProps {
|
|
34
|
+
/** Name of the icon from the curated Sovereign set. */
|
|
35
|
+
name: IconName;
|
|
36
|
+
/** Visual size. Defaults to `"md"` (20 px). */
|
|
37
|
+
size?: 'sm' | 'md' | 'lg';
|
|
38
|
+
/** Additional CSS class applied to the SVG element. */
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* `<Icon>` — the Sovereign design system icon primitive.
|
|
43
|
+
*
|
|
44
|
+
* Icons are either **decorative** (described by surrounding text — pass `aria-hidden`)
|
|
45
|
+
* or **meaningful** (standalone affordance — pass `aria-label`):
|
|
46
|
+
*
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <Icon name="house" aria-hidden /> // decorative
|
|
49
|
+
* <Icon name="log-out" aria-label="Sign out" /> // meaningful
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* Color follows `currentColor` so an icon automatically inherits the text color
|
|
53
|
+
* of its container and recolors with theme changes — no extra CSS required.
|
|
54
|
+
*/
|
|
55
|
+
declare function Icon({ name, size, className, ...aria }: IconProps & (DecorativeProps | MeaningfulProps)): react.JSX.Element;
|
|
56
|
+
|
|
57
|
+
interface ToggleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'aria-label'> {
|
|
58
|
+
checked: boolean;
|
|
59
|
+
onChange: (checked: boolean) => void;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
'aria-label': string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Toggle — 38×22px binary switch for settings rows.
|
|
65
|
+
*
|
|
66
|
+
* Renders as `<button role="switch">` rather than a hidden `<input type="checkbox">`
|
|
67
|
+
* to avoid iOS VoiceOver focus quirks on visually styled checkboxes. The `aria-label`
|
|
68
|
+
* prop is required because the control has no visible text label of its own.
|
|
69
|
+
*/
|
|
70
|
+
declare function Toggle({ checked, onChange, disabled, className, ...rest }: ToggleProps): react.JSX.Element;
|
|
71
|
+
|
|
72
|
+
interface SegmentedOption<T extends string = string> {
|
|
73
|
+
label: string;
|
|
74
|
+
value: T;
|
|
75
|
+
}
|
|
76
|
+
interface SegmentedControlProps<T extends string = string> {
|
|
77
|
+
value: T;
|
|
78
|
+
onChange: (value: T) => void;
|
|
79
|
+
options: SegmentedOption<T>[];
|
|
80
|
+
size?: 'sm' | 'md';
|
|
81
|
+
'aria-label': string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* SegmentedControl — pill-based 2–3 option picker for inline use in table rows
|
|
85
|
+
* and dialogs (e.g. User / Admin / Owner role switcher).
|
|
86
|
+
*
|
|
87
|
+
* Renders as `<div role="radiogroup">` with `<button role="radio">` children —
|
|
88
|
+
* correct semantics without a native `<input type="radio">` (which needs an id/name
|
|
89
|
+
* pair and a `<form>` context to function correctly in all browsers).
|
|
90
|
+
*/
|
|
91
|
+
declare function SegmentedControl<T extends string = string>({ value, onChange, options, size, 'aria-label': ariaLabel, }: SegmentedControlProps<T>): react.JSX.Element;
|
|
92
|
+
|
|
93
|
+
interface TabItem {
|
|
94
|
+
label: string;
|
|
95
|
+
value: string;
|
|
96
|
+
}
|
|
97
|
+
interface TabsProps {
|
|
98
|
+
items: TabItem[];
|
|
99
|
+
value: string;
|
|
100
|
+
onChange: (value: string) => void;
|
|
101
|
+
'aria-label': string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Tabs — underline tab nav for section switching.
|
|
105
|
+
*
|
|
106
|
+
* Stateless: the active tab is fully controlled via `value` + `onChange`, so the
|
|
107
|
+
* caller owns state and controls the rendered panel content. This keeps the
|
|
108
|
+
* component RSC-compatible when wrapped by a client boundary upstream.
|
|
109
|
+
*
|
|
110
|
+
* Mobile: the tab bar scrolls horizontally with the native scrollbar hidden.
|
|
111
|
+
*/
|
|
112
|
+
declare function Tabs({ items, value, onChange, 'aria-label': ariaLabel }: TabsProps): react.JSX.Element;
|
|
113
|
+
|
|
114
|
+
type SelectProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> & {
|
|
115
|
+
/** 'md' (default) — standard form field height. 'sm' — compact for table cells and inline controls. */
|
|
116
|
+
size?: 'sm' | 'md';
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Select — styled wrapper around the native `<select>`. Inherits the same
|
|
120
|
+
* height, border, radius, and focus ring as `Input` for visual consistency.
|
|
121
|
+
* Uses the native picker on mobile — no custom dropdown, maximum a11y coverage.
|
|
122
|
+
*
|
|
123
|
+
* RSC-safe: presentational, no hooks, forwards all native select props.
|
|
124
|
+
*/
|
|
125
|
+
declare function Select({ className, size, children, ...rest }: SelectProps): react.JSX.Element;
|
|
126
|
+
|
|
127
|
+
type BannerVariant = 'info' | 'warning' | 'error';
|
|
128
|
+
interface SystemBannerProps {
|
|
129
|
+
variant?: BannerVariant;
|
|
130
|
+
/** Called when the user clicks ×. If omitted, no dismiss button is shown. */
|
|
131
|
+
onDismiss?: () => void;
|
|
132
|
+
children: ReactNode;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* SystemBanner — full-width sticky strip that shifts page content down.
|
|
136
|
+
*
|
|
137
|
+
* Used for platform-level notices: maintenance mode, license warnings, broadcast
|
|
138
|
+
* messages. Stack multiple banners by rendering multiple `<SystemBanner>` elements.
|
|
139
|
+
* The dismiss button is only rendered when `onDismiss` is provided.
|
|
140
|
+
*/
|
|
141
|
+
declare function SystemBanner({ variant, onDismiss, children }: SystemBannerProps): react.JSX.Element;
|
|
142
|
+
|
|
143
|
+
interface PopoverProps {
|
|
144
|
+
/** The element that opens the popover — rendered as-is; caller wires its onClick. */
|
|
145
|
+
trigger: ReactElement;
|
|
146
|
+
open: boolean;
|
|
147
|
+
onClose: () => void;
|
|
148
|
+
/** Which edge of the trigger the panel aligns to. Default: 'right'. */
|
|
149
|
+
align?: 'left' | 'right';
|
|
150
|
+
/** Panel width in px. Default: 288. */
|
|
151
|
+
width?: number;
|
|
152
|
+
'aria-label': string;
|
|
153
|
+
children: ReactNode;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Popover — floating panel anchored below a trigger element.
|
|
157
|
+
*
|
|
158
|
+
* Positioning is `position: absolute` inside a `position: relative` wrapper —
|
|
159
|
+
* no floating-ui dependency. Supports left/right alignment against the trigger edge.
|
|
160
|
+
* Closes on outside click or Escape. Does not trap focus (it is non-modal).
|
|
161
|
+
*/
|
|
162
|
+
declare function Popover({ trigger, open, onClose, align, width, 'aria-label': ariaLabel, children, }: PopoverProps): react.JSX.Element;
|
|
163
|
+
|
|
164
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive';
|
|
165
|
+
type ButtonSize = 'sm' | 'md';
|
|
166
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
167
|
+
variant?: ButtonVariant;
|
|
168
|
+
size?: ButtonSize;
|
|
169
|
+
children: ReactNode;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Button — the primitive interactive control. Presentational and RSC-safe: it
|
|
173
|
+
* holds no state and simply forwards props to the underlying `<button>`, so it
|
|
174
|
+
* renders in both Server and Client Components. All styling references `--sv-*`
|
|
175
|
+
* tokens via CSS Modules; there are no hardcoded values.
|
|
176
|
+
*/
|
|
177
|
+
declare function Button({ variant, size, type, className, children, ...rest }: ButtonProps): react.JSX.Element;
|
|
178
|
+
|
|
179
|
+
type InputProps = InputHTMLAttributes<HTMLInputElement>;
|
|
180
|
+
/**
|
|
181
|
+
* Input — the primitive text field. Presentational and RSC-safe: it forwards
|
|
182
|
+
* all native input props to the underlying `<input>`. Styling references
|
|
183
|
+
* `--sv-*` tokens via CSS Modules; there are no hardcoded values.
|
|
184
|
+
*/
|
|
185
|
+
declare function Input({ type, className, ...rest }: InputProps): react.JSX.Element;
|
|
186
|
+
|
|
187
|
+
type DialogSize = 'sm' | 'md' | 'lg' | 'full';
|
|
188
|
+
interface DialogProps {
|
|
189
|
+
/** Whether the dialog is shown. When false, nothing renders. */
|
|
190
|
+
open: boolean;
|
|
191
|
+
/** Called on Esc, scrim click, or the close button. */
|
|
192
|
+
onClose: () => void;
|
|
193
|
+
/** Panel size on desktop. Mobile always renders as a full-screen sheet. */
|
|
194
|
+
size?: DialogSize;
|
|
195
|
+
/** Accessible name for the dialog (sets `aria-label` on the panel). */
|
|
196
|
+
'aria-label'?: string;
|
|
197
|
+
/** On mobile: shown in the top bar alongside the close button so the title
|
|
198
|
+
* and dismiss affordance occupy the same row instead of stacking. */
|
|
199
|
+
title?: string;
|
|
200
|
+
children: ReactNode;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Dialog — a modal surface (scrim + panel) for overlay-shell plugins and any
|
|
204
|
+
* plugin that needs a dismissable layer. Router-agnostic: the caller decides
|
|
205
|
+
* what `onClose` does (the runtime's `@modal` slot wires it to `router.back()`).
|
|
206
|
+
*
|
|
207
|
+
* Behaviour: Esc and scrim-click dismiss; focus moves into the panel on open and
|
|
208
|
+
* is restored to the previously-focused element on close; Tab is trapped within
|
|
209
|
+
* the panel. Styling references `--sv-*` tokens only; on mobile the panel becomes
|
|
210
|
+
* a full-screen sheet regardless of `size`.
|
|
211
|
+
*/
|
|
212
|
+
declare function Dialog({ open, onClose, size, 'aria-label': ariaLabel, title, children, }: DialogProps): react.JSX.Element | null;
|
|
213
|
+
|
|
214
|
+
interface DrawerProps {
|
|
215
|
+
/** Whether the drawer is shown. When false, nothing renders. */
|
|
216
|
+
open: boolean;
|
|
217
|
+
/** Called on Esc or scrim click. */
|
|
218
|
+
onClose: () => void;
|
|
219
|
+
/** Accessible name for the drawer panel (sets `aria-label`). */
|
|
220
|
+
'aria-label'?: string;
|
|
221
|
+
children: ReactNode;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Drawer — a dismissable bottom-sheet panel. Used by the mobile shell for
|
|
225
|
+
* plugin navigation; also available to plugins for any bottom-up surface.
|
|
226
|
+
*
|
|
227
|
+
* Behaviour: Esc and scrim-click dismiss; focus moves to the first focusable
|
|
228
|
+
* element on open and is restored on close; Tab is trapped within the panel.
|
|
229
|
+
* The panel respects `env(safe-area-inset-bottom)` so it clears the home
|
|
230
|
+
* indicator in standalone/fullscreen mode. Shares dismissal conventions and
|
|
231
|
+
* tokens (`--sv-color-scrim`, `--sv-shadow-overlay`) with `Dialog`.
|
|
232
|
+
*/
|
|
233
|
+
declare function Drawer({ open, onClose, 'aria-label': ariaLabel, children }: DrawerProps): react.JSX.Element | null;
|
|
234
|
+
|
|
235
|
+
interface ToastItem {
|
|
236
|
+
id: string;
|
|
237
|
+
title: string;
|
|
238
|
+
message?: string;
|
|
239
|
+
/** `'info'` | `'success'` | `'warning'` | `'error'` | `'security'` | `'announcement'` */
|
|
240
|
+
category?: string;
|
|
241
|
+
/** Auto-dismiss delay in ms. Default 5000. Pass `0` to disable auto-dismiss. */
|
|
242
|
+
duration?: number;
|
|
243
|
+
exiting?: boolean;
|
|
244
|
+
}
|
|
245
|
+
interface ToastContextValue {
|
|
246
|
+
/** Show a toast notification. Returns the generated toast id. */
|
|
247
|
+
show(item: Omit<ToastItem, 'id'>): string;
|
|
248
|
+
/** Dismiss a toast by id. */
|
|
249
|
+
dismiss(id: string): void;
|
|
250
|
+
}
|
|
251
|
+
/** Consume the toast context to imperatively show toasts from any client component. */
|
|
252
|
+
declare function useToast(): ToastContextValue;
|
|
253
|
+
declare function ToastProvider({ children }: {
|
|
254
|
+
children: React.ReactNode;
|
|
255
|
+
}): react.JSX.Element;
|
|
256
|
+
|
|
257
|
+
interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
258
|
+
as?: 'div' | 'article' | 'li';
|
|
259
|
+
interactive?: boolean;
|
|
260
|
+
padding?: 'sm' | 'md' | 'lg';
|
|
261
|
+
children: ReactNode;
|
|
262
|
+
}
|
|
263
|
+
declare function Card({ as: Tag, interactive, padding, className, children, ...rest }: CardProps): react.JSX.Element;
|
|
264
|
+
|
|
265
|
+
interface FormFieldProps {
|
|
266
|
+
label: string;
|
|
267
|
+
hint?: string;
|
|
268
|
+
error?: string;
|
|
269
|
+
htmlFor?: string;
|
|
270
|
+
required?: boolean;
|
|
271
|
+
children: ReactNode;
|
|
272
|
+
className?: string;
|
|
273
|
+
}
|
|
274
|
+
declare function FormField({ label, hint, error, htmlFor, required, children, className, }: FormFieldProps): react.JSX.Element;
|
|
275
|
+
|
|
276
|
+
interface PageHeaderProps {
|
|
277
|
+
title: string;
|
|
278
|
+
description?: string;
|
|
279
|
+
action?: ReactNode;
|
|
280
|
+
className?: string;
|
|
281
|
+
}
|
|
282
|
+
declare function PageHeader({ title, description, action, className }: PageHeaderProps): react.JSX.Element;
|
|
283
|
+
|
|
284
|
+
interface EmptyStateProps {
|
|
285
|
+
icon?: IconName;
|
|
286
|
+
heading: string;
|
|
287
|
+
description?: string;
|
|
288
|
+
action?: ReactNode;
|
|
289
|
+
className?: string;
|
|
290
|
+
}
|
|
291
|
+
declare function EmptyState({ icon, heading, description, action, className }: EmptyStateProps): react.JSX.Element;
|
|
292
|
+
|
|
293
|
+
interface SpinnerProps {
|
|
294
|
+
size?: 'sm' | 'md' | 'lg';
|
|
295
|
+
label?: string;
|
|
296
|
+
className?: string;
|
|
297
|
+
}
|
|
298
|
+
declare function Spinner({ size, label, className }: SpinnerProps): react.JSX.Element;
|
|
299
|
+
|
|
300
|
+
interface AvatarProps {
|
|
301
|
+
name: string;
|
|
302
|
+
src?: string;
|
|
303
|
+
size?: 'sm' | 'md' | 'lg';
|
|
304
|
+
className?: string;
|
|
305
|
+
}
|
|
306
|
+
declare function Avatar({ name, src, size, className }: AvatarProps): react.JSX.Element;
|
|
307
|
+
|
|
308
|
+
interface NavTabItem {
|
|
309
|
+
label: string;
|
|
310
|
+
href: string;
|
|
311
|
+
active?: boolean;
|
|
312
|
+
}
|
|
313
|
+
interface NavTabsProps {
|
|
314
|
+
items: NavTabItem[];
|
|
315
|
+
className?: string;
|
|
316
|
+
'aria-label'?: string;
|
|
317
|
+
}
|
|
318
|
+
declare function NavTabs({ items, className, 'aria-label': ariaLabel }: NavTabsProps): react.JSX.Element;
|
|
319
|
+
|
|
320
|
+
interface TooltipProps {
|
|
321
|
+
content: string;
|
|
322
|
+
children: ReactElement;
|
|
323
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
324
|
+
}
|
|
325
|
+
declare function Tooltip({ content, children, side }: TooltipProps): react.JSX.Element;
|
|
326
|
+
|
|
327
|
+
export { Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeStatus, type BadgeVariant, type BannerVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Dialog, type DialogProps, type DialogSize, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, FormField, type FormFieldProps, Icon, type IconName, type IconProps, Input, type InputProps, type NavTabItem, NavTabs, type NavTabsProps, PageHeader, type PageHeaderProps, Popover, type PopoverProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, Spinner, type SpinnerProps, SystemBanner, type SystemBannerProps, type TabItem, Tabs, type TabsProps, type ToastContextValue, type ToastItem, ToastProvider, Toggle, type ToggleProps, Tooltip, type TooltipProps, useToast };
|