@15gifts/back-office-kit 0.1.0-alpha.0 → 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/README.md +9 -6
- package/dist/browser/back-office-kit.js +6649 -5932
- package/dist/components/Alert/Alert.css.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +12 -2
- package/dist/components/Alert/Alert.js +33 -29
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Alert/Alert.styles.js +2 -2
- package/dist/components/Alert/Alert.styles.js.map +1 -1
- package/dist/components/AppShell/AppShell.css.d.ts +2 -0
- package/dist/components/AppShell/AppShell.d.ts +3 -1
- package/dist/components/AppShell/AppShell.js +42 -26
- package/dist/components/AppShell/AppShell.js.map +1 -1
- package/dist/components/AppShell/AppShell.styles.js +3 -2
- package/dist/components/AppShell/AppShell.styles.js.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -0
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Badge/Badge.css.d.ts +5 -0
- package/dist/components/Badge/Badge.d.ts +4 -1
- package/dist/components/Badge/Badge.js +6 -5
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/Badge.styles.js +16 -15
- package/dist/components/Badge/Badge.styles.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.css.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +27 -27
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.styles.js +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
- package/dist/components/Button/Button.css.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +5 -4
- package/dist/components/Button/Button.js +21 -21
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styles.js.map +1 -1
- package/dist/components/Card/Card.css.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +7 -1
- package/dist/components/Card/Card.js +33 -22
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.styles.js +2 -2
- package/dist/components/Card/Card.styles.js.map +1 -1
- package/dist/components/ChatTranscript/ChatTranscript.d.ts +2 -2
- package/dist/components/ChatTranscript/ChatTranscript.js +74 -71
- package/dist/components/ChatTranscript/ChatTranscript.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +2 -1
- package/dist/components/Checkbox/Checkbox.js +30 -34
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.styles.js.map +1 -1
- 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 +2 -0
- package/dist/components/Chip/Chip.d.ts +15 -3
- package/dist/components/Chip/Chip.js +35 -16
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/Chip.styles.js +2 -2
- package/dist/components/Chip/Chip.styles.js.map +1 -1
- package/dist/components/Chip/index.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +3 -1
- package/dist/components/ColorPicker/ColorPicker.js +46 -47
- package/dist/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.styles.js.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts +28 -4
- package/dist/components/Combobox/Combobox.js +130 -109
- package/dist/components/Combobox/Combobox.js.map +1 -1
- 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.d.ts +10 -3
- package/dist/components/DateRangePicker/DateRangePicker.js +107 -110
- package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.styles.js +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.styles.js.map +1 -1
- package/dist/components/DateTimeInput/DateTimeInput.d.ts +1 -1
- package/dist/components/DateTimeInput/DateTimeInput.js +20 -28
- package/dist/components/DateTimeInput/DateTimeInput.js.map +1 -1
- package/dist/components/DateTimeInput/DateTimeInput.styles.js +1 -0
- package/dist/components/DescriptionList/DescriptionList.d.ts +8 -0
- package/dist/components/DescriptionList/DescriptionList.js +2 -1
- package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/DetailsSummary/DetailsSummary.css.d.ts +1 -0
- package/dist/components/DetailsSummary/DetailsSummary.d.ts +5 -1
- package/dist/components/DetailsSummary/DetailsSummary.js +15 -15
- package/dist/components/DetailsSummary/DetailsSummary.js.map +1 -1
- package/dist/components/DetailsSummary/DetailsSummary.styles.js +10 -2
- package/dist/components/DetailsSummary/DetailsSummary.styles.js.map +1 -1
- package/dist/components/DetailsSummary/index.d.ts +1 -1
- package/dist/components/Drawer/Drawer.css.d.ts +3 -0
- package/dist/components/Drawer/Drawer.d.ts +24 -3
- package/dist/components/Drawer/Drawer.js +55 -46
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/Drawer.styles.js +7 -2
- package/dist/components/Drawer/Drawer.styles.js.map +1 -1
- 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 +5 -0
- package/dist/components/EnvironmentChip/EnvironmentChip.d.ts +13 -5
- package/dist/components/EnvironmentChip/EnvironmentChip.js +14 -3
- package/dist/components/EnvironmentChip/EnvironmentChip.js.map +1 -1
- package/dist/components/EnvironmentChip/EnvironmentChip.styles.js +3 -2
- package/dist/components/EnvironmentChip/EnvironmentChip.styles.js.map +1 -1
- package/dist/components/EnvironmentChip/index.d.ts +2 -2
- package/dist/components/Field/Field.css.d.ts +0 -1
- package/dist/components/Field/Field.d.ts +11 -28
- package/dist/components/Field/Field.js +25 -36
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/Field/Field.styles.js +2 -2
- package/dist/components/Field/Field.styles.js.map +1 -1
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/Fieldset/Fieldset.d.ts +1 -0
- package/dist/components/Fieldset/Fieldset.js.map +1 -1
- package/dist/components/Fieldset/Fieldset.styles.js.map +1 -1
- 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/List/List.d.ts +1 -0
- package/dist/components/List/List.js.map +1 -1
- package/dist/components/Loader/Loader.d.ts +1 -1
- package/dist/components/Loader/Loader.js +6 -2
- package/dist/components/Loader/Loader.js.map +1 -1
- package/dist/components/Menu/Menu.d.ts +25 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/Menu.styles.js.map +1 -1
- package/dist/components/MetricBar/MetricBar.css.d.ts +5 -0
- package/dist/components/MetricBar/MetricBar.d.ts +9 -1
- package/dist/components/MetricBar/MetricBar.js +38 -22
- package/dist/components/MetricBar/MetricBar.js.map +1 -1
- package/dist/components/MetricBar/MetricBar.styles.js +15 -10
- package/dist/components/MetricBar/MetricBar.styles.js.map +1 -1
- package/dist/components/Modal/Modal.d.ts +6 -0
- package/dist/components/Modal/Modal.js +25 -28
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/Modal.styles.js +2 -1
- package/dist/components/Modal/Modal.styles.js.map +1 -1
- package/dist/components/NavRail/NavRail.css.d.ts +2 -0
- package/dist/components/NavRail/NavRail.d.ts +22 -7
- package/dist/components/NavRail/NavRail.js +79 -58
- package/dist/components/NavRail/NavRail.js.map +1 -1
- package/dist/components/NavRail/NavRail.styles.js +3 -2
- package/dist/components/NavRail/NavRail.styles.js.map +1 -1
- package/dist/components/NavRail/index.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +9 -1
- package/dist/components/NumberInput/NumberInput.js +37 -31
- package/dist/components/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/PageHeader/PageHeader.css.d.ts +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +3 -1
- package/dist/components/PageHeader/PageHeader.js +21 -23
- package/dist/components/PageHeader/PageHeader.js.map +1 -1
- package/dist/components/PageHeader/PageHeader.styles.js +1 -1
- package/dist/components/PageHeader/PageHeader.styles.js.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts +5 -0
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Popover/Popover.d.ts +9 -1
- package/dist/components/Popover/Popover.js +7 -6
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/Popover.styles.js.map +1 -1
- package/dist/components/PortalContainer/PortalContainer.d.ts +1 -0
- package/dist/components/PortalContainer/PortalContainer.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.css.d.ts +3 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +5 -1
- package/dist/components/ProgressBar/ProgressBar.js +21 -7
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.styles.js +6 -6
- package/dist/components/ProgressBar/ProgressBar.styles.js.map +1 -1
- package/dist/components/RadioCards/RadioCards.d.ts +8 -2
- package/dist/components/RadioCards/RadioCards.js +40 -44
- package/dist/components/RadioCards/RadioCards.js.map +1 -1
- package/dist/components/SaveBar/SaveBar.d.ts +6 -1
- package/dist/components/SaveBar/SaveBar.js +1 -2
- package/dist/components/SaveBar/SaveBar.js.map +1 -1
- package/dist/components/SaveBar/SaveBar.styles.js.map +1 -1
- package/dist/components/Select/Select.css.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +32 -5
- package/dist/components/Select/Select.js +91 -62
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/Select.styles.js +3 -2
- package/dist/components/Select/Select.styles.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.js +20 -19
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Stack/Stack.css.d.ts +4 -1
- package/dist/components/Stack/Stack.d.ts +7 -3
- package/dist/components/Stack/Stack.js.map +1 -1
- package/dist/components/Stack/Stack.styles.js +16 -23
- package/dist/components/Stack/Stack.styles.js.map +1 -1
- package/dist/components/StatCard/StatCard.d.ts +3 -0
- package/dist/components/StatCard/StatCard.js.map +1 -1
- package/dist/components/StatCard/StatCard.styles.js.map +1 -1
- package/dist/components/StatsGrid/StatsGrid.d.ts +3 -6
- package/dist/components/StatsGrid/StatsGrid.js +3 -7
- package/dist/components/StatsGrid/StatsGrid.js.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.d.ts +3 -2
- package/dist/components/StatusBadge/StatusBadge.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +2 -1
- package/dist/components/Switch/Switch.js +27 -31
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Switcher/Switcher.css.d.ts +0 -1
- package/dist/components/Switcher/Switcher.d.ts +13 -1
- package/dist/components/Switcher/Switcher.js +35 -35
- package/dist/components/Switcher/Switcher.js.map +1 -1
- package/dist/components/Switcher/Switcher.styles.js +2 -2
- package/dist/components/Switcher/Switcher.styles.js.map +1 -1
- package/dist/components/Table/Table.css.d.ts +16 -1
- package/dist/components/Table/Table.d.ts +110 -13
- package/dist/components/Table/Table.js +214 -102
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/Table.styles.js +7 -6
- package/dist/components/Table/Table.styles.js.map +1 -1
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +23 -8
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/Tabs.styles.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/Tag/Tag.css.d.ts +33 -0
- package/dist/components/Tag/Tag.d.ts +5 -2
- package/dist/components/Tag/Tag.js +23 -6
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Tag/Tag.styles.js +12 -1
- package/dist/components/Tag/Tag.styles.js.map +1 -1
- package/dist/components/Tag/index.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +13 -2
- package/dist/components/TextInput/TextInput.js +45 -48
- package/dist/components/TextInput/TextInput.js.map +1 -1
- package/dist/components/Textarea/Textarea.css.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +5 -2
- package/dist/components/Textarea/Textarea.js +37 -37
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/Textarea.styles.js +3 -2
- package/dist/components/Textarea/Textarea.styles.js.map +1 -1
- 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.d.ts +9 -1
- package/dist/components/ThemePicker/ThemePicker.js +3 -1
- package/dist/components/ThemePicker/ThemePicker.js.map +1 -1
- 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.d.ts +30 -10
- package/dist/components/ToggleGroup/ToggleGroup.js +60 -59
- package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.styles.js.map +1 -1
- package/dist/components/ToggleGroup/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.css.d.ts +0 -1
- package/dist/components/Tooltip/Tooltip.d.ts +9 -5
- package/dist/components/Tooltip/Tooltip.js +9 -9
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.styles.js +2 -2
- package/dist/components/Tooltip/Tooltip.styles.js.map +1 -1
- package/dist/components/TopBar/TopBar.styles.js.map +1 -1
- package/dist/components/UserMenu/UserMenu.d.ts +4 -3
- package/dist/components/UserMenu/UserMenu.js.map +1 -1
- 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 +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +51 -45
- package/dist/styles/input.css.d.ts +8 -0
- package/dist/styles/input.styles.js +3 -2
- package/dist/styles/input.styles.js.map +1 -1
- package/dist/styles/shared.css.d.ts +5 -0
- package/dist/styles/shared.styles.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/fontSize.d.ts +4 -4
- package/dist/theme/fontSize.js +8 -23
- package/dist/theme/fontSize.js.map +1 -1
- 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 +4 -4
- package/dist/theme/theme.js +18 -33
- package/dist/theme/theme.js.map +1 -1
- package/dist/tokens/index.d.ts +0 -2
- package/dist/tokens.js +1 -2
- package/package.json +6 -2
- package/skills/back-office-kit/SKILL.md +27 -14
- package/skills/back-office-kit/references/artifact-template.html +1 -0
- package/skills/back-office-kit/references/components.md +482 -251
- package/skills/back-office-kit/references/install.md +27 -4
- package/skills/back-office-kit/references/migrate.md +58 -2
- package/skills/back-office-kit/references/patterns.md +129 -33
- package/skills/back-office-kit/references/testing.md +26 -22
- package/dist/tokens/sprinkles.css.d.ts +0 -38
- package/dist/tokens/sprinkles.styles.js +0 -349
- package/dist/tokens/sprinkles.styles.js.map +0 -1
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
export interface DescriptionListItem {
|
|
3
|
+
/** The label, e.g. "Customer". */
|
|
3
4
|
term: ReactNode;
|
|
5
|
+
/** The value. */
|
|
4
6
|
description: ReactNode;
|
|
5
7
|
/** Show the description in the mono font, e.g. for IDs and codes. */
|
|
6
8
|
mono?: boolean;
|
|
9
|
+
/** Native tooltip on the value, e.g. the full text of a truncated value. */
|
|
10
|
+
title?: string;
|
|
11
|
+
/** Extra class on the value (`<dd>`), e.g. to truncate it. */
|
|
12
|
+
className?: string;
|
|
7
13
|
}
|
|
8
14
|
export interface DescriptionListProps extends Omit<ComponentProps<'dl'>, 'children'> {
|
|
15
|
+
/** Term/description pairs, in order. */
|
|
9
16
|
items: DescriptionListItem[];
|
|
10
17
|
/** `stacked`: term above value, one pair per row. `inline`: term and value side by side, terms aligned. `grid`: stacked pairs in responsive columns. */
|
|
11
18
|
layout?: 'stacked' | 'inline' | 'grid';
|
|
19
|
+
/** `sm` for dense panels such as drawers. */
|
|
12
20
|
size?: 'sm' | 'md';
|
|
13
21
|
}
|
|
14
22
|
/** Key/value facts as a semantic `<dl>`. Terms are muted, values use the main ink colour. */
|
|
@@ -15,7 +15,8 @@ function s({ items: s, layout: c = "stacked", size: l = "md", className: u, ...d
|
|
|
15
15
|
className: r({ size: l }),
|
|
16
16
|
children: t.term
|
|
17
17
|
}), /* @__PURE__ */ a("dd", {
|
|
18
|
-
|
|
18
|
+
title: t.title,
|
|
19
|
+
className: i(e, t.mono && "lljrgbe", t.className),
|
|
19
20
|
children: t.description
|
|
20
21
|
})]
|
|
21
22
|
}, s))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptionList.js","names":["styles.list","styles.pair","styles.term","styles.description","DescriptionList","props","clsx","list","className","items","pair","term","item","description","index"],"sources":["../../../src/components/DescriptionList/DescriptionList.tsx"],"sourcesContent":["import { clsx } from 'clsx'\nimport type { ComponentProps, ReactNode } from 'react'\n\nimport * as styles from './DescriptionList.css'\n\nexport interface DescriptionListItem {\n term: ReactNode\n description: ReactNode\n /** Show the description in the mono font, e.g. for IDs and codes. */\n mono?: boolean\n}\n\nexport interface DescriptionListProps extends Omit<ComponentProps<'dl'>, 'children'> {\n items: DescriptionListItem[]\n /** `stacked`: term above value, one pair per row. `inline`: term and value side by side, terms aligned. `grid`: stacked pairs in responsive columns. */\n layout?: 'stacked' | 'inline' | 'grid'\n size?: 'sm' | 'md'\n}\n\n/** Key/value facts as a semantic `<dl>`. Terms are muted, values use the main ink colour. */\nexport function DescriptionList({\n items,\n layout = 'stacked',\n size = 'md',\n className,\n ...props\n}: DescriptionListProps) {\n return (\n <dl className={clsx(styles.list({ layout, size }), className)} {...props}>\n {items.map((item, index) => (\n <div key={index} className={styles.pair({ layout })}>\n <dt className={styles.term({ size })}>{item.term}</dt>\n <dd
|
|
1
|
+
{"version":3,"file":"DescriptionList.js","names":["styles.list","styles.pair","styles.term","styles.description","DescriptionList","props","clsx","list","className","items","pair","term","item","description","index"],"sources":["../../../src/components/DescriptionList/DescriptionList.tsx"],"sourcesContent":["import { clsx } from 'clsx'\nimport type { ComponentProps, ReactNode } from 'react'\n\nimport * as styles from './DescriptionList.css'\n\nexport interface DescriptionListItem {\n /** The label, e.g. \"Customer\". */\n term: ReactNode\n /** The value. */\n description: ReactNode\n /** Show the description in the mono font, e.g. for IDs and codes. */\n mono?: boolean\n /** Native tooltip on the value, e.g. the full text of a truncated value. */\n title?: string\n /** Extra class on the value (`<dd>`), e.g. to truncate it. */\n className?: string\n}\n\nexport interface DescriptionListProps extends Omit<ComponentProps<'dl'>, 'children'> {\n /** Term/description pairs, in order. */\n items: DescriptionListItem[]\n /** `stacked`: term above value, one pair per row. `inline`: term and value side by side, terms aligned. `grid`: stacked pairs in responsive columns. */\n layout?: 'stacked' | 'inline' | 'grid'\n /** `sm` for dense panels such as drawers. */\n size?: 'sm' | 'md'\n}\n\n/** Key/value facts as a semantic `<dl>`. Terms are muted, values use the main ink colour. */\nexport function DescriptionList({\n items,\n layout = 'stacked',\n size = 'md',\n className,\n ...props\n}: DescriptionListProps) {\n return (\n <dl className={clsx(styles.list({ layout, size }), className)} {...props}>\n {items.map((item, index) => (\n <div key={index} className={styles.pair({ layout })}>\n <dt className={styles.term({ size })}>{item.term}</dt>\n <dd\n title={item.title}\n className={clsx(styles.description, item.mono && styles.mono, item.className)}\n >\n {item.description}\n </dd>\n </div>\n ))}\n </dl>\n )\n}\n"],"mappings":";;;;AA4BA,SAAgBI,EAAgB,EAC9B,UACA,YAAS,WACT,UAAO,MACP,cACA,GAAGC,KACoB;CACvB,OACE,kBAAC,MAAD;EAAI,WAAWC,EAAKN,EAAY;GAAE;GAAQ;EAAK,CAAC,GAAGQ,CAAS;EAAG,GAAIH;EAChE,UAAAI,EAAM,KAAK,GAAM,MAChB,kBAAC,OAAD;GAAiB,WAAWR,EAAY,EAAE,UAAO,CAAC;GAAlD,UAAA,CACE,kBAAC,MAAD;IAAI,WAAWC,EAAY,EAAE,QAAK,CAAC;IAAI,UAAAU,EAAK;GAAS,CAAA,GACrD,kBAAC,MAAD;IACE,OAAOA,EAAK;IACZ,WAAWN,EAAKH,GAAoBS,EAAK,QAAQ,WAAaA,EAAK,SAAS;IAE3E,UAAAA,EAAK;GACJ,CAAA,CACD;EARK,GAAAE,CAQL,CACN;CACC,CAAA;AAER"}
|
|
@@ -2,3 +2,4 @@ export declare const details: string;
|
|
|
2
2
|
export declare const summary: string;
|
|
3
3
|
export declare const chevron: string;
|
|
4
4
|
export declare const content: string;
|
|
5
|
+
export declare const tone: Record<"accent" | "success" | "warning" | "danger" | "info" | "neutral" | "highlight", string>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { BadgeTone } from '../Badge';
|
|
3
|
+
export type DetailsSummaryTone = BadgeTone;
|
|
2
4
|
export interface DetailsSummaryProps extends ComponentProps<'details'> {
|
|
3
5
|
/** Always-visible summary that toggles the content. */
|
|
4
6
|
heading: ReactNode;
|
|
7
|
+
/** Tints the panel and colours the summary, e.g. `danger` for a block of errors. `neutral` (default) is untinted. */
|
|
8
|
+
tone?: DetailsSummaryTone;
|
|
5
9
|
}
|
|
6
10
|
/** A styled native `<details>`/`<summary>` disclosure. */
|
|
7
|
-
export declare function DetailsSummary({ heading, className, children, ...props }: DetailsSummaryProps): import('react').JSX.Element;
|
|
11
|
+
export declare function DetailsSummary({ heading, tone, className, children, ...props }: DetailsSummaryProps): import('react').JSX.Element;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/Icon.js";
|
|
2
|
-
import { chevron as t, content as n, details as r, summary as i } from "./DetailsSummary.styles.js";
|
|
3
|
-
import { clsx as
|
|
4
|
-
import { ChevronRight as
|
|
5
|
-
import { jsx as
|
|
2
|
+
import { chevron as t, content as n, details as r, summary as i, tone as a } from "./DetailsSummary.styles.js";
|
|
3
|
+
import { clsx as o } from "clsx";
|
|
4
|
+
import { ChevronRight as s } from "lucide-react";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
// src/components/DetailsSummary/DetailsSummary.tsx
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
className:
|
|
10
|
-
...
|
|
11
|
-
children: [/* @__PURE__ */
|
|
7
|
+
function u({ heading: u, tone: d = "neutral", className: f, children: p, ...m }) {
|
|
8
|
+
return /* @__PURE__ */ l("details", {
|
|
9
|
+
className: o(r, a[d], f),
|
|
10
|
+
...m,
|
|
11
|
+
children: [/* @__PURE__ */ l("summary", {
|
|
12
12
|
className: i,
|
|
13
|
-
children: [/* @__PURE__ */
|
|
14
|
-
icon:
|
|
13
|
+
children: [/* @__PURE__ */ c(e, {
|
|
14
|
+
icon: s,
|
|
15
15
|
size: "sm",
|
|
16
16
|
className: t
|
|
17
|
-
}),
|
|
18
|
-
}), /* @__PURE__ */
|
|
17
|
+
}), u]
|
|
18
|
+
}), /* @__PURE__ */ c("div", {
|
|
19
19
|
className: n,
|
|
20
|
-
children:
|
|
20
|
+
children: p
|
|
21
21
|
})]
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
export {
|
|
24
|
+
export { u as DetailsSummary };
|
|
25
25
|
|
|
26
26
|
//# sourceMappingURL=DetailsSummary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailsSummary.js","names":["styles.details","styles.summary","styles.chevron","styles.content","DetailsSummary","props","clsx","details","className","summary","Icon","ChevronRight","chevron","heading","content"],"sources":["../../../src/components/DetailsSummary/DetailsSummary.tsx"],"sourcesContent":["import { clsx } from 'clsx'\nimport { ChevronRight } from 'lucide-react'\nimport type { ComponentProps, ReactNode } from 'react'\n\nimport { Icon } from '../Icon'\nimport * as styles from './DetailsSummary.css'\n\nexport interface DetailsSummaryProps extends ComponentProps<'details'> {\n /** Always-visible summary that toggles the content. */\n heading: ReactNode\n}\n\n/** A styled native `<details>`/`<summary>` disclosure. */\nexport function DetailsSummary({
|
|
1
|
+
{"version":3,"file":"DetailsSummary.js","names":["styles.details","styles.tone","tone","styles.summary","styles.chevron","styles.content","DetailsSummary","tone$1","props","clsx","details","tone","className","summary","Icon","ChevronRight","chevron","heading","content"],"sources":["../../../src/components/DetailsSummary/DetailsSummary.tsx"],"sourcesContent":["import { clsx } from 'clsx'\nimport { ChevronRight } from 'lucide-react'\nimport type { ComponentProps, ReactNode } from 'react'\n\nimport type { BadgeTone } from '../Badge'\nimport { Icon } from '../Icon'\nimport * as styles from './DetailsSummary.css'\n\nexport type DetailsSummaryTone = BadgeTone\n\nexport interface DetailsSummaryProps extends ComponentProps<'details'> {\n /** Always-visible summary that toggles the content. */\n heading: ReactNode\n /** Tints the panel and colours the summary, e.g. `danger` for a block of errors. `neutral` (default) is untinted. */\n tone?: DetailsSummaryTone\n}\n\n/** A styled native `<details>`/`<summary>` disclosure. */\nexport function DetailsSummary({\n heading,\n tone = 'neutral',\n className,\n children,\n ...props\n}: DetailsSummaryProps) {\n return (\n <details className={clsx(styles.details, styles.tone[tone], className)} {...props}>\n <summary className={styles.summary}>\n <Icon icon={ChevronRight} size=\"sm\" className={styles.chevron} />\n {heading}\n </summary>\n <div className={styles.content}>{children}</div>\n </details>\n )\n}\n"],"mappings":";;;;;;AAkBA,SAAgBM,EAAe,EAC7B,YACA,MAAAC,IAAO,WACP,cACA,aACA,GAAGC,KACmB;CACtB,OACE,kBAAC,WAAD;EAAS,WAAWC,EAAKT,GAAgBC,EAAYC,IAAOU,CAAS;EAAG,GAAIJ;EAA5E,UAAA,CACE,kBAAC,WAAD;GAAS,WAAWL;GAApB,UAAA,CACE,kBAACW,GAAD;IAAM,MAAMC;IAAc,MAAK;IAAK,WAAWX;GAAiB,CAAA,GAC/Da,CACM;EACT,CAAA,GAAA,kBAAC,OAAD;GAAK,WAAWZ;GAAiB;EAAc,CAAA,CACxC;;AAEb"}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
/* empty css */
|
|
3
3
|
// src/components/DetailsSummary/DetailsSummary.css.ts
|
|
4
|
-
var e = "
|
|
5
|
-
|
|
4
|
+
var e = "_1bffl0p1", t = "_1bffl0p2 tyvs8e0", n = "_1bffl0p3", r = "_1bffl0p4", i = {
|
|
5
|
+
neutral: "_1bffl0p5",
|
|
6
|
+
accent: "_1bffl0p6",
|
|
7
|
+
success: "_1bffl0p7",
|
|
8
|
+
warning: "_1bffl0p8",
|
|
9
|
+
danger: "_1bffl0p9",
|
|
10
|
+
info: "_1bffl0pa",
|
|
11
|
+
highlight: "_1bffl0pb"
|
|
12
|
+
};
|
|
13
|
+
export { n as chevron, r as content, e as details, t as summary, i as tone };
|
|
6
14
|
|
|
7
15
|
//# sourceMappingURL=DetailsSummary.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailsSummary.styles.js","names":["details","summary","chevron","content"],"sources":["../../../src/components/DetailsSummary/DetailsSummary.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 details = style({\n padding: space['4'],\n border: `1px solid ${vars.color.border}`,\n borderRadius: radius.xl,\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n fontFamily: vars.font.sans,\n fontSize: fontSize.md,\n})\n\nexport const summary = style([\n focusRing,\n {\n display: 'flex',\n alignItems: 'center',\n gap: space['2'],\n listStyle: 'none',\n fontWeight: fontWeight.semibold,\n cursor: 'pointer',\n borderRadius: radius.sm,\n selectors: { '&::-webkit-details-marker': { display: 'none' } },\n },\n])\n\nexport const chevron = style({\n color: vars.color.inkMuted,\n transition: 'transform 200ms',\n selectors: { [`${details}[open] &`]: { transform: 'rotate(90deg)' } },\n '@media': { '(prefers-reduced-motion: reduce)': { transition: 'none' } },\n})\n\nexport const content = style({ marginTop: space['3'] })\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"DetailsSummary.styles.js","names":["details","summary","chevron","content","tone"],"sources":["../../../src/components/DetailsSummary/DetailsSummary.css.ts"],"sourcesContent":["import { createVar, fallbackVar, style, styleVariants } 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\nconst toneInk = createVar()\n\nexport const details = style({\n padding: space['4'],\n border: `1px solid ${vars.color.border}`,\n borderRadius: radius.xl,\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n fontFamily: vars.font.sans,\n fontSize: fontSize.md,\n})\n\nexport const summary = style([\n focusRing,\n {\n display: 'flex',\n alignItems: 'center',\n gap: space['2'],\n listStyle: 'none',\n fontWeight: fontWeight.semibold,\n color: fallbackVar(toneInk, vars.color.ink),\n cursor: 'pointer',\n borderRadius: radius.sm,\n selectors: { '&::-webkit-details-marker': { display: 'none' } },\n },\n])\n\nexport const chevron = style({\n color: fallbackVar(toneInk, vars.color.inkMuted),\n transition: 'transform 200ms',\n selectors: { [`${details}[open] &`]: { transform: 'rotate(90deg)' } },\n '@media': { '(prefers-reduced-motion: reduce)': { transition: 'none' } },\n})\n\nexport const content = style({ marginTop: space['3'] })\n\nconst tinted = (bg: string, ink: string) => ({\n backgroundColor: bg,\n borderColor: `color-mix(in srgb, ${ink} 30%, transparent)`,\n vars: { [toneInk]: ink },\n})\n\n// Summary and chevron take the tone's ink; the content stays in the main ink.\nexport const tone = styleVariants({\n neutral: {},\n accent: tinted(vars.color.accentSubtle, vars.color.accentInk),\n success: tinted(vars.color.successSubtle, vars.color.successInk),\n warning: tinted(vars.color.warningSubtle, vars.color.warningInk),\n danger: tinted(vars.color.dangerSubtle, vars.color.dangerInk),\n info: tinted(vars.color.infoSubtle, vars.color.infoInk),\n highlight: tinted(vars.color.highlightSubtle, vars.color.highlightInk),\n})\n"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { DetailsSummary } from './DetailsSummary';
|
|
2
|
-
export type { DetailsSummaryProps } from './DetailsSummary';
|
|
2
|
+
export type { DetailsSummaryProps, DetailsSummaryTone } from './DetailsSummary';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const backdrop: string;
|
|
2
2
|
export declare const viewport: Record<"left" | "right", string>;
|
|
3
3
|
export declare const popup: Record<"left" | "right", string>;
|
|
4
|
+
export declare const size: Record<"sm" | "md" | "lg", string>;
|
|
4
5
|
export declare const content: string;
|
|
5
6
|
export declare const header: string;
|
|
6
7
|
export declare const headings: string;
|
|
@@ -8,4 +9,6 @@ export declare const title: string;
|
|
|
8
9
|
export declare const description: string;
|
|
9
10
|
export declare const body: string;
|
|
10
11
|
export declare const footer: string;
|
|
12
|
+
export declare const footerStart: string;
|
|
13
|
+
export declare const headerEnd: string;
|
|
11
14
|
export declare const close: string;
|
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
import { Drawer as BaseDrawer } from '@base-ui/react/drawer';
|
|
2
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { FormEventHandler, ReactElement, ReactNode } from 'react';
|
|
3
3
|
import { PartProps } from '../Field/Field';
|
|
4
4
|
export interface DrawerProps extends Omit<BaseDrawer.Root.Props, 'children' | 'swipeDirection'> {
|
|
5
5
|
/** The element that opens the drawer, e.g. `<Button>`. Omit when controlling `open` yourself. */
|
|
6
6
|
trigger?: ReactElement;
|
|
7
|
+
/** Heading, also the dialog's accessible name. */
|
|
7
8
|
title: ReactNode;
|
|
9
|
+
/** Muted text under the title, linked as the dialog's description. */
|
|
8
10
|
description?: ReactNode;
|
|
11
|
+
/** Scrolling body content. */
|
|
9
12
|
children?: ReactNode;
|
|
10
|
-
/**
|
|
13
|
+
/** Controls in the header, before the close button, e.g. a Menu or an Edit button. */
|
|
14
|
+
actions?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Actions pinned to the bottom right, e.g. Cancel and Save. The footer sits outside the body, so
|
|
17
|
+
* a submit button there only submits a `<form>` in the body if you give it `form="<form id>"`,
|
|
18
|
+
* or set `onSubmit` instead.
|
|
19
|
+
*/
|
|
11
20
|
footer?: ReactNode;
|
|
21
|
+
/** Secondary actions pinned to the bottom left, e.g. Archive or Copy link. */
|
|
22
|
+
footerStart?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Wraps the body and footer in a `<form>` with this handler, so a `type="submit"` button in the
|
|
25
|
+
* footer submits it. Call `event.preventDefault()` yourself (react-hook-form's `handleSubmit` does).
|
|
26
|
+
*/
|
|
27
|
+
onSubmit?: FormEventHandler<HTMLFormElement>;
|
|
28
|
+
/** Called when the drawer asks to close (Escape, close button, overlay click, swipe). Shorthand for `onOpenChange(false)`. */
|
|
29
|
+
onClose?: () => void;
|
|
30
|
+
/** Width: `sm` 28rem (default), `md` 36rem, `lg` 60rem. Always capped to the viewport. */
|
|
31
|
+
size?: 'sm' | 'md' | 'lg';
|
|
32
|
+
/** Screen edge the drawer slides in from (and is swiped back to). */
|
|
12
33
|
side?: 'right' | 'left';
|
|
13
34
|
/** Accessible label of the close button. */
|
|
14
35
|
closeLabel?: string;
|
|
@@ -18,4 +39,4 @@ export interface DrawerProps extends Omit<BaseDrawer.Root.Props, 'children' | 's
|
|
|
18
39
|
popupProps?: PartProps<BaseDrawer.Popup.Props>;
|
|
19
40
|
}
|
|
20
41
|
/** A modal side panel. Closes on Escape, the close button, an overlay click or a swipe. */
|
|
21
|
-
export declare function Drawer({ trigger, title, description, children, footer, side, closeLabel, className, popupProps, ...props }: DrawerProps): import('react').JSX.Element;
|
|
42
|
+
export declare function Drawer({ trigger, title, description, children, actions, footer, footerStart, onSubmit, onClose, onOpenChange, size, side, closeLabel, className, popupProps, ...props }: DrawerProps): import('react').JSX.Element;
|
|
@@ -1,66 +1,75 @@
|
|
|
1
1
|
import { Button as e } from "../Button/Button.js";
|
|
2
2
|
import { PortalContainer as t } from "../PortalContainer/PortalContainer.js";
|
|
3
|
-
import { backdrop as n, body as r, close as i, content as a, header as o,
|
|
4
|
-
import { useState as
|
|
5
|
-
import { clsx as
|
|
6
|
-
import { X as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { Drawer as
|
|
3
|
+
import { backdrop as n, body as r, close as i, content as a, header as o, headerEnd as s, headings as c, popup as l, size as u, title as d, viewport as f } from "./Drawer.styles.js";
|
|
4
|
+
import { useState as p } from "react";
|
|
5
|
+
import { clsx as m } from "clsx";
|
|
6
|
+
import { X as h } from "lucide-react";
|
|
7
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
8
|
+
import { Drawer as y } from "@base-ui/react/drawer";
|
|
9
9
|
// src/components/Drawer/Drawer.tsx
|
|
10
|
-
function
|
|
11
|
-
let [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
children:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
function b({ trigger: b, title: x, description: S, children: C, actions: w, footer: T, footerStart: E, onSubmit: D, onClose: O, onOpenChange: k, size: A = "sm", side: j = "right", closeLabel: M = "Close", className: N, popupProps: P, ...F }) {
|
|
11
|
+
let [I, L] = p(null), R = (e, t) => {
|
|
12
|
+
k?.(e, t), !e && !t.isCanceled && O?.();
|
|
13
|
+
}, z = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
|
|
14
|
+
className: r,
|
|
15
|
+
children: C
|
|
16
|
+
}), (T || E) && /* @__PURE__ */ v("div", {
|
|
17
|
+
className: "_6rz8ucf",
|
|
18
|
+
children: [E && /* @__PURE__ */ _("div", {
|
|
19
|
+
className: "_6rz8ucg",
|
|
20
|
+
children: E
|
|
21
|
+
}), T]
|
|
22
|
+
})] });
|
|
23
|
+
return /* @__PURE__ */ v(y.Root, {
|
|
24
|
+
swipeDirection: j,
|
|
25
|
+
onOpenChange: R,
|
|
26
|
+
...F,
|
|
27
|
+
children: [b && /* @__PURE__ */ _(y.Trigger, { render: b }), /* @__PURE__ */ v(y.Portal, { children: [/* @__PURE__ */ _(y.Backdrop, { className: n }), /* @__PURE__ */ _(y.Viewport, {
|
|
28
|
+
className: f[j],
|
|
29
|
+
children: /* @__PURE__ */ _(y.Popup, {
|
|
30
|
+
...P,
|
|
31
|
+
className: m(l[j], u[A], P?.className, N),
|
|
32
|
+
children: /* @__PURE__ */ _(y.Content, {
|
|
33
|
+
ref: L,
|
|
22
34
|
className: a,
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
container:
|
|
25
|
-
children: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
children: /* @__PURE__ */ v(t, {
|
|
36
|
+
container: I,
|
|
37
|
+
children: [/* @__PURE__ */ v("div", {
|
|
38
|
+
className: o,
|
|
39
|
+
children: [/* @__PURE__ */ v("div", {
|
|
40
|
+
className: c,
|
|
41
|
+
children: [/* @__PURE__ */ _(y.Title, {
|
|
42
|
+
className: d,
|
|
43
|
+
children: x
|
|
44
|
+
}), S && /* @__PURE__ */ _(y.Description, {
|
|
45
|
+
className: "_6rz8ucd",
|
|
46
|
+
children: S
|
|
47
|
+
})]
|
|
48
|
+
}), /* @__PURE__ */ v("div", {
|
|
49
|
+
className: s,
|
|
50
|
+
children: [w, /* @__PURE__ */ _(y.Close, { render: /* @__PURE__ */ _(e, {
|
|
38
51
|
variant: "ghost",
|
|
39
52
|
size: "sm",
|
|
40
53
|
iconOnly: !0,
|
|
41
|
-
icon: /* @__PURE__ */
|
|
54
|
+
icon: /* @__PURE__ */ _(h, {
|
|
42
55
|
size: "1.38em",
|
|
43
56
|
"aria-hidden": !0
|
|
44
57
|
}),
|
|
45
|
-
"aria-label":
|
|
58
|
+
"aria-label": M,
|
|
46
59
|
className: i
|
|
47
60
|
}) })]
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
className: "_6rz8ucc",
|
|
55
|
-
children: x
|
|
56
|
-
})
|
|
57
|
-
]
|
|
61
|
+
})]
|
|
62
|
+
}), D ? /* @__PURE__ */ _("form", {
|
|
63
|
+
className: a,
|
|
64
|
+
onSubmit: D,
|
|
65
|
+
children: z
|
|
66
|
+
}) : z]
|
|
58
67
|
})
|
|
59
68
|
})
|
|
60
69
|
})
|
|
61
70
|
})] })]
|
|
62
71
|
});
|
|
63
72
|
}
|
|
64
|
-
export {
|
|
73
|
+
export { b as Drawer };
|
|
65
74
|
|
|
66
75
|
//# sourceMappingURL=Drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","names":["Drawer","content","BaseDrawer","styles.backdrop","styles.viewport","styles.popup","styles.content","styles.header","styles.headings","styles.title","title","description","styles.
|
|
1
|
+
{"version":3,"file":"Drawer.js","names":["Drawer","content","_Fragment","styles.body","footer","footerStart","BaseDrawer","styles.backdrop","styles.viewport","styles.popup","styles.size","size","styles.content","styles.header","styles.headings","styles.title","title","description","styles.headerEnd","styles.close","Drawer$1","title$1","description$1","footer$1","footerStart$1","size$1","props","content$1","setContent","useState","handleOpenChange","onOpenChange","open","details","onClose","main","Fragment","body","Drawer","side","trigger","backdrop","viewport","popupProps","clsx","popup","size","className","content","PortalContainer","header","headings","title","headerEnd","actions","Button","X","closeLabel","close","onSubmit"],"sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import { Drawer as BaseDrawer } from '@base-ui/react/drawer'\nimport { clsx } from 'clsx'\nimport { X } from 'lucide-react'\nimport { useState, type FormEventHandler, type ReactElement, type ReactNode } from 'react'\n\nimport { Button } from '../Button'\nimport type { PartProps } from '../Field/Field'\nimport { PortalContainer } from '../PortalContainer'\nimport * as styles from './Drawer.css'\n\nexport interface DrawerProps extends Omit<BaseDrawer.Root.Props, 'children' | 'swipeDirection'> {\n /** The element that opens the drawer, e.g. `<Button>`. Omit when controlling `open` yourself. */\n trigger?: ReactElement\n /** Heading, also the dialog's accessible name. */\n title: ReactNode\n /** Muted text under the title, linked as the dialog's description. */\n description?: ReactNode\n /** Scrolling body content. */\n children?: ReactNode\n /** Controls in the header, before the close button, e.g. a Menu or an Edit button. */\n actions?: ReactNode\n /**\n * Actions pinned to the bottom right, e.g. Cancel and Save. The footer sits outside the body, so\n * a submit button there only submits a `<form>` in the body if you give it `form=\"<form id>\"`,\n * or set `onSubmit` instead.\n */\n footer?: ReactNode\n /** Secondary actions pinned to the bottom left, e.g. Archive or Copy link. */\n footerStart?: ReactNode\n /**\n * Wraps the body and footer in a `<form>` with this handler, so a `type=\"submit\"` button in the\n * footer submits it. Call `event.preventDefault()` yourself (react-hook-form's `handleSubmit` does).\n */\n onSubmit?: FormEventHandler<HTMLFormElement>\n /** Called when the drawer asks to close (Escape, close button, overlay click, swipe). Shorthand for `onOpenChange(false)`. */\n onClose?: () => void\n /** Width: `sm` 28rem (default), `md` 36rem, `lg` 60rem. Always capped to the viewport. */\n size?: 'sm' | 'md' | 'lg'\n /** Screen edge the drawer slides in from (and is swiped back to). */\n side?: 'right' | 'left'\n /** Accessible label of the close button. */\n closeLabel?: string\n /** Goes on the popup (role `dialog`). */\n className?: string\n /** Props for the popup (role `dialog`), e.g. `{ 'data-testid': 'run-drawer' }`. */\n popupProps?: PartProps<BaseDrawer.Popup.Props>\n}\n\n/** A modal side panel. Closes on Escape, the close button, an overlay click or a swipe. */\nexport function Drawer({\n trigger,\n title,\n description,\n children,\n actions,\n footer,\n footerStart,\n onSubmit,\n onClose,\n onOpenChange,\n size = 'sm',\n side = 'right',\n closeLabel = 'Close',\n className,\n popupProps,\n ...props\n}: DrawerProps) {\n // Popups (Select, Menu…) inside render into the drawer so they stay above it and inside its focus trap.\n // They go into Content, not Popup: a mouse press outside Content starts the swipe gesture, which\n // captures the pointer and sends the click to the drawer instead of the option.\n const [content, setContent] = useState<HTMLDivElement | null>(null)\n const handleOpenChange: BaseDrawer.Root.Props['onOpenChange'] = (open, details) => {\n onOpenChange?.(open, details)\n if (!open && !details.isCanceled) onClose?.()\n }\n const main = (\n <>\n <div className={styles.body}>{children}</div>\n {(footer || footerStart) && (\n <div className={styles.footer}>\n {footerStart && <div className={styles.footerStart}>{footerStart}</div>}\n {footer}\n </div>\n )}\n </>\n )\n return (\n <BaseDrawer.Root swipeDirection={side} onOpenChange={handleOpenChange} {...props}>\n {trigger && <BaseDrawer.Trigger render={trigger} />}\n <BaseDrawer.Portal>\n <BaseDrawer.Backdrop className={styles.backdrop} />\n <BaseDrawer.Viewport className={styles.viewport[side]}>\n <BaseDrawer.Popup\n {...popupProps}\n className={clsx(\n styles.popup[side],\n styles.size[size],\n popupProps?.className,\n className,\n )}\n >\n <BaseDrawer.Content ref={setContent} className={styles.content}>\n <PortalContainer container={content}>\n <div className={styles.header}>\n <div className={styles.headings}>\n <BaseDrawer.Title className={styles.title}>{title}</BaseDrawer.Title>\n {description && (\n <BaseDrawer.Description className={styles.description}>\n {description}\n </BaseDrawer.Description>\n )}\n </div>\n <div className={styles.headerEnd}>\n {actions}\n <BaseDrawer.Close\n render={\n <Button\n variant=\"ghost\"\n size=\"sm\"\n iconOnly\n icon={<X size=\"1.38em\" aria-hidden />}\n aria-label={closeLabel}\n className={styles.close}\n />\n }\n />\n </div>\n </div>\n {onSubmit ? (\n <form className={styles.content} onSubmit={onSubmit}>\n {main}\n </form>\n ) : (\n main\n )}\n </PortalContainer>\n </BaseDrawer.Content>\n </BaseDrawer.Popup>\n </BaseDrawer.Viewport>\n </BaseDrawer.Portal>\n </BaseDrawer.Root>\n )\n}\n"],"mappings":";;;;;;;;;AAiDA,SAAgBA,EAAO,EACrB,YACA,OAAAqB,GACA,aAAAC,GACA,aACA,YACA,QAAAC,GACA,aAAAC,GACA,aACA,YACA,iBACA,MAAAC,IAAO,MACP,UAAO,SACP,gBAAa,SACb,cACA,eACA,GAAGC,KACW;CAId,IAAM,CAACzB,GAAS2B,KAAcC,EAAgC,IAAI,GAC5DC,KAA2D,GAAM,MAAY;EAEjF,AADAC,IAAeC,GAAMC,CAAO,GACxB,CAACD,KAAQ,CAACC,EAAQ,cAAYC,IAAU;CAC9C,GACMC,IACJ,kBAAAjC,GAAA,EAAA,UAAA,CACE,kBAAC,OAAD;EAAK,WAAWC;EAAc;CAAc,CAAA,IAC1CC,KAAUC,MACV,kBAAC,OAAD;EAAK,WAAW;EAAhB,UAAA,CACGA,KAAe,kBAAC,OAAD;GAAK,WAAW;GAAqB,UAAAA;EAAiB,CAAA,GACrED,CACE;CAEP,CAAA,CAAA,EAAA,CAAA;CAEJ,OACE,kBAACE,EAAW,MAAZ;EAAiB,gBAAgBiC;EAAM,cAAcT;EAAkB,GAAIJ;EAA3E,UAAA,CACGc,KAAW,kBAAClC,EAAW,SAAZ,EAAoB,QAAQkC,EAAU,CAAA,GAClD,kBAAClC,EAAW,QAAZ,EAAA,UAAA,CACE,kBAACA,EAAW,UAAZ,EAAqB,WAAWC,EAAkB,CAAA,GAClD,kBAACD,EAAW,UAAZ;GAAqB,WAAWE,EAAgB+B;GAC9C,UAAA,kBAACjC,EAAW,OAAZ;IACE,GAAIqC;IACJ,WAAWC,EACTnC,EAAa8B,IACb7B,EAAYC,IACZgC,GAAY,WACZI,CACF;IAEA,UAAA,kBAACzC,EAAW,SAAZ;KAAoB,KAAKsB;KAAY,WAAWhB;KAC9C,UAAA,kBAACqC,GAAD;MAAiB,WAAWhD;MAA5B,UAAA,CACE,kBAAC,OAAD;OAAK,WAAWY;OAAhB,UAAA,CACE,kBAAC,OAAD;QAAK,WAAWC;QAAhB,UAAA,CACE,kBAACR,EAAW,OAAZ;SAAkB,WAAWS;SAAe,UAAAC;QAAwB,CAAA,GACnEC,KACC,kBAACX,EAAW,aAAZ;SAAwB,WAAW;SAChC,UAAAW;QACqB,CAAA,CAEvB;OACL,CAAA,GAAA,kBAAC,OAAD;QAAK,WAAWC;QAAhB,UAAA,CACGoC,GACD,kBAAChD,EAAW,OAAZ,EACE,QACE,kBAACiD,GAAD;SACE,SAAQ;SACR,MAAK;SACL,UAAA;SACA,MAAM,kBAACC,GAAD;UAAG,MAAK;UAAS,eAAA;SAAa,CAAA;SACpC,cAAYC;SACZ,WAAWtC;QACZ,CAAA,EAEJ,CAAA,CACE;OACF,CAAA,CAAA;MACJ,CAAA,GAAAwC,IACC,kBAAC,QAAD;OAAM,WAAW/C;OAA0B;OACxC,UAAAuB;MACG,CAAA,IAENA,CAEa;;IACC,CAAA;GACJ,CAAA;EACC,CAAA,CACJ,EAAA,CAAA,CACJ;;AAErB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* empty css */
|
|
1
2
|
/* empty css */
|
|
2
3
|
// src/components/Drawer/Drawer.css.ts
|
|
3
4
|
var e = "_6rz8uc0", t = {
|
|
@@ -6,7 +7,11 @@ var e = "_6rz8uc0", t = {
|
|
|
6
7
|
}, n = {
|
|
7
8
|
right: "_6rz8uc4 _6rz8uc3",
|
|
8
9
|
left: "_6rz8uc5 _6rz8uc3"
|
|
9
|
-
}, r =
|
|
10
|
-
|
|
10
|
+
}, r = {
|
|
11
|
+
sm: "_6rz8uc6",
|
|
12
|
+
md: "_6rz8uc7",
|
|
13
|
+
lg: "_6rz8uc8"
|
|
14
|
+
}, i = "_6rz8uc9", a = "_6rz8uca", o = "_6rz8ucb", s = "_6rz8ucc", c = "_6rz8ucd", l = "_6rz8uce tyvs8eb tyvs8e6", u = "_6rz8ucf", d = "_6rz8ucg", f = "_6rz8uch", p = "_6rz8uci";
|
|
15
|
+
export { e as backdrop, l as body, p as close, i as content, c as description, u as footer, d as footerStart, a as header, f as headerEnd, o as headings, n as popup, r as size, s as title, t as viewport };
|
|
11
16
|
|
|
12
17
|
//# sourceMappingURL=Drawer.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.styles.js","names":["backdrop","viewport","popup","content","header","headings","title","description","body","footer","close"],"sources":["../../../src/components/Drawer/Drawer.css.ts"],"sourcesContent":["import { style, styleVariants } from '@vanilla-extract/css'\n\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, space, zIndex } from '../../tokens/scale'\n\nconst reducedMotion = { '(prefers-reduced-motion: reduce)': { transition: 'none' } }\n\nexport const backdrop = style({\n position: 'fixed',\n zIndex: zIndex.overlay,\n inset: 0,\n backgroundColor: vars.color.overlay,\n opacity: 'calc(1 - var(--drawer-swipe-progress, 0))',\n transition: 'opacity 300ms cubic-bezier(0.32, 0.72, 0, 1)',\n selectors: {\n '&[data-starting-style], &[data-ending-style]': { opacity: 0 },\n '&[data-swiping]': { transitionDuration: '0ms' },\n },\n '@media': reducedMotion,\n})\n\nexport const viewport = styleVariants(\n {\n right: { justifyContent: 'flex-end' },\n left: { justifyContent: 'flex-start' },\n },\n (justify) => [{ position: 'fixed', inset: 0, zIndex: zIndex.overlay, display: 'flex' }, justify],\n)\n\nconst popupBase = style({\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'column',\n
|
|
1
|
+
{"version":3,"file":"Drawer.styles.js","names":["backdrop","viewport","popup","size","content","header","headings","title","description","body","footer","footerStart","headerEnd","close"],"sources":["../../../src/components/Drawer/Drawer.css.ts"],"sourcesContent":["import { style, styleVariants } from '@vanilla-extract/css'\n\nimport { scrollPanel } from '../../styles/shared.css'\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, lineHeight, space, zIndex } from '../../tokens/scale'\n\nconst reducedMotion = { '(prefers-reduced-motion: reduce)': { transition: 'none' } }\n\nexport const backdrop = style({\n position: 'fixed',\n zIndex: zIndex.overlay,\n inset: 0,\n backgroundColor: vars.color.overlay,\n opacity: 'calc(1 - var(--drawer-swipe-progress, 0))',\n transition: 'opacity 300ms cubic-bezier(0.32, 0.72, 0, 1)',\n selectors: {\n '&[data-starting-style], &[data-ending-style]': { opacity: 0 },\n '&[data-swiping]': { transitionDuration: '0ms' },\n },\n '@media': reducedMotion,\n})\n\nexport const viewport = styleVariants(\n {\n right: { justifyContent: 'flex-end' },\n left: { justifyContent: 'flex-start' },\n },\n (justify) => [{ position: 'fixed', inset: 0, zIndex: zIndex.overlay, display: 'flex' }, justify],\n)\n\nconst popupBase = style({\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'column',\n maxWidth: 'calc(100vw - 3rem)',\n height: '100%',\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n boxShadow: vars.shadow.lg,\n fontFamily: vars.font.sans,\n outline: 0,\n overscrollBehavior: 'contain',\n transition: 'transform 300ms cubic-bezier(0.32, 0.72, 0, 1)',\n selectors: { '&[data-swiping]': { userSelect: 'none', transitionDuration: '0ms' } },\n '@media': reducedMotion,\n})\n\nexport const popup = styleVariants({\n right: [\n popupBase,\n {\n transform: 'translateX(var(--drawer-swipe-movement-x, 0))',\n selectors: {\n '&[data-starting-style], &[data-ending-style]': { transform: 'translateX(100%)' },\n },\n },\n ],\n left: [\n popupBase,\n {\n transform: 'translateX(var(--drawer-swipe-movement-x, 0))',\n selectors: {\n '&[data-starting-style], &[data-ending-style]': { transform: 'translateX(-100%)' },\n },\n },\n ],\n})\n\nexport const size = styleVariants({\n sm: { width: '28rem' },\n md: { width: '36rem' },\n lg: { width: '60rem' },\n})\n\nexport const content = style({ display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 })\n\nexport const header = style({\n display: 'flex',\n alignItems: 'flex-start',\n gap: space['3'],\n padding: space['6'],\n paddingBottom: space['4'],\n borderBottom: `1px solid ${vars.color.border}`,\n})\n\nexport const headings = style({ flex: 1, minWidth: 0 })\n\nexport const title = style({\n margin: 0,\n fontSize: fontSize.xl,\n fontWeight: fontWeight.semibold,\n lineHeight: lineHeight.tight,\n})\n\nexport const description = style({\n margin: 0,\n marginTop: space['1'],\n fontSize: fontSize.md,\n color: vars.color.inkMuted,\n})\n\nexport const body = style([scrollPanel, { flex: 1, overflowY: 'auto', padding: space['6'] }])\n\nexport const footer = style({\n display: 'flex',\n justifyContent: 'flex-end',\n gap: space['3'],\n padding: space['4'],\n paddingInline: space['6'],\n borderTop: `1px solid ${vars.color.border}`,\n})\n\nexport const footerStart = style({\n display: 'flex',\n gap: space['3'],\n marginInlineEnd: 'auto',\n})\n\n// Header actions and the close button, nudged up to line up with the title.\nexport const headerEnd = style({\n display: 'flex',\n alignItems: 'center',\n gap: space['2'],\n marginTop: `calc(${space['1.5']} * -1)`,\n})\n\nexport const close = style({ marginInlineEnd: `calc(${space['2']} * -1)` })\n"],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const root: string;
|
|
2
|
+
export declare const icon: import('@vanilla-extract/recipes').RuntimeFn<{
|
|
3
|
+
tone: {
|
|
4
|
+
neutral: {
|
|
5
|
+
backgroundColor: `var(--${string})`;
|
|
6
|
+
color: `var(--${string})`;
|
|
7
|
+
};
|
|
8
|
+
danger: {
|
|
9
|
+
backgroundColor: `var(--${string})`;
|
|
10
|
+
color: `var(--${string})`;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
}>;
|
|
14
|
+
export declare const title: string;
|
|
15
|
+
export declare const body: string;
|
|
16
|
+
export declare const action: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
export interface EmptyStateProps extends Omit<ComponentProps<'div'>, 'title'> {
|
|
3
|
+
/** Shown in a tile above the title. Defaults to an inbox (or an alert for `danger`); `null` hides it. */
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
/** One short line, e.g. "No runs yet". */
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
/** Optional button or link, e.g. "Start a run" or "Retry". */
|
|
8
|
+
action?: ReactNode;
|
|
9
|
+
/** `danger` is the error variant ("Couldn't load runs"), announced with `role="alert"`. */
|
|
10
|
+
tone?: 'neutral' | 'danger';
|
|
11
|
+
/** Renders the title as `h2`–`h6`. Default is a `<p>`, which suits cards and table cells. */
|
|
12
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
13
|
+
}
|
|
14
|
+
/** A centred placeholder for an empty list, table or card, or a load error. Use `EmptyLine` for a one-liner. */
|
|
15
|
+
export declare function EmptyState({ icon, title, action, tone, headingLevel, className, children, ...props }: EmptyStateProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { icon as e, root as t, title as n } from "./EmptyState.styles.js";
|
|
2
|
+
import { clsx as r } from "clsx";
|
|
3
|
+
import { CircleAlert as i, Inbox as a } from "lucide-react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
// src/components/EmptyState/EmptyState.tsx
|
|
6
|
+
function c({ icon: c, title: l, action: u, tone: d = "neutral", headingLevel: f, className: p, children: m, ...h }) {
|
|
7
|
+
let g = f ? `h${f}` : "p", _ = c === void 0 ? o(d === "danger" ? i : a, {
|
|
8
|
+
size: "1.25rem",
|
|
9
|
+
"aria-hidden": !0
|
|
10
|
+
}) : c;
|
|
11
|
+
return /* @__PURE__ */ s("div", {
|
|
12
|
+
role: d === "danger" ? "alert" : void 0,
|
|
13
|
+
className: r(t, p),
|
|
14
|
+
...h,
|
|
15
|
+
children: [
|
|
16
|
+
_ != null && /* @__PURE__ */ o("span", {
|
|
17
|
+
className: e({ tone: d }),
|
|
18
|
+
children: _
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ o(g, {
|
|
21
|
+
className: n,
|
|
22
|
+
children: l
|
|
23
|
+
}),
|
|
24
|
+
m != null && /* @__PURE__ */ o("div", {
|
|
25
|
+
className: "_1hnnnjv5",
|
|
26
|
+
children: m
|
|
27
|
+
}),
|
|
28
|
+
u != null && /* @__PURE__ */ o("div", {
|
|
29
|
+
className: "_1hnnnjv6",
|
|
30
|
+
children: u
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export { c as EmptyState };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.js","names":["icon","styles.root","styles.icon","styles.title","title","action","EmptyState","icon$1","title$1","action$1","props","Title","headingLevel","glyph","jsx","tone","CircleAlert","Inbox","clsx","root","className","icon","title","children"],"sources":["../../../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import { clsx } from 'clsx'\nimport { CircleAlert, Inbox } from 'lucide-react'\nimport type { ComponentProps, ReactNode } from 'react'\n\nimport * as styles from './EmptyState.css'\n\nexport interface EmptyStateProps extends Omit<ComponentProps<'div'>, 'title'> {\n /** Shown in a tile above the title. Defaults to an inbox (or an alert for `danger`); `null` hides it. */\n icon?: ReactNode\n /** One short line, e.g. \"No runs yet\". */\n title: ReactNode\n /** Optional button or link, e.g. \"Start a run\" or \"Retry\". */\n action?: ReactNode\n /** `danger` is the error variant (\"Couldn't load runs\"), announced with `role=\"alert\"`. */\n tone?: 'neutral' | 'danger'\n /** Renders the title as `h2`–`h6`. Default is a `<p>`, which suits cards and table cells. */\n headingLevel?: 2 | 3 | 4 | 5 | 6\n}\n\n/** A centred placeholder for an empty list, table or card, or a load error. Use `EmptyLine` for a one-liner. */\nexport function EmptyState({\n icon,\n title,\n action,\n tone = 'neutral',\n headingLevel,\n className,\n children,\n ...props\n}: EmptyStateProps) {\n const Title = headingLevel ? (`h${headingLevel}` as const) : 'p'\n const glyph =\n icon === undefined ? (\n tone === 'danger' ? (\n <CircleAlert size=\"1.25rem\" aria-hidden />\n ) : (\n <Inbox size=\"1.25rem\" aria-hidden />\n )\n ) : (\n icon\n )\n return (\n <div\n role={tone === 'danger' ? 'alert' : undefined}\n className={clsx(styles.root, className)}\n {...props}\n >\n {glyph != null && <span className={styles.icon({ tone })}>{glyph}</span>}\n <Title className={styles.title}>{title}</Title>\n {children != null && <div className={styles.body}>{children}</div>}\n {action != null && <div className={styles.action}>{action}</div>}\n </div>\n )\n}\n"],"mappings":";;;;;AAoBA,SAAgBM,EAAW,EACzB,MAAAC,GACA,OAAAC,GACA,QAAAC,GACA,UAAO,WACP,iBACA,cACA,aACA,GAAGC,KACe;CAClB,IAAMC,IAAQC,IAAgB,IAAIA,MAA2B,KACvDC,IACJb,MAAS,KAAA,IAELc,EADFC,MAAS,WACNC,IAEAC,GAFD;EAAa,MAAK;EAAU,eAAA;CAAa,CAEN,IAGrCjB;CAEJ,OACE,kBAAC,OAAD;EACE,MAAMe,MAAS,WAAW,UAAU,KAAA;EACpC,WAAWG,EAAKjB,GAAamB,CAAS;EACtC,GAAIV;EAHN,UAAA;GAKGG,KAAS,QAAQ,kBAAC,QAAD;IAAM,WAAWX,EAAY,EAAE,QAAK,CAAC;IAAI,UAAAW;GAAY,CAAA;GACvE,kBAACF,GAAD;IAAO,WAAWR;IAAe,UAAAC;GAAa,CAAA;GAC7CmB,KAAY,QAAQ,kBAAC,OAAD;IAAK,WAAW;IAAc;GAAc,CAAA;GAChElB,KAAU,QAAQ,kBAAC,OAAD;IAAK,WAAW;IAAgB,UAAAA;GAAY,CAAA;EAC5D;;AAET"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
// src/components/EmptyState/EmptyState.css.ts
|
|
4
|
+
var t = "_1hnnnjv0", n = e({
|
|
5
|
+
defaultClassName: "_1hnnnjv1",
|
|
6
|
+
variantClassNames: { tone: {
|
|
7
|
+
neutral: "_1hnnnjv2",
|
|
8
|
+
danger: "_1hnnnjv3"
|
|
9
|
+
} },
|
|
10
|
+
defaultVariants: {},
|
|
11
|
+
compoundVariants: []
|
|
12
|
+
}), r = "_1hnnnjv4", i = "_1hnnnjv5", a = "_1hnnnjv6";
|
|
13
|
+
export { a as action, i as body, n as icon, t as root, r as title };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=EmptyState.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.styles.js","names":["_7a468","root","icon","createRuntimeFn","title","body","action"],"sources":["../../../src/components/EmptyState/EmptyState.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css'\nimport { recipe } from '@vanilla-extract/recipes'\n\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, lineHeight, radius, space } from '../../tokens/scale'\n\nexport const root = style({\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: space['2'],\n paddingBlock: space['6'],\n paddingInline: space['4'],\n fontFamily: vars.font.sans,\n textAlign: 'center',\n})\n\nexport const icon = recipe({\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '2.75rem',\n height: '2.75rem',\n marginBlockEnd: space['1'],\n borderRadius: radius.lg,\n },\n variants: {\n tone: {\n neutral: { backgroundColor: vars.color.surfaceSunken, color: vars.color.inkMuted },\n danger: { backgroundColor: vars.color.dangerSubtle, color: vars.color.dangerInk },\n },\n },\n})\n\nexport const title = style({\n margin: 0,\n fontSize: fontSize.lg,\n fontWeight: fontWeight.semibold,\n lineHeight: lineHeight.tight,\n color: vars.color.ink,\n})\n\nexport const body = style({\n maxWidth: '40ch',\n fontSize: fontSize.md,\n lineHeight: lineHeight.normal,\n color: vars.color.inkMuted,\n})\n\nexport const action = style({ marginBlockStart: space['2'] })\n"],"mappings":""}
|
|
@@ -10,6 +10,11 @@ export declare const chip: import('@vanilla-extract/recipes').RuntimeFn<{
|
|
|
10
10
|
borderColor: `var(--${string})`;
|
|
11
11
|
color: `var(--${string})`;
|
|
12
12
|
};
|
|
13
|
+
info: {
|
|
14
|
+
backgroundColor: `var(--${string})`;
|
|
15
|
+
borderColor: `var(--${string})`;
|
|
16
|
+
color: `var(--${string})`;
|
|
17
|
+
};
|
|
13
18
|
neutral: {
|
|
14
19
|
backgroundColor: `var(--${string})`;
|
|
15
20
|
borderColor: `var(--${string})`;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
+
export type EnvironmentTone = 'danger' | 'highlight' | 'info' | 'neutral';
|
|
3
|
+
/**
|
|
4
|
+
* The colour an environment name gets: production and live are `danger`; staging, UAT, QA, test
|
|
5
|
+
* and pre-prod are `highlight`; dev, ephemeral, preview, sandbox and demo are `info`; anything
|
|
6
|
+
* else (e.g. local) is `neutral`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function environmentTone(environment: string): EnvironmentTone;
|
|
2
9
|
export interface EnvironmentChipProps extends ComponentProps<'span'> {
|
|
3
|
-
/** Environment name, e.g. "
|
|
10
|
+
/** Environment name, shown as given, e.g. "Staging". Its colour comes from the name (see `environmentTone`). */
|
|
4
11
|
environment: string;
|
|
5
|
-
/** `danger` for production-like environments, so they stand out. */
|
|
6
|
-
tone?: 'highlight' | 'danger' | 'neutral';
|
|
7
12
|
}
|
|
8
|
-
/**
|
|
9
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Shows which environment the app is pointed at, coloured by its name so production always stands
|
|
15
|
+
* out. Put it in the TopBar `end` slot.
|
|
16
|
+
*/
|
|
17
|
+
export declare function EnvironmentChip({ environment, className, ...props }: EnvironmentChipProps): import('react').JSX.Element;
|