@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 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","names":["styles.link","styles.nav","styles.list","item","styles.item","styles.current","styles.text","Crumb","useRender","item","clsx","link","Breadcrumbs","ariaLabel","props","nav","className","list","items","isCurrent","item$1","index","ChevronRight","current","text"],"sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render'\nimport { clsx } from 'clsx'\nimport { ChevronRight } from 'lucide-react'\nimport type { ComponentProps, HTMLAttributes, ReactElement, ReactNode } from 'react'\n\nimport * as styles from './Breadcrumbs.css'\nimport type { DataAttributes } from '../Field/Field'\n\nexport interface BreadcrumbItem {\n /** Crumb text, or a control such as a `Switcher` (then set `current: false`). */\n label: ReactNode\n /** Link target. Use `render` instead for a router link. Without either, the crumb is plain text. */\n href?: string\n /** Router link element, e.g. `<Link to=\"/customers\" />`. */\n render?: ReactElement\n /**\n * Marks the item as the current page: a plain `<span aria-current=\"page\">`, never a link.\n * Defaults to `true` for the last item. Set `false` to keep the last item interactive, e.g. a\n * link, or a switcher button passed as `label`.\n */\n current?: boolean\n /** Props for the crumb's link or text element, e.g. `{ 'data-testid': 'crumb-customer' }`. */\n itemProps?: HTMLAttributes<HTMLElement> & DataAttributes\n}\n\nexport interface BreadcrumbsProps extends Omit<ComponentProps<'nav'>, 'children'> {\n /** Trail from root to the current page. The last item is the current page unless it sets `current: false`. */\n items: BreadcrumbItem[]\n}\n\nfunction Crumb({ item }: { item: BreadcrumbItem }) {\n return useRender({\n defaultTagName: 'a',\n render: item.render,\n props: {\n ...item.itemProps,\n href: item.render ? undefined : item.href,\n className: clsx(styles.link, item.itemProps?.className),\n children: item.label,\n },\n })\n}\n\n/** Where the current page sits in the app. */\nexport function Breadcrumbs({\n items,\n className,\n 'aria-label': ariaLabel = 'Breadcrumb',\n ...props\n}: BreadcrumbsProps) {\n return (\n <nav aria-label={ariaLabel} className={clsx(styles.nav, className)} {...props}>\n <ol className={styles.list}>\n {items.map((item, index) => {\n const isCurrent = item.current ?? index === items.length - 1\n return (\n <li key={index} className={styles.item}>\n {index > 0 && (\n <span className={styles.separator} aria-hidden>\n <ChevronRight size=\"1em\" />\n </span>\n )}\n {isCurrent ? (\n <span\n {...item.itemProps}\n className={clsx(styles.current, item.itemProps?.className)}\n aria-current=\"page\"\n >\n {item.label}\n </span>\n ) : !item.href && !item.render ? (\n <span {...item.itemProps} className={clsx(styles.text, item.itemProps?.className)}>\n {item.label}\n </span>\n ) : (\n <Crumb item={item} />\n )}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n"],"mappings":";;;;;;AA8BA,SAASO,EAAM,EAAE,WAAkC;CACjD,OAAOC,EAAU;EACf,gBAAgB;EAChB,QAAQC,EAAK;EACb,OAAO;GACL,GAAGA,EAAK;GACR,MAAMA,EAAK,SAAS,KAAA,IAAYA,EAAK;GACrC,WAAWC,EAAKV,GAAaS,EAAK,WAAW,SAAS;GACtD,UAAUA,EAAK;EACjB;CACF,CAAC;AACH;AAGA,SAAgBG,EAAY,EAC1B,UACA,cACA,cAAcC,IAAY,cAC1B,GAAGC,KACgB;CACnB,OACE,kBAAC,OAAD;EAAK,cAAYD;EAAW,WAAWH,EAAKT,GAAYe,CAAS;EAAG,GAAIF;EACtE,UAAA,kBAAC,MAAD;GAAI,WAAWZ;GACZ,UAAAgB,EAAM,KAAK,GAAM,MAAU;IAC1B,IAAMC,IAAYhB,EAAK,WAAWkB,MAAUH,EAAM,SAAS;IAC3D,OACE,kBAAC,MAAD;KAAgB,WAAWd;KAA3B,UAAA,CACGiB,IAAQ,KACP,kBAAC,QAAD;MAAM,WAAW;MAAkB,eAAA;MACjC,UAAA,kBAACC,GAAD,EAAc,MAAK,MAAO,CAAA;KACtB,CAAA,GAEPH,IACC,kBAAC,QAAD;MACE,GAAIhB,EAAK;MACT,WAAWO,EAAKL,GAAgBF,EAAK,WAAW,SAAS;MACzD,gBAAa;MAEZ,UAAAA,EAAK;KACF,CAAA,IACJ,CAACA,EAAK,QAAQ,CAACA,EAAK,SACtB,kBAAC,QAAD;MAAM,GAAIA,EAAK;MAAW,WAAWO,EAAKJ,GAAaH,EAAK,WAAW,SAAS;MAC7E,UAAAA,EAAK;KACF,CAAA,IAEN,kBAACI,GAAD,EAAa,MAAAa,EAAO,CAAA,CAEpB;IArBK,GAAAC,CAqBL;GAER,CAAC;EACC,CAAA;CACD,CAAA;AAET"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
// src/components/Breadcrumbs/Breadcrumbs.css.ts
|
|
4
|
+
var e = "_1ef1m2r0", t = "_1ef1m2r1", n = "_1ef1m2r2", r = "_1ef1m2r3 tyvs8e0", i = "_1ef1m2r4", a = "_1ef1m2r5", o = "_1ef1m2r6";
|
|
5
|
+
export { i as current, n as item, r as link, t as list, e as nav, o as separator, a as text };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=Breadcrumbs.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.styles.js","names":["nav","list","item","link","current","text","separator"],"sources":["../../../src/components/Breadcrumbs/Breadcrumbs.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css'\n\nimport { focusRing } from '../../styles/shared.css'\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\nexport const nav = style({ minWidth: 0 })\n// One line: in a narrow bar, link crumbs shrink with an ellipsis instead of wrapping.\nexport const list = style({\n display: 'flex',\n flexWrap: 'nowrap',\n alignItems: 'center',\n gap: space['1'],\n margin: 0,\n padding: 0,\n listStyle: 'none',\n fontFamily: vars.font.sans,\n fontSize: fontSize.md,\n})\nexport const item = style({\n display: 'inline-flex',\n alignItems: 'center',\n gap: space['1'],\n minWidth: 0,\n})\nexport const link = style([\n focusRing,\n {\n display: 'inline-block',\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n // A 24px target (WCAG 2.5.8) without changing the text size.\n lineHeight: space['6'],\n color: vars.color.inkMuted,\n textDecoration: 'none',\n borderRadius: radius.sm,\n paddingInline: space['1'],\n selectors: { '&:hover': { color: vars.color.ink, textDecoration: 'underline' } },\n },\n])\nexport const current = style({\n whiteSpace: 'nowrap',\n color: vars.color.ink,\n fontWeight: fontWeight.medium,\n paddingInline: space['1'],\n})\n// A crumb that's neither a link nor the current page, e.g. a switcher.\nexport const text = style({ color: vars.color.inkMuted, paddingInline: space['1'] })\nexport const separator = style({\n flexShrink: 0,\n color: vars.color.inkSubtle,\n display: 'inline-flex',\n})\n"],"mappings":""}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { RecipeVariants } from '@vanilla-extract/recipes';
|
|
2
|
+
export declare const button: import('@vanilla-extract/recipes').RuntimeFn<{
|
|
3
|
+
variant: {
|
|
4
|
+
primary: {
|
|
5
|
+
backgroundColor: `var(--${string})`;
|
|
6
|
+
color: `var(--${string})`;
|
|
7
|
+
selectors: {
|
|
8
|
+
'&:hover:not([aria-disabled="true"])': {
|
|
9
|
+
backgroundColor: `var(--${string})`;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
secondary: {
|
|
14
|
+
backgroundColor: `var(--${string})`;
|
|
15
|
+
color: `var(--${string})`;
|
|
16
|
+
borderColor: `var(--${string})`;
|
|
17
|
+
selectors: {
|
|
18
|
+
'&:hover:not([aria-disabled="true"])': {
|
|
19
|
+
backgroundColor: `var(--${string})`;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
ghost: {
|
|
24
|
+
backgroundColor: "transparent";
|
|
25
|
+
color: `var(--${string})`;
|
|
26
|
+
selectors: {
|
|
27
|
+
'&:hover:not([aria-disabled="true"])': {
|
|
28
|
+
backgroundColor: `var(--${string})`;
|
|
29
|
+
};
|
|
30
|
+
'&[aria-disabled="true"]': {
|
|
31
|
+
backgroundColor: "transparent";
|
|
32
|
+
borderColor: "transparent";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
danger: {
|
|
37
|
+
backgroundColor: `var(--${string})`;
|
|
38
|
+
color: `var(--${string})`;
|
|
39
|
+
borderColor: `var(--${string})`;
|
|
40
|
+
selectors: {
|
|
41
|
+
'&:hover:not([aria-disabled="true"])': {
|
|
42
|
+
backgroundColor: `var(--${string})`;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
size: {
|
|
48
|
+
sm: {
|
|
49
|
+
minHeight: "2rem";
|
|
50
|
+
paddingInline: string;
|
|
51
|
+
fontSize: string;
|
|
52
|
+
};
|
|
53
|
+
md: {
|
|
54
|
+
minHeight: "2.75rem";
|
|
55
|
+
paddingInline: string;
|
|
56
|
+
fontSize: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
iconOnly: {
|
|
60
|
+
true: {
|
|
61
|
+
paddingInline: number;
|
|
62
|
+
aspectRatio: "1";
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
fullWidth: {
|
|
66
|
+
true: {
|
|
67
|
+
width: "100%";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}>;
|
|
71
|
+
export type ButtonVariants = NonNullable<RecipeVariants<typeof button>>;
|
|
72
|
+
export declare const content: string;
|
|
73
|
+
export declare const hidden: string;
|
|
74
|
+
export declare const overlay: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
export interface ButtonProps extends ComponentProps<'button'> {
|
|
4
|
+
/** `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. */
|
|
5
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
6
|
+
/** `sm` for dense places such as table rows and toolbars. */
|
|
7
|
+
size?: 'sm' | 'md';
|
|
8
|
+
/** Icon element (e.g. a lucide-react icon) shown before the label. */
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
/** Square button showing only the icon. `children` (or `aria-label`) still names it for screen readers. */
|
|
11
|
+
iconOnly?: boolean;
|
|
12
|
+
/** Stretches the button to fill its container. */
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Shows a spinner and blocks clicks, keeping the button's width and focus. A loading button is
|
|
16
|
+
* `aria-disabled="true"` and `aria-busy="true"`, not native `disabled`, so it stays focusable
|
|
17
|
+
* (assert `aria-disabled` in tests, not `toBeDisabled()`).
|
|
18
|
+
*/
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Text announced to assistive tech while `loading`, e.g. "Saving". It becomes the button's
|
|
22
|
+
* accessible name and is read out through a polite live region, a visually hidden
|
|
23
|
+
* `role="status"` span rendered next to the button.
|
|
24
|
+
*/
|
|
25
|
+
loadingLabel?: string;
|
|
26
|
+
/** Render a different element, e.g. `render={<a href="/runs" />}` or a router `<Link to="/runs" />`. */
|
|
27
|
+
render?: useRender.RenderProp;
|
|
28
|
+
}
|
|
29
|
+
/** Action button. Use `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. */
|
|
30
|
+
export declare function Button({ variant, size, icon, iconOnly, fullWidth, loading, loadingLabel, disabled, type, render, className, children, onClick, ...props }: ButtonProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { visuallyHidden as e } from "../../styles/shared.styles.js";
|
|
2
|
+
import { Loader as t } from "../Loader/Loader.js";
|
|
3
|
+
import { button as n, content as r } from "./Button.styles.js";
|
|
4
|
+
import { clsx as i } from "clsx";
|
|
5
|
+
import { mergeProps as a } from "@base-ui/react/merge-props";
|
|
6
|
+
import { useRender as o } from "@base-ui/react/use-render";
|
|
7
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
// src/components/Button/Button.tsx
|
|
9
|
+
function u({ variant: u = "primary", size: d = "md", icon: f, iconOnly: p = !1, fullWidth: m = !1, loading: h = !1, loadingLabel: g, disabled: _ = !1, type: v = "button", render: y, className: b, children: x, onClick: S, ...C }) {
|
|
10
|
+
let w = !y, T = _ || h, E = h && !!g, D = o({
|
|
11
|
+
defaultTagName: "button",
|
|
12
|
+
render: y,
|
|
13
|
+
props: a({
|
|
14
|
+
type: w ? v : void 0,
|
|
15
|
+
disabled: w && _ && !h,
|
|
16
|
+
"aria-disabled": T || void 0,
|
|
17
|
+
"aria-busy": h || void 0,
|
|
18
|
+
className: i(n({
|
|
19
|
+
variant: u,
|
|
20
|
+
size: d,
|
|
21
|
+
iconOnly: p,
|
|
22
|
+
fullWidth: m
|
|
23
|
+
}), b),
|
|
24
|
+
onClick: (e) => {
|
|
25
|
+
T ? e.preventDefault() : S?.(e);
|
|
26
|
+
},
|
|
27
|
+
children: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("span", {
|
|
28
|
+
className: i(r, h && "okkfzza"),
|
|
29
|
+
"aria-hidden": E || void 0,
|
|
30
|
+
children: [f, p ? /* @__PURE__ */ c("span", {
|
|
31
|
+
className: e,
|
|
32
|
+
children: x
|
|
33
|
+
}) : x]
|
|
34
|
+
}), h && /* @__PURE__ */ l("span", {
|
|
35
|
+
className: "okkfzzb",
|
|
36
|
+
children: [/* @__PURE__ */ c(t, {
|
|
37
|
+
size: d === "sm" ? "1.08em" : "1em",
|
|
38
|
+
label: null
|
|
39
|
+
}), E && /* @__PURE__ */ c("span", {
|
|
40
|
+
className: "tyvs8e1",
|
|
41
|
+
children: g
|
|
42
|
+
})]
|
|
43
|
+
})] })
|
|
44
|
+
}, C)
|
|
45
|
+
});
|
|
46
|
+
return g ? /* @__PURE__ */ l(s, { children: [D, /* @__PURE__ */ c("span", {
|
|
47
|
+
role: "status",
|
|
48
|
+
className: e,
|
|
49
|
+
children: h ? g : ""
|
|
50
|
+
})] }) : D;
|
|
51
|
+
}
|
|
52
|
+
export { u as Button };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","names":["styles.button","_Fragment","styles.content","Button","props","isNative","render","inactive","disabled","loading","labelled","loadingLabel","element","useRender","mergeProps","type","clsx","button","className","event","onClick","Fragment","content","icon","iconOnly","visuallyHidden","children","Loader","size"],"sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport { clsx } from 'clsx'\nimport type { ComponentProps, MouseEvent, ReactNode } from 'react'\n\nimport { visuallyHidden } from '../../styles/shared.css'\nimport { Loader } from '../Loader'\nimport * as styles from './Button.css'\n\nexport interface ButtonProps extends ComponentProps<'button'> {\n /** `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. */\n variant?: 'primary' | 'secondary' | 'ghost' | 'danger'\n /** `sm` for dense places such as table rows and toolbars. */\n size?: 'sm' | 'md'\n /** Icon element (e.g. a lucide-react icon) shown before the label. */\n icon?: ReactNode\n /** Square button showing only the icon. `children` (or `aria-label`) still names it for screen readers. */\n iconOnly?: boolean\n /** Stretches the button to fill its container. */\n fullWidth?: boolean\n /**\n * Shows a spinner and blocks clicks, keeping the button's width and focus. A loading button is\n * `aria-disabled=\"true\"` and `aria-busy=\"true\"`, not native `disabled`, so it stays focusable\n * (assert `aria-disabled` in tests, not `toBeDisabled()`).\n */\n loading?: boolean\n /**\n * Text announced to assistive tech while `loading`, e.g. \"Saving\". It becomes the button's\n * accessible name and is read out through a polite live region, a visually hidden\n * `role=\"status\"` span rendered next to the button.\n */\n loadingLabel?: string\n /** Render a different element, e.g. `render={<a href=\"/runs\" />}` or a router `<Link to=\"/runs\" />`. */\n render?: useRender.RenderProp\n}\n\n/** Action button. Use `primary` for the one main action per view, `secondary` for others, `ghost` in toolbars and tables, `danger` for destructive actions. */\nexport function Button({\n variant = 'primary',\n size = 'md',\n icon,\n iconOnly = false,\n fullWidth = false,\n loading = false,\n loadingLabel,\n disabled = false,\n type = 'button',\n render,\n className,\n children,\n onClick,\n ...props\n}: ButtonProps) {\n const isNative = !render\n const inactive = disabled || loading\n const labelled = loading && !!loadingLabel\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (inactive) {\n event.preventDefault()\n return\n }\n onClick?.(event)\n }\n\n const element = useRender({\n defaultTagName: 'button',\n render,\n props: mergeProps<'button'>(\n {\n type: isNative ? type : undefined,\n // Native disabled removes focus; a loading button keeps it so focus isn't lost mid-save.\n disabled: isNative && disabled && !loading,\n 'aria-disabled': inactive || undefined,\n 'aria-busy': loading || undefined,\n className: clsx(styles.button({ variant, size, iconOnly, fullWidth }), className),\n onClick: handleClick,\n children: (\n <>\n <span\n className={clsx(styles.content, loading && styles.hidden)}\n aria-hidden={labelled || undefined}\n >\n {icon}\n {iconOnly ? <span className={visuallyHidden}>{children}</span> : children}\n </span>\n {loading && (\n <span className={styles.overlay}>\n <Loader size={size === 'sm' ? '1.08em' : '1em'} label={null} />\n {labelled && <span className={visuallyHidden}>{loadingLabel}</span>}\n </span>\n )}\n </>\n ),\n },\n props,\n ),\n })\n\n if (!loadingLabel) return element\n // Kept mounted so screen readers notice when the text appears.\n return (\n <>\n {element}\n <span role=\"status\" className={visuallyHidden}>\n {loading ? loadingLabel : ''}\n </span>\n </>\n )\n}\n"],"mappings":";;;;;;;;AAqCA,SAAgBG,EAAO,EACrB,aAAU,WACV,UAAO,MACP,SACA,cAAW,IACX,eAAY,IACZ,aAAU,IACV,iBACA,cAAW,IACX,UAAO,UACP,WACA,cACA,aACA,YACA,GAAGC,KACW;CACd,IAAMC,IAAW,CAACC,GACZC,IAAWC,KAAYC,GACvBC,IAAWD,KAAW,CAAC,CAACE,GAUxBC,IAAUC,EAAU;EACxB,gBAAgB;EAChB;EACA,OAAOC,EACL;GACE,MAAMT,IAAWU,IAAO,KAAA;GAExB,UAAUV,KAAYG,KAAY,CAACC;GACnC,iBAAiBF,KAAY,KAAA;GAC7B,aAAaE,KAAW,KAAA;GACxB,WAAWO,EAAKhB,EAAc;IAAE;IAAS;IAAM;IAAU;GAAU,CAAC,GAAGkB,CAAS;GAChF,UAnBe,MAAyC;IAC5D,AAAIX,IACFY,EAAM,eAAe,IAGvBC,IAAUD,CAAK;GACjB;GAcM,UACE,kBAAAlB,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;IACE,WAAWe,EAAKd,GAAgBO,KAAW,SAAa;IACxD,eAAaC,KAAY,KAAA;IAF3B,UAAA,CAIGa,GACAC,IAAW,kBAAC,QAAD;KAAM,WAAWC;KAAiB;IAAe,CAAA,IAAIC,CAC7D;GACL,CAAA,GAAAjB,KACC,kBAAC,QAAD;IAAM,WAAW;IAAjB,UAAA,CACE,kBAACkB,GAAD;KAAQ,MAAMC,MAAS,OAAO,WAAW;KAAO,OAAO;IAAO,CAAA,GAC7DlB,KAAY,kBAAC,QAAD;KAAM,WAAA;KAA4B,UAAAC;IAAmB,CAAA,CAC9D;GAER,CAAA,CAAA,EAAA,CAAA;EAEN,GACAP,CACF;CACF,CAAC;CAID,OAFKO,IAGH,kBAAAV,GAAA,EAAA,UAAA,CACGW,GACD,kBAAC,QAAD;EAAM,MAAK;EAAS,WAAWa;EAC5B,UAAAhB,IAAUE,IAAe;CACtB,CAAA,CACN,EAAA,CAAA,IARsBC;AAU5B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
4
|
+
// src/components/Button/Button.css.ts
|
|
5
|
+
var t = e({
|
|
6
|
+
defaultClassName: "okkfzz0 tyvs8e0",
|
|
7
|
+
variantClassNames: {
|
|
8
|
+
variant: {
|
|
9
|
+
primary: "okkfzz1",
|
|
10
|
+
secondary: "okkfzz2",
|
|
11
|
+
ghost: "okkfzz3",
|
|
12
|
+
danger: "okkfzz4"
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
sm: "okkfzz5",
|
|
16
|
+
md: "okkfzz6"
|
|
17
|
+
},
|
|
18
|
+
iconOnly: { true: "okkfzz7" },
|
|
19
|
+
fullWidth: { true: "okkfzz8" }
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "primary",
|
|
23
|
+
size: "md"
|
|
24
|
+
},
|
|
25
|
+
compoundVariants: []
|
|
26
|
+
}), n = "okkfzz9", r = "okkfzza", i = "okkfzzb";
|
|
27
|
+
export { t as button, n as content, r as hidden, i as overlay };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=Button.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.styles.js","names":["_7a468","button","createRuntimeFn","content","hidden","overlay"],"sources":["../../../src/components/Button/Button.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css'\nimport { recipe, type RecipeVariants } from '@vanilla-extract/recipes'\n\nimport { focusRing } from '../../styles/shared.css'\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\nexport const button = recipe({\n base: [\n focusRing,\n {\n position: 'relative',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: space['2'],\n margin: 0,\n border: '1px solid transparent',\n borderRadius: radius.lg,\n fontFamily: vars.font.sans,\n fontWeight: fontWeight.medium,\n lineHeight: 1.25,\n whiteSpace: 'nowrap',\n textDecoration: 'none',\n cursor: 'pointer',\n userSelect: 'none',\n transition: 'background-color 120ms, border-color 120ms, color 120ms',\n selectors: {\n '&[aria-disabled=\"true\"]': {\n cursor: 'not-allowed',\n color: vars.color.inkSubtle,\n backgroundColor: vars.color.surfaceSunken,\n borderColor: vars.color.border,\n },\n },\n },\n ],\n variants: {\n variant: {\n primary: {\n backgroundColor: vars.color.primary,\n color: vars.color.onPrimary,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.primaryHover },\n },\n },\n secondary: {\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n borderColor: vars.color.borderStrong,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.surfaceHover },\n },\n },\n ghost: {\n backgroundColor: 'transparent',\n color: vars.color.ink,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.surfaceHover },\n '&[aria-disabled=\"true\"]': { backgroundColor: 'transparent', borderColor: 'transparent' },\n },\n },\n danger: {\n backgroundColor: vars.color.surface,\n color: vars.color.dangerInk,\n borderColor: vars.color.borderStrong,\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': { backgroundColor: vars.color.dangerSubtle },\n },\n },\n },\n size: {\n sm: { minHeight: '2rem', paddingInline: space['3'], fontSize: fontSize.sm },\n md: { minHeight: '2.75rem', paddingInline: space['5'], fontSize: fontSize.lg },\n },\n iconOnly: {\n true: { paddingInline: 0, aspectRatio: '1' },\n },\n fullWidth: {\n true: { width: '100%' },\n },\n },\n defaultVariants: { variant: 'primary', size: 'md' },\n})\n\nexport type ButtonVariants = NonNullable<RecipeVariants<typeof button>>\n\nexport const content = style({ display: 'inline-flex', alignItems: 'center', gap: space['2'] })\nexport const hidden = style({ opacity: 0 })\nexport const overlay = style({\n position: 'absolute',\n inset: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: space['2'],\n})\n"],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RecipeVariants } from '@vanilla-extract/recipes';
|
|
2
|
+
declare const padY: `var(--${string})`;
|
|
3
|
+
declare const padX: `var(--${string})`;
|
|
4
|
+
declare const cardRadius: `var(--${string})`;
|
|
5
|
+
export declare const card: import('@vanilla-extract/recipes').RuntimeFn<{
|
|
6
|
+
size: {
|
|
7
|
+
sm: {
|
|
8
|
+
vars: {
|
|
9
|
+
[padY]: string;
|
|
10
|
+
[padX]: string;
|
|
11
|
+
[cardRadius]: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
md: {
|
|
15
|
+
vars: {
|
|
16
|
+
[padY]: string;
|
|
17
|
+
[padX]: string;
|
|
18
|
+
[cardRadius]: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
flush: {
|
|
23
|
+
true: {
|
|
24
|
+
vars: {
|
|
25
|
+
[padY]: string;
|
|
26
|
+
[padX]: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
export type CardVariants = NonNullable<RecipeVariants<typeof card>>;
|
|
32
|
+
export declare const header: string;
|
|
33
|
+
export declare const heading: string;
|
|
34
|
+
export declare const actions: string;
|
|
35
|
+
export declare const headings: string;
|
|
36
|
+
export declare const description: string;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
export interface CardProps extends ComponentProps<'section'> {
|
|
4
|
+
/** `sm` has tighter padding, e.g. for cards inside other content. */
|
|
5
|
+
size?: 'sm' | 'md';
|
|
6
|
+
/** Remove the padding, e.g. for a table that fills the card. */
|
|
7
|
+
flush?: boolean;
|
|
8
|
+
/** Header content. A string is rendered as an `h2`; pass your own element to pick the level. */
|
|
9
|
+
heading?: ReactNode;
|
|
10
|
+
/** Muted subtitle under the heading. */
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
/** Controls shown at the end of the header, e.g. buttons. */
|
|
13
|
+
actions?: ReactNode;
|
|
14
|
+
/** Render a different element instead of `<section>`, e.g. `render={<aside />}`. */
|
|
15
|
+
render?: useRender.RenderProp;
|
|
16
|
+
}
|
|
17
|
+
/** Surface that groups related content, with an optional heading and actions. Use `flush` for edge-to-edge content like tables. */
|
|
18
|
+
export declare function Card({ size, flush, heading, description, actions, render, className, children, ...props }: CardProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { card as e, heading as t } from "./Card.styles.js";
|
|
2
|
+
import { clsx as n } from "clsx";
|
|
3
|
+
import { mergeProps as r } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender as i } from "@base-ui/react/use-render";
|
|
5
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
// src/components/Card/Card.tsx
|
|
7
|
+
function c({ size: c = "md", flush: l = !1, heading: u, description: d, actions: f, render: p, className: m, children: h, ...g }) {
|
|
8
|
+
let _ = u != null || d != null || f != null, v = typeof u == "string" ? /* @__PURE__ */ o("h2", {
|
|
9
|
+
className: t,
|
|
10
|
+
children: u
|
|
11
|
+
}) : u;
|
|
12
|
+
return i({
|
|
13
|
+
defaultTagName: "section",
|
|
14
|
+
render: p,
|
|
15
|
+
props: r({
|
|
16
|
+
className: n(e({
|
|
17
|
+
size: c,
|
|
18
|
+
flush: l
|
|
19
|
+
}), m),
|
|
20
|
+
children: /* @__PURE__ */ s(a, { children: [_ && /* @__PURE__ */ s("header", {
|
|
21
|
+
className: "z3ah6k7",
|
|
22
|
+
children: [d == null ? v : /* @__PURE__ */ s("div", {
|
|
23
|
+
className: "z3ah6ka",
|
|
24
|
+
children: [v, /* @__PURE__ */ o("div", {
|
|
25
|
+
className: "z3ah6kb",
|
|
26
|
+
children: d
|
|
27
|
+
})]
|
|
28
|
+
}), f && /* @__PURE__ */ o("div", {
|
|
29
|
+
className: "z3ah6k9",
|
|
30
|
+
children: f
|
|
31
|
+
})]
|
|
32
|
+
}), h] })
|
|
33
|
+
}, g)
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export { c as Card };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","names":["heading","description","actions","styles.heading","styles.card","_Fragment","Card","heading$1","description$1","actions$1","props","hasHeader","headingEl","heading","useRender","mergeProps","clsx","card","className","Fragment","children"],"sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport { clsx } from 'clsx'\nimport type { ComponentProps, ReactNode } from 'react'\n\nimport * as styles from './Card.css'\n\nexport interface CardProps extends ComponentProps<'section'> {\n /** `sm` has tighter padding, e.g. for cards inside other content. */\n size?: 'sm' | 'md'\n /** Remove the padding, e.g. for a table that fills the card. */\n flush?: boolean\n /** Header content. A string is rendered as an `h2`; pass your own element to pick the level. */\n heading?: ReactNode\n /** Muted subtitle under the heading. */\n description?: ReactNode\n /** Controls shown at the end of the header, e.g. buttons. */\n actions?: ReactNode\n /** Render a different element instead of `<section>`, e.g. `render={<aside />}`. */\n render?: useRender.RenderProp\n}\n\n/** Surface that groups related content, with an optional heading and actions. Use `flush` for edge-to-edge content like tables. */\nexport function Card({\n size = 'md',\n flush = false,\n heading,\n description,\n actions,\n render,\n className,\n children,\n ...props\n}: CardProps) {\n const hasHeader = heading != null || description != null || actions != null\n const headingEl =\n typeof heading === 'string' ? <h2 className={styles.heading}>{heading}</h2> : heading\n return useRender({\n defaultTagName: 'section',\n render,\n props: mergeProps<'section'>(\n {\n className: clsx(styles.card({ size, flush }), className),\n children: (\n <>\n {hasHeader && (\n <header className={styles.header}>\n {description != null ? (\n <div className={styles.headings}>\n {headingEl}\n <div className={styles.description}>{description}</div>\n </div>\n ) : (\n headingEl\n )}\n {actions && <div className={styles.actions}>{actions}</div>}\n </header>\n )}\n {children}\n </>\n ),\n },\n props,\n ),\n })\n}\n"],"mappings":";;;;;;AAuBA,SAAgBM,EAAK,EACnB,UAAO,MACP,WAAQ,IACR,SAAAC,GACA,aAAAC,GACA,SAAAC,GACA,WACA,cACA,aACA,GAAGC,KACS;CACZ,IAAMC,IAAYX,KAAW,QAAQC,KAAe,QAAQC,KAAW,MACjEU,IACJ,OAAOZ,KAAY,WAAW,kBAAC,MAAD;EAAI,WAAWG;EAAiB,UAAAH;CAAY,CAAA,IAAIA;CAChF,OAAOc,EAAU;EACf,gBAAgB;EAChB;EACA,OAAOC,EACL;GACE,WAAWC,EAAKZ,EAAY;IAAE;IAAM;GAAM,CAAC,GAAGc,CAAS;GACvD,UACE,kBAAAb,GAAA,EAAA,UAAA,CACGM,KACC,kBAAC,UAAD;IAAQ,WAAW;IAAnB,UAAA,CACGV,KAAe,OAMdW,IALA,kBAAC,OAAD;KAAK,WAAW;KAAhB,UAAA,CACGA,GACD,kBAAC,OAAD;MAAK,WAAW;MAAqB,UAAAX;KAAiB,CAAA,CACnD;IAEL,CAAA,GAEDC,KAAW,kBAAC,OAAD;KAAK,WAAW;KAAiB,UAAAA;IAAa,CAAA,CACpD;GAET,CAAA,GAAAkB,CACD,EAAA,CAAA;EAEN,GACAV,CACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
// src/components/Card/Card.css.ts
|
|
4
|
+
var t = e({
|
|
5
|
+
defaultClassName: "z3ah6k3",
|
|
6
|
+
variantClassNames: {
|
|
7
|
+
size: {
|
|
8
|
+
sm: "z3ah6k4",
|
|
9
|
+
md: "z3ah6k5"
|
|
10
|
+
},
|
|
11
|
+
flush: { true: "z3ah6k6" }
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: { size: "md" },
|
|
14
|
+
compoundVariants: []
|
|
15
|
+
}), n = "z3ah6k7", r = "z3ah6k8", i = "z3ah6k9", a = "z3ah6ka", o = "z3ah6kb";
|
|
16
|
+
export { i as actions, t as card, o as description, n as header, r as heading, a as headings };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=Card.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.styles.js","names":["_7a468","card","createRuntimeFn","header","heading","actions","headings","description"],"sources":["../../../src/components/Card/Card.css.ts"],"sourcesContent":["import { createVar, style } from '@vanilla-extract/css'\nimport { recipe, type RecipeVariants } from '@vanilla-extract/recipes'\n\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\n// Separate so the header can bleed to the card's edges whatever the padding.\nconst padY = createVar()\nconst padX = createVar()\nconst cardRadius = createVar()\n\nexport const card = recipe({\n base: {\n boxSizing: 'border-box',\n minWidth: 0,\n padding: `${padY} ${padX}`,\n borderRadius: cardRadius,\n border: `1px solid ${vars.color.border}`,\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n fontFamily: vars.font.sans,\n },\n variants: {\n size: {\n sm: { vars: { [padY]: space['4'], [padX]: space['4'], [cardRadius]: radius.xl } },\n md: { vars: { [padY]: space['6'], [padX]: space['6'], [cardRadius]: radius.xl } },\n },\n flush: { true: { vars: { [padY]: '0', [padX]: '0' } } },\n },\n defaultVariants: { size: 'md' },\n})\n\nexport type CardVariants = NonNullable<RecipeVariants<typeof card>>\n\nexport const header = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: space['3'],\n margin: `calc(${padY} * -1) calc(${padX} * -1) ${padY}`,\n padding: `${space['3']} ${space['6']}`,\n borderBottom: `1px solid ${vars.color.border}`,\n borderStartStartRadius: cardRadius,\n borderStartEndRadius: cardRadius,\n backgroundColor: vars.color.surfaceSunken,\n})\n\nexport const heading = style({\n margin: 0,\n fontSize: fontSize.md,\n fontWeight: fontWeight.semibold,\n color: vars.color.ink,\n})\n\nexport const actions = style({ display: 'flex', alignItems: 'center', gap: space['2'] })\n\nexport const headings = style({ minWidth: 0 })\n\nexport const description = style({\n margin: 0,\n marginTop: space['0.5'],\n fontSize: fontSize.sm,\n color: vars.color.inkMuted,\n})\n"],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const root: string;
|
|
2
|
+
export declare const message: string;
|
|
3
|
+
export declare const avatar: string;
|
|
4
|
+
export declare const body: string;
|
|
5
|
+
export declare const name: string;
|
|
6
|
+
export declare const row: string;
|
|
7
|
+
export declare const content: string;
|
|
8
|
+
export declare const actions: string;
|
|
9
|
+
export declare const bubble: string;
|
|
10
|
+
export declare const meta: string;
|
|
11
|
+
export declare const divider: string;
|
|
12
|
+
export declare const dividerContent: string;
|
|
13
|
+
export declare const dots: string;
|
|
14
|
+
export declare const dot: string;
|
|
15
|
+
export declare const empty: string;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { DataAttributes } from '../Field/Field';
|
|
3
|
+
export type ChatRole = 'user' | 'assistant' | 'system';
|
|
4
|
+
/** Speaker names read out before each message, e.g. "Assistant: Hello". */
|
|
5
|
+
export interface ChatTranscriptLabels {
|
|
6
|
+
user?: string;
|
|
7
|
+
assistant?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ChatTranscriptRootProps extends ComponentProps<'div'> {
|
|
10
|
+
/** Accessible name of the log. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Announce new messages to screen readers (`aria-live="polite"`). Off by default. */
|
|
13
|
+
live?: boolean;
|
|
14
|
+
/** Speaker names for screen readers. Defaults: "You" and "Assistant". */
|
|
15
|
+
labels?: ChatTranscriptLabels;
|
|
16
|
+
}
|
|
17
|
+
/** The `role="log"` container. Holds `Message`, `Divider` and `Typing` parts. */
|
|
18
|
+
declare function Root({ label, live, labels, className, children, ...props }: ChatTranscriptRootProps): import('react').JSX.Element;
|
|
19
|
+
export interface ChatTranscriptMessageProps extends ComponentProps<'div'> {
|
|
20
|
+
/** Who said it. `user` sits on the right, `assistant` on the left. */
|
|
21
|
+
speaker: Exclude<ChatRole, 'system'>;
|
|
22
|
+
/** Visible speaker name, shown at the start of a group. */
|
|
23
|
+
name?: ReactNode;
|
|
24
|
+
/** Avatar (e.g. `<Avatar size="sm" />`), shown at the start of a group. Decorative. */
|
|
25
|
+
avatar?: ReactNode;
|
|
26
|
+
/** Follows a message from the same speaker: tighter spacing, no name or avatar. */
|
|
27
|
+
continued?: boolean;
|
|
28
|
+
/** Controls shown beside the content on hover or focus, e.g. a "Turn details" button. */
|
|
29
|
+
actions?: ReactNode;
|
|
30
|
+
/** Screen-reader speaker name. Defaults to `name` when it's a string, else the Root `labels`. */
|
|
31
|
+
speakerLabel?: string;
|
|
32
|
+
}
|
|
33
|
+
/** One message. Put a `Bubble` (and optionally `Meta`) inside. */
|
|
34
|
+
declare function Message({ speaker, name, avatar, continued, actions, speakerLabel, className, children, ...props }: ChatTranscriptMessageProps): import('react').JSX.Element;
|
|
35
|
+
export type ChatTranscriptBubbleProps = ComponentProps<'div'>;
|
|
36
|
+
/**
|
|
37
|
+
* The message bubble. Long text wraps, and `<pre>` blocks scroll sideways. Each `<pre>` is made
|
|
38
|
+
* focusable so keyboard users can scroll it.
|
|
39
|
+
*/
|
|
40
|
+
declare function Bubble({ className, ref, ...props }: ChatTranscriptBubbleProps): import('react').JSX.Element;
|
|
41
|
+
export type ChatTranscriptMetaProps = ComponentProps<'div'>;
|
|
42
|
+
/** Muted line under a bubble for timestamps and IDs. `<code>` inside it is set in mono. */
|
|
43
|
+
declare function Meta({ className, ...props }: ChatTranscriptMetaProps): import('react').JSX.Element;
|
|
44
|
+
export type ChatTranscriptDividerProps = ComponentProps<'div'>;
|
|
45
|
+
/** A neutral, centred event line, e.g. "Conversation started" or a tool call. */
|
|
46
|
+
declare function Divider({ className, children, ...props }: ChatTranscriptDividerProps): import('react').JSX.Element;
|
|
47
|
+
export interface ChatTranscriptTypingProps extends Omit<ChatTranscriptMessageProps, 'speaker' | 'children' | 'actions'> {
|
|
48
|
+
/** Text for screen readers. */
|
|
49
|
+
label?: string;
|
|
50
|
+
}
|
|
51
|
+
/** The assistant's typing indicator. The dots hold still when reduced motion is set. */
|
|
52
|
+
declare function Typing({ label, ...props }: ChatTranscriptTypingProps): import('react').JSX.Element;
|
|
53
|
+
export interface ChatMessage {
|
|
54
|
+
id: string;
|
|
55
|
+
role: ChatRole;
|
|
56
|
+
/** Text, markdown output, product cards, buttons… */
|
|
57
|
+
content: ReactNode;
|
|
58
|
+
/** Shown in the muted line under the bubble (or inline for `system`). */
|
|
59
|
+
timestamp?: ReactNode;
|
|
60
|
+
/** Extra muted details, e.g. a turn ID in `<code>`. */
|
|
61
|
+
meta?: ReactNode;
|
|
62
|
+
/** Per-message controls, shown on hover or focus. Ignored for `system`. */
|
|
63
|
+
actions?: ReactNode;
|
|
64
|
+
/** Props for the message element, e.g. `{ 'data-testid': 'turn-3' }`. */
|
|
65
|
+
messageProps?: Omit<ComponentProps<'div'>, 'role'> & DataAttributes;
|
|
66
|
+
}
|
|
67
|
+
export interface ChatTranscriptProps extends Omit<ChatTranscriptRootProps, 'children'> {
|
|
68
|
+
messages: ChatMessage[];
|
|
69
|
+
/** Visible assistant name, e.g. "Humara". Defaults to the `labels.assistant` name ("Assistant"), so replies are always marked. */
|
|
70
|
+
assistantName?: ReactNode;
|
|
71
|
+
/** Assistant avatar, e.g. `<Avatar size="sm" name="Humara" />`. */
|
|
72
|
+
assistantAvatar?: ReactNode;
|
|
73
|
+
/** Show the assistant typing indicator at the end. */
|
|
74
|
+
typing?: boolean;
|
|
75
|
+
/** Screen-reader text for the typing indicator. */
|
|
76
|
+
typingLabel?: string;
|
|
77
|
+
/** Shown when there are no messages. */
|
|
78
|
+
empty?: ReactNode;
|
|
79
|
+
}
|
|
80
|
+
declare function ChatTranscriptComponent({ messages, labels, assistantName, assistantAvatar, typing, typingLabel, empty, ...props }: ChatTranscriptProps): import('react').JSX.Element;
|
|
81
|
+
/**
|
|
82
|
+
* A conversation between a shopper and the assistant. Pass `messages`, or compose
|
|
83
|
+
* `ChatTranscript.Root`, `.Message`, `.Bubble`, `.Meta`, `.Divider` and `.Typing` for custom
|
|
84
|
+
* layouts. Consecutive messages from the same speaker group together.
|
|
85
|
+
*/
|
|
86
|
+
export declare const ChatTranscript: typeof ChatTranscriptComponent & {
|
|
87
|
+
Root: typeof Root;
|
|
88
|
+
Message: typeof Message;
|
|
89
|
+
Bubble: typeof Bubble;
|
|
90
|
+
Meta: typeof Meta;
|
|
91
|
+
Divider: typeof Divider;
|
|
92
|
+
Typing: typeof Typing;
|
|
93
|
+
};
|
|
94
|
+
export {};
|