@amberstack/comp-lib 0.0.0-stage → 0.1.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 +68 -2
- package/dist/amberstack.css +2 -0
- package/dist/components/Accordion/Accordion.d.ts +18 -0
- package/dist/components/Accordion/AccordionContext.d.ts +10 -0
- package/dist/components/Accordion/AccordionItem.d.ts +11 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/ActivityItem/ActivityItem.d.ts +15 -0
- package/dist/components/ActivityItem/index.d.ts +1 -0
- package/dist/components/AreaChart/AreaChart.d.ts +4 -0
- package/dist/components/AreaChart/index.d.ts +1 -0
- package/dist/components/AssetField/AssetField.d.ts +26 -0
- package/dist/components/AssetField/index.d.ts +1 -0
- package/dist/components/Avatar/Avatar.d.ts +19 -0
- package/dist/components/Avatar/AvatarContext.d.ts +3 -0
- package/dist/components/Avatar/AvatarGroup.d.ts +12 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Banner/Banner.d.ts +18 -0
- package/dist/components/Banner/index.d.ts +1 -0
- package/dist/components/BarChart/BarChart.d.ts +25 -0
- package/dist/components/BarChart/index.d.ts +1 -0
- package/dist/components/BlockHeader/BlockHeader.d.ts +22 -0
- package/dist/components/BlockHeader/index.d.ts +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +9 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.d.ts +11 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +16 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Calendar/Calendar.d.ts +49 -0
- package/dist/components/Calendar/CalendarDay.d.ts +25 -0
- package/dist/components/Calendar/CalendarHeader.d.ts +27 -0
- package/dist/components/Calendar/DateTriggerInternal.d.ts +30 -0
- package/dist/components/Calendar/dateUtils.d.ts +95 -0
- package/dist/components/Calendar/index.d.ts +4 -0
- package/dist/components/Calendar/useDatePopup.d.ts +22 -0
- package/dist/components/Card/Card.d.ts +10 -0
- package/dist/components/Card/CardFooter.d.ts +8 -0
- package/dist/components/Card/CardHeader.d.ts +14 -0
- package/dist/components/Card/index.d.ts +3 -0
- package/dist/components/CatalogCard/CatalogCard.d.ts +18 -0
- package/dist/components/CatalogCard/index.d.ts +1 -0
- package/dist/components/ChartCard/ChartCard.d.ts +30 -0
- package/dist/components/ChartCard/index.d.ts +1 -0
- package/dist/components/ChartCore/ChartAxes.d.ts +24 -0
- package/dist/components/ChartCore/ChartDataTable.d.ts +19 -0
- package/dist/components/ChartCore/ChartFrame.d.ts +11 -0
- package/dist/components/ChartCore/ChartHoverLayer.d.ts +21 -0
- package/dist/components/ChartCore/chartPlayHelpers.d.ts +11 -0
- package/dist/components/ChartCore/index.d.ts +10 -0
- package/dist/components/ChartCore/paths.d.ts +23 -0
- package/dist/components/ChartCore/scales.d.ts +40 -0
- package/dist/components/ChartCore/series.d.ts +4 -0
- package/dist/components/ChartCore/types.d.ts +38 -0
- package/dist/components/ChartCore/useChartHover.d.ts +25 -0
- package/dist/components/ChartCore/useChartSize.d.ts +6 -0
- package/dist/components/ChartLegend/ChartLegend.d.ts +20 -0
- package/dist/components/ChartLegend/ChartLegendItem.d.ts +19 -0
- package/dist/components/ChartLegend/index.d.ts +4 -0
- package/dist/components/ChartLegend/legendHelpers.d.ts +20 -0
- package/dist/components/ChartLegend/useLegendState.d.ts +10 -0
- package/dist/components/ChartTooltip/ChartTooltip.d.ts +20 -0
- package/dist/components/ChartTooltip/index.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +11 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/ChecklistItem/ChecklistItem.d.ts +14 -0
- package/dist/components/ChecklistItem/index.d.ts +1 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +32 -0
- package/dist/components/CommandPalette/CommandPaletteItem.d.ts +14 -0
- package/dist/components/CommandPalette/index.d.ts +2 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +27 -0
- package/dist/components/ConfirmDialog/index.d.ts +1 -0
- package/dist/components/ContentRow/ContentRow.d.ts +20 -0
- package/dist/components/ContentRow/index.d.ts +1 -0
- package/dist/components/CredentialRow/CredentialRow.d.ts +18 -0
- package/dist/components/CredentialRow/index.d.ts +1 -0
- package/dist/components/DataTable/DataTable.d.ts +115 -0
- package/dist/components/DataTable/index.d.ts +1 -0
- package/dist/components/DataTable/useControllable.d.ts +2 -0
- package/dist/components/DateField/DateField.d.ts +4 -0
- package/dist/components/DateField/index.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +42 -0
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +87 -0
- package/dist/components/DateRangePicker/DateRangePresets.d.ts +24 -0
- package/dist/components/DateRangePicker/DateRangeTrigger.d.ts +10 -0
- package/dist/components/DateRangePicker/index.d.ts +3 -0
- package/dist/components/Dialog/Dialog.d.ts +23 -0
- package/dist/components/Dialog/DialogBody.d.ts +4 -0
- package/dist/components/Dialog/DialogFooter.d.ts +4 -0
- package/dist/components/Dialog/DialogHeader.d.ts +15 -0
- package/dist/components/Dialog/dialogContext.d.ts +23 -0
- package/dist/components/Dialog/index.d.ts +5 -0
- package/dist/components/Dialog/useModalBehaviour.d.ts +27 -0
- package/dist/components/Divider/Divider.d.ts +10 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/DonutChart/DonutChart.d.ts +20 -0
- package/dist/components/DonutChart/index.d.ts +1 -0
- package/dist/components/Drawer/Drawer.d.ts +21 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +32 -0
- package/dist/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +13 -0
- package/dist/components/DropdownMenu/DropdownMenuContext.d.ts +5 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.d.ts +16 -0
- package/dist/components/DropdownMenu/DropdownMenuLabel.d.ts +4 -0
- package/dist/components/DropdownMenu/DropdownMenuSeparator.d.ts +4 -0
- package/dist/components/DropdownMenu/index.d.ts +5 -0
- package/dist/components/EmptyState/EmptyState.d.ts +14 -0
- package/dist/components/EmptyState/index.d.ts +1 -0
- package/dist/components/EnvironmentLabel/EnvironmentLabel.d.ts +10 -0
- package/dist/components/EnvironmentLabel/index.d.ts +1 -0
- package/dist/components/Field/Field.d.ts +26 -0
- package/dist/components/Field/FieldContext.d.ts +17 -0
- package/dist/components/Field/index.d.ts +2 -0
- package/dist/components/Field/useFieldControl.d.ts +34 -0
- package/dist/components/Filters/FilterBar.d.ts +9 -0
- package/dist/components/Filters/FilterChip.d.ts +18 -0
- package/dist/components/Filters/FilterMenu.d.ts +37 -0
- package/dist/components/Filters/index.d.ts +3 -0
- package/dist/components/IconButton/IconButton.d.ts +16 -0
- package/dist/components/IconButton/index.d.ts +1 -0
- package/dist/components/Input/Input.d.ts +14 -0
- package/dist/components/Input/LockedTagInternal.d.ts +2 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/KPI/KPI.d.ts +24 -0
- package/dist/components/KPI/index.d.ts +1 -0
- package/dist/components/KPIGraph/KPIGraph.d.ts +12 -0
- package/dist/components/KPIGraph/index.d.ts +1 -0
- package/dist/components/Kbd/Kbd.d.ts +4 -0
- package/dist/components/Kbd/index.d.ts +1 -0
- package/dist/components/Label/Label.d.ts +14 -0
- package/dist/components/Label/index.d.ts +1 -0
- package/dist/components/LineChart/LineChart.d.ts +4 -0
- package/dist/components/LineChart/SeriesChartInternal.d.ts +30 -0
- package/dist/components/LineChart/index.d.ts +2 -0
- package/dist/components/Link/Link.d.ts +20 -0
- package/dist/components/Link/index.d.ts +1 -0
- package/dist/components/MediaTile/MediaTile.d.ts +13 -0
- package/dist/components/MediaTile/index.d.ts +1 -0
- package/dist/components/Menu/Menu.d.ts +7 -0
- package/dist/components/Menu/MenuItem.d.ts +20 -0
- package/dist/components/Menu/index.d.ts +3 -0
- package/dist/components/Menu/usePopup.d.ts +46 -0
- package/dist/components/MetricCard/MetricCard.d.ts +26 -0
- package/dist/components/MetricCard/index.d.ts +1 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +42 -0
- package/dist/components/MultiSelect/index.d.ts +1 -0
- package/dist/components/NavGroup/NavGroup.d.ts +17 -0
- package/dist/components/NavGroup/index.d.ts +1 -0
- package/dist/components/NavItem/NavItem.d.ts +28 -0
- package/dist/components/NavItem/index.d.ts +1 -0
- package/dist/components/NodeGraph/GraphNode.d.ts +15 -0
- package/dist/components/NodeGraph/NodeGraph.d.ts +34 -0
- package/dist/components/NodeGraph/index.d.ts +2 -0
- package/dist/components/NodeReference/NodeReference.d.ts +12 -0
- package/dist/components/NodeReference/index.d.ts +1 -0
- package/dist/components/NumberField/NumberField.d.ts +28 -0
- package/dist/components/NumberField/index.d.ts +1 -0
- package/dist/components/PageHeader/PageHeader.d.ts +20 -0
- package/dist/components/PageHeader/index.d.ts +1 -0
- package/dist/components/Pagination/Pagination.d.ts +21 -0
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/PickerItem/PickerItem.d.ts +14 -0
- package/dist/components/PickerItem/index.d.ts +1 -0
- package/dist/components/Popover/Popover.d.ts +24 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +16 -0
- package/dist/components/ProgressBar/index.d.ts +1 -0
- package/dist/components/ProposedNote/ProposedNote.d.ts +9 -0
- package/dist/components/ProposedNote/index.d.ts +1 -0
- package/dist/components/Radio/Radio.d.ts +11 -0
- package/dist/components/Radio/RadioGroup.d.ts +22 -0
- package/dist/components/Radio/RadioGroupContext.d.ts +11 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/RangeTabs/RangeTabs.d.ts +21 -0
- package/dist/components/RangeTabs/Segment.d.ts +7 -0
- package/dist/components/RangeTabs/index.d.ts +2 -0
- package/dist/components/ResourceCard/ResourceCard.d.ts +29 -0
- package/dist/components/ResourceCard/index.d.ts +1 -0
- package/dist/components/RichTextField/RichTextField.d.ts +26 -0
- package/dist/components/RichTextField/RichTextTool.d.ts +9 -0
- package/dist/components/RichTextField/RichTextToolbar.d.ts +12 -0
- package/dist/components/RichTextField/index.d.ts +4 -0
- package/dist/components/RichTextField/richTextCommands.d.ts +18 -0
- package/dist/components/ScatterPlot/ScatterPlot.d.ts +41 -0
- package/dist/components/ScatterPlot/index.d.ts +1 -0
- package/dist/components/Search/Search.d.ts +15 -0
- package/dist/components/Search/index.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +38 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/useListbox.d.ts +38 -0
- package/dist/components/SetupStep/SetupStep.d.ts +18 -0
- package/dist/components/SetupStep/index.d.ts +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +17 -0
- package/dist/components/Sidebar/SidebarBrand.d.ts +11 -0
- package/dist/components/Sidebar/SidebarUser.d.ts +13 -0
- package/dist/components/Sidebar/index.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.d.ts +12 -0
- package/dist/components/Skeleton/index.d.ts +1 -0
- package/dist/components/SortableRow/SortableRow.d.ts +24 -0
- package/dist/components/SortableRow/index.d.ts +1 -0
- package/dist/components/Sparkline/Sparkline.d.ts +18 -0
- package/dist/components/Sparkline/index.d.ts +1 -0
- package/dist/components/Spinner/Spinner.d.ts +10 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/Status/Status.d.ts +8 -0
- package/dist/components/Status/index.d.ts +1 -0
- package/dist/components/StatusIcon/StatusIcon.d.ts +13 -0
- package/dist/components/StatusIcon/index.d.ts +1 -0
- package/dist/components/Stepper/Step.d.ts +19 -0
- package/dist/components/Stepper/Stepper.d.ts +28 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/SwitchField/SwitchField.d.ts +10 -0
- package/dist/components/SwitchField/index.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +9 -0
- package/dist/components/Table/TableCell.d.ts +10 -0
- package/dist/components/Table/TableCellActions.d.ts +11 -0
- package/dist/components/Table/TableCellCheckbox.d.ts +7 -0
- package/dist/components/Table/TableCellNumber.d.ts +11 -0
- package/dist/components/Table/TableCellStatus.d.ts +4 -0
- package/dist/components/Table/TableCellText.d.ts +7 -0
- package/dist/components/Table/TableCellTwoLine.d.ts +9 -0
- package/dist/components/Table/TableCellUser.d.ts +11 -0
- package/dist/components/Table/TableContext.d.ts +3 -0
- package/dist/components/Table/TableFooter.d.ts +9 -0
- package/dist/components/Table/TableHeaderCell.d.ts +17 -0
- package/dist/components/Table/TableHeaderRow.d.ts +4 -0
- package/dist/components/Table/TableRow.d.ts +7 -0
- package/dist/components/Table/TableToolbar.d.ts +13 -0
- package/dist/components/Table/index.d.ts +14 -0
- package/dist/components/Table/storyHelpers.d.ts +12 -0
- package/dist/components/Tabs/Tab.d.ts +9 -0
- package/dist/components/Tabs/TabList.d.ts +4 -0
- package/dist/components/Tabs/TabPanel.d.ts +7 -0
- package/dist/components/Tabs/Tabs.d.ts +11 -0
- package/dist/components/Tabs/TabsContext.d.ts +12 -0
- package/dist/components/Tabs/index.d.ts +4 -0
- package/dist/components/Textarea/Textarea.d.ts +9 -0
- package/dist/components/Textarea/index.d.ts +1 -0
- package/dist/components/Toast/Toast.d.ts +23 -0
- package/dist/components/Toast/ToastProvider.d.ts +12 -0
- package/dist/components/Toast/ToastStack.d.ts +11 -0
- package/dist/components/Toast/index.d.ts +4 -0
- package/dist/components/Toast/useToast.d.ts +25 -0
- package/dist/components/Toggle/Toggle.d.ts +14 -0
- package/dist/components/Toggle/index.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/useAnchoredPosition.d.ts +13 -0
- package/dist/components/TopBar/ContextSwitcher.d.ts +10 -0
- package/dist/components/TopBar/TopBar.d.ts +9 -0
- package/dist/components/TopBar/TopBarSeparator.d.ts +4 -0
- package/dist/components/TopBar/index.d.ts +3 -0
- package/dist/components/UnavailableState/UnavailableState.d.ts +18 -0
- package/dist/components/UnavailableState/index.d.ts +1 -0
- package/dist/icons/index.d.ts +57 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +6774 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cx.d.ts +2 -0
- package/package.json +87 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface DialogContextValue {
|
|
2
|
+
titleId: string;
|
|
3
|
+
descriptionId: string;
|
|
4
|
+
/** Marks the title or description as present. Returns a function that removes it again. */
|
|
5
|
+
registerLabel: (kind: 'title' | 'description') => () => void;
|
|
6
|
+
/** Closes the surrounding modal. Undefined when it can't be dismissed by the user. */
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const DialogContext: import("react").Context<DialogContextValue | null>;
|
|
10
|
+
export declare const useDialogContext: () => DialogContextValue | null;
|
|
11
|
+
/** Builds the context and ARIA attributes that tie a modal surface to its DialogHeader. */
|
|
12
|
+
export declare function useDialogLabels(dismissible: boolean, close: () => void): {
|
|
13
|
+
context: {
|
|
14
|
+
titleId: string;
|
|
15
|
+
descriptionId: string;
|
|
16
|
+
registerLabel: (kind: "title" | "description") => () => void;
|
|
17
|
+
onClose: (() => void) | undefined;
|
|
18
|
+
};
|
|
19
|
+
labelProps: {
|
|
20
|
+
'aria-labelledby': string | undefined;
|
|
21
|
+
'aria-describedby': string | undefined;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/** Every element inside `container` that Tab can reach, in DOM order. */
|
|
3
|
+
export declare function getFocusableElements(container: HTMLElement): HTMLElement[];
|
|
4
|
+
export interface ModalBehaviourOptions {
|
|
5
|
+
/** Whether the modal is showing. All behaviour is active only while this is true. */
|
|
6
|
+
open: boolean;
|
|
7
|
+
/** The modal surface. Focus is kept inside it. It needs `tabIndex={-1}` in case it holds nothing focusable. */
|
|
8
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
9
|
+
/** The backdrop element. A press that starts and ends on it counts as a dismissal. */
|
|
10
|
+
backdropRef?: RefObject<HTMLElement | null>;
|
|
11
|
+
/** Element to focus on open. Defaults to the first focusable element, then the container. */
|
|
12
|
+
initialFocusRef?: RefObject<HTMLElement | null>;
|
|
13
|
+
/** Whether Escape and backdrop presses call `onDismiss`. */
|
|
14
|
+
dismissible?: boolean;
|
|
15
|
+
/** Called when the user dismisses the modal. */
|
|
16
|
+
onDismiss?: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Shared modal behaviour for Dialog and Drawer: focus trap, focus restore, body scroll lock,
|
|
20
|
+
* and Escape and backdrop dismissal. Stacked modals are supported; only the top one responds.
|
|
21
|
+
*
|
|
22
|
+
* Non-modal layers rendered in a portal, such as Popover, set `data-focus-scope` so the trap leaves
|
|
23
|
+
* their Tab handling alone, and call `preventDefault` on keys they consume so Escape closes one layer at a time.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useModalBehaviour({ open, containerRef, backdropRef, initialFocusRef, dismissible, onDismiss, }: ModalBehaviourOptions): void;
|
|
26
|
+
/** Open state for an overlay that works both controlled (`open`) and uncontrolled (`defaultOpen`). */
|
|
27
|
+
export declare function useOverlayOpen(open: boolean | undefined, defaultOpen: boolean, onClose?: () => void): readonly [boolean, () => void];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export type DividerOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
export interface DividerProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Direction of the line. A `vertical` divider stretches to the height of its container. */
|
|
5
|
+
orientation?: DividerOrientation;
|
|
6
|
+
/** Text in the middle of the line, also used as its accessible name. */
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Separates groups of content. */
|
|
10
|
+
export declare const Divider: import("react").ForwardRefExoticComponent<DividerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Divider';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type ChartSegment } from '../ChartCore';
|
|
3
|
+
export interface DonutChartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
|
+
/** The parts of the whole. Up to five; any more fold into Other. */
|
|
5
|
+
segments: ChartSegment[];
|
|
6
|
+
/** Word under the total in the centre. */
|
|
7
|
+
centerLabel?: string;
|
|
8
|
+
/** Word beside the percentage in the tooltip. */
|
|
9
|
+
shareLabel?: string;
|
|
10
|
+
/** Diameter of the ring in pixels. */
|
|
11
|
+
height?: number;
|
|
12
|
+
/** Accessible name of the chart. Say what it shows. */
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
/** Shown in place of the chart when there is no data. */
|
|
15
|
+
emptyMessage?: ReactNode;
|
|
16
|
+
/** Formats the total and the values in the data table. */
|
|
17
|
+
formatValue?: (value: number) => string;
|
|
18
|
+
}
|
|
19
|
+
/** Parts of one whole, for five segments or fewer. The total sits in the centre, and the legend gives each share so identity is never colour alone. */
|
|
20
|
+
export declare const DonutChart: import("react").ForwardRefExoticComponent<DonutChartProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DonutChart';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type HTMLAttributes, type RefObject } from 'react';
|
|
2
|
+
export type DrawerSide = 'right' | 'left';
|
|
3
|
+
export interface DrawerProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Whether the drawer is showing. Leave undefined to use `defaultOpen` and let the drawer manage itself. */
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/** Initial open state when uncontrolled. */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Called when the user closes the drawer. */
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
/** Whether Escape, a backdrop press and the header's close button can close the drawer. */
|
|
11
|
+
dismissible?: boolean;
|
|
12
|
+
/** The edge of the viewport the panel attaches to. */
|
|
13
|
+
side?: DrawerSide;
|
|
14
|
+
/** Element to focus on open. Defaults to the first focusable element. */
|
|
15
|
+
initialFocusRef?: RefObject<HTMLElement | null>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A modal side panel for details and secondary tasks. Compose it from DialogHeader, DialogBody and DialogFooter.
|
|
19
|
+
* It behaves like Dialog: focus trap, focus restore, scroll lock, Escape and backdrop close.
|
|
20
|
+
*/
|
|
21
|
+
export declare const Drawer: import("react").ForwardRefExoticComponent<DrawerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Drawer';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type KeyboardEvent, type MouseEvent, type ReactElement, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type PopupPlacement } from '../Menu';
|
|
3
|
+
/** Props a custom trigger must spread onto its button. */
|
|
4
|
+
export interface DropdownMenuTriggerProps {
|
|
5
|
+
ref: Ref<HTMLElement>;
|
|
6
|
+
id: string;
|
|
7
|
+
'aria-haspopup': 'menu';
|
|
8
|
+
'aria-expanded': boolean;
|
|
9
|
+
'aria-controls'?: string;
|
|
10
|
+
onClick: (event: MouseEvent<HTMLElement>) => void;
|
|
11
|
+
onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
|
|
12
|
+
}
|
|
13
|
+
type TriggerElementProps = Partial<Pick<DropdownMenuTriggerProps, 'onClick' | 'onKeyDown'>>;
|
|
14
|
+
export interface DropdownMenuProps {
|
|
15
|
+
/** The button that opens the menu: an element such as `<Button>`, or a function that spreads the given props onto one. */
|
|
16
|
+
trigger: ReactElement<TriggerElementProps> | ((props: DropdownMenuTriggerProps) => ReactNode);
|
|
17
|
+
/** DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuLabel and DropdownMenuSeparator rows. */
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
/** Whether the menu is open, when controlled. */
|
|
20
|
+
open?: boolean;
|
|
21
|
+
/** Whether the menu starts open, when uncontrolled. */
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
/** Called when the menu asks to open or close. */
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
/** Which edge of the trigger the menu lines up with. */
|
|
26
|
+
placement?: PopupPlacement;
|
|
27
|
+
/** Class name for the popup. */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Action menu with a button trigger, following the WAI-ARIA menu button pattern. For choosing a value use Select. */
|
|
31
|
+
export declare function DropdownMenu({ trigger, children, open, defaultOpen, onOpenChange, placement, className, }: DropdownMenuProps): import("react").JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export interface DropdownMenuCheckboxItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
3
|
+
/** Whether the item is ticked, when controlled. */
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
/** Whether the item starts ticked, when uncontrolled. */
|
|
6
|
+
defaultChecked?: boolean;
|
|
7
|
+
/** Called with the new state. The menu stays open, so several items can be changed. */
|
|
8
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
9
|
+
/** Stops the item changing, and keyboard navigation skips it. */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** An on or off setting in a DropdownMenu. The orange check shows when it is on. */
|
|
13
|
+
export declare const DropdownMenuCheckboxItem: import("react").ForwardRefExoticComponent<DropdownMenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import type { IconName } from '../../icons';
|
|
3
|
+
export interface DropdownMenuItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
4
|
+
/** Icon before the label. */
|
|
5
|
+
icon?: IconName;
|
|
6
|
+
/** Keyboard shortcut shown at the end of the row. It is a hint only and does not bind the key. */
|
|
7
|
+
shortcut?: string;
|
|
8
|
+
/** Uses the danger colour, for destructive actions. */
|
|
9
|
+
danger?: boolean;
|
|
10
|
+
/** Stops the item being chosen, and keyboard navigation skips it. */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Called when the item is chosen with the pointer, Enter or Space. The menu then closes. */
|
|
13
|
+
onSelect?: () => void;
|
|
14
|
+
}
|
|
15
|
+
/** One action in a DropdownMenu. */
|
|
16
|
+
export declare const DropdownMenuItem: import("react").ForwardRefExoticComponent<DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export type DropdownMenuLabelProps = HTMLAttributes<HTMLDivElement>;
|
|
3
|
+
/** A heading for the items that follow it in a DropdownMenu. */
|
|
4
|
+
export declare const DropdownMenuLabel: import("react").ForwardRefExoticComponent<DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export type DropdownMenuSeparatorProps = HTMLAttributes<HTMLDivElement>;
|
|
3
|
+
/** A line between groups of items in a DropdownMenu. */
|
|
4
|
+
export declare const DropdownMenuSeparator: import("react").ForwardRefExoticComponent<DropdownMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type IconName } from '../../icons';
|
|
3
|
+
export interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
|
+
/** Icon above the title. */
|
|
5
|
+
icon?: IconName;
|
|
6
|
+
/** What is empty. */
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
/** Why it is empty, or what to do about it. */
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** The next step, normally a Button. */
|
|
11
|
+
action?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** Fills a space that has no content yet, and points to the next step. */
|
|
14
|
+
export declare const EmptyState: import("react").ForwardRefExoticComponent<EmptyStateProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './EmptyState';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export type EnvironmentLabelKind = 'production' | 'standard';
|
|
3
|
+
export interface EnvironmentLabelProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** `production` is always visually distinct and has fixed text. `standard` shows `name`. */
|
|
5
|
+
kind: EnvironmentLabelKind;
|
|
6
|
+
/** Environment name, such as `staging`. Only used by the `standard` kind. */
|
|
7
|
+
name?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Identifies the environment. Production gets a rule, a lock and uppercase text so it cannot be mistaken for anything else. */
|
|
10
|
+
export declare const EnvironmentLabel: import("react").ForwardRefExoticComponent<EnvironmentLabelProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './EnvironmentLabel';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface FieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** The visible label. */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** Short text at the end of the label row, such as a locale. */
|
|
6
|
+
meta?: ReactNode;
|
|
7
|
+
/** Help text below the control. */
|
|
8
|
+
help?: ReactNode;
|
|
9
|
+
/** Error text. It replaces the help text and puts the control in its error state. */
|
|
10
|
+
error?: ReactNode;
|
|
11
|
+
/** Disables the control and dims the label. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Puts the control in its locked state, for values set by staff. */
|
|
14
|
+
locked?: boolean;
|
|
15
|
+
/** Marks the control as required. */
|
|
16
|
+
required?: boolean;
|
|
17
|
+
/** The id for the control. Generated when left out. */
|
|
18
|
+
controlId?: string;
|
|
19
|
+
/** One control that reads the Field through `useFieldControl`, such as Input, Textarea, Select or MultiSelect. */
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A labelled form control. It connects the label, help text and error text to its control. Use a library control
|
|
24
|
+
* as the child, or build one with `useFieldControl`; a plain native input is not connected.
|
|
25
|
+
*/
|
|
26
|
+
export declare function Field({ label, meta, help, error, disabled, locked, required, controlId, className, children, ...props }: FieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface FieldContextValue {
|
|
2
|
+
/** The id the label points at. */
|
|
3
|
+
controlId: string;
|
|
4
|
+
/** The id of the label, for controls that need `aria-labelledby`. */
|
|
5
|
+
labelId: string;
|
|
6
|
+
/** The id of the help or error text, if either is showing. */
|
|
7
|
+
describedById?: string;
|
|
8
|
+
/** True when the field shows an error. */
|
|
9
|
+
invalid: boolean;
|
|
10
|
+
/** True when the field is disabled. */
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
/** True when the field is locked. */
|
|
13
|
+
locked: boolean;
|
|
14
|
+
/** True when the field is required. */
|
|
15
|
+
required: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const FieldContext: import("react").Context<FieldContextValue | null>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface FieldControlInput {
|
|
2
|
+
/** The control's own id. A surrounding Field's id takes priority, so its label stays connected. */
|
|
3
|
+
id?: string;
|
|
4
|
+
/** The control's own error state. */
|
|
5
|
+
invalid?: boolean;
|
|
6
|
+
/** The control's own disabled state. */
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** The control's own locked state. */
|
|
9
|
+
locked?: boolean;
|
|
10
|
+
/** The control's own required state. */
|
|
11
|
+
required?: boolean;
|
|
12
|
+
/** Extra descriptions, kept beside the Field's help or error text. */
|
|
13
|
+
'aria-describedby'?: string;
|
|
14
|
+
/** The control's own label reference. */
|
|
15
|
+
'aria-labelledby'?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface FieldControlResult {
|
|
18
|
+
/** Use as the control's `id`. */
|
|
19
|
+
id?: string;
|
|
20
|
+
/** Show the error state and set `aria-invalid`. */
|
|
21
|
+
invalid: boolean;
|
|
22
|
+
/** Disable the control. */
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
/** Show the locked state. */
|
|
25
|
+
locked: boolean;
|
|
26
|
+
/** Mark the control as required. */
|
|
27
|
+
required: boolean;
|
|
28
|
+
/** Use as `aria-describedby`. */
|
|
29
|
+
describedBy?: string;
|
|
30
|
+
/** The Field's label id, or the control's own `aria-labelledby`. Custom controls such as a combobox use this. */
|
|
31
|
+
labelledBy?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Merges a control's own props with the surrounding Field, if there is one. Build custom Field controls with this. */
|
|
34
|
+
export declare function useFieldControl(props?: FieldControlInput): FieldControlResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HTMLAttributes, type MouseEventHandler } from 'react';
|
|
2
|
+
export interface FilterBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Called when Clear all is pressed. Without it, no Clear all button is shown. */
|
|
4
|
+
onClearAll?: MouseEventHandler<HTMLButtonElement>;
|
|
5
|
+
/** Text of the Clear all button. */
|
|
6
|
+
clearAllLabel?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A row of FilterChip children, followed by Clear all. */
|
|
9
|
+
export declare const FilterBar: import("react").ForwardRefExoticComponent<FilterBarProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type HTMLAttributes, type MouseEventHandler, type ReactNode } from 'react';
|
|
2
|
+
export type FilterChipState = 'applied' | 'hover' | 'add';
|
|
3
|
+
export interface FilterChipProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
4
|
+
/** `applied` shows one filter. `hover` forces the hover look. `add` is the button that adds a filter. */
|
|
5
|
+
state?: FilterChipState;
|
|
6
|
+
/** The field being filtered, such as `Status`. */
|
|
7
|
+
field?: ReactNode;
|
|
8
|
+
/** The chosen values, such as `Healthy, Degraded`. */
|
|
9
|
+
value?: ReactNode;
|
|
10
|
+
/** Called when the remove button is pressed. Without it, no remove button is shown. */
|
|
11
|
+
onRemove?: MouseEventHandler<HTMLButtonElement>;
|
|
12
|
+
/** Accessible name of the remove button. */
|
|
13
|
+
removeLabel?: string;
|
|
14
|
+
/** Text of the `add` chip. */
|
|
15
|
+
addLabel?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/** One applied filter above a table, or the button that adds another. Orange tint marks it as a selection. */
|
|
18
|
+
export declare const FilterChip: import("react").ForwardRefExoticComponent<FilterChipProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface FilterOption {
|
|
3
|
+
/** Stored when the option is chosen. */
|
|
4
|
+
value: string;
|
|
5
|
+
/** Shown to the person. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** How many rows have this value. */
|
|
8
|
+
count?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface FilterMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'defaultValue' | 'onChange'> {
|
|
11
|
+
/** The field being filtered, such as `Status`. */
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
/** The options to choose from. */
|
|
14
|
+
options: FilterOption[];
|
|
15
|
+
/** The chosen values, when controlled. They are a draft until Apply. */
|
|
16
|
+
value?: string[];
|
|
17
|
+
/** The first chosen values, when uncontrolled. */
|
|
18
|
+
defaultValue?: string[];
|
|
19
|
+
/** Called whenever a box is ticked or cleared. */
|
|
20
|
+
onChange?: (value: string[]) => void;
|
|
21
|
+
/** Called with the chosen values when Apply is pressed. */
|
|
22
|
+
onApply?: (value: string[]) => void;
|
|
23
|
+
/** Called after Clear empties the choices. */
|
|
24
|
+
onClear?: () => void;
|
|
25
|
+
/** Hides the search box, for a short list. */
|
|
26
|
+
searchable?: boolean;
|
|
27
|
+
/** Placeholder and accessible name of the search box. */
|
|
28
|
+
searchPlaceholder?: string;
|
|
29
|
+
/** Shown when the search matches no option. */
|
|
30
|
+
noMatchesLabel?: ReactNode;
|
|
31
|
+
/** Text of the Clear button. */
|
|
32
|
+
clearLabel?: string;
|
|
33
|
+
/** Text of the Apply button. */
|
|
34
|
+
applyLabel?: string;
|
|
35
|
+
}
|
|
36
|
+
/** A panel of checkbox options with counts. Choices apply only when Apply is pressed. Place it in a popup. */
|
|
37
|
+
export declare const FilterMenu: import("react").ForwardRefExoticComponent<FilterMenuProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { type IconName } from '../../icons';
|
|
3
|
+
export type IconButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
4
|
+
export type IconButtonSize = 'md' | 'sm';
|
|
5
|
+
export interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
6
|
+
/** Icon to draw. */
|
|
7
|
+
icon: IconName;
|
|
8
|
+
/** Accessible name, announced by screen readers because the button has no visible text. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Visual emphasis. Use `primary` at most once per view. */
|
|
11
|
+
variant?: IconButtonVariant;
|
|
12
|
+
/** Square size: `md` is 34 px and `sm` is 28 px. */
|
|
13
|
+
size?: IconButtonSize;
|
|
14
|
+
}
|
|
15
|
+
/** Compact action with an icon only. Add a Tooltip if the icon is not universally understood. */
|
|
16
|
+
export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './IconButton';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from 'react';
|
|
2
|
+
import { type IconName } from '../../icons';
|
|
3
|
+
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
/** Shows the error state and sets `aria-invalid`. */
|
|
5
|
+
invalid?: boolean;
|
|
6
|
+
/** Read-only look with a "Locked" tag, for values set by staff. */
|
|
7
|
+
locked?: boolean;
|
|
8
|
+
/** Icon before the value. */
|
|
9
|
+
leadingIcon?: IconName;
|
|
10
|
+
/** Icon after the value. */
|
|
11
|
+
trailingIcon?: IconName;
|
|
12
|
+
}
|
|
13
|
+
/** Single-line text control without a label. Use Field for a labelled input in a form. */
|
|
14
|
+
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Input';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type KPIVariant = 'plain' | 'card';
|
|
3
|
+
export type KPITrend = 'up' | 'down' | 'none';
|
|
4
|
+
export type KPITrendIntent = 'good' | 'bad' | 'neutral';
|
|
5
|
+
export interface KPIProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** What is being measured. */
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
/** The number. Never show zero for data that was not recorded. */
|
|
9
|
+
value: ReactNode;
|
|
10
|
+
/** Text after the value, such as a unit or `of 44`. */
|
|
11
|
+
unit?: ReactNode;
|
|
12
|
+
/** Direction of change. `up` and `down` draw an arrow before the meta text. */
|
|
13
|
+
trend?: KPITrend;
|
|
14
|
+
/** Whether the change is welcome, which sets the colour. Defaults to `good` for `up` and `bad` for `down`. Set it when lower is better, such as an error rate. */
|
|
15
|
+
trendIntent?: KPITrendIntent;
|
|
16
|
+
/** Accessible name of the arrow. Defaults to `Up` or `Down`. */
|
|
17
|
+
trendLabel?: string;
|
|
18
|
+
/** Supporting detail below the value. */
|
|
19
|
+
meta?: ReactNode;
|
|
20
|
+
/** `plain` has no frame. `card` adds a border and padding. */
|
|
21
|
+
variant?: KPIVariant;
|
|
22
|
+
}
|
|
23
|
+
/** One key number with its context. Colour is never the only signal: a trend always has an arrow and supporting text. */
|
|
24
|
+
export declare const KPI: import("react").ForwardRefExoticComponent<KPIProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './KPI';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type KPIProps } from '../KPI';
|
|
2
|
+
export type KPIGraphType = 'line' | 'area' | 'bars';
|
|
3
|
+
export interface KPIGraphProps extends KPIProps {
|
|
4
|
+
/** Values for the mini graph, oldest first. */
|
|
5
|
+
data: number[];
|
|
6
|
+
/** `line` and `area` suit continuous trends. `bars` suits counts per period, with the current period in the accent colour. */
|
|
7
|
+
graph?: KPIGraphType;
|
|
8
|
+
/** Accessible name of the graph. Say what the trend is, because the shape alone has no words. */
|
|
9
|
+
graphLabel: string;
|
|
10
|
+
}
|
|
11
|
+
/** A KPI with a mini graph of its recent history at the right. */
|
|
12
|
+
export declare const KPIGraph: import("react").ForwardRefExoticComponent<KPIGraphProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './KPIGraph';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export type KbdProps = HTMLAttributes<HTMLElement>;
|
|
3
|
+
/** Chip for a key or keyboard shortcut, as in the Search box. */
|
|
4
|
+
export declare const Kbd: import("react").ForwardRefExoticComponent<KbdProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Kbd';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import { type IconName } from '../../icons';
|
|
3
|
+
export type LabelTone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'outline';
|
|
4
|
+
export type LabelSize = 'md' | 'sm';
|
|
5
|
+
export interface LabelProps extends HTMLAttributes<HTMLSpanElement> {
|
|
6
|
+
/** Colour treatment of the tag. */
|
|
7
|
+
tone?: LabelTone;
|
|
8
|
+
/** Height: `md` is 24 px and `sm` is 20 px. */
|
|
9
|
+
size?: LabelSize;
|
|
10
|
+
/** Icon before the text. */
|
|
11
|
+
icon?: IconName;
|
|
12
|
+
}
|
|
13
|
+
/** Short categorical tag, such as a type, count or plan. Use Status instead when showing the state of an object. */
|
|
14
|
+
export declare const Label: import("react").ForwardRefExoticComponent<LabelProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Label';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type SeriesChartProps } from './SeriesChartInternal';
|
|
2
|
+
export type LineChartProps = SeriesChartProps;
|
|
3
|
+
/** Change over time for up to five series, on one y axis. Two or more series get a legend that can hide or isolate them. */
|
|
4
|
+
export declare const LineChart: import("react").ForwardRefExoticComponent<SeriesChartProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type ChartSeries } from '../ChartCore';
|
|
3
|
+
/** Props shared by LineChart and AreaChart. */
|
|
4
|
+
export interface SeriesChartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
5
|
+
/** The series to draw. Up to five; any more fold into Other. */
|
|
6
|
+
series: ChartSeries[];
|
|
7
|
+
/** Height of the plot in pixels, including the axis labels. Width fills the container. */
|
|
8
|
+
height?: number;
|
|
9
|
+
/** Accessible name of the chart. Say what it shows. */
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
/** Shown in place of the chart when there is no data. */
|
|
12
|
+
emptyMessage?: ReactNode;
|
|
13
|
+
/** Formats values in labels, tooltips and the data table. */
|
|
14
|
+
formatValue?: (value: number) => string;
|
|
15
|
+
/** Draws the end marker and end value of each series. Turn off for small charts inside a card. */
|
|
16
|
+
showEndMarkers?: boolean;
|
|
17
|
+
/** Hidden series ids, when controlled. */
|
|
18
|
+
hiddenSeries?: string[];
|
|
19
|
+
/** Hidden series ids at first, when uncontrolled. */
|
|
20
|
+
defaultHiddenSeries?: string[];
|
|
21
|
+
/** Called with the new hidden series ids. */
|
|
22
|
+
onHiddenSeriesChange?: (hiddenSeries: string[]) => void;
|
|
23
|
+
}
|
|
24
|
+
interface InternalProps extends SeriesChartProps {
|
|
25
|
+
/** Adds the wash under each line. */
|
|
26
|
+
wash: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** The chart behind LineChart and AreaChart, which differ only in the wash. */
|
|
29
|
+
export declare const SeriesChartInternal: import("react").ForwardRefExoticComponent<InternalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import { type IconName } from '../../icons';
|
|
3
|
+
export type LinkTone = 'default' | 'muted';
|
|
4
|
+
export type LinkSize = 'md' | 'sm';
|
|
5
|
+
export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
6
|
+
/** Colour: `default` is the link colour, `muted` is for quieter links. */
|
|
7
|
+
tone?: LinkTone;
|
|
8
|
+
/** Text size: `md` is 13 px and `sm` is 12 px. */
|
|
9
|
+
size?: LinkSize;
|
|
10
|
+
/** Icon after the text. Defaults to `external-link` when `external` is set. */
|
|
11
|
+
icon?: IconName;
|
|
12
|
+
/** Leaves the product: opens a new tab, sets a safe `rel` and shows the external-link icon. */
|
|
13
|
+
external?: boolean;
|
|
14
|
+
/** Removes the link from the tab order and blocks navigation, while still exposing it as a disabled link. */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Text announced with an `external` link to say that it opens a new tab. */
|
|
17
|
+
newTabLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Navigates somewhere rather than performing an action. For actions, use Button instead. */
|
|
20
|
+
export declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Link';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface MediaTileProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/** Image to show. Without it, the tile shows an empty placeholder. */
|
|
4
|
+
src?: string;
|
|
5
|
+
/** The name of the file. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** A quieter line, such as its size. */
|
|
8
|
+
meta?: ReactNode;
|
|
9
|
+
/** Marks the tile as chosen. */
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** A selectable thumbnail of a media file. A toggle button that states its selection with `aria-pressed`. */
|
|
13
|
+
export declare const MediaTile: import("react").ForwardRefExoticComponent<MediaTileProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MediaTile';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export type MenuProps = HTMLAttributes<HTMLDivElement>;
|
|
3
|
+
/**
|
|
4
|
+
* The floating surface for a list of MenuItems. It is visual only and has no behaviour, so give it the `role` the
|
|
5
|
+
* content needs. For interactive lists use Select, MultiSelect or DropdownMenu.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Menu: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<HTMLDivElement>>;
|