@brandsync/wc 1.12.1 → 1.13.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/CHANGELOG.md +16 -0
- package/CONVENTIONS.md +109 -0
- package/REFERENCE.md +1357 -0
- package/custom-elements.json +2628 -338
- package/dist/brandsync-wc/brandsync-wc.css +1 -1783
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/{p-83c90489.entry.js → p-00be9a64.entry.js} +1 -1
- package/dist/brandsync-wc/{p-b9ccd9d1.entry.js → p-020cb767.entry.js} +1 -1
- package/dist/brandsync-wc/p-046a53de.entry.js +1 -0
- package/dist/brandsync-wc/{p-282ddbee.entry.js → p-07966676.entry.js} +1 -1
- package/dist/brandsync-wc/p-0cb6fc39.entry.js +1 -0
- package/dist/brandsync-wc/{p-2497d128.entry.js → p-0e940ee1.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e5daa6ca.entry.js → p-10290c41.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e2556b4e.entry.js → p-144b6ac8.entry.js} +1 -1
- package/dist/brandsync-wc/p-1b5cc9b8.entry.js +1 -0
- package/dist/brandsync-wc/p-23b56775.entry.js +1 -0
- package/dist/brandsync-wc/{p-a9169157.entry.js → p-23cc532f.entry.js} +1 -1
- package/dist/brandsync-wc/{p-81605b82.entry.js → p-361aef36.entry.js} +1 -1
- package/dist/brandsync-wc/{p-89fabf27.entry.js → p-3789c7a5.entry.js} +1 -1
- package/dist/brandsync-wc/p-3f6682f8.entry.js +1 -0
- package/dist/brandsync-wc/{p-f5180578.entry.js → p-4054a944.entry.js} +1 -1
- package/dist/brandsync-wc/{p-fc069773.entry.js → p-45cb3e6d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-de110ad0.entry.js → p-47b7fe76.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2f4e08e1.entry.js → p-47cd19aa.entry.js} +1 -1
- package/dist/brandsync-wc/{p-3a1af63a.entry.js → p-4bbc4809.entry.js} +1 -1
- package/dist/brandsync-wc/{p-247e36ad.entry.js → p-4ea435a6.entry.js} +1 -1
- package/dist/brandsync-wc/{p-56c37e0a.entry.js → p-4ea9b6a1.entry.js} +1 -1
- package/dist/brandsync-wc/{p-1978e63c.entry.js → p-53362609.entry.js} +1 -1
- package/dist/brandsync-wc/p-658532b7.entry.js +1 -0
- package/dist/brandsync-wc/p-68f0be29.entry.js +1 -0
- package/dist/brandsync-wc/{p-09bc1923.entry.js → p-694fe468.entry.js} +1 -1
- package/dist/brandsync-wc/{p-78f4fcf0.entry.js → p-6ca1e51b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-52cb2358.entry.js → p-6e923ebc.entry.js} +1 -1
- package/dist/brandsync-wc/p-7e24dbd7.entry.js +1 -0
- package/dist/brandsync-wc/{p-00a0d489.entry.js → p-8048d033.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2368a92e.entry.js → p-8184d7de.entry.js} +1 -1
- package/dist/brandsync-wc/p-8390a155.entry.js +1 -0
- package/dist/brandsync-wc/{p-0b2d3b7e.entry.js → p-86028548.entry.js} +1 -1
- package/dist/brandsync-wc/{p-fcee0dc4.entry.js → p-89fa7567.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7796b93f.entry.js → p-8c9938a5.entry.js} +1 -1
- package/dist/brandsync-wc/{p-68fcd4a4.entry.js → p-9125632c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-416322bd.entry.js → p-94d435a2.entry.js} +1 -1
- package/dist/brandsync-wc/{p-69c0a85d.entry.js → p-95f034fc.entry.js} +1 -1
- package/dist/brandsync-wc/p-9b58c0c5.entry.js +1 -0
- package/dist/brandsync-wc/{p-39a26c64.entry.js → p-9cf8274a.entry.js} +1 -1
- package/dist/brandsync-wc/p-9d12b1fb.entry.js +1 -0
- package/dist/brandsync-wc/{p-5ba90a13.entry.js → p-9d660c03.entry.js} +1 -1
- package/dist/brandsync-wc/p-D3SkQJpw.js +3 -0
- package/dist/brandsync-wc/{p-7f954939.entry.js → p-a28ef52e.entry.js} +1 -1
- package/dist/brandsync-wc/{p-09435f41.entry.js → p-a5659499.entry.js} +1 -1
- package/dist/brandsync-wc/p-ab07c9b5.entry.js +1 -0
- package/dist/brandsync-wc/p-b0b2e525.entry.js +1 -0
- package/dist/brandsync-wc/p-b6ac1b50.entry.js +1 -0
- package/dist/brandsync-wc/p-bee30626.entry.js +1 -0
- package/dist/brandsync-wc/p-bf8bd386.entry.js +1 -0
- package/dist/brandsync-wc/{p-1aab6d07.entry.js → p-c05ee501.entry.js} +1 -1
- package/dist/brandsync-wc/p-c3da3080.entry.js +1 -0
- package/dist/brandsync-wc/p-c679b631.entry.js +1 -0
- package/dist/brandsync-wc/p-cceb8484.entry.js +1 -0
- package/dist/brandsync-wc/p-cd53bba9.entry.js +1 -0
- package/dist/brandsync-wc/p-ce16f038.entry.js +1 -0
- package/dist/brandsync-wc/{p-491b51e6.entry.js → p-d5a6098d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f15d9524.entry.js → p-d64cae57.entry.js} +1 -1
- package/dist/brandsync-wc/p-dfad8c0a.entry.js +1 -0
- package/dist/brandsync-wc/p-e0504a4b.entry.js +1 -0
- package/dist/brandsync-wc/{p-0ee4126c.entry.js → p-e1b7bea7.entry.js} +1 -1
- package/dist/brandsync-wc/{p-0b7c77c1.entry.js → p-e65d286c.entry.js} +1 -1
- package/dist/brandsync-wc/p-ed5c2d97.entry.js +1 -0
- package/dist/brandsync-wc/p-f134a502.entry.js +1 -0
- package/dist/brandsync-wc/p-f271e1d2.entry.js +1 -0
- package/dist/brandsync-wc/{p-3f09296a.entry.js → p-f3eca1ce.entry.js} +1 -1
- package/dist/brandsync-wc/{p-617bd13a.entry.js → p-f8d47004.entry.js} +1 -1
- package/dist/brandsync-wc/p-fa34fe20.entry.js +1 -0
- package/dist/brandsync-wc/{p-2177042f.entry.js → p-fa6b9750.entry.js} +1 -1
- package/dist/brandsync-wc/p-fb4d0093.entry.js +1 -0
- package/dist/brandsync-wc/{p-78a69a59.entry.js → p-fc76031e.entry.js} +1 -1
- package/dist/brandsync-wc/{p-be3dd446.entry.js → p-ffc07eb5.entry.js} +1 -1
- package/dist/cjs/brandsync-wc.cjs.js +2 -2
- package/dist/cjs/bs-accordion-group.cjs.entry.js +33 -0
- package/dist/cjs/bs-accordion.cjs.entry.js +1 -1
- package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +2 -2
- package/dist/cjs/bs-ai-greeting.cjs.entry.js +2 -2
- package/dist/cjs/bs-ai-thinking.cjs.entry.js +2 -2
- package/dist/cjs/bs-attachment-list.cjs.entry.js +2 -2
- package/dist/cjs/bs-attachment.cjs.entry.js +9 -5
- package/dist/cjs/bs-avatar.cjs.entry.js +1 -1
- package/dist/cjs/bs-badge.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumb-overflow.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumbs.cjs.entry.js +2 -2
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +4 -2
- package/dist/cjs/bs-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-card.cjs.entry.js +1 -1
- package/dist/cjs/bs-carousel.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +18 -2
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +20 -2
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +25 -3
- package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +4 -2
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +3 -3
- package/dist/cjs/bs-checkbox-skeleton.cjs.entry.js +4 -2
- package/dist/cjs/bs-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/bs-chip-filter.cjs.entry.js +1 -1
- package/dist/cjs/bs-chip-informative.cjs.entry.js +1 -1
- package/dist/cjs/bs-chip-input.cjs.entry.js +4 -2
- package/dist/cjs/bs-citation-preview.cjs.entry.js +29 -0
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +11 -3
- package/dist/cjs/bs-composer.cjs.entry.js +36 -7
- package/dist/cjs/bs-cookie-consent.cjs.entry.js +1 -1
- package/dist/cjs/bs-data-table.cjs.entry.js +5 -3
- package/dist/cjs/bs-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/bs-dialog.cjs.entry.js +4 -2
- package/dist/cjs/bs-error-page.cjs.entry.js +1 -1
- package/dist/cjs/bs-file-upload-item.cjs.entry.js +1 -1
- package/dist/cjs/bs-file-upload.cjs.entry.js +1 -1
- package/dist/cjs/bs-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-icon-tile.cjs.entry.js +1 -1
- package/dist/cjs/bs-inline-tab.cjs.entry.js +2 -2
- package/dist/cjs/bs-input_3.cjs.entry.js +15 -7
- package/dist/cjs/bs-logo.cjs.entry.js +1 -1
- package/dist/cjs/bs-message-list.cjs.entry.js +71 -0
- package/dist/cjs/bs-message.cjs.entry.js +25 -0
- package/dist/cjs/bs-navigation-drawer-item.cjs.entry.js +2 -2
- package/dist/cjs/bs-navigation-drawer.cjs.entry.js +9 -3
- package/dist/cjs/bs-navigation-header.cjs.entry.js +2 -2
- package/dist/cjs/bs-onboarding-checklist.cjs.entry.js +1 -1
- package/dist/cjs/bs-pagination.cjs.entry.js +6 -2
- package/dist/cjs/bs-popover.cjs.entry.js +153 -0
- package/dist/cjs/bs-product-tour.cjs.entry.js +1 -1
- package/dist/cjs/bs-progress-linear.cjs.entry.js +3 -3
- package/dist/cjs/bs-progress.cjs.entry.js +3 -3
- package/dist/cjs/bs-qr-code.cjs.entry.js +2 -2
- package/dist/cjs/bs-radio.cjs.entry.js +2 -2
- package/dist/cjs/bs-session-timeout.cjs.entry.js +2 -2
- package/dist/cjs/bs-side-panel.cjs.entry.js +164 -0
- package/dist/cjs/bs-skeleton.cjs.entry.js +51 -0
- package/dist/cjs/bs-slider.cjs.entry.js +7 -3
- package/dist/cjs/bs-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/bs-source-link.cjs.entry.js +3 -3
- package/dist/cjs/bs-spinner.cjs.entry.js +24 -0
- package/dist/cjs/bs-stepper-step.cjs.entry.js +2 -2
- package/dist/cjs/bs-stepper.cjs.entry.js +2 -2
- package/dist/cjs/bs-switch.cjs.entry.js +2 -2
- package/dist/cjs/bs-tab_3.cjs.entry.js +4 -4
- package/dist/cjs/bs-timepicker.cjs.entry.js +8 -4
- package/dist/cjs/bs-toast.cjs.entry.js +4 -2
- package/dist/cjs/bs-tooltip-trigger.cjs.entry.js +46 -0
- package/dist/cjs/bs-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/bs-whats-new.cjs.entry.js +1 -1
- package/dist/cjs/index-BYfMRtlW.js +1863 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +9 -0
- package/dist/collection/components/bs-accordion-group/bs-accordion-group.cmp.test.js +39 -0
- package/dist/collection/components/bs-accordion-group/bs-accordion-group.css +10 -0
- package/dist/collection/components/bs-accordion-group/bs-accordion-group.js +86 -0
- package/dist/collection/components/bs-accordion-group/bs-accordion-group.stories.js +18 -0
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +1 -1
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +1 -1
- package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +1 -1
- package/dist/collection/components/bs-attachment/bs-attachment.js +48 -4
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +1 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.js +1 -1
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +23 -1
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.cmp.test.js +10 -0
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +178 -2
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.cmp.test.js +6 -0
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +200 -1
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.cmp.test.js +8 -0
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.css +4 -0
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +223 -1
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +24 -2
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.css +1 -4
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +3 -6
- package/dist/collection/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.js +23 -1
- package/dist/collection/components/bs-chip/bs-chip-input/bs-chip-input.js +23 -1
- package/dist/collection/components/bs-citation-preview/bs-citation-preview.cmp.test.js +34 -0
- package/dist/collection/components/bs-citation-preview/bs-citation-preview.css +36 -0
- package/dist/collection/components/bs-citation-preview/bs-citation-preview.js +154 -0
- package/dist/collection/components/bs-citation-preview/bs-citation-preview.stories.js +22 -0
- package/dist/collection/components/bs-composer/bs-composer.cmp.test.js +29 -2
- package/dist/collection/components/bs-composer/bs-composer.css +16 -0
- package/dist/collection/components/bs-composer/bs-composer.js +234 -6
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.js +5 -0
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.css +16 -0
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.js +49 -1
- package/dist/collection/components/bs-data-table/bs-data-table.js +24 -2
- package/dist/collection/components/bs-dialog/bs-dialog.js +23 -1
- package/dist/collection/components/bs-input/bs-input.js +92 -4
- package/dist/collection/components/bs-menu/bs-menu.js +1 -1
- package/dist/collection/components/bs-menu-item/bs-menu-item.js +1 -1
- package/dist/collection/components/bs-message/bs-message.cmp.test.js +36 -0
- package/dist/collection/components/bs-message/bs-message.css +77 -0
- package/dist/collection/components/bs-message/bs-message.js +156 -0
- package/dist/collection/components/bs-message/bs-message.stories.js +33 -0
- package/dist/collection/components/bs-message-list/bs-message-list.cmp.test.js +58 -0
- package/dist/collection/components/bs-message-list/bs-message-list.css +40 -0
- package/dist/collection/components/bs-message-list/bs-message-list.js +161 -0
- package/dist/collection/components/bs-message-list/bs-message-list.stories.js +17 -0
- package/dist/collection/components/bs-pagination/bs-pagination.cmp.test.js +5 -0
- package/dist/collection/components/bs-pagination/bs-pagination.js +45 -1
- package/dist/collection/components/bs-popover/bs-popover.cmp.test.js +107 -0
- package/dist/collection/components/bs-popover/bs-popover.css +61 -0
- package/dist/collection/components/bs-popover/bs-popover.js +247 -0
- package/dist/collection/components/bs-popover/bs-popover.stories.js +26 -0
- package/dist/collection/components/bs-progress/bs-progress.js +2 -2
- package/dist/collection/components/bs-progress-linear/bs-progress-linear.js +2 -2
- package/dist/collection/components/bs-qr-code/bs-qr-code.js +1 -1
- package/dist/collection/components/bs-radio/bs-radio.js +1 -1
- package/dist/collection/components/bs-session-timeout/bs-session-timeout.js +1 -1
- package/dist/collection/components/bs-side-panel/bs-side-panel.cmp.test.js +117 -0
- package/dist/collection/components/bs-side-panel/bs-side-panel.css +77 -0
- package/dist/collection/components/bs-side-panel/bs-side-panel.js +325 -0
- package/dist/collection/components/bs-side-panel/bs-side-panel.stories.js +24 -0
- package/dist/collection/components/bs-skeleton/bs-skeleton.cmp.test.js +49 -0
- package/dist/collection/components/bs-skeleton/bs-skeleton.css +62 -0
- package/dist/collection/components/bs-skeleton/bs-skeleton.js +204 -0
- package/dist/collection/components/bs-skeleton/bs-skeleton.stories.js +43 -0
- package/dist/collection/components/bs-slider/bs-slider.js +46 -2
- package/dist/collection/components/bs-snackbar/bs-snackbar.js +1 -1
- package/dist/collection/components/bs-source-link/bs-source-link.js +2 -2
- package/dist/collection/components/bs-spinner/bs-spinner.cmp.test.js +32 -0
- package/dist/collection/components/bs-spinner/bs-spinner.css +61 -0
- package/dist/collection/components/bs-spinner/bs-spinner.js +96 -0
- package/dist/collection/components/bs-spinner/bs-spinner.stories.js +30 -0
- package/dist/collection/components/bs-stepper/bs-stepper/bs-stepper.js +1 -1
- package/dist/collection/components/bs-stepper/bs-stepper-step/bs-stepper-step.js +1 -1
- package/dist/collection/components/bs-switch/bs-switch.js +1 -1
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.js +1 -1
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.js +1 -1
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.js +1 -1
- package/dist/collection/components/bs-timepicker/bs-timepicker.js +48 -4
- package/dist/collection/components/bs-toast/bs-toast.js +23 -1
- package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
- package/dist/collection/components/bs-tooltip-trigger/bs-tooltip-trigger.cmp.test.js +73 -0
- package/dist/collection/components/bs-tooltip-trigger/bs-tooltip-trigger.css +52 -0
- package/dist/collection/components/bs-tooltip-trigger/bs-tooltip-trigger.js +140 -0
- package/dist/collection/components/bs-tooltip-trigger/bs-tooltip-trigger.stories.js +21 -0
- package/dist/collection/components/bs-whats-new-entry/bs-whats-new-entry.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.js +68 -2
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.js +1 -1
- package/dist/collection/global/brand-theming.cmp.test.js +44 -0
- package/dist/components/bs-accordion-group.d.ts +11 -0
- package/dist/components/bs-accordion-group.js +1 -0
- package/dist/components/bs-accordion.js +1 -1
- package/dist/components/bs-ai-disclaimer.js +1 -1
- package/dist/components/bs-ai-greeting.js +1 -1
- package/dist/components/bs-ai-thinking.js +1 -1
- package/dist/components/bs-attachment-list.js +1 -1
- package/dist/components/bs-attachment.js +1 -1
- package/dist/components/bs-avatar.js +1 -1
- package/dist/components/bs-badge.js +1 -1
- package/dist/components/bs-breadcrumb-overflow.js +1 -1
- package/dist/components/bs-breadcrumb.js +1 -1
- package/dist/components/bs-breadcrumbs.js +1 -1
- package/dist/components/bs-button-skeleton.js +1 -1
- package/dist/components/bs-button.js +1 -1
- package/dist/components/bs-card.js +1 -1
- package/dist/components/bs-carousel.js +1 -1
- package/dist/components/bs-chatbot-feedback.js +1 -1
- package/dist/components/bs-chatbot-header.js +1 -1
- package/dist/components/bs-chatbot-response-action.js +1 -1
- package/dist/components/bs-chatbot-sources-drawer.js +1 -1
- package/dist/components/bs-chatbot-suggestion-button.js +1 -1
- package/dist/components/bs-checkbox-skeleton.js +1 -1
- package/dist/components/bs-checkbox.js +1 -1
- package/dist/components/bs-chip-filter.js +1 -1
- package/dist/components/bs-chip-informative.js +1 -1
- package/dist/components/bs-chip-input.js +1 -1
- package/dist/components/bs-citation-preview.d.ts +11 -0
- package/dist/components/bs-citation-preview.js +1 -0
- package/dist/components/bs-composer-status-banner.js +1 -1
- package/dist/components/bs-composer.js +1 -1
- package/dist/components/bs-cookie-consent.js +1 -1
- package/dist/components/bs-data-table.js +1 -1
- package/dist/components/bs-datepicker.js +1 -1
- package/dist/components/bs-dialog.js +1 -1
- package/dist/components/bs-error-page.js +1 -1
- package/dist/components/bs-file-upload-item.js +1 -1
- package/dist/components/bs-file-upload.js +1 -1
- package/dist/components/bs-icon-button.js +1 -1
- package/dist/components/bs-icon-tile.js +1 -1
- package/dist/components/bs-inline-tab.js +1 -1
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-logo.js +1 -1
- package/dist/components/bs-menu-item.js +1 -1
- package/dist/components/bs-menu.js +1 -1
- package/dist/components/bs-message-list.d.ts +11 -0
- package/dist/components/bs-message-list.js +1 -0
- package/dist/components/bs-message.d.ts +11 -0
- package/dist/components/bs-message.js +1 -0
- package/dist/components/bs-navigation-drawer-item.js +1 -1
- package/dist/components/bs-navigation-drawer.js +1 -1
- package/dist/components/bs-navigation-header.js +1 -1
- package/dist/components/bs-onboarding-checklist.js +1 -1
- package/dist/components/bs-pagination.js +1 -1
- package/dist/components/bs-popover.d.ts +11 -0
- package/dist/components/bs-popover.js +1 -0
- package/dist/components/bs-product-tour.js +1 -1
- package/dist/components/bs-progress-linear.js +1 -1
- package/dist/components/bs-progress.js +1 -1
- package/dist/components/bs-qr-code.js +1 -1
- package/dist/components/bs-radio.js +1 -1
- package/dist/components/bs-session-timeout.js +1 -1
- package/dist/components/bs-side-panel.d.ts +11 -0
- package/dist/components/bs-side-panel.js +1 -0
- package/dist/components/bs-skeleton.d.ts +11 -0
- package/dist/components/bs-skeleton.js +1 -0
- package/dist/components/bs-slider.js +1 -1
- package/dist/components/bs-snackbar.js +1 -1
- package/dist/components/bs-source-link.js +1 -1
- package/dist/components/bs-spinner.d.ts +11 -0
- package/dist/components/bs-spinner.js +1 -0
- package/dist/components/bs-stepper-step.js +1 -1
- package/dist/components/bs-stepper.js +1 -1
- package/dist/components/bs-switch.js +1 -1
- package/dist/components/bs-tab.js +1 -1
- package/dist/components/bs-tabs.js +1 -1
- package/dist/components/bs-timepicker.js +1 -1
- package/dist/components/bs-toast.js +1 -1
- package/dist/components/bs-tooltip-trigger.d.ts +11 -0
- package/dist/components/bs-tooltip-trigger.js +1 -0
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/bs-whats-new-entry.js +1 -1
- package/dist/components/bs-whats-new.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-B2gx7SZk.js +1 -0
- package/dist/components/{p-BEEoVNRu.js → p-BTPdjnXT.js} +1 -1
- package/dist/components/{p-Be9L4_Fe.js → p-BVhF8cZQ.js} +1 -1
- package/dist/components/{p-C_j_jDM6.js → p-Bfq5YVOv.js} +1 -1
- package/dist/components/{p-DE8K7fg0.js → p-C2NR1v3p.js} +1 -1
- package/dist/components/{p-YsHQLXET.js → p-C9jIMBG3.js} +1 -1
- package/dist/components/{p-DuLL7Ouw.js → p-CRtvJlh8.js} +1 -1
- package/dist/components/{p-Dr0Qk9Zc.js → p-ChcaPfNL.js} +1 -1
- package/dist/components/{p-CbimDNGY.js → p-CrmEXUwm.js} +1 -1
- package/dist/components/p-Cu-aeY9t.js +1 -0
- package/dist/components/{p-zTHlbyH6.js → p-DAwSBMeM.js} +1 -1
- package/dist/components/{p-qmS2CBqi.js → p-DYuzgzxI.js} +1 -1
- package/dist/components/p-DfzrJKwN.js +1 -0
- package/dist/components/{p-CUfs0ROR.js → p-DpVeeIko.js} +1 -1
- package/dist/components/p-DqXI9V2A.js +1 -0
- package/dist/components/p-Dqg8l1y6.js +1 -0
- package/dist/components/{p-CA31vqjL.js → p-DvNED6Lb.js} +1 -1
- package/dist/components/{p-C8yT2Ucq.js → p-QnTjSed5.js} +1 -1
- package/dist/components/{p-CncySD_-.js → p-Rx4bpeYN.js} +1 -1
- package/dist/components/{p-Be_Pmccm.js → p-owdeCW0M.js} +1 -1
- package/dist/components/{p-Bl_tVzeq.js → p-uHvS81XA.js} +1 -1
- package/dist/esm/brandsync-wc.js +3 -3
- package/dist/esm/bs-accordion-group.entry.js +31 -0
- package/dist/esm/bs-accordion.entry.js +1 -1
- package/dist/esm/bs-ai-disclaimer.entry.js +2 -2
- package/dist/esm/bs-ai-greeting.entry.js +2 -2
- package/dist/esm/bs-ai-thinking.entry.js +2 -2
- package/dist/esm/bs-attachment-list.entry.js +2 -2
- package/dist/esm/bs-attachment.entry.js +9 -5
- package/dist/esm/bs-avatar.entry.js +1 -1
- package/dist/esm/bs-badge.entry.js +1 -1
- package/dist/esm/bs-breadcrumb-overflow.entry.js +1 -1
- package/dist/esm/bs-breadcrumb.entry.js +1 -1
- package/dist/esm/bs-breadcrumbs.entry.js +2 -2
- package/dist/esm/bs-button-skeleton.entry.js +4 -2
- package/dist/esm/bs-button.entry.js +1 -1
- package/dist/esm/bs-card.entry.js +1 -1
- package/dist/esm/bs-carousel.entry.js +1 -1
- package/dist/esm/bs-chatbot-feedback.entry.js +18 -2
- package/dist/esm/bs-chatbot-header.entry.js +20 -2
- package/dist/esm/bs-chatbot-response-action.entry.js +25 -3
- package/dist/esm/bs-chatbot-sources-drawer.entry.js +4 -2
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +3 -3
- package/dist/esm/bs-checkbox-skeleton.entry.js +4 -2
- package/dist/esm/bs-checkbox.entry.js +1 -1
- package/dist/esm/bs-chip-filter.entry.js +1 -1
- package/dist/esm/bs-chip-informative.entry.js +1 -1
- package/dist/esm/bs-chip-input.entry.js +4 -2
- package/dist/esm/bs-citation-preview.entry.js +27 -0
- package/dist/esm/bs-composer-status-banner.entry.js +11 -3
- package/dist/esm/bs-composer.entry.js +36 -7
- package/dist/esm/bs-cookie-consent.entry.js +1 -1
- package/dist/esm/bs-data-table.entry.js +5 -3
- package/dist/esm/bs-datepicker.entry.js +1 -1
- package/dist/esm/bs-dialog.entry.js +4 -2
- package/dist/esm/bs-error-page.entry.js +1 -1
- package/dist/esm/bs-file-upload-item.entry.js +1 -1
- package/dist/esm/bs-file-upload.entry.js +1 -1
- package/dist/esm/bs-icon-button.entry.js +1 -1
- package/dist/esm/bs-icon-tile.entry.js +1 -1
- package/dist/esm/bs-inline-tab.entry.js +2 -2
- package/dist/esm/bs-input_3.entry.js +15 -7
- package/dist/esm/bs-logo.entry.js +1 -1
- package/dist/esm/bs-message-list.entry.js +69 -0
- package/dist/esm/bs-message.entry.js +23 -0
- package/dist/esm/bs-navigation-drawer-item.entry.js +2 -2
- package/dist/esm/bs-navigation-drawer.entry.js +9 -3
- package/dist/esm/bs-navigation-header.entry.js +2 -2
- package/dist/esm/bs-onboarding-checklist.entry.js +1 -1
- package/dist/esm/bs-pagination.entry.js +6 -2
- package/dist/esm/bs-popover.entry.js +151 -0
- package/dist/esm/bs-product-tour.entry.js +1 -1
- package/dist/esm/bs-progress-linear.entry.js +3 -3
- package/dist/esm/bs-progress.entry.js +3 -3
- package/dist/esm/bs-qr-code.entry.js +2 -2
- package/dist/esm/bs-radio.entry.js +2 -2
- package/dist/esm/bs-session-timeout.entry.js +2 -2
- package/dist/esm/bs-side-panel.entry.js +162 -0
- package/dist/esm/bs-skeleton.entry.js +49 -0
- package/dist/esm/bs-slider.entry.js +7 -3
- package/dist/esm/bs-snackbar.entry.js +2 -2
- package/dist/esm/bs-source-link.entry.js +3 -3
- package/dist/esm/bs-spinner.entry.js +22 -0
- package/dist/esm/bs-stepper-step.entry.js +2 -2
- package/dist/esm/bs-stepper.entry.js +2 -2
- package/dist/esm/bs-switch.entry.js +2 -2
- package/dist/esm/bs-tab_3.entry.js +4 -4
- package/dist/esm/bs-timepicker.entry.js +8 -4
- package/dist/esm/bs-toast.entry.js +4 -2
- package/dist/esm/bs-tooltip-trigger.entry.js +44 -0
- package/dist/esm/bs-tooltip.entry.js +2 -2
- package/dist/esm/bs-whats-new.entry.js +1 -1
- package/dist/esm/index-D3SkQJpw.js +1853 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/bs-accordion-group/bs-accordion-group.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-accordion-group/bs-accordion-group.d.ts +25 -0
- package/dist/types/components/bs-accordion-group/bs-accordion-group.stories.d.ts +9 -0
- package/dist/types/components/bs-attachment/bs-attachment.d.ts +4 -0
- package/dist/types/components/bs-button-skeleton/bs-button-skeleton.d.ts +2 -0
- package/dist/types/components/bs-chatbot-feedback/bs-chatbot-feedback.d.ts +16 -0
- package/dist/types/components/bs-chatbot-header/bs-chatbot-header.d.ts +19 -0
- package/dist/types/components/bs-chatbot-response-action/bs-chatbot-response-action.d.ts +22 -0
- package/dist/types/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.d.ts +2 -0
- package/dist/types/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.d.ts +2 -5
- package/dist/types/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.d.ts +2 -0
- package/dist/types/components/bs-chip/bs-chip-input/bs-chip-input.d.ts +2 -0
- package/dist/types/components/bs-citation-preview/bs-citation-preview.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-citation-preview/bs-citation-preview.d.ts +40 -0
- package/dist/types/components/bs-citation-preview/bs-citation-preview.stories.d.ts +13 -0
- package/dist/types/components/bs-composer/bs-composer.d.ts +25 -1
- package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.d.ts +5 -0
- package/dist/types/components/bs-data-table/bs-data-table.d.ts +2 -0
- package/dist/types/components/bs-dialog/bs-dialog.d.ts +2 -0
- package/dist/types/components/bs-input/bs-input.d.ts +8 -0
- package/dist/types/components/bs-message/bs-message.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-message/bs-message.d.ts +49 -0
- package/dist/types/components/bs-message/bs-message.stories.d.ts +15 -0
- package/dist/types/components/bs-message-list/bs-message-list.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-message-list/bs-message-list.d.ts +44 -0
- package/dist/types/components/bs-message-list/bs-message-list.stories.d.ts +8 -0
- package/dist/types/components/bs-pagination/bs-pagination.d.ts +4 -0
- package/dist/types/components/bs-popover/bs-popover.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-popover/bs-popover.d.ts +58 -0
- package/dist/types/components/bs-popover/bs-popover.stories.d.ts +11 -0
- package/dist/types/components/bs-side-panel/bs-side-panel.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-side-panel/bs-side-panel.d.ts +67 -0
- package/dist/types/components/bs-side-panel/bs-side-panel.stories.d.ts +14 -0
- package/dist/types/components/bs-skeleton/bs-skeleton.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-skeleton/bs-skeleton.d.ts +44 -0
- package/dist/types/components/bs-skeleton/bs-skeleton.stories.d.ts +17 -0
- package/dist/types/components/bs-slider/bs-slider.d.ts +4 -0
- package/dist/types/components/bs-spinner/bs-spinner.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-spinner/bs-spinner.d.ts +32 -0
- package/dist/types/components/bs-spinner/bs-spinner.stories.d.ts +12 -0
- package/dist/types/components/bs-timepicker/bs-timepicker.d.ts +4 -0
- package/dist/types/components/bs-toast/bs-toast.d.ts +2 -0
- package/dist/types/components/bs-tooltip-trigger/bs-tooltip-trigger.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-tooltip-trigger/bs-tooltip-trigger.d.ts +35 -0
- package/dist/types/components/bs-tooltip-trigger/bs-tooltip-trigger.stories.d.ts +10 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.d.ts +6 -0
- package/dist/types/components.d.ts +1778 -38
- package/dist/types/global/brand-theming.cmp.test.d.ts +1 -0
- package/package.json +21 -5
- package/reference.d.ts +242 -0
- package/reference.json +4176 -0
- package/reference.mjs +2 -0
- package/tailwind-preset.cjs +36 -0
- package/testing/vitest-setup.mjs +41 -0
- package/dist/brandsync-wc/p-09cbf05b.entry.js +0 -1
- package/dist/brandsync-wc/p-0f8cd2e8.entry.js +0 -1
- package/dist/brandsync-wc/p-1261f0b0.entry.js +0 -1
- package/dist/brandsync-wc/p-20030f4d.entry.js +0 -1
- package/dist/brandsync-wc/p-22f8201a.entry.js +0 -1
- package/dist/brandsync-wc/p-34e5feaf.entry.js +0 -1
- package/dist/brandsync-wc/p-452f9c1c.entry.js +0 -1
- package/dist/brandsync-wc/p-6a696161.entry.js +0 -1
- package/dist/brandsync-wc/p-6c6cdf77.entry.js +0 -1
- package/dist/brandsync-wc/p-6e735e37.entry.js +0 -1
- package/dist/brandsync-wc/p-73f214ed.entry.js +0 -1
- package/dist/brandsync-wc/p-823ab3b2.entry.js +0 -1
- package/dist/brandsync-wc/p-DqQRXQMx.js +0 -3
- package/dist/brandsync-wc/p-b84366a7.entry.js +0 -1
- package/dist/brandsync-wc/p-b8d2ce91.entry.js +0 -1
- package/dist/brandsync-wc/p-b9a4042e.entry.js +0 -1
- package/dist/brandsync-wc/p-d754ee13.entry.js +0 -1
- package/dist/brandsync-wc/p-d75f3f87.entry.js +0 -1
- package/dist/brandsync-wc/p-d8b29a53.entry.js +0 -1
- package/dist/brandsync-wc/p-f7d15fbe.entry.js +0 -1
- package/dist/cjs/index-tFJjflK5.js +0 -1863
- package/dist/components/p-BGW5q5LZ.js +0 -1
- package/dist/components/p-BZ3M4lOU.js +0 -1
- package/dist/components/p-CVrEuVFo.js +0 -1
- package/dist/components/p-CeUK3n7D.js +0 -1
- package/dist/esm/index-DqQRXQMx.js +0 -1853
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
let popoverId = 0;
|
|
3
|
+
/**
|
|
4
|
+
* A trigger plus a popup panel that opens on trigger click and closes on outside click or Escape.
|
|
5
|
+
*
|
|
6
|
+
* The popup is positioned with CSS (absolute, relative to the host) and flips to the opposite side
|
|
7
|
+
* when it would overflow the viewport; the effective placement is mirrored on the host as
|
|
8
|
+
* `data-placement`. Focus moves into the popup on open and back to the trigger on close. The popup content is slotted, so it is typically a `bs-menu` or a list.
|
|
9
|
+
*
|
|
10
|
+
* ## When to use
|
|
11
|
+
* - A menu, language list or small set of options revealed from a button.
|
|
12
|
+
*
|
|
13
|
+
* ## When not to use
|
|
14
|
+
* - A blocking decision (use `bs-dialog`) or a hover-only hint (use `bs-tooltip-trigger`).
|
|
15
|
+
*
|
|
16
|
+
* @slot trigger - The element that toggles the popup (e.g. a `bs-button`).
|
|
17
|
+
* @slot - Default slot: the popup content.
|
|
18
|
+
* @part trigger - The wrapper around the trigger; carries aria-expanded/aria-haspopup/aria-controls.
|
|
19
|
+
* @part popup - The popup surface.
|
|
20
|
+
* @prop --bs-popover-bg - Popup background. Aliased to `--bs-surface-raised`.
|
|
21
|
+
* @prop --bs-popover-radius - Popup corner radius. Aliased to `--bs-border-radius-100`.
|
|
22
|
+
* @prop --bs-popover-shadow - Popup shadow. Aliased to `--bs-shadow-md`.
|
|
23
|
+
* @prop --bs-popover-offset - Gap between trigger and popup. Aliased to `--bs-spacing-100`.
|
|
24
|
+
* @prop --bs-popover-min-width - Minimum popup width. Aliased to `--bs-scale-1600`.
|
|
25
|
+
* @prop --bs-popover-z-index - Popup stacking order. Aliased to `--bs-z-index-popover`.
|
|
26
|
+
*/
|
|
27
|
+
export class BsPopover {
|
|
28
|
+
el;
|
|
29
|
+
/** Whether the popup is shown. */
|
|
30
|
+
open = false;
|
|
31
|
+
/** Where the popup sits relative to the trigger. */
|
|
32
|
+
placement = 'bottom-start';
|
|
33
|
+
/** Emitted when the open state changes through user interaction, with the new value. */
|
|
34
|
+
bsOpenChange;
|
|
35
|
+
popupId = `bs-popover-${++popoverId}`;
|
|
36
|
+
triggerSlot;
|
|
37
|
+
popupEl;
|
|
38
|
+
needsFocusIn = false;
|
|
39
|
+
escaped = false;
|
|
40
|
+
onOpenChange(next) {
|
|
41
|
+
this.detach();
|
|
42
|
+
if (next) {
|
|
43
|
+
document.addEventListener('click', this.onDocClick, true);
|
|
44
|
+
document.addEventListener('keydown', this.onKeyDown);
|
|
45
|
+
window.addEventListener('resize', this.reposition);
|
|
46
|
+
window.addEventListener('scroll', this.reposition, true);
|
|
47
|
+
this.needsFocusIn = true;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.needsFocusIn = false;
|
|
51
|
+
this.el.setAttribute('data-placement', this.placement);
|
|
52
|
+
const active = this.el.shadowRoot?.activeElement || document.activeElement;
|
|
53
|
+
const focusInside = this.el.contains(document.activeElement) && document.activeElement !== this.triggerSlot?.assignedElements()[0] && !this.isInTrigger(document.activeElement);
|
|
54
|
+
if (this.escaped || (focusInside && active))
|
|
55
|
+
this.focusTrigger();
|
|
56
|
+
}
|
|
57
|
+
this.escaped = false;
|
|
58
|
+
}
|
|
59
|
+
onPlacementChange() {
|
|
60
|
+
this.reposition();
|
|
61
|
+
}
|
|
62
|
+
componentWillLoad() {
|
|
63
|
+
this.el.setAttribute('data-placement', this.placement);
|
|
64
|
+
}
|
|
65
|
+
componentDidRender() {
|
|
66
|
+
if (!this.open)
|
|
67
|
+
return;
|
|
68
|
+
this.reposition();
|
|
69
|
+
if (this.needsFocusIn) {
|
|
70
|
+
this.needsFocusIn = false;
|
|
71
|
+
this.focusPopup();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
isInTrigger(node) {
|
|
75
|
+
const first = this.triggerSlot?.assignedElements() ?? [];
|
|
76
|
+
return !!node && first.some(t => t.contains(node));
|
|
77
|
+
}
|
|
78
|
+
/** Effective placement after collision flipping; mirrored on the host as `data-placement`. */
|
|
79
|
+
reposition = () => {
|
|
80
|
+
if (!this.open || !this.popupEl)
|
|
81
|
+
return;
|
|
82
|
+
const [v, h] = this.placement.split('-');
|
|
83
|
+
// Measure from the preferred placement.
|
|
84
|
+
this.el.setAttribute('data-placement', this.placement);
|
|
85
|
+
const trig = this.el.getBoundingClientRect();
|
|
86
|
+
const pop = this.popupEl.getBoundingClientRect();
|
|
87
|
+
const vh = window.innerHeight;
|
|
88
|
+
const vw = window.innerWidth;
|
|
89
|
+
let rv = v;
|
|
90
|
+
let rh = h;
|
|
91
|
+
if (v === 'bottom' && pop.bottom > vh && trig.top >= pop.height)
|
|
92
|
+
rv = 'top';
|
|
93
|
+
else if (v === 'top' && pop.top < 0 && vh - trig.bottom >= pop.height)
|
|
94
|
+
rv = 'bottom';
|
|
95
|
+
if (h === 'start' && pop.right > vw && trig.right >= pop.width)
|
|
96
|
+
rh = 'end';
|
|
97
|
+
else if (h === 'end' && pop.left < 0 && vw - trig.left >= pop.width)
|
|
98
|
+
rh = 'start';
|
|
99
|
+
this.el.setAttribute('data-placement', `${rv}-${rh}`);
|
|
100
|
+
};
|
|
101
|
+
focusPopup() {
|
|
102
|
+
const sel = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
103
|
+
const slot = this.popupEl?.querySelector('slot');
|
|
104
|
+
const assigned = slot?.assignedElements({ flatten: true }) ?? [];
|
|
105
|
+
for (const a of assigned) {
|
|
106
|
+
const target = a.matches(sel) ? a : a.querySelector(sel);
|
|
107
|
+
if (target) {
|
|
108
|
+
target.focus();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
this.popupEl?.focus();
|
|
113
|
+
}
|
|
114
|
+
disconnectedCallback() {
|
|
115
|
+
this.detach();
|
|
116
|
+
}
|
|
117
|
+
componentDidLoad() {
|
|
118
|
+
if (this.open)
|
|
119
|
+
this.onOpenChange(true);
|
|
120
|
+
}
|
|
121
|
+
detach() {
|
|
122
|
+
document.removeEventListener('click', this.onDocClick, true);
|
|
123
|
+
document.removeEventListener('keydown', this.onKeyDown);
|
|
124
|
+
window.removeEventListener('resize', this.reposition);
|
|
125
|
+
window.removeEventListener('scroll', this.reposition, true);
|
|
126
|
+
}
|
|
127
|
+
setOpen(next) {
|
|
128
|
+
if (this.open === next)
|
|
129
|
+
return;
|
|
130
|
+
this.open = next;
|
|
131
|
+
this.bsOpenChange.emit(next);
|
|
132
|
+
}
|
|
133
|
+
focusTrigger() {
|
|
134
|
+
const first = this.triggerSlot?.assignedElements()[0];
|
|
135
|
+
first?.focus();
|
|
136
|
+
}
|
|
137
|
+
onTriggerKeyDown = (ev) => {
|
|
138
|
+
if (ev.key === 'ArrowDown' && !this.open) {
|
|
139
|
+
ev.preventDefault();
|
|
140
|
+
this.setOpen(true);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
onTriggerClick = () => this.setOpen(!this.open);
|
|
144
|
+
onDocClick = (ev) => {
|
|
145
|
+
if (!ev.composedPath().includes(this.el))
|
|
146
|
+
this.setOpen(false);
|
|
147
|
+
};
|
|
148
|
+
onKeyDown = (ev) => {
|
|
149
|
+
if (ev.key === 'Escape' && this.open) {
|
|
150
|
+
this.escaped = true;
|
|
151
|
+
this.setOpen(false);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
render() {
|
|
155
|
+
return (h("div", { key: 'e4e96eb40953abdd3f5f9a9169cfe2b9ad87d3b5', class: "bs-popover" }, h("div", { key: '6456d7cb3cba9e243015086095534cad82716711', part: "trigger", class: "bs-popover__trigger", "aria-haspopup": "true", "aria-expanded": String(this.open), "aria-controls": this.popupId, onClick: this.onTriggerClick, onKeyDown: this.onTriggerKeyDown }, h("slot", { key: '1a1d545bf0afc0a59e4f9f7f29bf359cc2264c65', name: "trigger", ref: el => (this.triggerSlot = el) })), h("div", { key: '8a1e1e3ade63f2cba665368f3bd2659ce659ee18', part: "popup", id: this.popupId, class: "bs-popover__popup", tabindex: "-1", hidden: !this.open, ref: el => (this.popupEl = el) }, h("slot", { key: 'abdeeb2105d00487a43f23dd6021c61b533e8139' }))));
|
|
156
|
+
}
|
|
157
|
+
static get is() { return "bs-popover"; }
|
|
158
|
+
static get encapsulation() { return "shadow"; }
|
|
159
|
+
static get originalStyleUrls() {
|
|
160
|
+
return {
|
|
161
|
+
"$": ["bs-popover.css"]
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
static get styleUrls() {
|
|
165
|
+
return {
|
|
166
|
+
"$": ["bs-popover.css"]
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
static get properties() {
|
|
170
|
+
return {
|
|
171
|
+
"open": {
|
|
172
|
+
"type": "boolean",
|
|
173
|
+
"mutable": true,
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "boolean",
|
|
176
|
+
"resolved": "boolean",
|
|
177
|
+
"references": {}
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"optional": false,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": "Whether the popup is shown."
|
|
184
|
+
},
|
|
185
|
+
"getter": false,
|
|
186
|
+
"setter": false,
|
|
187
|
+
"reflect": true,
|
|
188
|
+
"attribute": "open",
|
|
189
|
+
"defaultValue": "false"
|
|
190
|
+
},
|
|
191
|
+
"placement": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"mutable": false,
|
|
194
|
+
"complexType": {
|
|
195
|
+
"original": "BsPopoverPlacement",
|
|
196
|
+
"resolved": "\"bottom-end\" | \"bottom-start\" | \"top-end\" | \"top-start\"",
|
|
197
|
+
"references": {
|
|
198
|
+
"BsPopoverPlacement": {
|
|
199
|
+
"location": "local",
|
|
200
|
+
"path": "/home/runner/work/eg-brandsync-storybook/eg-brandsync-storybook/packages/wc/src/components/bs-popover/bs-popover.tsx",
|
|
201
|
+
"id": "src/components/bs-popover/bs-popover.tsx::BsPopoverPlacement"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"required": false,
|
|
206
|
+
"optional": false,
|
|
207
|
+
"docs": {
|
|
208
|
+
"tags": [],
|
|
209
|
+
"text": "Where the popup sits relative to the trigger."
|
|
210
|
+
},
|
|
211
|
+
"getter": false,
|
|
212
|
+
"setter": false,
|
|
213
|
+
"reflect": true,
|
|
214
|
+
"attribute": "placement",
|
|
215
|
+
"defaultValue": "'bottom-start'"
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
static get events() {
|
|
220
|
+
return [{
|
|
221
|
+
"method": "bsOpenChange",
|
|
222
|
+
"name": "bsOpenChange",
|
|
223
|
+
"bubbles": true,
|
|
224
|
+
"cancelable": true,
|
|
225
|
+
"composed": true,
|
|
226
|
+
"docs": {
|
|
227
|
+
"tags": [],
|
|
228
|
+
"text": "Emitted when the open state changes through user interaction, with the new value."
|
|
229
|
+
},
|
|
230
|
+
"complexType": {
|
|
231
|
+
"original": "boolean",
|
|
232
|
+
"resolved": "boolean",
|
|
233
|
+
"references": {}
|
|
234
|
+
}
|
|
235
|
+
}];
|
|
236
|
+
}
|
|
237
|
+
static get elementRef() { return "el"; }
|
|
238
|
+
static get watchers() {
|
|
239
|
+
return [{
|
|
240
|
+
"propName": "open",
|
|
241
|
+
"methodName": "onOpenChange"
|
|
242
|
+
}, {
|
|
243
|
+
"propName": "placement",
|
|
244
|
+
"methodName": "onPlacementChange"
|
|
245
|
+
}];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { componentDescription } from "../../stories-utils";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Components/bs-popover',
|
|
5
|
+
parameters: { docs: { description: { component: componentDescription('bs-popover') } } },
|
|
6
|
+
render: args => html `
|
|
7
|
+
<div style="padding: 80px 160px;">
|
|
8
|
+
<bs-popover ?open=${args.open} placement=${args.placement}>
|
|
9
|
+
<bs-button slot="trigger">Language</bs-button>
|
|
10
|
+
<bs-menu>
|
|
11
|
+
<bs-menu-item>English</bs-menu-item>
|
|
12
|
+
<bs-menu-item>Dansk</bs-menu-item>
|
|
13
|
+
</bs-menu>
|
|
14
|
+
</bs-popover>
|
|
15
|
+
</div>
|
|
16
|
+
`,
|
|
17
|
+
argTypes: {
|
|
18
|
+
open: { control: 'boolean' },
|
|
19
|
+
placement: { control: 'select', options: ['bottom-start', 'bottom-end', 'top-start', 'top-end'] },
|
|
20
|
+
},
|
|
21
|
+
args: { open: false, placement: 'bottom-start' },
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
export const Default = {};
|
|
25
|
+
export const Open = { args: { open: true } };
|
|
26
|
+
export const TopEnd = { name: 'Placement top-end', args: { open: true, placement: 'top-end' } };
|
|
@@ -69,7 +69,7 @@ export class BsProgress {
|
|
|
69
69
|
const isDeterminate = this.type === 'determinate';
|
|
70
70
|
const value = this.clampedValue;
|
|
71
71
|
const dashOffset = circumference * (1 - value / 100);
|
|
72
|
-
return (h("div", { key: '
|
|
72
|
+
return (h("div", { key: '2909533f8b4472a7c12c564c3b42b6456d5d1c80', part: "container", class: "bs-progress" }, h("div", { key: '3f41fc7f22d7c9eba13e859330aae4f6230af8ab', class: "bs-progress__box", style: { width: `${diameter}px`, height: `${diameter}px` }, role: "progressbar", "aria-label": this.ariaLabel, "aria-valuemin": isDeterminate ? '0' : undefined, "aria-valuemax": isDeterminate ? '100' : undefined, "aria-valuenow": isDeterminate ? String(value) : undefined, "aria-busy": isDeterminate ? undefined : 'true' }, isDeterminate ? (h("svg", { class: "bs-progress__ring", width: diameter, height: diameter, viewBox: `0 0 ${diameter} ${diameter}` }, h("circle", { part: "track", class: "bs-progress__track", cx: diameter / 2, cy: diameter / 2, r: radius, "stroke-width": this.strokeWidth, fill: "none" }), h("circle", { part: "arc", class: "bs-progress__arc", cx: diameter / 2, cy: diameter / 2, r: radius, "stroke-width": this.strokeWidth, fill: "none", "stroke-linecap": "round", "stroke-dasharray": circumference, "stroke-dashoffset": dashOffset }))) : (
|
|
73
73
|
// Figma's indeterminate ring is a fading "comet tail" (transparent -> solid color),
|
|
74
74
|
// not a flat-colored partial arc -- SVG has no angular/conic gradient primitive, so a
|
|
75
75
|
// CSS conic-gradient (color varying by angle) + a radial-gradient mask (carving the
|
|
@@ -78,7 +78,7 @@ export class BsProgress {
|
|
|
78
78
|
h("div", { part: "arc", class: "bs-progress__spinner", style: {
|
|
79
79
|
'--bs-progress-spinner-stroke-width': `${this.strokeWidth}px`,
|
|
80
80
|
'--bs-progress-spinner-sweep': `${INDETERMINATE_SWEEP_DEGREES}deg`,
|
|
81
|
-
} }))), isDeterminate && this.showLabel && (h("span", { key: '
|
|
81
|
+
} }))), isDeterminate && this.showLabel && (h("span", { key: '417f47612fc45127c4a1832a6cb4122ad16d9579', part: "label", class: `bs-progress__label bs-progress__label--${this.size}` }, value, "%"))));
|
|
82
82
|
}
|
|
83
83
|
static get is() { return "bs-progress"; }
|
|
84
84
|
static get encapsulation() { return "shadow"; }
|
|
@@ -51,13 +51,13 @@ export class BsProgressLinear {
|
|
|
51
51
|
render() {
|
|
52
52
|
const isDeterminate = this.type === 'determinate';
|
|
53
53
|
const value = this.clampedValue;
|
|
54
|
-
return (h("div", { key: '
|
|
54
|
+
return (h("div", { key: 'abdae797c319d17404ea15adf1b312c0f19e0ed9', part: "container", class: "bs-progress-linear" }, h("div", { key: 'ec250c3d5d93c6d6fd4c20d57ea7e7177dac2b91', part: "track", class: `bs-progress-linear__track bs-progress-linear__track--${this.size}`, role: "progressbar", "aria-label": this.ariaLabel, "aria-valuemin": isDeterminate ? '0' : undefined, "aria-valuemax": isDeterminate ? '100' : undefined, "aria-valuenow": isDeterminate ? String(value) : undefined, "aria-busy": isDeterminate ? undefined : 'true' }, isDeterminate ? (h("div", { part: "fill", class: "bs-progress-linear__fill", style: { width: `${value}%` } })) : (
|
|
55
55
|
// Figma's indeterminate bar is a soft "comet" gradient segment (transparent -> blue ->
|
|
56
56
|
// transparent) sliding left-to-right across the track's full width in a loop -- the
|
|
57
57
|
// same fade concept as bs-progress's indeterminate ring's conic-gradient comet tail,
|
|
58
58
|
// but along a straight line via a linear-gradient + `transform: translateX(...)`
|
|
59
59
|
// keyframe animation instead of a rotating conic-gradient.
|
|
60
|
-
h("div", { part: "fill", class: "bs-progress-linear__fill bs-progress-linear__fill--indeterminate" }))), this.showLabel && this.hasLabelContent && (h("span", { key: '
|
|
60
|
+
h("div", { part: "fill", class: "bs-progress-linear__fill bs-progress-linear__fill--indeterminate" }))), this.showLabel && this.hasLabelContent && (h("span", { key: 'd7fd99b0b5666b83cd597086a2643a919b9b9d5c', part: "label", class: "bs-progress-linear__label" }, h("slot", { key: '81adeaf185aa995907b317b960fffa4b684404e4' })))));
|
|
61
61
|
}
|
|
62
62
|
// The default slot's assigned content lives in the host's light DOM regardless of whether a
|
|
63
63
|
// <slot> is currently rendered in the shadow tree, so this can be computed directly from the
|
|
@@ -168,7 +168,7 @@ export class BsQrCode {
|
|
|
168
168
|
const buttonSize = this.size === 'sm' ? 'sm' : 'md';
|
|
169
169
|
// Figma shows the unavailable actions as filled-disabled (grey) rather than a faded outline,
|
|
170
170
|
// which is what bs-button's disabled primary looks like.
|
|
171
|
-
return (h("bs-card", { key: '
|
|
171
|
+
return (h("bs-card", { key: '01dc0befd273aecce2437e98987fa6a76555a65c', part: "container", class: "bs-qr-code", surface: "base" }, this.closable && (h("bs-icon-button", { key: 'b611e446cbaa4267f7cfcb6e1baa1352e316994c', part: "close", class: "bs-qr-code__close", variant: "subtle", size: "sm", ariaLabel: this.closeLabel, onClick: () => this.bsClose.emit() }, h("svg", { key: 'c3af9b06190a8d98e80a1ba5aa32a614cf706ef8', viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", "stroke-width": "1.6", "stroke-linecap": "round", "aria-hidden": "true" }, h("path", { key: 'bc86434823fabb3375bd2aa7c8382b33ed94e293', d: "M5 5L15 15M15 5L5 15" })))), h("div", { key: '95520bbba236876975ca8097f923162c9af84505', class: "bs-qr-code__body" }, h("div", { key: '1c5ab32fd408dfb874914848daf611d5ede8fc15', part: "head", class: "bs-qr-code__head" }, h("p", { key: '765b6700e9d73ad9858e7dfed25adba98d9f37a4', part: "title", class: "bs-qr-code__title" }, this.heading), this.description && (h("p", { key: '9994b60173dfdce115ab249122f29d17f8e530da', part: "description", class: "bs-qr-code__description" }, this.description))), h("div", { key: '9a32be6fa563ff3ed7f7825ce793cd1521989dbe', part: "qr", class: "bs-qr-code__qr" }, h("div", { key: '9aa3199f1d5dac68eb4b3d8c6e490199964715ab', part: "code", class: "bs-qr-code__code" }, h("slot", { key: 'e859ada22ca6dad597fb2d3c239662a51b43b39c', name: "code" }, this.renderMatrix()), h("div", { key: '49023d47353f7eac10d46d7be68be8691be50455', part: "logo", class: { 'bs-qr-code__logo': true, 'bs-qr-code__logo--visible': this.hasLogo } }, h("slot", { key: '53125aeb2c4891ca790268f9ef5ee3ba37cae5f0', name: "logo", onSlotchange: (ev) => (this.hasLogo = ev.target.assignedNodes().length > 0) }))), this.renderOverlay()), this.type === 'payment' && this.amount && (h("div", { key: '2714b2a6513da5442809292f78b31141ee77ce81', part: "amount", class: "bs-qr-code__amount" }, this.amountLabel && h("p", { key: '51573f23cf8d2c3a0b7e3df2a9ff212f18c92539', class: "bs-qr-code__amount-label" }, this.amountLabel), h("p", { key: 'dc7c005152c216ababde9282c385856e8d6b3b57', class: "bs-qr-code__amount-value" }, this.amount))), this.type === 'default' && this.url && (h("div", { key: 'a3f3c4d1ceea0ba079ca204a1acd5447551f86f4', part: "url", class: "bs-qr-code__url" }, this.url)), this.expiry && (h("bs-chip-informative", { key: '39d95354200ccf4cfbfc9dc3c15da200955fa2f5', part: "expiry", size: "md" }, h(TimerIcon, { key: '7244fd36a173052caf4db2e4f0f2ad05f3569341', slot: "icon" }), this.expiry)), showActions && (h("div", { key: 'f6c808132c0ca1d8af27b8aedf5cc5f86a3ba7e8', part: "actions", class: "bs-qr-code__actions" }, !this.hideDownload && (h("bs-button", { key: 'ff50126a297987518e4e174c08db438560671d95', part: "download", variant: interactive ? 'outlined' : 'primary', size: buttonSize, disabled: !interactive, onClick: () => interactive && this.bsDownload.emit() }, h(DownloadIcon, { key: 'e7c982907553a6607b3c941c77a4f88876c71c85', slot: "icon" }), this.downloadLabel)), !this.hideCopy && (h("bs-button", { key: 'bc603f4ba0a2bfa12112806b2eb2a04ccec60568', part: "copy", variant: interactive ? 'outlined' : 'primary', size: buttonSize, disabled: !interactive, onClick: () => interactive && this.onCopy() }, h(CopyIcon, { key: '35e27d196c9475f5b0be1dd0e389b699d08ec7db', slot: "icon" }), this.copyLabel)))))));
|
|
172
172
|
}
|
|
173
173
|
static get is() { return "bs-qr-code"; }
|
|
174
174
|
static get encapsulation() { return "shadow"; }
|
|
@@ -104,7 +104,7 @@ export class BsRadio {
|
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
render() {
|
|
107
|
-
return (h("label", { key: '
|
|
107
|
+
return (h("label", { key: 'f02d321e89bfff6bf56aa3f28dbe04082de6892d', class: `bs-radio ${this.disabled ? 'bs-radio--disabled' : ''}` }, h("input", { key: '81085f1ccf0c341b8827b4516da4971eca708ba8', class: "bs-radio__input", type: "radio", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, tabIndex: this.checked || !this.groupHasChecked ? 0 : -1, onKeyDown: this.onKeyDown, onChange: this.onChange }), h("span", { key: '7bbe2f5e7f391aa811377aac1173d6b2a3ef7161', class: "bs-radio__hit-area" }, h("span", { key: '7c9e6d0d8b16ec338ffb9daa496ca7aa524d5f08', class: "bs-radio__state-layer" }, h("span", { key: '26dc982e2691a8fc2db174a7ea53a56cd331b0c9', part: "circle", class: `bs-radio__circle ${this.checked ? 'bs-radio__circle--selected' : ''}` }, this.checked && h("span", { key: 'f6335bd0f5b200e510bca2fcd04507cd6d2a2dc0', part: "dot", class: "bs-radio__dot" })))), h("span", { key: '859d9f7ed854b2df6884bb5217a3889063d38689', part: "label", class: "bs-radio__label" }, h("slot", { key: '771222d57afd4a11ef56fda1b549441356e3fa22' }))));
|
|
108
108
|
}
|
|
109
109
|
static get is() { return "bs-radio"; }
|
|
110
110
|
static get encapsulation() { return "shadow"; }
|
|
@@ -196,7 +196,7 @@ export class BsSessionTimeout {
|
|
|
196
196
|
const description = this.description ?? d.description;
|
|
197
197
|
const primary = this.primaryLabel ?? d.primary;
|
|
198
198
|
const secondary = this.secondaryLabel ?? d.secondary;
|
|
199
|
-
return (h("bs-card", { key: '
|
|
199
|
+
return (h("bs-card", { key: 'a59288c1e524507781d37b23493224c299ca697a', part: "container", class: "bs-session-timeout", surface: "base", role: "region", "aria-labelledby": "heading" }, h("div", { key: 'adde8ef701bc24337fe42998c9f3af0fd3b817bf', class: "bs-session-timeout__body" }, !this.hideIcon && (h("bs-icon-tile", { key: 'a3d1f87b2fcd29a319be7e119bf76c800b343e48', part: "art", intent: d.intent, size: "lg" }, h("slot", { key: '42b9193378bf88f0ea2f4e3ac48a0ff58545d21b', name: "icon" }, d.glyph()))), this.renderHeading(heading, description), this.type === 'warning' && this.renderWarning(), this.type === 'warning' && this.savedMessage && (h("p", { key: 'ed78d1c152d3edcf0db93c7bb8b6d744ae8283c5', part: "saved", class: "bs-session-timeout__saved" }, h(InfoIcon, { key: '7992c624db71b1471ea62b82f5d8c90d438d7ee1' }), h("span", { key: 'a4cdc8e871083a685de65d3e785800ff6af1452e' }, this.savedMessage))), this.type === 'signed-out' && this.renderAccount(), this.type === 'confirm-identity' && this.renderConfirm(), this.type === 'warning' && (primary || secondary) && (h("div", { key: '756f8e8cddd87c273273621d69796be30a9daa3e', part: "actions", class: "bs-session-timeout__actions" }, secondary && (h("bs-button", { key: '525c02f57453d82e5e2105b1f28d8f7ca8e8e1bc', part: "secondary", variant: "outlined", onClick: () => this.bsSecondary.emit() }, secondary)), primary && (h("bs-button", { key: 'daaf10a97c4306a657fce5ec827a067659a2b2d7', part: "primary", variant: "primary", onClick: () => this.bsPrimary.emit() }, primary)))), this.type === 'signed-out' && (primary || secondary) && (h("div", { key: 'f1b52edae2419a8e66b08a681d2f2b917383c90e', part: "actions", class: "bs-session-timeout__actions bs-session-timeout__actions--stacked" }, primary && (h("bs-button", { key: '145f8f09b939c82eef01068bc0e849fc7f63b957', part: "primary", class: "bs-session-timeout__block-button", variant: "primary", onClick: () => this.bsPrimary.emit() }, primary)), secondary && (h("bs-button", { key: '897e5342fe89966702d2af457f9038b60e8929ec', part: "secondary", class: "bs-session-timeout__text-button", variant: "subtle", size: "lg", onClick: () => this.bsSecondary.emit() }, secondary)))), h("div", { key: 'b3f242f4a8b00b52975ed66d9a72ebc98997cf29', class: "bs-session-timeout__sr-only", role: "status", "aria-live": "polite" }, this.announcement))));
|
|
200
200
|
}
|
|
201
201
|
static get is() { return "bs-session-timeout"; }
|
|
202
202
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
2
|
+
describe('bs-side-panel', () => {
|
|
3
|
+
it('renders nothing when closed', async () => {
|
|
4
|
+
const { root } = await render(h("bs-side-panel", { heading: "History" }, "Body"));
|
|
5
|
+
expect(root.shadowRoot.querySelector('[role="dialog"]')).toBeNull();
|
|
6
|
+
});
|
|
7
|
+
it('renders a labelled dialog when open', async () => {
|
|
8
|
+
const { root } = await render(h("bs-side-panel", { open: true, heading: "History" }, "Body"));
|
|
9
|
+
const dialog = root.shadowRoot.querySelector('[role="dialog"]');
|
|
10
|
+
const heading = root.shadowRoot.querySelector('[part="heading"]');
|
|
11
|
+
expect(dialog.getAttribute('aria-labelledby')).toBe(heading.id);
|
|
12
|
+
expect(heading).toHaveTextContent('History');
|
|
13
|
+
});
|
|
14
|
+
it('closes on Escape and emits bsClose', async () => {
|
|
15
|
+
const { root, waitForChanges, spyOnEvent } = await render(h("bs-side-panel", { open: true, heading: "History" }, "Body"));
|
|
16
|
+
const spy = spyOnEvent('bsClose');
|
|
17
|
+
root.shadowRoot.querySelector('[role="dialog"]').dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true, composed: true }));
|
|
18
|
+
await waitForChanges();
|
|
19
|
+
expect(spy).toHaveReceivedEvent();
|
|
20
|
+
expect(root.open).toBe(false);
|
|
21
|
+
});
|
|
22
|
+
it('closes via the close button, using closeLabel', async () => {
|
|
23
|
+
const { root, waitForChanges, spyOnEvent } = await render(h("bs-side-panel", { open: true, heading: "H", closeLabel: "Dismiss" }, "Body"));
|
|
24
|
+
const spy = spyOnEvent('bsClose');
|
|
25
|
+
const btn = root.shadowRoot.querySelector('bs-icon-button');
|
|
26
|
+
expect(btn.getAttribute('aria-label') ?? btn.ariaLabel).toBe('Dismiss');
|
|
27
|
+
btn.click();
|
|
28
|
+
await waitForChanges();
|
|
29
|
+
expect(spy).toHaveReceivedEvent();
|
|
30
|
+
expect(root.open).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
it('only renders the overlay when requested, and overlay click closes', async () => {
|
|
33
|
+
const { root, waitForChanges } = await render(h("bs-side-panel", { open: true, overlay: true, heading: "H" }, "Body"));
|
|
34
|
+
const overlay = root.shadowRoot.querySelector('[part="overlay"]');
|
|
35
|
+
expect(overlay).not.toBeNull();
|
|
36
|
+
overlay.click();
|
|
37
|
+
await waitForChanges();
|
|
38
|
+
expect(root.open).toBe(false);
|
|
39
|
+
});
|
|
40
|
+
it('has no overlay by default and reflects side', async () => {
|
|
41
|
+
const { root } = await render(h("bs-side-panel", { open: true, side: "start", heading: "H" }));
|
|
42
|
+
expect(root.shadowRoot.querySelector('[part="overlay"]')).toBeNull();
|
|
43
|
+
expect(root).toEqualAttribute('side', 'start');
|
|
44
|
+
});
|
|
45
|
+
it('moves focus in on open and restores it on close', async () => {
|
|
46
|
+
const outer = document.createElement('button');
|
|
47
|
+
document.body.appendChild(outer);
|
|
48
|
+
outer.focus();
|
|
49
|
+
const { root, waitForChanges } = await render(h("bs-side-panel", { heading: "H" }, "Body"));
|
|
50
|
+
outer.focus();
|
|
51
|
+
root.open = true;
|
|
52
|
+
await waitForChanges();
|
|
53
|
+
expect(document.activeElement).toBe(root);
|
|
54
|
+
expect(root.shadowRoot.activeElement).toBe(root.shadowRoot.querySelector('[role="dialog"]'));
|
|
55
|
+
root.open = false;
|
|
56
|
+
await waitForChanges();
|
|
57
|
+
expect(document.activeElement).toBe(outer);
|
|
58
|
+
outer.remove();
|
|
59
|
+
});
|
|
60
|
+
it('sets aria-modal on the dialog', async () => {
|
|
61
|
+
const { root } = await render(h("bs-side-panel", { open: true, heading: "H" }));
|
|
62
|
+
expect(root.shadowRoot.querySelector('[role="dialog"]')).toEqualAttribute('aria-modal', 'true');
|
|
63
|
+
});
|
|
64
|
+
it('traps Tab and Shift+Tab through slotted content', async () => {
|
|
65
|
+
const { root, waitForChanges } = await render(h("bs-side-panel", { open: true, heading: "H" }, h("button", { id: "a" }, "A"), h("button", { id: "b" }, "B")));
|
|
66
|
+
await waitForChanges();
|
|
67
|
+
const a = root.querySelector('#a');
|
|
68
|
+
const b = root.querySelector('#b');
|
|
69
|
+
const key = (target, shiftKey = false) => {
|
|
70
|
+
const ev = new KeyboardEvent('keydown', { key: 'Tab', shiftKey, bubbles: true, composed: true, cancelable: true });
|
|
71
|
+
target.dispatchEvent(ev);
|
|
72
|
+
return ev;
|
|
73
|
+
};
|
|
74
|
+
b.focus();
|
|
75
|
+
expect(key(b).defaultPrevented).toBe(true);
|
|
76
|
+
// Forward from the last focusable wraps to the first (the header close button).
|
|
77
|
+
expect(root.shadowRoot.activeElement).not.toBeNull();
|
|
78
|
+
expect(document.activeElement).toBe(root);
|
|
79
|
+
a.focus();
|
|
80
|
+
expect(key(a, true).defaultPrevented).toBe(false);
|
|
81
|
+
// Shift+Tab from the first focusable (close button) wraps to the last slotted element.
|
|
82
|
+
const close = root.shadowRoot.querySelector('bs-icon-button');
|
|
83
|
+
close.focus();
|
|
84
|
+
expect(key(close, true).defaultPrevented).toBe(true);
|
|
85
|
+
expect(document.activeElement).toBe(b);
|
|
86
|
+
});
|
|
87
|
+
it('makes siblings inert with overlay and restores prior state', async () => {
|
|
88
|
+
const plain = document.createElement('div');
|
|
89
|
+
const already = document.createElement('div');
|
|
90
|
+
already.inert = true;
|
|
91
|
+
const { root, waitForChanges } = await render(h("bs-side-panel", { heading: "H", overlay: true }));
|
|
92
|
+
document.body.append(plain, already);
|
|
93
|
+
root.open = true;
|
|
94
|
+
await waitForChanges();
|
|
95
|
+
expect(plain.inert).toBe(true);
|
|
96
|
+
expect(root.inert).toBe(false);
|
|
97
|
+
root.open = false;
|
|
98
|
+
await waitForChanges();
|
|
99
|
+
expect(plain.inert).toBe(false);
|
|
100
|
+
expect(already.inert).toBe(true);
|
|
101
|
+
plain.remove();
|
|
102
|
+
already.remove();
|
|
103
|
+
});
|
|
104
|
+
it('does not set inert without overlay, and restores on disconnect', async () => {
|
|
105
|
+
const plain = document.createElement('div');
|
|
106
|
+
const { root, waitForChanges } = await render(h("bs-side-panel", { heading: "H", open: true }));
|
|
107
|
+
document.body.append(plain);
|
|
108
|
+
await waitForChanges();
|
|
109
|
+
expect(plain.inert).toBe(false);
|
|
110
|
+
root.overlay = true;
|
|
111
|
+
await waitForChanges();
|
|
112
|
+
expect(plain.inert).toBe(true);
|
|
113
|
+
root.remove();
|
|
114
|
+
expect(plain.inert).toBe(false);
|
|
115
|
+
plain.remove();
|
|
116
|
+
});
|
|
117
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--bs-side-panel-bg: var(--bs-surface-raised);
|
|
3
|
+
--bs-side-panel-width: calc(var(--bs-scale-1600) * 3);
|
|
4
|
+
--bs-side-panel-padding: var(--bs-spacing-200);
|
|
5
|
+
--bs-side-panel-shadow: var(--bs-shadow-md);
|
|
6
|
+
--bs-side-panel-overlay-bg: var(--bs-surface-overlay);
|
|
7
|
+
--bs-side-panel-color: var(--bs-text-default);
|
|
8
|
+
--bs-side-panel-z-index: var(--bs-z-index-modal);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.bs-side-panel {
|
|
12
|
+
position: fixed;
|
|
13
|
+
inset: 0;
|
|
14
|
+
z-index: var(--bs-side-panel-z-index);
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bs-side-panel__overlay {
|
|
19
|
+
position: absolute;
|
|
20
|
+
inset: 0;
|
|
21
|
+
background: var(--bs-side-panel-overlay-bg);
|
|
22
|
+
pointer-events: auto;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.bs-side-panel__panel {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 0;
|
|
28
|
+
bottom: 0;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
width: var(--bs-side-panel-width);
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
background: var(--bs-side-panel-bg);
|
|
35
|
+
color: var(--bs-side-panel-color);
|
|
36
|
+
box-shadow: var(--bs-side-panel-shadow);
|
|
37
|
+
pointer-events: auto;
|
|
38
|
+
outline: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bs-side-panel--start .bs-side-panel__panel {
|
|
42
|
+
left: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.bs-side-panel--end .bs-side-panel__panel {
|
|
46
|
+
right: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.bs-side-panel__header {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: space-between;
|
|
53
|
+
gap: var(--bs-spacing-100);
|
|
54
|
+
padding: var(--bs-side-panel-padding);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.bs-side-panel__heading {
|
|
58
|
+
margin: 0;
|
|
59
|
+
font-size: var(--bs-font-size-lg);
|
|
60
|
+
font-weight: var(--bs-font-weight-semibold);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.bs-side-panel__actions {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: var(--bs-spacing-100);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.bs-side-panel__body {
|
|
70
|
+
flex: 1;
|
|
71
|
+
overflow-y: auto;
|
|
72
|
+
padding: 0 var(--bs-side-panel-padding);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.bs-side-panel__footer {
|
|
76
|
+
padding: var(--bs-side-panel-padding);
|
|
77
|
+
}
|