@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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyleSheet, View, Text, Pressable, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { spacing, font, border, lineHeight } from '../../../native/tokens';
|
|
4
|
+
import { useTheme } from '../../../native/ThemeContext';
|
|
5
|
+
|
|
6
|
+
type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
7
|
+
|
|
8
|
+
interface AlertProps {
|
|
9
|
+
variant?: AlertVariant;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
title?: string;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
onDismiss?: () => void;
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const styles = StyleSheet.create({
|
|
18
|
+
alert: {
|
|
19
|
+
flexDirection: 'row',
|
|
20
|
+
alignItems: 'flex-start',
|
|
21
|
+
padding: spacing.m,
|
|
22
|
+
borderRadius: border.radius.s,
|
|
23
|
+
gap: spacing.xs,
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
flexShrink: 0,
|
|
27
|
+
marginTop: 2,
|
|
28
|
+
},
|
|
29
|
+
content: {
|
|
30
|
+
flex: 1,
|
|
31
|
+
gap: spacing.xxs,
|
|
32
|
+
},
|
|
33
|
+
title: {
|
|
34
|
+
fontSize: font.size.body,
|
|
35
|
+
fontFamily: font.family.body,
|
|
36
|
+
fontWeight: font.weight.semibold,
|
|
37
|
+
lineHeight: lineHeight.body,
|
|
38
|
+
},
|
|
39
|
+
body: {
|
|
40
|
+
fontSize: font.size.bodyS,
|
|
41
|
+
fontFamily: font.family.body,
|
|
42
|
+
lineHeight: lineHeight.bodyS,
|
|
43
|
+
},
|
|
44
|
+
dismiss: {
|
|
45
|
+
padding: spacing.xxs,
|
|
46
|
+
flexShrink: 0,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export function Alert({
|
|
51
|
+
variant = 'info',
|
|
52
|
+
icon,
|
|
53
|
+
title,
|
|
54
|
+
children,
|
|
55
|
+
onDismiss,
|
|
56
|
+
style,
|
|
57
|
+
}: Readonly<AlertProps>) {
|
|
58
|
+
const { colors } = useTheme();
|
|
59
|
+
const isUrgent = variant === 'error' || variant === 'warning';
|
|
60
|
+
|
|
61
|
+
const variantColors: Record<AlertVariant, { bg: string; text: string }> = {
|
|
62
|
+
info: { bg: colors.colorBlueSubtle, text: colors.colorOnBlueSubtle },
|
|
63
|
+
success: { bg: colors.colorSuccessSubtle, text: colors.colorOnSuccessSubtle },
|
|
64
|
+
warning: { bg: colors.colorOrangeSubtle, text: colors.colorOnOrangeSubtle },
|
|
65
|
+
error: { bg: colors.colorRedSubtle, text: colors.colorOnRedSubtle },
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const { bg, text } = variantColors[variant];
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<View
|
|
72
|
+
accessibilityRole={isUrgent ? 'alert' : 'none'}
|
|
73
|
+
accessibilityLiveRegion={isUrgent ? 'assertive' : 'polite'}
|
|
74
|
+
style={[styles.alert, { backgroundColor: bg }, style]}
|
|
75
|
+
>
|
|
76
|
+
{icon && <View style={styles.icon}>{icon}</View>}
|
|
77
|
+
<View style={styles.content}>
|
|
78
|
+
{title && <Text style={[styles.title, { color: text }]}>{title}</Text>}
|
|
79
|
+
<Text style={[styles.body, { color: text }]}>{children}</Text>
|
|
80
|
+
</View>
|
|
81
|
+
{onDismiss && (
|
|
82
|
+
<Pressable
|
|
83
|
+
onPress={onDismiss}
|
|
84
|
+
style={styles.dismiss}
|
|
85
|
+
accessibilityLabel="Dismiss alert"
|
|
86
|
+
accessibilityRole="button"
|
|
87
|
+
hitSlop={8}
|
|
88
|
+
>
|
|
89
|
+
<Text style={{ color: text, fontSize: 16 }}>✕</Text>
|
|
90
|
+
</Pressable>
|
|
91
|
+
)}
|
|
92
|
+
</View>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import css from './Alert.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
|
-
interface AlertProps {
|
|
6
|
+
interface AlertProps extends WithClassName {
|
|
6
7
|
variant?: 'info' | 'success' | 'warning' | 'error';
|
|
7
8
|
icon?: ReactNode;
|
|
8
9
|
title?: string;
|
|
9
10
|
children: ReactNode;
|
|
10
11
|
onDismiss?: () => void;
|
|
11
|
-
className?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function Alert({
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.avatar.--fallback {
|
|
14
|
-
background-color: var(--avatar_bg, var(--bds-
|
|
15
|
-
color: var(--avatar_text, var(--bds-
|
|
14
|
+
background-color: var(--avatar_bg, var(--bds-color_blue));
|
|
15
|
+
color: var(--avatar_text, var(--bds-color_on-blue));
|
|
16
16
|
font-weight: var(--bds-font_weight--semibold);
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { ThemeProvider } from '../../../native/ThemeContext';
|
|
3
|
+
import { Avatar } from './Avatar.native';
|
|
4
|
+
|
|
5
|
+
function renderWithTheme(ui: React.ReactElement) {
|
|
6
|
+
return render(<ThemeProvider>{ui}</ThemeProvider>);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
describe('Avatar (native)', () => {
|
|
10
|
+
describe('initials fallback', () => {
|
|
11
|
+
it('has image role and accessible label on the container', () => {
|
|
12
|
+
renderWithTheme(<Avatar name="John Doe" />);
|
|
13
|
+
expect(screen.getByRole('img', { name: 'John Doe' })).toBeInTheDocument();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('derives initials from a two-word name', () => {
|
|
17
|
+
renderWithTheme(<Avatar name="John Doe" />);
|
|
18
|
+
expect(screen.getByText('JD')).toBeInTheDocument();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('uses a single-word name as one initial', () => {
|
|
22
|
+
renderWithTheme(<Avatar name="Alice" />);
|
|
23
|
+
expect(screen.getByText('A')).toBeInTheDocument();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('uses the alt prop as accessible label when provided', () => {
|
|
27
|
+
renderWithTheme(<Avatar name="John Doe" alt="Profile picture" />);
|
|
28
|
+
expect(screen.getByRole('img', { name: 'Profile picture' })).toBeInTheDocument();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('image variant', () => {
|
|
33
|
+
it('has image role and accessible label on the container', () => {
|
|
34
|
+
renderWithTheme(<Avatar src="https://example.com/avatar.jpg" alt="Jane Smith" />);
|
|
35
|
+
expect(screen.getByRole('img', { name: 'Jane Smith' })).toBeInTheDocument();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('does not duplicate the accessible label (regression: duplicate label bug)', () => {
|
|
39
|
+
// Previously, both the outer View and the inner Image had accessibilityLabel={label},
|
|
40
|
+
// causing screen readers to announce the name twice.
|
|
41
|
+
renderWithTheme(<Avatar src="https://example.com/avatar.jpg" alt="Jane Smith" />);
|
|
42
|
+
// Only one element should have aria-label="Jane Smith".
|
|
43
|
+
const labeled = screen.getAllByLabelText('Jane Smith');
|
|
44
|
+
expect(labeled).toHaveLength(1);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { ThemeProvider } from '../../../native/ThemeContext';
|
|
4
|
+
import { Avatar } from './Avatar.native';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
tags: ['!stable', 'alpha'],
|
|
8
|
+
title: 'React Native/UI/Avatar',
|
|
9
|
+
component: Avatar,
|
|
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 Avatar>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const WithInitials: Story = { args: { name: 'John Doe', size: 'medium' } };
|
|
21
|
+
export const Small: Story = { args: { name: 'Jane Smith', size: 'small' } };
|
|
22
|
+
export const Large: Story = { args: { name: 'Alex Brown', size: 'large' } };
|
|
23
|
+
export const SingleName: Story = { args: { name: 'Alice', size: 'medium' } };
|
|
24
|
+
export const AllSizes: Story = {
|
|
25
|
+
render: () => (
|
|
26
|
+
<ThemeProvider>
|
|
27
|
+
<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>
|
|
28
|
+
{(['small', 'medium', 'large'] as const).map(s => (
|
|
29
|
+
<Avatar key={s} name="John Doe" size={s} />
|
|
30
|
+
))}
|
|
31
|
+
</div>
|
|
32
|
+
</ThemeProvider>
|
|
33
|
+
),
|
|
34
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { StyleSheet, View, Text, Image, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import { font } from '../../../native/tokens';
|
|
3
|
+
import { useTheme } from '../../../native/ThemeContext';
|
|
4
|
+
|
|
5
|
+
type AvatarSize = 'small' | 'medium' | 'large';
|
|
6
|
+
|
|
7
|
+
interface AvatarProps {
|
|
8
|
+
src?: string;
|
|
9
|
+
alt?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
size?: AvatarSize;
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const sizeMap: Record<AvatarSize, { container: number; fontSize: number }> = {
|
|
16
|
+
small: { container: 32, fontSize: font.size.bodyS },
|
|
17
|
+
medium: { container: 48, fontSize: font.size.body },
|
|
18
|
+
large: { container: 72, fontSize: font.size.heading3 },
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function getInitials(name: string): string {
|
|
22
|
+
return name
|
|
23
|
+
.split(' ')
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.slice(0, 2)
|
|
26
|
+
.map(word => word[0].toUpperCase())
|
|
27
|
+
.join('');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
container: {
|
|
32
|
+
borderRadius: 999,
|
|
33
|
+
overflow: 'hidden',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
},
|
|
37
|
+
image: {
|
|
38
|
+
width: '100%',
|
|
39
|
+
height: '100%',
|
|
40
|
+
},
|
|
41
|
+
initials: {
|
|
42
|
+
fontFamily: font.family.body,
|
|
43
|
+
fontWeight: font.weight.semibold,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export function Avatar({ src, alt, name, size = 'medium', style }: Readonly<AvatarProps>) {
|
|
48
|
+
const { colors } = useTheme();
|
|
49
|
+
const { container, fontSize } = sizeMap[size];
|
|
50
|
+
const label = alt ?? name ?? 'User avatar';
|
|
51
|
+
|
|
52
|
+
if (src) {
|
|
53
|
+
return (
|
|
54
|
+
<View
|
|
55
|
+
style={[styles.container, { width: container, height: container }, style]}
|
|
56
|
+
accessibilityLabel={label}
|
|
57
|
+
accessibilityRole="image"
|
|
58
|
+
>
|
|
59
|
+
<Image source={{ uri: src }} style={styles.image} />
|
|
60
|
+
</View>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const initials = name ? getInitials(name) : '';
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<View
|
|
68
|
+
style={[
|
|
69
|
+
styles.container,
|
|
70
|
+
{ width: container, height: container, backgroundColor: colors.colorBlue },
|
|
71
|
+
style,
|
|
72
|
+
]}
|
|
73
|
+
accessibilityLabel={label}
|
|
74
|
+
accessibilityRole="image"
|
|
75
|
+
>
|
|
76
|
+
<Text
|
|
77
|
+
style={[styles.initials, { fontSize, color: colors.colorOnBlue }]}
|
|
78
|
+
importantForAccessibility="no"
|
|
79
|
+
accessibilityElementsHidden={true}
|
|
80
|
+
>
|
|
81
|
+
{initials}
|
|
82
|
+
</Text>
|
|
83
|
+
</View>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import css from './Avatar.module.css';
|
|
2
2
|
import { cn } from '@boostdev/design-system-foundation';
|
|
3
|
+
import type { WithClassName } from '../../../types';
|
|
3
4
|
|
|
4
|
-
interface AvatarProps {
|
|
5
|
+
interface AvatarProps extends WithClassName {
|
|
5
6
|
src?: string;
|
|
6
7
|
alt?: string;
|
|
7
8
|
name?: string;
|
|
8
9
|
size?: 'small' | 'medium' | 'large';
|
|
9
|
-
className?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
function getInitials(name: string): string {
|
|
@@ -50,8 +50,8 @@ Override these on a parent element to customise the badge without touching globa
|
|
|
50
50
|
<tr><th>Variable</th><th>Default</th><th>Description</th></tr>
|
|
51
51
|
</thead>
|
|
52
52
|
<tbody>
|
|
53
|
-
<tr><td>`--
|
|
54
|
-
<tr><td>`--
|
|
53
|
+
<tr><td>`--badge_bg`</td><td>`var(--bds-color_blue)`</td><td>Background colour</td></tr>
|
|
54
|
+
<tr><td>`--badge_text`</td><td>`var(--bds-color_on-blue)`</td><td>Text colour</td></tr>
|
|
55
55
|
</tbody>
|
|
56
56
|
</table>
|
|
57
57
|
|
|
@@ -9,32 +9,32 @@
|
|
|
9
9
|
font-weight: var(--bds-font_weight--semibold);
|
|
10
10
|
line-height: 1;
|
|
11
11
|
white-space: nowrap;
|
|
12
|
-
background-color: var(--badge_bg, var(--bds-
|
|
13
|
-
color: var(--badge_text, var(--bds-
|
|
12
|
+
background-color: var(--badge_bg, var(--bds-color_blue));
|
|
13
|
+
color: var(--badge_text, var(--bds-color_on-blue));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.--variant_primary {
|
|
17
|
-
--badge_bg: var(--bds-
|
|
18
|
-
--badge_text: var(--bds-
|
|
17
|
+
--badge_bg: var(--bds-color_interactive);
|
|
18
|
+
--badge_text: var(--bds-color_on-interactive);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.--variant_secondary {
|
|
22
|
-
--badge_bg: var(--bds-
|
|
23
|
-
--badge_text: var(--bds-
|
|
22
|
+
--badge_bg: var(--bds-color_bg);
|
|
23
|
+
--badge_text: var(--bds-color_on-bg);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.--variant_success {
|
|
27
|
-
--badge_bg: var(--bds-
|
|
28
|
-
--badge_text: var(--bds-
|
|
27
|
+
--badge_bg: var(--bds-color_success);
|
|
28
|
+
--badge_text: var(--bds-color_on-success);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.--variant_error {
|
|
32
|
-
--badge_bg: var(--bds-
|
|
33
|
-
--badge_text: var(--bds-
|
|
32
|
+
--badge_bg: var(--bds-color_error);
|
|
33
|
+
--badge_text: var(--bds-color_on-error);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.--variant_warning {
|
|
37
|
-
--badge_bg: var(--bds-
|
|
38
|
-
--badge_text: var(--bds-
|
|
37
|
+
--badge_bg: var(--bds-color_warning);
|
|
38
|
+
--badge_text: var(--bds-color_on-warning);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { ThemeProvider } from '../../../native/ThemeContext';
|
|
4
|
+
import { Badge } from './Badge.native';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
tags: ['!stable', 'alpha'],
|
|
8
|
+
title: 'React Native/UI/Badge',
|
|
9
|
+
component: Badge,
|
|
10
|
+
decorators: [(Story) => <ThemeProvider><Story /></ThemeProvider>],
|
|
11
|
+
parameters: { layout: 'centered' },
|
|
12
|
+
argTypes: {
|
|
13
|
+
variant: { control: 'select', options: ['primary', 'secondary', 'success', 'error', 'warning'] },
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<typeof Badge>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Primary: Story = { args: { children: 'Primary', variant: 'primary' } };
|
|
21
|
+
export const Secondary: Story = { args: { children: 'Secondary', variant: 'secondary' } };
|
|
22
|
+
export const Success: Story = { args: { children: 'Success', variant: 'success' } };
|
|
23
|
+
export const Error: Story = { args: { children: 'Error', variant: 'error' } };
|
|
24
|
+
export const Warning: Story = { args: { children: 'Warning', variant: 'warning' } };
|
|
25
|
+
export const AllVariants: Story = {
|
|
26
|
+
args: { children: '' },
|
|
27
|
+
render: () => (
|
|
28
|
+
<ThemeProvider>
|
|
29
|
+
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
|
30
|
+
{(['primary', 'secondary', 'success', 'error', 'warning'] as const).map(v => (
|
|
31
|
+
<Badge key={v} variant={v}>{v}</Badge>
|
|
32
|
+
))}
|
|
33
|
+
</div>
|
|
34
|
+
</ThemeProvider>
|
|
35
|
+
),
|
|
36
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyleSheet, View, Text, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { spacing, font } from '../../../native/tokens';
|
|
4
|
+
import { useTheme } from '../../../native/ThemeContext';
|
|
5
|
+
|
|
6
|
+
type BadgeVariant = 'primary' | 'secondary' | 'success' | 'error' | 'warning';
|
|
7
|
+
|
|
8
|
+
interface BadgeProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
variant?: BadgeVariant;
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
badge: {
|
|
16
|
+
alignSelf: 'flex-start',
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
paddingVertical: spacing.xxs,
|
|
21
|
+
paddingHorizontal: spacing.xs,
|
|
22
|
+
borderRadius: 999,
|
|
23
|
+
},
|
|
24
|
+
text: {
|
|
25
|
+
fontSize: font.size.bodyS,
|
|
26
|
+
fontFamily: font.family.body,
|
|
27
|
+
fontWeight: font.weight.semibold,
|
|
28
|
+
lineHeight: font.size.bodyS,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export function Badge({ children, variant = 'primary', style }: BadgeProps) {
|
|
33
|
+
const { colors } = useTheme();
|
|
34
|
+
|
|
35
|
+
const variantColors: Record<BadgeVariant, { bg: string; text: string }> = {
|
|
36
|
+
primary: { bg: colors.colorInteractive, text: colors.colorOnInteractive },
|
|
37
|
+
secondary: { bg: colors.colorBgSubtle, text: colors.colorOnBgSubtle },
|
|
38
|
+
success: { bg: colors.colorSuccess, text: colors.colorOnSuccess },
|
|
39
|
+
error: { bg: colors.colorError, text: colors.colorOnError },
|
|
40
|
+
warning: { bg: colors.colorWarning, text: colors.colorOnWarning },
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const { bg, text } = variantColors[variant];
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<View style={[styles.badge, { backgroundColor: bg }, style]}>
|
|
47
|
+
<Text style={[styles.text, { color: text }]}>{children}</Text>
|
|
48
|
+
</View>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { Badge } from './Badge';
|
|
3
3
|
|
|
4
4
|
const meta = {
|
|
5
|
-
title: 'UI/Badge',
|
|
5
|
+
title: 'React/UI/Badge',
|
|
6
6
|
component: Badge,
|
|
7
7
|
argTypes: {
|
|
8
8
|
variant: { control: 'select', options: ['primary', 'secondary', 'success', 'error', 'warning'] },
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import css from './Badge.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
|
+
import type { WithClassName } from '../../../types';
|
|
4
5
|
|
|
5
|
-
interface BadgeProps {
|
|
6
|
+
interface BadgeProps extends WithClassName {
|
|
6
7
|
children: ReactNode;
|
|
7
8
|
variant?: 'primary' | 'secondary' | 'success' | 'error' | 'warning';
|
|
8
|
-
className?: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export function Badge({ children, variant = 'primary', className }: BadgeProps) {
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.separator {
|
|
42
|
-
color: var(--bds-
|
|
42
|
+
color: var(--bds-color_on-bg--subtle);
|
|
43
43
|
user-select: none;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.current {
|
|
47
|
-
color: var(--bds-
|
|
47
|
+
color: var(--bds-color_on-bg--subtle);
|
|
48
48
|
font-weight: var(--bds-font_weight--semibold);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import css from './Breadcrumb.module.css';
|
|
2
2
|
import { cn } from '@boostdev/design-system-foundation';
|
|
3
|
+
import type { WithClassName } from '../../../types';
|
|
3
4
|
|
|
4
5
|
export interface BreadcrumbItem {
|
|
5
6
|
label: string;
|
|
6
7
|
href?: string;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
interface BreadcrumbProps {
|
|
10
|
+
interface BreadcrumbProps extends WithClassName {
|
|
10
11
|
items: BreadcrumbItem[];
|
|
11
|
-
className?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function Breadcrumb({ items, className }: Readonly<BreadcrumbProps>) {
|
|
@@ -26,6 +26,22 @@ Date picker calendar grid. Use standalone or as the popover content inside a dat
|
|
|
26
26
|
|
|
27
27
|
<ArgTypes of={Stories} />
|
|
28
28
|
|
|
29
|
+
## CSS variables
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<table>
|
|
33
|
+
<thead>
|
|
34
|
+
<tr><th>Variable</th><th>Default</th><th>Description</th></tr>
|
|
35
|
+
</thead>
|
|
36
|
+
<tbody>
|
|
37
|
+
<tr><td>`--calendar_border`</td><td>`none`</td><td>Container border</td></tr>
|
|
38
|
+
<tr><td>`--calendar_radius`</td><td>`var(--bdc-outline_radius)`</td><td>Container corner radius</td></tr>
|
|
39
|
+
<tr><td>`--calendar_shadow`</td><td>`var(--bds-shadow_s)`</td><td>Container box shadow</td></tr>
|
|
40
|
+
<tr><td>`--calendar_today-border`</td><td>`none`</td><td>Border on today's date cell</td></tr>
|
|
41
|
+
</tbody>
|
|
42
|
+
</table>
|
|
43
|
+
|
|
44
|
+
|
|
29
45
|
## Accessibility
|
|
30
46
|
|
|
31
47
|
- Grid uses `role="grid"` with `role="gridcell"` for each day
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
gap: var(--bds-space_s);
|
|
6
|
-
background-color: var(--bds-
|
|
6
|
+
background-color: var(--bds-color_bg);
|
|
7
7
|
border: var(--calendar_border, none);
|
|
8
|
-
--bdc_color: var(--bds-
|
|
8
|
+
--bdc_color: var(--bds-color_bg--subtle);
|
|
9
9
|
--bdc-outline_radius: var(--bds-border_radius--m);
|
|
10
10
|
|
|
11
11
|
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
.monthYear {
|
|
26
26
|
font-size: var(--bds-font_size--body);
|
|
27
27
|
font-weight: var(--bds-font_weight--semibold);
|
|
28
|
-
color: var(--bds-
|
|
28
|
+
color: var(--bds-color_on-bg);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.navBtn {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
height: 2rem;
|
|
38
38
|
border-radius: 50%;
|
|
39
39
|
cursor: pointer;
|
|
40
|
-
color: var(--bds-
|
|
40
|
+
color: var(--bds-color_on-bg);
|
|
41
41
|
transition: var(--bds-animation_transition);
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
|
|
54
54
|
@media (hover: hover) and (pointer: fine) {
|
|
55
55
|
.navBtn:hover {
|
|
56
|
-
background-color: var(--bds-
|
|
56
|
+
background-color: var(--bds-color_bg--subtle);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
.weekday {
|
|
67
67
|
font-size: var(--bds-font_size--body--s);
|
|
68
68
|
font-weight: var(--bds-font_weight--semibold);
|
|
69
|
-
color: var(--bds-
|
|
69
|
+
color: var(--bds-color_on-bg);
|
|
70
70
|
text-align: center;
|
|
71
71
|
padding-block-end: var(--bds-space_xs);
|
|
72
72
|
}
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
aspect-ratio: 1;
|
|
85
85
|
border-radius: 50%;
|
|
86
86
|
font-size: var(--bds-font_size--body--s);
|
|
87
|
-
color: var(--bds-
|
|
87
|
+
color: var(--bds-color_on-bg);
|
|
88
88
|
cursor: pointer;
|
|
89
89
|
transition: var(--bds-animation_transition);
|
|
90
90
|
box-sizing: border-box;
|
|
@@ -97,14 +97,14 @@
|
|
|
97
97
|
|
|
98
98
|
@media (hover: hover) and (pointer: fine) {
|
|
99
99
|
.day:not(.disabled, .selected):hover {
|
|
100
|
-
background-color: var(--bds-
|
|
100
|
+
background-color: var(--bds-color_bg--subtle);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
.today {
|
|
105
105
|
font-weight: var(--bds-font_weight--semibold);
|
|
106
106
|
|
|
107
|
-
--bdc_color: var(--bds-
|
|
107
|
+
--bdc_color: var(--bds-color_interactive);
|
|
108
108
|
|
|
109
109
|
border: var(--calendar_today-border, none);
|
|
110
110
|
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
.selected {
|
|
115
|
-
background-color: var(--bds-
|
|
116
|
-
color: var(--bds-
|
|
115
|
+
background-color: var(--bds-color_interactive);
|
|
116
|
+
color: var(--bds-color_on-interactive);
|
|
117
117
|
font-weight: var(--bds-font_weight--semibold);
|
|
118
118
|
}
|
|
119
119
|
|