@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,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,185 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/bds-dialog.ts
|
|
8
|
+
var FOCUSABLE = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
9
|
+
var BdsDialog = class extends i2 {
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: contents;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dialog {
|
|
16
|
+
font-size: var(--bds-font_size--body--s);
|
|
17
|
+
border: var(--dialog_border, none);
|
|
18
|
+
--bdc_color: currentcolor;
|
|
19
|
+
--bdc-outline_radius: var(--bds-border_radius--m);
|
|
20
|
+
|
|
21
|
+
border-radius: var(--dialog_radius, var(--bdc-outline_radius));
|
|
22
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--dialog_shadow, var(--bdc-outline_shadow));
|
|
23
|
+
background-color: var(--dialog_color, var(--bds-color_grey--subtle));
|
|
24
|
+
color: var(--dialog_on-color, var(--bds-color_on-grey--subtle));
|
|
25
|
+
padding: var(--bds-space_l);
|
|
26
|
+
max-inline-size: 90svw;
|
|
27
|
+
max-block-size: 90svh;
|
|
28
|
+
overflow: visible;
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.dialog-content {
|
|
33
|
+
display: grid;
|
|
34
|
+
gap: var(--bds-grid_gap);
|
|
35
|
+
overflow-block: auto;
|
|
36
|
+
min-block-size: 0;
|
|
37
|
+
flex: 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.close-button {
|
|
41
|
+
all: unset;
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset-block-start: -1em;
|
|
44
|
+
inset-inline-end: -1em;
|
|
45
|
+
inline-size: 2em;
|
|
46
|
+
block-size: 2em;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
border-radius: 50%;
|
|
51
|
+
background-color: var(--bds-color_bg);
|
|
52
|
+
color: currentcolor;
|
|
53
|
+
border: var(--dialog_close-border, none);
|
|
54
|
+
--bdc_color: currentcolor;
|
|
55
|
+
|
|
56
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.close-button svg {
|
|
61
|
+
inline-size: 1.25em;
|
|
62
|
+
block-size: 1.25em;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.dialog::backdrop {
|
|
66
|
+
background-color: var(--color_backdrop, rgb(0 0 0 / 50%));
|
|
67
|
+
backdrop-filter: blur(3px);
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
static properties = {
|
|
71
|
+
open: { type: Boolean, reflect: true }
|
|
72
|
+
};
|
|
73
|
+
_triggerEl = null;
|
|
74
|
+
constructor() {
|
|
75
|
+
super();
|
|
76
|
+
this.open = false;
|
|
77
|
+
}
|
|
78
|
+
connectedCallback() {
|
|
79
|
+
super.connectedCallback();
|
|
80
|
+
this.addEventListener("command", this._onCommand);
|
|
81
|
+
}
|
|
82
|
+
disconnectedCallback() {
|
|
83
|
+
super.disconnectedCallback();
|
|
84
|
+
this.removeEventListener("command", this._onCommand);
|
|
85
|
+
}
|
|
86
|
+
updated(changed) {
|
|
87
|
+
super.updated(changed);
|
|
88
|
+
if (changed.has("open")) {
|
|
89
|
+
const dialog = this._dialog;
|
|
90
|
+
if (!dialog) return;
|
|
91
|
+
if (this.open && !dialog.open) {
|
|
92
|
+
this._triggerEl = document.activeElement;
|
|
93
|
+
dialog.showModal();
|
|
94
|
+
document.body.style.overflow = "hidden";
|
|
95
|
+
} else if (!this.open && dialog.open) {
|
|
96
|
+
dialog.close();
|
|
97
|
+
document.body.style.overflow = "";
|
|
98
|
+
this._triggerEl?.focus();
|
|
99
|
+
this._triggerEl = null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
get _dialog() {
|
|
104
|
+
return this.shadowRoot?.querySelector("dialog") ?? null;
|
|
105
|
+
}
|
|
106
|
+
_onCommand = (e) => {
|
|
107
|
+
const command = e.command;
|
|
108
|
+
if (command === "show-modal") this._openDialog();
|
|
109
|
+
else if (command === "close") this._closeDialog();
|
|
110
|
+
};
|
|
111
|
+
_openDialog() {
|
|
112
|
+
if (this.open) return;
|
|
113
|
+
this._triggerEl = document.activeElement;
|
|
114
|
+
this.open = true;
|
|
115
|
+
this.dispatchEvent(new CustomEvent("bds-open", { bubbles: true, composed: true }));
|
|
116
|
+
}
|
|
117
|
+
_closeDialog() {
|
|
118
|
+
if (!this.open) return;
|
|
119
|
+
this.open = false;
|
|
120
|
+
this.dispatchEvent(new CustomEvent("bds-close", { bubbles: true, composed: true }));
|
|
121
|
+
}
|
|
122
|
+
_handleBackdropClick(e) {
|
|
123
|
+
if (e.target === this._dialog) this._closeDialog();
|
|
124
|
+
}
|
|
125
|
+
_handleCancel(e) {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
this._closeDialog();
|
|
128
|
+
}
|
|
129
|
+
_handleKeydown(e) {
|
|
130
|
+
if (e.key !== "Tab") return;
|
|
131
|
+
const dialog = this._dialog;
|
|
132
|
+
if (!dialog) return;
|
|
133
|
+
const focusable = Array.from(dialog.querySelectorAll(FOCUSABLE));
|
|
134
|
+
const slot = dialog.querySelector("slot");
|
|
135
|
+
const slottedFocusable = slot ? slot.assignedElements({ flatten: true }).flatMap((el) => [
|
|
136
|
+
...el.matches(FOCUSABLE) ? [el] : [],
|
|
137
|
+
...Array.from(el.querySelectorAll(FOCUSABLE))
|
|
138
|
+
]) : [];
|
|
139
|
+
const all = [...focusable, ...slottedFocusable];
|
|
140
|
+
if (all.length === 0) return;
|
|
141
|
+
const first = all[0];
|
|
142
|
+
const last = all[all.length - 1];
|
|
143
|
+
if (e.shiftKey) {
|
|
144
|
+
if (document.activeElement === first) {
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
last.focus();
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
if (document.activeElement === last) {
|
|
150
|
+
e.preventDefault();
|
|
151
|
+
first.focus();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
render() {
|
|
156
|
+
return T`
|
|
157
|
+
<dialog
|
|
158
|
+
class="dialog"
|
|
159
|
+
aria-modal="true"
|
|
160
|
+
@click=${this._handleBackdropClick}
|
|
161
|
+
@cancel=${this._handleCancel}
|
|
162
|
+
@keydown=${this._handleKeydown}
|
|
163
|
+
>
|
|
164
|
+
<button
|
|
165
|
+
type="button"
|
|
166
|
+
class="close-button"
|
|
167
|
+
aria-label="Close dialog"
|
|
168
|
+
@click=${this._closeDialog}
|
|
169
|
+
>
|
|
170
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
171
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M18 6L6 18M6 6l12 12" />
|
|
172
|
+
</svg>
|
|
173
|
+
</button>
|
|
174
|
+
<div class="dialog-content">
|
|
175
|
+
<slot></slot>
|
|
176
|
+
</div>
|
|
177
|
+
</dialog>
|
|
178
|
+
`;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
customElements.define("bds-dialog", BdsDialog);
|
|
182
|
+
|
|
183
|
+
export {
|
|
184
|
+
BdsDialog
|
|
185
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/form/bds-file-input.ts
|
|
8
|
+
var BdsFileInput = 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
|
+
.zone {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
gap: var(--bds-space_s);
|
|
26
|
+
padding: var(--bds-space_xl);
|
|
27
|
+
border-radius: var(--bds-border_radius--m);
|
|
28
|
+
border: 2px dashed var(--file-input_border-color, var(--bds-color_bg--subtle));
|
|
29
|
+
background-color: var(--file-input_color_bg, var(--bds-color_bg));
|
|
30
|
+
color: var(--bds-color_on-bg);
|
|
31
|
+
font-family: var(--bds-font_family--body);
|
|
32
|
+
font-size: var(--bds-font_size--body);
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
text-align: center;
|
|
35
|
+
transition: var(--bds-animation_transition);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.zone.--dragging {
|
|
39
|
+
border-color: var(--bds-color_interactive);
|
|
40
|
+
background-color: var(--bds-color_bg--subtle);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.zone-input {
|
|
44
|
+
position: absolute;
|
|
45
|
+
opacity: 0;
|
|
46
|
+
inline-size: 0;
|
|
47
|
+
block-size: 0;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.zone-label {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: var(--bds-space_xs);
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.icon {
|
|
60
|
+
inline-size: 2.5rem;
|
|
61
|
+
block-size: 2.5rem;
|
|
62
|
+
color: var(--bds-color_on-bg--subtle);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.icon svg {
|
|
66
|
+
inline-size: 100%;
|
|
67
|
+
block-size: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.hint {
|
|
71
|
+
font-size: var(--bds-font_size--body--s);
|
|
72
|
+
color: var(--bds-color_on-bg--subtle);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@media (hover: hover) and (pointer: fine) {
|
|
76
|
+
.zone:hover {
|
|
77
|
+
border-color: var(--bds-color_interactive);
|
|
78
|
+
background-color: var(--bds-color_bg--subtle);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
static properties = {
|
|
83
|
+
name: { type: String, reflect: true },
|
|
84
|
+
accept: { type: String },
|
|
85
|
+
multiple: { type: Boolean, reflect: true },
|
|
86
|
+
disabled: { type: Boolean, reflect: true }
|
|
87
|
+
};
|
|
88
|
+
_internals;
|
|
89
|
+
_isDragging = false;
|
|
90
|
+
_uid = Math.random().toString(36).slice(2, 8);
|
|
91
|
+
constructor() {
|
|
92
|
+
super();
|
|
93
|
+
this._internals = this.attachInternals();
|
|
94
|
+
this.name = "";
|
|
95
|
+
this.accept = "";
|
|
96
|
+
this.multiple = false;
|
|
97
|
+
this.disabled = false;
|
|
98
|
+
}
|
|
99
|
+
formResetCallback() {
|
|
100
|
+
this._internals.setFormValue?.(null);
|
|
101
|
+
const input = this.shadowRoot?.querySelector("input");
|
|
102
|
+
if (input) input.value = "";
|
|
103
|
+
}
|
|
104
|
+
_handleFiles(files) {
|
|
105
|
+
if (!files || files.length === 0) return;
|
|
106
|
+
const formData = new FormData();
|
|
107
|
+
Array.from(files).forEach((file) => formData.append(this.name, file));
|
|
108
|
+
this._internals.setFormValue?.(formData);
|
|
109
|
+
this.dispatchEvent(new CustomEvent("bds-change", {
|
|
110
|
+
bubbles: true,
|
|
111
|
+
composed: true,
|
|
112
|
+
detail: files
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
_handleInputChange(e) {
|
|
116
|
+
this._handleFiles(e.target.files);
|
|
117
|
+
}
|
|
118
|
+
_handleClick() {
|
|
119
|
+
this.shadowRoot?.querySelector("input")?.click();
|
|
120
|
+
}
|
|
121
|
+
_handleDragover(e) {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
if (!this._isDragging) {
|
|
124
|
+
this._isDragging = true;
|
|
125
|
+
this.requestUpdate();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
_handleDragleave() {
|
|
129
|
+
this._isDragging = false;
|
|
130
|
+
this.requestUpdate();
|
|
131
|
+
}
|
|
132
|
+
_handleDrop(e) {
|
|
133
|
+
e.preventDefault();
|
|
134
|
+
this._isDragging = false;
|
|
135
|
+
this.requestUpdate();
|
|
136
|
+
this._handleFiles(e.dataTransfer?.files ?? null);
|
|
137
|
+
}
|
|
138
|
+
render() {
|
|
139
|
+
const id = `bds-file-${this._uid}`;
|
|
140
|
+
return T`
|
|
141
|
+
<input
|
|
142
|
+
id=${id}
|
|
143
|
+
type="file"
|
|
144
|
+
class="zone-input"
|
|
145
|
+
name=${this.name}
|
|
146
|
+
accept=${this.accept}
|
|
147
|
+
?multiple=${this.multiple}
|
|
148
|
+
?disabled=${this.disabled}
|
|
149
|
+
@change=${this._handleInputChange}
|
|
150
|
+
/>
|
|
151
|
+
<div
|
|
152
|
+
class="zone ${this._isDragging ? "--dragging" : ""}"
|
|
153
|
+
role="button"
|
|
154
|
+
tabindex=${this.disabled ? "-1" : "0"}
|
|
155
|
+
aria-label="Upload file"
|
|
156
|
+
@click=${this._handleClick}
|
|
157
|
+
@keydown=${(e) => (e.key === "Enter" || e.key === " ") && this._handleClick()}
|
|
158
|
+
@dragover=${this._handleDragover}
|
|
159
|
+
@dragleave=${this._handleDragleave}
|
|
160
|
+
@drop=${this._handleDrop}
|
|
161
|
+
>
|
|
162
|
+
<span class="icon" aria-hidden="true">
|
|
163
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
164
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 16.5V9.75m0 0-3 3m3-3 3 3M6.75 19.5a4.5 4.5 0 01-1.41-8.775 5.25 5.25 0 0110.338-2.329 3 3 0 013.83 3.849A3.75 3.75 0 0118 19.5H6.75z" />
|
|
165
|
+
</svg>
|
|
166
|
+
</span>
|
|
167
|
+
<span class="zone-label">
|
|
168
|
+
<slot>Drag & drop or click to browse</slot>
|
|
169
|
+
</span>
|
|
170
|
+
<span class="hint">${this.accept ? `Accepted: ${this.accept}` : "Any file type"}</span>
|
|
171
|
+
</div>
|
|
172
|
+
`;
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
customElements.define("bds-file-input", BdsFileInput);
|
|
176
|
+
|
|
177
|
+
export {
|
|
178
|
+
BdsFileInput
|
|
179
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/ui/bds-breadcrumb.ts
|
|
8
|
+
var BdsBreadcrumb = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.breadcrumb {
|
|
15
|
+
font-size: var(--bds-font_size--body--s);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.list {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-wrap: wrap;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--bds-space_xxs);
|
|
23
|
+
list-style: none;
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.item {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: var(--bds-space_xxs);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.link {
|
|
35
|
+
color: var(--bds-color_interactive_on-bg);
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
transition: var(--bds-animation_transition);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.link: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
|
+
.link:hover {
|
|
48
|
+
text-decoration: underline;
|
|
49
|
+
text-underline-offset: 0.2em;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.separator {
|
|
54
|
+
color: var(--bds-color_on-bg--subtle);
|
|
55
|
+
user-select: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.current {
|
|
59
|
+
color: var(--bds-color_on-bg--subtle);
|
|
60
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
static properties = {
|
|
64
|
+
items: { type: Array }
|
|
65
|
+
};
|
|
66
|
+
constructor() {
|
|
67
|
+
super();
|
|
68
|
+
this.items = [];
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
return T`
|
|
72
|
+
<nav class="breadcrumb" aria-label="Breadcrumb">
|
|
73
|
+
<ol class="list">
|
|
74
|
+
${this.items.map((item, index) => {
|
|
75
|
+
const isLast = index === this.items.length - 1;
|
|
76
|
+
return T`
|
|
77
|
+
<li class="item">
|
|
78
|
+
${isLast ? T`<span class="current" aria-current="page">${item.label}</span>` : T`
|
|
79
|
+
<a class="link" href=${item.href ?? "#"}>${item.label}</a>
|
|
80
|
+
<span class="separator" aria-hidden="true">›</span>
|
|
81
|
+
`}
|
|
82
|
+
</li>
|
|
83
|
+
`;
|
|
84
|
+
})}
|
|
85
|
+
</ol>
|
|
86
|
+
</nav>
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
customElements.define("bds-breadcrumb", BdsBreadcrumb);
|
|
91
|
+
|
|
92
|
+
export {
|
|
93
|
+
BdsBreadcrumb
|
|
94
|
+
};
|