@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
|
@@ -1,92 +1,70 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Children, ReactElement, ReactNode, cloneElement, isValidElement } from 'react';
|
|
2
2
|
import css from './SegmentedControl.module.css';
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
4
|
import type { WithClassName } from '../../../../types';
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
name: string;
|
|
15
|
-
options: SegmentedControlOption[];
|
|
16
|
-
/** Controlled selected value */
|
|
17
|
-
value?: string;
|
|
18
|
-
/** Uncontrolled initial value (defaults to first option) */
|
|
19
|
-
defaultValue?: string;
|
|
20
|
-
onChange?: (value: string) => void;
|
|
6
|
+
export interface SegmentedControlProps extends WithClassName {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Zero-based index of the active item.
|
|
10
|
+
* When omitted, auto-detected from the first child that has
|
|
11
|
+
* aria-current="page", aria-pressed={true}, or aria-selected={true}.
|
|
12
|
+
*/
|
|
13
|
+
selectedIndex?: number;
|
|
21
14
|
disabled?: boolean;
|
|
22
15
|
size?: 'small' | 'medium' | 'large';
|
|
16
|
+
/** "outline" (default) — sliding inset border; "filled" — sliding filled thumb */
|
|
17
|
+
variant?: 'outline' | 'filled';
|
|
23
18
|
'aria-label'?: string;
|
|
24
19
|
}
|
|
25
20
|
|
|
26
21
|
export function SegmentedControl({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
value,
|
|
30
|
-
defaultValue,
|
|
31
|
-
onChange,
|
|
22
|
+
children,
|
|
23
|
+
selectedIndex: selectedIndexProp,
|
|
32
24
|
disabled,
|
|
33
25
|
size = 'medium',
|
|
26
|
+
variant = 'outline',
|
|
34
27
|
className,
|
|
35
28
|
'aria-label': ariaLabel,
|
|
36
|
-
...rest
|
|
37
29
|
}: Readonly<SegmentedControlProps>) {
|
|
38
|
-
const
|
|
30
|
+
const validChildren = Children.toArray(children).filter(isValidElement) as ReactElement<Record<string, unknown>>[];
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
// Auto-detect active index from standard ARIA attributes if not explicitly provided.
|
|
33
|
+
const autoIndex = selectedIndexProp === undefined
|
|
34
|
+
? validChildren.findIndex(child => {
|
|
35
|
+
const p = child.props as Record<string, unknown>;
|
|
36
|
+
return p['aria-current'] === 'page' || p['aria-pressed'] === true || p['aria-selected'] === true;
|
|
37
|
+
})
|
|
38
|
+
: -1;
|
|
46
39
|
|
|
47
|
-
const
|
|
48
|
-
if (value === undefined) setInternalValue(optionValue);
|
|
49
|
-
onChange?.(optionValue);
|
|
50
|
-
};
|
|
40
|
+
const activeIndex = Math.max(0, selectedIndexProp ?? (autoIndex >= 0 ? autoIndex : 0));
|
|
51
41
|
|
|
52
42
|
return (
|
|
53
43
|
<div
|
|
54
44
|
role="group"
|
|
55
45
|
aria-label={ariaLabel}
|
|
56
|
-
className={cn(css.control, css[`--size_${size}`], className)}
|
|
46
|
+
className={cn(css.control, css[`--size_${size}`], css[`--variant_${variant}`], className)}
|
|
57
47
|
style={{
|
|
58
|
-
'--control_count':
|
|
59
|
-
'--control_selected-index':
|
|
48
|
+
'--control_count': validChildren.length,
|
|
49
|
+
'--control_selected-index': activeIndex,
|
|
60
50
|
} as React.CSSProperties}
|
|
61
51
|
>
|
|
62
|
-
{/* Sliding thumb — purely visual */}
|
|
63
52
|
<span className={css.thumb} aria-hidden="true" />
|
|
53
|
+
<span className={css.indicator} aria-hidden="true" />
|
|
64
54
|
|
|
65
|
-
{
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const isDisabled = disabled ||
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
type="radio"
|
|
79
|
-
id={id}
|
|
80
|
-
name={name}
|
|
81
|
-
value={option.value}
|
|
82
|
-
checked={isChecked}
|
|
83
|
-
disabled={isDisabled}
|
|
84
|
-
className={css.radio}
|
|
85
|
-
onChange={() => handleChange(option.value)}
|
|
86
|
-
/>
|
|
87
|
-
<span className={css.label}>{option.label}</span>
|
|
88
|
-
</label>
|
|
89
|
-
);
|
|
55
|
+
{validChildren.map((child, index) => {
|
|
56
|
+
const isActive = index === activeIndex;
|
|
57
|
+
const p = child.props as Record<string, unknown>;
|
|
58
|
+
const isDisabled = disabled || !!p.disabled || p['aria-disabled'] === true;
|
|
59
|
+
return cloneElement(child, {
|
|
60
|
+
key: child.key ?? index,
|
|
61
|
+
className: cn(
|
|
62
|
+
css.item,
|
|
63
|
+
isActive && css['--active'],
|
|
64
|
+
isDisabled && css['--disabled'],
|
|
65
|
+
p.className as string | undefined,
|
|
66
|
+
),
|
|
67
|
+
});
|
|
90
68
|
})}
|
|
91
69
|
</div>
|
|
92
70
|
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { SegmentedControl } from './SegmentedControl';
|
|
2
|
-
export type { SegmentedControlProps
|
|
2
|
+
export type { SegmentedControlProps } from './SegmentedControl';
|
|
@@ -21,10 +21,8 @@
|
|
|
21
21
|
--bdc_color: currentcolor;
|
|
22
22
|
--bdc-outline_radius: var(--bds-border_radius--xs);
|
|
23
23
|
|
|
24
|
-
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
25
|
-
outline-offset: var(--bdc-outline_offset);
|
|
26
24
|
border-radius: var(--select_radius, var(--bdc-outline_radius));
|
|
27
|
-
box-shadow: var(--select_shadow, var(--bdc-outline_shadow));
|
|
25
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--select_shadow, var(--bdc-outline_shadow));
|
|
28
26
|
background-color: var(--select_color_bg, var(--bds-color_bg));
|
|
29
27
|
color: var(--select_color, var(--bds-color_on-bg));
|
|
30
28
|
cursor: pointer;
|
|
@@ -56,7 +54,7 @@
|
|
|
56
54
|
display: flex;
|
|
57
55
|
align-items: center;
|
|
58
56
|
pointer-events: none;
|
|
59
|
-
color: var(--
|
|
57
|
+
color: var(--select_chevron-color, var(--bds-color_interactive));
|
|
60
58
|
}
|
|
61
59
|
|
|
62
60
|
.chevron svg {
|
|
@@ -56,14 +56,12 @@
|
|
|
56
56
|
background-color: var(--switch_track-bg, var(--bds-color_grey--subtle));
|
|
57
57
|
padding-inline: var(--switch_track-pad);
|
|
58
58
|
pointer-events: none;
|
|
59
|
-
|
|
60
|
-
outline-offset: var(--bds-outline_offset);
|
|
61
|
-
box-shadow: var(--switch_shadow, var(--bdc-outline_shadow));
|
|
59
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--switch_shadow, var(--bdc-outline_shadow));
|
|
62
60
|
transition: --bdc_color var(--bds-animation_transition-duration) var(--bds-animation_easing),
|
|
63
61
|
background-color var(--bds-animation_transition-duration) var(--bds-animation_easing),
|
|
64
62
|
transform var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
65
63
|
|
|
66
|
-
--bdc_color: var(--switch_thumb-bg, var(--bds-
|
|
64
|
+
--bdc_color: var(--switch_thumb-bg, var(--bds-color_interactive));
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
/* Thumb */
|
|
@@ -72,7 +70,7 @@
|
|
|
72
70
|
inline-size: var(--switch_thumb-size);
|
|
73
71
|
block-size: var(--switch_thumb-size);
|
|
74
72
|
border-radius: 50%;
|
|
75
|
-
background-color: var(--switch_thumb-bg, var(--bds-
|
|
73
|
+
background-color: var(--switch_thumb-bg, var(--bds-color_interactive));
|
|
76
74
|
box-shadow: var(--bds-shadow_s);
|
|
77
75
|
transition: var(--bds-animation_transition);
|
|
78
76
|
transform: translateX(0);
|
|
@@ -87,11 +85,11 @@
|
|
|
87
85
|
.switch:checked + .track {
|
|
88
86
|
background-color: var(--switch_track-bg--active, var(--bdc-color_active--subtle));
|
|
89
87
|
|
|
90
|
-
--bdc_color: var(--switch_thumb-bg--active, var(--
|
|
88
|
+
--bdc_color: var(--switch_thumb-bg--active, var(--bds-color_interactive));
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
.switch:checked + .track .thumb {
|
|
94
|
-
background-color: var(--switch_thumb-bg--active, var(--
|
|
92
|
+
background-color: var(--switch_thumb-bg--active, var(--bds-color_interactive));
|
|
95
93
|
transform: translateX(var(--switch_thumb-size));
|
|
96
94
|
}
|
|
97
95
|
|
|
@@ -38,17 +38,17 @@ describe('Switch (native)', () => {
|
|
|
38
38
|
expect(getSwitchInput(container)).toBeChecked();
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
it('thumb
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
const { container } = renderWithTheme(
|
|
41
|
+
it('renders thumb in both on and off states without error (thumb always uses colorInteractive)', () => {
|
|
42
|
+
// thumbColor is always colorInteractive — interactive affordance is visible in both states.
|
|
43
|
+
// Track color provides the on/off visual feedback instead.
|
|
44
|
+
const { container: offContainer } = renderWithTheme(
|
|
45
45
|
<Switch label="Toggle" name="toggle" value={false} />,
|
|
46
46
|
);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
expect(
|
|
47
|
+
const { container: onContainer } = renderWithTheme(
|
|
48
|
+
<Switch label="Toggle2" name="toggle2" value={true} />,
|
|
49
|
+
);
|
|
50
|
+
expect(offContainer.querySelector('[style*="background-color"]')).toBeInTheDocument();
|
|
51
|
+
expect(onContainer.querySelector('[style*="background-color"]')).toBeInTheDocument();
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
it('renders hint message', () => {
|
|
@@ -47,8 +47,8 @@ export function Switch({
|
|
|
47
47
|
accessibilityLabel={label}
|
|
48
48
|
accessibilityRole="switch"
|
|
49
49
|
accessibilityState={{ checked: value, disabled }}
|
|
50
|
-
thumbColor={
|
|
51
|
-
trackColor={{ false: colors.colorBgSubtle, true: colors.
|
|
50
|
+
thumbColor={colors.colorInteractive}
|
|
51
|
+
trackColor={{ false: colors.colorBgSubtle, true: colors.colorBlueSubtle }}
|
|
52
52
|
/>
|
|
53
53
|
<Label label={label} />
|
|
54
54
|
</View>
|
|
@@ -13,10 +13,8 @@
|
|
|
13
13
|
--bdc_color: currentcolor;
|
|
14
14
|
--bdc-outline_radius: var(--bds-border_radius--xs);
|
|
15
15
|
|
|
16
|
-
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
17
|
-
outline-offset: var(--bdc-outline_offset);
|
|
18
16
|
border-radius: var(--textarea_radius, var(--bdc-outline_radius));
|
|
19
|
-
box-shadow: var(--textarea_shadow, var(--bdc-outline_shadow));
|
|
17
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--textarea_shadow, var(--bdc-outline_shadow));
|
|
20
18
|
background-color: var(--textarea_color_bg, var(--bds-color_bg));
|
|
21
19
|
color: var(--textarea_color, var(--bds-color_on-bg));
|
|
22
20
|
resize: vertical;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { InputContainer } from './InputContainer';
|
|
4
|
+
import { Label } from './Label';
|
|
5
|
+
import { Message } from './Message';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'React/Form/Atoms/InputContainer',
|
|
9
|
+
component: InputContainer,
|
|
10
|
+
parameters: { layout: 'padded' },
|
|
11
|
+
} satisfies Meta<typeof InputContainer>;
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
|
|
16
|
+
export const Default: Story = {
|
|
17
|
+
render: () => (
|
|
18
|
+
<InputContainer>
|
|
19
|
+
<Label id="demo-input" label="Email address" />
|
|
20
|
+
<input id="demo-input" type="email" placeholder="you@example.com" style={{ display: 'block', width: '100%', padding: '8px', boxSizing: 'border-box' }} />
|
|
21
|
+
</InputContainer>
|
|
22
|
+
),
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const WithHint: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<InputContainer>
|
|
28
|
+
<Label id="demo-hint" label="Username" />
|
|
29
|
+
<input id="demo-hint" type="text" placeholder="Enter username" style={{ display: 'block', width: '100%', padding: '8px', boxSizing: 'border-box' }} />
|
|
30
|
+
<Message inputId="demo-hint" type="hint" message="At least 3 characters." />
|
|
31
|
+
</InputContainer>
|
|
32
|
+
),
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const WithError: Story = {
|
|
36
|
+
render: () => (
|
|
37
|
+
<InputContainer>
|
|
38
|
+
<Label id="demo-error" label="Password" />
|
|
39
|
+
<input id="demo-error" type="password" placeholder="Enter password" style={{ display: 'block', width: '100%', padding: '8px', boxSizing: 'border-box' }} />
|
|
40
|
+
<Message inputId="demo-error" type="error" message="Password is too short." />
|
|
41
|
+
</InputContainer>
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const AllVariants: Story = {
|
|
46
|
+
render: () => (
|
|
47
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px', maxWidth: '320px' }}>
|
|
48
|
+
<InputContainer>
|
|
49
|
+
<Label id="v1" label="Plain input" />
|
|
50
|
+
<input id="v1" type="text" placeholder="Default" style={{ display: 'block', width: '100%', padding: '8px', boxSizing: 'border-box' }} />
|
|
51
|
+
</InputContainer>
|
|
52
|
+
<InputContainer>
|
|
53
|
+
<Label id="v2" label="With hint" />
|
|
54
|
+
<input id="v2" type="text" placeholder="Hint below" style={{ display: 'block', width: '100%', padding: '8px', boxSizing: 'border-box' }} />
|
|
55
|
+
<Message inputId="v2" type="hint" message="Helpful hint text." />
|
|
56
|
+
</InputContainer>
|
|
57
|
+
<InputContainer>
|
|
58
|
+
<Label id="v3" label="With error" />
|
|
59
|
+
<input id="v3" type="text" placeholder="Error state" style={{ display: 'block', width: '100%', padding: '8px', boxSizing: 'border-box' }} />
|
|
60
|
+
<Message inputId="v3" type="error" message="This field has an error." />
|
|
61
|
+
</InputContainer>
|
|
62
|
+
</div>
|
|
63
|
+
),
|
|
64
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Label } from './Label';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'React/Form/Atoms/Label',
|
|
6
|
+
component: Label,
|
|
7
|
+
parameters: { layout: 'padded' },
|
|
8
|
+
} satisfies Meta<typeof Label>;
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = { args: { id: 'input-1', label: 'Email address' } };
|
|
14
|
+
export const Required: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
id: 'input-required',
|
|
17
|
+
label: (
|
|
18
|
+
<>
|
|
19
|
+
Full name <span aria-hidden="true" style={{ color: 'red' }}>*</span>
|
|
20
|
+
</>
|
|
21
|
+
),
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const AllVariants: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
|
|
28
|
+
<Label id="a" label="Plain label" />
|
|
29
|
+
<Label id="b" label="Label for a text input" />
|
|
30
|
+
<Label id="c" label={<><strong>Bold</strong> label with markup</>} />
|
|
31
|
+
</div>
|
|
32
|
+
),
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Message } from './Message';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'React/Form/Atoms/Message',
|
|
6
|
+
component: Message,
|
|
7
|
+
parameters: { layout: 'padded' },
|
|
8
|
+
argTypes: {
|
|
9
|
+
type: { control: 'select', options: ['hint', 'error'] },
|
|
10
|
+
},
|
|
11
|
+
} satisfies Meta<typeof Message>;
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
|
|
16
|
+
export const Hint: Story = {
|
|
17
|
+
args: { inputId: 'field-1', type: 'hint', message: 'Password must be at least 8 characters.' },
|
|
18
|
+
};
|
|
19
|
+
export const Error: Story = {
|
|
20
|
+
args: { inputId: 'field-2', type: 'error', message: 'This field is required.' },
|
|
21
|
+
};
|
|
22
|
+
export const NoMessage: Story = {
|
|
23
|
+
args: { inputId: 'field-3', type: 'hint', message: undefined },
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const AllVariants: Story = {
|
|
27
|
+
render: () => (
|
|
28
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
29
|
+
<Message inputId="v1" type="hint" message="Hint: Enter your full legal name." />
|
|
30
|
+
<Message inputId="v2" type="error" message="Error: This field is required." />
|
|
31
|
+
</div>
|
|
32
|
+
),
|
|
33
|
+
};
|
|
@@ -19,9 +19,7 @@
|
|
|
19
19
|
border: var(--card_border, none);
|
|
20
20
|
--bdc_color: currentcolor;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
outline-offset: var(--bdc-outline_offset);
|
|
24
|
-
box-shadow: var(--bds-shadow_s);
|
|
22
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--bds-shadow_s);
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
.card.--clickable {
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
--bdc_color: var(--bds-color_bg--subtle);
|
|
7
7
|
--bdc-outline_radius: var(--bds-border_radius--s);
|
|
8
8
|
|
|
9
|
-
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
10
|
-
outline-offset: var(--bdc-outline_offset);
|
|
11
9
|
border-radius: var(--accordion_radius, var(--bdc-outline_radius));
|
|
10
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
12
11
|
overflow: hidden;
|
|
13
12
|
}
|
|
14
13
|
|
|
@@ -8,11 +8,9 @@
|
|
|
8
8
|
--bdc_color: var(--bds-color_bg--subtle);
|
|
9
9
|
--bdc-outline_radius: var(--bds-border_radius--m);
|
|
10
10
|
|
|
11
|
-
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
12
|
-
outline-offset: var(--bdc-outline_offset);
|
|
13
11
|
border-radius: var(--calendar_radius, var(--bdc-outline_radius));
|
|
14
12
|
padding: var(--bds-space_m);
|
|
15
|
-
box-shadow: var(--calendar_shadow, var(--bds-shadow_s));
|
|
13
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--calendar_shadow, var(--bds-shadow_s));
|
|
16
14
|
inline-size: 20rem;
|
|
17
15
|
}
|
|
18
16
|
|
|
@@ -107,8 +105,7 @@
|
|
|
107
105
|
--bdc_color: var(--bds-color_interactive);
|
|
108
106
|
|
|
109
107
|
border: var(--calendar_today-border, none);
|
|
110
|
-
|
|
111
|
-
outline-offset: var(--bdc-outline_offset);
|
|
108
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
112
109
|
}
|
|
113
110
|
|
|
114
111
|
.selected {
|
|
@@ -39,12 +39,10 @@
|
|
|
39
39
|
--bdc_color: var(--bds-color_on-bg);
|
|
40
40
|
|
|
41
41
|
border: none;
|
|
42
|
-
|
|
43
|
-
outline-offset: var(--bdc-outline_offset);
|
|
42
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--bds-shadow_s);
|
|
44
43
|
cursor: pointer;
|
|
45
44
|
flex-shrink: 0;
|
|
46
45
|
transition: var(--bds-animation_transition);
|
|
47
|
-
box-shadow: var(--bds-shadow_s);
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
.navBtn svg {
|
|
@@ -57,8 +57,7 @@
|
|
|
57
57
|
transition: var(--bds-animation_transition);
|
|
58
58
|
--bdc_color: currentcolor;
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
outline-offset: var(--bdc-outline_offset);
|
|
60
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
.dismiss svg {
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
--bdc_color: var(--btn_border, var(--bds-color_bg--subtle));
|
|
28
28
|
|
|
29
29
|
border: none;
|
|
30
|
-
|
|
31
|
-
outline-offset: var(--bdc-outline_offset);
|
|
30
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
32
31
|
color: var(--btn_color, var(--bds-color_on-bg));
|
|
33
32
|
font-family: var(--bds-font_family--body);
|
|
34
33
|
font-size: var(--bds-font_size--body);
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
--bdc_color: var(--color_focus, var(--bds-color_interactive));
|
|
16
16
|
|
|
17
17
|
border: var(--skip-link_border, none);
|
|
18
|
-
|
|
19
|
-
outline-offset: var(--bdc-outline_offset);
|
|
18
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
20
19
|
transform: translateY(-200%);
|
|
21
20
|
transition: transform var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
22
21
|
}
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
--bdc_color: var(--bds-color_bg--subtle);
|
|
7
7
|
--bdc-outline_radius: var(--bds-border_radius--s);
|
|
8
8
|
|
|
9
|
-
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
10
|
-
outline-offset: var(--bdc-outline_offset);
|
|
11
9
|
border-radius: var(--table_radius, var(--bdc-outline_radius));
|
|
10
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
.table {
|
package/src/css/bdc.css
CHANGED
|
@@ -38,11 +38,12 @@
|
|
|
38
38
|
initial-value: 0;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
/* '*' syntax cannot be interpolated
|
|
41
|
+
/* '*' syntax cannot be interpolated; use a transparent shadow (not 'none') so it
|
|
42
|
+
can safely appear as the trailing item in a comma-separated box-shadow list. */
|
|
42
43
|
@property --bdc-outline_shadow {
|
|
43
44
|
syntax: '*';
|
|
44
45
|
inherits: false;
|
|
45
|
-
initial-value:
|
|
46
|
+
initial-value: 0 0 0 0 transparent;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
@layer component {
|
|
@@ -56,19 +57,23 @@
|
|
|
56
57
|
--bdc_color--error: var(--bds-color_error);
|
|
57
58
|
|
|
58
59
|
/* Active / selected state colours — override these to theme all filled form controls globally */
|
|
59
|
-
--bdc-color_active: var(--bds-
|
|
60
|
-
--bdc-color_on-active: var(--bds-color_on-
|
|
61
|
-
--bdc-color_active--subtle: var(--bds-
|
|
62
|
-
--bdc-color_on-active--subtle: var(--bds-color_on-
|
|
63
|
-
--bdc-color_active--strong: var(--bds-
|
|
64
|
-
--bdc-color_on-active--strong: var(--bds-color_on-
|
|
60
|
+
--bdc-color_active: var(--bds-color_interactive);
|
|
61
|
+
--bdc-color_on-active: var(--bds-color_on-interactive);
|
|
62
|
+
--bdc-color_active--subtle: var(--bds-color_blue--subtle);
|
|
63
|
+
--bdc-color_on-active--subtle: var(--bds-color_on-blue--subtle);
|
|
64
|
+
--bdc-color_active--strong: var(--bds-color_interactive_on-bg);
|
|
65
|
+
--bdc-color_on-active--strong: var(--bds-color_on-blue--strong);
|
|
65
66
|
|
|
66
67
|
/* Outline geometry */
|
|
67
68
|
--bdc-outline_width: 1px;
|
|
68
|
-
--bdc-outline_offset: -1px; /*
|
|
69
|
+
--bdc-outline_offset: -1px; /* available for consumer use; bdc borders now use inset box-shadow */
|
|
69
70
|
--bdc-outline_radius: var(--bds-border_radius--xs);
|
|
70
71
|
|
|
71
|
-
/* Shadow: opt-in
|
|
72
|
-
--bdc-outline_shadow:
|
|
72
|
+
/* Shadow: opt-in; transparent (not 'none') so it's valid in a comma-separated box-shadow list */
|
|
73
|
+
--bdc-outline_shadow: 0 0 0 0 transparent;
|
|
74
|
+
|
|
75
|
+
/* Focus-visible ring — solid interactive colour, replaces foundation's dotted grey default */
|
|
76
|
+
--bds-outline_default: 2px solid var(--bds-color_interactive);
|
|
77
|
+
--bds-outline_offset: 2px;
|
|
73
78
|
}
|
|
74
79
|
}
|
package/src/index.ts
CHANGED
|
@@ -56,7 +56,7 @@ export { Radio } from './components/interaction/form/Radio';
|
|
|
56
56
|
export { RadioGroup } from './components/interaction/form/RadioGroup';
|
|
57
57
|
export type { RadioGroupProps } from './components/interaction/form/RadioGroup';
|
|
58
58
|
export { SegmentedControl } from './components/interaction/form/SegmentedControl';
|
|
59
|
-
export type { SegmentedControlProps
|
|
59
|
+
export type { SegmentedControlProps } from './components/interaction/form/SegmentedControl';
|
|
60
60
|
export { Select } from './components/interaction/form/Select';
|
|
61
61
|
export type { SelectOption } from './components/interaction/form/Select';
|
|
62
62
|
export { Slider } from './components/interaction/form/Slider';
|
|
@@ -33,7 +33,7 @@ const bdcCss = `
|
|
|
33
33
|
@property --bdc-outline_shadow {
|
|
34
34
|
syntax: '*';
|
|
35
35
|
inherits: false;
|
|
36
|
-
initial-value:
|
|
36
|
+
initial-value: 0 0 0 0 transparent;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
@layer component {
|
|
@@ -45,9 +45,9 @@ const bdcCss = `
|
|
|
45
45
|
--bdc_color--error: var(--bds-color_error);
|
|
46
46
|
|
|
47
47
|
--bdc-outline_width: 1px;
|
|
48
|
-
--bdc-outline_offset: -1px;
|
|
48
|
+
--bdc-outline_offset: -1px; /* available for consumer use; bdc borders now use inset box-shadow */
|
|
49
49
|
--bdc-outline_radius: var(--bds-border_radius--xs);
|
|
50
|
-
--bdc-outline_shadow:
|
|
50
|
+
--bdc-outline_shadow: 0 0 0 0 transparent;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
`;
|
|
@@ -10,3 +10,50 @@ export { BdsAlert } from './ui/bds-alert';
|
|
|
10
10
|
// Phase 2 — layout-driven components
|
|
11
11
|
export { BdsPopover } from './interaction/bds-popover';
|
|
12
12
|
export { BdsToastProvider } from './interaction/bds-toast-provider';
|
|
13
|
+
|
|
14
|
+
// Phase 3 — simple UI display
|
|
15
|
+
export { BdsSeparator } from './ui/bds-separator';
|
|
16
|
+
export { BdsSkeleton } from './ui/bds-skeleton';
|
|
17
|
+
export { BdsLoading } from './ui/bds-loading';
|
|
18
|
+
export { BdsAvatar } from './ui/bds-avatar';
|
|
19
|
+
export { BdsTypography } from './ui/bds-typography';
|
|
20
|
+
export { BdsProgress } from './ui/bds-progress';
|
|
21
|
+
export { BdsProgressCircle } from './ui/bds-progress-circle';
|
|
22
|
+
export { BdsRating } from './ui/bds-rating';
|
|
23
|
+
|
|
24
|
+
// Phase 3 — interactive with state
|
|
25
|
+
export { BdsCollapsible } from './interaction/bds-collapsible';
|
|
26
|
+
export { BdsAccordionItem } from './interaction/bds-accordion-item';
|
|
27
|
+
export { BdsAccordion } from './interaction/bds-accordion';
|
|
28
|
+
export { BdsTab } from './interaction/bds-tab';
|
|
29
|
+
export { BdsTabPanel } from './interaction/bds-tab-panel';
|
|
30
|
+
export { BdsTabs } from './interaction/bds-tabs';
|
|
31
|
+
export { BdsTooltip } from './interaction/bds-tooltip';
|
|
32
|
+
export { BdsSkipLink } from './interaction/bds-skip-link';
|
|
33
|
+
|
|
34
|
+
// Phase 4 — modal overlays
|
|
35
|
+
export { BdsDialog } from './interaction/bds-dialog';
|
|
36
|
+
export { BdsDrawer } from './interaction/bds-drawer';
|
|
37
|
+
|
|
38
|
+
// Phase 5 — basic form inputs (ElementInternals)
|
|
39
|
+
export { BdsCheckbox } from './interaction/form/bds-checkbox';
|
|
40
|
+
export { BdsRadio } from './interaction/form/bds-radio';
|
|
41
|
+
export { BdsSwitch } from './interaction/form/bds-switch';
|
|
42
|
+
export { BdsSelect } from './interaction/form/bds-select';
|
|
43
|
+
export { BdsTextarea } from './interaction/form/bds-textarea';
|
|
44
|
+
|
|
45
|
+
// Phase 6 — complex form inputs (ElementInternals)
|
|
46
|
+
export { BdsNumberInput } from './interaction/form/bds-number-input';
|
|
47
|
+
export { BdsSlider } from './interaction/form/bds-slider';
|
|
48
|
+
export { BdsSegmentedControl } from './interaction/form/bds-segmented-control';
|
|
49
|
+
export { BdsFileInput } from './interaction/form/bds-file-input';
|
|
50
|
+
export { BdsCombobox } from './interaction/form/bds-combobox';
|
|
51
|
+
|
|
52
|
+
// Phase 7 — slotted content display
|
|
53
|
+
export { BdsNotificationBanner } from './ui/bds-notification-banner';
|
|
54
|
+
export { BdsCard } from './ui/bds-card';
|
|
55
|
+
export { BdsSectionHeader } from './ui/bds-section-header';
|
|
56
|
+
export { BdsIconWrapper } from './ui/bds-icon-wrapper';
|
|
57
|
+
export { BdsDescriptionList } from './ui/bds-description-list';
|
|
58
|
+
export { BdsBreadcrumb } from './ui/bds-breadcrumb';
|
|
59
|
+
export { BdsLink } from './ui/bds-link';
|