@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,69 @@
|
|
|
1
|
+
import { Tabs as BaseTabs } from '@base-ui/react/tabs';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { PartProps } from '../Field/Field';
|
|
4
|
+
type ClassName = {
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
/** Typed value props: `Value` is a union of tab values, e.g. `'general' | 'advanced'`. */
|
|
8
|
+
export interface TabsValueProps<Value extends string = string> {
|
|
9
|
+
/** The active tab's value (controlled). */
|
|
10
|
+
value?: Value;
|
|
11
|
+
/** The tab active at first (uncontrolled). */
|
|
12
|
+
defaultValue?: Value;
|
|
13
|
+
/** Called with the newly active tab's value. */
|
|
14
|
+
onValueChange?: (value: Value, eventDetails: BaseTabs.Root.ChangeEventDetails) => void;
|
|
15
|
+
}
|
|
16
|
+
export type TabsRootProps<Value extends string = string> = Omit<BaseTabs.Root.Props, 'className' | keyof TabsValueProps> & TabsValueProps<Value> & ClassName;
|
|
17
|
+
export type TabsListProps = Omit<BaseTabs.List.Props, 'className'> & ClassName;
|
|
18
|
+
export type TabsPanelProps = Omit<BaseTabs.Panel.Props, 'className'> & ClassName;
|
|
19
|
+
export interface TabsTabProps extends Omit<BaseTabs.Tab.Props, 'className'>, ClassName {
|
|
20
|
+
/** Shown muted after the label, e.g. the number of items in the panel. */
|
|
21
|
+
count?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare function Root<Value extends string = string>({ className, ...props }: TabsRootProps<Value>): import('react').JSX.Element;
|
|
24
|
+
/** The tab row. Includes the accent underline indicator. */
|
|
25
|
+
declare function List({ className, children, activateOnFocus, ...props }: TabsListProps): import('react').JSX.Element;
|
|
26
|
+
declare function Tab({ className, count, children, ...props }: TabsTabProps): import('react').JSX.Element;
|
|
27
|
+
declare function Panel({ className, ...props }: TabsPanelProps): import('react').JSX.Element;
|
|
28
|
+
export interface TabItem<Value extends string = string> {
|
|
29
|
+
/** Unique key, used by `value`/`defaultValue`/`onValueChange`. */
|
|
30
|
+
value: Value;
|
|
31
|
+
/** Tab text. */
|
|
32
|
+
label: ReactNode;
|
|
33
|
+
/** Shown muted after the label, e.g. the number of items in the panel. */
|
|
34
|
+
count?: ReactNode;
|
|
35
|
+
/** The panel shown while this tab is active. */
|
|
36
|
+
content: ReactNode;
|
|
37
|
+
/** Can't be selected. */
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/** Keeps this panel in the DOM (hidden) while another tab is active. Overrides the `Tabs` prop. */
|
|
40
|
+
keepMounted?: boolean;
|
|
41
|
+
/** Props for the tab (role `tab`), e.g. `{ 'data-testid': 'tab-config' }`. */
|
|
42
|
+
tabProps?: PartProps<BaseTabs.Tab.Props>;
|
|
43
|
+
/** Props for the panel (role `tabpanel`). */
|
|
44
|
+
panelProps?: PartProps<BaseTabs.Panel.Props>;
|
|
45
|
+
}
|
|
46
|
+
export interface TabsProps<Value extends string = string> extends Omit<TabsRootProps<Value>, 'children'> {
|
|
47
|
+
/** The tabs, in order. The first enabled one is selected unless `value`/`defaultValue` says otherwise. */
|
|
48
|
+
items: TabItem<Value>[];
|
|
49
|
+
/**
|
|
50
|
+
* Keeps hidden panels in the DOM, so form fields in other tabs stay registered and keep their
|
|
51
|
+
* state. Panels unmount while hidden by default.
|
|
52
|
+
*/
|
|
53
|
+
keepMounted?: boolean;
|
|
54
|
+
/** Props for the tab row (role `tablist`). */
|
|
55
|
+
listProps?: PartProps<BaseTabs.List.Props>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Underline tabs. Pass `items`, or compose `Tabs.Root`, `Tabs.List`, `Tabs.Tab` and `Tabs.Panel`.
|
|
59
|
+
* Defaults to the first enabled item.
|
|
60
|
+
*/
|
|
61
|
+
declare function TabsComponent<Value extends string = string>({ items, defaultValue, keepMounted, listProps, ...props }: TabsProps<Value>): import('react').JSX.Element;
|
|
62
|
+
/** Underline tabs with optional counts ("Conversation 13"). Pass `items`, or compose `Tabs.Root`, `Tabs.List`, `Tabs.Tab` and `Tabs.Panel`. */
|
|
63
|
+
export declare const Tabs: typeof TabsComponent & {
|
|
64
|
+
Root: typeof Root;
|
|
65
|
+
List: typeof List;
|
|
66
|
+
Tab: typeof Tab;
|
|
67
|
+
Panel: typeof Panel;
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { indicator as e, list as t, panel as n, root as r, tab as i } from "./Tabs.styles.js";
|
|
2
|
+
import { createElement as a } from "react";
|
|
3
|
+
import { clsx as o } from "clsx";
|
|
4
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
import { Tabs as l } from "@base-ui/react/tabs";
|
|
6
|
+
// src/components/Tabs/Tabs.tsx
|
|
7
|
+
function u({ className: e, ...t }) {
|
|
8
|
+
return /* @__PURE__ */ s(l.Root, {
|
|
9
|
+
className: o(r, e),
|
|
10
|
+
...t
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function d({ className: n, children: r, activateOnFocus: i = !0, ...a }) {
|
|
14
|
+
return /* @__PURE__ */ c(l.List, {
|
|
15
|
+
className: o(t, n),
|
|
16
|
+
activateOnFocus: i,
|
|
17
|
+
...a,
|
|
18
|
+
children: [r, /* @__PURE__ */ s(l.Indicator, { className: e })]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function f({ className: e, count: t, children: n, ...r }) {
|
|
22
|
+
return /* @__PURE__ */ c(l.Tab, {
|
|
23
|
+
className: o(i, e),
|
|
24
|
+
...r,
|
|
25
|
+
children: [n, t != null && /* @__PURE__ */ s("span", {
|
|
26
|
+
className: "_5ocgjx3",
|
|
27
|
+
children: t
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function p({ className: e, ...t }) {
|
|
32
|
+
return /* @__PURE__ */ s(l.Panel, {
|
|
33
|
+
className: o(n, e),
|
|
34
|
+
...t
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function m({ items: e, defaultValue: t, keepMounted: n = !1, listProps: r, ...i }) {
|
|
38
|
+
let o = t ?? e.find((e) => !e.disabled)?.value;
|
|
39
|
+
return /* @__PURE__ */ c(u, {
|
|
40
|
+
defaultValue: o,
|
|
41
|
+
...i,
|
|
42
|
+
children: [/* @__PURE__ */ s(d, {
|
|
43
|
+
...r,
|
|
44
|
+
children: e.map((e) => /* @__PURE__ */ a(f, {
|
|
45
|
+
...e.tabProps,
|
|
46
|
+
key: e.value,
|
|
47
|
+
value: e.value,
|
|
48
|
+
count: e.count,
|
|
49
|
+
disabled: e.disabled
|
|
50
|
+
}, e.label))
|
|
51
|
+
}), e.map((e) => /* @__PURE__ */ a(p, {
|
|
52
|
+
...e.panelProps,
|
|
53
|
+
key: e.value,
|
|
54
|
+
value: e.value,
|
|
55
|
+
keepMounted: e.keepMounted ?? n
|
|
56
|
+
}, e.content))]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
var h = Object.assign(m, {
|
|
60
|
+
Root: u,
|
|
61
|
+
List: d,
|
|
62
|
+
Tab: f,
|
|
63
|
+
Panel: p
|
|
64
|
+
});
|
|
65
|
+
export { h as Tabs };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=Tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.js","names":["BaseTabs","styles.root","styles.list","styles.indicator","styles.tab","count","styles.panel","Tabs","Root","props","Tabs","clsx","root","className","List","list","children","indicator","Tab","count$1","tab","Panel","panel","TabsComponent","initial","defaultValue","items","item","listProps","keepMounted","Tabs$1"],"sources":["../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport { clsx } from 'clsx'\nimport type { ReactNode } from 'react'\n\nimport * as styles from './Tabs.css'\nimport type { PartProps } from '../Field/Field'\n\ntype ClassName = { className?: string }\n\n/** Typed value props: `Value` is a union of tab values, e.g. `'general' | 'advanced'`. */\nexport interface TabsValueProps<Value extends string = string> {\n /** The active tab's value (controlled). */\n value?: Value\n /** The tab active at first (uncontrolled). */\n defaultValue?: Value\n /** Called with the newly active tab's value. */\n onValueChange?: (value: Value, eventDetails: BaseTabs.Root.ChangeEventDetails) => void\n}\n\nexport type TabsRootProps<Value extends string = string> = Omit<\n BaseTabs.Root.Props,\n 'className' | keyof TabsValueProps\n> &\n TabsValueProps<Value> &\n ClassName\nexport type TabsListProps = Omit<BaseTabs.List.Props, 'className'> & ClassName\nexport type TabsPanelProps = Omit<BaseTabs.Panel.Props, 'className'> & ClassName\nexport interface TabsTabProps extends Omit<BaseTabs.Tab.Props, 'className'>, ClassName {\n /** Shown muted after the label, e.g. the number of items in the panel. */\n count?: ReactNode\n}\n\nfunction Root<Value extends string = string>({ className, ...props }: TabsRootProps<Value>) {\n return <BaseTabs.Root className={clsx(styles.root, className)} {...props} />\n}\n\n/** The tab row. Includes the accent underline indicator. */\nfunction List({ className, children, activateOnFocus = true, ...props }: TabsListProps) {\n return (\n <BaseTabs.List\n className={clsx(styles.list, className)}\n activateOnFocus={activateOnFocus}\n {...props}\n >\n {children}\n <BaseTabs.Indicator className={styles.indicator} />\n </BaseTabs.List>\n )\n}\n\nfunction Tab({ className, count, children, ...props }: TabsTabProps) {\n return (\n <BaseTabs.Tab className={clsx(styles.tab, className)} {...props}>\n {children}\n {count != null && <span className={styles.count}>{count}</span>}\n </BaseTabs.Tab>\n )\n}\n\nfunction Panel({ className, ...props }: TabsPanelProps) {\n return <BaseTabs.Panel className={clsx(styles.panel, className)} {...props} />\n}\n\nexport interface TabItem<Value extends string = string> {\n /** Unique key, used by `value`/`defaultValue`/`onValueChange`. */\n value: Value\n /** Tab text. */\n label: ReactNode\n /** Shown muted after the label, e.g. the number of items in the panel. */\n count?: ReactNode\n /** The panel shown while this tab is active. */\n content: ReactNode\n /** Can't be selected. */\n disabled?: boolean\n /** Keeps this panel in the DOM (hidden) while another tab is active. Overrides the `Tabs` prop. */\n keepMounted?: boolean\n /** Props for the tab (role `tab`), e.g. `{ 'data-testid': 'tab-config' }`. */\n tabProps?: PartProps<BaseTabs.Tab.Props>\n /** Props for the panel (role `tabpanel`). */\n panelProps?: PartProps<BaseTabs.Panel.Props>\n}\n\nexport interface TabsProps<Value extends string = string> extends Omit<\n TabsRootProps<Value>,\n 'children'\n> {\n /** The tabs, in order. The first enabled one is selected unless `value`/`defaultValue` says otherwise. */\n items: TabItem<Value>[]\n /**\n * Keeps hidden panels in the DOM, so form fields in other tabs stay registered and keep their\n * state. Panels unmount while hidden by default.\n */\n keepMounted?: boolean\n /** Props for the tab row (role `tablist`). */\n listProps?: PartProps<BaseTabs.List.Props>\n}\n\n/**\n * Underline tabs. Pass `items`, or compose `Tabs.Root`, `Tabs.List`, `Tabs.Tab` and `Tabs.Panel`.\n * Defaults to the first enabled item.\n */\nfunction TabsComponent<Value extends string = string>({\n items,\n defaultValue,\n keepMounted = false,\n listProps,\n ...props\n}: TabsProps<Value>) {\n const initial = defaultValue ?? items.find((item) => !item.disabled)?.value\n return (\n <Root<Value> defaultValue={initial} {...props}>\n <List {...listProps}>\n {items.map((item) => (\n <Tab\n {...item.tabProps}\n key={item.value}\n value={item.value}\n count={item.count}\n disabled={item.disabled}\n >\n {item.label}\n </Tab>\n ))}\n </List>\n {items.map((item) => (\n <Panel\n {...item.panelProps}\n key={item.value}\n value={item.value}\n keepMounted={item.keepMounted ?? keepMounted}\n >\n {item.content}\n </Panel>\n ))}\n </Root>\n )\n}\n\n/** Underline tabs with optional counts (\"Conversation 13\"). Pass `items`, or compose `Tabs.Root`, `Tabs.List`, `Tabs.Tab` and `Tabs.Panel`. */\nexport const Tabs = Object.assign(TabsComponent, { Root, List, Tab, Panel })\n"],"mappings":";;;;;;AAgCA,SAASQ,EAAoC,EAAE,cAAW,GAAGC,KAA+B;CAC1F,OAAO,kBAACT,EAAS,MAAV;EAAe,WAAWW,EAAKV,GAAaY,CAAS;EAAG,GAAIJ;CAAQ,CAAA;AAC7E;AAGA,SAASK,EAAK,EAAE,cAAW,aAAU,qBAAkB,IAAM,GAAGL,KAAwB;CACtF,OACE,kBAACT,EAAS,MAAV;EACE,WAAWW,EAAKT,GAAaW,CAAS;EACrB;EACjB,GAAIJ;EAHN,UAAA,CAKGO,GACD,kBAAChB,EAAS,WAAV,EAAoB,WAAWG,EAAmB,CAAA,CACrC;;AAEnB;AAEA,SAASe,EAAI,EAAE,cAAW,OAAAC,GAAO,aAAU,GAAGV,KAAuB;CACnE,OACE,kBAACT,EAAS,KAAV;EAAc,WAAWW,EAAKP,GAAYS,CAAS;EAAG,GAAIJ;EAA1D,UAAA,CACGO,GACAX,KAAS,QAAQ,kBAAC,QAAD;GAAM,WAAW;GAAe,UAAAA;EAAY,CAAA,CAClD;;AAElB;AAEA,SAASgB,EAAM,EAAE,cAAW,GAAGZ,KAAyB;CACtD,OAAO,kBAACT,EAAS,OAAV;EAAgB,WAAWW,EAAKL,GAAcO,CAAS;EAAG,GAAIJ;CAAQ,CAAA;AAC/E;AAwCA,SAASc,EAA6C,EACpD,UACA,iBACA,iBAAc,IACd,cACA,GAAGd,KACgB;CACnB,IAAMe,IAAUC,KAAgBC,EAAM,MAAM,MAAS,CAACC,EAAK,QAAQ,CAAC,EAAE;CACtE,OACE,kBAACnB,GAAD;EAAa,cAAcgB;EAAS,GAAIf;EAAxC,UAAA,CACE,kBAACK,GAAD;GAAM,GAAIc;GACP,UAAAF,EAAM,KAAK,MACV,kBAACR,GAAD;IACE,GAAIS,EAAK;IACT,KAAKA,EAAK;IACV,OAAOA,EAAK;IACZ,OAAOA,EAAK;IACZ,UAAUA,EAAK;GAGZ,GADFA,EAAK,KACH,CACN;EACG,CAAA,GACLD,EAAM,KAAK,MACV,kBAACL,GAAD;GACE,GAAIM,EAAK;GACT,KAAKA,EAAK;GACV,OAAOA,EAAK;GACZ,aAAaA,EAAK,eAAeE;EAG5B,GADJF,EAAK,OACD,CACR,CACG;;AAEV;AAGA,IAAapB,IAAO,OAAO,OAAOgB,GAAe;CAAE;CAAM;CAAM;CAAK;AAAM,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
// src/components/Tabs/Tabs.css.ts
|
|
4
|
+
var e = "_5ocgjx0", t = "_5ocgjx1", n = "_5ocgjx2 tyvs8e0", r = "_5ocgjx3", i = "_5ocgjx4", a = "_5ocgjx5 tyvs8e0";
|
|
5
|
+
export { r as count, i as indicator, t as list, a as panel, e as root, n as tab };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=Tabs.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.styles.js","names":["root","list","tab","count","indicator","panel"],"sources":["../../../src/components/Tabs/Tabs.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 root = style({ fontFamily: vars.font.sans, color: vars.color.ink })\n\nexport const list = style({\n position: 'relative',\n display: 'flex',\n gap: space['6'],\n borderBottom: `1px solid ${vars.color.border}`,\n})\n\nexport const tab = style([\n focusRing,\n {\n display: 'inline-flex',\n alignItems: 'baseline',\n gap: space['2'],\n margin: 0,\n paddingBlock: space['3'],\n paddingInline: 0,\n border: 0,\n borderRadius: radius.sm,\n background: 'none',\n color: vars.color.inkMuted,\n fontFamily: 'inherit',\n fontSize: fontSize.lg,\n fontWeight: fontWeight.medium,\n whiteSpace: 'nowrap',\n cursor: 'pointer',\n transition: 'color 120ms',\n selectors: {\n '&:hover:not([data-disabled])': { color: vars.color.ink },\n '&[data-active]': { color: vars.color.ink },\n '&[data-disabled]': { cursor: 'not-allowed', color: vars.color.inkSubtle },\n },\n },\n])\n\nexport const count = style({\n fontSize: fontSize.sm,\n fontWeight: fontWeight.normal,\n color: vars.color.inkSubtle,\n})\n\nexport const indicator = style({\n position: 'absolute',\n bottom: -1,\n left: 0,\n height: '0.125rem',\n width: 'var(--active-tab-width)',\n translate: 'var(--active-tab-left)',\n borderRadius: radius.full,\n backgroundColor: vars.color.accent,\n transition: 'translate 200ms, width 200ms',\n '@media': { '(prefers-reduced-motion: reduce)': { transition: 'none' } },\n})\n\nexport const panel = style([focusRing, { paddingBlock: space['4'], borderRadius: radius.sm }])\n"],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const tag: import('@vanilla-extract/recipes').RuntimeFn<{
|
|
2
|
+
tone: {
|
|
3
|
+
neutral: {};
|
|
4
|
+
accent: {
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
borderColor: string;
|
|
7
|
+
color: string;
|
|
8
|
+
};
|
|
9
|
+
success: {
|
|
10
|
+
backgroundColor: string;
|
|
11
|
+
borderColor: string;
|
|
12
|
+
color: string;
|
|
13
|
+
};
|
|
14
|
+
warning: {
|
|
15
|
+
backgroundColor: string;
|
|
16
|
+
borderColor: string;
|
|
17
|
+
color: string;
|
|
18
|
+
};
|
|
19
|
+
danger: {
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
borderColor: string;
|
|
22
|
+
color: string;
|
|
23
|
+
};
|
|
24
|
+
info: {
|
|
25
|
+
backgroundColor: string;
|
|
26
|
+
borderColor: string;
|
|
27
|
+
color: string;
|
|
28
|
+
};
|
|
29
|
+
highlight: {
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
borderColor: string;
|
|
32
|
+
color: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
selected: {
|
|
36
|
+
true: {
|
|
37
|
+
backgroundColor: `var(--${string})`;
|
|
38
|
+
borderColor: `var(--${string})`;
|
|
39
|
+
color: `var(--${string})`;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export type TagTone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info' | 'highlight';
|
|
3
|
+
export interface TagProps extends ComponentProps<'span'> {
|
|
4
|
+
/** Colour. `neutral` (default) is plain; the others carry meaning, as in `Badge`. */
|
|
5
|
+
tone?: TagTone;
|
|
6
|
+
/** Accent-tinted with a leading check, e.g. the active value in a group of tags. */
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** A small rectangular mono label, e.g. an input method or event type. */
|
|
10
|
+
export declare function Tag({ tone, selected, className, children, ...props }: TagProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { tag as e } from "./Tag.styles.js";
|
|
2
|
+
import "../../styles/shared.styles.js";
|
|
3
|
+
import { clsx as t } from "clsx";
|
|
4
|
+
import { Check as n } from "lucide-react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
// src/components/Tag/Tag.tsx
|
|
7
|
+
function a({ tone: a = "neutral", selected: o = !1, className: s, children: c, ...l }) {
|
|
8
|
+
return /* @__PURE__ */ i("span", {
|
|
9
|
+
className: t(e({
|
|
10
|
+
tone: a,
|
|
11
|
+
selected: o
|
|
12
|
+
}), s),
|
|
13
|
+
...l,
|
|
14
|
+
children: [
|
|
15
|
+
o && /* @__PURE__ */ r(n, {
|
|
16
|
+
size: "1em",
|
|
17
|
+
strokeWidth: 2.5,
|
|
18
|
+
"aria-hidden": !0
|
|
19
|
+
}),
|
|
20
|
+
c,
|
|
21
|
+
o && /* @__PURE__ */ r("span", {
|
|
22
|
+
className: "tyvs8e1",
|
|
23
|
+
children: " (selected)"
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export { a as Tag };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=Tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.js","names":["styles.tag","Tag","props","clsx","tag","className","selected","Check","children"],"sources":["../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import { clsx } from 'clsx'\nimport { Check } from 'lucide-react'\nimport type { ComponentProps } from 'react'\n\nimport * as styles from './Tag.css'\nimport { visuallyHidden } from '../../styles/shared.css'\n\nexport type TagTone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info' | 'highlight'\n\nexport interface TagProps extends ComponentProps<'span'> {\n /** Colour. `neutral` (default) is plain; the others carry meaning, as in `Badge`. */\n tone?: TagTone\n /** Accent-tinted with a leading check, e.g. the active value in a group of tags. */\n selected?: boolean\n}\n\n/** A small rectangular mono label, e.g. an input method or event type. */\nexport function Tag({\n tone = 'neutral',\n selected = false,\n className,\n children,\n ...props\n}: TagProps) {\n return (\n <span className={clsx(styles.tag({ tone, selected }), className)} {...props}>\n {selected && <Check size=\"1em\" strokeWidth={2.5} aria-hidden />}\n {children}\n {selected && <span className={visuallyHidden}> (selected)</span>}\n </span>\n )\n}\n"],"mappings":";;;;;;AAiBA,SAAgBC,EAAI,EAClB,UAAO,WACP,cAAW,IACX,cACA,aACA,GAAGC,KACQ;CACX,OACE,kBAAC,QAAD;EAAM,WAAWC,EAAKH,EAAW;GAAE;GAAM;EAAS,CAAC,GAAGK,CAAS;EAAG,GAAIH;EAAtE,UAAA;GACGI,KAAY,kBAACC,GAAD;IAAO,MAAK;IAAM,aAAa;IAAK,eAAA;GAAa,CAAA;GAC7DC;GACAF,KAAY,kBAAC,QAAD;IAAM,WAAA;IAA2B,UAAA;GAAiB,CAAA;EAC3D;;AAEV"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
// src/components/Tag/Tag.css.ts
|
|
4
|
+
var t = e({
|
|
5
|
+
defaultClassName: "at4kg60",
|
|
6
|
+
variantClassNames: {
|
|
7
|
+
tone: {
|
|
8
|
+
neutral: "at4kg61",
|
|
9
|
+
accent: "at4kg62",
|
|
10
|
+
success: "at4kg63",
|
|
11
|
+
warning: "at4kg64",
|
|
12
|
+
danger: "at4kg65",
|
|
13
|
+
info: "at4kg66",
|
|
14
|
+
highlight: "at4kg67"
|
|
15
|
+
},
|
|
16
|
+
selected: { true: "at4kg68" }
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {},
|
|
19
|
+
compoundVariants: []
|
|
20
|
+
});
|
|
21
|
+
export { t as tag };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=Tag.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.styles.js","names":["_7a468","tag","createRuntimeFn"],"sources":["../../../src/components/Tag/Tag.css.ts"],"sourcesContent":["import { recipe } from '@vanilla-extract/recipes'\n\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\nconst tone = (backgroundColor: string, borderColor: string, color: string) => ({\n backgroundColor,\n borderColor,\n color,\n})\n\nexport const tag = recipe({\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: space['1'],\n paddingBlock: space['0.5'],\n paddingInline: space['1.5'],\n border: `1px solid ${vars.color.border}`,\n borderRadius: radius.sm,\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n fontFamily: vars.font.mono,\n fontSize: fontSize.xs,\n fontWeight: fontWeight.medium,\n lineHeight: 1.4,\n whiteSpace: 'nowrap',\n },\n variants: {\n // Tinted fill, ink text, and the tone's fill colour as the border.\n tone: {\n neutral: {},\n accent: tone(vars.color.accentSubtle, vars.color.accent, vars.color.accentInk),\n success: tone(vars.color.successSubtle, vars.color.success, vars.color.successInk),\n warning: tone(vars.color.warningSubtle, vars.color.warning, vars.color.warningInk),\n danger: tone(vars.color.dangerSubtle, vars.color.danger, vars.color.dangerInk),\n info: tone(vars.color.infoSubtle, vars.color.info, vars.color.infoInk),\n highlight: tone(\n vars.color.highlightSubtle,\n vars.color.highlightBorder,\n vars.color.highlightInk,\n ),\n },\n // After `tone`, so it wins.\n selected: {\n true: {\n backgroundColor: vars.color.accentSubtle,\n borderColor: vars.color.accent,\n color: vars.color.accentInk,\n },\n },\n },\n})\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const counter: string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ComponentProps, Ref } from 'react';
|
|
2
|
+
import { FieldBaseProps, FieldOptionProps, PartProps } from '../Field/Field';
|
|
3
|
+
/**
|
|
4
|
+
* Native input props (`id`, `name`, `placeholder`…) go on the `<input>`, except `className`, which
|
|
5
|
+
* goes on the field's root. Use `inputProps` for a class or anything else meant only for the `<input>`.
|
|
6
|
+
*/
|
|
7
|
+
export interface TextInputProps extends FieldBaseProps, FieldOptionProps, Omit<ComponentProps<'input'>, 'ref'> {
|
|
8
|
+
/** Forwarded to the `<input>` (for form libraries, and to focus it). */
|
|
9
|
+
ref?: Ref<HTMLInputElement>;
|
|
10
|
+
/** Goes on the `<input>`, so `<label htmlFor>` and `getElementById(id).focus()` work. */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** Goes on the field's root element, not the `<input>`. Use `inputProps.className` for that. */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Extra props for the `<input>`, e.g. `{ className, 'data-testid': 'name' }`. */
|
|
15
|
+
inputProps?: PartProps<Omit<ComponentProps<'input'>, 'ref'>>;
|
|
16
|
+
/** Shows "count/maxLength" inside the input. Needs `maxLength`, which stops typing at the limit. */
|
|
17
|
+
showCount?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Soft limit: shows "count/countLimit" without setting native `maxLength`, so people can type
|
|
20
|
+
* past it. Over the limit the count turns red and gets `data-over="true"`; show an `error` too.
|
|
21
|
+
*/
|
|
22
|
+
countLimit?: number;
|
|
23
|
+
/** Called with the new string value on every change. */
|
|
24
|
+
onValueChange?: (value: string) => void;
|
|
25
|
+
}
|
|
26
|
+
/** Single-line text input with a label. Spread `register('name')` from react-hook-form onto it. */
|
|
27
|
+
export declare function TextInput({ label, description, error, required, hideLabel, fieldProps, disabled, className, showCount, countLimit, maxLength, value, defaultValue, onChange, onValueChange, ref, inputProps, ...props }: TextInputProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { counter as e } from "./TextInput.styles.js";
|
|
2
|
+
import { useCharCount as t } from "./useCharCount.js";
|
|
3
|
+
import { adornment as n, counter as r, frame as i, frameInput as a, input as o } from "../../styles/input.styles.js";
|
|
4
|
+
import { Field as s } from "../Field/Field.js";
|
|
5
|
+
import { clsx as c } from "clsx";
|
|
6
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
import { Input as d } from "@base-ui/react/input";
|
|
8
|
+
// src/components/TextInput/TextInput.tsx
|
|
9
|
+
function f({ label: f, description: p, error: m, required: h, hideLabel: g, fieldProps: _, disabled: v, className: y, showCount: b = !1, countLimit: x, maxLength: S, value: C, defaultValue: w, onChange: T, onValueChange: E, ref: D, inputProps: O, ...k }) {
|
|
10
|
+
let A = t({
|
|
11
|
+
value: C,
|
|
12
|
+
defaultValue: w,
|
|
13
|
+
maxLength: S,
|
|
14
|
+
showCount: b,
|
|
15
|
+
countLimit: x
|
|
16
|
+
}), j = (e) => {
|
|
17
|
+
let t = typeof D == "function" ? D(e) : void 0;
|
|
18
|
+
return D && typeof D != "function" && (D.current = e), e && A.setLength(e.value.length), t;
|
|
19
|
+
}, M = (e) => {
|
|
20
|
+
A.setLength(e.target.value.length), T?.(e), E?.(e.target.value);
|
|
21
|
+
}, N = A.limit !== void 0, P = /* @__PURE__ */ l(d, {
|
|
22
|
+
...k,
|
|
23
|
+
...O,
|
|
24
|
+
ref: j,
|
|
25
|
+
value: C,
|
|
26
|
+
defaultValue: w,
|
|
27
|
+
maxLength: S,
|
|
28
|
+
required: h,
|
|
29
|
+
disabled: v,
|
|
30
|
+
onChange: M,
|
|
31
|
+
className: c(N ? a : o, O?.className)
|
|
32
|
+
});
|
|
33
|
+
return /* @__PURE__ */ l(s, {
|
|
34
|
+
..._,
|
|
35
|
+
label: f,
|
|
36
|
+
description: p,
|
|
37
|
+
error: m,
|
|
38
|
+
required: h,
|
|
39
|
+
hideLabel: g,
|
|
40
|
+
disabled: v,
|
|
41
|
+
className: c(_?.className, y),
|
|
42
|
+
children: N ? /* @__PURE__ */ u("div", {
|
|
43
|
+
className: i,
|
|
44
|
+
"data-disabled": v || void 0,
|
|
45
|
+
children: [P, /* @__PURE__ */ u("span", {
|
|
46
|
+
className: c(n, r, e),
|
|
47
|
+
"data-over": A.over,
|
|
48
|
+
children: [
|
|
49
|
+
A.count,
|
|
50
|
+
"/",
|
|
51
|
+
A.limit
|
|
52
|
+
]
|
|
53
|
+
})]
|
|
54
|
+
}) : P
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export { f as TextInput };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=TextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInput.js","names":["counter","input.frameInput","input.input","input.frame","input.adornment","input.counter","styles.counter","counter$1","TextInput","props","counter$2","useCharCount","setRef","cleanup","ref","node","handleChange","event","onChange","onValueChange","hasCounter","control","Input","inputProps","clsx","frameInput","input","Field","fieldProps","className","frame","disabled","adornment","counter"],"sources":["../../../src/components/TextInput/TextInput.tsx"],"sourcesContent":["import { Input } from '@base-ui/react/input'\nimport { clsx } from 'clsx'\nimport type { ChangeEvent, ComponentProps, Ref } from 'react'\n\nimport * as styles from './TextInput.css'\nimport { useCharCount } from './useCharCount'\nimport * as input from '../../styles/input.css'\nimport { Field, type FieldBaseProps, type FieldOptionProps, type PartProps } from '../Field/Field'\n\n/**\n * Native input props (`id`, `name`, `placeholder`…) go on the `<input>`, except `className`, which\n * goes on the field's root. Use `inputProps` for a class or anything else meant only for the `<input>`.\n */\nexport interface TextInputProps\n extends FieldBaseProps, FieldOptionProps, Omit<ComponentProps<'input'>, 'ref'> {\n /** Forwarded to the `<input>` (for form libraries, and to focus it). */\n ref?: Ref<HTMLInputElement>\n /** Goes on the `<input>`, so `<label htmlFor>` and `getElementById(id).focus()` work. */\n id?: string\n /** Goes on the field's root element, not the `<input>`. Use `inputProps.className` for that. */\n className?: string\n /** Extra props for the `<input>`, e.g. `{ className, 'data-testid': 'name' }`. */\n inputProps?: PartProps<Omit<ComponentProps<'input'>, 'ref'>>\n /** Shows \"count/maxLength\" inside the input. Needs `maxLength`, which stops typing at the limit. */\n showCount?: boolean\n /**\n * Soft limit: shows \"count/countLimit\" without setting native `maxLength`, so people can type\n * past it. Over the limit the count turns red and gets `data-over=\"true\"`; show an `error` too.\n */\n countLimit?: number\n /** Called with the new string value on every change. */\n onValueChange?: (value: string) => void\n}\n\n/** Single-line text input with a label. Spread `register('name')` from react-hook-form onto it. */\nexport function TextInput({\n label,\n description,\n error,\n required,\n hideLabel,\n fieldProps,\n disabled,\n className,\n showCount = false,\n countLimit,\n maxLength,\n value,\n defaultValue,\n onChange,\n onValueChange,\n ref,\n inputProps,\n ...props\n}: TextInputProps) {\n const counter = useCharCount({ value, defaultValue, maxLength, showCount, countLimit })\n\n // Re-runs every render, so the count picks up values set outside React (react-hook-form's\n // default values and `reset`). The caller's ref runs first because it may set the value.\n const setRef = (node: HTMLInputElement | null) => {\n const cleanup = typeof ref === 'function' ? ref(node) : undefined\n if (ref && typeof ref !== 'function') ref.current = node\n if (node) counter.setLength(node.value.length)\n return cleanup\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n counter.setLength(event.target.value.length)\n onChange?.(event)\n onValueChange?.(event.target.value)\n }\n const hasCounter = counter.limit !== undefined\n\n const control = (\n <Input\n {...props}\n {...inputProps}\n ref={setRef}\n value={value}\n defaultValue={defaultValue}\n maxLength={maxLength}\n required={required}\n disabled={disabled}\n onChange={handleChange}\n className={clsx(hasCounter ? input.frameInput : input.input, inputProps?.className)}\n />\n )\n\n return (\n <Field\n {...fieldProps}\n label={label}\n description={description}\n error={error}\n required={required}\n hideLabel={hideLabel}\n disabled={disabled}\n className={clsx(fieldProps?.className, className)}\n >\n {hasCounter ? (\n <div className={input.frame} data-disabled={disabled || undefined}>\n {control}\n <span\n className={clsx(input.adornment, input.counter, styles.counter)}\n data-over={counter.over}\n >\n {counter.count}/{counter.limit}\n </span>\n </div>\n ) : (\n control\n )}\n </Field>\n )\n}\n"],"mappings":";;;;;;;;AAmCA,SAAgBQ,EAAU,EACxB,UACA,gBACA,UACA,aACA,cACA,eACA,aACA,cACA,eAAY,IACZ,eACA,cACA,UACA,iBACA,aACA,kBACA,QACA,eACA,GAAGC,KACc;CACjB,IAAMT,IAAUW,EAAa;EAAE;EAAO;EAAc;EAAW;EAAW;CAAW,CAAC,GAIhFC,KAAU,MAAkC;EAChD,IAAMC,IAAU,OAAOC,KAAQ,aAAaA,EAAIC,CAAI,IAAI,KAAA;EAGxD,OAFID,KAAO,OAAOA,KAAQ,eAAY,EAAI,UAAUC,IAChDA,KAAML,EAAQ,UAAUK,EAAK,MAAM,MAAM,GACtCF;CACT,GAEMG,KAAgB,MAAyC;EAG7D,AAFAN,EAAQ,UAAUO,EAAM,OAAO,MAAM,MAAM,GAC3CC,IAAWD,CAAK,GAChBE,IAAgBF,EAAM,OAAO,KAAK;CACpC,GACMG,IAAapB,EAAQ,UAAU,KAAA,GAE/BqB,IACJ,kBAACC,GAAD;EACE,GAAIb;EACJ,GAAIc;EACJ,KAAKX;EACE;EACO;EACH;EACD;EACA;EACV,UAAUI;EACV,WAAWQ,EAAKJ,IAAanB,IAAmBC,GAAaqB,GAAY,SAAS;CACnF,CAAA;CAGH,OACE,kBAACI,GAAD;EACE,GAAIC;EACG;EACM;EACN;EACG;EACC;EACD;EACV,WAAWJ,EAAKI,GAAY,WAAWC,CAAS;EAE/C,UAAAT,IACC,kBAAC,OAAD;GAAK,WAAWjB;GAAa,iBAAe4B,KAAY,KAAA;GAAxD,UAAA,CACGV,GACD,kBAAC,QAAD;IACE,WAAWG,EAAKpB,GAAiBC,GAAeC,CAAc;IAC9D,aAAWN,EAAQ;IAFrB,UAAA;KAIGA,EAAQ;KAAM;KAAEA,EAAQ;IACrB;GACH,CAAA,CAAA;EAEL,CAAA,IAAAqB;CAEG,CAAA;AAEX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInput.styles.js","names":["counter"],"sources":["../../../src/components/TextInput/TextInput.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css'\n\nimport { space } from '../../tokens/scale'\n\nexport const counter = style({ paddingInlineEnd: space['4'] })\n"],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type Value = string | number | readonly string[] | undefined;
|
|
2
|
+
/** Character count for TextInput and Textarea: hard limit (`maxLength` + `showCount`) or soft (`countLimit`). */
|
|
3
|
+
export declare function useCharCount(options: {
|
|
4
|
+
value: Value;
|
|
5
|
+
defaultValue: Value;
|
|
6
|
+
maxLength: number | undefined;
|
|
7
|
+
showCount: boolean;
|
|
8
|
+
countLimit: number | undefined;
|
|
9
|
+
}): {
|
|
10
|
+
count: number;
|
|
11
|
+
limit: number | undefined;
|
|
12
|
+
over: boolean;
|
|
13
|
+
setLength: import('react').Dispatch<import('react').SetStateAction<number>>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useState as e } from "react";
|
|
2
|
+
// src/components/TextInput/useCharCount.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
let { value: n, defaultValue: r, maxLength: i, showCount: a, countLimit: o } = t, [s, c] = e(String(r ?? "").length), l = n === void 0 ? s : String(n).length, u = o ?? (a ? i : void 0);
|
|
5
|
+
return {
|
|
6
|
+
count: l,
|
|
7
|
+
limit: u,
|
|
8
|
+
over: u !== void 0 && l > u,
|
|
9
|
+
setLength: c
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export { t as useCharCount };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=useCharCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCharCount.js","names":["useCharCount","options","length","setLength","useState","defaultValue","count","value","limit","countLimit","showCount","maxLength"],"sources":["../../../src/components/TextInput/useCharCount.ts"],"sourcesContent":["import { useState } from 'react'\n\ntype Value = string | number | readonly string[] | undefined\n\n/** Character count for TextInput and Textarea: hard limit (`maxLength` + `showCount`) or soft (`countLimit`). */\nexport function useCharCount(options: {\n value: Value\n defaultValue: Value\n maxLength: number | undefined\n showCount: boolean\n countLimit: number | undefined\n}) {\n const { value, defaultValue, maxLength, showCount, countLimit } = options\n const [length, setLength] = useState(String(defaultValue ?? '').length)\n const count = value !== undefined ? String(value).length : length\n const limit = countLimit ?? (showCount ? maxLength : undefined)\n return { count, limit, over: limit !== undefined && count > limit, setLength }\n}\n"],"mappings":";;AAKA,SAAgBA,EAAa,GAM1B;CACD,IAAM,EAAE,UAAO,iBAAc,cAAW,cAAW,kBAAeC,GAC5D,CAACC,GAAQC,KAAaC,EAAS,OAAOC,KAAgB,EAAE,CAAC,CAAC,MAAM,GAChEC,IAAQC,MAAU,KAAA,IAAmCL,IAAvB,OAAOK,CAAK,CAAC,CAAC,QAC5CC,IAAQC,MAAeC,IAAYC,IAAY,KAAA;CACrD,OAAO;EAAE;EAAO;EAAO,MAAMH,MAAU,KAAA,KAAaF,IAAQE;EAAO;CAAU;AAC/E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentProps, Ref } from 'react';
|
|
2
|
+
import { FieldBaseProps, FieldOptionProps } from '../Field/Field';
|
|
3
|
+
export interface TextareaProps extends FieldBaseProps, FieldOptionProps, Omit<ComponentProps<'textarea'>, 'ref'> {
|
|
4
|
+
/** Lines shown when empty (default 3). It then grows with its content, up to 15 lines, and scrolls after that. */
|
|
5
|
+
rows?: number;
|
|
6
|
+
/** Forwarded to the `<textarea>` (for form libraries). */
|
|
7
|
+
ref?: Ref<HTMLTextAreaElement>;
|
|
8
|
+
/** Shows "count/maxLength" under the textarea. Needs `maxLength`, which stops typing at the limit. */
|
|
9
|
+
showCount?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Soft limit: shows "count/countLimit" without setting native `maxLength`, so people can type
|
|
12
|
+
* past it. Over the limit the count turns red and gets `data-over="true"`; show an `error` too.
|
|
13
|
+
*/
|
|
14
|
+
countLimit?: number;
|
|
15
|
+
/** Called with the new string value on every change. */
|
|
16
|
+
onValueChange?: (value: string) => void;
|
|
17
|
+
}
|
|
18
|
+
/** Multi-line text input with a label. Grows to fit its content (CSS `field-sizing`; browsers without it get a resize handle). */
|
|
19
|
+
export declare function Textarea({ label, description, error, required, hideLabel, fieldProps, disabled, className, rows, showCount, countLimit, maxLength, value, defaultValue, onChange, onValueChange, ref, ...props }: TextareaProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { rowsProperty as e, textarea as t } from "./Textarea.styles.js";
|
|
2
|
+
import "../../styles/input.styles.js";
|
|
3
|
+
import { Field as n } from "../Field/Field.js";
|
|
4
|
+
import { useCharCount as r } from "../TextInput/useCharCount.js";
|
|
5
|
+
import { clsx as i } from "clsx";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { Field as s } from "@base-ui/react/field";
|
|
8
|
+
// src/components/Textarea/Textarea.tsx
|
|
9
|
+
function c({ label: c, description: l, error: u, required: d, hideLabel: f, fieldProps: p, disabled: m, className: h, rows: g = 3, showCount: _ = !1, countLimit: v, maxLength: y, value: b, defaultValue: x, onChange: S, onValueChange: C, ref: w, ...T }) {
|
|
10
|
+
let E = r({
|
|
11
|
+
value: b,
|
|
12
|
+
defaultValue: x,
|
|
13
|
+
maxLength: y,
|
|
14
|
+
showCount: _,
|
|
15
|
+
countLimit: v
|
|
16
|
+
}), D = (e) => {
|
|
17
|
+
let t = typeof w == "function" ? w(e) : void 0;
|
|
18
|
+
return w && typeof w != "function" && (w.current = e), e && E.setLength(e.value.length), t;
|
|
19
|
+
}, O = (e) => {
|
|
20
|
+
E.setLength(e.target.value.length), S?.(e), C?.(e.target.value);
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ o(n, {
|
|
23
|
+
...p,
|
|
24
|
+
label: c,
|
|
25
|
+
description: l,
|
|
26
|
+
error: u,
|
|
27
|
+
required: d,
|
|
28
|
+
hideLabel: f,
|
|
29
|
+
disabled: m,
|
|
30
|
+
className: i(p?.className, h),
|
|
31
|
+
children: [/* @__PURE__ */ a(s.Control, { render: /* @__PURE__ */ a("textarea", {
|
|
32
|
+
...T,
|
|
33
|
+
ref: D,
|
|
34
|
+
rows: g,
|
|
35
|
+
value: b,
|
|
36
|
+
defaultValue: x,
|
|
37
|
+
maxLength: y,
|
|
38
|
+
required: d,
|
|
39
|
+
disabled: m,
|
|
40
|
+
onChange: O,
|
|
41
|
+
className: t,
|
|
42
|
+
style: {
|
|
43
|
+
...T.style,
|
|
44
|
+
[e]: g
|
|
45
|
+
}
|
|
46
|
+
}) }), E.limit !== void 0 && /* @__PURE__ */ o("span", {
|
|
47
|
+
className: i("_12aoxdme", "_3gmpop1"),
|
|
48
|
+
"data-over": E.over,
|
|
49
|
+
children: [
|
|
50
|
+
E.count,
|
|
51
|
+
"/",
|
|
52
|
+
E.limit
|
|
53
|
+
]
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export { c as Textarea };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=Textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.js","names":["counter","Field","BaseField","styles.textarea","styles.rowsProperty","Field$1","Textarea","props","counter$2","useCharCount","setRef","cleanup","ref","node","handleChange","event","onChange","onValueChange","fieldProps","clsx","className","Field","textarea","rowsProperty","rows"],"sources":["../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import { Field as BaseField } from '@base-ui/react/field'\nimport { clsx } from 'clsx'\nimport type { ChangeEvent, ComponentProps, CSSProperties, Ref } from 'react'\n\nimport * as styles from './Textarea.css'\nimport * as input from '../../styles/input.css'\nimport { Field, type FieldBaseProps, type FieldOptionProps } from '../Field/Field'\nimport { useCharCount } from '../TextInput/useCharCount'\n\nexport interface TextareaProps\n extends FieldBaseProps, FieldOptionProps, Omit<ComponentProps<'textarea'>, 'ref'> {\n /** Lines shown when empty (default 3). It then grows with its content, up to 15 lines, and scrolls after that. */\n rows?: number\n /** Forwarded to the `<textarea>` (for form libraries). */\n ref?: Ref<HTMLTextAreaElement>\n /** Shows \"count/maxLength\" under the textarea. Needs `maxLength`, which stops typing at the limit. */\n showCount?: boolean\n /**\n * Soft limit: shows \"count/countLimit\" without setting native `maxLength`, so people can type\n * past it. Over the limit the count turns red and gets `data-over=\"true\"`; show an `error` too.\n */\n countLimit?: number\n /** Called with the new string value on every change. */\n onValueChange?: (value: string) => void\n}\n\n/** Multi-line text input with a label. Grows to fit its content (CSS `field-sizing`; browsers without it get a resize handle). */\nexport function Textarea({\n label,\n description,\n error,\n required,\n hideLabel,\n fieldProps,\n disabled,\n className,\n rows = 3,\n showCount = false,\n countLimit,\n maxLength,\n value,\n defaultValue,\n onChange,\n onValueChange,\n ref,\n ...props\n}: TextareaProps) {\n const counter = useCharCount({ value, defaultValue, maxLength, showCount, countLimit })\n\n // Re-runs every render, so the count picks up values set outside React (react-hook-form's\n // default values and `reset`). The caller's ref runs first because it may set the value.\n const setRef = (node: HTMLTextAreaElement | null) => {\n const cleanup = typeof ref === 'function' ? ref(node) : undefined\n if (ref && typeof ref !== 'function') ref.current = node\n if (node) counter.setLength(node.value.length)\n return cleanup\n }\n\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) => {\n counter.setLength(event.target.value.length)\n onChange?.(event)\n onValueChange?.(event.target.value)\n }\n\n return (\n <Field\n {...fieldProps}\n label={label}\n description={description}\n error={error}\n required={required}\n hideLabel={hideLabel}\n disabled={disabled}\n className={clsx(fieldProps?.className, className)}\n >\n <BaseField.Control\n render={\n <textarea\n {...props}\n ref={setRef}\n rows={rows}\n value={value}\n defaultValue={defaultValue}\n maxLength={maxLength}\n required={required}\n disabled={disabled}\n onChange={handleChange}\n className={styles.textarea}\n style={{ ...props.style, [styles.rowsProperty]: rows } as CSSProperties}\n />\n }\n />\n {counter.limit !== undefined && (\n <span className={clsx(input.counter, styles.counter)} data-over={counter.over}>\n {counter.count}/{counter.limit}\n </span>\n )}\n </Field>\n )\n}\n"],"mappings":";;;;;;;;AA2BA,SAAgBM,EAAS,EACvB,UACA,gBACA,UACA,aACA,cACA,eACA,aACA,cACA,UAAO,GACP,eAAY,IACZ,eACA,cACA,UACA,iBACA,aACA,kBACA,QACA,GAAGC,KACa;CAChB,IAAMP,IAAUS,EAAa;EAAE;EAAO;EAAc;EAAW;EAAW;CAAW,CAAC,GAIhFC,KAAU,MAAqC;EACnD,IAAMC,IAAU,OAAOC,KAAQ,aAAaA,EAAIC,CAAI,IAAI,KAAA;EAGxD,OAFID,KAAO,OAAOA,KAAQ,eAAY,EAAI,UAAUC,IAChDA,KAAML,EAAQ,UAAUK,EAAK,MAAM,MAAM,GACtCF;CACT,GAEMG,KAAgB,MAA4C;EAGhE,AAFAN,EAAQ,UAAUO,EAAM,OAAO,MAAM,MAAM,GAC3CC,IAAWD,CAAK,GAChBE,IAAgBF,EAAM,OAAO,KAAK;CACpC;CAEA,OACE,kBAACd,GAAD;EACE,GAAIiB;EACG;EACM;EACN;EACG;EACC;EACD;EACV,WAAWC,EAAKD,GAAY,WAAWE,CAAS;EARlD,UAAA,CAUE,kBAAClB,EAAU,SAAX,EACE,QACE,kBAAC,YAAD;GACE,GAAIK;GACJ,KAAKG;GACC;GACC;GACO;GACH;GACD;GACA;GACV,UAAUI;GACV,WAAWX;GACX,OAAO;IAAE,GAAGI,EAAM;KAAQH,IAAsBoB;GAAK;EACtD,CAAA,EAEJ,CAAA,GACAxB,EAAQ,UAAU,KAAA,KACjB,kBAAC,QAAD;GAAM,WAAWmB,EAAK,aAAe,UAAc;GAAG,aAAWnB,EAAQ;GAAzE,UAAA;IACGA,EAAQ;IAAM;IAAEA,EAAQ;GACrB;EAEH,CAAA,CAAA;;AAEX"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
// src/components/Textarea/Textarea.css.ts
|
|
5
|
+
var e = "--bok-textarea-rows", t = "_3gmpop0 _12aoxdm0", n = "_3gmpop1";
|
|
6
|
+
export { n as counter, e as rowsProperty, t as textarea };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=Textarea.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.styles.js","names":["rowsProperty","textarea","counter"],"sources":["../../../src/components/Textarea/Textarea.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css'\n\nimport { input } from '../../styles/input.css'\nimport { lineHeight, space } from '../../tokens/scale'\n\n/** Set inline from the `rows` prop: the smallest the textarea gets. */\nexport const rowsProperty = '--bok-textarea-rows'\n\nconst padding = space['2.5']\n\nexport const textarea = style([\n input,\n {\n display: 'block',\n paddingBlock: padding,\n lineHeight: lineHeight.normal,\n resize: 'vertical',\n '@supports': {\n // Grows with its content (no JS): `rows` lines at least, then scrolls after 15 lines.\n '(field-sizing: content)': {\n fieldSizing: 'content',\n resize: 'none',\n minBlockSize: `calc(var(${rowsProperty}, 3) * 1lh + 2 * ${padding} + 2px)`,\n maxBlockSize: `calc(15lh + 2 * ${padding} + 2px)`,\n },\n },\n },\n])\n\nexport const counter = style({ alignSelf: 'flex-end', marginBlockStart: `-${space['0.5']}` })\n"],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Theme } from '../../theme/theme';
|
|
2
|
+
import { MenuProps } from '../Menu';
|
|
3
|
+
export interface ThemeMenuProps extends Omit<MenuProps, 'trigger' | 'items' | 'header' | 'footer'> {
|
|
4
|
+
/** Accessible name of the trigger, and the heading above the options. */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** The themes offered, in order. Defaults to all of them. */
|
|
7
|
+
themes?: readonly Theme[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A compact theme switch: an icon button showing the current theme that opens a menu of themes.
|
|
11
|
+
* Made for the `NavRail` footer, so it opens to the right by default.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ThemeMenu({ label, themes, side, align, ...props }: ThemeMenuProps): import('react').JSX.Element;
|