@boostdev/design-system-components 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +20 -18
- package/dist/client.cjs +236 -153
- package/dist/client.css +785 -702
- package/dist/client.d.cts +53 -94
- package/dist/client.d.ts +53 -94
- package/dist/client.js +237 -163
- package/dist/index.cjs +236 -153
- package/dist/index.css +785 -702
- package/dist/index.d.cts +53 -94
- package/dist/index.d.ts +53 -94
- package/dist/index.js +237 -163
- package/dist/native/index.cjs +991 -0
- package/dist/native/index.d.cts +208 -0
- package/dist/native/index.d.ts +208 -0
- package/dist/native/index.js +968 -0
- package/dist/web-components.d.ts +303 -0
- package/dist/web-components.js +1968 -0
- package/package.json +29 -7
- package/src/components/interaction/Button/Button.module.css +14 -11
- package/src/components/interaction/Button/Button.native.spec.tsx +35 -0
- package/src/components/interaction/Button/Button.native.stories.tsx +42 -0
- package/src/components/interaction/Button/Button.native.tsx +95 -0
- package/src/components/interaction/Button/Button.stories.tsx +1 -1
- package/src/components/interaction/Button/Button.tsx +2 -2
- package/src/components/interaction/Command/Command.mdx +16 -0
- package/src/components/interaction/Command/Command.module.css +12 -12
- package/src/components/interaction/Command/Command.stories.tsx +1 -1
- package/src/components/interaction/Command/Command.tsx +2 -2
- package/src/components/interaction/Dialog/Dialog.module.css +3 -3
- package/src/components/interaction/Dialog/Dialog.stories.tsx +1 -1
- package/src/components/interaction/Dialog/Dialog.tsx +2 -2
- package/src/components/interaction/Drawer/Drawer.mdx +14 -0
- package/src/components/interaction/Drawer/Drawer.module.css +3 -3
- package/src/components/interaction/Drawer/Drawer.stories.tsx +1 -1
- package/src/components/interaction/Drawer/Drawer.tsx +2 -2
- package/src/components/interaction/DropdownMenu/DropdownMenu.module.css +3 -3
- package/src/components/interaction/DropdownMenu/DropdownMenu.stories.tsx +1 -1
- package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +2 -2
- package/src/components/interaction/Popover/Popover.mdx +17 -0
- package/src/components/interaction/Popover/Popover.module.css +72 -15
- package/src/components/interaction/Popover/Popover.spec.tsx +68 -4
- package/src/components/interaction/Popover/Popover.stories.tsx +1 -1
- package/src/components/interaction/Popover/Popover.tsx +76 -20
- package/src/components/interaction/Rating/Rating.module.css +2 -2
- package/src/components/interaction/Rating/Rating.stories.tsx +1 -1
- package/src/components/interaction/Rating/Rating.tsx +2 -2
- package/src/components/interaction/Toast/Toast.module.css +16 -11
- package/src/components/interaction/Toast/Toast.spec.tsx +21 -0
- package/src/components/interaction/Toast/Toast.stories.tsx +1 -1
- package/src/components/interaction/Toast/Toast.tsx +22 -2
- package/src/components/interaction/form/Checkbox/Checkbox.mdx +2 -2
- package/src/components/interaction/form/Checkbox/Checkbox.module.css +5 -5
- package/src/components/interaction/form/Checkbox/Checkbox.native.spec.tsx +42 -0
- package/src/components/interaction/form/Checkbox/Checkbox.native.stories.tsx +36 -0
- package/src/components/interaction/form/Checkbox/Checkbox.native.tsx +80 -0
- package/src/components/interaction/form/Checkbox/Checkbox.stories.tsx +1 -1
- package/src/components/interaction/form/Checkbox/Checkbox.tsx +2 -2
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.mdx +44 -0
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.module.css +2 -2
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.stories.tsx +1 -1
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx +2 -2
- package/src/components/interaction/form/Combobox/Combobox.mdx +21 -0
- package/src/components/interaction/form/Combobox/Combobox.module.css +8 -8
- package/src/components/interaction/form/Combobox/Combobox.stories.tsx +1 -1
- package/src/components/interaction/form/Combobox/Combobox.tsx +2 -2
- package/src/components/interaction/form/FileInput/FileInput.mdx +14 -0
- package/src/components/interaction/form/FileInput/FileInput.module.css +8 -8
- package/src/components/interaction/form/FileInput/FileInput.stories.tsx +1 -1
- package/src/components/interaction/form/FileInput/FileInput.tsx +2 -2
- package/src/components/interaction/form/FormInput/FormInput.module.css +2 -2
- package/src/components/interaction/form/FormInput/FormInput.stories.tsx +1 -1
- package/src/components/interaction/form/FormInput/FormInput.tsx +2 -2
- package/src/components/interaction/form/NumberInput/NumberInput.mdx +16 -0
- package/src/components/interaction/form/NumberInput/NumberInput.module.css +4 -4
- package/src/components/interaction/form/NumberInput/NumberInput.stories.tsx +1 -1
- package/src/components/interaction/form/NumberInput/NumberInput.tsx +2 -2
- package/src/components/interaction/form/Radio/Radio.mdx +3 -3
- package/src/components/interaction/form/Radio/Radio.module.css +6 -6
- package/src/components/interaction/form/Radio/Radio.native.stories.tsx +46 -0
- package/src/components/interaction/form/Radio/Radio.native.tsx +79 -0
- package/src/components/interaction/form/Radio/Radio.stories.tsx +1 -1
- package/src/components/interaction/form/Radio/Radio.tsx +2 -2
- package/src/components/interaction/form/RadioGroup/RadioGroup.mdx +45 -0
- package/src/components/interaction/form/RadioGroup/RadioGroup.module.css +2 -2
- package/src/components/interaction/form/RadioGroup/RadioGroup.stories.tsx +1 -1
- package/src/components/interaction/form/RadioGroup/RadioGroup.tsx +2 -2
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.module.css +5 -5
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.stories.tsx +1 -1
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.tsx +2 -2
- package/src/components/interaction/form/Select/Select.module.css +3 -3
- package/src/components/interaction/form/Select/Select.stories.tsx +1 -1
- package/src/components/interaction/form/Select/Select.tsx +2 -2
- package/src/components/interaction/form/Slider/Slider.mdx +1 -1
- package/src/components/interaction/form/Slider/Slider.module.css +14 -14
- package/src/components/interaction/form/Slider/Slider.stories.tsx +1 -1
- package/src/components/interaction/form/Slider/Slider.tsx +2 -2
- package/src/components/interaction/form/Switch/Switch.mdx +4 -4
- package/src/components/interaction/form/Switch/Switch.module.css +8 -8
- package/src/components/interaction/form/Switch/Switch.native.spec.tsx +60 -0
- package/src/components/interaction/form/Switch/Switch.native.stories.tsx +35 -0
- package/src/components/interaction/form/Switch/Switch.native.tsx +59 -0
- package/src/components/interaction/form/Switch/Switch.stories.tsx +1 -1
- package/src/components/interaction/form/Switch/Switch.tsx +2 -2
- package/src/components/interaction/form/Textarea/Textarea.mdx +17 -0
- package/src/components/interaction/form/Textarea/Textarea.module.css +2 -2
- package/src/components/interaction/form/Textarea/Textarea.stories.tsx +1 -1
- package/src/components/interaction/form/Textarea/Textarea.tsx +2 -2
- package/src/components/interaction/form/atoms/InputContainer.tsx +2 -1
- package/src/components/interaction/form/atoms/Label.module.css +1 -1
- package/src/components/interaction/form/atoms/Label.native.stories.tsx +18 -0
- package/src/components/interaction/form/atoms/Label.native.tsx +29 -0
- package/src/components/interaction/form/atoms/Label.tsx +5 -3
- package/src/components/interaction/form/atoms/Message.native.spec.tsx +30 -0
- package/src/components/interaction/form/atoms/Message.native.stories.tsx +22 -0
- package/src/components/interaction/form/atoms/Message.native.tsx +34 -0
- package/src/components/interaction/form/atoms/Message.tsx +5 -3
- package/src/components/layout/ButtonGroup/ButtonGroup.native.stories.tsx +50 -0
- package/src/components/layout/ButtonGroup/ButtonGroup.native.tsx +34 -0
- package/src/components/layout/ButtonGroup/ButtonGroup.stories.tsx +1 -1
- package/src/components/layout/ButtonGroup/ButtonGroup.tsx +2 -2
- package/src/components/layout/Card/Card.module.css +2 -2
- package/src/components/layout/Card/Card.native.stories.tsx +53 -0
- package/src/components/layout/Card/Card.native.tsx +89 -0
- package/src/components/layout/Card/Card.stories.tsx +1 -1
- package/src/components/layout/Card/Card.tsx +2 -2
- package/src/components/layout/IconWrapper/IconWrapper.mdx +2 -2
- package/src/components/layout/IconWrapper/IconWrapper.module.css +3 -3
- package/src/components/layout/IconWrapper/IconWrapper.native.spec.tsx +39 -0
- package/src/components/layout/IconWrapper/IconWrapper.native.stories.tsx +41 -0
- package/src/components/layout/IconWrapper/IconWrapper.native.tsx +20 -0
- package/src/components/layout/IconWrapper/IconWrapper.stories.tsx +1 -1
- package/src/components/layout/IconWrapper/IconWrapper.tsx +2 -2
- package/src/components/layout/SectionHeader/SectionHeader.mdx +13 -0
- package/src/components/layout/SectionHeader/SectionHeader.module.css +2 -2
- package/src/components/layout/SectionHeader/SectionHeader.native.stories.tsx +38 -0
- package/src/components/layout/SectionHeader/SectionHeader.native.tsx +79 -0
- package/src/components/layout/SectionHeader/SectionHeader.stories.tsx +1 -1
- package/src/components/layout/SectionHeader/SectionHeader.tsx +2 -2
- package/src/components/ui/Accordion/Accordion.mdx +14 -0
- package/src/components/ui/Accordion/Accordion.module.css +5 -5
- package/src/components/ui/Accordion/Accordion.stories.tsx +1 -1
- package/src/components/ui/Accordion/Accordion.tsx +2 -2
- package/src/components/ui/Alert/Alert.module.css +15 -15
- package/src/components/ui/Alert/Alert.native.stories.tsx +43 -0
- package/src/components/ui/Alert/Alert.native.tsx +94 -0
- package/src/components/ui/Alert/Alert.stories.tsx +1 -1
- package/src/components/ui/Alert/Alert.tsx +2 -2
- package/src/components/ui/Avatar/Avatar.module.css +2 -2
- package/src/components/ui/Avatar/Avatar.native.spec.tsx +47 -0
- package/src/components/ui/Avatar/Avatar.native.stories.tsx +34 -0
- package/src/components/ui/Avatar/Avatar.native.tsx +85 -0
- package/src/components/ui/Avatar/Avatar.stories.tsx +1 -1
- package/src/components/ui/Avatar/Avatar.tsx +2 -2
- package/src/components/ui/Badge/Badge.mdx +2 -2
- package/src/components/ui/Badge/Badge.module.css +12 -12
- package/src/components/ui/Badge/Badge.native.stories.tsx +36 -0
- package/src/components/ui/Badge/Badge.native.tsx +50 -0
- package/src/components/ui/Badge/Badge.stories.tsx +1 -1
- package/src/components/ui/Badge/Badge.tsx +2 -2
- package/src/components/ui/Breadcrumb/Breadcrumb.module.css +2 -2
- package/src/components/ui/Breadcrumb/Breadcrumb.stories.tsx +1 -1
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +2 -2
- package/src/components/ui/Calendar/Calendar.mdx +16 -0
- package/src/components/ui/Calendar/Calendar.module.css +11 -11
- package/src/components/ui/Calendar/Calendar.stories.tsx +1 -1
- package/src/components/ui/Calendar/Calendar.tsx +2 -2
- package/src/components/ui/Carousel/Carousel.module.css +4 -4
- package/src/components/ui/Carousel/Carousel.stories.tsx +1 -1
- package/src/components/ui/Carousel/Carousel.tsx +2 -2
- package/src/components/ui/Collapsible/Collapsible.module.css +6 -6
- package/src/components/ui/Collapsible/Collapsible.stories.tsx +1 -1
- package/src/components/ui/Collapsible/Collapsible.tsx +2 -2
- package/src/components/ui/DescriptionList/DescriptionList.module.css +3 -3
- package/src/components/ui/DescriptionList/DescriptionList.stories.tsx +1 -1
- package/src/components/ui/DescriptionList/DescriptionList.tsx +2 -2
- package/src/components/ui/Link/Link.mdx +14 -0
- package/src/components/ui/Link/Link.module.css +4 -4
- package/src/components/ui/Link/Link.stories.tsx +1 -1
- package/src/components/ui/Link/Link.tsx +2 -2
- package/src/components/ui/Loading/Loading.module.css +2 -2
- package/src/components/ui/Loading/Loading.native.spec.tsx +24 -0
- package/src/components/ui/Loading/Loading.native.stories.tsx +33 -0
- package/src/components/ui/Loading/Loading.native.tsx +29 -0
- package/src/components/ui/Loading/Loading.stories.tsx +1 -1
- package/src/components/ui/Loading/Loading.tsx +2 -2
- package/src/components/ui/NotificationBanner/NotificationBanner.module.css +15 -15
- package/src/components/ui/NotificationBanner/NotificationBanner.native.stories.tsx +39 -0
- package/src/components/ui/NotificationBanner/NotificationBanner.native.tsx +76 -0
- package/src/components/ui/NotificationBanner/NotificationBanner.stories.tsx +1 -1
- package/src/components/ui/NotificationBanner/NotificationBanner.tsx +2 -2
- package/src/components/ui/Pagination/Pagination.module.css +8 -8
- package/src/components/ui/Pagination/Pagination.stories.tsx +1 -1
- package/src/components/ui/Pagination/Pagination.tsx +2 -2
- package/src/components/ui/Progress/Progress.mdx +1 -1
- package/src/components/ui/Progress/Progress.module.css +3 -3
- package/src/components/ui/Progress/Progress.native.stories.tsx +34 -0
- package/src/components/ui/Progress/Progress.native.tsx +84 -0
- package/src/components/ui/Progress/Progress.stories.tsx +1 -1
- package/src/components/ui/Progress/Progress.tsx +2 -2
- package/src/components/ui/ProgressCircle/ProgressCircle.module.css +3 -3
- package/src/components/ui/ProgressCircle/ProgressCircle.stories.tsx +1 -1
- package/src/components/ui/ProgressCircle/ProgressCircle.tsx +2 -2
- package/src/components/ui/Separator/Separator.mdx +14 -0
- package/src/components/ui/Separator/Separator.module.css +1 -1
- package/src/components/ui/Separator/Separator.native.stories.tsx +42 -0
- package/src/components/ui/Separator/Separator.native.tsx +32 -0
- package/src/components/ui/Separator/Separator.stories.tsx +1 -1
- package/src/components/ui/Separator/Separator.tsx +2 -2
- package/src/components/ui/Skeleton/Skeleton.module.css +3 -3
- package/src/components/ui/Skeleton/Skeleton.native.stories.tsx +33 -0
- package/src/components/ui/Skeleton/Skeleton.native.tsx +41 -0
- package/src/components/ui/Skeleton/Skeleton.stories.tsx +1 -1
- package/src/components/ui/Skeleton/Skeleton.tsx +2 -3
- package/src/components/ui/SkipLink/SkipLink.module.css +3 -3
- package/src/components/ui/SkipLink/SkipLink.stories.tsx +1 -1
- package/src/components/ui/SkipLink/SkipLink.tsx +5 -3
- package/src/components/ui/Table/Table.mdx +14 -0
- package/src/components/ui/Table/Table.module.css +11 -11
- package/src/components/ui/Table/Table.stories.tsx +1 -1
- package/src/components/ui/Table/Table.tsx +2 -2
- package/src/components/ui/Tabs/Tabs.module.css +3 -3
- package/src/components/ui/Tabs/Tabs.stories.tsx +1 -1
- package/src/components/ui/Tabs/Tabs.tsx +2 -2
- package/src/components/ui/Tooltip/Tooltip.mdx +14 -0
- package/src/components/ui/Tooltip/Tooltip.module.css +2 -2
- package/src/components/ui/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/components/ui/Tooltip/Tooltip.tsx +2 -2
- package/src/components/ui/Typography/Typography.mdx +13 -0
- package/src/components/ui/Typography/Typography.module.css +1 -1
- package/src/components/ui/Typography/Typography.native.stories.tsx +38 -0
- package/src/components/ui/Typography/Typography.native.tsx +65 -0
- package/src/components/ui/Typography/Typography.stories.tsx +1 -1
- package/src/components/ui/Typography/Typography.tsx +2 -2
- package/src/css/bdc.css +10 -2
- package/src/index.ts +3 -0
- package/src/native/ThemeContext.tsx +28 -0
- package/src/native/tokens.ts +13 -0
- package/src/native.ts +39 -0
- package/src/react-augment.d.ts +13 -0
- package/src/stories/DesignSystem/Borders.mdx +7 -7
- package/src/stories/DesignSystem/Colors.mdx +28 -29
- package/src/stories/DesignSystem/DarkMode.mdx +130 -0
- package/src/stories/DesignSystem/Elevation.mdx +4 -4
- package/src/stories/DesignSystem/Grid.mdx +5 -5
- package/src/stories/DesignSystem/Motion.mdx +2 -2
- package/src/stories/DesignSystem/Overview.mdx +1 -1
- package/src/stories/DesignSystem/Spacing.mdx +3 -3
- package/src/stories/DesignSystem/Typography.mdx +6 -6
- package/src/types.ts +2 -0
- package/src/typings.d.ts +3 -0
- package/src/web-components/globals.ts +61 -0
- package/src/web-components/index.ts +12 -0
- package/src/web-components/interaction/BdsButton.stories.tsx +60 -0
- package/src/web-components/interaction/BdsPopover.stories.tsx +70 -0
- package/src/web-components/interaction/BdsToastProvider.stories.tsx +73 -0
- package/src/web-components/interaction/bds-button.spec.ts +95 -0
- package/src/web-components/interaction/bds-button.ts +293 -0
- package/src/web-components/interaction/bds-popover.spec.ts +126 -0
- package/src/web-components/interaction/bds-popover.ts +217 -0
- package/src/web-components/interaction/bds-toast-provider.spec.ts +122 -0
- package/src/web-components/interaction/bds-toast-provider.ts +211 -0
- package/src/web-components/test/helpers.ts +14 -0
- package/src/web-components/ui/BdsAlert.stories.tsx +60 -0
- package/src/web-components/ui/BdsBadge.stories.tsx +37 -0
- package/src/web-components/ui/bds-alert.spec.ts +109 -0
- package/src/web-components/ui/bds-alert.ts +209 -0
- package/src/web-components/ui/bds-badge.spec.ts +51 -0
- package/src/web-components/ui/bds-badge.ts +88 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import css from './Table.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
6
|
export interface TableColumn<Row> {
|
|
6
7
|
key: string;
|
|
@@ -9,14 +10,13 @@ export interface TableColumn<Row> {
|
|
|
9
10
|
render?: (row: Row) => ReactNode;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
interface TableProps<Row extends Record<string, unknown>> {
|
|
13
|
+
interface TableProps<Row extends Record<string, unknown>> extends WithClassName {
|
|
13
14
|
columns: TableColumn<Row>[];
|
|
14
15
|
rows: Row[];
|
|
15
16
|
caption?: string;
|
|
16
17
|
sortKey?: string;
|
|
17
18
|
sortDirection?: 'asc' | 'desc';
|
|
18
19
|
onSort?: (key: string, direction: 'asc' | 'desc') => void;
|
|
19
|
-
className?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export function Table<Row extends Record<string, unknown>>({
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
.tabList {
|
|
8
8
|
display: flex;
|
|
9
|
-
border-bottom: 1px solid var(--bds-
|
|
9
|
+
border-bottom: 1px solid var(--bds-color_bg--subtle);
|
|
10
10
|
gap: var(--bds-space_xxs);
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
font-family: var(--bds-font_family--body);
|
|
19
19
|
font-size: var(--bds-font_size--body);
|
|
20
20
|
font-weight: var(--bds-font_weight--semibold);
|
|
21
|
-
color: var(--tab_color, var(--bds-
|
|
21
|
+
color: var(--tab_color, var(--bds-color_on-bg));
|
|
22
22
|
border-bottom: 2px solid var(--tab_border-color, transparent);
|
|
23
23
|
margin-bottom: -1px;
|
|
24
24
|
cursor: pointer;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
.tab.--active {
|
|
29
29
|
--tab_color: var(--bds-color_interactive_on-bg);
|
|
30
|
-
--tab_border-color: var(--bds-
|
|
30
|
+
--tab_border-color: var(--bds-color_interactive);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.tab:disabled {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KeyboardEvent, ReactNode, useId, useRef, useState } from 'react';
|
|
2
2
|
import css from './Tabs.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
6
|
export interface TabItem {
|
|
6
7
|
id: string;
|
|
@@ -9,10 +10,9 @@ export interface TabItem {
|
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
interface TabsProps {
|
|
13
|
+
interface TabsProps extends WithClassName {
|
|
13
14
|
tabs: TabItem[];
|
|
14
15
|
defaultTab?: string;
|
|
15
|
-
className?: string;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export function Tabs({ tabs, defaultTab, className }: Readonly<TabsProps>) {
|
|
@@ -36,6 +36,20 @@ Short contextual label that appears on hover or focus. Use to supplement icon bu
|
|
|
36
36
|
|
|
37
37
|
<ArgTypes of={Stories} />
|
|
38
38
|
|
|
39
|
+
## CSS variables
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<table>
|
|
43
|
+
<thead>
|
|
44
|
+
<tr><th>Variable</th><th>Default</th><th>Description</th></tr>
|
|
45
|
+
</thead>
|
|
46
|
+
<tbody>
|
|
47
|
+
<tr><td>`--tooltip_bg`</td><td>`var(--bds-color_on-bg)`</td><td>Tooltip background colour</td></tr>
|
|
48
|
+
<tr><td>`--tooltip_text`</td><td>`var(--bds-color_bg)`</td><td>Tooltip text colour</td></tr>
|
|
49
|
+
</tbody>
|
|
50
|
+
</table>
|
|
51
|
+
|
|
52
|
+
|
|
39
53
|
## Accessibility
|
|
40
54
|
|
|
41
55
|
- Tooltip content is linked via `aria-describedby` on the trigger element
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
z-index: var(--bds-z-index_popover);
|
|
11
11
|
padding: var(--bds-space_xxs) var(--bds-space_xs);
|
|
12
12
|
border-radius: var(--bds-border_radius--xs);
|
|
13
|
-
background-color: var(--tooltip_bg, var(--bds-
|
|
14
|
-
color: var(--tooltip_text, var(--bds-
|
|
13
|
+
background-color: var(--tooltip_bg, var(--bds-color_on-bg));
|
|
14
|
+
color: var(--tooltip_text, var(--bds-color_bg));
|
|
15
15
|
font-size: var(--bds-font_size--body--s);
|
|
16
16
|
line-height: var(--bds-font_line-height--body);
|
|
17
17
|
white-space: nowrap;
|
|
@@ -3,7 +3,7 @@ import { Tooltip } from './Tooltip';
|
|
|
3
3
|
import { Button } from '../../interaction/Button/Button';
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
|
-
title: 'UI/Tooltip',
|
|
6
|
+
title: 'React/UI/Tooltip',
|
|
7
7
|
component: Tooltip,
|
|
8
8
|
argTypes: {
|
|
9
9
|
placement: { control: 'radio', options: ['top', 'bottom', 'left', 'right'] },
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReactElement, ReactNode, cloneElement, isValidElement, useId, useState } from 'react';
|
|
2
2
|
import css from './Tooltip.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
|
-
interface TooltipProps {
|
|
6
|
+
interface TooltipProps extends WithClassName {
|
|
6
7
|
content: ReactNode;
|
|
7
8
|
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
8
9
|
children: ReactElement;
|
|
9
|
-
className?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function Tooltip({
|
|
@@ -35,6 +35,19 @@ Renders a text element with a design-system variant. Decouples visual style from
|
|
|
35
35
|
|
|
36
36
|
<ArgTypes of={Stories} />
|
|
37
37
|
|
|
38
|
+
## CSS variables
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<table>
|
|
42
|
+
<thead>
|
|
43
|
+
<tr><th>Variable</th><th>Default</th><th>Description</th></tr>
|
|
44
|
+
</thead>
|
|
45
|
+
<tbody>
|
|
46
|
+
<tr><td>`--typography_color`</td><td>`var(--bds-color_on-bg)`</td><td>Text colour override</td></tr>
|
|
47
|
+
</tbody>
|
|
48
|
+
</table>
|
|
49
|
+
|
|
50
|
+
|
|
38
51
|
## Accessibility
|
|
39
52
|
|
|
40
53
|
- Defaults to the semantically correct element for each variant (`h1`–`h3`, `p`)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { ThemeProvider } from '../../../native/ThemeContext';
|
|
4
|
+
import { Typography } from './Typography.native';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
tags: ['!stable', 'alpha'],
|
|
8
|
+
title: 'React Native/UI/Typography',
|
|
9
|
+
component: Typography,
|
|
10
|
+
decorators: [(Story) => <ThemeProvider><Story /></ThemeProvider>],
|
|
11
|
+
parameters: { layout: 'padded' },
|
|
12
|
+
argTypes: {
|
|
13
|
+
variant: { control: 'select', options: ['h1', 'h2', 'h3', 'body', 'body_s'] },
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<typeof Typography>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Heading1: Story = { args: { children: 'Heading 1', variant: 'h1' } };
|
|
21
|
+
export const Heading2: Story = { args: { children: 'Heading 2', variant: 'h2' } };
|
|
22
|
+
export const Heading3: Story = { args: { children: 'Heading 3', variant: 'h3' } };
|
|
23
|
+
export const Body: Story = { args: { children: 'The quick brown fox jumps over the lazy dog.', variant: 'body' } };
|
|
24
|
+
export const BodySmall: Story = { args: { children: 'The quick brown fox jumps over the lazy dog.', variant: 'body_s' } };
|
|
25
|
+
export const AllVariants: Story = {
|
|
26
|
+
args: { children: '' },
|
|
27
|
+
render: () => (
|
|
28
|
+
<ThemeProvider>
|
|
29
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
|
|
30
|
+
<Typography variant="h1">Heading 1</Typography>
|
|
31
|
+
<Typography variant="h2">Heading 2</Typography>
|
|
32
|
+
<Typography variant="h3">Heading 3</Typography>
|
|
33
|
+
<Typography variant="body">Body — The quick brown fox jumps over the lazy dog.</Typography>
|
|
34
|
+
<Typography variant="body_s">Body Small — The quick brown fox jumps over the lazy dog.</Typography>
|
|
35
|
+
</div>
|
|
36
|
+
</ThemeProvider>
|
|
37
|
+
),
|
|
38
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyleSheet, Text, StyleProp, TextStyle } from 'react-native';
|
|
3
|
+
import { font, lineHeight } from '../../../native/tokens';
|
|
4
|
+
import { useTheme } from '../../../native/ThemeContext';
|
|
5
|
+
|
|
6
|
+
type TypographyVariant = 'h1' | 'h2' | 'h3' | 'body' | 'body_s';
|
|
7
|
+
|
|
8
|
+
interface TypographyProps {
|
|
9
|
+
variant?: TypographyVariant;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
style?: StyleProp<TextStyle>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
base: {
|
|
16
|
+
fontFamily: font.family.body,
|
|
17
|
+
fontWeight: font.weight.body,
|
|
18
|
+
},
|
|
19
|
+
h1: {
|
|
20
|
+
fontSize: font.size.heading1,
|
|
21
|
+
fontFamily: font.family.heading,
|
|
22
|
+
fontWeight: font.weight.heading,
|
|
23
|
+
lineHeight: lineHeight.heading1,
|
|
24
|
+
},
|
|
25
|
+
h2: {
|
|
26
|
+
fontSize: font.size.heading2,
|
|
27
|
+
fontFamily: font.family.heading,
|
|
28
|
+
fontWeight: font.weight.heading,
|
|
29
|
+
lineHeight: lineHeight.heading2,
|
|
30
|
+
},
|
|
31
|
+
h3: {
|
|
32
|
+
fontSize: font.size.heading3,
|
|
33
|
+
fontFamily: font.family.heading,
|
|
34
|
+
fontWeight: font.weight.heading,
|
|
35
|
+
lineHeight: lineHeight.heading3,
|
|
36
|
+
},
|
|
37
|
+
body: {
|
|
38
|
+
fontSize: font.size.body,
|
|
39
|
+
lineHeight: lineHeight.body,
|
|
40
|
+
},
|
|
41
|
+
body_s: {
|
|
42
|
+
fontSize: font.size.bodyS,
|
|
43
|
+
lineHeight: lineHeight.bodyS,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const accessibilityRoles: Record<TypographyVariant, 'header' | 'text'> = {
|
|
48
|
+
h1: 'header',
|
|
49
|
+
h2: 'header',
|
|
50
|
+
h3: 'header',
|
|
51
|
+
body: 'text',
|
|
52
|
+
body_s: 'text',
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export function Typography({ variant = 'body', children, style }: TypographyProps) {
|
|
56
|
+
const { colors } = useTheme();
|
|
57
|
+
return (
|
|
58
|
+
<Text
|
|
59
|
+
accessibilityRole={accessibilityRoles[variant]}
|
|
60
|
+
style={[styles.base, styles[variant], { color: colors.colorOnBg }, style]}
|
|
61
|
+
>
|
|
62
|
+
{children}
|
|
63
|
+
</Text>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { Typography } from './Typography';
|
|
3
3
|
|
|
4
4
|
const meta = {
|
|
5
|
-
title: 'UI/Typography',
|
|
5
|
+
title: 'React/UI/Typography',
|
|
6
6
|
component: Typography,
|
|
7
7
|
argTypes: {
|
|
8
8
|
variant: { control: 'select', options: ['h1', 'h2', 'h3', 'body', 'body_s'] },
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ReactNode, ElementType } from 'react';
|
|
2
2
|
import css from './Typography.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
6
|
type TypographyVariant = 'h1' | 'h2' | 'h3' | 'body' | 'body_s';
|
|
6
7
|
|
|
7
|
-
interface TypographyProps {
|
|
8
|
+
interface TypographyProps extends WithClassName {
|
|
8
9
|
variant?: TypographyVariant;
|
|
9
10
|
component?: ElementType;
|
|
10
11
|
children: ReactNode;
|
|
11
|
-
className?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const variantToElement: Record<TypographyVariant, ElementType> = {
|
package/src/css/bdc.css
CHANGED
|
@@ -52,8 +52,16 @@
|
|
|
52
52
|
|
|
53
53
|
/* Colour tokens (kept as --bdc_color — see naming note above) */
|
|
54
54
|
--bdc_color: currentcolor;
|
|
55
|
-
--bdc_color--focus: var(--bds-
|
|
56
|
-
--bdc_color--error: var(--bds-
|
|
55
|
+
--bdc_color--focus: var(--bds-color_interactive);
|
|
56
|
+
--bdc_color--error: var(--bds-color_error);
|
|
57
|
+
|
|
58
|
+
/* Active / selected state colours — override these to theme all filled form controls globally */
|
|
59
|
+
--bdc-color_active: var(--bds-color_green);
|
|
60
|
+
--bdc-color_on-active: var(--bds-color_on-green);
|
|
61
|
+
--bdc-color_active--subtle: var(--bds-color_green--subtle);
|
|
62
|
+
--bdc-color_on-active--subtle: var(--bds-color_on-green--subtle);
|
|
63
|
+
--bdc-color_active--strong: var(--bds-color_green--strong);
|
|
64
|
+
--bdc-color_on-active--strong: var(--bds-color_on-green--strong);
|
|
57
65
|
|
|
58
66
|
/* Outline geometry */
|
|
59
67
|
--bdc-outline_width: 1px;
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import './css/bdc.css';
|
|
2
|
+
|
|
1
3
|
// UI
|
|
2
4
|
export { Accordion } from './components/ui/Accordion';
|
|
3
5
|
export type { AccordionItem } from './components/ui/Accordion';
|
|
@@ -71,3 +73,4 @@ export type { IconWrapperProps } from './components/layout/IconWrapper';
|
|
|
71
73
|
|
|
72
74
|
// Utilities
|
|
73
75
|
export { cn } from '@boostdev/design-system-foundation';
|
|
76
|
+
export type { WithClassName } from './types';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createContext, ReactNode, useContext, useMemo } from 'react';
|
|
2
|
+
import { useColorScheme } from 'react-native';
|
|
3
|
+
import { colors } from './tokens';
|
|
4
|
+
|
|
5
|
+
type ThemeColors = typeof colors.light | typeof colors.dark;
|
|
6
|
+
|
|
7
|
+
interface ThemeContextValue {
|
|
8
|
+
colors: ThemeColors;
|
|
9
|
+
isDark: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const ThemeContext = createContext<ThemeContextValue | null>(null);
|
|
13
|
+
|
|
14
|
+
export function ThemeProvider({ children }: { children: ReactNode }) {
|
|
15
|
+
const scheme = useColorScheme();
|
|
16
|
+
const isDark = scheme === 'dark';
|
|
17
|
+
const value = useMemo<ThemeContextValue>(
|
|
18
|
+
() => ({ colors: isDark ? colors.dark : colors.light, isDark }),
|
|
19
|
+
[isDark],
|
|
20
|
+
);
|
|
21
|
+
return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function useTheme(): ThemeContextValue {
|
|
25
|
+
const ctx = useContext(ThemeContext);
|
|
26
|
+
if (!ctx) throw new Error('useTheme must be used within ThemeProvider');
|
|
27
|
+
return ctx;
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { colors, spacing, font, border, zIndex, animation } from '@boostdev/design-system-foundation/native';
|
|
2
|
+
|
|
3
|
+
export { colors, spacing, font, border, zIndex, animation };
|
|
4
|
+
|
|
5
|
+
/** Absolute lineHeight values for React Native (ratio × fontSize). */
|
|
6
|
+
export const lineHeight = {
|
|
7
|
+
display: Math.round(font.size.display * font.lineHeight.display),
|
|
8
|
+
heading1: Math.round(font.size.heading1 * font.lineHeight.heading),
|
|
9
|
+
heading2: Math.round(font.size.heading2 * font.lineHeight.heading),
|
|
10
|
+
heading3: Math.round(font.size.heading3 * font.lineHeight.heading),
|
|
11
|
+
body: Math.round(font.size.body * font.lineHeight.body),
|
|
12
|
+
bodyS: Math.round(font.size.bodyS * font.lineHeight.body),
|
|
13
|
+
} as const;
|
package/src/native.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// React Native component barrel
|
|
2
|
+
// Explicitly imports *.native.tsx variants so tsup compiles them into dist/native/index.js.
|
|
3
|
+
// Metro resolves this via the "react-native" export condition in package.json.
|
|
4
|
+
|
|
5
|
+
// Infrastructure
|
|
6
|
+
export { ThemeProvider, useTheme } from './native/ThemeContext';
|
|
7
|
+
|
|
8
|
+
// UI
|
|
9
|
+
export { Typography } from './components/ui/Typography/Typography.native';
|
|
10
|
+
export { Badge } from './components/ui/Badge/Badge.native';
|
|
11
|
+
export { Avatar } from './components/ui/Avatar/Avatar.native';
|
|
12
|
+
export { Separator } from './components/ui/Separator/Separator.native';
|
|
13
|
+
export { Loading } from './components/ui/Loading/Loading.native';
|
|
14
|
+
export { Progress } from './components/ui/Progress/Progress.native';
|
|
15
|
+
export { Skeleton } from './components/ui/Skeleton/Skeleton.native';
|
|
16
|
+
export { Alert } from './components/ui/Alert/Alert.native';
|
|
17
|
+
export { NotificationBanner } from './components/ui/NotificationBanner/NotificationBanner.native';
|
|
18
|
+
|
|
19
|
+
// Layout
|
|
20
|
+
export { Card } from './components/layout/Card/Card.native';
|
|
21
|
+
export { SectionHeader } from './components/layout/SectionHeader/SectionHeader.native';
|
|
22
|
+
export { IconWrapper } from './components/layout/IconWrapper/IconWrapper.native';
|
|
23
|
+
export type { IconWrapperProps } from './components/layout/IconWrapper/IconWrapper.native';
|
|
24
|
+
export { ButtonGroup } from './components/layout/ButtonGroup/ButtonGroup.native';
|
|
25
|
+
export type { ButtonGroupProps } from './components/layout/ButtonGroup/ButtonGroup.native';
|
|
26
|
+
|
|
27
|
+
// Interaction
|
|
28
|
+
export { Button } from './components/interaction/Button/Button.native';
|
|
29
|
+
export type { ButtonProps } from './components/interaction/Button/Button.native';
|
|
30
|
+
export { Switch } from './components/interaction/form/Switch/Switch.native';
|
|
31
|
+
export { Checkbox } from './components/interaction/form/Checkbox/Checkbox.native';
|
|
32
|
+
export { Radio } from './components/interaction/form/Radio/Radio.native';
|
|
33
|
+
|
|
34
|
+
// Atoms
|
|
35
|
+
export { Label } from './components/interaction/form/atoms/Label.native';
|
|
36
|
+
export { Message } from './components/interaction/form/atoms/Message.native';
|
|
37
|
+
|
|
38
|
+
// Tokens (re-exported for convenience)
|
|
39
|
+
export { colors, spacing, font, border, zIndex, animation, lineHeight } from './native/tokens';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file MUST be a module (not a global script) so that `declare module 'react'`
|
|
2
|
+
// is treated as an augmentation that merges with @types/react rather than as an
|
|
3
|
+
// ambient module declaration that would shadow @types/react entirely.
|
|
4
|
+
// The `export {}` below is what makes TypeScript treat this as a module.
|
|
5
|
+
export {};
|
|
6
|
+
|
|
7
|
+
// CSS Anchor Positioning properties — not yet in React's CSSProperties types.
|
|
8
|
+
declare module 'react' {
|
|
9
|
+
interface CSSProperties {
|
|
10
|
+
anchorName?: string;
|
|
11
|
+
positionAnchor?: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -7,7 +7,7 @@ export const BorderDemo = ({ label, token, color = 'currentcolor', offset = '-1p
|
|
|
7
7
|
<div style={{
|
|
8
8
|
width: '8rem',
|
|
9
9
|
height: '5rem',
|
|
10
|
-
background: 'var(--bds-
|
|
10
|
+
background: 'var(--bds-color_bg)',
|
|
11
11
|
borderRadius: '0.5rem',
|
|
12
12
|
outline: `${width} solid ${color}`,
|
|
13
13
|
outlineOffset: offset,
|
|
@@ -64,11 +64,11 @@ Components use `outline` rather than `border` for their decorative edge. The rea
|
|
|
64
64
|
|
|
65
65
|
## Visual examples
|
|
66
66
|
|
|
67
|
-
<div style={{ display: 'flex', gap: '2.5rem', flexWrap: 'wrap', padding: '2rem', background: 'var(--bds-
|
|
67
|
+
<div style={{ display: 'flex', gap: '2.5rem', flexWrap: 'wrap', padding: '2rem', background: 'var(--bds-color_bg--subtle)', borderRadius: '0.75rem', marginBottom: '2rem' }}>
|
|
68
68
|
<BorderDemo label="Default" token="currentcolor" color="currentcolor" />
|
|
69
|
-
<BorderDemo label="Focus" token="--bdc_color--focus" color="var(--bds-
|
|
70
|
-
<BorderDemo label="Error" token="--bdc_color--error" color="var(--bds-
|
|
71
|
-
<BorderDemo label="Outer halo" token="--bdc-outline_offset: 2px" color="var(--bds-
|
|
69
|
+
<BorderDemo label="Focus" token="--bdc_color--focus" color="var(--bds-color_interactive)" />
|
|
70
|
+
<BorderDemo label="Error" token="--bdc_color--error" color="var(--bds-color_error)" />
|
|
71
|
+
<BorderDemo label="Outer halo" token="--bdc-outline_offset: 2px" color="var(--bds-color_interactive)" offset="2px" width="2px" />
|
|
72
72
|
</div>
|
|
73
73
|
|
|
74
74
|
| State | `--bdc_color` resolves to | Trigger |
|
|
@@ -123,13 +123,13 @@ Override a component's border colour for a specific context by reassigning `--bd
|
|
|
123
123
|
```css
|
|
124
124
|
/* Scoped to a single component instance */
|
|
125
125
|
.my-context .my-input {
|
|
126
|
-
--bdc_color: var(--bds-
|
|
126
|
+
--bdc_color: var(--bds-color_warning);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/* Override globally via the token layer */
|
|
130
130
|
@layer tokens.override {
|
|
131
131
|
:root {
|
|
132
|
-
--bdc_color: var(--bds-
|
|
132
|
+
--bdc_color: var(--bds-color_green);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
```
|
|
@@ -47,12 +47,12 @@ export const TokenRow = ({ token, description }) => (
|
|
|
47
47
|
# Colours
|
|
48
48
|
|
|
49
49
|
Colours are the most visible part of the design system.
|
|
50
|
-
Every colour token comes in surface–content pairs: for every `--bds
|
|
50
|
+
Every colour token comes in surface–content pairs: for every `--bds-color_*` there is a `--bds-color_on-*` that guarantees WCAG AA contrast.
|
|
51
51
|
|
|
52
52
|
```css
|
|
53
53
|
.badge {
|
|
54
|
-
background-color: var(--bds-
|
|
55
|
-
color: var(--bds-
|
|
54
|
+
background-color: var(--bds-color_success--subtle);
|
|
55
|
+
color: var(--bds-color_on-success--subtle); /* always legible */
|
|
56
56
|
}
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -63,57 +63,56 @@ These are the tokens you should use in component CSS. They adapt automatically t
|
|
|
63
63
|
### Brand & intent
|
|
64
64
|
|
|
65
65
|
<SwatchRow>
|
|
66
|
-
<Swatch label="
|
|
67
|
-
<Swatch label="
|
|
68
|
-
<Swatch label="Brand" token="--bds-brand" bg="var(--bds-brand)" text="var(--bds-on-brand)" />
|
|
66
|
+
<Swatch label="Interactive" token="--bds-color_interactive" bg="var(--bds-color_interactive)" text="var(--bds-color_on-interactive)" />
|
|
67
|
+
<Swatch label="Green (CTA)" token="--bds-color_green" bg="var(--bds-color_green)" text="var(--bds-color_on-green)" />
|
|
69
68
|
</SwatchRow>
|
|
70
69
|
|
|
71
70
|
### Status
|
|
72
71
|
|
|
73
72
|
<SwatchRow>
|
|
74
|
-
<Swatch label="Success" token="--bds-
|
|
75
|
-
<Swatch label="Warning" token="--bds-
|
|
76
|
-
<Swatch label="Error" token="--bds-
|
|
77
|
-
<Swatch label="Important" token="--bds-
|
|
73
|
+
<Swatch label="Success" token="--bds-color_success" bg="var(--bds-color_success)" text="var(--bds-color_on-success)" />
|
|
74
|
+
<Swatch label="Warning" token="--bds-color_warning" bg="var(--bds-color_warning)" text="var(--bds-color_on-warning)" />
|
|
75
|
+
<Swatch label="Error" token="--bds-color_error" bg="var(--bds-color_error)" text="var(--bds-color_on-error)" />
|
|
76
|
+
<Swatch label="Important" token="--bds-color_important" bg="var(--bds-color_important)" text="var(--bds-color_on-important)" />
|
|
78
77
|
</SwatchRow>
|
|
79
78
|
|
|
80
79
|
### Surface
|
|
81
80
|
|
|
82
81
|
<SwatchRow>
|
|
83
|
-
<Swatch label="Background" token="--bds-
|
|
84
|
-
<Swatch label="Subtle background" token="--bds-
|
|
82
|
+
<Swatch label="Background" token="--bds-color_bg" bg="var(--bds-color_bg)" text="var(--bds-color_on-bg)" />
|
|
83
|
+
<Swatch label="Subtle background" token="--bds-color_bg--subtle" bg="var(--bds-color_bg--subtle)" text="var(--bds-color_on-bg--subtle)" />
|
|
85
84
|
</SwatchRow>
|
|
86
85
|
|
|
87
86
|
### Neutral grey scale
|
|
88
87
|
|
|
89
88
|
<SwatchRow>
|
|
90
|
-
<Swatch label="Grey subtle" token="--bds-
|
|
91
|
-
<Swatch label="Grey" token="--bds-
|
|
92
|
-
<Swatch label="Grey strong" token="--bds-
|
|
89
|
+
<Swatch label="Grey subtle" token="--bds-color_grey--subtle" bg="var(--bds-color_grey--subtle)" text="var(--bds-color_on-grey--subtle)" />
|
|
90
|
+
<Swatch label="Grey" token="--bds-color_grey" bg="var(--bds-color_grey)" text="var(--bds-color_on-grey)" />
|
|
91
|
+
<Swatch label="Grey strong" token="--bds-color_grey--strong" bg="var(--bds-color_grey--strong)" text="var(--bds-color_on-grey--strong)" />
|
|
93
92
|
</SwatchRow>
|
|
94
93
|
|
|
95
94
|
### Green scale
|
|
96
95
|
|
|
97
96
|
<SwatchRow>
|
|
98
|
-
<Swatch label="Green subtle" token="--bds-
|
|
99
|
-
<Swatch label="Green" token="--bds-
|
|
100
|
-
<Swatch label="Green strong" token="--bds-
|
|
97
|
+
<Swatch label="Green subtle" token="--bds-color_green--subtle" bg="var(--bds-color_green--subtle)" text="var(--bds-color_on-green--subtle)" />
|
|
98
|
+
<Swatch label="Green" token="--bds-color_green" bg="var(--bds-color_green)" text="var(--bds-color_on-green)" />
|
|
99
|
+
<Swatch label="Green strong" token="--bds-color_green--strong" bg="var(--bds-color_green--strong)" text="var(--bds-color_on-green--strong)" />
|
|
101
100
|
</SwatchRow>
|
|
102
101
|
|
|
103
102
|
### Blue scale
|
|
104
103
|
|
|
105
104
|
<SwatchRow>
|
|
106
|
-
<Swatch label="Blue subtle" token="--bds-
|
|
107
|
-
<Swatch label="Blue" token="--bds-
|
|
108
|
-
<Swatch label="Blue strong" token="--bds-
|
|
105
|
+
<Swatch label="Blue subtle" token="--bds-color_blue--subtle" bg="var(--bds-color_blue--subtle)" text="var(--bds-color_on-blue--subtle)" />
|
|
106
|
+
<Swatch label="Blue" token="--bds-color_blue" bg="var(--bds-color_blue)" text="var(--bds-color_on-blue)" />
|
|
107
|
+
<Swatch label="Blue strong" token="--bds-color_blue--strong" bg="var(--bds-color_blue--strong)" text="var(--bds-color_on-blue--strong)" />
|
|
109
108
|
</SwatchRow>
|
|
110
109
|
|
|
111
110
|
### Orange scale
|
|
112
111
|
|
|
113
112
|
<SwatchRow>
|
|
114
|
-
<Swatch label="Orange subtle" token="--bds-
|
|
115
|
-
<Swatch label="Orange" token="--bds-
|
|
116
|
-
<Swatch label="Orange strong" token="--bds-
|
|
113
|
+
<Swatch label="Orange subtle" token="--bds-color_orange--subtle" bg="var(--bds-color_orange--subtle)" text="var(--bds-color_on-orange--subtle)" />
|
|
114
|
+
<Swatch label="Orange" token="--bds-color_orange" bg="var(--bds-color_orange)" text="var(--bds-color_on-orange)" />
|
|
115
|
+
<Swatch label="Orange strong" token="--bds-color_orange--strong" bg="var(--bds-color_orange--strong)" text="var(--bds-color_on-orange--strong)" />
|
|
117
116
|
</SwatchRow>
|
|
118
117
|
|
|
119
118
|
---
|
|
@@ -182,15 +181,15 @@ These `--bds-BASE__color--*` tokens are the primitive values. **Do not use them
|
|
|
182
181
|
|
|
183
182
|
## Theming
|
|
184
183
|
|
|
185
|
-
Override `--bds-
|
|
184
|
+
Override `--bds-color_green` and `--bds-color_interactive` to change the primary action colour globally:
|
|
186
185
|
|
|
187
186
|
```css
|
|
188
187
|
@layer tokens.override {
|
|
189
188
|
:root {
|
|
190
|
-
--bds-
|
|
191
|
-
--bds-
|
|
192
|
-
--bds-
|
|
193
|
-
--bds-
|
|
189
|
+
--bds-color_green: var(--bds-BASE__color--blue);
|
|
190
|
+
--bds-color_on-green: var(--bds-BASE__color--white);
|
|
191
|
+
--bds-color_interactive: var(--bds-BASE__color--blue);
|
|
192
|
+
--bds-color_on-interactive: var(--bds-BASE__color--white);
|
|
194
193
|
}
|
|
195
194
|
}
|
|
196
195
|
```
|