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