@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
|
@@ -1,2172 +1,443 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BdsRadioGroup
|
|
3
|
+
} from "./chunk-JV5QT2OU.js";
|
|
4
|
+
import {
|
|
5
|
+
BdsSegmentedControl
|
|
6
|
+
} from "./chunk-NTQ4TCUT.js";
|
|
7
|
+
import {
|
|
8
|
+
BdsSelect
|
|
9
|
+
} from "./chunk-JH6LQKLK.js";
|
|
10
|
+
import {
|
|
11
|
+
BdsSlider
|
|
12
|
+
} from "./chunk-FEDABOR5.js";
|
|
1
13
|
import {
|
|
2
14
|
BdsSwitch
|
|
3
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3AY2YKCM.js";
|
|
4
16
|
import {
|
|
5
17
|
BdsTextarea
|
|
6
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-2OLVQUBU.js";
|
|
19
|
+
import {
|
|
20
|
+
BdsGrid
|
|
21
|
+
} from "./chunk-ITD2MV5K.js";
|
|
22
|
+
import {
|
|
23
|
+
BdsGridItem
|
|
24
|
+
} from "./chunk-W6H5ID2U.js";
|
|
7
25
|
import {
|
|
8
26
|
BdsCheckbox
|
|
9
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-KA3VPKMY.js";
|
|
28
|
+
import {
|
|
29
|
+
BdsCheckboxGroup
|
|
30
|
+
} from "./chunk-VANAKB6D.js";
|
|
10
31
|
import {
|
|
11
32
|
BdsCombobox
|
|
12
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-47AT5KZD.js";
|
|
34
|
+
import {
|
|
35
|
+
BdsFieldGroup
|
|
36
|
+
} from "./chunk-SEO2F5KJ.js";
|
|
13
37
|
import {
|
|
14
38
|
BdsFileInput
|
|
15
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-KZPRFY5P.js";
|
|
40
|
+
import {
|
|
41
|
+
BdsFormInput
|
|
42
|
+
} from "./chunk-CUKQ2L5B.js";
|
|
16
43
|
import {
|
|
17
44
|
BdsNumberInput
|
|
18
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-VED2DFJ6.js";
|
|
19
46
|
import {
|
|
20
47
|
BdsRadio
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import {
|
|
23
|
-
BdsSegmentedControl
|
|
24
|
-
} from "./chunk-2FGATTGT.js";
|
|
25
|
-
import {
|
|
26
|
-
BdsSelect
|
|
27
|
-
} from "./chunk-ARMKC4BQ.js";
|
|
48
|
+
} from "./chunk-3WAV6MDN.js";
|
|
28
49
|
import {
|
|
29
|
-
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import {
|
|
32
|
-
BdsDrawer
|
|
33
|
-
} from "./chunk-KUI55GFB.js";
|
|
50
|
+
BdsDropdownMenuItem
|
|
51
|
+
} from "./chunk-QZAIRJ75.js";
|
|
34
52
|
import {
|
|
35
53
|
BdsPopover
|
|
36
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-QEF2IRID.js";
|
|
37
55
|
import {
|
|
38
56
|
BdsSkipLink
|
|
39
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-66M6ETWD.js";
|
|
40
58
|
import {
|
|
41
59
|
BdsTab
|
|
42
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-RSZ3BWBK.js";
|
|
43
61
|
import {
|
|
44
62
|
BdsTabPanel
|
|
45
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-WIBAN7KP.js";
|
|
46
64
|
import {
|
|
47
65
|
BdsTabs
|
|
48
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-F3ZDNHZZ.js";
|
|
49
67
|
import {
|
|
50
68
|
BdsToastProvider
|
|
51
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-BTCMJQKB.js";
|
|
52
70
|
import {
|
|
53
71
|
BdsTooltip
|
|
54
|
-
} from "./chunk-
|
|
55
|
-
import {
|
|
56
|
-
BdsSeparator
|
|
57
|
-
} from "./chunk-VMMVWLXL.js";
|
|
58
|
-
import {
|
|
59
|
-
BdsSkeleton
|
|
60
|
-
} from "./chunk-2QA62WCQ.js";
|
|
72
|
+
} from "./chunk-M3ECULRH.js";
|
|
61
73
|
import {
|
|
62
74
|
BdsTypography
|
|
63
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-IPGHUCJT.js";
|
|
64
76
|
import {
|
|
65
77
|
BdsAccordion
|
|
66
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-PXPPKCLT.js";
|
|
67
79
|
import {
|
|
68
80
|
BdsAccordionItem
|
|
69
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-YFAXGRPR.js";
|
|
70
82
|
import {
|
|
71
83
|
BdsButton
|
|
72
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-XIZWAWMJ.js";
|
|
73
85
|
import {
|
|
74
86
|
BdsCollapsible
|
|
75
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-HGFCJXOQ.js";
|
|
76
88
|
import {
|
|
77
89
|
BdsDialog
|
|
78
|
-
} from "./chunk-
|
|
79
|
-
import {
|
|
80
|
-
BdsIconWrapper
|
|
81
|
-
} from "./chunk-A3RLT3AS.js";
|
|
90
|
+
} from "./chunk-U3YZE6R6.js";
|
|
82
91
|
import {
|
|
83
|
-
|
|
84
|
-
} from "./chunk-
|
|
92
|
+
BdsDrawer
|
|
93
|
+
} from "./chunk-JUPCZVVW.js";
|
|
85
94
|
import {
|
|
86
|
-
|
|
87
|
-
} from "./chunk-
|
|
95
|
+
BdsDropdownMenu
|
|
96
|
+
} from "./chunk-NIN3JO6Q.js";
|
|
88
97
|
import {
|
|
89
|
-
|
|
90
|
-
} from "./chunk-
|
|
98
|
+
BdsPagination
|
|
99
|
+
} from "./chunk-TMWXRHGF.js";
|
|
91
100
|
import {
|
|
92
101
|
BdsProgress
|
|
93
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-AP4RDUL2.js";
|
|
94
103
|
import {
|
|
95
104
|
BdsProgressCircle
|
|
96
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-7ZOJ7N4E.js";
|
|
97
106
|
import {
|
|
98
107
|
BdsRating
|
|
99
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-SYNLFKD3.js";
|
|
100
109
|
import {
|
|
101
110
|
BdsSectionHeader
|
|
102
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-RVF7W653.js";
|
|
103
112
|
import "./chunk-QPOKHLMQ.js";
|
|
104
|
-
import
|
|
113
|
+
import {
|
|
114
|
+
BdsSeparator
|
|
115
|
+
} from "./chunk-SFZ6Q4BP.js";
|
|
116
|
+
import {
|
|
117
|
+
BdsSkeleton
|
|
118
|
+
} from "./chunk-EF7IVYTY.js";
|
|
119
|
+
import {
|
|
120
|
+
BdsTable
|
|
121
|
+
} from "./chunk-JMCXAAFK.js";
|
|
122
|
+
import {
|
|
123
|
+
BdsCalendar,
|
|
124
|
+
buildMonthGrid,
|
|
125
|
+
calendarStyles,
|
|
126
|
+
getDayLabel,
|
|
127
|
+
getMonthLabel,
|
|
128
|
+
getWeekdayNames,
|
|
129
|
+
isDisabled,
|
|
130
|
+
isInRange,
|
|
131
|
+
isSameDay,
|
|
132
|
+
nextFocusDate,
|
|
133
|
+
parseISO,
|
|
134
|
+
sortRange,
|
|
135
|
+
toISO
|
|
136
|
+
} from "./chunk-UO7ROSHD.js";
|
|
137
|
+
import {
|
|
138
|
+
BdsCard
|
|
139
|
+
} from "./chunk-DV5T43ZC.js";
|
|
140
|
+
import {
|
|
141
|
+
BdsCarousel
|
|
142
|
+
} from "./chunk-OY74D4X6.js";
|
|
143
|
+
import {
|
|
144
|
+
BdsDescriptionList
|
|
145
|
+
} from "./chunk-NBN2ENWJ.js";
|
|
146
|
+
import {
|
|
147
|
+
BdsIconWrapper
|
|
148
|
+
} from "./chunk-XI7KRAH7.js";
|
|
149
|
+
import {
|
|
150
|
+
BdsLink
|
|
151
|
+
} from "./chunk-KJGRFDFI.js";
|
|
152
|
+
import {
|
|
153
|
+
BdsLoading
|
|
154
|
+
} from "./chunk-AIBOHNDU.js";
|
|
155
|
+
import {
|
|
156
|
+
BdsNotificationBanner
|
|
157
|
+
} from "./chunk-LDIPCTRN.js";
|
|
158
|
+
import "./chunk-P24JYC5V.js";
|
|
105
159
|
import {
|
|
106
160
|
BdsAlert
|
|
107
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-6G22I2CK.js";
|
|
108
162
|
import {
|
|
109
163
|
BdsAvatar
|
|
110
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-WFVKU4GX.js";
|
|
111
165
|
import {
|
|
112
166
|
BdsBadge
|
|
113
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-BPYKZVDK.js";
|
|
114
168
|
import {
|
|
115
169
|
BdsBreadcrumb
|
|
116
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-62NK3ZSC.js";
|
|
117
171
|
import {
|
|
118
|
-
|
|
119
|
-
} from "./chunk-
|
|
172
|
+
BdsButtonGroup
|
|
173
|
+
} from "./chunk-DIZDCL7Z.js";
|
|
120
174
|
import {
|
|
121
|
-
|
|
122
|
-
} from "./chunk-
|
|
175
|
+
BdsButtonContainer
|
|
176
|
+
} from "./chunk-4A2YYTYN.js";
|
|
123
177
|
import {
|
|
124
178
|
A,
|
|
125
179
|
T,
|
|
126
|
-
i
|
|
127
|
-
i2
|
|
180
|
+
i2 as i
|
|
128
181
|
} from "./chunk-LGEZYFUU.js";
|
|
129
182
|
|
|
130
|
-
// src/components/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"two-thirds": "--bds-grid_columns-66",
|
|
135
|
-
half: "--bds-grid_columns-50",
|
|
136
|
-
"one-third": "--bds-grid_columns-33",
|
|
137
|
-
"one-quarter": "--bds-grid_columns-25"
|
|
138
|
-
};
|
|
139
|
-
var NAMED_SPAN_FRACTION = {
|
|
140
|
-
"three-quarters": 0.75,
|
|
141
|
-
"two-thirds": 2 / 3,
|
|
142
|
-
half: 0.5,
|
|
143
|
-
"one-third": 1 / 3,
|
|
144
|
-
"one-quarter": 0.25
|
|
145
|
-
};
|
|
146
|
-
function resolvePreferredColumns(container, value, totalCols) {
|
|
147
|
-
if (value === "full") return totalCols;
|
|
148
|
-
if (typeof value === "number") return Math.max(1, Math.min(totalCols, value));
|
|
149
|
-
const varName = NAMED_SPAN_VAR[value];
|
|
150
|
-
const raw = window.getComputedStyle(container).getPropertyValue(varName).trim();
|
|
151
|
-
const n = parseInt(raw, 10);
|
|
152
|
-
if (Number.isFinite(n) && n > 0) return Math.min(totalCols, n);
|
|
153
|
-
return Math.max(1, Math.round(totalCols * NAMED_SPAN_FRACTION[value]));
|
|
154
|
-
}
|
|
155
|
-
var TARGET_MAX_IMPLICIT_ROWS = 5e3;
|
|
156
|
-
function supportsNativeMasonry() {
|
|
157
|
-
if (typeof CSS === "undefined" || typeof CSS.supports !== "function") return false;
|
|
158
|
-
return CSS.supports("display", "grid-lanes") || CSS.supports("grid-template-rows", "masonry");
|
|
159
|
-
}
|
|
160
|
-
var ORIGINAL_COL_ATTR = "data-bds-masonry-original-column";
|
|
161
|
-
var LAST_SPAN_ATTR = "data-bds-masonry-span";
|
|
162
|
-
var UNIT_ATTR = "data-bds-masonry-unit";
|
|
163
|
-
function applyMasonryLayout(container, rawChildren, options = {}) {
|
|
164
|
-
const cs = window.getComputedStyle(container);
|
|
165
|
-
const targetGap = parseFloat(cs.columnGap) || 0;
|
|
166
|
-
container.style.rowGap = "0px";
|
|
167
|
-
container.style.gridAutoFlow = "dense";
|
|
168
|
-
container.style.overflowAnchor = "none";
|
|
169
|
-
const children = rawChildren.filter(
|
|
170
|
-
(el) => el.nodeType === 1 && window.getComputedStyle(el).display !== "none"
|
|
171
|
-
);
|
|
172
|
-
for (const child of children) {
|
|
173
|
-
child.style.alignSelf = "start";
|
|
174
|
-
child.style.overflowAnchor = "none";
|
|
175
|
-
}
|
|
176
|
-
const preferred = options.preferredColumnSpan;
|
|
177
|
-
if (preferred !== void 0) {
|
|
178
|
-
const totalCols = countGridColumns(container);
|
|
179
|
-
const preferredCols = totalCols > 0 ? resolvePreferredColumns(container, preferred, totalCols) : 0;
|
|
180
|
-
if (totalCols > 0 && preferredCols > 0) {
|
|
181
|
-
let col = 0;
|
|
182
|
-
for (const child of children) {
|
|
183
|
-
if (child.hasAttribute("data-column-span-auto")) {
|
|
184
|
-
if (!child.hasAttribute(ORIGINAL_COL_ATTR)) {
|
|
185
|
-
child.setAttribute(ORIGINAL_COL_ATTR, child.style.gridColumn);
|
|
186
|
-
}
|
|
187
|
-
const remaining = totalCols - col;
|
|
188
|
-
const span = Math.max(1, Math.min(preferredCols, remaining));
|
|
189
|
-
child.style.gridColumn = `span ${span}`;
|
|
190
|
-
col = (col + span) % totalCols;
|
|
191
|
-
} else {
|
|
192
|
-
const consumed = Math.min(totalCols, readExplicitSpan(child, totalCols));
|
|
193
|
-
col = (col + consumed) % totalCols;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
} else {
|
|
198
|
-
for (const child of children) {
|
|
199
|
-
restoreOriginalColumn(child);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
const heights = children.map((child) => child.offsetHeight);
|
|
203
|
-
const cols = countGridColumns(container) || 1;
|
|
204
|
-
const projectedRows = children.reduce((sum, child, i3) => {
|
|
205
|
-
const rowSpan = Math.max(1, Math.ceil(heights[i3] + targetGap));
|
|
206
|
-
const colSpan = readExplicitSpan(child, cols);
|
|
207
|
-
return sum + rowSpan * colSpan;
|
|
208
|
-
}, 0) / cols;
|
|
209
|
-
const autoUnit = Math.max(
|
|
210
|
-
1,
|
|
211
|
-
Math.ceil(projectedRows / TARGET_MAX_IMPLICIT_ROWS)
|
|
212
|
-
);
|
|
213
|
-
const rowUnit = options.rowUnitPx !== void 0 && options.rowUnitPx > 0 ? Math.floor(options.rowUnitPx) : autoUnit;
|
|
214
|
-
container.style.gridAutoRows = `${rowUnit}px`;
|
|
215
|
-
const prevUnit = container.getAttribute(UNIT_ATTR);
|
|
216
|
-
if (prevUnit !== String(rowUnit)) {
|
|
217
|
-
for (const child of children) child.removeAttribute(LAST_SPAN_ATTR);
|
|
218
|
-
container.setAttribute(UNIT_ATTR, String(rowUnit));
|
|
219
|
-
}
|
|
220
|
-
const spans = heights.map(
|
|
221
|
-
(h) => Math.max(1, Math.ceil((h + targetGap) / rowUnit))
|
|
222
|
-
);
|
|
223
|
-
let changed = false;
|
|
224
|
-
for (let i3 = 0; i3 < children.length; i3++) {
|
|
225
|
-
const prev = children[i3].getAttribute(LAST_SPAN_ATTR);
|
|
226
|
-
if (prev !== String(spans[i3])) {
|
|
227
|
-
changed = true;
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
if (!changed) return;
|
|
232
|
-
for (let i3 = 0; i3 < children.length; i3++) {
|
|
233
|
-
children[i3].style.gridRowEnd = `span ${spans[i3]}`;
|
|
234
|
-
children[i3].setAttribute(LAST_SPAN_ATTR, String(spans[i3]));
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
function countGridColumns(container) {
|
|
238
|
-
const value = window.getComputedStyle(container).gridTemplateColumns.trim();
|
|
239
|
-
if (!value || value === "none") return 0;
|
|
240
|
-
return value.split(/\s+/).length;
|
|
241
|
-
}
|
|
242
|
-
function readExplicitSpan(el, totalCols) {
|
|
243
|
-
const inline = el.style.gridColumn || el.style.gridColumnEnd;
|
|
244
|
-
const fromInline = parseSpan(inline, totalCols);
|
|
245
|
-
if (fromInline !== null) return fromInline;
|
|
246
|
-
const computed = window.getComputedStyle(el).gridColumn;
|
|
247
|
-
return parseSpan(computed, totalCols) ?? 1;
|
|
248
|
-
}
|
|
249
|
-
function parseSpan(value, totalCols) {
|
|
250
|
-
if (!value) return null;
|
|
251
|
-
const match = value.match(/^\s*span\s+(\d+)/);
|
|
252
|
-
if (match) return Math.max(1, Math.min(totalCols, parseInt(match[1], 10)));
|
|
253
|
-
if (/\/\s*-1\b/.test(value)) return totalCols;
|
|
254
|
-
return null;
|
|
255
|
-
}
|
|
256
|
-
function clearMasonryLayout(container, rawChildren) {
|
|
257
|
-
container.style.gridAutoRows = "";
|
|
258
|
-
container.style.gridAutoFlow = "";
|
|
259
|
-
container.style.rowGap = "";
|
|
260
|
-
container.style.overflowAnchor = "";
|
|
261
|
-
container.removeAttribute(UNIT_ATTR);
|
|
262
|
-
for (const child of rawChildren) {
|
|
263
|
-
if (child.nodeType !== 1) continue;
|
|
264
|
-
child.style.gridRow = "";
|
|
265
|
-
child.style.gridRowStart = "";
|
|
266
|
-
child.style.gridRowEnd = "";
|
|
267
|
-
child.style.alignSelf = "";
|
|
268
|
-
child.style.overflowAnchor = "";
|
|
269
|
-
child.removeAttribute(LAST_SPAN_ATTR);
|
|
270
|
-
restoreOriginalColumn(child);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
function restoreOriginalColumn(el) {
|
|
274
|
-
if (!el.hasAttribute(ORIGINAL_COL_ATTR)) return;
|
|
275
|
-
el.style.gridColumn = el.getAttribute(ORIGINAL_COL_ATTR) ?? "";
|
|
276
|
-
el.removeAttribute(ORIGINAL_COL_ATTR);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// src/web-components/layout/bds-grid.ts
|
|
280
|
-
var BdsGrid = class extends i2 {
|
|
281
|
-
static styles = i`
|
|
282
|
-
:host {
|
|
283
|
-
display: block;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.grid {
|
|
287
|
-
display: grid;
|
|
288
|
-
gap: var(--grid_gap, var(--bds-grid_gap));
|
|
289
|
-
box-sizing: border-box;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.grid.--main {
|
|
293
|
-
grid-template-columns: var(--bds-grid_template-columns);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.grid.--page {
|
|
297
|
-
grid-template-columns: 1fr;
|
|
298
|
-
grid-column: 1 / -1;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.grid.--funnel {
|
|
302
|
-
grid-template-columns: var(--bds-grid_template-columns);
|
|
303
|
-
max-inline-size: var(--bds-container_max-width--narrow);
|
|
304
|
-
margin-inline: auto;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.grid.--custom {
|
|
308
|
-
grid-template-columns: repeat(var(--grid_columns, 4), minmax(0, 1fr));
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.grid.--centered {
|
|
312
|
-
margin-inline: auto;
|
|
313
|
-
max-inline-size: var(--bds-container_max-width);
|
|
314
|
-
padding-inline: var(--bds-container_spacing-inline);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
@supports (grid-template-rows: masonry) {
|
|
318
|
-
.grid.--masonry {
|
|
319
|
-
grid-template-rows: masonry;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
@supports (display: grid-lanes) {
|
|
324
|
-
.grid.--masonry {
|
|
325
|
-
display: grid-lanes;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
`;
|
|
183
|
+
// src/web-components/ui/bds-calendar-range.ts
|
|
184
|
+
var BdsCalendarRange = class extends i {
|
|
185
|
+
static formAssociated = true;
|
|
186
|
+
static styles = calendarStyles;
|
|
329
187
|
static properties = {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
188
|
+
name: { type: String, reflect: true },
|
|
189
|
+
value: { type: String, reflect: true },
|
|
190
|
+
min: { type: String },
|
|
191
|
+
max: { type: String },
|
|
192
|
+
disabled: { type: Boolean, reflect: true },
|
|
193
|
+
months: { type: Number, reflect: true },
|
|
194
|
+
pageBy: { type: String, attribute: "page-by" },
|
|
195
|
+
firstDayOfWeek: { type: Number, attribute: "first-day-of-week" },
|
|
196
|
+
locale: { type: String },
|
|
197
|
+
previousLabel: { type: String, attribute: "previous-label" },
|
|
198
|
+
nextLabel: { type: String, attribute: "next-label" },
|
|
199
|
+
isDateDisallowed: { attribute: false },
|
|
200
|
+
formatWeekday: { attribute: false },
|
|
201
|
+
formatMonth: { attribute: false },
|
|
202
|
+
formatDay: { attribute: false }
|
|
340
203
|
};
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
204
|
+
_internals;
|
|
205
|
+
_viewYear;
|
|
206
|
+
_viewMonth;
|
|
207
|
+
_focusedIso = null;
|
|
208
|
+
_anchorIso = null;
|
|
209
|
+
_hoverIso = null;
|
|
344
210
|
constructor() {
|
|
345
211
|
super();
|
|
346
|
-
this.
|
|
347
|
-
this.
|
|
348
|
-
this.
|
|
349
|
-
this.
|
|
350
|
-
this.
|
|
351
|
-
this.
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
this.
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
} else {
|
|
362
|
-
this._teardownMasonry();
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
_gridEl() {
|
|
366
|
-
return this.renderRoot.querySelector(".grid");
|
|
367
|
-
}
|
|
368
|
-
_items() {
|
|
369
|
-
return Array.from(this.children).filter((el) => el.nodeType === 1);
|
|
370
|
-
}
|
|
371
|
-
_setupMasonry() {
|
|
372
|
-
if (this._ro || this._mo) return;
|
|
373
|
-
const container = this._gridEl();
|
|
374
|
-
if (!container) return;
|
|
375
|
-
if (typeof ResizeObserver !== "undefined") {
|
|
376
|
-
this._ro = new ResizeObserver(() => this._scheduleMasonry());
|
|
377
|
-
for (const child of this._items()) this._ro.observe(child);
|
|
378
|
-
}
|
|
379
|
-
if (typeof MutationObserver !== "undefined") {
|
|
380
|
-
this._mo = new MutationObserver(() => {
|
|
381
|
-
if (this._ro) for (const child of this._items()) this._ro.observe(child);
|
|
382
|
-
this._scheduleMasonry();
|
|
383
|
-
});
|
|
384
|
-
this._mo.observe(this, { childList: true });
|
|
385
|
-
}
|
|
212
|
+
this._internals = this.attachInternals();
|
|
213
|
+
this.name = "";
|
|
214
|
+
this.value = "";
|
|
215
|
+
this.min = "";
|
|
216
|
+
this.max = "";
|
|
217
|
+
this.disabled = false;
|
|
218
|
+
this.months = 1;
|
|
219
|
+
this.pageBy = "months";
|
|
220
|
+
this.firstDayOfWeek = 1;
|
|
221
|
+
this.locale = "";
|
|
222
|
+
this.previousLabel = "Previous month";
|
|
223
|
+
this.nextLabel = "Next month";
|
|
224
|
+
const now = /* @__PURE__ */ new Date();
|
|
225
|
+
this._viewYear = now.getFullYear();
|
|
226
|
+
this._viewMonth = now.getMonth();
|
|
386
227
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
preferredColumnSpan: this._resolvePreferredColumnSpan()
|
|
394
|
-
});
|
|
228
|
+
willUpdate(changed) {
|
|
229
|
+
if (changed.has("value")) {
|
|
230
|
+
const committed = this._committed();
|
|
231
|
+
if (committed && !this._monthVisible(committed[0])) {
|
|
232
|
+
this._viewYear = committed[0].getFullYear();
|
|
233
|
+
this._viewMonth = committed[0].getMonth();
|
|
395
234
|
}
|
|
396
|
-
|
|
397
|
-
}
|
|
398
|
-
_resolvePreferredColumnSpan() {
|
|
399
|
-
const raw = this.masonryPreferredColumnSpan;
|
|
400
|
-
if (raw === void 0 || raw === null || raw === "") return void 0;
|
|
401
|
-
const n = Number(raw);
|
|
402
|
-
if (Number.isFinite(n) && String(n) === raw) return n;
|
|
403
|
-
return raw;
|
|
404
|
-
}
|
|
405
|
-
_teardownMasonry() {
|
|
406
|
-
cancelAnimationFrame(this._frame);
|
|
407
|
-
this._ro?.disconnect();
|
|
408
|
-
this._mo?.disconnect();
|
|
409
|
-
this._ro = void 0;
|
|
410
|
-
this._mo = void 0;
|
|
411
|
-
const container = this._gridEl();
|
|
412
|
-
if (container) clearMasonryLayout(container, this._items());
|
|
413
|
-
}
|
|
414
|
-
render() {
|
|
415
|
-
const classes = [
|
|
416
|
-
"grid",
|
|
417
|
-
`--${this.variant}`,
|
|
418
|
-
this.isCentered ? "--centered" : "",
|
|
419
|
-
this.isMasonry ? "--masonry" : ""
|
|
420
|
-
].filter(Boolean).join(" ");
|
|
421
|
-
const styleAttr = this.variant === "custom" && this.columns !== void 0 ? `--grid_columns: ${this.columns}` : "";
|
|
422
|
-
return T`<div class=${classes} style=${styleAttr}><slot></slot></div>`;
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
customElements.define("bds-grid", BdsGrid);
|
|
426
|
-
|
|
427
|
-
// src/components/layout/Grid/autoSpan.ts
|
|
428
|
-
function aspectToColumnSpan(ratio) {
|
|
429
|
-
if (!Number.isFinite(ratio) || ratio <= 0) return "one-quarter";
|
|
430
|
-
if (ratio > 3.5) return "full";
|
|
431
|
-
if (ratio > 2.2) return "three-quarters";
|
|
432
|
-
if (ratio > 1.5) return "half";
|
|
433
|
-
return "one-quarter";
|
|
434
|
-
}
|
|
435
|
-
function findMediaChild(root) {
|
|
436
|
-
return root.querySelector("img, video");
|
|
437
|
-
}
|
|
438
|
-
function readMediaAspect(media) {
|
|
439
|
-
if (media instanceof HTMLImageElement) {
|
|
440
|
-
if (media.naturalWidth > 0 && media.naturalHeight > 0) {
|
|
441
|
-
return media.naturalWidth / media.naturalHeight;
|
|
235
|
+
this._internals.setFormValue?.(this.value);
|
|
442
236
|
}
|
|
443
|
-
return null;
|
|
444
237
|
}
|
|
445
|
-
|
|
446
|
-
|
|
238
|
+
formResetCallback() {
|
|
239
|
+
this.value = "";
|
|
240
|
+
this._internals.setFormValue?.("");
|
|
447
241
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
function mediaReadyEvent(media) {
|
|
451
|
-
if (media instanceof HTMLImageElement) return media.complete ? null : "load";
|
|
452
|
-
if (media.readyState < 1) return "loadedmetadata";
|
|
453
|
-
return null;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
// src/web-components/layout/bds-grid-item.ts
|
|
457
|
-
var SPAN_VAR = {
|
|
458
|
-
full: "var(--bds-grid_span-100)",
|
|
459
|
-
"three-quarters": "span var(--bds-grid_columns-75)",
|
|
460
|
-
"two-thirds": "span var(--bds-grid_columns-66)",
|
|
461
|
-
half: "span var(--bds-grid_columns-50)",
|
|
462
|
-
"one-third": "span var(--bds-grid_columns-33)",
|
|
463
|
-
"one-quarter": "span var(--bds-grid_columns-25)"
|
|
464
|
-
};
|
|
465
|
-
function resolveSpan(value) {
|
|
466
|
-
if (value === void 0 || value === null) return SPAN_VAR.full;
|
|
467
|
-
if (typeof value === "number") return `span ${value}`;
|
|
468
|
-
if (!(value in SPAN_VAR)) {
|
|
469
|
-
const n = Number(value);
|
|
470
|
-
if (Number.isFinite(n)) return `span ${n}`;
|
|
471
|
-
return SPAN_VAR.full;
|
|
242
|
+
formDisabledCallback(disabled) {
|
|
243
|
+
this.disabled = disabled;
|
|
472
244
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
var BdsGridItem = class extends i2 {
|
|
476
|
-
static styles = i`
|
|
477
|
-
:host {
|
|
478
|
-
display: block;
|
|
479
|
-
min-inline-size: 0;
|
|
480
|
-
}
|
|
481
|
-
`;
|
|
482
|
-
static properties = {
|
|
483
|
-
columnSpan: { attribute: "column-span" },
|
|
484
|
-
rowSpan: { attribute: "row-span", type: Number },
|
|
485
|
-
startColumn: { attribute: "start-column", type: Number },
|
|
486
|
-
endColumn: { attribute: "end-column", type: Number }
|
|
487
|
-
};
|
|
488
|
-
_autoSpan = "one-quarter";
|
|
489
|
-
_mediaCleanup;
|
|
490
|
-
_slotObserver;
|
|
491
|
-
constructor() {
|
|
492
|
-
super();
|
|
493
|
-
this.columnSpan = void 0;
|
|
494
|
-
this.rowSpan = void 0;
|
|
495
|
-
this.startColumn = void 0;
|
|
496
|
-
this.endColumn = void 0;
|
|
245
|
+
get _localeOrUndefined() {
|
|
246
|
+
return this.locale || void 0;
|
|
497
247
|
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
if (typeof MutationObserver !== "undefined") {
|
|
501
|
-
this._slotObserver = new MutationObserver(() => this._resolveAutoSpan());
|
|
502
|
-
this._slotObserver.observe(this, { childList: true, subtree: true });
|
|
503
|
-
}
|
|
248
|
+
get _count() {
|
|
249
|
+
return Math.max(1, this.months || 1);
|
|
504
250
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
251
|
+
_committed() {
|
|
252
|
+
const [s, e] = (this.value || "").split("/");
|
|
253
|
+
const sd = parseISO(s ?? "");
|
|
254
|
+
const ed = parseISO(e ?? "");
|
|
255
|
+
return sd && ed ? sortRange(sd, ed) : null;
|
|
510
256
|
}
|
|
511
|
-
|
|
512
|
-
if (this.
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
257
|
+
_paint() {
|
|
258
|
+
if (this._anchorIso) {
|
|
259
|
+
const a = parseISO(this._anchorIso);
|
|
260
|
+
const pe = parseISO(this._hoverIso ?? this._focusedIso ?? this._anchorIso) ?? a;
|
|
261
|
+
return sortRange(a, pe);
|
|
262
|
+
}
|
|
263
|
+
return this._committed();
|
|
516
264
|
}
|
|
517
|
-
|
|
518
|
-
this.
|
|
519
|
-
|
|
265
|
+
_monthVisible(date) {
|
|
266
|
+
const start = this._viewYear * 12 + this._viewMonth;
|
|
267
|
+
const idx = date.getFullYear() * 12 + date.getMonth();
|
|
268
|
+
return idx >= start && idx < start + this._count;
|
|
520
269
|
}
|
|
521
|
-
|
|
522
|
-
this.
|
|
523
|
-
|
|
524
|
-
const media = findMediaChild(this);
|
|
525
|
-
if (!media) {
|
|
526
|
-
this._setAutoSpan("one-quarter");
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
const aspect = readMediaAspect(media);
|
|
530
|
-
if (aspect !== null) {
|
|
531
|
-
this._setAutoSpan(aspectToColumnSpan(aspect));
|
|
532
|
-
return;
|
|
533
|
-
}
|
|
534
|
-
const event = mediaReadyEvent(media);
|
|
535
|
-
if (!event) {
|
|
536
|
-
this._setAutoSpan("one-quarter");
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
const handler = () => {
|
|
540
|
-
const a = readMediaAspect(media);
|
|
541
|
-
if (a !== null) this._setAutoSpan(aspectToColumnSpan(a));
|
|
542
|
-
};
|
|
543
|
-
media.addEventListener(event, handler, { once: true });
|
|
544
|
-
this._mediaCleanup = () => media.removeEventListener(event, handler);
|
|
270
|
+
_setView(d) {
|
|
271
|
+
this._viewYear = d.getFullYear();
|
|
272
|
+
this._viewMonth = d.getMonth();
|
|
545
273
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
this.
|
|
274
|
+
_page(dir) {
|
|
275
|
+
this._focusedIso = null;
|
|
276
|
+
const step = this.pageBy === "single" ? 1 : this._count;
|
|
277
|
+
this._setView(new Date(this._viewYear, this._viewMonth + dir * step, 1));
|
|
549
278
|
this.requestUpdate();
|
|
550
279
|
}
|
|
551
|
-
|
|
552
|
-
const
|
|
553
|
-
if (
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
const isColumnSpanAuto = (this.columnSpan === void 0 || this.columnSpan === null) && !hasExplicitRange;
|
|
560
|
-
if (isColumnSpanAuto) this.setAttribute("data-column-span-auto", "");
|
|
561
|
-
else this.removeAttribute("data-column-span-auto");
|
|
562
|
-
}
|
|
563
|
-
render() {
|
|
564
|
-
return T`<slot></slot>`;
|
|
280
|
+
_isDisabledDate(iso) {
|
|
281
|
+
const date = parseISO(iso);
|
|
282
|
+
if (!date) return false;
|
|
283
|
+
return isDisabled(date, {
|
|
284
|
+
min: parseISO(this.min) ?? void 0,
|
|
285
|
+
max: parseISO(this.max) ?? void 0,
|
|
286
|
+
isDateDisallowed: this.isDateDisallowed
|
|
287
|
+
});
|
|
565
288
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
flex-direction: column;
|
|
585
|
-
align-items: stretch;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
/* Collapse border radius between adjacent buttons */
|
|
589
|
-
::slotted(*:not(:first-child)) {
|
|
590
|
-
--button_radius-start: 0;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
::slotted(*:not(:last-child)) {
|
|
594
|
-
--button_radius-end: 0;
|
|
289
|
+
_selectDate(iso) {
|
|
290
|
+
if (this.disabled || this._isDisabledDate(iso)) return;
|
|
291
|
+
const date = parseISO(iso);
|
|
292
|
+
if (!date) return;
|
|
293
|
+
if (!this._anchorIso) {
|
|
294
|
+
this._anchorIso = iso;
|
|
295
|
+
this._hoverIso = null;
|
|
296
|
+
this.dispatchEvent(new CustomEvent("bds-range-start", { detail: { start: iso }, bubbles: true, composed: true }));
|
|
297
|
+
this.requestUpdate();
|
|
298
|
+
} else {
|
|
299
|
+
const [s, e] = sortRange(parseISO(this._anchorIso), date);
|
|
300
|
+
const startIso = toISO(s);
|
|
301
|
+
const endIso = toISO(e);
|
|
302
|
+
this.value = `${startIso}/${endIso}`;
|
|
303
|
+
this._internals.setFormValue?.(this.value);
|
|
304
|
+
this.dispatchEvent(new CustomEvent("bds-range-select", { detail: { start: startIso, end: endIso }, bubbles: true, composed: true }));
|
|
305
|
+
this._anchorIso = null;
|
|
306
|
+
this._hoverIso = null;
|
|
595
307
|
}
|
|
596
|
-
`;
|
|
597
|
-
static properties = {
|
|
598
|
-
orientation: { type: String, reflect: true },
|
|
599
|
-
"aria-label": { type: String }
|
|
600
|
-
};
|
|
601
|
-
constructor() {
|
|
602
|
-
super();
|
|
603
|
-
this.orientation = "horizontal";
|
|
604
308
|
}
|
|
605
|
-
|
|
606
|
-
return
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
};
|
|
613
|
-
customElements.define("bds-button-group", BdsButtonGroup);
|
|
614
|
-
|
|
615
|
-
// src/web-components/ui/bds-table.ts
|
|
616
|
-
var BdsTable = class extends i2 {
|
|
617
|
-
static styles = i`
|
|
618
|
-
:host {
|
|
619
|
-
display: block;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
.wrapper {
|
|
623
|
-
overflow-inline: auto;
|
|
624
|
-
-webkit-overflow-scrolling: touch;
|
|
625
|
-
border: var(--table_border, none);
|
|
626
|
-
border-radius: var(--table_radius, var(--bds-border_radius--s));
|
|
627
|
-
--bdc_color: var(--bds-color_bg--subtle);
|
|
628
|
-
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
::slotted(table) {
|
|
632
|
-
inline-size: 100%;
|
|
633
|
-
border-collapse: collapse;
|
|
634
|
-
font-size: var(--bds-font_size--body);
|
|
635
|
-
font-family: var(--bds-font_family--body);
|
|
636
|
-
color: var(--bds-color_on-bg);
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
::slotted(thead) {
|
|
640
|
-
background-color: var(--bds-color_bg--subtle);
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
::slotted(th) {
|
|
644
|
-
padding: var(--bds-space_xs) var(--bds-space_s);
|
|
645
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
646
|
-
font-size: var(--bds-font_size--body--s);
|
|
647
|
-
text-align: start;
|
|
648
|
-
color: var(--bds-color_on-bg--subtle);
|
|
649
|
-
border-block-end: 1px solid var(--bds-color_bg--subtle);
|
|
650
|
-
white-space: nowrap;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
::slotted(td) {
|
|
654
|
-
padding: var(--bds-space_xs) var(--bds-space_s);
|
|
655
|
-
border-block-end: 1px solid var(--bds-color_bg--subtle);
|
|
656
|
-
vertical-align: middle;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
::slotted(tr:last-child td) {
|
|
660
|
-
border-block-end: none;
|
|
309
|
+
_handleKeydown = (e) => {
|
|
310
|
+
if (this.disabled) return;
|
|
311
|
+
if (e.key === "Escape") {
|
|
312
|
+
this._anchorIso = null;
|
|
313
|
+
this._hoverIso = null;
|
|
314
|
+
this.requestUpdate();
|
|
315
|
+
return;
|
|
661
316
|
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
317
|
+
const focused = this.shadowRoot?.activeElement;
|
|
318
|
+
if (!focused?.dataset.date) return;
|
|
319
|
+
const current = parseISO(focused.dataset.date);
|
|
320
|
+
if (!current) return;
|
|
321
|
+
const next = nextFocusDate(current, e.key, { shiftKey: e.shiftKey, firstDayOfWeek: this.firstDayOfWeek });
|
|
322
|
+
if (!next) return;
|
|
323
|
+
e.preventDefault();
|
|
324
|
+
const iso = toISO(next);
|
|
325
|
+
this._focusedIso = iso;
|
|
326
|
+
if (!this._monthVisible(next)) this._setView(next);
|
|
327
|
+
this.requestUpdate();
|
|
328
|
+
this.updateComplete.then(() => {
|
|
329
|
+
this.shadowRoot?.querySelector(`.day:not(.--outside)[data-date="${iso}"]`)?.focus();
|
|
330
|
+
});
|
|
665
331
|
};
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
this.
|
|
332
|
+
_onDayEnter(iso) {
|
|
333
|
+
if (!this._anchorIso) return;
|
|
334
|
+
this._hoverIso = iso;
|
|
335
|
+
this.requestUpdate();
|
|
669
336
|
}
|
|
670
|
-
|
|
337
|
+
_weekdayNames() {
|
|
338
|
+
if (this.formatWeekday) {
|
|
339
|
+
return Array.from({ length: 7 }, (_, i2) => this.formatWeekday(new Date(2023, 0, 1 + (this.firstDayOfWeek + i2) % 7)));
|
|
340
|
+
}
|
|
341
|
+
return getWeekdayNames(this._localeOrUndefined, this.firstDayOfWeek);
|
|
342
|
+
}
|
|
343
|
+
_monthLabel(year, month) {
|
|
344
|
+
return this.formatMonth ? this.formatMonth(new Date(year, month, 1)) : getMonthLabel(year, month, this._localeOrUndefined);
|
|
345
|
+
}
|
|
346
|
+
_dayLabel(date) {
|
|
347
|
+
return this.formatDay ? this.formatDay(date) : getDayLabel(date, this._localeOrUndefined);
|
|
348
|
+
}
|
|
349
|
+
_tabbableIso(paint) {
|
|
350
|
+
const today = /* @__PURE__ */ new Date();
|
|
351
|
+
if (this._focusedIso) return this._focusedIso;
|
|
352
|
+
if (this._anchorIso && this._monthVisible(parseISO(this._anchorIso))) return this._anchorIso;
|
|
353
|
+
if (paint && this._monthVisible(paint[0])) return toISO(paint[0]);
|
|
354
|
+
if (this._monthVisible(today)) return toISO(today);
|
|
355
|
+
return toISO(new Date(this._viewYear, this._viewMonth, 1));
|
|
356
|
+
}
|
|
357
|
+
_renderMonth(index, weekdays, paint, tabbableIso) {
|
|
358
|
+
const first = new Date(this._viewYear, this._viewMonth + index, 1);
|
|
359
|
+
const year = first.getFullYear();
|
|
360
|
+
const month = first.getMonth();
|
|
361
|
+
const todayIso = toISO(/* @__PURE__ */ new Date());
|
|
362
|
+
const cells = buildMonthGrid(year, month, this.firstDayOfWeek);
|
|
363
|
+
const rows = [];
|
|
364
|
+
for (let i2 = 0; i2 < cells.length; i2 += 7) rows.push(cells.slice(i2, i2 + 7));
|
|
365
|
+
const label = this._monthLabel(year, month);
|
|
671
366
|
return T`
|
|
672
|
-
<div
|
|
673
|
-
class="
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
return range;
|
|
695
|
-
}
|
|
696
|
-
var BdsPagination = class extends i2 {
|
|
697
|
-
static styles = i`
|
|
698
|
-
:host {
|
|
699
|
-
display: block;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
.pagination {
|
|
703
|
-
display: flex;
|
|
704
|
-
align-items: center;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
.list {
|
|
708
|
-
display: flex;
|
|
709
|
-
align-items: center;
|
|
710
|
-
gap: var(--bds-space_xxs);
|
|
711
|
-
list-style: none;
|
|
712
|
-
margin: 0;
|
|
713
|
-
padding: 0;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
.button {
|
|
717
|
-
display: inline-flex;
|
|
718
|
-
align-items: center;
|
|
719
|
-
justify-content: center;
|
|
720
|
-
min-inline-size: 2rem;
|
|
721
|
-
block-size: 2rem;
|
|
722
|
-
padding-inline: var(--bds-space_xs);
|
|
723
|
-
font-size: var(--bds-font_size--body--s);
|
|
724
|
-
font-family: var(--bds-font_family--body);
|
|
725
|
-
border: none;
|
|
726
|
-
background: none;
|
|
727
|
-
border-radius: var(--bds-border_radius--xs);
|
|
728
|
-
cursor: pointer;
|
|
729
|
-
color: var(--bds-color_on-bg);
|
|
730
|
-
transition: var(--bds-animation_transition);
|
|
731
|
-
--bdc_color: var(--pagination_border-color, transparent);
|
|
732
|
-
--bdc-outline_radius: var(--bds-border_radius--xs);
|
|
733
|
-
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--bdc-outline_shadow);
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
.button:focus-visible {
|
|
737
|
-
outline: var(--bds-outline_default);
|
|
738
|
-
outline-offset: var(--bds-outline_offset);
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
@media (hover: hover) and (pointer: fine) {
|
|
742
|
-
.button:not(:disabled):not(.--active):hover {
|
|
743
|
-
background-color: var(--bds-color_bg--subtle);
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
.button.--active {
|
|
748
|
-
background-color: var(--bds-color_interactive);
|
|
749
|
-
color: var(--bds-color_on-interactive);
|
|
750
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
.button.--nav {
|
|
754
|
-
color: var(--bds-color_on-bg--subtle);
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
.button:disabled {
|
|
758
|
-
opacity: 0.4;
|
|
759
|
-
cursor: not-allowed;
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
.ellipsis {
|
|
763
|
-
display: inline-flex;
|
|
764
|
-
align-items: center;
|
|
765
|
-
justify-content: center;
|
|
766
|
-
min-inline-size: 2rem;
|
|
767
|
-
color: var(--bds-color_on-bg--subtle);
|
|
768
|
-
font-size: var(--bds-font_size--body--s);
|
|
769
|
-
user-select: none;
|
|
770
|
-
}
|
|
367
|
+
<div class="month">
|
|
368
|
+
<div class="header">
|
|
369
|
+
<span class="nav-slot">
|
|
370
|
+
${index === 0 ? T`
|
|
371
|
+
<button class="nav-btn" type="button" aria-label=${this.previousLabel} ?disabled=${this.disabled} @click=${() => this._page(-1)}>
|
|
372
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
373
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
|
|
374
|
+
</svg>
|
|
375
|
+
</button>` : null}
|
|
376
|
+
</span>
|
|
377
|
+
<span class="month-label" aria-live="polite">${label}</span>
|
|
378
|
+
<span class="nav-slot">
|
|
379
|
+
${index === this._count - 1 ? T`
|
|
380
|
+
<button class="nav-btn" type="button" aria-label=${this.nextLabel} ?disabled=${this.disabled} @click=${() => this._page(1)}>
|
|
381
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
382
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
|
|
383
|
+
</svg>
|
|
384
|
+
</button>` : null}
|
|
385
|
+
</span>
|
|
386
|
+
</div>
|
|
771
387
|
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
}
|
|
795
|
-
render() {
|
|
796
|
-
const pages = getPageRange(this.currentPage, this.totalPages);
|
|
797
|
-
return T`
|
|
798
|
-
<nav class="pagination" aria-label="Pagination">
|
|
799
|
-
<ul class="list">
|
|
800
|
-
<li>
|
|
801
|
-
<button
|
|
802
|
-
type="button"
|
|
803
|
-
class="button --nav"
|
|
804
|
-
?disabled=${this.currentPage <= 1}
|
|
805
|
-
aria-label="Previous page"
|
|
806
|
-
@click=${() => this._navigate(this.currentPage - 1)}
|
|
807
|
-
>
|
|
808
|
-
<svg class="nav-icon" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
809
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
|
|
810
|
-
</svg>
|
|
811
|
-
</button>
|
|
812
|
-
</li>
|
|
813
|
-
${pages.map(
|
|
814
|
-
(page) => page === "..." ? T`<li><span class="ellipsis" aria-hidden="true">…</span></li>` : T`
|
|
815
|
-
<li>
|
|
388
|
+
<div class="grid" role="grid" aria-label=${label}>
|
|
389
|
+
<div class="row" role="row">
|
|
390
|
+
${weekdays.map((d) => T`<div class="weekday" role="columnheader" aria-label=${d}>${d}</div>`)}
|
|
391
|
+
</div>
|
|
392
|
+
${rows.map((week) => T`
|
|
393
|
+
<div class="row" role="row">
|
|
394
|
+
${week.map(({ iso, date, day, outside }) => {
|
|
395
|
+
const isStart = !outside && !!paint && isSameDay(date, paint[0]);
|
|
396
|
+
const isEnd = !outside && !!paint && isSameDay(date, paint[1]);
|
|
397
|
+
const inRange = !outside && !!paint && !isStart && !isEnd && isInRange(date, paint[0], paint[1]);
|
|
398
|
+
const isToday = !outside && iso === todayIso;
|
|
399
|
+
const isDisabled2 = this._isDisabledDate(iso) || this.disabled;
|
|
400
|
+
const classes = [
|
|
401
|
+
"day",
|
|
402
|
+
outside ? "--outside" : "",
|
|
403
|
+
isStart ? "--range-start" : "",
|
|
404
|
+
isEnd ? "--range-end" : "",
|
|
405
|
+
inRange ? "--in-range" : "",
|
|
406
|
+
isToday && !isStart && !isEnd ? "--today" : ""
|
|
407
|
+
].filter(Boolean).join(" ");
|
|
408
|
+
return T`
|
|
409
|
+
<div class="cell" role="gridcell" aria-selected=${isStart || isEnd ? "true" : "false"}>
|
|
816
410
|
<button
|
|
411
|
+
class=${classes}
|
|
817
412
|
type="button"
|
|
818
|
-
|
|
819
|
-
aria-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
>
|
|
833
|
-
<svg class="nav-icon" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
834
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
|
|
835
|
-
</svg>
|
|
836
|
-
</button>
|
|
837
|
-
</li>
|
|
838
|
-
</ul>
|
|
839
|
-
</nav>
|
|
840
|
-
`;
|
|
841
|
-
}
|
|
842
|
-
};
|
|
843
|
-
customElements.define("bds-pagination", BdsPagination);
|
|
844
|
-
|
|
845
|
-
// src/web-components/interaction/form/bds-checkbox-group.ts
|
|
846
|
-
var BdsCheckboxGroup = class extends i2 {
|
|
847
|
-
static styles = i`
|
|
848
|
-
:host {
|
|
849
|
-
display: block;
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
fieldset {
|
|
853
|
-
border: none;
|
|
854
|
-
margin: 0;
|
|
855
|
-
padding: 0;
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
.legend {
|
|
859
|
-
font-size: var(--bds-font_size--body--s);
|
|
860
|
-
font-family: var(--bds-font_family--body);
|
|
861
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
862
|
-
color: var(--bds-color_on-bg);
|
|
863
|
-
margin-block-end: var(--bds-space_xs);
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
.required {
|
|
867
|
-
color: var(--bds-color_error);
|
|
868
|
-
margin-inline-start: var(--bds-space_xxxs);
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
.items {
|
|
872
|
-
display: flex;
|
|
873
|
-
flex-direction: column;
|
|
874
|
-
gap: var(--bds-space_xs);
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
.message {
|
|
878
|
-
margin-block-start: var(--bds-space_xs);
|
|
879
|
-
font-size: var(--bds-font_size--body--s);
|
|
880
|
-
font-family: var(--bds-font_family--body);
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
.message--error {
|
|
884
|
-
color: var(--bds-color_error);
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
.message--hint {
|
|
888
|
-
color: var(--bds-color_on-bg--subtle);
|
|
889
|
-
font-style: italic;
|
|
890
|
-
}
|
|
891
|
-
`;
|
|
892
|
-
static properties = {
|
|
893
|
-
label: { type: String },
|
|
894
|
-
error: { type: String },
|
|
895
|
-
hint: { type: String },
|
|
896
|
-
disabled: { type: Boolean, reflect: true },
|
|
897
|
-
required: { type: Boolean, reflect: true }
|
|
898
|
-
};
|
|
899
|
-
constructor() {
|
|
900
|
-
super();
|
|
901
|
-
this.label = "";
|
|
902
|
-
this.disabled = false;
|
|
903
|
-
this.required = false;
|
|
904
|
-
}
|
|
905
|
-
render() {
|
|
906
|
-
return T`
|
|
907
|
-
<fieldset ?disabled=${this.disabled}>
|
|
908
|
-
<legend class="legend">
|
|
909
|
-
${this.label}
|
|
910
|
-
${this.required ? T`<span class="required" aria-hidden="true"> *</span>` : ""}
|
|
911
|
-
</legend>
|
|
912
|
-
<div class="items">
|
|
913
|
-
<slot></slot>
|
|
914
|
-
</div>
|
|
915
|
-
${this.error ? T`<p class="message message--error" role="alert">${this.error}</p>` : this.hint ? T`<p class="message message--hint">${this.hint}</p>` : ""}
|
|
916
|
-
</fieldset>
|
|
917
|
-
`;
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
customElements.define("bds-checkbox-group", BdsCheckboxGroup);
|
|
921
|
-
|
|
922
|
-
// src/web-components/interaction/form/bds-radio-group.ts
|
|
923
|
-
var BdsRadioGroup = class extends i2 {
|
|
924
|
-
static styles = i`
|
|
925
|
-
:host {
|
|
926
|
-
display: block;
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
fieldset {
|
|
930
|
-
border: none;
|
|
931
|
-
margin: 0;
|
|
932
|
-
padding: 0;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
.legend {
|
|
936
|
-
font-size: var(--bds-font_size--body--s);
|
|
937
|
-
font-family: var(--bds-font_family--body);
|
|
938
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
939
|
-
color: var(--bds-color_on-bg);
|
|
940
|
-
margin-block-end: var(--bds-space_xs);
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
.required {
|
|
944
|
-
color: var(--bds-color_error);
|
|
945
|
-
margin-inline-start: var(--bds-space_xxxs);
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
.items {
|
|
949
|
-
display: flex;
|
|
950
|
-
flex-direction: column;
|
|
951
|
-
gap: var(--bds-space_xs);
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
.message {
|
|
955
|
-
margin-block-start: var(--bds-space_xs);
|
|
956
|
-
font-size: var(--bds-font_size--body--s);
|
|
957
|
-
font-family: var(--bds-font_family--body);
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
.message--error {
|
|
961
|
-
color: var(--bds-color_error);
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
.message--hint {
|
|
965
|
-
color: var(--bds-color_on-bg--subtle);
|
|
966
|
-
font-style: italic;
|
|
967
|
-
}
|
|
968
|
-
`;
|
|
969
|
-
static properties = {
|
|
970
|
-
label: { type: String },
|
|
971
|
-
name: { type: String, reflect: true },
|
|
972
|
-
error: { type: String },
|
|
973
|
-
hint: { type: String },
|
|
974
|
-
disabled: { type: Boolean, reflect: true },
|
|
975
|
-
required: { type: Boolean, reflect: true }
|
|
976
|
-
};
|
|
977
|
-
constructor() {
|
|
978
|
-
super();
|
|
979
|
-
this.label = "";
|
|
980
|
-
this.name = "";
|
|
981
|
-
this.disabled = false;
|
|
982
|
-
this.required = false;
|
|
983
|
-
}
|
|
984
|
-
_propagateName = () => {
|
|
985
|
-
if (!this.name) return;
|
|
986
|
-
this.querySelectorAll("bds-radio").forEach((radio) => {
|
|
987
|
-
radio.setAttribute("name", this.name);
|
|
988
|
-
});
|
|
989
|
-
};
|
|
990
|
-
connectedCallback() {
|
|
991
|
-
super.connectedCallback();
|
|
992
|
-
Promise.resolve().then(this._propagateName);
|
|
993
|
-
}
|
|
994
|
-
updated(changed) {
|
|
995
|
-
super.updated(changed);
|
|
996
|
-
if (changed.has("name")) {
|
|
997
|
-
this._propagateName();
|
|
998
|
-
}
|
|
413
|
+
data-date=${iso}
|
|
414
|
+
aria-label=${this._dayLabel(date)}
|
|
415
|
+
?disabled=${isDisabled2 || outside}
|
|
416
|
+
aria-current=${isToday ? "date" : A}
|
|
417
|
+
aria-disabled=${isDisabled2 ? "true" : "false"}
|
|
418
|
+
tabindex=${!outside && iso === tabbableIso ? "0" : "-1"}
|
|
419
|
+
@click=${() => this._selectDate(iso)}
|
|
420
|
+
@pointerenter=${() => this._onDayEnter(iso)}
|
|
421
|
+
>${day}</button>
|
|
422
|
+
</div>`;
|
|
423
|
+
})}
|
|
424
|
+
</div>`)}
|
|
425
|
+
</div>
|
|
426
|
+
</div>`;
|
|
999
427
|
}
|
|
1000
428
|
render() {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
${this.label}
|
|
1005
|
-
${this.required ? T`<span class="required" aria-hidden="true"> *</span>` : ""}
|
|
1006
|
-
</legend>
|
|
1007
|
-
<div class="items">
|
|
1008
|
-
<slot @slotchange=${this._propagateName}></slot>
|
|
1009
|
-
</div>
|
|
1010
|
-
${this.error ? T`<p class="message message--error" role="alert">${this.error}</p>` : this.hint ? T`<p class="message message--hint">${this.hint}</p>` : ""}
|
|
1011
|
-
</fieldset>
|
|
1012
|
-
`;
|
|
1013
|
-
}
|
|
1014
|
-
};
|
|
1015
|
-
customElements.define("bds-radio-group", BdsRadioGroup);
|
|
1016
|
-
|
|
1017
|
-
// src/web-components/interaction/form/bds-field-group.ts
|
|
1018
|
-
var BdsFieldGroup = class extends i2 {
|
|
1019
|
-
static styles = i`
|
|
1020
|
-
:host {
|
|
1021
|
-
display: block;
|
|
1022
|
-
|
|
1023
|
-
/* Establish an inline-size containment context so the @container rule
|
|
1024
|
-
queries the host's own width — independent of the viewport. */
|
|
1025
|
-
container-type: inline-size;
|
|
1026
|
-
container-name: field-group;
|
|
1027
|
-
|
|
1028
|
-
/* Auto-derived collapse threshold (mirror of the React component).
|
|
1029
|
-
--fieldGroup_field-count is set inline by _onSlotChange; the other
|
|
1030
|
-
tokens use foundation-default fallbacks so the calc rebuilds when
|
|
1031
|
-
a consumer overrides --fieldGroup_min-field-width or _gap. */
|
|
1032
|
-
--fieldGroup_collapse-threshold:
|
|
1033
|
-
calc(
|
|
1034
|
-
var(--fieldGroup_field-count, 1)
|
|
1035
|
-
* var(--fieldGroup_min-field-width, 12rem)
|
|
1036
|
-
+ (var(--fieldGroup_field-count, 1) - 1)
|
|
1037
|
-
* var(--fieldGroup_gap, var(--bds-space_m))
|
|
1038
|
-
);
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
fieldset {
|
|
1042
|
-
border: 0;
|
|
1043
|
-
margin: 0;
|
|
1044
|
-
padding: 0;
|
|
1045
|
-
min-inline-size: 0;
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
.legend {
|
|
1049
|
-
inline-size: 100%;
|
|
1050
|
-
padding-inline: 0;
|
|
1051
|
-
|
|
1052
|
-
padding-block:
|
|
1053
|
-
var(--fieldGroup_legend-padding-block, var(--bds-space_xs));
|
|
1054
|
-
margin-block-end:
|
|
1055
|
-
var(--fieldGroup_legend-gap, var(--bds-space_m));
|
|
1056
|
-
border-block-end:
|
|
1057
|
-
var(--fieldGroup_legend-border-block-end, 1px solid var(--bds-color_bg--subtle));
|
|
1058
|
-
|
|
1059
|
-
color:
|
|
1060
|
-
var(--fieldGroup_legend-color, var(--bds-color_on-bg));
|
|
1061
|
-
font-family: var(--bds-font_family--body);
|
|
1062
|
-
font-size:
|
|
1063
|
-
var(--fieldGroup_legend-font-size, var(--bds-font_size--heading-3));
|
|
1064
|
-
font-weight:
|
|
1065
|
-
var(--fieldGroup_legend-font-weight, var(--bds-font_weight--semibold));
|
|
1066
|
-
line-height:
|
|
1067
|
-
var(--fieldGroup_legend-line-height, var(--bds-font_line-height--heading));
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
.fields {
|
|
1071
|
-
display: flex;
|
|
1072
|
-
flex-direction: column;
|
|
1073
|
-
gap: var(--fieldGroup_gap, var(--bds-space_m));
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
:host([variant='horizontal']) .fields {
|
|
1077
|
-
flex-flow: row wrap;
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
:host([variant='horizontal']) .fields ::slotted(*) {
|
|
1081
|
-
flex: 1 1 var(--fieldGroup_min-field-width, 12rem);
|
|
1082
|
-
min-inline-size: 0;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
/* Auto-collapse: when the host's inline-size can't fit a complete
|
|
1086
|
-
horizontal row, switch to a single-column stack. Threshold scales
|
|
1087
|
-
with the actual slotted-element count (see :host calc above). */
|
|
1088
|
-
@container field-group (max-inline-size: var(--fieldGroup_collapse-threshold)) {
|
|
1089
|
-
:host([variant='horizontal']) .fields {
|
|
1090
|
-
flex-direction: column;
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
:host([variant='horizontal']) .fields ::slotted(*) {
|
|
1094
|
-
flex: 1 1 auto;
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
`;
|
|
1098
|
-
static properties = {
|
|
1099
|
-
variant: { type: String, reflect: true },
|
|
1100
|
-
legend: { type: String },
|
|
1101
|
-
disabled: { type: Boolean, reflect: true }
|
|
1102
|
-
};
|
|
1103
|
-
constructor() {
|
|
1104
|
-
super();
|
|
1105
|
-
this.variant = "horizontal";
|
|
1106
|
-
this.legend = "";
|
|
1107
|
-
this.disabled = false;
|
|
1108
|
-
}
|
|
1109
|
-
// Arrow-bound for stable identity (unused here but matches the
|
|
1110
|
-
// bds-popover / bds-button conventions for handlers attached in render).
|
|
1111
|
-
_onSlotChange = (e) => {
|
|
1112
|
-
const slot = e.target;
|
|
1113
|
-
const count = slot.assignedElements().length;
|
|
1114
|
-
this.style.setProperty("--fieldGroup_field-count", String(count));
|
|
1115
|
-
};
|
|
1116
|
-
render() {
|
|
1117
|
-
return T`
|
|
1118
|
-
<fieldset ?disabled=${this.disabled}>
|
|
1119
|
-
${this.legend ? T`<legend class="legend">${this.legend}</legend>` : A}
|
|
1120
|
-
<div class="fields">
|
|
1121
|
-
<slot @slotchange=${this._onSlotChange}></slot>
|
|
1122
|
-
</div>
|
|
1123
|
-
</fieldset>
|
|
1124
|
-
`;
|
|
1125
|
-
}
|
|
1126
|
-
};
|
|
1127
|
-
customElements.define("bds-field-group", BdsFieldGroup);
|
|
1128
|
-
|
|
1129
|
-
// src/web-components/interaction/form/bds-form-input.ts
|
|
1130
|
-
var BdsFormInput = class extends i2 {
|
|
1131
|
-
static formAssociated = true;
|
|
1132
|
-
static styles = i`
|
|
1133
|
-
:host {
|
|
1134
|
-
display: block;
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
:host([disabled]) {
|
|
1138
|
-
opacity: 0.5;
|
|
1139
|
-
pointer-events: none;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
.label {
|
|
1143
|
-
display: block;
|
|
1144
|
-
font-size: var(--bds-font_size--body--s);
|
|
1145
|
-
font-family: var(--bds-font_family--body);
|
|
1146
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
1147
|
-
color: var(--bds-color_on-bg);
|
|
1148
|
-
margin-block-end: var(--bds-space_xxs);
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
.required {
|
|
1152
|
-
color: var(--bds-color_error);
|
|
1153
|
-
margin-inline-start: var(--bds-space_xxxs);
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
.wrapper {
|
|
1157
|
-
position: relative;
|
|
1158
|
-
display: flex;
|
|
1159
|
-
align-items: center;
|
|
1160
|
-
--bdc_color: var(--formInput_border-color, currentcolor);
|
|
1161
|
-
--bdc-outline_radius: var(--bds-border_radius--xs);
|
|
1162
|
-
|
|
1163
|
-
border-radius: var(--formInput_radius, var(--bdc-outline_radius));
|
|
1164
|
-
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--formInput_shadow, var(--bdc-outline_shadow));
|
|
1165
|
-
background-color: var(--bds-color_bg);
|
|
1166
|
-
transition: --bdc_color var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
:host([error]) .wrapper {
|
|
1170
|
-
--bdc_color: var(--bds-color_error);
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
.wrapper:focus-within {
|
|
1174
|
-
--bdc_color: var(--bdc_color--focus);
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
:host([error]) .wrapper:focus-within {
|
|
1178
|
-
--bdc_color: var(--bds-color_error);
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
.input {
|
|
1182
|
-
flex: 1;
|
|
1183
|
-
min-inline-size: 0;
|
|
1184
|
-
border: none;
|
|
1185
|
-
background: transparent;
|
|
1186
|
-
padding: var(--bds-space_s);
|
|
1187
|
-
font-size: var(--bds-font_size--body);
|
|
1188
|
-
font-family: var(--bds-font_family--body);
|
|
1189
|
-
color: var(--bds-color_on-bg);
|
|
1190
|
-
outline: none;
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
.input::placeholder {
|
|
1194
|
-
color: var(--bds-color_on-bg--subtle);
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
.input:focus-visible {
|
|
1198
|
-
outline: none;
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
.wrapper:focus-within {
|
|
1202
|
-
outline: var(--bds-outline_default);
|
|
1203
|
-
outline-offset: var(--bds-outline_offset);
|
|
1204
|
-
border-radius: var(--formInput_radius, var(--bdc-outline_radius));
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
.prefix,
|
|
1208
|
-
.suffix {
|
|
1209
|
-
display: flex;
|
|
1210
|
-
align-items: center;
|
|
1211
|
-
color: var(--bds-color_on-bg--subtle);
|
|
1212
|
-
flex-shrink: 0;
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
.prefix {
|
|
1216
|
-
padding-inline-start: var(--bds-space_s);
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
.suffix {
|
|
1220
|
-
padding-inline-end: var(--bds-space_s);
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
.prefix:empty,
|
|
1224
|
-
.suffix:empty {
|
|
1225
|
-
display: none;
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
.message {
|
|
1229
|
-
margin-block-start: var(--bds-space_xxs);
|
|
1230
|
-
font-size: var(--bds-font_size--body--s);
|
|
1231
|
-
font-family: var(--bds-font_family--body);
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
.message--error {
|
|
1235
|
-
color: var(--bds-color_error);
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
.message--hint {
|
|
1239
|
-
color: var(--bds-color_on-bg--subtle);
|
|
1240
|
-
font-style: italic;
|
|
1241
|
-
}
|
|
1242
|
-
`;
|
|
1243
|
-
static properties = {
|
|
1244
|
-
name: { type: String, reflect: true },
|
|
1245
|
-
type: { type: String, reflect: true },
|
|
1246
|
-
value: { type: String },
|
|
1247
|
-
placeholder: { type: String },
|
|
1248
|
-
label: { type: String },
|
|
1249
|
-
hint: { type: String },
|
|
1250
|
-
error: { type: String, reflect: true },
|
|
1251
|
-
disabled: { type: Boolean, reflect: true },
|
|
1252
|
-
required: { type: Boolean, reflect: true }
|
|
1253
|
-
};
|
|
1254
|
-
_internals;
|
|
1255
|
-
_uid = Math.random().toString(36).slice(2, 8);
|
|
1256
|
-
constructor() {
|
|
1257
|
-
super();
|
|
1258
|
-
this._internals = this.attachInternals();
|
|
1259
|
-
this.name = "";
|
|
1260
|
-
this.type = "text";
|
|
1261
|
-
this.value = "";
|
|
1262
|
-
this.placeholder = "";
|
|
1263
|
-
this.label = "";
|
|
1264
|
-
this.disabled = false;
|
|
1265
|
-
this.required = false;
|
|
1266
|
-
}
|
|
1267
|
-
updated(changed) {
|
|
1268
|
-
super.updated(changed);
|
|
1269
|
-
if (changed.has("value")) {
|
|
1270
|
-
this._internals.setFormValue?.(this.value);
|
|
1271
|
-
}
|
|
1272
|
-
if (changed.has("required") || changed.has("value")) {
|
|
1273
|
-
if (this.required && !this.value) {
|
|
1274
|
-
this._internals.setValidity?.({ valueMissing: true }, "Required");
|
|
1275
|
-
} else {
|
|
1276
|
-
this._internals.setValidity?.({});
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
formResetCallback() {
|
|
1281
|
-
this.value = "";
|
|
1282
|
-
this._internals.setFormValue?.("");
|
|
1283
|
-
}
|
|
1284
|
-
_handleInput(e) {
|
|
1285
|
-
const input = e.target;
|
|
1286
|
-
this.value = input.value;
|
|
1287
|
-
this.dispatchEvent(new CustomEvent("bds-input", {
|
|
1288
|
-
detail: { value: this.value },
|
|
1289
|
-
bubbles: true,
|
|
1290
|
-
composed: true
|
|
1291
|
-
}));
|
|
1292
|
-
}
|
|
1293
|
-
_handleChange(e) {
|
|
1294
|
-
const input = e.target;
|
|
1295
|
-
this.value = input.value;
|
|
1296
|
-
this.dispatchEvent(new CustomEvent("bds-change", {
|
|
1297
|
-
detail: { value: this.value },
|
|
1298
|
-
bubbles: true,
|
|
1299
|
-
composed: true
|
|
1300
|
-
}));
|
|
1301
|
-
}
|
|
1302
|
-
render() {
|
|
1303
|
-
const id = `bds-form-input-${this._uid}`;
|
|
1304
|
-
const hintId = `${id}-hint`;
|
|
1305
|
-
const errorId = `${id}-error`;
|
|
1306
|
-
const describedBy = [this.error && errorId, this.hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
1307
|
-
return T`
|
|
1308
|
-
${this.label ? T`
|
|
1309
|
-
<label class="label" for=${id}>
|
|
1310
|
-
${this.label}
|
|
1311
|
-
${this.required ? T`<span class="required" aria-hidden="true">*</span>` : ""}
|
|
1312
|
-
</label>
|
|
1313
|
-
` : ""}
|
|
1314
|
-
<div class="wrapper">
|
|
1315
|
-
<span class="prefix"><slot name="prefix"></slot></span>
|
|
1316
|
-
<input
|
|
1317
|
-
id=${id}
|
|
1318
|
-
class="input"
|
|
1319
|
-
type=${this.type}
|
|
1320
|
-
.value=${this.value}
|
|
1321
|
-
placeholder=${this.placeholder}
|
|
1322
|
-
?disabled=${this.disabled}
|
|
1323
|
-
?required=${this.required}
|
|
1324
|
-
aria-invalid=${this.error ? "true" : "false"}
|
|
1325
|
-
aria-describedby=${describedBy ?? ""}
|
|
1326
|
-
aria-required=${this.required ? "true" : "false"}
|
|
1327
|
-
@input=${this._handleInput}
|
|
1328
|
-
@change=${this._handleChange}
|
|
1329
|
-
/>
|
|
1330
|
-
<span class="suffix"><slot name="suffix"></slot></span>
|
|
1331
|
-
</div>
|
|
1332
|
-
${this.error ? T`<p id=${errorId} class="message message--error" role="alert">${this.error}</p>` : this.hint ? T`<p id=${hintId} class="message message--hint">${this.hint}</p>` : ""}
|
|
1333
|
-
`;
|
|
1334
|
-
}
|
|
1335
|
-
};
|
|
1336
|
-
customElements.define("bds-form-input", BdsFormInput);
|
|
1337
|
-
|
|
1338
|
-
// src/web-components/ui/bds-carousel.ts
|
|
1339
|
-
var BdsCarousel = class extends i2 {
|
|
1340
|
-
static styles = i`
|
|
1341
|
-
:host {
|
|
1342
|
-
display: block;
|
|
1343
|
-
position: relative;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
.track {
|
|
1347
|
-
display: flex;
|
|
1348
|
-
overflow-inline: auto;
|
|
1349
|
-
scroll-snap-type: inline mandatory;
|
|
1350
|
-
scroll-behavior: smooth;
|
|
1351
|
-
scrollbar-width: none;
|
|
1352
|
-
-ms-overflow-style: none;
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
.track::-webkit-scrollbar {
|
|
1356
|
-
display: none;
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
::slotted(*) {
|
|
1360
|
-
flex-shrink: 0;
|
|
1361
|
-
inline-size: 100%;
|
|
1362
|
-
scroll-snap-align: start;
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
.controls {
|
|
1366
|
-
display: flex;
|
|
1367
|
-
align-items: center;
|
|
1368
|
-
justify-content: space-between;
|
|
1369
|
-
margin-block-start: var(--bds-space_s);
|
|
1370
|
-
}
|
|
1371
|
-
|
|
1372
|
-
.nav-btn {
|
|
1373
|
-
display: inline-flex;
|
|
1374
|
-
align-items: center;
|
|
1375
|
-
justify-content: center;
|
|
1376
|
-
inline-size: 2.5rem;
|
|
1377
|
-
block-size: 2.5rem;
|
|
1378
|
-
border: none;
|
|
1379
|
-
border-radius: var(--carousel_navBtn-radius, var(--bds-border_radius--circle));
|
|
1380
|
-
background-color: var(--carousel_navBtn-bg, var(--bds-color_bg--subtle));
|
|
1381
|
-
color: var(--bds-color_on-bg);
|
|
1382
|
-
cursor: pointer;
|
|
1383
|
-
transition: var(--bds-animation_transition);
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
.nav-btn:focus-visible {
|
|
1387
|
-
outline: var(--bds-outline_default);
|
|
1388
|
-
outline-offset: var(--bds-outline_offset);
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
@media (hover: hover) and (pointer: fine) {
|
|
1392
|
-
.nav-btn:hover {
|
|
1393
|
-
background-color: var(--carousel_navBtn-bg--hover, var(--bds-color_bg--strong));
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
.nav-btn:disabled {
|
|
1398
|
-
opacity: 0.4;
|
|
1399
|
-
cursor: not-allowed;
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
.nav-btn svg {
|
|
1403
|
-
inline-size: 1.25rem;
|
|
1404
|
-
block-size: 1.25rem;
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
.indicators {
|
|
1408
|
-
display: flex;
|
|
1409
|
-
gap: var(--bds-space_xxs);
|
|
1410
|
-
align-items: center;
|
|
1411
|
-
justify-content: center;
|
|
1412
|
-
flex: 1;
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
.dot {
|
|
1416
|
-
inline-size: 0.5rem;
|
|
1417
|
-
block-size: 0.5rem;
|
|
1418
|
-
border-radius: var(--carousel_indicator-radius, var(--bds-border_radius--circle));
|
|
1419
|
-
border: none;
|
|
1420
|
-
padding: 0;
|
|
1421
|
-
background-color: var(--carousel_indicator-bg, var(--bds-color_bg--strong));
|
|
1422
|
-
cursor: pointer;
|
|
1423
|
-
transition: var(--bds-animation_transition);
|
|
1424
|
-
}
|
|
1425
|
-
|
|
1426
|
-
.dot.--active {
|
|
1427
|
-
background-color: var(--carousel_indicator-bg--active, var(--bds-color_interactive));
|
|
1428
|
-
inline-size: 1rem;
|
|
1429
|
-
border-radius: var(--carousel_indicator-radius--active, var(--bds-border_radius--full));
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
.dot:focus-visible {
|
|
1433
|
-
outline: var(--bds-outline_default);
|
|
1434
|
-
outline-offset: var(--bds-outline_offset);
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
@media (prefers-reduced-motion: reduce) {
|
|
1438
|
-
.track {
|
|
1439
|
-
scroll-behavior: auto;
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
`;
|
|
1443
|
-
static properties = {
|
|
1444
|
-
currentIndex: { type: Number, attribute: "current-index", reflect: true },
|
|
1445
|
-
indicators: { type: Boolean, reflect: true },
|
|
1446
|
-
loop: { type: Boolean, reflect: true }
|
|
1447
|
-
};
|
|
1448
|
-
_slideCount = 0;
|
|
1449
|
-
_io = null;
|
|
1450
|
-
constructor() {
|
|
1451
|
-
super();
|
|
1452
|
-
this.currentIndex = 0;
|
|
1453
|
-
this.indicators = false;
|
|
1454
|
-
this.loop = false;
|
|
1455
|
-
}
|
|
1456
|
-
get _track() {
|
|
1457
|
-
return this.shadowRoot?.querySelector(".track") ?? null;
|
|
1458
|
-
}
|
|
1459
|
-
connectedCallback() {
|
|
1460
|
-
super.connectedCallback();
|
|
1461
|
-
this._updateSlideCount();
|
|
1462
|
-
}
|
|
1463
|
-
disconnectedCallback() {
|
|
1464
|
-
super.disconnectedCallback();
|
|
1465
|
-
this._io?.disconnect();
|
|
1466
|
-
this._io = null;
|
|
1467
|
-
}
|
|
1468
|
-
_updateSlideCount() {
|
|
1469
|
-
this._slideCount = this.children.length;
|
|
1470
|
-
this.requestUpdate();
|
|
1471
|
-
}
|
|
1472
|
-
_goTo(index) {
|
|
1473
|
-
const count = this._slideCount;
|
|
1474
|
-
if (count === 0) return;
|
|
1475
|
-
let next = index;
|
|
1476
|
-
if (this.loop) {
|
|
1477
|
-
next = (index % count + count) % count;
|
|
1478
|
-
} else {
|
|
1479
|
-
next = Math.max(0, Math.min(index, count - 1));
|
|
1480
|
-
}
|
|
1481
|
-
if (next === this.currentIndex && index === next) return;
|
|
1482
|
-
this.currentIndex = next;
|
|
1483
|
-
const track = this._track;
|
|
1484
|
-
const slides = track?.querySelector("slot")?.assignedElements() ?? [];
|
|
1485
|
-
const target = slides[next];
|
|
1486
|
-
if (target && typeof target.scrollIntoView === "function") {
|
|
1487
|
-
target.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "start" });
|
|
1488
|
-
}
|
|
1489
|
-
this.dispatchEvent(new CustomEvent("bds-slide-change", {
|
|
1490
|
-
detail: { index: next },
|
|
1491
|
-
bubbles: true,
|
|
1492
|
-
composed: true
|
|
1493
|
-
}));
|
|
1494
|
-
}
|
|
1495
|
-
_onSlotChange() {
|
|
1496
|
-
this._updateSlideCount();
|
|
1497
|
-
this._io?.disconnect();
|
|
1498
|
-
const track = this._track;
|
|
1499
|
-
if (!track) return;
|
|
1500
|
-
const slot = track.querySelector("slot");
|
|
1501
|
-
const slides = slot?.assignedElements() ?? [];
|
|
1502
|
-
if (typeof IntersectionObserver === "undefined") return;
|
|
1503
|
-
this._io = new IntersectionObserver(
|
|
1504
|
-
(entries) => {
|
|
1505
|
-
const visible = entries.find((e) => e.isIntersecting && e.intersectionRatio >= 0.5);
|
|
1506
|
-
if (visible) {
|
|
1507
|
-
const idx = slides.indexOf(visible.target);
|
|
1508
|
-
if (idx !== -1 && idx !== this.currentIndex) {
|
|
1509
|
-
this.currentIndex = idx;
|
|
1510
|
-
this.requestUpdate();
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
},
|
|
1514
|
-
{ root: track, threshold: 0.5 }
|
|
1515
|
-
);
|
|
1516
|
-
slides.forEach((slide) => this._io.observe(slide));
|
|
1517
|
-
}
|
|
1518
|
-
render() {
|
|
1519
|
-
const atStart = this.currentIndex <= 0;
|
|
1520
|
-
const atEnd = this.currentIndex >= this._slideCount - 1;
|
|
1521
|
-
const showPrev = this.loop || !atStart;
|
|
1522
|
-
const showNext = this.loop || !atEnd;
|
|
1523
|
-
return T`
|
|
1524
|
-
<div class="track" aria-label="Carousel" role="region">
|
|
1525
|
-
<slot @slotchange=${this._onSlotChange}></slot>
|
|
1526
|
-
</div>
|
|
1527
|
-
<div class="controls">
|
|
1528
|
-
<slot name="prev">
|
|
1529
|
-
<button
|
|
1530
|
-
class="nav-btn"
|
|
1531
|
-
type="button"
|
|
1532
|
-
aria-label="Previous slide"
|
|
1533
|
-
?disabled=${!showPrev}
|
|
1534
|
-
@click=${() => this._goTo(this.currentIndex - 1)}
|
|
1535
|
-
>
|
|
1536
|
-
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1537
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
|
|
1538
|
-
</svg>
|
|
1539
|
-
</button>
|
|
1540
|
-
</slot>
|
|
1541
|
-
|
|
1542
|
-
${this.indicators ? T`
|
|
1543
|
-
<div class="indicators" role="tablist" aria-label="Slides">
|
|
1544
|
-
${Array.from({ length: this._slideCount }, (_, i3) => T`
|
|
1545
|
-
<button
|
|
1546
|
-
class="dot ${i3 === this.currentIndex ? "--active" : ""}"
|
|
1547
|
-
type="button"
|
|
1548
|
-
role="tab"
|
|
1549
|
-
aria-selected=${i3 === this.currentIndex ? "true" : "false"}
|
|
1550
|
-
aria-label="Slide ${i3 + 1}"
|
|
1551
|
-
@click=${() => this._goTo(i3)}
|
|
1552
|
-
></button>
|
|
1553
|
-
`)}
|
|
1554
|
-
</div>
|
|
1555
|
-
` : T`<span style="flex:1"></span>`}
|
|
1556
|
-
|
|
1557
|
-
<slot name="next">
|
|
1558
|
-
<button
|
|
1559
|
-
class="nav-btn"
|
|
1560
|
-
type="button"
|
|
1561
|
-
aria-label="Next slide"
|
|
1562
|
-
?disabled=${!showNext}
|
|
1563
|
-
@click=${() => this._goTo(this.currentIndex + 1)}
|
|
1564
|
-
>
|
|
1565
|
-
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1566
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
|
|
1567
|
-
</svg>
|
|
1568
|
-
</button>
|
|
1569
|
-
</slot>
|
|
1570
|
-
</div>
|
|
1571
|
-
`;
|
|
1572
|
-
}
|
|
1573
|
-
};
|
|
1574
|
-
customElements.define("bds-carousel", BdsCarousel);
|
|
1575
|
-
|
|
1576
|
-
// src/web-components/ui/bds-calendar.ts
|
|
1577
|
-
function toISO(date) {
|
|
1578
|
-
const y = date.getFullYear();
|
|
1579
|
-
const m = String(date.getMonth() + 1).padStart(2, "0");
|
|
1580
|
-
const d = String(date.getDate()).padStart(2, "0");
|
|
1581
|
-
return `${y}-${m}-${d}`;
|
|
1582
|
-
}
|
|
1583
|
-
function parseISO(iso) {
|
|
1584
|
-
if (!iso) return null;
|
|
1585
|
-
const [y, m, d] = iso.split("-").map(Number);
|
|
1586
|
-
if (!y || !m || !d) return null;
|
|
1587
|
-
const date = new Date(y, m - 1, d);
|
|
1588
|
-
return isNaN(date.getTime()) ? null : date;
|
|
1589
|
-
}
|
|
1590
|
-
var BdsCalendar = class extends i2 {
|
|
1591
|
-
static formAssociated = true;
|
|
1592
|
-
static styles = i`
|
|
1593
|
-
:host {
|
|
1594
|
-
display: inline-block;
|
|
1595
|
-
font-family: var(--bds-font_family--body);
|
|
1596
|
-
font-size: var(--bds-font_size--body);
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
:host([disabled]) {
|
|
1600
|
-
opacity: 0.5;
|
|
1601
|
-
pointer-events: none;
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
.calendar {
|
|
1605
|
-
background-color: var(--bds-color_bg);
|
|
1606
|
-
border-radius: var(--bds-border_radius--m);
|
|
1607
|
-
box-shadow: var(--bds-shadow_s);
|
|
1608
|
-
padding: var(--bds-space_s);
|
|
1609
|
-
inline-size: fit-content;
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
.header {
|
|
1613
|
-
display: flex;
|
|
1614
|
-
align-items: center;
|
|
1615
|
-
justify-content: space-between;
|
|
1616
|
-
margin-block-end: var(--bds-space_s);
|
|
1617
|
-
}
|
|
1618
|
-
|
|
1619
|
-
.month-label {
|
|
1620
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
1621
|
-
color: var(--bds-color_on-bg);
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
.nav-btn {
|
|
1625
|
-
display: inline-flex;
|
|
1626
|
-
align-items: center;
|
|
1627
|
-
justify-content: center;
|
|
1628
|
-
inline-size: 2rem;
|
|
1629
|
-
block-size: 2rem;
|
|
1630
|
-
border: none;
|
|
1631
|
-
border-radius: var(--bds-border_radius--xs);
|
|
1632
|
-
background: none;
|
|
1633
|
-
color: var(--bds-color_on-bg);
|
|
1634
|
-
cursor: pointer;
|
|
1635
|
-
transition: var(--bds-animation_transition);
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
@media (hover: hover) and (pointer: fine) {
|
|
1639
|
-
.nav-btn:hover {
|
|
1640
|
-
background-color: var(--bds-color_bg--subtle);
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
.nav-btn:focus-visible {
|
|
1645
|
-
outline: var(--bds-outline_default);
|
|
1646
|
-
outline-offset: var(--bds-outline_offset);
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
.nav-btn svg {
|
|
1650
|
-
inline-size: 1rem;
|
|
1651
|
-
block-size: 1rem;
|
|
1652
|
-
}
|
|
1653
|
-
|
|
1654
|
-
.grid {
|
|
1655
|
-
display: grid;
|
|
1656
|
-
grid-template-columns: repeat(7, 2.25rem);
|
|
1657
|
-
gap: var(--bds-space_xxxs);
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
.weekday {
|
|
1661
|
-
display: flex;
|
|
1662
|
-
align-items: center;
|
|
1663
|
-
justify-content: center;
|
|
1664
|
-
block-size: 2rem;
|
|
1665
|
-
font-size: var(--bds-font_size--body--s);
|
|
1666
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
1667
|
-
color: var(--bds-color_on-bg--subtle);
|
|
1668
|
-
user-select: none;
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
.day {
|
|
1672
|
-
display: flex;
|
|
1673
|
-
align-items: center;
|
|
1674
|
-
justify-content: center;
|
|
1675
|
-
inline-size: 2.25rem;
|
|
1676
|
-
block-size: 2.25rem;
|
|
1677
|
-
border: none;
|
|
1678
|
-
border-radius: var(--bds-border_radius--xs);
|
|
1679
|
-
background: none;
|
|
1680
|
-
color: var(--bds-color_on-bg);
|
|
1681
|
-
cursor: pointer;
|
|
1682
|
-
font-size: var(--bds-font_size--body--s);
|
|
1683
|
-
font-family: inherit;
|
|
1684
|
-
transition: var(--bds-animation_transition);
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
.day:focus-visible {
|
|
1688
|
-
outline: var(--bds-outline_default);
|
|
1689
|
-
outline-offset: var(--bds-outline_offset);
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
@media (hover: hover) and (pointer: fine) {
|
|
1693
|
-
.day:not(.--selected):not(.--outside):not([disabled]):hover {
|
|
1694
|
-
background-color: var(--bds-color_bg--subtle);
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
|
-
.day.--today {
|
|
1699
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
1700
|
-
color: var(--bds-color_interactive_on-bg);
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
.day.--selected {
|
|
1704
|
-
background-color: var(--bds-color_interactive);
|
|
1705
|
-
color: var(--bds-color_on-interactive);
|
|
1706
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
1707
|
-
}
|
|
1708
|
-
|
|
1709
|
-
.day.--outside {
|
|
1710
|
-
color: var(--bds-color_on-bg--subtle);
|
|
1711
|
-
opacity: 0.4;
|
|
1712
|
-
}
|
|
1713
|
-
|
|
1714
|
-
.day[disabled] {
|
|
1715
|
-
opacity: 0.3;
|
|
1716
|
-
cursor: not-allowed;
|
|
1717
|
-
}
|
|
1718
|
-
`;
|
|
1719
|
-
static properties = {
|
|
1720
|
-
name: { type: String, reflect: true },
|
|
1721
|
-
value: { type: String, reflect: true },
|
|
1722
|
-
min: { type: String },
|
|
1723
|
-
max: { type: String },
|
|
1724
|
-
disabled: { type: Boolean, reflect: true }
|
|
1725
|
-
};
|
|
1726
|
-
_internals;
|
|
1727
|
-
_viewYear;
|
|
1728
|
-
_viewMonth;
|
|
1729
|
-
// 0-based
|
|
1730
|
-
constructor() {
|
|
1731
|
-
super();
|
|
1732
|
-
this._internals = this.attachInternals();
|
|
1733
|
-
this.name = "";
|
|
1734
|
-
this.value = "";
|
|
1735
|
-
this.min = "";
|
|
1736
|
-
this.max = "";
|
|
1737
|
-
this.disabled = false;
|
|
1738
|
-
const now = /* @__PURE__ */ new Date();
|
|
1739
|
-
this._viewYear = now.getFullYear();
|
|
1740
|
-
this._viewMonth = now.getMonth();
|
|
1741
|
-
}
|
|
1742
|
-
updated(changed) {
|
|
1743
|
-
super.updated(changed);
|
|
1744
|
-
if (changed.has("value")) {
|
|
1745
|
-
this._internals.setFormValue?.(this.value);
|
|
1746
|
-
if (this.value) {
|
|
1747
|
-
const d = parseISO(this.value);
|
|
1748
|
-
if (d) {
|
|
1749
|
-
this._viewYear = d.getFullYear();
|
|
1750
|
-
this._viewMonth = d.getMonth();
|
|
1751
|
-
}
|
|
1752
|
-
}
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
formResetCallback() {
|
|
1756
|
-
this.value = "";
|
|
1757
|
-
this._internals.setFormValue?.("");
|
|
1758
|
-
}
|
|
1759
|
-
_prevMonth() {
|
|
1760
|
-
if (this._viewMonth === 0) {
|
|
1761
|
-
this._viewMonth = 11;
|
|
1762
|
-
this._viewYear--;
|
|
1763
|
-
} else {
|
|
1764
|
-
this._viewMonth--;
|
|
1765
|
-
}
|
|
1766
|
-
this.requestUpdate();
|
|
1767
|
-
}
|
|
1768
|
-
_nextMonth() {
|
|
1769
|
-
if (this._viewMonth === 11) {
|
|
1770
|
-
this._viewMonth = 0;
|
|
1771
|
-
this._viewYear++;
|
|
1772
|
-
} else {
|
|
1773
|
-
this._viewMonth++;
|
|
1774
|
-
}
|
|
1775
|
-
this.requestUpdate();
|
|
1776
|
-
}
|
|
1777
|
-
_selectDate(iso) {
|
|
1778
|
-
if (this._isDisabledDate(iso)) return;
|
|
1779
|
-
this.value = iso;
|
|
1780
|
-
this._internals.setFormValue?.(iso);
|
|
1781
|
-
this.dispatchEvent(new CustomEvent("bds-date-select", {
|
|
1782
|
-
detail: { date: iso },
|
|
1783
|
-
bubbles: true,
|
|
1784
|
-
composed: true
|
|
1785
|
-
}));
|
|
1786
|
-
}
|
|
1787
|
-
_isDisabledDate(iso) {
|
|
1788
|
-
if (this.min && iso < this.min) return true;
|
|
1789
|
-
if (this.max && iso > this.max) return true;
|
|
1790
|
-
return false;
|
|
1791
|
-
}
|
|
1792
|
-
_handleKeydown = (e) => {
|
|
1793
|
-
const focused = this.shadowRoot?.activeElement;
|
|
1794
|
-
if (!focused?.dataset.date) return;
|
|
1795
|
-
const current = parseISO(focused.dataset.date);
|
|
1796
|
-
if (!current) return;
|
|
1797
|
-
let next = null;
|
|
1798
|
-
if (e.key === "ArrowRight") {
|
|
1799
|
-
e.preventDefault();
|
|
1800
|
-
next = new Date(current.getFullYear(), current.getMonth(), current.getDate() + 1);
|
|
1801
|
-
} else if (e.key === "ArrowLeft") {
|
|
1802
|
-
e.preventDefault();
|
|
1803
|
-
next = new Date(current.getFullYear(), current.getMonth(), current.getDate() - 1);
|
|
1804
|
-
} else if (e.key === "ArrowDown") {
|
|
1805
|
-
e.preventDefault();
|
|
1806
|
-
next = new Date(current.getFullYear(), current.getMonth(), current.getDate() + 7);
|
|
1807
|
-
} else if (e.key === "ArrowUp") {
|
|
1808
|
-
e.preventDefault();
|
|
1809
|
-
next = new Date(current.getFullYear(), current.getMonth(), current.getDate() - 7);
|
|
1810
|
-
} else if (e.key === "Home") {
|
|
1811
|
-
e.preventDefault();
|
|
1812
|
-
const dow = current.getDay();
|
|
1813
|
-
next = new Date(current.getFullYear(), current.getMonth(), current.getDate() - dow);
|
|
1814
|
-
} else if (e.key === "End") {
|
|
1815
|
-
e.preventDefault();
|
|
1816
|
-
const dow = current.getDay();
|
|
1817
|
-
next = new Date(current.getFullYear(), current.getMonth(), current.getDate() + (6 - dow));
|
|
1818
|
-
} else if (e.key === "PageUp") {
|
|
1819
|
-
e.preventDefault();
|
|
1820
|
-
this._prevMonth();
|
|
1821
|
-
return;
|
|
1822
|
-
} else if (e.key === "PageDown") {
|
|
1823
|
-
e.preventDefault();
|
|
1824
|
-
this._nextMonth();
|
|
1825
|
-
return;
|
|
1826
|
-
}
|
|
1827
|
-
if (next) {
|
|
1828
|
-
const iso = toISO(next);
|
|
1829
|
-
if (next.getMonth() !== this._viewMonth || next.getFullYear() !== this._viewYear) {
|
|
1830
|
-
this._viewYear = next.getFullYear();
|
|
1831
|
-
this._viewMonth = next.getMonth();
|
|
1832
|
-
this.requestUpdate();
|
|
1833
|
-
this.updateComplete.then(() => {
|
|
1834
|
-
this.shadowRoot?.querySelector(`[data-date="${iso}"]`)?.focus();
|
|
1835
|
-
});
|
|
1836
|
-
} else {
|
|
1837
|
-
this.shadowRoot?.querySelector(`[data-date="${iso}"]`)?.focus();
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
};
|
|
1841
|
-
_buildGrid() {
|
|
1842
|
-
const year = this._viewYear;
|
|
1843
|
-
const month = this._viewMonth;
|
|
1844
|
-
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
1845
|
-
const firstDow = new Date(year, month, 1).getDay();
|
|
1846
|
-
const cells = [];
|
|
1847
|
-
const prevMonthDays = new Date(year, month, 0).getDate();
|
|
1848
|
-
for (let i3 = firstDow - 1; i3 >= 0; i3--) {
|
|
1849
|
-
const d = new Date(year, month - 1, prevMonthDays - i3);
|
|
1850
|
-
cells.push({ iso: toISO(d), outside: true });
|
|
1851
|
-
}
|
|
1852
|
-
for (let d = 1; d <= daysInMonth; d++) {
|
|
1853
|
-
cells.push({ iso: toISO(new Date(year, month, d)), outside: false });
|
|
1854
|
-
}
|
|
1855
|
-
const trailing = (7 - cells.length % 7) % 7;
|
|
1856
|
-
for (let d = 1; d <= trailing; d++) {
|
|
1857
|
-
cells.push({ iso: toISO(new Date(year, month + 1, d)), outside: true });
|
|
1858
|
-
}
|
|
1859
|
-
return cells;
|
|
1860
|
-
}
|
|
1861
|
-
render() {
|
|
1862
|
-
const today = toISO(/* @__PURE__ */ new Date());
|
|
1863
|
-
const cells = this._buildGrid();
|
|
1864
|
-
const fmt = new Intl.DateTimeFormat(void 0, { month: "long", year: "numeric" });
|
|
1865
|
-
const monthLabel = fmt.format(new Date(this._viewYear, this._viewMonth, 1));
|
|
1866
|
-
const weekdayFmt = new Intl.DateTimeFormat(void 0, { weekday: "short" });
|
|
1867
|
-
const weekdays = Array.from({ length: 7 }, (_, i3) => {
|
|
1868
|
-
const sunday = new Date(2023, 0, 1 + i3);
|
|
1869
|
-
return weekdayFmt.format(sunday);
|
|
1870
|
-
});
|
|
429
|
+
const weekdays = this._weekdayNames();
|
|
430
|
+
const paint = this._paint();
|
|
431
|
+
const tabbableIso = this._tabbableIso(paint);
|
|
1871
432
|
return T`
|
|
1872
433
|
<div class="calendar" @keydown=${this._handleKeydown}>
|
|
1873
|
-
<div class="
|
|
1874
|
-
|
|
1875
|
-
class="nav-btn"
|
|
1876
|
-
type="button"
|
|
1877
|
-
aria-label="Previous month"
|
|
1878
|
-
@click=${this._prevMonth}
|
|
1879
|
-
>
|
|
1880
|
-
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1881
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
|
|
1882
|
-
</svg>
|
|
1883
|
-
</button>
|
|
1884
|
-
<span class="month-label" aria-live="polite">${monthLabel}</span>
|
|
1885
|
-
<button
|
|
1886
|
-
class="nav-btn"
|
|
1887
|
-
type="button"
|
|
1888
|
-
aria-label="Next month"
|
|
1889
|
-
@click=${this._nextMonth}
|
|
1890
|
-
>
|
|
1891
|
-
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1892
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
|
|
1893
|
-
</svg>
|
|
1894
|
-
</button>
|
|
1895
|
-
</div>
|
|
1896
|
-
|
|
1897
|
-
<div class="grid" role="grid" aria-label=${monthLabel}>
|
|
1898
|
-
${weekdays.map((day) => T`<div class="weekday" role="columnheader" aria-label=${day}>${day}</div>`)}
|
|
1899
|
-
${cells.map(({ iso, outside }) => {
|
|
1900
|
-
const isSelected = iso === this.value;
|
|
1901
|
-
const isToday = iso === today;
|
|
1902
|
-
const isDisabled = this._isDisabledDate(iso);
|
|
1903
|
-
const classes = [
|
|
1904
|
-
"day",
|
|
1905
|
-
outside ? "--outside" : "",
|
|
1906
|
-
isSelected ? "--selected" : "",
|
|
1907
|
-
isToday && !isSelected ? "--today" : ""
|
|
1908
|
-
].filter(Boolean).join(" ");
|
|
1909
|
-
return T`
|
|
1910
|
-
<button
|
|
1911
|
-
class=${classes}
|
|
1912
|
-
type="button"
|
|
1913
|
-
role="gridcell"
|
|
1914
|
-
data-date=${iso}
|
|
1915
|
-
?disabled=${isDisabled || outside}
|
|
1916
|
-
aria-selected=${isSelected ? "true" : "false"}
|
|
1917
|
-
aria-current=${isToday ? "date" : "false"}
|
|
1918
|
-
aria-disabled=${isDisabled ? "true" : "false"}
|
|
1919
|
-
tabindex=${isSelected || !this.value && isToday ? "0" : "-1"}
|
|
1920
|
-
@click=${() => this._selectDate(iso)}
|
|
1921
|
-
>
|
|
1922
|
-
${(/* @__PURE__ */ new Date(iso + "T00:00:00")).getDate()}
|
|
1923
|
-
</button>
|
|
1924
|
-
`;
|
|
1925
|
-
})}
|
|
434
|
+
<div class="months">
|
|
435
|
+
${Array.from({ length: this._count }, (_, i2) => this._renderMonth(i2, weekdays, paint, tabbableIso))}
|
|
1926
436
|
</div>
|
|
1927
|
-
</div
|
|
1928
|
-
`;
|
|
1929
|
-
}
|
|
1930
|
-
};
|
|
1931
|
-
customElements.define("bds-calendar", BdsCalendar);
|
|
1932
|
-
|
|
1933
|
-
// src/web-components/interaction/bds-dropdown-menu.ts
|
|
1934
|
-
var BdsDropdownMenu = class extends i2 {
|
|
1935
|
-
static styles = i`
|
|
1936
|
-
:host {
|
|
1937
|
-
display: inline-block;
|
|
1938
|
-
position: relative;
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
.panel {
|
|
1942
|
-
position: absolute;
|
|
1943
|
-
inset-block-start: calc(100% + var(--bds-space_xxs));
|
|
1944
|
-
inset-inline-start: 0;
|
|
1945
|
-
min-inline-size: 10rem;
|
|
1946
|
-
background-color: var(--bds-color_bg);
|
|
1947
|
-
border-radius: var(--bds-border_radius--s);
|
|
1948
|
-
box-shadow: var(--bds-shadow_m);
|
|
1949
|
-
padding: var(--bds-space_xxs);
|
|
1950
|
-
z-index: var(--bds-z-index_dropdown, 200);
|
|
1951
|
-
display: none;
|
|
1952
|
-
flex-direction: column;
|
|
1953
|
-
}
|
|
1954
|
-
|
|
1955
|
-
:host([placement='bottom-end']) .panel {
|
|
1956
|
-
inset-inline-start: auto;
|
|
1957
|
-
inset-inline-end: 0;
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
:host([placement='top-start']) .panel {
|
|
1961
|
-
inset-block-start: auto;
|
|
1962
|
-
inset-block-end: calc(100% + var(--bds-space_xxs));
|
|
1963
|
-
inset-inline-start: 0;
|
|
1964
|
-
}
|
|
1965
|
-
|
|
1966
|
-
:host([placement='top-end']) .panel {
|
|
1967
|
-
inset-block-start: auto;
|
|
1968
|
-
inset-block-end: calc(100% + var(--bds-space_xxs));
|
|
1969
|
-
inset-inline-start: auto;
|
|
1970
|
-
inset-inline-end: 0;
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
:host([open]) .panel {
|
|
1974
|
-
display: flex;
|
|
1975
|
-
}
|
|
1976
|
-
`;
|
|
1977
|
-
static properties = {
|
|
1978
|
-
open: { type: Boolean, reflect: true },
|
|
1979
|
-
placement: { type: String, reflect: true }
|
|
1980
|
-
};
|
|
1981
|
-
constructor() {
|
|
1982
|
-
super();
|
|
1983
|
-
this.open = false;
|
|
1984
|
-
this.placement = "bottom-start";
|
|
1985
|
-
}
|
|
1986
|
-
connectedCallback() {
|
|
1987
|
-
super.connectedCallback();
|
|
1988
|
-
document.addEventListener("click", this._handleOutsideClick);
|
|
1989
|
-
this.addEventListener("keydown", this._handleKeydown);
|
|
1990
|
-
this.addEventListener("bds-select", this._handleItemSelect);
|
|
1991
|
-
}
|
|
1992
|
-
disconnectedCallback() {
|
|
1993
|
-
super.disconnectedCallback();
|
|
1994
|
-
document.removeEventListener("click", this._handleOutsideClick);
|
|
1995
|
-
this.removeEventListener("keydown", this._handleKeydown);
|
|
1996
|
-
this.removeEventListener("bds-select", this._handleItemSelect);
|
|
1997
|
-
}
|
|
1998
|
-
get _items() {
|
|
1999
|
-
return [...this.querySelectorAll("bds-dropdown-menu-item")].filter(
|
|
2000
|
-
(item) => !item.disabled
|
|
2001
|
-
);
|
|
2002
|
-
}
|
|
2003
|
-
get _trigger() {
|
|
2004
|
-
const slot = this.shadowRoot?.querySelector('slot[name="trigger"]');
|
|
2005
|
-
return slot?.assignedElements()[0] ?? null;
|
|
2006
|
-
}
|
|
2007
|
-
_open() {
|
|
2008
|
-
if (this.open) return;
|
|
2009
|
-
this.open = true;
|
|
2010
|
-
this.dispatchEvent(new CustomEvent("bds-open", { bubbles: true, composed: true }));
|
|
2011
|
-
this.updateComplete.then(() => {
|
|
2012
|
-
this._items[0]?.shadowRoot?.querySelector("button")?.focus();
|
|
2013
|
-
});
|
|
2014
|
-
}
|
|
2015
|
-
_close() {
|
|
2016
|
-
if (!this.open) return;
|
|
2017
|
-
this.open = false;
|
|
2018
|
-
this.dispatchEvent(new CustomEvent("bds-close", { bubbles: true, composed: true }));
|
|
2019
|
-
this._trigger?.focus();
|
|
2020
|
-
}
|
|
2021
|
-
_handleTriggerClick = (e) => {
|
|
2022
|
-
e.stopPropagation();
|
|
2023
|
-
if (this.open) {
|
|
2024
|
-
this._close();
|
|
2025
|
-
} else {
|
|
2026
|
-
this._open();
|
|
2027
|
-
}
|
|
2028
|
-
};
|
|
2029
|
-
_handleOutsideClick = (e) => {
|
|
2030
|
-
if (this.open && !this.contains(e.target)) {
|
|
2031
|
-
this._close();
|
|
2032
|
-
}
|
|
2033
|
-
};
|
|
2034
|
-
_handleKeydown = (e) => {
|
|
2035
|
-
if (!this.open) return;
|
|
2036
|
-
const items = this._items;
|
|
2037
|
-
const focused = items.findIndex(
|
|
2038
|
-
(item) => item.shadowRoot?.activeElement !== null && item.shadowRoot?.querySelector("button") === item.shadowRoot?.activeElement
|
|
2039
|
-
);
|
|
2040
|
-
if (e.key === "Escape") {
|
|
2041
|
-
e.preventDefault();
|
|
2042
|
-
this._close();
|
|
2043
|
-
} else if (e.key === "ArrowDown") {
|
|
2044
|
-
e.preventDefault();
|
|
2045
|
-
const next = (focused + 1) % items.length;
|
|
2046
|
-
items[next]?.shadowRoot?.querySelector("button")?.focus();
|
|
2047
|
-
} else if (e.key === "ArrowUp") {
|
|
2048
|
-
e.preventDefault();
|
|
2049
|
-
const prev = (focused - 1 + items.length) % items.length;
|
|
2050
|
-
items[prev]?.shadowRoot?.querySelector("button")?.focus();
|
|
2051
|
-
} else if (e.key === "Tab") {
|
|
2052
|
-
this._close();
|
|
2053
|
-
}
|
|
2054
|
-
};
|
|
2055
|
-
_handleItemSelect = () => {
|
|
2056
|
-
this._close();
|
|
2057
|
-
};
|
|
2058
|
-
_onTriggerSlotChange() {
|
|
2059
|
-
const trigger = this._trigger;
|
|
2060
|
-
if (trigger) {
|
|
2061
|
-
trigger.removeEventListener("click", this._handleTriggerClick);
|
|
2062
|
-
trigger.addEventListener("click", this._handleTriggerClick);
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
render() {
|
|
2066
|
-
return T`
|
|
2067
|
-
<slot name="trigger" @slotchange=${this._onTriggerSlotChange}></slot>
|
|
2068
|
-
<div
|
|
2069
|
-
class="panel"
|
|
2070
|
-
role="menu"
|
|
2071
|
-
aria-hidden=${!this.open ? "true" : "false"}
|
|
2072
|
-
>
|
|
2073
|
-
<slot></slot>
|
|
2074
|
-
</div>
|
|
2075
|
-
`;
|
|
2076
|
-
}
|
|
2077
|
-
};
|
|
2078
|
-
customElements.define("bds-dropdown-menu", BdsDropdownMenu);
|
|
2079
|
-
|
|
2080
|
-
// src/web-components/interaction/bds-dropdown-menu-item.ts
|
|
2081
|
-
var BdsDropdownMenuItem = class extends i2 {
|
|
2082
|
-
static styles = i`
|
|
2083
|
-
:host {
|
|
2084
|
-
display: block;
|
|
2085
|
-
}
|
|
2086
|
-
|
|
2087
|
-
:host([disabled]) {
|
|
2088
|
-
opacity: 0.5;
|
|
2089
|
-
pointer-events: none;
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
.item {
|
|
2093
|
-
display: flex;
|
|
2094
|
-
align-items: center;
|
|
2095
|
-
gap: var(--bds-space_xs);
|
|
2096
|
-
inline-size: 100%;
|
|
2097
|
-
padding: var(--bds-space_xs) var(--bds-space_s);
|
|
2098
|
-
font-size: var(--bds-font_size--body);
|
|
2099
|
-
font-family: var(--bds-font_family--body);
|
|
2100
|
-
color: var(--bds-color_on-bg);
|
|
2101
|
-
background: none;
|
|
2102
|
-
border: none;
|
|
2103
|
-
text-align: start;
|
|
2104
|
-
cursor: pointer;
|
|
2105
|
-
border-radius: var(--bds-border_radius--xs);
|
|
2106
|
-
transition: var(--bds-animation_transition);
|
|
2107
|
-
}
|
|
2108
|
-
|
|
2109
|
-
:host([destructive]) .item {
|
|
2110
|
-
color: var(--bds-color_error);
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
|
-
@media (hover: hover) and (pointer: fine) {
|
|
2114
|
-
.item:hover {
|
|
2115
|
-
background-color: var(--bds-color_bg--subtle);
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
:host([destructive]) .item:hover {
|
|
2119
|
-
background-color: color-mix(in srgb, var(--bds-color_error) 10%, transparent);
|
|
2120
|
-
}
|
|
2121
|
-
}
|
|
2122
|
-
|
|
2123
|
-
.item:focus-visible {
|
|
2124
|
-
outline: var(--bds-outline_default);
|
|
2125
|
-
outline-offset: var(--bds-outline_offset);
|
|
2126
|
-
}
|
|
2127
|
-
`;
|
|
2128
|
-
static properties = {
|
|
2129
|
-
value: { type: String, reflect: true },
|
|
2130
|
-
disabled: { type: Boolean, reflect: true },
|
|
2131
|
-
destructive: { type: Boolean, reflect: true }
|
|
2132
|
-
};
|
|
2133
|
-
constructor() {
|
|
2134
|
-
super();
|
|
2135
|
-
this.value = "";
|
|
2136
|
-
this.disabled = false;
|
|
2137
|
-
this.destructive = false;
|
|
2138
|
-
}
|
|
2139
|
-
_handleClick() {
|
|
2140
|
-
if (this.disabled) return;
|
|
2141
|
-
this.dispatchEvent(new CustomEvent("bds-select", {
|
|
2142
|
-
detail: { value: this.value },
|
|
2143
|
-
bubbles: true,
|
|
2144
|
-
composed: true
|
|
2145
|
-
}));
|
|
2146
|
-
}
|
|
2147
|
-
_handleKeydown(e) {
|
|
2148
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
2149
|
-
e.preventDefault();
|
|
2150
|
-
this._handleClick();
|
|
2151
|
-
}
|
|
2152
|
-
}
|
|
2153
|
-
render() {
|
|
2154
|
-
return T`
|
|
2155
|
-
<button
|
|
2156
|
-
class="item"
|
|
2157
|
-
type="button"
|
|
2158
|
-
role="menuitem"
|
|
2159
|
-
tabindex=${this.disabled ? "-1" : "0"}
|
|
2160
|
-
?disabled=${this.disabled}
|
|
2161
|
-
@click=${this._handleClick}
|
|
2162
|
-
@keydown=${this._handleKeydown}
|
|
2163
|
-
>
|
|
2164
|
-
<slot></slot>
|
|
2165
|
-
</button>
|
|
2166
|
-
`;
|
|
437
|
+
</div>`;
|
|
2167
438
|
}
|
|
2168
439
|
};
|
|
2169
|
-
customElements.define("bds-
|
|
440
|
+
customElements.define("bds-calendar-range", BdsCalendarRange);
|
|
2170
441
|
export {
|
|
2171
442
|
BdsAccordion,
|
|
2172
443
|
BdsAccordionItem,
|
|
@@ -2175,8 +446,10 @@ export {
|
|
|
2175
446
|
BdsBadge,
|
|
2176
447
|
BdsBreadcrumb,
|
|
2177
448
|
BdsButton,
|
|
449
|
+
BdsButtonContainer,
|
|
2178
450
|
BdsButtonGroup,
|
|
2179
451
|
BdsCalendar,
|
|
452
|
+
BdsCalendarRange,
|
|
2180
453
|
BdsCard,
|
|
2181
454
|
BdsCarousel,
|
|
2182
455
|
BdsCheckbox,
|