@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,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/bds-skip-link.ts
|
|
8
|
+
var BdsSkipLink = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.skip-link {
|
|
15
|
+
position: absolute;
|
|
16
|
+
inset-block-start: var(--bds-space_s);
|
|
17
|
+
inset-inline-start: var(--bds-space_s);
|
|
18
|
+
z-index: 9999;
|
|
19
|
+
padding: var(--bds-space_xs) var(--bds-space_m);
|
|
20
|
+
background-color: var(--bds-color_bg);
|
|
21
|
+
color: var(--bds-color_on-bg);
|
|
22
|
+
border-radius: var(--bds-border_radius--s);
|
|
23
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
24
|
+
font-size: var(--bds-font_size--body);
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
box-shadow: var(--bds-shadow_m);
|
|
27
|
+
transform: translateY(calc(-100% - var(--bds-space_s)));
|
|
28
|
+
transition: transform var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.skip-link:focus-visible {
|
|
32
|
+
transform: translateY(0);
|
|
33
|
+
outline: var(--bds-outline_default);
|
|
34
|
+
outline-offset: var(--bds-outline_offset);
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
static properties = {
|
|
38
|
+
href: { type: String }
|
|
39
|
+
};
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
this.href = "#main";
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
return T`
|
|
46
|
+
<a class="skip-link" href=${this.href}>
|
|
47
|
+
<slot>Skip to main content</slot>
|
|
48
|
+
</a>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
customElements.define("bds-skip-link", BdsSkipLink);
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
BdsSkipLink
|
|
56
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.dismiss svg {
|
|
94
|
+
width: 1rem;
|
|
95
|
+
height: 1rem;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.dismiss:focus-visible {
|
|
99
|
+
outline: var(--bds-outline_default);
|
|
100
|
+
outline-offset: var(--bds-outline_offset);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (hover: hover) and (pointer: fine) {
|
|
104
|
+
.dismiss:hover {
|
|
105
|
+
opacity: 0.7;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`;
|
|
109
|
+
static properties = {
|
|
110
|
+
variant: { type: String, reflect: true },
|
|
111
|
+
title: { type: String },
|
|
112
|
+
dismissible: { type: Boolean, reflect: true },
|
|
113
|
+
_iconFilled: { state: true }
|
|
114
|
+
};
|
|
115
|
+
constructor() {
|
|
116
|
+
super();
|
|
117
|
+
this.variant = "info";
|
|
118
|
+
this.title = "";
|
|
119
|
+
this.dismissible = false;
|
|
120
|
+
this._iconFilled = false;
|
|
121
|
+
}
|
|
122
|
+
_onIconSlotChange(e) {
|
|
123
|
+
const slot = e.target;
|
|
124
|
+
this._iconFilled = slot.assignedNodes({ flatten: true }).length > 0;
|
|
125
|
+
}
|
|
126
|
+
get _isUrgent() {
|
|
127
|
+
return this.variant === "error" || this.variant === "warning";
|
|
128
|
+
}
|
|
129
|
+
_handleDismiss() {
|
|
130
|
+
this.dispatchEvent(new CustomEvent("bds-dismiss", { bubbles: true, composed: true }));
|
|
131
|
+
}
|
|
132
|
+
render() {
|
|
133
|
+
return T`
|
|
134
|
+
<div
|
|
135
|
+
class="alert"
|
|
136
|
+
role=${this._isUrgent ? "alert" : "status"}
|
|
137
|
+
aria-live=${this._isUrgent ? "assertive" : "polite"}
|
|
138
|
+
aria-atomic="true"
|
|
139
|
+
>
|
|
140
|
+
<span class="icon ${this._iconFilled ? "has-content" : ""}" aria-hidden="true">
|
|
141
|
+
<slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
|
|
142
|
+
</span>
|
|
143
|
+
<div class="content">
|
|
144
|
+
${this.title ? T`<strong class="title">${this.title}</strong>` : A}
|
|
145
|
+
<div><slot></slot></div>
|
|
146
|
+
</div>
|
|
147
|
+
${this.dismissible ? T`
|
|
148
|
+
<button
|
|
149
|
+
type="button"
|
|
150
|
+
class="dismiss"
|
|
151
|
+
@click=${this._handleDismiss}
|
|
152
|
+
aria-label="Dismiss alert"
|
|
153
|
+
>
|
|
154
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
155
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M18 6L6 18M6 6l12 12" />
|
|
156
|
+
</svg>
|
|
157
|
+
</button>
|
|
158
|
+
` : A}
|
|
159
|
+
</div>
|
|
160
|
+
`;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
customElements.define("bds-alert", BdsAlert);
|
|
164
|
+
|
|
165
|
+
export {
|
|
166
|
+
BdsAlert
|
|
167
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
A,
|
|
3
|
+
T,
|
|
4
|
+
i,
|
|
5
|
+
i2
|
|
6
|
+
} from "./chunk-LGEZYFUU.js";
|
|
7
|
+
|
|
8
|
+
// src/web-components/ui/bds-link.ts
|
|
9
|
+
var BdsLink = class extends i2 {
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: inline;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.link {
|
|
16
|
+
color: var(--link_color, var(--bds-color_interactive_on-bg));
|
|
17
|
+
text-decoration: underline;
|
|
18
|
+
text-underline-offset: 0.2em;
|
|
19
|
+
transition: var(--bds-animation_transition);
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.link:focus-visible {
|
|
24
|
+
outline: var(--bds-outline_default);
|
|
25
|
+
outline-offset: var(--bds-outline_offset);
|
|
26
|
+
border-radius: var(--bds-border_radius--xs);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@media (hover: hover) and (pointer: fine) {
|
|
30
|
+
.link:hover {
|
|
31
|
+
--link_color: var(--link_color-hover, var(--bds-color_blue--strong));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.link.--variant_default {
|
|
36
|
+
--link_color: var(--bds-color_interactive_on-bg);
|
|
37
|
+
--link_color-hover: var(--bds-color_blue--strong);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.link.--variant_subtle {
|
|
41
|
+
--link_color: var(--bds-color_on-bg);
|
|
42
|
+
--link_color-hover: var(--bds-color_interactive_on-bg);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.link.--variant_standalone {
|
|
46
|
+
--link_color: var(--bds-color_interactive_on-bg);
|
|
47
|
+
--link_color-hover: var(--bds-color_blue--strong);
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: var(--bds-space_xxs);
|
|
51
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
52
|
+
text-decoration: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (hover: hover) and (pointer: fine) {
|
|
56
|
+
.link.--variant_standalone:hover {
|
|
57
|
+
text-decoration: underline;
|
|
58
|
+
text-underline-offset: 0.2em;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.external-label {
|
|
63
|
+
position: absolute;
|
|
64
|
+
inline-size: 1px;
|
|
65
|
+
block-size: 1px;
|
|
66
|
+
padding: 0;
|
|
67
|
+
margin: -1px;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
clip: rect(0, 0, 0, 0);
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
border-width: 0;
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
74
|
+
static properties = {
|
|
75
|
+
href: { type: String },
|
|
76
|
+
target: { type: String },
|
|
77
|
+
variant: { type: String, reflect: true },
|
|
78
|
+
external: { type: Boolean, reflect: true },
|
|
79
|
+
externalLabel: { type: String, attribute: "external-label" }
|
|
80
|
+
};
|
|
81
|
+
constructor() {
|
|
82
|
+
super();
|
|
83
|
+
this.href = "";
|
|
84
|
+
this.target = "";
|
|
85
|
+
this.variant = "default";
|
|
86
|
+
this.external = false;
|
|
87
|
+
this.externalLabel = "(opens in new tab)";
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
const rel = this.external ? "noreferrer noopener" : A;
|
|
91
|
+
const target = this.external ? "_blank" : this.target || A;
|
|
92
|
+
return T`
|
|
93
|
+
<a
|
|
94
|
+
class="link --variant_${this.variant}"
|
|
95
|
+
href=${this.href || A}
|
|
96
|
+
target=${target}
|
|
97
|
+
rel=${rel}
|
|
98
|
+
>
|
|
99
|
+
<slot></slot>
|
|
100
|
+
${this.external ? T`<span class="external-label">${this.externalLabel}</span>` : A}
|
|
101
|
+
</a>
|
|
102
|
+
`;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
customElements.define("bds-link", BdsLink);
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
BdsLink
|
|
109
|
+
};
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/bds-drawer.ts
|
|
8
|
+
var FOCUSABLE = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
9
|
+
var BdsDrawer = class extends i2 {
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: contents;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.drawer {
|
|
16
|
+
position: fixed;
|
|
17
|
+
inset: 0;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
inline-size: 100%;
|
|
21
|
+
max-inline-size: 100%;
|
|
22
|
+
block-size: 100%;
|
|
23
|
+
max-block-size: 100%;
|
|
24
|
+
border: none;
|
|
25
|
+
background: transparent;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
transition:
|
|
28
|
+
display var(--bds-animation_transition-duration) allow-discrete,
|
|
29
|
+
overlay var(--bds-animation_transition-duration) allow-discrete;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.drawer::backdrop {
|
|
33
|
+
background-color: var(--color_backdrop, rgb(0 0 0 / 50%));
|
|
34
|
+
backdrop-filter: blur(3px);
|
|
35
|
+
transition:
|
|
36
|
+
display var(--bds-animation_transition-duration) allow-discrete,
|
|
37
|
+
overlay var(--bds-animation_transition-duration) allow-discrete,
|
|
38
|
+
background-color var(--bds-animation_transition-duration) var(--bds-animation_easing),
|
|
39
|
+
backdrop-filter var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@starting-style {
|
|
43
|
+
.drawer[open]::backdrop {
|
|
44
|
+
background-color: transparent;
|
|
45
|
+
backdrop-filter: blur(0);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.panel {
|
|
50
|
+
position: absolute;
|
|
51
|
+
inset-block: 0;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
inline-size: min(28rem, 90vw);
|
|
55
|
+
block-size: 100%;
|
|
56
|
+
background-color: var(--drawer_color, var(--bds-color_bg));
|
|
57
|
+
color: var(--drawer_on-color, var(--bds-color_on-bg));
|
|
58
|
+
box-shadow: var(--bds-shadow_xl);
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
translate: 100% 0;
|
|
61
|
+
transition: translate var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([side='right']) .panel {
|
|
65
|
+
inset-inline-end: 0;
|
|
66
|
+
translate: 100% 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:host([side='left']) .panel,
|
|
70
|
+
:host(:not([side])) .panel {
|
|
71
|
+
inset-inline-start: 0;
|
|
72
|
+
translate: -100% 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.drawer[open] .panel {
|
|
76
|
+
translate: 0 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([side='right']) .drawer[open] .panel,
|
|
80
|
+
:host(:not([side])) .drawer[open] .panel {
|
|
81
|
+
animation: bds-drawer-slide-right var(--bds-animation_transition-duration) var(--bds-animation_easing) both;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host([side='left']) .drawer[open] .panel {
|
|
85
|
+
animation: bds-drawer-slide-left var(--bds-animation_transition-duration) var(--bds-animation_easing) both;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@keyframes bds-drawer-slide-right {
|
|
89
|
+
from { translate: 100% 0; }
|
|
90
|
+
to { translate: 0 0; }
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@keyframes bds-drawer-slide-left {
|
|
94
|
+
from { translate: -100% 0; }
|
|
95
|
+
to { translate: 0 0; }
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.header {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: space-between;
|
|
102
|
+
padding: var(--bds-space_m) var(--bds-space_l);
|
|
103
|
+
border-block-end: 1px solid currentcolor;
|
|
104
|
+
flex-shrink: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.title {
|
|
108
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
109
|
+
font-size: var(--bds-font_size--body);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.close-button {
|
|
113
|
+
all: unset;
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
inline-size: 2rem;
|
|
118
|
+
block-size: 2rem;
|
|
119
|
+
border-radius: 50%;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
transition: var(--bds-animation_transition);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.close-button svg {
|
|
125
|
+
inline-size: 1.25rem;
|
|
126
|
+
block-size: 1.25rem;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.close-button:focus-visible {
|
|
130
|
+
outline: var(--bds-outline_default);
|
|
131
|
+
outline-offset: var(--bds-outline_offset);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (hover: hover) and (pointer: fine) {
|
|
135
|
+
.close-button:hover {
|
|
136
|
+
background-color: var(--bds-color_bg--subtle);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.body {
|
|
141
|
+
flex: 1;
|
|
142
|
+
overflow-block: auto;
|
|
143
|
+
padding: var(--bds-space_l);
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@media (prefers-reduced-motion: reduce) {
|
|
149
|
+
.drawer,
|
|
150
|
+
.drawer::backdrop,
|
|
151
|
+
.panel {
|
|
152
|
+
transition: none;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:host([side='right']) .drawer[open] .panel,
|
|
156
|
+
:host(:not([side])) .drawer[open] .panel,
|
|
157
|
+
:host([side='left']) .drawer[open] .panel {
|
|
158
|
+
animation: none;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
`;
|
|
162
|
+
static properties = {
|
|
163
|
+
open: { type: Boolean, reflect: true },
|
|
164
|
+
side: { type: String, reflect: true }
|
|
165
|
+
};
|
|
166
|
+
_triggerEl = null;
|
|
167
|
+
constructor() {
|
|
168
|
+
super();
|
|
169
|
+
this.open = false;
|
|
170
|
+
this.side = "right";
|
|
171
|
+
}
|
|
172
|
+
connectedCallback() {
|
|
173
|
+
super.connectedCallback();
|
|
174
|
+
this.addEventListener("command", this._onCommand);
|
|
175
|
+
}
|
|
176
|
+
disconnectedCallback() {
|
|
177
|
+
super.disconnectedCallback();
|
|
178
|
+
this.removeEventListener("command", this._onCommand);
|
|
179
|
+
}
|
|
180
|
+
updated(changed) {
|
|
181
|
+
super.updated(changed);
|
|
182
|
+
if (changed.has("open")) {
|
|
183
|
+
const dialog = this._dialog;
|
|
184
|
+
if (!dialog) return;
|
|
185
|
+
if (this.open && !dialog.open) {
|
|
186
|
+
this._triggerEl = document.activeElement;
|
|
187
|
+
dialog.showModal();
|
|
188
|
+
document.body.style.overflow = "hidden";
|
|
189
|
+
} else if (!this.open && dialog.open) {
|
|
190
|
+
dialog.close();
|
|
191
|
+
document.body.style.overflow = "";
|
|
192
|
+
this._triggerEl?.focus();
|
|
193
|
+
this._triggerEl = null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
get _dialog() {
|
|
198
|
+
return this.shadowRoot?.querySelector("dialog") ?? null;
|
|
199
|
+
}
|
|
200
|
+
_onCommand = (e) => {
|
|
201
|
+
const command = e.command;
|
|
202
|
+
if (command === "show-modal") this._openDrawer();
|
|
203
|
+
else if (command === "close") this._closeDrawer();
|
|
204
|
+
};
|
|
205
|
+
_openDrawer() {
|
|
206
|
+
if (this.open) return;
|
|
207
|
+
this._triggerEl = document.activeElement;
|
|
208
|
+
this.open = true;
|
|
209
|
+
this.dispatchEvent(new CustomEvent("bds-open", { bubbles: true, composed: true }));
|
|
210
|
+
}
|
|
211
|
+
_closeDrawer() {
|
|
212
|
+
if (!this.open) return;
|
|
213
|
+
this.open = false;
|
|
214
|
+
this.dispatchEvent(new CustomEvent("bds-close", { bubbles: true, composed: true }));
|
|
215
|
+
}
|
|
216
|
+
_handleBackdropClick(e) {
|
|
217
|
+
if (e.target === this._dialog) this._closeDrawer();
|
|
218
|
+
}
|
|
219
|
+
_handleCancel(e) {
|
|
220
|
+
e.preventDefault();
|
|
221
|
+
this._closeDrawer();
|
|
222
|
+
}
|
|
223
|
+
_handleKeydown(e) {
|
|
224
|
+
if (e.key !== "Tab") return;
|
|
225
|
+
const dialog = this._dialog;
|
|
226
|
+
if (!dialog) return;
|
|
227
|
+
const focusable = Array.from(dialog.querySelectorAll(FOCUSABLE));
|
|
228
|
+
if (focusable.length === 0) return;
|
|
229
|
+
const first = focusable[0];
|
|
230
|
+
const last = focusable[focusable.length - 1];
|
|
231
|
+
if (e.shiftKey) {
|
|
232
|
+
if (document.activeElement === first) {
|
|
233
|
+
e.preventDefault();
|
|
234
|
+
last.focus();
|
|
235
|
+
}
|
|
236
|
+
} else {
|
|
237
|
+
if (document.activeElement === last) {
|
|
238
|
+
e.preventDefault();
|
|
239
|
+
first.focus();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
render() {
|
|
244
|
+
return T`
|
|
245
|
+
<dialog
|
|
246
|
+
class="drawer"
|
|
247
|
+
aria-modal="true"
|
|
248
|
+
@click=${this._handleBackdropClick}
|
|
249
|
+
@cancel=${this._handleCancel}
|
|
250
|
+
@keydown=${this._handleKeydown}
|
|
251
|
+
>
|
|
252
|
+
<div class="panel">
|
|
253
|
+
<div class="header">
|
|
254
|
+
<span class="title"><slot name="title"></slot></span>
|
|
255
|
+
<button
|
|
256
|
+
type="button"
|
|
257
|
+
class="close-button"
|
|
258
|
+
aria-label="Close drawer"
|
|
259
|
+
@click=${this._closeDrawer}
|
|
260
|
+
>
|
|
261
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
262
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M18 6L6 18M6 6l12 12" />
|
|
263
|
+
</svg>
|
|
264
|
+
</button>
|
|
265
|
+
</div>
|
|
266
|
+
<div class="body">
|
|
267
|
+
<slot></slot>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
</dialog>
|
|
271
|
+
`;
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
customElements.define("bds-drawer", BdsDrawer);
|
|
275
|
+
|
|
276
|
+
export {
|
|
277
|
+
BdsDrawer
|
|
278
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// src/web-components/globals.ts
|
|
2
|
+
var bdcCss = `
|
|
3
|
+
@property --bdc_color {
|
|
4
|
+
syntax: '<color>';
|
|
5
|
+
inherits: false;
|
|
6
|
+
initial-value: currentcolor;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@property --bdc-outline_width {
|
|
10
|
+
syntax: '<length>';
|
|
11
|
+
inherits: false;
|
|
12
|
+
initial-value: 1px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@property --bdc-outline_offset {
|
|
16
|
+
syntax: '<length>';
|
|
17
|
+
inherits: false;
|
|
18
|
+
initial-value: -1px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@property --bdc-outline_radius {
|
|
22
|
+
syntax: '<length-percentage>';
|
|
23
|
+
inherits: false;
|
|
24
|
+
initial-value: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@property --bdc-outline_shadow {
|
|
28
|
+
syntax: '*';
|
|
29
|
+
inherits: false;
|
|
30
|
+
initial-value: 0 0 0 0 transparent;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@layer component {
|
|
34
|
+
:root {
|
|
35
|
+
--bdc-outline_border: none;
|
|
36
|
+
|
|
37
|
+
--bdc_color: currentcolor;
|
|
38
|
+
--bdc_color--focus: var(--bds-color_interactive);
|
|
39
|
+
--bdc_color--error: var(--bds-color_error);
|
|
40
|
+
|
|
41
|
+
--bdc-outline_width: 1px;
|
|
42
|
+
--bdc-outline_offset: -1px; /* available for consumer use; bdc borders now use inset box-shadow */
|
|
43
|
+
--bdc-outline_radius: var(--bds-border_radius--xs);
|
|
44
|
+
--bdc-outline_shadow: 0 0 0 0 transparent;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
if (!("__bdcInjected" in document)) {
|
|
49
|
+
Object.defineProperty(document, "__bdcInjected", { value: true });
|
|
50
|
+
const sheet = new CSSStyleSheet();
|
|
51
|
+
sheet.replaceSync(bdcCss);
|
|
52
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
|
|
53
|
+
}
|