@boostdev/design-system-components 2.7.1 → 2.11.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 +54 -46
- package/README.md +34 -20
- package/dist/client.cjs +1317 -779
- package/dist/client.css +1029 -812
- package/dist/client.d.cts +88 -26
- package/dist/client.d.ts +88 -26
- package/dist/client.js +1278 -732
- package/dist/index.cjs +1317 -779
- package/dist/index.css +1029 -812
- package/dist/index.d.cts +88 -26
- package/dist/index.d.ts +88 -26
- package/dist/index.js +1278 -732
- package/dist/web-components/chunk-2OLVQUBU.js +193 -0
- package/dist/web-components/chunk-3AY2YKCM.js +223 -0
- package/dist/web-components/chunk-3WAV6MDN.js +212 -0
- package/dist/web-components/{chunk-CZBIVR4V.js → chunk-47AT5KZD.js} +88 -16
- package/dist/web-components/chunk-4A2YYTYN.js +93 -0
- package/dist/web-components/{chunk-Q4T5BJT6.js → chunk-62NK3ZSC.js} +18 -3
- package/dist/web-components/chunk-66M6ETWD.js +77 -0
- package/dist/web-components/{chunk-NCPQ7AF3.js → chunk-6G22I2CK.js} +18 -3
- package/dist/web-components/{chunk-QDST57JC.js → chunk-7ZOJ7N4E.js} +14 -4
- package/dist/web-components/{chunk-5R6IFELV.js → chunk-AIBOHNDU.js} +11 -1
- package/dist/web-components/{chunk-ITHLKR7Q.js → chunk-AP4RDUL2.js} +16 -5
- package/dist/web-components/{chunk-QWPACK5L.js → chunk-BPYKZVDK.js} +11 -1
- package/dist/web-components/{chunk-YLVTEY23.js → chunk-BTCMJQKB.js} +53 -21
- package/dist/web-components/chunk-CUKQ2L5B.js +245 -0
- package/dist/web-components/chunk-DIZDCL7Z.js +14 -0
- package/dist/web-components/{chunk-PC3IOQAH.js → chunk-DV5T43ZC.js} +27 -7
- package/dist/web-components/{chunk-2QA62WCQ.js → chunk-EF7IVYTY.js} +10 -0
- package/dist/web-components/{chunk-L3XHOMN6.js → chunk-F3ZDNHZZ.js} +26 -1
- package/dist/web-components/chunk-FEDABOR5.js +248 -0
- package/dist/web-components/{chunk-6I2DBFQ7.js → chunk-HGFCJXOQ.js} +36 -5
- package/dist/web-components/{chunk-SOQQ7RVJ.js → chunk-IPGHUCJT.js} +23 -8
- package/dist/web-components/chunk-ITD2MV5K.js +392 -0
- package/dist/web-components/{chunk-CM3KYZ6Z.js → chunk-JH6LQKLK.js} +78 -6
- package/dist/web-components/chunk-JMCXAAFK.js +120 -0
- package/dist/web-components/{chunk-KUI55GFB.js → chunk-JUPCZVVW.js} +50 -18
- package/dist/web-components/chunk-JV5QT2OU.js +146 -0
- package/dist/web-components/{chunk-3GFWLSLS.js → chunk-KA3VPKMY.js} +29 -6
- package/dist/web-components/{chunk-CR5PGUHV.js → chunk-KJGRFDFI.js} +26 -11
- package/dist/web-components/{chunk-PY62FTRW.js → chunk-KZPRFY5P.js} +68 -33
- package/dist/web-components/{chunk-X46KL5BK.js → chunk-LDIPCTRN.js} +18 -1
- package/dist/web-components/chunk-M3ECULRH.js +174 -0
- package/dist/web-components/chunk-NBN2ENWJ.js +90 -0
- package/dist/web-components/chunk-NIN3JO6Q.js +189 -0
- package/dist/web-components/{chunk-2FGATTGT.js → chunk-NTQ4TCUT.js} +76 -55
- package/dist/web-components/chunk-OY74D4X6.js +302 -0
- package/dist/web-components/{chunk-3S42DZ7W.js → chunk-P24JYC5V.js} +7 -0
- package/dist/web-components/{chunk-BKIHQYJR.js → chunk-PXPPKCLT.js} +17 -2
- package/dist/web-components/{chunk-TQ7IQ4GZ.js → chunk-QEF2IRID.js} +71 -29
- package/dist/web-components/chunk-QZAIRJ75.js +111 -0
- package/dist/web-components/{chunk-6I3CFC26.js → chunk-RSZ3BWBK.js} +20 -5
- package/dist/web-components/chunk-RVF7W653.js +101 -0
- package/dist/web-components/chunk-SEO2F5KJ.js +234 -0
- package/dist/web-components/{chunk-VMMVWLXL.js → chunk-SFZ6Q4BP.js} +10 -0
- package/dist/web-components/{chunk-LY62SAVN.js → chunk-SYNLFKD3.js} +12 -2
- package/dist/web-components/chunk-TMWXRHGF.js +192 -0
- package/dist/web-components/{chunk-65JXQOBA.js → chunk-U3YZE6R6.js} +51 -7
- package/dist/web-components/chunk-UO7ROSHD.js +424 -0
- package/dist/web-components/chunk-VANAKB6D.js +152 -0
- package/dist/web-components/{chunk-PXZWYO6Z.js → chunk-VED2DFJ6.js} +108 -29
- package/dist/web-components/chunk-W6H5ID2U.js +161 -0
- package/dist/web-components/{chunk-57TRNCWQ.js → chunk-WFVKU4GX.js} +22 -11
- package/dist/web-components/{chunk-OQTRTMAB.js → chunk-WIBAN7KP.js} +10 -0
- package/dist/web-components/chunk-XI7KRAH7.js +54 -0
- package/dist/web-components/{chunk-F5E3IT7G.js → chunk-XIZWAWMJ.js} +50 -11
- package/dist/web-components/{chunk-FXURM6D5.js → chunk-YFAXGRPR.js} +10 -0
- package/dist/web-components/globals.js +1 -1
- package/dist/web-components/index.d.ts +77 -707
- package/dist/web-components/index.js +339 -2066
- package/dist/web-components/interaction/bds-accordion-item.js +1 -1
- package/dist/web-components/interaction/bds-accordion.js +1 -1
- package/dist/web-components/interaction/bds-button.d.ts +10 -2
- package/dist/web-components/interaction/bds-button.js +1 -1
- package/dist/web-components/interaction/bds-collapsible.d.ts +7 -2
- package/dist/web-components/interaction/bds-collapsible.js +1 -1
- package/dist/web-components/interaction/bds-dialog.d.ts +11 -3
- package/dist/web-components/interaction/bds-dialog.js +1 -1
- package/dist/web-components/interaction/bds-drawer.d.ts +7 -1
- package/dist/web-components/interaction/bds-drawer.js +1 -1
- package/dist/web-components/interaction/bds-dropdown-menu-item.d.ts +51 -0
- package/dist/web-components/interaction/bds-dropdown-menu-item.js +7 -0
- package/dist/web-components/interaction/bds-dropdown-menu.d.ts +70 -0
- package/dist/web-components/interaction/bds-dropdown-menu.js +7 -0
- package/dist/web-components/interaction/bds-popover.d.ts +14 -3
- package/dist/web-components/interaction/bds-popover.js +1 -1
- package/dist/web-components/interaction/bds-skip-link.js +1 -1
- package/dist/web-components/interaction/bds-tab-panel.js +1 -1
- package/dist/web-components/interaction/bds-tab.js +1 -1
- package/dist/web-components/interaction/bds-tabs.d.ts +1 -0
- package/dist/web-components/interaction/bds-tabs.js +1 -1
- package/dist/web-components/interaction/bds-toast-provider.js +1 -1
- package/dist/web-components/interaction/bds-tooltip.d.ts +19 -3
- package/dist/web-components/interaction/bds-tooltip.js +1 -1
- package/dist/web-components/interaction/form/bds-checkbox-group.d.ts +83 -0
- package/dist/web-components/interaction/form/bds-checkbox-group.js +7 -0
- package/dist/web-components/interaction/form/bds-checkbox.d.ts +6 -0
- package/dist/web-components/interaction/form/bds-checkbox.js +1 -1
- package/dist/web-components/interaction/form/bds-combobox.d.ts +18 -0
- package/dist/web-components/interaction/form/bds-combobox.js +1 -1
- package/dist/web-components/interaction/form/bds-field-group.d.ts +89 -0
- package/dist/web-components/interaction/form/bds-field-group.js +7 -0
- package/dist/web-components/interaction/form/bds-file-input.d.ts +1 -1
- package/dist/web-components/interaction/form/bds-file-input.js +1 -1
- package/dist/web-components/interaction/form/bds-form-input.d.ts +92 -0
- package/dist/web-components/interaction/form/bds-form-input.js +7 -0
- package/dist/web-components/interaction/form/bds-number-input.d.ts +18 -1
- package/dist/web-components/interaction/form/bds-number-input.js +1 -1
- package/dist/web-components/interaction/form/bds-radio-group.d.ts +81 -0
- package/dist/web-components/interaction/form/bds-radio-group.js +7 -0
- package/dist/web-components/interaction/form/bds-radio.d.ts +34 -6
- package/dist/web-components/interaction/form/bds-radio.js +1 -1
- package/dist/web-components/interaction/form/bds-segmented-control.d.ts +4 -4
- package/dist/web-components/interaction/form/bds-segmented-control.js +1 -1
- package/dist/web-components/interaction/form/bds-select.d.ts +22 -1
- package/dist/web-components/interaction/form/bds-select.js +1 -1
- package/dist/web-components/interaction/form/bds-slider.d.ts +42 -10
- package/dist/web-components/interaction/form/bds-slider.js +1 -1
- package/dist/web-components/interaction/form/bds-switch.d.ts +20 -0
- package/dist/web-components/interaction/form/bds-switch.js +1 -1
- package/dist/web-components/interaction/form/bds-textarea.d.ts +23 -3
- package/dist/web-components/interaction/form/bds-textarea.js +1 -1
- package/dist/web-components/layout/bds-grid-item.d.ts +63 -0
- package/dist/web-components/layout/bds-grid-item.js +7 -0
- package/dist/web-components/layout/bds-grid.d.ts +108 -0
- package/dist/web-components/layout/bds-grid.js +7 -0
- package/dist/web-components/ui/bds-alert.d.ts +16 -2
- package/dist/web-components/ui/bds-alert.js +1 -1
- package/dist/web-components/ui/bds-avatar.d.ts +2 -1
- package/dist/web-components/ui/bds-avatar.js +1 -1
- package/dist/web-components/ui/bds-badge.js +1 -1
- package/dist/web-components/ui/bds-breadcrumb.d.ts +3 -1
- package/dist/web-components/ui/bds-breadcrumb.js +1 -1
- package/dist/web-components/ui/bds-button-container.d.ts +52 -0
- package/dist/web-components/ui/bds-button-container.js +7 -0
- package/dist/web-components/ui/bds-button-group.d.ts +21 -0
- package/dist/web-components/ui/bds-button-group.js +8 -0
- package/dist/web-components/ui/bds-calendar.d.ts +121 -0
- package/dist/web-components/ui/bds-calendar.js +7 -0
- package/dist/web-components/ui/bds-card.d.ts +12 -3
- package/dist/web-components/ui/bds-card.js +1 -1
- package/dist/web-components/ui/bds-carousel.d.ts +98 -0
- package/dist/web-components/ui/bds-carousel.js +7 -0
- package/dist/web-components/ui/bds-description-list.js +1 -1
- package/dist/web-components/ui/bds-icon-wrapper.d.ts +0 -9
- package/dist/web-components/ui/bds-icon-wrapper.js +1 -1
- package/dist/web-components/ui/bds-link.js +1 -1
- package/dist/web-components/ui/bds-loading.js +1 -1
- package/dist/web-components/ui/bds-notification-banner.js +1 -1
- package/dist/web-components/ui/bds-pagination.d.ts +47 -0
- package/dist/web-components/ui/bds-pagination.js +7 -0
- package/dist/web-components/ui/bds-progress-circle.d.ts +3 -1
- package/dist/web-components/ui/bds-progress-circle.js +1 -1
- package/dist/web-components/ui/bds-progress.d.ts +3 -1
- package/dist/web-components/ui/bds-progress.js +1 -1
- package/dist/web-components/ui/bds-rating.js +1 -1
- package/dist/web-components/ui/bds-section-header.d.ts +18 -4
- package/dist/web-components/ui/bds-section-header.js +1 -1
- package/dist/web-components/ui/bds-separator.js +1 -1
- package/dist/web-components/ui/bds-skeleton.js +1 -1
- package/dist/web-components/ui/bds-table.d.ts +52 -0
- package/dist/web-components/ui/bds-table.js +7 -0
- package/dist/web-components/ui/bds-typography.d.ts +1 -0
- package/dist/web-components/ui/bds-typography.js +1 -1
- package/package.json +60 -3
- package/src/components/interaction/Button/Button.module.css +23 -14
- package/src/components/interaction/Button/Button.spec.tsx +20 -0
- package/src/components/interaction/Button/Button.tsx +2 -2
- package/src/components/interaction/Command/Command.mdx +5 -2
- package/src/components/interaction/Command/Command.module.css +23 -7
- package/src/components/interaction/Command/Command.spec.tsx +35 -0
- package/src/components/interaction/Command/Command.tsx +15 -4
- package/src/components/interaction/Command/index.ts +1 -1
- package/src/components/interaction/Dialog/Dialog.mdx +4 -4
- package/src/components/interaction/Dialog/Dialog.module.css +20 -0
- package/src/components/interaction/Dialog/Dialog.spec.tsx +20 -0
- package/src/components/interaction/Dialog/Dialog.tsx +8 -3
- package/src/components/interaction/Dialog/index.ts +1 -0
- package/src/components/interaction/Drawer/Drawer.mdx +5 -2
- package/src/components/interaction/Drawer/Drawer.module.css +34 -3
- package/src/components/interaction/Drawer/Drawer.spec.tsx +67 -1
- package/src/components/interaction/Drawer/Drawer.tsx +30 -12
- package/src/components/interaction/Drawer/index.ts +1 -0
- package/src/components/interaction/DropdownMenu/DropdownMenu.mdx +2 -0
- package/src/components/interaction/DropdownMenu/DropdownMenu.spec.tsx +34 -0
- package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +15 -5
- package/src/components/interaction/DropdownMenu/index.ts +1 -0
- package/src/components/interaction/Popover/Popover.mdx +6 -2
- package/src/components/interaction/Popover/Popover.module.css +26 -18
- package/src/components/interaction/Popover/Popover.spec.tsx +38 -0
- package/src/components/interaction/Popover/Popover.tsx +19 -5
- package/src/components/interaction/Popover/index.ts +1 -0
- package/src/components/interaction/Rating/Rating.mdx +1 -1
- package/src/components/interaction/Rating/Rating.module.css +2 -2
- package/src/components/interaction/Rating/Rating.tsx +1 -1
- package/src/components/interaction/Rating/index.ts +1 -0
- package/src/components/interaction/Toast/Toast.mdx +3 -0
- package/src/components/interaction/Toast/Toast.module.css +35 -5
- package/src/components/interaction/Toast/Toast.spec.tsx +69 -1
- package/src/components/interaction/Toast/Toast.tsx +15 -9
- package/src/components/interaction/form/Checkbox/Checkbox.mdx +3 -0
- package/src/components/interaction/form/Checkbox/Checkbox.module.css +13 -6
- package/src/components/interaction/form/Checkbox/Checkbox.spec.tsx +6 -0
- package/src/components/interaction/form/Checkbox/Checkbox.tsx +1 -1
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.mdx +16 -1
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.module.css +24 -8
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.spec.tsx +32 -2
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx +14 -2
- package/src/components/interaction/form/Combobox/Combobox.mdx +11 -4
- package/src/components/interaction/form/Combobox/Combobox.module.css +6 -6
- package/src/components/interaction/form/Combobox/Combobox.spec.tsx +47 -0
- package/src/components/interaction/form/Combobox/Combobox.tsx +10 -5
- package/src/components/interaction/form/FieldGroup/FieldGroup.mdx +9 -10
- package/src/components/interaction/form/FieldGroup/FieldGroup.module.css +57 -23
- package/src/components/interaction/form/FieldGroup/FieldGroup.spec.tsx +129 -7
- package/src/components/interaction/form/FieldGroup/FieldGroup.tsx +72 -12
- package/src/components/interaction/form/FileInput/FileInput.mdx +9 -1
- package/src/components/interaction/form/FileInput/FileInput.module.css +8 -8
- package/src/components/interaction/form/FileInput/FileInput.spec.tsx +89 -1
- package/src/components/interaction/form/FileInput/FileInput.tsx +6 -2
- package/src/components/interaction/form/FormInput/FormInput.mdx +9 -5
- package/src/components/interaction/form/FormInput/FormInput.module.css +17 -8
- package/src/components/interaction/form/FormInput/FormInput.spec.tsx +20 -0
- package/src/components/interaction/form/FormInput/FormInput.tsx +7 -2
- package/src/components/interaction/form/NumberInput/NumberInput.mdx +5 -1
- package/src/components/interaction/form/NumberInput/NumberInput.module.css +6 -6
- package/src/components/interaction/form/NumberInput/NumberInput.spec.tsx +51 -0
- package/src/components/interaction/form/NumberInput/NumberInput.tsx +36 -8
- package/src/components/interaction/form/Radio/Radio.mdx +8 -1
- package/src/components/interaction/form/Radio/Radio.module.css +20 -7
- package/src/components/interaction/form/Radio/Radio.spec.tsx +15 -0
- package/src/components/interaction/form/Radio/Radio.tsx +10 -4
- package/src/components/interaction/form/RadioGroup/RadioGroup.mdx +16 -1
- package/src/components/interaction/form/RadioGroup/RadioGroup.module.css +24 -8
- package/src/components/interaction/form/RadioGroup/RadioGroup.spec.tsx +32 -2
- package/src/components/interaction/form/RadioGroup/RadioGroup.tsx +14 -2
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.mdx +9 -3
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.module.css +25 -12
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.spec.tsx +86 -5
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.tsx +44 -4
- package/src/components/interaction/form/Select/Select.mdx +10 -4
- package/src/components/interaction/form/Select/Select.module.css +4 -4
- package/src/components/interaction/form/Select/Select.spec.tsx +34 -0
- package/src/components/interaction/form/Select/Select.tsx +21 -9
- package/src/components/interaction/form/Slider/Slider.mdx +4 -1
- package/src/components/interaction/form/Slider/Slider.module.css +32 -8
- package/src/components/interaction/form/Slider/Slider.spec.tsx +29 -0
- package/src/components/interaction/form/Slider/Slider.tsx +9 -7
- package/src/components/interaction/form/Switch/Switch.mdx +2 -2
- package/src/components/interaction/form/Switch/Switch.module.css +12 -13
- package/src/components/interaction/form/Switch/Switch.spec.tsx +20 -0
- package/src/components/interaction/form/Switch/Switch.tsx +2 -1
- package/src/components/interaction/form/Textarea/Textarea.mdx +5 -0
- package/src/components/interaction/form/Textarea/Textarea.module.css +5 -5
- package/src/components/interaction/form/Textarea/Textarea.spec.tsx +13 -0
- package/src/components/interaction/form/Textarea/Textarea.tsx +3 -1
- package/src/components/interaction/form/atoms/Message.module.css +1 -1
- package/src/components/interaction/form/atoms/Message.spec.tsx +29 -0
- package/src/components/interaction/form/atoms/Message.tsx +1 -1
- package/src/components/layout/ButtonGroup/ButtonGroup.mdx +11 -0
- package/src/components/layout/ButtonGroup/ButtonGroup.module.css +1 -5
- package/src/components/layout/ButtonGroup/ButtonGroup.stories.tsx +14 -0
- package/src/components/layout/Card/Card.mdx +6 -1
- package/src/components/layout/Card/Card.module.css +26 -5
- package/src/components/layout/Card/Card.spec.tsx +7 -0
- package/src/components/layout/Card/Card.tsx +4 -3
- package/src/components/layout/Grid/Grid.spec.tsx +44 -0
- package/src/components/layout/Grid/Grid.tsx +5 -5
- package/src/components/layout/Grid/GridItem.tsx +6 -6
- package/src/components/layout/Grid/masonry.ts +31 -5
- package/src/components/layout/Grid/useIsomorphicLayoutEffect.ts +11 -0
- package/src/components/layout/IconWrapper/IconWrapper.mdx +8 -2
- package/src/components/layout/IconWrapper/IconWrapper.module.css +9 -6
- package/src/components/layout/SectionHeader/SectionHeader.mdx +4 -1
- package/src/components/layout/SectionHeader/SectionHeader.module.css +10 -9
- package/src/components/ui/Accordion/Accordion.mdx +4 -1
- package/src/components/ui/Accordion/Accordion.module.css +2 -1
- package/src/components/ui/Alert/Alert.mdx +21 -4
- package/src/components/ui/Alert/Alert.module.css +9 -4
- package/src/components/ui/Alert/Alert.spec.tsx +20 -0
- package/src/components/ui/Avatar/Avatar.mdx +8 -3
- package/src/components/ui/Avatar/Avatar.module.css +13 -8
- package/src/components/ui/Badge/Badge.mdx +3 -1
- package/src/components/ui/Breadcrumb/Breadcrumb.mdx +3 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.module.css +4 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.spec.tsx +12 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +11 -3
- package/src/components/ui/Calendar/Calendar.mdx +6 -0
- package/src/components/ui/Calendar/Calendar.module.css +68 -19
- package/src/components/ui/Calendar/Calendar.spec.tsx +139 -24
- package/src/components/ui/Calendar/Calendar.stories.tsx +14 -0
- package/src/components/ui/Calendar/Calendar.tsx +143 -154
- package/src/components/ui/Calendar/CalendarRange.mdx +39 -0
- package/src/components/ui/Calendar/CalendarRange.spec.tsx +119 -0
- package/src/components/ui/Calendar/CalendarRange.stories.tsx +51 -0
- package/src/components/ui/Calendar/CalendarRange.tsx +213 -0
- package/src/components/ui/Calendar/MonthGrid.tsx +141 -0
- package/src/components/ui/Calendar/calendar-core.spec.ts +176 -0
- package/src/components/ui/Calendar/calendar-core.ts +164 -0
- package/src/components/ui/Calendar/index.ts +1 -0
- package/src/components/ui/Carousel/Carousel.mdx +8 -3
- package/src/components/ui/Carousel/Carousel.module.css +7 -5
- package/src/components/ui/Carousel/Carousel.spec.tsx +67 -0
- package/src/components/ui/Carousel/Carousel.tsx +19 -7
- package/src/components/ui/Collapsible/Collapsible.mdx +17 -6
- package/src/components/ui/Collapsible/Collapsible.module.css +7 -2
- package/src/components/ui/Collapsible/Collapsible.spec.tsx +40 -0
- package/src/components/ui/Collapsible/Collapsible.tsx +19 -2
- package/src/components/ui/DescriptionList/DescriptionList.mdx +2 -0
- package/src/components/ui/Link/Link.mdx +4 -2
- package/src/components/ui/Loading/Loading.mdx +6 -3
- package/src/components/ui/Loading/Loading.module.css +7 -7
- package/src/components/ui/Loading/Loading.spec.tsx +12 -0
- package/src/components/ui/Loading/Loading.tsx +8 -3
- package/src/components/ui/NotificationBanner/NotificationBanner.mdx +4 -0
- package/src/components/ui/NotificationBanner/NotificationBanner.module.css +5 -0
- package/src/components/ui/NotificationBanner/NotificationBanner.spec.tsx +20 -0
- package/src/components/ui/Pagination/Pagination.mdx +29 -7
- package/src/components/ui/Pagination/Pagination.module.css +15 -14
- package/src/components/ui/Progress/Progress.mdx +6 -2
- package/src/components/ui/Progress/Progress.module.css +1 -1
- package/src/components/ui/Progress/Progress.spec.tsx +17 -0
- package/src/components/ui/Progress/Progress.tsx +2 -2
- package/src/components/ui/ProgressCircle/ProgressCircle.mdx +8 -4
- package/src/components/ui/ProgressCircle/ProgressCircle.module.css +2 -2
- package/src/components/ui/ProgressCircle/ProgressCircle.spec.tsx +11 -1
- package/src/components/ui/ProgressCircle/ProgressCircle.tsx +1 -1
- package/src/components/ui/Separator/Separator.mdx +7 -0
- package/src/components/ui/Separator/Separator.module.css +1 -0
- package/src/components/ui/Skeleton/Skeleton.mdx +17 -0
- package/src/components/ui/Skeleton/Skeleton.module.css +12 -5
- package/src/components/ui/SkipLink/SkipLink.mdx +19 -0
- package/src/components/ui/SkipLink/SkipLink.module.css +8 -7
- package/src/components/ui/SkipLink/SkipLink.spec.tsx +28 -0
- package/src/components/ui/Table/Table.mdx +14 -0
- package/src/components/ui/Table/Table.module.css +13 -8
- package/src/components/ui/Table/Table.spec.tsx +56 -0
- package/src/components/ui/Table/Table.tsx +44 -6
- package/src/components/ui/Tabs/Tabs.mdx +16 -0
- package/src/components/ui/Tabs/Tabs.module.css +3 -3
- package/src/components/ui/Tabs/Tabs.spec.tsx +20 -0
- package/src/components/ui/Tabs/Tabs.tsx +5 -1
- package/src/components/ui/Tooltip/Tooltip.mdx +9 -0
- package/src/components/ui/Tooltip/Tooltip.module.css +32 -12
- package/src/components/ui/Tooltip/Tooltip.spec.tsx +56 -0
- package/src/components/ui/Tooltip/Tooltip.tsx +26 -7
- package/src/components/ui/Typography/Typography.mdx +7 -0
- package/src/components/ui/Typography/Typography.module.css +5 -5
- package/src/index.ts +7 -3
- package/src/stories/DesignSystem/Borders.mdx +14 -9
- package/src/stories/DesignSystem/Colors.mdx +43 -41
- package/src/stories/DesignSystem/Overview.mdx +4 -3
- package/src/stories/Introduction.mdx +5 -5
- package/src/web-components/globals.ts +7 -0
- package/src/web-components/index.ts +2 -0
- package/src/web-components/interaction/BdsAccordion.mdx +10 -1
- package/src/web-components/interaction/BdsButton.mdx +15 -4
- package/src/web-components/interaction/BdsButton.stories.tsx +1 -1
- package/src/web-components/interaction/BdsCollapsible.mdx +3 -3
- package/src/web-components/interaction/BdsDialog.mdx +12 -7
- package/src/web-components/interaction/BdsDialog.stories.tsx +2 -2
- package/src/web-components/interaction/BdsDrawer.mdx +9 -6
- package/src/web-components/interaction/BdsDropdownMenu.mdx +20 -1
- package/src/web-components/interaction/BdsPopover.mdx +7 -3
- package/src/web-components/interaction/BdsSkipLink.mdx +14 -1
- package/src/web-components/interaction/BdsTabs.mdx +18 -1
- package/src/web-components/interaction/BdsToastProvider.mdx +21 -3
- package/src/web-components/interaction/BdsTooltip.mdx +4 -4
- package/src/web-components/interaction/bds-accordion-item.ts +10 -0
- package/src/web-components/interaction/bds-accordion.spec.ts +41 -0
- package/src/web-components/interaction/bds-accordion.ts +28 -2
- package/src/web-components/interaction/bds-button.spec.ts +81 -0
- package/src/web-components/interaction/bds-button.ts +60 -13
- package/src/web-components/interaction/bds-collapsible.spec.ts +93 -2
- package/src/web-components/interaction/bds-collapsible.ts +49 -7
- package/src/web-components/interaction/bds-dialog.spec.ts +49 -0
- package/src/web-components/interaction/bds-dialog.ts +68 -11
- package/src/web-components/interaction/bds-drawer.spec.ts +93 -4
- package/src/web-components/interaction/bds-drawer.ts +54 -21
- package/src/web-components/interaction/bds-dropdown-menu-item.ts +12 -1
- package/src/web-components/interaction/bds-dropdown-menu.spec.ts +63 -0
- package/src/web-components/interaction/bds-dropdown-menu.ts +45 -7
- package/src/web-components/interaction/bds-popover.spec.ts +80 -6
- package/src/web-components/interaction/bds-popover.ts +83 -32
- package/src/web-components/interaction/bds-skip-link.spec.ts +18 -0
- package/src/web-components/interaction/bds-skip-link.ts +29 -8
- package/src/web-components/interaction/bds-tab-panel.ts +10 -0
- package/src/web-components/interaction/bds-tab.spec.ts +25 -0
- package/src/web-components/interaction/bds-tab.ts +20 -5
- package/src/web-components/interaction/bds-tabs.spec.ts +92 -5
- package/src/web-components/interaction/bds-tabs.ts +42 -1
- package/src/web-components/interaction/bds-toast-provider.spec.ts +43 -0
- package/src/web-components/interaction/bds-toast-provider.ts +50 -21
- package/src/web-components/interaction/bds-tooltip.spec.ts +71 -0
- package/src/web-components/interaction/bds-tooltip.ts +100 -5
- package/src/web-components/interaction/form/BdsCheckbox.mdx +20 -1
- package/src/web-components/interaction/form/BdsCheckbox.stories.tsx +8 -0
- package/src/web-components/interaction/form/BdsCheckboxGroup.mdx +4 -3
- package/src/web-components/interaction/form/BdsCombobox.mdx +39 -2
- package/src/web-components/interaction/form/BdsCombobox.stories.tsx +31 -0
- package/src/web-components/interaction/form/BdsFieldGroup.mdx +8 -3
- package/src/web-components/interaction/form/BdsFieldGroup.stories.tsx +1 -1
- package/src/web-components/interaction/form/BdsFileInput.mdx +26 -5
- package/src/web-components/interaction/form/BdsFormInput.mdx +16 -1
- package/src/web-components/interaction/form/BdsNumberInput.mdx +34 -2
- package/src/web-components/interaction/form/BdsNumberInput.stories.tsx +27 -3
- package/src/web-components/interaction/form/BdsRadio.mdx +39 -12
- package/src/web-components/interaction/form/BdsRadio.stories.tsx +26 -0
- package/src/web-components/interaction/form/BdsRadioGroup.mdx +9 -4
- package/src/web-components/interaction/form/BdsSegmentedControl.mdx +37 -11
- package/src/web-components/interaction/form/BdsSelect.mdx +22 -4
- package/src/web-components/interaction/form/BdsSelect.stories.tsx +33 -0
- package/src/web-components/interaction/form/BdsSlider.mdx +36 -19
- package/src/web-components/interaction/form/BdsSlider.stories.tsx +24 -0
- package/src/web-components/interaction/form/BdsSwitch.mdx +38 -11
- package/src/web-components/interaction/form/BdsSwitch.stories.tsx +16 -0
- package/src/web-components/interaction/form/BdsTextarea.mdx +42 -16
- package/src/web-components/interaction/form/BdsTextarea.stories.tsx +21 -0
- package/src/web-components/interaction/form/bds-checkbox-group.spec.ts +99 -0
- package/src/web-components/interaction/form/bds-checkbox-group.ts +95 -9
- package/src/web-components/interaction/form/bds-checkbox.spec.ts +55 -0
- package/src/web-components/interaction/form/bds-checkbox.ts +30 -5
- package/src/web-components/interaction/form/bds-combobox.spec.ts +79 -0
- package/src/web-components/interaction/form/bds-combobox.ts +102 -17
- package/src/web-components/interaction/form/bds-field-group.spec.ts +158 -0
- package/src/web-components/interaction/form/bds-field-group.ts +167 -23
- package/src/web-components/interaction/form/bds-file-input.spec.ts +73 -5
- package/src/web-components/interaction/form/bds-file-input.ts +71 -34
- package/src/web-components/interaction/form/bds-form-input.spec.ts +22 -0
- package/src/web-components/interaction/form/bds-form-input.ts +27 -16
- package/src/web-components/interaction/form/bds-number-input.spec.ts +49 -0
- package/src/web-components/interaction/form/bds-number-input.ts +118 -29
- package/src/web-components/interaction/form/bds-radio-group.spec.ts +57 -0
- package/src/web-components/interaction/form/bds-radio-group.ts +60 -12
- package/src/web-components/interaction/form/bds-radio.spec.ts +123 -0
- package/src/web-components/interaction/form/bds-radio.ts +136 -23
- package/src/web-components/interaction/form/bds-segmented-control.spec.ts +55 -0
- package/src/web-components/interaction/form/bds-segmented-control.ts +81 -59
- package/src/web-components/interaction/form/bds-select.spec.ts +57 -0
- package/src/web-components/interaction/form/bds-select.ts +96 -8
- package/src/web-components/interaction/form/bds-slider.spec.ts +83 -0
- package/src/web-components/interaction/form/bds-slider.ts +181 -33
- package/src/web-components/interaction/form/bds-switch.spec.ts +68 -0
- package/src/web-components/interaction/form/bds-switch.ts +142 -41
- package/src/web-components/interaction/form/bds-textarea.spec.ts +71 -0
- package/src/web-components/interaction/form/bds-textarea.ts +109 -8
- package/src/web-components/layout/BdsGrid.mdx +6 -2
- package/src/web-components/layout/BdsGrid.stories.tsx +4 -0
- package/src/web-components/layout/bds-grid-item.spec.ts +21 -0
- package/src/web-components/layout/bds-grid-item.ts +17 -3
- package/src/web-components/layout/bds-grid.spec.ts +98 -0
- package/src/web-components/layout/bds-grid.ts +139 -19
- package/src/web-components/ui/BdsAlert.mdx +6 -5
- package/src/web-components/ui/BdsAlert.stories.tsx +6 -6
- package/src/web-components/ui/BdsAvatar.mdx +4 -2
- package/src/web-components/ui/BdsBreadcrumb.mdx +3 -2
- package/src/web-components/ui/BdsButtonContainer.mdx +64 -0
- package/src/web-components/ui/BdsButtonContainer.stories.tsx +84 -0
- package/src/web-components/ui/BdsCalendar.mdx +29 -4
- package/src/web-components/ui/BdsCalendar.stories.tsx +16 -18
- package/src/web-components/ui/BdsCalendarRange.mdx +71 -0
- package/src/web-components/ui/BdsCalendarRange.stories.tsx +31 -0
- package/src/web-components/ui/BdsCard.mdx +7 -3
- package/src/web-components/ui/BdsCard.stories.tsx +17 -1
- package/src/web-components/ui/BdsCarousel.mdx +40 -12
- package/src/web-components/ui/BdsDescriptionList.mdx +6 -1
- package/src/web-components/ui/BdsIconWrapper.mdx +3 -2
- package/src/web-components/ui/BdsLink.mdx +14 -2
- package/src/web-components/ui/BdsNotificationBanner.mdx +18 -0
- package/src/web-components/ui/BdsPagination.mdx +40 -1
- package/src/web-components/ui/BdsProgress.mdx +8 -2
- package/src/web-components/ui/BdsProgressCircle.mdx +5 -2
- package/src/web-components/ui/BdsRating.mdx +7 -0
- package/src/web-components/ui/BdsSectionHeader.mdx +22 -3
- package/src/web-components/ui/BdsSectionHeader.stories.tsx +15 -13
- package/src/web-components/ui/BdsTable.mdx +23 -2
- package/src/web-components/ui/BdsTable.stories.tsx +8 -2
- package/src/web-components/ui/BdsTypography.mdx +17 -1
- package/src/web-components/ui/bds-alert.spec.ts +17 -2
- package/src/web-components/ui/bds-alert.ts +31 -5
- package/src/web-components/ui/bds-avatar.spec.ts +29 -0
- package/src/web-components/ui/bds-avatar.ts +30 -12
- package/src/web-components/ui/bds-badge.spec.ts +5 -0
- package/src/web-components/ui/bds-badge.ts +11 -1
- package/src/web-components/ui/bds-breadcrumb.spec.ts +30 -0
- package/src/web-components/ui/bds-breadcrumb.ts +26 -4
- package/src/web-components/ui/bds-button-container.spec.ts +39 -0
- package/src/web-components/ui/bds-button-container.ts +123 -0
- package/src/web-components/ui/bds-button-group.spec.ts +14 -20
- package/src/web-components/ui/bds-button-group.ts +13 -64
- package/src/web-components/ui/bds-calendar-range.spec.ts +123 -0
- package/src/web-components/ui/bds-calendar-range.ts +307 -0
- package/src/web-components/ui/bds-calendar.spec.ts +176 -0
- package/src/web-components/ui/bds-calendar.ts +186 -344
- package/src/web-components/ui/bds-card.spec.ts +32 -0
- package/src/web-components/ui/bds-card.ts +34 -9
- package/src/web-components/ui/bds-carousel.spec.ts +147 -0
- package/src/web-components/ui/bds-carousel.ts +113 -36
- package/src/web-components/ui/bds-description-list.spec.ts +15 -0
- package/src/web-components/ui/bds-description-list.ts +37 -3
- package/src/web-components/ui/bds-icon-wrapper.spec.ts +12 -0
- package/src/web-components/ui/bds-icon-wrapper.ts +16 -15
- package/src/web-components/ui/bds-link.spec.ts +17 -0
- package/src/web-components/ui/bds-link.ts +26 -11
- package/src/web-components/ui/bds-loading.ts +11 -1
- package/src/web-components/ui/bds-notification-banner.spec.ts +13 -0
- package/src/web-components/ui/bds-notification-banner.ts +18 -1
- package/src/web-components/ui/bds-pagination.spec.ts +44 -0
- package/src/web-components/ui/bds-pagination.ts +39 -19
- package/src/web-components/ui/bds-progress-circle.spec.ts +21 -0
- package/src/web-components/ui/bds-progress-circle.ts +17 -5
- package/src/web-components/ui/bds-progress.spec.ts +21 -0
- package/src/web-components/ui/bds-progress.ts +19 -6
- package/src/web-components/ui/bds-rating.spec.ts +6 -0
- package/src/web-components/ui/bds-rating.ts +12 -2
- package/src/web-components/ui/bds-section-header.spec.ts +39 -8
- package/src/web-components/ui/bds-section-header.ts +47 -13
- package/src/web-components/ui/bds-separator.ts +10 -0
- package/src/web-components/ui/bds-skeleton.ts +10 -0
- package/src/web-components/ui/bds-table.spec.ts +63 -0
- package/src/web-components/ui/bds-table.ts +88 -28
- package/src/web-components/ui/bds-typography.spec.ts +47 -0
- package/src/web-components/ui/bds-typography.ts +28 -10
- package/src/web-components/ui/calendar-styles.ts +94 -0
- package/dist/web-components/chunk-5TFWOPLH.js +0 -49
- package/dist/web-components/chunk-7FMR53BW.js +0 -127
- package/dist/web-components/chunk-AGKJTMJI.js +0 -56
- package/dist/web-components/chunk-BQLZ7I4G.js +0 -56
- package/dist/web-components/chunk-IYGF6CD5.js +0 -118
- package/dist/web-components/chunk-QBB6ZX4R.js +0 -107
- package/dist/web-components/chunk-Y3POAKGS.js +0 -133
- package/dist/web-components/chunk-Y4MAXTMA.js +0 -80
- package/dist/web-components/chunk-Y7V7LM6R.js +0 -98
- package/src/web-components/ui/BdsButtonGroup.mdx +0 -69
- package/src/web-components/ui/BdsButtonGroup.stories.tsx +0 -66
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
HTMLAttributes,
|
|
3
|
+
KeyboardEvent,
|
|
4
|
+
ReactElement,
|
|
5
|
+
ReactNode,
|
|
6
|
+
cloneElement,
|
|
7
|
+
isValidElement,
|
|
8
|
+
useId,
|
|
9
|
+
useState,
|
|
10
|
+
} from 'react';
|
|
2
11
|
import css from './Tooltip.module.css';
|
|
3
12
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
13
|
import type { WithClassName } from '../../../types';
|
|
@@ -19,6 +28,15 @@ export function Tooltip({
|
|
|
19
28
|
const tooltipId = useId();
|
|
20
29
|
const [isVisible, setIsVisible] = useState(false);
|
|
21
30
|
|
|
31
|
+
const show = () => setIsVisible(true);
|
|
32
|
+
const hide = () => setIsVisible(false);
|
|
33
|
+
|
|
34
|
+
const handleKeyDown = (event: KeyboardEvent<HTMLSpanElement>) => {
|
|
35
|
+
if (event.key === 'Escape' && isVisible) {
|
|
36
|
+
hide();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
22
40
|
const trigger = isValidElement(children)
|
|
23
41
|
? cloneElement(children as ReactElement<Record<string, unknown>>, {
|
|
24
42
|
'aria-describedby': tooltipId,
|
|
@@ -29,17 +47,18 @@ export function Tooltip({
|
|
|
29
47
|
<span
|
|
30
48
|
{...rest}
|
|
31
49
|
className={cn(css.wrapper, className)}
|
|
32
|
-
onMouseEnter={
|
|
33
|
-
onMouseLeave={
|
|
34
|
-
onFocus={
|
|
35
|
-
onBlur={
|
|
50
|
+
onMouseEnter={show}
|
|
51
|
+
onMouseLeave={hide}
|
|
52
|
+
onFocus={show}
|
|
53
|
+
onBlur={hide}
|
|
54
|
+
onKeyDown={handleKeyDown}
|
|
36
55
|
>
|
|
37
56
|
{trigger}
|
|
38
57
|
<span
|
|
39
58
|
id={tooltipId}
|
|
40
59
|
role="tooltip"
|
|
41
|
-
|
|
42
|
-
className={cn(css.tooltip, css[`--placement_${placement}`])}
|
|
60
|
+
hidden={!isVisible}
|
|
61
|
+
className={cn(css.tooltip, css[`--placement_${placement}`], isVisible && css['--visible'])}
|
|
43
62
|
>
|
|
44
63
|
{content}
|
|
45
64
|
</span>
|
|
@@ -33,6 +33,8 @@ Renders a text element with a design-system variant. Decouples visual style from
|
|
|
33
33
|
|
|
34
34
|
## Props
|
|
35
35
|
|
|
36
|
+
> **HTML attributes** — all standard HTML attributes for the root element are forwarded via `{...rest}` (`id`, `className`, `style`, `data-*`, `aria-*`, event handlers, etc.). Component-controlled attributes take precedence.
|
|
37
|
+
|
|
36
38
|
<ArgTypes of={Stories} />
|
|
37
39
|
|
|
38
40
|
## CSS variables
|
|
@@ -44,6 +46,11 @@ Renders a text element with a design-system variant. Decouples visual style from
|
|
|
44
46
|
</thead>
|
|
45
47
|
<tbody>
|
|
46
48
|
<tr><td>`--typography_color`</td><td>`var(--bds-color_on-bg)`</td><td>Text colour override</td></tr>
|
|
49
|
+
<tr><td>`--typography_font-size--h1`</td><td>`var(--bds-font_size--heading-1)`</td><td>Font size override for the `h1` variant</td></tr>
|
|
50
|
+
<tr><td>`--typography_font-size--h2`</td><td>`var(--bds-font_size--heading-2)`</td><td>Font size override for the `h2` variant</td></tr>
|
|
51
|
+
<tr><td>`--typography_font-size--h3`</td><td>`var(--bds-font_size--heading-3)`</td><td>Font size override for the `h3` variant</td></tr>
|
|
52
|
+
<tr><td>`--typography_font-size--body`</td><td>`var(--bds-font_size--body)`</td><td>Font size override for the `body` variant</td></tr>
|
|
53
|
+
<tr><td>`--typography_font-size--body_s`</td><td>`var(--bds-font_size--body--s)`</td><td>Font size override for the `body_s` variant</td></tr>
|
|
47
54
|
</tbody>
|
|
48
55
|
</table>
|
|
49
56
|
|
|
@@ -7,32 +7,32 @@
|
|
|
7
7
|
|
|
8
8
|
.--h1 {
|
|
9
9
|
font-family: var(--bds-font_family--heading);
|
|
10
|
-
font-size: var(--bds-font_size--heading-1);
|
|
10
|
+
font-size: var(--typography_font-size--h1, var(--bds-font_size--heading-1));
|
|
11
11
|
font-weight: var(--bds-font_weight--bold);
|
|
12
12
|
line-height: var(--bds-font_line-height--heading);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.--h2 {
|
|
16
16
|
font-family: var(--bds-font_family--heading);
|
|
17
|
-
font-size: var(--bds-font_size--heading-2);
|
|
17
|
+
font-size: var(--typography_font-size--h2, var(--bds-font_size--heading-2));
|
|
18
18
|
font-weight: var(--bds-font_weight--semibold);
|
|
19
19
|
line-height: var(--bds-font_line-height--heading);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.--h3 {
|
|
23
23
|
font-family: var(--bds-font_family--heading);
|
|
24
|
-
font-size: var(--bds-font_size--heading-3);
|
|
24
|
+
font-size: var(--typography_font-size--h3, var(--bds-font_size--heading-3));
|
|
25
25
|
font-weight: var(--bds-font_weight--semibold);
|
|
26
26
|
line-height: var(--bds-font_line-height--heading);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.--body {
|
|
30
|
-
font-size: var(--bds-font_size--body);
|
|
30
|
+
font-size: var(--typography_font-size--body, var(--bds-font_size--body));
|
|
31
31
|
line-height: var(--bds-font_line-height--body);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.--body_s {
|
|
35
|
-
font-size: var(--bds-font_size--body--s);
|
|
35
|
+
font-size: var(--typography_font-size--body_s, var(--bds-font_size--body--s));
|
|
36
36
|
line-height: var(--bds-font_line-height--body);
|
|
37
37
|
}
|
|
38
38
|
}
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { Breadcrumb } from './components/ui/Breadcrumb';
|
|
|
10
10
|
export type { BreadcrumbItem } from './components/ui/Breadcrumb';
|
|
11
11
|
export { Collapsible } from './components/ui/Collapsible';
|
|
12
12
|
export type { CollapsibleProps } from './components/ui/Collapsible';
|
|
13
|
-
export { Calendar } from './components/ui/Calendar';
|
|
13
|
+
export { Calendar, CalendarRange } from './components/ui/Calendar';
|
|
14
14
|
export { Carousel } from './components/ui/Carousel';
|
|
15
15
|
export { DescriptionList } from './components/ui/DescriptionList';
|
|
16
16
|
export type { DescriptionItem } from './components/ui/DescriptionList';
|
|
@@ -34,13 +34,17 @@ export { Typography } from './components/ui/Typography';
|
|
|
34
34
|
export { Button } from './components/interaction/Button';
|
|
35
35
|
export type { ButtonProps } from './components/interaction/Button';
|
|
36
36
|
export { Command } from './components/interaction/Command';
|
|
37
|
-
export type { CommandItem } from './components/interaction/Command';
|
|
37
|
+
export type { CommandItem, CommandProps } from './components/interaction/Command';
|
|
38
38
|
export { Dialog } from './components/interaction/Dialog';
|
|
39
|
+
export type { DialogProps } from './components/interaction/Dialog';
|
|
39
40
|
export { Drawer } from './components/interaction/Drawer';
|
|
41
|
+
export type { DrawerProps } from './components/interaction/Drawer';
|
|
40
42
|
export { DropdownMenu } from './components/interaction/DropdownMenu';
|
|
41
|
-
export type { DropdownMenuItem } from './components/interaction/DropdownMenu';
|
|
43
|
+
export type { DropdownMenuItem, DropdownMenuProps } from './components/interaction/DropdownMenu';
|
|
42
44
|
export { Popover } from './components/interaction/Popover';
|
|
45
|
+
export type { PopoverProps } from './components/interaction/Popover';
|
|
43
46
|
export { Rating } from './components/interaction/Rating';
|
|
47
|
+
export type { RatingProps } from './components/interaction/Rating';
|
|
44
48
|
export { ToastProvider, useToast } from './components/interaction/Toast';
|
|
45
49
|
|
|
46
50
|
// Form
|
|
@@ -56,7 +56,7 @@ Components use `outline` rather than `border` for their decorative edge. The rea
|
|
|
56
56
|
<TokenRow token="--bdc-outline_width" type="<length>" defaultValue="1px" description="Border width" />
|
|
57
57
|
<TokenRow token="--bdc-outline_offset" type="<length>" defaultValue="-1px" description="Negative = inset (border-like); positive = outer halo" />
|
|
58
58
|
<TokenRow token="--bdc-outline_radius" type="<length-percentage>" defaultValue="0" description="Border radius, synced with the element's own radius" />
|
|
59
|
-
<TokenRow token="--bdc-outline_shadow" type="*" defaultValue="
|
|
59
|
+
<TokenRow token="--bdc-outline_shadow" type="*" defaultValue="0 0 0 0 transparent" description="Box shadow — opt-in accent, e.g. focus glow (transparent, not `none` — invalid in a comma-separated box-shadow list)" />
|
|
60
60
|
</tbody>
|
|
61
61
|
</table>
|
|
62
62
|
|
|
@@ -82,22 +82,24 @@ Components use `outline` rather than `border` for their decorative edge. The rea
|
|
|
82
82
|
|
|
83
83
|
## Component pattern
|
|
84
84
|
|
|
85
|
-
Every component that renders a bordered element follows this CSS pattern
|
|
85
|
+
Every component that renders a bordered element follows this CSS pattern. The frame itself is drawn
|
|
86
|
+
with an **inset `box-shadow`** (not `outline` or `border`) so it has zero layout impact while still
|
|
87
|
+
letting `--bdc_color` animate smoothly via the registered `@property`. `outline` is reserved
|
|
88
|
+
exclusively for the `:focus-visible` ring:
|
|
86
89
|
|
|
87
90
|
```css
|
|
88
91
|
.element {
|
|
89
92
|
/* Suppress any browser default border — consumer can re-enable
|
|
90
93
|
via the --component_border custom property if needed. */
|
|
91
|
-
border: none;
|
|
94
|
+
border: var(--component_border, none);
|
|
92
95
|
|
|
93
96
|
/* bdc defaults */
|
|
94
97
|
--bdc_color: currentcolor;
|
|
95
98
|
|
|
96
|
-
/* Rendered border (zero layout impact) */
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
box-shadow: var(--bdc-outline_shadow);
|
|
99
|
+
/* Rendered border (inset box-shadow — zero layout impact) */
|
|
100
|
+
border-radius: var(--component_radius, var(--bdc-outline_radius));
|
|
101
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color),
|
|
102
|
+
var(--component_shadow, var(--bdc-outline_shadow));
|
|
101
103
|
|
|
102
104
|
/* Smooth colour transitions via registered @property */
|
|
103
105
|
transition: --bdc_color 150ms ease-out;
|
|
@@ -107,13 +109,16 @@ Every component that renders a bordered element follows this CSS pattern:
|
|
|
107
109
|
.element:focus { --bdc_color: var(--bdc_color--focus); }
|
|
108
110
|
.element[aria-invalid="true"] { --bdc_color: var(--bdc_color--error); }
|
|
109
111
|
|
|
110
|
-
/* Keyboard accessibility ring —
|
|
112
|
+
/* Keyboard accessibility ring — outline is used here only, replacing
|
|
113
|
+
the inset box-shadow visually on focus-visible */
|
|
111
114
|
.element:focus-visible {
|
|
112
115
|
outline: var(--bds-outline_default);
|
|
113
116
|
outline-offset: var(--bds-outline_offset);
|
|
114
117
|
}
|
|
115
118
|
```
|
|
116
119
|
|
|
120
|
+
See `src/components/ui/Accordion/Accordion.module.css` for a shipped example of this pattern.
|
|
121
|
+
|
|
117
122
|
---
|
|
118
123
|
|
|
119
124
|
## Consumer overrides
|
|
@@ -119,62 +119,64 @@ These are the tokens you should use in component CSS. They adapt automatically t
|
|
|
119
119
|
|
|
120
120
|
## Base palette
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
The primitive palette, defined in the foundation's DTCG source (`tokens/color/base.dtcg.json`).
|
|
123
|
+
Each swatch shows its DTCG path (`color.<hue>.<step>`) and value. In component CSS, always use
|
|
124
|
+
the semantic tokens above so themes work correctly — the palette is reference documentation.
|
|
123
125
|
|
|
124
126
|
### Grey
|
|
125
127
|
|
|
126
128
|
<SwatchRow>
|
|
127
|
-
<Swatch label="grey-100" token="
|
|
128
|
-
<Swatch label="grey-200" token="
|
|
129
|
-
<Swatch label="grey-300" token="
|
|
130
|
-
<Swatch label="grey-400" token="
|
|
131
|
-
<Swatch label="grey-500" token="
|
|
132
|
-
<Swatch label="grey-600" token="
|
|
133
|
-
<Swatch label="grey-700" token="
|
|
134
|
-
<Swatch label="grey-800" token="
|
|
135
|
-
<Swatch label="grey-900" token="
|
|
129
|
+
<Swatch label="grey-100" token="color.grey.100" bg="#f3f4f6" />
|
|
130
|
+
<Swatch label="grey-200" token="color.grey.200" bg="#e5e7eb" />
|
|
131
|
+
<Swatch label="grey-300" token="color.grey.300" bg="#d1d5dc" />
|
|
132
|
+
<Swatch label="grey-400" token="color.grey.400" bg="#99a1af" />
|
|
133
|
+
<Swatch label="grey-500" token="color.grey" bg="#6a7282" text="white" />
|
|
134
|
+
<Swatch label="grey-600" token="color.grey.600" bg="#4a5565" text="white" />
|
|
135
|
+
<Swatch label="grey-700" token="color.grey.700" bg="#364153" text="white" />
|
|
136
|
+
<Swatch label="grey-800" token="color.grey.800" bg="#1e2939" text="white" />
|
|
137
|
+
<Swatch label="grey-900" token="color.grey.900" bg="#101828" text="white" />
|
|
136
138
|
</SwatchRow>
|
|
137
139
|
|
|
138
140
|
### Green
|
|
139
141
|
|
|
140
142
|
<SwatchRow>
|
|
141
|
-
<Swatch label="green-100" token="
|
|
142
|
-
<Swatch label="green-200" token="
|
|
143
|
-
<Swatch label="green-300" token="
|
|
144
|
-
<Swatch label="green-400" token="
|
|
145
|
-
<Swatch label="green-500" token="
|
|
146
|
-
<Swatch label="green-600" token="
|
|
147
|
-
<Swatch label="green-700" token="
|
|
148
|
-
<Swatch label="green-800" token="
|
|
149
|
-
<Swatch label="green-900" token="
|
|
143
|
+
<Swatch label="green-100" token="color.green.100" bg="#dcfce7" />
|
|
144
|
+
<Swatch label="green-200" token="color.green.200" bg="#b9f8cf" />
|
|
145
|
+
<Swatch label="green-300" token="color.green.300" bg="#7bf1a8" />
|
|
146
|
+
<Swatch label="green-400" token="color.green.400" bg="#05df72" />
|
|
147
|
+
<Swatch label="green-500" token="color.green" bg="#00c950" />
|
|
148
|
+
<Swatch label="green-600" token="color.green.600" bg="#00a63e" />
|
|
149
|
+
<Swatch label="green-700" token="color.green.700" bg="#008236" text="white" />
|
|
150
|
+
<Swatch label="green-800" token="color.green.800" bg="#016630" text="white" />
|
|
151
|
+
<Swatch label="green-900" token="color.green.900" bg="#0d542b" text="white" />
|
|
150
152
|
</SwatchRow>
|
|
151
153
|
|
|
152
154
|
### Blue
|
|
153
155
|
|
|
154
156
|
<SwatchRow>
|
|
155
|
-
<Swatch label="blue-100" token="
|
|
156
|
-
<Swatch label="blue-200" token="
|
|
157
|
-
<Swatch label="blue-300" token="
|
|
158
|
-
<Swatch label="blue-400" token="
|
|
159
|
-
<Swatch label="blue-500" token="
|
|
160
|
-
<Swatch label="blue-600" token="
|
|
161
|
-
<Swatch label="blue-700" token="
|
|
162
|
-
<Swatch label="blue-800" token="
|
|
163
|
-
<Swatch label="blue-900" token="
|
|
157
|
+
<Swatch label="blue-100" token="color.blue.100" bg="#dbeafe" />
|
|
158
|
+
<Swatch label="blue-200" token="color.blue.200" bg="#bedbff" />
|
|
159
|
+
<Swatch label="blue-300" token="color.blue.300" bg="#8ec5ff" />
|
|
160
|
+
<Swatch label="blue-400" token="color.blue.400" bg="#51a2ff" />
|
|
161
|
+
<Swatch label="blue-500" token="color.blue" bg="#2b7fff" text="white" />
|
|
162
|
+
<Swatch label="blue-600" token="color.blue.600" bg="#155dfc" text="white" />
|
|
163
|
+
<Swatch label="blue-700" token="color.blue.700" bg="#1447e6" text="white" />
|
|
164
|
+
<Swatch label="blue-800" token="color.blue.800" bg="#193cb8" text="white" />
|
|
165
|
+
<Swatch label="blue-900" token="color.blue.900" bg="#1c398e" text="white" />
|
|
164
166
|
</SwatchRow>
|
|
165
167
|
|
|
166
168
|
### Orange
|
|
167
169
|
|
|
168
170
|
<SwatchRow>
|
|
169
|
-
<Swatch label="orange-100" token="
|
|
170
|
-
<Swatch label="orange-200" token="
|
|
171
|
-
<Swatch label="orange-300" token="
|
|
172
|
-
<Swatch label="orange-400" token="
|
|
173
|
-
<Swatch label="orange-500" token="
|
|
174
|
-
<Swatch label="orange-600" token="
|
|
175
|
-
<Swatch label="orange-700" token="
|
|
176
|
-
<Swatch label="orange-800" token="
|
|
177
|
-
<Swatch label="orange-900" token="
|
|
171
|
+
<Swatch label="orange-100" token="color.orange.100" bg="#ffedd4" />
|
|
172
|
+
<Swatch label="orange-200" token="color.orange.200" bg="#ffd6a7" />
|
|
173
|
+
<Swatch label="orange-300" token="color.orange.300" bg="#ffb86a" />
|
|
174
|
+
<Swatch label="orange-400" token="color.orange.400" bg="#ff8904" />
|
|
175
|
+
<Swatch label="orange-500" token="color.orange" bg="#ff6900" />
|
|
176
|
+
<Swatch label="orange-600" token="color.orange.600" bg="#f54900" text="white" />
|
|
177
|
+
<Swatch label="orange-700" token="color.orange.700" bg="#ca3500" text="white" />
|
|
178
|
+
<Swatch label="orange-800" token="color.orange.800" bg="#9f2d00" text="white" />
|
|
179
|
+
<Swatch label="orange-900" token="color.orange.900" bg="#7e2a0c" text="white" />
|
|
178
180
|
</SwatchRow>
|
|
179
181
|
|
|
180
182
|
---
|
|
@@ -186,10 +188,10 @@ Override `--bds-color_green` and `--bds-color_interactive` to change the primary
|
|
|
186
188
|
```css
|
|
187
189
|
@layer boostdev.tokens.override {
|
|
188
190
|
:root {
|
|
189
|
-
--bds-color_green: var(--bds-
|
|
190
|
-
--bds-color_on-green:
|
|
191
|
-
--bds-color_interactive: var(--bds-
|
|
192
|
-
--bds-color_on-interactive:
|
|
191
|
+
--bds-color_green: var(--bds-color_blue);
|
|
192
|
+
--bds-color_on-green: var(--bds-color_white);
|
|
193
|
+
--bds-color_interactive: var(--bds-color_blue);
|
|
194
|
+
--bds-color_on-interactive: var(--bds-color_white);
|
|
193
195
|
}
|
|
194
196
|
}
|
|
195
197
|
```
|
|
@@ -91,8 +91,8 @@ Override any token in your own layer to retheme:
|
|
|
91
91
|
|
|
92
92
|
@layer boostdev.tokens.override {
|
|
93
93
|
:root {
|
|
94
|
-
--bds-cta: var(--bds-
|
|
95
|
-
--bds-color_on-green: var(--bds-
|
|
94
|
+
--bds-cta: var(--bds-color_blue);
|
|
95
|
+
--bds-color_on-green: var(--bds-color_white);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
```
|
|
@@ -106,5 +106,6 @@ Override any token in your own layer to retheme:
|
|
|
106
106
|
- `bds-` prefix = all foundation tokens
|
|
107
107
|
- `_` separates group from name
|
|
108
108
|
- `--` separates name from scale variant
|
|
109
|
-
-
|
|
109
|
+
- Primitive palette values live in the foundation's DTCG source (`tokens/**/*.dtcg.json`)
|
|
110
|
+
and are inlined into the semantic tokens at build time
|
|
110
111
|
- All semantic tokens are prefixed with `bds-` (e.g. `--bds-bg`, `--bds-interactive`)
|
|
@@ -94,11 +94,11 @@ import logo from '../static/logo.svg';
|
|
|
94
94
|
```css
|
|
95
95
|
@layer boostdev.tokens.override {
|
|
96
96
|
:root {
|
|
97
|
-
--bds-cta: var(--bds-
|
|
98
|
-
--bds-on-cta: var(--bds-
|
|
99
|
-
--bds-interactive: var(--bds-
|
|
100
|
-
--bds-active: var(--bds-
|
|
101
|
-
--bds-on-active: var(--bds-
|
|
97
|
+
--bds-cta: var(--bds-color_orange);
|
|
98
|
+
--bds-on-cta: var(--bds-color_white);
|
|
99
|
+
--bds-interactive: var(--bds-color_orange);
|
|
100
|
+
--bds-active: var(--bds-color_orange);
|
|
101
|
+
--bds-on-active: var(--bds-color_white);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
```
|
|
@@ -44,9 +44,16 @@ const bdcCss = `
|
|
|
44
44
|
--bdc_color--focus: var(--bds-color_interactive);
|
|
45
45
|
--bdc_color--error: var(--bds-color_error);
|
|
46
46
|
|
|
47
|
+
/* Active / selected state colours — override these to theme all filled form controls globally */
|
|
48
|
+
--bdc-color_active: var(--bds-color_interactive);
|
|
49
|
+
--bdc-color_on-active: var(--bds-color_on-interactive);
|
|
50
|
+
--bdc-color_active--subtle: var(--bds-color_blue--subtle);
|
|
51
|
+
--bdc-color_active--strong: var(--bds-color_interactive_on-bg);
|
|
52
|
+
|
|
47
53
|
--bdc-outline_width: 1px;
|
|
48
54
|
--bdc-outline_offset: -1px; /* available for consumer use; bdc borders now use inset box-shadow */
|
|
49
55
|
--bdc-outline_radius: var(--bds-border_radius--xs);
|
|
56
|
+
--bdc-outline_radius--l: 1.5em;
|
|
50
57
|
--bdc-outline_shadow: 0 0 0 0 transparent;
|
|
51
58
|
}
|
|
52
59
|
}
|
|
@@ -63,6 +63,7 @@ export { BdsGrid } from './layout/bds-grid';
|
|
|
63
63
|
export { BdsGridItem } from './layout/bds-grid-item';
|
|
64
64
|
|
|
65
65
|
// Phase 8 — complete parity with React library
|
|
66
|
+
export { BdsButtonContainer } from './ui/bds-button-container';
|
|
66
67
|
export { BdsButtonGroup } from './ui/bds-button-group';
|
|
67
68
|
export { BdsTable } from './ui/bds-table';
|
|
68
69
|
export { BdsPagination } from './ui/bds-pagination';
|
|
@@ -73,5 +74,6 @@ export type { FieldGroupVariant as BdsFieldGroupVariant } from './interaction/fo
|
|
|
73
74
|
export { BdsFormInput } from './interaction/form/bds-form-input';
|
|
74
75
|
export { BdsCarousel } from './ui/bds-carousel';
|
|
75
76
|
export { BdsCalendar } from './ui/bds-calendar';
|
|
77
|
+
export { BdsCalendarRange } from './ui/bds-calendar-range';
|
|
76
78
|
export { BdsDropdownMenu } from './interaction/bds-dropdown-menu';
|
|
77
79
|
export { BdsDropdownMenuItem } from './interaction/bds-dropdown-menu-item';
|
|
@@ -73,7 +73,16 @@ Or in HTML without a bundler:
|
|
|
73
73
|
|
|
74
74
|
| Event | Bubbles | Description |
|
|
75
75
|
|-------|---------|-------------|
|
|
76
|
-
| `bds-accordion-item-toggle` | Yes | Fired by `<bds-accordion-item>` when the trigger is clicked; the
|
|
76
|
+
| `bds-accordion-item-toggle` | Yes | Fired by `<bds-accordion-item>` when the trigger is clicked; the closest ancestor `<bds-accordion>` handles state. Nested accordions each own only their own items — a `<bds-accordion>` never reacts to a toggle event whose item belongs to a nested accordion, and stops the event from bubbling to any accordion further up the tree once it is handled. |
|
|
77
|
+
|
|
78
|
+
## CSS Custom Properties — `<bds-accordion>`
|
|
79
|
+
|
|
80
|
+
| Property | Default | Description |
|
|
81
|
+
|----------|---------|-------------|
|
|
82
|
+
| `--accordion_border` | `none` | Container border |
|
|
83
|
+
| `--accordion_radius` | `var(--bdc-outline_radius)` | Container corner radius |
|
|
84
|
+
| `--accordion_shadow` | `var(--bdc-outline_shadow)` | Container box-shadow tail (layered after the frame border) |
|
|
85
|
+
| `--accordion_trigger-bg--hover` | `var(--bds-color_bg--subtle)` | Trigger button background on hover |
|
|
77
86
|
|
|
78
87
|
## Usage in plain HTML
|
|
79
88
|
|
|
@@ -56,7 +56,7 @@ Slot an SVG (or any element) into `icon-start` or `icon-end`:
|
|
|
56
56
|
|
|
57
57
|
### Icon-only (1:1 aspect ratio)
|
|
58
58
|
|
|
59
|
-
Set the `is-icon-only` attribute to render a square button with equal `var(--bds-
|
|
59
|
+
Set the `is-icon-only` attribute to render a square button with equal `var(--bds-space_xxs)` padding on both axes. Composable with any `variant`. Always pair with `aria-label` — there's no visible label text for assistive tech to read.
|
|
60
60
|
|
|
61
61
|
<Canvas of={Stories.IconOnly} />
|
|
62
62
|
<Canvas of={Stories.IconOnlyOutline} />
|
|
@@ -88,9 +88,9 @@ Set the `is-icon-only` attribute to render a square button with equal `var(--bds
|
|
|
88
88
|
| `href` | string | — | Renders as `<a>` when set |
|
|
89
89
|
| `target` | string | — | Forwarded to `<a>` when `href` is set |
|
|
90
90
|
| `rel` | string | — | Forwarded to `<a>` when `href` is set |
|
|
91
|
-
| `type` | `"button" \| "submit" \| "reset"` | `"button"` | Native button type |
|
|
91
|
+
| `type` | `"button" \| "submit" \| "reset"` | `"button"` | Native button type. `submit`/`reset` act on the nearest light-DOM `<form>` the element participates in (via `ElementInternals` — see [Form participation](#form-participation)) |
|
|
92
92
|
| `has-pulse` | boolean | `false` | Adds animated ring for CTA emphasis |
|
|
93
|
-
| `is-icon-only` | boolean | `false` | 1:1 aspect ratio with equal `
|
|
93
|
+
| `is-icon-only` | boolean | `false` | 1:1 aspect ratio with equal `xxs` padding on both axes. Requires `aria-label`. |
|
|
94
94
|
| `aria-label` | string | — | Accessible label (required for icon-only buttons) |
|
|
95
95
|
|
|
96
96
|
## Slots
|
|
@@ -108,6 +108,17 @@ Set the `is-icon-only` attribute to render a square button with equal `var(--bds
|
|
|
108
108
|
| `--button_color` | Identity colour — fills the default variant, outlines the outline variant |
|
|
109
109
|
| `--button_on-color` | Text/icon colour on the button surface. Pair with `--button_color` |
|
|
110
110
|
|
|
111
|
+
## Form participation
|
|
112
|
+
|
|
113
|
+
`<bds-button>` is form-associated via the Form-Associated Custom Elements API (`ElementInternals`). When placed inside a light-DOM `<form>` — directly or via `<slot>` — `type="submit"` calls the form's `requestSubmit()` and `type="reset"` calls its `reset()`. This works even though the button itself renders in shadow DOM, where a plain `<button type="submit">` would have no form to act on.
|
|
114
|
+
|
|
115
|
+
```html
|
|
116
|
+
<form>
|
|
117
|
+
<bds-button type="submit">Save</bds-button>
|
|
118
|
+
<bds-button type="reset" variant="outline">Cancel</bds-button>
|
|
119
|
+
</form>
|
|
120
|
+
```
|
|
121
|
+
|
|
111
122
|
## Invoker Commands API
|
|
112
123
|
|
|
113
124
|
`<bds-button>` can control a `<bds-popover>` declaratively using `commandfor` and `command`:
|
|
@@ -135,4 +146,4 @@ Set the `is-icon-only` attribute to render a square button with equal `var(--bds
|
|
|
135
146
|
- Always provide a label via slot content or `aria-label` (required for icon-only buttons)
|
|
136
147
|
- `disabled` sets `aria-disabled="true"` and prevents click events
|
|
137
148
|
- When rendered as `<a>`, `href` must point to a valid destination
|
|
138
|
-
- `has-pulse` animation
|
|
149
|
+
- `has-pulse` and the hover icon animation both respect `prefers-reduced-motion`
|
|
@@ -130,7 +130,7 @@ const meta: Meta<BdsButtonStoryArgs> = {
|
|
|
130
130
|
},
|
|
131
131
|
isIconOnly: {
|
|
132
132
|
control: 'boolean',
|
|
133
|
-
description: 'Forces 1:1 aspect ratio with minimal
|
|
133
|
+
description: 'Forces 1:1 aspect ratio with minimal xxs padding. Composable with any `variant`. Requires `aria-label`.',
|
|
134
134
|
table: { defaultValue: { summary: 'false' } },
|
|
135
135
|
},
|
|
136
136
|
hasPulse: {
|
|
@@ -31,7 +31,7 @@ Or in HTML without a bundler:
|
|
|
31
31
|
|
|
32
32
|
## When not to use
|
|
33
33
|
|
|
34
|
-
-
|
|
34
|
+
- Multiple interrelated sections with complex state — use `<bds-accordion>` instead
|
|
35
35
|
- For navigation menus — use a dedicated nav component
|
|
36
36
|
|
|
37
37
|
## Examples
|
|
@@ -54,7 +54,7 @@ Or in HTML without a bundler:
|
|
|
54
54
|
| Attribute | Type | Default | Description |
|
|
55
55
|
|-----------|------|---------|-------------|
|
|
56
56
|
| `open` | boolean | `false` | Whether the panel is currently expanded |
|
|
57
|
-
| `name` | string | `""` | Groups collapsibles so only one in a group is open at a time (native `<details name>` behaviour
|
|
57
|
+
| `name` | string | `""` | Groups collapsibles so only one in a group is open at a time. Each `<bds-collapsible>` renders its own `<details>` in its own shadow root, so this is implemented by the component itself (querying same-`name` elements in `document` and closing them) rather than relying on the native `<details name>` behaviour, which is scoped per tree and can't see across shadow boundaries. |
|
|
58
58
|
|
|
59
59
|
## Slots
|
|
60
60
|
|
|
@@ -100,7 +100,7 @@ Or in HTML without a bundler:
|
|
|
100
100
|
|----------|---------|-------------|
|
|
101
101
|
| `--collapsible_bg` | `var(--bds-color_bg)` | Summary (header) background colour |
|
|
102
102
|
| `--collapsible_bg--hover` | `var(--bds-color_bg--subtle)` | Summary background on hover |
|
|
103
|
-
| `--collapsible_content-bg` | `
|
|
103
|
+
| `--collapsible_content-bg` | `transparent` | Content panel background colour |
|
|
104
104
|
| `--collapsible_color` | `var(--bds-color_on-bg)` | Summary text colour |
|
|
105
105
|
| `--collapsible_on-color` | `var(--bds-color_on-bg)` | Content text colour |
|
|
106
106
|
| `--collapsible_border-color` | `var(--bds-color_bg--subtle)` | Border colour |
|
|
@@ -5,7 +5,7 @@ import * as Stories from './BdsDialog.stories';
|
|
|
5
5
|
|
|
6
6
|
# <bds-dialog>
|
|
7
7
|
|
|
8
|
-
Framework-agnostic Dialog custom element. Wraps a native `<dialog>` element with `showModal()` / `close()` lifecycle, backdrop-click to dismiss, Escape key handling, Tab focus trapping, and the Invoker Commands API.
|
|
8
|
+
Framework-agnostic Dialog custom element. Wraps a native `<dialog>` element with `showModal()` / `close()` lifecycle, backdrop-click to dismiss, Escape key handling, Tab focus trapping, and the Invoker Commands API (custom commands).
|
|
9
9
|
|
|
10
10
|
> **Status: experimental** — API may change before stable release.
|
|
11
11
|
|
|
@@ -55,6 +55,7 @@ Or in HTML without a bundler:
|
|
|
55
55
|
| Attribute | Type | Default | Description |
|
|
56
56
|
|-----------|------|---------|-------------|
|
|
57
57
|
| `open` | boolean | `false` | Controlled open state — syncs to native `showModal()` / `close()` |
|
|
58
|
+
| `aria-label` | string | — | Accessible name, forwarded to the inner shadow `<dialog>` |
|
|
58
59
|
|
|
59
60
|
## Slots
|
|
60
61
|
|
|
@@ -71,17 +72,19 @@ Or in HTML without a bundler:
|
|
|
71
72
|
|
|
72
73
|
## Invoker Commands API
|
|
73
74
|
|
|
74
|
-
Open or close the dialog declaratively using the Invoker Commands API:
|
|
75
|
+
Open or close the dialog declaratively using the Invoker Commands API. `<bds-dialog>` is a custom element (not a native `<dialog>`), so it only reacts to **custom** command values — these must be prefixed with `--` per the Invoker Commands spec:
|
|
75
76
|
|
|
76
77
|
```html
|
|
77
|
-
<button commandfor="my-dialog" command="show-modal">Open</button>
|
|
78
|
-
<button commandfor="my-dialog" command="close">Close</button>
|
|
78
|
+
<button commandfor="my-dialog" command="--show-modal">Open</button>
|
|
79
|
+
<button commandfor="my-dialog" command="--close">Close</button>
|
|
79
80
|
|
|
80
81
|
<bds-dialog id="my-dialog">
|
|
81
82
|
<p>Dialog content</p>
|
|
82
83
|
</bds-dialog>
|
|
83
84
|
```
|
|
84
85
|
|
|
86
|
+
The unprefixed `show-modal` / `close` command values are still accepted by the element's internal handler for compatibility with polyfilled or programmatic dispatch, but native browsers will not fire a `command` event for them on a custom-element target — always use `--show-modal` / `--close` in markup.
|
|
87
|
+
|
|
85
88
|
The Invoker Commands API is a native browser feature. For browsers that do not support it yet, use the `open` attribute or JavaScript.
|
|
86
89
|
|
|
87
90
|
## Usage in plain HTML
|
|
@@ -102,9 +105,11 @@ The Invoker Commands API is a native browser feature. For browsers that do not s
|
|
|
102
105
|
## Accessibility
|
|
103
106
|
|
|
104
107
|
- Renders a native `<dialog>` element with `aria-modal="true"`
|
|
105
|
-
-
|
|
108
|
+
- Set `aria-label` on `<bds-dialog>` to give the dialog an accessible name — it is forwarded to the inner shadow `<dialog>`
|
|
109
|
+
- Focus is trapped inside the dialog while open (Tab / Shift+Tab cycle), including focus that lands on the shadow-internal close button
|
|
106
110
|
- Escape key closes the dialog
|
|
107
111
|
- Clicking the backdrop closes the dialog
|
|
108
112
|
- Focus returns to the triggering element on close
|
|
109
|
-
- A visually positioned close button is provided with `aria-label="Close dialog"`
|
|
110
|
-
- `document.body.overflow` is set to `hidden` while the dialog is open to prevent background scroll
|
|
113
|
+
- A visually positioned close button is provided with `aria-label="Close dialog"` and a 44×44px hit area (WCAG 2.5.5), with a visible `:focus-visible` outline
|
|
114
|
+
- `document.body.overflow` is set to `hidden` while the dialog is open to prevent background scroll, and is released automatically if the dialog is removed from the DOM while still open
|
|
115
|
+
- Content taller than the dialog's `90svh` cap scrolls internally instead of overflowing the box
|
|
@@ -138,7 +138,7 @@ export const InvokerCommands: Story = {
|
|
|
138
138
|
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
|
139
139
|
{React.createElement(
|
|
140
140
|
'button',
|
|
141
|
-
{ commandFor: dialogId, command: 'show-modal', style: { padding: '0.5rem 1rem', cursor: 'pointer' } },
|
|
141
|
+
{ commandFor: dialogId, command: '--show-modal', style: { padding: '0.5rem 1rem', cursor: 'pointer' } },
|
|
142
142
|
'Open with Invoker Command',
|
|
143
143
|
)}
|
|
144
144
|
{React.createElement(
|
|
@@ -148,7 +148,7 @@ export const InvokerCommands: Story = {
|
|
|
148
148
|
'div',
|
|
149
149
|
{ style: { minWidth: '260px' } },
|
|
150
150
|
React.createElement('h2', { style: { margin: '0 0 0.5rem' } }, 'Invoker Commands'),
|
|
151
|
-
React.createElement('p', { style: { margin: 0 } }, 'This dialog was opened using the Invoker Commands API (commandfor + command="show-modal").'),
|
|
151
|
+
React.createElement('p', { style: { margin: 0 } }, 'This dialog was opened using the Invoker Commands API (commandfor + command="--show-modal").'),
|
|
152
152
|
),
|
|
153
153
|
)}
|
|
154
154
|
</div>
|
|
@@ -58,6 +58,7 @@ Or in HTML without a bundler:
|
|
|
58
58
|
|-----------|------|---------|-------------|
|
|
59
59
|
| `open` | boolean | `false` | Controlled open state |
|
|
60
60
|
| `side` | `"left" \| "right"` | `"right"` | Which side the panel slides in from |
|
|
61
|
+
| `aria-label` | string | — | Overrides the default accessible name (which is otherwise the `title` slot content, via `aria-labelledby`) |
|
|
61
62
|
|
|
62
63
|
## Slots
|
|
63
64
|
|
|
@@ -75,14 +76,15 @@ Or in HTML without a bundler:
|
|
|
75
76
|
|
|
76
77
|
## Invoker Commands API
|
|
77
78
|
|
|
78
|
-
Open or close the drawer declaratively using the Invoker Commands API:
|
|
79
|
+
Open or close the drawer declaratively using the Invoker Commands API. `<bds-drawer>` is a custom element, not a native `<dialog>`, so the browser only dispatches the `command` event for **custom** (`--`-prefixed) command values — the built-in `show-modal`/`close` values never fire on it:
|
|
79
80
|
|
|
80
81
|
```html
|
|
81
|
-
<button commandfor="my-drawer" command="show-modal">Open</button>
|
|
82
|
+
<button commandfor="my-drawer" command="--show-modal">Open</button>
|
|
82
83
|
<bds-drawer id="my-drawer" side="right">
|
|
83
84
|
<span slot="title">Settings</span>
|
|
84
85
|
<p>Drawer content</p>
|
|
85
86
|
</bds-drawer>
|
|
87
|
+
<button commandfor="my-drawer" command="--close">Close</button>
|
|
86
88
|
```
|
|
87
89
|
|
|
88
90
|
## Usage in plain HTML
|
|
@@ -99,10 +101,11 @@ Open or close the drawer declaratively using the Invoker Commands API:
|
|
|
99
101
|
## Accessibility
|
|
100
102
|
|
|
101
103
|
- Renders a native `<dialog>` element with `aria-modal="true"`
|
|
102
|
-
-
|
|
104
|
+
- Accessible name: the `title` slot content is wired via `aria-labelledby` by default; set a host `aria-label` attribute to override it
|
|
105
|
+
- Focus is trapped inside the drawer while open (Tab / Shift+Tab cycle), including slotted content
|
|
103
106
|
- Escape key closes the drawer
|
|
104
|
-
- Clicking the backdrop closes the drawer
|
|
107
|
+
- Clicking the backdrop closes the drawer (detected via `event.target === dialog`, so keyboard-activated synthetic clicks on inner controls never trigger a false close)
|
|
105
108
|
- Focus returns to the triggering element on close
|
|
106
|
-
- A close button is provided with `aria-label="Close drawer"`
|
|
107
|
-
- `document.body.overflow` is set to `hidden` while the drawer is open
|
|
109
|
+
- A close button is provided with `aria-label="Close drawer"` and a 44×44px hit area
|
|
110
|
+
- `document.body.overflow` is set to `hidden` while the drawer is open, and restored on close or if the element is disconnected while still open
|
|
108
111
|
- Slide-in animation respects `prefers-reduced-motion`
|