@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,20 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type IconName } from '../../icons';
|
|
3
|
+
export interface MenuItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Icon before the label. */
|
|
5
|
+
icon?: IconName;
|
|
6
|
+
/** Shows the orange check for the chosen item. */
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
/** Shows the highlight, for the item under the pointer or the keyboard. */
|
|
9
|
+
active?: boolean;
|
|
10
|
+
/** Dims the item and sets `aria-disabled`. */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Uses the danger colour, for destructive actions. */
|
|
13
|
+
danger?: boolean;
|
|
14
|
+
/** Keyboard shortcut shown at the end of the row. */
|
|
15
|
+
shortcut?: string;
|
|
16
|
+
/** Replaces the icon, for a control such as a checkbox. */
|
|
17
|
+
leading?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/** One row of a Menu. It is visual only, so give it the `role` and handlers the list needs. */
|
|
20
|
+
export declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type CSSProperties, type RefObject } from 'react';
|
|
2
|
+
/** Which edge of the trigger the popup lines up with. It opens below, and flips above when there is no room. */
|
|
3
|
+
export type PopupPlacement = 'bottom-start' | 'bottom-end';
|
|
4
|
+
/** Why the popup asked to close. */
|
|
5
|
+
export type PopupCloseReason = 'outside' | 'escape';
|
|
6
|
+
export interface UsePopupOptions {
|
|
7
|
+
/** Whether the popup is rendered. The hook only positions and listens while this is true. */
|
|
8
|
+
open: boolean;
|
|
9
|
+
/** Called on a pointer press outside the trigger and popup, and on Escape. The caller sets `open` to false. */
|
|
10
|
+
onClose: (reason: PopupCloseReason) => void;
|
|
11
|
+
/** Which edge of the trigger to line up with. */
|
|
12
|
+
placement?: PopupPlacement;
|
|
13
|
+
/** Gap between trigger and popup, in pixels. */
|
|
14
|
+
offset?: number;
|
|
15
|
+
/** Makes the popup exactly as wide as the trigger. */
|
|
16
|
+
matchTriggerWidth?: boolean;
|
|
17
|
+
/** Set to false if the caller handles Escape itself. */
|
|
18
|
+
closeOnEscape?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface UsePopupResult<TTrigger extends HTMLElement, TPopup extends HTMLElement> {
|
|
21
|
+
/** Attach to the element the popup is anchored to. */
|
|
22
|
+
triggerRef: RefObject<TTrigger | null>;
|
|
23
|
+
/** Attach to the popup element. */
|
|
24
|
+
popupRef: RefObject<TPopup | null>;
|
|
25
|
+
/** Spread as `style` on the popup element. */
|
|
26
|
+
popupStyle: CSSProperties;
|
|
27
|
+
/** Measures and positions again. Scrolling and resizing already do this. */
|
|
28
|
+
reposition: () => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Positions a portalled popup against a trigger, and dismisses it.
|
|
32
|
+
*
|
|
33
|
+
* The popup uses `position: fixed` and is positioned by writing to its style, so moving it does not re-render.
|
|
34
|
+
* It flips above the trigger when there is no room below, stays inside the viewport and limits its own height.
|
|
35
|
+
* While `open`, it follows scrolling, resizing and size changes of the trigger or popup. A pointer press outside
|
|
36
|
+
* both elements or Escape calls `onClose`. `data-placement` on the popup is `top` or `bottom`.
|
|
37
|
+
*
|
|
38
|
+
* The caller renders the popup and owns focus:
|
|
39
|
+
*
|
|
40
|
+
* ```tsx
|
|
41
|
+
* const { triggerRef, popupRef, popupStyle } = usePopup<HTMLButtonElement>({ open, onClose: () => setOpen(false) });
|
|
42
|
+
* <button ref={triggerRef} onClick={() => setOpen(!open)}>Open</button>
|
|
43
|
+
* {open && createPortal(<div ref={popupRef} style={popupStyle}>Content</div>, document.body)}
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function usePopup<TTrigger extends HTMLElement = HTMLElement, TPopup extends HTMLElement = HTMLDivElement>({ open, onClose, placement, offset, matchTriggerWidth, closeOnEscape, }: UsePopupOptions): UsePopupResult<TTrigger, TPopup>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type MetricCardState = 'default' | 'unavailable';
|
|
3
|
+
export interface MetricCardProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** `default` shows the figure and chart. `unavailable` explains what is off and how to turn it on, and never draws zeros. */
|
|
5
|
+
state?: MetricCardState;
|
|
6
|
+
/** What is measured. */
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
/** The figure. */
|
|
9
|
+
value?: ReactNode;
|
|
10
|
+
/** Context for the figure, such as the change against a named period. */
|
|
11
|
+
meta?: ReactNode;
|
|
12
|
+
/** When unavailable: what is off. */
|
|
13
|
+
unavailableTitle?: ReactNode;
|
|
14
|
+
/** When unavailable: why it is off, and what still works. */
|
|
15
|
+
unavailableDescription?: ReactNode;
|
|
16
|
+
/** When unavailable: text of the link that explains how to turn it on. */
|
|
17
|
+
linkLabel?: string;
|
|
18
|
+
/** When unavailable: where that link goes. */
|
|
19
|
+
linkHref?: string;
|
|
20
|
+
/** When unavailable: whether that link leaves the app. */
|
|
21
|
+
linkExternal?: boolean;
|
|
22
|
+
/** The chart beside the figure. */
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/** A label and value beside a chart. When the source is off, it explains what is off and how to turn it on. */
|
|
26
|
+
export declare const MetricCard: import("react").ForwardRefExoticComponent<MetricCardProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MetricCard';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import type { SelectOption } from '../Select';
|
|
3
|
+
export interface MultiSelectProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange' | 'children'> {
|
|
4
|
+
/** The options to choose from. */
|
|
5
|
+
options: SelectOption[];
|
|
6
|
+
/** The chosen values, when controlled. */
|
|
7
|
+
value?: string[];
|
|
8
|
+
/** The first chosen values, when uncontrolled. */
|
|
9
|
+
defaultValue?: string[];
|
|
10
|
+
/** Called with all chosen values whenever they change. */
|
|
11
|
+
onChange?: (value: string[]) => void;
|
|
12
|
+
/** Called when the clear button is used. Passing this shows the clear button while there are values. */
|
|
13
|
+
onClear?: () => void;
|
|
14
|
+
/** Text shown when nothing is chosen. */
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** Shows the error state and sets `aria-invalid`. */
|
|
17
|
+
invalid?: boolean;
|
|
18
|
+
/** Stops all interaction. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Read-only look with a "Locked" tag. It can be focused but not opened. */
|
|
21
|
+
locked?: boolean;
|
|
22
|
+
/** Marks the control as required. */
|
|
23
|
+
required?: boolean;
|
|
24
|
+
/** How many chips to show before the "+N" overflow. */
|
|
25
|
+
maxVisible?: number;
|
|
26
|
+
/** Adds a filter box at the top of the popup. */
|
|
27
|
+
searchable?: boolean;
|
|
28
|
+
/** Label of the select-all row. The row appears when this is set, and shows a mixed state for a partial selection. */
|
|
29
|
+
selectAllLabel?: string;
|
|
30
|
+
/** Accessible name and placeholder of the filter box. */
|
|
31
|
+
filterLabel?: string;
|
|
32
|
+
/** Text shown when the filter matches nothing. */
|
|
33
|
+
emptyLabel?: string;
|
|
34
|
+
/** Accessible name of the clear button. */
|
|
35
|
+
clearLabel?: string;
|
|
36
|
+
/** Builds the accessible name of a chip's remove button. */
|
|
37
|
+
removeLabel?: (label: string) => string;
|
|
38
|
+
/** Form field name. Each chosen value is submitted under it. */
|
|
39
|
+
name?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Multi select dropdown. Chosen values appear as removable chips, and the popup stays open while selecting. */
|
|
42
|
+
export declare const MultiSelect: import("react").ForwardRefExoticComponent<MultiSelectProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MultiSelect';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface NavGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Overline heading, which also names the group. Without it the items simply sit together. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Makes the heading a button that shows and hides the items. Needs a `label`. */
|
|
6
|
+
collapsible?: boolean;
|
|
7
|
+
/** Whether the items are showing, when controlled. */
|
|
8
|
+
expanded?: boolean;
|
|
9
|
+
/** Whether the items first show, when uncontrolled. */
|
|
10
|
+
defaultExpanded?: boolean;
|
|
11
|
+
/** Called with the new state when the heading is pressed. */
|
|
12
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
13
|
+
/** The NavItems of this group. */
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/** A labelled group of nav items, optionally collapsible. */
|
|
17
|
+
export declare const NavGroup: import("react").ForwardRefExoticComponent<NavGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NavGroup';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type IconName } from '../../icons';
|
|
3
|
+
export interface NavItemProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** The label of the row. */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Icon before the label. */
|
|
7
|
+
icon?: IconName;
|
|
8
|
+
/** Number shown at the end of the row. */
|
|
9
|
+
count?: number;
|
|
10
|
+
/** Marks the current location with the orange bar and `aria-current="page"`. Use on one item per navigation column. */
|
|
11
|
+
active?: boolean;
|
|
12
|
+
/** Blocks the item and shows a lock, for a place the user is not allowed to open. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Indents the row under its parent item. */
|
|
15
|
+
child?: boolean;
|
|
16
|
+
/** Shows a chevron, because this item opens a list of child items. */
|
|
17
|
+
hasChildren?: boolean;
|
|
18
|
+
/** Whether the child items are showing. Only used with `hasChildren`. */
|
|
19
|
+
expanded?: boolean;
|
|
20
|
+
/** Renders an anchor to this address. Without it the item is a button. */
|
|
21
|
+
href?: string;
|
|
22
|
+
/** Where an anchor opens. */
|
|
23
|
+
target?: string;
|
|
24
|
+
/** Relationship of an anchor to its target. */
|
|
25
|
+
rel?: string;
|
|
26
|
+
}
|
|
27
|
+
/** A row in the sidebar. The orange bar marks the current location. */
|
|
28
|
+
export declare const NavItem: import("react").ForwardRefExoticComponent<NavItemProps & import("react").RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NavItem';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import { type IconName } from '../../icons';
|
|
3
|
+
export type GraphNodeHealth = 'healthy' | 'degraded' | 'offline';
|
|
4
|
+
export interface GraphNodeProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Name of the system. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** How the system is doing. Sets the dot colour and is part of the accessible name. */
|
|
8
|
+
health?: GraphNodeHealth;
|
|
9
|
+
/** Word for the health, in place of the default. */
|
|
10
|
+
healthLabel?: string;
|
|
11
|
+
/** Icon for the kind of system. */
|
|
12
|
+
icon?: IconName;
|
|
13
|
+
}
|
|
14
|
+
/** One system in a node graph: its name and a health dot. The health is in the accessible name and in the hover title. */
|
|
15
|
+
export declare const GraphNode: import("react").ForwardRefExoticComponent<GraphNodeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type GraphNodeHealth } from './GraphNode';
|
|
3
|
+
/** A system in the graph. */
|
|
4
|
+
export interface NodeGraphNode {
|
|
5
|
+
/** Stable identifier, used by edges. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Name of the system. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** How the system is doing. */
|
|
10
|
+
health: GraphNodeHealth;
|
|
11
|
+
/** Left position in pixels at full size. */
|
|
12
|
+
x: number;
|
|
13
|
+
/** Top position in pixels. */
|
|
14
|
+
y: number;
|
|
15
|
+
}
|
|
16
|
+
/** A connection between two systems. */
|
|
17
|
+
export interface NodeGraphEdge {
|
|
18
|
+
/** Id of the node the connection starts from. */
|
|
19
|
+
from: string;
|
|
20
|
+
/** Id of the node the connection goes to. An offline target draws the edge in the danger colour. */
|
|
21
|
+
to: string;
|
|
22
|
+
}
|
|
23
|
+
export interface NodeGraphProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
24
|
+
/** The systems, with their positions. */
|
|
25
|
+
nodes: readonly NodeGraphNode[];
|
|
26
|
+
/** The connections between them. */
|
|
27
|
+
edges: readonly NodeGraphEdge[];
|
|
28
|
+
/** Accessible name of the graph. Say what it shows. */
|
|
29
|
+
'aria-label'?: string;
|
|
30
|
+
/** Shown in place of the graph when there are no nodes. */
|
|
31
|
+
emptyMessage?: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
/** Shows how systems connect, such as a topology. Edges to an offline node are drawn in the danger colour. */
|
|
34
|
+
export declare const NodeGraph: import("react").ForwardRefExoticComponent<NodeGraphProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type NodeReferenceHealth = 'healthy' | 'degraded' | 'offline' | 'maintenance';
|
|
3
|
+
export interface NodeReferenceProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
4
|
+
/** The name of the node. */
|
|
5
|
+
name: ReactNode;
|
|
6
|
+
/** The state of the node. */
|
|
7
|
+
health?: NodeReferenceHealth;
|
|
8
|
+
/** The state in words. Defaults to the health. It is only announced for `healthy`, which the design shows as a dot alone. */
|
|
9
|
+
healthLabel?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/** A compact mention of a node, with its health as a dot and text. */
|
|
12
|
+
export declare const NodeReference: import("react").ForwardRefExoticComponent<NodeReferenceProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NodeReference';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step'> {
|
|
3
|
+
/** The number, when controlled. `null` means empty. */
|
|
4
|
+
value?: number | null;
|
|
5
|
+
/** The first number, when uncontrolled. */
|
|
6
|
+
defaultValue?: number | null;
|
|
7
|
+
/** Called with the new number, or `null` when the box is empty. */
|
|
8
|
+
onChange?: (value: number | null) => void;
|
|
9
|
+
/** The lowest allowed number. */
|
|
10
|
+
min?: number;
|
|
11
|
+
/** The highest allowed number. */
|
|
12
|
+
max?: number;
|
|
13
|
+
/** How far the steppers and arrow keys move. */
|
|
14
|
+
step?: number;
|
|
15
|
+
/** Shows the error state and sets `aria-invalid`. */
|
|
16
|
+
invalid?: boolean;
|
|
17
|
+
/** Read-only look with a "Locked" tag, for values set by staff. */
|
|
18
|
+
locked?: boolean;
|
|
19
|
+
/** Accessible name of the decrease button. */
|
|
20
|
+
decreaseLabel?: string;
|
|
21
|
+
/** Accessible name of the increase button. */
|
|
22
|
+
increaseLabel?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A number input styled like Input, with stepper buttons. Arrow keys move by `step`, Page Up and Page Down move
|
|
26
|
+
* by ten steps, and Home and End go to `min` and `max`. Steppers stay out of the tab order because the arrow keys do the same job.
|
|
27
|
+
*/
|
|
28
|
+
export declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NumberField';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type PageHeaderHeadingLevel = 1 | 2 | 3;
|
|
3
|
+
export interface PageHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
|
+
/** The page title. */
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
/** Small uppercase line above the title, such as the parent project. */
|
|
7
|
+
overline?: ReactNode;
|
|
8
|
+
/** One or two lines below the title. */
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** Address of the documentation. Shows the Docs link beside the title. */
|
|
11
|
+
docsHref?: string;
|
|
12
|
+
/** Text of the Docs link. */
|
|
13
|
+
docsLabel?: string;
|
|
14
|
+
/** Buttons at the right of the header. */
|
|
15
|
+
actions?: ReactNode;
|
|
16
|
+
/** Level of the title heading. */
|
|
17
|
+
headingLevel?: PageHeaderHeadingLevel;
|
|
18
|
+
}
|
|
19
|
+
/** The title block at the top of a page. */
|
|
20
|
+
export declare const PageHeader: import("react").ForwardRefExoticComponent<PageHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PageHeader';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface PaginationProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** The one-based current page, when controlled. */
|
|
4
|
+
page?: number;
|
|
5
|
+
/** The first one-based page, when uncontrolled. */
|
|
6
|
+
defaultPage?: number;
|
|
7
|
+
/** How many pages there are. */
|
|
8
|
+
pageCount: number;
|
|
9
|
+
/** Called with the one-based page the user chooses. */
|
|
10
|
+
onPageChange?: (page: number) => void;
|
|
11
|
+
/** Text at the left, such as "Showing 1–5 of 42". */
|
|
12
|
+
summary?: ReactNode;
|
|
13
|
+
/** Accessible name of the previous button. */
|
|
14
|
+
previousLabel?: string;
|
|
15
|
+
/** Accessible name of the next button. */
|
|
16
|
+
nextLabel?: string;
|
|
17
|
+
/** Accessible name of a page button, given its number. */
|
|
18
|
+
pageLabel?: (page: number) => string;
|
|
19
|
+
}
|
|
20
|
+
/** Moves through a long list one page at a time. */
|
|
21
|
+
export declare const Pagination: import("react").ForwardRefExoticComponent<PaginationProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Pagination';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type IconName } from '../../icons';
|
|
3
|
+
export interface PickerItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {
|
|
4
|
+
/** Icon in the tile. */
|
|
5
|
+
icon?: IconName;
|
|
6
|
+
/** A letter in the tile, when there is no icon. */
|
|
7
|
+
glyph?: ReactNode;
|
|
8
|
+
/** The name of the choice. */
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
/** What the choice gives you. */
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** One choice in a picker, such as a type of block to add. */
|
|
14
|
+
export declare const PickerItem: import("react").ForwardRefExoticComponent<PickerItemProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PickerItem';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type AnchoredPlacement } from '../Tooltip/useAnchoredPosition';
|
|
3
|
+
export type PopoverPlacement = AnchoredPlacement;
|
|
4
|
+
export interface PopoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content'> {
|
|
5
|
+
/** The one element that opens the popover. It must accept click and ARIA props. */
|
|
6
|
+
trigger: ReactElement<HTMLAttributes<HTMLElement>>;
|
|
7
|
+
/** What the panel shows. */
|
|
8
|
+
content: ReactNode;
|
|
9
|
+
/** Which side of the trigger the panel sits on. It flips if there isn't room. */
|
|
10
|
+
placement?: PopoverPlacement;
|
|
11
|
+
/** Whether the panel is showing. Leave undefined to use `defaultOpen` and let the popover manage itself. */
|
|
12
|
+
open?: boolean;
|
|
13
|
+
/** Initial open state when uncontrolled. */
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
/** Called when the popover asks to open or close. */
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
/** Accessible name of the panel. */
|
|
18
|
+
'aria-label'?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* An anchored, non-modal panel. Focus moves in on open and returns to the trigger on close.
|
|
22
|
+
* Closes on an outside press, on Escape, and when Tab leaves the panel.
|
|
23
|
+
*/
|
|
24
|
+
export declare const Popover: import("react").ForwardRefExoticComponent<PopoverProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Popover';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type ProgressBarTone = 'default' | 'accent' | 'warning' | 'danger';
|
|
3
|
+
export interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Progress from 0 to 100. Values outside that range are clamped. */
|
|
5
|
+
value: number;
|
|
6
|
+
/** Fill colour. Use `warning` and `danger` for capacity near its limit, and `accent` only for the main task on the page. */
|
|
7
|
+
tone?: ProgressBarTone;
|
|
8
|
+
/** Visible name. Without it, pass `aria-label`. */
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
/** Shows the percentage. Defaults to true when there is a `label`. */
|
|
11
|
+
showValue?: boolean;
|
|
12
|
+
/** Helper text below the bar, also exposed as its description. */
|
|
13
|
+
meta?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/** Shows how much of something is complete or used. */
|
|
16
|
+
export declare const ProgressBar: import("react").ForwardRefExoticComponent<ProgressBarProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ProgressBar';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface ProposedNoteProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Short status line above the note, such as what the proposal is waiting for. */
|
|
4
|
+
overline: ReactNode;
|
|
5
|
+
/** The note itself. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** Marks something as proposed rather than built, and says what it still needs. */
|
|
9
|
+
export declare const ProposedNote: import("react").ForwardRefExoticComponent<ProposedNoteProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ProposedNote';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value'> {
|
|
3
|
+
/** The value this radio stands for. */
|
|
4
|
+
value: string;
|
|
5
|
+
/** The visible label. Leave it out for a bare circle, and give the radio an `aria-label`. */
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
/** Longer text below the label. */
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** One option of a RadioGroup. Built on a native radio, so the browser handles arrow keys within the group. */
|
|
11
|
+
export declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type RadioGroupOrientation = 'vertical' | 'horizontal';
|
|
3
|
+
export interface RadioGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
4
|
+
/** The visible group label. Without it, give the group an `aria-label`. */
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
/** The chosen value, when controlled. */
|
|
7
|
+
value?: string;
|
|
8
|
+
/** The first chosen value, when uncontrolled. */
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
/** Called with the new value when a radio is chosen. */
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
/** The native group name. Generated when left out. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Disables every radio in the group. */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** How the radios are laid out. */
|
|
17
|
+
orientation?: RadioGroupOrientation;
|
|
18
|
+
/** The Radio options. */
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/** Selects exactly one option from a short list. Use Select when there are more than about five options. */
|
|
22
|
+
export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface RadioGroupContextValue {
|
|
2
|
+
/** The native group name shared by the radios. */
|
|
3
|
+
name: string;
|
|
4
|
+
/** The chosen value. */
|
|
5
|
+
value?: string;
|
|
6
|
+
/** Disables every radio in the group. */
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
/** Called when a radio is chosen. */
|
|
9
|
+
onChange: (value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const RadioGroupContext: import("react").Context<RadioGroupContextValue | null>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type RefAttributes } from 'react';
|
|
2
|
+
export interface RangeTabsOption<T extends string = string> {
|
|
3
|
+
/** The value reported when this option is chosen. */
|
|
4
|
+
value: T;
|
|
5
|
+
/** The visible text. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Blocks this option. */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface RangeTabsProps<T extends string = string> extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange' | 'children'> {
|
|
11
|
+
/** The choices, in order. */
|
|
12
|
+
options: RangeTabsOption<T>[];
|
|
13
|
+
/** The chosen value, when controlled. */
|
|
14
|
+
value?: T;
|
|
15
|
+
/** The first chosen value, when uncontrolled. Defaults to the first option that is enabled. */
|
|
16
|
+
defaultValue?: T;
|
|
17
|
+
/** Called with the value the user chooses. */
|
|
18
|
+
onChange?: (value: T) => void;
|
|
19
|
+
}
|
|
20
|
+
/** Segmented control for switching a time range or view. Use one per chart group. */
|
|
21
|
+
export declare const RangeTabs: <T extends string = string>(props: RangeTabsProps<T> & RefAttributes<HTMLDivElement>) => ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export interface SegmentProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/** Raises this segment as the selected one. */
|
|
4
|
+
selected?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** One choice in RangeTabs. The selected segment is raised and uses no colour. */
|
|
7
|
+
export declare const Segment: import("react").ForwardRefExoticComponent<SegmentProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type IconName } from '../../icons';
|
|
3
|
+
import { type StatusTone } from '../Status';
|
|
4
|
+
export interface ResourceCardDetail {
|
|
5
|
+
/** The name of the fact. */
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
/** The fact. */
|
|
8
|
+
value: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface ResourceCardProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
11
|
+
/** Icon in the tile at the top left. */
|
|
12
|
+
icon?: IconName;
|
|
13
|
+
/** The name of the resource. */
|
|
14
|
+
title: ReactNode;
|
|
15
|
+
/** Its machine-readable name. */
|
|
16
|
+
identifier?: ReactNode;
|
|
17
|
+
/** Tone of the status dot. */
|
|
18
|
+
statusTone?: StatusTone;
|
|
19
|
+
/** The status text. Without it, no status is shown. */
|
|
20
|
+
statusLabel?: ReactNode;
|
|
21
|
+
/** Facts about the resource, as label and value pairs. */
|
|
22
|
+
details?: ResourceCardDetail[];
|
|
23
|
+
/** Icon before the footer. */
|
|
24
|
+
footerIcon?: IconName;
|
|
25
|
+
/** A line at the bottom, such as what uses this resource. */
|
|
26
|
+
footer?: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/** A provisioned resource, with its state and key facts. */
|
|
29
|
+
export declare const ResourceCard: import("react").ForwardRefExoticComponent<ResourceCardProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ResourceCard';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface RichTextFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
3
|
+
/** The visible label, which also names the editor. */
|
|
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 editor. */
|
|
8
|
+
help?: ReactNode;
|
|
9
|
+
/** Error text. It replaces the help text and puts the editor in its error state. */
|
|
10
|
+
error?: ReactNode;
|
|
11
|
+
/** The content as an HTML string, when controlled. It is sanitised before display. */
|
|
12
|
+
value?: string;
|
|
13
|
+
/** The first content as an HTML string, when uncontrolled. It is sanitised before display. */
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
/** Called with the content as an HTML string after every change. */
|
|
16
|
+
onChange?: (html: string) => void;
|
|
17
|
+
/** Stops editing and disables the toolbar. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Asks for a link address when the Link tool is used. Defaults to `window.prompt`. Return null to cancel. */
|
|
20
|
+
requestLinkUrl?: () => string | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A labelled editor with a formatting toolbar, for long-form content. The toolbar marks the formatting at the cursor.
|
|
24
|
+
* Pasted and dropped content arrives as plain text, and only safe markup is kept from the value passed in.
|
|
25
|
+
*/
|
|
26
|
+
export declare function RichTextField({ label, meta, help, error, value, defaultValue, onChange, disabled, requestLinkUrl, className, ...props }: RichTextFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export interface RichTextToolProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/** The full name of the tool, for assistive technology, such as "Bold". */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Marks the format as applied at the cursor. */
|
|
6
|
+
active?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** One toolbar button of a RichTextField. Its children are the short visible text, such as "B". */
|
|
9
|
+
export declare const RichTextTool: import("react").ForwardRefExoticComponent<RichTextToolProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import type { RichTextFormat } from './richTextCommands';
|
|
3
|
+
export interface RichTextToolbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** The formats applied at the cursor. */
|
|
5
|
+
activeFormats?: RichTextFormat[];
|
|
6
|
+
/** Called when a tool is used. */
|
|
7
|
+
onFormat?: (format: RichTextFormat) => void;
|
|
8
|
+
/** Disables every tool. */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** The formatting toolbar of a RichTextField. Tab enters it once, and arrow keys move between tools. */
|
|
12
|
+
export declare const RichTextToolbar: import("react").ForwardRefExoticComponent<RichTextToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
|