@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
package/dist/native/index.cjs
CHANGED
|
@@ -737,22 +737,23 @@ function Button({
|
|
|
737
737
|
}) {
|
|
738
738
|
const { colors: colors2 } = useTheme();
|
|
739
739
|
const { height, px, fontSize, radius } = sizeTokens[size];
|
|
740
|
-
const primaryColor = colors2.
|
|
741
|
-
const onPrimaryColor = colors2.
|
|
742
|
-
const
|
|
740
|
+
const primaryColor = colors2.colorInteractive;
|
|
741
|
+
const onPrimaryColor = colors2.colorOnInteractive;
|
|
742
|
+
const outlineTextColor = colors2.colorInteractiveOnBg;
|
|
743
|
+
const isOutline = variant === "outline" || variant === "ghost";
|
|
743
744
|
const containerStyle = {
|
|
744
745
|
height,
|
|
745
746
|
paddingHorizontal: px,
|
|
746
747
|
borderRadius: radius,
|
|
747
748
|
opacity: disabled ? 0.4 : 1,
|
|
748
749
|
...variant === "default" && { backgroundColor: primaryColor },
|
|
749
|
-
...
|
|
750
|
+
...isOutline && {
|
|
750
751
|
backgroundColor: "transparent",
|
|
751
752
|
borderWidth: 1,
|
|
752
|
-
borderColor:
|
|
753
|
+
borderColor: outlineTextColor
|
|
753
754
|
}
|
|
754
755
|
};
|
|
755
|
-
const textColor = variant === "default" ? onPrimaryColor :
|
|
756
|
+
const textColor = variant === "default" ? onPrimaryColor : outlineTextColor;
|
|
756
757
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
757
758
|
import_react_native15.Pressable,
|
|
758
759
|
{
|
|
@@ -855,8 +856,8 @@ function Switch({
|
|
|
855
856
|
accessibilityLabel: label,
|
|
856
857
|
accessibilityRole: "switch",
|
|
857
858
|
accessibilityState: { checked: value, disabled },
|
|
858
|
-
thumbColor:
|
|
859
|
-
trackColor: { false: colors2.colorBgSubtle, true: colors2.
|
|
859
|
+
thumbColor: colors2.colorInteractive,
|
|
860
|
+
trackColor: { false: colors2.colorBgSubtle, true: colors2.colorBlueSubtle }
|
|
860
861
|
}
|
|
861
862
|
),
|
|
862
863
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Label, { label })
|
package/dist/native/index.d.cts
CHANGED
|
@@ -141,7 +141,7 @@ interface ButtonGroupProps {
|
|
|
141
141
|
}
|
|
142
142
|
declare function ButtonGroup({ children, variant, accessibilityLabel, style }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
|
|
143
143
|
|
|
144
|
-
type ButtonVariant = 'default' | 'ghost';
|
|
144
|
+
type ButtonVariant = 'default' | 'outline' | 'ghost';
|
|
145
145
|
type ButtonSize = 'small' | 'medium' | 'large';
|
|
146
146
|
interface ButtonProps {
|
|
147
147
|
children?: ReactNode;
|
package/dist/native/index.d.ts
CHANGED
|
@@ -141,7 +141,7 @@ interface ButtonGroupProps {
|
|
|
141
141
|
}
|
|
142
142
|
declare function ButtonGroup({ children, variant, accessibilityLabel, style }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
|
|
143
143
|
|
|
144
|
-
type ButtonVariant = 'default' | 'ghost';
|
|
144
|
+
type ButtonVariant = 'default' | 'outline' | 'ghost';
|
|
145
145
|
type ButtonSize = 'small' | 'medium' | 'large';
|
|
146
146
|
interface ButtonProps {
|
|
147
147
|
children?: ReactNode;
|
package/dist/native/index.js
CHANGED
|
@@ -684,22 +684,23 @@ function Button({
|
|
|
684
684
|
}) {
|
|
685
685
|
const { colors: colors2 } = useTheme();
|
|
686
686
|
const { height, px, fontSize, radius } = sizeTokens[size];
|
|
687
|
-
const primaryColor = colors2.
|
|
688
|
-
const onPrimaryColor = colors2.
|
|
689
|
-
const
|
|
687
|
+
const primaryColor = colors2.colorInteractive;
|
|
688
|
+
const onPrimaryColor = colors2.colorOnInteractive;
|
|
689
|
+
const outlineTextColor = colors2.colorInteractiveOnBg;
|
|
690
|
+
const isOutline = variant === "outline" || variant === "ghost";
|
|
690
691
|
const containerStyle = {
|
|
691
692
|
height,
|
|
692
693
|
paddingHorizontal: px,
|
|
693
694
|
borderRadius: radius,
|
|
694
695
|
opacity: disabled ? 0.4 : 1,
|
|
695
696
|
...variant === "default" && { backgroundColor: primaryColor },
|
|
696
|
-
...
|
|
697
|
+
...isOutline && {
|
|
697
698
|
backgroundColor: "transparent",
|
|
698
699
|
borderWidth: 1,
|
|
699
|
-
borderColor:
|
|
700
|
+
borderColor: outlineTextColor
|
|
700
701
|
}
|
|
701
702
|
};
|
|
702
|
-
const textColor = variant === "default" ? onPrimaryColor :
|
|
703
|
+
const textColor = variant === "default" ? onPrimaryColor : outlineTextColor;
|
|
703
704
|
return /* @__PURE__ */ jsxs5(
|
|
704
705
|
Pressable4,
|
|
705
706
|
{
|
|
@@ -802,8 +803,8 @@ function Switch({
|
|
|
802
803
|
accessibilityLabel: label,
|
|
803
804
|
accessibilityRole: "switch",
|
|
804
805
|
accessibilityState: { checked: value, disabled },
|
|
805
|
-
thumbColor:
|
|
806
|
-
trackColor: { false: colors2.colorBgSubtle, true: colors2.
|
|
806
|
+
thumbColor: colors2.colorInteractive,
|
|
807
|
+
trackColor: { false: colors2.colorBgSubtle, true: colors2.colorBlueSubtle }
|
|
807
808
|
}
|
|
808
809
|
),
|
|
809
810
|
/* @__PURE__ */ jsx18(Label, { label })
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/ui/bds-skeleton.ts
|
|
8
|
+
var BdsSkeleton = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.skeleton {
|
|
15
|
+
display: block;
|
|
16
|
+
background: linear-gradient(
|
|
17
|
+
90deg,
|
|
18
|
+
var(--bds-color_grey--subtle) 25%,
|
|
19
|
+
var(--bds-color_bg) 50%,
|
|
20
|
+
var(--bds-color_grey--subtle) 75%
|
|
21
|
+
);
|
|
22
|
+
background-size: 200% 100%;
|
|
23
|
+
animation: shimmer 1.5s infinite;
|
|
24
|
+
border-radius: var(--bds-border_radius--xs);
|
|
25
|
+
min-block-size: var(--bds-space_m);
|
|
26
|
+
inline-size: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@keyframes shimmer {
|
|
30
|
+
0% { background-position: 200% 0; }
|
|
31
|
+
100% { background-position: -200% 0; }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (prefers-reduced-motion: reduce) {
|
|
35
|
+
.skeleton {
|
|
36
|
+
animation: none;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
render() {
|
|
41
|
+
return T`<span class="skeleton" aria-hidden="true"></span>`;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
customElements.define("bds-skeleton", BdsSkeleton);
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
BdsSkeleton
|
|
48
|
+
};
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import {
|
|
2
|
+
A,
|
|
3
|
+
T,
|
|
4
|
+
i,
|
|
5
|
+
i2
|
|
6
|
+
} from "./chunk-LGEZYFUU.js";
|
|
7
|
+
|
|
8
|
+
// src/web-components/interaction/bds-button.ts
|
|
9
|
+
var BdsButton = class extends i2 {
|
|
10
|
+
static styles = i`
|
|
11
|
+
@keyframes fadeZoom {
|
|
12
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
13
|
+
50% { opacity: 0.75; transform: scale(1.15); }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@keyframes pulse {
|
|
17
|
+
0% { transform: scale(1); box-shadow: 0 0 0 0 rgb(from var(--button_pulse-color, var(--button_color, var(--bds-color_interactive))) r g b / 50%); }
|
|
18
|
+
70% { transform: scale(1.01); box-shadow: 0 0 0 var(--bds-space_m) rgb(from var(--button_pulse-color, var(--button_color, var(--bds-color_interactive))) r g b / 0%); }
|
|
19
|
+
100% { transform: scale(1); box-shadow: 0 0 0 0 rgb(from var(--button_pulse-color, var(--button_color, var(--bds-color_interactive))) r g b / 0%); }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.button,
|
|
27
|
+
.button[href] {
|
|
28
|
+
all: unset;
|
|
29
|
+
position: relative;
|
|
30
|
+
font: inherit;
|
|
31
|
+
padding-inline: var(--bds-space_l);
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
gap: var(--bds-space_xs);
|
|
34
|
+
border-radius: var(--button_border_radius--s, var(--bds-border_radius--s));
|
|
35
|
+
align-items: center;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
height: var(--button_height, 3em);
|
|
39
|
+
font-size: var(--button_font-size, inherit);
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
line-height: 1;
|
|
42
|
+
|
|
43
|
+
--button_color: var(--bds-color_interactive);
|
|
44
|
+
--button_on-color: var(--bds-color_on-interactive);
|
|
45
|
+
--button_color--on-bg: var(--bds-color_interactive_on-bg);
|
|
46
|
+
|
|
47
|
+
background-color: var(--button_bg, var(--button_color));
|
|
48
|
+
color: var(--button_text, var(--button_on-color));
|
|
49
|
+
border: var(--button_border, none);
|
|
50
|
+
--bdc_color: transparent;
|
|
51
|
+
|
|
52
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
53
|
+
transition: var(--bds-animation_transition),
|
|
54
|
+
--bdc_color var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.button[href] {
|
|
58
|
+
text-decoration: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Variants */
|
|
62
|
+
.button.outline,
|
|
63
|
+
.button.ghost /* deprecated — use variant="outline" */ {
|
|
64
|
+
--button_bg: transparent;
|
|
65
|
+
--button_text: var(--button_color--on-bg);
|
|
66
|
+
--bdc_color: var(--button_color--on-bg);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Sizes */
|
|
70
|
+
.button.small {
|
|
71
|
+
--button_height: 2.25em;
|
|
72
|
+
--button_font-size: var(--bds-font_size--body--s);
|
|
73
|
+
--button_border_radius--s: var(--bds-border_radius--xs);
|
|
74
|
+
padding-inline: var(--bds-space_m);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.button.medium {
|
|
78
|
+
--button_height: 3em;
|
|
79
|
+
padding-inline: var(--bds-space_l);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.button.large {
|
|
83
|
+
--button_font-size: var(--bds-font_size--heading-3);
|
|
84
|
+
--button_border_radius--s: var(--bds-border_radius--m);
|
|
85
|
+
padding-inline: var(--bds-space_xl);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Pulse */
|
|
89
|
+
.button.has-pulse {
|
|
90
|
+
animation: pulse 3s infinite;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* SVG icon colour */
|
|
94
|
+
.button svg {
|
|
95
|
+
--icon__stroke: currentcolor;
|
|
96
|
+
fill: currentcolor;
|
|
97
|
+
color: currentcolor;
|
|
98
|
+
flex-shrink: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Icon slots — hidden by default, shown when slot has content */
|
|
102
|
+
.icon-start,
|
|
103
|
+
.icon-end {
|
|
104
|
+
display: none;
|
|
105
|
+
align-items: center;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.icon-start.has-content {
|
|
109
|
+
display: flex;
|
|
110
|
+
margin-inline-start: calc(var(--bds-space_s) * -1);
|
|
111
|
+
transition: var(--bds-animation_transition);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.icon-end.has-content {
|
|
115
|
+
display: flex;
|
|
116
|
+
margin-inline-end: calc(var(--bds-space_s) * -1);
|
|
117
|
+
transition: var(--bds-animation_transition);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Hover icon animation */
|
|
121
|
+
@media (hover: hover) and (pointer: fine) {
|
|
122
|
+
.button:hover .icon-start svg,
|
|
123
|
+
.button:hover .icon-end svg {
|
|
124
|
+
animation: fadeZoom 2s ease-out infinite;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Default hover */
|
|
128
|
+
.button.default:hover {
|
|
129
|
+
--button_bg: var(--bds-color_bg);
|
|
130
|
+
--button_text: var(--bds-color_interactive);
|
|
131
|
+
--button_pulse-color: var(--bds-color_interactive);
|
|
132
|
+
--bdc_color: currentcolor;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Outline hover */
|
|
136
|
+
.button.outline:hover,
|
|
137
|
+
.button.ghost:hover {
|
|
138
|
+
--button_bg: var(--button_color);
|
|
139
|
+
--button_text: var(--button_on-color);
|
|
140
|
+
--bdc_color: transparent;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Focus visible */
|
|
145
|
+
.button:focus-visible {
|
|
146
|
+
outline: var(--bds-outline_default);
|
|
147
|
+
outline-offset: var(--bds-outline_offset);
|
|
148
|
+
border-radius: var(--bds-border_radius--s);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Disabled */
|
|
152
|
+
.button:disabled,
|
|
153
|
+
.button[aria-disabled='true'] {
|
|
154
|
+
opacity: 0.5;
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
pointer-events: none;
|
|
157
|
+
}
|
|
158
|
+
`;
|
|
159
|
+
static properties = {
|
|
160
|
+
variant: { type: String, reflect: true },
|
|
161
|
+
size: { type: String, reflect: true },
|
|
162
|
+
disabled: { type: Boolean, reflect: true },
|
|
163
|
+
href: { type: String },
|
|
164
|
+
target: { type: String },
|
|
165
|
+
rel: { type: String },
|
|
166
|
+
hasPulse: { type: Boolean, attribute: "has-pulse", reflect: true },
|
|
167
|
+
type: { type: String },
|
|
168
|
+
ariaLabel: { type: String, attribute: "aria-label" },
|
|
169
|
+
// Internal state
|
|
170
|
+
_iconStartFilled: { state: true },
|
|
171
|
+
_iconEndFilled: { state: true }
|
|
172
|
+
};
|
|
173
|
+
constructor() {
|
|
174
|
+
super();
|
|
175
|
+
this.variant = "default";
|
|
176
|
+
this.size = "medium";
|
|
177
|
+
this.disabled = false;
|
|
178
|
+
this.hasPulse = false;
|
|
179
|
+
this.type = "button";
|
|
180
|
+
this.ariaLabel = null;
|
|
181
|
+
this._iconStartFilled = false;
|
|
182
|
+
this._iconEndFilled = false;
|
|
183
|
+
}
|
|
184
|
+
_onIconSlotChange(e, position) {
|
|
185
|
+
const slot = e.target;
|
|
186
|
+
const filled = slot.assignedNodes({ flatten: true }).length > 0;
|
|
187
|
+
if (position === "start") {
|
|
188
|
+
this._iconStartFilled = filled;
|
|
189
|
+
} else {
|
|
190
|
+
this._iconEndFilled = filled;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
get _classes() {
|
|
194
|
+
return `button ${this.variant} ${this.size}${this.hasPulse ? " has-pulse" : ""}`;
|
|
195
|
+
}
|
|
196
|
+
_handleAnchorClick(e) {
|
|
197
|
+
if (this.disabled) {
|
|
198
|
+
e.preventDefault();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
_iconSlot(position) {
|
|
202
|
+
const filled = position === "start" ? this._iconStartFilled : this._iconEndFilled;
|
|
203
|
+
return T`
|
|
204
|
+
<span class="icon-${position} ${filled ? "has-content" : ""}">
|
|
205
|
+
<slot name="icon-${position}" @slotchange=${(e) => this._onIconSlotChange(e, position)}></slot>
|
|
206
|
+
</span>
|
|
207
|
+
`;
|
|
208
|
+
}
|
|
209
|
+
render() {
|
|
210
|
+
if (this.href) {
|
|
211
|
+
return T`
|
|
212
|
+
<a
|
|
213
|
+
class=${this._classes}
|
|
214
|
+
href=${this.disabled ? A : this.href}
|
|
215
|
+
target=${this.target ?? A}
|
|
216
|
+
rel=${this.rel ?? A}
|
|
217
|
+
aria-disabled=${this.disabled ? "true" : A}
|
|
218
|
+
tabindex=${this.disabled ? "-1" : A}
|
|
219
|
+
aria-label=${this.ariaLabel ?? A}
|
|
220
|
+
@click=${this._handleAnchorClick}
|
|
221
|
+
>
|
|
222
|
+
${this._iconSlot("start")}
|
|
223
|
+
<slot></slot>
|
|
224
|
+
${this._iconSlot("end")}
|
|
225
|
+
</a>
|
|
226
|
+
`;
|
|
227
|
+
}
|
|
228
|
+
return T`
|
|
229
|
+
<button
|
|
230
|
+
class=${this._classes}
|
|
231
|
+
type=${this.type}
|
|
232
|
+
?disabled=${this.disabled}
|
|
233
|
+
aria-label=${this.ariaLabel ?? A}
|
|
234
|
+
>
|
|
235
|
+
${this._iconSlot("start")}
|
|
236
|
+
<slot></slot>
|
|
237
|
+
${this._iconSlot("end")}
|
|
238
|
+
</button>
|
|
239
|
+
`;
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
customElements.define("bds-button", BdsButton);
|
|
243
|
+
|
|
244
|
+
export {
|
|
245
|
+
BdsButton
|
|
246
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
A,
|
|
3
|
+
T,
|
|
4
|
+
i,
|
|
5
|
+
i2
|
|
6
|
+
} from "./chunk-LGEZYFUU.js";
|
|
7
|
+
|
|
8
|
+
// src/web-components/ui/bds-avatar.ts
|
|
9
|
+
var BdsAvatar = class extends i2 {
|
|
10
|
+
static styles = i`
|
|
11
|
+
:host {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
inline-size: var(--avatar_size, 3em);
|
|
16
|
+
block-size: var(--avatar_size, 3em);
|
|
17
|
+
border-radius: 50%;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
flex-shrink: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([size='small']) { --avatar_size: 2em; }
|
|
23
|
+
:host([size='medium']) { --avatar_size: 3em; }
|
|
24
|
+
:host([size='large']) { --avatar_size: 4.5em; }
|
|
25
|
+
|
|
26
|
+
.fallback {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
inline-size: 100%;
|
|
31
|
+
block-size: 100%;
|
|
32
|
+
background-color: var(--avatar_bg, var(--bds-color_blue));
|
|
33
|
+
color: var(--avatar_text, var(--bds-color_on-blue));
|
|
34
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.initials {
|
|
38
|
+
line-height: 1;
|
|
39
|
+
user-select: none;
|
|
40
|
+
font-size: var(--bds-font_size--body);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([size='small']) .initials { font-size: var(--bds-font_size--body--s); }
|
|
44
|
+
:host([size='large']) .initials { font-size: var(--bds-font_size--heading-3); }
|
|
45
|
+
|
|
46
|
+
.image {
|
|
47
|
+
inline-size: 100%;
|
|
48
|
+
block-size: 100%;
|
|
49
|
+
object-fit: cover;
|
|
50
|
+
display: block;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
static properties = {
|
|
54
|
+
src: { type: String },
|
|
55
|
+
alt: { type: String },
|
|
56
|
+
name: { type: String },
|
|
57
|
+
size: { type: String, reflect: true }
|
|
58
|
+
};
|
|
59
|
+
constructor() {
|
|
60
|
+
super();
|
|
61
|
+
this.src = "";
|
|
62
|
+
this.alt = "";
|
|
63
|
+
this.name = "";
|
|
64
|
+
this.size = "medium";
|
|
65
|
+
}
|
|
66
|
+
get _initials() {
|
|
67
|
+
if (!this.name) return "";
|
|
68
|
+
return this.name.split(" ").filter(Boolean).slice(0, 2).map((word) => word[0].toUpperCase()).join("");
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
if (this.src) {
|
|
72
|
+
return T`<img
|
|
73
|
+
class="image"
|
|
74
|
+
src=${this.src}
|
|
75
|
+
alt=${this.alt || this.name || "User avatar"}
|
|
76
|
+
/>`;
|
|
77
|
+
}
|
|
78
|
+
return T`
|
|
79
|
+
<span
|
|
80
|
+
class="fallback"
|
|
81
|
+
role="img"
|
|
82
|
+
aria-label=${this.name || "User avatar"}
|
|
83
|
+
>
|
|
84
|
+
${this._initials ? T`<span class="initials" aria-hidden="true">${this._initials}</span>` : A}
|
|
85
|
+
</span>
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
customElements.define("bds-avatar", BdsAvatar);
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
BdsAvatar
|
|
93
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/interaction/bds-collapsible.ts
|
|
8
|
+
var BdsCollapsible = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.collapsible {
|
|
15
|
+
border: var(--collapsible_border-width, 1px) solid var(--collapsible_border-color, var(--bds-color_bg--subtle));
|
|
16
|
+
border-radius: var(--collapsible_border-radius, var(--bds-border_radius--m));
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.summary {
|
|
21
|
+
list-style: none;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
gap: var(--bds-space_m);
|
|
26
|
+
padding: var(--bds-space_m);
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
font-weight: var(--bds-font_weight--semibold);
|
|
29
|
+
font-size: var(--bds-font_size--body);
|
|
30
|
+
color: var(--collapsible_color, var(--bds-color_on-bg));
|
|
31
|
+
background-color: var(--collapsible_bg, var(--bds-color_bg));
|
|
32
|
+
user-select: none;
|
|
33
|
+
transition: var(--bds-animation_transition);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.summary::-webkit-details-marker {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.summary:focus-visible {
|
|
41
|
+
outline: var(--bds-outline_default);
|
|
42
|
+
outline-offset: calc(var(--bds-outline_offset) * -1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (hover: hover) and (pointer: fine) {
|
|
46
|
+
.summary:hover {
|
|
47
|
+
background-color: var(--collapsible_bg--hover, var(--bds-color_bg--subtle));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.collapsible[open] > .summary {
|
|
52
|
+
border-block-end: var(--collapsible_border-width, 1px) solid var(--collapsible_border-color, var(--bds-color_bg--subtle));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.summary-content {
|
|
56
|
+
flex: 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.icon {
|
|
60
|
+
inline-size: 0.5rem;
|
|
61
|
+
block-size: 0.5rem;
|
|
62
|
+
border-inline-end: 2px solid currentcolor;
|
|
63
|
+
border-block-end: 2px solid currentcolor;
|
|
64
|
+
transform: rotate(45deg);
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
transition: transform var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.collapsible[open] > .summary .icon {
|
|
70
|
+
transform: rotate(-135deg);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.content {
|
|
74
|
+
padding: var(--bds-space_m);
|
|
75
|
+
color: var(--collapsible_on-color, var(--bds-color_on-bg));
|
|
76
|
+
font-size: var(--bds-font_size--body);
|
|
77
|
+
line-height: var(--bds-font_line-height--body);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@media (prefers-reduced-motion: reduce) {
|
|
81
|
+
.icon {
|
|
82
|
+
transition: none;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
86
|
+
static properties = {
|
|
87
|
+
open: { type: Boolean, reflect: true },
|
|
88
|
+
name: { type: String }
|
|
89
|
+
};
|
|
90
|
+
constructor() {
|
|
91
|
+
super();
|
|
92
|
+
this.open = false;
|
|
93
|
+
this.name = "";
|
|
94
|
+
}
|
|
95
|
+
updated(changed) {
|
|
96
|
+
super.updated(changed);
|
|
97
|
+
if (changed.has("name")) {
|
|
98
|
+
const details = this.shadowRoot?.querySelector("details");
|
|
99
|
+
if (details) {
|
|
100
|
+
if (this.name) {
|
|
101
|
+
details.setAttribute("name", this.name);
|
|
102
|
+
} else {
|
|
103
|
+
details.removeAttribute("name");
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
_onToggle(e) {
|
|
109
|
+
const details = e.currentTarget;
|
|
110
|
+
this.open = details.open;
|
|
111
|
+
this.dispatchEvent(
|
|
112
|
+
new CustomEvent("bds-toggle", {
|
|
113
|
+
bubbles: true,
|
|
114
|
+
composed: true,
|
|
115
|
+
detail: { open: this.open }
|
|
116
|
+
})
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
render() {
|
|
120
|
+
return T`
|
|
121
|
+
<details
|
|
122
|
+
class="collapsible"
|
|
123
|
+
?open=${this.open}
|
|
124
|
+
@toggle=${this._onToggle}
|
|
125
|
+
>
|
|
126
|
+
<summary class="summary">
|
|
127
|
+
<span class="summary-content"><slot name="summary"></slot></span>
|
|
128
|
+
<span class="icon" aria-hidden="true"></span>
|
|
129
|
+
</summary>
|
|
130
|
+
<div class="content"><slot></slot></div>
|
|
131
|
+
</details>
|
|
132
|
+
`;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
customElements.define("bds-collapsible", BdsCollapsible);
|
|
136
|
+
|
|
137
|
+
export {
|
|
138
|
+
BdsCollapsible
|
|
139
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T,
|
|
3
|
+
i,
|
|
4
|
+
i2
|
|
5
|
+
} from "./chunk-LGEZYFUU.js";
|
|
6
|
+
|
|
7
|
+
// src/web-components/ui/bds-loading.ts
|
|
8
|
+
var BdsLoading = class extends i2 {
|
|
9
|
+
static styles = i`
|
|
10
|
+
:host {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.spinner {
|
|
17
|
+
inline-size: 2.5em;
|
|
18
|
+
block-size: 2.5em;
|
|
19
|
+
border: 4px solid var(--bds-color_bg);
|
|
20
|
+
border-block-start: 4px solid var(--bds-color_interactive);
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
animation: spin 1s linear infinite;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([size='small']) .spinner {
|
|
26
|
+
inline-size: 1.5em;
|
|
27
|
+
block-size: 1.5em;
|
|
28
|
+
border-width: 2px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host([size='large']) .spinner {
|
|
32
|
+
inline-size: 4em;
|
|
33
|
+
block-size: 4em;
|
|
34
|
+
border-width: 6px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@keyframes spin {
|
|
38
|
+
0% { transform: rotate(0deg); }
|
|
39
|
+
100% { transform: rotate(360deg); }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@media (prefers-reduced-motion: reduce) {
|
|
43
|
+
.spinner {
|
|
44
|
+
animation: none;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
static properties = {
|
|
49
|
+
size: { type: String, reflect: true }
|
|
50
|
+
};
|
|
51
|
+
constructor() {
|
|
52
|
+
super();
|
|
53
|
+
this.size = "medium";
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
return T`<div class="spinner" role="status" aria-label="Loading"></div>`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
customElements.define("bds-loading", BdsLoading);
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
BdsLoading
|
|
63
|
+
};
|