@15gifts/back-office-kit 0.0.0-stage → 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +39 -0
- package/README.md +49 -2
- package/bin/back-office-kit.js +35 -0
- package/dist/browser/back-office-kit.js +22186 -0
- package/dist/components/Alert/Alert.css.d.ts +33 -0
- package/dist/components/Alert/Alert.d.ts +24 -0
- package/dist/components/Alert/Alert.js +63 -0
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/Alert/Alert.styles.js +17 -0
- package/dist/components/Alert/Alert.styles.js.map +1 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/AppShell/AppShell.css.d.ts +9 -0
- package/dist/components/AppShell/AppShell.d.ts +22 -0
- package/dist/components/AppShell/AppShell.js +48 -0
- package/dist/components/AppShell/AppShell.js.map +1 -0
- package/dist/components/AppShell/AppShell.styles.js +7 -0
- package/dist/components/AppShell/AppShell.styles.js.map +1 -0
- package/dist/components/AppShell/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.css.d.ts +22 -0
- package/dist/components/Avatar/Avatar.d.ts +14 -0
- package/dist/components/Avatar/Avatar.js +30 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Avatar/Avatar.styles.js +16 -0
- package/dist/components/Avatar/Avatar.styles.js.map +1 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.css.d.ts +16 -0
- package/dist/components/Badge/Badge.d.ts +14 -0
- package/dist/components/Badge/Badge.js +18 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Badge/Badge.styles.js +87 -0
- package/dist/components/Badge/Badge.styles.js.map +1 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.css.d.ts +7 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +24 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +51 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.styles.js +7 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -0
- package/dist/components/Breadcrumbs/index.d.ts +2 -0
- package/dist/components/Button/Button.css.d.ts +74 -0
- package/dist/components/Button/Button.d.ts +30 -0
- package/dist/components/Button/Button.js +54 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/Button.styles.js +29 -0
- package/dist/components/Button/Button.styles.js.map +1 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.css.d.ts +37 -0
- package/dist/components/Card/Card.d.ts +18 -0
- package/dist/components/Card/Card.js +38 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Card/Card.styles.js +18 -0
- package/dist/components/Card/Card.styles.js.map +1 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/ChatTranscript/ChatTranscript.css.d.ts +15 -0
- package/dist/components/ChatTranscript/ChatTranscript.d.ts +94 -0
- package/dist/components/ChatTranscript/ChatTranscript.js +162 -0
- package/dist/components/ChatTranscript/ChatTranscript.js.map +1 -0
- package/dist/components/ChatTranscript/ChatTranscript.styles.js +6 -0
- package/dist/components/ChatTranscript/ChatTranscript.styles.js.map +1 -0
- package/dist/components/ChatTranscript/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.css.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.d.ts +11 -0
- package/dist/components/Checkbox/Checkbox.js +46 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.styles.js +8 -0
- package/dist/components/Checkbox/Checkbox.styles.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.css.d.ts +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +28 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js +66 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.styles.js +10 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.styles.js.map +1 -0
- package/dist/components/CheckboxGroup/index.d.ts +2 -0
- package/dist/components/Chip/Chip.css.d.ts +4 -0
- package/dist/components/Chip/Chip.d.ts +18 -0
- package/dist/components/Chip/Chip.js +40 -0
- package/dist/components/Chip/Chip.js.map +1 -0
- package/dist/components/Chip/Chip.styles.js +7 -0
- package/dist/components/Chip/Chip.styles.js.map +1 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/ColorPicker/ColorPicker.css.d.ts +5 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +19 -0
- package/dist/components/ColorPicker/ColorPicker.js +79 -0
- package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.styles.js +6 -0
- package/dist/components/ColorPicker/ColorPicker.styles.js.map +1 -0
- package/dist/components/ColorPicker/color.d.ts +14 -0
- package/dist/components/ColorPicker/color.js +39 -0
- package/dist/components/ColorPicker/color.js.map +1 -0
- package/dist/components/ColorPicker/index.d.ts +2 -0
- package/dist/components/Combobox/Combobox.d.ts +82 -0
- package/dist/components/Combobox/Combobox.js +177 -0
- package/dist/components/Combobox/Combobox.js.map +1 -0
- package/dist/components/Combobox/index.d.ts +2 -0
- package/dist/components/CopyButton/CopyButton.d.ts +11 -0
- package/dist/components/CopyButton/CopyButton.js +40 -0
- package/dist/components/CopyButton/CopyButton.js.map +1 -0
- package/dist/components/CopyButton/index.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.css.d.ts +31 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +58 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +258 -0
- package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.styles.js +8 -0
- package/dist/components/DateRangePicker/DateRangePicker.styles.js.map +1 -0
- package/dist/components/DateRangePicker/index.d.ts +4 -0
- package/dist/components/DateRangePicker/presets.d.ts +27 -0
- package/dist/components/DateRangePicker/presets.js +62 -0
- package/dist/components/DateRangePicker/presets.js.map +1 -0
- package/dist/components/DateTimeInput/DateTimeInput.css.d.ts +1 -0
- package/dist/components/DateTimeInput/DateTimeInput.d.ts +9 -0
- package/dist/components/DateTimeInput/DateTimeInput.js +29 -0
- package/dist/components/DateTimeInput/DateTimeInput.js.map +1 -0
- package/dist/components/DateTimeInput/DateTimeInput.styles.js +8 -0
- package/dist/components/DateTimeInput/DateTimeInput.styles.js.map +1 -0
- package/dist/components/DateTimeInput/index.d.ts +2 -0
- package/dist/components/DescriptionList/DescriptionList.css.d.ts +62 -0
- package/dist/components/DescriptionList/DescriptionList.d.ts +23 -0
- package/dist/components/DescriptionList/DescriptionList.js +27 -0
- package/dist/components/DescriptionList/DescriptionList.js.map +1 -0
- package/dist/components/DescriptionList/DescriptionList.styles.js +42 -0
- package/dist/components/DescriptionList/DescriptionList.styles.js.map +1 -0
- package/dist/components/DescriptionList/index.d.ts +2 -0
- package/dist/components/DetailsSummary/DetailsSummary.css.d.ts +5 -0
- package/dist/components/DetailsSummary/DetailsSummary.d.ts +11 -0
- package/dist/components/DetailsSummary/DetailsSummary.js +26 -0
- package/dist/components/DetailsSummary/DetailsSummary.js.map +1 -0
- package/dist/components/DetailsSummary/DetailsSummary.styles.js +15 -0
- package/dist/components/DetailsSummary/DetailsSummary.styles.js.map +1 -0
- package/dist/components/DetailsSummary/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.css.d.ts +14 -0
- package/dist/components/Drawer/Drawer.d.ts +42 -0
- package/dist/components/Drawer/Drawer.js +75 -0
- package/dist/components/Drawer/Drawer.js.map +1 -0
- package/dist/components/Drawer/Drawer.styles.js +17 -0
- package/dist/components/Drawer/Drawer.styles.js.map +1 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/EmptyLine/EmptyLine.css.d.ts +11 -0
- package/dist/components/EmptyLine/EmptyLine.d.ts +7 -0
- package/dist/components/EmptyLine/EmptyLine.js +19 -0
- package/dist/components/EmptyLine/EmptyLine.js.map +1 -0
- package/dist/components/EmptyLine/EmptyLine.styles.js +12 -0
- package/dist/components/EmptyLine/EmptyLine.styles.js.map +1 -0
- package/dist/components/EmptyLine/index.d.ts +2 -0
- package/dist/components/EmptyState/EmptyState.css.d.ts +16 -0
- package/dist/components/EmptyState/EmptyState.d.ts +15 -0
- package/dist/components/EmptyState/EmptyState.js +37 -0
- package/dist/components/EmptyState/EmptyState.js.map +1 -0
- package/dist/components/EmptyState/EmptyState.styles.js +15 -0
- package/dist/components/EmptyState/EmptyState.styles.js.map +1 -0
- package/dist/components/EmptyState/index.d.ts +2 -0
- package/dist/components/EnvironmentChip/EnvironmentChip.css.d.ts +24 -0
- package/dist/components/EnvironmentChip/EnvironmentChip.d.ts +17 -0
- package/dist/components/EnvironmentChip/EnvironmentChip.js +32 -0
- package/dist/components/EnvironmentChip/EnvironmentChip.js.map +1 -0
- package/dist/components/EnvironmentChip/EnvironmentChip.styles.js +17 -0
- package/dist/components/EnvironmentChip/EnvironmentChip.styles.js.map +1 -0
- package/dist/components/EnvironmentChip/index.d.ts +2 -0
- package/dist/components/Field/Field.css.d.ts +13 -0
- package/dist/components/Field/Field.d.ts +57 -0
- package/dist/components/Field/Field.js +58 -0
- package/dist/components/Field/Field.js.map +1 -0
- package/dist/components/Field/Field.styles.js +6 -0
- package/dist/components/Field/Field.styles.js.map +1 -0
- package/dist/components/Field/index.d.ts +2 -0
- package/dist/components/Fieldset/Fieldset.css.d.ts +6 -0
- package/dist/components/Fieldset/Fieldset.d.ts +11 -0
- package/dist/components/Fieldset/Fieldset.js +32 -0
- package/dist/components/Fieldset/Fieldset.js.map +1 -0
- package/dist/components/Fieldset/Fieldset.styles.js +6 -0
- package/dist/components/Fieldset/Fieldset.styles.js.map +1 -0
- package/dist/components/Fieldset/index.d.ts +2 -0
- package/dist/components/Grid/Grid.css.d.ts +22 -0
- package/dist/components/Grid/Grid.d.ts +21 -0
- package/dist/components/Grid/Grid.js +23 -0
- package/dist/components/Grid/Grid.js.map +1 -0
- package/dist/components/Grid/Grid.styles.js +28 -0
- package/dist/components/Grid/Grid.styles.js.map +1 -0
- package/dist/components/Grid/index.d.ts +2 -0
- package/dist/components/Heading/Heading.css.d.ts +21 -0
- package/dist/components/Heading/Heading.d.ts +11 -0
- package/dist/components/Heading/Heading.js +22 -0
- package/dist/components/Heading/Heading.js.map +1 -0
- package/dist/components/Heading/Heading.styles.js +18 -0
- package/dist/components/Heading/Heading.styles.js.map +1 -0
- package/dist/components/Heading/index.d.ts +2 -0
- package/dist/components/Icon/Icon.css.d.ts +1 -0
- package/dist/components/Icon/Icon.d.ts +24 -0
- package/dist/components/Icon/Icon.js +24 -0
- package/dist/components/Icon/Icon.js.map +1 -0
- package/dist/components/Icon/Icon.styles.js +6 -0
- package/dist/components/Icon/Icon.styles.js.map +1 -0
- package/dist/components/Icon/index.d.ts +2 -0
- package/dist/components/List/List.css.d.ts +4 -0
- package/dist/components/List/List.d.ts +13 -0
- package/dist/components/List/List.js +28 -0
- package/dist/components/List/List.js.map +1 -0
- package/dist/components/List/List.styles.js +6 -0
- package/dist/components/List/List.styles.js.map +1 -0
- package/dist/components/List/index.d.ts +2 -0
- package/dist/components/Loader/Loader.css.d.ts +1 -0
- package/dist/components/Loader/Loader.d.ts +12 -0
- package/dist/components/Loader/Loader.js +27 -0
- package/dist/components/Loader/Loader.js.map +1 -0
- package/dist/components/Loader/Loader.styles.js +7 -0
- package/dist/components/Loader/Loader.styles.js.map +1 -0
- package/dist/components/Loader/index.d.ts +2 -0
- package/dist/components/Menu/Menu.css.d.ts +9 -0
- package/dist/components/Menu/Menu.d.ts +114 -0
- package/dist/components/Menu/Menu.js +140 -0
- package/dist/components/Menu/Menu.js.map +1 -0
- package/dist/components/Menu/Menu.styles.js +6 -0
- package/dist/components/Menu/Menu.styles.js.map +1 -0
- package/dist/components/Menu/index.d.ts +2 -0
- package/dist/components/MetricBar/MetricBar.css.d.ts +10 -0
- package/dist/components/MetricBar/MetricBar.d.ts +28 -0
- package/dist/components/MetricBar/MetricBar.js +51 -0
- package/dist/components/MetricBar/MetricBar.js.map +1 -0
- package/dist/components/MetricBar/MetricBar.styles.js +20 -0
- package/dist/components/MetricBar/MetricBar.styles.js.map +1 -0
- package/dist/components/MetricBar/index.d.ts +2 -0
- package/dist/components/Modal/Modal.css.d.ts +24 -0
- package/dist/components/Modal/Modal.d.ts +22 -0
- package/dist/components/Modal/Modal.js +64 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/Modal.styles.js +17 -0
- package/dist/components/Modal/Modal.styles.js.map +1 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/NavRail/HumaraLogo.d.ts +5 -0
- package/dist/components/NavRail/HumaraLogo.js +33 -0
- package/dist/components/NavRail/HumaraLogo.js.map +1 -0
- package/dist/components/NavRail/NavRail.css.d.ts +11 -0
- package/dist/components/NavRail/NavRail.d.ts +68 -0
- package/dist/components/NavRail/NavRail.js +129 -0
- package/dist/components/NavRail/NavRail.js.map +1 -0
- package/dist/components/NavRail/NavRail.styles.js +8 -0
- package/dist/components/NavRail/NavRail.styles.js.map +1 -0
- package/dist/components/NavRail/index.d.ts +2 -0
- package/dist/components/NumberInput/NumberInput.d.ts +21 -0
- package/dist/components/NumberInput/NumberInput.js +59 -0
- package/dist/components/NumberInput/NumberInput.js.map +1 -0
- package/dist/components/NumberInput/index.d.ts +2 -0
- package/dist/components/PageHeader/PageHeader.css.d.ts +8 -0
- package/dist/components/PageHeader/PageHeader.d.ts +15 -0
- package/dist/components/PageHeader/PageHeader.js +40 -0
- package/dist/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/components/PageHeader/PageHeader.styles.js +6 -0
- package/dist/components/PageHeader/PageHeader.styles.js.map +1 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/Pagination/Pagination.css.d.ts +3 -0
- package/dist/components/Pagination/Pagination.d.ts +19 -0
- package/dist/components/Pagination/Pagination.js +61 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/Pagination.styles.js +6 -0
- package/dist/components/Pagination/Pagination.styles.js.map +1 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Popover/Popover.css.d.ts +4 -0
- package/dist/components/Popover/Popover.d.ts +26 -0
- package/dist/components/Popover/Popover.js +44 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Popover/Popover.styles.js +7 -0
- package/dist/components/Popover/Popover.styles.js.map +1 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/PortalContainer/PortalContainer.d.ts +18 -0
- package/dist/components/PortalContainer/PortalContainer.js +17 -0
- package/dist/components/PortalContainer/PortalContainer.js.map +1 -0
- package/dist/components/PortalContainer/index.d.ts +2 -0
- package/dist/components/ProgressBar/ProgressBar.css.d.ts +8 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +22 -0
- package/dist/components/ProgressBar/ProgressBar.js +64 -0
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -0
- package/dist/components/ProgressBar/ProgressBar.styles.js +11 -0
- package/dist/components/ProgressBar/ProgressBar.styles.js.map +1 -0
- package/dist/components/ProgressBar/index.d.ts +2 -0
- package/dist/components/RadioCards/RadioCards.css.d.ts +6 -0
- package/dist/components/RadioCards/RadioCards.d.ts +26 -0
- package/dist/components/RadioCards/RadioCards.js +65 -0
- package/dist/components/RadioCards/RadioCards.js.map +1 -0
- package/dist/components/RadioCards/RadioCards.styles.js +6 -0
- package/dist/components/RadioCards/RadioCards.styles.js.map +1 -0
- package/dist/components/RadioCards/index.d.ts +2 -0
- package/dist/components/SaveBar/SaveBar.css.d.ts +5 -0
- package/dist/components/SaveBar/SaveBar.d.ts +19 -0
- package/dist/components/SaveBar/SaveBar.js +44 -0
- package/dist/components/SaveBar/SaveBar.js.map +1 -0
- package/dist/components/SaveBar/SaveBar.styles.js +6 -0
- package/dist/components/SaveBar/SaveBar.styles.js.map +1 -0
- package/dist/components/SaveBar/index.d.ts +2 -0
- package/dist/components/Select/Select.css.d.ts +5 -0
- package/dist/components/Select/Select.d.ts +56 -0
- package/dist/components/Select/Select.js +118 -0
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Select/Select.styles.js +8 -0
- package/dist/components/Select/Select.styles.js.map +1 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.css.d.ts +16 -0
- package/dist/components/Skeleton/Skeleton.d.ts +16 -0
- package/dist/components/Skeleton/Skeleton.js +38 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.styles.js +17 -0
- package/dist/components/Skeleton/Skeleton.styles.js.map +1 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Stack/Stack.css.d.ts +54 -0
- package/dist/components/Stack/Stack.d.ts +16 -0
- package/dist/components/Stack/Stack.js +21 -0
- package/dist/components/Stack/Stack.js.map +1 -0
- package/dist/components/Stack/Stack.styles.js +39 -0
- package/dist/components/Stack/Stack.styles.js.map +1 -0
- package/dist/components/Stack/index.d.ts +2 -0
- package/dist/components/StatCard/StatCard.css.d.ts +4 -0
- package/dist/components/StatCard/StatCard.d.ts +11 -0
- package/dist/components/StatCard/StatCard.js +27 -0
- package/dist/components/StatCard/StatCard.js.map +1 -0
- package/dist/components/StatCard/StatCard.styles.js +6 -0
- package/dist/components/StatCard/StatCard.styles.js.map +1 -0
- package/dist/components/StatCard/index.d.ts +2 -0
- package/dist/components/StatsGrid/StatsGrid.css.d.ts +1 -0
- package/dist/components/StatsGrid/StatsGrid.d.ts +4 -0
- package/dist/components/StatsGrid/StatsGrid.js +13 -0
- package/dist/components/StatsGrid/StatsGrid.js.map +1 -0
- package/dist/components/StatsGrid/StatsGrid.styles.js +6 -0
- package/dist/components/StatsGrid/StatsGrid.styles.js.map +1 -0
- package/dist/components/StatsGrid/index.d.ts +2 -0
- package/dist/components/StatusBadge/StatusBadge.css.d.ts +53 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +10 -0
- package/dist/components/StatusBadge/StatusBadge.js +17 -0
- package/dist/components/StatusBadge/StatusBadge.js.map +1 -0
- package/dist/components/StatusBadge/StatusBadge.styles.js +19 -0
- package/dist/components/StatusBadge/StatusBadge.styles.js.map +1 -0
- package/dist/components/StatusBadge/index.d.ts +2 -0
- package/dist/components/Switch/Switch.css.d.ts +3 -0
- package/dist/components/Switch/Switch.d.ts +11 -0
- package/dist/components/Switch/Switch.js +37 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Switch/Switch.styles.js +8 -0
- package/dist/components/Switch/Switch.styles.js.map +1 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switcher/Switcher.css.d.ts +32 -0
- package/dist/components/Switcher/Switcher.d.ts +80 -0
- package/dist/components/Switcher/Switcher.js +158 -0
- package/dist/components/Switcher/Switcher.js.map +1 -0
- package/dist/components/Switcher/Switcher.styles.js +16 -0
- package/dist/components/Switcher/Switcher.styles.js.map +1 -0
- package/dist/components/Switcher/index.d.ts +2 -0
- package/dist/components/Table/Table.css.d.ts +31 -0
- package/dist/components/Table/Table.d.ts +163 -0
- package/dist/components/Table/Table.js +248 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Table/Table.styles.js +12 -0
- package/dist/components/Table/Table.styles.js.map +1 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/TableAction/TableAction.d.ts +10 -0
- package/dist/components/TableAction/TableAction.js +19 -0
- package/dist/components/TableAction/TableAction.js.map +1 -0
- package/dist/components/TableAction/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.css.d.ts +6 -0
- package/dist/components/Tabs/Tabs.d.ts +69 -0
- package/dist/components/Tabs/Tabs.js +67 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tabs/Tabs.styles.js +7 -0
- package/dist/components/Tabs/Tabs.styles.js.map +1 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tag/Tag.css.d.ts +42 -0
- package/dist/components/Tag/Tag.d.ts +10 -0
- package/dist/components/Tag/Tag.js +30 -0
- package/dist/components/Tag/Tag.js.map +1 -0
- package/dist/components/Tag/Tag.styles.js +23 -0
- package/dist/components/Tag/Tag.styles.js.map +1 -0
- package/dist/components/Tag/index.d.ts +2 -0
- package/dist/components/TextInput/TextInput.css.d.ts +1 -0
- package/dist/components/TextInput/TextInput.d.ts +27 -0
- package/dist/components/TextInput/TextInput.js +59 -0
- package/dist/components/TextInput/TextInput.js.map +1 -0
- package/dist/components/TextInput/TextInput.styles.js +6 -0
- package/dist/components/TextInput/TextInput.styles.js.map +1 -0
- package/dist/components/TextInput/index.d.ts +2 -0
- package/dist/components/TextInput/useCharCount.d.ts +15 -0
- package/dist/components/TextInput/useCharCount.js +14 -0
- package/dist/components/TextInput/useCharCount.js.map +1 -0
- package/dist/components/Textarea/Textarea.css.d.ts +4 -0
- package/dist/components/Textarea/Textarea.d.ts +19 -0
- package/dist/components/Textarea/Textarea.js +59 -0
- package/dist/components/Textarea/Textarea.js.map +1 -0
- package/dist/components/Textarea/Textarea.styles.js +8 -0
- package/dist/components/Textarea/Textarea.styles.js.map +1 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/ThemeMenu/ThemeMenu.d.ts +13 -0
- package/dist/components/ThemeMenu/ThemeMenu.js +52 -0
- package/dist/components/ThemeMenu/ThemeMenu.js.map +1 -0
- package/dist/components/ThemeMenu/index.d.ts +2 -0
- package/dist/components/ThemePicker/ThemePicker.css.d.ts +10 -0
- package/dist/components/ThemePicker/ThemePicker.d.ts +26 -0
- package/dist/components/ThemePicker/ThemePicker.js +76 -0
- package/dist/components/ThemePicker/ThemePicker.js.map +1 -0
- package/dist/components/ThemePicker/ThemePicker.styles.js +7 -0
- package/dist/components/ThemePicker/ThemePicker.styles.js.map +1 -0
- package/dist/components/ThemePicker/index.d.ts +2 -0
- package/dist/components/TimeInput/TimeInput.d.ts +10 -0
- package/dist/components/TimeInput/TimeInput.js +29 -0
- package/dist/components/TimeInput/TimeInput.js.map +1 -0
- package/dist/components/TimeInput/index.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroup.css.d.ts +4 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +43 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +69 -0
- package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.styles.js +13 -0
- package/dist/components/ToggleGroup/ToggleGroup.styles.js.map +1 -0
- package/dist/components/ToggleGroup/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.css.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +22 -0
- package/dist/components/Tooltip/Tooltip.js +33 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.styles.js +6 -0
- package/dist/components/Tooltip/Tooltip.styles.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/TopBar/TopBar.css.d.ts +3 -0
- package/dist/components/TopBar/TopBar.d.ts +9 -0
- package/dist/components/TopBar/TopBar.js +20 -0
- package/dist/components/TopBar/TopBar.js.map +1 -0
- package/dist/components/TopBar/TopBar.styles.js +6 -0
- package/dist/components/TopBar/TopBar.styles.js.map +1 -0
- package/dist/components/TopBar/index.d.ts +2 -0
- package/dist/components/UserMenu/UserMenu.css.d.ts +5 -0
- package/dist/components/UserMenu/UserMenu.d.ts +27 -0
- package/dist/components/UserMenu/UserMenu.js +55 -0
- package/dist/components/UserMenu/UserMenu.js.map +1 -0
- package/dist/components/UserMenu/UserMenu.styles.js +7 -0
- package/dist/components/UserMenu/UserMenu.styles.js.map +1 -0
- package/dist/components/UserMenu/index.d.ts +2 -0
- package/dist/examples/Crm.css.d.ts +3 -0
- package/dist/examples/ExampleShell.d.ts +28 -0
- package/dist/examples/Expenses.css.d.ts +2 -0
- package/dist/examples/HiringTracker.css.d.ts +13 -0
- package/dist/examples/SalesPipeline.css.d.ts +11 -0
- package/dist/foundations/Foundations.css.d.ts +12 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +67 -0
- package/dist/styles/input.css.d.ts +26 -0
- package/dist/styles/input.styles.js +7 -0
- package/dist/styles/input.styles.js.map +1 -0
- package/dist/styles/shared.css.d.ts +13 -0
- package/dist/styles/shared.styles.js +6 -0
- package/dist/styles/shared.styles.js.map +1 -0
- package/dist/styles.css +4 -0
- package/dist/theme/fontSize.d.ts +15 -0
- package/dist/theme/fontSize.js +16 -0
- package/dist/theme/fontSize.js.map +1 -0
- package/dist/theme/htmlSetting.d.ts +14 -0
- package/dist/theme/htmlSetting.js +33 -0
- package/dist/theme/htmlSetting.js.map +1 -0
- package/dist/theme/theme.d.ts +29 -0
- package/dist/theme/theme.js +37 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/tokens/contract.css.d.ts +120 -0
- package/dist/tokens/contract.styles.js +68 -0
- package/dist/tokens/contract.styles.js.map +1 -0
- package/dist/tokens/global.css.d.ts +0 -0
- package/dist/tokens/global.styles.js +2 -0
- package/dist/tokens/index.d.ts +7 -0
- package/dist/tokens/palette.d.ts +16 -0
- package/dist/tokens/palette.js +18 -0
- package/dist/tokens/palette.js.map +1 -0
- package/dist/tokens/scale.d.ts +51 -0
- package/dist/tokens/scale.js +47 -0
- package/dist/tokens/scale.js.map +1 -0
- package/dist/tokens/themes.css.d.ts +387 -0
- package/dist/tokens.js +4 -0
- package/package.json +111 -4
- package/skills/back-office-kit/SKILL.md +49 -0
- package/skills/back-office-kit/references/artifact-template.html +103 -0
- package/skills/back-office-kit/references/components.md +1470 -0
- package/skills/back-office-kit/references/install.md +210 -0
- package/skills/back-office-kit/references/migrate.md +142 -0
- package/skills/back-office-kit/references/patterns.md +294 -0
- package/skills/back-office-kit/references/testing.md +162 -0
|
@@ -0,0 +1,1470 @@
|
|
|
1
|
+
<!-- Generated by `npm run catalogue`. Do not edit by hand. -->
|
|
2
|
+
# Component catalogue
|
|
3
|
+
|
|
4
|
+
Every component is a named export of `@15gifts/back-office-kit`: `import { Button } from '@15gifts/back-office-kit'`.
|
|
5
|
+
Props marked * are required. All components also accept `className` and the native props of their root element.
|
|
6
|
+
|
|
7
|
+
Components: Alert, AppShell, Autocomplete, Avatar, Badge, Breadcrumbs, Button, Card, ChatTranscript, Checkbox, CheckboxGroup, Chip, ColorPicker, Combobox, CopyButton, DateRangePicker, DateTimeInput, DescriptionList, DetailsSummary, Drawer, EmptyLine, EmptyState, EnvironmentChip, environmentTone, Field, Fieldset, Grid, Heading, Icon, List, Loader, Menu, MetricBar, Modal, NavRail, NumberInput, PageHeader, Pagination, Popover, PortalContainer, ProgressBar, RadioCards, SaveBar, Select, Skeleton, Stack, StatCard, StatsGrid, StatusBadge, Switch, Switcher, Table, TableAction, Tabs, Tag, Textarea, TextInput, ThemeMenu, ThemePicker, TimeInput, ToggleGroup, Tooltip, TopBar, usePortalContainer, UserMenu.
|
|
8
|
+
|
|
9
|
+
### Alert
|
|
10
|
+
|
|
11
|
+
Page or section message. `info`/`success` are polite status updates; `warning`/`danger` are announced immediately. Not for field errors (use the input's `error`).
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| `action` | `ReactNode` | | Optional control under the body, e.g. a Button. |
|
|
16
|
+
| `detail` | `ReactNode` | | Detail lines in monospace under the body, e.g. IDs or error codes. |
|
|
17
|
+
| `dismissLabel` | `string` | `Dismiss` | Accessible name of the dismiss button. |
|
|
18
|
+
| `live` | `boolean` | `true` | Announce the alert to screen readers (default). Set `false` for static content, such as a validation summary that re-renders on every keystroke: it drops `role="alert"`/`"status"`. An explicit `role` prop always wins. |
|
|
19
|
+
| `onDismiss` | `(() => void)` | | Shows a dismiss button when set. |
|
|
20
|
+
| `title` | `ReactNode` | | The message, in bold. Optional, e.g. for a plain list of problems in `children`. |
|
|
21
|
+
| `tone` | `AlertTone` | `info` | `warning` and `danger` interrupt screen readers (`role="alert"`); the others are polite (`role="status"`). |
|
|
22
|
+
|
|
23
|
+
### AppShell
|
|
24
|
+
|
|
25
|
+
Page frame for internal apps: icon rail on the left, top bar, optional side panel, and the main content.
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| `bodyProps` | `(ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & DataAttributes)` | | Props for the row that holds the side panel and `<main>`, below the top bar. |
|
|
30
|
+
| `contained` | `boolean` | `true` | Constrain the content to a readable max width. |
|
|
31
|
+
| `mainProps` | `(ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & DataAttributes)` | | Props for the `<main>` element, e.g. a test ID or `style={{ position: 'relative' }}`. |
|
|
32
|
+
| `rail` | `ReactNode` | | Left navigation, usually a `NavRail`. |
|
|
33
|
+
| `sidePanel` | `ReactNode` | | Optional secondary panel between the rail and the content (e.g. section nav or filters). |
|
|
34
|
+
| `sidePanelLabel` | `string` | `Sidebar` | Accessible name for `sidePanel`. |
|
|
35
|
+
| `skipLinkLabel` | `string` | `Skip to content` | Text of the "skip to content" link, the first thing keyboard users reach. |
|
|
36
|
+
| `topBar` | `ReactNode` | | Sticky bar above the content, usually a `TopBar`. |
|
|
37
|
+
|
|
38
|
+
### Autocomplete
|
|
39
|
+
|
|
40
|
+
Free-text input with suggestions. The value is whatever is typed or picked.
|
|
41
|
+
|
|
42
|
+
| Prop | Type | Default | Description |
|
|
43
|
+
| --- | --- | --- | --- |
|
|
44
|
+
| `className` | `string` | | Goes on the field's root element. |
|
|
45
|
+
| `clearable` | `boolean` | `false` | Shows a Clear button while there's text. |
|
|
46
|
+
| `clearLabel` | `string` | `Clear` | Accessible name of the Clear button. |
|
|
47
|
+
| `defaultOpen` | `boolean` | `false` | Whether the popup is initially open. To render a controlled popup, use the `open` prop instead. |
|
|
48
|
+
| `defaultValue` | `string` | | The initial text, when uncontrolled. |
|
|
49
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
50
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
51
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
52
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
53
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
54
|
+
| `inputProps` | `PartProps<ComboboxInputProps>` | | Props for the text input (role `combobox`), e.g. `{ 'data-testid': 'branch-filter' }`. |
|
|
55
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
56
|
+
| `name` | `string` | | Identifies the field when a form is submitted. |
|
|
57
|
+
| `onClear` | `(() => void)` | | Called when the text is cleared with the Clear button, or Escape while the suggestions are closed. Not when it's deleted by typing. |
|
|
58
|
+
| `onItemSelect` | `((value: string) => void)` | | Called when a suggestion is picked by click or Enter (not while typing or arrowing through the list). `onValueChange` still fires for every change. |
|
|
59
|
+
| `onOpenChange` | `((open: boolean, eventDetails: AutocompleteRootOpenChangeEventDetails) => void)` | | Event handler called when the popup is opened or closed. |
|
|
60
|
+
| `onValueChange` | `((value: string, eventDetails: AutocompleteRootChangeEventDetails) => void)` | | Event handler called when the input value of the autocomplete changes. |
|
|
61
|
+
| `open` | `boolean` | | Whether the popup is currently open. Use when controlled. |
|
|
62
|
+
| `placeholder` | `string` | | Shown in the empty input. |
|
|
63
|
+
| `popupProps` | `PartProps<ComboboxPopupProps>` | | Props for the suggestions popup. |
|
|
64
|
+
| `portalContainer` | `PortalContainerTarget` | | Where the suggestions render. Defaults to the nearest `PortalContainer`, else `document.body`. |
|
|
65
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the text input. |
|
|
66
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
67
|
+
| `suggestions` * | `string[]` | | Suggestions shown while typing. Any text is allowed. |
|
|
68
|
+
| `value` | `string` | | The text. Use with `onValueChange` to control it. |
|
|
69
|
+
|
|
70
|
+
### Avatar
|
|
71
|
+
|
|
72
|
+
Person's image with an initials fallback. Named from `name` for assistive tech.
|
|
73
|
+
|
|
74
|
+
| Prop | Type | Default | Description |
|
|
75
|
+
| --- | --- | --- | --- |
|
|
76
|
+
| `className` | `string` | | |
|
|
77
|
+
| `initials` | `string` | | Initials shown when there is no image. Derived from `name` when omitted. |
|
|
78
|
+
| `name` | `string` | | Person's name or email. Used as the accessible name and to derive initials. |
|
|
79
|
+
| `render` | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, AvatarRootState>` | | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
|
|
80
|
+
| `size` | `"sm" \| "md" \| "lg"` | `md` | `sm` 24px (inline, e.g. menus), `md` 40px (default), `lg` 56px (profile headers). |
|
|
81
|
+
| `src` | `string` | | Image URL. Falls back to initials while loading or if it fails. |
|
|
82
|
+
| `style` | `CSSProperties \| ((state: AvatarRootState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
83
|
+
|
|
84
|
+
### Badge
|
|
85
|
+
|
|
86
|
+
A small pill label. Use `tone`, not `color`.
|
|
87
|
+
|
|
88
|
+
| Prop | Type | Default | Description |
|
|
89
|
+
| --- | --- | --- | --- |
|
|
90
|
+
| `icon` | `ReactNode` | | Decorative icon shown before the label (mark it `aria-hidden`). |
|
|
91
|
+
| `mono` | `boolean` | `false` | Monospace text, for IDs, codes and versions. |
|
|
92
|
+
| `tone` | `BadgeTone` | `neutral` | Colour. `neutral` (default) for plain labels; the others carry meaning, e.g. `danger` for errors. |
|
|
93
|
+
| `variant` | `"subtle" \| "solid"` | `subtle` | `subtle` (default) is a tinted pill; `solid` is a filled pill for stronger emphasis. |
|
|
94
|
+
|
|
95
|
+
### Breadcrumbs
|
|
96
|
+
|
|
97
|
+
Where the current page sits in the app.
|
|
98
|
+
|
|
99
|
+
| Prop | Type | Default | Description |
|
|
100
|
+
| --- | --- | --- | --- |
|
|
101
|
+
| `items` * | `BreadcrumbItem[]` | | Trail from root to the current page. The last item is the current page unless it sets `current: false`. |
|
|
102
|
+
|
|
103
|
+
### Button
|
|
104
|
+
|
|
105
|
+
Action button. Use `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions.
|
|
106
|
+
|
|
107
|
+
| Prop | Type | Default | Description |
|
|
108
|
+
| --- | --- | --- | --- |
|
|
109
|
+
| `fullWidth` | `boolean` | `false` | Stretches the button to fill its container. |
|
|
110
|
+
| `icon` | `ReactNode` | | Icon element (e.g. a lucide-react icon) shown before the label. |
|
|
111
|
+
| `iconOnly` | `boolean` | `false` | Square button showing only the icon. `children` (or `aria-label`) still names it for screen readers. |
|
|
112
|
+
| `loading` | `boolean` | `false` | Shows a spinner and blocks clicks, keeping the button's width and focus. A loading button is `aria-disabled="true"` and `aria-busy="true"`, not native `disabled`, so it stays focusable (assert `aria-disabled` in tests, not `toBeDisabled()`). |
|
|
113
|
+
| `loadingLabel` | `string` | | Text announced to assistive tech while `loading`, e.g. "Saving". It becomes the button's accessible name and is read out through a polite live region, a visually hidden `role="status"` span rendered next to the button. |
|
|
114
|
+
| `render` | `RenderProp<Record<string, unknown>>` | | Render a different element, e.g. `render={<a href="/runs" />}` or a router `<Link to="/runs" />`. |
|
|
115
|
+
| `size` | `"sm" \| "md"` | `md` | `sm` for dense places such as table rows and toolbars. |
|
|
116
|
+
| `variant` | `"danger" \| "primary" \| "secondary" \| "ghost"` | `primary` | `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. |
|
|
117
|
+
|
|
118
|
+
### Card
|
|
119
|
+
|
|
120
|
+
Surface that groups related content, with an optional heading and actions. Use `flush` for edge-to-edge content like tables.
|
|
121
|
+
|
|
122
|
+
| Prop | Type | Default | Description |
|
|
123
|
+
| --- | --- | --- | --- |
|
|
124
|
+
| `actions` | `ReactNode` | | Controls shown at the end of the header, e.g. buttons. |
|
|
125
|
+
| `description` | `ReactNode` | | Muted subtitle under the heading. |
|
|
126
|
+
| `flush` | `boolean` | `false` | Remove the padding, e.g. for a table that fills the card. |
|
|
127
|
+
| `heading` | `ReactNode` | | Header content. A string is rendered as an `h2`; pass your own element to pick the level. |
|
|
128
|
+
| `render` | `RenderProp<Record<string, unknown>>` | | Render a different element instead of `<section>`, e.g. `render={<aside />}`. |
|
|
129
|
+
| `size` | `"sm" \| "md"` | `md` | `sm` has tighter padding, e.g. for cards inside other content. |
|
|
130
|
+
|
|
131
|
+
### ChatTranscript
|
|
132
|
+
|
|
133
|
+
A conversation between a shopper and the assistant. Pass `messages`, or compose
|
|
134
|
+
`ChatTranscript.Root`, `.Message`, `.Bubble`, `.Meta`, `.Divider` and `.Typing` for custom
|
|
135
|
+
layouts. Consecutive messages from the same speaker group together.
|
|
136
|
+
|
|
137
|
+
| Prop | Type | Default | Description |
|
|
138
|
+
| --- | --- | --- | --- |
|
|
139
|
+
| `assistantAvatar` | `ReactNode` | | Assistant avatar, e.g. `<Avatar size="sm" name="Humara" />`. |
|
|
140
|
+
| `assistantName` | `ReactNode` | | Visible assistant name, e.g. "Humara". Defaults to the `labels.assistant` name ("Assistant"), so replies are always marked. |
|
|
141
|
+
| `empty` | `ReactNode` | | Shown when there are no messages. |
|
|
142
|
+
| `label` | `string` | | Accessible name of the log. |
|
|
143
|
+
| `labels` | `ChatTranscriptLabels` | | Speaker names for screen readers. Defaults: "You" and "Assistant". |
|
|
144
|
+
| `live` | `boolean` | | Announce new messages to screen readers (`aria-live="polite"`). Off by default. |
|
|
145
|
+
| `messages` * | `ChatMessage[]` | | |
|
|
146
|
+
| `typing` | `boolean` | | Show the assistant typing indicator at the end. |
|
|
147
|
+
| `typingLabel` | `string` | | Screen-reader text for the typing indicator. |
|
|
148
|
+
|
|
149
|
+
### Checkbox
|
|
150
|
+
|
|
151
|
+
A checkbox with its label beside it.
|
|
152
|
+
|
|
153
|
+
| Prop | Type | Default | Description |
|
|
154
|
+
| --- | --- | --- | --- |
|
|
155
|
+
| `checked` | `boolean` | `undefined` | Whether the checkbox is currently ticked. To render an uncontrolled checkbox, use the `defaultChecked` prop instead. |
|
|
156
|
+
| `className` | `string` | | Class for the field's root element. |
|
|
157
|
+
| `defaultChecked` | `boolean` | `false` | Whether the checkbox is initially ticked. To render a controlled checkbox, use the `checked` prop instead. |
|
|
158
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
159
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
160
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
161
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
162
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
163
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
164
|
+
| `name` | `string` | `undefined` | Identifies the field when a form is submitted. |
|
|
165
|
+
| `onCheckedChange` | `((checked: boolean, eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element; }) => void)` | | Event handler called when the checkbox is ticked or unticked. |
|
|
166
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the hidden checkbox input (for form libraries). |
|
|
167
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
168
|
+
| `style` | `CSSProperties \| ((state: CheckboxRootState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
169
|
+
| `value` | `string` | | The checkbox's value. Identifies it within a [Checkbox Group](https://base-ui.com/react/components/checkbox-group), falling back to `name` when omitted. When submitting a form, a checked box submits `value`; with no `value`, it submits the native "on". |
|
|
170
|
+
|
|
171
|
+
### CheckboxGroup
|
|
172
|
+
|
|
173
|
+
A labelled set of checkboxes: pick any number. `required` only adds the asterisk, since browsers
|
|
174
|
+
can't require "at least one"; validate that yourself and pass `error`.
|
|
175
|
+
|
|
176
|
+
| Prop | Type | Default | Description |
|
|
177
|
+
| --- | --- | --- | --- |
|
|
178
|
+
| `className` | `string` | | Class for the field's root element. |
|
|
179
|
+
| `defaultValue` | `string[]` | | Names of the checkboxes in the group that should be initially ticked. To render a controlled checkbox group, use the `value` prop instead. |
|
|
180
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
181
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
182
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
183
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
184
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
185
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
186
|
+
| `name` | `string` | | Submitted once per ticked option. |
|
|
187
|
+
| `onValueChange` | `((value: string[]) => void)` | | Called with the values of the ticked options. |
|
|
188
|
+
| `options` * | `CheckboxGroupOption[]` | | The checkboxes, in order. |
|
|
189
|
+
| `orientation` | `"horizontal" \| "vertical"` | `vertical` | `horizontal` lines short options up in a row, wrapping when needed. |
|
|
190
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
191
|
+
| `style` | `CSSProperties \| ((state: CheckboxGroupState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
192
|
+
| `value` | `string[]` | | Names of the checkboxes in the group that should be ticked. To render an uncontrolled checkbox group, use the `defaultValue` prop instead. |
|
|
193
|
+
|
|
194
|
+
### Chip
|
|
195
|
+
|
|
196
|
+
A selectable pill built on Base UI Toggle. Selected chips show a leading check. Pass `static`
|
|
197
|
+
for a non-interactive chip that only displays a choice.
|
|
198
|
+
|
|
199
|
+
| Prop | Type | Default | Description |
|
|
200
|
+
| --- | --- | --- | --- |
|
|
201
|
+
| `className` | `string` | | |
|
|
202
|
+
| `defaultPressed` | `boolean` | `false` | Whether the toggle button is currently pressed. This is the uncontrolled counterpart of `pressed`. |
|
|
203
|
+
| `onPressedChange` | `((pressed: boolean, eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element; }) => void)` | | Callback fired when the pressed state is changed. |
|
|
204
|
+
| `pressed` | `boolean` | | Whether the toggle button is currently pressed. This is the controlled counterpart of `defaultPressed`. Shows the leading check, and "(selected)" to screen readers. |
|
|
205
|
+
| `render` | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, ToggleState>` | | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
|
|
206
|
+
| `static` | `boolean` | | Display only: a `<span>` that looks like a chip, e.g. to show what was chosen. |
|
|
207
|
+
| `style` | `CSSProperties \| ((state: ToggleState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
208
|
+
| `value` | `string` | | A unique string that identifies the toggle when used inside a toggle group. |
|
|
209
|
+
|
|
210
|
+
### ColorPicker
|
|
211
|
+
|
|
212
|
+
A text input for any CSS colour (hex, rgb(), a name…) with a swatch that opens the browser's
|
|
213
|
+
colour picker. Values not written as hex show their hex alongside.
|
|
214
|
+
|
|
215
|
+
| Prop | Type | Default | Description |
|
|
216
|
+
| --- | --- | --- | --- |
|
|
217
|
+
| `defaultValue` | `string` | `` | The initial colour text, when uncontrolled. |
|
|
218
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
219
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
220
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
221
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
222
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
223
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
224
|
+
| `name` | `string` | | |
|
|
225
|
+
| `onValueChange` | `((value: string) => void)` | | Called with the text as typed or picked, e.g. `#0B6B4F` or `rgb(0 0 0)`. |
|
|
226
|
+
| `pickerLabel` | `string` | `Choose colour` | Accessible name of the swatch that opens the browser's colour picker. |
|
|
227
|
+
| `placeholder` | `string` | | |
|
|
228
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the text input. |
|
|
229
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
230
|
+
| `value` | `string` | | The colour text. Use with `onValueChange` to control it. |
|
|
231
|
+
|
|
232
|
+
### Combobox
|
|
233
|
+
|
|
234
|
+
Filterable single-choice dropdown: type to narrow the options, then pick one.
|
|
235
|
+
|
|
236
|
+
| Prop | Type | Default | Description |
|
|
237
|
+
| --- | --- | --- | --- |
|
|
238
|
+
| `actionsRef` | `RefObject<Actions \| null>` | | A ref to imperative actions. - `unmount`: Ends the closing phase of the combobox after an externally controlled closing animation finishes. Call `preventUnmountOnClose()` in `onOpenChange` first, otherwise the combobox completes closing on its own. Whether it leaves the DOM is decided by `keepMounted` on the portal. - `close`: Closes the combobox imperatively when called. |
|
|
239
|
+
| `autoComplete` | `string` | | Provides a hint to the browser for autofill. @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete |
|
|
240
|
+
| `autoHighlight` | `boolean` | `false` | Whether the first matching item is highlighted automatically while filtering. |
|
|
241
|
+
| `className` | `string` | | Goes on the field's root element. |
|
|
242
|
+
| `clearLabel` | `string` | `Clear` | Accessible name of the Clear button. |
|
|
243
|
+
| `defaultOpen` | `boolean` | `false` | Whether the popup is initially open. To render a controlled popup, use the `open` prop instead. |
|
|
244
|
+
| `defaultValue` | `string \| null` | | The initially picked option's `value`, when uncontrolled. |
|
|
245
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
246
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
247
|
+
| `emptyMessage` | `ReactNode` | `No matches` | Shown when nothing matches the typed text. |
|
|
248
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
249
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
250
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
251
|
+
| `highlightItemOnHover` | `boolean` | `true` | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state. |
|
|
252
|
+
| `inputProps` | `PartProps<ComboboxInputProps>` | | Props for the text input (role `combobox`), e.g. `{ 'data-testid': 'retailer' }`. |
|
|
253
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
254
|
+
| `name` | `string` | | Identifies the field when a form is submitted. |
|
|
255
|
+
| `onInputValueChange` | `((inputValue: string, eventDetails: ChangeEventDetails) => void)` | | Event handler called when the input value changes. |
|
|
256
|
+
| `onItemHighlighted` | `((highlightedValue: string, eventDetails: HighlightEventDetails) => void)` | | Callback fired when an item is highlighted or unhighlighted. Receives the highlighted item value (or `undefined` if no item is highlighted) and event details with a `reason` property describing why the highlight changed. The `reason` can be: - `'keyboard'`: the highlight changed due to keyboard navigation. - `'pointer'`: the highlight changed due to pointer hovering. The event may be a `MouseEvent` rather than a `PointerEvent`. - `'none'`: the highlight changed for another reason, such as typing, `autoHighlight`, the item list changing, or the popup opening or closing. |
|
|
257
|
+
| `onOpenChange` | `((open: boolean, eventDetails: OpenChangeEventDetails) => void)` | | Event handler called when the popup is opened or closed. |
|
|
258
|
+
| `onValueChange` | `((value: string \| null) => void)` | | Called with the picked option's `value`, or `null` when cleared (Clear button, or a form reset). |
|
|
259
|
+
| `open` | `boolean` | | Whether the popup is currently open. Use when controlled. |
|
|
260
|
+
| `options` * | `ComboboxOption[]` | | The choices, in order. |
|
|
261
|
+
| `placeholder` | `string` | | Shown in the empty input. |
|
|
262
|
+
| `popupProps` | `PartProps<ComboboxPopupProps>` | | Props for the dropdown, e.g. `{ 'data-testid': 'retailer-options' }`. |
|
|
263
|
+
| `popupWidth` | `string` | | Width of the dropdown when it should be wider than the field, e.g. `'24rem'`. Never narrower than the field. |
|
|
264
|
+
| `portalContainer` | `PortalContainerTarget` | | Where the dropdown renders. Defaults to the nearest `PortalContainer`, else `document.body`. |
|
|
265
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the visible text input. |
|
|
266
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
267
|
+
| `value` | `string \| null` | | The picked option's `value`, or `null` for none. Use with `onValueChange` to control it. |
|
|
268
|
+
|
|
269
|
+
### CopyButton
|
|
270
|
+
|
|
271
|
+
Icon button that copies `value` to the clipboard, shows a check briefly and announces it.
|
|
272
|
+
|
|
273
|
+
| Prop | Type | Default | Description |
|
|
274
|
+
| --- | --- | --- | --- |
|
|
275
|
+
| `copiedLabel` | `string` | `Copied` | Announced after copying. Default "Copied". |
|
|
276
|
+
| `fullWidth` | `boolean` | | Stretches the button to fill its container. |
|
|
277
|
+
| `label` | `string` | `Copy` | Accessible name. Default "Copy"; say what's copied, e.g. "Copy run ID". |
|
|
278
|
+
| `size` | `"sm" \| "md"` | `sm` | `sm` for dense places such as table rows and toolbars. |
|
|
279
|
+
| `value` * | `string` | | The text copied to the clipboard. |
|
|
280
|
+
| `variant` | `"danger" \| "primary" \| "secondary" \| "ghost"` | `ghost` | `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. |
|
|
281
|
+
|
|
282
|
+
### DateRangePicker
|
|
283
|
+
|
|
284
|
+
From–to date range picker: a field-styled trigger opening a range calendar with quick ranges.
|
|
285
|
+
Clicking a quick range applies it straight away; calendar picks apply with the Apply button.
|
|
286
|
+
Escape or Cancel discards the draft.
|
|
287
|
+
|
|
288
|
+
| Prop | Type | Default | Description |
|
|
289
|
+
| --- | --- | --- | --- |
|
|
290
|
+
| `applyLabel` | `string` | `Apply` | Text of the button that applies the picked range. |
|
|
291
|
+
| `cancelLabel` | `string` | `Cancel` | Text of the button that discards the picked range. |
|
|
292
|
+
| `className` | `string` | | Goes on the field root. |
|
|
293
|
+
| `defaultValue` | `DateRange` | `{ start: null, end: null }` | The initial range, for an uncontrolled picker. |
|
|
294
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
295
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
296
|
+
| `endTimeLabel` | `string` | `End time` | Label of the end time input (with `withTime`). |
|
|
297
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
298
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
299
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
300
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
301
|
+
| `locale` | `Partial<DayPickerLocale>` | | Calendar locale, e.g. `enGB` from `react-day-picker/locale`. Its `code` also formats the trigger. |
|
|
302
|
+
| `maxDate` | `Date` | | Latest selectable day. Ranges, including quick ranges, are clamped to end by the end of it. |
|
|
303
|
+
| `minDate` | `Date` | | Earliest selectable day. Ranges, including quick ranges, are clamped to start no earlier. |
|
|
304
|
+
| `onValueChange` | `((range: DateRange, details: { preset?: DateRangePreset; }) => void)` | | Called with the new range on Apply or when a quick range is chosen. `details.preset` is the chosen quick range, so a preset can trigger extra behaviour (e.g. a live mode). |
|
|
305
|
+
| `placeholder` | `string` | `Select a date range` | Trigger text while no range is set. |
|
|
306
|
+
| `popupProps` | `PartProps<PopoverPopupProps>` | | Props for the popup (role `dialog`). |
|
|
307
|
+
| `portalContainer` | `PortalContainerTarget` | | Where the popup renders. Defaults to the nearest `PortalContainer`, else `document.body`. |
|
|
308
|
+
| `presets` | `DateRangePreset[]` | | Quick ranges beside the calendar. Replaces the defaults; `[]` hides the list. |
|
|
309
|
+
| `presetsLabel` | `string` | `Quick ranges` | Accessible name of the quick ranges list. |
|
|
310
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
311
|
+
| `startTimeLabel` | `string` | `Start time` | Label of the start time input (with `withTime`). |
|
|
312
|
+
| `timeZone` | `string` | | IANA zone (e.g. `'UTC'`) that days and times are shown and picked in. Defaults to local time. |
|
|
313
|
+
| `triggerProps` | `PartProps<Props<unknown>>` | | Props for the trigger button, e.g. `{ 'data-testid': 'range' }`. |
|
|
314
|
+
| `value` | `DateRange` | | The applied range, for a controlled picker. Use with `onValueChange`. |
|
|
315
|
+
| `weekStartsOn` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6` | `1` | First day of the week (0 is Sunday). |
|
|
316
|
+
| `withTime` | `boolean` | `false` | Adds start and end time inputs. Without it, a range runs from the start of its first day to the end of its last. |
|
|
317
|
+
|
|
318
|
+
### DateTimeInput
|
|
319
|
+
|
|
320
|
+
Date and time picker using the browser's native `datetime-local` input.
|
|
321
|
+
|
|
322
|
+
| Prop | Type | Default | Description |
|
|
323
|
+
| --- | --- | --- | --- |
|
|
324
|
+
| `defaultValue` | `string \| number \| readonly string[]` | | |
|
|
325
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
326
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
327
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
328
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
329
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
330
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
331
|
+
| `name` | `string` | | |
|
|
332
|
+
| `onValueChange` | `((value: string) => void)` | | Called with the local date-time string, e.g. `2026-11-10T09:21`, or `''` when cleared. |
|
|
333
|
+
| `placeholder` | `string` | | |
|
|
334
|
+
| `ref` | `Ref<HTMLInputElement>` | | |
|
|
335
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
336
|
+
| `value` | `string \| number \| readonly string[]` | | |
|
|
337
|
+
|
|
338
|
+
### DescriptionList
|
|
339
|
+
|
|
340
|
+
Key/value facts as a semantic `<dl>`. Terms are muted, values use the main ink colour.
|
|
341
|
+
|
|
342
|
+
| Prop | Type | Default | Description |
|
|
343
|
+
| --- | --- | --- | --- |
|
|
344
|
+
| `items` * | `DescriptionListItem[]` | | Term/description pairs, in order. |
|
|
345
|
+
| `layout` | `"grid" \| "inline" \| "stacked"` | `stacked` | `stacked`: term above value, one pair per row. `inline`: term and value side by side, terms aligned. `grid`: stacked pairs in responsive columns. |
|
|
346
|
+
| `size` | `"sm" \| "md"` | `md` | `sm` for dense panels such as drawers. |
|
|
347
|
+
|
|
348
|
+
### DetailsSummary
|
|
349
|
+
|
|
350
|
+
A styled native `<details>`/`<summary>` disclosure.
|
|
351
|
+
|
|
352
|
+
| Prop | Type | Default | Description |
|
|
353
|
+
| --- | --- | --- | --- |
|
|
354
|
+
| `heading` * | `ReactNode` | | Always-visible summary that toggles the content. |
|
|
355
|
+
| `open` | `boolean` | | |
|
|
356
|
+
| `tone` | `BadgeTone` | `neutral` | Tints the panel and colours the summary, e.g. `danger` for a block of errors. `neutral` (default) is untinted. |
|
|
357
|
+
|
|
358
|
+
### Drawer
|
|
359
|
+
|
|
360
|
+
A modal side panel. Closes on Escape, the close button, an overlay click or a swipe.
|
|
361
|
+
|
|
362
|
+
| Prop | Type | Default | Description |
|
|
363
|
+
| --- | --- | --- | --- |
|
|
364
|
+
| `actions` | `ReactNode` | | Controls in the header, before the close button, e.g. a Menu or an Edit button. |
|
|
365
|
+
| `children` | `ReactNode` | | Scrolling body content. |
|
|
366
|
+
| `className` | `string` | | Goes on the popup (role `dialog`). |
|
|
367
|
+
| `closeLabel` | `string` | `Close` | Accessible label of the close button. |
|
|
368
|
+
| `defaultOpen` | `boolean` | `false` | Whether the drawer is initially open. To render a controlled drawer, use the `open` prop instead. |
|
|
369
|
+
| `description` | `ReactNode` | | Muted text under the title, linked as the dialog's description. |
|
|
370
|
+
| `footer` | `ReactNode` | | Actions pinned to the bottom right, e.g. Cancel and Save. The footer sits outside the body, so a submit button there only submits a `<form>` in the body if you give it `form="<form id>"`, or set `onSubmit` instead. |
|
|
371
|
+
| `footerStart` | `ReactNode` | | Secondary actions pinned to the bottom left, e.g. Archive or Copy link. |
|
|
372
|
+
| `onClose` | `(() => void)` | | Called when the drawer asks to close (Escape, close button, overlay click, swipe). Shorthand for `onOpenChange(false)`. |
|
|
373
|
+
| `onOpenChange` | `((open: boolean, eventDetails: DrawerRootChangeEventDetails) => void)` | | Event handler called when the drawer is opened or closed. |
|
|
374
|
+
| `onSubmit` | `FormEventHandler<HTMLFormElement>` | | Wraps the body and footer in a `<form>` with this handler, so a `type="submit"` button in the footer submits it. Call `event.preventDefault()` yourself (react-hook-form's `handleSubmit` does). |
|
|
375
|
+
| `open` | `boolean` | | Whether the drawer is currently open. |
|
|
376
|
+
| `popupProps` | `PartProps<DrawerPopupProps>` | | Props for the popup (role `dialog`), e.g. `{ 'data-testid': 'run-drawer' }`. |
|
|
377
|
+
| `side` | `"right" \| "left"` | `right` | Screen edge the drawer slides in from (and is swiped back to). |
|
|
378
|
+
| `size` | `"sm" \| "md" \| "lg"` | `sm` | Width: `sm` 28rem (default), `md` 36rem, `lg` 60rem. Always capped to the viewport. |
|
|
379
|
+
| `title` * | `ReactNode` | | Heading, also the dialog's accessible name. |
|
|
380
|
+
| `trigger` | `ReactElement<unknown, string \| JSXElementConstructor<any>>` | | The element that opens the drawer, e.g. `<Button>`. Omit when controlling `open` yourself. |
|
|
381
|
+
|
|
382
|
+
### EmptyLine
|
|
383
|
+
|
|
384
|
+
A one-line empty state, e.g. "No prompt chips yet."
|
|
385
|
+
|
|
386
|
+
| Prop | Type | Default | Description |
|
|
387
|
+
| --- | --- | --- | --- |
|
|
388
|
+
| `bare` | `boolean` | `false` | Without its own border, for use inside something that already has one (e.g. a table cell). |
|
|
389
|
+
|
|
390
|
+
### EmptyState
|
|
391
|
+
|
|
392
|
+
A centred placeholder for an empty list, table or card, or a load error. Use `EmptyLine` for a one-liner.
|
|
393
|
+
|
|
394
|
+
| Prop | Type | Default | Description |
|
|
395
|
+
| --- | --- | --- | --- |
|
|
396
|
+
| `action` | `ReactNode` | | Optional button or link, e.g. "Start a run" or "Retry". |
|
|
397
|
+
| `headingLevel` | `2 \| 3 \| 4 \| 5 \| 6` | | Renders the title as `h2`–`h6`. Default is a `<p>`, which suits cards and table cells. |
|
|
398
|
+
| `icon` | `ReactNode` | | Shown in a tile above the title. Defaults to an inbox (or an alert for `danger`); `null` hides it. |
|
|
399
|
+
| `title` * | `ReactNode` | | One short line, e.g. "No runs yet". |
|
|
400
|
+
| `tone` | `"danger" \| "neutral"` | `neutral` | `danger` is the error variant ("Couldn't load runs"), announced with `role="alert"`. |
|
|
401
|
+
|
|
402
|
+
### EnvironmentChip
|
|
403
|
+
|
|
404
|
+
Shows which environment the app is pointed at, coloured by its name so production always stands
|
|
405
|
+
out. Put it in the TopBar `end` slot.
|
|
406
|
+
|
|
407
|
+
| Prop | Type | Default | Description |
|
|
408
|
+
| --- | --- | --- | --- |
|
|
409
|
+
| `environment` * | `string` | | Environment name, shown as given, e.g. "Staging". Its colour comes from the name (see `environmentTone`). |
|
|
410
|
+
|
|
411
|
+
### environmentTone
|
|
412
|
+
|
|
413
|
+
The colour an environment name gets: production and live are `danger`; staging, UAT, QA, test
|
|
414
|
+
and pre-prod are `highlight`; dev, ephemeral, preview, sandbox and demo are `info`; anything
|
|
415
|
+
else (e.g. local) is `neutral`.
|
|
416
|
+
|
|
417
|
+
### Field
|
|
418
|
+
|
|
419
|
+
Wraps a form control with a label, description and error message. Base UI wires up the label,
|
|
420
|
+
`aria-describedby` and invalid state for any Base UI control (or `Field.Control`) inside it.
|
|
421
|
+
Here `required` only adds the asterisk, so put `required` on the control too.
|
|
422
|
+
|
|
423
|
+
| Prop | Type | Default | Description |
|
|
424
|
+
| --- | --- | --- | --- |
|
|
425
|
+
| `className` | `string` | | |
|
|
426
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
427
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
428
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
429
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
430
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
431
|
+
| `name` | `string` | | Identifies the field when a form is submitted. Takes precedence over the `name` prop on the `<Field.Control>` component. |
|
|
432
|
+
| `render` | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, FieldRootState>` | | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
|
|
433
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
434
|
+
| `style` | `CSSProperties \| ((state: FieldRootState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
435
|
+
|
|
436
|
+
### Fieldset
|
|
437
|
+
|
|
438
|
+
A titled card of related fields. Nested fieldsets render as an indented group instead of a card.
|
|
439
|
+
|
|
440
|
+
| Prop | Type | Default | Description |
|
|
441
|
+
| --- | --- | --- | --- |
|
|
442
|
+
| `className` | `string` | | |
|
|
443
|
+
| `description` | `ReactNode` | | Help text under the legend, linked with `aria-describedby`. A `<div>`, so it can hold block content. |
|
|
444
|
+
| `legend` * | `ReactNode` | | The card's title. |
|
|
445
|
+
| `render` | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, FieldsetRootState>` | | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
|
|
446
|
+
| `style` | `CSSProperties \| ((state: FieldsetRootState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
447
|
+
|
|
448
|
+
### Grid
|
|
449
|
+
|
|
450
|
+
Grid layout, e.g. form fields in rows or cards in a responsive grid.
|
|
451
|
+
|
|
452
|
+
| Prop | Type | Default | Description |
|
|
453
|
+
| --- | --- | --- | --- |
|
|
454
|
+
| `align` | `"center" \| "start" \| "end" \| "stretch"` | `start` | Vertical alignment in each row. `start` (default) keeps fields top-aligned when one has a description. |
|
|
455
|
+
| `columns` | `string \| number` | | A number gives that many equal columns. A string is a `grid-template-columns` value, e.g. `'1fr 20rem'` for content beside a sidebar. Default `1`. |
|
|
456
|
+
| `gap` | `"1" \| "2" \| "3" \| "4" \| "6" \| "8"` | `4` | Space between cells: `'1'` 4px, `'2'` 8px, `'3'` 12px, `'4'` 16px (default), `'6'` 24px, `'8'` 32px. |
|
|
457
|
+
| `minColumnWidth` | `string` | | Responsive: columns are at least this wide (e.g. `'16rem'`), so the grid drops to fewer columns as it narrows, down to one. With a number of `columns` it never goes above that number; on its own it fits as many as there's room for. Ignored when `columns` is a string. |
|
|
458
|
+
|
|
459
|
+
### Heading
|
|
460
|
+
|
|
461
|
+
Section heading. `level` sets the semantic h1–h6; `size` sets the look independently. Pages get their h1 from `PageHeader`.
|
|
462
|
+
|
|
463
|
+
| Prop | Type | Default | Description |
|
|
464
|
+
| --- | --- | --- | --- |
|
|
465
|
+
| `level` * | `HeadingLevel` | | Document outline level (`h1`–`h6`). |
|
|
466
|
+
| `size` | `HeadingSize` | | Visual size, independent of `level`. Defaults to the size for the level. |
|
|
467
|
+
|
|
468
|
+
### Icon
|
|
469
|
+
|
|
470
|
+
Renders a lucide-react icon at a token size. Decorative unless `label` is given.
|
|
471
|
+
|
|
472
|
+
| Prop | Type | Default | Description |
|
|
473
|
+
| --- | --- | --- | --- |
|
|
474
|
+
| `icon` * | `LucideIcon` | | A lucide-react icon component, e.g. `Play`. |
|
|
475
|
+
| `label` | `string` | | Accessible name. Without it the icon is decorative and hidden from assistive tech. |
|
|
476
|
+
| `name` | `string` | | |
|
|
477
|
+
| `size` | `IconSize` | `md` | `xs` 0.75rem, `sm` 1rem, `md` 1.25rem (default), `lg` 1.5rem, an em/rem length, or px (deprecated). |
|
|
478
|
+
|
|
479
|
+
### List
|
|
480
|
+
|
|
481
|
+
Simple list with a built-in empty state.
|
|
482
|
+
|
|
483
|
+
| Prop | Type | Default | Description |
|
|
484
|
+
| --- | --- | --- | --- |
|
|
485
|
+
| `emptyState` | `ReactNode` | `No items` | Shown when there are no items. |
|
|
486
|
+
| `getKey` | `((item: T, index: number) => Key)` | `(item: unknown): Key => (typeof item === 'string' ? item : JSON.stringify(item))` | Row key. Defaults to the item if it's a string, else its JSON. |
|
|
487
|
+
| `items` | `readonly T[] \| null` | | The items. `null` or empty shows `emptyState`. |
|
|
488
|
+
| `renderItem` | `((item: T, index: number) => ReactNode)` | `(item) => item as ReactNode` | Row content. Defaults to the item itself, so strings need no template. |
|
|
489
|
+
|
|
490
|
+
### Loader
|
|
491
|
+
|
|
492
|
+
Indeterminate spinner. Inherits the current text colour.
|
|
493
|
+
|
|
494
|
+
| Prop | Type | Default | Description |
|
|
495
|
+
| --- | --- | --- | --- |
|
|
496
|
+
| `label` | `string \| null` | `Loading` | Text announced to screen readers. Pass `null` when a visible label sits next to it. |
|
|
497
|
+
| `size` | `string \| number` | `1rem` | Diameter as a CSS length, e.g. `'1em'` to match the surrounding text. Numbers are px at the 16px base, converted to rem so they scale with the text-size setting. |
|
|
498
|
+
|
|
499
|
+
### Menu
|
|
500
|
+
|
|
501
|
+
A dropdown list of actions, links, settings and submenus.
|
|
502
|
+
|
|
503
|
+
| Prop | Type | Default | Description |
|
|
504
|
+
| --- | --- | --- | --- |
|
|
505
|
+
| `align` | `Align` | `start` | How the menu lines up with the trigger along that side. |
|
|
506
|
+
| `className` | `string` | | Goes on the popup (role `menu`). |
|
|
507
|
+
| `defaultOpen` | `boolean` | `false` | Whether the menu is initially open. To render a controlled menu, use the `open` prop instead. |
|
|
508
|
+
| `footer` | `ReactNode` | | Content below the items, e.g. a version number. |
|
|
509
|
+
| `header` | `ReactNode` | | Content above the items, e.g. the signed-in user's name. |
|
|
510
|
+
| `items` * | `MenuEntry[]` | | Menu items, with `'separator'` for a divider. |
|
|
511
|
+
| `onOpenChange` | `((open: boolean, eventDetails: MenuRootChangeEventDetails) => void)` | | Event handler called when the menu is opened or closed. |
|
|
512
|
+
| `open` | `boolean` | | Whether the menu is currently open. |
|
|
513
|
+
| `popupProps` | `PartProps<MenuPopupProps>` | | Props for the popup (role `menu`), e.g. `{ 'data-testid': 'account-menu' }`. |
|
|
514
|
+
| `portalContainer` | `PortalContainerTarget` | | Where the menu renders. Defaults to the nearest `PortalContainer`, else `document.body`. |
|
|
515
|
+
| `side` | `Side` | `bottom` | Which side of the trigger the menu opens on. It flips if there isn't room. |
|
|
516
|
+
| `trigger` * | `ReactElement<unknown, string \| JSXElementConstructor<any>>` | | The element that opens the menu, e.g. `<Button>`. It must accept a ref and props. |
|
|
517
|
+
|
|
518
|
+
### MetricBar
|
|
519
|
+
|
|
520
|
+
A labelled percentage with a stacked bar, e.g. "Achieved 83%".
|
|
521
|
+
|
|
522
|
+
| Prop | Type | Default | Description |
|
|
523
|
+
| --- | --- | --- | --- |
|
|
524
|
+
| `className` | `string` | | |
|
|
525
|
+
| `formatValue` | `((value: number) => ReactNode)` | `(value: number) => `${Math.round(value)}%`` | Formats `value` and the legend's segment values. Defaults to a rounded percentage, e.g. "83%". |
|
|
526
|
+
| `label` * | `ReactNode` | | Names the meter, e.g. "Achieved". |
|
|
527
|
+
| `render` | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, MeterRootState>` | | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
|
|
528
|
+
| `segments` | `MetricBarSegment[]` | `[{ value, tone }]` | Stacked bar segments, left to right. Defaults to one segment of `value` in the label's tone. |
|
|
529
|
+
| `size` | `"sm" \| "md"` | `md` | `sm` for dense rows and cards: smaller text and a thinner bar. |
|
|
530
|
+
| `style` | `CSSProperties \| ((state: MeterRootState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
531
|
+
| `tone` | `"success" \| "danger" \| "neutral"` | `neutral` | Colour of the label. |
|
|
532
|
+
| `value` * | `number` | | The percentage shown next to the label (0 to 100). |
|
|
533
|
+
|
|
534
|
+
### Modal
|
|
535
|
+
|
|
536
|
+
Controlled modal dialog. Closes on Escape, backdrop click and the close buttons via `onOpenChange(false)`.
|
|
537
|
+
|
|
538
|
+
| Prop | Type | Default | Description |
|
|
539
|
+
| --- | --- | --- | --- |
|
|
540
|
+
| `className` | `string` | | Goes on the popup (role `dialog`). |
|
|
541
|
+
| `closeLabel` | `string` | `Close` | Accessible label of the close buttons, and the default footer button's text. |
|
|
542
|
+
| `description` | `ReactNode` | | Muted text under the title, linked as the dialog's description. |
|
|
543
|
+
| `footer` | `ReactNode` | | Footer actions. Defaults to a single Close button; pass `null` for no footer. |
|
|
544
|
+
| `onOpenChange` * | `(open: boolean, eventDetails: DialogRootChangeEventDetails) => void` | | Called with `false` when the user closes it (Escape, backdrop click, close buttons). |
|
|
545
|
+
| `open` * | `boolean` | | Whether the modal is open. The modal is always controlled. |
|
|
546
|
+
| `render` | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, DialogPopupState>` | | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
|
|
547
|
+
| `size` | `"sm" \| "md" \| "lg"` | `md` | Max width: `sm` 37.5rem, `md` 47rem (default), `lg` 78rem. It's always capped to the viewport. |
|
|
548
|
+
| `style` | `CSSProperties \| ((state: DialogPopupState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
549
|
+
| `title` * | `ReactNode` | | Heading, also the dialog's accessible name. |
|
|
550
|
+
|
|
551
|
+
### NavRail
|
|
552
|
+
|
|
553
|
+
Primary app navigation: a slim icon rail that can expand to show labels. Collapsed by default;
|
|
554
|
+
uncontrolled rails remember the user's choice in localStorage. In a narrow window an uncontrolled
|
|
555
|
+
rail collapses; expanding it there lasts until the window widens and isn't stored.
|
|
556
|
+
|
|
557
|
+
| Prop | Type | Default | Description |
|
|
558
|
+
| --- | --- | --- | --- |
|
|
559
|
+
| `appName` | `string` | | The app's name, shown under the Humara wordmark when the rail is expanded, e.g. "Back Office". The logo itself is built in: the wordmark when expanded, the fan mark when collapsed. |
|
|
560
|
+
| `brandHref` | `string` | `/` | Where the logo links to. Use `brandRender` instead for a router link. |
|
|
561
|
+
| `brandLabel` | `string` | `appName ? `${appName} home` : 'Home'` | Accessible name of the logo link. Defaults to "<appName> home", or "Home". |
|
|
562
|
+
| `brandRender` | `ReactElement<unknown, string \| JSXElementConstructor<any>>` | | Router link element for the logo, e.g. `<Link to="/" />`. |
|
|
563
|
+
| `defaultExpanded` | `boolean` | `false` | Starting state when uncontrolled and nothing is stored. |
|
|
564
|
+
| `expanded` | `boolean` | | Shows labels next to icons. When collapsed, each item's label shows in a `Tooltip`. Pass it to control the rail yourself (nothing is stored); omit it and the rail manages its own state, collapsing in windows narrower than 48em. Without `onExpandedChange` the toggle is hidden, so `expanded={false}` gives a fixed icon rail. |
|
|
565
|
+
| `footer` | `ReactNode \| ((expanded: boolean) => ReactNode)` | | Pinned to the bottom, e.g. a `UserMenu`. Pass a function to vary it with `expanded`, e.g. `(expanded) => <UserMenu name={name} showName={expanded} />`. |
|
|
566
|
+
| `items` * | `(NavRailItem \| NavRailGroup)[]` | | Top-level sections, in order. Use groups (`{ group: 'Set up', items: [...] }`) when there are more than about six; don't mix groups and loose items. |
|
|
567
|
+
| `onExpandedChange` | `((expanded: boolean) => void)` | | Called with the new state when the user toggles the rail. |
|
|
568
|
+
| `persistKey` | `string \| null` | `bok-rail-expanded` | localStorage key that remembers the user's choice when uncontrolled. `null` disables it. Use different keys for rails in different apps on one origin. |
|
|
569
|
+
|
|
570
|
+
### NumberInput
|
|
571
|
+
|
|
572
|
+
Numeric input with step buttons. Arrow keys step by `step`, Shift+Arrow by `largeStep`.
|
|
573
|
+
|
|
574
|
+
| Prop | Type | Default | Description |
|
|
575
|
+
| --- | --- | --- | --- |
|
|
576
|
+
| `className` | `string` | | Class for the field's root element. |
|
|
577
|
+
| `defaultValue` | `number` | | The uncontrolled value of the field when it's initially rendered. To render a controlled number field, use the `value` prop instead. |
|
|
578
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
579
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
580
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
581
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
582
|
+
| `hideControls` | `boolean` | `false` | Hides the − and + buttons. |
|
|
583
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
584
|
+
| `integer` | `boolean` | `false` | Whole numbers only: typed decimals round (on blur, and in `onValueChange` straight away), and Alt+Arrow steps by 1. Emptying the field reverts it to the last value on blur, so once it has a value `onValueChange` never gets `null`. |
|
|
585
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
586
|
+
| `max` | `number` | | The maximum value of the input element. |
|
|
587
|
+
| `min` | `number` | | The minimum value of the input element. |
|
|
588
|
+
| `name` | `string` | | Identifies the field when a form is submitted. |
|
|
589
|
+
| `onValueChange` | `((value: number \| null, eventDetails: NumberFieldRootChangeEventDetails) => void)` | | Callback fired when the number value changes. The `eventDetails.reason` indicates what triggered the change: - `'input-change'` for parseable typing or programmatic text updates - `'input-clear'` when the field becomes empty - `'input-blur'` when formatting (and clamping, if enabled) occurs on blur - `'input-paste'` for paste interactions - `'keyboard'` for arrow-key/Home/End stepping (typing digits uses `'input-change'`/`'input-clear'`) - `'increment-press'` / `'decrement-press'` for button presses on the increment and decrement controls - `'wheel'` for wheel-based scrubbing - `'scrub'` for scrub area drags |
|
|
590
|
+
| `placeholder` | `string` | | Shown in the empty input. |
|
|
591
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the visible text input. |
|
|
592
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
593
|
+
| `step` | `number \| "any"` | `1` | Amount to increment and decrement with the buttons and arrow keys, or to scrub with pointer movement in the scrub area. To always enable step validation on form submission, specify the `min` prop explicitly in conjunction with this prop. Specify `step="any"` to always disable step validation; interactive stepping then uses a base amount of `1`, while the alt and shift keys still step by `smallStep` and `largeStep`. |
|
|
594
|
+
| `style` | `CSSProperties \| ((state: NumberFieldRootState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
595
|
+
| `value` | `number \| null` | | The raw numeric value of the field. |
|
|
596
|
+
|
|
597
|
+
### PageHeader
|
|
598
|
+
|
|
599
|
+
The page's h1, with an optional facts line, description, and actions at the top right.
|
|
600
|
+
|
|
601
|
+
| Prop | Type | Default | Description |
|
|
602
|
+
| --- | --- | --- | --- |
|
|
603
|
+
| `actions` | `ReactNode` | | Controls at the top right, e.g. the page's primary Button. |
|
|
604
|
+
| `description` | `ReactNode` | | A sentence or two under the title. |
|
|
605
|
+
| `facts` | `ReactNode[]` | `[]` | Short facts on one line under the title. Put the one people act on first: it leads and the rest are muted. `null`, `undefined`, `false` and `''` are skipped (`0` is kept). |
|
|
606
|
+
| `logo` | `ReactNode` | | Shown before the title, e.g. a logo or avatar. |
|
|
607
|
+
| `title` * | `ReactNode` | | The page's `<h1>`. |
|
|
608
|
+
|
|
609
|
+
### Pagination
|
|
610
|
+
|
|
611
|
+
Page navigation for long tables and lists. Controlled via `page` and `onPageChange`.
|
|
612
|
+
|
|
613
|
+
| Prop | Type | Default | Description |
|
|
614
|
+
| --- | --- | --- | --- |
|
|
615
|
+
| `label` | `string` | `Pagination` | Accessible name of the `<nav>`. |
|
|
616
|
+
| `nextLabel` | `string` | `Next page` | Accessible name of the next button. |
|
|
617
|
+
| `onPageChange` * | `(page: number) => void` | | Called with the requested page (1-based). |
|
|
618
|
+
| `page` * | `number` | | Current page, 1-based. |
|
|
619
|
+
| `pageCount` * | `number` | | Total number of pages. |
|
|
620
|
+
| `previousLabel` | `string` | `Previous page` | Accessible name of the previous button. |
|
|
621
|
+
| `siblings` | `number` | `1` | Pages shown either side of the current one before collapsing into "…". |
|
|
622
|
+
|
|
623
|
+
### Popover
|
|
624
|
+
|
|
625
|
+
Floating content anchored to a trigger. Closes on Escape and outside click.
|
|
626
|
+
|
|
627
|
+
| Prop | Type | Default | Description |
|
|
628
|
+
| --- | --- | --- | --- |
|
|
629
|
+
| `align` | `Align` | `start` | Alignment against the trigger along `side`. |
|
|
630
|
+
| `children` | `ReactNode` | | Popup content, e.g. details or actions. |
|
|
631
|
+
| `className` | `string` | | Goes on the popup (role `dialog`). |
|
|
632
|
+
| `defaultOpen` | `boolean` | `false` | Whether the popover is initially open. To render a controlled popover, use the `open` prop instead. |
|
|
633
|
+
| `description` | `ReactNode` | | Muted text under the title, linked as the dialog's description. |
|
|
634
|
+
| `onOpenChange` | `((open: boolean, eventDetails: PopoverRootChangeEventDetails) => void)` | | Event handler called when the popover is opened or closed. |
|
|
635
|
+
| `open` | `boolean` | | Whether the popover is currently open. |
|
|
636
|
+
| `popupProps` | `PartProps<PopoverPopupProps>` | | Props for the popup (role `dialog`), e.g. `{ 'data-testid': 'run-popover' }`. |
|
|
637
|
+
| `portalContainer` | `PortalContainerTarget` | | Where the popup renders. Defaults to the nearest `PortalContainer`, else `document.body`. |
|
|
638
|
+
| `side` | `Side` | `bottom` | Side of the trigger the popup opens on. |
|
|
639
|
+
| `title` | `ReactNode` | | Names the popover dialog. Recommended for accessibility. |
|
|
640
|
+
| `trigger` * | `ReactElement<unknown, string \| JSXElementConstructor<any>>` | | The element that toggles the popover, e.g. `<Button>`. It must accept a ref and props. |
|
|
641
|
+
|
|
642
|
+
### PortalContainer
|
|
643
|
+
|
|
644
|
+
Makes library popups (Select, Combobox, Menu, Popover, Tooltip) inside it render into
|
|
645
|
+
`container` instead of `document.body`. Use it inside a native `<dialog>` opened with
|
|
646
|
+
`showModal()`, which sits in the top layer above anything portalled to the body.
|
|
647
|
+
Modal and Drawer already do this for their content.
|
|
648
|
+
|
|
649
|
+
| Prop | Type | Default | Description |
|
|
650
|
+
| --- | --- | --- | --- |
|
|
651
|
+
| `children` | `ReactNode` | | Content whose popups render into `container`. |
|
|
652
|
+
| `container` * | `PortalContainerTarget` | | The element popups render into, e.g. a native `<dialog>` opened with `showModal()`. |
|
|
653
|
+
|
|
654
|
+
### ProgressBar
|
|
655
|
+
|
|
656
|
+
A segmented bar for a batch of runs: done, failed, running (pulsing) and waiting.
|
|
657
|
+
The count and `aria-valuenow` are the finished runs (done + failed).
|
|
658
|
+
|
|
659
|
+
| Prop | Type | Default | Description |
|
|
660
|
+
| --- | --- | --- | --- |
|
|
661
|
+
| `className` | `string` | | |
|
|
662
|
+
| `done` * | `number` | | Runs that finished successfully. |
|
|
663
|
+
| `failed` | `number` | `0` | Runs that finished with an error. |
|
|
664
|
+
| `hideCount` | `boolean` | `false` | Hides the "n/total" count and the failed and running counts beside it. |
|
|
665
|
+
| `label` | `ReactNode` | | Shown above the bar. Without it, pass `aria-label`. |
|
|
666
|
+
| `render` | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, ProgressRootState>` | | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
|
|
667
|
+
| `running` | `number` | `0` | Runs in progress (pulsing segment). |
|
|
668
|
+
| `style` | `CSSProperties \| ((state: ProgressRootState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
669
|
+
| `total` * | `number` | | All runs in the batch. The rest are waiting. |
|
|
670
|
+
|
|
671
|
+
### RadioCards
|
|
672
|
+
|
|
673
|
+
A radio group drawn as selectable cards, each with a title and optional description.
|
|
674
|
+
|
|
675
|
+
| Prop | Type | Default | Description |
|
|
676
|
+
| --- | --- | --- | --- |
|
|
677
|
+
| `className` | `string` | | Class for the field's root element. |
|
|
678
|
+
| `defaultValue` | `string \| null` | | The uncontrolled value of the radio button that should be initially selected. To render a controlled radio group, use the `value` prop instead. |
|
|
679
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
680
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
681
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
682
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
683
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
684
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
685
|
+
| `name` | `string` | | Identifies the field when a form is submitted. |
|
|
686
|
+
| `onValueChange` | `((value: string) => void)` | | Called with the chosen option's `value`. |
|
|
687
|
+
| `options` * | `RadioCardOption[]` | | The cards, in order. |
|
|
688
|
+
| `orientation` | `"horizontal" \| "vertical"` | `vertical` | Lay the cards out in a row (wrapping) instead of a column. |
|
|
689
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the group's hidden input (for form libraries). |
|
|
690
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
691
|
+
| `style` | `CSSProperties \| ((state: RadioGroupState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
692
|
+
| `value` | `string \| null` | | The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the `defaultValue` prop instead. |
|
|
693
|
+
|
|
694
|
+
### SaveBar
|
|
695
|
+
|
|
696
|
+
Sticky bar at the bottom of an editable page, shown while there are unsaved changes.
|
|
697
|
+
|
|
698
|
+
| Prop | Type | Default | Description |
|
|
699
|
+
| --- | --- | --- | --- |
|
|
700
|
+
| `changes` * | `number` | | Number of unsaved changes. The bar renders nothing when this is 0. |
|
|
701
|
+
| `context` | `ReactNode` | | Extra context, e.g. "on branch main". |
|
|
702
|
+
| `discardLabel` | `string` | `Discard` | Discard button text. |
|
|
703
|
+
| `onDiscard` | `(() => void)` | | Adds a Discard button when given. |
|
|
704
|
+
| `onSave` * | `() => void` | | Called by the Save button. |
|
|
705
|
+
| `saveLabel` | `string` | `Save changes` | Save button text. |
|
|
706
|
+
| `saving` | `boolean` | `false` | Shows a spinner on Save and disables Discard while saving. |
|
|
707
|
+
|
|
708
|
+
### Select
|
|
709
|
+
|
|
710
|
+
Single-choice dropdown with a label.
|
|
711
|
+
|
|
712
|
+
| Prop | Type | Default | Description |
|
|
713
|
+
| --- | --- | --- | --- |
|
|
714
|
+
| `className` | `string` | | Goes on the field's root element. |
|
|
715
|
+
| `defaultOpen` | `boolean` | `false` | Whether the select popup is initially open. To render a controlled select popup, use the `open` prop instead. |
|
|
716
|
+
| `defaultValue` | `string \| null` | | The initially picked option's `value`, when uncontrolled. |
|
|
717
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
718
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
719
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
720
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
721
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
722
|
+
| `id` | `string` | | Goes on the trigger button, so `<label htmlFor>` and `getElementById(id).focus()` work. |
|
|
723
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
724
|
+
| `name` | `string` | | Identifies the field when a form is submitted. |
|
|
725
|
+
| `onOpenChange` | `((open: boolean, eventDetails: SelectRootOpenChangeEventDetails) => void)` | | Event handler called when the select popup is opened or closed. |
|
|
726
|
+
| `onValueChange` | `((value: string \| null) => void)` | | Called when the value changes. Re-picking the current option doesn't call it. Picking from the list always gives an option's `value`; `null` only comes from a form reset back to an empty initial value, so with a picked initial value it's safe to treat it as a `string`. |
|
|
727
|
+
| `open` | `boolean` | | Whether the select popup is currently open. |
|
|
728
|
+
| `options` * | `SelectOption[]` | | The choices, in order. |
|
|
729
|
+
| `placeholder` | `string` | `Select an option` | Shown while nothing is selected, or when `value` matches no option. |
|
|
730
|
+
| `popupProps` | `PartProps<SelectPopupProps>` | | Props for the dropdown (role `listbox`), e.g. `{ 'data-testid': 'plan-options' }`. |
|
|
731
|
+
| `popupWidth` | `string` | | Width of the dropdown when it should be wider than the field, e.g. `'24rem'`. Never narrower than the field. |
|
|
732
|
+
| `portalContainer` | `PortalContainerTarget` | | Where the dropdown renders. Defaults to the nearest `PortalContainer`, else `document.body`. |
|
|
733
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the hidden input that holds the value (for form libraries). |
|
|
734
|
+
| `renderValue` | `((option: SelectOption \| null) => ReactNode)` | | What the trigger shows for the picked option (`null` when none matches). Defaults to its `label`, else the placeholder. |
|
|
735
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
736
|
+
| `triggerProps` | `PartProps<SelectTriggerProps>` | | Props for the trigger button (role `combobox`), e.g. `{ 'data-testid': 'plan-select' }`. |
|
|
737
|
+
| `value` | `string \| null` | | The picked option's `value`, or `null` for none. Use with `onValueChange` to control it. A value that matches no option shows the placeholder. |
|
|
738
|
+
|
|
739
|
+
### Skeleton
|
|
740
|
+
|
|
741
|
+
A pulsing placeholder shaped like the content that's loading. Hidden from assistive tech;
|
|
742
|
+
mark the loading region with `aria-busy` instead.
|
|
743
|
+
|
|
744
|
+
| Prop | Type | Default | Description |
|
|
745
|
+
| --- | --- | --- | --- |
|
|
746
|
+
| `height` | `Height<string \| number>` | | A CSS length. Numbers are px at the 16px base, converted to rem (like `width`). |
|
|
747
|
+
| `lines` | `number` | `1` | For `text`, renders this many lines, the last one shorter. |
|
|
748
|
+
| `variant` | `"circle" \| "text" \| "block"` | `block` | `text` is a line of text, `circle` is an avatar (sized by `height`). |
|
|
749
|
+
| `width` | `Width<string \| number>` | | A CSS length. Numbers are px at the 16px base, converted to rem so they scale with the text-size setting. |
|
|
750
|
+
|
|
751
|
+
### Stack
|
|
752
|
+
|
|
753
|
+
Flex layout that spaces its children. Renders nothing when it has no children.
|
|
754
|
+
|
|
755
|
+
| Prop | Type | Default | Description |
|
|
756
|
+
| --- | --- | --- | --- |
|
|
757
|
+
| `align` | `"center" \| "start" \| "end" \| "stretch" \| "baseline"` | | Cross-axis alignment (`align-items`). |
|
|
758
|
+
| `direction` | `"row" \| "column"` | `column` | `column` (default) stacks children; `row` lines them up. |
|
|
759
|
+
| `gap` | `"1" \| "2" \| "3" \| "4" \| "6" \| "8"` | `4` | Space between children: `'1'` 4px, `'2'` 8px, `'3'` 12px, `'4'` 16px (default), `'6'` 24px, `'8'` 32px. |
|
|
760
|
+
| `justify` | `"center" \| "start" \| "end" \| "between"` | | Main-axis distribution (`justify-content`). |
|
|
761
|
+
| `wrap` | `boolean` | `false` | Let children wrap onto new lines, e.g. a row of filters. |
|
|
762
|
+
|
|
763
|
+
### StatCard
|
|
764
|
+
|
|
765
|
+
A headline number on a card, e.g. "Objective achieved 64%".
|
|
766
|
+
|
|
767
|
+
| Prop | Type | Default | Description |
|
|
768
|
+
| --- | --- | --- | --- |
|
|
769
|
+
| `caption` | `ReactNode` | | Small muted context under the value, e.g. "7 of 11 judged". |
|
|
770
|
+
| `label` * | `ReactNode` | | What the number is, e.g. "Objective achieved". |
|
|
771
|
+
| `value` * | `ReactNode` | | The headline number, formatted, e.g. "64%". |
|
|
772
|
+
|
|
773
|
+
### StatsGrid
|
|
774
|
+
|
|
775
|
+
Responsive grid for stat tiles. Columns fill the row and wrap when narrower than 14rem.
|
|
776
|
+
|
|
777
|
+
### StatusBadge
|
|
778
|
+
|
|
779
|
+
A pill showing a run's status as a coloured dot and label.
|
|
780
|
+
|
|
781
|
+
| Prop | Type | Default | Description |
|
|
782
|
+
| --- | --- | --- | --- |
|
|
783
|
+
| `children` | `ReactNode` | | Overrides the default label (the capitalised status). |
|
|
784
|
+
| `status` * | `Status` | | Sets the colour and the default label. |
|
|
785
|
+
|
|
786
|
+
### Switch
|
|
787
|
+
|
|
788
|
+
On/off toggle with its label beside it. Toggle with Space or Enter.
|
|
789
|
+
|
|
790
|
+
| Prop | Type | Default | Description |
|
|
791
|
+
| --- | --- | --- | --- |
|
|
792
|
+
| `checked` | `boolean` | | Whether the switch is currently active. To render an uncontrolled switch, use the `defaultChecked` prop instead. |
|
|
793
|
+
| `className` | `string` | | Class for the field's root element. |
|
|
794
|
+
| `defaultChecked` | `boolean` | `false` | Whether the switch is initially active. To render a controlled switch, use the `checked` prop instead. |
|
|
795
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
796
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
797
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
798
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
799
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
800
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
801
|
+
| `name` | `string` | | Identifies the field when a form is submitted. |
|
|
802
|
+
| `onCheckedChange` | `((checked: boolean, eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element; }) => void)` | | Event handler called when the switch is activated or deactivated. |
|
|
803
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the hidden checkbox input (for form libraries). |
|
|
804
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
805
|
+
| `style` | `CSSProperties \| ((state: SwitchRootState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
806
|
+
| `value` | `string` | | The value submitted with the form when the switch is on. By default, switch submits the "on" value, matching native checkbox behavior. |
|
|
807
|
+
|
|
808
|
+
### Switcher
|
|
809
|
+
|
|
810
|
+
Searchable switcher, e.g. "pick a customer or branch" in a breadcrumb or top bar. Typing filters, arrows move, Enter picks, Escape closes.
|
|
811
|
+
|
|
812
|
+
| Prop | Type | Default | Description |
|
|
813
|
+
| --- | --- | --- | --- |
|
|
814
|
+
| `className` | `string` | | Goes on the trigger. |
|
|
815
|
+
| `defaultOpen` | `boolean` | `false` | Whether the popup starts open, when uncontrolled. |
|
|
816
|
+
| `disabled` | `boolean` | | The trigger can't be used. |
|
|
817
|
+
| `emptyMessage` | `ReactNode` | `No matches` | Shown when nothing matches the filter. |
|
|
818
|
+
| `footer` | `SwitcherFooter` | | A link or action under the list, e.g. "View all customers". |
|
|
819
|
+
| `items` * | `SwitcherItem[]` | | The rows to pick from. |
|
|
820
|
+
| `label` * | `string` | | What is being switched, e.g. "Customer". Names the trigger ("Customer: O2") and the popup. |
|
|
821
|
+
| `loading` | `boolean` | `false` | Shows `loadingLabel` with a spinner instead of the rows, e.g. while they're fetched. |
|
|
822
|
+
| `loadingLabel` | `string` | `Loading…` | Text shown (and announced) while `loading`. |
|
|
823
|
+
| `onOpenChange` | `((open: boolean) => void)` | | Called when the popup opens or closes. |
|
|
824
|
+
| `onSelect` | `((item: SwitcherItem) => void)` | | Called when a different item is picked (by click or Enter). Link items navigate as well. |
|
|
825
|
+
| `open` | `boolean` | | Whether the popup is open. Use with `onOpenChange` to control it. |
|
|
826
|
+
| `placeholder` | `string` | `Select…` | Trigger text when there is no current item. |
|
|
827
|
+
| `popupProps` | `PartProps<ComboboxPopupProps>` | | Props for the popup (role `dialog`, named by `label`). |
|
|
828
|
+
| `portalContainer` | `PortalContainerTarget` | | Where the popup renders. Defaults to the nearest `PortalContainer`, else `document.body`. |
|
|
829
|
+
| `resultsLabel` | `((count: number) => string)` | `(count: number) => `${count} ${count === 1 ? 'result' : 'results'}`` | Screen reader text for the number of rows shown. |
|
|
830
|
+
| `searchLabel` | `string` | `Search` | Accessible name and placeholder of the filter input. |
|
|
831
|
+
| `size` | `"sm" \| "md"` | `md` | `md` shows the current item's description in the trigger. |
|
|
832
|
+
| `triggerProps` | `PartProps<ComboboxTriggerProps>` | | Props for the trigger (role `combobox`, named "Customer: O2"), e.g. `{ 'data-testid': 'customer-switch' }`. |
|
|
833
|
+
| `value` | `string \| null` | | `value` of the current item, shown in the trigger and checked in the list. |
|
|
834
|
+
|
|
835
|
+
### Table
|
|
836
|
+
|
|
837
|
+
A data table. Pass `columns` and `rows`, or compose `Table.Root`, `Table.Head`, `Table.Body`,
|
|
838
|
+
`Table.Row`, `Table.GroupRow`, `Table.HeaderCell` and `Table.Cell` for custom layouts.
|
|
839
|
+
|
|
840
|
+
| Prop | Type | Default | Description |
|
|
841
|
+
| --- | --- | --- | --- |
|
|
842
|
+
| `caption` | `ReactNode` | | The table's `<caption>`, which names it. Visually hidden unless `captionVisible`. |
|
|
843
|
+
| `captionVisible` | `boolean` | | Shows the caption above the table. |
|
|
844
|
+
| `columns` * | `TableColumn<Row>[]` | | Column definitions, left to right. |
|
|
845
|
+
| `defaultSort` | `SortState` | | Initially sorted column (uncontrolled). |
|
|
846
|
+
| `density` | `"default" \| "compact"` | | `compact` tightens cell padding for dense data. |
|
|
847
|
+
| `empty` | `ReactNode` | | Shown when there are no rows, across all columns. Can be a block such as an empty state. |
|
|
848
|
+
| `footer` | `ReactNode` | | Shown under the table, inside the frame, e.g. `Table.LoadMore` or `Pagination`. Doesn't scroll sideways. |
|
|
849
|
+
| `getRowHref` | `((row: Row) => string)` | | Makes each row a link: the primary column's content becomes an `<a href>` (so middle-click and "open in new tab" work), and a click anywhere else on the row follows it. `onRowClick`, if set, is also called. |
|
|
850
|
+
| `getRowKey` * | `(row: Row) => Key` | | A stable, unique key for each row, e.g. `(row) => row.id`. |
|
|
851
|
+
| `getRowProps` | `((row: Row) => ClassAttributes<HTMLTableRowElement> & HTMLAttributes<HTMLTableRowElement> & DataAttributes)` | | Props for each row's `<tr>`, e.g. `(row) => ({ 'data-testid': `run-${row.id}` })`. |
|
|
852
|
+
| `groupBy` | `((row: Row) => Key)` | | Groups rows under full-width headings. Groups appear in first-seen order. |
|
|
853
|
+
| `loading` | `boolean` | | Shows skeleton rows while there are no rows yet. Existing rows stay during a refetch. |
|
|
854
|
+
| `onRowClick` | `((row: Row) => void)` | | Makes each row clickable. The primary column's cell becomes a button (so keyboard and screen reader users reach it with Tab and press Enter or Space), and a click anywhere else on the row clicks it too. Clicks on other buttons, links or inputs in the row are left alone. Don't put interactive content in the primary column; use the column's `extra` for tags and the like. |
|
|
855
|
+
| `onSortChange` | `((sort: SortState) => void)` | | Called when a sortable header is clicked. A new column sorts descending first; clicking the sorted column flips its direction. Without the column's `compare`, sort the rows yourself. |
|
|
856
|
+
| `primaryColumn` | `string` | | `key` of the column that holds the row's button or link. Defaults to the first column. |
|
|
857
|
+
| `renderGroup` | `((key: Key, rows: Row[]) => ReactNode)` | | The group heading. Defaults to the key. |
|
|
858
|
+
| `rowLinkRender` | `((row: Row) => ReactElement<unknown, string \| JSXElementConstructor<any>>)` | | A router link per row instead of `getRowHref`, e.g. `(run) => <Link to={`/runs/${run.id}`} />`. |
|
|
859
|
+
| `rows` * | `Row[]` | | The data, one row each. |
|
|
860
|
+
| `scrollRef` | `Ref<HTMLDivElement>` | | Ref to the `<div>` that scrolls the table sideways, e.g. for scroll hints. |
|
|
861
|
+
| `sort` | `SortState` | | Sorted column (controlled). |
|
|
862
|
+
| `stale` | `boolean` | | Rows are out of date, e.g. while new filters load. The table is `aria-busy`, and after 300ms (so quick loads don't flicker) a progress bar slides along its top edge. |
|
|
863
|
+
|
|
864
|
+
### TableAction
|
|
865
|
+
|
|
866
|
+
An icon-only ghost button for table rows, labelled by a tooltip.
|
|
867
|
+
|
|
868
|
+
| Prop | Type | Default | Description |
|
|
869
|
+
| --- | --- | --- | --- |
|
|
870
|
+
| `aria-label` * | `string` | | Names the button and is shown as its tooltip. |
|
|
871
|
+
| `fullWidth` | `boolean` | | Stretches the button to fill its container. |
|
|
872
|
+
| `icon` * | `ReactNode` | | A decorative icon, e.g. `<Pencil size="1.38em" aria-hidden />`. |
|
|
873
|
+
| `loading` | `boolean` | | Shows a spinner and blocks clicks, keeping the button's width and focus. A loading button is `aria-disabled="true"` and `aria-busy="true"`, not native `disabled`, so it stays focusable (assert `aria-disabled` in tests, not `toBeDisabled()`). |
|
|
874
|
+
| `loadingLabel` | `string` | | Text announced to assistive tech while `loading`, e.g. "Saving". It becomes the button's accessible name and is read out through a polite live region, a visually hidden `role="status"` span rendered next to the button. |
|
|
875
|
+
| `render` | `RenderProp<Record<string, unknown>>` | | Render a different element, e.g. `render={<a href="/runs" />}` or a router `<Link to="/runs" />`. |
|
|
876
|
+
| `size` | `"sm" \| "md"` | `sm` | `sm` for dense places such as table rows and toolbars. |
|
|
877
|
+
|
|
878
|
+
### Tabs
|
|
879
|
+
|
|
880
|
+
Underline tabs with optional counts ("Conversation 13"). Pass `items`, or compose `Tabs.Root`, `Tabs.List`, `Tabs.Tab` and `Tabs.Panel`.
|
|
881
|
+
|
|
882
|
+
| Prop | Type | Default | Description |
|
|
883
|
+
| --- | --- | --- | --- |
|
|
884
|
+
| `className` | `string` | | |
|
|
885
|
+
| `defaultValue` | `string` | | The tab active at first (uncontrolled). |
|
|
886
|
+
| `items` * | `TabItem<Value>[]` | | The tabs, in order. The first enabled one is selected unless `value`/`defaultValue` says otherwise. |
|
|
887
|
+
| `keepMounted` | `boolean` | | Keeps hidden panels in the DOM, so form fields in other tabs stay registered and keep their state. Panels unmount while hidden by default. |
|
|
888
|
+
| `listProps` | `PartProps<TabsListProps>` | | Props for the tab row (role `tablist`). |
|
|
889
|
+
| `onValueChange` | `((value: Value, eventDetails: TabsRootChangeEventDetails) => void)` | | Called with the newly active tab's value. |
|
|
890
|
+
| `render` | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, TabsRootState>` | | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
|
|
891
|
+
| `style` | `CSSProperties \| ((state: TabsRootState) => CSSProperties)` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
892
|
+
| `value` | `string` | | The active tab's value (controlled). |
|
|
893
|
+
|
|
894
|
+
### Tag
|
|
895
|
+
|
|
896
|
+
A small rectangular mono label, e.g. an input method or event type.
|
|
897
|
+
|
|
898
|
+
| Prop | Type | Default | Description |
|
|
899
|
+
| --- | --- | --- | --- |
|
|
900
|
+
| `selected` | `boolean` | `false` | Accent-tinted with a leading check, e.g. the active value in a group of tags. |
|
|
901
|
+
| `tone` | `TagTone` | `neutral` | Colour. `neutral` (default) is plain; the others carry meaning, as in `Badge`. |
|
|
902
|
+
|
|
903
|
+
### Textarea
|
|
904
|
+
|
|
905
|
+
Multi-line text input with a label. Grows to fit its content (CSS `field-sizing`; browsers without it get a resize handle).
|
|
906
|
+
|
|
907
|
+
| Prop | Type | Default | Description |
|
|
908
|
+
| --- | --- | --- | --- |
|
|
909
|
+
| `countLimit` | `number` | | Soft limit: shows "count/countLimit" without setting native `maxLength`, so people can type past it. Over the limit the count turns red and gets `data-over="true"`; show an `error` too. |
|
|
910
|
+
| `defaultValue` | `string \| number \| readonly string[]` | | |
|
|
911
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
912
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
913
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
914
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
915
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
916
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
917
|
+
| `name` | `string` | | |
|
|
918
|
+
| `onValueChange` | `((value: string) => void)` | | Called with the new string value on every change. |
|
|
919
|
+
| `placeholder` | `string` | | |
|
|
920
|
+
| `ref` | `Ref<HTMLTextAreaElement>` | | Forwarded to the `<textarea>` (for form libraries). |
|
|
921
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
922
|
+
| `rows` | `number` | `3` | Lines shown when empty (default 3). It then grows with its content, up to 15 lines, and scrolls after that. |
|
|
923
|
+
| `showCount` | `boolean` | `false` | Shows "count/maxLength" under the textarea. Needs `maxLength`, which stops typing at the limit. |
|
|
924
|
+
| `value` | `string \| number \| readonly string[]` | | |
|
|
925
|
+
|
|
926
|
+
### TextInput
|
|
927
|
+
|
|
928
|
+
Single-line text input with a label. Spread `register('name')` from react-hook-form onto it.
|
|
929
|
+
|
|
930
|
+
| Prop | Type | Default | Description |
|
|
931
|
+
| --- | --- | --- | --- |
|
|
932
|
+
| `className` | `string` | | Goes on the field's root element, not the `<input>`. Use `inputProps.className` for that. |
|
|
933
|
+
| `countLimit` | `number` | | Soft limit: shows "count/countLimit" without setting native `maxLength`, so people can type past it. Over the limit the count turns red and gets `data-over="true"`; show an `error` too. |
|
|
934
|
+
| `defaultValue` | `string \| number \| readonly string[]` | | |
|
|
935
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
936
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
937
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
938
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
939
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
940
|
+
| `id` | `string` | | Goes on the `<input>`, so `<label htmlFor>` and `getElementById(id).focus()` work. |
|
|
941
|
+
| `inputProps` | `PartProps<Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">>` | | Extra props for the `<input>`, e.g. `{ className, 'data-testid': 'name' }`. |
|
|
942
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
943
|
+
| `name` | `string` | | |
|
|
944
|
+
| `onValueChange` | `((value: string) => void)` | | Called with the new string value on every change. |
|
|
945
|
+
| `placeholder` | `string` | | |
|
|
946
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the `<input>` (for form libraries, and to focus it). |
|
|
947
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
948
|
+
| `showCount` | `boolean` | `false` | Shows "count/maxLength" inside the input. Needs `maxLength`, which stops typing at the limit. |
|
|
949
|
+
| `value` | `string \| number \| readonly string[]` | | |
|
|
950
|
+
|
|
951
|
+
### ThemeMenu
|
|
952
|
+
|
|
953
|
+
A compact theme switch: an icon button showing the current theme that opens a menu of themes.
|
|
954
|
+
Made for the `NavRail` footer, so it opens to the right by default.
|
|
955
|
+
|
|
956
|
+
| Prop | Type | Default | Description |
|
|
957
|
+
| --- | --- | --- | --- |
|
|
958
|
+
| `align` | `Align` | `end` | How the menu lines up with the trigger along that side. |
|
|
959
|
+
| `className` | `string` | | Goes on the popup (role `menu`). |
|
|
960
|
+
| `defaultOpen` | `boolean` | `false` | Whether the menu is initially open. To render a controlled menu, use the `open` prop instead. |
|
|
961
|
+
| `label` | `string` | `Theme` | Accessible name of the trigger, and the heading above the options. |
|
|
962
|
+
| `onOpenChange` | `((open: boolean, eventDetails: MenuRootChangeEventDetails) => void)` | | Event handler called when the menu is opened or closed. |
|
|
963
|
+
| `open` | `boolean` | | Whether the menu is currently open. |
|
|
964
|
+
| `popupProps` | `PartProps<MenuPopupProps>` | | Props for the popup (role `menu`), e.g. `{ 'data-testid': 'account-menu' }`. |
|
|
965
|
+
| `portalContainer` | `PortalContainerTarget` | | Where the menu renders. Defaults to the nearest `PortalContainer`, else `document.body`. |
|
|
966
|
+
| `side` | `Side` | `right` | Which side of the trigger the menu opens on. It flips if there isn't room. |
|
|
967
|
+
| `themes` | `readonly ("light" \| "dark" \| "sand" \| "system")[]` | `['light', 'dark', 'sand', 'system'] as const` | The themes offered, in order. Defaults to all of them. |
|
|
968
|
+
|
|
969
|
+
### ThemePicker
|
|
970
|
+
|
|
971
|
+
Lets the user pick a theme. Each option previews itself in its own colours.
|
|
972
|
+
|
|
973
|
+
| Prop | Type | Default | Description |
|
|
974
|
+
| --- | --- | --- | --- |
|
|
975
|
+
| `label` | `string` | `Theme` | Visible group label (the `<legend>`). |
|
|
976
|
+
| `onChange` | `((theme: "light" \| "dark" \| "sand" \| "system") => void)` | | Called with the picked theme. |
|
|
977
|
+
| `options` | `ThemeOption[]` | `[ { value: 'light', label: 'Light', palettes: ['light'] }, { value: 'sand', label: 'Sand', palettes: ['sand'] }, { value: 'dark', label: 'Dark', palettes: ['dark'] }, { value: 'system', label: 'System', palettes: ['light', 'dark'] }, ]` | The themes offered, in order. Defaults to `defaultThemeOptions` (light, sand, dark, system). |
|
|
978
|
+
| `value` | `"light" \| "dark" \| "sand" \| "system"` | | Controlled value: the picker shows it and only calls `onChange`. Omit it to drive the app theme (`useTheme`); `onChange` is then still called, e.g. to save the choice to a profile. |
|
|
979
|
+
|
|
980
|
+
### TimeInput
|
|
981
|
+
|
|
982
|
+
Time picker using the browser's native time input. The value is `HH:MM` (24-hour).
|
|
983
|
+
|
|
984
|
+
| Prop | Type | Default | Description |
|
|
985
|
+
| --- | --- | --- | --- |
|
|
986
|
+
| `defaultValue` | `string \| number \| readonly string[]` | | |
|
|
987
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
988
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
989
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
990
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
991
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
992
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
993
|
+
| `name` | `string` | | |
|
|
994
|
+
| `onValueChange` | `((value: string) => void)` | | Called with the 24-hour time, e.g. `'09:30'`, or `''` when cleared. |
|
|
995
|
+
| `placeholder` | `string` | | |
|
|
996
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the `<input>` (for form libraries). |
|
|
997
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
998
|
+
| `value` | `string \| number \| readonly string[]` | | |
|
|
999
|
+
|
|
1000
|
+
### ToggleGroup
|
|
1001
|
+
|
|
1002
|
+
Segmented control: pick one of a few options. It's a radio group, so it submits `name` with a
|
|
1003
|
+
form, supports `required`, and arrow keys move the selection. With `multiple` it's a group of
|
|
1004
|
+
checkboxes: any number can be on, `value` is a `string[]`, and `required` only adds the asterisk.
|
|
1005
|
+
|
|
1006
|
+
| Prop | Type | Default | Description |
|
|
1007
|
+
| --- | --- | --- | --- |
|
|
1008
|
+
| `className` | `string` | | Class for the field's root element. |
|
|
1009
|
+
| `defaultValue` | `string \| null` | | The uncontrolled value of the radio button that should be initially selected. To render a controlled radio group, use the `value` prop instead. |
|
|
1010
|
+
| `description` | `ReactNode` | | Help text under the input, linked with `aria-describedby`. |
|
|
1011
|
+
| `disabled` | `boolean` | | Disables the input and greys out the label. |
|
|
1012
|
+
| `error` | `ReactNode` | | Error message. When set, the input is marked invalid and the message is announced. |
|
|
1013
|
+
| `fieldProps` | `FieldRootProps` | | Props for the field's root element, e.g. `{ 'data-testid': 'name-field' }`. `className` already goes there. |
|
|
1014
|
+
| `hideLabel` | `boolean` | | Hides the label visually. It still names the input for screen readers and tests. |
|
|
1015
|
+
| `label` | `ReactNode` | | Visible label, also the input's accessible name. |
|
|
1016
|
+
| `multiple` | `boolean` | | |
|
|
1017
|
+
| `name` | `string` | | Identifies the field when a form is submitted. |
|
|
1018
|
+
| `onValueChange` | `((value: string) => void) \| ((value: string[]) => void)` | | Called with the chosen option's `value`. Called with the values of the selected options. |
|
|
1019
|
+
| `options` * | `ToggleGroupOption[]` | | The segments, in order. Keep to 2–4 short labels. |
|
|
1020
|
+
| `ref` | `Ref<HTMLInputElement>` | | Forwarded to the group's hidden input (for form libraries). Single selection only. |
|
|
1021
|
+
| `required` | `boolean` | | Native `required`: the label gets an asterisk and the browser blocks submitting an empty field. When a form library validates instead, keep `required` and put `noValidate` on the `<form>`. |
|
|
1022
|
+
| `size` | `"sm" \| "md"` | `md` | `sm` is a compact control for use inside forms and toolbars. |
|
|
1023
|
+
| `style` | `CSSProperties \| ((state: CheckboxGroupState) => CSSProperties) \| ((state: RadioGroupState) => CSSProperties) \| undefined` | | Style applied to the element, or a function that returns a style object based on the component's state. |
|
|
1024
|
+
| `value` | `string \| null` | | The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the `defaultValue` prop instead. |
|
|
1025
|
+
|
|
1026
|
+
### Tooltip
|
|
1027
|
+
|
|
1028
|
+
A short inverted label shown on hover and keyboard focus. It's visual only, so give the trigger
|
|
1029
|
+
an accessible name too, e.g. `aria-label` matching `label` on an icon-only button.
|
|
1030
|
+
|
|
1031
|
+
| Prop | Type | Default | Description |
|
|
1032
|
+
| --- | --- | --- | --- |
|
|
1033
|
+
| `align` | `Align` | `center` | Alignment against the trigger along `side`. |
|
|
1034
|
+
| `children` * | `ReactElement<unknown, string \| JSXElementConstructor<any>>` | | The trigger element. It must accept a ref and props, e.g. a `<button>` or our `Button`. |
|
|
1035
|
+
| `className` | `string` | | Goes on the popup. |
|
|
1036
|
+
| `defaultOpen` | `boolean` | `false` | Whether the tooltip is initially open. To render a controlled tooltip, use the `open` prop instead. |
|
|
1037
|
+
| `label` * | `ReactNode` | | The tooltip text. Visual only: screen readers don't get it, so the trigger needs its own name. |
|
|
1038
|
+
| `onOpenChange` | `((open: boolean, eventDetails: TooltipRootChangeEventDetails) => void)` | | Event handler called when the tooltip is opened or closed. |
|
|
1039
|
+
| `open` | `boolean` | | Whether the tooltip is currently open. |
|
|
1040
|
+
| `portalContainer` | `PortalContainerTarget` | | Where the popup renders. Defaults to the nearest `PortalContainer`, else `document.body`. |
|
|
1041
|
+
| `side` | `Side` | `top` | Side of the trigger the tooltip shows on. |
|
|
1042
|
+
|
|
1043
|
+
### TopBar
|
|
1044
|
+
|
|
1045
|
+
Sticky bar at the top of the content area.
|
|
1046
|
+
|
|
1047
|
+
| Prop | Type | Default | Description |
|
|
1048
|
+
| --- | --- | --- | --- |
|
|
1049
|
+
| `end` | `ReactNode` | | Right side, e.g. `EnvironmentChip`, search or actions. |
|
|
1050
|
+
| `start` | `ReactNode` | | Left side, usually `Breadcrumbs`. |
|
|
1051
|
+
|
|
1052
|
+
### usePortalContainer
|
|
1053
|
+
|
|
1054
|
+
The nearest `PortalContainer`, unless `override` is given. `undefined` means `document.body`.
|
|
1055
|
+
|
|
1056
|
+
### UserMenu
|
|
1057
|
+
|
|
1058
|
+
Account menu: avatar button that opens a menu of account actions. Fits the NavRail `footer` slot.
|
|
1059
|
+
|
|
1060
|
+
| Prop | Type | Default | Description |
|
|
1061
|
+
| --- | --- | --- | --- |
|
|
1062
|
+
| `align` | `Align` | `end` | How the menu lines up with the trigger along that side. |
|
|
1063
|
+
| `avatarSrc` | `string` | | Avatar image URL. Falls back to initials. |
|
|
1064
|
+
| `className` | `string` | | Goes on the popup (role `menu`). |
|
|
1065
|
+
| `defaultOpen` | `boolean` | `false` | Whether the menu is initially open. To render a controlled menu, use the `open` prop instead. |
|
|
1066
|
+
| `email` | `string` | | Shown under the name in the default header. |
|
|
1067
|
+
| `footer` | `ReactNode` | | Content below the items, e.g. a version number. |
|
|
1068
|
+
| `header` | `ReactNode` | | Content at the top of the menu. Defaults to the name and `email`; pass `null` for none. |
|
|
1069
|
+
| `items` | `MenuEntry[]` | `[]` | Extra items above Sign out, e.g. Profile, Settings or a Theme submenu. |
|
|
1070
|
+
| `name` * | `string` | | Signed-in user's name or email. |
|
|
1071
|
+
| `onOpenChange` | `((open: boolean, eventDetails: MenuRootChangeEventDetails) => void)` | | Event handler called when the menu is opened or closed. |
|
|
1072
|
+
| `onSignOut` | `(() => void)` | | Adds a Sign out item when given. |
|
|
1073
|
+
| `open` | `boolean` | | Whether the menu is currently open. |
|
|
1074
|
+
| `popupProps` | `PartProps<MenuPopupProps>` | | Props for the popup (role `menu`), e.g. `{ 'data-testid': 'account-menu' }`. |
|
|
1075
|
+
| `portalContainer` | `PortalContainerTarget` | | Where the menu renders. Defaults to the nearest `PortalContainer`, else `document.body`. |
|
|
1076
|
+
| `showName` | `boolean` | `false` | Show the name next to the avatar (e.g. in an expanded NavRail). |
|
|
1077
|
+
| `side` | `Side` | `right` | Which side of the trigger the menu opens on. It flips if there isn't room. |
|
|
1078
|
+
| `signOutLabel` | `string` | `Sign out` | Text of the Sign out item. |
|
|
1079
|
+
| `signOutProps` | `MenuItemElementProps` | | Props for the Sign out item, e.g. `{ 'data-testid': 'sign-out' }`. |
|
|
1080
|
+
| `triggerProps` | `(ClassAttributes<HTMLButtonElement> & ButtonHTMLAttributes<HTMLButtonElement> & DataAttributes)` | | Props for the trigger button, e.g. `aria-label` or `data-testid`. |
|
|
1081
|
+
|
|
1082
|
+
## Helpers
|
|
1083
|
+
|
|
1084
|
+
Also exported from `@15gifts/back-office-kit`.
|
|
1085
|
+
|
|
1086
|
+
- `lastDuration(ms: number)`: The last `ms` milliseconds, ending now, e.g. `lastDuration(15 * 60_000)`.
|
|
1087
|
+
- `today(timeZone?: string)`: The whole of today, in `timeZone` (local when omitted).
|
|
1088
|
+
- `yesterday(timeZone?: string)`: The whole of yesterday, in `timeZone` (local when omitted).
|
|
1089
|
+
- `thisMonth(timeZone?: string)`: The whole of the current month, in `timeZone` (local when omitted).
|
|
1090
|
+
- `getDefaultPresets(timeZone?: string)`: The default quick ranges. Day-based ones follow `timeZone`.
|
|
1091
|
+
|
|
1092
|
+
## Theme and text size
|
|
1093
|
+
|
|
1094
|
+
Functions and hooks exported from `@15gifts/back-office-kit` (no provider needed).
|
|
1095
|
+
|
|
1096
|
+
- `FONT_SIZES`: Global text size. `md` (default) gives 14px body text, as in the original Back Office; `sm` and `lg` are about 6% smaller and larger. Everything in the library scales with it.
|
|
1097
|
+
- `FONT_SIZE_STORAGE_KEY`: localStorage key used to remember the user's choice.
|
|
1098
|
+
- `getFontSize: () => FontSize`: The active size, read from `<html data-font-size>`. Defaults to `md`.
|
|
1099
|
+
- `setFontSize: (size: FontSize, options?: { persist?: boolean }) => void`: Sets `<html data-font-size>` and remembers the choice (unless `persist` is false).
|
|
1100
|
+
- `applyStoredFontSize(fallback: FontSize = 'md')`: Applies the saved size. Call once before the first render, next to `applyStoredTheme`.
|
|
1101
|
+
- `useFontSize(): readonly [FontSize, (next: FontSize) => void]`: React hook over `getFontSize`/`setFontSize`. No provider needed.
|
|
1102
|
+
- `THEME_STORAGE_KEY`: localStorage key used to remember the user's choice.
|
|
1103
|
+
- `getTheme: () => Theme`: The active theme, read from `<html data-theme>`. Defaults to `system`.
|
|
1104
|
+
- `getColorScheme(theme: Theme = getTheme()): ColorScheme`: Whether the page currently renders light or dark. Use it to drive libraries with their own dark mode.
|
|
1105
|
+
- `setTheme: (theme: Theme, options?: { persist?: boolean }) => void`: Sets `<html data-theme>` and remembers the choice (unless `persist` is false).
|
|
1106
|
+
- `applyStoredTheme(options: Theme | ApplyStoredThemeOptions = {})`: Applies the saved theme. Call once before the first render to avoid a flash of the wrong theme.
|
|
1107
|
+
- `useTheme(): readonly [Theme, (next: Theme) => void]`: React hook over `getTheme`/`setTheme`. No provider needed.
|
|
1108
|
+
- `useColorScheme(): ColorScheme`: The resolved `light`/`dark` scheme, updating on theme changes and OS changes.
|
|
1109
|
+
|
|
1110
|
+
## Supporting types
|
|
1111
|
+
|
|
1112
|
+
Also exported from `@15gifts/back-office-kit`.
|
|
1113
|
+
|
|
1114
|
+
```ts
|
|
1115
|
+
export type AlertTone = 'info' | 'success' | 'warning' | 'danger'
|
|
1116
|
+
|
|
1117
|
+
export type BadgeTone =
|
|
1118
|
+
'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info' | 'highlight'
|
|
1119
|
+
|
|
1120
|
+
export interface BreadcrumbItem {
|
|
1121
|
+
/** Crumb text, or a control such as a `Switcher` (then set `current: false`). */
|
|
1122
|
+
label: ReactNode
|
|
1123
|
+
/** Link target. Use `render` instead for a router link. Without either, the crumb is plain text. */
|
|
1124
|
+
href?: string
|
|
1125
|
+
/** Router link element, e.g. `<Link to="/customers" />`. */
|
|
1126
|
+
render?: ReactElement
|
|
1127
|
+
/**
|
|
1128
|
+
* Marks the item as the current page: a plain `<span aria-current="page">`, never a link.
|
|
1129
|
+
* Defaults to `true` for the last item. Set `false` to keep the last item interactive, e.g. a
|
|
1130
|
+
* link, or a switcher button passed as `label`.
|
|
1131
|
+
*/
|
|
1132
|
+
current?: boolean
|
|
1133
|
+
/** Props for the crumb's link or text element, e.g. `{ 'data-testid': 'crumb-customer' }`. */
|
|
1134
|
+
itemProps?: HTMLAttributes<HTMLElement> & DataAttributes
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
export type ChatRole = 'user' | 'assistant' | 'system'
|
|
1138
|
+
|
|
1139
|
+
export interface ChatTranscriptLabels {
|
|
1140
|
+
user?: string
|
|
1141
|
+
assistant?: string
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
export interface ChatMessage {
|
|
1145
|
+
id: string
|
|
1146
|
+
role: ChatRole
|
|
1147
|
+
/** Text, markdown output, product cards, buttons… */
|
|
1148
|
+
content: ReactNode
|
|
1149
|
+
/** Shown in the muted line under the bubble (or inline for `system`). */
|
|
1150
|
+
timestamp?: ReactNode
|
|
1151
|
+
/** Extra muted details, e.g. a turn ID in `<code>`. */
|
|
1152
|
+
meta?: ReactNode
|
|
1153
|
+
/** Per-message controls, shown on hover or focus. Ignored for `system`. */
|
|
1154
|
+
actions?: ReactNode
|
|
1155
|
+
/** Props for the message element, e.g. `{ 'data-testid': 'turn-3' }`. */
|
|
1156
|
+
messageProps?: Omit<ComponentProps<'div'>, 'role'> & DataAttributes
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
export interface CheckboxGroupOption {
|
|
1160
|
+
/** Submitted with the form and included in `value` when ticked. */
|
|
1161
|
+
value: string
|
|
1162
|
+
label: ReactNode
|
|
1163
|
+
/** Help text under this option. */
|
|
1164
|
+
description?: ReactNode
|
|
1165
|
+
disabled?: boolean
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
export interface ComboboxOption {
|
|
1169
|
+
/** What `value` and `onValueChange` use. Unique within the options. */
|
|
1170
|
+
value: string
|
|
1171
|
+
/** The text shown in the list and, once picked, in the input. Typing filters on it. */
|
|
1172
|
+
label: string
|
|
1173
|
+
/** A muted line under the label in the list. Screen readers announce it as the option's description. Not filtered on. */
|
|
1174
|
+
description?: ReactNode
|
|
1175
|
+
/** Muted text at the end of the row, e.g. "32–50 wpm". Also part of the option's description. */
|
|
1176
|
+
detail?: ReactNode
|
|
1177
|
+
/** Shown but can't be picked. */
|
|
1178
|
+
disabled?: boolean
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
export interface DateRange {
|
|
1182
|
+
start: Date | null
|
|
1183
|
+
end: Date | null
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
export interface FullDateRange {
|
|
1187
|
+
start: Date
|
|
1188
|
+
end: Date
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
export interface DateRangePreset {
|
|
1192
|
+
label: string
|
|
1193
|
+
range: () => FullDateRange
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
export interface DescriptionListItem {
|
|
1197
|
+
/** The label, e.g. "Customer". */
|
|
1198
|
+
term: ReactNode
|
|
1199
|
+
/** The value. */
|
|
1200
|
+
description: ReactNode
|
|
1201
|
+
/** Show the description in the mono font, e.g. for IDs and codes. */
|
|
1202
|
+
mono?: boolean
|
|
1203
|
+
/** Native tooltip on the value, e.g. the full text of a truncated value. */
|
|
1204
|
+
title?: string
|
|
1205
|
+
/** Extra class on the value (`<dd>`), e.g. to truncate it. */
|
|
1206
|
+
className?: string
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
export type DetailsSummaryTone = BadgeTone
|
|
1210
|
+
|
|
1211
|
+
export type EnvironmentTone = 'danger' | 'highlight' | 'info' | 'neutral'
|
|
1212
|
+
|
|
1213
|
+
export type DataAttributes = { [key: `data-${string}`]: string | number | boolean | undefined }
|
|
1214
|
+
|
|
1215
|
+
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6
|
|
1216
|
+
|
|
1217
|
+
export type HeadingSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
1218
|
+
|
|
1219
|
+
export type IconSize = keyof typeof sizes | `${number}${'em' | 'rem'}` | 12 | 14 | 16 | 20 | 24
|
|
1220
|
+
|
|
1221
|
+
export interface MenuItem {
|
|
1222
|
+
type?: 'item'
|
|
1223
|
+
/** The item's text. */
|
|
1224
|
+
label: ReactNode
|
|
1225
|
+
/** Called when the item is picked by click or Enter. The menu then closes. */
|
|
1226
|
+
onClick?: () => void
|
|
1227
|
+
/** A decorative icon shown before the label. */
|
|
1228
|
+
icon?: ReactNode
|
|
1229
|
+
/** Styled in the danger colour, e.g. Delete. */
|
|
1230
|
+
destructive?: boolean
|
|
1231
|
+
/** Shown but can't be picked. A disabled link renders without its `href`. */
|
|
1232
|
+
disabled?: boolean
|
|
1233
|
+
/** Renders a link. */
|
|
1234
|
+
href?: string
|
|
1235
|
+
/** Renders a link through your router's link component. */
|
|
1236
|
+
render?: ReactElement
|
|
1237
|
+
/** React key. Defaults to the item's index. */
|
|
1238
|
+
key?: string
|
|
1239
|
+
/** Props for the item's element. */
|
|
1240
|
+
itemProps?: MenuItemElementProps
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
export interface MenuSubmenu {
|
|
1244
|
+
type?: 'submenu'
|
|
1245
|
+
/** The text of the item that opens the submenu. */
|
|
1246
|
+
label: ReactNode
|
|
1247
|
+
/** A decorative icon shown before the label. */
|
|
1248
|
+
icon?: ReactNode
|
|
1249
|
+
/** The submenu's entries. */
|
|
1250
|
+
items: MenuEntry[]
|
|
1251
|
+
/** Shown but can't be opened. */
|
|
1252
|
+
disabled?: boolean
|
|
1253
|
+
/** React key. Defaults to the entry's index. */
|
|
1254
|
+
key?: string
|
|
1255
|
+
/** Props for the item that opens the submenu. */
|
|
1256
|
+
itemProps?: MenuItemElementProps
|
|
1257
|
+
/** Props for the submenu's popup (role `menu`). */
|
|
1258
|
+
popupProps?: PartProps<BaseMenu.Popup.Props>
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
export interface MenuRadioGroup {
|
|
1262
|
+
type: 'radio'
|
|
1263
|
+
/** A visible label above the options. */
|
|
1264
|
+
label?: ReactNode
|
|
1265
|
+
/** The `value` of the checked option. */
|
|
1266
|
+
value: string
|
|
1267
|
+
/** Called with the picked option's `value`. The menu stays open. */
|
|
1268
|
+
onValueChange: (value: string) => void
|
|
1269
|
+
/** The choices. `itemProps` go on each option's element. */
|
|
1270
|
+
options: Array<{
|
|
1271
|
+
value: string
|
|
1272
|
+
label: ReactNode
|
|
1273
|
+
disabled?: boolean
|
|
1274
|
+
itemProps?: MenuItemElementProps
|
|
1275
|
+
}>
|
|
1276
|
+
/** React key. Defaults to the entry's index. */
|
|
1277
|
+
key?: string
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
export interface MenuCheckboxItem {
|
|
1281
|
+
type: 'checkbox'
|
|
1282
|
+
/** The setting's text. */
|
|
1283
|
+
label: ReactNode
|
|
1284
|
+
/** Whether the setting is on. */
|
|
1285
|
+
checked: boolean
|
|
1286
|
+
/** Called with the new state when toggled. The menu stays open. */
|
|
1287
|
+
onCheckedChange: (checked: boolean) => void
|
|
1288
|
+
/** A decorative icon shown before the label. */
|
|
1289
|
+
icon?: ReactNode
|
|
1290
|
+
/** Shown but can't be toggled. */
|
|
1291
|
+
disabled?: boolean
|
|
1292
|
+
/** React key. Defaults to the entry's index. */
|
|
1293
|
+
key?: string
|
|
1294
|
+
/** Props for the item's element. */
|
|
1295
|
+
itemProps?: MenuItemElementProps
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
export interface MenuGroupLabel {
|
|
1299
|
+
type: 'label'
|
|
1300
|
+
/** The heading text. Also names the group for screen readers. */
|
|
1301
|
+
label: ReactNode
|
|
1302
|
+
/** React key. Defaults to the entry's index. */
|
|
1303
|
+
key?: string
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
export type MenuEntry =
|
|
1307
|
+
MenuItem | MenuSubmenu | MenuRadioGroup | MenuCheckboxItem | MenuGroupLabel | 'separator'
|
|
1308
|
+
|
|
1309
|
+
export type MetricBarSegmentTone = 'success' | 'neutral' | 'danger' | 'highlight'
|
|
1310
|
+
|
|
1311
|
+
export interface MetricBarSegment {
|
|
1312
|
+
/** Percentage of the bar's width (0 to 100). */
|
|
1313
|
+
value: number
|
|
1314
|
+
/** Segment colour. */
|
|
1315
|
+
tone: MetricBarSegmentTone
|
|
1316
|
+
/** Names the segment in a legend under the bar, so its meaning isn't carried by colour alone. */
|
|
1317
|
+
label?: ReactNode
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
export interface NavRailItem {
|
|
1321
|
+
/** Shown beside the icon when expanded, and as the tooltip and accessible name when collapsed. */
|
|
1322
|
+
label: string
|
|
1323
|
+
/** Icon element, e.g. `<Settings size="1.43em" aria-hidden />` (em keeps it scaling with text). */
|
|
1324
|
+
icon: ReactNode
|
|
1325
|
+
/** Link target. Use `render` instead for a router link. */
|
|
1326
|
+
href?: string
|
|
1327
|
+
/** Router link element, e.g. `<Link to="/settings" />`. Takes precedence over `href`. */
|
|
1328
|
+
render?: ReactElement
|
|
1329
|
+
/** Marks the current section (`aria-current="page"`). */
|
|
1330
|
+
active?: boolean
|
|
1331
|
+
/** Props for the item's link, e.g. `{ 'data-testid': 'nav-settings' }`. */
|
|
1332
|
+
itemProps?: ComponentProps<'a'> & DataAttributes
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
export interface NavRailGroup {
|
|
1336
|
+
/** Group heading, e.g. "Results". Short: one or two words. */
|
|
1337
|
+
group: string
|
|
1338
|
+
items: NavRailItem[]
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
export type PortalContainerTarget =
|
|
1342
|
+
HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null
|
|
1343
|
+
|
|
1344
|
+
export interface RadioCardOption {
|
|
1345
|
+
/** Submitted with the form and passed to `onValueChange`. */
|
|
1346
|
+
value: string
|
|
1347
|
+
/** The card's title, also the radio's accessible name. */
|
|
1348
|
+
label: ReactNode
|
|
1349
|
+
/** Smaller text under the title, also the radio's accessible description. */
|
|
1350
|
+
description?: ReactNode
|
|
1351
|
+
disabled?: boolean
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
export interface SelectOption {
|
|
1355
|
+
/**
|
|
1356
|
+
* What `value` and `onValueChange` use. Unique within the options. `''` works as a real choice
|
|
1357
|
+
* (e.g. "All sites"), but like a native `<select>` it doesn't satisfy `required`.
|
|
1358
|
+
*/
|
|
1359
|
+
value: string
|
|
1360
|
+
/** The text shown in the list and, once picked, in the trigger. Typeahead matches it. */
|
|
1361
|
+
label: string
|
|
1362
|
+
/** A muted line under the label in the list. Screen readers announce it as the option's description. */
|
|
1363
|
+
description?: ReactNode
|
|
1364
|
+
/** Muted text at the end of the row, e.g. "32–50 wpm". Also part of the option's description. */
|
|
1365
|
+
detail?: ReactNode
|
|
1366
|
+
/** Shown but can't be picked. */
|
|
1367
|
+
disabled?: boolean
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
export type Status = 'queued' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled'
|
|
1371
|
+
|
|
1372
|
+
export interface SwitcherItem {
|
|
1373
|
+
/** Unique ID, e.g. a customer ID or branch name. Also matched by the filter. */
|
|
1374
|
+
value: string
|
|
1375
|
+
/** The row's name, also shown in the trigger when it's the current item. Matched by the filter. */
|
|
1376
|
+
label: string
|
|
1377
|
+
/** Secondary text under the label, e.g. an ID. */
|
|
1378
|
+
description?: string
|
|
1379
|
+
/** Leading visual, e.g. an `<Avatar size="sm" />` or a logo. Hidden from assistive tech, as the label names the row. */
|
|
1380
|
+
visual?: ReactNode
|
|
1381
|
+
/** Trailing content, e.g. `<Badge>main</Badge>`. */
|
|
1382
|
+
badge?: ReactNode
|
|
1383
|
+
/** Extra words the filter matches. */
|
|
1384
|
+
keywords?: string[]
|
|
1385
|
+
/** Shown but can't be picked. */
|
|
1386
|
+
disabled?: boolean
|
|
1387
|
+
/** Render the row as a link, e.g. `render={<a href="/customer/o2" />}` or a router `<Link />`. */
|
|
1388
|
+
render?: ReactElement
|
|
1389
|
+
/** Props for the row (role `option`), e.g. `{ 'data-testid': 'customer-o2' }`. */
|
|
1390
|
+
itemProps?: PartProps<BaseCombobox.Item.Props>
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
export interface SwitcherFooter {
|
|
1394
|
+
/** The button's text, e.g. "View all customers". */
|
|
1395
|
+
label: ReactNode
|
|
1396
|
+
/** e.g. `<a href="/customers" />` or a router `<Link to="/customers" />`. */
|
|
1397
|
+
render?: ButtonProps['render']
|
|
1398
|
+
/** Called on click. The popup then closes. */
|
|
1399
|
+
onClick?: () => void
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
export type SortDirection = 'asc' | 'desc'
|
|
1403
|
+
|
|
1404
|
+
export interface SortState {
|
|
1405
|
+
key: string
|
|
1406
|
+
direction: SortDirection
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
export interface TableColumn<Row> {
|
|
1410
|
+
/** Unique column ID. Also the row field shown when there's no `render`. */
|
|
1411
|
+
key: string
|
|
1412
|
+
/** Column header content. */
|
|
1413
|
+
header: ReactNode
|
|
1414
|
+
/** Text alignment. Use `right` for numbers. */
|
|
1415
|
+
align?: Align
|
|
1416
|
+
/** Column width, e.g. `1` to shrink an actions column to fit. */
|
|
1417
|
+
width?: CSSProperties['width']
|
|
1418
|
+
/** Defaults to `row[key]`. */
|
|
1419
|
+
render?: (row: Row) => ReactNode
|
|
1420
|
+
/**
|
|
1421
|
+
* Shown after the cell's content and outside the row's link or button, so it isn't part of its
|
|
1422
|
+
* accessible name, e.g. tags beside a name.
|
|
1423
|
+
*/
|
|
1424
|
+
extra?: (row: Row) => ReactNode
|
|
1425
|
+
/** Makes the header a sort button (see `sort`). */
|
|
1426
|
+
sortable?: boolean
|
|
1427
|
+
/** Ascending order for client-side sorting. Without it, rows show in the order given (the server sorts). */
|
|
1428
|
+
compare?: (a: Row, b: Row) => number
|
|
1429
|
+
/** One line with an ellipsis. A string sets the max width, e.g. `'16rem'` (default `20rem`). */
|
|
1430
|
+
truncate?: boolean | string
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
export interface TabItem<Value extends string = string> {
|
|
1434
|
+
/** Unique key, used by `value`/`defaultValue`/`onValueChange`. */
|
|
1435
|
+
value: Value
|
|
1436
|
+
/** Tab text. */
|
|
1437
|
+
label: ReactNode
|
|
1438
|
+
/** Shown muted after the label, e.g. the number of items in the panel. */
|
|
1439
|
+
count?: ReactNode
|
|
1440
|
+
/** The panel shown while this tab is active. */
|
|
1441
|
+
content: ReactNode
|
|
1442
|
+
/** Can't be selected. */
|
|
1443
|
+
disabled?: boolean
|
|
1444
|
+
/** Keeps this panel in the DOM (hidden) while another tab is active. Overrides the `Tabs` prop. */
|
|
1445
|
+
keepMounted?: boolean
|
|
1446
|
+
/** Props for the tab (role `tab`), e.g. `{ 'data-testid': 'tab-config' }`. */
|
|
1447
|
+
tabProps?: PartProps<BaseTabs.Tab.Props>
|
|
1448
|
+
/** Props for the panel (role `tabpanel`). */
|
|
1449
|
+
panelProps?: PartProps<BaseTabs.Panel.Props>
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
export type TagTone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info' | 'highlight'
|
|
1453
|
+
|
|
1454
|
+
export interface ThemeOption {
|
|
1455
|
+
/** The theme this option applies. */
|
|
1456
|
+
value: Theme
|
|
1457
|
+
/** Visible name under the preview. */
|
|
1458
|
+
label: string
|
|
1459
|
+
/** Palettes drawn in the preview. Two are drawn side by side (e.g. system = light + dark). */
|
|
1460
|
+
palettes: ('light' | 'dark' | 'sand')[]
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
export interface ToggleGroupOption {
|
|
1464
|
+
/** Submitted with the form and passed to `onValueChange`. */
|
|
1465
|
+
value: string
|
|
1466
|
+
/** The segment's text. */
|
|
1467
|
+
label: string
|
|
1468
|
+
disabled?: boolean
|
|
1469
|
+
}
|
|
1470
|
+
```
|