@boostdev/design-system-components 1.1.1 → 1.2.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 +13 -10
- package/dist/client.cjs +77 -99
- package/dist/client.css +611 -580
- package/dist/client.d.cts +13 -16
- package/dist/client.d.ts +13 -16
- package/dist/client.js +87 -109
- package/dist/index.cjs +77 -99
- package/dist/index.css +611 -580
- package/dist/index.d.cts +13 -16
- package/dist/index.d.ts +13 -16
- package/dist/index.js +87 -109
- package/dist/native/index.cjs +9 -8
- package/dist/native/index.d.cts +1 -1
- package/dist/native/index.d.ts +1 -1
- package/dist/native/index.js +9 -8
- package/dist/web-components/chunk-2QA62WCQ.js +48 -0
- package/dist/web-components/chunk-3REOIRDW.js +246 -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-6MH5UWUD.js +226 -0
- package/dist/web-components/chunk-7FMR53BW.js +127 -0
- package/dist/web-components/chunk-AGKJTMJI.js +56 -0
- package/dist/web-components/chunk-AJSXNDAP.js +151 -0
- package/dist/web-components/chunk-BQLZ7I4G.js +56 -0
- package/dist/web-components/chunk-BX3IPVOB.js +167 -0
- package/dist/web-components/chunk-CR5PGUHV.js +109 -0
- package/dist/web-components/chunk-DI46Q2EA.js +278 -0
- package/dist/web-components/chunk-DZRSJGPB.js +53 -0
- package/dist/web-components/chunk-EBJM3VD4.js +107 -0
- package/dist/web-components/chunk-ECW3HHWA.js +185 -0
- package/dist/web-components/chunk-HGBNDR22.js +98 -0
- package/dist/web-components/chunk-HHHRF2PS.js +118 -0
- package/dist/web-components/chunk-ITHLKR7Q.js +105 -0
- package/dist/web-components/chunk-JUKB3BUP.js +186 -0
- package/dist/web-components/chunk-L3XHOMN6.js +111 -0
- package/dist/{web-components.js → web-components/chunk-LGEZYFUU.js} +62 -844
- package/dist/web-components/chunk-LY62SAVN.js +64 -0
- package/dist/web-components/chunk-N6IMUOY4.js +185 -0
- package/dist/web-components/chunk-OHUTLSIQ.js +69 -0
- package/dist/web-components/chunk-OQTRTMAB.js +27 -0
- package/dist/web-components/chunk-PY62FTRW.js +179 -0
- package/dist/web-components/chunk-Q4T5BJT6.js +94 -0
- package/dist/web-components/chunk-QDST57JC.js +119 -0
- package/dist/web-components/chunk-QLZ2362S.js +279 -0
- package/dist/web-components/chunk-QPOKHLMQ.js +45 -0
- package/dist/web-components/chunk-SOQQ7RVJ.js +88 -0
- package/dist/web-components/chunk-T6AETZRP.js +131 -0
- package/dist/web-components/chunk-UFFCKVZE.js +149 -0
- package/dist/web-components/chunk-VMMVWLXL.js +53 -0
- package/dist/web-components/chunk-X3FKVHLK.js +144 -0
- package/dist/web-components/chunk-XNA6WTXG.js +133 -0
- package/dist/web-components/chunk-Y4MAXTMA.js +80 -0
- package/dist/web-components/chunk-YLVTEY23.js +165 -0
- package/dist/web-components/chunk-YRXCVKHV.js +116 -0
- package/dist/web-components/chunk-ZTC6GRP7.js +64 -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 +88 -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 +170 -5
- package/src/components/interaction/Button/Button.module.css +12 -11
- package/src/components/interaction/Button/Button.native.tsx +10 -9
- package/src/components/interaction/Button/Button.tsx +1 -1
- package/src/components/interaction/Command/Command.module.css +3 -7
- package/src/components/interaction/Dialog/Dialog.module.css +7 -5
- package/src/components/interaction/Drawer/Drawer.module.css +49 -1
- package/src/components/interaction/DropdownMenu/DropdownMenu.module.css +1 -3
- package/src/components/interaction/Popover/Popover.module.css +1 -3
- package/src/components/interaction/form/Checkbox/Checkbox.module.css +1 -3
- package/src/components/interaction/form/Combobox/Combobox.module.css +2 -6
- package/src/components/interaction/form/FormInput/FormInput.module.css +1 -3
- package/src/components/interaction/form/NumberInput/NumberInput.module.css +16 -4
- package/src/components/interaction/form/Radio/Radio.module.css +6 -16
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.mdx +70 -25
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.module.css +55 -33
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.spec.tsx +127 -56
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.stories.tsx +89 -72
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.tsx +40 -62
- package/src/components/interaction/form/SegmentedControl/index.ts +1 -1
- package/src/components/interaction/form/Select/Select.module.css +2 -4
- package/src/components/interaction/form/Switch/Switch.module.css +5 -7
- package/src/components/interaction/form/Switch/Switch.native.spec.tsx +9 -9
- package/src/components/interaction/form/Switch/Switch.native.tsx +2 -2
- package/src/components/interaction/form/Textarea/Textarea.module.css +1 -3
- package/src/components/interaction/form/atoms/InputContainer.stories.tsx +64 -0
- package/src/components/interaction/form/atoms/Label.stories.tsx +33 -0
- package/src/components/interaction/form/atoms/Message.stories.tsx +33 -0
- package/src/components/layout/Card/Card.module.css +1 -3
- package/src/components/ui/Accordion/Accordion.module.css +1 -2
- package/src/components/ui/Alert/Alert.module.css +1 -2
- package/src/components/ui/Calendar/Calendar.module.css +2 -5
- package/src/components/ui/Carousel/Carousel.module.css +1 -3
- package/src/components/ui/NotificationBanner/NotificationBanner.module.css +1 -2
- package/src/components/ui/Pagination/Pagination.module.css +1 -2
- package/src/components/ui/SkipLink/SkipLink.module.css +1 -2
- package/src/components/ui/Table/Table.module.css +1 -2
- package/src/css/bdc.css +16 -11
- package/src/index.ts +1 -1
- package/src/web-components/globals.ts +3 -3
- package/src/web-components/index.ts +47 -0
- package/src/web-components/interaction/BdsAccordion.mdx +51 -0
- package/src/web-components/interaction/BdsAccordion.stories.tsx +85 -0
- package/src/web-components/interaction/BdsCollapsible.mdx +46 -0
- package/src/web-components/interaction/BdsCollapsible.stories.tsx +87 -0
- package/src/web-components/interaction/BdsDialog.mdx +49 -0
- package/src/web-components/interaction/BdsDialog.stories.tsx +75 -0
- package/src/web-components/interaction/BdsDrawer.mdx +50 -0
- package/src/web-components/interaction/BdsDrawer.stories.tsx +66 -0
- package/src/web-components/interaction/BdsSkipLink.mdx +34 -0
- package/src/web-components/interaction/BdsSkipLink.stories.tsx +55 -0
- package/src/web-components/interaction/BdsTabs.mdx +47 -0
- package/src/web-components/interaction/BdsTabs.stories.tsx +80 -0
- package/src/web-components/interaction/BdsTooltip.mdx +38 -0
- package/src/web-components/interaction/BdsTooltip.stories.tsx +68 -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 +98 -0
- package/src/web-components/interaction/bds-button.ts +15 -13
- 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 +221 -0
- package/src/web-components/interaction/bds-drawer.spec.ts +113 -0
- package/src/web-components/interaction/bds-drawer.ts +315 -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/BdsCheckbox.mdx +39 -0
- package/src/web-components/interaction/form/BdsCheckbox.stories.tsx +73 -0
- package/src/web-components/interaction/form/BdsCombobox.mdx +52 -0
- package/src/web-components/interaction/form/BdsCombobox.stories.tsx +91 -0
- package/src/web-components/interaction/form/BdsFileInput.mdx +44 -0
- package/src/web-components/interaction/form/BdsFileInput.stories.tsx +84 -0
- package/src/web-components/interaction/form/BdsNumberInput.mdx +41 -0
- package/src/web-components/interaction/form/BdsNumberInput.stories.tsx +90 -0
- package/src/web-components/interaction/form/BdsRadio.mdx +41 -0
- package/src/web-components/interaction/form/BdsRadio.stories.tsx +90 -0
- package/src/web-components/interaction/form/BdsSegmentedControl.mdx +42 -0
- package/src/web-components/interaction/form/BdsSegmentedControl.stories.tsx +92 -0
- package/src/web-components/interaction/form/BdsSelect.mdx +38 -0
- package/src/web-components/interaction/form/BdsSelect.stories.tsx +93 -0
- package/src/web-components/interaction/form/BdsSlider.mdx +49 -0
- package/src/web-components/interaction/form/BdsSlider.stories.tsx +89 -0
- package/src/web-components/interaction/form/BdsSwitch.mdx +39 -0
- package/src/web-components/interaction/form/BdsSwitch.stories.tsx +73 -0
- package/src/web-components/interaction/form/BdsTextarea.mdx +41 -0
- package/src/web-components/interaction/form/BdsTextarea.stories.tsx +79 -0
- package/src/web-components/interaction/form/bds-checkbox.spec.ts +63 -0
- package/src/web-components/interaction/form/bds-checkbox.ts +166 -0
- package/src/web-components/interaction/form/bds-combobox.spec.ts +117 -0
- package/src/web-components/interaction/form/bds-combobox.ts +334 -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 +220 -0
- package/src/web-components/interaction/form/bds-radio.spec.ts +70 -0
- package/src/web-components/interaction/form/bds-radio.ts +151 -0
- package/src/web-components/interaction/form/bds-segmented-control.spec.ts +74 -0
- package/src/web-components/interaction/form/bds-segmented-control.ts +282 -0
- package/src/web-components/interaction/form/bds-select.spec.ts +74 -0
- package/src/web-components/interaction/form/bds-select.ts +188 -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 +165 -0
- package/src/web-components/interaction/form/bds-textarea.spec.ts +55 -0
- package/src/web-components/interaction/form/bds-textarea.ts +141 -0
- package/src/web-components/ui/BdsAvatar.mdx +67 -0
- package/src/web-components/ui/BdsAvatar.stories.tsx +62 -0
- package/src/web-components/ui/BdsBreadcrumb.mdx +63 -0
- package/src/web-components/ui/BdsBreadcrumb.stories.tsx +59 -0
- package/src/web-components/ui/BdsCard.mdx +83 -0
- package/src/web-components/ui/BdsCard.stories.tsx +90 -0
- package/src/web-components/ui/BdsDescriptionList.mdx +67 -0
- package/src/web-components/ui/BdsDescriptionList.stories.tsx +79 -0
- package/src/web-components/ui/BdsIconWrapper.mdx +70 -0
- package/src/web-components/ui/BdsIconWrapper.stories.tsx +76 -0
- package/src/web-components/ui/BdsLink.mdx +75 -0
- package/src/web-components/ui/BdsLink.stories.tsx +64 -0
- package/src/web-components/ui/BdsLoading.mdx +62 -0
- package/src/web-components/ui/BdsLoading.stories.tsx +37 -0
- package/src/web-components/ui/BdsNotificationBanner.mdx +90 -0
- package/src/web-components/ui/BdsNotificationBanner.stories.tsx +93 -0
- package/src/web-components/ui/BdsProgress.mdx +63 -0
- package/src/web-components/ui/BdsProgress.stories.tsx +70 -0
- package/src/web-components/ui/BdsProgressCircle.mdx +64 -0
- package/src/web-components/ui/BdsProgressCircle.stories.tsx +69 -0
- package/src/web-components/ui/BdsRating.mdx +61 -0
- package/src/web-components/ui/BdsRating.stories.tsx +39 -0
- package/src/web-components/ui/BdsSectionHeader.mdx +69 -0
- package/src/web-components/ui/BdsSectionHeader.stories.tsx +56 -0
- package/src/web-components/ui/BdsSeparator.mdx +63 -0
- package/src/web-components/ui/BdsSeparator.stories.tsx +47 -0
- package/src/web-components/ui/BdsSkeleton.mdx +67 -0
- package/src/web-components/ui/BdsSkeleton.stories.tsx +50 -0
- package/src/web-components/ui/BdsTypography.mdx +83 -0
- package/src/web-components/ui/BdsTypography.stories.tsx +51 -0
- package/src/web-components/ui/bds-alert.ts +1 -2
- 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 +154 -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 +184 -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 -304
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/ui/bds-icon-wrapper.ts
|
|
8
|
+
var BdsIconWrapper = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.wrapper {
|
|
15
|
+
inline-size: 2em;
|
|
16
|
+
block-size: 2em;
|
|
17
|
+
font-size: 3em;
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
margin: var(--bds-space_l) auto var(--bds-space_m);
|
|
23
|
+
background: var(--icon-wrapper-color, var(--bds-color_bg));
|
|
24
|
+
color: var(--bds-on-icon-wrapper-color, var(--bds-color_on-bg));
|
|
25
|
+
fill: var(--bds-on-icon-wrapper-color, var(--bds-color_on-bg));
|
|
26
|
+
position: relative;
|
|
27
|
+
transition: var(--bds-animation_transition);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.wrapper svg {
|
|
31
|
+
fill: currentcolor;
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
static properties = {
|
|
35
|
+
ariaHidden: { type: String, attribute: "aria-hidden", reflect: true }
|
|
36
|
+
};
|
|
37
|
+
constructor() {
|
|
38
|
+
super();
|
|
39
|
+
this.ariaHidden = "";
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return T`<div class="wrapper"><slot></slot></div>`;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
customElements.define("bds-icon-wrapper", BdsIconWrapper);
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
BdsIconWrapper
|
|
49
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/bds-tab.ts
|
|
8
|
+
var BdsTab = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.tab {
|
|
15
|
+
all: unset;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
padding: var(--bds-space_s) var(--bds-space_m);
|
|
19
|
+
font-family: var(--bds-font_family--body);
|
|
20
|
+
font-size: var(--bds-font_size--body);
|
|
21
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
22
|
+
color: var(--tab_color, var(--bds-color_on-bg));
|
|
23
|
+
border-block-end: 2px solid var(--tab_border-color, transparent);
|
|
24
|
+
margin-block-end: -1px;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
transition: var(--bds-animation_transition);
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([selected]) .tab {
|
|
31
|
+
--tab_color: var(--bds-color_interactive_on-bg);
|
|
32
|
+
--tab_border-color: var(--bds-color_interactive);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tab:disabled {
|
|
36
|
+
opacity: 0.4;
|
|
37
|
+
cursor: not-allowed;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.tab:focus-visible {
|
|
41
|
+
outline: var(--bds-outline_default);
|
|
42
|
+
outline-offset: var(--bds-outline_offset);
|
|
43
|
+
border-radius: var(--bds-border_radius--xs);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (hover: hover) and (pointer: fine) {
|
|
47
|
+
.tab:not(:disabled, [aria-selected='true']):hover {
|
|
48
|
+
--tab_color: var(--bds-color_interactive_on-bg);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
static properties = {
|
|
53
|
+
selected: { type: Boolean, reflect: true },
|
|
54
|
+
disabled: { type: Boolean, reflect: true }
|
|
55
|
+
};
|
|
56
|
+
constructor() {
|
|
57
|
+
super();
|
|
58
|
+
this.selected = false;
|
|
59
|
+
this.disabled = false;
|
|
60
|
+
}
|
|
61
|
+
/** Called by `bds-tabs` to focus the inner button for keyboard navigation. */
|
|
62
|
+
focusButton() {
|
|
63
|
+
this.shadowRoot?.querySelector("button")?.focus();
|
|
64
|
+
}
|
|
65
|
+
_handleClick() {
|
|
66
|
+
if (this.disabled) return;
|
|
67
|
+
this.dispatchEvent(new CustomEvent("bds-tab-select", { bubbles: true, composed: true }));
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
return T`
|
|
71
|
+
<button
|
|
72
|
+
type="button"
|
|
73
|
+
class="tab"
|
|
74
|
+
role="tab"
|
|
75
|
+
aria-selected=${this.selected}
|
|
76
|
+
tabindex=${this.selected ? 0 : -1}
|
|
77
|
+
?disabled=${this.disabled}
|
|
78
|
+
@click=${this._handleClick}
|
|
79
|
+
>
|
|
80
|
+
<slot></slot>
|
|
81
|
+
</button>
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
customElements.define("bds-tab", BdsTab);
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
BdsTab
|
|
89
|
+
};
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import {
|
|
2
|
+
A,
|
|
3
|
+
T,
|
|
4
|
+
i,
|
|
5
|
+
i2
|
|
6
|
+
} from "./chunk-LGEZYFUU.js";
|
|
7
|
+
|
|
8
|
+
// src/web-components/interaction/form/bds-segmented-control.ts
|
|
9
|
+
var BdsSegmentedControl = class extends i2 {
|
|
10
|
+
static formAssociated = true;
|
|
11
|
+
static styles = i`
|
|
12
|
+
:host {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([disabled]) {
|
|
17
|
+
opacity: 0.5;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.control {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
position: relative;
|
|
24
|
+
border-radius: var(--bds-border_radius--s);
|
|
25
|
+
background-color: var(--segmented_color_bg, var(--bds-color_bg--subtle));
|
|
26
|
+
padding: 0.25rem;
|
|
27
|
+
gap: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Sliding thumb */
|
|
31
|
+
.thumb {
|
|
32
|
+
position: absolute;
|
|
33
|
+
inset-block: 0.25rem;
|
|
34
|
+
border-radius: calc(var(--bds-border_radius--s) - 2px);
|
|
35
|
+
background-color: var(--segmented_thumb-color, var(--bds-color_interactive));
|
|
36
|
+
box-shadow: var(--bds-shadow_m);
|
|
37
|
+
transition: inset-inline-start var(--bds-animation_transition-duration) var(--bds-animation_easing),
|
|
38
|
+
inline-size var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
/* Position set via JS in updated() */
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.radio {
|
|
44
|
+
position: absolute;
|
|
45
|
+
opacity: 0;
|
|
46
|
+
inline-size: 0;
|
|
47
|
+
block-size: 0;
|
|
48
|
+
margin: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.item {
|
|
52
|
+
position: relative;
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
padding: var(--bds-space_xs) var(--bds-space_m);
|
|
57
|
+
font-size: var(--bds-font_size--body--s);
|
|
58
|
+
font-family: var(--bds-font_family--body);
|
|
59
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
60
|
+
color: var(--segmented_color, var(--bds-color_on-bg));
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
border-radius: calc(var(--bds-border_radius--s) - 2px);
|
|
63
|
+
transition: color var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
64
|
+
user-select: none;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
text-decoration: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.item.--active {
|
|
70
|
+
color: var(--segmented_color--active, var(--bds-color_on-interactive));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.item.--disabled {
|
|
74
|
+
opacity: 0.4;
|
|
75
|
+
cursor: not-allowed;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.radio:focus-visible + .item-label {
|
|
79
|
+
outline: var(--bds-outline_default);
|
|
80
|
+
outline-offset: var(--bds-outline_offset);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Outline variant: sliding inset-border indicator (positioned via JS like .thumb) */
|
|
84
|
+
.indicator {
|
|
85
|
+
position: absolute;
|
|
86
|
+
inset-block: 0.25rem;
|
|
87
|
+
border-radius: calc(var(--bds-border_radius--s) - 2px);
|
|
88
|
+
pointer-events: none;
|
|
89
|
+
z-index: 2;
|
|
90
|
+
display: none;
|
|
91
|
+
transition: inset-inline-start var(--bds-animation_transition-duration) var(--bds-animation_easing),
|
|
92
|
+
inline-size var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* Outline variant — no thumb, sliding inset-border indicator, interactive active color */
|
|
96
|
+
:host([variant='outline']) .thumb {
|
|
97
|
+
display: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host([variant='outline']) .item.--active {
|
|
101
|
+
color: var(--segmented_color--active, var(--bds-color_interactive));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host([variant='outline']) .indicator {
|
|
105
|
+
display: block;
|
|
106
|
+
box-shadow: inset 0 0 0 2px var(--bds-color_interactive);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@media (prefers-reduced-motion: reduce) {
|
|
110
|
+
.thumb,
|
|
111
|
+
.indicator {
|
|
112
|
+
transition: none;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
static properties = {
|
|
117
|
+
name: { type: String, reflect: true },
|
|
118
|
+
value: { type: String },
|
|
119
|
+
options: { type: String },
|
|
120
|
+
disabled: { type: Boolean, reflect: true },
|
|
121
|
+
variant: { type: String, reflect: true }
|
|
122
|
+
};
|
|
123
|
+
_internals;
|
|
124
|
+
_uid = Math.random().toString(36).slice(2, 8);
|
|
125
|
+
constructor() {
|
|
126
|
+
super();
|
|
127
|
+
this._internals = this.attachInternals();
|
|
128
|
+
this.name = "";
|
|
129
|
+
this.value = "";
|
|
130
|
+
this.options = "[]";
|
|
131
|
+
this.disabled = false;
|
|
132
|
+
this.variant = "outline";
|
|
133
|
+
}
|
|
134
|
+
get _options() {
|
|
135
|
+
try {
|
|
136
|
+
return JSON.parse(this.options);
|
|
137
|
+
} catch {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
updated(changed) {
|
|
142
|
+
super.updated(changed);
|
|
143
|
+
if (changed.has("value") || changed.has("options")) {
|
|
144
|
+
this._internals.setFormValue?.(this.value || null);
|
|
145
|
+
if (this.variant === "filled") this._updateThumb();
|
|
146
|
+
if (this.variant === "outline") this._updateIndicator();
|
|
147
|
+
}
|
|
148
|
+
if (changed.has("variant")) {
|
|
149
|
+
if (this.variant === "filled") this._updateThumb();
|
|
150
|
+
if (this.variant === "outline") this._updateIndicator();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
_positionSlider(el, items, selectedIndex) {
|
|
154
|
+
if (!el || items.length === 0) return;
|
|
155
|
+
const item = items[selectedIndex];
|
|
156
|
+
if (!item) return;
|
|
157
|
+
const controlRect = item.parentElement.getBoundingClientRect();
|
|
158
|
+
const itemRect = item.getBoundingClientRect();
|
|
159
|
+
el.style.insetInlineStart = `${itemRect.left - controlRect.left}px`;
|
|
160
|
+
el.style.inlineSize = `${itemRect.width}px`;
|
|
161
|
+
}
|
|
162
|
+
_updateThumb() {
|
|
163
|
+
const selectedIndex = Math.max(0, this._options.findIndex((o) => o.value === this.value));
|
|
164
|
+
const items = this.shadowRoot?.querySelectorAll(".item");
|
|
165
|
+
this._positionSlider(this.shadowRoot?.querySelector(".thumb"), items, selectedIndex);
|
|
166
|
+
}
|
|
167
|
+
_updateIndicator() {
|
|
168
|
+
const selectedIndex = Math.max(0, this._options.findIndex((o) => o.value === this.value));
|
|
169
|
+
const items = this.shadowRoot?.querySelectorAll(".item");
|
|
170
|
+
this._positionSlider(this.shadowRoot?.querySelector(".indicator"), items, selectedIndex);
|
|
171
|
+
}
|
|
172
|
+
formResetCallback() {
|
|
173
|
+
const firstOption = this._options[0];
|
|
174
|
+
this.value = firstOption?.value ?? "";
|
|
175
|
+
this._internals.setFormValue?.(this.value || null);
|
|
176
|
+
}
|
|
177
|
+
_handleChange(optionValue) {
|
|
178
|
+
this.value = optionValue;
|
|
179
|
+
this.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
|
|
180
|
+
}
|
|
181
|
+
render() {
|
|
182
|
+
const opts = this._options;
|
|
183
|
+
return T`
|
|
184
|
+
<div class="control" role="group">
|
|
185
|
+
<span class="thumb" aria-hidden="true"></span>
|
|
186
|
+
<span class="indicator" aria-hidden="true"></span>
|
|
187
|
+
${opts.map((opt, i3) => {
|
|
188
|
+
const isActive = opt.value === this.value;
|
|
189
|
+
const isDisabled = this.disabled || opt.disabled;
|
|
190
|
+
const itemClass = `item ${isActive ? "--active" : ""} ${isDisabled ? "--disabled" : ""}`.trim();
|
|
191
|
+
if (opt.href) {
|
|
192
|
+
return T`
|
|
193
|
+
<a
|
|
194
|
+
class=${itemClass}
|
|
195
|
+
href=${isDisabled ? A : opt.href}
|
|
196
|
+
aria-current=${isActive ? "page" : A}
|
|
197
|
+
?aria-disabled=${isDisabled}
|
|
198
|
+
>${opt.label}</a>
|
|
199
|
+
`;
|
|
200
|
+
}
|
|
201
|
+
const id = `bds-seg-${this._uid}-${i3}`;
|
|
202
|
+
return T`
|
|
203
|
+
<label class=${itemClass} for=${id}>
|
|
204
|
+
<input
|
|
205
|
+
id=${id}
|
|
206
|
+
type="radio"
|
|
207
|
+
class="radio"
|
|
208
|
+
name=${this.name || this._uid}
|
|
209
|
+
value=${opt.value}
|
|
210
|
+
.checked=${isActive}
|
|
211
|
+
?disabled=${isDisabled}
|
|
212
|
+
@change=${() => this._handleChange(opt.value)}
|
|
213
|
+
/>
|
|
214
|
+
${opt.label}
|
|
215
|
+
</label>
|
|
216
|
+
`;
|
|
217
|
+
})}
|
|
218
|
+
</div>
|
|
219
|
+
`;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
customElements.define("bds-segmented-control", BdsSegmentedControl);
|
|
223
|
+
|
|
224
|
+
export {
|
|
225
|
+
BdsSegmentedControl
|
|
226
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/form/bds-slider.ts
|
|
8
|
+
var BdsSlider = class extends i2 {
|
|
9
|
+
static formAssociated = true;
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([disabled]) {
|
|
16
|
+
opacity: 0.5;
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.track-wrapper {
|
|
21
|
+
position: relative;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.input {
|
|
27
|
+
inline-size: 100%;
|
|
28
|
+
appearance: none;
|
|
29
|
+
block-size: 0.25rem;
|
|
30
|
+
border-radius: 999px;
|
|
31
|
+
background: linear-gradient(
|
|
32
|
+
to right,
|
|
33
|
+
var(--slider_fill-color, var(--bds-color_interactive)) var(--slider_fill, 0%),
|
|
34
|
+
var(--slider_track-color, var(--bds-color_bg--subtle)) var(--slider_fill, 0%)
|
|
35
|
+
);
|
|
36
|
+
outline: none;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.input::-webkit-slider-thumb {
|
|
41
|
+
appearance: none;
|
|
42
|
+
inline-size: 1.25rem;
|
|
43
|
+
block-size: 1.25rem;
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
background-color: var(--slider_thumb-color, var(--bds-color_interactive));
|
|
46
|
+
box-shadow: var(--bds-shadow_m);
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
transition: var(--bds-animation_transition);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.input::-moz-range-thumb {
|
|
52
|
+
inline-size: 1.25rem;
|
|
53
|
+
block-size: 1.25rem;
|
|
54
|
+
border-radius: 50%;
|
|
55
|
+
border: none;
|
|
56
|
+
background-color: var(--slider_thumb-color, var(--bds-color_interactive));
|
|
57
|
+
box-shadow: var(--bds-shadow_m);
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.input:focus-visible {
|
|
62
|
+
outline: var(--bds-outline_default);
|
|
63
|
+
outline-offset: var(--bds-outline_offset);
|
|
64
|
+
border-radius: 999px;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
static properties = {
|
|
68
|
+
name: { type: String, reflect: true },
|
|
69
|
+
value: { type: Number },
|
|
70
|
+
min: { type: Number },
|
|
71
|
+
max: { type: Number },
|
|
72
|
+
step: { type: Number },
|
|
73
|
+
disabled: { type: Boolean, reflect: true }
|
|
74
|
+
};
|
|
75
|
+
_internals;
|
|
76
|
+
constructor() {
|
|
77
|
+
super();
|
|
78
|
+
this._internals = this.attachInternals();
|
|
79
|
+
this.name = "";
|
|
80
|
+
this.value = 0;
|
|
81
|
+
this.min = 0;
|
|
82
|
+
this.max = 100;
|
|
83
|
+
this.step = 1;
|
|
84
|
+
this.disabled = false;
|
|
85
|
+
}
|
|
86
|
+
updated(changed) {
|
|
87
|
+
super.updated(changed);
|
|
88
|
+
if (changed.has("value")) {
|
|
89
|
+
this._internals.setFormValue?.(String(this.value));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
formResetCallback() {
|
|
93
|
+
this.value = 0;
|
|
94
|
+
this._internals.setFormValue?.("0");
|
|
95
|
+
}
|
|
96
|
+
get _fillPct() {
|
|
97
|
+
const range = this.max - this.min;
|
|
98
|
+
if (range === 0) return 0;
|
|
99
|
+
return (this.value - this.min) / range * 100;
|
|
100
|
+
}
|
|
101
|
+
_handleInput(e) {
|
|
102
|
+
this.value = parseFloat(e.target.value);
|
|
103
|
+
}
|
|
104
|
+
render() {
|
|
105
|
+
return T`
|
|
106
|
+
<div class="track-wrapper">
|
|
107
|
+
<input
|
|
108
|
+
type="range"
|
|
109
|
+
class="input"
|
|
110
|
+
name=${this.name}
|
|
111
|
+
.value=${String(this.value)}
|
|
112
|
+
min=${this.min}
|
|
113
|
+
max=${this.max}
|
|
114
|
+
step=${this.step}
|
|
115
|
+
?disabled=${this.disabled}
|
|
116
|
+
style="--slider_fill: ${this._fillPct}%"
|
|
117
|
+
@input=${this._handleInput}
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
customElements.define("bds-slider", BdsSlider);
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
BdsSlider
|
|
127
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/ui/bds-description-list.ts
|
|
8
|
+
var BdsDescriptionList = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.list {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: var(--bds-space_s);
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
font-size: var(--bds-font_size--body);
|
|
21
|
+
color: var(--bds-color_on-bg);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Style slotted dt/dd elements */
|
|
25
|
+
::slotted(dt) {
|
|
26
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
27
|
+
color: var(--bds-color_on-bg);
|
|
28
|
+
margin: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
::slotted(dd) {
|
|
32
|
+
margin: 0;
|
|
33
|
+
color: var(--bds-color_on-bg);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Inline layout: pair each dt/dd side by side */
|
|
37
|
+
:host([layout='inline']) .list {
|
|
38
|
+
gap: var(--bds-space_xs);
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
static properties = {
|
|
42
|
+
layout: { type: String, reflect: true }
|
|
43
|
+
};
|
|
44
|
+
constructor() {
|
|
45
|
+
super();
|
|
46
|
+
this.layout = "stacked";
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
return T`<dl class="list"><slot></slot></dl>`;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
customElements.define("bds-description-list", BdsDescriptionList);
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
BdsDescriptionList
|
|
56
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
A,
|
|
3
|
+
T,
|
|
4
|
+
i,
|
|
5
|
+
i2
|
|
6
|
+
} from "./chunk-LGEZYFUU.js";
|
|
7
|
+
|
|
8
|
+
// src/web-components/ui/bds-notification-banner.ts
|
|
9
|
+
var BdsNotificationBanner = class extends i2 {
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.banner {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: var(--bds-space_m);
|
|
19
|
+
padding: var(--bds-space_s) var(--bds-space_m);
|
|
20
|
+
background-color: var(--banner_bg, var(--bds-color_blue--subtle));
|
|
21
|
+
color: var(--banner_text, var(--bds-color_on-blue--subtle));
|
|
22
|
+
border-block-end: 3px solid var(--banner_border, var(--bds-color_blue));
|
|
23
|
+
font-size: var(--bds-font_size--body);
|
|
24
|
+
line-height: var(--bds-font_line-height--body);
|
|
25
|
+
inline-size: 100%;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([variant='info']) .banner {
|
|
30
|
+
--banner_bg: var(--bds-color_blue--subtle);
|
|
31
|
+
--banner_text: var(--bds-color_on-blue--subtle);
|
|
32
|
+
--banner_border: var(--bds-color_blue);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([variant='success']) .banner {
|
|
36
|
+
--banner_bg: var(--bds-color_success--subtle);
|
|
37
|
+
--banner_text: var(--bds-color_on-success--subtle);
|
|
38
|
+
--banner_border: var(--bds-color_success);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([variant='warning']) .banner {
|
|
42
|
+
--banner_bg: var(--bds-color_orange--subtle);
|
|
43
|
+
--banner_text: var(--bds-color_on-orange--subtle);
|
|
44
|
+
--banner_border: var(--bds-color_warning);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([variant='error']) .banner {
|
|
48
|
+
--banner_bg: rgb(from var(--bds-color_error) r g b / 12%);
|
|
49
|
+
--banner_text: var(--bds-color_on-bg);
|
|
50
|
+
--banner_border: var(--bds-color_error);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.content {
|
|
54
|
+
flex: 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.action {
|
|
58
|
+
flex-shrink: 0;
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.action.has-content {
|
|
63
|
+
display: block;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.dismiss {
|
|
67
|
+
all: unset;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
color: currentcolor;
|
|
74
|
+
border-radius: 50%;
|
|
75
|
+
transition: var(--bds-animation_transition);
|
|
76
|
+
--bdc_color: currentcolor;
|
|
77
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.dismiss svg {
|
|
81
|
+
inline-size: 1rem;
|
|
82
|
+
block-size: 1rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.dismiss:focus-visible {
|
|
86
|
+
outline: var(--bds-outline_default);
|
|
87
|
+
outline-offset: var(--bds-outline_offset);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@media (hover: hover) and (pointer: fine) {
|
|
91
|
+
.dismiss:hover {
|
|
92
|
+
opacity: 0.7;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
static properties = {
|
|
97
|
+
variant: { type: String, reflect: true },
|
|
98
|
+
dismissible: { type: Boolean, reflect: true },
|
|
99
|
+
dismissLabel: { type: String, attribute: "dismiss-label" },
|
|
100
|
+
_actionFilled: { state: true }
|
|
101
|
+
};
|
|
102
|
+
constructor() {
|
|
103
|
+
super();
|
|
104
|
+
this.variant = "info";
|
|
105
|
+
this.dismissible = false;
|
|
106
|
+
this.dismissLabel = "Dismiss notification";
|
|
107
|
+
this._actionFilled = false;
|
|
108
|
+
}
|
|
109
|
+
_onActionSlotChange(e) {
|
|
110
|
+
const slot = e.target;
|
|
111
|
+
this._actionFilled = slot.assignedNodes({ flatten: true }).length > 0;
|
|
112
|
+
}
|
|
113
|
+
get _isUrgent() {
|
|
114
|
+
return this.variant === "error" || this.variant === "warning";
|
|
115
|
+
}
|
|
116
|
+
_handleDismiss() {
|
|
117
|
+
this.dispatchEvent(new CustomEvent("bds-dismiss", { bubbles: true, composed: true }));
|
|
118
|
+
}
|
|
119
|
+
render() {
|
|
120
|
+
return T`
|
|
121
|
+
<div
|
|
122
|
+
class="banner"
|
|
123
|
+
role=${this._isUrgent ? "alert" : "status"}
|
|
124
|
+
aria-live=${this._isUrgent ? "assertive" : "polite"}
|
|
125
|
+
aria-atomic="true"
|
|
126
|
+
>
|
|
127
|
+
<div class="content"><slot></slot></div>
|
|
128
|
+
<div class="action ${this._actionFilled ? "has-content" : ""}">
|
|
129
|
+
<slot name="action" @slotchange=${this._onActionSlotChange}></slot>
|
|
130
|
+
</div>
|
|
131
|
+
${this.dismissible ? T`
|
|
132
|
+
<button
|
|
133
|
+
type="button"
|
|
134
|
+
class="dismiss"
|
|
135
|
+
@click=${this._handleDismiss}
|
|
136
|
+
aria-label=${this.dismissLabel}
|
|
137
|
+
>
|
|
138
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
139
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M18 6L6 18M6 6l12 12" />
|
|
140
|
+
</svg>
|
|
141
|
+
</button>
|
|
142
|
+
` : A}
|
|
143
|
+
</div>
|
|
144
|
+
`;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
customElements.define("bds-notification-banner", BdsNotificationBanner);
|
|
148
|
+
|
|
149
|
+
export {
|
|
150
|
+
BdsNotificationBanner
|
|
151
|
+
};
|