@boostdev/design-system-components 2.8.0 → 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-OF6FFGOT.js → chunk-3AY2YKCM.js} +77 -21
- package/dist/web-components/chunk-3WAV6MDN.js +212 -0
- package/dist/web-components/{chunk-UUKSDCYS.js → chunk-47AT5KZD.js} +87 -15
- 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-QLT6MTZF.js → chunk-AIBOHNDU.js} +10 -0
- package/dist/web-components/{chunk-X3NQMBAQ.js → chunk-AP4RDUL2.js} +14 -3
- 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-ARMKC4BQ.js → chunk-JH6LQKLK.js} +77 -5
- 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-FSZRP43R.js → chunk-WFVKU4GX.js} +21 -10
- 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-ORC56MDY.js → chunk-XIZWAWMJ.js} +45 -6
- 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 +55 -8
- 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 +101 -16
- 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 +135 -22
- 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 +95 -7
- package/src/web-components/interaction/form/bds-slider.spec.ts +83 -0
- package/src/web-components/interaction/form/bds-slider.ts +154 -26
- package/src/web-components/interaction/form/bds-switch.spec.ts +68 -0
- package/src/web-components/interaction/form/bds-switch.ts +87 -20
- package/src/web-components/interaction/form/bds-textarea.spec.ts +71 -0
- package/src/web-components/interaction/form/bds-textarea.ts +108 -7
- 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 +29 -11
- 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 +109 -32
- 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 +15 -14
- 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 +10 -0
- 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 +17 -4
- 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-7YURXHTS.js +0 -147
- package/dist/web-components/chunk-A3RLT3AS.js +0 -49
- package/dist/web-components/chunk-AGKJTMJI.js +0 -56
- package/dist/web-components/chunk-BQLZ7I4G.js +0 -56
- package/dist/web-components/chunk-DZOEPVFT.js +0 -107
- package/dist/web-components/chunk-JYYRJS2D.js +0 -118
- 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
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useId, useState } from "react";
|
|
3
3
|
|
|
4
4
|
// src/components/ui/Accordion/Accordion.module.css
|
|
5
|
-
var Accordion_default = {"component":"
|
|
5
|
+
var Accordion_default = {"component":"bds2110Accordion-component","accordion":"bds2110Accordion-accordion","item":"bds2110Accordion-item","heading":"bds2110Accordion-heading","trigger":"bds2110Accordion-trigger","triggerLabel":"bds2110Accordion-triggerLabel","chevron":"bds2110Accordion-chevron","--open":"bds2110Accordion---open","panel":"bds2110Accordion-panel","panelContent":"bds2110Accordion-panelContent"};
|
|
6
6
|
|
|
7
7
|
// src/components/ui/Accordion/Accordion.tsx
|
|
8
8
|
import { cn } from "@boostdev/design-system-foundation";
|
|
@@ -71,7 +71,7 @@ function Accordion({
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// src/components/ui/Alert/Alert.module.css
|
|
74
|
-
var Alert_default = {"component":"
|
|
74
|
+
var Alert_default = {"component":"bds2110Alert-component","alert":"bds2110Alert-alert","--variant_info":"bds2110Alert---variant_info","--variant_success":"bds2110Alert---variant_success","--variant_warning":"bds2110Alert---variant_warning","--variant_error":"bds2110Alert---variant_error","icon":"bds2110Alert-icon","content":"bds2110Alert-content","title":"bds2110Alert-title","dismiss":"bds2110Alert-dismiss"};
|
|
75
75
|
|
|
76
76
|
// src/components/ui/Alert/Alert.tsx
|
|
77
77
|
import { cn as cn2 } from "@boostdev/design-system-foundation";
|
|
@@ -116,7 +116,7 @@ function Alert({
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
// src/components/ui/Avatar/Avatar.module.css
|
|
119
|
-
var Avatar_default = {"component":"
|
|
119
|
+
var Avatar_default = {"component":"bds2110Avatar-component","avatar":"bds2110Avatar-avatar","--fallback":"bds2110Avatar---fallback","--size_small":"bds2110Avatar---size_small","--size_medium":"bds2110Avatar---size_medium","--size_large":"bds2110Avatar---size_large","image":"bds2110Avatar-image","initials":"bds2110Avatar-initials"};
|
|
120
120
|
|
|
121
121
|
// src/components/ui/Avatar/Avatar.tsx
|
|
122
122
|
import { cn as cn3 } from "@boostdev/design-system-foundation";
|
|
@@ -143,7 +143,7 @@ function Avatar({ src, alt, name, size = "medium", className, ...rest }) {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
// src/components/ui/Badge/Badge.module.css
|
|
146
|
-
var Badge_default = {"component":"
|
|
146
|
+
var Badge_default = {"component":"bds2110Badge-component","badge":"bds2110Badge-badge","--variant_primary":"bds2110Badge---variant_primary","--variant_secondary":"bds2110Badge---variant_secondary","--variant_success":"bds2110Badge---variant_success","--variant_error":"bds2110Badge---variant_error","--variant_warning":"bds2110Badge---variant_warning"};
|
|
147
147
|
|
|
148
148
|
// src/components/ui/Badge/Badge.tsx
|
|
149
149
|
import { cn as cn4 } from "@boostdev/design-system-foundation";
|
|
@@ -153,7 +153,7 @@ function Badge({ children, variant = "primary", className, ...rest }) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
// src/components/ui/Breadcrumb/Breadcrumb.module.css
|
|
156
|
-
var Breadcrumb_default = {"component":"
|
|
156
|
+
var Breadcrumb_default = {"component":"bds2110Breadcrumb-component","breadcrumb":"bds2110Breadcrumb-breadcrumb","list":"bds2110Breadcrumb-list","item":"bds2110Breadcrumb-item","link":"bds2110Breadcrumb-link","separator":"bds2110Breadcrumb-separator","text":"bds2110Breadcrumb-text","current":"bds2110Breadcrumb-current"};
|
|
157
157
|
|
|
158
158
|
// src/components/ui/Breadcrumb/Breadcrumb.tsx
|
|
159
159
|
import { cn as cn5 } from "@boostdev/design-system-foundation";
|
|
@@ -162,14 +162,14 @@ function Breadcrumb({ items, className, ...rest }) {
|
|
|
162
162
|
return /* @__PURE__ */ jsx5("nav", { ...rest, "aria-label": "Breadcrumb", className: cn5(Breadcrumb_default.breadcrumb, className), children: /* @__PURE__ */ jsx5("ol", { className: Breadcrumb_default.list, children: items.map((item, index) => {
|
|
163
163
|
const isLast = index === items.length - 1;
|
|
164
164
|
return /* @__PURE__ */ jsx5("li", { className: Breadcrumb_default.item, children: isLast ? /* @__PURE__ */ jsx5("span", { "aria-current": "page", className: Breadcrumb_default.current, children: item.label }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
165
|
-
/* @__PURE__ */ jsx5("a", { href: item.href, className: Breadcrumb_default.link, children: item.label }),
|
|
165
|
+
item.href ? /* @__PURE__ */ jsx5("a", { href: item.href, className: Breadcrumb_default.link, children: item.label }) : /* @__PURE__ */ jsx5("span", { className: Breadcrumb_default.text, children: item.label }),
|
|
166
166
|
/* @__PURE__ */ jsx5("span", { className: Breadcrumb_default.separator, "aria-hidden": "true", children: "\u203A" })
|
|
167
167
|
] }) }, index);
|
|
168
168
|
}) }) });
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
// src/components/ui/Collapsible/Collapsible.module.css
|
|
172
|
-
var Collapsible_default = {"component":"
|
|
172
|
+
var Collapsible_default = {"component":"bds2110Collapsible-component","collapsible":"bds2110Collapsible-collapsible","summary":"bds2110Collapsible-summary","summaryContent":"bds2110Collapsible-summaryContent","icon":"bds2110Collapsible-icon","content":"bds2110Collapsible-content"};
|
|
173
173
|
|
|
174
174
|
// src/components/ui/Collapsible/Collapsible.tsx
|
|
175
175
|
import { cn as cn6 } from "@boostdev/design-system-foundation";
|
|
@@ -184,9 +184,16 @@ function Collapsible({
|
|
|
184
184
|
className,
|
|
185
185
|
...rest
|
|
186
186
|
}) {
|
|
187
|
+
const isControlled = open !== void 0;
|
|
187
188
|
const handleToggle = (e) => {
|
|
189
|
+
if (isControlled) return;
|
|
188
190
|
onToggle?.(e.currentTarget.open);
|
|
189
191
|
};
|
|
192
|
+
const handleSummaryClick = (e) => {
|
|
193
|
+
if (!isControlled) return;
|
|
194
|
+
e.preventDefault();
|
|
195
|
+
onToggle?.(!open);
|
|
196
|
+
};
|
|
190
197
|
return /* @__PURE__ */ jsxs4(
|
|
191
198
|
"details",
|
|
192
199
|
{
|
|
@@ -196,7 +203,7 @@ function Collapsible({
|
|
|
196
203
|
onToggle: handleToggle,
|
|
197
204
|
...rest,
|
|
198
205
|
children: [
|
|
199
|
-
/* @__PURE__ */ jsxs4("summary", { className: Collapsible_default.summary, children: [
|
|
206
|
+
/* @__PURE__ */ jsxs4("summary", { className: Collapsible_default.summary, onClick: handleSummaryClick, children: [
|
|
200
207
|
/* @__PURE__ */ jsx6("span", { className: Collapsible_default.summaryContent, children: summary }),
|
|
201
208
|
/* @__PURE__ */ jsx6("span", { className: Collapsible_default.icon, "aria-hidden": "true" })
|
|
202
209
|
] }),
|
|
@@ -207,255 +214,575 @@ function Collapsible({
|
|
|
207
214
|
}
|
|
208
215
|
|
|
209
216
|
// src/components/ui/Calendar/Calendar.tsx
|
|
210
|
-
import { useState as useState2, useId as useId2 } from "react";
|
|
217
|
+
import { useState as useState2, useId as useId2, useRef, useEffect, useCallback } from "react";
|
|
218
|
+
import { cn as cn8 } from "@boostdev/design-system-foundation";
|
|
211
219
|
|
|
212
220
|
// src/components/ui/Calendar/Calendar.module.css
|
|
213
|
-
var Calendar_default = {"component":"
|
|
221
|
+
var Calendar_default = {"component":"bds2110Calendar-component","calendar":"bds2110Calendar-calendar","months":"bds2110Calendar-months","month":"bds2110Calendar-month","monthHeader":"bds2110Calendar-monthHeader","navSlot":"bds2110Calendar-navSlot","monthYear":"bds2110Calendar-monthYear","navBtn":"bds2110Calendar-navBtn","grid":"bds2110Calendar-grid","row":"bds2110Calendar-row","weekday":"bds2110Calendar-weekday","cell":"bds2110Calendar-cell","day":"bds2110Calendar-day","disabled":"bds2110Calendar-disabled","selected":"bds2110Calendar-selected","rangeStart":"bds2110Calendar-rangeStart","rangeEnd":"bds2110Calendar-rangeEnd","outside":"bds2110Calendar-outside","today":"bds2110Calendar-today","inRange":"bds2110Calendar-inRange"};
|
|
214
222
|
|
|
215
|
-
// src/components/ui/Calendar/
|
|
223
|
+
// src/components/ui/Calendar/MonthGrid.tsx
|
|
216
224
|
import { cn as cn7 } from "@boostdev/design-system-foundation";
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
225
|
+
|
|
226
|
+
// src/components/ui/Calendar/calendar-core.ts
|
|
227
|
+
function toISO(date) {
|
|
228
|
+
const y = date.getFullYear();
|
|
229
|
+
const m = String(date.getMonth() + 1).padStart(2, "0");
|
|
230
|
+
const d = String(date.getDate()).padStart(2, "0");
|
|
231
|
+
return `${y}-${m}-${d}`;
|
|
232
|
+
}
|
|
233
|
+
function parseISO(iso) {
|
|
234
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(iso);
|
|
235
|
+
if (!m) return null;
|
|
236
|
+
const year = Number(m[1]);
|
|
237
|
+
const month = Number(m[2]) - 1;
|
|
238
|
+
const day = Number(m[3]);
|
|
239
|
+
const date = new Date(year, month, day);
|
|
240
|
+
date.setFullYear(year);
|
|
241
|
+
if (isNaN(date.getTime())) return null;
|
|
242
|
+
if (date.getFullYear() !== year || date.getMonth() !== month || date.getDate() !== day) return null;
|
|
243
|
+
return date;
|
|
244
|
+
}
|
|
245
|
+
function addDays(date, n) {
|
|
246
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + n);
|
|
247
|
+
}
|
|
248
|
+
function addMonths(date, n) {
|
|
249
|
+
const firstOfTarget = new Date(date.getFullYear(), date.getMonth() + n, 1);
|
|
250
|
+
const daysInTarget = new Date(firstOfTarget.getFullYear(), firstOfTarget.getMonth() + 1, 0).getDate();
|
|
251
|
+
return new Date(firstOfTarget.getFullYear(), firstOfTarget.getMonth(), Math.min(date.getDate(), daysInTarget));
|
|
252
|
+
}
|
|
242
253
|
function isSameDay(a, b) {
|
|
243
254
|
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
244
255
|
}
|
|
245
|
-
function
|
|
246
|
-
|
|
256
|
+
function compareDay(a, b) {
|
|
257
|
+
const am = new Date(a.getFullYear(), a.getMonth(), a.getDate()).getTime();
|
|
258
|
+
const bm = new Date(b.getFullYear(), b.getMonth(), b.getDate()).getTime();
|
|
259
|
+
return am < bm ? -1 : am > bm ? 1 : 0;
|
|
260
|
+
}
|
|
261
|
+
function sortRange(a, b) {
|
|
262
|
+
return compareDay(a, b) <= 0 ? [a, b] : [b, a];
|
|
263
|
+
}
|
|
264
|
+
function isInRange(date, start, end) {
|
|
265
|
+
const [lo, hi] = sortRange(start, end);
|
|
266
|
+
return compareDay(date, lo) >= 0 && compareDay(date, hi) <= 0;
|
|
267
|
+
}
|
|
268
|
+
function isDisabled(date, opts) {
|
|
269
|
+
if (opts.min && compareDay(date, opts.min) < 0) return true;
|
|
270
|
+
if (opts.max && compareDay(date, opts.max) > 0) return true;
|
|
271
|
+
return !!opts.isDateDisallowed?.(date);
|
|
272
|
+
}
|
|
273
|
+
function buildMonthGrid(year, month, firstDayOfWeek) {
|
|
274
|
+
const firstOfMonth = new Date(year, month, 1);
|
|
275
|
+
const lead = (firstOfMonth.getDay() - firstDayOfWeek + 7) % 7;
|
|
276
|
+
const start = addDays(firstOfMonth, -lead);
|
|
277
|
+
return Array.from({ length: 42 }, (_, i) => {
|
|
278
|
+
const date = addDays(start, i);
|
|
279
|
+
return { iso: toISO(date), date, day: date.getDate(), outside: date.getMonth() !== month };
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
function getMonthLabel(year, month, locale) {
|
|
283
|
+
return new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" }).format(new Date(year, month, 1));
|
|
284
|
+
}
|
|
285
|
+
function getDayLabel(date, locale) {
|
|
286
|
+
return new Intl.DateTimeFormat(locale, { year: "numeric", month: "long", day: "numeric" }).format(date);
|
|
287
|
+
}
|
|
288
|
+
function getWeekdayNames(locale, firstDayOfWeek) {
|
|
289
|
+
const fmt = new Intl.DateTimeFormat(locale, { weekday: "short" });
|
|
290
|
+
return Array.from({ length: 7 }, (_, i) => fmt.format(new Date(2023, 0, 1 + (firstDayOfWeek + i) % 7)));
|
|
291
|
+
}
|
|
292
|
+
function nextFocusDate(current, key, opts) {
|
|
293
|
+
const offsetInWeek = (current.getDay() - opts.firstDayOfWeek + 7) % 7;
|
|
294
|
+
switch (key) {
|
|
295
|
+
case "ArrowRight":
|
|
296
|
+
return addDays(current, 1);
|
|
297
|
+
case "ArrowLeft":
|
|
298
|
+
return addDays(current, -1);
|
|
299
|
+
case "ArrowDown":
|
|
300
|
+
return addDays(current, 7);
|
|
301
|
+
case "ArrowUp":
|
|
302
|
+
return addDays(current, -7);
|
|
303
|
+
case "Home":
|
|
304
|
+
return addDays(current, -offsetInWeek);
|
|
305
|
+
case "End":
|
|
306
|
+
return addDays(current, 6 - offsetInWeek);
|
|
307
|
+
case "PageUp":
|
|
308
|
+
return addMonths(current, opts.shiftKey ? -12 : -1);
|
|
309
|
+
case "PageDown":
|
|
310
|
+
return addMonths(current, opts.shiftKey ? 12 : 1);
|
|
311
|
+
default:
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// src/components/ui/Calendar/MonthGrid.tsx
|
|
317
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
318
|
+
var ChevronLeft = () => /* @__PURE__ */ jsx7("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx7("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) });
|
|
319
|
+
var ChevronRight = () => /* @__PURE__ */ jsx7("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx7("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
|
|
320
|
+
function MonthGrid(props) {
|
|
321
|
+
const {
|
|
322
|
+
year,
|
|
323
|
+
month,
|
|
324
|
+
firstDayOfWeek,
|
|
325
|
+
weekdayNames,
|
|
326
|
+
monthLabel,
|
|
327
|
+
headingId,
|
|
328
|
+
showPrev,
|
|
329
|
+
showNext,
|
|
330
|
+
onPrev,
|
|
331
|
+
onNext,
|
|
332
|
+
prevLabel,
|
|
333
|
+
nextLabel,
|
|
334
|
+
classifyDay,
|
|
335
|
+
formatDay,
|
|
336
|
+
registerRef,
|
|
337
|
+
onSelect,
|
|
338
|
+
onKeyDown,
|
|
339
|
+
onDayPointerEnter
|
|
340
|
+
} = props;
|
|
341
|
+
const cells = buildMonthGrid(year, month, firstDayOfWeek);
|
|
342
|
+
const rows = Array.from({ length: 6 }, (_, r) => cells.slice(r * 7, r * 7 + 7));
|
|
343
|
+
return /* @__PURE__ */ jsxs5("div", { className: Calendar_default.month, children: [
|
|
344
|
+
/* @__PURE__ */ jsxs5("div", { className: Calendar_default.monthHeader, children: [
|
|
345
|
+
/* @__PURE__ */ jsx7("span", { className: Calendar_default.navSlot, children: showPrev && /* @__PURE__ */ jsx7("button", { type: "button", className: Calendar_default.navBtn, "aria-label": prevLabel, onClick: onPrev, children: /* @__PURE__ */ jsx7(ChevronLeft, {}) }) }),
|
|
346
|
+
/* @__PURE__ */ jsx7("span", { id: headingId, className: Calendar_default.monthYear, "aria-live": "polite", children: monthLabel }),
|
|
347
|
+
/* @__PURE__ */ jsx7("span", { className: Calendar_default.navSlot, children: showNext && /* @__PURE__ */ jsx7("button", { type: "button", className: Calendar_default.navBtn, "aria-label": nextLabel, onClick: onNext, children: /* @__PURE__ */ jsx7(ChevronRight, {}) }) })
|
|
348
|
+
] }),
|
|
349
|
+
/* @__PURE__ */ jsxs5("div", { className: Calendar_default.grid, role: "grid", "aria-labelledby": headingId, children: [
|
|
350
|
+
/* @__PURE__ */ jsx7("div", { className: Calendar_default.row, role: "row", children: weekdayNames.map((name, i) => /* @__PURE__ */ jsx7("span", { role: "columnheader", className: Calendar_default.weekday, "aria-label": name, children: name }, i)) }),
|
|
351
|
+
rows.map((week, r) => /* @__PURE__ */ jsx7("div", { className: Calendar_default.row, role: "row", children: week.map((cell) => {
|
|
352
|
+
const s = cell.outside ? { today: false, selected: false, rangeStart: false, rangeEnd: false, inRange: false, disabled: true, tabbable: false } : classifyDay(cell.date);
|
|
353
|
+
const isEndpoint = s.selected || s.rangeStart || s.rangeEnd;
|
|
354
|
+
return /* @__PURE__ */ jsx7(
|
|
355
|
+
"span",
|
|
356
|
+
{
|
|
357
|
+
role: "gridcell",
|
|
358
|
+
"aria-selected": isEndpoint,
|
|
359
|
+
className: Calendar_default.cell,
|
|
360
|
+
children: /* @__PURE__ */ jsx7(
|
|
361
|
+
"button",
|
|
362
|
+
{
|
|
363
|
+
ref: (el) => registerRef(cell.iso, el),
|
|
364
|
+
type: "button",
|
|
365
|
+
"data-date": cell.iso,
|
|
366
|
+
"data-outside": cell.outside || void 0,
|
|
367
|
+
"data-today": s.today || void 0,
|
|
368
|
+
"data-selected": s.selected || void 0,
|
|
369
|
+
"data-range-start": s.rangeStart || void 0,
|
|
370
|
+
"data-range-end": s.rangeEnd || void 0,
|
|
371
|
+
"data-in-range": s.inRange || void 0,
|
|
372
|
+
className: cn7(
|
|
373
|
+
Calendar_default.day,
|
|
374
|
+
cell.outside && Calendar_default.outside,
|
|
375
|
+
s.today && !isEndpoint && Calendar_default.today,
|
|
376
|
+
s.selected && Calendar_default.selected,
|
|
377
|
+
s.rangeStart && Calendar_default.rangeStart,
|
|
378
|
+
s.rangeEnd && Calendar_default.rangeEnd,
|
|
379
|
+
s.inRange && Calendar_default.inRange,
|
|
380
|
+
s.disabled && Calendar_default.disabled
|
|
381
|
+
),
|
|
382
|
+
"aria-label": formatDay(cell.date),
|
|
383
|
+
"aria-current": s.today ? "date" : void 0,
|
|
384
|
+
"aria-disabled": s.disabled || void 0,
|
|
385
|
+
disabled: s.disabled || cell.outside,
|
|
386
|
+
tabIndex: s.tabbable ? 0 : -1,
|
|
387
|
+
onClick: () => onSelect(cell.date),
|
|
388
|
+
onKeyDown: (e) => onKeyDown(e, cell.date),
|
|
389
|
+
onPointerEnter: onDayPointerEnter ? () => onDayPointerEnter(cell.date) : void 0,
|
|
390
|
+
children: cell.day
|
|
391
|
+
}
|
|
392
|
+
)
|
|
393
|
+
},
|
|
394
|
+
cell.iso
|
|
395
|
+
);
|
|
396
|
+
}) }, r))
|
|
397
|
+
] })
|
|
398
|
+
] });
|
|
247
399
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
400
|
+
|
|
401
|
+
// src/components/ui/Calendar/Calendar.tsx
|
|
402
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
403
|
+
function monthIndex(d) {
|
|
404
|
+
return d.getFullYear() * 12 + d.getMonth();
|
|
252
405
|
}
|
|
253
|
-
function
|
|
254
|
-
|
|
406
|
+
function isMonthVisible(date, viewYear, viewMonth, months) {
|
|
407
|
+
const start = viewYear * 12 + viewMonth;
|
|
408
|
+
const idx = monthIndex(date);
|
|
409
|
+
return idx >= start && idx < start + months;
|
|
255
410
|
}
|
|
256
|
-
function
|
|
257
|
-
return new Date(
|
|
411
|
+
function weekdayNamesFrom(fmt, firstDayOfWeek) {
|
|
412
|
+
return Array.from({ length: 7 }, (_, i) => fmt(new Date(2023, 0, 1 + (firstDayOfWeek + i) % 7)));
|
|
258
413
|
}
|
|
259
|
-
function Calendar({
|
|
414
|
+
function Calendar({
|
|
415
|
+
value,
|
|
416
|
+
defaultValue,
|
|
417
|
+
min,
|
|
418
|
+
max,
|
|
419
|
+
months = 1,
|
|
420
|
+
pageBy = "months",
|
|
421
|
+
firstDayOfWeek = 1,
|
|
422
|
+
locale,
|
|
423
|
+
isDateDisallowed,
|
|
424
|
+
formatWeekday,
|
|
425
|
+
formatMonth,
|
|
426
|
+
formatDay,
|
|
427
|
+
labels,
|
|
428
|
+
onChange,
|
|
429
|
+
className,
|
|
430
|
+
...rest
|
|
431
|
+
}) {
|
|
260
432
|
const today = /* @__PURE__ */ new Date();
|
|
261
433
|
const controlled = value !== void 0;
|
|
262
434
|
const [internal, setInternal] = useState2(defaultValue);
|
|
263
435
|
const selected = controlled ? value : internal;
|
|
264
|
-
const
|
|
265
|
-
const [
|
|
266
|
-
const [
|
|
267
|
-
const
|
|
268
|
-
const
|
|
269
|
-
const
|
|
270
|
-
const
|
|
271
|
-
|
|
436
|
+
const base = selected ?? today;
|
|
437
|
+
const [viewYear, setViewYear] = useState2(base.getFullYear());
|
|
438
|
+
const [viewMonth, setViewMonth] = useState2(base.getMonth());
|
|
439
|
+
const [focusedIso, setFocusedIso] = useState2();
|
|
440
|
+
const headingBaseId = useId2();
|
|
441
|
+
const dayRefs = useRef(/* @__PURE__ */ new Map());
|
|
442
|
+
const registerRef = useCallback((iso, el) => {
|
|
443
|
+
if (el) dayRefs.current.set(iso, el);
|
|
444
|
+
else dayRefs.current.delete(iso);
|
|
445
|
+
}, []);
|
|
446
|
+
useEffect(() => {
|
|
447
|
+
if (!controlled || !value) return;
|
|
448
|
+
if (!isMonthVisible(value, viewYear, viewMonth, months)) {
|
|
449
|
+
setViewYear(value.getFullYear());
|
|
450
|
+
setViewMonth(value.getMonth());
|
|
451
|
+
}
|
|
452
|
+
}, [controlled, value]);
|
|
453
|
+
useEffect(() => {
|
|
454
|
+
if (focusedIso) dayRefs.current.get(focusedIso)?.focus();
|
|
455
|
+
}, [focusedIso, viewYear, viewMonth]);
|
|
456
|
+
const disabledFor = (date) => isDisabled(date, { min, max, isDateDisallowed });
|
|
457
|
+
const page = (dir) => {
|
|
458
|
+
const step = pageBy === "single" ? 1 : months;
|
|
459
|
+
const d = new Date(viewYear, viewMonth + dir * step, 1);
|
|
272
460
|
setViewYear(d.getFullYear());
|
|
273
461
|
setViewMonth(d.getMonth());
|
|
274
|
-
|
|
462
|
+
setFocusedIso(void 0);
|
|
275
463
|
};
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
if (isOutOfRange(date, min, max)) return;
|
|
464
|
+
const select = (date) => {
|
|
465
|
+
if (disabledFor(date)) return;
|
|
279
466
|
if (!controlled) setInternal(date);
|
|
280
467
|
onChange?.(date);
|
|
281
468
|
};
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
const current = new Date(viewYear, viewMonth, day);
|
|
292
|
-
const next = new Date(current);
|
|
293
|
-
next.setDate(next.getDate() + map[e.key]);
|
|
294
|
-
setViewYear(next.getFullYear());
|
|
295
|
-
setViewMonth(next.getMonth());
|
|
296
|
-
setFocusedDay(next.getDate());
|
|
297
|
-
} else if (e.key === "Home") {
|
|
298
|
-
e.preventDefault();
|
|
299
|
-
setFocusedDay(1);
|
|
300
|
-
} else if (e.key === "End") {
|
|
301
|
-
e.preventDefault();
|
|
302
|
-
setFocusedDay(daysInMonth);
|
|
303
|
-
} else if (e.key === "Enter" || e.key === " ") {
|
|
469
|
+
const moveFocus = (target) => {
|
|
470
|
+
setFocusedIso(toISO(target));
|
|
471
|
+
if (!isMonthVisible(target, viewYear, viewMonth, months)) {
|
|
472
|
+
setViewYear(target.getFullYear());
|
|
473
|
+
setViewMonth(target.getMonth());
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
const onKeyDown = (e, date) => {
|
|
477
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
304
478
|
e.preventDefault();
|
|
305
|
-
|
|
479
|
+
select(date);
|
|
480
|
+
return;
|
|
306
481
|
}
|
|
482
|
+
const next = nextFocusDate(date, e.key, { shiftKey: e.shiftKey, firstDayOfWeek });
|
|
483
|
+
if (!next) return;
|
|
484
|
+
e.preventDefault();
|
|
485
|
+
moveFocus(next);
|
|
307
486
|
};
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
className: Calendar_default.navBtn,
|
|
335
|
-
"aria-label": "Next month",
|
|
336
|
-
onClick: () => navigate(1),
|
|
337
|
-
children: /* @__PURE__ */ jsx7("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx7("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) })
|
|
338
|
-
}
|
|
339
|
-
)
|
|
340
|
-
] }),
|
|
341
|
-
/* @__PURE__ */ jsxs5(
|
|
342
|
-
"table",
|
|
487
|
+
const selectedVisible = selected && isMonthVisible(selected, viewYear, viewMonth, months) ? selected : void 0;
|
|
488
|
+
const todayVisible = isMonthVisible(today, viewYear, viewMonth, months) ? today : void 0;
|
|
489
|
+
const tabbableIso = focusedIso ?? (selectedVisible && toISO(selectedVisible)) ?? (todayVisible && toISO(todayVisible)) ?? toISO(new Date(viewYear, viewMonth, 1));
|
|
490
|
+
const classifyDay = (date) => ({
|
|
491
|
+
today: isSameDay(date, today),
|
|
492
|
+
selected: !!selected && isSameDay(date, selected),
|
|
493
|
+
rangeStart: false,
|
|
494
|
+
rangeEnd: false,
|
|
495
|
+
inRange: false,
|
|
496
|
+
disabled: disabledFor(date),
|
|
497
|
+
tabbable: toISO(date) === tabbableIso
|
|
498
|
+
});
|
|
499
|
+
const weekdayNames = formatWeekday ? weekdayNamesFrom(formatWeekday, firstDayOfWeek) : getWeekdayNames(locale, firstDayOfWeek);
|
|
500
|
+
const labelOfMonth = (y, m) => formatMonth ? formatMonth(new Date(y, m, 1)) : getMonthLabel(y, m, locale);
|
|
501
|
+
const labelOfDay = (d) => formatDay ? formatDay(d) : getDayLabel(d, locale);
|
|
502
|
+
const prevLabel = labels?.previousMonth ?? "Previous month";
|
|
503
|
+
const nextLabel = labels?.nextMonth ?? "Next month";
|
|
504
|
+
const count = Math.max(1, months);
|
|
505
|
+
const groupLabel = Array.from({ length: count }, (_, i) => {
|
|
506
|
+
const d = new Date(viewYear, viewMonth + i, 1);
|
|
507
|
+
return labelOfMonth(d.getFullYear(), d.getMonth());
|
|
508
|
+
}).join(", ");
|
|
509
|
+
return /* @__PURE__ */ jsx8("div", { ...rest, className: cn8(Calendar_default.calendar, className), role: "group", "aria-label": groupLabel, children: /* @__PURE__ */ jsx8("div", { className: Calendar_default.months, children: Array.from({ length: count }, (_, i) => {
|
|
510
|
+
const d = new Date(viewYear, viewMonth + i, 1);
|
|
511
|
+
return /* @__PURE__ */ jsx8(
|
|
512
|
+
MonthGrid,
|
|
343
513
|
{
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
514
|
+
year: d.getFullYear(),
|
|
515
|
+
month: d.getMonth(),
|
|
516
|
+
firstDayOfWeek,
|
|
517
|
+
weekdayNames,
|
|
518
|
+
monthLabel: labelOfMonth(d.getFullYear(), d.getMonth()),
|
|
519
|
+
headingId: `${headingBaseId}-${i}`,
|
|
520
|
+
showPrev: i === 0,
|
|
521
|
+
showNext: i === count - 1,
|
|
522
|
+
onPrev: () => page(-1),
|
|
523
|
+
onNext: () => page(1),
|
|
524
|
+
prevLabel,
|
|
525
|
+
nextLabel,
|
|
526
|
+
classifyDay,
|
|
527
|
+
formatDay: labelOfDay,
|
|
528
|
+
registerRef,
|
|
529
|
+
onSelect: select,
|
|
530
|
+
onKeyDown
|
|
531
|
+
},
|
|
532
|
+
i
|
|
533
|
+
);
|
|
534
|
+
}) }) });
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// src/components/ui/Calendar/CalendarRange.tsx
|
|
538
|
+
import { useState as useState3, useId as useId3, useRef as useRef2, useEffect as useEffect2, useCallback as useCallback2 } from "react";
|
|
539
|
+
import { cn as cn9 } from "@boostdev/design-system-foundation";
|
|
540
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
541
|
+
function isMonthVisible2(date, viewYear, viewMonth, months) {
|
|
542
|
+
const start = viewYear * 12 + viewMonth;
|
|
543
|
+
const idx = date.getFullYear() * 12 + date.getMonth();
|
|
544
|
+
return idx >= start && idx < start + months;
|
|
545
|
+
}
|
|
546
|
+
function weekdayNamesFrom2(fmt, firstDayOfWeek) {
|
|
547
|
+
return Array.from({ length: 7 }, (_, i) => fmt(new Date(2023, 0, 1 + (firstDayOfWeek + i) % 7)));
|
|
548
|
+
}
|
|
549
|
+
function CalendarRange({
|
|
550
|
+
value,
|
|
551
|
+
defaultValue,
|
|
552
|
+
min,
|
|
553
|
+
max,
|
|
554
|
+
months = 1,
|
|
555
|
+
pageBy = "months",
|
|
556
|
+
firstDayOfWeek = 1,
|
|
557
|
+
locale,
|
|
558
|
+
isDateDisallowed,
|
|
559
|
+
formatWeekday,
|
|
560
|
+
formatMonth,
|
|
561
|
+
formatDay,
|
|
562
|
+
labels,
|
|
563
|
+
onChange,
|
|
564
|
+
onRangeStart,
|
|
565
|
+
className,
|
|
566
|
+
...rest
|
|
567
|
+
}) {
|
|
568
|
+
const today = /* @__PURE__ */ new Date();
|
|
569
|
+
const controlled = value !== void 0;
|
|
570
|
+
const [internal, setInternal] = useState3(defaultValue);
|
|
571
|
+
const committed = controlled ? value : internal;
|
|
572
|
+
const [anchor, setAnchor] = useState3();
|
|
573
|
+
const [hover, setHover] = useState3();
|
|
574
|
+
const base = committed ? committed[0] : today;
|
|
575
|
+
const [viewYear, setViewYear] = useState3(base.getFullYear());
|
|
576
|
+
const [viewMonth, setViewMonth] = useState3(base.getMonth());
|
|
577
|
+
const [focusedIso, setFocusedIso] = useState3();
|
|
578
|
+
const headingBaseId = useId3();
|
|
579
|
+
const dayRefs = useRef2(/* @__PURE__ */ new Map());
|
|
580
|
+
const registerRef = useCallback2((iso, el) => {
|
|
581
|
+
if (el) dayRefs.current.set(iso, el);
|
|
582
|
+
else dayRefs.current.delete(iso);
|
|
583
|
+
}, []);
|
|
584
|
+
useEffect2(() => {
|
|
585
|
+
if (!controlled || !value) return;
|
|
586
|
+
if (!isMonthVisible2(value[0], viewYear, viewMonth, months)) {
|
|
587
|
+
setViewYear(value[0].getFullYear());
|
|
588
|
+
setViewMonth(value[0].getMonth());
|
|
589
|
+
}
|
|
590
|
+
}, [controlled, value]);
|
|
591
|
+
useEffect2(() => {
|
|
592
|
+
if (focusedIso) dayRefs.current.get(focusedIso)?.focus();
|
|
593
|
+
}, [focusedIso, viewYear, viewMonth]);
|
|
594
|
+
const disabledFor = (date) => isDisabled(date, { min, max, isDateDisallowed });
|
|
595
|
+
const page = (dir) => {
|
|
596
|
+
const step = pageBy === "single" ? 1 : months;
|
|
597
|
+
const d = new Date(viewYear, viewMonth + dir * step, 1);
|
|
598
|
+
setViewYear(d.getFullYear());
|
|
599
|
+
setViewMonth(d.getMonth());
|
|
600
|
+
setFocusedIso(void 0);
|
|
601
|
+
};
|
|
602
|
+
const select = (date) => {
|
|
603
|
+
if (disabledFor(date)) return;
|
|
604
|
+
if (!anchor) {
|
|
605
|
+
setAnchor(date);
|
|
606
|
+
setHover(void 0);
|
|
607
|
+
onRangeStart?.(date);
|
|
608
|
+
} else {
|
|
609
|
+
const pair = sortRange(anchor, date);
|
|
610
|
+
if (!controlled) setInternal(pair);
|
|
611
|
+
onChange?.(pair);
|
|
612
|
+
setAnchor(void 0);
|
|
613
|
+
setHover(void 0);
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
const moveFocus = (target) => {
|
|
617
|
+
setFocusedIso(toISO(target));
|
|
618
|
+
if (!isMonthVisible2(target, viewYear, viewMonth, months)) {
|
|
619
|
+
setViewYear(target.getFullYear());
|
|
620
|
+
setViewMonth(target.getMonth());
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
const onKeyDown = (e, date) => {
|
|
624
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
625
|
+
e.preventDefault();
|
|
626
|
+
select(date);
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
if (e.key === "Escape") {
|
|
630
|
+
if (anchor) {
|
|
631
|
+
setAnchor(void 0);
|
|
632
|
+
setHover(void 0);
|
|
379
633
|
}
|
|
380
|
-
|
|
381
|
-
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
const next = nextFocusDate(date, e.key, { shiftKey: e.shiftKey, firstDayOfWeek });
|
|
637
|
+
if (!next) return;
|
|
638
|
+
e.preventDefault();
|
|
639
|
+
moveFocus(next);
|
|
640
|
+
};
|
|
641
|
+
let paintStart;
|
|
642
|
+
let paintEnd;
|
|
643
|
+
if (anchor) {
|
|
644
|
+
const previewEnd = hover ?? (focusedIso ? parseISO(focusedIso) ?? anchor : anchor);
|
|
645
|
+
[paintStart, paintEnd] = sortRange(anchor, previewEnd);
|
|
646
|
+
} else if (committed) {
|
|
647
|
+
[paintStart, paintEnd] = sortRange(committed[0], committed[1]);
|
|
648
|
+
}
|
|
649
|
+
const anchorVisible = anchor && isMonthVisible2(anchor, viewYear, viewMonth, months) ? anchor : void 0;
|
|
650
|
+
const committedStartVisible = committed && isMonthVisible2(committed[0], viewYear, viewMonth, months) ? committed[0] : void 0;
|
|
651
|
+
const todayVisible = isMonthVisible2(today, viewYear, viewMonth, months) ? today : void 0;
|
|
652
|
+
const tabbableIso = focusedIso ?? (anchorVisible && toISO(anchorVisible)) ?? (committedStartVisible && toISO(committedStartVisible)) ?? (todayVisible && toISO(todayVisible)) ?? toISO(new Date(viewYear, viewMonth, 1));
|
|
653
|
+
const classifyDay = (date) => {
|
|
654
|
+
const isStart = !!paintStart && isSameDay(date, paintStart);
|
|
655
|
+
const isEnd = !!paintEnd && isSameDay(date, paintEnd);
|
|
656
|
+
const inRange = !!paintStart && !!paintEnd && !isStart && !isEnd && isInRange(date, paintStart, paintEnd);
|
|
657
|
+
return {
|
|
658
|
+
today: isSameDay(date, today),
|
|
659
|
+
selected: false,
|
|
660
|
+
rangeStart: isStart,
|
|
661
|
+
rangeEnd: isEnd,
|
|
662
|
+
inRange,
|
|
663
|
+
disabled: disabledFor(date),
|
|
664
|
+
tabbable: toISO(date) === tabbableIso
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
const weekdayNames = formatWeekday ? weekdayNamesFrom2(formatWeekday, firstDayOfWeek) : getWeekdayNames(locale, firstDayOfWeek);
|
|
668
|
+
const labelOfMonth = (y, m) => formatMonth ? formatMonth(new Date(y, m, 1)) : getMonthLabel(y, m, locale);
|
|
669
|
+
const labelOfDay = (d) => formatDay ? formatDay(d) : getDayLabel(d, locale);
|
|
670
|
+
const prevLabel = labels?.previousMonth ?? "Previous month";
|
|
671
|
+
const nextLabel = labels?.nextMonth ?? "Next month";
|
|
672
|
+
const count = Math.max(1, months);
|
|
673
|
+
const groupLabel = Array.from({ length: count }, (_, i) => {
|
|
674
|
+
const d = new Date(viewYear, viewMonth + i, 1);
|
|
675
|
+
return labelOfMonth(d.getFullYear(), d.getMonth());
|
|
676
|
+
}).join(", ");
|
|
677
|
+
return /* @__PURE__ */ jsx9("div", { ...rest, className: cn9(Calendar_default.calendar, className), role: "group", "aria-label": groupLabel, children: /* @__PURE__ */ jsx9("div", { className: Calendar_default.months, children: Array.from({ length: count }, (_, i) => {
|
|
678
|
+
const d = new Date(viewYear, viewMonth + i, 1);
|
|
679
|
+
return /* @__PURE__ */ jsx9(
|
|
680
|
+
MonthGrid,
|
|
681
|
+
{
|
|
682
|
+
year: d.getFullYear(),
|
|
683
|
+
month: d.getMonth(),
|
|
684
|
+
firstDayOfWeek,
|
|
685
|
+
weekdayNames,
|
|
686
|
+
monthLabel: labelOfMonth(d.getFullYear(), d.getMonth()),
|
|
687
|
+
headingId: `${headingBaseId}-${i}`,
|
|
688
|
+
showPrev: i === 0,
|
|
689
|
+
showNext: i === count - 1,
|
|
690
|
+
onPrev: () => page(-1),
|
|
691
|
+
onNext: () => page(1),
|
|
692
|
+
prevLabel,
|
|
693
|
+
nextLabel,
|
|
694
|
+
classifyDay,
|
|
695
|
+
formatDay: labelOfDay,
|
|
696
|
+
registerRef,
|
|
697
|
+
onSelect: select,
|
|
698
|
+
onKeyDown,
|
|
699
|
+
onDayPointerEnter: anchor ? ((date) => setHover(date)) : void 0
|
|
700
|
+
},
|
|
701
|
+
i
|
|
702
|
+
);
|
|
703
|
+
}) }) });
|
|
382
704
|
}
|
|
383
705
|
|
|
384
706
|
// src/components/ui/Carousel/Carousel.tsx
|
|
385
|
-
import { useRef, useId as
|
|
707
|
+
import { useRef as useRef3, useId as useId4 } from "react";
|
|
386
708
|
|
|
387
709
|
// src/components/ui/Carousel/Carousel.module.css
|
|
388
|
-
var Carousel_default = {"component":"
|
|
710
|
+
var Carousel_default = {"component":"bds2110Carousel-component","carousel":"bds2110Carousel-carousel","track":"bds2110Carousel-track","slide":"bds2110Carousel-slide","navBtn":"bds2110Carousel-navBtn"};
|
|
389
711
|
|
|
390
712
|
// src/components/ui/Carousel/Carousel.tsx
|
|
391
|
-
import { cn as
|
|
392
|
-
import { jsx as
|
|
713
|
+
import { cn as cn10 } from "@boostdev/design-system-foundation";
|
|
714
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
715
|
+
function prefersReducedMotion() {
|
|
716
|
+
return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
717
|
+
}
|
|
393
718
|
function Carousel({ items, label, className, ...rest }) {
|
|
394
|
-
const trackRef =
|
|
395
|
-
const listId =
|
|
719
|
+
const trackRef = useRef3(null);
|
|
720
|
+
const listId = useId4();
|
|
396
721
|
const scroll = (direction) => {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
722
|
+
const track = trackRef.current;
|
|
723
|
+
if (!track) return;
|
|
724
|
+
const isRtl = window.getComputedStyle(track).direction === "rtl";
|
|
725
|
+
const sign = direction === "next" ? 1 : -1;
|
|
726
|
+
track.scrollBy({
|
|
727
|
+
left: (isRtl ? -sign : sign) * track.clientWidth,
|
|
728
|
+
behavior: prefersReducedMotion() ? "auto" : "smooth"
|
|
402
729
|
});
|
|
403
730
|
};
|
|
404
|
-
return /* @__PURE__ */ jsxs6("section", { ...rest, "aria-label": label, className:
|
|
405
|
-
/* @__PURE__ */
|
|
731
|
+
return /* @__PURE__ */ jsxs6("section", { ...rest, "aria-label": label, className: cn10(Carousel_default.carousel, className), children: [
|
|
732
|
+
/* @__PURE__ */ jsx10(
|
|
406
733
|
"button",
|
|
407
734
|
{
|
|
408
735
|
type: "button",
|
|
409
|
-
className:
|
|
736
|
+
className: Carousel_default.navBtn,
|
|
410
737
|
"aria-label": "Previous",
|
|
411
738
|
"aria-controls": listId,
|
|
412
739
|
onClick: () => scroll("prev"),
|
|
413
|
-
children: /* @__PURE__ */
|
|
740
|
+
children: /* @__PURE__ */ jsx10("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx10("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) })
|
|
414
741
|
}
|
|
415
742
|
),
|
|
416
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ jsx10(
|
|
417
744
|
"div",
|
|
418
745
|
{
|
|
419
746
|
ref: trackRef,
|
|
420
747
|
id: listId,
|
|
421
748
|
role: "list",
|
|
422
749
|
className: Carousel_default.track,
|
|
423
|
-
children: items.map((item, i) => /* @__PURE__ */
|
|
750
|
+
children: items.map((item, i) => /* @__PURE__ */ jsx10("div", { role: "listitem", className: Carousel_default.slide, children: item }, i))
|
|
424
751
|
}
|
|
425
752
|
),
|
|
426
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ jsx10(
|
|
427
754
|
"button",
|
|
428
755
|
{
|
|
429
756
|
type: "button",
|
|
430
|
-
className:
|
|
757
|
+
className: Carousel_default.navBtn,
|
|
431
758
|
"aria-label": "Next",
|
|
432
759
|
"aria-controls": listId,
|
|
433
760
|
onClick: () => scroll("next"),
|
|
434
|
-
children: /* @__PURE__ */
|
|
761
|
+
children: /* @__PURE__ */ jsx10("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx10("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) })
|
|
435
762
|
}
|
|
436
763
|
)
|
|
437
764
|
] });
|
|
438
765
|
}
|
|
439
766
|
|
|
440
767
|
// src/components/ui/DescriptionList/DescriptionList.module.css
|
|
441
|
-
var DescriptionList_default = {"component":"
|
|
768
|
+
var DescriptionList_default = {"component":"bds2110DescriptionList-component","list":"bds2110DescriptionList-list","group":"bds2110DescriptionList-group","term":"bds2110DescriptionList-term","details":"bds2110DescriptionList-details","--layout_inline":"bds2110DescriptionList---layout_inline"};
|
|
442
769
|
|
|
443
770
|
// src/components/ui/DescriptionList/DescriptionList.tsx
|
|
444
|
-
import { cn as
|
|
445
|
-
import { jsx as
|
|
771
|
+
import { cn as cn11 } from "@boostdev/design-system-foundation";
|
|
772
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
446
773
|
function DescriptionList({ items, layout = "stacked", className, ...rest }) {
|
|
447
|
-
return /* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
Array.isArray(item.details) ? item.details.map((d, j) => /* @__PURE__ */
|
|
774
|
+
return /* @__PURE__ */ jsx11("dl", { ...rest, className: cn11(DescriptionList_default.list, DescriptionList_default[`--layout_${layout}`], className), children: items.map((item, i) => /* @__PURE__ */ jsxs7("div", { className: DescriptionList_default.group, children: [
|
|
775
|
+
/* @__PURE__ */ jsx11("dt", { className: DescriptionList_default.term, children: item.term }),
|
|
776
|
+
Array.isArray(item.details) ? item.details.map((d, j) => /* @__PURE__ */ jsx11("dd", { className: DescriptionList_default.details, children: d }, j)) : /* @__PURE__ */ jsx11("dd", { className: DescriptionList_default.details, children: item.details })
|
|
450
777
|
] }, i)) });
|
|
451
778
|
}
|
|
452
779
|
|
|
453
780
|
// src/components/ui/Link/Link.module.css
|
|
454
|
-
var Link_default = {"component":"
|
|
781
|
+
var Link_default = {"component":"bds2110Link-component","link":"bds2110Link-link","--variant_default":"bds2110Link---variant_default","--variant_subtle":"bds2110Link---variant_subtle","--variant_standalone":"bds2110Link---variant_standalone","externalLabel":"bds2110Link-externalLabel"};
|
|
455
782
|
|
|
456
783
|
// src/components/ui/Link/Link.tsx
|
|
457
|
-
import { cn as
|
|
458
|
-
import { jsx as
|
|
784
|
+
import { cn as cn12 } from "@boostdev/design-system-foundation";
|
|
785
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
459
786
|
function Link({
|
|
460
787
|
as,
|
|
461
788
|
children,
|
|
@@ -470,33 +797,42 @@ function Link({
|
|
|
470
797
|
return /* @__PURE__ */ jsxs8(
|
|
471
798
|
Component,
|
|
472
799
|
{
|
|
473
|
-
className:
|
|
800
|
+
className: cn12(Link_default.link, Link_default[`--variant_${variant}`], className),
|
|
474
801
|
...externalProps,
|
|
475
802
|
...props,
|
|
476
803
|
children: [
|
|
477
804
|
children,
|
|
478
|
-
external && /* @__PURE__ */
|
|
805
|
+
external && /* @__PURE__ */ jsx12("span", { className: Link_default.externalLabel, children: externalLabel })
|
|
479
806
|
]
|
|
480
807
|
}
|
|
481
808
|
);
|
|
482
809
|
}
|
|
483
810
|
|
|
484
811
|
// src/components/ui/Loading/Loading.module.css
|
|
485
|
-
var Loading_default = {"component":"
|
|
812
|
+
var Loading_default = {"component":"bds2110Loading-component","loading":"bds2110Loading-loading","spinner":"bds2110Loading-spinner","--size_small":"bds2110Loading---size_small","--size_large":"bds2110Loading---size_large"};
|
|
486
813
|
|
|
487
814
|
// src/components/ui/Loading/Loading.tsx
|
|
488
|
-
import { cn as
|
|
489
|
-
import { jsx as
|
|
490
|
-
function Loading({ size = "medium", className, ...rest }) {
|
|
491
|
-
return /* @__PURE__ */
|
|
815
|
+
import { cn as cn13 } from "@boostdev/design-system-foundation";
|
|
816
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
817
|
+
function Loading({ size = "medium", className, "aria-label": ariaLabel, ...rest }) {
|
|
818
|
+
return /* @__PURE__ */ jsx13(
|
|
819
|
+
"div",
|
|
820
|
+
{
|
|
821
|
+
role: "status",
|
|
822
|
+
"aria-label": ariaLabel ?? "Loading",
|
|
823
|
+
...rest,
|
|
824
|
+
className: cn13(Loading_default.loading, Loading_default[`--size_${size}`], className),
|
|
825
|
+
children: /* @__PURE__ */ jsx13("div", { className: Loading_default.spinner })
|
|
826
|
+
}
|
|
827
|
+
);
|
|
492
828
|
}
|
|
493
829
|
|
|
494
830
|
// src/components/ui/NotificationBanner/NotificationBanner.module.css
|
|
495
|
-
var NotificationBanner_default = {"component":"
|
|
831
|
+
var NotificationBanner_default = {"component":"bds2110NotificationBanner-component","banner":"bds2110NotificationBanner-banner","--variant_info":"bds2110NotificationBanner---variant_info","--variant_success":"bds2110NotificationBanner---variant_success","--variant_warning":"bds2110NotificationBanner---variant_warning","--variant_error":"bds2110NotificationBanner---variant_error","content":"bds2110NotificationBanner-content","action":"bds2110NotificationBanner-action","dismiss":"bds2110NotificationBanner-dismiss"};
|
|
496
832
|
|
|
497
833
|
// src/components/ui/NotificationBanner/NotificationBanner.tsx
|
|
498
|
-
import { cn as
|
|
499
|
-
import { jsx as
|
|
834
|
+
import { cn as cn14 } from "@boostdev/design-system-foundation";
|
|
835
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
500
836
|
function NotificationBanner({
|
|
501
837
|
variant = "info",
|
|
502
838
|
children,
|
|
@@ -513,18 +849,18 @@ function NotificationBanner({
|
|
|
513
849
|
role: isUrgent ? "alert" : "status",
|
|
514
850
|
"aria-live": isUrgent ? "assertive" : "polite",
|
|
515
851
|
"aria-atomic": "true",
|
|
516
|
-
className:
|
|
852
|
+
className: cn14(NotificationBanner_default.banner, NotificationBanner_default[`--variant_${variant}`], className),
|
|
517
853
|
children: [
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
action && /* @__PURE__ */
|
|
520
|
-
onDismiss && /* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ jsx14("div", { className: NotificationBanner_default.content, children }),
|
|
855
|
+
action && /* @__PURE__ */ jsx14("div", { className: NotificationBanner_default.action, children: action }),
|
|
856
|
+
onDismiss && /* @__PURE__ */ jsx14(
|
|
521
857
|
"button",
|
|
522
858
|
{
|
|
523
859
|
type: "button",
|
|
524
860
|
className: NotificationBanner_default.dismiss,
|
|
525
861
|
onClick: onDismiss,
|
|
526
862
|
"aria-label": "Dismiss notification",
|
|
527
|
-
children: /* @__PURE__ */
|
|
863
|
+
children: /* @__PURE__ */ jsx14("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx14("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18 6L6 18M6 6l12 12" }) })
|
|
528
864
|
}
|
|
529
865
|
)
|
|
530
866
|
]
|
|
@@ -533,11 +869,11 @@ function NotificationBanner({
|
|
|
533
869
|
}
|
|
534
870
|
|
|
535
871
|
// src/components/ui/Pagination/Pagination.module.css
|
|
536
|
-
var Pagination_default = {"component":"
|
|
872
|
+
var Pagination_default = {"component":"bds2110Pagination-component","pagination":"bds2110Pagination-pagination","list":"bds2110Pagination-list","button":"bds2110Pagination-button","--active":"bds2110Pagination---active","--nav":"bds2110Pagination---nav","ellipsis":"bds2110Pagination-ellipsis"};
|
|
537
873
|
|
|
538
874
|
// src/components/ui/Pagination/Pagination.tsx
|
|
539
|
-
import { cn as
|
|
540
|
-
import { jsx as
|
|
875
|
+
import { cn as cn15 } from "@boostdev/design-system-foundation";
|
|
876
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
541
877
|
function getPageRange(current, total) {
|
|
542
878
|
const delta = 1;
|
|
543
879
|
const range = [];
|
|
@@ -558,24 +894,24 @@ function Pagination({
|
|
|
558
894
|
...rest
|
|
559
895
|
}) {
|
|
560
896
|
const pages = getPageRange(currentPage, totalPages);
|
|
561
|
-
return /* @__PURE__ */
|
|
562
|
-
/* @__PURE__ */
|
|
897
|
+
return /* @__PURE__ */ jsx15("nav", { ...rest, "aria-label": "Pagination", className: cn15(Pagination_default.pagination, className), children: /* @__PURE__ */ jsxs10("ul", { className: Pagination_default.list, children: [
|
|
898
|
+
/* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15(
|
|
563
899
|
"button",
|
|
564
900
|
{
|
|
565
901
|
type: "button",
|
|
566
|
-
className:
|
|
902
|
+
className: cn15(Pagination_default.button, Pagination_default["--nav"]),
|
|
567
903
|
onClick: () => onPageChange(currentPage - 1),
|
|
568
904
|
disabled: currentPage <= 1,
|
|
569
905
|
"aria-label": "Previous page",
|
|
570
|
-
children: /* @__PURE__ */
|
|
906
|
+
children: /* @__PURE__ */ jsx15("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx15("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) })
|
|
571
907
|
}
|
|
572
908
|
) }),
|
|
573
909
|
pages.map(
|
|
574
|
-
(page, index) => page === "..." ? /* @__PURE__ */
|
|
910
|
+
(page, index) => page === "..." ? /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15("span", { className: Pagination_default.ellipsis, "aria-hidden": "true", children: "\u2026" }) }, `ellipsis-${index}`) : /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15(
|
|
575
911
|
"button",
|
|
576
912
|
{
|
|
577
913
|
type: "button",
|
|
578
|
-
className:
|
|
914
|
+
className: cn15(Pagination_default.button, currentPage === page ? Pagination_default["--active"] : void 0),
|
|
579
915
|
onClick: () => onPageChange(page),
|
|
580
916
|
"aria-label": `Page ${page}`,
|
|
581
917
|
"aria-current": currentPage === page ? "page" : void 0,
|
|
@@ -583,26 +919,26 @@ function Pagination({
|
|
|
583
919
|
}
|
|
584
920
|
) }, page)
|
|
585
921
|
),
|
|
586
|
-
/* @__PURE__ */
|
|
922
|
+
/* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15(
|
|
587
923
|
"button",
|
|
588
924
|
{
|
|
589
925
|
type: "button",
|
|
590
|
-
className:
|
|
926
|
+
className: cn15(Pagination_default.button, Pagination_default["--nav"]),
|
|
591
927
|
onClick: () => onPageChange(currentPage + 1),
|
|
592
928
|
disabled: currentPage >= totalPages,
|
|
593
929
|
"aria-label": "Next page",
|
|
594
|
-
children: /* @__PURE__ */
|
|
930
|
+
children: /* @__PURE__ */ jsx15("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx15("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) })
|
|
595
931
|
}
|
|
596
932
|
) })
|
|
597
933
|
] }) });
|
|
598
934
|
}
|
|
599
935
|
|
|
600
936
|
// src/components/ui/Progress/Progress.module.css
|
|
601
|
-
var Progress_default = {"component":"
|
|
937
|
+
var Progress_default = {"component":"bds2110Progress-component","container":"bds2110Progress-container","labelRow":"bds2110Progress-labelRow","value":"bds2110Progress-value","track":"bds2110Progress-track","--size_small":"bds2110Progress---size_small","--size_medium":"bds2110Progress---size_medium","--size_large":"bds2110Progress---size_large","fill":"bds2110Progress-fill"};
|
|
602
938
|
|
|
603
939
|
// src/components/ui/Progress/Progress.tsx
|
|
604
|
-
import { cn as
|
|
605
|
-
import { jsx as
|
|
940
|
+
import { cn as cn16 } from "@boostdev/design-system-foundation";
|
|
941
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
606
942
|
function Progress({
|
|
607
943
|
value,
|
|
608
944
|
max = 100,
|
|
@@ -613,35 +949,35 @@ function Progress({
|
|
|
613
949
|
...rest
|
|
614
950
|
}) {
|
|
615
951
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
616
|
-
return /* @__PURE__ */ jsxs11("div", { ...rest, className:
|
|
952
|
+
return /* @__PURE__ */ jsxs11("div", { ...rest, className: cn16(Progress_default.container, className), children: [
|
|
617
953
|
showLabel && /* @__PURE__ */ jsxs11("div", { className: Progress_default.labelRow, children: [
|
|
618
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ jsx16("span", { className: Progress_default.label, children: label }),
|
|
619
955
|
/* @__PURE__ */ jsxs11("span", { className: Progress_default.value, children: [
|
|
620
956
|
Math.round(percentage),
|
|
621
957
|
"%"
|
|
622
958
|
] })
|
|
623
959
|
] }),
|
|
624
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ jsx16(
|
|
625
961
|
"div",
|
|
626
962
|
{
|
|
627
963
|
role: "progressbar",
|
|
628
964
|
"aria-label": label,
|
|
629
|
-
"aria-valuenow": value,
|
|
965
|
+
"aria-valuenow": Math.min(max, Math.max(0, value)),
|
|
630
966
|
"aria-valuemin": 0,
|
|
631
967
|
"aria-valuemax": max,
|
|
632
|
-
className:
|
|
633
|
-
children: /* @__PURE__ */
|
|
968
|
+
className: cn16(Progress_default.track, Progress_default[`--size_${size}`]),
|
|
969
|
+
children: /* @__PURE__ */ jsx16("div", { className: Progress_default.fill, style: { inlineSize: `${percentage}%` } })
|
|
634
970
|
}
|
|
635
971
|
)
|
|
636
972
|
] });
|
|
637
973
|
}
|
|
638
974
|
|
|
639
975
|
// src/components/ui/ProgressCircle/ProgressCircle.module.css
|
|
640
|
-
var ProgressCircle_default = {"component":"
|
|
976
|
+
var ProgressCircle_default = {"component":"bds2110ProgressCircle-component","wrapper":"bds2110ProgressCircle-wrapper","svg":"bds2110ProgressCircle-svg","track":"bds2110ProgressCircle-track","fill":"bds2110ProgressCircle-fill","value":"bds2110ProgressCircle-value","--size_small":"bds2110ProgressCircle---size_small","--size_medium":"bds2110ProgressCircle---size_medium","--size_large":"bds2110ProgressCircle---size_large"};
|
|
641
977
|
|
|
642
978
|
// src/components/ui/ProgressCircle/ProgressCircle.tsx
|
|
643
|
-
import { cn as
|
|
644
|
-
import { jsx as
|
|
979
|
+
import { cn as cn17 } from "@boostdev/design-system-foundation";
|
|
980
|
+
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
645
981
|
var SIZE_PX = { small: 40, medium: 64, large: 96 };
|
|
646
982
|
var STROKE_WIDTH = 4;
|
|
647
983
|
function ProgressCircle({
|
|
@@ -665,10 +1001,10 @@ function ProgressCircle({
|
|
|
665
1001
|
...rest,
|
|
666
1002
|
role: "progressbar",
|
|
667
1003
|
"aria-label": label,
|
|
668
|
-
"aria-valuenow": value,
|
|
1004
|
+
"aria-valuenow": Math.min(max, Math.max(0, value)),
|
|
669
1005
|
"aria-valuemin": 0,
|
|
670
1006
|
"aria-valuemax": max,
|
|
671
|
-
className:
|
|
1007
|
+
className: cn17(ProgressCircle_default.wrapper, ProgressCircle_default[`--size_${size}`], className),
|
|
672
1008
|
children: [
|
|
673
1009
|
/* @__PURE__ */ jsxs12(
|
|
674
1010
|
"svg",
|
|
@@ -679,7 +1015,7 @@ function ProgressCircle({
|
|
|
679
1015
|
"aria-hidden": "true",
|
|
680
1016
|
className: ProgressCircle_default.svg,
|
|
681
1017
|
children: [
|
|
682
|
-
/* @__PURE__ */
|
|
1018
|
+
/* @__PURE__ */ jsx17(
|
|
683
1019
|
"circle",
|
|
684
1020
|
{
|
|
685
1021
|
className: ProgressCircle_default.track,
|
|
@@ -690,7 +1026,7 @@ function ProgressCircle({
|
|
|
690
1026
|
fill: "none"
|
|
691
1027
|
}
|
|
692
1028
|
),
|
|
693
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ jsx17(
|
|
694
1030
|
"circle",
|
|
695
1031
|
{
|
|
696
1032
|
className: ProgressCircle_default.fill,
|
|
@@ -718,54 +1054,57 @@ function ProgressCircle({
|
|
|
718
1054
|
}
|
|
719
1055
|
|
|
720
1056
|
// src/components/ui/Separator/Separator.module.css
|
|
721
|
-
var Separator_default = {"component":"
|
|
1057
|
+
var Separator_default = {"component":"bds2110Separator-component","separator":"bds2110Separator-separator","--horizontal":"bds2110Separator---horizontal","--vertical":"bds2110Separator---vertical"};
|
|
722
1058
|
|
|
723
1059
|
// src/components/ui/Separator/Separator.tsx
|
|
724
|
-
import { cn as
|
|
725
|
-
import { jsx as
|
|
1060
|
+
import { cn as cn18 } from "@boostdev/design-system-foundation";
|
|
1061
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
726
1062
|
function Separator({ orientation = "horizontal", className, ...rest }) {
|
|
727
1063
|
if (orientation === "vertical") {
|
|
728
|
-
return /* @__PURE__ */
|
|
1064
|
+
return /* @__PURE__ */ jsx18(
|
|
729
1065
|
"div",
|
|
730
1066
|
{
|
|
731
1067
|
...rest,
|
|
732
1068
|
role: "separator",
|
|
733
1069
|
"aria-orientation": "vertical",
|
|
734
|
-
className:
|
|
1070
|
+
className: cn18(Separator_default.separator, Separator_default["--vertical"], className)
|
|
735
1071
|
}
|
|
736
1072
|
);
|
|
737
1073
|
}
|
|
738
|
-
return /* @__PURE__ */
|
|
1074
|
+
return /* @__PURE__ */ jsx18("hr", { ...rest, "aria-orientation": "horizontal", className: cn18(Separator_default.separator, Separator_default["--horizontal"], className) });
|
|
739
1075
|
}
|
|
740
1076
|
|
|
741
1077
|
// src/components/ui/Skeleton/Skeleton.tsx
|
|
742
|
-
import { cn as
|
|
1078
|
+
import { cn as cn19 } from "@boostdev/design-system-foundation";
|
|
743
1079
|
|
|
744
1080
|
// src/components/ui/Skeleton/Skeleton.module.css
|
|
745
|
-
var Skeleton_default = {"component":"
|
|
1081
|
+
var Skeleton_default = {"component":"bds2110Skeleton-component","skeleton":"bds2110Skeleton-skeleton"};
|
|
746
1082
|
|
|
747
1083
|
// src/components/ui/Skeleton/Skeleton.tsx
|
|
748
|
-
import { jsx as
|
|
1084
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
749
1085
|
function Skeleton({ className, ...rest }) {
|
|
750
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ jsx19("div", { ...rest, "aria-hidden": "true", className: cn19(Skeleton_default.skeleton, className) });
|
|
751
1087
|
}
|
|
752
1088
|
|
|
753
1089
|
// src/components/ui/SkipLink/SkipLink.module.css
|
|
754
|
-
var SkipLink_default = {"component":"
|
|
1090
|
+
var SkipLink_default = {"component":"bds2110SkipLink-component","skipLink":"bds2110SkipLink-skipLink"};
|
|
755
1091
|
|
|
756
1092
|
// src/components/ui/SkipLink/SkipLink.tsx
|
|
757
|
-
import { cn as
|
|
758
|
-
import { jsx as
|
|
1093
|
+
import { cn as cn20 } from "@boostdev/design-system-foundation";
|
|
1094
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
759
1095
|
function SkipLink({ href = "#main", children = "Skip to main content", className, ...rest }) {
|
|
760
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ jsx20("a", { ...rest, href, className: cn20(SkipLink_default.skipLink, className), children });
|
|
761
1097
|
}
|
|
762
1098
|
|
|
1099
|
+
// src/components/ui/Table/Table.tsx
|
|
1100
|
+
import { useId as useId5 } from "react";
|
|
1101
|
+
|
|
763
1102
|
// src/components/ui/Table/Table.module.css
|
|
764
|
-
var Table_default = {"component":"
|
|
1103
|
+
var Table_default = {"component":"bds2110Table-component","wrapper":"bds2110Table-wrapper","table":"bds2110Table-table","caption":"bds2110Table-caption","thead":"bds2110Table-thead","th":"bds2110Table-th","--sortable":"bds2110Table---sortable","sortButton":"bds2110Table-sortButton","sortIcon":"bds2110Table-sortIcon","--sort-active":"bds2110Table---sort-active","--sort-desc":"bds2110Table---sort-desc","tbody":"bds2110Table-tbody","tr":"bds2110Table-tr","td":"bds2110Table-td"};
|
|
765
1104
|
|
|
766
1105
|
// src/components/ui/Table/Table.tsx
|
|
767
|
-
import { cn as
|
|
768
|
-
import { jsx as
|
|
1106
|
+
import { cn as cn21 } from "@boostdev/design-system-foundation";
|
|
1107
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
769
1108
|
function Table({
|
|
770
1109
|
columns,
|
|
771
1110
|
rows,
|
|
@@ -773,8 +1112,14 @@ function Table({
|
|
|
773
1112
|
sortKey,
|
|
774
1113
|
sortDirection,
|
|
775
1114
|
onSort,
|
|
776
|
-
|
|
1115
|
+
rowKey,
|
|
1116
|
+
className,
|
|
1117
|
+
...rest
|
|
777
1118
|
}) {
|
|
1119
|
+
const generatedId = useId5();
|
|
1120
|
+
const captionId = caption ? `${generatedId}-caption` : void 0;
|
|
1121
|
+
const hasCustomLabel = "aria-label" in rest || "aria-labelledby" in rest;
|
|
1122
|
+
const hasAccessibleName = Boolean(caption) || hasCustomLabel;
|
|
778
1123
|
const handleSort = (key) => {
|
|
779
1124
|
if (!onSort) return;
|
|
780
1125
|
const nextDirection = sortKey === key && sortDirection === "asc" ? "desc" : "asc";
|
|
@@ -784,62 +1129,81 @@ function Table({
|
|
|
784
1129
|
if (sortKey !== key) return "none";
|
|
785
1130
|
return sortDirection === "asc" ? "ascending" : "descending";
|
|
786
1131
|
};
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
1132
|
+
const getSortAriaLabel = (col) => {
|
|
1133
|
+
const label = col.sortLabel ?? (typeof col.header === "string" ? col.header : void 0);
|
|
1134
|
+
if (!label) return void 0;
|
|
1135
|
+
const stateSuffix = sortKey === col.key ? `, currently ${sortDirection === "asc" ? "ascending" : "descending"}` : "";
|
|
1136
|
+
return `Sort by ${label}${stateSuffix}`;
|
|
1137
|
+
};
|
|
1138
|
+
return /* @__PURE__ */ jsx21(
|
|
1139
|
+
"div",
|
|
1140
|
+
{
|
|
1141
|
+
...rest,
|
|
1142
|
+
className: cn21(Table_default.wrapper, className),
|
|
1143
|
+
tabIndex: rest.tabIndex ?? 0,
|
|
1144
|
+
role: hasAccessibleName ? "region" : void 0,
|
|
1145
|
+
"aria-labelledby": hasCustomLabel ? rest["aria-labelledby"] : captionId,
|
|
1146
|
+
children: /* @__PURE__ */ jsxs13("table", { className: Table_default.table, children: [
|
|
1147
|
+
caption && /* @__PURE__ */ jsx21("caption", { id: captionId, className: Table_default.caption, children: caption }),
|
|
1148
|
+
/* @__PURE__ */ jsx21("thead", { className: Table_default.thead, children: /* @__PURE__ */ jsx21("tr", { children: columns.map((col) => /* @__PURE__ */ jsx21(
|
|
1149
|
+
"th",
|
|
797
1150
|
{
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
1151
|
+
scope: "col",
|
|
1152
|
+
"aria-sort": col.sortable ? getAriaSort(col.key) : void 0,
|
|
1153
|
+
className: cn21(Table_default.th, col.sortable ? Table_default["--sortable"] : void 0),
|
|
1154
|
+
children: col.sortable ? /* @__PURE__ */ jsxs13(
|
|
1155
|
+
"button",
|
|
1156
|
+
{
|
|
1157
|
+
type: "button",
|
|
1158
|
+
className: Table_default.sortButton,
|
|
1159
|
+
onClick: () => handleSort(col.key),
|
|
1160
|
+
"aria-label": getSortAriaLabel(col),
|
|
1161
|
+
children: [
|
|
1162
|
+
col.header,
|
|
1163
|
+
/* @__PURE__ */ jsx21(
|
|
1164
|
+
"svg",
|
|
1165
|
+
{
|
|
1166
|
+
"aria-hidden": "true",
|
|
1167
|
+
className: cn21(
|
|
1168
|
+
Table_default.sortIcon,
|
|
1169
|
+
sortKey === col.key ? Table_default["--sort-active"] : void 0,
|
|
1170
|
+
sortKey === col.key && sortDirection === "desc" ? Table_default["--sort-desc"] : void 0
|
|
1171
|
+
),
|
|
1172
|
+
viewBox: "0 0 24 24",
|
|
1173
|
+
fill: "none",
|
|
1174
|
+
stroke: "currentColor",
|
|
1175
|
+
strokeWidth: "2",
|
|
1176
|
+
children: /* @__PURE__ */ jsx21("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 9l6 6 6-6" })
|
|
1177
|
+
}
|
|
1178
|
+
)
|
|
1179
|
+
]
|
|
1180
|
+
}
|
|
1181
|
+
) : col.header
|
|
1182
|
+
},
|
|
1183
|
+
col.key
|
|
1184
|
+
)) }) }),
|
|
1185
|
+
/* @__PURE__ */ jsx21("tbody", { className: Table_default.tbody, children: rows.map((row, rowIndex) => /* @__PURE__ */ jsx21("tr", { className: Table_default.tr, children: columns.map((col) => /* @__PURE__ */ jsx21("td", { className: Table_default.td, children: col.render ? col.render(row) : String(row[col.key] ?? "") }, col.key)) }, rowKey?.(row, rowIndex) ?? rowIndex)) })
|
|
1186
|
+
] })
|
|
1187
|
+
}
|
|
1188
|
+
);
|
|
828
1189
|
}
|
|
829
1190
|
|
|
830
1191
|
// src/components/ui/Tabs/Tabs.tsx
|
|
831
|
-
import { useId as
|
|
1192
|
+
import { useId as useId6, useRef as useRef4, useState as useState4 } from "react";
|
|
832
1193
|
|
|
833
1194
|
// src/components/ui/Tabs/Tabs.module.css
|
|
834
|
-
var Tabs_default = {"component":"
|
|
1195
|
+
var Tabs_default = {"component":"bds2110Tabs-component","tabs":"bds2110Tabs-tabs","tabList":"bds2110Tabs-tabList","tab":"bds2110Tabs-tab","--active":"bds2110Tabs---active","panel":"bds2110Tabs-panel"};
|
|
835
1196
|
|
|
836
1197
|
// src/components/ui/Tabs/Tabs.tsx
|
|
837
|
-
import { cn as
|
|
838
|
-
import { jsx as
|
|
1198
|
+
import { cn as cn22 } from "@boostdev/design-system-foundation";
|
|
1199
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
839
1200
|
function Tabs({ tabs, defaultTab, className, ...rest }) {
|
|
840
|
-
const baseId =
|
|
841
|
-
const [activeTab, setActiveTab] =
|
|
842
|
-
|
|
1201
|
+
const baseId = useId6();
|
|
1202
|
+
const [activeTab, setActiveTab] = useState4(() => {
|
|
1203
|
+
const initialTab = tabs.find((tab) => tab.id === defaultTab && !tab.disabled) ?? tabs.find((tab) => !tab.disabled);
|
|
1204
|
+
return initialTab?.id;
|
|
1205
|
+
});
|
|
1206
|
+
const tabRefs = useRef4([]);
|
|
843
1207
|
const enabledIndexes = tabs.map((tab, i) => ({ tab, i })).filter(({ tab }) => !tab.disabled).map(({ i }) => i);
|
|
844
1208
|
const handleKeyDown = (e, index) => {
|
|
845
1209
|
const pos = enabledIndexes.indexOf(index);
|
|
@@ -861,12 +1225,12 @@ function Tabs({ tabs, defaultTab, className, ...rest }) {
|
|
|
861
1225
|
focusAt(enabledIndexes[enabledIndexes.length - 1]);
|
|
862
1226
|
}
|
|
863
1227
|
};
|
|
864
|
-
return /* @__PURE__ */ jsxs14("div", { ...rest, className:
|
|
865
|
-
/* @__PURE__ */
|
|
1228
|
+
return /* @__PURE__ */ jsxs14("div", { ...rest, className: cn22(Tabs_default.tabs, className), children: [
|
|
1229
|
+
/* @__PURE__ */ jsx22("div", { role: "tablist", className: Tabs_default.tabList, children: tabs.map((tab, i) => {
|
|
866
1230
|
const tabId = `${baseId}-tab-${tab.id}`;
|
|
867
1231
|
const panelId = `${baseId}-panel-${tab.id}`;
|
|
868
1232
|
const isActive = activeTab === tab.id;
|
|
869
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ jsx22(
|
|
870
1234
|
"button",
|
|
871
1235
|
{
|
|
872
1236
|
ref: (el) => {
|
|
@@ -879,7 +1243,7 @@ function Tabs({ tabs, defaultTab, className, ...rest }) {
|
|
|
879
1243
|
"aria-controls": panelId,
|
|
880
1244
|
tabIndex: isActive ? 0 : -1,
|
|
881
1245
|
disabled: tab.disabled,
|
|
882
|
-
className:
|
|
1246
|
+
className: cn22(Tabs_default.tab, isActive ? Tabs_default["--active"] : void 0),
|
|
883
1247
|
onClick: () => setActiveTab(tab.id),
|
|
884
1248
|
onKeyDown: (e) => handleKeyDown(e, i),
|
|
885
1249
|
children: tab.label
|
|
@@ -891,13 +1255,14 @@ function Tabs({ tabs, defaultTab, className, ...rest }) {
|
|
|
891
1255
|
const tabId = `${baseId}-tab-${tab.id}`;
|
|
892
1256
|
const panelId = `${baseId}-panel-${tab.id}`;
|
|
893
1257
|
const isActive = activeTab === tab.id;
|
|
894
|
-
return /* @__PURE__ */
|
|
1258
|
+
return /* @__PURE__ */ jsx22(
|
|
895
1259
|
"div",
|
|
896
1260
|
{
|
|
897
1261
|
id: panelId,
|
|
898
1262
|
role: "tabpanel",
|
|
899
1263
|
"aria-labelledby": tabId,
|
|
900
1264
|
hidden: !isActive,
|
|
1265
|
+
tabIndex: 0,
|
|
901
1266
|
className: Tabs_default.panel,
|
|
902
1267
|
children: tab.content
|
|
903
1268
|
},
|
|
@@ -908,14 +1273,19 @@ function Tabs({ tabs, defaultTab, className, ...rest }) {
|
|
|
908
1273
|
}
|
|
909
1274
|
|
|
910
1275
|
// src/components/ui/Tooltip/Tooltip.tsx
|
|
911
|
-
import {
|
|
1276
|
+
import {
|
|
1277
|
+
cloneElement,
|
|
1278
|
+
isValidElement,
|
|
1279
|
+
useId as useId7,
|
|
1280
|
+
useState as useState5
|
|
1281
|
+
} from "react";
|
|
912
1282
|
|
|
913
1283
|
// src/components/ui/Tooltip/Tooltip.module.css
|
|
914
|
-
var Tooltip_default = {"component":"
|
|
1284
|
+
var Tooltip_default = {"component":"bds2110Tooltip-component","wrapper":"bds2110Tooltip-wrapper","tooltip":"bds2110Tooltip-tooltip","--visible":"bds2110Tooltip---visible","--placement_top":"bds2110Tooltip---placement_top","--placement_bottom":"bds2110Tooltip---placement_bottom","--placement_left":"bds2110Tooltip---placement_left","--placement_right":"bds2110Tooltip---placement_right"};
|
|
915
1285
|
|
|
916
1286
|
// src/components/ui/Tooltip/Tooltip.tsx
|
|
917
|
-
import { cn as
|
|
918
|
-
import { jsx as
|
|
1287
|
+
import { cn as cn23 } from "@boostdev/design-system-foundation";
|
|
1288
|
+
import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
919
1289
|
function Tooltip({
|
|
920
1290
|
content,
|
|
921
1291
|
placement = "top",
|
|
@@ -923,8 +1293,15 @@ function Tooltip({
|
|
|
923
1293
|
className,
|
|
924
1294
|
...rest
|
|
925
1295
|
}) {
|
|
926
|
-
const tooltipId =
|
|
927
|
-
const [isVisible, setIsVisible] =
|
|
1296
|
+
const tooltipId = useId7();
|
|
1297
|
+
const [isVisible, setIsVisible] = useState5(false);
|
|
1298
|
+
const show = () => setIsVisible(true);
|
|
1299
|
+
const hide = () => setIsVisible(false);
|
|
1300
|
+
const handleKeyDown = (event) => {
|
|
1301
|
+
if (event.key === "Escape" && isVisible) {
|
|
1302
|
+
hide();
|
|
1303
|
+
}
|
|
1304
|
+
};
|
|
928
1305
|
const trigger = isValidElement(children) ? cloneElement(children, {
|
|
929
1306
|
"aria-describedby": tooltipId
|
|
930
1307
|
}) : children;
|
|
@@ -932,20 +1309,21 @@ function Tooltip({
|
|
|
932
1309
|
"span",
|
|
933
1310
|
{
|
|
934
1311
|
...rest,
|
|
935
|
-
className:
|
|
936
|
-
onMouseEnter:
|
|
937
|
-
onMouseLeave:
|
|
938
|
-
onFocus:
|
|
939
|
-
onBlur:
|
|
1312
|
+
className: cn23(Tooltip_default.wrapper, className),
|
|
1313
|
+
onMouseEnter: show,
|
|
1314
|
+
onMouseLeave: hide,
|
|
1315
|
+
onFocus: show,
|
|
1316
|
+
onBlur: hide,
|
|
1317
|
+
onKeyDown: handleKeyDown,
|
|
940
1318
|
children: [
|
|
941
1319
|
trigger,
|
|
942
|
-
/* @__PURE__ */
|
|
1320
|
+
/* @__PURE__ */ jsx23(
|
|
943
1321
|
"span",
|
|
944
1322
|
{
|
|
945
1323
|
id: tooltipId,
|
|
946
1324
|
role: "tooltip",
|
|
947
|
-
|
|
948
|
-
className:
|
|
1325
|
+
hidden: !isVisible,
|
|
1326
|
+
className: cn23(Tooltip_default.tooltip, Tooltip_default[`--placement_${placement}`], isVisible && Tooltip_default["--visible"]),
|
|
949
1327
|
children: content
|
|
950
1328
|
}
|
|
951
1329
|
)
|
|
@@ -955,11 +1333,11 @@ function Tooltip({
|
|
|
955
1333
|
}
|
|
956
1334
|
|
|
957
1335
|
// src/components/ui/Typography/Typography.module.css
|
|
958
|
-
var Typography_default = {"component":"
|
|
1336
|
+
var Typography_default = {"component":"bds2110Typography-component","typography":"bds2110Typography-typography","--h1":"bds2110Typography---h1","--h2":"bds2110Typography---h2","--h3":"bds2110Typography---h3","--body":"bds2110Typography---body","--body_s":"bds2110Typography---body_s"};
|
|
959
1337
|
|
|
960
1338
|
// src/components/ui/Typography/Typography.tsx
|
|
961
|
-
import { cn as
|
|
962
|
-
import { jsx as
|
|
1339
|
+
import { cn as cn24 } from "@boostdev/design-system-foundation";
|
|
1340
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
963
1341
|
var variantToElement = {
|
|
964
1342
|
h1: "h1",
|
|
965
1343
|
h2: "h2",
|
|
@@ -969,15 +1347,15 @@ var variantToElement = {
|
|
|
969
1347
|
};
|
|
970
1348
|
function Typography({ variant = "body", component, children, className, ...rest }) {
|
|
971
1349
|
const Component = component || variantToElement[variant];
|
|
972
|
-
return /* @__PURE__ */
|
|
1350
|
+
return /* @__PURE__ */ jsx24(Component, { ...rest, className: cn24(Typography_default.typography, Typography_default[`--${variant}`], className), children });
|
|
973
1351
|
}
|
|
974
1352
|
|
|
975
1353
|
// src/components/interaction/Button/Button.module.css
|
|
976
|
-
var Button_default = {"component":"
|
|
1354
|
+
var Button_default = {"component":"bds2110Button-component","button":"bds2110Button-button","--default":"bds2110Button---default","--outline":"bds2110Button---outline","--ghost":"bds2110Button---ghost","--size_small":"bds2110Button---size_small","--size_medium":"bds2110Button---size_medium","--size_large":"bds2110Button---size_large","--hasPulse":"bds2110Button---hasPulse","iconStart":"bds2110Button-iconStart","iconEnd":"bds2110Button-iconEnd","--iconOnly":"bds2110Button---iconOnly"};
|
|
977
1355
|
|
|
978
1356
|
// src/components/interaction/Button/Button.tsx
|
|
979
|
-
import { cn as
|
|
980
|
-
import { Fragment as Fragment2, jsx as
|
|
1357
|
+
import { cn as cn25 } from "@boostdev/design-system-foundation";
|
|
1358
|
+
import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
981
1359
|
function Button({
|
|
982
1360
|
children,
|
|
983
1361
|
className,
|
|
@@ -995,7 +1373,7 @@ function Button({
|
|
|
995
1373
|
onClick,
|
|
996
1374
|
...rest
|
|
997
1375
|
}) {
|
|
998
|
-
const classNames =
|
|
1376
|
+
const classNames = cn25(
|
|
999
1377
|
Button_default.button,
|
|
1000
1378
|
Button_default[`--${variant}`],
|
|
1001
1379
|
Button_default[`--size_${size}`],
|
|
@@ -1014,14 +1392,15 @@ function Button({
|
|
|
1014
1392
|
onClick?.(e);
|
|
1015
1393
|
};
|
|
1016
1394
|
const content = /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
1017
|
-
Boolean(iconStart) && /* @__PURE__ */
|
|
1395
|
+
Boolean(iconStart) && /* @__PURE__ */ jsx25("span", { className: Button_default.iconStart, children: iconStart }),
|
|
1018
1396
|
children,
|
|
1019
|
-
Boolean(iconEnd) && /* @__PURE__ */
|
|
1397
|
+
Boolean(iconEnd) && /* @__PURE__ */ jsx25("span", { className: Button_default.iconEnd, children: iconEnd })
|
|
1020
1398
|
] });
|
|
1021
1399
|
if (href) {
|
|
1022
|
-
return /* @__PURE__ */
|
|
1400
|
+
return /* @__PURE__ */ jsx25(
|
|
1023
1401
|
"a",
|
|
1024
1402
|
{
|
|
1403
|
+
...rest,
|
|
1025
1404
|
className: classNames,
|
|
1026
1405
|
href: disabled ? void 0 : href,
|
|
1027
1406
|
target,
|
|
@@ -1029,26 +1408,25 @@ function Button({
|
|
|
1029
1408
|
"aria-disabled": disabled,
|
|
1030
1409
|
tabIndex: disabled ? -1 : void 0,
|
|
1031
1410
|
onClick: handleAnchorClick,
|
|
1032
|
-
...rest,
|
|
1033
1411
|
children: content
|
|
1034
1412
|
}
|
|
1035
1413
|
);
|
|
1036
1414
|
}
|
|
1037
|
-
return /* @__PURE__ */
|
|
1415
|
+
return /* @__PURE__ */ jsx25(
|
|
1038
1416
|
"button",
|
|
1039
1417
|
{
|
|
1418
|
+
...rest,
|
|
1040
1419
|
type,
|
|
1041
1420
|
className: classNames,
|
|
1042
1421
|
disabled,
|
|
1043
1422
|
onClick: handleButtonClick,
|
|
1044
|
-
...rest,
|
|
1045
1423
|
children: content
|
|
1046
1424
|
}
|
|
1047
1425
|
);
|
|
1048
1426
|
}
|
|
1049
1427
|
|
|
1050
1428
|
// src/components/interaction/Command/Command.tsx
|
|
1051
|
-
import { useState as
|
|
1429
|
+
import { useState as useState6, useEffect as useEffect3, useRef as useRef5, useId as useId8, useMemo } from "react";
|
|
1052
1430
|
|
|
1053
1431
|
// src/polyfill-invoker-commands.ts
|
|
1054
1432
|
var installed = false;
|
|
@@ -1090,11 +1468,11 @@ function installInvokerCommandsPolyfill() {
|
|
|
1090
1468
|
}
|
|
1091
1469
|
|
|
1092
1470
|
// src/components/interaction/Command/Command.module.css
|
|
1093
|
-
var Command_default = {"component":"
|
|
1471
|
+
var Command_default = {"component":"bds2110Command-component","dialog":"bds2110Command-dialog","palette":"bds2110Command-palette","searchRow":"bds2110Command-searchRow","searchIcon":"bds2110Command-searchIcon","search":"bds2110Command-search","escHint":"bds2110Command-escHint","list":"bds2110Command-list","groupList":"bds2110Command-groupList","group":"bds2110Command-group","item":"bds2110Command-item","itemActive":"bds2110Command-itemActive","itemLabel":"bds2110Command-itemLabel","itemDesc":"bds2110Command-itemDesc","shortcut":"bds2110Command-shortcut","empty":"bds2110Command-empty","srOnly":"bds2110Command-srOnly"};
|
|
1094
1472
|
|
|
1095
1473
|
// src/components/interaction/Command/Command.tsx
|
|
1096
|
-
import { cn as
|
|
1097
|
-
import { jsx as
|
|
1474
|
+
import { cn as cn26 } from "@boostdev/design-system-foundation";
|
|
1475
|
+
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1098
1476
|
installInvokerCommandsPolyfill();
|
|
1099
1477
|
function Command({
|
|
1100
1478
|
id: idProp,
|
|
@@ -1106,13 +1484,13 @@ function Command({
|
|
|
1106
1484
|
className,
|
|
1107
1485
|
...rest
|
|
1108
1486
|
}) {
|
|
1109
|
-
const [query, setQuery] =
|
|
1110
|
-
const [activeIndex, setActiveIndex] =
|
|
1111
|
-
const generatedId =
|
|
1487
|
+
const [query, setQuery] = useState6("");
|
|
1488
|
+
const [activeIndex, setActiveIndex] = useState6(0);
|
|
1489
|
+
const generatedId = useId8();
|
|
1112
1490
|
const dialogId = idProp ?? generatedId;
|
|
1113
|
-
const dialogRef =
|
|
1114
|
-
const inputRef =
|
|
1115
|
-
const listboxId =
|
|
1491
|
+
const dialogRef = useRef5(null);
|
|
1492
|
+
const inputRef = useRef5(null);
|
|
1493
|
+
const listboxId = useId8();
|
|
1116
1494
|
const filtered = useMemo(() => {
|
|
1117
1495
|
const q = query.toLowerCase().trim();
|
|
1118
1496
|
return q ? items.filter(
|
|
@@ -1129,8 +1507,8 @@ function Command({
|
|
|
1129
1507
|
});
|
|
1130
1508
|
return map;
|
|
1131
1509
|
}, [filtered]);
|
|
1132
|
-
const triggerRef =
|
|
1133
|
-
|
|
1510
|
+
const triggerRef = useRef5(null);
|
|
1511
|
+
useEffect3(() => {
|
|
1134
1512
|
const dialog = dialogRef.current;
|
|
1135
1513
|
if (!dialog) return;
|
|
1136
1514
|
if (isOpen && !dialog.open) {
|
|
@@ -1149,10 +1527,10 @@ function Command({
|
|
|
1149
1527
|
document.body.style.overflow = "";
|
|
1150
1528
|
};
|
|
1151
1529
|
}, [isOpen]);
|
|
1152
|
-
|
|
1530
|
+
useEffect3(() => {
|
|
1153
1531
|
setActiveIndex(0);
|
|
1154
1532
|
}, [query]);
|
|
1155
|
-
|
|
1533
|
+
useEffect3(() => {
|
|
1156
1534
|
const dialog = dialogRef.current;
|
|
1157
1535
|
if (!dialog) return;
|
|
1158
1536
|
const handleCommand = (e) => {
|
|
@@ -1186,8 +1564,11 @@ function Command({
|
|
|
1186
1564
|
setActiveIndex((i) => Math.max(i - 1, 0));
|
|
1187
1565
|
} else if (e.key === "Enter") {
|
|
1188
1566
|
e.preventDefault();
|
|
1189
|
-
filtered[activeIndex]
|
|
1190
|
-
|
|
1567
|
+
const item = filtered[activeIndex];
|
|
1568
|
+
if (item) {
|
|
1569
|
+
item.onSelect();
|
|
1570
|
+
onClose();
|
|
1571
|
+
}
|
|
1191
1572
|
} else if (e.key === "Escape") {
|
|
1192
1573
|
onClose();
|
|
1193
1574
|
}
|
|
@@ -1196,28 +1577,29 @@ function Command({
|
|
|
1196
1577
|
item.onSelect();
|
|
1197
1578
|
onClose();
|
|
1198
1579
|
};
|
|
1199
|
-
return /* @__PURE__ */
|
|
1580
|
+
return /* @__PURE__ */ jsx26(
|
|
1200
1581
|
"dialog",
|
|
1201
1582
|
{
|
|
1202
1583
|
...rest,
|
|
1203
1584
|
ref: dialogRef,
|
|
1204
1585
|
id: dialogId,
|
|
1205
|
-
className:
|
|
1586
|
+
className: cn26(Command_default.dialog, className),
|
|
1206
1587
|
"aria-label": "Command palette",
|
|
1207
1588
|
"aria-modal": "true",
|
|
1208
1589
|
onCancel: handleCancel,
|
|
1209
1590
|
children: /* @__PURE__ */ jsxs17("div", { className: Command_default.palette, onKeyDown: handleKeyDown, children: [
|
|
1210
1591
|
/* @__PURE__ */ jsxs17("div", { className: Command_default.searchRow, children: [
|
|
1211
1592
|
/* @__PURE__ */ jsxs17("svg", { "aria-hidden": "true", className: Command_default.searchIcon, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
/* @__PURE__ */
|
|
1593
|
+
/* @__PURE__ */ jsx26("circle", { cx: "11", cy: "11", r: "8" }),
|
|
1594
|
+
/* @__PURE__ */ jsx26("path", { strokeLinecap: "round", d: "M21 21l-4.35-4.35" })
|
|
1214
1595
|
] }),
|
|
1215
|
-
/* @__PURE__ */
|
|
1596
|
+
/* @__PURE__ */ jsx26(
|
|
1216
1597
|
"input",
|
|
1217
1598
|
{
|
|
1218
1599
|
ref: inputRef,
|
|
1219
1600
|
type: "search",
|
|
1220
1601
|
role: "combobox",
|
|
1602
|
+
"aria-label": "Search commands",
|
|
1221
1603
|
"aria-expanded": filtered.length > 0,
|
|
1222
1604
|
"aria-controls": listboxId,
|
|
1223
1605
|
"aria-autocomplete": "list",
|
|
@@ -1228,11 +1610,12 @@ function Command({
|
|
|
1228
1610
|
onChange: (e) => setQuery(e.target.value)
|
|
1229
1611
|
}
|
|
1230
1612
|
),
|
|
1231
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ jsx26("kbd", { className: Command_default.escHint, children: "Esc" })
|
|
1232
1614
|
] }),
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
/* @__PURE__ */
|
|
1615
|
+
/* @__PURE__ */ jsx26("div", { className: Command_default.srOnly, "aria-live": "polite", children: filtered.length === 0 ? `Nothing matches \u201C${query}\u201D` : "" }),
|
|
1616
|
+
filtered.length > 0 ? /* @__PURE__ */ jsx26("ul", { id: listboxId, role: "listbox", className: Command_default.list, "aria-label": "Commands", children: Array.from(groups.entries()).map(([group, groupItems]) => /* @__PURE__ */ jsxs17("li", { role: "presentation", children: [
|
|
1617
|
+
group && /* @__PURE__ */ jsx26("div", { className: Command_default.group, role: "presentation", children: group }),
|
|
1618
|
+
/* @__PURE__ */ jsx26("ul", { role: "group", "aria-label": group || void 0, className: Command_default.groupList, children: groupItems.map((item) => {
|
|
1236
1619
|
const flatIndex = filtered.indexOf(item);
|
|
1237
1620
|
const isActive = flatIndex === activeIndex;
|
|
1238
1621
|
return /* @__PURE__ */ jsxs17(
|
|
@@ -1241,19 +1624,19 @@ function Command({
|
|
|
1241
1624
|
id: `cmd-${item.id}`,
|
|
1242
1625
|
role: "option",
|
|
1243
1626
|
"aria-selected": isActive,
|
|
1244
|
-
className:
|
|
1627
|
+
className: cn26(Command_default.item, isActive && Command_default.itemActive),
|
|
1245
1628
|
onPointerDown: (e) => e.preventDefault(),
|
|
1246
1629
|
onClick: () => selectItem(item),
|
|
1247
1630
|
children: [
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
item.description && /* @__PURE__ */
|
|
1250
|
-
item.shortcut && /* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ jsx26("span", { className: Command_default.itemLabel, children: item.label }),
|
|
1632
|
+
item.description && /* @__PURE__ */ jsx26("span", { className: Command_default.itemDesc, children: item.description }),
|
|
1633
|
+
item.shortcut && /* @__PURE__ */ jsx26("kbd", { className: Command_default.shortcut, children: item.shortcut })
|
|
1251
1634
|
]
|
|
1252
1635
|
},
|
|
1253
1636
|
item.id
|
|
1254
1637
|
);
|
|
1255
1638
|
}) })
|
|
1256
|
-
] }, group)) }) : /* @__PURE__ */ jsxs17("div", { className: Command_default.empty,
|
|
1639
|
+
] }, group)) }) : /* @__PURE__ */ jsxs17("div", { className: Command_default.empty, children: [
|
|
1257
1640
|
"No results for \u201C",
|
|
1258
1641
|
query,
|
|
1259
1642
|
"\u201D"
|
|
@@ -1264,22 +1647,22 @@ function Command({
|
|
|
1264
1647
|
}
|
|
1265
1648
|
|
|
1266
1649
|
// src/components/interaction/Dialog/Dialog.tsx
|
|
1267
|
-
import { useEffect as
|
|
1650
|
+
import { useEffect as useEffect4, useId as useId9, useRef as useRef6 } from "react";
|
|
1268
1651
|
|
|
1269
1652
|
// src/components/interaction/Dialog/Dialog.module.css
|
|
1270
|
-
var Dialog_default = {"component":"
|
|
1653
|
+
var Dialog_default = {"component":"bds2110Dialog-component","dialog":"bds2110Dialog-dialog","dialogContent":"bds2110Dialog-dialogContent","closeButton":"bds2110Dialog-closeButton"};
|
|
1271
1654
|
|
|
1272
1655
|
// src/components/interaction/Dialog/Dialog.tsx
|
|
1273
|
-
import { cn as
|
|
1274
|
-
import { jsx as
|
|
1656
|
+
import { cn as cn27 } from "@boostdev/design-system-foundation";
|
|
1657
|
+
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1275
1658
|
installInvokerCommandsPolyfill();
|
|
1276
1659
|
var FOCUSABLE_SELECTOR = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
1277
1660
|
function Dialog({ children, id: idProp, isOpen = false, className, onOpen, onClose, ...rest }) {
|
|
1278
|
-
const generatedId =
|
|
1661
|
+
const generatedId = useId9();
|
|
1279
1662
|
const id = idProp ?? generatedId;
|
|
1280
|
-
const dialogRef =
|
|
1281
|
-
const triggerRef =
|
|
1282
|
-
|
|
1663
|
+
const dialogRef = useRef6(null);
|
|
1664
|
+
const triggerRef = useRef6(null);
|
|
1665
|
+
useEffect4(() => {
|
|
1283
1666
|
const dialog = dialogRef.current;
|
|
1284
1667
|
if (!dialog) return;
|
|
1285
1668
|
if (isOpen && !dialog.open) {
|
|
@@ -1295,7 +1678,7 @@ function Dialog({ children, id: idProp, isOpen = false, className, onOpen, onClo
|
|
|
1295
1678
|
document.body.style.overflow = "";
|
|
1296
1679
|
};
|
|
1297
1680
|
}, [isOpen]);
|
|
1298
|
-
|
|
1681
|
+
useEffect4(() => {
|
|
1299
1682
|
const dialog = dialogRef.current;
|
|
1300
1683
|
if (!dialog) return;
|
|
1301
1684
|
const handleCommand = (e) => {
|
|
@@ -1317,8 +1700,10 @@ function Dialog({ children, id: idProp, isOpen = false, className, onOpen, onClo
|
|
|
1317
1700
|
if (e.target === dialogRef.current) onClose?.();
|
|
1318
1701
|
};
|
|
1319
1702
|
const handleCancel = (e) => {
|
|
1320
|
-
|
|
1321
|
-
|
|
1703
|
+
if (onClose) {
|
|
1704
|
+
e.preventDefault();
|
|
1705
|
+
onClose();
|
|
1706
|
+
}
|
|
1322
1707
|
};
|
|
1323
1708
|
const handleKeyDown = (e) => {
|
|
1324
1709
|
if (e.key !== "Tab") return;
|
|
@@ -1346,13 +1731,13 @@ function Dialog({ children, id: idProp, isOpen = false, className, onOpen, onClo
|
|
|
1346
1731
|
...rest,
|
|
1347
1732
|
ref: dialogRef,
|
|
1348
1733
|
id,
|
|
1349
|
-
className:
|
|
1734
|
+
className: cn27(className, Dialog_default.dialog),
|
|
1350
1735
|
"aria-modal": "true",
|
|
1351
1736
|
onClick: handleBackdropClick,
|
|
1352
1737
|
onCancel: handleCancel,
|
|
1353
1738
|
onKeyDown: handleKeyDown,
|
|
1354
1739
|
children: [
|
|
1355
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ jsx27(
|
|
1356
1741
|
"button",
|
|
1357
1742
|
{
|
|
1358
1743
|
type: "button",
|
|
@@ -1360,25 +1745,26 @@ function Dialog({ children, id: idProp, isOpen = false, className, onOpen, onClo
|
|
|
1360
1745
|
commandfor: id,
|
|
1361
1746
|
command: "close",
|
|
1362
1747
|
"aria-label": "Close dialog",
|
|
1363
|
-
children: /* @__PURE__ */
|
|
1748
|
+
children: /* @__PURE__ */ jsx27("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx27("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18 6L6 18M6 6l12 12" }) })
|
|
1364
1749
|
}
|
|
1365
1750
|
),
|
|
1366
|
-
/* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ jsx27("div", { className: Dialog_default.dialogContent, children })
|
|
1367
1752
|
]
|
|
1368
1753
|
}
|
|
1369
1754
|
);
|
|
1370
1755
|
}
|
|
1371
1756
|
|
|
1372
1757
|
// src/components/interaction/Drawer/Drawer.tsx
|
|
1373
|
-
import { useEffect as
|
|
1758
|
+
import { useEffect as useEffect5, useId as useId10, useRef as useRef7 } from "react";
|
|
1374
1759
|
|
|
1375
1760
|
// src/components/interaction/Drawer/Drawer.module.css
|
|
1376
|
-
var Drawer_default = {"component":"
|
|
1761
|
+
var Drawer_default = {"component":"bds2110Drawer-component","drawer":"bds2110Drawer-drawer","--side_left":"bds2110Drawer---side_left","header":"bds2110Drawer-header","closeButton":"bds2110Drawer-closeButton","body":"bds2110Drawer-body"};
|
|
1377
1762
|
|
|
1378
1763
|
// src/components/interaction/Drawer/Drawer.tsx
|
|
1379
|
-
import { cn as
|
|
1380
|
-
import { jsx as
|
|
1764
|
+
import { cn as cn28 } from "@boostdev/design-system-foundation";
|
|
1765
|
+
import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1381
1766
|
installInvokerCommandsPolyfill();
|
|
1767
|
+
var FOCUSABLE_SELECTOR2 = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
1382
1768
|
function Drawer({
|
|
1383
1769
|
id: idProp,
|
|
1384
1770
|
isOpen,
|
|
@@ -1390,11 +1776,13 @@ function Drawer({
|
|
|
1390
1776
|
className,
|
|
1391
1777
|
...rest
|
|
1392
1778
|
}) {
|
|
1393
|
-
const generatedId =
|
|
1779
|
+
const generatedId = useId10();
|
|
1394
1780
|
const id = idProp ?? generatedId;
|
|
1395
|
-
const
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1781
|
+
const titleId = useId10();
|
|
1782
|
+
const hasCustomLabel = "aria-label" in rest || "aria-labelledby" in rest;
|
|
1783
|
+
const dialogRef = useRef7(null);
|
|
1784
|
+
const triggerRef = useRef7(null);
|
|
1785
|
+
useEffect5(() => {
|
|
1398
1786
|
const dialog = dialogRef.current;
|
|
1399
1787
|
if (!dialog) return;
|
|
1400
1788
|
if (isOpen && !dialog.open) {
|
|
@@ -1410,7 +1798,7 @@ function Drawer({
|
|
|
1410
1798
|
document.body.style.overflow = "";
|
|
1411
1799
|
};
|
|
1412
1800
|
}, [isOpen]);
|
|
1413
|
-
|
|
1801
|
+
useEffect5(() => {
|
|
1414
1802
|
const dialog = dialogRef.current;
|
|
1415
1803
|
if (!dialog) return;
|
|
1416
1804
|
const handleCommand = (e) => {
|
|
@@ -1428,31 +1816,49 @@ function Drawer({
|
|
|
1428
1816
|
dialog.addEventListener("command", handleCommand);
|
|
1429
1817
|
return () => dialog.removeEventListener("command", handleCommand);
|
|
1430
1818
|
}, [onOpen, onClose]);
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1433
|
-
if (!dialog) return;
|
|
1434
|
-
const rect = dialog.getBoundingClientRect();
|
|
1435
|
-
const outside = e.clientX < rect.left || e.clientX > rect.right || e.clientY < rect.top || e.clientY > rect.bottom;
|
|
1436
|
-
if (outside) onClose();
|
|
1819
|
+
const handleBackdropClick = (e) => {
|
|
1820
|
+
if (e.target === dialogRef.current) onClose();
|
|
1437
1821
|
};
|
|
1438
1822
|
const handleCancel = (e) => {
|
|
1439
1823
|
e.preventDefault();
|
|
1440
1824
|
onClose();
|
|
1441
1825
|
};
|
|
1826
|
+
const handleKeyDown = (e) => {
|
|
1827
|
+
if (e.key !== "Tab") return;
|
|
1828
|
+
const dialog = dialogRef.current;
|
|
1829
|
+
if (!dialog) return;
|
|
1830
|
+
const focusable = Array.from(dialog.querySelectorAll(FOCUSABLE_SELECTOR2));
|
|
1831
|
+
if (focusable.length === 0) return;
|
|
1832
|
+
const first = focusable[0];
|
|
1833
|
+
const last = focusable[focusable.length - 1];
|
|
1834
|
+
if (e.shiftKey) {
|
|
1835
|
+
if (document.activeElement === first) {
|
|
1836
|
+
e.preventDefault();
|
|
1837
|
+
last.focus();
|
|
1838
|
+
}
|
|
1839
|
+
} else {
|
|
1840
|
+
if (document.activeElement === last) {
|
|
1841
|
+
e.preventDefault();
|
|
1842
|
+
first.focus();
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
};
|
|
1442
1846
|
return /* @__PURE__ */ jsxs19(
|
|
1443
1847
|
"dialog",
|
|
1444
1848
|
{
|
|
1445
1849
|
...rest,
|
|
1446
1850
|
ref: dialogRef,
|
|
1447
1851
|
id,
|
|
1448
|
-
className:
|
|
1852
|
+
className: cn28(Drawer_default.drawer, Drawer_default[`--side_${side}`], className),
|
|
1449
1853
|
"aria-modal": "true",
|
|
1450
|
-
|
|
1854
|
+
"aria-labelledby": hasCustomLabel ? rest["aria-labelledby"] : title ? titleId : void 0,
|
|
1855
|
+
onClick: handleBackdropClick,
|
|
1451
1856
|
onCancel: handleCancel,
|
|
1857
|
+
onKeyDown: handleKeyDown,
|
|
1452
1858
|
children: [
|
|
1453
1859
|
/* @__PURE__ */ jsxs19("div", { className: Drawer_default.header, children: [
|
|
1454
|
-
!!title && title,
|
|
1455
|
-
/* @__PURE__ */
|
|
1860
|
+
!!title && /* @__PURE__ */ jsx28("div", { id: titleId, children: title }),
|
|
1861
|
+
/* @__PURE__ */ jsx28(
|
|
1456
1862
|
"button",
|
|
1457
1863
|
{
|
|
1458
1864
|
type: "button",
|
|
@@ -1460,11 +1866,11 @@ function Drawer({
|
|
|
1460
1866
|
commandfor: id,
|
|
1461
1867
|
command: "close",
|
|
1462
1868
|
"aria-label": "Close drawer",
|
|
1463
|
-
children: /* @__PURE__ */
|
|
1869
|
+
children: /* @__PURE__ */ jsx28("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx28("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18 6L6 18M6 6l12 12" }) })
|
|
1464
1870
|
}
|
|
1465
1871
|
)
|
|
1466
1872
|
] }),
|
|
1467
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ jsx28("div", { className: Drawer_default.body, children })
|
|
1468
1874
|
]
|
|
1469
1875
|
}
|
|
1470
1876
|
);
|
|
@@ -1474,18 +1880,18 @@ function Drawer({
|
|
|
1474
1880
|
import {
|
|
1475
1881
|
cloneElement as cloneElement2,
|
|
1476
1882
|
isValidElement as isValidElement2,
|
|
1477
|
-
useEffect as
|
|
1478
|
-
useId as
|
|
1479
|
-
useRef as
|
|
1480
|
-
useState as
|
|
1883
|
+
useEffect as useEffect6,
|
|
1884
|
+
useId as useId11,
|
|
1885
|
+
useRef as useRef8,
|
|
1886
|
+
useState as useState7
|
|
1481
1887
|
} from "react";
|
|
1482
1888
|
|
|
1483
1889
|
// src/components/interaction/DropdownMenu/DropdownMenu.module.css
|
|
1484
|
-
var DropdownMenu_default = {"component":"
|
|
1890
|
+
var DropdownMenu_default = {"component":"bds2110DropdownMenu-component","wrapper":"bds2110DropdownMenu-wrapper","menu":"bds2110DropdownMenu-menu","--placement_bottom-start":"bds2110DropdownMenu---placement_bottom-start","--placement_bottom-end":"bds2110DropdownMenu---placement_bottom-end","separator":"bds2110DropdownMenu-separator","item":"bds2110DropdownMenu-item","icon":"bds2110DropdownMenu-icon"};
|
|
1485
1891
|
|
|
1486
1892
|
// src/components/interaction/DropdownMenu/DropdownMenu.tsx
|
|
1487
|
-
import { cn as
|
|
1488
|
-
import { jsx as
|
|
1893
|
+
import { cn as cn29 } from "@boostdev/design-system-foundation";
|
|
1894
|
+
import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1489
1895
|
function DropdownMenu({
|
|
1490
1896
|
trigger,
|
|
1491
1897
|
items,
|
|
@@ -1493,26 +1899,36 @@ function DropdownMenu({
|
|
|
1493
1899
|
className,
|
|
1494
1900
|
...rest
|
|
1495
1901
|
}) {
|
|
1496
|
-
const [isOpen, setIsOpen] =
|
|
1497
|
-
const containerRef =
|
|
1498
|
-
const menuId =
|
|
1499
|
-
const itemRefs =
|
|
1902
|
+
const [isOpen, setIsOpen] = useState7(false);
|
|
1903
|
+
const containerRef = useRef8(null);
|
|
1904
|
+
const menuId = useId11();
|
|
1905
|
+
const itemRefs = useRef8([]);
|
|
1906
|
+
const triggerRef = useRef8(null);
|
|
1500
1907
|
const open = () => {
|
|
1908
|
+
triggerRef.current = document.activeElement;
|
|
1501
1909
|
setIsOpen(true);
|
|
1502
1910
|
};
|
|
1503
|
-
const close = () =>
|
|
1504
|
-
|
|
1911
|
+
const close = (restoreFocus = false) => {
|
|
1912
|
+
setIsOpen(false);
|
|
1913
|
+
if (restoreFocus) {
|
|
1914
|
+
triggerRef.current?.focus();
|
|
1915
|
+
}
|
|
1916
|
+
};
|
|
1917
|
+
useEffect6(() => {
|
|
1505
1918
|
if (isOpen) {
|
|
1506
|
-
|
|
1919
|
+
const firstEnabledIndex = items.findIndex((item) => !item.disabled);
|
|
1920
|
+
if (firstEnabledIndex !== -1) {
|
|
1921
|
+
itemRefs.current[firstEnabledIndex]?.focus();
|
|
1922
|
+
}
|
|
1507
1923
|
}
|
|
1508
1924
|
}, [isOpen]);
|
|
1509
|
-
|
|
1925
|
+
useEffect6(() => {
|
|
1510
1926
|
if (!isOpen) return;
|
|
1511
1927
|
const handlePointerDown = (e) => {
|
|
1512
1928
|
if (!containerRef.current?.contains(e.target)) close();
|
|
1513
1929
|
};
|
|
1514
1930
|
const handleKeyDown = (e) => {
|
|
1515
|
-
if (e.key === "Escape") close();
|
|
1931
|
+
if (e.key === "Escape") close(true);
|
|
1516
1932
|
};
|
|
1517
1933
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
1518
1934
|
document.addEventListener("keydown", handleKeyDown);
|
|
@@ -1554,16 +1970,16 @@ function DropdownMenu({
|
|
|
1554
1970
|
if (typeof existingOnClick === "function") existingOnClick(e);
|
|
1555
1971
|
}
|
|
1556
1972
|
}) : trigger;
|
|
1557
|
-
return /* @__PURE__ */ jsxs20("div", { ...rest, ref: containerRef, className:
|
|
1973
|
+
return /* @__PURE__ */ jsxs20("div", { ...rest, ref: containerRef, className: cn29(DropdownMenu_default.wrapper, className), children: [
|
|
1558
1974
|
triggerEl,
|
|
1559
|
-
isOpen && /* @__PURE__ */
|
|
1975
|
+
isOpen && /* @__PURE__ */ jsx29(
|
|
1560
1976
|
"ul",
|
|
1561
1977
|
{
|
|
1562
1978
|
id: menuId,
|
|
1563
1979
|
role: "menu",
|
|
1564
|
-
className:
|
|
1980
|
+
className: cn29(DropdownMenu_default.menu, DropdownMenu_default[`--placement_${placement}`]),
|
|
1565
1981
|
children: items.map((item, index) => /* @__PURE__ */ jsxs20("li", { role: "presentation", children: [
|
|
1566
|
-
item.separator && /* @__PURE__ */
|
|
1982
|
+
item.separator && /* @__PURE__ */ jsx29("hr", { className: DropdownMenu_default.separator, role: "separator" }),
|
|
1567
1983
|
/* @__PURE__ */ jsxs20(
|
|
1568
1984
|
"button",
|
|
1569
1985
|
{
|
|
@@ -1576,11 +1992,11 @@ function DropdownMenu({
|
|
|
1576
1992
|
className: DropdownMenu_default.item,
|
|
1577
1993
|
onClick: () => {
|
|
1578
1994
|
item.onClick?.();
|
|
1579
|
-
close();
|
|
1995
|
+
close(true);
|
|
1580
1996
|
},
|
|
1581
1997
|
onKeyDown: (e) => handleItemKeyDown(e, index),
|
|
1582
1998
|
children: [
|
|
1583
|
-
item.icon && /* @__PURE__ */
|
|
1999
|
+
item.icon && /* @__PURE__ */ jsx29("span", { className: DropdownMenu_default.icon, "aria-hidden": "true", children: item.icon }),
|
|
1584
2000
|
item.label
|
|
1585
2001
|
]
|
|
1586
2002
|
}
|
|
@@ -1595,18 +2011,18 @@ function DropdownMenu({
|
|
|
1595
2011
|
import {
|
|
1596
2012
|
cloneElement as cloneElement3,
|
|
1597
2013
|
isValidElement as isValidElement3,
|
|
1598
|
-
useEffect as
|
|
1599
|
-
useId as
|
|
1600
|
-
useRef as
|
|
1601
|
-
useState as
|
|
2014
|
+
useEffect as useEffect7,
|
|
2015
|
+
useId as useId12,
|
|
2016
|
+
useRef as useRef9,
|
|
2017
|
+
useState as useState8
|
|
1602
2018
|
} from "react";
|
|
1603
2019
|
|
|
1604
2020
|
// src/components/interaction/Popover/Popover.module.css
|
|
1605
|
-
var Popover_default = {"component":"
|
|
2021
|
+
var Popover_default = {"component":"bds2110Popover-component","wrapper":"bds2110Popover-wrapper","panel":"bds2110Popover-panel","g":"bds2110Popover-g"};
|
|
1606
2022
|
|
|
1607
2023
|
// src/components/interaction/Popover/Popover.tsx
|
|
1608
|
-
import { cn as
|
|
1609
|
-
import { jsx as
|
|
2024
|
+
import { cn as cn30 } from "@boostdev/design-system-foundation";
|
|
2025
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1610
2026
|
installInvokerCommandsPolyfill();
|
|
1611
2027
|
if (typeof window !== "undefined" && !(typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("anchor-name: --a"))) {
|
|
1612
2028
|
import("@oddbird/css-anchor-positioning").catch(() => {
|
|
@@ -1620,13 +2036,13 @@ function Popover({
|
|
|
1620
2036
|
"aria-label": ariaLabel,
|
|
1621
2037
|
...rest
|
|
1622
2038
|
}) {
|
|
1623
|
-
const [isOpen, setIsOpen] =
|
|
1624
|
-
const containerRef =
|
|
1625
|
-
const panelRef =
|
|
1626
|
-
const rawId =
|
|
2039
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
2040
|
+
const containerRef = useRef9(null);
|
|
2041
|
+
const panelRef = useRef9(null);
|
|
2042
|
+
const rawId = useId12();
|
|
1627
2043
|
const anchorName = `--popover-${rawId.replace(/\W/g, "") || "a"}`;
|
|
1628
2044
|
const panelId = rawId;
|
|
1629
|
-
|
|
2045
|
+
useEffect7(() => {
|
|
1630
2046
|
const panel = panelRef.current;
|
|
1631
2047
|
if (!panel) return;
|
|
1632
2048
|
const handleToggle = (e) => {
|
|
@@ -1635,7 +2051,7 @@ function Popover({
|
|
|
1635
2051
|
panel.addEventListener("toggle", handleToggle);
|
|
1636
2052
|
return () => panel.removeEventListener("toggle", handleToggle);
|
|
1637
2053
|
}, []);
|
|
1638
|
-
|
|
2054
|
+
useEffect7(() => {
|
|
1639
2055
|
if (!isOpen) return;
|
|
1640
2056
|
const handleScroll = () => {
|
|
1641
2057
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
@@ -1655,7 +2071,6 @@ function Popover({
|
|
|
1655
2071
|
const trigger = isValidElement3(children) ? cloneElement3(children, {
|
|
1656
2072
|
"aria-expanded": isOpen,
|
|
1657
2073
|
"aria-controls": panelId,
|
|
1658
|
-
"aria-haspopup": true,
|
|
1659
2074
|
commandfor: panelId,
|
|
1660
2075
|
command: "toggle-popover",
|
|
1661
2076
|
style: {
|
|
@@ -1663,13 +2078,25 @@ function Popover({
|
|
|
1663
2078
|
anchorName
|
|
1664
2079
|
},
|
|
1665
2080
|
// Forward any existing onClick on the child (for custom side-effects).
|
|
1666
|
-
//
|
|
1667
|
-
//
|
|
1668
|
-
|
|
2081
|
+
// commandfor/command handles the toggle when the trigger renders a
|
|
2082
|
+
// native <button> — don't also toggle there (avoids a double-toggle).
|
|
2083
|
+
// Invoker commands are spec-limited to <button>, so when the actual
|
|
2084
|
+
// rendered element isn't one (e.g. a plain <a> or a custom non-button
|
|
2085
|
+
// Link), fall back to an explicit togglePopover() call instead of
|
|
2086
|
+
// silently going dead. Checked on the DOM node (event.currentTarget),
|
|
2087
|
+
// not the React element type, so wrapper components that forward
|
|
2088
|
+
// props onto an inner <button> (e.g. this library's Button) still
|
|
2089
|
+
// take the native path.
|
|
2090
|
+
onClick: (event) => {
|
|
2091
|
+
children.props.onClick?.(event);
|
|
2092
|
+
if (!(event.currentTarget instanceof HTMLButtonElement)) {
|
|
2093
|
+
panelRef.current?.togglePopover();
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
1669
2096
|
}) : children;
|
|
1670
|
-
return /* @__PURE__ */ jsxs21("span", { ...rest, ref: containerRef, className:
|
|
2097
|
+
return /* @__PURE__ */ jsxs21("span", { ...rest, ref: containerRef, className: cn30(Popover_default.wrapper, className), children: [
|
|
1671
2098
|
trigger,
|
|
1672
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ jsx30(
|
|
1673
2100
|
"div",
|
|
1674
2101
|
{
|
|
1675
2102
|
ref: panelRef,
|
|
@@ -1687,27 +2114,27 @@ function Popover({
|
|
|
1687
2114
|
}
|
|
1688
2115
|
|
|
1689
2116
|
// src/components/interaction/Rating/Rating.module.css
|
|
1690
|
-
var Rating_default = {"component":"
|
|
2117
|
+
var Rating_default = {"component":"bds2110Rating-component","rating":"bds2110Rating-rating","star":"bds2110Rating-star","--filled":"bds2110Rating---filled"};
|
|
1691
2118
|
|
|
1692
2119
|
// src/components/interaction/Rating/Rating.tsx
|
|
1693
|
-
import { cn as
|
|
1694
|
-
import { jsx as
|
|
2120
|
+
import { cn as cn31 } from "@boostdev/design-system-foundation";
|
|
2121
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1695
2122
|
function Rating({ value, max = 5, className, ...rest }) {
|
|
1696
|
-
return /* @__PURE__ */
|
|
2123
|
+
return /* @__PURE__ */ jsx31(
|
|
1697
2124
|
"div",
|
|
1698
2125
|
{
|
|
1699
2126
|
...rest,
|
|
1700
|
-
className:
|
|
2127
|
+
className: cn31(Rating_default.rating, className),
|
|
1701
2128
|
role: "img",
|
|
1702
2129
|
"aria-label": `${value} out of ${max} stars`,
|
|
1703
|
-
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */
|
|
2130
|
+
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ jsx31(
|
|
1704
2131
|
"svg",
|
|
1705
2132
|
{
|
|
1706
2133
|
"aria-hidden": "true",
|
|
1707
|
-
className:
|
|
2134
|
+
className: cn31(Rating_default.star, i < value && Rating_default["--filled"]),
|
|
1708
2135
|
fill: "currentColor",
|
|
1709
2136
|
viewBox: "0 0 24 24",
|
|
1710
|
-
children: /* @__PURE__ */
|
|
2137
|
+
children: /* @__PURE__ */ jsx31("path", { d: "M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z" })
|
|
1711
2138
|
},
|
|
1712
2139
|
i
|
|
1713
2140
|
))
|
|
@@ -1716,14 +2143,14 @@ function Rating({ value, max = 5, className, ...rest }) {
|
|
|
1716
2143
|
}
|
|
1717
2144
|
|
|
1718
2145
|
// src/components/interaction/Toast/Toast.tsx
|
|
1719
|
-
import { useState as
|
|
2146
|
+
import { useState as useState9, useEffect as useEffect8, createContext, useContext, useCallback as useCallback3, useMemo as useMemo2, useRef as useRef10 } from "react";
|
|
1720
2147
|
|
|
1721
2148
|
// src/components/interaction/Toast/Toast.module.css
|
|
1722
|
-
var Toast_default = {"component":"
|
|
2149
|
+
var Toast_default = {"component":"bds2110Toast-component","toastContainer":"bds2110Toast-toastContainer","toast":"bds2110Toast-toast","md":"bds2110Toast-md","--variant_success":"bds2110Toast---variant_success","--variant_warning":"bds2110Toast---variant_warning","--variant_info":"bds2110Toast---variant_info","--variant_error":"bds2110Toast---variant_error","message":"bds2110Toast-message","closeButton":"bds2110Toast-closeButton"};
|
|
1723
2150
|
|
|
1724
2151
|
// src/components/interaction/Toast/Toast.tsx
|
|
1725
|
-
import { cn as
|
|
1726
|
-
import { jsx as
|
|
2152
|
+
import { cn as cn32 } from "@boostdev/design-system-foundation";
|
|
2153
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1727
2154
|
var _ToastContext;
|
|
1728
2155
|
function getToastContext() {
|
|
1729
2156
|
_ToastContext ??= createContext(void 0);
|
|
@@ -1731,20 +2158,23 @@ function getToastContext() {
|
|
|
1731
2158
|
}
|
|
1732
2159
|
function ToastProvider({ children }) {
|
|
1733
2160
|
const ToastContext = getToastContext();
|
|
1734
|
-
const [toasts, setToasts] =
|
|
1735
|
-
const containerRef =
|
|
1736
|
-
const showToast =
|
|
2161
|
+
const [toasts, setToasts] = useState9([]);
|
|
2162
|
+
const containerRef = useRef10(null);
|
|
2163
|
+
const showToast = useCallback3((message, variant) => {
|
|
1737
2164
|
const id = Math.random().toString(36).substring(2, 9);
|
|
1738
2165
|
setToasts((prev) => [...prev, { id, message, variant }]);
|
|
1739
2166
|
}, []);
|
|
1740
|
-
const removeToast =
|
|
2167
|
+
const removeToast = useCallback3((id) => {
|
|
1741
2168
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
1742
2169
|
}, []);
|
|
1743
|
-
|
|
2170
|
+
useEffect8(() => {
|
|
1744
2171
|
const container = containerRef.current;
|
|
1745
2172
|
if (!container) return;
|
|
1746
2173
|
if (toasts.length > 0) {
|
|
1747
|
-
|
|
2174
|
+
try {
|
|
2175
|
+
container.showPopover?.();
|
|
2176
|
+
} catch {
|
|
2177
|
+
}
|
|
1748
2178
|
} else {
|
|
1749
2179
|
try {
|
|
1750
2180
|
container.hidePopover?.();
|
|
@@ -1755,7 +2185,7 @@ function ToastProvider({ children }) {
|
|
|
1755
2185
|
const value = useMemo2(() => ({ showToast }), [showToast]);
|
|
1756
2186
|
return /* @__PURE__ */ jsxs22(ToastContext.Provider, { value, children: [
|
|
1757
2187
|
children,
|
|
1758
|
-
/* @__PURE__ */
|
|
2188
|
+
/* @__PURE__ */ jsx32(
|
|
1759
2189
|
"div",
|
|
1760
2190
|
{
|
|
1761
2191
|
ref: containerRef,
|
|
@@ -1763,11 +2193,11 @@ function ToastProvider({ children }) {
|
|
|
1763
2193
|
role: "region",
|
|
1764
2194
|
"aria-label": "Notifications",
|
|
1765
2195
|
className: Toast_default.toastContainer,
|
|
1766
|
-
children: toasts.map((toast) => /* @__PURE__ */
|
|
2196
|
+
children: toasts.map((toast) => /* @__PURE__ */ jsx32(
|
|
1767
2197
|
ToastItem,
|
|
1768
2198
|
{
|
|
1769
2199
|
toast,
|
|
1770
|
-
onRemove:
|
|
2200
|
+
onRemove: removeToast
|
|
1771
2201
|
},
|
|
1772
2202
|
toast.id
|
|
1773
2203
|
))
|
|
@@ -1776,13 +2206,13 @@ function ToastProvider({ children }) {
|
|
|
1776
2206
|
] });
|
|
1777
2207
|
}
|
|
1778
2208
|
function ToastItem({ toast, onRemove }) {
|
|
1779
|
-
|
|
1780
|
-
const timer = setTimeout(onRemove, 5e3);
|
|
2209
|
+
useEffect8(() => {
|
|
2210
|
+
const timer = setTimeout(() => onRemove(toast.id), 5e3);
|
|
1781
2211
|
return () => clearTimeout(timer);
|
|
1782
|
-
}, [onRemove]);
|
|
1783
|
-
return /* @__PURE__ */ jsxs22("div", { className:
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */
|
|
2212
|
+
}, [onRemove, toast.id]);
|
|
2213
|
+
return /* @__PURE__ */ jsxs22("div", { className: cn32(Toast_default.toast, Toast_default[`--variant_${toast.variant}`]), role: "status", "aria-live": "polite", "aria-atomic": "true", children: [
|
|
2214
|
+
/* @__PURE__ */ jsx32("span", { className: Toast_default.message, children: toast.message }),
|
|
2215
|
+
/* @__PURE__ */ jsx32("button", { type: "button", className: Toast_default.closeButton, onClick: () => onRemove(toast.id), "aria-label": "Dismiss", children: /* @__PURE__ */ jsx32("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx32("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18 6L6 18M6 6l12 12" }) }) })
|
|
1786
2216
|
] });
|
|
1787
2217
|
}
|
|
1788
2218
|
function useToast() {
|
|
@@ -1794,82 +2224,82 @@ function useToast() {
|
|
|
1794
2224
|
}
|
|
1795
2225
|
|
|
1796
2226
|
// src/components/interaction/form/Checkbox/Checkbox.tsx
|
|
1797
|
-
import { useId as
|
|
2227
|
+
import { useId as useId13 } from "react";
|
|
1798
2228
|
|
|
1799
2229
|
// src/components/interaction/form/Checkbox/Checkbox.module.css
|
|
1800
|
-
var Checkbox_default = {"component":"
|
|
2230
|
+
var Checkbox_default = {"component":"bds2110Checkbox-component","checkboxGroup":"bds2110Checkbox-checkboxGroup","inputWrapper":"bds2110Checkbox-inputWrapper","checkbox":"bds2110Checkbox-checkbox","checkboxError":"bds2110Checkbox-checkboxError"};
|
|
1801
2231
|
|
|
1802
2232
|
// src/components/interaction/form/atoms/Message.module.css
|
|
1803
|
-
var Message_default = {"component":"
|
|
2233
|
+
var Message_default = {"component":"bds2110Message-component","error":"bds2110Message-error","hint":"bds2110Message-hint"};
|
|
1804
2234
|
|
|
1805
2235
|
// src/components/interaction/form/atoms/Message.tsx
|
|
1806
|
-
import { cn as
|
|
1807
|
-
import { jsx as
|
|
2236
|
+
import { cn as cn33 } from "@boostdev/design-system-foundation";
|
|
2237
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1808
2238
|
var Message = ({ message, type, inputId, className }) => {
|
|
1809
2239
|
if (!message) return null;
|
|
1810
|
-
return /* @__PURE__ */
|
|
2240
|
+
return /* @__PURE__ */ jsx33("p", { id: inputId + type, role: type === "error" ? "alert" : void 0, className: cn33(Message_default[type], className), children: message });
|
|
1811
2241
|
};
|
|
1812
2242
|
|
|
1813
2243
|
// src/components/interaction/form/atoms/Label.module.css
|
|
1814
|
-
var Label_default = {"component":"
|
|
2244
|
+
var Label_default = {"component":"bds2110Label-component","label":"bds2110Label-label"};
|
|
1815
2245
|
|
|
1816
2246
|
// src/components/interaction/form/atoms/Label.tsx
|
|
1817
|
-
import { cn as
|
|
1818
|
-
import { jsx as
|
|
2247
|
+
import { cn as cn34 } from "@boostdev/design-system-foundation";
|
|
2248
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1819
2249
|
var Label = ({ label, id, className }) => {
|
|
1820
|
-
return /* @__PURE__ */
|
|
2250
|
+
return /* @__PURE__ */ jsx34("label", { htmlFor: id, className: cn34(Label_default.label, className), children: label });
|
|
1821
2251
|
};
|
|
1822
2252
|
|
|
1823
2253
|
// src/components/interaction/form/Checkbox/Checkbox.tsx
|
|
1824
|
-
import { cn as
|
|
2254
|
+
import { cn as cn36 } from "@boostdev/design-system-foundation";
|
|
1825
2255
|
|
|
1826
2256
|
// src/components/interaction/form/atoms/InputContainer.module.css
|
|
1827
|
-
var InputContainer_default = {"component":"
|
|
2257
|
+
var InputContainer_default = {"component":"bds2110InputContainer-component","container":"bds2110InputContainer-container"};
|
|
1828
2258
|
|
|
1829
2259
|
// src/components/interaction/form/atoms/InputContainer.tsx
|
|
1830
|
-
import { cn as
|
|
1831
|
-
import { jsx as
|
|
2260
|
+
import { cn as cn35 } from "@boostdev/design-system-foundation";
|
|
2261
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1832
2262
|
var InputContainer = ({ children, className, ...rest }) => {
|
|
1833
|
-
return /* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ jsx35("div", { ...rest, className: cn35(InputContainer_default.container, className), children });
|
|
1834
2264
|
};
|
|
1835
2265
|
|
|
1836
2266
|
// src/components/interaction/form/Checkbox/Checkbox.tsx
|
|
1837
|
-
import { jsx as
|
|
2267
|
+
import { jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1838
2268
|
function Checkbox({ label, name, error, hint, className, ...props }) {
|
|
1839
|
-
const id = name +
|
|
2269
|
+
const id = name + useId13();
|
|
1840
2270
|
const hintId = id + "hint";
|
|
1841
2271
|
const errorId = id + "error";
|
|
1842
2272
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
1843
|
-
return /* @__PURE__ */ jsxs23(InputContainer, { className:
|
|
2273
|
+
return /* @__PURE__ */ jsxs23(InputContainer, { className: cn36(Checkbox_default.checkboxGroup, className), children: [
|
|
1844
2274
|
/* @__PURE__ */ jsxs23("div", { className: Checkbox_default.inputWrapper, children: [
|
|
1845
|
-
/* @__PURE__ */
|
|
2275
|
+
/* @__PURE__ */ jsx36(
|
|
1846
2276
|
"input",
|
|
1847
2277
|
{
|
|
2278
|
+
...props,
|
|
1848
2279
|
"aria-describedby": describedBy,
|
|
1849
2280
|
"aria-invalid": !!error,
|
|
1850
2281
|
type: "checkbox",
|
|
1851
2282
|
id,
|
|
1852
2283
|
name,
|
|
1853
|
-
className:
|
|
1854
|
-
...props
|
|
2284
|
+
className: cn36(Checkbox_default.checkbox, error && Checkbox_default.checkboxError)
|
|
1855
2285
|
}
|
|
1856
2286
|
),
|
|
1857
|
-
/* @__PURE__ */
|
|
2287
|
+
/* @__PURE__ */ jsx36(Label, { id, label })
|
|
1858
2288
|
] }),
|
|
1859
|
-
/* @__PURE__ */
|
|
1860
|
-
/* @__PURE__ */
|
|
2289
|
+
/* @__PURE__ */ jsx36(Message, { inputId: id, type: "error", message: error }),
|
|
2290
|
+
/* @__PURE__ */ jsx36(Message, { inputId: id, type: "hint", message: hint })
|
|
1861
2291
|
] });
|
|
1862
2292
|
}
|
|
1863
2293
|
|
|
1864
2294
|
// src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx
|
|
1865
|
-
import { useId as
|
|
2295
|
+
import { useId as useId14 } from "react";
|
|
1866
2296
|
|
|
1867
2297
|
// src/components/interaction/form/CheckboxGroup/CheckboxGroup.module.css
|
|
1868
|
-
var CheckboxGroup_default = {"component":"
|
|
2298
|
+
var CheckboxGroup_default = {"component":"bds2110CheckboxGroup-component","group":"bds2110CheckboxGroup-group","legend":"bds2110CheckboxGroup-legend","required":"bds2110CheckboxGroup-required","requiredLabel":"bds2110CheckboxGroup-requiredLabel","items":"bds2110CheckboxGroup-items"};
|
|
1869
2299
|
|
|
1870
2300
|
// src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx
|
|
1871
|
-
import { cn as
|
|
1872
|
-
import { jsx as
|
|
2301
|
+
import { cn as cn37 } from "@boostdev/design-system-foundation";
|
|
2302
|
+
import { Fragment as Fragment3, jsx as jsx37, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1873
2303
|
function CheckboxGroup({
|
|
1874
2304
|
legend,
|
|
1875
2305
|
children,
|
|
@@ -1879,7 +2309,7 @@ function CheckboxGroup({
|
|
|
1879
2309
|
className,
|
|
1880
2310
|
...rest
|
|
1881
2311
|
}) {
|
|
1882
|
-
const id =
|
|
2312
|
+
const id = useId14();
|
|
1883
2313
|
const hintId = id + "hint";
|
|
1884
2314
|
const errorId = id + "error";
|
|
1885
2315
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
@@ -1887,17 +2317,20 @@ function CheckboxGroup({
|
|
|
1887
2317
|
"fieldset",
|
|
1888
2318
|
{
|
|
1889
2319
|
...rest,
|
|
1890
|
-
className:
|
|
1891
|
-
"aria-required": required || void 0,
|
|
2320
|
+
className: cn37(CheckboxGroup_default.group, className),
|
|
1892
2321
|
"aria-describedby": describedBy,
|
|
1893
2322
|
children: [
|
|
1894
2323
|
/* @__PURE__ */ jsxs24("legend", { className: CheckboxGroup_default.legend, children: [
|
|
1895
2324
|
legend,
|
|
1896
|
-
required && /* @__PURE__ */
|
|
2325
|
+
required && /* @__PURE__ */ jsxs24(Fragment3, { children: [
|
|
2326
|
+
/* @__PURE__ */ jsx37("span", { className: CheckboxGroup_default.required, "aria-hidden": "true", children: " *" }),
|
|
2327
|
+
" ",
|
|
2328
|
+
/* @__PURE__ */ jsx37("span", { className: CheckboxGroup_default.requiredLabel, children: "(required)" })
|
|
2329
|
+
] })
|
|
1897
2330
|
] }),
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
/* @__PURE__ */
|
|
2331
|
+
/* @__PURE__ */ jsx37("div", { className: CheckboxGroup_default.items, children }),
|
|
2332
|
+
/* @__PURE__ */ jsx37(Message, { inputId: id, type: "error", message: error }),
|
|
2333
|
+
/* @__PURE__ */ jsx37(Message, { inputId: id, type: "hint", message: hint })
|
|
1901
2334
|
]
|
|
1902
2335
|
}
|
|
1903
2336
|
);
|
|
@@ -1905,19 +2338,19 @@ function CheckboxGroup({
|
|
|
1905
2338
|
|
|
1906
2339
|
// src/components/interaction/form/Combobox/Combobox.tsx
|
|
1907
2340
|
import {
|
|
1908
|
-
useEffect as
|
|
1909
|
-
useId as
|
|
1910
|
-
useRef as
|
|
1911
|
-
useState as
|
|
2341
|
+
useEffect as useEffect9,
|
|
2342
|
+
useId as useId15,
|
|
2343
|
+
useRef as useRef11,
|
|
2344
|
+
useState as useState10,
|
|
1912
2345
|
useMemo as useMemo3
|
|
1913
2346
|
} from "react";
|
|
1914
2347
|
|
|
1915
2348
|
// src/components/interaction/form/Combobox/Combobox.module.css
|
|
1916
|
-
var Combobox_default = {"component":"
|
|
2349
|
+
var Combobox_default = {"component":"bds2110Combobox-component","formGroup":"bds2110Combobox-formGroup","inputWrapper":"bds2110Combobox-inputWrapper","input":"bds2110Combobox-input","inputError":"bds2110Combobox-inputError","chevron":"bds2110Combobox-chevron","listbox":"bds2110Combobox-listbox","option":"bds2110Combobox-option","--highlighted":"bds2110Combobox---highlighted","--selected":"bds2110Combobox---selected","--disabled":"bds2110Combobox---disabled"};
|
|
1917
2350
|
|
|
1918
2351
|
// src/components/interaction/form/Combobox/Combobox.tsx
|
|
1919
|
-
import { cn as
|
|
1920
|
-
import { jsx as
|
|
2352
|
+
import { cn as cn38 } from "@boostdev/design-system-foundation";
|
|
2353
|
+
import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1921
2354
|
function Combobox({
|
|
1922
2355
|
label,
|
|
1923
2356
|
name,
|
|
@@ -1931,25 +2364,25 @@ function Combobox({
|
|
|
1931
2364
|
className,
|
|
1932
2365
|
...rest
|
|
1933
2366
|
}) {
|
|
1934
|
-
const id = name +
|
|
2367
|
+
const id = name + useId15();
|
|
1935
2368
|
const listboxId = id + "listbox";
|
|
1936
2369
|
const hintId = id + "hint";
|
|
1937
2370
|
const errorId = id + "error";
|
|
1938
2371
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
1939
2372
|
const selectedOption = useMemo3(() => options.find((o) => o.value === value), [options, value]);
|
|
1940
|
-
const [inputValue, setInputValue] =
|
|
1941
|
-
|
|
2373
|
+
const [inputValue, setInputValue] = useState10(selectedOption?.label ?? "");
|
|
2374
|
+
useEffect9(() => {
|
|
1942
2375
|
setInputValue(selectedOption?.label ?? "");
|
|
1943
2376
|
}, [selectedOption]);
|
|
1944
|
-
const [isOpen, setIsOpen] =
|
|
1945
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
1946
|
-
const containerRef =
|
|
1947
|
-
const inputRef =
|
|
2377
|
+
const [isOpen, setIsOpen] = useState10(false);
|
|
2378
|
+
const [highlightedIndex, setHighlightedIndex] = useState10(-1);
|
|
2379
|
+
const containerRef = useRef11(null);
|
|
2380
|
+
const inputRef = useRef11(null);
|
|
1948
2381
|
const filtered = options.filter(
|
|
1949
2382
|
(o) => o.label.toLowerCase().includes(inputValue.toLowerCase())
|
|
1950
2383
|
);
|
|
1951
2384
|
const getOptionId = (index) => `${id}-option-${index}`;
|
|
1952
|
-
|
|
2385
|
+
useEffect9(() => {
|
|
1953
2386
|
if (!isOpen) return;
|
|
1954
2387
|
const handlePointerDown = (e) => {
|
|
1955
2388
|
if (!containerRef.current?.contains(e.target)) setIsOpen(false);
|
|
@@ -1976,18 +2409,31 @@ function Combobox({
|
|
|
1976
2409
|
setIsOpen(true);
|
|
1977
2410
|
return;
|
|
1978
2411
|
}
|
|
2412
|
+
if (enabledIndexes.length === 0) {
|
|
2413
|
+
setHighlightedIndex(-1);
|
|
2414
|
+
return;
|
|
2415
|
+
}
|
|
1979
2416
|
const pos = enabledIndexes.indexOf(highlightedIndex);
|
|
1980
|
-
setHighlightedIndex(enabledIndexes[(pos + 1) % enabledIndexes.length]
|
|
2417
|
+
setHighlightedIndex(enabledIndexes[(pos + 1) % enabledIndexes.length]);
|
|
1981
2418
|
} else if (e.key === "ArrowUp") {
|
|
1982
2419
|
e.preventDefault();
|
|
2420
|
+
if (!isOpen) {
|
|
2421
|
+
setIsOpen(true);
|
|
2422
|
+
return;
|
|
2423
|
+
}
|
|
2424
|
+
if (enabledIndexes.length === 0) {
|
|
2425
|
+
setHighlightedIndex(-1);
|
|
2426
|
+
return;
|
|
2427
|
+
}
|
|
1983
2428
|
const pos = enabledIndexes.indexOf(highlightedIndex);
|
|
1984
2429
|
setHighlightedIndex(
|
|
1985
|
-
enabledIndexes[(pos - 1 + enabledIndexes.length) % enabledIndexes.length]
|
|
2430
|
+
enabledIndexes[(pos - 1 + enabledIndexes.length) % enabledIndexes.length]
|
|
1986
2431
|
);
|
|
1987
2432
|
} else if (e.key === "Enter") {
|
|
1988
2433
|
e.preventDefault();
|
|
1989
|
-
|
|
1990
|
-
|
|
2434
|
+
const option = filtered[highlightedIndex];
|
|
2435
|
+
if (highlightedIndex >= 0 && option && !option.disabled) {
|
|
2436
|
+
selectOption(option);
|
|
1991
2437
|
}
|
|
1992
2438
|
} else if (e.key === "Escape") {
|
|
1993
2439
|
setIsOpen(false);
|
|
@@ -1996,10 +2442,10 @@ function Combobox({
|
|
|
1996
2442
|
setIsOpen(false);
|
|
1997
2443
|
}
|
|
1998
2444
|
};
|
|
1999
|
-
return /* @__PURE__ */ jsxs25(InputContainer, { ...rest, className:
|
|
2000
|
-
/* @__PURE__ */
|
|
2445
|
+
return /* @__PURE__ */ jsxs25(InputContainer, { ...rest, className: cn38(Combobox_default.formGroup, className), children: [
|
|
2446
|
+
/* @__PURE__ */ jsx38(Label, { id, label }),
|
|
2001
2447
|
/* @__PURE__ */ jsxs25("div", { ref: containerRef, className: Combobox_default.inputWrapper, children: [
|
|
2002
|
-
/* @__PURE__ */
|
|
2448
|
+
/* @__PURE__ */ jsx38(
|
|
2003
2449
|
"input",
|
|
2004
2450
|
{
|
|
2005
2451
|
ref: inputRef,
|
|
@@ -2011,34 +2457,35 @@ function Combobox({
|
|
|
2011
2457
|
"aria-haspopup": "listbox",
|
|
2012
2458
|
"aria-autocomplete": "list",
|
|
2013
2459
|
"aria-controls": listboxId,
|
|
2014
|
-
"aria-activedescendant": highlightedIndex >= 0 ? getOptionId(highlightedIndex) : void 0,
|
|
2460
|
+
"aria-activedescendant": isOpen && highlightedIndex >= 0 ? getOptionId(highlightedIndex) : void 0,
|
|
2015
2461
|
"aria-invalid": !!error,
|
|
2016
2462
|
"aria-describedby": describedBy,
|
|
2017
2463
|
autoComplete: "off",
|
|
2018
2464
|
placeholder,
|
|
2019
2465
|
value: inputValue,
|
|
2020
2466
|
disabled,
|
|
2021
|
-
className:
|
|
2467
|
+
className: cn38(Combobox_default.input, error ? Combobox_default.inputError : void 0),
|
|
2022
2468
|
onChange: handleInputChange,
|
|
2023
2469
|
onKeyDown: handleKeyDown,
|
|
2024
2470
|
onFocus: () => setIsOpen(true)
|
|
2025
2471
|
}
|
|
2026
2472
|
),
|
|
2027
|
-
/* @__PURE__ */
|
|
2028
|
-
isOpen && filtered.length > 0 && /* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ jsx38("span", { className: Combobox_default.chevron, "aria-hidden": "true", children: /* @__PURE__ */ jsx38("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx38("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 9l6 6 6-6" }) }) }),
|
|
2474
|
+
isOpen && filtered.length > 0 && /* @__PURE__ */ jsx38(
|
|
2029
2475
|
"ul",
|
|
2030
2476
|
{
|
|
2031
2477
|
id: listboxId,
|
|
2032
2478
|
role: "listbox",
|
|
2479
|
+
"aria-label": typeof label === "string" ? label : void 0,
|
|
2033
2480
|
className: Combobox_default.listbox,
|
|
2034
|
-
children: filtered.map((option, index) => /* @__PURE__ */
|
|
2481
|
+
children: filtered.map((option, index) => /* @__PURE__ */ jsx38(
|
|
2035
2482
|
"li",
|
|
2036
2483
|
{
|
|
2037
2484
|
id: getOptionId(index),
|
|
2038
2485
|
role: "option",
|
|
2039
2486
|
"aria-selected": option.value === value,
|
|
2040
2487
|
"aria-disabled": option.disabled,
|
|
2041
|
-
className:
|
|
2488
|
+
className: cn38(
|
|
2042
2489
|
Combobox_default.option,
|
|
2043
2490
|
index === highlightedIndex ? Combobox_default["--highlighted"] : void 0,
|
|
2044
2491
|
option.value === value ? Combobox_default["--selected"] : void 0,
|
|
@@ -2055,20 +2502,26 @@ function Combobox({
|
|
|
2055
2502
|
}
|
|
2056
2503
|
)
|
|
2057
2504
|
] }),
|
|
2058
|
-
/* @__PURE__ */
|
|
2059
|
-
/* @__PURE__ */
|
|
2505
|
+
/* @__PURE__ */ jsx38(Message, { inputId: id, type: "error", message: error }),
|
|
2506
|
+
/* @__PURE__ */ jsx38(Message, { inputId: id, type: "hint", message: hint })
|
|
2060
2507
|
] });
|
|
2061
2508
|
}
|
|
2062
2509
|
|
|
2063
2510
|
// src/components/interaction/form/FieldGroup/FieldGroup.tsx
|
|
2064
|
-
import {
|
|
2065
|
-
|
|
2511
|
+
import {
|
|
2512
|
+
Children,
|
|
2513
|
+
useEffect as useEffect10,
|
|
2514
|
+
useRef as useRef12,
|
|
2515
|
+
useState as useState11
|
|
2516
|
+
} from "react";
|
|
2517
|
+
import { cn as cn39 } from "@boostdev/design-system-foundation";
|
|
2066
2518
|
|
|
2067
2519
|
// src/components/interaction/form/FieldGroup/FieldGroup.module.css
|
|
2068
|
-
var FieldGroup_default = {"component":"
|
|
2520
|
+
var FieldGroup_default = {"component":"bds2110FieldGroup-component","fieldGroup":"bds2110FieldGroup-fieldGroup","legend":"bds2110FieldGroup-legend","fields":"bds2110FieldGroup-fields","--variant_horizontal":"bds2110FieldGroup---variant_horizontal","probe":"bds2110FieldGroup-probe","tsx":"bds2110FieldGroup-tsx","probeContainer":"bds2110FieldGroup-probeContainer"};
|
|
2069
2521
|
|
|
2070
2522
|
// src/components/interaction/form/FieldGroup/FieldGroup.tsx
|
|
2071
|
-
import { jsx as
|
|
2523
|
+
import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2524
|
+
var getInlineSize = (entry) => entry.contentBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;
|
|
2072
2525
|
function FieldGroup({
|
|
2073
2526
|
variant = "horizontal",
|
|
2074
2527
|
legend,
|
|
@@ -2077,34 +2530,61 @@ function FieldGroup({
|
|
|
2077
2530
|
style,
|
|
2078
2531
|
...rest
|
|
2079
2532
|
}) {
|
|
2080
|
-
const fieldCount = Children.
|
|
2533
|
+
const fieldCount = Children.toArray(children).length;
|
|
2081
2534
|
const styleWithCount = {
|
|
2082
2535
|
...style,
|
|
2083
2536
|
"--fieldGroup_field-count": fieldCount
|
|
2084
2537
|
};
|
|
2538
|
+
const fieldsetRef = useRef12(null);
|
|
2539
|
+
const probeRef = useRef12(null);
|
|
2540
|
+
const [isCollapsed, setIsCollapsed] = useState11(false);
|
|
2541
|
+
useEffect10(() => {
|
|
2542
|
+
const fieldsetEl = fieldsetRef.current;
|
|
2543
|
+
const probeEl = probeRef.current;
|
|
2544
|
+
if (variant !== "horizontal" || !fieldsetEl || !probeEl || typeof ResizeObserver === "undefined") {
|
|
2545
|
+
setIsCollapsed(false);
|
|
2546
|
+
return;
|
|
2547
|
+
}
|
|
2548
|
+
let fieldsetSize = 0;
|
|
2549
|
+
let thresholdSize = 0;
|
|
2550
|
+
const observer = new ResizeObserver((entries) => {
|
|
2551
|
+
for (const entry of entries) {
|
|
2552
|
+
const size = getInlineSize(entry);
|
|
2553
|
+
if (entry.target === fieldsetEl) fieldsetSize = size;
|
|
2554
|
+
else if (entry.target === probeEl) thresholdSize = size;
|
|
2555
|
+
}
|
|
2556
|
+
setIsCollapsed(fieldsetSize < thresholdSize);
|
|
2557
|
+
});
|
|
2558
|
+
observer.observe(fieldsetEl);
|
|
2559
|
+
observer.observe(probeEl);
|
|
2560
|
+
return () => observer.disconnect();
|
|
2561
|
+
}, [variant]);
|
|
2085
2562
|
return /* @__PURE__ */ jsxs26(
|
|
2086
2563
|
"fieldset",
|
|
2087
2564
|
{
|
|
2088
2565
|
...rest,
|
|
2566
|
+
ref: fieldsetRef,
|
|
2089
2567
|
style: styleWithCount,
|
|
2090
|
-
className:
|
|
2568
|
+
className: cn39(FieldGroup_default.fieldGroup, FieldGroup_default[`--variant_${variant}`], className),
|
|
2569
|
+
"data-collapsed": variant === "horizontal" && isCollapsed ? "true" : void 0,
|
|
2091
2570
|
children: [
|
|
2092
|
-
legend !== void 0 && /* @__PURE__ */
|
|
2093
|
-
/* @__PURE__ */
|
|
2571
|
+
legend !== void 0 && /* @__PURE__ */ jsx39("legend", { className: FieldGroup_default.legend, children: legend }),
|
|
2572
|
+
/* @__PURE__ */ jsx39("div", { className: FieldGroup_default.fields, children }),
|
|
2573
|
+
/* @__PURE__ */ jsx39("div", { className: FieldGroup_default.probeContainer, children: /* @__PURE__ */ jsx39("div", { ref: probeRef, className: FieldGroup_default.probe }) })
|
|
2094
2574
|
]
|
|
2095
2575
|
}
|
|
2096
2576
|
);
|
|
2097
2577
|
}
|
|
2098
2578
|
|
|
2099
2579
|
// src/components/interaction/form/FileInput/FileInput.tsx
|
|
2100
|
-
import { useId as
|
|
2580
|
+
import { useId as useId16, useRef as useRef13, useState as useState12 } from "react";
|
|
2101
2581
|
|
|
2102
2582
|
// src/components/interaction/form/FileInput/FileInput.module.css
|
|
2103
|
-
var FileInput_default = {"component":"
|
|
2583
|
+
var FileInput_default = {"component":"bds2110FileInput-component","formGroup":"bds2110FileInput-formGroup","fieldLabel":"bds2110FileInput-fieldLabel","dropZone":"bds2110FileInput-dropZone","isDragging":"bds2110FileInput-isDragging","hasError":"bds2110FileInput-hasError","isDisabled":"bds2110FileInput-isDisabled","icon":"bds2110FileInput-icon","prompt":"bds2110FileInput-prompt","acceptHint":"bds2110FileInput-acceptHint","hiddenInput":"bds2110FileInput-hiddenInput"};
|
|
2104
2584
|
|
|
2105
2585
|
// src/components/interaction/form/FileInput/FileInput.tsx
|
|
2106
|
-
import { cn as
|
|
2107
|
-
import { Fragment as
|
|
2586
|
+
import { cn as cn40 } from "@boostdev/design-system-foundation";
|
|
2587
|
+
import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2108
2588
|
function FileInput({
|
|
2109
2589
|
label,
|
|
2110
2590
|
name,
|
|
@@ -2118,13 +2598,13 @@ function FileInput({
|
|
|
2118
2598
|
className,
|
|
2119
2599
|
...rest
|
|
2120
2600
|
}) {
|
|
2121
|
-
const uid = name +
|
|
2601
|
+
const uid = name + useId16();
|
|
2122
2602
|
const hintId = uid + "hint";
|
|
2123
2603
|
const errorId = uid + "error";
|
|
2124
2604
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2125
|
-
const inputRef =
|
|
2126
|
-
const [isDragging, setIsDragging] =
|
|
2127
|
-
const [fileNames, setFileNames] =
|
|
2605
|
+
const inputRef = useRef13(null);
|
|
2606
|
+
const [isDragging, setIsDragging] = useState12(false);
|
|
2607
|
+
const [fileNames, setFileNames] = useState12([]);
|
|
2128
2608
|
const isFileAccepted = (file) => {
|
|
2129
2609
|
if (!accept) return true;
|
|
2130
2610
|
return accept.split(",").some((token) => {
|
|
@@ -2145,7 +2625,9 @@ function FileInput({
|
|
|
2145
2625
|
setIsDragging(false);
|
|
2146
2626
|
if (disabled) return;
|
|
2147
2627
|
const dt = new DataTransfer();
|
|
2148
|
-
Array.from(e.dataTransfer.files).filter(isFileAccepted)
|
|
2628
|
+
const accepted = Array.from(e.dataTransfer.files).filter(isFileAccepted);
|
|
2629
|
+
const filesToAdd = multiple ? accepted : accepted.slice(0, 1);
|
|
2630
|
+
filesToAdd.forEach((f) => dt.items.add(f));
|
|
2149
2631
|
if (inputRef.current) inputRef.current.files = dt.files;
|
|
2150
2632
|
handleFiles(dt.files.length > 0 ? dt.files : null);
|
|
2151
2633
|
};
|
|
@@ -2153,25 +2635,27 @@ function FileInput({
|
|
|
2153
2635
|
e.preventDefault();
|
|
2154
2636
|
if (!disabled) setIsDragging(true);
|
|
2155
2637
|
};
|
|
2156
|
-
const handleDragLeave = () =>
|
|
2157
|
-
|
|
2638
|
+
const handleDragLeave = (e) => {
|
|
2639
|
+
if (!e.currentTarget.contains(e.relatedTarget)) setIsDragging(false);
|
|
2640
|
+
};
|
|
2641
|
+
return /* @__PURE__ */ jsxs27(InputContainer, { ...rest, className: cn40(FileInput_default.formGroup, className), children: [
|
|
2158
2642
|
/* @__PURE__ */ jsxs27(
|
|
2159
2643
|
"label",
|
|
2160
2644
|
{
|
|
2161
2645
|
htmlFor: uid,
|
|
2162
|
-
className:
|
|
2646
|
+
className: cn40(FileInput_default.dropZone, isDragging && FileInput_default.isDragging, error && FileInput_default.hasError, disabled && FileInput_default.isDisabled),
|
|
2163
2647
|
onDrop: handleDrop,
|
|
2164
2648
|
onDragOver: handleDragOver,
|
|
2165
2649
|
onDragLeave: handleDragLeave,
|
|
2166
2650
|
children: [
|
|
2167
|
-
/* @__PURE__ */
|
|
2168
|
-
/* @__PURE__ */
|
|
2169
|
-
/* @__PURE__ */
|
|
2170
|
-
/* @__PURE__ */
|
|
2651
|
+
/* @__PURE__ */ jsx40("span", { className: FileInput_default.fieldLabel, children: label }),
|
|
2652
|
+
/* @__PURE__ */ jsx40("svg", { "aria-hidden": "true", className: FileInput_default.icon, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx40("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5" }) }),
|
|
2653
|
+
/* @__PURE__ */ jsx40("span", { className: FileInput_default.prompt, children: fileNames.length > 0 ? fileNames.join(", ") : /* @__PURE__ */ jsxs27(Fragment4, { children: [
|
|
2654
|
+
/* @__PURE__ */ jsx40("strong", { children: "Click to upload" }),
|
|
2171
2655
|
" or drag and drop"
|
|
2172
2656
|
] }) }),
|
|
2173
|
-
accept && /* @__PURE__ */
|
|
2174
|
-
/* @__PURE__ */
|
|
2657
|
+
accept && /* @__PURE__ */ jsx40("span", { className: FileInput_default.acceptHint, children: accept }),
|
|
2658
|
+
/* @__PURE__ */ jsx40(
|
|
2175
2659
|
"input",
|
|
2176
2660
|
{
|
|
2177
2661
|
ref: inputRef,
|
|
@@ -2192,20 +2676,20 @@ function FileInput({
|
|
|
2192
2676
|
]
|
|
2193
2677
|
}
|
|
2194
2678
|
),
|
|
2195
|
-
/* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2679
|
+
/* @__PURE__ */ jsx40(Message, { inputId: uid, type: "error", message: error }),
|
|
2680
|
+
/* @__PURE__ */ jsx40(Message, { inputId: uid, type: "hint", message: hint })
|
|
2197
2681
|
] });
|
|
2198
2682
|
}
|
|
2199
2683
|
|
|
2200
2684
|
// src/components/interaction/form/FormInput/FormInput.tsx
|
|
2201
|
-
import { useId as
|
|
2685
|
+
import { useId as useId17 } from "react";
|
|
2202
2686
|
|
|
2203
2687
|
// src/components/interaction/form/FormInput/FormInput.module.css
|
|
2204
|
-
var FormInput_default = {"component":"
|
|
2688
|
+
var FormInput_default = {"component":"bds2110FormInput-component","formGroup":"bds2110FormInput-formGroup","input":"bds2110FormInput-input","g":"bds2110FormInput-g","inputError":"bds2110FormInput-inputError"};
|
|
2205
2689
|
|
|
2206
2690
|
// src/components/interaction/form/FormInput/FormInput.tsx
|
|
2207
|
-
import { cn as
|
|
2208
|
-
import { jsx as
|
|
2691
|
+
import { cn as cn41 } from "@boostdev/design-system-foundation";
|
|
2692
|
+
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2209
2693
|
function FormInput({
|
|
2210
2694
|
label,
|
|
2211
2695
|
name,
|
|
@@ -2214,42 +2698,43 @@ function FormInput({
|
|
|
2214
2698
|
hint,
|
|
2215
2699
|
className,
|
|
2216
2700
|
required,
|
|
2701
|
+
"aria-label": nativeAriaLabel,
|
|
2217
2702
|
...props
|
|
2218
2703
|
}) {
|
|
2219
|
-
const id = name +
|
|
2704
|
+
const id = name + useId17();
|
|
2220
2705
|
const hintId = id + "hint";
|
|
2221
2706
|
const errorId = id + "error";
|
|
2222
2707
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2223
|
-
return /* @__PURE__ */ jsxs28(InputContainer, { className:
|
|
2224
|
-
/* @__PURE__ */
|
|
2225
|
-
/* @__PURE__ */
|
|
2708
|
+
return /* @__PURE__ */ jsxs28(InputContainer, { className: cn41(FormInput_default.formGroup, className), children: [
|
|
2709
|
+
/* @__PURE__ */ jsx41(Label, { id, label }),
|
|
2710
|
+
/* @__PURE__ */ jsx41(
|
|
2226
2711
|
"input",
|
|
2227
2712
|
{
|
|
2713
|
+
...props,
|
|
2228
2714
|
"aria-invalid": !!error,
|
|
2229
2715
|
"aria-describedby": describedBy,
|
|
2230
|
-
"aria-label": ariaLabel,
|
|
2716
|
+
"aria-label": ariaLabel ?? nativeAriaLabel,
|
|
2231
2717
|
"aria-required": required || void 0,
|
|
2232
2718
|
id,
|
|
2233
2719
|
name,
|
|
2234
2720
|
required,
|
|
2235
|
-
className:
|
|
2236
|
-
...props
|
|
2721
|
+
className: cn41(FormInput_default.input, error && FormInput_default.inputError)
|
|
2237
2722
|
}
|
|
2238
2723
|
),
|
|
2239
|
-
/* @__PURE__ */
|
|
2240
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ jsx41(Message, { inputId: id, type: "error", message: error }),
|
|
2725
|
+
/* @__PURE__ */ jsx41(Message, { inputId: id, type: "hint", message: hint })
|
|
2241
2726
|
] });
|
|
2242
2727
|
}
|
|
2243
2728
|
|
|
2244
2729
|
// src/components/interaction/form/NumberInput/NumberInput.tsx
|
|
2245
|
-
import { useId as
|
|
2730
|
+
import { useEffect as useEffect11, useId as useId18, useRef as useRef14, useState as useState13 } from "react";
|
|
2246
2731
|
|
|
2247
2732
|
// src/components/interaction/form/NumberInput/NumberInput.module.css
|
|
2248
|
-
var NumberInput_default = {"component":"
|
|
2733
|
+
var NumberInput_default = {"component":"bds2110NumberInput-component","formGroup":"bds2110NumberInput-formGroup","inputRow":"bds2110NumberInput-inputRow","input":"bds2110NumberInput-input","inputError":"bds2110NumberInput-inputError","stepper":"bds2110NumberInput-stepper"};
|
|
2249
2734
|
|
|
2250
2735
|
// src/components/interaction/form/NumberInput/NumberInput.tsx
|
|
2251
|
-
import { cn as
|
|
2252
|
-
import { jsx as
|
|
2736
|
+
import { cn as cn42 } from "@boostdev/design-system-foundation";
|
|
2737
|
+
import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2253
2738
|
function NumberInput({
|
|
2254
2739
|
label,
|
|
2255
2740
|
name,
|
|
@@ -2263,16 +2748,23 @@ function NumberInput({
|
|
|
2263
2748
|
hint,
|
|
2264
2749
|
onChange,
|
|
2265
2750
|
className,
|
|
2751
|
+
decreaseLabel = "Decrease",
|
|
2752
|
+
increaseLabel = "Increase",
|
|
2266
2753
|
...rest
|
|
2267
2754
|
}) {
|
|
2268
|
-
const uid = name +
|
|
2755
|
+
const uid = name + useId18();
|
|
2269
2756
|
const hintId = uid + "hint";
|
|
2270
2757
|
const errorId = uid + "error";
|
|
2271
2758
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2272
|
-
const inputRef =
|
|
2759
|
+
const inputRef = useRef14(null);
|
|
2273
2760
|
const isControlled = value !== void 0;
|
|
2274
|
-
const [internalValue, setInternalValue] =
|
|
2761
|
+
const [internalValue, setInternalValue] = useState13(defaultValue ?? 0);
|
|
2275
2762
|
const currentValue = isControlled ? value : internalValue;
|
|
2763
|
+
const [controlledDraft, setControlledDraft] = useState13(() => isControlled ? String(value) : "");
|
|
2764
|
+
useEffect11(() => {
|
|
2765
|
+
if (!isControlled) return;
|
|
2766
|
+
setControlledDraft((prev) => parseFloat(prev) === value ? prev : String(value));
|
|
2767
|
+
}, [isControlled, value]);
|
|
2276
2768
|
const clamp = (v) => {
|
|
2277
2769
|
const withMin = min !== void 0 ? Math.max(min, v) : v;
|
|
2278
2770
|
return max !== void 0 ? Math.min(max, withMin) : withMin;
|
|
@@ -2285,84 +2777,91 @@ function NumberInput({
|
|
|
2285
2777
|
inputRef.current.value = String(next);
|
|
2286
2778
|
inputRef.current.dispatchEvent(new Event("input", { bubbles: true }));
|
|
2287
2779
|
}
|
|
2780
|
+
} else {
|
|
2781
|
+
setControlledDraft(String(next));
|
|
2288
2782
|
}
|
|
2289
2783
|
onChange?.(next);
|
|
2290
2784
|
};
|
|
2291
|
-
return /* @__PURE__ */ jsxs29(InputContainer, { ...rest, className:
|
|
2292
|
-
/* @__PURE__ */
|
|
2785
|
+
return /* @__PURE__ */ jsxs29(InputContainer, { ...rest, className: cn42(NumberInput_default.formGroup, className), children: [
|
|
2786
|
+
/* @__PURE__ */ jsx42(Label, { id: uid, label }),
|
|
2293
2787
|
/* @__PURE__ */ jsxs29("div", { className: NumberInput_default.inputRow, children: [
|
|
2294
|
-
/* @__PURE__ */
|
|
2788
|
+
/* @__PURE__ */ jsx42(
|
|
2295
2789
|
"button",
|
|
2296
2790
|
{
|
|
2297
2791
|
type: "button",
|
|
2298
2792
|
className: NumberInput_default.stepper,
|
|
2299
|
-
"aria-label":
|
|
2793
|
+
"aria-label": decreaseLabel,
|
|
2300
2794
|
"aria-controls": uid,
|
|
2301
2795
|
disabled: disabled || min !== void 0 && currentValue <= min,
|
|
2302
2796
|
onClick: () => adjust(-step),
|
|
2303
2797
|
tabIndex: -1,
|
|
2304
|
-
children: /* @__PURE__ */
|
|
2798
|
+
children: /* @__PURE__ */ jsx42("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx42("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14" }) })
|
|
2305
2799
|
}
|
|
2306
2800
|
),
|
|
2307
|
-
/* @__PURE__ */
|
|
2801
|
+
/* @__PURE__ */ jsx42(
|
|
2308
2802
|
"input",
|
|
2309
2803
|
{
|
|
2310
2804
|
ref: inputRef,
|
|
2311
2805
|
id: uid,
|
|
2312
2806
|
type: "number",
|
|
2313
2807
|
name,
|
|
2314
|
-
...isControlled ? { value } : { defaultValue },
|
|
2808
|
+
...isControlled ? { value: controlledDraft } : { defaultValue },
|
|
2315
2809
|
min,
|
|
2316
2810
|
max,
|
|
2317
2811
|
step,
|
|
2318
2812
|
disabled,
|
|
2319
2813
|
"aria-invalid": !!error,
|
|
2320
2814
|
"aria-describedby": describedBy,
|
|
2321
|
-
className:
|
|
2815
|
+
className: cn42(NumberInput_default.input, error ? NumberInput_default.inputError : void 0),
|
|
2322
2816
|
onChange: (e) => {
|
|
2323
|
-
|
|
2324
|
-
const
|
|
2325
|
-
if (
|
|
2326
|
-
|
|
2817
|
+
if (e.target.validity.badInput) return;
|
|
2818
|
+
const raw = e.target.value;
|
|
2819
|
+
if (isControlled) setControlledDraft(raw);
|
|
2820
|
+
if (raw === "") return;
|
|
2821
|
+
const parsed = parseFloat(raw);
|
|
2822
|
+
if (Number.isNaN(parsed)) return;
|
|
2823
|
+
if (!isControlled) setInternalValue(parsed);
|
|
2824
|
+
onChange?.(parsed);
|
|
2327
2825
|
}
|
|
2328
2826
|
}
|
|
2329
2827
|
),
|
|
2330
|
-
/* @__PURE__ */
|
|
2828
|
+
/* @__PURE__ */ jsx42(
|
|
2331
2829
|
"button",
|
|
2332
2830
|
{
|
|
2333
2831
|
type: "button",
|
|
2334
2832
|
className: NumberInput_default.stepper,
|
|
2335
|
-
"aria-label":
|
|
2833
|
+
"aria-label": increaseLabel,
|
|
2336
2834
|
"aria-controls": uid,
|
|
2337
2835
|
disabled: disabled || max !== void 0 && currentValue >= max,
|
|
2338
2836
|
onClick: () => adjust(step),
|
|
2339
2837
|
tabIndex: -1,
|
|
2340
|
-
children: /* @__PURE__ */
|
|
2838
|
+
children: /* @__PURE__ */ jsx42("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx42("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 5v14M5 12h14" }) })
|
|
2341
2839
|
}
|
|
2342
2840
|
)
|
|
2343
2841
|
] }),
|
|
2344
|
-
/* @__PURE__ */
|
|
2345
|
-
/* @__PURE__ */
|
|
2842
|
+
/* @__PURE__ */ jsx42(Message, { inputId: uid, type: "error", message: error }),
|
|
2843
|
+
/* @__PURE__ */ jsx42(Message, { inputId: uid, type: "hint", message: hint })
|
|
2346
2844
|
] });
|
|
2347
2845
|
}
|
|
2348
2846
|
|
|
2349
2847
|
// src/components/interaction/form/Radio/Radio.tsx
|
|
2350
|
-
import { useId as
|
|
2848
|
+
import { useId as useId19 } from "react";
|
|
2351
2849
|
|
|
2352
2850
|
// src/components/interaction/form/Radio/Radio.module.css
|
|
2353
|
-
var Radio_default = {"component":"
|
|
2851
|
+
var Radio_default = {"component":"bds2110Radio-component","radioGroup":"bds2110Radio-radioGroup","inputWrapper":"bds2110Radio-inputWrapper","textWrapper":"bds2110Radio-textWrapper","description":"bds2110Radio-description","radio":"bds2110Radio-radio","g":"bds2110Radio-g","radioError":"bds2110Radio-radioError"};
|
|
2354
2852
|
|
|
2355
2853
|
// src/components/interaction/form/Radio/Radio.tsx
|
|
2356
|
-
import { cn as
|
|
2357
|
-
import { jsx as
|
|
2358
|
-
function Radio({ label, name, description, error, hint, className, ...props }) {
|
|
2359
|
-
const id = name +
|
|
2854
|
+
import { cn as cn43 } from "@boostdev/design-system-foundation";
|
|
2855
|
+
import { jsx as jsx43, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2856
|
+
function Radio({ label, name, description, error, hint, className, id: consumerId, ...props }) {
|
|
2857
|
+
const id = consumerId ?? name + useId19();
|
|
2858
|
+
const descriptionId = id + "description";
|
|
2360
2859
|
const hintId = id + "hint";
|
|
2361
2860
|
const errorId = id + "error";
|
|
2362
|
-
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2363
|
-
return /* @__PURE__ */ jsxs30(InputContainer, { className:
|
|
2861
|
+
const describedBy = [description && descriptionId, error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2862
|
+
return /* @__PURE__ */ jsxs30(InputContainer, { className: cn43(Radio_default.radioGroup, className), children: [
|
|
2364
2863
|
/* @__PURE__ */ jsxs30("div", { className: Radio_default.inputWrapper, children: [
|
|
2365
|
-
/* @__PURE__ */
|
|
2864
|
+
/* @__PURE__ */ jsx43(
|
|
2366
2865
|
"input",
|
|
2367
2866
|
{
|
|
2368
2867
|
"aria-describedby": describedBy,
|
|
@@ -2370,29 +2869,29 @@ function Radio({ label, name, description, error, hint, className, ...props }) {
|
|
|
2370
2869
|
type: "radio",
|
|
2371
2870
|
id,
|
|
2372
2871
|
name,
|
|
2373
|
-
className:
|
|
2872
|
+
className: cn43(Radio_default.radio, error && Radio_default.radioError),
|
|
2374
2873
|
...props
|
|
2375
2874
|
}
|
|
2376
2875
|
),
|
|
2377
2876
|
/* @__PURE__ */ jsxs30("div", { className: Radio_default.textWrapper, children: [
|
|
2378
|
-
/* @__PURE__ */
|
|
2379
|
-
description && /* @__PURE__ */
|
|
2877
|
+
/* @__PURE__ */ jsx43(Label, { id, label }),
|
|
2878
|
+
description && /* @__PURE__ */ jsx43("span", { id: descriptionId, className: Radio_default.description, children: description })
|
|
2380
2879
|
] })
|
|
2381
2880
|
] }),
|
|
2382
|
-
/* @__PURE__ */
|
|
2383
|
-
/* @__PURE__ */
|
|
2881
|
+
/* @__PURE__ */ jsx43(Message, { inputId: id, type: "error", message: error }),
|
|
2882
|
+
/* @__PURE__ */ jsx43(Message, { inputId: id, type: "hint", message: hint })
|
|
2384
2883
|
] });
|
|
2385
2884
|
}
|
|
2386
2885
|
|
|
2387
2886
|
// src/components/interaction/form/RadioGroup/RadioGroup.tsx
|
|
2388
|
-
import { useId as
|
|
2887
|
+
import { useId as useId20 } from "react";
|
|
2389
2888
|
|
|
2390
2889
|
// src/components/interaction/form/RadioGroup/RadioGroup.module.css
|
|
2391
|
-
var RadioGroup_default = {"component":"
|
|
2890
|
+
var RadioGroup_default = {"component":"bds2110RadioGroup-component","group":"bds2110RadioGroup-group","legend":"bds2110RadioGroup-legend","required":"bds2110RadioGroup-required","requiredLabel":"bds2110RadioGroup-requiredLabel","items":"bds2110RadioGroup-items"};
|
|
2392
2891
|
|
|
2393
2892
|
// src/components/interaction/form/RadioGroup/RadioGroup.tsx
|
|
2394
|
-
import { cn as
|
|
2395
|
-
import { jsx as
|
|
2893
|
+
import { cn as cn44 } from "@boostdev/design-system-foundation";
|
|
2894
|
+
import { Fragment as Fragment5, jsx as jsx44, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2396
2895
|
function RadioGroup({
|
|
2397
2896
|
legend,
|
|
2398
2897
|
children,
|
|
@@ -2402,7 +2901,7 @@ function RadioGroup({
|
|
|
2402
2901
|
className,
|
|
2403
2902
|
...rest
|
|
2404
2903
|
}) {
|
|
2405
|
-
const id =
|
|
2904
|
+
const id = useId20();
|
|
2406
2905
|
const hintId = id + "hint";
|
|
2407
2906
|
const errorId = id + "error";
|
|
2408
2907
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
@@ -2410,17 +2909,20 @@ function RadioGroup({
|
|
|
2410
2909
|
"fieldset",
|
|
2411
2910
|
{
|
|
2412
2911
|
...rest,
|
|
2413
|
-
className:
|
|
2414
|
-
"aria-required": required || void 0,
|
|
2912
|
+
className: cn44(RadioGroup_default.group, className),
|
|
2415
2913
|
"aria-describedby": describedBy,
|
|
2416
2914
|
children: [
|
|
2417
2915
|
/* @__PURE__ */ jsxs31("legend", { className: RadioGroup_default.legend, children: [
|
|
2418
2916
|
legend,
|
|
2419
|
-
required && /* @__PURE__ */
|
|
2917
|
+
required && /* @__PURE__ */ jsxs31(Fragment5, { children: [
|
|
2918
|
+
/* @__PURE__ */ jsx44("span", { className: RadioGroup_default.required, "aria-hidden": "true", children: " *" }),
|
|
2919
|
+
" ",
|
|
2920
|
+
/* @__PURE__ */ jsx44("span", { className: RadioGroup_default.requiredLabel, children: "(required)" })
|
|
2921
|
+
] })
|
|
2420
2922
|
] }),
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2423
|
-
/* @__PURE__ */
|
|
2923
|
+
/* @__PURE__ */ jsx44("div", { className: RadioGroup_default.items, children }),
|
|
2924
|
+
/* @__PURE__ */ jsx44(Message, { inputId: id, type: "error", message: error }),
|
|
2925
|
+
/* @__PURE__ */ jsx44(Message, { inputId: id, type: "hint", message: hint })
|
|
2424
2926
|
]
|
|
2425
2927
|
}
|
|
2426
2928
|
);
|
|
@@ -2430,11 +2932,14 @@ function RadioGroup({
|
|
|
2430
2932
|
import { Children as Children2, cloneElement as cloneElement4, isValidElement as isValidElement4 } from "react";
|
|
2431
2933
|
|
|
2432
2934
|
// src/components/interaction/form/SegmentedControl/SegmentedControl.module.css
|
|
2433
|
-
var SegmentedControl_default = {"component":"
|
|
2935
|
+
var SegmentedControl_default = {"component":"bds2110SegmentedControl-component","control":"bds2110SegmentedControl-control","thumb":"bds2110SegmentedControl-thumb","indicator":"bds2110SegmentedControl-indicator","item":"bds2110SegmentedControl-item","--active":"bds2110SegmentedControl---active","--disabled":"bds2110SegmentedControl---disabled","--size_small":"bds2110SegmentedControl---size_small","--size_large":"bds2110SegmentedControl---size_large","--variant_outline":"bds2110SegmentedControl---variant_outline","--no-selection":"bds2110SegmentedControl---no-selection"};
|
|
2434
2936
|
|
|
2435
2937
|
// src/components/interaction/form/SegmentedControl/SegmentedControl.tsx
|
|
2436
|
-
import { cn as
|
|
2437
|
-
import { jsx as
|
|
2938
|
+
import { cn as cn45 } from "@boostdev/design-system-foundation";
|
|
2939
|
+
import { jsx as jsx45, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2940
|
+
var preventDisabledActivation = (event) => {
|
|
2941
|
+
event.preventDefault();
|
|
2942
|
+
};
|
|
2438
2943
|
function SegmentedControl({
|
|
2439
2944
|
children,
|
|
2440
2945
|
selectedIndex: selectedIndexProp,
|
|
@@ -2449,30 +2954,50 @@ function SegmentedControl({
|
|
|
2449
2954
|
const p = child.props;
|
|
2450
2955
|
return p["aria-current"] === "page" || p["aria-pressed"] === true || p["aria-selected"] === true;
|
|
2451
2956
|
}) : -1;
|
|
2452
|
-
const activeIndex = Math.max(0,
|
|
2957
|
+
const activeIndex = validChildren.length === 0 ? void 0 : selectedIndexProp !== void 0 ? Math.min(Math.max(selectedIndexProp, 0), validChildren.length - 1) : autoIndex >= 0 ? autoIndex : void 0;
|
|
2453
2958
|
return /* @__PURE__ */ jsxs32(
|
|
2454
2959
|
"div",
|
|
2455
2960
|
{
|
|
2456
2961
|
...rest,
|
|
2457
2962
|
role: "group",
|
|
2458
|
-
className:
|
|
2963
|
+
className: cn45(
|
|
2964
|
+
SegmentedControl_default.control,
|
|
2965
|
+
SegmentedControl_default[`--size_${size}`],
|
|
2966
|
+
SegmentedControl_default[`--variant_${variant}`],
|
|
2967
|
+
activeIndex === void 0 && SegmentedControl_default["--no-selection"],
|
|
2968
|
+
className
|
|
2969
|
+
),
|
|
2459
2970
|
style: {
|
|
2460
2971
|
"--control_count": validChildren.length,
|
|
2461
|
-
"--control_selected-index": activeIndex
|
|
2972
|
+
...activeIndex !== void 0 ? { "--control_selected-index": activeIndex } : {}
|
|
2462
2973
|
},
|
|
2463
2974
|
children: [
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ jsx45("span", { className: SegmentedControl_default.thumb, "aria-hidden": "true" }),
|
|
2976
|
+
/* @__PURE__ */ jsx45("span", { className: SegmentedControl_default.indicator, "aria-hidden": "true" }),
|
|
2466
2977
|
validChildren.map((child, index) => {
|
|
2467
2978
|
const isActive = index === activeIndex;
|
|
2468
2979
|
const p = child.props;
|
|
2469
|
-
const
|
|
2980
|
+
const isDisabled2 = disabled || !!p.disabled || p["aria-disabled"] === true;
|
|
2981
|
+
const hasAriaState = p["aria-current"] !== void 0 || p["aria-pressed"] !== void 0 || p["aria-selected"] !== void 0;
|
|
2982
|
+
const stateProps = {};
|
|
2983
|
+
if (isDisabled2) {
|
|
2984
|
+
stateProps["aria-disabled"] = true;
|
|
2985
|
+
if (child.type === "button") {
|
|
2986
|
+
stateProps.disabled = true;
|
|
2987
|
+
} else {
|
|
2988
|
+
stateProps.tabIndex = -1;
|
|
2989
|
+
stateProps.onClick = preventDisabledActivation;
|
|
2990
|
+
}
|
|
2991
|
+
} else if (isActive && selectedIndexProp !== void 0 && !hasAriaState) {
|
|
2992
|
+
stateProps[child.type === "a" ? "aria-current" : "aria-pressed"] = child.type === "a" ? "page" : true;
|
|
2993
|
+
}
|
|
2470
2994
|
return cloneElement4(child, {
|
|
2471
2995
|
key: child.key ?? index,
|
|
2472
|
-
|
|
2996
|
+
...stateProps,
|
|
2997
|
+
className: cn45(
|
|
2473
2998
|
SegmentedControl_default.item,
|
|
2474
2999
|
isActive && SegmentedControl_default["--active"],
|
|
2475
|
-
|
|
3000
|
+
isDisabled2 && SegmentedControl_default["--disabled"],
|
|
2476
3001
|
p.className
|
|
2477
3002
|
)
|
|
2478
3003
|
});
|
|
@@ -2483,14 +3008,14 @@ function SegmentedControl({
|
|
|
2483
3008
|
}
|
|
2484
3009
|
|
|
2485
3010
|
// src/components/interaction/form/Select/Select.tsx
|
|
2486
|
-
import { useId as
|
|
3011
|
+
import { useId as useId21 } from "react";
|
|
2487
3012
|
|
|
2488
3013
|
// src/components/interaction/form/Select/Select.module.css
|
|
2489
|
-
var Select_default = {"component":"
|
|
3014
|
+
var Select_default = {"component":"bds2110Select-component","formGroup":"bds2110Select-formGroup","selectWrapper":"bds2110Select-selectWrapper","select":"bds2110Select-select","selectError":"bds2110Select-selectError","chevron":"bds2110Select-chevron"};
|
|
2490
3015
|
|
|
2491
3016
|
// src/components/interaction/form/Select/Select.tsx
|
|
2492
|
-
import { cn as
|
|
2493
|
-
import { jsx as
|
|
3017
|
+
import { cn as cn46 } from "@boostdev/design-system-foundation";
|
|
3018
|
+
import { jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2494
3019
|
function Select({
|
|
2495
3020
|
label,
|
|
2496
3021
|
name,
|
|
@@ -2500,48 +3025,55 @@ function Select({
|
|
|
2500
3025
|
hint,
|
|
2501
3026
|
className,
|
|
2502
3027
|
required,
|
|
2503
|
-
|
|
3028
|
+
id,
|
|
3029
|
+
value,
|
|
3030
|
+
defaultValue,
|
|
3031
|
+
...rest
|
|
2504
3032
|
}) {
|
|
2505
|
-
const
|
|
2506
|
-
const
|
|
2507
|
-
const
|
|
3033
|
+
const generatedId = name + useId21();
|
|
3034
|
+
const selectId = id ?? generatedId;
|
|
3035
|
+
const hintId = selectId + "hint";
|
|
3036
|
+
const errorId = selectId + "error";
|
|
2508
3037
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2509
|
-
|
|
2510
|
-
|
|
3038
|
+
const isControlled = value !== void 0;
|
|
3039
|
+
const initialValueProps = isControlled ? { value } : { defaultValue: defaultValue ?? (placeholder ? "" : void 0) };
|
|
3040
|
+
return /* @__PURE__ */ jsxs33(InputContainer, { className: cn46(Select_default.formGroup, className), children: [
|
|
3041
|
+
/* @__PURE__ */ jsx46(Label, { id: selectId, label }),
|
|
2511
3042
|
/* @__PURE__ */ jsxs33("div", { className: Select_default.selectWrapper, children: [
|
|
2512
3043
|
/* @__PURE__ */ jsxs33(
|
|
2513
3044
|
"select",
|
|
2514
3045
|
{
|
|
2515
|
-
|
|
3046
|
+
...rest,
|
|
3047
|
+
id: selectId,
|
|
2516
3048
|
name,
|
|
2517
3049
|
"aria-invalid": !!error,
|
|
2518
3050
|
"aria-required": required || void 0,
|
|
2519
3051
|
"aria-describedby": describedBy,
|
|
2520
3052
|
required,
|
|
2521
|
-
className:
|
|
2522
|
-
...
|
|
3053
|
+
className: cn46(Select_default.select, error ? Select_default.selectError : void 0),
|
|
3054
|
+
...initialValueProps,
|
|
2523
3055
|
children: [
|
|
2524
|
-
placeholder && /* @__PURE__ */
|
|
2525
|
-
options.map(({ value, label: optLabel, disabled }) => /* @__PURE__ */
|
|
3056
|
+
placeholder && /* @__PURE__ */ jsx46("option", { value: "", disabled: true, hidden: true, children: placeholder }),
|
|
3057
|
+
options.map(({ value: value2, label: optLabel, disabled }) => /* @__PURE__ */ jsx46("option", { value: value2, disabled, children: optLabel }, value2))
|
|
2526
3058
|
]
|
|
2527
3059
|
}
|
|
2528
3060
|
),
|
|
2529
|
-
/* @__PURE__ */
|
|
3061
|
+
/* @__PURE__ */ jsx46("span", { className: Select_default.chevron, "aria-hidden": "true", children: /* @__PURE__ */ jsx46("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx46("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 9l6 6 6-6" }) }) })
|
|
2530
3062
|
] }),
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
3063
|
+
/* @__PURE__ */ jsx46(Message, { inputId: selectId, type: "error", message: error }),
|
|
3064
|
+
/* @__PURE__ */ jsx46(Message, { inputId: selectId, type: "hint", message: hint })
|
|
2533
3065
|
] });
|
|
2534
3066
|
}
|
|
2535
3067
|
|
|
2536
3068
|
// src/components/interaction/form/Slider/Slider.tsx
|
|
2537
|
-
import { useId as
|
|
3069
|
+
import { useId as useId22, useState as useState14 } from "react";
|
|
2538
3070
|
|
|
2539
3071
|
// src/components/interaction/form/Slider/Slider.module.css
|
|
2540
|
-
var Slider_default = {"component":"
|
|
3072
|
+
var Slider_default = {"component":"bds2110Slider-component","formGroup":"bds2110Slider-formGroup","labelRow":"bds2110Slider-labelRow","value":"bds2110Slider-value","slider":"bds2110Slider-slider","sliderError":"bds2110Slider-sliderError"};
|
|
2541
3073
|
|
|
2542
3074
|
// src/components/interaction/form/Slider/Slider.tsx
|
|
2543
|
-
import { cn as
|
|
2544
|
-
import { jsx as
|
|
3075
|
+
import { cn as cn47 } from "@boostdev/design-system-foundation";
|
|
3076
|
+
import { jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2545
3077
|
function Slider({
|
|
2546
3078
|
label,
|
|
2547
3079
|
name,
|
|
@@ -2554,56 +3086,55 @@ function Slider({
|
|
|
2554
3086
|
onChange,
|
|
2555
3087
|
...props
|
|
2556
3088
|
}) {
|
|
2557
|
-
const id = name +
|
|
3089
|
+
const id = name + useId22();
|
|
2558
3090
|
const hintId = id + "hint";
|
|
2559
3091
|
const errorId = id + "error";
|
|
2560
3092
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2561
3093
|
const isControlled = props.value !== void 0;
|
|
2562
|
-
const [internalValue, setInternalValue] =
|
|
3094
|
+
const [internalValue, setInternalValue] = useState14(
|
|
3095
|
+
Number(props.defaultValue ?? min + (max - min) / 2)
|
|
3096
|
+
);
|
|
2563
3097
|
const currentValue = isControlled ? Number(props.value) : internalValue;
|
|
2564
3098
|
const fillPct = (currentValue - min) / (max - min) * 100;
|
|
2565
3099
|
const handleChange = (e) => {
|
|
2566
3100
|
if (!isControlled) setInternalValue(Number(e.target.value));
|
|
2567
3101
|
onChange?.(e);
|
|
2568
3102
|
};
|
|
2569
|
-
return /* @__PURE__ */ jsxs34(InputContainer, { className:
|
|
3103
|
+
return /* @__PURE__ */ jsxs34(InputContainer, { className: cn47(Slider_default.formGroup, className), children: [
|
|
2570
3104
|
/* @__PURE__ */ jsxs34("div", { className: Slider_default.labelRow, children: [
|
|
2571
|
-
/* @__PURE__ */
|
|
2572
|
-
showValue && /* @__PURE__ */
|
|
3105
|
+
/* @__PURE__ */ jsx47(Label, { id, label }),
|
|
3106
|
+
showValue && /* @__PURE__ */ jsx47("span", { className: Slider_default.value, children: currentValue })
|
|
2573
3107
|
] }),
|
|
2574
|
-
/* @__PURE__ */
|
|
3108
|
+
/* @__PURE__ */ jsx47(
|
|
2575
3109
|
"input",
|
|
2576
3110
|
{
|
|
3111
|
+
...props,
|
|
2577
3112
|
type: "range",
|
|
2578
3113
|
id,
|
|
2579
3114
|
name,
|
|
2580
3115
|
min,
|
|
2581
3116
|
max,
|
|
3117
|
+
"aria-invalid": !!error,
|
|
2582
3118
|
"aria-describedby": describedBy,
|
|
2583
|
-
|
|
2584
|
-
"
|
|
2585
|
-
|
|
2586
|
-
"aria-valuetext": String(currentValue),
|
|
2587
|
-
className: cn45(Slider_default.slider, error ? Slider_default.sliderError : void 0),
|
|
2588
|
-
style: { "--slider_fill": `${fillPct}%` },
|
|
2589
|
-
onChange: handleChange,
|
|
2590
|
-
...props
|
|
3119
|
+
className: cn47(Slider_default.slider, error ? Slider_default.sliderError : void 0),
|
|
3120
|
+
style: { ...props.style, "--slider_fill": `${fillPct}%` },
|
|
3121
|
+
onChange: handleChange
|
|
2591
3122
|
}
|
|
2592
3123
|
),
|
|
2593
|
-
/* @__PURE__ */
|
|
2594
|
-
/* @__PURE__ */
|
|
3124
|
+
/* @__PURE__ */ jsx47(Message, { inputId: id, type: "error", message: error }),
|
|
3125
|
+
/* @__PURE__ */ jsx47(Message, { inputId: id, type: "hint", message: hint })
|
|
2595
3126
|
] });
|
|
2596
3127
|
}
|
|
2597
3128
|
|
|
2598
3129
|
// src/components/interaction/form/Switch/Switch.tsx
|
|
2599
|
-
import { useId as
|
|
3130
|
+
import { useId as useId23 } from "react";
|
|
2600
3131
|
|
|
2601
3132
|
// src/components/interaction/form/Switch/Switch.module.css
|
|
2602
|
-
var Switch_default = {"component":"
|
|
3133
|
+
var Switch_default = {"component":"bds2110Switch-component","switchGroup":"bds2110Switch-switchGroup","--size_small":"bds2110Switch---size_small","--size_medium":"bds2110Switch---size_medium","--size_large":"bds2110Switch---size_large","inputWrapper":"bds2110Switch-inputWrapper","trackWrapper":"bds2110Switch-trackWrapper","switch":"bds2110Switch-switch","track":"bds2110Switch-track","thumb":"bds2110Switch-thumb","switchError":"bds2110Switch-switchError"};
|
|
2603
3134
|
|
|
2604
3135
|
// src/components/interaction/form/Switch/Switch.tsx
|
|
2605
|
-
import { cn as
|
|
2606
|
-
import { jsx as
|
|
3136
|
+
import { cn as cn48 } from "@boostdev/design-system-foundation";
|
|
3137
|
+
import { jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2607
3138
|
function Switch({
|
|
2608
3139
|
label,
|
|
2609
3140
|
name,
|
|
@@ -2614,44 +3145,45 @@ function Switch({
|
|
|
2614
3145
|
prefix,
|
|
2615
3146
|
...props
|
|
2616
3147
|
}) {
|
|
2617
|
-
const id = name +
|
|
3148
|
+
const id = name + useId23();
|
|
2618
3149
|
const hintId = id + "hint";
|
|
2619
3150
|
const errorId = id + "error";
|
|
2620
3151
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2621
|
-
return /* @__PURE__ */ jsxs35(InputContainer, { className:
|
|
3152
|
+
return /* @__PURE__ */ jsxs35(InputContainer, { className: cn48(Switch_default.switchGroup, Switch_default[`--size_${size}`], className), children: [
|
|
2622
3153
|
/* @__PURE__ */ jsxs35("div", { className: Switch_default.inputWrapper, children: [
|
|
2623
|
-
prefix && /* @__PURE__ */
|
|
3154
|
+
prefix && /* @__PURE__ */ jsx48("span", { children: prefix }),
|
|
2624
3155
|
/* @__PURE__ */ jsxs35("div", { className: Switch_default.trackWrapper, children: [
|
|
2625
|
-
/* @__PURE__ */
|
|
3156
|
+
/* @__PURE__ */ jsx48(
|
|
2626
3157
|
"input",
|
|
2627
3158
|
{
|
|
3159
|
+
...props,
|
|
2628
3160
|
type: "checkbox",
|
|
2629
3161
|
role: "switch",
|
|
2630
3162
|
id,
|
|
2631
3163
|
name,
|
|
2632
3164
|
"aria-describedby": describedBy,
|
|
2633
|
-
|
|
2634
|
-
|
|
3165
|
+
"aria-invalid": !!error,
|
|
3166
|
+
className: cn48(Switch_default.switch, error ? Switch_default.switchError : void 0)
|
|
2635
3167
|
}
|
|
2636
3168
|
),
|
|
2637
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ jsx48("span", { className: Switch_default.track, "aria-hidden": "true", children: /* @__PURE__ */ jsx48("span", { className: Switch_default.thumb }) })
|
|
2638
3170
|
] }),
|
|
2639
|
-
/* @__PURE__ */
|
|
3171
|
+
/* @__PURE__ */ jsx48(Label, { id, label })
|
|
2640
3172
|
] }),
|
|
2641
|
-
/* @__PURE__ */
|
|
2642
|
-
/* @__PURE__ */
|
|
3173
|
+
/* @__PURE__ */ jsx48(Message, { inputId: id, type: "error", message: error }),
|
|
3174
|
+
/* @__PURE__ */ jsx48(Message, { inputId: id, type: "hint", message: hint })
|
|
2643
3175
|
] });
|
|
2644
3176
|
}
|
|
2645
3177
|
|
|
2646
3178
|
// src/components/interaction/form/Textarea/Textarea.tsx
|
|
2647
|
-
import { useId as
|
|
3179
|
+
import { useId as useId24 } from "react";
|
|
2648
3180
|
|
|
2649
3181
|
// src/components/interaction/form/Textarea/Textarea.module.css
|
|
2650
|
-
var Textarea_default = {"component":"
|
|
3182
|
+
var Textarea_default = {"component":"bds2110Textarea-component","formGroup":"bds2110Textarea-formGroup","textarea":"bds2110Textarea-textarea","textareaError":"bds2110Textarea-textareaError"};
|
|
2651
3183
|
|
|
2652
3184
|
// src/components/interaction/form/Textarea/Textarea.tsx
|
|
2653
|
-
import { cn as
|
|
2654
|
-
import { jsx as
|
|
3185
|
+
import { cn as cn49 } from "@boostdev/design-system-foundation";
|
|
3186
|
+
import { jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2655
3187
|
function Textarea({
|
|
2656
3188
|
label,
|
|
2657
3189
|
name,
|
|
@@ -2659,15 +3191,17 @@ function Textarea({
|
|
|
2659
3191
|
hint,
|
|
2660
3192
|
className,
|
|
2661
3193
|
required,
|
|
3194
|
+
id: idProp,
|
|
2662
3195
|
...props
|
|
2663
3196
|
}) {
|
|
2664
|
-
const
|
|
3197
|
+
const generatedId = useId24();
|
|
3198
|
+
const id = idProp ?? name + generatedId;
|
|
2665
3199
|
const hintId = id + "hint";
|
|
2666
3200
|
const errorId = id + "error";
|
|
2667
3201
|
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2668
|
-
return /* @__PURE__ */ jsxs36(InputContainer, { className:
|
|
2669
|
-
/* @__PURE__ */
|
|
2670
|
-
/* @__PURE__ */
|
|
3202
|
+
return /* @__PURE__ */ jsxs36(InputContainer, { className: cn49(Textarea_default.formGroup, className), children: [
|
|
3203
|
+
/* @__PURE__ */ jsx49(Label, { id, label }),
|
|
3204
|
+
/* @__PURE__ */ jsx49(
|
|
2671
3205
|
"textarea",
|
|
2672
3206
|
{
|
|
2673
3207
|
id,
|
|
@@ -2676,40 +3210,40 @@ function Textarea({
|
|
|
2676
3210
|
"aria-describedby": describedBy,
|
|
2677
3211
|
"aria-required": required || void 0,
|
|
2678
3212
|
required,
|
|
2679
|
-
className:
|
|
3213
|
+
className: cn49(Textarea_default.textarea, error ? Textarea_default.textareaError : void 0),
|
|
2680
3214
|
...props
|
|
2681
3215
|
}
|
|
2682
3216
|
),
|
|
2683
|
-
/* @__PURE__ */
|
|
2684
|
-
/* @__PURE__ */
|
|
3217
|
+
/* @__PURE__ */ jsx49(Message, { inputId: id, type: "error", message: error }),
|
|
3218
|
+
/* @__PURE__ */ jsx49(Message, { inputId: id, type: "hint", message: hint })
|
|
2685
3219
|
] });
|
|
2686
3220
|
}
|
|
2687
3221
|
|
|
2688
3222
|
// src/components/layout/ButtonGroup/ButtonGroup.module.css
|
|
2689
|
-
var ButtonGroup_default = {"component":"
|
|
3223
|
+
var ButtonGroup_default = {"component":"bds2110ButtonGroup-component","buttonGroup":"bds2110ButtonGroup-buttonGroup","container":"bds2110ButtonGroup-container","--variant_card":"bds2110ButtonGroup---variant_card","--variant_flow":"bds2110ButtonGroup---variant_flow","--variant_modal":"bds2110ButtonGroup---variant_modal","--variant_content":"bds2110ButtonGroup---variant_content"};
|
|
2690
3224
|
|
|
2691
3225
|
// src/components/layout/ButtonGroup/ButtonGroup.tsx
|
|
2692
|
-
import { cn as
|
|
2693
|
-
import { jsx as
|
|
3226
|
+
import { cn as cn50 } from "@boostdev/design-system-foundation";
|
|
3227
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
2694
3228
|
function ButtonContainer({ children, className, variant, ...rest }) {
|
|
2695
|
-
return /* @__PURE__ */
|
|
3229
|
+
return /* @__PURE__ */ jsx50(
|
|
2696
3230
|
"div",
|
|
2697
3231
|
{
|
|
2698
3232
|
...rest,
|
|
2699
3233
|
role: "group",
|
|
2700
|
-
className:
|
|
2701
|
-
children: /* @__PURE__ */
|
|
3234
|
+
className: cn50(ButtonGroup_default.buttonGroup, className, variant && ButtonGroup_default[`--variant_${variant}`]),
|
|
3235
|
+
children: /* @__PURE__ */ jsx50("div", { className: ButtonGroup_default.container, children })
|
|
2702
3236
|
}
|
|
2703
3237
|
);
|
|
2704
3238
|
}
|
|
2705
3239
|
var ButtonGroup = ButtonContainer;
|
|
2706
3240
|
|
|
2707
3241
|
// src/components/layout/Card/Card.module.css
|
|
2708
|
-
var Card_default = {"component":"
|
|
3242
|
+
var Card_default = {"component":"bds2110Card-component","card":"bds2110Card-card","--default":"bds2110Card---default","--elevated":"bds2110Card---elevated","--outlined":"bds2110Card---outlined","--clickable":"bds2110Card---clickable","--padding-none":"bds2110Card---padding-none","--padding-small":"bds2110Card---padding-small","--padding-medium":"bds2110Card---padding-medium","--padding-large":"bds2110Card---padding-large","--padding-extra-large":"bds2110Card---padding-extra-large","--text-start":"bds2110Card---text-start","--text-center":"bds2110Card---text-center","--text-end":"bds2110Card---text-end"};
|
|
2709
3243
|
|
|
2710
3244
|
// src/components/layout/Card/Card.tsx
|
|
2711
|
-
import { cn as
|
|
2712
|
-
import { jsx as
|
|
3245
|
+
import { cn as cn51 } from "@boostdev/design-system-foundation";
|
|
3246
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2713
3247
|
function Card({
|
|
2714
3248
|
children,
|
|
2715
3249
|
className,
|
|
@@ -2720,7 +3254,7 @@ function Card({
|
|
|
2720
3254
|
onClick,
|
|
2721
3255
|
...rest
|
|
2722
3256
|
}) {
|
|
2723
|
-
const classNames =
|
|
3257
|
+
const classNames = cn51(
|
|
2724
3258
|
Card_default.card,
|
|
2725
3259
|
Card_default[`--${variant}`],
|
|
2726
3260
|
Card_default[`--padding-${padding}`],
|
|
@@ -2729,7 +3263,7 @@ function Card({
|
|
|
2729
3263
|
className
|
|
2730
3264
|
);
|
|
2731
3265
|
const Component = as ?? (onClick ? "button" : "div");
|
|
2732
|
-
return /* @__PURE__ */
|
|
3266
|
+
return /* @__PURE__ */ jsx51(
|
|
2733
3267
|
Component,
|
|
2734
3268
|
{
|
|
2735
3269
|
...rest,
|
|
@@ -2745,17 +3279,20 @@ function Card({
|
|
|
2745
3279
|
import {
|
|
2746
3280
|
createContext as createContext2,
|
|
2747
3281
|
useMemo as useMemo4,
|
|
2748
|
-
useRef as
|
|
3282
|
+
useRef as useRef15
|
|
2749
3283
|
} from "react";
|
|
2750
3284
|
|
|
2751
3285
|
// src/components/layout/Grid/Grid.module.css
|
|
2752
|
-
var Grid_default = {"component":"
|
|
3286
|
+
var Grid_default = {"component":"bds2110Grid-component","grid":"bds2110Grid-grid","--main":"bds2110Grid---main","--page":"bds2110Grid---page","--funnel":"bds2110Grid---funnel","--custom":"bds2110Grid---custom","--centered":"bds2110Grid---centered","item":"bds2110Grid-item","w3":"bds2110Grid-w3","org":"bds2110Grid-org","ts":"bds2110Grid-ts","--masonry":"bds2110Grid---masonry"};
|
|
2753
3287
|
|
|
2754
3288
|
// src/components/layout/Grid/Grid.tsx
|
|
2755
|
-
import { cn as
|
|
3289
|
+
import { cn as cn52 } from "@boostdev/design-system-foundation";
|
|
3290
|
+
|
|
3291
|
+
// src/components/layout/Grid/useIsomorphicLayoutEffect.ts
|
|
3292
|
+
import { useEffect as useEffect12, useLayoutEffect } from "react";
|
|
3293
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect12;
|
|
2756
3294
|
|
|
2757
3295
|
// src/components/layout/Grid/masonry.ts
|
|
2758
|
-
import { useLayoutEffect } from "react";
|
|
2759
3296
|
var NAMED_SPAN_VAR = {
|
|
2760
3297
|
"three-quarters": "--bds-grid_columns-75",
|
|
2761
3298
|
"two-thirds": "--bds-grid_columns-66",
|
|
@@ -2785,6 +3322,7 @@ function supportsNativeMasonry() {
|
|
|
2785
3322
|
return CSS.supports("display", "grid-lanes") || CSS.supports("grid-template-rows", "masonry");
|
|
2786
3323
|
}
|
|
2787
3324
|
var ORIGINAL_COL_ATTR = "data-bds-masonry-original-column";
|
|
3325
|
+
var LAST_COL_ATTR = "data-bds-masonry-col";
|
|
2788
3326
|
var LAST_SPAN_ATTR = "data-bds-masonry-span";
|
|
2789
3327
|
var UNIT_ATTR = "data-bds-masonry-unit";
|
|
2790
3328
|
function applyMasonryLayout(container, rawChildren, options = {}) {
|
|
@@ -2808,16 +3346,23 @@ function applyMasonryLayout(container, rawChildren, options = {}) {
|
|
|
2808
3346
|
let col = 0;
|
|
2809
3347
|
for (const child of children) {
|
|
2810
3348
|
if (child.hasAttribute("data-column-span-auto")) {
|
|
2811
|
-
|
|
2812
|
-
|
|
3349
|
+
const currentInline = child.style.gridColumn;
|
|
3350
|
+
const lastWritten = child.getAttribute(LAST_COL_ATTR);
|
|
3351
|
+
if (!child.hasAttribute(ORIGINAL_COL_ATTR) || currentInline !== lastWritten) {
|
|
3352
|
+
child.setAttribute(ORIGINAL_COL_ATTR, currentInline);
|
|
2813
3353
|
}
|
|
2814
3354
|
const remaining = totalCols - col;
|
|
2815
3355
|
const span = Math.max(1, Math.min(preferredCols, remaining));
|
|
2816
3356
|
child.style.gridColumn = `span ${span}`;
|
|
3357
|
+
child.setAttribute(LAST_COL_ATTR, child.style.gridColumn);
|
|
2817
3358
|
col = (col + span) % totalCols;
|
|
2818
3359
|
} else {
|
|
2819
3360
|
const consumed = Math.min(totalCols, readExplicitSpan(child, totalCols));
|
|
2820
|
-
|
|
3361
|
+
if (consumed > totalCols - col) {
|
|
3362
|
+
col = consumed % totalCols;
|
|
3363
|
+
} else {
|
|
3364
|
+
col = (col + consumed) % totalCols;
|
|
3365
|
+
}
|
|
2821
3366
|
}
|
|
2822
3367
|
}
|
|
2823
3368
|
}
|
|
@@ -2901,10 +3446,11 @@ function restoreOriginalColumn(el) {
|
|
|
2901
3446
|
if (!el.hasAttribute(ORIGINAL_COL_ATTR)) return;
|
|
2902
3447
|
el.style.gridColumn = el.getAttribute(ORIGINAL_COL_ATTR) ?? "";
|
|
2903
3448
|
el.removeAttribute(ORIGINAL_COL_ATTR);
|
|
3449
|
+
el.removeAttribute(LAST_COL_ATTR);
|
|
2904
3450
|
}
|
|
2905
3451
|
function useMasonry(ref, enabled, options = {}) {
|
|
2906
3452
|
const { preferredColumnSpan, rowUnitPx } = options;
|
|
2907
|
-
|
|
3453
|
+
useIsomorphicLayoutEffect(() => {
|
|
2908
3454
|
const container = ref.current;
|
|
2909
3455
|
if (!container || !enabled) return;
|
|
2910
3456
|
if (supportsNativeMasonry()) return;
|
|
@@ -2976,7 +3522,7 @@ function useMasonry(ref, enabled, options = {}) {
|
|
|
2976
3522
|
}
|
|
2977
3523
|
|
|
2978
3524
|
// src/components/layout/Grid/Grid.tsx
|
|
2979
|
-
import { jsx as
|
|
3525
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2980
3526
|
var _GridContext;
|
|
2981
3527
|
function getGridContext() {
|
|
2982
3528
|
_GridContext ??= createContext2({ autoSpanMedia: false });
|
|
@@ -2996,12 +3542,12 @@ function Grid({
|
|
|
2996
3542
|
style,
|
|
2997
3543
|
...rest
|
|
2998
3544
|
}) {
|
|
2999
|
-
const ref =
|
|
3545
|
+
const ref = useRef15(null);
|
|
3000
3546
|
useMasonry(ref, isMasonry, {
|
|
3001
3547
|
preferredColumnSpan: masonryPreferredColumnSpan,
|
|
3002
3548
|
rowUnitPx: masonryRowUnitPx
|
|
3003
3549
|
});
|
|
3004
|
-
const classNames =
|
|
3550
|
+
const classNames = cn52(
|
|
3005
3551
|
Grid_default.grid,
|
|
3006
3552
|
Grid_default[`--${variant}`],
|
|
3007
3553
|
isCentered && Grid_default["--centered"],
|
|
@@ -3012,17 +3558,16 @@ function Grid({
|
|
|
3012
3558
|
const Component = as ?? "div";
|
|
3013
3559
|
const GridContext = getGridContext();
|
|
3014
3560
|
const ctx = useMemo4(() => ({ autoSpanMedia }), [autoSpanMedia]);
|
|
3015
|
-
return /* @__PURE__ */
|
|
3561
|
+
return /* @__PURE__ */ jsx52(Component, { ref, ...rest, className: classNames, style: composedStyle, children: /* @__PURE__ */ jsx52(GridContext.Provider, { value: ctx, children }) });
|
|
3016
3562
|
}
|
|
3017
3563
|
|
|
3018
3564
|
// src/components/layout/Grid/GridItem.tsx
|
|
3019
3565
|
import {
|
|
3020
3566
|
useContext as useContext2,
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
useState as useState13
|
|
3567
|
+
useRef as useRef16,
|
|
3568
|
+
useState as useState15
|
|
3024
3569
|
} from "react";
|
|
3025
|
-
import { cn as
|
|
3570
|
+
import { cn as cn53 } from "@boostdev/design-system-foundation";
|
|
3026
3571
|
|
|
3027
3572
|
// src/components/layout/Grid/autoSpan.ts
|
|
3028
3573
|
function aspectToColumnSpan(ratio) {
|
|
@@ -3054,7 +3599,7 @@ function mediaReadyEvent(media) {
|
|
|
3054
3599
|
}
|
|
3055
3600
|
|
|
3056
3601
|
// src/components/layout/Grid/GridItem.tsx
|
|
3057
|
-
import { jsx as
|
|
3602
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
3058
3603
|
var GridItemSpan = {
|
|
3059
3604
|
full: "full",
|
|
3060
3605
|
threeQuarters: "three-quarters",
|
|
@@ -3089,9 +3634,9 @@ function GridItem({
|
|
|
3089
3634
|
}) {
|
|
3090
3635
|
const { autoSpanMedia } = useContext2(getGridContext());
|
|
3091
3636
|
const effectiveSpan = columnSpan ?? (autoSpanMedia ? "auto" : "full");
|
|
3092
|
-
const ref =
|
|
3093
|
-
const [autoSpan, setAutoSpan] =
|
|
3094
|
-
|
|
3637
|
+
const ref = useRef16(null);
|
|
3638
|
+
const [autoSpan, setAutoSpan] = useState15("one-quarter");
|
|
3639
|
+
useIsomorphicLayoutEffect(() => {
|
|
3095
3640
|
if (effectiveSpan !== "auto") return;
|
|
3096
3641
|
const el = ref.current;
|
|
3097
3642
|
if (!el) return;
|
|
@@ -3136,13 +3681,13 @@ function GridItem({
|
|
|
3136
3681
|
};
|
|
3137
3682
|
const Component = as ?? "div";
|
|
3138
3683
|
const isColumnSpanAuto = columnSpan === void 0 && !hasExplicitRange;
|
|
3139
|
-
return /* @__PURE__ */
|
|
3684
|
+
return /* @__PURE__ */ jsx53(
|
|
3140
3685
|
Component,
|
|
3141
3686
|
{
|
|
3142
3687
|
ref,
|
|
3143
3688
|
...rest,
|
|
3144
3689
|
"data-column-span-auto": isColumnSpanAuto ? "" : void 0,
|
|
3145
|
-
className:
|
|
3690
|
+
className: cn53(Grid_default.item, className),
|
|
3146
3691
|
style: composedStyle,
|
|
3147
3692
|
children
|
|
3148
3693
|
}
|
|
@@ -3150,11 +3695,11 @@ function GridItem({
|
|
|
3150
3695
|
}
|
|
3151
3696
|
|
|
3152
3697
|
// src/components/layout/SectionHeader/SectionHeader.module.css
|
|
3153
|
-
var SectionHeader_default = {"component":"
|
|
3698
|
+
var SectionHeader_default = {"component":"bds2110SectionHeader-component","sectionHeader":"bds2110SectionHeader-sectionHeader","title":"bds2110SectionHeader-title","subtitle":"bds2110SectionHeader-subtitle","--start":"bds2110SectionHeader---start","--center":"bds2110SectionHeader---center","--end":"bds2110SectionHeader---end","--medium":"bds2110SectionHeader---medium","--xs":"bds2110SectionHeader---xs","--small":"bds2110SectionHeader---small","--large":"bds2110SectionHeader---large"};
|
|
3154
3699
|
|
|
3155
3700
|
// src/components/layout/SectionHeader/SectionHeader.tsx
|
|
3156
|
-
import { cn as
|
|
3157
|
-
import { jsx as
|
|
3701
|
+
import { cn as cn54 } from "@boostdev/design-system-foundation";
|
|
3702
|
+
import { jsx as jsx54, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3158
3703
|
function SectionHeader({
|
|
3159
3704
|
title,
|
|
3160
3705
|
subtitle,
|
|
@@ -3165,24 +3710,24 @@ function SectionHeader({
|
|
|
3165
3710
|
...rest
|
|
3166
3711
|
}) {
|
|
3167
3712
|
const Title = titleAs;
|
|
3168
|
-
return /* @__PURE__ */ jsxs37("div", { ...rest, className:
|
|
3169
|
-
/* @__PURE__ */
|
|
3170
|
-
subtitle && /* @__PURE__ */
|
|
3713
|
+
return /* @__PURE__ */ jsxs37("div", { ...rest, className: cn54(SectionHeader_default.sectionHeader, SectionHeader_default[`--${alignment}`], SectionHeader_default[`--${size}`], className), children: [
|
|
3714
|
+
/* @__PURE__ */ jsx54(Title, { className: SectionHeader_default.title, children: title }),
|
|
3715
|
+
subtitle && /* @__PURE__ */ jsx54("p", { className: SectionHeader_default.subtitle, children: subtitle })
|
|
3171
3716
|
] });
|
|
3172
3717
|
}
|
|
3173
3718
|
|
|
3174
3719
|
// src/components/layout/IconWrapper/IconWrapper.module.css
|
|
3175
|
-
var IconWrapper_default = {"component":"
|
|
3720
|
+
var IconWrapper_default = {"component":"bds2110IconWrapper-component","wrapper":"bds2110IconWrapper-wrapper"};
|
|
3176
3721
|
|
|
3177
3722
|
// src/components/layout/IconWrapper/IconWrapper.tsx
|
|
3178
|
-
import { cn as
|
|
3179
|
-
import { jsx as
|
|
3723
|
+
import { cn as cn55 } from "@boostdev/design-system-foundation";
|
|
3724
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
3180
3725
|
function IconWrapper({ children, className, ...rest }) {
|
|
3181
|
-
return /* @__PURE__ */
|
|
3726
|
+
return /* @__PURE__ */ jsx55("div", { ...rest, className: cn55(className, IconWrapper_default.wrapper), children });
|
|
3182
3727
|
}
|
|
3183
3728
|
|
|
3184
3729
|
// src/index.ts
|
|
3185
|
-
import { cn as
|
|
3730
|
+
import { cn as cn56 } from "@boostdev/design-system-foundation";
|
|
3186
3731
|
export {
|
|
3187
3732
|
Accordion,
|
|
3188
3733
|
Alert,
|
|
@@ -3193,6 +3738,7 @@ export {
|
|
|
3193
3738
|
ButtonContainer,
|
|
3194
3739
|
ButtonGroup,
|
|
3195
3740
|
Calendar,
|
|
3741
|
+
CalendarRange,
|
|
3196
3742
|
Card,
|
|
3197
3743
|
Carousel,
|
|
3198
3744
|
Checkbox,
|
|
@@ -3236,6 +3782,6 @@ export {
|
|
|
3236
3782
|
ToastProvider,
|
|
3237
3783
|
Tooltip,
|
|
3238
3784
|
Typography,
|
|
3239
|
-
|
|
3785
|
+
cn56 as cn,
|
|
3240
3786
|
useToast
|
|
3241
3787
|
};
|