@openwarelabs/ui 0.0.0-stage → 0.1.1
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 +21 -0
- package/README.md +100 -2
- package/dist/components/Accordion/Accordion.d.cts +54 -0
- package/dist/components/Accordion/Accordion.d.ts +54 -0
- package/dist/components/Alert/Alert.d.cts +18 -0
- package/dist/components/Alert/Alert.d.ts +18 -0
- package/dist/components/Avatar/Avatar.d.cts +14 -0
- package/dist/components/Avatar/Avatar.d.ts +14 -0
- package/dist/components/Avatar/AvatarGroup.d.cts +28 -0
- package/dist/components/Avatar/AvatarGroup.d.ts +28 -0
- package/dist/components/Badge/Badge.d.cts +13 -0
- package/dist/components/Badge/Badge.d.ts +13 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.cts +33 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +33 -0
- package/dist/components/Button/Button.d.cts +42 -0
- package/dist/components/Button/Button.d.ts +42 -0
- package/dist/components/Button/ButtonGroup.d.cts +33 -0
- package/dist/components/Button/ButtonGroup.d.ts +33 -0
- package/dist/components/Calendar/Calendar.d.cts +31 -0
- package/dist/components/Calendar/Calendar.d.ts +31 -0
- package/dist/components/Calendar/DatePicker.d.cts +21 -0
- package/dist/components/Calendar/DatePicker.d.ts +21 -0
- package/dist/components/Calendar/dates.d.cts +15 -0
- package/dist/components/Calendar/dates.d.ts +15 -0
- package/dist/components/Card/Card.d.cts +18 -0
- package/dist/components/Card/Card.d.ts +18 -0
- package/dist/components/Checkbox/Checkbox.d.cts +59 -0
- package/dist/components/Checkbox/Checkbox.d.ts +59 -0
- package/dist/components/ChoiceCard/ChoiceCard.d.cts +14 -0
- package/dist/components/ChoiceCard/ChoiceCard.d.ts +14 -0
- package/dist/components/CodeBlock/CodeBlock.d.cts +50 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +50 -0
- package/dist/components/ColorPicker/ColorPicker.d.cts +62 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +62 -0
- package/dist/components/Combobox/Combobox.d.cts +42 -0
- package/dist/components/Combobox/Combobox.d.ts +42 -0
- package/dist/components/CommandPalette/CommandPalette.d.cts +27 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +27 -0
- package/dist/components/CommandPalette/filterCommands.d.cts +3 -0
- package/dist/components/CommandPalette/filterCommands.d.ts +3 -0
- package/dist/components/Dialog/Dialog.d.cts +42 -0
- package/dist/components/Dialog/Dialog.d.ts +42 -0
- package/dist/components/Drawer/Drawer.d.cts +23 -0
- package/dist/components/Drawer/Drawer.d.ts +23 -0
- package/dist/components/EmptyState/EmptyState.d.cts +18 -0
- package/dist/components/EmptyState/EmptyState.d.ts +18 -0
- package/dist/components/Field/Field.d.cts +18 -0
- package/dist/components/Field/Field.d.ts +18 -0
- package/dist/components/FileDropZone/FileDropZone.d.cts +29 -0
- package/dist/components/FileDropZone/FileDropZone.d.ts +29 -0
- package/dist/components/FileTree/FileTree.d.cts +29 -0
- package/dist/components/FileTree/FileTree.d.ts +29 -0
- package/dist/components/Input/Input.d.cts +18 -0
- package/dist/components/Input/Input.d.ts +18 -0
- package/dist/components/InputOTP/InputOTP.d.cts +31 -0
- package/dist/components/InputOTP/InputOTP.d.ts +31 -0
- package/dist/components/Kbd/Kbd.d.cts +5 -0
- package/dist/components/Kbd/Kbd.d.ts +5 -0
- package/dist/components/Layout/Layout.d.cts +50 -0
- package/dist/components/Layout/Layout.d.ts +50 -0
- package/dist/components/Marketing/Marketing.d.cts +39 -0
- package/dist/components/Marketing/Marketing.d.ts +39 -0
- package/dist/components/Menu/Menu.d.cts +43 -0
- package/dist/components/Menu/Menu.d.ts +43 -0
- package/dist/components/NavList/NavList.d.cts +27 -0
- package/dist/components/NavList/NavList.d.ts +27 -0
- package/dist/components/NumberField/NumberField.d.cts +23 -0
- package/dist/components/NumberField/NumberField.d.ts +23 -0
- package/dist/components/Pagination/Pagination.d.cts +24 -0
- package/dist/components/Pagination/Pagination.d.ts +24 -0
- package/dist/components/Popover/Popover.d.cts +30 -0
- package/dist/components/Popover/Popover.d.ts +30 -0
- package/dist/components/Progress/Progress.d.cts +41 -0
- package/dist/components/Progress/Progress.d.ts +41 -0
- package/dist/components/RadioGroup/RadioGroup.d.cts +36 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +36 -0
- package/dist/components/SearchField/SearchField.d.cts +17 -0
- package/dist/components/SearchField/SearchField.d.ts +17 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.cts +32 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +32 -0
- package/dist/components/Select/Select.d.cts +40 -0
- package/dist/components/Select/Select.d.ts +40 -0
- package/dist/components/Skeleton/Skeleton.d.cts +26 -0
- package/dist/components/Skeleton/Skeleton.d.ts +26 -0
- package/dist/components/Slider/Slider.d.cts +33 -0
- package/dist/components/Slider/Slider.d.ts +33 -0
- package/dist/components/Spinner/Spinner.d.cts +14 -0
- package/dist/components/Spinner/Spinner.d.ts +14 -0
- package/dist/components/Stat/Stat.d.cts +20 -0
- package/dist/components/Stat/Stat.d.ts +20 -0
- package/dist/components/Steps/Steps.d.cts +27 -0
- package/dist/components/Steps/Steps.d.ts +27 -0
- package/dist/components/Switch/Switch.d.cts +9 -0
- package/dist/components/Switch/Switch.d.ts +9 -0
- package/dist/components/Table/Table.d.cts +55 -0
- package/dist/components/Table/Table.d.ts +55 -0
- package/dist/components/Tabs/Tabs.d.cts +35 -0
- package/dist/components/Tabs/Tabs.d.ts +35 -0
- package/dist/components/Tag/Tag.d.cts +40 -0
- package/dist/components/Tag/Tag.d.ts +40 -0
- package/dist/components/Textarea/Textarea.d.cts +12 -0
- package/dist/components/Textarea/Textarea.d.ts +12 -0
- package/dist/components/Toast/Toast.d.cts +41 -0
- package/dist/components/Toast/Toast.d.ts +41 -0
- package/dist/components/Tooltip/Tooltip.d.cts +19 -0
- package/dist/components/Tooltip/Tooltip.d.ts +19 -0
- package/dist/components.css +5236 -0
- package/dist/fonts.css +3 -0
- package/dist/hooks/useControllableState.d.cts +5 -0
- package/dist/hooks/useControllableState.d.ts +5 -0
- package/dist/hooks/useFloating.d.cts +26 -0
- package/dist/hooks/useFloating.d.ts +26 -0
- package/dist/hooks/useIndicator.d.cts +8 -0
- package/dist/hooks/useIndicator.d.ts +8 -0
- package/dist/hooks/useMenuKeyboard.d.cts +12 -0
- package/dist/hooks/useMenuKeyboard.d.ts +12 -0
- package/dist/hooks/useModalDialog.d.cts +9 -0
- package/dist/hooks/useModalDialog.d.ts +9 -0
- package/dist/hooks/usePresence.d.cts +13 -0
- package/dist/hooks/usePresence.d.ts +13 -0
- package/dist/icons.d.cts +33 -0
- package/dist/icons.d.ts +33 -0
- package/dist/index.cjs +4622 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.cts +114 -0
- package/dist/index.d.ts +114 -0
- package/dist/index.js +4650 -0
- package/dist/index.js.map +7 -0
- package/dist/openware-ui.iife.js +8 -0
- package/dist/styles.css +5664 -0
- package/dist/tailwind.css +145 -0
- package/dist/tokens.css +427 -0
- package/dist/tokens.json +1163 -0
- package/dist/utils/brand.d.cts +30 -0
- package/dist/utils/brand.d.ts +30 -0
- package/dist/utils/copyText.d.cts +2 -0
- package/dist/utils/copyText.d.ts +2 -0
- package/dist/utils/cx.d.cts +4 -0
- package/dist/utils/cx.d.ts +4 -0
- package/dist/utils/resizeTextArea.d.cts +2 -0
- package/dist/utils/resizeTextArea.d.ts +2 -0
- package/dist/utils/text.d.cts +4 -0
- package/dist/utils/text.d.ts +4 -0
- package/package.json +83 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
/** A white pill with a brass dot that names a section, set just above its title. */
|
|
3
|
+
export declare function Chip({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
|
|
4
|
+
export interface SectionHeadingProps {
|
|
5
|
+
/** One to three words for the Chip above the title. */
|
|
6
|
+
eyebrow?: ReactNode;
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
/** One or two sentences under the title. */
|
|
9
|
+
intro?: ReactNode;
|
|
10
|
+
/** @default "start" */
|
|
11
|
+
align?: "start" | "center";
|
|
12
|
+
/** The heading level.
|
|
13
|
+
* @default "h2" */
|
|
14
|
+
as?: "h1" | "h2" | "h3";
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/** How a marketing section opens: a Chip, a big light title, then an intro in muted text. */
|
|
18
|
+
export declare function SectionHeading({ eyebrow, title, intro, align, as: Heading, className, }: SectionHeadingProps): import("react").JSX.Element;
|
|
19
|
+
export interface SiteHeaderProps {
|
|
20
|
+
/** Your logo or name, usually a link home. */
|
|
21
|
+
brand: ReactNode;
|
|
22
|
+
/** Links in the middle; hidden under 760px wide. */
|
|
23
|
+
nav?: ReactNode;
|
|
24
|
+
/** On the right: one primary Button with shape="pill". */
|
|
25
|
+
actions?: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/** The marketing site's header: a floating white pill over a blur, with a hairline border and a soft shadow. */
|
|
29
|
+
export declare function SiteHeader({ brand, nav, actions, className }: SiteHeaderProps): import("react").JSX.Element;
|
|
30
|
+
export interface DotGridProps extends HTMLAttributes<HTMLDivElement> {
|
|
31
|
+
/** Fades the dots out toward the edges.
|
|
32
|
+
* @default false */
|
|
33
|
+
fade?: boolean;
|
|
34
|
+
/** Turns the dots under the pointer brass.
|
|
35
|
+
* @default false */
|
|
36
|
+
interactive?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** A ground of 1px dots every 22px, like a sheet laid out for planning. Content goes inside. */
|
|
39
|
+
export declare function DotGrid({ fade, interactive, className, children, onPointerMove, ...props }: DotGridProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
/** A white pill with a brass dot that names a section, set just above its title. */
|
|
3
|
+
export declare function Chip({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
|
|
4
|
+
export interface SectionHeadingProps {
|
|
5
|
+
/** One to three words for the Chip above the title. */
|
|
6
|
+
eyebrow?: ReactNode;
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
/** One or two sentences under the title. */
|
|
9
|
+
intro?: ReactNode;
|
|
10
|
+
/** @default "start" */
|
|
11
|
+
align?: "start" | "center";
|
|
12
|
+
/** The heading level.
|
|
13
|
+
* @default "h2" */
|
|
14
|
+
as?: "h1" | "h2" | "h3";
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/** How a marketing section opens: a Chip, a big light title, then an intro in muted text. */
|
|
18
|
+
export declare function SectionHeading({ eyebrow, title, intro, align, as: Heading, className, }: SectionHeadingProps): import("react").JSX.Element;
|
|
19
|
+
export interface SiteHeaderProps {
|
|
20
|
+
/** Your logo or name, usually a link home. */
|
|
21
|
+
brand: ReactNode;
|
|
22
|
+
/** Links in the middle; hidden under 760px wide. */
|
|
23
|
+
nav?: ReactNode;
|
|
24
|
+
/** On the right: one primary Button with shape="pill". */
|
|
25
|
+
actions?: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/** The marketing site's header: a floating white pill over a blur, with a hairline border and a soft shadow. */
|
|
29
|
+
export declare function SiteHeader({ brand, nav, actions, className }: SiteHeaderProps): import("react").JSX.Element;
|
|
30
|
+
export interface DotGridProps extends HTMLAttributes<HTMLDivElement> {
|
|
31
|
+
/** Fades the dots out toward the edges.
|
|
32
|
+
* @default false */
|
|
33
|
+
fade?: boolean;
|
|
34
|
+
/** Turns the dots under the pointer brass.
|
|
35
|
+
* @default false */
|
|
36
|
+
interactive?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** A ground of 1px dots every 22px, like a sheet laid out for planning. Content goes inside. */
|
|
39
|
+
export declare function DotGrid({ fade, interactive, className, children, onPointerMove, ...props }: DotGridProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
export interface MenuProps {
|
|
3
|
+
/** The button that opens it, usually a Button. Menu adds the click handler and the aria attributes. */
|
|
4
|
+
trigger: ReactElement;
|
|
5
|
+
/** MenuItem, MenuLabel and MenuSeparator. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Names the menu for screen readers. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Which edge of the trigger it lines up with.
|
|
10
|
+
* @default "start" */
|
|
11
|
+
align?: "start" | "end";
|
|
12
|
+
/** Prefers opening upward. Either way it flips when there's no room.
|
|
13
|
+
* @default false */
|
|
14
|
+
above?: boolean;
|
|
15
|
+
/** CSS width; default fits the items, at least 200px. */
|
|
16
|
+
width?: number | string;
|
|
17
|
+
/** Starts open, for documentation and tests. */
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A dropdown menu of actions under a button. Opening it focuses the first item; the arrow keys, Home and End
|
|
23
|
+
* move; Escape closes it and returns focus to the button; a click outside or Tab closes it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Menu({ trigger, children, label, align, above, width, defaultOpen, className }: MenuProps): import("react").JSX.Element;
|
|
26
|
+
export interface MenuItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onSelect"> {
|
|
27
|
+
/** A 15px lucide-react icon before the label. */
|
|
28
|
+
icon?: ReactNode;
|
|
29
|
+
/** Runs the action; the menu then closes. */
|
|
30
|
+
onSelect?(): void;
|
|
31
|
+
/** Red, for actions that delete or can't be undone. */
|
|
32
|
+
destructive?: boolean;
|
|
33
|
+
/** Shown on the right, e.g. "⌘,". Only a shortcut that actually works. */
|
|
34
|
+
shortcut?: string;
|
|
35
|
+
}
|
|
36
|
+
/** One action in a Menu. */
|
|
37
|
+
export declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
/** A small uppercase heading for a group of items. */
|
|
39
|
+
export declare function MenuLabel({ children }: {
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}): import("react").JSX.Element;
|
|
42
|
+
/** A hairline between groups of items. */
|
|
43
|
+
export declare function MenuSeparator(): import("react").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
export interface MenuProps {
|
|
3
|
+
/** The button that opens it, usually a Button. Menu adds the click handler and the aria attributes. */
|
|
4
|
+
trigger: ReactElement;
|
|
5
|
+
/** MenuItem, MenuLabel and MenuSeparator. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Names the menu for screen readers. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Which edge of the trigger it lines up with.
|
|
10
|
+
* @default "start" */
|
|
11
|
+
align?: "start" | "end";
|
|
12
|
+
/** Prefers opening upward. Either way it flips when there's no room.
|
|
13
|
+
* @default false */
|
|
14
|
+
above?: boolean;
|
|
15
|
+
/** CSS width; default fits the items, at least 200px. */
|
|
16
|
+
width?: number | string;
|
|
17
|
+
/** Starts open, for documentation and tests. */
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A dropdown menu of actions under a button. Opening it focuses the first item; the arrow keys, Home and End
|
|
23
|
+
* move; Escape closes it and returns focus to the button; a click outside or Tab closes it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Menu({ trigger, children, label, align, above, width, defaultOpen, className }: MenuProps): import("react").JSX.Element;
|
|
26
|
+
export interface MenuItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onSelect"> {
|
|
27
|
+
/** A 15px lucide-react icon before the label. */
|
|
28
|
+
icon?: ReactNode;
|
|
29
|
+
/** Runs the action; the menu then closes. */
|
|
30
|
+
onSelect?(): void;
|
|
31
|
+
/** Red, for actions that delete or can't be undone. */
|
|
32
|
+
destructive?: boolean;
|
|
33
|
+
/** Shown on the right, e.g. "⌘,". Only a shortcut that actually works. */
|
|
34
|
+
shortcut?: string;
|
|
35
|
+
}
|
|
36
|
+
/** One action in a Menu. */
|
|
37
|
+
export declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
/** A small uppercase heading for a group of items. */
|
|
39
|
+
export declare function MenuLabel({ children }: {
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}): import("react").JSX.Element;
|
|
42
|
+
/** A hairline between groups of items. */
|
|
43
|
+
export declare function MenuSeparator(): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface NavListProps {
|
|
3
|
+
/** Names the navigation for screen readers, e.g. "Settings". */
|
|
4
|
+
label: string;
|
|
5
|
+
/** A muted heading above the items (vertical only). */
|
|
6
|
+
heading?: ReactNode;
|
|
7
|
+
/** `vertical` for a sidebar; `horizontal` scrolls sideways, for narrow screens.
|
|
8
|
+
* @default "vertical" */
|
|
9
|
+
orientation?: "vertical" | "horizontal";
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/** A list of places to go, the way a settings dialog's sidebar lists its sections. Place it on ow-canvas. */
|
|
14
|
+
export declare function NavList({ label, heading, orientation, children, className }: NavListProps): import("react").JSX.Element;
|
|
15
|
+
export interface NavItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
16
|
+
/** A 15px lucide-react icon. */
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
/** The current section: raised on a surface, its icon in the primary colour.
|
|
19
|
+
* @default false */
|
|
20
|
+
active?: boolean;
|
|
21
|
+
/** Makes the item a link to this address instead of a button. */
|
|
22
|
+
href?: string;
|
|
23
|
+
/** Muted text at the right: a count, a badge. */
|
|
24
|
+
end?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/** One place in a NavList: a button, or a link when given an href. */
|
|
27
|
+
export declare const NavItem: import("react").ForwardRefExoticComponent<NavItemProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface NavListProps {
|
|
3
|
+
/** Names the navigation for screen readers, e.g. "Settings". */
|
|
4
|
+
label: string;
|
|
5
|
+
/** A muted heading above the items (vertical only). */
|
|
6
|
+
heading?: ReactNode;
|
|
7
|
+
/** `vertical` for a sidebar; `horizontal` scrolls sideways, for narrow screens.
|
|
8
|
+
* @default "vertical" */
|
|
9
|
+
orientation?: "vertical" | "horizontal";
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/** A list of places to go, the way a settings dialog's sidebar lists its sections. Place it on ow-canvas. */
|
|
14
|
+
export declare function NavList({ label, heading, orientation, children, className }: NavListProps): import("react").JSX.Element;
|
|
15
|
+
export interface NavItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
16
|
+
/** A 15px lucide-react icon. */
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
/** The current section: raised on a surface, its icon in the primary colour.
|
|
19
|
+
* @default false */
|
|
20
|
+
active?: boolean;
|
|
21
|
+
/** Makes the item a link to this address instead of a button. */
|
|
22
|
+
href?: string;
|
|
23
|
+
/** Muted text at the right: a count, a badge. */
|
|
24
|
+
end?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/** One place in a NavList: a button, or a link when given an href. */
|
|
27
|
+
export declare const NavItem: import("react").ForwardRefExoticComponent<NavItemProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from "react";
|
|
2
|
+
export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "size" | "type" | "min" | "max" | "step"> {
|
|
3
|
+
/** The number, or null when empty. */
|
|
4
|
+
value?: number | null;
|
|
5
|
+
/** @default null */
|
|
6
|
+
defaultValue?: number | null;
|
|
7
|
+
onChange?(value: number | null): void;
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
/** How much the buttons and arrow keys change it. PageUp and PageDown move ten steps.
|
|
11
|
+
* @default 1 */
|
|
12
|
+
step?: number;
|
|
13
|
+
/** How the number is shown while the field isn't being edited, e.g. { style: "currency", currency: "EUR" }. */
|
|
14
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
15
|
+
/** @default "md" */
|
|
16
|
+
size?: "sm" | "md";
|
|
17
|
+
/** @default false */
|
|
18
|
+
isInvalid?: boolean;
|
|
19
|
+
/** Names the field when there's no visible label (Field gives it one). */
|
|
20
|
+
"aria-label"?: string;
|
|
21
|
+
}
|
|
22
|
+
/** A number with − and + buttons either side. Up and Down step it; the value is clamped to min and max. */
|
|
23
|
+
export declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from "react";
|
|
2
|
+
export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "size" | "type" | "min" | "max" | "step"> {
|
|
3
|
+
/** The number, or null when empty. */
|
|
4
|
+
value?: number | null;
|
|
5
|
+
/** @default null */
|
|
6
|
+
defaultValue?: number | null;
|
|
7
|
+
onChange?(value: number | null): void;
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
/** How much the buttons and arrow keys change it. PageUp and PageDown move ten steps.
|
|
11
|
+
* @default 1 */
|
|
12
|
+
step?: number;
|
|
13
|
+
/** How the number is shown while the field isn't being edited, e.g. { style: "currency", currency: "EUR" }. */
|
|
14
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
15
|
+
/** @default "md" */
|
|
16
|
+
size?: "sm" | "md";
|
|
17
|
+
/** @default false */
|
|
18
|
+
isInvalid?: boolean;
|
|
19
|
+
/** Names the field when there's no visible label (Field gives it one). */
|
|
20
|
+
"aria-label"?: string;
|
|
21
|
+
}
|
|
22
|
+
/** A number with − and + buttons either side. Up and Down step it; the value is clamped to min and max. */
|
|
23
|
+
export declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface PaginationProps {
|
|
2
|
+
/** The current page, starting at 1. */
|
|
3
|
+
page: number;
|
|
4
|
+
pageCount: number;
|
|
5
|
+
onPageChange(page: number): void;
|
|
6
|
+
/** Pages shown either side of the current one.
|
|
7
|
+
* @default 1 */
|
|
8
|
+
siblingCount?: number;
|
|
9
|
+
/** Pages always shown at each end.
|
|
10
|
+
* @default 1 */
|
|
11
|
+
boundaryCount?: number;
|
|
12
|
+
/** @default "md" */
|
|
13
|
+
size?: "sm" | "md";
|
|
14
|
+
/** Names the control for screen readers.
|
|
15
|
+
* @default "Pagination" */
|
|
16
|
+
label?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
type Item = number | "start-gap" | "end-gap";
|
|
20
|
+
/** The page numbers to show, with gaps where pages are skipped. */
|
|
21
|
+
export declare function paginationItems(page: number, pageCount: number, siblingCount?: number, boundaryCount?: number): Item[];
|
|
22
|
+
/** Moves through pages of results: previous, numbered pages with gaps, next. */
|
|
23
|
+
export declare function Pagination({ page, pageCount, onPageChange, siblingCount, boundaryCount, size, label, className, }: PaginationProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface PaginationProps {
|
|
2
|
+
/** The current page, starting at 1. */
|
|
3
|
+
page: number;
|
|
4
|
+
pageCount: number;
|
|
5
|
+
onPageChange(page: number): void;
|
|
6
|
+
/** Pages shown either side of the current one.
|
|
7
|
+
* @default 1 */
|
|
8
|
+
siblingCount?: number;
|
|
9
|
+
/** Pages always shown at each end.
|
|
10
|
+
* @default 1 */
|
|
11
|
+
boundaryCount?: number;
|
|
12
|
+
/** @default "md" */
|
|
13
|
+
size?: "sm" | "md";
|
|
14
|
+
/** Names the control for screen readers.
|
|
15
|
+
* @default "Pagination" */
|
|
16
|
+
label?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
type Item = number | "start-gap" | "end-gap";
|
|
20
|
+
/** The page numbers to show, with gaps where pages are skipped. */
|
|
21
|
+
export declare function paginationItems(page: number, pageCount: number, siblingCount?: number, boundaryCount?: number): Item[];
|
|
22
|
+
/** Moves through pages of results: previous, numbered pages with gaps, next. */
|
|
23
|
+
export declare function Pagination({ page, pageCount, onPageChange, siblingCount, boundaryCount, size, label, className, }: PaginationProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type Placement } from "../../hooks/useFloating.cjs";
|
|
3
|
+
export interface PopoverProps {
|
|
4
|
+
/** The button that opens it. Popover adds the click handler and aria attributes. */
|
|
5
|
+
trigger: ReactElement;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
/** @default false */
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
onOpenChange?(open: boolean): void;
|
|
11
|
+
/** Where it opens relative to the trigger; it flips when there's no room.
|
|
12
|
+
* @default "bottom-start" */
|
|
13
|
+
placement?: Placement;
|
|
14
|
+
/** A heading at the top that also names the popover for screen readers. */
|
|
15
|
+
title?: ReactNode;
|
|
16
|
+
/** Names the popover when there's no title. */
|
|
17
|
+
"aria-label"?: string;
|
|
18
|
+
/** Pixels, or any CSS width.
|
|
19
|
+
* @default 280 */
|
|
20
|
+
width?: number | string;
|
|
21
|
+
/** Moves focus into the popover when it opens.
|
|
22
|
+
* @default true */
|
|
23
|
+
autoFocus?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A small panel attached to a button, for a few controls or details that don't need a dialog.
|
|
28
|
+
* Escape, a click outside or the trigger closes it, and focus goes back to the trigger.
|
|
29
|
+
*/
|
|
30
|
+
export declare function Popover({ trigger, children, open, defaultOpen, onOpenChange, placement, title, "aria-label": ariaLabel, width, autoFocus, className, }: PopoverProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type Placement } from "../../hooks/useFloating.js";
|
|
3
|
+
export interface PopoverProps {
|
|
4
|
+
/** The button that opens it. Popover adds the click handler and aria attributes. */
|
|
5
|
+
trigger: ReactElement;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
/** @default false */
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
onOpenChange?(open: boolean): void;
|
|
11
|
+
/** Where it opens relative to the trigger; it flips when there's no room.
|
|
12
|
+
* @default "bottom-start" */
|
|
13
|
+
placement?: Placement;
|
|
14
|
+
/** A heading at the top that also names the popover for screen readers. */
|
|
15
|
+
title?: ReactNode;
|
|
16
|
+
/** Names the popover when there's no title. */
|
|
17
|
+
"aria-label"?: string;
|
|
18
|
+
/** Pixels, or any CSS width.
|
|
19
|
+
* @default 280 */
|
|
20
|
+
width?: number | string;
|
|
21
|
+
/** Moves focus into the popover when it opens.
|
|
22
|
+
* @default true */
|
|
23
|
+
autoFocus?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A small panel attached to a button, for a few controls or details that don't need a dialog.
|
|
28
|
+
* Escape, a click outside or the trigger closes it, and focus goes back to the trigger.
|
|
29
|
+
*/
|
|
30
|
+
export declare function Popover({ trigger, children, open, defaultOpen, onOpenChange, placement, title, "aria-label": ariaLabel, width, autoFocus, className, }: PopoverProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type ProgressTone = "primary" | "success" | "warning" | "danger";
|
|
3
|
+
export interface ProgressBarProps {
|
|
4
|
+
/** How far along, from 0 to max. Leave out for work of unknown length. */
|
|
5
|
+
value?: number;
|
|
6
|
+
/** @default 100 */
|
|
7
|
+
max?: number;
|
|
8
|
+
/** Shown above the bar, and names it for screen readers. */
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
/** Shows the value at the right of the label.
|
|
11
|
+
* @default true */
|
|
12
|
+
showValue?: boolean;
|
|
13
|
+
/** The text shown and read out for the value, e.g. "3 of 8 stages". Defaults to a percentage. */
|
|
14
|
+
valueLabel?: string;
|
|
15
|
+
/** sm is 4px, for a pipeline bar; md is 8px.
|
|
16
|
+
* @default "sm" */
|
|
17
|
+
size?: "sm" | "md";
|
|
18
|
+
/** @default "primary" */
|
|
19
|
+
tone?: ProgressTone;
|
|
20
|
+
"aria-label"?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/** How far a task has got: a thin bar, or a sliding segment when the length isn't known. */
|
|
24
|
+
export declare function ProgressBar({ value, max, label, showValue, valueLabel, size, tone, "aria-label": ariaLabel, className, }: ProgressBarProps): import("react").JSX.Element;
|
|
25
|
+
export interface ProgressCircleProps {
|
|
26
|
+
/** From 0 to max. Leave out to spin, for work of unknown length. */
|
|
27
|
+
value?: number;
|
|
28
|
+
/** @default 100 */
|
|
29
|
+
max?: number;
|
|
30
|
+
/** sm 16px, md 24px, lg 48px (lg shows the percentage inside).
|
|
31
|
+
* @default "md" */
|
|
32
|
+
size?: "sm" | "md" | "lg";
|
|
33
|
+
/** @default "primary" */
|
|
34
|
+
tone?: ProgressTone;
|
|
35
|
+
/** Names it for screen readers.
|
|
36
|
+
* @default "Progress" */
|
|
37
|
+
"aria-label"?: string;
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
/** Progress as a ring, for tight spaces: a row in a list, a file being uploaded. */
|
|
41
|
+
export declare function ProgressCircle({ value, max, size, tone, "aria-label": ariaLabel, className, }: ProgressCircleProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type ProgressTone = "primary" | "success" | "warning" | "danger";
|
|
3
|
+
export interface ProgressBarProps {
|
|
4
|
+
/** How far along, from 0 to max. Leave out for work of unknown length. */
|
|
5
|
+
value?: number;
|
|
6
|
+
/** @default 100 */
|
|
7
|
+
max?: number;
|
|
8
|
+
/** Shown above the bar, and names it for screen readers. */
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
/** Shows the value at the right of the label.
|
|
11
|
+
* @default true */
|
|
12
|
+
showValue?: boolean;
|
|
13
|
+
/** The text shown and read out for the value, e.g. "3 of 8 stages". Defaults to a percentage. */
|
|
14
|
+
valueLabel?: string;
|
|
15
|
+
/** sm is 4px, for a pipeline bar; md is 8px.
|
|
16
|
+
* @default "sm" */
|
|
17
|
+
size?: "sm" | "md";
|
|
18
|
+
/** @default "primary" */
|
|
19
|
+
tone?: ProgressTone;
|
|
20
|
+
"aria-label"?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/** How far a task has got: a thin bar, or a sliding segment when the length isn't known. */
|
|
24
|
+
export declare function ProgressBar({ value, max, label, showValue, valueLabel, size, tone, "aria-label": ariaLabel, className, }: ProgressBarProps): import("react").JSX.Element;
|
|
25
|
+
export interface ProgressCircleProps {
|
|
26
|
+
/** From 0 to max. Leave out to spin, for work of unknown length. */
|
|
27
|
+
value?: number;
|
|
28
|
+
/** @default 100 */
|
|
29
|
+
max?: number;
|
|
30
|
+
/** sm 16px, md 24px, lg 48px (lg shows the percentage inside).
|
|
31
|
+
* @default "md" */
|
|
32
|
+
size?: "sm" | "md" | "lg";
|
|
33
|
+
/** @default "primary" */
|
|
34
|
+
tone?: ProgressTone;
|
|
35
|
+
/** Names it for screen readers.
|
|
36
|
+
* @default "Progress" */
|
|
37
|
+
"aria-label"?: string;
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
/** Progress as a ring, for tight spaces: a row in a list, a file being uploaded. */
|
|
41
|
+
export declare function ProgressCircle({ value, max, size, tone, "aria-label": ariaLabel, className, }: ProgressCircleProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface RadioGroupProps {
|
|
3
|
+
/** The question, shown as the group's legend. */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** A muted line under the label. */
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
value?: string;
|
|
8
|
+
/** The starting choice when uncontrolled.
|
|
9
|
+
* @default "" */
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onChange?(value: string): void;
|
|
12
|
+
/** @default "vertical" */
|
|
13
|
+
orientation?: "vertical" | "horizontal";
|
|
14
|
+
/** `default` is a dot and a label; `cards` turns each option into a bordered card, for choices that need a description.
|
|
15
|
+
* @default "default" */
|
|
16
|
+
variant?: "default" | "cards";
|
|
17
|
+
/** An error under the options. */
|
|
18
|
+
error?: ReactNode;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** The form field name. Generated when left out. */
|
|
21
|
+
name?: string;
|
|
22
|
+
/** Radio options. */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** One choice from a few visible options. The arrow keys move between them, as with any radio group. */
|
|
27
|
+
export declare function RadioGroup({ label, description, value, defaultValue, onChange, orientation, variant, error, disabled, name, children, className, }: RadioGroupProps): import("react").JSX.Element;
|
|
28
|
+
export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "size"> {
|
|
29
|
+
value: string;
|
|
30
|
+
/** The label. */
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
/** A muted line under the label. */
|
|
33
|
+
description?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/** One option in a RadioGroup. */
|
|
36
|
+
export declare function Radio({ value, children, description, disabled, className, ...inputProps }: RadioProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface RadioGroupProps {
|
|
3
|
+
/** The question, shown as the group's legend. */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** A muted line under the label. */
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
value?: string;
|
|
8
|
+
/** The starting choice when uncontrolled.
|
|
9
|
+
* @default "" */
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onChange?(value: string): void;
|
|
12
|
+
/** @default "vertical" */
|
|
13
|
+
orientation?: "vertical" | "horizontal";
|
|
14
|
+
/** `default` is a dot and a label; `cards` turns each option into a bordered card, for choices that need a description.
|
|
15
|
+
* @default "default" */
|
|
16
|
+
variant?: "default" | "cards";
|
|
17
|
+
/** An error under the options. */
|
|
18
|
+
error?: ReactNode;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** The form field name. Generated when left out. */
|
|
21
|
+
name?: string;
|
|
22
|
+
/** Radio options. */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** One choice from a few visible options. The arrow keys move between them, as with any radio group. */
|
|
27
|
+
export declare function RadioGroup({ label, description, value, defaultValue, onChange, orientation, variant, error, disabled, name, children, className, }: RadioGroupProps): import("react").JSX.Element;
|
|
28
|
+
export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "size"> {
|
|
29
|
+
value: string;
|
|
30
|
+
/** The label. */
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
/** A muted line under the label. */
|
|
33
|
+
description?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/** One option in a RadioGroup. */
|
|
36
|
+
export declare function Radio({ value, children, description, disabled, className, ...inputProps }: RadioProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type InputProps } from "../Input/Input.cjs";
|
|
2
|
+
export interface SearchFieldProps extends Omit<InputProps, "value" | "defaultValue" | "onChange" | "type" | "startContent" | "endContent" | "onSubmit"> {
|
|
3
|
+
value?: string;
|
|
4
|
+
/** @default "" */
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
onChange?(value: string): void;
|
|
7
|
+
/** Called with the text when the person presses Enter. */
|
|
8
|
+
onSubmit?(value: string): void;
|
|
9
|
+
/** Shows a spinner in place of the clear button while results load.
|
|
10
|
+
* @default false */
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
/** Names the field when there's no visible label.
|
|
13
|
+
* @default "Search" */
|
|
14
|
+
"aria-label"?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A search box: a magnifier, the text, and a clear button once there's something to clear. Escape clears it. */
|
|
17
|
+
export declare const SearchField: import("react").ForwardRefExoticComponent<SearchFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type InputProps } from "../Input/Input.js";
|
|
2
|
+
export interface SearchFieldProps extends Omit<InputProps, "value" | "defaultValue" | "onChange" | "type" | "startContent" | "endContent" | "onSubmit"> {
|
|
3
|
+
value?: string;
|
|
4
|
+
/** @default "" */
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
onChange?(value: string): void;
|
|
7
|
+
/** Called with the text when the person presses Enter. */
|
|
8
|
+
onSubmit?(value: string): void;
|
|
9
|
+
/** Shows a spinner in place of the clear button while results load.
|
|
10
|
+
* @default false */
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
/** Names the field when there's no visible label.
|
|
13
|
+
* @default "Search" */
|
|
14
|
+
"aria-label"?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A search box: a magnifier, the text, and a clear button once there's something to clear. Escape clears it. */
|
|
17
|
+
export declare const SearchField: import("react").ForwardRefExoticComponent<SearchFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface SegmentedControlOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** A 16px icon before the label. With no label, give the option an aria-label. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
"aria-label"?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SegmentedControlProps {
|
|
11
|
+
options: SegmentedControlOption[];
|
|
12
|
+
value?: string;
|
|
13
|
+
/** The starting value when uncontrolled. Defaults to the first option. */
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
onChange?(value: string): void;
|
|
16
|
+
/** sm 28px, md 32px tall.
|
|
17
|
+
* @default "md" */
|
|
18
|
+
size?: "sm" | "md";
|
|
19
|
+
/** Stretches the segments to fill the container.
|
|
20
|
+
* @default false */
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
/** Names the choice for screen readers. */
|
|
23
|
+
"aria-label"?: string;
|
|
24
|
+
"aria-labelledby"?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Two to five mutually exclusive options in a well, with the chosen one raised: a view switch, a filter.
|
|
30
|
+
* It behaves like a radio group: the arrow keys move and choose.
|
|
31
|
+
*/
|
|
32
|
+
export declare function SegmentedControl({ options, value, defaultValue, onChange, size, fullWidth, disabled, className, ...aria }: SegmentedControlProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface SegmentedControlOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** A 16px icon before the label. With no label, give the option an aria-label. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
"aria-label"?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SegmentedControlProps {
|
|
11
|
+
options: SegmentedControlOption[];
|
|
12
|
+
value?: string;
|
|
13
|
+
/** The starting value when uncontrolled. Defaults to the first option. */
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
onChange?(value: string): void;
|
|
16
|
+
/** sm 28px, md 32px tall.
|
|
17
|
+
* @default "md" */
|
|
18
|
+
size?: "sm" | "md";
|
|
19
|
+
/** Stretches the segments to fill the container.
|
|
20
|
+
* @default false */
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
/** Names the choice for screen readers. */
|
|
23
|
+
"aria-label"?: string;
|
|
24
|
+
"aria-labelledby"?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Two to five mutually exclusive options in a well, with the chosen one raised: a view switch, a filter.
|
|
30
|
+
* It behaves like a radio group: the arrow keys move and choose.
|
|
31
|
+
*/
|
|
32
|
+
export declare function SegmentedControl({ options, value, defaultValue, onChange, size, fullWidth, disabled, className, ...aria }: SegmentedControlProps): import("react").JSX.Element;
|