@mercury-fx/ui 2.4.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 +21 -0
- package/README.md +44 -0
- package/dist/components/actions/Button/Button.d.ts +17 -0
- package/dist/components/actions/Button/index.d.ts +1 -0
- package/dist/components/actions/IconButton/IconButton.d.ts +24 -0
- package/dist/components/actions/IconButton/index.d.ts +1 -0
- package/dist/components/actions/Link/Link.d.ts +26 -0
- package/dist/components/actions/Link/index.d.ts +1 -0
- package/dist/components/data-display/Avatar/Avatar.d.ts +8 -0
- package/dist/components/data-display/Avatar/index.d.ts +1 -0
- package/dist/components/data-display/Badge/Badge.d.ts +8 -0
- package/dist/components/data-display/Badge/index.d.ts +1 -0
- package/dist/components/data-display/Blockquote/Blockquote.d.ts +18 -0
- package/dist/components/data-display/Blockquote/index.d.ts +1 -0
- package/dist/components/data-display/Card/Card.d.ts +9 -0
- package/dist/components/data-display/Card/index.d.ts +1 -0
- package/dist/components/data-display/Chart/Chart.d.ts +41 -0
- package/dist/components/data-display/Chart/index.d.ts +1 -0
- package/dist/components/data-display/Checklist/Checklist.d.ts +14 -0
- package/dist/components/data-display/Checklist/index.d.ts +1 -0
- package/dist/components/data-display/Chip/Chip.d.ts +13 -0
- package/dist/components/data-display/Chip/index.d.ts +1 -0
- package/dist/components/data-display/Code/Code.d.ts +22 -0
- package/dist/components/data-display/Code/index.d.ts +1 -0
- package/dist/components/data-display/DataList/DataList.d.ts +27 -0
- package/dist/components/data-display/DataList/index.d.ts +1 -0
- package/dist/components/data-display/Kbd/Kbd.d.ts +14 -0
- package/dist/components/data-display/Kbd/index.d.ts +1 -0
- package/dist/components/data-display/ListRow/ListRow.d.ts +16 -0
- package/dist/components/data-display/ListRow/index.d.ts +1 -0
- package/dist/components/data-display/Stat/Stat.d.ts +16 -0
- package/dist/components/data-display/Stat/index.d.ts +1 -0
- package/dist/components/data-display/Table/Table.d.ts +14 -0
- package/dist/components/data-display/Table/index.d.ts +1 -0
- package/dist/components/data-display/Tag/Tag.d.ts +9 -0
- package/dist/components/data-display/Tag/index.d.ts +1 -0
- package/dist/components/feedback/Alert/Alert.d.ts +11 -0
- package/dist/components/feedback/Alert/index.d.ts +1 -0
- package/dist/components/feedback/Callout/Callout.d.ts +26 -0
- package/dist/components/feedback/Callout/index.d.ts +1 -0
- package/dist/components/feedback/PasswordStrength/PasswordStrength.d.ts +13 -0
- package/dist/components/feedback/PasswordStrength/index.d.ts +1 -0
- package/dist/components/feedback/Progress/Progress.d.ts +9 -0
- package/dist/components/feedback/Progress/index.d.ts +1 -0
- package/dist/components/feedback/Skeleton/Skeleton.d.ts +19 -0
- package/dist/components/feedback/Skeleton/index.d.ts +1 -0
- package/dist/components/feedback/Spinner/Spinner.d.ts +18 -0
- package/dist/components/feedback/Spinner/index.d.ts +1 -0
- package/dist/components/foundations/Divider/Divider.d.ts +11 -0
- package/dist/components/foundations/Divider/index.d.ts +1 -0
- package/dist/components/foundations/Heading/Heading.d.ts +26 -0
- package/dist/components/foundations/Heading/index.d.ts +1 -0
- package/dist/components/foundations/Icon/Icon.d.ts +9 -0
- package/dist/components/foundations/Icon/index.d.ts +1 -0
- package/dist/components/foundations/Separator/Separator.d.ts +20 -0
- package/dist/components/foundations/Separator/index.d.ts +1 -0
- package/dist/components/foundations/Text/Text.d.ts +19 -0
- package/dist/components/foundations/Text/index.d.ts +1 -0
- package/dist/components/inputs/AuthCode/AuthCode.d.ts +10 -0
- package/dist/components/inputs/AuthCode/index.d.ts +1 -0
- package/dist/components/inputs/Calendar/Calendar.d.ts +24 -0
- package/dist/components/inputs/Calendar/index.d.ts +1 -0
- package/dist/components/inputs/DateField/DateField.d.ts +25 -0
- package/dist/components/inputs/DateField/index.d.ts +1 -0
- package/dist/components/inputs/Input/Input.d.ts +9 -0
- package/dist/components/inputs/Input/index.d.ts +1 -0
- package/dist/components/inputs/Label/Label.d.ts +20 -0
- package/dist/components/inputs/Label/index.d.ts +1 -0
- package/dist/components/inputs/MoneyInput/MoneyInput.d.ts +12 -0
- package/dist/components/inputs/MoneyInput/index.d.ts +1 -0
- package/dist/components/inputs/Search/Search.d.ts +7 -0
- package/dist/components/inputs/Search/index.d.ts +1 -0
- package/dist/components/inputs/Select/Select.d.ts +14 -0
- package/dist/components/inputs/Select/index.d.ts +1 -0
- package/dist/components/inputs/Textarea/Textarea.d.ts +9 -0
- package/dist/components/inputs/Textarea/index.d.ts +1 -0
- package/dist/components/layout/AspectRatio/AspectRatio.d.ts +14 -0
- package/dist/components/layout/AspectRatio/index.d.ts +1 -0
- package/dist/components/layout/AuthLayout/AuthLayout.d.ts +30 -0
- package/dist/components/layout/AuthLayout/index.d.ts +1 -0
- package/dist/components/layout/Box/Box.d.ts +35 -0
- package/dist/components/layout/Box/index.d.ts +1 -0
- package/dist/components/layout/Center/Center.d.ts +13 -0
- package/dist/components/layout/Center/index.d.ts +1 -0
- package/dist/components/layout/Cluster/Cluster.d.ts +18 -0
- package/dist/components/layout/Cluster/index.d.ts +1 -0
- package/dist/components/layout/Collapsible/Collapsible.d.ts +26 -0
- package/dist/components/layout/Collapsible/index.d.ts +1 -0
- package/dist/components/layout/Container/Container.d.ts +19 -0
- package/dist/components/layout/Container/index.d.ts +1 -0
- package/dist/components/layout/Flex/Flex.d.ts +24 -0
- package/dist/components/layout/Flex/index.d.ts +1 -0
- package/dist/components/layout/Grid/Grid.d.ts +26 -0
- package/dist/components/layout/Grid/index.d.ts +1 -0
- package/dist/components/layout/GridItem/GridItem.d.ts +19 -0
- package/dist/components/layout/GridItem/index.d.ts +1 -0
- package/dist/components/layout/ScrollArea/ScrollArea.d.ts +22 -0
- package/dist/components/layout/ScrollArea/index.d.ts +1 -0
- package/dist/components/layout/Section/Section.d.ts +18 -0
- package/dist/components/layout/Section/index.d.ts +1 -0
- package/dist/components/layout/Sidebar/Sidebar.d.ts +21 -0
- package/dist/components/layout/Sidebar/index.d.ts +1 -0
- package/dist/components/layout/Spacer/Spacer.d.ts +15 -0
- package/dist/components/layout/Spacer/index.d.ts +1 -0
- package/dist/components/layout/Stack/Stack.d.ts +20 -0
- package/dist/components/layout/Stack/index.d.ts +1 -0
- package/dist/components/layout/scales.d.ts +20 -0
- package/dist/components/navigation/Accordion/Accordion.d.ts +17 -0
- package/dist/components/navigation/Accordion/index.d.ts +1 -0
- package/dist/components/navigation/Menubar/Menubar.d.ts +53 -0
- package/dist/components/navigation/Menubar/index.d.ts +1 -0
- package/dist/components/navigation/Pagination/Pagination.d.ts +14 -0
- package/dist/components/navigation/Pagination/index.d.ts +1 -0
- package/dist/components/navigation/TabNav/TabNav.d.ts +38 -0
- package/dist/components/navigation/TabNav/index.d.ts +1 -0
- package/dist/components/navigation/Tabs/Tabs.d.ts +12 -0
- package/dist/components/navigation/Tabs/index.d.ts +1 -0
- package/dist/components/overlay/AlertDialog/AlertDialog.d.ts +33 -0
- package/dist/components/overlay/AlertDialog/index.d.ts +1 -0
- package/dist/components/overlay/ContextMenu/ContextMenu.d.ts +40 -0
- package/dist/components/overlay/ContextMenu/index.d.ts +1 -0
- package/dist/components/overlay/Dialog/Dialog.d.ts +33 -0
- package/dist/components/overlay/Dialog/index.d.ts +1 -0
- package/dist/components/overlay/Dropdown/Dropdown.d.ts +48 -0
- package/dist/components/overlay/Dropdown/index.d.ts +1 -0
- package/dist/components/overlay/HoverCard/HoverCard.d.ts +35 -0
- package/dist/components/overlay/HoverCard/index.d.ts +1 -0
- package/dist/components/overlay/LinkPreview/LinkPreview.d.ts +33 -0
- package/dist/components/overlay/LinkPreview/index.d.ts +1 -0
- package/dist/components/overlay/Modal/Modal.d.ts +10 -0
- package/dist/components/overlay/Modal/index.d.ts +1 -0
- package/dist/components/overlay/Popover/Popover.d.ts +35 -0
- package/dist/components/overlay/Popover/index.d.ts +1 -0
- package/dist/components/overlay/Tooltip/Tooltip.d.ts +6 -0
- package/dist/components/overlay/Tooltip/index.d.ts +1 -0
- package/dist/components/overlay/_overlay/Portal.d.ts +14 -0
- package/dist/components/selection/Checkbox/Checkbox.d.ts +12 -0
- package/dist/components/selection/Checkbox/index.d.ts +1 -0
- package/dist/components/selection/CheckboxCards/CheckboxCards.d.ts +20 -0
- package/dist/components/selection/CheckboxCards/index.d.ts +1 -0
- package/dist/components/selection/CheckboxGroup/CheckboxGroup.d.ts +17 -0
- package/dist/components/selection/CheckboxGroup/index.d.ts +1 -0
- package/dist/components/selection/Radio/Radio.d.ts +11 -0
- package/dist/components/selection/Radio/index.d.ts +1 -0
- package/dist/components/selection/RadioCards/RadioCards.d.ts +20 -0
- package/dist/components/selection/RadioCards/index.d.ts +1 -0
- package/dist/components/selection/RadioGroup/RadioGroup.d.ts +18 -0
- package/dist/components/selection/RadioGroup/index.d.ts +1 -0
- package/dist/components/selection/Segmented/Segmented.d.ts +13 -0
- package/dist/components/selection/Segmented/index.d.ts +1 -0
- package/dist/components/selection/Slider/Slider.d.ts +13 -0
- package/dist/components/selection/Slider/index.d.ts +1 -0
- package/dist/components/selection/Switch/Switch.d.ts +10 -0
- package/dist/components/selection/Switch/index.d.ts +1 -0
- package/dist/components/selection/Toggle/Toggle.d.ts +36 -0
- package/dist/components/selection/Toggle/index.d.ts +1 -0
- package/dist/index.d.ts +93 -0
- package/dist/mercury-ui.css +1 -0
- package/dist/mercury-ui.js +4049 -0
- package/package.json +58 -0
- package/src/styles/additions.css +1030 -0
- package/src/styles/fonts/DMMono-Italic.woff2 +0 -0
- package/src/styles/fonts/DMMono-Light.woff2 +0 -0
- package/src/styles/fonts/DMMono-LightItalic.woff2 +0 -0
- package/src/styles/fonts/DMMono-Medium.woff2 +0 -0
- package/src/styles/fonts/DMMono-MediumItalic.woff2 +0 -0
- package/src/styles/fonts/DMMono-Regular.woff2 +0 -0
- package/src/styles/fonts/DMSans-Bold.woff2 +0 -0
- package/src/styles/fonts/DMSans-BoldItalic.woff2 +0 -0
- package/src/styles/fonts/DMSans-Italic.woff2 +0 -0
- package/src/styles/fonts/DMSans-Medium.woff2 +0 -0
- package/src/styles/fonts/DMSans-MediumItalic.woff2 +0 -0
- package/src/styles/fonts/DMSans-Regular.woff2 +0 -0
- package/src/styles/fonts/DMSerifDisplay-Italic.woff2 +0 -0
- package/src/styles/fonts/DMSerifDisplay-Regular.woff2 +0 -0
- package/src/styles/index.css +5 -0
- package/src/styles/layout.css +55 -0
- package/src/styles/mercury.css +676 -0
- package/src/styles/tokens.css +438 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared scales + alignment maps for the Layout composition tier (mx.8.3).
|
|
3
|
+
*
|
|
4
|
+
* Token-scale props resolve to CSS custom properties (the `AspectRatio` non-color
|
|
5
|
+
* inline idiom, INV-2-legal); alignment props map to CSS Box-Alignment keywords
|
|
6
|
+
* that are valid in both flexbox and grid. No new token is defined here — these
|
|
7
|
+
* name existing `--space-*` / `--radius-*` scales.
|
|
8
|
+
*/
|
|
9
|
+
export type SpaceScale = "2" | "4" | "6" | "8" | "10" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "40" | "48" | "56" | "64" | "72" | "80" | "96" | "128";
|
|
10
|
+
export type RadiusScale = "2" | "4" | "6" | "8" | "12" | "16" | "20" | "24" | "32" | "full";
|
|
11
|
+
/** A space-scale step → its CSS custom property, e.g. `spaceVar("12")` → `"var(--space-12)"`. */
|
|
12
|
+
export declare const spaceVar: (s: SpaceScale) => string;
|
|
13
|
+
/** A radius-scale step → its CSS custom property, e.g. `radiusVar("8")` → `"var(--radius-8)"`. */
|
|
14
|
+
export declare const radiusVar: (r: RadiusScale) => string;
|
|
15
|
+
export type Align = "start" | "center" | "end" | "stretch" | "baseline";
|
|
16
|
+
export type Justify = "start" | "center" | "end" | "between" | "around" | "evenly";
|
|
17
|
+
/** `align` → `align-items` (Box-Alignment keywords; valid in flex + grid). */
|
|
18
|
+
export declare const ALIGN: Record<Align, string>;
|
|
19
|
+
/** `justify` → `justify-content` / `justify-items`. */
|
|
20
|
+
export declare const JUSTIFY: Record<Justify, string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export interface AccordionItemData {
|
|
3
|
+
value: string;
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
|
|
9
|
+
items: AccordionItemData[];
|
|
10
|
+
/** "single" (default) keeps one item open at a time; "multiple" allows many. */
|
|
11
|
+
type?: "single" | "multiple";
|
|
12
|
+
/** Initially-open value(s) for the uncontrolled accordion. */
|
|
13
|
+
defaultValue?: string | string[];
|
|
14
|
+
/** In single mode, allow the open item to collapse again. Default true. */
|
|
15
|
+
collapsible?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const Accordion: import("react").ForwardRefExoticComponent<AccordionProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Accordion";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { IconName } from "../../foundations/Icon";
|
|
3
|
+
/** One row of a {@link Menubar} submenu. `check`/`radio` carry state; a plain
|
|
4
|
+
* `item` runs `onSelect` and closes; `label`/`separator` are presentational. */
|
|
5
|
+
export interface MenubarItem {
|
|
6
|
+
/** Row kind. Default `"item"`. */
|
|
7
|
+
type?: "item" | "check" | "radio" | "label" | "separator";
|
|
8
|
+
/** The row's visible text. */
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
/** Stable id — required for a `check` row's toggle state. */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** The radio group's name (rows sharing it are mutually exclusive). */
|
|
13
|
+
group?: string;
|
|
14
|
+
/** The radio row's value (the selected value keys the group). */
|
|
15
|
+
value?: string;
|
|
16
|
+
/** Initial checked state for a `check`/`radio` row (thereafter uncontrolled). */
|
|
17
|
+
checked?: boolean;
|
|
18
|
+
/** A trailing key hint. */
|
|
19
|
+
shortcut?: string;
|
|
20
|
+
/** A leading icon (plain item rows). */
|
|
21
|
+
icon?: IconName;
|
|
22
|
+
/** Invoked on activation. */
|
|
23
|
+
onSelect?: () => void;
|
|
24
|
+
}
|
|
25
|
+
/** One top-level menu of a {@link Menubar}. */
|
|
26
|
+
export interface MenubarMenu {
|
|
27
|
+
/** The bar trigger's text. */
|
|
28
|
+
label: string;
|
|
29
|
+
/** A leading icon on the bar trigger. */
|
|
30
|
+
icon?: IconName;
|
|
31
|
+
/** The submenu rows, in order. */
|
|
32
|
+
items: MenubarItem[];
|
|
33
|
+
}
|
|
34
|
+
export interface MenubarProps {
|
|
35
|
+
/** The top-level menus, left to right. */
|
|
36
|
+
menus: MenubarMenu[];
|
|
37
|
+
/** The check-mark ink + radio-dot fill family. Default `"iris"`. */
|
|
38
|
+
accent?: "iris" | "indigo" | "green" | "orange" | "plum" | "red";
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Menubar — a horizontal bar of menus (a desktop-app menu strip). Each top menu
|
|
42
|
+
* opens a submenu that composes the overlay-floor: `useAnchoredPosition`
|
|
43
|
+
* (portaled, `position: fixed`) + `useDismiss` (outside-press + `Escape`, the
|
|
44
|
+
* whole bar ignored so a sibling trigger switches without a dismiss race) +
|
|
45
|
+
* `useArrowNavigation` (Up/Down within a submenu). `ArrowLeft`/`ArrowRight` on
|
|
46
|
+
* the bar move between the top triggers.
|
|
47
|
+
*
|
|
48
|
+
* a11y: the bar is `role="menubar"`; each trigger is `role="menuitem"` with
|
|
49
|
+
* `aria-haspopup="menu"` + `aria-expanded`; a submenu is `role="menu"` with
|
|
50
|
+
* `menuitem` / `menuitemcheckbox` / `menuitemradio` rows.
|
|
51
|
+
*/
|
|
52
|
+
export declare function Menubar({ menus, accent }: MenubarProps): import("react").JSX.Element;
|
|
53
|
+
export default Menubar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Menubar";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
|
|
3
|
+
/** 1-based current page. */
|
|
4
|
+
page: number;
|
|
5
|
+
/** Total number of pages. */
|
|
6
|
+
count: number;
|
|
7
|
+
onPageChange: (page: number) => void;
|
|
8
|
+
/** Pages shown on each side of the current page. Default 1. */
|
|
9
|
+
siblingCount?: number;
|
|
10
|
+
size?: "sm" | "md";
|
|
11
|
+
/** Optional caption rendered under the controls (e.g. "Showing 1 – 10"). */
|
|
12
|
+
caption?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const Pagination: import("react").ForwardRefExoticComponent<PaginationProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Pagination";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type TabNavSize = "sm" | "md";
|
|
3
|
+
export interface TabNavItem {
|
|
4
|
+
/** The item's stable value, matched against `value` to mark the active tab. */
|
|
5
|
+
value: string;
|
|
6
|
+
/** The visible label. */
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
/** The navigation target. Omit for a non-navigating tab (driven by `onChange`). */
|
|
9
|
+
href?: string;
|
|
10
|
+
/** Renders the tab dimmed + non-interactive. */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface TabNavProps {
|
|
14
|
+
/** The tabs, in order. */
|
|
15
|
+
items: TabNavItem[];
|
|
16
|
+
/** The active tab's `value` (controlled). */
|
|
17
|
+
value: string;
|
|
18
|
+
/** Notified with the clicked tab's `value` (unless disabled). */
|
|
19
|
+
onChange?: (value: string) => void;
|
|
20
|
+
/** Density. Default `"md"`. */
|
|
21
|
+
size?: TabNavSize;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* TabNav — link-styled navigation tabs: a `<nav>` of `<a aria-current="page">`
|
|
25
|
+
* anchors sharing an underline rail. Distinct from `Tabs`, which switches
|
|
26
|
+
* in-page panels — TabNav navigates (each tab is a real link with an `href`),
|
|
27
|
+
* so the active tab is the current *page*, not a selected panel.
|
|
28
|
+
*
|
|
29
|
+
* Controlled: `value` marks the active tab; `onChange` fires with the clicked
|
|
30
|
+
* tab's value (a disabled tab is inert — `preventDefault` + no `onChange`).
|
|
31
|
+
* Presentational — no floor, no portal, no internal state.
|
|
32
|
+
*
|
|
33
|
+
* a11y: the active anchor carries `aria-current="page"`; the `:focus-visible`
|
|
34
|
+
* ring is restored (the source prototype's `outline: none` was an a11y
|
|
35
|
+
* regression and is NOT carried over).
|
|
36
|
+
*/
|
|
37
|
+
export declare function TabNav({ items, value, onChange, size }: TabNavProps): import("react").JSX.Element;
|
|
38
|
+
export default TabNav;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TabNav";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Tab<T extends string> {
|
|
2
|
+
label: string;
|
|
3
|
+
value: T;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface TabsProps<T extends string> {
|
|
7
|
+
tabs: Tab<T>[];
|
|
8
|
+
value: T;
|
|
9
|
+
onChange?: (value: T) => void;
|
|
10
|
+
variant?: "underline" | "pills";
|
|
11
|
+
}
|
|
12
|
+
export declare function Tabs<T extends string>({ tabs, value, onChange, variant }: TabsProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Tabs";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export interface AlertDialogProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
3
|
+
/** Whether the confirmation is mounted + visible. Controlled. */
|
|
4
|
+
open: boolean;
|
|
5
|
+
/** The heading, wired to `aria-labelledby`. */
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
/** The prompt, wired to `aria-describedby`. */
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
/** Extra content between the description and the actions. */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/** The confirm action label. Default `"Confirm"`. */
|
|
12
|
+
confirmLabel?: string;
|
|
13
|
+
/** The cancel action label. Default `"Cancel"`. */
|
|
14
|
+
cancelLabel?: string;
|
|
15
|
+
/** Style the confirm action as destructive (a `Button variant="destructive"`). */
|
|
16
|
+
destructive?: boolean;
|
|
17
|
+
/** Invoked when the confirm action is pressed. */
|
|
18
|
+
onConfirm?: () => void;
|
|
19
|
+
/** Invoked on cancel, `Escape`, or the cancel action. */
|
|
20
|
+
onCancel?: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* AlertDialog — a blocking confirmation that demands an explicit choice.
|
|
24
|
+
* `role="alertdialog"`, composing the overlay-floor minus outside-press
|
|
25
|
+
* dismiss: a backdrop press does NOT dismiss (deliberate), only `Escape` or the
|
|
26
|
+
* cancel action. Composes mx.7.1's `Heading` and the `Button` actions.
|
|
27
|
+
*
|
|
28
|
+
* a11y: `aria-modal`; title/description wired via `aria-labelledby`/
|
|
29
|
+
* `aria-describedby`; focus is trapped and lands on the confirm action on open,
|
|
30
|
+
* returning to the trigger on close.
|
|
31
|
+
*/
|
|
32
|
+
export declare const AlertDialog: import("react").ForwardRefExoticComponent<AlertDialogProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export default AlertDialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AlertDialog";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { IconName } from "../../foundations/Icon";
|
|
3
|
+
/** One row of a {@link ContextMenu}. A plain `item` runs `onSelect` and closes;
|
|
4
|
+
* `label`/`separator` are presentational. `danger` recolours to the negative family. */
|
|
5
|
+
export interface ContextMenuItem {
|
|
6
|
+
/** Row kind. Default `"item"`. */
|
|
7
|
+
type?: "item" | "label" | "separator";
|
|
8
|
+
/** The row's visible text. */
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
/** A leading icon. */
|
|
11
|
+
icon?: IconName;
|
|
12
|
+
/** A trailing key hint. */
|
|
13
|
+
shortcut?: string;
|
|
14
|
+
/** Invoked on activation. */
|
|
15
|
+
onSelect?: () => void;
|
|
16
|
+
/** Non-interactive + excluded from arrow-nav. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Destructive action — recoloured to the negative family. */
|
|
19
|
+
danger?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ContextMenuProps {
|
|
22
|
+
/** The right-click surface — the wrapped region opens the menu at the pointer. */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
/** The menu rows, in order. */
|
|
25
|
+
items: ContextMenuItem[];
|
|
26
|
+
/** Panel width (px). Default `220`. */
|
|
27
|
+
width?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* ContextMenu — a menu opened at the pointer by a right-click on the wrapped
|
|
31
|
+
* region. Composes the overlay-floor: `useAnchoredPosition({ point })` (a
|
|
32
|
+
* pointer-anchored, viewport-clamped portaled panel) + `useDismiss` (outside-press
|
|
33
|
+
* + `Escape`) + `useArrowNavigation`. A local `scroll` listener dismisses while
|
|
34
|
+
* open (the page moving out from under a pinned menu).
|
|
35
|
+
*
|
|
36
|
+
* a11y: the panel is `role="menu"`, rows are `role="menuitem"`. `danger` rows are
|
|
37
|
+
* the sole recolour, token-based (no accent prop).
|
|
38
|
+
*/
|
|
39
|
+
export declare function ContextMenu({ children, items, width }: ContextMenuProps): import("react").JSX.Element;
|
|
40
|
+
export default ContextMenu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ContextMenu";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type DialogSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface DialogProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
4
|
+
/** Whether the dialog is mounted + visible. Controlled. */
|
|
5
|
+
open: boolean;
|
|
6
|
+
/** Requested close — the backdrop press, the close control, or `Escape`. */
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
/** The heading, wired to `aria-labelledby`. */
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
/** A supporting line under the title, wired to `aria-describedby`. */
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
/** The body content. */
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/** Trailing actions (usually a `Button` row). */
|
|
15
|
+
footer?: ReactNode;
|
|
16
|
+
/** Panel max-width: `sm` 420 · `md` 496 (default) · `lg` 640. */
|
|
17
|
+
size?: DialogSize;
|
|
18
|
+
/** Render the corner close control (`IconButton`). Default `true`. */
|
|
19
|
+
showClose?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Dialog — a focused, blocking surface with a divider header, description slot,
|
|
23
|
+
* and footer actions. A richer `Modal`: monolithic (prop-driven, not
|
|
24
|
+
* composable-parts), composing the overlay-floor (`Portal` + `useFocusTrap` +
|
|
25
|
+
* `useDismiss`) and mx.7.1 (`Heading` title, `IconButton` close). It reuses the
|
|
26
|
+
* `.mx-modal` style family and layers the `.mx-dialog` delta.
|
|
27
|
+
*
|
|
28
|
+
* a11y: `role="dialog"` + `aria-modal`; the title/description are wired via
|
|
29
|
+
* `aria-labelledby`/`aria-describedby`; focus is trapped while open and returns
|
|
30
|
+
* to the trigger on close; `Escape` and a backdrop press dismiss.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Dialog: import("react").ForwardRefExoticComponent<DialogProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export default Dialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Dialog";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { IconName } from "../../foundations/Icon";
|
|
3
|
+
/** One row of a {@link Dropdown} menu. A `check` row toggles in place; a plain
|
|
4
|
+
* `item` runs `onSelect` and closes; `label`/`separator` are presentational. */
|
|
5
|
+
export interface DropdownItem {
|
|
6
|
+
/** Row kind. Default `"item"`. */
|
|
7
|
+
type?: "item" | "label" | "separator" | "check";
|
|
8
|
+
/** The row's visible text (item/label/check). */
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
/** A leading icon (item rows). */
|
|
11
|
+
icon?: IconName;
|
|
12
|
+
/** A trailing key hint, e.g. `"⌘K"`. */
|
|
13
|
+
shortcut?: string;
|
|
14
|
+
/** Initial checked state for a `check` row (thereafter uncontrolled). */
|
|
15
|
+
checked?: boolean;
|
|
16
|
+
/** Stable id — required for a `check` row's toggle state. */
|
|
17
|
+
id?: string;
|
|
18
|
+
/** Invoked on activation (both `item` and `check`). */
|
|
19
|
+
onSelect?: () => void;
|
|
20
|
+
/** Non-interactive + excluded from arrow-nav. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface DropdownProps {
|
|
24
|
+
/** The trigger's content — a label/icon, NOT an interactive element (Dropdown
|
|
25
|
+
* renders its own `<button>`). */
|
|
26
|
+
trigger: ReactNode;
|
|
27
|
+
/** The menu rows, in order. */
|
|
28
|
+
items: DropdownItem[];
|
|
29
|
+
/** The check-mark ink family. Default `"iris"`. */
|
|
30
|
+
accent?: "iris" | "indigo" | "green" | "orange" | "plum" | "red";
|
|
31
|
+
/** Which trigger edge the panel aligns to. Default `"start"`. */
|
|
32
|
+
align?: "start" | "end";
|
|
33
|
+
/** Panel width (px). Default `220`. */
|
|
34
|
+
width?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Dropdown — a menu of actions anchored to a trigger. Composes the overlay-floor:
|
|
38
|
+
* `useAnchoredPosition` (portaled `position: fixed`, so it escapes overflow/
|
|
39
|
+
* stacking) + `useDismiss` (outside-press + `Escape`, the trigger ignored so
|
|
40
|
+
* re-pressing toggles) + `useArrowNavigation` (Up/Down over the rows).
|
|
41
|
+
*
|
|
42
|
+
* a11y: a real `<button>` trigger carries `aria-haspopup="menu"` +
|
|
43
|
+
* `aria-expanded`; the panel is `role="menu"`, rows are `role="menuitem"` /
|
|
44
|
+
* `role="menuitemcheckbox"`. Non-modal — focus moves into the panel on open and
|
|
45
|
+
* returns to the trigger on close, but `Tab` is NOT trapped.
|
|
46
|
+
*/
|
|
47
|
+
export declare function Dropdown({ trigger, items, accent, align, width }: DropdownProps): import("react").JSX.Element;
|
|
48
|
+
export default Dropdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Dropdown";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type HoverCardPlacement = "top" | "bottom" | "left" | "right";
|
|
3
|
+
export interface HoverCardProps {
|
|
4
|
+
/**
|
|
5
|
+
* The anchor. Must be **focusable** (a `Link`/`Avatar`/`button`) so keyboard
|
|
6
|
+
* focus — not only hover — opens the card.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** The floating card body. */
|
|
10
|
+
content: ReactNode;
|
|
11
|
+
/** Which side the card anchors to. Default `"bottom"`. */
|
|
12
|
+
placement?: HoverCardPlacement;
|
|
13
|
+
/** Delay before opening on hover/focus (ms). Default `250`. */
|
|
14
|
+
openDelay?: number;
|
|
15
|
+
/** Delay before closing on leave/blur (ms). Default `150`. */
|
|
16
|
+
closeDelay?: number;
|
|
17
|
+
/** Card width (px). Default `280`. */
|
|
18
|
+
width?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* HoverCard — a non-modal preview card revealed on hover OR focus of its
|
|
22
|
+
* anchor. Composes the overlay-floor's `useAnchoredPosition` (portaled
|
|
23
|
+
* `position: fixed`, so it escapes any `overflow`/stacking context) with local
|
|
24
|
+
* open/close timers.
|
|
25
|
+
*
|
|
26
|
+
* Distinct from `Tooltip` (a static, CSS-only label) and `Popover`
|
|
27
|
+
* (click-triggered, dismiss-managed): it holds interactive content and stays
|
|
28
|
+
* open while the pointer is over the card. There is NO dismiss floor
|
|
29
|
+
* (outside-press/`Escape`) and NO focus trap — it is non-modal.
|
|
30
|
+
*
|
|
31
|
+
* a11y: the card is `role="dialog"`; FOCUS (not only hover) opens it, so the
|
|
32
|
+
* wrapped child must be focusable.
|
|
33
|
+
*/
|
|
34
|
+
export declare function HoverCard({ children, content, placement, openDelay, closeDelay, width, }: HoverCardProps): import("react").JSX.Element;
|
|
35
|
+
export default HoverCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./HoverCard";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type LinkPreviewPlacement = "top" | "bottom";
|
|
3
|
+
export interface LinkPreviewProps {
|
|
4
|
+
/**
|
|
5
|
+
* The anchor — typically a [Link](../../actions/Link/Link.prompt.md). Must be
|
|
6
|
+
* focusable so keyboard focus, not only hover, opens the preview.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** The floating preview body (a URL card, an embed, a summary). */
|
|
10
|
+
content: ReactNode;
|
|
11
|
+
/** Which side the preview anchors to. Default `"bottom"`. */
|
|
12
|
+
placement?: LinkPreviewPlacement;
|
|
13
|
+
/** Delay before opening on hover/focus (ms). Default `300`. */
|
|
14
|
+
openDelay?: number;
|
|
15
|
+
/** Preview width (px). Default `300`. */
|
|
16
|
+
width?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* LinkPreview — the URL-preview specialization of the hover-card family: a
|
|
20
|
+
* non-modal card revealed on hover OR focus of an inline anchor (a link), used
|
|
21
|
+
* to preview where a link leads. Composes the overlay-floor's
|
|
22
|
+
* `useAnchoredPosition` (portaled `position: fixed`) with local open/close
|
|
23
|
+
* timers.
|
|
24
|
+
*
|
|
25
|
+
* Unlike HoverCard there is NO `closeDelay` prop — the preview hides on a fixed
|
|
26
|
+
* 120ms grace so the pointer can bridge the gap onto the card. Non-modal: no
|
|
27
|
+
* dismiss floor, no focus trap.
|
|
28
|
+
*
|
|
29
|
+
* a11y: the card is `role="dialog"`; FOCUS (not only hover) opens it, so the
|
|
30
|
+
* wrapped child must be focusable.
|
|
31
|
+
*/
|
|
32
|
+
export declare function LinkPreview({ children, content, placement, openDelay, width, }: LinkPreviewProps): import("react").JSX.Element;
|
|
33
|
+
export default LinkPreview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LinkPreview";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface ModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
footer?: ReactNode;
|
|
7
|
+
size?: "sm" | "md" | "lg";
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function Modal({ open, onClose, title, footer, size, children }: ModalProps): import("react").ReactPortal | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Modal";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type PopoverPlacement = "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
3
|
+
export interface PopoverProps {
|
|
4
|
+
/**
|
|
5
|
+
* The trigger's content — pass a label or icon, NOT an interactive element:
|
|
6
|
+
* Popover renders its own `<button>`, and nesting a button inside is invalid.
|
|
7
|
+
*/
|
|
8
|
+
trigger: ReactNode;
|
|
9
|
+
/** The panel content. */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/** Controlled open state. Omit for uncontrolled (see `defaultOpen`). */
|
|
12
|
+
open?: boolean;
|
|
13
|
+
/** Initial open state when uncontrolled. Default `false`. */
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
/** Notified on every open/close (both controlled and uncontrolled). */
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
/** Where the panel anchors relative to the trigger. Default `"bottom-start"`. */
|
|
18
|
+
placement?: PopoverPlacement;
|
|
19
|
+
/** Panel width (px). Default `280`. */
|
|
20
|
+
width?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Popover — a floating panel anchored to a trigger, holding arbitrary
|
|
24
|
+
* interactive content. Controlled or uncontrolled. Composes the overlay-floor:
|
|
25
|
+
* `useAnchoredPosition` (portaled `position: fixed`, so it escapes any
|
|
26
|
+
* overflow/stacking context) + `useDismiss` (outside-press + `Escape`, the
|
|
27
|
+
* trigger ignored so re-pressing toggles).
|
|
28
|
+
*
|
|
29
|
+
* a11y: a real `<button>` trigger carries `aria-haspopup="dialog"` +
|
|
30
|
+
* `aria-expanded`; the panel is `role="dialog"`. Non-modal — focus moves into
|
|
31
|
+
* the panel on open and returns to the trigger on close, but `Tab` is NOT
|
|
32
|
+
* trapped (focus may leave freely).
|
|
33
|
+
*/
|
|
34
|
+
export declare function Popover({ trigger, children, open: openProp, defaultOpen, onOpenChange, placement, width, }: PopoverProps): import("react").JSX.Element;
|
|
35
|
+
export default Popover;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Popover";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Tooltip";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface PortalProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Portal — the overlay-floor's thin `createPortal` wrapper. Mounts `children`
|
|
7
|
+
* at `document.body` so a floating surface escapes any `overflow`/stacking
|
|
8
|
+
* context of its origin subtree. The behavior floor (focus-trap · dismiss ·
|
|
9
|
+
* anchored-position) lives in `@mercury-fx/core`; `createPortal` lives here
|
|
10
|
+
* because `@mercury-fx/core` has no `react-dom` peer (mx.7.4 §4).
|
|
11
|
+
*
|
|
12
|
+
* SSR-guarded: with no `document` it renders nothing.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Portal({ children }: PortalProps): ReactNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface CheckboxProps {
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
onChange?: (checked: boolean) => void;
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
indeterminate?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
name?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Checkbox({ checked, onChange, label, indeterminate, disabled, name, value, id }: CheckboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Checkbox";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { IconName } from "../../foundations/Icon";
|
|
3
|
+
type Accent = "iris" | "indigo" | "green" | "orange" | "plum" | "red";
|
|
4
|
+
export interface CheckboxCardsProps {
|
|
5
|
+
items: {
|
|
6
|
+
value: string;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
icon?: IconName;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}[];
|
|
12
|
+
value?: string[];
|
|
13
|
+
defaultValue?: string[];
|
|
14
|
+
onChange?: (value: string[]) => void;
|
|
15
|
+
accent?: Accent;
|
|
16
|
+
columns?: number;
|
|
17
|
+
size?: "sm" | "md" | "lg";
|
|
18
|
+
}
|
|
19
|
+
export declare function CheckboxCards({ items, value, defaultValue, onChange, accent, columns, size, }: CheckboxCardsProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./CheckboxCards";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
type Accent = "iris" | "indigo" | "green" | "orange" | "plum" | "red";
|
|
3
|
+
export interface CheckboxGroupProps {
|
|
4
|
+
items: {
|
|
5
|
+
value: string;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}[];
|
|
9
|
+
value?: string[];
|
|
10
|
+
defaultValue?: string[];
|
|
11
|
+
onChange?: (value: string[]) => void;
|
|
12
|
+
accent?: Accent;
|
|
13
|
+
orientation?: "vertical" | "horizontal";
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function CheckboxGroup({ items, value, defaultValue, onChange, accent, orientation, disabled, }: CheckboxGroupProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./CheckboxGroup";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface RadioProps {
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
onChange?: (value: string) => void;
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
value: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
id?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function Radio({ checked, onChange, label, value, name, disabled, id }: RadioProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Radio";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { IconName } from "../../foundations/Icon";
|
|
3
|
+
type Accent = "iris" | "indigo" | "green" | "orange" | "plum" | "red";
|
|
4
|
+
export interface RadioCardsProps {
|
|
5
|
+
items: {
|
|
6
|
+
value: string;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
icon?: IconName;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}[];
|
|
12
|
+
value?: string;
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
onChange?: (value: string) => void;
|
|
15
|
+
accent?: Accent;
|
|
16
|
+
columns?: number;
|
|
17
|
+
size?: "sm" | "md" | "lg";
|
|
18
|
+
}
|
|
19
|
+
export declare function RadioCards({ items, value, defaultValue, onChange, accent, columns, size, }: RadioCardsProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RadioCards";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
type Accent = "iris" | "indigo" | "green" | "orange" | "plum" | "red";
|
|
3
|
+
export interface RadioGroupProps {
|
|
4
|
+
items: {
|
|
5
|
+
value: string;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}[];
|
|
9
|
+
value?: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
name?: string;
|
|
13
|
+
accent?: Accent;
|
|
14
|
+
orientation?: "vertical" | "horizontal";
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function RadioGroup({ items, value, defaultValue, onChange, name, accent, orientation, disabled, }: RadioGroupProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RadioGroup";
|