@boostdev/design-system-components 1.1.0 → 1.1.2
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 +46 -5
- package/dist/client.cjs +206 -113
- package/dist/client.css +664 -624
- package/dist/client.d.cts +9 -3
- package/dist/client.d.ts +9 -3
- package/dist/client.js +241 -149
- package/dist/index.cjs +206 -113
- package/dist/index.css +664 -624
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +241 -149
- package/dist/web-components/chunk-2QA62WCQ.js +48 -0
- package/dist/web-components/chunk-4BX6AWXX.js +146 -0
- package/dist/web-components/chunk-57TRNCWQ.js +93 -0
- package/dist/web-components/chunk-5IPHEONG.js +139 -0
- package/dist/web-components/chunk-5R6IFELV.js +63 -0
- package/dist/web-components/chunk-5TFWOPLH.js +49 -0
- package/dist/web-components/chunk-6I3CFC26.js +89 -0
- package/dist/web-components/chunk-6T3RKUKG.js +65 -0
- package/dist/web-components/chunk-7FMR53BW.js +127 -0
- package/dist/web-components/chunk-A67LCT7C.js +134 -0
- package/dist/web-components/chunk-AGKJTMJI.js +56 -0
- package/dist/web-components/chunk-BQLZ7I4G.js +56 -0
- package/dist/web-components/chunk-CAPI25CU.js +53 -0
- package/dist/web-components/chunk-CJ5ZOO42.js +229 -0
- package/dist/web-components/chunk-CR5PGUHV.js +109 -0
- package/dist/web-components/chunk-ECW3HHWA.js +185 -0
- package/dist/web-components/chunk-HGBNDR22.js +98 -0
- package/dist/web-components/chunk-IK3PTFZ4.js +133 -0
- package/dist/web-components/chunk-IQGLIQSO.js +188 -0
- package/dist/web-components/chunk-ITHLKR7Q.js +105 -0
- package/dist/web-components/chunk-K5CE6HSB.js +169 -0
- package/dist/web-components/chunk-L3XHOMN6.js +111 -0
- package/dist/{web-components.js → web-components/chunk-LGEZYFUU.js} +62 -834
- package/dist/web-components/chunk-LSC4N56Q.js +168 -0
- package/dist/web-components/chunk-LY62SAVN.js +64 -0
- package/dist/web-components/chunk-O4UFI2RX.js +244 -0
- package/dist/web-components/chunk-O7I63SQX.js +124 -0
- package/dist/web-components/chunk-OHUTLSIQ.js +69 -0
- package/dist/web-components/chunk-OQTRTMAB.js +27 -0
- package/dist/web-components/chunk-OTX4COSV.js +187 -0
- package/dist/web-components/chunk-PY62FTRW.js +179 -0
- package/dist/web-components/chunk-Q4T5BJT6.js +94 -0
- package/dist/web-components/chunk-QDRH46TF.js +281 -0
- package/dist/web-components/chunk-QDST57JC.js +119 -0
- package/dist/web-components/chunk-QPOKHLMQ.js +45 -0
- package/dist/web-components/chunk-SOQQ7RVJ.js +88 -0
- package/dist/web-components/chunk-UFFCKVZE.js +149 -0
- package/dist/web-components/chunk-VM3YHGQ2.js +152 -0
- package/dist/web-components/chunk-VMMVWLXL.js +53 -0
- package/dist/web-components/chunk-VSS5ITNE.js +109 -0
- package/dist/web-components/chunk-XIENXR7H.js +118 -0
- package/dist/web-components/chunk-Y4MAXTMA.js +80 -0
- package/dist/web-components/chunk-YLVTEY23.js +165 -0
- package/dist/web-components/globals.d.ts +2 -0
- package/dist/web-components/globals.js +1 -0
- package/dist/web-components/index.d.ts +41 -0
- package/dist/web-components/index.js +165 -0
- package/dist/web-components/interaction/bds-accordion-item.d.ts +54 -0
- package/dist/web-components/interaction/bds-accordion-item.js +7 -0
- package/dist/web-components/interaction/bds-accordion.d.ts +50 -0
- package/dist/web-components/interaction/bds-accordion.js +7 -0
- package/dist/web-components/interaction/bds-button.d.ts +100 -0
- package/dist/web-components/interaction/bds-button.js +7 -0
- package/dist/web-components/interaction/bds-collapsible.d.ts +52 -0
- package/dist/web-components/interaction/bds-collapsible.js +7 -0
- package/dist/web-components/interaction/bds-dialog.d.ts +56 -0
- package/dist/web-components/interaction/bds-dialog.js +7 -0
- package/dist/web-components/interaction/bds-drawer.d.ts +64 -0
- package/dist/web-components/interaction/bds-drawer.js +7 -0
- package/dist/web-components/interaction/bds-popover.d.ts +62 -0
- package/dist/web-components/interaction/bds-popover.js +7 -0
- package/dist/web-components/interaction/bds-skip-link.d.ts +36 -0
- package/dist/web-components/interaction/bds-skip-link.js +7 -0
- package/dist/web-components/interaction/bds-tab-panel.d.ts +26 -0
- package/dist/web-components/interaction/bds-tab-panel.js +7 -0
- package/dist/web-components/interaction/bds-tab.d.ts +45 -0
- package/dist/web-components/interaction/bds-tab.js +7 -0
- package/dist/web-components/interaction/bds-tabs.d.ts +46 -0
- package/dist/web-components/interaction/bds-tabs.js +7 -0
- package/dist/web-components/interaction/bds-toast-provider.d.ts +57 -0
- package/dist/web-components/interaction/bds-toast-provider.js +7 -0
- package/dist/web-components/interaction/bds-tooltip.d.ts +50 -0
- package/dist/web-components/interaction/bds-tooltip.js +7 -0
- package/dist/web-components/interaction/form/bds-checkbox.d.ts +70 -0
- package/dist/web-components/interaction/form/bds-checkbox.js +7 -0
- package/dist/web-components/interaction/form/bds-combobox.d.ts +84 -0
- package/dist/web-components/interaction/form/bds-combobox.js +7 -0
- package/dist/web-components/interaction/form/bds-file-input.d.ts +62 -0
- package/dist/web-components/interaction/form/bds-file-input.js +7 -0
- package/dist/web-components/interaction/form/bds-number-input.d.ts +68 -0
- package/dist/web-components/interaction/form/bds-number-input.js +7 -0
- package/dist/web-components/interaction/form/bds-radio.d.ts +68 -0
- package/dist/web-components/interaction/form/bds-radio.js +7 -0
- package/dist/web-components/interaction/form/bds-segmented-control.d.ts +71 -0
- package/dist/web-components/interaction/form/bds-segmented-control.js +7 -0
- package/dist/web-components/interaction/form/bds-select.d.ts +79 -0
- package/dist/web-components/interaction/form/bds-select.js +7 -0
- package/dist/web-components/interaction/form/bds-slider.d.ts +70 -0
- package/dist/web-components/interaction/form/bds-slider.js +7 -0
- package/dist/web-components/interaction/form/bds-switch.d.ts +67 -0
- package/dist/web-components/interaction/form/bds-switch.js +7 -0
- package/dist/web-components/interaction/form/bds-textarea.d.ts +70 -0
- package/dist/web-components/interaction/form/bds-textarea.js +7 -0
- package/dist/web-components/ui/bds-alert.d.ts +66 -0
- package/dist/web-components/ui/bds-alert.js +7 -0
- package/dist/web-components/ui/bds-avatar.d.ts +50 -0
- package/dist/web-components/ui/bds-avatar.js +7 -0
- package/dist/web-components/ui/bds-badge.d.ts +35 -0
- package/dist/web-components/ui/bds-badge.js +7 -0
- package/dist/web-components/ui/bds-breadcrumb.d.ts +35 -0
- package/dist/web-components/ui/bds-breadcrumb.js +7 -0
- package/dist/web-components/ui/bds-card.d.ts +72 -0
- package/dist/web-components/ui/bds-card.js +7 -0
- package/dist/web-components/ui/bds-description-list.d.ts +42 -0
- package/dist/web-components/ui/bds-description-list.js +7 -0
- package/dist/web-components/ui/bds-icon-wrapper.d.ts +39 -0
- package/dist/web-components/ui/bds-icon-wrapper.js +7 -0
- package/dist/web-components/ui/bds-link.d.ts +59 -0
- package/dist/web-components/ui/bds-link.js +7 -0
- package/dist/web-components/ui/bds-loading.d.ts +32 -0
- package/dist/web-components/ui/bds-loading.js +7 -0
- package/dist/web-components/ui/bds-notification-banner.d.ts +61 -0
- package/dist/web-components/ui/bds-notification-banner.js +7 -0
- package/dist/web-components/ui/bds-progress-circle.d.ts +53 -0
- package/dist/web-components/ui/bds-progress-circle.js +7 -0
- package/dist/web-components/ui/bds-progress.d.ts +54 -0
- package/dist/web-components/ui/bds-progress.js +7 -0
- package/dist/web-components/ui/bds-rating.d.ts +36 -0
- package/dist/web-components/ui/bds-rating.js +7 -0
- package/dist/web-components/ui/bds-section-header.d.ts +53 -0
- package/dist/web-components/ui/bds-section-header.js +8 -0
- package/dist/web-components/ui/bds-separator.d.ts +32 -0
- package/dist/web-components/ui/bds-separator.js +7 -0
- package/dist/web-components/ui/bds-skeleton.d.ts +22 -0
- package/dist/web-components/ui/bds-skeleton.js +7 -0
- package/dist/web-components/ui/bds-typography.d.ts +44 -0
- package/dist/web-components/ui/bds-typography.js +8 -0
- package/package.json +169 -4
- package/src/components/interaction/Button/Button.module.css +1 -1
- package/src/components/interaction/Button/Button.native.mdx +72 -0
- package/src/components/interaction/Command/Command.module.css +7 -7
- package/src/components/interaction/Command/Command.spec.tsx +37 -0
- package/src/components/interaction/Command/Command.tsx +37 -2
- package/src/components/interaction/Dialog/Dialog.module.css +10 -13
- package/src/components/interaction/Dialog/Dialog.spec.tsx +53 -1
- package/src/components/interaction/Dialog/Dialog.stories.tsx +17 -0
- package/src/components/interaction/Dialog/Dialog.tsx +50 -16
- package/src/components/interaction/Drawer/Drawer.module.css +11 -11
- package/src/components/interaction/Drawer/Drawer.spec.tsx +48 -1
- package/src/components/interaction/Drawer/Drawer.tsx +38 -4
- package/src/components/interaction/DropdownMenu/DropdownMenu.module.css +6 -6
- package/src/components/interaction/Popover/Popover.module.css +74 -15
- package/src/components/interaction/Popover/Popover.spec.tsx +94 -59
- package/src/components/interaction/Popover/Popover.tsx +44 -60
- package/src/components/interaction/Toast/Toast.module.css +7 -7
- package/src/components/interaction/form/Checkbox/Checkbox.module.css +6 -6
- package/src/components/interaction/form/Checkbox/Checkbox.native.mdx +74 -0
- package/src/components/interaction/form/Combobox/Combobox.module.css +7 -8
- package/src/components/interaction/form/FileInput/FileInput.module.css +4 -4
- package/src/components/interaction/form/NumberInput/NumberInput.module.css +1 -1
- package/src/components/interaction/form/Radio/Radio.module.css +6 -6
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.module.css +5 -6
- package/src/components/interaction/form/Select/Select.module.css +3 -3
- package/src/components/interaction/form/Slider/Slider.module.css +6 -6
- package/src/components/interaction/form/Switch/Switch.module.css +8 -8
- package/src/components/interaction/form/Textarea/Textarea.module.css +1 -1
- package/src/components/layout/IconWrapper/IconWrapper.module.css +2 -2
- package/src/components/ui/Accordion/Accordion.module.css +5 -5
- package/src/components/ui/Alert/Alert.native.mdx +62 -0
- package/src/components/ui/Avatar/Avatar.native.mdx +50 -0
- package/src/components/ui/Badge/Badge.native.mdx +54 -0
- package/src/components/ui/Calendar/Calendar.module.css +7 -7
- package/src/components/ui/Carousel/Carousel.module.css +5 -5
- package/src/components/ui/Collapsible/Collapsible.module.css +4 -4
- package/src/components/ui/Link/Link.module.css +2 -2
- package/src/components/ui/Loading/Loading.module.css +7 -7
- package/src/components/ui/NotificationBanner/NotificationBanner.module.css +3 -3
- package/src/components/ui/Pagination/Pagination.module.css +6 -6
- package/src/components/ui/Progress/Progress.module.css +5 -5
- package/src/components/ui/Separator/Separator.module.css +3 -3
- package/src/components/ui/Skeleton/Skeleton.module.css +1 -1
- package/src/components/ui/Table/Table.module.css +9 -9
- package/src/components/ui/Tabs/Tabs.module.css +3 -3
- package/src/components/ui/Tooltip/Tooltip.module.css +8 -8
- package/src/components/ui/Typography/Typography.native.mdx +56 -0
- package/src/polyfill-invoker-commands.ts +68 -0
- package/src/react-augment.d.ts +19 -0
- package/src/stories/ReactNative.mdx +121 -0
- package/src/web-components/index.ts +47 -0
- package/src/web-components/interaction/BdsButton.mdx +106 -0
- package/src/web-components/interaction/BdsPopover.mdx +120 -0
- package/src/web-components/interaction/BdsToastProvider.mdx +94 -0
- package/src/web-components/interaction/bds-accordion-item.spec.ts +75 -0
- package/src/web-components/interaction/bds-accordion-item.ts +181 -0
- package/src/web-components/interaction/bds-accordion.spec.ts +73 -0
- package/src/web-components/interaction/bds-accordion.ts +99 -0
- package/src/web-components/interaction/bds-collapsible.spec.ts +56 -0
- package/src/web-components/interaction/bds-collapsible.ts +170 -0
- package/src/web-components/interaction/bds-dialog.spec.ts +119 -0
- package/src/web-components/interaction/bds-dialog.ts +224 -0
- package/src/web-components/interaction/bds-drawer.spec.ts +113 -0
- package/src/web-components/interaction/bds-drawer.ts +266 -0
- package/src/web-components/interaction/bds-popover.spec.ts +49 -1
- package/src/web-components/interaction/bds-popover.ts +12 -0
- package/src/web-components/interaction/bds-skip-link.spec.ts +42 -0
- package/src/web-components/interaction/bds-skip-link.ts +74 -0
- package/src/web-components/interaction/bds-tab-panel.spec.ts +32 -0
- package/src/web-components/interaction/bds-tab-panel.ts +38 -0
- package/src/web-components/interaction/bds-tab.spec.ts +71 -0
- package/src/web-components/interaction/bds-tab.ts +110 -0
- package/src/web-components/interaction/bds-tabs.spec.ts +120 -0
- package/src/web-components/interaction/bds-tabs.ts +152 -0
- package/src/web-components/interaction/bds-tooltip.spec.ts +49 -0
- package/src/web-components/interaction/bds-tooltip.ts +127 -0
- package/src/web-components/interaction/form/bds-checkbox.spec.ts +63 -0
- package/src/web-components/interaction/form/bds-checkbox.ts +168 -0
- package/src/web-components/interaction/form/bds-combobox.spec.ts +117 -0
- package/src/web-components/interaction/form/bds-combobox.ts +336 -0
- package/src/web-components/interaction/form/bds-file-input.spec.ts +58 -0
- package/src/web-components/interaction/form/bds-file-input.ts +209 -0
- package/src/web-components/interaction/form/bds-number-input.spec.ts +87 -0
- package/src/web-components/interaction/form/bds-number-input.ts +221 -0
- package/src/web-components/interaction/form/bds-radio.spec.ts +70 -0
- package/src/web-components/interaction/form/bds-radio.ts +157 -0
- package/src/web-components/interaction/form/bds-segmented-control.spec.ts +74 -0
- package/src/web-components/interaction/form/bds-segmented-control.ts +211 -0
- package/src/web-components/interaction/form/bds-select.spec.ts +74 -0
- package/src/web-components/interaction/form/bds-select.ts +190 -0
- package/src/web-components/interaction/form/bds-slider.spec.ts +41 -0
- package/src/web-components/interaction/form/bds-slider.ts +162 -0
- package/src/web-components/interaction/form/bds-switch.spec.ts +62 -0
- package/src/web-components/interaction/form/bds-switch.ts +166 -0
- package/src/web-components/interaction/form/bds-textarea.spec.ts +55 -0
- package/src/web-components/interaction/form/bds-textarea.ts +143 -0
- package/src/web-components/test/helpers.ts +8 -0
- package/src/web-components/ui/BdsAlert.mdx +90 -0
- package/src/web-components/ui/BdsBadge.mdx +74 -0
- package/src/web-components/ui/bds-avatar.spec.ts +75 -0
- package/src/web-components/ui/bds-avatar.ts +122 -0
- package/src/web-components/ui/bds-breadcrumb.spec.ts +55 -0
- package/src/web-components/ui/bds-breadcrumb.ts +114 -0
- package/src/web-components/ui/bds-card.spec.ts +70 -0
- package/src/web-components/ui/bds-card.ts +156 -0
- package/src/web-components/ui/bds-description-list.spec.ts +36 -0
- package/src/web-components/ui/bds-description-list.ts +79 -0
- package/src/web-components/ui/bds-icon-wrapper.spec.ts +21 -0
- package/src/web-components/ui/bds-icon-wrapper.ts +68 -0
- package/src/web-components/ui/bds-link.spec.ts +72 -0
- package/src/web-components/ui/bds-link.ts +138 -0
- package/src/web-components/ui/bds-loading.spec.ts +38 -0
- package/src/web-components/ui/bds-loading.ts +76 -0
- package/src/web-components/ui/bds-notification-banner.spec.ts +82 -0
- package/src/web-components/ui/bds-notification-banner.ts +185 -0
- package/src/web-components/ui/bds-progress-circle.spec.ts +58 -0
- package/src/web-components/ui/bds-progress-circle.ts +142 -0
- package/src/web-components/ui/bds-progress.spec.ts +66 -0
- package/src/web-components/ui/bds-progress.ts +127 -0
- package/src/web-components/ui/bds-rating.spec.ts +70 -0
- package/src/web-components/ui/bds-rating.ts +80 -0
- package/src/web-components/ui/bds-section-header.spec.ts +57 -0
- package/src/web-components/ui/bds-section-header.ts +96 -0
- package/src/web-components/ui/bds-separator.spec.ts +50 -0
- package/src/web-components/ui/bds-separator.ts +66 -0
- package/src/web-components/ui/bds-skeleton.spec.ts +22 -0
- package/src/web-components/ui/bds-skeleton.ts +55 -0
- package/src/web-components/ui/bds-typography.spec.ts +76 -0
- package/src/web-components/ui/bds-typography.ts +112 -0
- package/dist/web-components.d.ts +0 -303
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import {
|
|
2
|
+
A,
|
|
3
|
+
T,
|
|
4
|
+
i,
|
|
5
|
+
i2
|
|
6
|
+
} from "./chunk-LGEZYFUU.js";
|
|
7
|
+
|
|
8
|
+
// src/web-components/ui/bds-alert.ts
|
|
9
|
+
var BdsAlert = class extends i2 {
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.alert {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: flex-start;
|
|
18
|
+
gap: var(--bds-space_s);
|
|
19
|
+
padding: var(--bds-space_m);
|
|
20
|
+
border-radius: var(--bds-border_radius--s);
|
|
21
|
+
border-inline-start: var(--bds-space_s) solid var(--alert_border, var(--bds-color_blue));
|
|
22
|
+
background-color: var(--alert_bg, var(--bds-color_blue--subtle));
|
|
23
|
+
color: var(--alert_text, var(--bds-color_on-blue--subtle));
|
|
24
|
+
font-size: var(--bds-font_size--body);
|
|
25
|
+
line-height: var(--bds-font_line-height--body);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Variant colours */
|
|
29
|
+
:host([variant='info']) .alert {
|
|
30
|
+
--alert_bg: var(--bds-color_blue--subtle);
|
|
31
|
+
--alert_text: var(--bds-color_on-blue--subtle);
|
|
32
|
+
--alert_border: var(--bds-color_blue);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([variant='success']) .alert {
|
|
36
|
+
--alert_bg: var(--bds-color_success--subtle);
|
|
37
|
+
--alert_text: var(--bds-color_on-success--subtle);
|
|
38
|
+
--alert_border: var(--bds-color_success);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([variant='warning']) .alert {
|
|
42
|
+
--alert_bg: var(--bds-color_orange--subtle);
|
|
43
|
+
--alert_text: var(--bds-color_on-orange--subtle);
|
|
44
|
+
--alert_border: var(--bds-color_warning);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([variant='error']) .alert {
|
|
48
|
+
--alert_bg: rgb(from var(--bds-color_error) r g b / 12%);
|
|
49
|
+
--alert_text: var(--bds-color_on-bg);
|
|
50
|
+
--alert_border: var(--bds-color_error);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Icon slot wrapper — hidden unless slot has content */
|
|
54
|
+
.icon {
|
|
55
|
+
display: none;
|
|
56
|
+
align-items: center;
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
margin-block-start: 0.1em;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.icon.has-content {
|
|
62
|
+
display: flex;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Content area */
|
|
66
|
+
.content {
|
|
67
|
+
flex: 1;
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
gap: var(--bds-space_xxs);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.title {
|
|
74
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
75
|
+
font-size: var(--bds-font_size--body);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Dismiss button */
|
|
79
|
+
.dismiss {
|
|
80
|
+
all: unset;
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
flex-shrink: 0;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
color: currentcolor;
|
|
87
|
+
transition: var(--bds-animation_transition);
|
|
88
|
+
border-radius: 50%;
|
|
89
|
+
--bdc_color: currentcolor;
|
|
90
|
+
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
91
|
+
outline-offset: var(--bdc-outline_offset);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.dismiss svg {
|
|
95
|
+
width: 1rem;
|
|
96
|
+
height: 1rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.dismiss:focus-visible {
|
|
100
|
+
outline: var(--bds-outline_default);
|
|
101
|
+
outline-offset: var(--bds-outline_offset);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media (hover: hover) and (pointer: fine) {
|
|
105
|
+
.dismiss:hover {
|
|
106
|
+
opacity: 0.7;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
static properties = {
|
|
111
|
+
variant: { type: String, reflect: true },
|
|
112
|
+
title: { type: String },
|
|
113
|
+
dismissible: { type: Boolean, reflect: true },
|
|
114
|
+
_iconFilled: { state: true }
|
|
115
|
+
};
|
|
116
|
+
constructor() {
|
|
117
|
+
super();
|
|
118
|
+
this.variant = "info";
|
|
119
|
+
this.title = "";
|
|
120
|
+
this.dismissible = false;
|
|
121
|
+
this._iconFilled = false;
|
|
122
|
+
}
|
|
123
|
+
_onIconSlotChange(e) {
|
|
124
|
+
const slot = e.target;
|
|
125
|
+
this._iconFilled = slot.assignedNodes({ flatten: true }).length > 0;
|
|
126
|
+
}
|
|
127
|
+
get _isUrgent() {
|
|
128
|
+
return this.variant === "error" || this.variant === "warning";
|
|
129
|
+
}
|
|
130
|
+
_handleDismiss() {
|
|
131
|
+
this.dispatchEvent(new CustomEvent("bds-dismiss", { bubbles: true, composed: true }));
|
|
132
|
+
}
|
|
133
|
+
render() {
|
|
134
|
+
return T`
|
|
135
|
+
<div
|
|
136
|
+
class="alert"
|
|
137
|
+
role=${this._isUrgent ? "alert" : "status"}
|
|
138
|
+
aria-live=${this._isUrgent ? "assertive" : "polite"}
|
|
139
|
+
aria-atomic="true"
|
|
140
|
+
>
|
|
141
|
+
<span class="icon ${this._iconFilled ? "has-content" : ""}" aria-hidden="true">
|
|
142
|
+
<slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
|
|
143
|
+
</span>
|
|
144
|
+
<div class="content">
|
|
145
|
+
${this.title ? T`<strong class="title">${this.title}</strong>` : A}
|
|
146
|
+
<div><slot></slot></div>
|
|
147
|
+
</div>
|
|
148
|
+
${this.dismissible ? T`
|
|
149
|
+
<button
|
|
150
|
+
type="button"
|
|
151
|
+
class="dismiss"
|
|
152
|
+
@click=${this._handleDismiss}
|
|
153
|
+
aria-label="Dismiss alert"
|
|
154
|
+
>
|
|
155
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
156
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M18 6L6 18M6 6l12 12" />
|
|
157
|
+
</svg>
|
|
158
|
+
</button>
|
|
159
|
+
` : A}
|
|
160
|
+
</div>
|
|
161
|
+
`;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
customElements.define("bds-alert", BdsAlert);
|
|
165
|
+
|
|
166
|
+
export {
|
|
167
|
+
BdsAlert
|
|
168
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/ui/bds-rating.ts
|
|
8
|
+
var STAR_PATH = "M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z";
|
|
9
|
+
var BdsRating = class extends i2 {
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rating {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
gap: var(--bds-space_xxxs);
|
|
18
|
+
color: var(--bds-color_bg);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.star {
|
|
22
|
+
inline-size: 1.5em;
|
|
23
|
+
block-size: 1.5em;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.star.--filled {
|
|
27
|
+
color: var(--bds-color_warning);
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
static properties = {
|
|
31
|
+
value: { type: Number },
|
|
32
|
+
max: { type: Number }
|
|
33
|
+
};
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
this.value = 0;
|
|
37
|
+
this.max = 5;
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
return T`
|
|
41
|
+
<div
|
|
42
|
+
class="rating"
|
|
43
|
+
role="img"
|
|
44
|
+
aria-label="${this.value} out of ${this.max} stars"
|
|
45
|
+
>
|
|
46
|
+
${Array.from({ length: this.max }, (_, i3) => T`
|
|
47
|
+
<svg
|
|
48
|
+
class="star ${i3 < this.value ? "--filled" : ""}"
|
|
49
|
+
aria-hidden="true"
|
|
50
|
+
fill="currentColor"
|
|
51
|
+
viewBox="0 0 24 24"
|
|
52
|
+
>
|
|
53
|
+
<path d=${STAR_PATH} />
|
|
54
|
+
</svg>
|
|
55
|
+
`)}
|
|
56
|
+
</div>
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
customElements.define("bds-rating", BdsRating);
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
BdsRating
|
|
64
|
+
};
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import {
|
|
2
|
+
A,
|
|
3
|
+
T,
|
|
4
|
+
i,
|
|
5
|
+
i2
|
|
6
|
+
} from "./chunk-LGEZYFUU.js";
|
|
7
|
+
|
|
8
|
+
// src/web-components/interaction/bds-button.ts
|
|
9
|
+
var BdsButton = class extends i2 {
|
|
10
|
+
static styles = i`
|
|
11
|
+
@keyframes fadeZoom {
|
|
12
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
13
|
+
50% { opacity: 0.75; transform: scale(1.15); }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@keyframes pulse {
|
|
17
|
+
0% { transform: scale(1); box-shadow: 0 0 0 0 rgb(from var(--button_pulse-color, var(--button_color, var(--bds-color_green))) r g b / 50%); }
|
|
18
|
+
70% { transform: scale(1.01); box-shadow: 0 0 0 var(--bds-space_m) rgb(from var(--button_pulse-color, var(--button_color, var(--bds-color_green))) r g b / 0%); }
|
|
19
|
+
100% { transform: scale(1); box-shadow: 0 0 0 0 rgb(from var(--button_pulse-color, var(--button_color, var(--bds-color_green))) r g b / 0%); }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.button,
|
|
27
|
+
.button[href] {
|
|
28
|
+
all: unset;
|
|
29
|
+
position: relative;
|
|
30
|
+
font: inherit;
|
|
31
|
+
padding-inline: var(--bds-space_l);
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
gap: var(--bds-space_xs);
|
|
34
|
+
border-radius: var(--button_border_radius--s, var(--bds-border_radius--s));
|
|
35
|
+
align-items: center;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
height: var(--button_height, 3em);
|
|
39
|
+
font-size: var(--button_font-size, inherit);
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
line-height: 1;
|
|
42
|
+
|
|
43
|
+
--button_color: var(--bds-color_green);
|
|
44
|
+
--button_on-color: var(--bds-color_on-green);
|
|
45
|
+
|
|
46
|
+
background-color: var(--button_bg, var(--button_color));
|
|
47
|
+
color: var(--button_text, var(--button_on-color));
|
|
48
|
+
border: var(--button_border, none);
|
|
49
|
+
--bdc_color: transparent;
|
|
50
|
+
|
|
51
|
+
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
52
|
+
outline-offset: var(--bdc-outline_offset);
|
|
53
|
+
transition: var(--bds-animation_transition),
|
|
54
|
+
--bdc_color var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.button[href] {
|
|
58
|
+
text-decoration: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Variants */
|
|
62
|
+
.button.ghost {
|
|
63
|
+
--button_bg: transparent;
|
|
64
|
+
--button_text: var(--button_color);
|
|
65
|
+
--bdc_color: var(--button_color);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Sizes */
|
|
69
|
+
.button.small {
|
|
70
|
+
--button_height: 2.25em;
|
|
71
|
+
--button_font-size: var(--bds-font_size--body--s);
|
|
72
|
+
--button_border_radius--s: var(--bds-border_radius--xs);
|
|
73
|
+
padding-inline: var(--bds-space_m);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.button.medium {
|
|
77
|
+
--button_height: 3em;
|
|
78
|
+
padding-inline: var(--bds-space_l);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.button.large {
|
|
82
|
+
--button_font-size: var(--bds-font_size--heading-3);
|
|
83
|
+
--button_border_radius--s: var(--bds-border_radius--m);
|
|
84
|
+
padding-inline: var(--bds-space_xl);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Pulse */
|
|
88
|
+
.button.has-pulse {
|
|
89
|
+
animation: pulse 3s infinite;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* SVG icon colour */
|
|
93
|
+
.button svg {
|
|
94
|
+
--icon__stroke: currentcolor;
|
|
95
|
+
fill: currentcolor;
|
|
96
|
+
color: currentcolor;
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Icon slots — hidden by default, shown when slot has content */
|
|
101
|
+
.icon-start,
|
|
102
|
+
.icon-end {
|
|
103
|
+
display: none;
|
|
104
|
+
align-items: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.icon-start.has-content {
|
|
108
|
+
display: flex;
|
|
109
|
+
margin-inline-start: calc(var(--bds-space_s) * -1);
|
|
110
|
+
transition: var(--bds-animation_transition);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.icon-end.has-content {
|
|
114
|
+
display: flex;
|
|
115
|
+
margin-inline-end: calc(var(--bds-space_s) * -1);
|
|
116
|
+
transition: var(--bds-animation_transition);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Hover icon animation */
|
|
120
|
+
@media (hover: hover) and (pointer: fine) {
|
|
121
|
+
.button:hover .icon-start svg,
|
|
122
|
+
.button:hover .icon-end svg {
|
|
123
|
+
animation: fadeZoom 2s ease-out infinite;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Default hover */
|
|
127
|
+
.button.default:hover {
|
|
128
|
+
--button_bg: var(--bds-color_bg);
|
|
129
|
+
--button_text: var(--bds-color_interactive);
|
|
130
|
+
--button_pulse-color: var(--bds-color_interactive);
|
|
131
|
+
--bdc_color: currentcolor;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Ghost hover */
|
|
135
|
+
.button.ghost:hover {
|
|
136
|
+
--button_bg: var(--button_color);
|
|
137
|
+
--button_text: var(--button_on-color);
|
|
138
|
+
--bdc_color: transparent;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Focus visible */
|
|
143
|
+
.button:focus-visible {
|
|
144
|
+
outline: var(--bds-outline_default);
|
|
145
|
+
outline-offset: var(--bds-outline_offset);
|
|
146
|
+
border-radius: var(--bds-border_radius--s);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Disabled */
|
|
150
|
+
.button:disabled,
|
|
151
|
+
.button[aria-disabled='true'] {
|
|
152
|
+
opacity: 0.5;
|
|
153
|
+
cursor: not-allowed;
|
|
154
|
+
pointer-events: none;
|
|
155
|
+
}
|
|
156
|
+
`;
|
|
157
|
+
static properties = {
|
|
158
|
+
variant: { type: String, reflect: true },
|
|
159
|
+
size: { type: String, reflect: true },
|
|
160
|
+
disabled: { type: Boolean, reflect: true },
|
|
161
|
+
href: { type: String },
|
|
162
|
+
target: { type: String },
|
|
163
|
+
rel: { type: String },
|
|
164
|
+
hasPulse: { type: Boolean, attribute: "has-pulse", reflect: true },
|
|
165
|
+
type: { type: String },
|
|
166
|
+
ariaLabel: { type: String, attribute: "aria-label" },
|
|
167
|
+
// Internal state
|
|
168
|
+
_iconStartFilled: { state: true },
|
|
169
|
+
_iconEndFilled: { state: true }
|
|
170
|
+
};
|
|
171
|
+
constructor() {
|
|
172
|
+
super();
|
|
173
|
+
this.variant = "default";
|
|
174
|
+
this.size = "medium";
|
|
175
|
+
this.disabled = false;
|
|
176
|
+
this.hasPulse = false;
|
|
177
|
+
this.type = "button";
|
|
178
|
+
this.ariaLabel = null;
|
|
179
|
+
this._iconStartFilled = false;
|
|
180
|
+
this._iconEndFilled = false;
|
|
181
|
+
}
|
|
182
|
+
_onIconSlotChange(e, position) {
|
|
183
|
+
const slot = e.target;
|
|
184
|
+
const filled = slot.assignedNodes({ flatten: true }).length > 0;
|
|
185
|
+
if (position === "start") {
|
|
186
|
+
this._iconStartFilled = filled;
|
|
187
|
+
} else {
|
|
188
|
+
this._iconEndFilled = filled;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
get _classes() {
|
|
192
|
+
return `button ${this.variant} ${this.size}${this.hasPulse ? " has-pulse" : ""}`;
|
|
193
|
+
}
|
|
194
|
+
_handleAnchorClick(e) {
|
|
195
|
+
if (this.disabled) {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
_iconSlot(position) {
|
|
200
|
+
const filled = position === "start" ? this._iconStartFilled : this._iconEndFilled;
|
|
201
|
+
return T`
|
|
202
|
+
<span class="icon-${position} ${filled ? "has-content" : ""}">
|
|
203
|
+
<slot name="icon-${position}" @slotchange=${(e) => this._onIconSlotChange(e, position)}></slot>
|
|
204
|
+
</span>
|
|
205
|
+
`;
|
|
206
|
+
}
|
|
207
|
+
render() {
|
|
208
|
+
if (this.href) {
|
|
209
|
+
return T`
|
|
210
|
+
<a
|
|
211
|
+
class=${this._classes}
|
|
212
|
+
href=${this.disabled ? A : this.href}
|
|
213
|
+
target=${this.target ?? A}
|
|
214
|
+
rel=${this.rel ?? A}
|
|
215
|
+
aria-disabled=${this.disabled ? "true" : A}
|
|
216
|
+
tabindex=${this.disabled ? "-1" : A}
|
|
217
|
+
aria-label=${this.ariaLabel ?? A}
|
|
218
|
+
@click=${this._handleAnchorClick}
|
|
219
|
+
>
|
|
220
|
+
${this._iconSlot("start")}
|
|
221
|
+
<slot></slot>
|
|
222
|
+
${this._iconSlot("end")}
|
|
223
|
+
</a>
|
|
224
|
+
`;
|
|
225
|
+
}
|
|
226
|
+
return T`
|
|
227
|
+
<button
|
|
228
|
+
class=${this._classes}
|
|
229
|
+
type=${this.type}
|
|
230
|
+
?disabled=${this.disabled}
|
|
231
|
+
aria-label=${this.ariaLabel ?? A}
|
|
232
|
+
>
|
|
233
|
+
${this._iconSlot("start")}
|
|
234
|
+
<slot></slot>
|
|
235
|
+
${this._iconSlot("end")}
|
|
236
|
+
</button>
|
|
237
|
+
`;
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
customElements.define("bds-button", BdsButton);
|
|
241
|
+
|
|
242
|
+
export {
|
|
243
|
+
BdsButton
|
|
244
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/form/bds-radio.ts
|
|
8
|
+
var BdsRadio = class extends i2 {
|
|
9
|
+
static formAssociated = true;
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: flex-start;
|
|
14
|
+
gap: var(--bds-space_xs);
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
font-size: var(--bds-font_size--body);
|
|
17
|
+
font-family: var(--bds-font_family--body);
|
|
18
|
+
color: var(--bds-color_on-bg);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([disabled]) {
|
|
22
|
+
opacity: 0.5;
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.input {
|
|
28
|
+
--inputSize: calc(var(--bds-space_s) * 2);
|
|
29
|
+
margin-block-start: 0.25em;
|
|
30
|
+
inline-size: var(--inputSize);
|
|
31
|
+
block-size: var(--inputSize);
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
--bdc_color: currentcolor;
|
|
34
|
+
--bdc-outline_radius: 50%;
|
|
35
|
+
|
|
36
|
+
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
37
|
+
outline-offset: var(--bdc-outline_offset);
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
box-shadow: var(--radio_shadow, var(--bdc-outline_shadow));
|
|
40
|
+
border: none;
|
|
41
|
+
appearance: none;
|
|
42
|
+
background-color: var(--radio_color_bg, var(--bds-color_bg));
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
position: relative;
|
|
45
|
+
transition: --bdc_color 0.3s ease, background-color 0.3s ease;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.input:checked {
|
|
49
|
+
background-color: var(--radio_color-active, var(--bdc-color_active));
|
|
50
|
+
--bdc_color: var(--radio_color-active, var(--bdc-color_active));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.input:checked::after {
|
|
54
|
+
content: '';
|
|
55
|
+
position: absolute;
|
|
56
|
+
inset: 25%;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
background-color: var(--radio_color-on-active, var(--bdc-color_on-active));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.input:focus-visible {
|
|
62
|
+
outline: var(--bds-outline_default);
|
|
63
|
+
outline-offset: var(--bds-outline_offset);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
label {
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
flex: 1;
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
static properties = {
|
|
72
|
+
name: { type: String, reflect: true },
|
|
73
|
+
value: { type: String },
|
|
74
|
+
checked: { type: Boolean, reflect: true },
|
|
75
|
+
required: { type: Boolean, reflect: true },
|
|
76
|
+
disabled: { type: Boolean, reflect: true }
|
|
77
|
+
};
|
|
78
|
+
_internals;
|
|
79
|
+
_uid = Math.random().toString(36).slice(2, 8);
|
|
80
|
+
constructor() {
|
|
81
|
+
super();
|
|
82
|
+
this._internals = this.attachInternals();
|
|
83
|
+
this.name = "";
|
|
84
|
+
this.value = "";
|
|
85
|
+
this.checked = false;
|
|
86
|
+
this.required = false;
|
|
87
|
+
this.disabled = false;
|
|
88
|
+
}
|
|
89
|
+
updated(changed) {
|
|
90
|
+
super.updated(changed);
|
|
91
|
+
if (changed.has("checked") || changed.has("value")) {
|
|
92
|
+
this._internals.setFormValue?.(this.checked ? this.value : null);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
formResetCallback() {
|
|
96
|
+
this.checked = false;
|
|
97
|
+
this._internals.setFormValue?.(null);
|
|
98
|
+
}
|
|
99
|
+
_handleChange(e) {
|
|
100
|
+
this.checked = e.target.checked;
|
|
101
|
+
}
|
|
102
|
+
render() {
|
|
103
|
+
const id = `bds-radio-${this._uid}`;
|
|
104
|
+
return T`
|
|
105
|
+
<input
|
|
106
|
+
id=${id}
|
|
107
|
+
type="radio"
|
|
108
|
+
class="input"
|
|
109
|
+
name=${this.name}
|
|
110
|
+
value=${this.value}
|
|
111
|
+
.checked=${this.checked}
|
|
112
|
+
?required=${this.required}
|
|
113
|
+
?disabled=${this.disabled}
|
|
114
|
+
@change=${this._handleChange}
|
|
115
|
+
/>
|
|
116
|
+
<label for=${id}><slot></slot></label>
|
|
117
|
+
`;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
customElements.define("bds-radio", BdsRadio);
|
|
121
|
+
|
|
122
|
+
export {
|
|
123
|
+
BdsRadio
|
|
124
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/ui/bds-badge.ts
|
|
8
|
+
var BdsBadge = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.badge {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
padding: var(--bds-space_xxs) var(--bds-space_xs);
|
|
19
|
+
border-radius: var(--badge_radius, 2em);
|
|
20
|
+
font-size: var(--badge_font-size, var(--bds-font_size--body--s));
|
|
21
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
22
|
+
line-height: 1;
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
background-color: var(--badge_bg, var(--bds-color_blue));
|
|
25
|
+
color: var(--badge_text, var(--bds-color_on-blue));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Variant overrides */
|
|
29
|
+
:host([variant='primary']) .badge {
|
|
30
|
+
--badge_bg: var(--bds-color_interactive);
|
|
31
|
+
--badge_text: var(--bds-color_on-interactive);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([variant='secondary']) .badge {
|
|
35
|
+
--badge_bg: var(--bds-color_bg);
|
|
36
|
+
--badge_text: var(--bds-color_on-bg);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host([variant='success']) .badge {
|
|
40
|
+
--badge_bg: var(--bds-color_success);
|
|
41
|
+
--badge_text: var(--bds-color_on-success);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host([variant='error']) .badge {
|
|
45
|
+
--badge_bg: var(--bds-color_error);
|
|
46
|
+
--badge_text: var(--bds-color_on-error);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host([variant='warning']) .badge {
|
|
50
|
+
--badge_bg: var(--bds-color_warning);
|
|
51
|
+
--badge_text: var(--bds-color_on-warning);
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
static properties = {
|
|
55
|
+
variant: { type: String, reflect: true }
|
|
56
|
+
};
|
|
57
|
+
constructor() {
|
|
58
|
+
super();
|
|
59
|
+
this.variant = "primary";
|
|
60
|
+
}
|
|
61
|
+
render() {
|
|
62
|
+
return T`<span class="badge"><slot></slot></span>`;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
customElements.define("bds-badge", BdsBadge);
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
BdsBadge
|
|
69
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/bds-tab-panel.ts
|
|
8
|
+
var BdsTabPanel = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
padding-block-start: var(--bds-space_m);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([hidden]) {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
render() {
|
|
20
|
+
return T`<slot></slot>`;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
customElements.define("bds-tab-panel", BdsTabPanel);
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
BdsTabPanel
|
|
27
|
+
};
|