@telesign/boreal-web-components 0.1.0-alpha.3 → 0.1.0-alpha.5
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/components-build/bds-avatar.d.ts +11 -0
- package/components-build/bds-avatar.js +1 -0
- package/components-build/bds-badge.d.ts +11 -0
- package/components-build/bds-badge.js +1 -0
- package/components-build/bds-banner.js +1 -1
- package/components-build/bds-button-group.d.ts +11 -0
- package/components-build/bds-button-group.js +1 -0
- package/components-build/bds-button.js +1 -1
- package/components-build/bds-checkbox-card.d.ts +11 -0
- package/components-build/bds-checkbox-card.js +1 -0
- package/components-build/bds-checkbox.js +1 -1
- package/components-build/bds-dialog.js +1 -1
- package/components-build/bds-divider.d.ts +11 -0
- package/components-build/bds-divider.js +1 -0
- package/components-build/bds-flag.js +1 -1
- package/components-build/bds-grid-item.d.ts +11 -0
- package/components-build/bds-grid-item.js +1 -0
- package/components-build/bds-grid.d.ts +11 -0
- package/components-build/bds-grid.js +1 -0
- package/components-build/bds-list-menu-item.d.ts +11 -0
- package/components-build/bds-list-menu-item.js +1 -0
- package/components-build/bds-list-menu.d.ts +11 -0
- package/components-build/bds-list-menu.js +1 -0
- package/components-build/bds-popover.js +1 -1
- package/components-build/bds-radio-button.d.ts +11 -0
- package/components-build/bds-radio-button.js +1 -0
- package/components-build/bds-radio-card.d.ts +11 -0
- package/components-build/bds-radio-card.js +1 -0
- package/components-build/bds-radio-group.d.ts +11 -0
- package/components-build/bds-radio-group.js +1 -0
- package/components-build/bds-radio.d.ts +11 -0
- package/components-build/bds-radio.js +1 -0
- package/components-build/bds-spinner.js +1 -1
- package/components-build/bds-status.d.ts +11 -0
- package/components-build/bds-status.js +1 -0
- package/components-build/bds-tag.d.ts +11 -0
- package/components-build/bds-tag.js +1 -0
- package/components-build/bds-text-field.js +1 -1
- package/components-build/bds-toggle.d.ts +11 -0
- package/components-build/bds-toggle.js +1 -0
- package/components-build/bds-tooltip.js +1 -1
- package/components-build/bds-typography.js +1 -1
- package/components-build/index.js +1 -1
- package/components-build/p-BSlaf0ff.js +1 -0
- package/components-build/p-Bfazyxqi.js +1 -0
- package/components-build/p-CPvuMm5C.js +1 -0
- package/components-build/p-Cbibqaz0.js +1 -0
- package/components-build/p-ClR-wgiT.js +1 -0
- package/components-build/p-DfaYciGa.js +1 -0
- package/components-build/p-Dh8DSJs_.js +1 -0
- package/components-build/p-DhSchGPI.js +1 -0
- package/components-build/p-N_tqtRV2.js +1 -0
- package/components-build/p-bAMuJ4Jx.js +1 -0
- package/components-build/p-c2z3tneT.js +1 -0
- package/components-build/p-dz9-Q2N8.js +1 -0
- package/components-build/{p-CaHOghy5.js → p-fUK0GCeC.js} +1 -1
- package/components-build/p-iq2UuV7c.js +1 -0
- package/components-build/p-kGnB15Lz.js +1 -0
- package/components-build/p-nxYzL9uu.js +1 -0
- package/custom-elements.json +4611 -891
- package/dist/boreal-web-components/boreal-web-components.esm.js +1 -1
- package/dist/boreal-web-components/boreal-web-components.js +1 -1
- package/dist/boreal-web-components/css/boreal.css +1066 -1074
- package/dist/boreal-web-components/css/global.css +403 -407
- package/dist/boreal-web-components/css/theme-connect.css +163 -164
- package/dist/boreal-web-components/css/theme-engage.css +163 -164
- package/dist/boreal-web-components/css/theme-protect.css +163 -164
- package/dist/boreal-web-components/css/theme-proximus.css +164 -165
- package/dist/boreal-web-components/p-024d90b0.system.entry.js +1 -0
- package/dist/boreal-web-components/p-06DrzEMB.system.js +1 -0
- package/dist/boreal-web-components/p-11e4c0ec.system.entry.js +1 -0
- package/dist/boreal-web-components/p-147d6652.system.entry.js +1 -0
- package/dist/boreal-web-components/p-148d510f.entry.js +1 -0
- package/dist/boreal-web-components/p-19f9352d.entry.js +1 -0
- package/dist/boreal-web-components/p-277f142e.system.entry.js +1 -0
- package/dist/boreal-web-components/{p-8c57e06a.entry.js → p-2adf2cd5.entry.js} +1 -1
- package/dist/boreal-web-components/p-2be4aa3a.system.entry.js +1 -0
- package/dist/boreal-web-components/p-340896b2.entry.js +1 -0
- package/dist/boreal-web-components/p-365e8e5c.system.entry.js +1 -0
- package/dist/boreal-web-components/p-3d4ce8eb.system.entry.js +1 -0
- package/dist/boreal-web-components/p-44a8fde5.entry.js +1 -0
- package/dist/boreal-web-components/{p-efe57901.system.entry.js → p-48ebbfbe.system.entry.js} +1 -1
- package/dist/boreal-web-components/{p-5fa53a80.system.entry.js → p-4dc01078.system.entry.js} +1 -1
- package/dist/boreal-web-components/p-5681b294.system.entry.js +1 -0
- package/dist/boreal-web-components/p-5ed75075.entry.js +1 -0
- package/dist/boreal-web-components/p-635f676b.system.entry.js +1 -0
- package/dist/boreal-web-components/p-6629be14.entry.js +1 -0
- package/dist/boreal-web-components/p-68b83680.system.entry.js +1 -0
- package/dist/boreal-web-components/p-6a60d134.system.entry.js +1 -0
- package/dist/boreal-web-components/p-71ed1e1d.entry.js +1 -0
- package/dist/boreal-web-components/p-732e98f1.system.entry.js +1 -0
- package/dist/boreal-web-components/p-77658a5b.system.entry.js +1 -0
- package/dist/boreal-web-components/p-7aff4c78.entry.js +1 -0
- package/dist/boreal-web-components/p-7bb88855.entry.js +1 -0
- package/dist/boreal-web-components/p-7d3a8f61.entry.js +1 -0
- package/dist/boreal-web-components/p-7e672cce.entry.js +1 -0
- package/dist/boreal-web-components/p-7ebc67c9.entry.js +1 -0
- package/dist/boreal-web-components/p-81401e2a.system.entry.js +1 -0
- package/dist/boreal-web-components/p-8289e506.entry.js +1 -0
- package/dist/boreal-web-components/p-82d15372.entry.js +1 -0
- package/dist/boreal-web-components/p-851c06f2.entry.js +1 -0
- package/dist/boreal-web-components/p-8a3716ec.entry.js +1 -0
- package/dist/boreal-web-components/p-8f4f8af0.system.entry.js +1 -0
- package/dist/boreal-web-components/p-93066db4.system.entry.js +1 -0
- package/dist/boreal-web-components/p-Bfazyxqi.js +1 -0
- package/dist/boreal-web-components/{p-D4EFsvs1.js → p-BqJlOB6b.js} +2 -2
- package/dist/boreal-web-components/p-BsZkk4oK.system.js +1 -0
- package/dist/boreal-web-components/p-C-g3hhl_.system.js +1 -0
- package/dist/boreal-web-components/p-C0P3gzq5.system.js +1 -0
- package/dist/boreal-web-components/p-C4HM8wQe.js +1 -0
- package/dist/boreal-web-components/p-CPvuMm5C.js +1 -0
- package/dist/boreal-web-components/p-CRMH6mfq.system.js +1 -0
- package/dist/boreal-web-components/p-CU_dRLdk.system.js +1 -0
- package/dist/boreal-web-components/p-CW4-dkCF.system.js +1 -0
- package/dist/boreal-web-components/p-CXz1RLGi.system.js +1 -0
- package/dist/boreal-web-components/p-DCKg5Cg_.system.js +2 -0
- package/dist/boreal-web-components/{p-BuxZeJbu.system.js → p-DSU8tkVw.system.js} +1 -1
- package/dist/boreal-web-components/p-DYlZcFrB.system.js +1 -0
- package/dist/boreal-web-components/p-DfaYciGa.js +1 -0
- package/dist/boreal-web-components/p-DhSchGPI.js +1 -0
- package/dist/boreal-web-components/p-DlVzZK7o.js +1 -0
- package/dist/boreal-web-components/p-DlYG-OVB.js +1 -0
- package/dist/boreal-web-components/p-DnIhjwCH.system.js +1 -0
- package/dist/boreal-web-components/p-DpnBDSUm.system.js +1 -0
- package/dist/boreal-web-components/p-Dwo1hcd9.js +1 -0
- package/dist/boreal-web-components/p-RhSdMyWk.system.js +1 -0
- package/dist/boreal-web-components/{p-CaHOghy5.js → p-U9yfbs7i.js} +1 -1
- package/dist/boreal-web-components/p-a73659ac.system.entry.js +1 -0
- package/dist/boreal-web-components/p-b2ad9535.system.entry.js +1 -0
- package/dist/boreal-web-components/p-d4c30d2b.entry.js +1 -0
- package/dist/boreal-web-components/p-db0c10b9.system.entry.js +1 -0
- package/dist/boreal-web-components/p-dc7d429c.entry.js +1 -0
- package/dist/boreal-web-components/p-dca16a3d.entry.js +1 -0
- package/dist/boreal-web-components/p-de846c43.system.entry.js +1 -0
- package/dist/boreal-web-components/p-df087e23.system.entry.js +1 -0
- package/dist/boreal-web-components/p-dfb4854e.entry.js +1 -0
- package/dist/boreal-web-components/p-dz9-Q2N8.js +1 -0
- package/dist/boreal-web-components/p-e09b4d14.system.entry.js +1 -0
- package/dist/boreal-web-components/p-e0a41cab.system.entry.js +1 -0
- package/dist/boreal-web-components/p-e55f2a8b.entry.js +1 -0
- package/dist/boreal-web-components/p-e7af1e1a.entry.js +1 -0
- package/dist/boreal-web-components/p-efe159aa.entry.js +1 -0
- package/dist/boreal-web-components/p-f65e9d0c.system.entry.js +1 -0
- package/dist/boreal-web-components/p-f792aa74.entry.js +1 -0
- package/dist/boreal-web-components/p-fb9a0e94.entry.js +1 -0
- package/dist/boreal-web-components/p-iq2UuV7c.js +1 -0
- package/dist/boreal-web-components/p-kGnB15Lz.js +1 -0
- package/dist/boreal-web-components/p-vzZJGcYF.system.js +1 -0
- package/dist/boreal-web-components/p-wREMI3WA.js +1 -0
- package/dist/boreal-web-components/scss/maps/_primitives.scss +404 -408
- package/dist/boreal-web-components/scss/maps/_theme-connect.scss +164 -165
- package/dist/boreal-web-components/scss/maps/_theme-engage.scss +164 -165
- package/dist/boreal-web-components/scss/maps/_theme-protect.scss +164 -165
- package/dist/boreal-web-components/scss/maps/_theme-proximus.scss +165 -166
- package/dist/boreal-web-components/scss/variables/_primitives.scss +404 -408
- package/dist/boreal-web-components/scss/variables/_theme-connect.scss +164 -165
- package/dist/boreal-web-components/scss/variables/_theme-engage.scss +164 -165
- package/dist/boreal-web-components/scss/variables/_theme-protect.scss +164 -165
- package/dist/boreal-web-components/scss/variables/_theme-proximus.scss +165 -166
- package/dist/cjs/BaseAttributes-DBBhKt7O.js +14 -0
- package/dist/cjs/Keys-rKl2za5q.js +18 -0
- package/dist/cjs/Logger-DnziItRH.js +51 -0
- package/dist/cjs/{attributes-wIHueigW.js → attributes-CgRFplrN.js} +3 -0
- package/dist/cjs/bds-avatar.cjs.entry.js +89 -0
- package/dist/cjs/bds-badge.cjs.entry.js +50 -0
- package/dist/cjs/bds-banner.cjs.entry.js +13 -6
- package/dist/cjs/bds-button-group.cjs.entry.js +95 -0
- package/dist/cjs/bds-button.cjs.entry.js +11 -17
- package/dist/cjs/bds-checkbox-card.cjs.entry.js +121 -0
- package/dist/cjs/bds-checkbox.cjs.entry.js +13 -6
- package/dist/cjs/bds-dialog.cjs.entry.js +8 -7
- package/dist/cjs/bds-divider.cjs.entry.js +46 -0
- package/dist/cjs/bds-flag.cjs.entry.js +3 -3
- package/dist/cjs/bds-grid-item.cjs.entry.js +93 -0
- package/dist/cjs/bds-grid.cjs.entry.js +37 -0
- package/dist/cjs/bds-list-menu-item.cjs.entry.js +493 -0
- package/dist/cjs/bds-list-menu.cjs.entry.js +199 -0
- package/dist/cjs/bds-popover.cjs.entry.js +19 -9
- package/dist/cjs/bds-radio-button.cjs.entry.js +60 -0
- package/dist/cjs/bds-radio-card.cjs.entry.js +76 -0
- package/dist/cjs/bds-radio-group.cjs.entry.js +285 -0
- package/dist/cjs/bds-radio.cjs.entry.js +60 -0
- package/dist/cjs/bds-spinner.cjs.entry.js +4 -4
- package/dist/cjs/bds-status.cjs.entry.js +59 -0
- package/dist/cjs/bds-tag.cjs.entry.js +140 -0
- package/dist/cjs/bds-text-field.cjs.entry.js +8 -17
- package/dist/cjs/bds-toggle.cjs.entry.js +187 -0
- package/dist/cjs/bds-tooltip_2.cjs.entry.js +321 -0
- package/dist/cjs/boreal-web-components.cjs.js +2 -2
- package/dist/cjs/coreColors-CQGojc0l.js +10 -0
- package/dist/cjs/{enum-DLblRCkQ.js → enum-DeTWfR0D.js} +3 -3
- package/dist/cjs/form-associated.mixin-BCR6bj29.js +33 -0
- package/dist/cjs/{anchored.mixin-CnIwkaUi.js → getOffset-k4ezB-eT.js} +45 -76
- package/dist/cjs/{index-BcSjvXJk.js → index-CwYIVC9N.js} +64 -0
- package/dist/cjs/{internals-X77qKxsK.js → internals-D8x7GMfR.js} +0 -31
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/menu-BxKaEajh.js +8 -0
- package/dist/cjs/orientation-DQAIleEJ.js +8 -0
- package/dist/cjs/{states-iIYiazaM.js → states-BweP5Vpu.js} +8 -0
- package/dist/cjs/validateProps-CJe9X5x8.js +42 -0
- package/dist/collection/collection-manifest.json +16 -0
- package/dist/collection/components/actions/bds-button/bds-button.css +19 -19
- package/dist/collection/components/actions/bds-button/bds-button.js +8 -8
- package/dist/collection/components/actions/bds-button/types/enum.js +3 -3
- package/dist/collection/components/actions/bds-button-group/bds-button-group.css +77 -0
- package/dist/collection/components/actions/bds-button-group/bds-button-group.js +245 -0
- package/dist/collection/components/actions/bds-button-group/types/IButtonGroup.js +1 -0
- package/dist/collection/components/actions/bds-list-menu/bds-list-menu/bds-list-menu.css +51 -0
- package/dist/collection/components/actions/bds-list-menu/bds-list-menu/bds-list-menu.js +400 -0
- package/dist/collection/components/actions/bds-list-menu/bds-list-menu/types/IListMenu.js +1 -0
- package/dist/collection/components/actions/bds-list-menu/bds-list-menu/types/enum.js +4 -0
- package/dist/collection/components/actions/bds-list-menu/bds-list-menu/types/types.js +1 -0
- package/dist/collection/components/actions/bds-list-menu/bds-list-menu-item/bds-list-menu-item.css +87 -0
- package/dist/collection/components/actions/bds-list-menu/bds-list-menu-item/bds-list-menu-item.js +482 -0
- package/dist/collection/components/actions/bds-list-menu/bds-list-menu-item/types/IListMenuItem.js +1 -0
- package/dist/collection/components/actions/bds-list-menu/bds-list-menu-item/types/enum.js +4 -0
- package/dist/collection/components/actions/bds-list-menu/bds-list-menu-item/types/types.js +1 -0
- package/dist/collection/components/actions/bds-toggle/bds-toggle.css +120 -0
- package/dist/collection/components/actions/bds-toggle/bds-toggle.js +544 -0
- package/dist/collection/components/actions/bds-toggle/types/IEventChange.js +1 -0
- package/dist/collection/components/actions/bds-toggle/types/IToggle.js +1 -0
- package/dist/collection/components/actions/bds-toggle/types/enum.js +4 -0
- package/dist/collection/components/actions/bds-toggle/types/index.js +4 -0
- package/dist/collection/components/actions/bds-toggle/types/types.js +1 -0
- package/dist/collection/components/feedback/bds-badge/bds-badge.css +76 -0
- package/dist/collection/components/feedback/bds-badge/bds-badge.js +120 -0
- package/dist/collection/components/feedback/bds-badge/types/IBadge.js +1 -0
- package/dist/collection/components/feedback/bds-badge/types/enum.js +5 -0
- package/dist/collection/components/feedback/bds-banner/bds-banner.css +1 -2
- package/dist/collection/components/feedback/bds-banner/bds-banner.js +30 -6
- package/dist/collection/components/feedback/bds-spinner/bds-spinner.css +7 -8
- package/dist/collection/components/feedback/bds-spinner/bds-spinner.js +1 -1
- package/dist/collection/components/feedback/bds-status/bds-status.css +101 -0
- package/dist/collection/components/feedback/bds-status/bds-status.js +122 -0
- package/dist/collection/components/feedback/bds-status/types/IStatus.js +1 -0
- package/dist/collection/components/feedback/bds-status/types/enum.js +5 -0
- package/dist/collection/components/feedback/bds-status/types/types.js +1 -0
- package/dist/collection/components/feedback/bds-tag/bds-tag.css +202 -0
- package/dist/collection/components/feedback/bds-tag/bds-tag.js +375 -0
- package/dist/collection/components/feedback/bds-tag/types/ITag.js +1 -0
- package/dist/collection/components/feedback/bds-tag/types/enum.js +10 -0
- package/dist/collection/components/feedback/bds-tag/types/index.js +3 -0
- package/dist/collection/components/feedback/bds-tag/types/types.js +1 -0
- package/dist/collection/components/forms/bds-checkbox/bds-checkbox.css +9 -8
- package/dist/collection/components/forms/bds-checkbox/bds-checkbox.js +7 -1
- package/dist/collection/components/forms/bds-checkbox-card/bds-checkbox-card.css +127 -0
- package/dist/collection/components/forms/bds-checkbox-card/bds-checkbox-card.js +397 -0
- package/dist/collection/components/forms/bds-checkbox-card/types/ICheckboxCard.js +1 -0
- package/dist/collection/components/forms/bds-flag/bds-flag.js +1 -1
- package/dist/collection/components/forms/bds-radio/bds-radio.css +121 -0
- package/dist/collection/components/forms/bds-radio/bds-radio.js +238 -0
- package/dist/collection/components/forms/bds-radio/types/IRadio.js +1 -0
- package/dist/collection/components/forms/bds-radio-button/bds-radio-button.css +109 -0
- package/dist/collection/components/forms/bds-radio-button/bds-radio-button.js +238 -0
- package/dist/collection/components/forms/bds-radio-button/types/IRadioButton.js +1 -0
- package/dist/collection/components/forms/bds-radio-card/bds-radio-card.css +156 -0
- package/dist/collection/components/forms/bds-radio-card/bds-radio-card.js +307 -0
- package/dist/collection/components/forms/bds-radio-card/types/IRadioCard.js +1 -0
- package/dist/collection/components/forms/bds-radio-group/bds-radio-group.css +55 -0
- package/dist/collection/components/forms/bds-radio-group/bds-radio-group.js +620 -0
- package/dist/collection/components/forms/bds-radio-group/types/IRadioGroup.js +1 -0
- package/dist/collection/components/forms/bds-radio-group/types/enum.js +5 -0
- package/dist/collection/components/forms/bds-radio-group/types/types.js +1 -0
- package/dist/collection/components/forms/bds-text-field/bds-text-field.js +1 -1
- package/dist/collection/components/helpers/bds-divider/bds-divider.css +44 -0
- package/dist/collection/components/helpers/bds-divider/bds-divider.js +88 -0
- package/dist/collection/components/helpers/bds-divider/types/IDivider.js +1 -0
- package/dist/collection/components/helpers/bds-divider/types/enum.js +4 -0
- package/dist/collection/components/helpers/bds-divider/types/types.js +1 -0
- package/dist/collection/components/images-icons/bds-avatar/bds-avatar.css +52 -0
- package/dist/collection/components/images-icons/bds-avatar/bds-avatar.js +219 -0
- package/dist/collection/components/images-icons/bds-avatar/types/IAvatar.js +1 -0
- package/dist/collection/components/images-icons/bds-avatar/types/enum.js +5 -0
- package/dist/collection/components/images-icons/bds-avatar/types/index.js +3 -0
- package/dist/collection/components/images-icons/bds-avatar/types/types.js +1 -0
- package/dist/collection/components/layouts/bds-grid/grid/bds-grid.css +57 -0
- package/dist/collection/components/layouts/bds-grid/grid/bds-grid.js +100 -0
- package/dist/collection/components/layouts/bds-grid/grid/types/IGrid.js +1 -0
- package/dist/collection/components/layouts/bds-grid/grid/types/enum.js +4 -0
- package/dist/collection/components/layouts/bds-grid/grid/types/index.js +3 -0
- package/dist/collection/components/layouts/bds-grid/grid/types/types.js +1 -0
- package/dist/collection/components/layouts/bds-grid/grid-item/bds-grid-item.css +70 -0
- package/dist/collection/components/layouts/bds-grid/grid-item/bds-grid-item.js +306 -0
- package/dist/collection/components/layouts/bds-grid/grid-item/types/IGridItem.js +1 -0
- package/dist/collection/components/layouts/bds-grid/grid-item/types/enum.js +10 -0
- package/dist/collection/components/layouts/bds-grid/grid-item/types/index.js +3 -0
- package/dist/collection/components/layouts/bds-grid/grid-item/types/types.js +1 -0
- package/dist/collection/components/overlays/bds-dialog/bds-dialog.js +4 -3
- package/dist/collection/components/overlays/bds-popover/bds-popover.css +16 -2
- package/dist/collection/components/overlays/bds-popover/bds-popover.js +12 -4
- package/dist/collection/components/overlays/bds-popover/constants/Offset.js +1 -0
- package/dist/collection/components/overlays/bds-tooltip/bds-tooltip.css +2 -13
- package/dist/collection/components/overlays/bds-tooltip/bds-tooltip.js +6 -4
- package/dist/collection/components/overlays/bds-tooltip/constants/Offset.js +1 -0
- package/dist/collection/components/titles-text/bds-typography/bds-typography.css +9 -0
- package/dist/collection/components/titles-text/bds-typography/bds-typography.js +20 -19
- package/dist/collection/components/titles-text/bds-typography/utils/bds-typography-utils.js +2 -2
- package/dist/collection/css/boreal.css +1066 -1074
- package/dist/collection/css/global.css +403 -407
- package/dist/collection/css/theme-connect.css +163 -164
- package/dist/collection/css/theme-engage.css +163 -164
- package/dist/collection/css/theme-protect.css +163 -164
- package/dist/collection/css/theme-proximus.css +164 -165
- package/dist/collection/mixins/anchored.mixin.js +16 -3
- package/dist/collection/mixins/index.js +2 -0
- package/dist/collection/mixins/links.mixin.js +152 -0
- package/dist/collection/mixins/menu-behavior.mixin.js +119 -0
- package/dist/collection/scss/maps/_primitives.scss +404 -408
- package/dist/collection/scss/maps/_theme-connect.scss +164 -165
- package/dist/collection/scss/maps/_theme-engage.scss +164 -165
- package/dist/collection/scss/maps/_theme-protect.scss +164 -165
- package/dist/collection/scss/maps/_theme-proximus.scss +165 -166
- package/dist/collection/scss/variables/_primitives.scss +404 -408
- package/dist/collection/scss/variables/_theme-connect.scss +164 -165
- package/dist/collection/scss/variables/_theme-engage.scss +164 -165
- package/dist/collection/scss/variables/_theme-protect.scss +164 -165
- package/dist/collection/scss/variables/_theme-proximus.scss +165 -166
- package/dist/collection/services/floating/positioning.service.js +1 -1
- package/dist/collection/types/IFormProps.js +1 -0
- package/dist/collection/types/index.js +5 -0
- package/dist/collection/types/links.js +1 -0
- package/dist/collection/types/menu.js +8 -0
- package/dist/collection/types/orientation.js +4 -0
- package/dist/collection/types/position.js +6 -2
- package/dist/collection/utils/constants/common/Keys.js +10 -12
- package/dist/collection/utils/helpers/overlays/getOffset.js +13 -0
- package/dist/collection/utils/helpers/validateProps.js +21 -0
- package/dist/collection/utils/index.js +2 -1
- package/dist/collection/utils/menu/index.js +1 -0
- package/dist/collection/utils/menu/menu-item.utils.js +82 -0
- package/dist/collection/utils/{__test__ → testing}/helpers.js +10 -0
- package/dist/collection/utils/{__test__ → testing}/index.js +0 -2
- package/dist/collection/utils/testing/mocks/console.js +30 -0
- package/dist/collection/utils/testing/mocks/index.js +4 -0
- package/dist/css/boreal.css +1066 -1074
- package/dist/css/global.css +403 -407
- package/dist/css/theme-connect.css +163 -164
- package/dist/css/theme-engage.css +163 -164
- package/dist/css/theme-protect.css +163 -164
- package/dist/css/theme-proximus.css +164 -165
- package/dist/esm/BaseAttributes-DhSchGPI.js +12 -0
- package/dist/esm/Keys-DlYG-OVB.js +16 -0
- package/dist/esm/Logger-iq2UuV7c.js +49 -0
- package/dist/esm/{attributes-CaHOghy5.js → attributes-U9yfbs7i.js} +3 -0
- package/dist/esm/bds-avatar.entry.js +87 -0
- package/dist/esm/bds-badge.entry.js +48 -0
- package/dist/esm/bds-banner.entry.js +13 -6
- package/dist/esm/bds-button-group.entry.js +93 -0
- package/dist/esm/bds-button.entry.js +9 -15
- package/dist/esm/bds-checkbox-card.entry.js +119 -0
- package/dist/esm/bds-checkbox.entry.js +12 -5
- package/dist/esm/bds-dialog.entry.js +8 -7
- package/dist/esm/bds-divider.entry.js +44 -0
- package/dist/esm/bds-flag.entry.js +3 -3
- package/dist/esm/bds-grid-item.entry.js +91 -0
- package/dist/esm/bds-grid.entry.js +35 -0
- package/dist/esm/bds-list-menu-item.entry.js +491 -0
- package/dist/esm/bds-list-menu.entry.js +197 -0
- package/dist/esm/bds-popover.entry.js +18 -8
- package/dist/esm/bds-radio-button.entry.js +58 -0
- package/dist/esm/bds-radio-card.entry.js +74 -0
- package/dist/esm/bds-radio-group.entry.js +283 -0
- package/dist/esm/bds-radio.entry.js +58 -0
- package/dist/esm/bds-spinner.entry.js +4 -4
- package/dist/esm/bds-status.entry.js +57 -0
- package/dist/esm/bds-tag.entry.js +138 -0
- package/dist/esm/bds-text-field.entry.js +6 -15
- package/dist/esm/bds-toggle.entry.js +185 -0
- package/dist/esm/bds-tooltip_2.entry.js +318 -0
- package/dist/esm/boreal-web-components.js +3 -3
- package/dist/esm/coreColors-Dwo1hcd9.js +8 -0
- package/dist/esm/{enum-C8mRvnTA.js → enum-DlVzZK7o.js} +4 -4
- package/dist/esm/form-associated.mixin-C4HM8wQe.js +31 -0
- package/dist/esm/{anchored.mixin-Y3MkGc2X.js → getOffset-BYS3c13B.js} +43 -75
- package/dist/esm/{index-D4EFsvs1.js → index-BqJlOB6b.js} +64 -0
- package/dist/esm/{internals-Dy7QKP9e.js → internals-DfaYciGa.js} +1 -31
- package/dist/esm/loader.js +3 -3
- package/dist/esm/menu-dz9-Q2N8.js +6 -0
- package/dist/esm/orientation-CPvuMm5C.js +6 -0
- package/dist/esm/{states-BhTPNsBb.js → states-Bfazyxqi.js} +8 -1
- package/dist/esm/validateProps-kGnB15Lz.js +39 -0
- package/dist/esm-es5/BaseAttributes-DhSchGPI.js +1 -0
- package/dist/esm-es5/Keys-DlYG-OVB.js +1 -0
- package/dist/esm-es5/Logger-iq2UuV7c.js +1 -0
- package/dist/esm-es5/{attributes-CaHOghy5.js → attributes-U9yfbs7i.js} +1 -1
- package/dist/esm-es5/bds-avatar.entry.js +1 -0
- package/dist/esm-es5/bds-badge.entry.js +1 -0
- package/dist/esm-es5/bds-banner.entry.js +1 -1
- package/dist/esm-es5/bds-button-group.entry.js +1 -0
- package/dist/esm-es5/bds-button.entry.js +1 -1
- package/dist/esm-es5/bds-checkbox-card.entry.js +1 -0
- package/dist/esm-es5/bds-checkbox.entry.js +1 -1
- package/dist/esm-es5/bds-dialog.entry.js +1 -1
- package/dist/esm-es5/bds-divider.entry.js +1 -0
- package/dist/esm-es5/bds-flag.entry.js +1 -1
- package/dist/esm-es5/bds-grid-item.entry.js +1 -0
- package/dist/esm-es5/bds-grid.entry.js +1 -0
- package/dist/esm-es5/bds-list-menu-item.entry.js +1 -0
- package/dist/esm-es5/bds-list-menu.entry.js +1 -0
- package/dist/esm-es5/bds-popover.entry.js +1 -1
- package/dist/esm-es5/bds-radio-button.entry.js +1 -0
- package/dist/esm-es5/bds-radio-card.entry.js +1 -0
- package/dist/esm-es5/bds-radio-group.entry.js +1 -0
- package/dist/esm-es5/bds-radio.entry.js +1 -0
- package/dist/esm-es5/bds-spinner.entry.js +1 -1
- package/dist/esm-es5/bds-status.entry.js +1 -0
- package/dist/esm-es5/bds-tag.entry.js +1 -0
- package/dist/esm-es5/bds-text-field.entry.js +1 -1
- package/dist/esm-es5/bds-toggle.entry.js +1 -0
- package/dist/esm-es5/bds-tooltip_2.entry.js +1 -0
- package/dist/esm-es5/boreal-web-components.js +1 -1
- package/dist/esm-es5/coreColors-Dwo1hcd9.js +1 -0
- package/dist/esm-es5/enum-DlVzZK7o.js +1 -0
- package/dist/esm-es5/form-associated.mixin-C4HM8wQe.js +1 -0
- package/dist/esm-es5/getOffset-BYS3c13B.js +1 -0
- package/dist/esm-es5/index-BqJlOB6b.js +2 -0
- package/dist/esm-es5/internals-DfaYciGa.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/menu-dz9-Q2N8.js +1 -0
- package/dist/esm-es5/orientation-CPvuMm5C.js +1 -0
- package/dist/esm-es5/states-Bfazyxqi.js +1 -0
- package/dist/esm-es5/validateProps-kGnB15Lz.js +1 -0
- package/dist/scss/maps/_primitives.scss +404 -408
- package/dist/scss/maps/_theme-connect.scss +164 -165
- package/dist/scss/maps/_theme-engage.scss +164 -165
- package/dist/scss/maps/_theme-protect.scss +164 -165
- package/dist/scss/maps/_theme-proximus.scss +165 -166
- package/dist/scss/variables/_primitives.scss +404 -408
- package/dist/scss/variables/_theme-connect.scss +164 -165
- package/dist/scss/variables/_theme-engage.scss +164 -165
- package/dist/scss/variables/_theme-protect.scss +164 -165
- package/dist/scss/variables/_theme-proximus.scss +165 -166
- package/dist/types/components/actions/bds-button/bds-button.d.ts +4 -4
- package/dist/types/components/actions/bds-button/types/enum.d.ts +3 -3
- package/dist/types/components/actions/bds-button-group/bds-button-group.d.ts +36 -0
- package/dist/types/components/actions/bds-button-group/types/IButtonGroup.d.ts +11 -0
- package/dist/types/components/actions/bds-list-menu/bds-list-menu/bds-list-menu.d.ts +74 -0
- package/dist/types/components/actions/bds-list-menu/bds-list-menu/types/IListMenu.d.ts +14 -0
- package/dist/types/components/actions/bds-list-menu/bds-list-menu/types/enum.d.ts +5 -0
- package/dist/types/components/actions/bds-list-menu/bds-list-menu/types/types.d.ts +3 -0
- package/dist/types/components/actions/bds-list-menu/bds-list-menu-item/bds-list-menu-item.d.ts +122 -0
- package/dist/types/components/actions/bds-list-menu/bds-list-menu-item/types/IListMenuItem.d.ts +13 -0
- package/dist/types/components/actions/bds-list-menu/bds-list-menu-item/types/enum.d.ts +5 -0
- package/dist/types/components/actions/bds-list-menu/bds-list-menu-item/types/types.d.ts +3 -0
- package/dist/types/components/actions/bds-toggle/bds-toggle.d.ts +91 -0
- package/dist/types/components/actions/bds-toggle/types/IEventChange.d.ts +5 -0
- package/dist/types/components/actions/bds-toggle/types/IToggle.d.ts +12 -0
- package/dist/types/components/actions/bds-toggle/types/enum.d.ts +5 -0
- package/dist/types/components/actions/bds-toggle/types/index.d.ts +5 -0
- package/dist/types/components/actions/bds-toggle/types/types.d.ts +3 -0
- package/dist/types/components/feedback/bds-badge/bds-badge.d.ts +31 -0
- package/dist/types/components/feedback/bds-badge/types/IBadge.d.ts +6 -0
- package/dist/types/components/feedback/bds-badge/types/enum.d.ts +9 -0
- package/dist/types/components/feedback/bds-banner/bds-banner.d.ts +8 -4
- package/dist/types/components/feedback/bds-status/bds-status.d.ts +26 -0
- package/dist/types/components/feedback/bds-status/types/IStatus.d.ts +7 -0
- package/dist/types/components/feedback/bds-status/types/enum.d.ts +6 -0
- package/dist/types/components/feedback/bds-status/types/types.d.ts +3 -0
- package/dist/types/components/feedback/bds-tag/bds-tag.d.ts +71 -0
- package/dist/types/components/feedback/bds-tag/types/ITag.d.ts +13 -0
- package/dist/types/components/feedback/bds-tag/types/enum.d.ts +11 -0
- package/dist/types/components/feedback/bds-tag/types/index.d.ts +4 -0
- package/dist/types/components/feedback/bds-tag/types/types.d.ts +8 -0
- package/dist/types/components/forms/bds-checkbox/bds-checkbox.d.ts +2 -0
- package/dist/types/components/forms/bds-checkbox-card/bds-checkbox-card.d.ts +70 -0
- package/dist/types/components/forms/bds-checkbox-card/types/ICheckboxCard.d.ts +8 -0
- package/dist/types/components/forms/bds-flag/bds-flag.d.ts +3 -4
- package/dist/types/components/forms/bds-radio/bds-radio.d.ts +36 -0
- package/dist/types/components/forms/bds-radio/types/IRadio.d.ts +13 -0
- package/dist/types/components/forms/bds-radio-button/bds-radio-button.d.ts +36 -0
- package/dist/types/components/forms/bds-radio-button/types/IRadioButton.d.ts +13 -0
- package/dist/types/components/forms/bds-radio-card/bds-radio-card.d.ts +57 -0
- package/dist/types/components/forms/bds-radio-card/types/IRadioCard.d.ts +14 -0
- package/dist/types/components/forms/bds-radio-group/bds-radio-group.d.ts +82 -0
- package/dist/types/components/forms/bds-radio-group/types/IRadioGroup.d.ts +19 -0
- package/dist/types/components/forms/bds-radio-group/types/enum.d.ts +6 -0
- package/dist/types/components/forms/bds-radio-group/types/types.d.ts +3 -0
- package/dist/types/components/helpers/bds-divider/bds-divider.d.ts +26 -0
- package/dist/types/components/helpers/bds-divider/types/IDivider.d.ts +5 -0
- package/dist/types/components/helpers/bds-divider/types/enum.d.ts +5 -0
- package/dist/types/components/helpers/bds-divider/types/types.d.ts +3 -0
- package/dist/types/components/images-icons/bds-avatar/bds-avatar.d.ts +51 -0
- package/dist/types/components/images-icons/bds-avatar/types/IAvatar.d.ts +9 -0
- package/dist/types/components/images-icons/bds-avatar/types/enum.d.ts +6 -0
- package/dist/types/components/images-icons/bds-avatar/types/index.d.ts +4 -0
- package/dist/types/components/images-icons/bds-avatar/types/types.d.ts +3 -0
- package/dist/types/components/layouts/bds-grid/grid/bds-grid.d.ts +19 -0
- package/dist/types/components/layouts/bds-grid/grid/types/IGrid.d.ts +6 -0
- package/dist/types/components/layouts/bds-grid/grid/types/enum.d.ts +5 -0
- package/dist/types/components/layouts/bds-grid/grid/types/index.d.ts +4 -0
- package/dist/types/components/layouts/bds-grid/grid/types/types.d.ts +3 -0
- package/dist/types/components/layouts/bds-grid/grid-item/bds-grid-item.d.ts +31 -0
- package/dist/types/components/layouts/bds-grid/grid-item/types/IGridItem.d.ts +12 -0
- package/dist/types/components/layouts/bds-grid/grid-item/types/enum.d.ts +11 -0
- package/dist/types/components/layouts/bds-grid/grid-item/types/index.d.ts +4 -0
- package/dist/types/components/layouts/bds-grid/grid-item/types/types.d.ts +3 -0
- package/dist/types/components/overlays/bds-dialog/bds-dialog.d.ts +2 -2
- package/dist/types/components/overlays/bds-popover/bds-popover.d.ts +1 -0
- package/dist/types/components/overlays/bds-popover/constants/Offset.d.ts +2 -0
- package/dist/types/components/overlays/bds-tooltip/bds-tooltip.d.ts +1 -0
- package/dist/types/components/overlays/bds-tooltip/constants/Offset.d.ts +2 -0
- package/dist/types/components/titles-text/bds-typography/bds-typography.d.ts +9 -9
- package/dist/types/components/titles-text/bds-typography/types/ITypography.d.ts +2 -2
- package/dist/types/components/titles-text/bds-typography/utils/bds-typography-utils.d.ts +1 -1
- package/dist/types/components.d.ts +2542 -450
- package/dist/types/mixins/anchored.mixin.d.ts +5 -0
- package/dist/types/mixins/index.d.ts +2 -0
- package/dist/types/mixins/links.mixin.d.ts +85 -0
- package/dist/types/mixins/menu-behavior.mixin.d.ts +95 -0
- package/dist/types/types/IFormProps.d.ts +25 -0
- package/dist/types/types/index.d.ts +5 -0
- package/dist/types/types/links.d.ts +14 -0
- package/dist/types/types/menu.d.ts +16 -0
- package/dist/types/types/orientation.d.ts +6 -0
- package/dist/types/types/position.d.ts +6 -2
- package/dist/types/utils/constants/common/Keys.d.ts +12 -14
- package/dist/types/utils/helpers/overlays/getOffset.d.ts +9 -0
- package/dist/types/utils/helpers/validateProps.d.ts +11 -0
- package/dist/types/utils/index.d.ts +2 -1
- package/dist/types/utils/menu/index.d.ts +2 -0
- package/dist/types/utils/menu/menu-item.utils.d.ts +50 -0
- package/dist/types/utils/{__test__ → testing}/helpers.d.ts +8 -0
- package/dist/types/utils/{__test__ → testing}/index.d.ts +0 -2
- package/dist/types/utils/{__test__/backdrop-mock.d.ts → testing/mocks/backdrop.d.ts} +1 -1
- package/dist/types/utils/testing/mocks/console.d.ts +17 -0
- package/dist/types/utils/{__test__/mocks/ElementInternals.d.ts → testing/mocks/elementInternals.d.ts} +1 -1
- package/dist/types/utils/testing/mocks/index.d.ts +5 -0
- package/dist/types/utils/{__test__/popover-mock.d.ts → testing/mocks/popover.d.ts} +1 -1
- package/package.json +1 -1
- package/components-build/p-B6R9EVXK.js +0 -1
- package/components-build/p-BSpJ_e9f.js +0 -1
- package/components-build/p-BYEAJCas.js +0 -1
- package/components-build/p-BhTPNsBb.js +0 -1
- package/components-build/p-CYojP4vI.js +0 -1
- package/components-build/p-D5omSME4.js +0 -1
- package/components-build/p-vfAIdwy0.js +0 -1
- package/dist/boreal-web-components/p-07a933df.entry.js +0 -1
- package/dist/boreal-web-components/p-1bb2b33f.entry.js +0 -1
- package/dist/boreal-web-components/p-1fccea3f.system.entry.js +0 -1
- package/dist/boreal-web-components/p-20af732b.system.entry.js +0 -1
- package/dist/boreal-web-components/p-22378341.system.entry.js +0 -1
- package/dist/boreal-web-components/p-39c26e58.entry.js +0 -1
- package/dist/boreal-web-components/p-6210d025.entry.js +0 -1
- package/dist/boreal-web-components/p-6de2b44c.system.entry.js +0 -1
- package/dist/boreal-web-components/p-91b9e94e.entry.js +0 -1
- package/dist/boreal-web-components/p-9e06910d.system.entry.js +0 -1
- package/dist/boreal-web-components/p-BIJhHSAt.system.js +0 -1
- package/dist/boreal-web-components/p-BKRyWlfr.js +0 -1
- package/dist/boreal-web-components/p-BhTPNsBb.js +0 -1
- package/dist/boreal-web-components/p-BkDQsB4R.system.js +0 -1
- package/dist/boreal-web-components/p-C8mRvnTA.js +0 -1
- package/dist/boreal-web-components/p-CdKFZYxk.system.js +0 -1
- package/dist/boreal-web-components/p-DoDeP7KR.system.js +0 -1
- package/dist/boreal-web-components/p-Dtp4O0H2.system.js +0 -1
- package/dist/boreal-web-components/p-Dy7QKP9e.js +0 -1
- package/dist/boreal-web-components/p-GjKJvOVG.system.js +0 -2
- package/dist/boreal-web-components/p-ac64d4a5.system.entry.js +0 -1
- package/dist/boreal-web-components/p-b61fe06c.entry.js +0 -1
- package/dist/boreal-web-components/p-cdc87437.entry.js +0 -1
- package/dist/boreal-web-components/p-d8ec8557.system.entry.js +0 -1
- package/dist/boreal-web-components/p-ea889727.entry.js +0 -1
- package/dist/boreal-web-components/p-fa327346.system.entry.js +0 -1
- package/dist/boreal-web-components/p-fc2cb919.entry.js +0 -1
- package/dist/boreal-web-components/p-sDZFaZMN.system.js +0 -1
- package/dist/boreal-web-components/p-vfAIdwy0.js +0 -1
- package/dist/cjs/bds-tooltip.cjs.entry.js +0 -152
- package/dist/cjs/bds-typography.cjs.entry.js +0 -168
- package/dist/cjs/validateProps-BNOBk1Xs.js +0 -20
- package/dist/collection/utils/__test__/mocks/index.js +0 -1
- package/dist/esm/bds-tooltip.entry.js +0 -150
- package/dist/esm/bds-typography.entry.js +0 -166
- package/dist/esm/validateProps-vfAIdwy0.js +0 -18
- package/dist/esm-es5/anchored.mixin-Y3MkGc2X.js +0 -1
- package/dist/esm-es5/bds-tooltip.entry.js +0 -1
- package/dist/esm-es5/bds-typography.entry.js +0 -1
- package/dist/esm-es5/enum-C8mRvnTA.js +0 -1
- package/dist/esm-es5/index-D4EFsvs1.js +0 -2
- package/dist/esm-es5/internals-Dy7QKP9e.js +0 -1
- package/dist/esm-es5/states-BhTPNsBb.js +0 -1
- package/dist/esm-es5/validateProps-vfAIdwy0.js +0 -1
- package/dist/types/utils/__test__/mocks/index.d.ts +0 -2
- /package/dist/collection/utils/{__test__ → testing}/constants.js +0 -0
- /package/dist/collection/utils/{__test__ → testing}/fixtures.js +0 -0
- /package/dist/collection/utils/{__test__/backdrop-mock.js → testing/mocks/backdrop.js} +0 -0
- /package/dist/collection/utils/{__test__/mocks/ElementInternals.js → testing/mocks/elementInternals.js} +0 -0
- /package/dist/collection/utils/{__test__/popover-mock.js → testing/mocks/popover.js} +0 -0
- /package/dist/types/utils/{__test__ → testing}/constants.d.ts +0 -0
- /package/dist/types/utils/{__test__ → testing}/fixtures.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var validateProps = require('./validateProps-
|
|
3
|
+
var index = require('./index-CwYIVC9N.js');
|
|
4
|
+
var validateProps = require('./validateProps-CJe9X5x8.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The identifier to be used to resolve the country code.
|
|
@@ -2931,7 +2931,7 @@ const BdsFlag = class {
|
|
|
2931
2931
|
const flagContentClass = this.flagContentClass;
|
|
2932
2932
|
const flagClass = this.flagClass;
|
|
2933
2933
|
const flagStyle = !this.isGlobal ? { backgroundImage: `url(${this.flagUrl(flag)})` } : {};
|
|
2934
|
-
return (index.h(index.Host, { key: '
|
|
2934
|
+
return (index.h(index.Host, { key: 'a8a3ef0fefd3e7b1d4c9fd40bf5ea82ce9000815', class: flagClass, "aria-label": countryName, role: "img" }, flag && index.h("span", { key: 'ea653c06af2a3c3341c95acd1750bdbbbd08f268', class: flagContentClass, style: flagStyle, "aria-hidden": "true" }), index.h("span", { key: '289fcc0f0d247f02b79493fd34aca190c985ed45', class: "bds-flag__country", "aria-hidden": "true" }, countryName)));
|
|
2935
2935
|
}
|
|
2936
2936
|
static get assetsDirs() { return ["./constants"]; }
|
|
2937
2937
|
get el() { return index.getElement(this); }
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CwYIVC9N.js');
|
|
4
|
+
var validateProps = require('./validateProps-CJe9X5x8.js');
|
|
5
|
+
|
|
6
|
+
const GRID_ITEM_COL_SPAN = {
|
|
7
|
+
SM_MAX: 4,
|
|
8
|
+
MD_MAX: 8,
|
|
9
|
+
LG_MAX: 12,
|
|
10
|
+
XL_MAX: 12,
|
|
11
|
+
XXL_MAX: 12,
|
|
12
|
+
DEFAULT: 12,
|
|
13
|
+
OFFSET_MIN: 0,
|
|
14
|
+
OFFSET_MAX: 11,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const bdsGridItemCss = () => `@charset "UTF-8";bds-grid-item{--_col-span:var(--_col-base, 12);grid-column-end:span var(--_col-span);grid-row-end:span var(--_row-base, 1)}bds-grid-item[col-span=full]{grid-column:1/-1}bds-grid-item[row-span=full]{grid-row:1/-1}@media (min-width: 320px){bds-grid-item{--_col-span:var(--_col-sm, var(--_col-base, 12))}bds-grid-item[col-span-sm=full]{grid-column:1/-1}}@media (min-width: 769px){bds-grid-item{--_col-span:var(--_col-md, var(--_col-sm, var(--_col-base, 12)))}bds-grid-item[col-span-md=full]{grid-column:1/-1}}@media (min-width: 960px){bds-grid-item{--_col-span:var(--_col-lg, var(--_col-md, var(--_col-sm, var(--_col-base, 12))))}bds-grid-item[col-span-lg=full]{grid-column:1/-1}}@media (min-width: 1152px){bds-grid-item{--_col-span:var(--_col-xl, var(--_col-lg, var(--_col-md, var(--_col-sm, var(--_col-base, 12)))))}bds-grid-item[col-span-xl=full]{grid-column:1/-1}}@media (min-width: 1344px){bds-grid-item{--_col-span:var(--_col-2xl, var(--_col-xl, var(--_col-lg, var(--_col-md, var(--_col-sm, var(--_col-base, 12))))))}bds-grid-item[col-span-2xl=full]{grid-column:1/-1}}`;
|
|
18
|
+
|
|
19
|
+
const BdsGridItem = class {
|
|
20
|
+
constructor(hostRef) {
|
|
21
|
+
index.registerInstance(this, hostRef);
|
|
22
|
+
/** Column span at all breakpoints (fallback). `'full'` spans all columns (`grid-column: 1 / -1`). */
|
|
23
|
+
this.colSpan = GRID_ITEM_COL_SPAN.DEFAULT;
|
|
24
|
+
/** Column offset: shifts the item right by N columns (0–11). */
|
|
25
|
+
this.offset = 0;
|
|
26
|
+
}
|
|
27
|
+
checkPropValues() {
|
|
28
|
+
validateProps.validateNumericProp(1, GRID_ITEM_COL_SPAN.DEFAULT, this.el, 'colSpan');
|
|
29
|
+
validateProps.validateNumericProp(1, GRID_ITEM_COL_SPAN.SM_MAX, this.el, 'colSpanSm');
|
|
30
|
+
validateProps.validateNumericProp(1, GRID_ITEM_COL_SPAN.MD_MAX, this.el, 'colSpanMd');
|
|
31
|
+
validateProps.validateNumericProp(1, GRID_ITEM_COL_SPAN.LG_MAX, this.el, 'colSpanLg');
|
|
32
|
+
validateProps.validateNumericProp(1, GRID_ITEM_COL_SPAN.XL_MAX, this.el, 'colSpanXl');
|
|
33
|
+
validateProps.validateNumericProp(1, GRID_ITEM_COL_SPAN.XXL_MAX, this.el, 'colSpan2xl');
|
|
34
|
+
validateProps.validateNumericProp(1, undefined, this.el, 'rowSpan');
|
|
35
|
+
validateProps.validateNumericProp(GRID_ITEM_COL_SPAN.OFFSET_MIN, GRID_ITEM_COL_SPAN.OFFSET_MAX, this.el, 'offset');
|
|
36
|
+
}
|
|
37
|
+
componentWillLoad() {
|
|
38
|
+
this.checkPropValues();
|
|
39
|
+
}
|
|
40
|
+
getHostStyles() {
|
|
41
|
+
const styles = {};
|
|
42
|
+
if (this.colSpan !== 'full')
|
|
43
|
+
styles['--_col-base'] = String(this.colSpan);
|
|
44
|
+
if (this.colSpanSm !== undefined && this.colSpanSm !== 'full')
|
|
45
|
+
styles['--_col-sm'] = String(this.colSpanSm);
|
|
46
|
+
if (this.colSpanMd !== undefined && this.colSpanMd !== 'full')
|
|
47
|
+
styles['--_col-md'] = String(this.colSpanMd);
|
|
48
|
+
if (this.colSpanLg !== undefined && this.colSpanLg !== 'full')
|
|
49
|
+
styles['--_col-lg'] = String(this.colSpanLg);
|
|
50
|
+
if (this.colSpanXl !== undefined && this.colSpanXl !== 'full')
|
|
51
|
+
styles['--_col-xl'] = String(this.colSpanXl);
|
|
52
|
+
if (this.colSpan2xl !== undefined && this.colSpan2xl !== 'full')
|
|
53
|
+
styles['--_col-2xl'] = String(this.colSpan2xl);
|
|
54
|
+
if (this.rowSpan !== undefined && this.rowSpan !== 'full')
|
|
55
|
+
styles['--_row-base'] = String(this.rowSpan);
|
|
56
|
+
if (this.offset > 0)
|
|
57
|
+
styles['grid-column-start'] = String(Number(this.offset) + 1);
|
|
58
|
+
return styles;
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
return (index.h(index.Host, { key: 'e16ec21f8fcabbf3091ed3469a120aaff37f4274', style: this.getHostStyles() }, index.h("slot", { key: 'b1fa7e071660a4f4f50d9fd31ee9646069678d10' })));
|
|
62
|
+
}
|
|
63
|
+
get el() { return index.getElement(this); }
|
|
64
|
+
static get watchers() { return {
|
|
65
|
+
"colSpan": [{
|
|
66
|
+
"checkPropValues": 0
|
|
67
|
+
}],
|
|
68
|
+
"colSpanSm": [{
|
|
69
|
+
"checkPropValues": 0
|
|
70
|
+
}],
|
|
71
|
+
"colSpanMd": [{
|
|
72
|
+
"checkPropValues": 0
|
|
73
|
+
}],
|
|
74
|
+
"colSpanLg": [{
|
|
75
|
+
"checkPropValues": 0
|
|
76
|
+
}],
|
|
77
|
+
"colSpanXl": [{
|
|
78
|
+
"checkPropValues": 0
|
|
79
|
+
}],
|
|
80
|
+
"colSpan2xl": [{
|
|
81
|
+
"checkPropValues": 0
|
|
82
|
+
}],
|
|
83
|
+
"rowSpan": [{
|
|
84
|
+
"checkPropValues": 0
|
|
85
|
+
}],
|
|
86
|
+
"offset": [{
|
|
87
|
+
"checkPropValues": 0
|
|
88
|
+
}]
|
|
89
|
+
}; }
|
|
90
|
+
};
|
|
91
|
+
BdsGridItem.style = bdsGridItemCss();
|
|
92
|
+
|
|
93
|
+
exports.bds_grid_item = BdsGridItem;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CwYIVC9N.js');
|
|
4
|
+
var validateProps = require('./validateProps-CJe9X5x8.js');
|
|
5
|
+
|
|
6
|
+
const GRID_LAYOUT = {
|
|
7
|
+
FIXED: 'fixed',
|
|
8
|
+
FLUID: 'fluid',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const bdsGridCss = () => `@charset "UTF-8";bds-grid{--bds-grid-columns:var(--boreal-grid-columns-sm);--bds-grid-gutter:var(--boreal-grid-gutter-sm);--bds-grid-margin:var(--boreal-grid-margin-sm);display:grid;grid-template-columns:repeat(var(--bds-grid-columns), 1fr);gap:var(--bds-grid-gutter);padding-inline:var(--bds-grid-margin);-webkit-margin-start:var(--bds-grid-nav-offset, 0px);margin-inline-start:var(--bds-grid-nav-offset, 0px);-webkit-box-sizing:border-box;box-sizing:border-box}@media (min-width: 769px){bds-grid{--bds-grid-columns:var(--boreal-grid-columns-md)}}@media (min-width: 960px){bds-grid{--bds-grid-columns:var(--boreal-grid-columns-lg);--bds-grid-margin:var(--boreal-grid-margin-lg)}}@media (min-width: 1152px){bds-grid{--bds-grid-gutter:var(--boreal-grid-gutter-xl);--bds-grid-margin:var(--boreal-grid-margin-xl)}}@media (min-width: 1344px){bds-grid{--bds-grid-margin:var(--boreal-grid-margin-2xl)}}bds-grid.bds-grid--fixed{max-width:calc(var(--boreal-grid-fixed-max-columns-width) + 2 * var(--bds-grid-margin));margin-inline:auto}`;
|
|
12
|
+
|
|
13
|
+
const BdsGrid = class {
|
|
14
|
+
constructor(hostRef) {
|
|
15
|
+
index.registerInstance(this, hostRef);
|
|
16
|
+
/** `'fluid'` fills full width; `'fixed'` caps the column area at 960px and centres the container. */
|
|
17
|
+
this.layout = GRID_LAYOUT.FLUID;
|
|
18
|
+
}
|
|
19
|
+
checkPropValues() {
|
|
20
|
+
validateProps.validatePropValue(Object.values(GRID_LAYOUT), GRID_LAYOUT.FLUID, this.el, 'layout');
|
|
21
|
+
}
|
|
22
|
+
componentWillLoad() {
|
|
23
|
+
this.checkPropValues();
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return (index.h(index.Host, { key: '52672cc265a59d6556eb4ae677c650b19696dbdc', class: { 'bds-grid--fixed': this.layout === GRID_LAYOUT.FIXED }, style: { ...(this.rowGap && { 'row-gap': this.rowGap }) } }, index.h("slot", { key: '6c0f0b89777a754a91d273838940cd8721b79d5c' })));
|
|
27
|
+
}
|
|
28
|
+
get el() { return index.getElement(this); }
|
|
29
|
+
static get watchers() { return {
|
|
30
|
+
"layout": [{
|
|
31
|
+
"checkPropValues": 0
|
|
32
|
+
}]
|
|
33
|
+
}; }
|
|
34
|
+
};
|
|
35
|
+
BdsGrid.style = bdsGridCss();
|
|
36
|
+
|
|
37
|
+
exports.bds_grid = BdsGrid;
|
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CwYIVC9N.js');
|
|
4
|
+
var states = require('./states-BweP5Vpu.js');
|
|
5
|
+
var menu = require('./menu-BxKaEajh.js');
|
|
6
|
+
var validateProps = require('./validateProps-CJe9X5x8.js');
|
|
7
|
+
var Keys = require('./Keys-rKl2za5q.js');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Resolves the appropriate ARIA role for a menu item.
|
|
11
|
+
* @param {MenuRole} role - The role of the parent menu container ('menu' or 'listbox').
|
|
12
|
+
* @returns {MenuItemRole} - Returns 'menuitem' if parent is 'menu', otherwise 'option'.
|
|
13
|
+
* @example
|
|
14
|
+
* const itemRole = resolveMenuItemRole('menu'); // returns 'menuitem'
|
|
15
|
+
*/
|
|
16
|
+
function resolveMenuItemRole(role) {
|
|
17
|
+
return role === 'menu' ? 'menuitem' : 'option';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Determines the aria-selected value based on the item's role and state.
|
|
21
|
+
* @param {MenuItemRole} role - The role of the item ('menuitem' or 'option').
|
|
22
|
+
* @param {boolean} selected - The current selection state of the item.
|
|
23
|
+
* @returns {string | null} - Returns the string representation of the boolean if role is 'option', otherwise null.
|
|
24
|
+
* @example
|
|
25
|
+
* const attr = resolveAriaSelected('option', true); // returns 'true'
|
|
26
|
+
* const attrNull = resolveAriaSelected('menuitem', true); // returns null
|
|
27
|
+
*/
|
|
28
|
+
function resolveAriaSelected(role, selected) {
|
|
29
|
+
return role === 'option' ? String(selected) : null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolves the tabIndex attribute for keyboard navigation.
|
|
33
|
+
* @param {MenuItemRole} role - The role of the item.
|
|
34
|
+
* @param {boolean} disabled - Whether the item is currently disabled.
|
|
35
|
+
* @param {boolean} active - Whether the item is currently active.
|
|
36
|
+
* @returns {number} - Returns 0 for focusable menu items, or -1 for disabled/options.
|
|
37
|
+
* @example
|
|
38
|
+
* const index = resolveTabIndex('menuitem', false); // returns 0
|
|
39
|
+
* const indexDisabled = resolveTabIndex('menuitem', true); // returns -1
|
|
40
|
+
*/
|
|
41
|
+
function resolveTabIndex(role, disabled, active) {
|
|
42
|
+
if (disabled)
|
|
43
|
+
return -1;
|
|
44
|
+
if (role === 'option' || role === 'menuitem') {
|
|
45
|
+
return active ? 0 : -1;
|
|
46
|
+
}
|
|
47
|
+
return -1;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Manages focus and activation through keyboard events.
|
|
51
|
+
* @param {KeyboardEvent} event - The keyboard event object from the listener.
|
|
52
|
+
* @param {HTMLElement[]} items - An array of focusable HTML elements within the menu.
|
|
53
|
+
* @param {number} currentIndex - The index of the currently focused item.
|
|
54
|
+
* @param {boolean} selected - The current selection state of the item (used for activation logic).
|
|
55
|
+
* @returns {void}
|
|
56
|
+
* @example
|
|
57
|
+
* handleMenuKeyNavigation(event, menuItems, 2);
|
|
58
|
+
*/
|
|
59
|
+
function handleMenuKeyNavigation(event, items, currentIndex) {
|
|
60
|
+
if (items.length === 0 || currentIndex === -1)
|
|
61
|
+
return;
|
|
62
|
+
let nextIndex = -1;
|
|
63
|
+
switch (event.key) {
|
|
64
|
+
case Keys.KEYBOARD.ArrowDown:
|
|
65
|
+
nextIndex = (currentIndex + 1) % items.length;
|
|
66
|
+
break;
|
|
67
|
+
case Keys.KEYBOARD.ArrowUp:
|
|
68
|
+
nextIndex = (currentIndex - 1 + items.length) % items.length;
|
|
69
|
+
break;
|
|
70
|
+
default:
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
items.forEach(item => item.removeAttribute('active-item'));
|
|
74
|
+
items[nextIndex].focus();
|
|
75
|
+
items[nextIndex].setAttribute('active-item', '');
|
|
76
|
+
}
|
|
77
|
+
/** Prevents default browser behavior for specific navigation keys.
|
|
78
|
+
* @param {KeyboardEvent} e - The keyboard event to evaluate.
|
|
79
|
+
* @returns {void}
|
|
80
|
+
* @example
|
|
81
|
+
* // Inside a keydown listener:
|
|
82
|
+
* preventNavigationKeys(event);
|
|
83
|
+
*/
|
|
84
|
+
function preventNavigationKeys(e) {
|
|
85
|
+
const navigationKeys = [Keys.KEYBOARD.ArrowDown, Keys.KEYBOARD.ArrowUp, Keys.KEYBOARD.Enter, Keys.KEYBOARD.Space];
|
|
86
|
+
if (navigationKeys.includes(e.key)) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* A Mixin that provides menu item behaviors, including ARIA roles,
|
|
93
|
+
* focus management, and keyboard navigation logic.
|
|
94
|
+
* This mixin is designed to be used with Stencil components that represent items within a menu or listbox,
|
|
95
|
+
* allowing them to automatically adapt their behavior based on the context of their parent container.
|
|
96
|
+
*
|
|
97
|
+
* The mixin includes:
|
|
98
|
+
* - Dynamic ARIA role resolution based on the nearest parent menu or listbox.
|
|
99
|
+
* - Computation of aria-selected and tabIndex attributes for accessibility.
|
|
100
|
+
* - A method to handle keyboard navigation (Arrow keys, Enter, Space) within the menu context.
|
|
101
|
+
*
|
|
102
|
+
* @typeParam B - The base constructor type.
|
|
103
|
+
* @param {B} Base - The base component class to be extended.
|
|
104
|
+
* @returns {MenuBehaviorMixin} - A class with injected menu behaviors.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* import { Component, h } from '@stencil/core';
|
|
109
|
+
* import { MenuItemBehavior } from '@/mixins/menu-behavior.mixin';
|
|
110
|
+
*
|
|
111
|
+
* @Component({
|
|
112
|
+
* tag: 'my-menu-item',
|
|
113
|
+
* styleUrl: 'my-menu-item.scss',
|
|
114
|
+
* })
|
|
115
|
+
* export class MyMenuItem extends Mixin(MenuItemBehavior) {
|
|
116
|
+
* @Element() el!: HTMLElement;
|
|
117
|
+
* @Prop() disabled: boolean = false;
|
|
118
|
+
* @Prop() selected: boolean = false;
|
|
119
|
+
*
|
|
120
|
+
* private handleKeyDown = (e: KeyboardEvent) => {
|
|
121
|
+
* if (this.disabled) return;
|
|
122
|
+
* this.handleKeyDownLogic(e, () => this.handleSelection());
|
|
123
|
+
* };
|
|
124
|
+
*
|
|
125
|
+
* render() {
|
|
126
|
+
* return (
|
|
127
|
+
* <Host
|
|
128
|
+
* role={this.menuItemRole}
|
|
129
|
+
* aria-selected={this.ariaSelected}
|
|
130
|
+
* tabIndex={ this.itemTabIndex}
|
|
131
|
+
* onKeyDown={this.handleKeyDown} >
|
|
132
|
+
* <slot />
|
|
133
|
+
* </Host>
|
|
134
|
+
* );
|
|
135
|
+
* }
|
|
136
|
+
* } ```
|
|
137
|
+
*
|
|
138
|
+
*
|
|
139
|
+
*/
|
|
140
|
+
const MenuItemBehavior = (Base) => {
|
|
141
|
+
class MenuBehaviorMixin extends Base {
|
|
142
|
+
constructor() {
|
|
143
|
+
super(...arguments);
|
|
144
|
+
this.disabled = false;
|
|
145
|
+
this.selected = false;
|
|
146
|
+
this.activeItem = false;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Finds the closest parent element with a role of 'menu' or 'listbox'.
|
|
150
|
+
* @returns {HTMLElement | null} - The parent menu or listbox element, or null if not found.
|
|
151
|
+
*/
|
|
152
|
+
get parent() {
|
|
153
|
+
return this.el.closest('[role="menu"], [role="listbox"]');
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Detects the ARIA role of the nearest parent menu or listbox.
|
|
157
|
+
* @returns {MenuRole | null} - 'menu', 'listbox', or null if not found.
|
|
158
|
+
*/
|
|
159
|
+
get parentRole() {
|
|
160
|
+
const parent = this.parent;
|
|
161
|
+
return parent !== null ? parent.getAttribute('role') : null;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Resolves the specific item role ('menuitem' or 'option').
|
|
165
|
+
* Defaults to 'menuitem' if no parent is detected.
|
|
166
|
+
* @returns {MenuItemRole}
|
|
167
|
+
*/
|
|
168
|
+
get menuItemRole() {
|
|
169
|
+
return resolveMenuItemRole(this.parentRole || 'menu');
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Returns the 'aria-selected' value as a string for listbox options.
|
|
173
|
+
* @returns {string | null}
|
|
174
|
+
*/
|
|
175
|
+
get ariaSelected() {
|
|
176
|
+
return resolveAriaSelected(this.menuItemRole, this.selected);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Calculates the tabIndex for the item.
|
|
180
|
+
* @returns {number} 0 for focusable menu items, -1 otherwise.
|
|
181
|
+
*/
|
|
182
|
+
get itemTabIndex() {
|
|
183
|
+
return resolveTabIndex(this.menuItemRole, this.disabled, this.activeItem);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Processes keyboard events for arrow navigation and activation.
|
|
187
|
+
* @param {KeyboardEvent} e - The native keyboard event.
|
|
188
|
+
* @param {() => void} onActivate - Function to execute when Enter or Space is pressed.
|
|
189
|
+
* @example
|
|
190
|
+
* // Inside a component's keydown listener:
|
|
191
|
+
* this.handleKeyDownLogic(event, () => this.emitSelection());
|
|
192
|
+
*/
|
|
193
|
+
handleKeyDownLogic(e, onActivate) {
|
|
194
|
+
preventNavigationKeys(e);
|
|
195
|
+
if (e.key === Keys.KEYBOARD.Enter || e.key === Keys.KEYBOARD.Space) {
|
|
196
|
+
onActivate();
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const parent = this.parent;
|
|
200
|
+
if (parent === null)
|
|
201
|
+
return;
|
|
202
|
+
const items = Array.from(parent.querySelectorAll(`${this.el.tagName.toLocaleLowerCase()}:not([disabled]):not([variant="label"])`));
|
|
203
|
+
const currentIndex = items.indexOf(this.el);
|
|
204
|
+
handleMenuKeyNavigation(e, items, currentIndex);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return MenuBehaviorMixin;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Creates a mixin that adds link-related properties and behaviors to a base class.
|
|
212
|
+
* It provides computed attributes for links, handles keyboard interactions, and sanitizes URLs to ensure security.
|
|
213
|
+
* It allows components to easily handle link attributes and execute link events.
|
|
214
|
+
*
|
|
215
|
+
* This mixin includes:
|
|
216
|
+
* - `href`: The URL the link points to.
|
|
217
|
+
* - `newTab`: Whether the link should open in a new tab.
|
|
218
|
+
* - `downloadable`: Whether the link should be treated as a download.
|
|
219
|
+
* - `filename`: The filename to use when downloading.
|
|
220
|
+
* - `getLinkAttributes`: A computed property that returns the appropriate attributes for the link based on its state and props.
|
|
221
|
+
* - `handleLinkKeyDown`: A method to handle keyboard interactions for accessibility.
|
|
222
|
+
* - `handleLinkClick`: A method to manage click behavior, including external links and downloads.
|
|
223
|
+
* - `sanitizeUrl`: A utility method to sanitize URLs and prevent XSS vulnerabilities.
|
|
224
|
+
*
|
|
225
|
+
* @typeParam T - The base constructor type to extend.
|
|
226
|
+
* @param {T} Base - The base component class to be extended.
|
|
227
|
+
* @returns {WithLinks} - A class with injected link behaviors.
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```tsx
|
|
231
|
+
* import { Component, h } from '@stencil/core';
|
|
232
|
+
* import { WithLinks } from '@/mixins/links.mixin';
|
|
233
|
+
*
|
|
234
|
+
* @Component({
|
|
235
|
+
* tag: 'my-link',
|
|
236
|
+
* styleUrl: 'my-link.scss',
|
|
237
|
+
* })
|
|
238
|
+
* class MyLink extends Mixin(WithLinks) {
|
|
239
|
+
* @Element() el!: HTMLElement;
|
|
240
|
+
* @Prop() href: string = '';
|
|
241
|
+
* @Prop() newTab: boolean = false;
|
|
242
|
+
* @Prop() downloadable: boolean = false;
|
|
243
|
+
* @Prop() filename: string = '';
|
|
244
|
+
* @Prop() disabled: boolean = false;
|
|
245
|
+
*
|
|
246
|
+
* private handleKeyDown = (e: KeyboardEvent) => {
|
|
247
|
+
* if (this.disabled) return;
|
|
248
|
+
* this.handleLinkKeyDown(e);
|
|
249
|
+
* };
|
|
250
|
+
*
|
|
251
|
+
* render() {
|
|
252
|
+
* return (
|
|
253
|
+
* <Host
|
|
254
|
+
* {...this.getLinkAttributes}
|
|
255
|
+
* onKeyDown={this.handleKeyDown} >
|
|
256
|
+
* <slot />
|
|
257
|
+
* </Host>
|
|
258
|
+
* );
|
|
259
|
+
* }
|
|
260
|
+
* } ```
|
|
261
|
+
*
|
|
262
|
+
*/
|
|
263
|
+
const WithLinks = (Base) => {
|
|
264
|
+
class WithLinks extends Base {
|
|
265
|
+
constructor() {
|
|
266
|
+
super(...arguments);
|
|
267
|
+
this.href = '';
|
|
268
|
+
this.newTab = false;
|
|
269
|
+
this.download = '';
|
|
270
|
+
}
|
|
271
|
+
get isLink() {
|
|
272
|
+
return this.href !== '' || this.download !== '';
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Computes the appropriate link attributes based on the component's props and state.
|
|
276
|
+
* It handles external links, new tab behavior, and download attributes while ensuring accessibility.
|
|
277
|
+
* @returns {LinksAttrs} - The computed link attributes.
|
|
278
|
+
* */
|
|
279
|
+
get linkAttributes() {
|
|
280
|
+
const attributes = {};
|
|
281
|
+
if (!this.isLink)
|
|
282
|
+
return attributes;
|
|
283
|
+
const sanitizedHref = this.sanitizeUrl(this.href);
|
|
284
|
+
attributes.href = sanitizedHref;
|
|
285
|
+
attributes.target = this.newTab ? '_blank' : '_self';
|
|
286
|
+
attributes.rel =
|
|
287
|
+
this._isExternalLink(sanitizedHref) || this.newTab || this.download !== '' ? 'noopener noreferrer' : '';
|
|
288
|
+
attributes.download = this.download !== '' ? this.download : undefined;
|
|
289
|
+
if (this.el.tagName.toLowerCase() !== 'a') {
|
|
290
|
+
attributes.role = 'link';
|
|
291
|
+
attributes.tabindex = '0';
|
|
292
|
+
}
|
|
293
|
+
return attributes;
|
|
294
|
+
}
|
|
295
|
+
_isExternalLink(url) {
|
|
296
|
+
const isExternal = /^https?:\/\//.test(url) && !url.includes(window.location.hostname);
|
|
297
|
+
return isExternal;
|
|
298
|
+
}
|
|
299
|
+
/** Keydown handler to allow keyboard interaction with the link */
|
|
300
|
+
handleLinkKeyDown(event) {
|
|
301
|
+
if (!this.isLink)
|
|
302
|
+
return;
|
|
303
|
+
if (this.el.tagName.toLowerCase() !== 'a' && (event.key === Keys.KEYBOARD.Enter || event.key === Keys.KEYBOARD.Space)) {
|
|
304
|
+
event.preventDefault();
|
|
305
|
+
this.handleLinkClick(new MouseEvent('click', { bubbles: true, cancelable: true }));
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/** Click handler to manage link behavior, including external links and downloads */
|
|
309
|
+
handleLinkClick(event) {
|
|
310
|
+
if (!this.isLink) {
|
|
311
|
+
event.preventDefault();
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
const attributes = this.linkAttributes;
|
|
315
|
+
if (attributes.download !== '' && attributes.download !== undefined) {
|
|
316
|
+
event.preventDefault();
|
|
317
|
+
const logger = document.createElement('a');
|
|
318
|
+
logger.href = attributes.download || '';
|
|
319
|
+
logger.download = attributes.download;
|
|
320
|
+
logger.style.display = 'none';
|
|
321
|
+
document.body.appendChild(logger);
|
|
322
|
+
console.log('Initiating download:', logger.href);
|
|
323
|
+
logger.click();
|
|
324
|
+
document.body.removeChild(logger);
|
|
325
|
+
}
|
|
326
|
+
if (this.el.tagName.toLowerCase() !== 'a') {
|
|
327
|
+
if (attributes.target === '_blank') {
|
|
328
|
+
window.open(attributes.href, '_blank', attributes.rel);
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
window.location.href = attributes.href || '';
|
|
332
|
+
}
|
|
333
|
+
event.preventDefault();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/** Sanitizes the URL to prevent XSS vulnerabilities. It removes dangerous protocols and ensures valid URLs.
|
|
337
|
+
* @param {string} url - The URL to sanitize.
|
|
338
|
+
* @returns {string} - The sanitized URL, or an empty string if the URL is deemed unsafe.
|
|
339
|
+
* @example
|
|
340
|
+
* const safeUrl = sanitizeUrl('https://example.com'); // returns 'https://example.com'
|
|
341
|
+
* const unsafeUrl = sanitizeUrl('javascript:alert(1)'); // returns ''
|
|
342
|
+
*/
|
|
343
|
+
sanitizeUrl(url) {
|
|
344
|
+
const sanitized = url.trim().toLowerCase();
|
|
345
|
+
if (sanitized.startsWith('javascript:') || sanitized.startsWith('data:') || sanitized.includes('\0')) {
|
|
346
|
+
return '';
|
|
347
|
+
}
|
|
348
|
+
if (!sanitized.startsWith('http://') &&
|
|
349
|
+
!sanitized.startsWith('https://') &&
|
|
350
|
+
!sanitized.startsWith('mailto:') &&
|
|
351
|
+
!sanitized.startsWith('tel:') &&
|
|
352
|
+
!sanitized.startsWith('/') &&
|
|
353
|
+
!sanitized.startsWith('#')) {
|
|
354
|
+
return sanitized.startsWith('://') ? '' : `https://${url}`;
|
|
355
|
+
}
|
|
356
|
+
return url;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return WithLinks;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
const LIST_MENU_ITEM_VARIANTS = {
|
|
363
|
+
LABEL: 'label',
|
|
364
|
+
BUTTON: 'button',
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
const bdsListMenuItemCss = () => `@charset "UTF-8";.bds-list-item,.bds-list-item__content{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.bds-list-item{width:100%;vertical-align:middle;position:relative;color:var(--boreal-text-default);font-style:normal;font-family:var(--boreal-typography-font-family-primary);font-weight:var(--boreal-typography-font-weight-regular)}.bds-list-item__content{-ms-flex-pack:justify;justify-content:space-between;-ms-flex:1;flex:1;vertical-align:middle;gap:var(--boreal-spacing-3xs)}.bds-list-item__content-left,.bds-list-item__content-right{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;vertical-align:middle}.bds-list-item__content-left__icon,.bds-list-item__content-left__text{display:inline-block;vertical-align:middle;font-style:normal;font-size:var(--boreal-typography-font-size-sm);line-height:var(--boreal-typography-line-height-xs)}.bds-list-item__content-left__icon:not(:empty){padding-right:var(--boreal-spacing-3xs)}.bds-list-item__content [class*=bds-icon-]{font-size:var(--boreal-typography-font-size-md)}.bds-list-item--button{cursor:pointer;padding:var(--boreal-spacing-1xs) var(--boreal-spacing-s);-webkit-transition:background-color 0.3s ease, border-color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:background-color 0.3s ease, border-color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;transition:background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, -webkit-box-shadow 0.3s ease}.bds-list-item--button:not(.bds-list-item--disabled):hover:not([selected]){background-color:var(--boreal-ui-default-lighter);z-index:1}.bds-list-item--button:not(.bds-list-item--disabled):focus,.bds-list-item--button:not(.bds-list-item--disabled):focus-visible{outline:none;-webkit-box-shadow:0 0 0 1px var(--boreal-ui-inverse), 0 0 0 3px var(--boreal-stroke-focus);box-shadow:0 0 0 1px var(--boreal-ui-inverse), 0 0 0 3px var(--boreal-stroke-focus);z-index:1}.bds-list-item--button:not(.bds-list-item--disabled):active,.bds-list-item--button:not(.bds-list-item--disabled).bds-list-item--state-active{-webkit-box-shadow:0 0 0 1px var(--boreal-ui-inverse), 0 0 0 3px var(--boreal-stroke-focus), 0 1px 2px 0 rgba(19, 19, 22, 0.15) inset;box-shadow:0 0 0 1px var(--boreal-ui-inverse), 0 0 0 3px var(--boreal-stroke-focus), 0 1px 2px 0 rgba(19, 19, 22, 0.15) inset;background-color:var(--boreal-ui-default-lighter);z-index:1}.bds-list-item--selected{background-color:var(--boreal-ui-primary-lighter)}.bds-list-item--disabled{color:var(--boreal-text-disabled);cursor:not-allowed}.bds-list-item--label{cursor:default;padding:var(--boreal-spacing-3xs) 0}.bds-list-item--label .bds-typography label{color:var(--boreal-text-default-light)}`;
|
|
368
|
+
|
|
369
|
+
const BdsListMenuItem = class extends index.Mixin(MenuItemBehavior, WithLinks) {
|
|
370
|
+
constructor(hostRef) {
|
|
371
|
+
super();
|
|
372
|
+
index.registerInstance(this, hostRef);
|
|
373
|
+
this.bdsSelectItem = index.createEvent(this, "bdsSelectItem");
|
|
374
|
+
/**
|
|
375
|
+
* Defines the visual style of the list menu item.
|
|
376
|
+
* - 'button': A standard clickable item.
|
|
377
|
+
* - 'label': A non-interactive label, typically used for grouping items.
|
|
378
|
+
*/
|
|
379
|
+
this.variant = LIST_MENU_ITEM_VARIANTS.BUTTON;
|
|
380
|
+
/** The name of the list menu item */
|
|
381
|
+
this.name = '';
|
|
382
|
+
/** Disabled state item */
|
|
383
|
+
this.disabled = false;
|
|
384
|
+
/** Selected item state */
|
|
385
|
+
this.selected = false;
|
|
386
|
+
/** Value associated with the menu item */
|
|
387
|
+
this.value = '';
|
|
388
|
+
/** Checkable state item, if is activated should be visible a checkbox */
|
|
389
|
+
this.checkable = false;
|
|
390
|
+
/** Active state item */
|
|
391
|
+
this.activeItem = false;
|
|
392
|
+
/** Link behavior props */
|
|
393
|
+
this.href = '';
|
|
394
|
+
/** Opens the link in a new tab if true */
|
|
395
|
+
this.newTab = false;
|
|
396
|
+
/** Makes the link downloadable if true */
|
|
397
|
+
this.download = '';
|
|
398
|
+
/** State to manage click and keyboard interaction states */
|
|
399
|
+
this.currentState = states.COMPONENT_STATES.DEFAULT;
|
|
400
|
+
/** Event to notify when the menu item is clicked */
|
|
401
|
+
this.handleClick = (e) => {
|
|
402
|
+
if (this.disabled || this.isLabelVariant)
|
|
403
|
+
return;
|
|
404
|
+
e.stopPropagation();
|
|
405
|
+
if (this.isLink) {
|
|
406
|
+
this.handleLinkClick(e);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
if (this.checkable && this.parentRole !== menu.MENU_ROLES.LISTBOX)
|
|
410
|
+
this.selected = !this.selected;
|
|
411
|
+
this.bdsSelectItem.emit({
|
|
412
|
+
value: this.value,
|
|
413
|
+
selected: !this.selected,
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
/** Event to handle keydown navigation and trigger click */
|
|
417
|
+
this.handleKeyDown = (e) => {
|
|
418
|
+
if (this.disabled || this.isLabelVariant)
|
|
419
|
+
return;
|
|
420
|
+
this.handleKeyDownLogic(e, () => this.handleClick(e));
|
|
421
|
+
// If the item is a link, we dont activate this animation
|
|
422
|
+
if (!this.isLink || this.linkAttributes.download !== undefined) {
|
|
423
|
+
this.currentState =
|
|
424
|
+
e.key === Keys.KEYBOARD.Enter || e.key === Keys.KEYBOARD.Space ? states.COMPONENT_STATES.ACTIVE : this.currentState;
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
/** Event to handle keyup navigation and reset active state */
|
|
428
|
+
this.handleKeyUp = () => {
|
|
429
|
+
if (this.disabled || this.isLabelVariant)
|
|
430
|
+
return;
|
|
431
|
+
this.currentState = states.COMPONENT_STATES.DEFAULT;
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
checkPropsVariant() {
|
|
435
|
+
validateProps.validatePropValue(Object.values(LIST_MENU_ITEM_VARIANTS), LIST_MENU_ITEM_VARIANTS.BUTTON, this.el, 'variant');
|
|
436
|
+
}
|
|
437
|
+
/** Lifecycle method called before the component is loaded */
|
|
438
|
+
componentWillLoad() {
|
|
439
|
+
this.checkPropsVariant();
|
|
440
|
+
}
|
|
441
|
+
/** Improve aria resolve for checkable items */
|
|
442
|
+
get menuItemRoleExtended() {
|
|
443
|
+
if (!this.checkable)
|
|
444
|
+
return this.menuItemRole;
|
|
445
|
+
if (this.parentRole === 'listbox')
|
|
446
|
+
return 'checkbox';
|
|
447
|
+
return 'menuitemcheckbox';
|
|
448
|
+
}
|
|
449
|
+
/** Checks if the variant is a label */
|
|
450
|
+
get isLabelVariant() {
|
|
451
|
+
return this.variant === LIST_MENU_ITEM_VARIANTS.LABEL;
|
|
452
|
+
}
|
|
453
|
+
/** Returns the class map for the list menu item */
|
|
454
|
+
get classMap() {
|
|
455
|
+
return {
|
|
456
|
+
'bds-list-item': true,
|
|
457
|
+
'bds-list-item--disabled': this.disabled,
|
|
458
|
+
'bds-list-item--selected': this.selected,
|
|
459
|
+
[`bds-list-item--state-${this.currentState}`]: true,
|
|
460
|
+
[`bds-list-item--${this.variant}`]: true,
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
/** Return the render for the label variant of the list menu item */
|
|
464
|
+
renderTypeLabel() {
|
|
465
|
+
return (index.h("bds-typography", { variant: "label", element: "label", align: "start", role: "presentation" }, index.h("slot", { name: "left-content" }), " ", index.h("slot", null)));
|
|
466
|
+
}
|
|
467
|
+
renderCheckbox() {
|
|
468
|
+
if (!this.checkable)
|
|
469
|
+
return null;
|
|
470
|
+
return (index.h("bds-checkbox", { checked: this.selected, disabled: this.disabled, name: `checkbox-${this.value}`, tabindex: "-1", style: { pointerEvents: 'none' }, inert: true }));
|
|
471
|
+
}
|
|
472
|
+
/** Return the render for the button variant of the list menu item */
|
|
473
|
+
renderTypeButton() {
|
|
474
|
+
return (index.h("div", { class: "bds-list-item__content" }, index.h("div", { class: "bds-list-item__content-left" }, this.renderCheckbox(), index.h("span", { class: "bds-list-item__content-left__icon" }, index.h("slot", { name: "left-content" })), index.h("span", { class: "bds-list-item__content-left__text" }, index.h("slot", null))), index.h("div", { class: "bds-list-item__content-right" }, index.h("slot", { name: "right-content" }))));
|
|
475
|
+
}
|
|
476
|
+
/** Main render */
|
|
477
|
+
render() {
|
|
478
|
+
let renderItem = this.renderTypeButton();
|
|
479
|
+
if (this.isLabelVariant)
|
|
480
|
+
renderItem = this.renderTypeLabel();
|
|
481
|
+
const linkAttributes = this.isLink ? { ...this.linkAttributes, tabindex: this.activeItem ? 0 : -1 } : {};
|
|
482
|
+
return (index.h(index.Host, { key: '0882d4cb677f6621518113c48e92d7e94cb71916', class: this.classMap, role: this.isLabelVariant ? 'presentation' : this.menuItemRoleExtended, "aria-selected": !this.checkable ? this.ariaSelected : false, "aria-checked": this.checkable ? this.ariaSelected : undefined, ...linkAttributes, tabIndex: this.isLabelVariant ? -1 : this.itemTabIndex, onClick: this.handleClick, onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp }, renderItem));
|
|
483
|
+
}
|
|
484
|
+
get el() { return index.getElement(this); }
|
|
485
|
+
static get watchers() { return {
|
|
486
|
+
"variant": [{
|
|
487
|
+
"checkPropsVariant": 0
|
|
488
|
+
}]
|
|
489
|
+
}; }
|
|
490
|
+
};
|
|
491
|
+
BdsListMenuItem.style = bdsListMenuItemCss();
|
|
492
|
+
|
|
493
|
+
exports.bds_list_menu_item = BdsListMenuItem;
|