@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 { useState, useId, KeyboardEvent } from 'react';
|
|
2
2
|
import css from './Calendar.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
6
|
const DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
|
6
7
|
const DAY_LABELS: Record<string, string> = {
|
|
@@ -12,13 +13,12 @@ const MONTHS = [
|
|
|
12
13
|
'July', 'August', 'September', 'October', 'November', 'December',
|
|
13
14
|
];
|
|
14
15
|
|
|
15
|
-
interface CalendarProps {
|
|
16
|
+
interface CalendarProps extends WithClassName {
|
|
16
17
|
value?: Date;
|
|
17
18
|
defaultValue?: Date;
|
|
18
19
|
min?: Date;
|
|
19
20
|
max?: Date;
|
|
20
21
|
onChange?: (date: Date) => void;
|
|
21
|
-
className?: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function isSameDay(a: Date, b: Date): boolean {
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
width: 2.5rem;
|
|
34
34
|
height: 2.5rem;
|
|
35
35
|
border-radius: 50%;
|
|
36
|
-
background-color: var(--bds-
|
|
37
|
-
color: var(--bds-
|
|
36
|
+
background-color: var(--bds-color_bg);
|
|
37
|
+
color: var(--bds-color_on-bg);
|
|
38
38
|
|
|
39
|
-
--bdc_color: var(--bds-
|
|
39
|
+
--bdc_color: var(--bds-color_on-bg);
|
|
40
40
|
|
|
41
41
|
border: none;
|
|
42
42
|
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
@media (hover: hover) and (pointer: fine) {
|
|
61
61
|
.navBtn:hover {
|
|
62
|
-
background-color: var(--bds-
|
|
62
|
+
background-color: var(--bds-color_bg--subtle);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode, useRef, useId } from 'react';
|
|
2
2
|
import css from './Carousel.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
|
-
interface CarouselProps {
|
|
6
|
+
interface CarouselProps extends WithClassName {
|
|
6
7
|
items: ReactNode[];
|
|
7
8
|
label: string;
|
|
8
|
-
className?: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export function Carousel({ items, label, className }: Readonly<CarouselProps>) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@layer component {
|
|
2
2
|
.collapsible {
|
|
3
|
-
border: var(--collapsible_border-width, 1px) solid var(--collapsible_border-color, var(--bds-
|
|
3
|
+
border: var(--collapsible_border-width, 1px) solid var(--collapsible_border-color, var(--bds-color_bg--subtle));
|
|
4
4
|
border-radius: var(--collapsible_border-radius, var(--bds-border_radius--m));
|
|
5
5
|
overflow: hidden;
|
|
6
6
|
}
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
font-weight: var(--bds-font_weight--semibold);
|
|
17
17
|
font-size: var(--bds-font_size--body);
|
|
18
|
-
color: var(--collapsible_color, var(--bds-
|
|
19
|
-
background-color: var(--collapsible_bg, var(--bds-
|
|
18
|
+
color: var(--collapsible_color, var(--bds-color_on-bg));
|
|
19
|
+
background-color: var(--collapsible_bg, var(--bds-color_bg));
|
|
20
20
|
user-select: none;
|
|
21
21
|
transition: var(--bds-animation_transition);
|
|
22
22
|
}
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
|
|
34
34
|
@media (hover: hover) and (pointer: fine) {
|
|
35
35
|
.summary:hover {
|
|
36
|
-
background-color: var(--collapsible_bg--hover, var(--bds-
|
|
36
|
+
background-color: var(--collapsible_bg--hover, var(--bds-color_bg--subtle));
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/* Separator when open */
|
|
41
41
|
.collapsible[open] > .summary {
|
|
42
|
-
border-block-end: var(--collapsible_border-width, 1px) solid var(--collapsible_border-color, var(--bds-
|
|
42
|
+
border-block-end: var(--collapsible_border-width, 1px) solid var(--collapsible_border-color, var(--bds-color_bg--subtle));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.summaryContent {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
|
|
64
64
|
.content {
|
|
65
65
|
padding: var(--bds-space_m);
|
|
66
|
-
color: var(--collapsible_on-color, var(--bds-
|
|
66
|
+
color: var(--collapsible_on-color, var(--bds-color_on-bg));
|
|
67
67
|
font-size: var(--bds-font_size--body);
|
|
68
68
|
line-height: var(--bds-font_line-height--body);
|
|
69
69
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode, SyntheticEvent } from 'react';
|
|
2
2
|
import css from './Collapsible.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
|
-
export interface CollapsibleProps extends Omit<HTMLAttributes<HTMLDetailsElement>, 'onToggle'> {
|
|
6
|
+
export interface CollapsibleProps extends WithClassName, Omit<HTMLAttributes<HTMLDetailsElement>, 'onToggle'> {
|
|
6
7
|
/** The trigger label — always visible */
|
|
7
8
|
summary: ReactNode;
|
|
8
9
|
/** The content revealed when expanded */
|
|
@@ -18,7 +19,6 @@ export interface CollapsibleProps extends Omit<HTMLAttributes<HTMLDetailsElement
|
|
|
18
19
|
* (native <details name="…"> behaviour).
|
|
19
20
|
*/
|
|
20
21
|
name?: string;
|
|
21
|
-
className?: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export function Collapsible({
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
margin: 0;
|
|
7
7
|
padding: 0;
|
|
8
8
|
font-size: var(--bds-font_size--body);
|
|
9
|
-
color: var(--bds-
|
|
9
|
+
color: var(--bds-color_on-bg);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.group {
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
|
|
18
18
|
.term {
|
|
19
19
|
font-weight: var(--bds-font_weight--semibold);
|
|
20
|
-
color: var(--bds-
|
|
20
|
+
color: var(--bds-color_on-bg);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.details {
|
|
24
24
|
margin: 0;
|
|
25
|
-
color: var(--bds-
|
|
25
|
+
color: var(--bds-color_on-bg);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/* Inline layout */
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { DescriptionList } from './DescriptionList';
|
|
3
3
|
|
|
4
4
|
const meta = {
|
|
5
|
-
title: 'UI/DescriptionList',
|
|
5
|
+
title: 'React/UI/DescriptionList',
|
|
6
6
|
component: DescriptionList,
|
|
7
7
|
} satisfies Meta<typeof DescriptionList>;
|
|
8
8
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import css from './DescriptionList.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
6
|
export interface DescriptionItem {
|
|
6
7
|
term: ReactNode;
|
|
7
8
|
details: ReactNode | ReactNode[];
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
interface DescriptionListProps {
|
|
11
|
+
interface DescriptionListProps extends WithClassName {
|
|
11
12
|
items: DescriptionItem[];
|
|
12
13
|
layout?: 'stacked' | 'inline';
|
|
13
|
-
className?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function DescriptionList({ items, layout = 'stacked', className }: Readonly<DescriptionListProps>) {
|
|
@@ -38,6 +38,20 @@ Styled anchor element with three visual variants. Renders as `<a>` by default, b
|
|
|
38
38
|
|
|
39
39
|
<ArgTypes of={Stories} />
|
|
40
40
|
|
|
41
|
+
## CSS variables
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
<table>
|
|
45
|
+
<thead>
|
|
46
|
+
<tr><th>Variable</th><th>Default</th><th>Description</th></tr>
|
|
47
|
+
</thead>
|
|
48
|
+
<tbody>
|
|
49
|
+
<tr><td>`--link_color`</td><td>`var(--bds-color_interactive_on-bg)`</td><td>Link text colour</td></tr>
|
|
50
|
+
<tr><td>`--link_color-hover`</td><td>`var(--bds-color_blue--strong)`</td><td>Link text colour on hover</td></tr>
|
|
51
|
+
</tbody>
|
|
52
|
+
</table>
|
|
53
|
+
|
|
54
|
+
|
|
41
55
|
## Accessibility
|
|
42
56
|
|
|
43
57
|
- External links add `target="_blank"` with `rel="noopener noreferrer"` and a visually-hidden "(opens in new tab)" label
|
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
|
|
16
16
|
@media (hover: hover) and (pointer: fine) {
|
|
17
17
|
.link:hover {
|
|
18
|
-
--link_color: var(--link_color-hover, var(--bds-
|
|
18
|
+
--link_color: var(--link_color-hover, var(--bds-color_blue--strong));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.--variant_default {
|
|
23
23
|
--link_color: var(--bds-color_interactive_on-bg);
|
|
24
|
-
--link_color-hover: var(--bds-
|
|
24
|
+
--link_color-hover: var(--bds-color_blue--strong);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.--variant_subtle {
|
|
28
|
-
--link_color: var(--bds-
|
|
28
|
+
--link_color: var(--bds-color_on-bg);
|
|
29
29
|
--link_color-hover: var(--bds-color_interactive_on-bg);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.--variant_standalone {
|
|
33
33
|
--link_color: var(--bds-color_interactive_on-bg);
|
|
34
|
-
--link_color-hover: var(--bds-
|
|
34
|
+
--link_color-hover: var(--bds-color_blue--strong);
|
|
35
35
|
|
|
36
36
|
display: inline-flex;
|
|
37
37
|
align-items: center;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
|
|
2
2
|
import css from './Link.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
|
-
type LinkOwnProps<T extends ElementType> = {
|
|
6
|
+
type LinkOwnProps<T extends ElementType> = WithClassName & {
|
|
6
7
|
as?: T;
|
|
7
8
|
children: ReactNode;
|
|
8
9
|
variant?: 'default' | 'subtle' | 'standalone';
|
|
9
10
|
external?: boolean;
|
|
10
11
|
externalLabel?: string;
|
|
11
|
-
className?: string;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
type LinkProps<T extends ElementType = 'a'> = LinkOwnProps<T> &
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
.spinner {
|
|
9
9
|
width: 2.5em;
|
|
10
10
|
height: 2.5em;
|
|
11
|
-
border: 4px solid var(--bds-
|
|
12
|
-
border-top: 4px solid var(--bds-
|
|
11
|
+
border: 4px solid var(--bds-color_bg);
|
|
12
|
+
border-top: 4px solid var(--bds-color_interactive);
|
|
13
13
|
border-radius: 50%;
|
|
14
14
|
animation: spin 1s linear infinite;
|
|
15
15
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { ThemeProvider } from '../../../native/ThemeContext';
|
|
3
|
+
import { Loading } from './Loading.native';
|
|
4
|
+
|
|
5
|
+
function renderWithTheme(ui: React.ReactElement) {
|
|
6
|
+
return render(<ThemeProvider>{ui}</ThemeProvider>);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
describe('Loading (native)', () => {
|
|
10
|
+
it('has progressbar role', () => {
|
|
11
|
+
renderWithTheme(<Loading />);
|
|
12
|
+
expect(screen.getByRole('progressbar')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('has default accessible label "Loading"', () => {
|
|
16
|
+
renderWithTheme(<Loading />);
|
|
17
|
+
expect(screen.getByRole('progressbar', { name: 'Loading' })).toBeInTheDocument();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('accepts a custom accessibilityLabel', () => {
|
|
21
|
+
renderWithTheme(<Loading accessibilityLabel="Laden…" />);
|
|
22
|
+
expect(screen.getByRole('progressbar', { name: 'Laden…' })).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { ThemeProvider } from '../../../native/ThemeContext';
|
|
4
|
+
import { Loading } from './Loading.native';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
tags: ['!stable', 'alpha'],
|
|
8
|
+
title: 'React Native/UI/Loading',
|
|
9
|
+
component: Loading,
|
|
10
|
+
decorators: [(Story) => <ThemeProvider><Story /></ThemeProvider>],
|
|
11
|
+
parameters: { layout: 'centered' },
|
|
12
|
+
argTypes: {
|
|
13
|
+
size: { control: 'select', options: ['small', 'medium', 'large'] },
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<typeof Loading>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Small: Story = { args: { size: 'small' } };
|
|
21
|
+
export const Medium: Story = { args: { size: 'medium' } };
|
|
22
|
+
export const Large: Story = { args: { size: 'large' } };
|
|
23
|
+
export const AllSizes: Story = {
|
|
24
|
+
render: () => (
|
|
25
|
+
<ThemeProvider>
|
|
26
|
+
<div style={{ display: 'flex', gap: '24px', alignItems: 'center' }}>
|
|
27
|
+
<Loading size="small" />
|
|
28
|
+
<Loading size="medium" />
|
|
29
|
+
<Loading size="large" />
|
|
30
|
+
</div>
|
|
31
|
+
</ThemeProvider>
|
|
32
|
+
),
|
|
33
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ActivityIndicator, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import { useTheme } from '../../../native/ThemeContext';
|
|
3
|
+
|
|
4
|
+
type LoadingSize = 'small' | 'medium' | 'large';
|
|
5
|
+
|
|
6
|
+
interface LoadingProps {
|
|
7
|
+
size?: LoadingSize;
|
|
8
|
+
accessibilityLabel?: string;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const rnSize: Record<LoadingSize, 'small' | 'large'> = {
|
|
13
|
+
small: 'small',
|
|
14
|
+
medium: 'large',
|
|
15
|
+
large: 'large',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export function Loading({ size = 'medium', accessibilityLabel = 'Loading', style }: LoadingProps) {
|
|
19
|
+
const { colors } = useTheme();
|
|
20
|
+
return (
|
|
21
|
+
<ActivityIndicator
|
|
22
|
+
size={rnSize[size]}
|
|
23
|
+
color={colors.colorInteractive}
|
|
24
|
+
style={style}
|
|
25
|
+
accessibilityRole="progressbar"
|
|
26
|
+
accessibilityLabel={accessibilityLabel}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { Loading } from './Loading';
|
|
3
3
|
|
|
4
4
|
const meta = {
|
|
5
|
-
title: 'UI/Loading',
|
|
5
|
+
title: 'React/UI/Loading',
|
|
6
6
|
component: Loading,
|
|
7
7
|
argTypes: {
|
|
8
8
|
size: { control: 'select', options: ['small', 'medium', 'large'] },
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import css from './Loading.module.css';
|
|
2
2
|
import { cn } from '@boostdev/design-system-foundation';
|
|
3
|
+
import type { WithClassName } from '../../../types';
|
|
3
4
|
|
|
4
|
-
interface LoadingProps {
|
|
5
|
+
interface LoadingProps extends WithClassName {
|
|
5
6
|
size?: 'small' | 'medium' | 'large';
|
|
6
|
-
className?: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function Loading({ size = 'medium', className }: LoadingProps) {
|
|
@@ -4,36 +4,36 @@
|
|
|
4
4
|
align-items: center;
|
|
5
5
|
gap: var(--bds-space_m);
|
|
6
6
|
padding: var(--bds-space_s) var(--bds-space_m);
|
|
7
|
-
background-color: var(--banner_bg, var(--bds-
|
|
8
|
-
color: var(--banner_text, var(--bds-
|
|
9
|
-
border-block-end: 3px solid var(--banner_border, var(--bds-
|
|
7
|
+
background-color: var(--banner_bg, var(--bds-color_blue--subtle));
|
|
8
|
+
color: var(--banner_text, var(--bds-color_on-blue--subtle));
|
|
9
|
+
border-block-end: 3px solid var(--banner_border, var(--bds-color_blue));
|
|
10
10
|
font-size: var(--bds-font_size--body);
|
|
11
11
|
line-height: var(--bds-font_line-height--body);
|
|
12
12
|
width: 100%;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.--variant_info {
|
|
16
|
-
--banner_bg: var(--bds-
|
|
17
|
-
--banner_text: var(--bds-
|
|
18
|
-
--banner_border: var(--bds-
|
|
16
|
+
--banner_bg: var(--bds-color_blue--subtle);
|
|
17
|
+
--banner_text: var(--bds-color_on-blue--subtle);
|
|
18
|
+
--banner_border: var(--bds-color_blue);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.--variant_success {
|
|
22
|
-
--banner_bg: var(--bds-
|
|
23
|
-
--banner_text: var(--bds-
|
|
24
|
-
--banner_border: var(--bds-
|
|
22
|
+
--banner_bg: var(--bds-color_success--subtle);
|
|
23
|
+
--banner_text: var(--bds-color_on-success--subtle);
|
|
24
|
+
--banner_border: var(--bds-color_success);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.--variant_warning {
|
|
28
|
-
--banner_bg: var(--bds-
|
|
29
|
-
--banner_text: var(--bds-
|
|
30
|
-
--banner_border: var(--bds-
|
|
28
|
+
--banner_bg: var(--bds-color_orange--subtle);
|
|
29
|
+
--banner_text: var(--bds-color_on-orange--subtle);
|
|
30
|
+
--banner_border: var(--bds-color_warning);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.--variant_error {
|
|
34
|
-
--banner_bg: rgb(from var(--bds-
|
|
35
|
-
--banner_text: var(--bds-
|
|
36
|
-
--banner_border: var(--bds-
|
|
34
|
+
--banner_bg: rgb(from var(--bds-color_error) r g b / 12%);
|
|
35
|
+
--banner_text: var(--bds-color_on-bg);
|
|
36
|
+
--banner_border: var(--bds-color_error);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.content {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { ThemeProvider } from '../../../native/ThemeContext';
|
|
4
|
+
import { NotificationBanner } from './NotificationBanner.native';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
tags: ['!stable', 'alpha'],
|
|
8
|
+
title: 'React Native/UI/NotificationBanner',
|
|
9
|
+
component: NotificationBanner,
|
|
10
|
+
decorators: [(Story) => <ThemeProvider><Story /></ThemeProvider>],
|
|
11
|
+
parameters: { layout: 'padded' },
|
|
12
|
+
argTypes: {
|
|
13
|
+
variant: { control: 'select', options: ['info', 'success', 'warning', 'error'] },
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<typeof NotificationBanner>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Info: Story = { args: { children: 'New update available.', variant: 'info' } };
|
|
21
|
+
export const Success: Story = { args: { children: 'Changes saved successfully.', variant: 'success' } };
|
|
22
|
+
export const Warning: Story = { args: { children: 'Your session will expire soon.', variant: 'warning' } };
|
|
23
|
+
export const Error: Story = { args: { children: 'Failed to load data. Please retry.', variant: 'error' } };
|
|
24
|
+
export const Dismissible: Story = {
|
|
25
|
+
args: { children: 'You can dismiss this notification.', variant: 'info', onDismiss: () => {} },
|
|
26
|
+
};
|
|
27
|
+
export const AllVariants: Story = {
|
|
28
|
+
render: () => (
|
|
29
|
+
<ThemeProvider>
|
|
30
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
31
|
+
{(['info', 'success', 'warning', 'error'] as const).map(v => (
|
|
32
|
+
<NotificationBanner key={v} variant={v}>
|
|
33
|
+
{v.charAt(0).toUpperCase() + v.slice(1)} notification
|
|
34
|
+
</NotificationBanner>
|
|
35
|
+
))}
|
|
36
|
+
</div>
|
|
37
|
+
</ThemeProvider>
|
|
38
|
+
),
|
|
39
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyleSheet, View, Text, Pressable, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { spacing, font, lineHeight } from '../../../native/tokens';
|
|
4
|
+
import { useTheme } from '../../../native/ThemeContext';
|
|
5
|
+
|
|
6
|
+
type BannerVariant = 'info' | 'success' | 'warning' | 'error';
|
|
7
|
+
|
|
8
|
+
interface NotificationBannerProps {
|
|
9
|
+
variant?: BannerVariant;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
action?: ReactNode;
|
|
12
|
+
onDismiss?: () => void;
|
|
13
|
+
style?: StyleProp<ViewStyle>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const styles = StyleSheet.create({
|
|
17
|
+
banner: {
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
paddingVertical: spacing.s,
|
|
21
|
+
paddingHorizontal: spacing.m,
|
|
22
|
+
gap: spacing.xs,
|
|
23
|
+
},
|
|
24
|
+
content: {
|
|
25
|
+
flex: 1,
|
|
26
|
+
fontSize: font.size.bodyS,
|
|
27
|
+
fontFamily: font.family.body,
|
|
28
|
+
lineHeight: lineHeight.bodyS,
|
|
29
|
+
},
|
|
30
|
+
dismiss: {
|
|
31
|
+
padding: spacing.xxs,
|
|
32
|
+
flexShrink: 0,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export function NotificationBanner({
|
|
37
|
+
variant = 'info',
|
|
38
|
+
children,
|
|
39
|
+
action,
|
|
40
|
+
onDismiss,
|
|
41
|
+
style,
|
|
42
|
+
}: Readonly<NotificationBannerProps>) {
|
|
43
|
+
const { colors } = useTheme();
|
|
44
|
+
const isUrgent = variant === 'error' || variant === 'warning';
|
|
45
|
+
|
|
46
|
+
const variantColors: Record<BannerVariant, { bg: string; text: string }> = {
|
|
47
|
+
info: { bg: colors.colorBlueSubtle, text: colors.colorOnBlueSubtle },
|
|
48
|
+
success: { bg: colors.colorSuccessSubtle, text: colors.colorOnSuccessSubtle },
|
|
49
|
+
warning: { bg: colors.colorOrangeSubtle, text: colors.colorOnOrangeSubtle },
|
|
50
|
+
error: { bg: colors.colorRedSubtle, text: colors.colorOnRedSubtle },
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const { bg, text } = variantColors[variant];
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<View
|
|
57
|
+
accessibilityRole={isUrgent ? 'alert' : 'none'}
|
|
58
|
+
accessibilityLiveRegion={isUrgent ? 'assertive' : 'polite'}
|
|
59
|
+
style={[styles.banner, { backgroundColor: bg }, style]}
|
|
60
|
+
>
|
|
61
|
+
<Text style={[styles.content, { color: text }]}>{children}</Text>
|
|
62
|
+
{action}
|
|
63
|
+
{onDismiss && (
|
|
64
|
+
<Pressable
|
|
65
|
+
onPress={onDismiss}
|
|
66
|
+
style={styles.dismiss}
|
|
67
|
+
accessibilityLabel="Dismiss notification"
|
|
68
|
+
accessibilityRole="button"
|
|
69
|
+
hitSlop={8}
|
|
70
|
+
>
|
|
71
|
+
<Text style={{ color: text, fontSize: 16 }}>✕</Text>
|
|
72
|
+
</Pressable>
|
|
73
|
+
)}
|
|
74
|
+
</View>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -3,7 +3,7 @@ import { NotificationBanner } from './NotificationBanner';
|
|
|
3
3
|
import { Button } from '../../interaction/Button/Button';
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
|
-
title: 'UI/NotificationBanner',
|
|
6
|
+
title: 'React/UI/NotificationBanner',
|
|
7
7
|
component: NotificationBanner,
|
|
8
8
|
} satisfies Meta<typeof NotificationBanner>;
|
|
9
9
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import css from './NotificationBanner.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
|
-
interface NotificationBannerProps {
|
|
6
|
+
interface NotificationBannerProps extends WithClassName {
|
|
6
7
|
variant?: 'info' | 'success' | 'warning' | 'error';
|
|
7
8
|
children: ReactNode;
|
|
8
9
|
action?: ReactNode;
|
|
9
10
|
onDismiss?: () => void;
|
|
10
|
-
className?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function NotificationBanner({
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
border-radius: var(--bds-border_radius--xs);
|
|
25
25
|
background-color: var(--btn_bg, transparent);
|
|
26
26
|
|
|
27
|
-
--bdc_color: var(--btn_border, var(--bds-
|
|
27
|
+
--bdc_color: var(--btn_border, var(--bds-color_bg--subtle));
|
|
28
28
|
|
|
29
29
|
border: none;
|
|
30
30
|
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
31
31
|
outline-offset: var(--bdc-outline_offset);
|
|
32
|
-
color: var(--btn_color, var(--bds-
|
|
32
|
+
color: var(--btn_color, var(--bds-color_on-bg));
|
|
33
33
|
font-family: var(--bds-font_family--body);
|
|
34
34
|
font-size: var(--bds-font_size--body);
|
|
35
35
|
font-variant-numeric: tabular-nums;
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
|
|
51
51
|
@media (hover: hover) and (pointer: fine) {
|
|
52
52
|
.button:not(:disabled, .--active):hover {
|
|
53
|
-
--btn_bg: var(--bds-
|
|
54
|
-
--btn_color: var(--bds-
|
|
53
|
+
--btn_bg: var(--bds-color_bg--subtle);
|
|
54
|
+
--btn_color: var(--bds-color_interactive_on-bg);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.button.--active {
|
|
59
|
-
--btn_bg: var(--bds-
|
|
60
|
-
--btn_color: var(--bds-
|
|
61
|
-
--btn_border: var(--bds-
|
|
59
|
+
--btn_bg: var(--bds-color_interactive);
|
|
60
|
+
--btn_color: var(--bds-color_on-interactive);
|
|
61
|
+
--btn_border: var(--bds-color_interactive);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.button.--nav svg {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
justify-content: center;
|
|
73
73
|
min-width: 2.25rem;
|
|
74
74
|
height: 2.25rem;
|
|
75
|
-
color: var(--bds-
|
|
75
|
+
color: var(--bds-color_on-bg--subtle);
|
|
76
76
|
font-size: var(--bds-font_size--body);
|
|
77
77
|
user-select: none;
|
|
78
78
|
}
|