@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,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/form/bds-textarea.ts
|
|
8
|
+
var BdsTextarea = 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
|
+
.textarea {
|
|
21
|
+
inline-size: 100%;
|
|
22
|
+
font-family: var(--bds-font_family--body);
|
|
23
|
+
font-size: var(--bds-font_size--body);
|
|
24
|
+
line-height: var(--bds-font_line-height--body);
|
|
25
|
+
padding: var(--bds-space_s);
|
|
26
|
+
border: none;
|
|
27
|
+
--bdc_color: currentcolor;
|
|
28
|
+
--bdc-outline_radius: var(--bds-border_radius--xs);
|
|
29
|
+
|
|
30
|
+
border-radius: var(--textarea_radius, var(--bdc-outline_radius));
|
|
31
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--textarea_shadow, var(--bdc-outline_shadow));
|
|
32
|
+
background-color: var(--textarea_color_bg, var(--bds-color_bg));
|
|
33
|
+
color: var(--textarea_color, var(--bds-color_on-bg));
|
|
34
|
+
resize: vertical;
|
|
35
|
+
min-block-size: calc(var(--bds-space_m) * 5);
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
transition: --bdc_color var(--bds-animation_transition-duration) var(--bds-animation_easing),
|
|
38
|
+
background-color var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.textarea:focus {
|
|
42
|
+
--bdc_color: var(--bdc_color--focus);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.textarea:focus-visible {
|
|
46
|
+
outline: var(--bds-outline_default);
|
|
47
|
+
outline-offset: var(--bds-outline_offset);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.textarea:disabled {
|
|
51
|
+
opacity: 0.5;
|
|
52
|
+
cursor: not-allowed;
|
|
53
|
+
resize: none;
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
static properties = {
|
|
57
|
+
name: { type: String, reflect: true },
|
|
58
|
+
value: { type: String },
|
|
59
|
+
placeholder: { type: String },
|
|
60
|
+
rows: { type: Number },
|
|
61
|
+
required: { type: Boolean, reflect: true },
|
|
62
|
+
disabled: { type: Boolean, reflect: true }
|
|
63
|
+
};
|
|
64
|
+
_internals;
|
|
65
|
+
constructor() {
|
|
66
|
+
super();
|
|
67
|
+
this._internals = this.attachInternals();
|
|
68
|
+
this.name = "";
|
|
69
|
+
this.value = "";
|
|
70
|
+
this.placeholder = "";
|
|
71
|
+
this.rows = 4;
|
|
72
|
+
this.required = false;
|
|
73
|
+
this.disabled = false;
|
|
74
|
+
}
|
|
75
|
+
updated(changed) {
|
|
76
|
+
super.updated(changed);
|
|
77
|
+
if (changed.has("value")) {
|
|
78
|
+
this._internals.setFormValue?.(this.value || null);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
formResetCallback() {
|
|
82
|
+
this.value = "";
|
|
83
|
+
this._internals.setFormValue?.(null);
|
|
84
|
+
}
|
|
85
|
+
_handleInput(e) {
|
|
86
|
+
this.value = e.target.value;
|
|
87
|
+
}
|
|
88
|
+
render() {
|
|
89
|
+
return T`
|
|
90
|
+
<textarea
|
|
91
|
+
class="textarea"
|
|
92
|
+
name=${this.name}
|
|
93
|
+
.value=${this.value}
|
|
94
|
+
placeholder=${this.placeholder}
|
|
95
|
+
rows=${this.rows}
|
|
96
|
+
?required=${this.required}
|
|
97
|
+
?disabled=${this.disabled}
|
|
98
|
+
@input=${this._handleInput}
|
|
99
|
+
></textarea>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
customElements.define("bds-textarea", BdsTextarea);
|
|
104
|
+
|
|
105
|
+
export {
|
|
106
|
+
BdsTextarea
|
|
107
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/bds-popover.ts
|
|
8
|
+
var BdsPopover = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
position: relative;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* The wrapper IS the CSS anchor — anchor-name resolves via the custom
|
|
16
|
+
property injected on :host in connectedCallback(), so each instance
|
|
17
|
+
gets its own unique name without colliding with siblings. */
|
|
18
|
+
.wrapper {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
anchor-name: var(--bds-popover-anchor);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.panel {
|
|
24
|
+
display: none;
|
|
25
|
+
position: absolute;
|
|
26
|
+
position-anchor: var(--bds-popover-anchor);
|
|
27
|
+
margin: 0;
|
|
28
|
+
overflow-y: auto;
|
|
29
|
+
z-index: var(--popover_z-index, 100);
|
|
30
|
+
min-width: 12rem;
|
|
31
|
+
padding: var(--bds-space_m);
|
|
32
|
+
border-radius: var(--bds-border_radius--s);
|
|
33
|
+
background-color: var(--popover_color, var(--bds-color_bg));
|
|
34
|
+
box-shadow: var(--popover_shadow, var(--bds-shadow_m));
|
|
35
|
+
color: var(--popover_on-color, var(--bds-color_on-bg));
|
|
36
|
+
font-size: var(--bds-font_size--body);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.panel.open {
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Primary placements */
|
|
44
|
+
|
|
45
|
+
.panel[data-placement='bottom'] {
|
|
46
|
+
top: anchor(bottom);
|
|
47
|
+
left: anchor(left);
|
|
48
|
+
margin-top: var(--bds-space_xs, 8px);
|
|
49
|
+
position-try-fallbacks: --bds-popover-top, --bds-popover-right, --bds-popover-left;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.panel[data-placement='top'] {
|
|
53
|
+
bottom: anchor(top);
|
|
54
|
+
left: anchor(left);
|
|
55
|
+
margin-bottom: var(--bds-space_xs, 8px);
|
|
56
|
+
position-try-fallbacks: --bds-popover-bottom, --bds-popover-right, --bds-popover-left;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.panel[data-placement='right'] {
|
|
60
|
+
top: anchor(top);
|
|
61
|
+
left: anchor(right);
|
|
62
|
+
margin-left: var(--bds-space_xs, 8px);
|
|
63
|
+
position-try-fallbacks: --bds-popover-left, --bds-popover-bottom, --bds-popover-top;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.panel[data-placement='left'] {
|
|
67
|
+
top: anchor(top);
|
|
68
|
+
right: anchor(left);
|
|
69
|
+
margin-right: var(--bds-space_xs, 8px);
|
|
70
|
+
position-try-fallbacks: --bds-popover-right, --bds-popover-bottom, --bds-popover-top;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Fallback placements */
|
|
74
|
+
|
|
75
|
+
@position-try --bds-popover-bottom {
|
|
76
|
+
top: anchor(bottom);
|
|
77
|
+
right: unset;
|
|
78
|
+
bottom: unset;
|
|
79
|
+
left: anchor(left);
|
|
80
|
+
margin: 0;
|
|
81
|
+
margin-top: var(--bds-space_xs, 8px);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@position-try --bds-popover-top {
|
|
85
|
+
top: unset;
|
|
86
|
+
right: unset;
|
|
87
|
+
bottom: anchor(top);
|
|
88
|
+
left: anchor(left);
|
|
89
|
+
margin: 0;
|
|
90
|
+
margin-bottom: var(--bds-space_xs, 8px);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@position-try --bds-popover-right {
|
|
94
|
+
top: anchor(top);
|
|
95
|
+
right: unset;
|
|
96
|
+
bottom: unset;
|
|
97
|
+
left: anchor(right);
|
|
98
|
+
margin: 0;
|
|
99
|
+
margin-left: var(--bds-space_xs, 8px);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@position-try --bds-popover-left {
|
|
103
|
+
top: anchor(top);
|
|
104
|
+
right: anchor(left);
|
|
105
|
+
bottom: unset;
|
|
106
|
+
left: unset;
|
|
107
|
+
margin: 0;
|
|
108
|
+
margin-right: var(--bds-space_xs, 8px);
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
static properties = {
|
|
112
|
+
placement: { type: String, reflect: true },
|
|
113
|
+
open: { type: Boolean, reflect: true }
|
|
114
|
+
};
|
|
115
|
+
_anchorName;
|
|
116
|
+
constructor() {
|
|
117
|
+
super();
|
|
118
|
+
this.placement = "bottom";
|
|
119
|
+
this.open = false;
|
|
120
|
+
const uid = Math.random().toString(36).slice(2, 8);
|
|
121
|
+
this._anchorName = `--bds-popover-${uid}`;
|
|
122
|
+
}
|
|
123
|
+
connectedCallback() {
|
|
124
|
+
super.connectedCallback();
|
|
125
|
+
this.style.setProperty("--bds-popover-anchor", this._anchorName);
|
|
126
|
+
document.addEventListener("keydown", this._onKeydown);
|
|
127
|
+
document.addEventListener("mousedown", this._onOutsideClick);
|
|
128
|
+
this.addEventListener("command", this._onCommand);
|
|
129
|
+
}
|
|
130
|
+
disconnectedCallback() {
|
|
131
|
+
super.disconnectedCallback();
|
|
132
|
+
document.removeEventListener("keydown", this._onKeydown);
|
|
133
|
+
document.removeEventListener("mousedown", this._onOutsideClick);
|
|
134
|
+
this.removeEventListener("command", this._onCommand);
|
|
135
|
+
}
|
|
136
|
+
_onKeydown = (e) => {
|
|
137
|
+
if (this.open && e.key === "Escape") this._close();
|
|
138
|
+
};
|
|
139
|
+
_onCommand = (e) => {
|
|
140
|
+
const command = e.command;
|
|
141
|
+
if (command === "--toggle") this._toggle();
|
|
142
|
+
else if (command === "--open") this._open();
|
|
143
|
+
else if (command === "--close") this._close();
|
|
144
|
+
};
|
|
145
|
+
_onOutsideClick = (e) => {
|
|
146
|
+
if (this.open && !this.contains(e.target)) this._close();
|
|
147
|
+
};
|
|
148
|
+
_toggle() {
|
|
149
|
+
if (this.open) {
|
|
150
|
+
this._close();
|
|
151
|
+
} else {
|
|
152
|
+
this._open();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
_open() {
|
|
156
|
+
if (this.open) return;
|
|
157
|
+
this.open = true;
|
|
158
|
+
this.dispatchEvent(new CustomEvent("bds-open", { bubbles: true, composed: true }));
|
|
159
|
+
}
|
|
160
|
+
_close() {
|
|
161
|
+
if (!this.open) return;
|
|
162
|
+
this.open = false;
|
|
163
|
+
this.dispatchEvent(new CustomEvent("bds-close", { bubbles: true, composed: true }));
|
|
164
|
+
}
|
|
165
|
+
render() {
|
|
166
|
+
return T`
|
|
167
|
+
<span class="wrapper">
|
|
168
|
+
<slot name="trigger" @click=${this._toggle}></slot>
|
|
169
|
+
</span>
|
|
170
|
+
<div
|
|
171
|
+
class="panel ${this.open ? "open" : ""}"
|
|
172
|
+
data-placement=${this.placement}
|
|
173
|
+
role="region"
|
|
174
|
+
aria-label="Popover"
|
|
175
|
+
>
|
|
176
|
+
<slot></slot>
|
|
177
|
+
</div>
|
|
178
|
+
`;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
customElements.define("bds-popover", BdsPopover);
|
|
182
|
+
|
|
183
|
+
export {
|
|
184
|
+
BdsPopover
|
|
185
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/bds-tooltip.ts
|
|
8
|
+
var BdsTooltip = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.tooltip {
|
|
17
|
+
position: absolute;
|
|
18
|
+
z-index: var(--bds-z-index_popover, 200);
|
|
19
|
+
padding: var(--bds-space_xxs) var(--bds-space_xs);
|
|
20
|
+
border-radius: var(--bds-border_radius--xs);
|
|
21
|
+
background-color: var(--tooltip_bg, var(--bds-color_on-bg));
|
|
22
|
+
color: var(--tooltip_text, var(--bds-color_bg));
|
|
23
|
+
font-size: var(--bds-font_size--body--s);
|
|
24
|
+
line-height: var(--bds-font_line-height--body);
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
|
|
28
|
+
/* Hidden by default */
|
|
29
|
+
visibility: hidden;
|
|
30
|
+
opacity: 0;
|
|
31
|
+
transition: opacity var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Show on hover and keyboard focus */
|
|
35
|
+
:host(:hover) .tooltip,
|
|
36
|
+
:host(:focus-within) .tooltip {
|
|
37
|
+
visibility: visible;
|
|
38
|
+
opacity: 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Placement: top (default) */
|
|
42
|
+
.tooltip.--placement_top {
|
|
43
|
+
inset-block-end: calc(100% + var(--bds-space_xs));
|
|
44
|
+
inset-inline-start: 50%;
|
|
45
|
+
transform: translateX(-50%);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Placement: bottom */
|
|
49
|
+
.tooltip.--placement_bottom {
|
|
50
|
+
inset-block-start: calc(100% + var(--bds-space_xs));
|
|
51
|
+
inset-inline-start: 50%;
|
|
52
|
+
transform: translateX(-50%);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Placement: left */
|
|
56
|
+
.tooltip.--placement_left {
|
|
57
|
+
inset-inline-end: calc(100% + var(--bds-space_xs));
|
|
58
|
+
inset-block-start: 50%;
|
|
59
|
+
transform: translateY(-50%);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Placement: right */
|
|
63
|
+
.tooltip.--placement_right {
|
|
64
|
+
inset-inline-start: calc(100% + var(--bds-space_xs));
|
|
65
|
+
inset-block-start: 50%;
|
|
66
|
+
transform: translateY(-50%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (prefers-reduced-motion: reduce) {
|
|
70
|
+
.tooltip {
|
|
71
|
+
transition: none;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
static properties = {
|
|
76
|
+
content: { type: String },
|
|
77
|
+
placement: { type: String, reflect: true }
|
|
78
|
+
};
|
|
79
|
+
constructor() {
|
|
80
|
+
super();
|
|
81
|
+
this.content = "";
|
|
82
|
+
this.placement = "top";
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
return T`
|
|
86
|
+
<slot></slot>
|
|
87
|
+
<span
|
|
88
|
+
class="tooltip --placement_${this.placement}"
|
|
89
|
+
role="tooltip"
|
|
90
|
+
>${this.content}</span>
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
customElements.define("bds-tooltip", BdsTooltip);
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
BdsTooltip
|
|
98
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/form/bds-radio.ts
|
|
8
|
+
var BdsRadio = class extends i2 {
|
|
9
|
+
static formAssociated = true;
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: flex-start;
|
|
14
|
+
gap: var(--bds-space_xs);
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
font-size: var(--bds-font_size--body);
|
|
17
|
+
font-family: var(--bds-font_family--body);
|
|
18
|
+
color: var(--bds-color_on-bg);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([disabled]) {
|
|
22
|
+
opacity: 0.5;
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.input {
|
|
28
|
+
--inputSize: calc(var(--bds-space_s) * 2);
|
|
29
|
+
margin-block-start: 0.25em;
|
|
30
|
+
inline-size: var(--inputSize);
|
|
31
|
+
block-size: var(--inputSize);
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
--bdc_color: currentcolor;
|
|
34
|
+
--bdc-outline_radius: 50%;
|
|
35
|
+
|
|
36
|
+
border-radius: 50%;
|
|
37
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--radio_shadow, var(--bdc-outline_shadow));
|
|
38
|
+
border: none;
|
|
39
|
+
appearance: none;
|
|
40
|
+
background-color: var(--radio_color_bg, var(--bds-color_bg));
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
position: relative;
|
|
43
|
+
transition: --bdc_color 0.3s ease, background-color 0.3s ease;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.input:checked {
|
|
47
|
+
background: radial-gradient(
|
|
48
|
+
circle,
|
|
49
|
+
var(--radio_color-active, var(--bdc-color_active)) 35%,
|
|
50
|
+
var(--radio_color_bg, var(--bds-color_bg)) 42%
|
|
51
|
+
);
|
|
52
|
+
--bdc_color: var(--radio_color-active, var(--bdc-color_active));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.input:focus-visible {
|
|
56
|
+
outline: var(--bds-outline_default);
|
|
57
|
+
outline-offset: var(--bds-outline_offset);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
label {
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
flex: 1;
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
static properties = {
|
|
66
|
+
name: { type: String, reflect: true },
|
|
67
|
+
value: { type: String },
|
|
68
|
+
checked: { type: Boolean, reflect: true },
|
|
69
|
+
required: { type: Boolean, reflect: true },
|
|
70
|
+
disabled: { type: Boolean, reflect: true }
|
|
71
|
+
};
|
|
72
|
+
_internals;
|
|
73
|
+
_uid = Math.random().toString(36).slice(2, 8);
|
|
74
|
+
constructor() {
|
|
75
|
+
super();
|
|
76
|
+
this._internals = this.attachInternals();
|
|
77
|
+
this.name = "";
|
|
78
|
+
this.value = "";
|
|
79
|
+
this.checked = false;
|
|
80
|
+
this.required = false;
|
|
81
|
+
this.disabled = false;
|
|
82
|
+
}
|
|
83
|
+
updated(changed) {
|
|
84
|
+
super.updated(changed);
|
|
85
|
+
if (changed.has("checked") || changed.has("value")) {
|
|
86
|
+
this._internals.setFormValue?.(this.checked ? this.value : null);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
formResetCallback() {
|
|
90
|
+
this.checked = false;
|
|
91
|
+
this._internals.setFormValue?.(null);
|
|
92
|
+
}
|
|
93
|
+
_handleChange(e) {
|
|
94
|
+
this.checked = e.target.checked;
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
const id = `bds-radio-${this._uid}`;
|
|
98
|
+
return T`
|
|
99
|
+
<input
|
|
100
|
+
id=${id}
|
|
101
|
+
type="radio"
|
|
102
|
+
class="input"
|
|
103
|
+
name=${this.name}
|
|
104
|
+
value=${this.value}
|
|
105
|
+
.checked=${this.checked}
|
|
106
|
+
?required=${this.required}
|
|
107
|
+
?disabled=${this.disabled}
|
|
108
|
+
@change=${this._handleChange}
|
|
109
|
+
/>
|
|
110
|
+
<label for=${id}><slot></slot></label>
|
|
111
|
+
`;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
customElements.define("bds-radio", BdsRadio);
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
BdsRadio
|
|
118
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
A,
|
|
3
|
+
T,
|
|
4
|
+
i,
|
|
5
|
+
i2
|
|
6
|
+
} from "./chunk-LGEZYFUU.js";
|
|
7
|
+
|
|
8
|
+
// src/web-components/ui/bds-progress.ts
|
|
9
|
+
var BdsProgress = class extends i2 {
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.container {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--bds-space_xxs);
|
|
19
|
+
inline-size: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.label-row {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
align-items: baseline;
|
|
26
|
+
font-size: var(--bds-font_size--body--s);
|
|
27
|
+
color: var(--bds-color_on-bg);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.value {
|
|
31
|
+
font-variant-numeric: tabular-nums;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.track {
|
|
35
|
+
inline-size: 100%;
|
|
36
|
+
block-size: var(--progress_height, var(--bds-space_xs));
|
|
37
|
+
background-color: var(--bds-color_bg--subtle);
|
|
38
|
+
border-radius: 999px;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([size='small']) .track { --progress_height: var(--bds-space_xxs); }
|
|
43
|
+
:host([size='medium']) .track { --progress_height: var(--bds-space_xs); }
|
|
44
|
+
:host([size='large']) .track { --progress_height: var(--bds-space_s); }
|
|
45
|
+
|
|
46
|
+
.fill {
|
|
47
|
+
block-size: 100%;
|
|
48
|
+
background-color: var(--progress_color-active, var(--bdc-color_active));
|
|
49
|
+
border-radius: 999px;
|
|
50
|
+
transition: inline-size var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media (prefers-reduced-motion: reduce) {
|
|
54
|
+
.fill {
|
|
55
|
+
transition: none;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
static properties = {
|
|
60
|
+
value: { type: Number },
|
|
61
|
+
max: { type: Number },
|
|
62
|
+
label: { type: String },
|
|
63
|
+
showLabel: { type: Boolean, attribute: "show-label", reflect: true },
|
|
64
|
+
size: { type: String, reflect: true }
|
|
65
|
+
};
|
|
66
|
+
constructor() {
|
|
67
|
+
super();
|
|
68
|
+
this.value = 0;
|
|
69
|
+
this.max = 100;
|
|
70
|
+
this.label = "";
|
|
71
|
+
this.showLabel = false;
|
|
72
|
+
this.size = "medium";
|
|
73
|
+
}
|
|
74
|
+
get _percentage() {
|
|
75
|
+
return Math.min(100, Math.max(0, this.value / this.max * 100));
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
const pct = this._percentage;
|
|
79
|
+
return T`
|
|
80
|
+
<div class="container">
|
|
81
|
+
${this.showLabel ? T`
|
|
82
|
+
<div class="label-row">
|
|
83
|
+
<span class="label">${this.label}</span>
|
|
84
|
+
<span class="value">${Math.round(pct)}%</span>
|
|
85
|
+
</div>
|
|
86
|
+
` : A}
|
|
87
|
+
<div
|
|
88
|
+
class="track"
|
|
89
|
+
role="progressbar"
|
|
90
|
+
aria-label=${this.label}
|
|
91
|
+
aria-valuenow=${this.value}
|
|
92
|
+
aria-valuemin="0"
|
|
93
|
+
aria-valuemax=${this.max}
|
|
94
|
+
>
|
|
95
|
+
<div class="fill" style="inline-size: ${pct}%"></div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
`;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
customElements.define("bds-progress", BdsProgress);
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
BdsProgress
|
|
105
|
+
};
|