@brandsync/wc 1.9.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +8864 -3754
- package/dist/brandsync-wc/brandsync-wc.css +33 -0
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/{p-9f8852a0.entry.js → p-00a0d489.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a5feaad4.entry.js → p-061ddc46.entry.js} +1 -1
- package/dist/brandsync-wc/{p-360452c2.entry.js → p-09435f41.entry.js} +1 -1
- package/dist/brandsync-wc/{p-107b1c5d.entry.js → p-09bc1923.entry.js} +1 -1
- package/dist/brandsync-wc/{p-1f7208cb.entry.js → p-09cbf05b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7c94e6ae.entry.js → p-0b2d3b7e.entry.js} +1 -1
- package/dist/brandsync-wc/p-0b7c77c1.entry.js +1 -0
- package/dist/brandsync-wc/p-0ee4126c.entry.js +1 -0
- package/dist/brandsync-wc/{p-0e39b9cc.entry.js → p-0f8cd2e8.entry.js} +1 -1
- package/dist/brandsync-wc/{p-1c0db4d6.entry.js → p-1261f0b0.entry.js} +1 -1
- package/dist/brandsync-wc/{p-6bf2f116.entry.js → p-1978e63c.entry.js} +1 -1
- package/dist/brandsync-wc/p-1aab6d07.entry.js +1 -0
- package/dist/brandsync-wc/{p-6fd7dd6a.entry.js → p-20030f4d.entry.js} +1 -1
- package/dist/brandsync-wc/p-2177042f.entry.js +1 -0
- package/dist/brandsync-wc/{p-33e44094.entry.js → p-2368a92e.entry.js} +1 -1
- package/dist/brandsync-wc/{p-29027559.entry.js → p-247e36ad.entry.js} +1 -1
- package/dist/brandsync-wc/{p-ae978c9a.entry.js → p-2497d128.entry.js} +1 -1
- package/dist/brandsync-wc/{p-fc240aa0.entry.js → p-282ddbee.entry.js} +1 -1
- package/dist/brandsync-wc/{p-0eed6813.entry.js → p-2f4e08e1.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c3f72584.entry.js → p-34e5feaf.entry.js} +1 -1
- package/dist/brandsync-wc/{p-062cfa34.entry.js → p-39a26c64.entry.js} +1 -1
- package/dist/brandsync-wc/p-3a1af63a.entry.js +1 -0
- package/dist/brandsync-wc/{p-9f6fe37d.entry.js → p-3f09296a.entry.js} +1 -1
- package/dist/brandsync-wc/p-416322bd.entry.js +1 -0
- package/dist/brandsync-wc/{p-bbcc47b0.entry.js → p-491b51e6.entry.js} +1 -1
- package/dist/brandsync-wc/p-52cb2358.entry.js +1 -0
- package/dist/brandsync-wc/{p-3ec74d35.entry.js → p-56c37e0a.entry.js} +1 -1
- package/dist/brandsync-wc/p-5ba90a13.entry.js +1 -0
- package/dist/brandsync-wc/{p-2181378f.entry.js → p-5f27f04d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a09e157f.entry.js → p-617bd13a.entry.js} +1 -1
- package/dist/brandsync-wc/p-68fcd4a4.entry.js +1 -0
- package/dist/brandsync-wc/{p-cfcf3f0a.entry.js → p-69c0a85d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-9f65f998.entry.js → p-6a696161.entry.js} +1 -1
- package/dist/brandsync-wc/{p-8ee0153b.entry.js → p-6c6cdf77.entry.js} +1 -1
- package/dist/brandsync-wc/{p-051d3064.entry.js → p-6e735e37.entry.js} +1 -1
- package/dist/brandsync-wc/{p-fc58c663.entry.js → p-73f214ed.entry.js} +1 -1
- package/dist/brandsync-wc/{p-be2c1740.entry.js → p-7796b93f.entry.js} +1 -1
- package/dist/brandsync-wc/p-78a69a59.entry.js +1 -0
- package/dist/brandsync-wc/{p-27bbed83.entry.js → p-78f4fcf0.entry.js} +1 -1
- package/dist/brandsync-wc/p-7f954939.entry.js +1 -0
- package/dist/brandsync-wc/{p-835a8dc7.entry.js → p-81605b82.entry.js} +1 -1
- package/dist/brandsync-wc/{p-de7c946d.entry.js → p-823ab3b2.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a92eec48.entry.js → p-89fabf27.entry.js} +1 -1
- package/dist/brandsync-wc/{p-AgoOSYvW.js → p-DqQRXQMx.js} +2 -2
- package/dist/brandsync-wc/{p-70f64b25.entry.js → p-a9169157.entry.js} +1 -1
- package/dist/brandsync-wc/{p-05c7de28.entry.js → p-afb07368.entry.js} +1 -1
- package/dist/brandsync-wc/{p-235ae012.entry.js → p-b84366a7.entry.js} +1 -1
- package/dist/brandsync-wc/p-b9a4042e.entry.js +1 -0
- package/dist/brandsync-wc/{p-275072dd.entry.js → p-b9ccd9d1.entry.js} +1 -1
- package/dist/brandsync-wc/{p-61c1a2a3.entry.js → p-be3dd446.entry.js} +1 -1
- package/dist/brandsync-wc/p-c0a92750.entry.js +1 -0
- package/dist/brandsync-wc/{p-6331de9c.entry.js → p-d754ee13.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e9b43754.entry.js → p-d75f3f87.entry.js} +1 -1
- package/dist/brandsync-wc/{p-3176d1d3.entry.js → p-d8b29a53.entry.js} +1 -1
- package/dist/brandsync-wc/p-de110ad0.entry.js +1 -0
- package/dist/brandsync-wc/p-e2556b4e.entry.js +1 -0
- package/dist/brandsync-wc/{p-4574a707.entry.js → p-e5daa6ca.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c4de155c.entry.js → p-f15d9524.entry.js} +1 -1
- package/dist/brandsync-wc/p-f5180578.entry.js +1 -0
- package/dist/brandsync-wc/{p-114d2fd8.entry.js → p-f7d15fbe.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a0d5a620.entry.js → p-fc069773.entry.js} +1 -1
- package/dist/brandsync-wc/p-fcee0dc4.entry.js +1 -0
- package/dist/cjs/brandsync-wc.cjs.js +2 -2
- 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 +1 -1
- 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 +2 -2
- package/dist/cjs/bs-button.cjs.entry.js +3 -3
- package/dist/cjs/bs-card.cjs.entry.js +3 -3
- package/dist/cjs/bs-carousel.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +2 -2
- package/dist/cjs/bs-checkbox-skeleton.cjs.entry.js +2 -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 +1 -1
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +1 -1
- package/dist/cjs/bs-composer.cjs.entry.js +1 -1
- package/dist/cjs/bs-cookie-consent.cjs.entry.js +186 -0
- package/dist/cjs/bs-data-table.cjs.entry.js +1 -1
- package/dist/cjs/bs-datepicker.cjs.entry.js +414 -0
- package/dist/cjs/bs-dialog.cjs.entry.js +1 -1
- package/dist/cjs/bs-error-page.cjs.entry.js +103 -0
- package/dist/cjs/bs-file-upload-item.cjs.entry.js +2 -2
- package/dist/cjs/bs-file-upload.cjs.entry.js +2 -2
- package/dist/cjs/bs-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/bs-icon-tile.cjs.entry.js +52 -0
- package/dist/cjs/bs-inline-tab.cjs.entry.js +2 -2
- package/dist/cjs/{bs-input.cjs.entry.js → bs-input_3.cjs.entry.js} +74 -6
- package/dist/cjs/bs-logo.cjs.entry.js +1 -1
- package/dist/cjs/bs-navigation-drawer-item.cjs.entry.js +2 -2
- package/dist/cjs/bs-navigation-drawer.cjs.entry.js +3 -3
- package/dist/cjs/bs-navigation-header.cjs.entry.js +2 -2
- package/dist/cjs/bs-onboarding-checklist.cjs.entry.js +161 -0
- package/dist/cjs/bs-pagination.cjs.entry.js +2 -2
- package/dist/cjs/bs-product-tour.cjs.entry.js +78 -0
- package/dist/cjs/bs-progress-linear.cjs.entry.js +4 -4
- package/dist/cjs/bs-progress.cjs.entry.js +3 -3
- package/dist/cjs/bs-qr-code.cjs.entry.js +148 -0
- package/dist/cjs/bs-radio.cjs.entry.js +2 -2
- package/dist/cjs/bs-session-timeout.cjs.entry.js +215 -0
- package/dist/cjs/bs-slider.cjs.entry.js +2 -2
- package/dist/cjs/bs-snackbar.cjs.entry.js +9 -3
- package/dist/cjs/bs-source-link.cjs.entry.js +3 -3
- 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 +255 -0
- package/dist/cjs/bs-timepicker.cjs.entry.js +209 -0
- package/dist/cjs/bs-toast.cjs.entry.js +2 -2
- package/dist/cjs/bs-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/bs-whats-new.cjs.entry.js +144 -0
- package/dist/cjs/{index-kk9YXF2S.js → index-tFJjflK5.js} +15 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +11 -0
- package/dist/collection/components/bs-a11y.cmp.test.js +26 -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-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/bs-button/bs-button.cmp.test.js +28 -0
- package/dist/collection/components/bs-button/bs-button/bs-button.css +8 -2
- package/dist/collection/components/bs-button/bs-button/bs-button.js +4 -1
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.js +1 -1
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
- package/dist/collection/components/bs-card/bs-card.cmp.test.js +48 -0
- package/dist/collection/components/bs-card/bs-card.css +37 -16
- package/dist/collection/components/bs-card/bs-card.js +2 -2
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +1 -1
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +1 -1
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +1 -1
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +1 -1
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +1 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.js +1 -1
- package/dist/collection/components/bs-cookie-consent/bs-cookie-consent.cmp.test.js +217 -0
- package/dist/collection/components/bs-cookie-consent/bs-cookie-consent.css +350 -0
- package/dist/collection/components/bs-cookie-consent/bs-cookie-consent.js +668 -0
- package/dist/collection/components/bs-cookie-consent/bs-cookie-consent.stories.js +103 -0
- package/dist/collection/components/bs-datepicker/bs-datepicker.cmp.test.js +191 -0
- package/dist/collection/components/bs-datepicker/bs-datepicker.css +325 -0
- package/dist/collection/components/bs-datepicker/bs-datepicker.js +788 -0
- package/dist/collection/components/bs-datepicker/bs-datepicker.stories.js +64 -0
- package/dist/collection/components/bs-error-page/bs-error-page.cmp.test.js +99 -0
- package/dist/collection/components/bs-error-page/bs-error-page.css +105 -0
- package/dist/collection/components/bs-error-page/bs-error-page.js +328 -0
- package/dist/collection/components/bs-error-page/bs-error-page.stories.js +57 -0
- package/dist/collection/components/bs-file-upload/bs-file-upload.js +1 -1
- package/dist/collection/components/bs-file-upload-item/bs-file-upload-item.js +1 -1
- package/dist/collection/components/bs-icon-tile/bs-icon-tile.cmp.test.js +175 -0
- package/dist/collection/components/bs-icon-tile/bs-icon-tile.css +112 -0
- package/dist/collection/components/bs-icon-tile/bs-icon-tile.js +158 -0
- package/dist/collection/components/bs-icon-tile/bs-icon-tile.stories.js +45 -0
- package/dist/collection/components/bs-input/bs-input.cmp.test.js +14 -0
- package/dist/collection/components/bs-input/bs-input.css +9 -2
- package/dist/collection/components/bs-input/bs-input.js +7 -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-onboarding-checklist/bs-onboarding-checklist.cmp.test.js +280 -0
- package/dist/collection/components/bs-onboarding-checklist/bs-onboarding-checklist.css +488 -0
- package/dist/collection/components/bs-onboarding-checklist/bs-onboarding-checklist.js +674 -0
- package/dist/collection/components/bs-onboarding-checklist/bs-onboarding-checklist.stories.js +92 -0
- package/dist/collection/components/bs-pagination/bs-pagination.js +1 -1
- package/dist/collection/components/bs-product-tour/bs-product-tour.cmp.test.js +116 -0
- package/dist/collection/components/bs-product-tour/bs-product-tour.css +265 -0
- package/dist/collection/components/bs-product-tour/bs-product-tour.js +391 -0
- package/dist/collection/components/bs-product-tour/bs-product-tour.stories.js +68 -0
- package/dist/collection/components/bs-progress/bs-progress.js +2 -2
- package/dist/collection/components/bs-progress-linear/bs-progress-linear.css +1 -1
- package/dist/collection/components/bs-progress-linear/bs-progress-linear.js +2 -2
- package/dist/collection/components/bs-qr-code/bs-qr-code.cmp.test.js +152 -0
- package/dist/collection/components/bs-qr-code/bs-qr-code.css +307 -0
- package/dist/collection/components/bs-qr-code/bs-qr-code.js +767 -0
- package/dist/collection/components/bs-qr-code/bs-qr-code.stories.js +99 -0
- package/dist/collection/components/bs-radio/bs-radio.js +1 -1
- package/dist/collection/components/bs-session-timeout/bs-session-timeout.cmp.test.js +202 -0
- package/dist/collection/components/bs-session-timeout/bs-session-timeout.css +239 -0
- package/dist/collection/components/bs-session-timeout/bs-session-timeout.js +772 -0
- package/dist/collection/components/bs-session-timeout/bs-session-timeout.stories.js +88 -0
- package/dist/collection/components/bs-slider/bs-slider.js +1 -1
- package/dist/collection/components/bs-snackbar/bs-snackbar.cmp.test.js +20 -0
- package/dist/collection/components/bs-snackbar/bs-snackbar.css +6 -4
- package/dist/collection/components/bs-snackbar/bs-snackbar.js +53 -1
- package/dist/collection/components/bs-source-link/bs-source-link.js +2 -2
- 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.cmp.test.js +141 -0
- package/dist/collection/components/bs-timepicker/bs-timepicker.css +204 -0
- package/dist/collection/components/bs-timepicker/bs-timepicker.js +511 -0
- package/dist/collection/components/bs-timepicker/bs-timepicker.stories.js +44 -0
- package/dist/collection/components/bs-toast/bs-toast.js +1 -1
- package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
- package/dist/collection/components/bs-whats-new/bs-whats-new.cmp.test.js +200 -0
- package/dist/collection/components/bs-whats-new/bs-whats-new.css +315 -0
- package/dist/collection/components/bs-whats-new/bs-whats-new.js +790 -0
- package/dist/collection/components/bs-whats-new/bs-whats-new.stories.js +105 -0
- package/dist/collection/components/bs-whats-new-entry/bs-whats-new-entry.cmp.test.js +79 -0
- package/dist/collection/components/bs-whats-new-entry/bs-whats-new-entry.css +131 -0
- package/dist/collection/components/bs-whats-new-entry/bs-whats-new-entry.js +295 -0
- package/dist/collection/components/bs-whats-new-entry/bs-whats-new-entry.stories.js +67 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.js +2 -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/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-composer-status-banner.js +1 -1
- package/dist/components/bs-composer.js +1 -1
- package/dist/components/bs-cookie-consent.d.ts +11 -0
- package/dist/components/bs-cookie-consent.js +1 -0
- package/dist/components/bs-data-table.js +1 -1
- package/dist/components/bs-datepicker.d.ts +11 -0
- package/dist/components/bs-datepicker.js +1 -0
- package/dist/components/bs-dialog.js +1 -1
- package/dist/components/bs-error-page.d.ts +11 -0
- package/dist/components/bs-error-page.js +1 -0
- 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.d.ts +11 -0
- package/dist/components/bs-icon-tile.js +1 -0
- 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-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.d.ts +11 -0
- package/dist/components/bs-onboarding-checklist.js +1 -0
- package/dist/components/bs-pagination.js +1 -1
- package/dist/components/bs-product-tour.d.ts +11 -0
- package/dist/components/bs-product-tour.js +1 -0
- package/dist/components/bs-progress-linear.js +1 -1
- package/dist/components/bs-progress.js +1 -1
- package/dist/components/bs-qr-code.d.ts +11 -0
- package/dist/components/bs-qr-code.js +1 -0
- package/dist/components/bs-radio.js +1 -1
- package/dist/components/bs-session-timeout.d.ts +11 -0
- package/dist/components/bs-session-timeout.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-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.d.ts +11 -0
- package/dist/components/bs-timepicker.js +1 -0
- package/dist/components/bs-toast.js +1 -1
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/bs-whats-new-entry.d.ts +11 -0
- package/dist/components/bs-whats-new-entry.js +1 -0
- package/dist/components/bs-whats-new.d.ts +11 -0
- package/dist/components/bs-whats-new.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-R2MlkUzD.js → p-BEEoVNRu.js} +1 -1
- package/dist/components/{p-EtXc94lJ.js → p-BZ3M4lOU.js} +1 -1
- package/dist/components/p-B_I4UEMp.js +1 -0
- package/dist/components/{p-BfEyD6Ku.js → p-Be9L4_Fe.js} +1 -1
- package/dist/components/p-Be_Pmccm.js +1 -0
- package/dist/components/p-Bl_tVzeq.js +1 -0
- package/dist/components/p-C8yT2Ucq.js +1 -0
- package/dist/components/p-CA31vqjL.js +1 -0
- package/dist/components/p-CUfs0ROR.js +1 -0
- package/dist/components/{p-JYlmcxBn.js → p-CVrEuVFo.js} +1 -1
- package/dist/components/{p-BA3c9Rom.js → p-C_j_jDM6.js} +1 -1
- package/dist/components/p-CbimDNGY.js +1 -0
- package/dist/components/{p-Buly0d5G.js → p-CeUK3n7D.js} +1 -1
- package/dist/components/p-CncySD_-.js +1 -0
- package/dist/components/p-DE8K7fg0.js +1 -0
- package/dist/components/p-Dr0Qk9Zc.js +1 -0
- package/dist/components/p-DuLL7Ouw.js +1 -0
- package/dist/components/p-YsHQLXET.js +1 -0
- package/dist/components/p-qmS2CBqi.js +1 -0
- package/dist/components/{p-BoeorHNv.js → p-zTHlbyH6.js} +1 -1
- package/dist/esm/brandsync-wc.js +3 -3
- 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 +1 -1
- 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 +2 -2
- package/dist/esm/bs-button.entry.js +3 -3
- package/dist/esm/bs-card.entry.js +3 -3
- package/dist/esm/bs-carousel.entry.js +1 -1
- package/dist/esm/bs-chatbot-feedback.entry.js +2 -2
- package/dist/esm/bs-chatbot-header.entry.js +2 -2
- package/dist/esm/bs-chatbot-response-action.entry.js +2 -2
- package/dist/esm/bs-chatbot-sources-drawer.entry.js +2 -2
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +2 -2
- package/dist/esm/bs-checkbox-skeleton.entry.js +2 -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 +1 -1
- package/dist/esm/bs-composer-status-banner.entry.js +1 -1
- package/dist/esm/bs-composer.entry.js +1 -1
- package/dist/esm/bs-cookie-consent.entry.js +184 -0
- package/dist/esm/bs-data-table.entry.js +1 -1
- package/dist/esm/bs-datepicker.entry.js +412 -0
- package/dist/esm/bs-dialog.entry.js +1 -1
- package/dist/esm/bs-error-page.entry.js +101 -0
- package/dist/esm/bs-file-upload-item.entry.js +2 -2
- package/dist/esm/bs-file-upload.entry.js +2 -2
- package/dist/esm/bs-icon-button.entry.js +2 -2
- package/dist/esm/bs-icon-tile.entry.js +50 -0
- package/dist/esm/bs-inline-tab.entry.js +2 -2
- package/dist/esm/{bs-input.entry.js → bs-input_3.entry.js} +73 -7
- package/dist/esm/bs-logo.entry.js +1 -1
- package/dist/esm/bs-navigation-drawer-item.entry.js +2 -2
- package/dist/esm/bs-navigation-drawer.entry.js +3 -3
- package/dist/esm/bs-navigation-header.entry.js +2 -2
- package/dist/esm/bs-onboarding-checklist.entry.js +159 -0
- package/dist/esm/bs-pagination.entry.js +2 -2
- package/dist/esm/bs-product-tour.entry.js +76 -0
- package/dist/esm/bs-progress-linear.entry.js +4 -4
- package/dist/esm/bs-progress.entry.js +3 -3
- package/dist/esm/bs-qr-code.entry.js +146 -0
- package/dist/esm/bs-radio.entry.js +2 -2
- package/dist/esm/bs-session-timeout.entry.js +213 -0
- package/dist/esm/bs-slider.entry.js +2 -2
- package/dist/esm/bs-snackbar.entry.js +9 -3
- package/dist/esm/bs-source-link.entry.js +3 -3
- 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 +251 -0
- package/dist/esm/bs-timepicker.entry.js +207 -0
- package/dist/esm/bs-toast.entry.js +2 -2
- package/dist/esm/bs-tooltip.entry.js +2 -2
- package/dist/esm/bs-whats-new.entry.js +142 -0
- package/dist/esm/{index-AgoOSYvW.js → index-DqQRXQMx.js} +15 -3
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/bs-button/bs-button/bs-button.d.ts +3 -0
- package/dist/types/components/bs-cookie-consent/bs-cookie-consent.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-cookie-consent/bs-cookie-consent.d.ts +136 -0
- package/dist/types/components/bs-cookie-consent/bs-cookie-consent.stories.d.ts +16 -0
- package/dist/types/components/bs-datepicker/bs-datepicker.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-datepicker/bs-datepicker.d.ts +138 -0
- package/dist/types/components/bs-datepicker/bs-datepicker.stories.d.ts +20 -0
- package/dist/types/components/bs-error-page/bs-error-page.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-error-page/bs-error-page.d.ts +60 -0
- package/dist/types/components/bs-error-page/bs-error-page.stories.d.ts +22 -0
- package/dist/types/components/bs-icon-tile/bs-icon-tile.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-icon-tile/bs-icon-tile.d.ts +40 -0
- package/dist/types/components/bs-icon-tile/bs-icon-tile.stories.d.ts +13 -0
- package/dist/types/components/bs-onboarding-checklist/bs-onboarding-checklist.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-onboarding-checklist/bs-onboarding-checklist.d.ts +140 -0
- package/dist/types/components/bs-onboarding-checklist/bs-onboarding-checklist.stories.d.ts +18 -0
- package/dist/types/components/bs-product-tour/bs-product-tour.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-product-tour/bs-product-tour.d.ts +78 -0
- package/dist/types/components/bs-product-tour/bs-product-tour.stories.d.ts +19 -0
- package/dist/types/components/bs-qr-code/bs-qr-code.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-qr-code/bs-qr-code.d.ts +124 -0
- package/dist/types/components/bs-qr-code/bs-qr-code.stories.d.ts +28 -0
- package/dist/types/components/bs-session-timeout/bs-session-timeout.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-session-timeout/bs-session-timeout.d.ts +141 -0
- package/dist/types/components/bs-session-timeout/bs-session-timeout.stories.d.ts +19 -0
- package/dist/types/components/bs-snackbar/bs-snackbar.d.ts +7 -0
- package/dist/types/components/bs-timepicker/bs-timepicker.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-timepicker/bs-timepicker.d.ts +103 -0
- package/dist/types/components/bs-timepicker/bs-timepicker.stories.d.ts +14 -0
- package/dist/types/components/bs-whats-new/bs-whats-new.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-whats-new/bs-whats-new.d.ts +147 -0
- package/dist/types/components/bs-whats-new/bs-whats-new.stories.d.ts +14 -0
- package/dist/types/components/bs-whats-new-entry/bs-whats-new-entry.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-whats-new-entry/bs-whats-new-entry.d.ts +53 -0
- package/dist/types/components/bs-whats-new-entry/bs-whats-new-entry.stories.d.ts +18 -0
- package/dist/types/components.d.ts +3072 -17
- package/package.json +1 -1
- package/dist/brandsync-wc/p-2891d40b.entry.js +0 -1
- package/dist/brandsync-wc/p-36bf37d9.entry.js +0 -1
- package/dist/brandsync-wc/p-3b64e3cd.entry.js +0 -1
- package/dist/brandsync-wc/p-4e5dcaff.entry.js +0 -1
- package/dist/brandsync-wc/p-7b00dd36.entry.js +0 -1
- package/dist/brandsync-wc/p-c10d2529.entry.js +0 -1
- package/dist/brandsync-wc/p-f006d962.entry.js +0 -1
- package/dist/brandsync-wc/p-f074f94e.entry.js +0 -1
- package/dist/brandsync-wc/p-f7d47c17.entry.js +0 -1
- package/dist/brandsync-wc/p-fddc7bd1.entry.js +0 -1
- package/dist/cjs/bs-menu-item.cjs.entry.js +0 -34
- package/dist/cjs/bs-menu.cjs.entry.js +0 -39
- package/dist/cjs/bs-tab.cjs.entry.js +0 -88
- package/dist/cjs/bs-tabs.cjs.entry.js +0 -133
- package/dist/components/p-CpUHnsq9.js +0 -1
- package/dist/components/p-wei0Ija2.js +0 -1
- package/dist/esm/bs-menu-item.entry.js +0 -32
- package/dist/esm/bs-menu.entry.js +0 -37
- package/dist/esm/bs-tab.entry.js +0 -86
- package/dist/esm/bs-tabs.entry.js +0 -131
|
@@ -112,7 +112,7 @@ export class BsFileUpload {
|
|
|
112
112
|
this.handleFiles(files);
|
|
113
113
|
};
|
|
114
114
|
render() {
|
|
115
|
-
return (h("div", { key: '
|
|
115
|
+
return (h("div", { key: '0d56df66efcaae8ae01435f81755a2cbfe9e6735', part: "dropzone", class: `bs-file-upload bs-file-upload--${this.direction} ${this.dragging ? 'bs-file-upload--dragging' : ''} ${this.disabled ? 'bs-file-upload--disabled' : ''}`, onDragEnter: this.onDragOver, onDragOver: this.onDragOver, onDragLeave: this.onDragLeave, onDrop: this.onDrop }, h("div", { key: '63d1f3d7b64f9efe016f5720f2e78224cde2d4ee', part: "icon", class: "bs-file-upload__icon" }, h("slot", { key: '8bd5a62c50cce5608bd48b5db4d414c00dcdb68d', name: "icon" }, h(UploadIcon, { key: '478fcbbd730135bc396837ff1fcdee22418cf662' }))), h("div", { key: 'b4403e04e359e0d01a9f2e06d90ccaf0ce9ed5dd', class: "bs-file-upload__content" }, h("div", { key: '2b2d4dd5492ff8b88acbf4e3525f94d427e66e05', class: "bs-file-upload__text" }, this.heading && (h("span", { key: '25110b17458d6ac5d8f41c75b1cac44e7aa5b726', part: "heading", class: "bs-file-upload__heading" }, this.heading)), this.description && (h("span", { key: '362c13ebac808e066aa583c861f7d540715ebf2b', part: "description", id: "description", class: "bs-file-upload__description" }, this.description))), h("bs-button", { key: '09fd3013539163d2478abc7cd127cc2121aa206e', part: "browse", variant: "neutral", size: "sm", disabled: this.disabled, onClick: this.onBrowse }, this.buttonLabel)), h("input", { key: '2829fea7f7d8b4f3aae730678c9193eadd075422', ref: el => (this.inputEl = el), class: "bs-file-upload__input", type: "file", hidden: true, tabindex: -1, accept: this.accept, multiple: this.multiple, disabled: this.disabled, "aria-describedby": this.description ? 'description' : undefined, onChange: this.onInputChange })));
|
|
116
116
|
}
|
|
117
117
|
static get is() { return "bs-file-upload"; }
|
|
118
118
|
static get encapsulation() { return "shadow"; }
|
|
@@ -86,7 +86,7 @@ export class BsFileUploadItem {
|
|
|
86
86
|
}
|
|
87
87
|
render() {
|
|
88
88
|
const removing = this.state === 'success';
|
|
89
|
-
return (h("div", { key: '
|
|
89
|
+
return (h("div", { key: 'b239ca2558d3f0c25c58e0deeff988b29696a4a2', part: "item", class: `bs-file-upload-item bs-file-upload-item--${this.state}` }, h("div", { key: 'c146e98abf457f86aaca4f22e1813e51b9f8bfea', part: "thumbnail", class: "bs-file-upload-item__thumbnail" }, h("slot", { key: '1d7b35010b00fcedcf8f3e94ccc710ff44a1de9f', name: "thumbnail" }, this.thumbnailSrc ? (h("img", { class: "bs-file-upload-item__image", src: this.thumbnailSrc, alt: this.thumbnailAlt })) : (h(ImageIcon, null)))), h("div", { key: 'ba248f04ec0c44a4419f2e87d800500259d50c39', class: "bs-file-upload-item__content" }, h("div", { key: '9feafd65955cd80cd7e8878dc2af73e2c4184455', class: "bs-file-upload-item__meta" }, h("span", { key: '95214fe26b2256399a0ab3ea3568f868ac22984e', part: "name", class: "bs-file-upload-item__name" }, this.fileName), this.fileSize && (h("span", { key: '8ffece05f1ecb00839fbdd4086ad55a485f0bbca', part: "size", class: "bs-file-upload-item__size" }, this.fileSize))), this.renderStatus()), h("bs-icon-button", { key: '63508a0938b11dabfba623f0197c91e024b004b7', part: "action", variant: "subtle", size: "lg", ariaLabel: removing ? this.removeLabel : this.cancelLabel, onClick: this.onAction }, removing ? h(TrashIcon, null) : h(CloseIcon, null))));
|
|
90
90
|
}
|
|
91
91
|
static get is() { return "bs-file-upload-item"; }
|
|
92
92
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
2
|
+
const box = (root) => root.getBoundingClientRect();
|
|
3
|
+
const cs = (root) => getComputedStyle(root.shadowRoot.querySelector('[part="container"]'));
|
|
4
|
+
describe('bs-icon-tile', () => {
|
|
5
|
+
it('defaults to a small default tile with the house glyph', async () => {
|
|
6
|
+
const { root } = await render(h("bs-icon-tile", null));
|
|
7
|
+
expect(root).toEqualAttribute('size', 'sm');
|
|
8
|
+
expect(root).toEqualAttribute('intent', 'default');
|
|
9
|
+
expect(box(root).width).toBe(24);
|
|
10
|
+
expect(box(root).height).toBe(24);
|
|
11
|
+
expect(root.shadowRoot.querySelector('[part="icon"] svg')).not.toBeNull();
|
|
12
|
+
});
|
|
13
|
+
it.each([
|
|
14
|
+
['sm', 24, 12, '4px'],
|
|
15
|
+
['md', 32, 16, '5.33333px'],
|
|
16
|
+
['lg', 48, 24, '8px'],
|
|
17
|
+
])('size %s is %ipx with a %ipx icon and %s radius (Figma)', async (size, tile, icon, radius) => {
|
|
18
|
+
const { root } = await render(h("bs-icon-tile", { size: size }));
|
|
19
|
+
expect(box(root).width).toBe(tile);
|
|
20
|
+
expect(root.shadowRoot.querySelector('svg').getBoundingClientRect().width).toBe(icon);
|
|
21
|
+
expect(cs(root).borderTopLeftRadius).toBe(radius);
|
|
22
|
+
});
|
|
23
|
+
it('renders a different glyph per intent', async () => {
|
|
24
|
+
const intents = ['default', 'success', 'warning', 'error', 'brand', 'information'];
|
|
25
|
+
const markup = new Set();
|
|
26
|
+
for (const intent of intents) {
|
|
27
|
+
const { root } = await render(h("bs-icon-tile", { intent: intent }));
|
|
28
|
+
markup.add(root.shadowRoot.querySelector('svg').innerHTML);
|
|
29
|
+
}
|
|
30
|
+
expect(markup.size).toBe(6);
|
|
31
|
+
});
|
|
32
|
+
it('tints each intent differently', async () => {
|
|
33
|
+
const intents = ['default', 'success', 'warning', 'error', 'brand', 'information'];
|
|
34
|
+
const colours = new Set();
|
|
35
|
+
for (const intent of intents) {
|
|
36
|
+
const { root } = await render(h("bs-icon-tile", { intent: intent }));
|
|
37
|
+
colours.add(cs(root).backgroundColor);
|
|
38
|
+
}
|
|
39
|
+
expect(colours.size).toBe(6);
|
|
40
|
+
});
|
|
41
|
+
it('replaces the default glyph with slotted content', async () => {
|
|
42
|
+
const { root } = await render(h("bs-icon-tile", null, h("svg", { slot: undefined, id: "mine", viewBox: "0 0 24 24" }, h("path", { d: "M0 0" }))));
|
|
43
|
+
const slot = root.shadowRoot.querySelector('slot');
|
|
44
|
+
expect(slot.assignedElements().map(e => e.id)).toEqual(['mine']);
|
|
45
|
+
});
|
|
46
|
+
it('is decorative by default', async () => {
|
|
47
|
+
const { root } = await render(h("bs-icon-tile", null));
|
|
48
|
+
const c = root.shadowRoot.querySelector('[part="container"]');
|
|
49
|
+
expect(c).toEqualAttribute('aria-hidden', 'true');
|
|
50
|
+
expect(c.getAttribute('role')).toBeNull();
|
|
51
|
+
});
|
|
52
|
+
it('is an image with an accessible name when label is set', async () => {
|
|
53
|
+
const { root } = await render(h("bs-icon-tile", { label: "Error" }));
|
|
54
|
+
const c = root.shadowRoot.querySelector('[part="container"]');
|
|
55
|
+
expect(c).toEqualAttribute('role', 'img');
|
|
56
|
+
expect(c).toEqualAttribute('aria-label', 'Error');
|
|
57
|
+
expect(c.getAttribute('aria-hidden')).toBeNull();
|
|
58
|
+
});
|
|
59
|
+
it('can be resized through its custom property', async () => {
|
|
60
|
+
const { root } = await render(h("bs-icon-tile", { style: { '--bs-icon-tile-size': '64px' } }));
|
|
61
|
+
expect(box(root).width).toBe(64);
|
|
62
|
+
});
|
|
63
|
+
describe('dark mode (Figma "Icon tile", dark)', () => {
|
|
64
|
+
const hex = (c) => '#' + (c.match(/\d+/g) || []).slice(0, 3).map(n => Number(n).toString(16).padStart(2, '0')).join('');
|
|
65
|
+
const colours = async (theme) => {
|
|
66
|
+
if (theme)
|
|
67
|
+
document.documentElement.setAttribute('data-theme', theme);
|
|
68
|
+
try {
|
|
69
|
+
const out = {};
|
|
70
|
+
for (const intent of ['default', 'success', 'warning', 'error', 'brand', 'information']) {
|
|
71
|
+
const { root } = await render(h("bs-icon-tile", { intent: intent }));
|
|
72
|
+
const cs = getComputedStyle(root.shadowRoot.querySelector('[part="container"]'));
|
|
73
|
+
out[intent] = [hex(cs.backgroundColor), hex(cs.color)];
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
document.documentElement.removeAttribute('data-theme');
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
it('uses the 900 step behind the 100 step in dark mode, and a fixed information tint', async () => {
|
|
82
|
+
const dark = await colours('dark');
|
|
83
|
+
expect(dark.default).toEqual(['#21262e', '#f9fafb']);
|
|
84
|
+
expect(dark.success).toEqual(['#0f2b1e', '#c5ebd5']);
|
|
85
|
+
expect(dark.warning).toEqual(['#332300', '#ffdea1']);
|
|
86
|
+
expect(dark.error).toEqual(['#481212', '#ffdad7']);
|
|
87
|
+
expect(dark.brand).toEqual(['#001b3e', '#3e88ef']);
|
|
88
|
+
expect(dark.information).toEqual(['#edf0fa', '#448cd6']);
|
|
89
|
+
});
|
|
90
|
+
it('keeps the light backgrounds from the light Figma', async () => {
|
|
91
|
+
const light = await colours();
|
|
92
|
+
expect(light.success[0]).toBe('#e5f5e9');
|
|
93
|
+
expect(light.warning[0]).toBe('#ffdea1');
|
|
94
|
+
expect(light.error[0]).toBe('#ffdad7');
|
|
95
|
+
expect(light.information[0]).toBe('#edf0fa');
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
describe('whitespace in the markup (any HTML template)', () => {
|
|
99
|
+
const mount = async (html) => {
|
|
100
|
+
const host = document.createElement('div');
|
|
101
|
+
host.innerHTML = html;
|
|
102
|
+
document.body.appendChild(host);
|
|
103
|
+
await new Promise(r => setTimeout(r, 200));
|
|
104
|
+
return host.querySelector('bs-icon-tile');
|
|
105
|
+
};
|
|
106
|
+
it('still shows the default glyph when the only children are whitespace around a text child', async () => {
|
|
107
|
+
const tile = await mount(`<bs-icon-tile size="md" intent="success">
|
|
108
|
+
<span slot="text">Payment received</span>
|
|
109
|
+
</bs-icon-tile>`);
|
|
110
|
+
const glyph = tile.shadowRoot.querySelector('[part="icon"] svg');
|
|
111
|
+
expect(glyph).not.toBeNull();
|
|
112
|
+
expect(glyph.getBoundingClientRect().width).toBe(16);
|
|
113
|
+
tile.parentElement.remove();
|
|
114
|
+
});
|
|
115
|
+
it('still shows the default glyph for a tile written across lines with nothing in it', async () => {
|
|
116
|
+
const tile = await mount(`<bs-icon-tile intent="error">
|
|
117
|
+
|
|
118
|
+
</bs-icon-tile>`);
|
|
119
|
+
expect(tile.shadowRoot.querySelector('[part="icon"] svg')).not.toBeNull();
|
|
120
|
+
tile.parentElement.remove();
|
|
121
|
+
});
|
|
122
|
+
it('still lets a real custom icon replace the default glyph', async () => {
|
|
123
|
+
const tile = await mount(`<bs-icon-tile>
|
|
124
|
+
<svg id="mine" viewBox="0 0 24 24"><path d="M0 0" /></svg>
|
|
125
|
+
</bs-icon-tile>`);
|
|
126
|
+
expect(tile.shadowRoot.querySelector('[part="icon"] > svg')).toBeNull();
|
|
127
|
+
const slot = tile.shadowRoot.querySelector('slot:not([name])');
|
|
128
|
+
expect(slot.assignedElements().map(e => e.id)).toEqual(['mine']);
|
|
129
|
+
tile.parentElement.remove();
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
describe('text slot', () => {
|
|
133
|
+
it('is exactly the square when no text is slotted', async () => {
|
|
134
|
+
const { root } = await render(h("bs-icon-tile", { size: "md" }));
|
|
135
|
+
expect(root.getBoundingClientRect().width).toBe(32);
|
|
136
|
+
expect(getComputedStyle(root.shadowRoot.querySelector('[part="text"]')).display).toBe('none');
|
|
137
|
+
});
|
|
138
|
+
it('shows slotted text beside the square, vertically centred, with a gap', async () => {
|
|
139
|
+
const { root } = await render(h("bs-icon-tile", { size: "md", intent: "success" }, h("span", { slot: "text" }, "Payment received")));
|
|
140
|
+
await new Promise(r => setTimeout(r, 100));
|
|
141
|
+
const square = root.shadowRoot.querySelector('[part="container"]').getBoundingClientRect();
|
|
142
|
+
const text = root.shadowRoot.querySelector('[part="text"]').getBoundingClientRect();
|
|
143
|
+
expect(getComputedStyle(root.shadowRoot.querySelector('[part="text"]')).display).toBe('block');
|
|
144
|
+
expect(text.left - square.right).toBe(8);
|
|
145
|
+
expect(Math.abs((text.top + text.bottom) / 2 - (square.top + square.bottom) / 2)).toBeLessThanOrEqual(1);
|
|
146
|
+
});
|
|
147
|
+
it('colours the text with --bs-icon-tile-text-color, and leaves the icon colour alone', async () => {
|
|
148
|
+
const { root } = await render(h("bs-icon-tile", { intent: "success", style: { '--bs-icon-tile-text-color': 'rgb(1, 2, 3)' } }, h("span", { slot: "text" }, "Done")));
|
|
149
|
+
await new Promise(r => setTimeout(r, 100));
|
|
150
|
+
expect(getComputedStyle(root.shadowRoot.querySelector('[part="text"]')).color).toBe('rgb(1, 2, 3)');
|
|
151
|
+
expect(getComputedStyle(root.shadowRoot.querySelector('[part="container"]')).color).not.toBe('rgb(1, 2, 3)');
|
|
152
|
+
});
|
|
153
|
+
it('uses the default text colour (--bs-text-default) when not overridden, in light and dark', async () => {
|
|
154
|
+
const read = async () => {
|
|
155
|
+
const { root } = await render(h("bs-icon-tile", null, h("span", { slot: "text" }, "Done")));
|
|
156
|
+
await new Promise(r => setTimeout(r, 100));
|
|
157
|
+
return getComputedStyle(root.shadowRoot.querySelector('[part="text"]')).color;
|
|
158
|
+
};
|
|
159
|
+
const light = await read();
|
|
160
|
+
document.documentElement.setAttribute('data-theme', 'dark');
|
|
161
|
+
try {
|
|
162
|
+
const dark = await read();
|
|
163
|
+
expect(dark).not.toBe(light);
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
document.documentElement.removeAttribute('data-theme');
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
it('keeps the square decorative: the text stays readable and is not inside the aria-hidden square', async () => {
|
|
170
|
+
const { root } = await render(h("bs-icon-tile", null, h("span", { slot: "text" }, "Payment received")));
|
|
171
|
+
expect(root.shadowRoot.querySelector('[part="container"]')).toEqualAttribute('aria-hidden', 'true');
|
|
172
|
+
expect(root.shadowRoot.querySelector('[part="container"]').contains(root.shadowRoot.querySelector('[part="text"]'))).toBe(false);
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @prop --bs-icon-tile-size: Width/height of the tile. Set per `size` on the host: 24px / 32px / 48px (Figma).
|
|
3
|
+
* @prop --bs-icon-tile-radius: Corner radius. Set per `size`: 4px (--bs-border-radius-50) / 5.33px / 8px (--bs-border-radius-100).
|
|
4
|
+
* @prop --bs-icon-tile-icon-size: Width/height of the icon. Set per `size`: 12px / 16px / 24px.
|
|
5
|
+
* @prop --bs-icon-tile-bg: Background. Set per `intent`. Success, warning, error and information read mode-aware --bs-icon-tile-<intent>-bg properties from base.css (light and dark values from the Figma); default and brand use the neutral / primary container tokens, which already switch with the theme.
|
|
6
|
+
* @prop --bs-icon-tile-text-color: Colour of the text slotted into the `text` slot. Aliased to --bs-text-default.
|
|
7
|
+
* @prop --bs-icon-tile-text-gap: Gap between the square and the `text` slot. Aliased to --bs-spacing-100.
|
|
8
|
+
* @prop --bs-icon-tile-color: Icon colour. Set per `intent`: --bs-icon-tile-<intent>-color from base.css for success, warning, error and information; --bs-icon-default for default and --bs-icon-action for brand.
|
|
9
|
+
*/
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--bs-icon-tile-text-gap);
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
|
|
16
|
+
/* size: sm (default) */
|
|
17
|
+
--bs-icon-tile-size: 24px;
|
|
18
|
+
--bs-icon-tile-radius: var(--bs-border-radius-50);
|
|
19
|
+
--bs-icon-tile-icon-size: 12px;
|
|
20
|
+
--bs-icon-tile-text-color: var(--bs-text-default);
|
|
21
|
+
--bs-icon-tile-text-gap: var(--bs-spacing-100);
|
|
22
|
+
|
|
23
|
+
/* intent: default */
|
|
24
|
+
--bs-icon-tile-bg: var(--bs-color-neutral-container);
|
|
25
|
+
--bs-icon-tile-color: var(--bs-icon-default);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([size='md']) {
|
|
29
|
+
--bs-icon-tile-size: 32px;
|
|
30
|
+
/* Figma: 5.333px -- two thirds of the large radius, which has no token of its own. */
|
|
31
|
+
--bs-icon-tile-radius: calc(var(--bs-border-radius-100) * 2 / 3);
|
|
32
|
+
--bs-icon-tile-icon-size: 16px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([size='lg']) {
|
|
36
|
+
--bs-icon-tile-size: 48px;
|
|
37
|
+
--bs-icon-tile-radius: var(--bs-border-radius-100);
|
|
38
|
+
--bs-icon-tile-icon-size: 24px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([intent='success']) {
|
|
42
|
+
--bs-icon-tile-bg: var(--bs-icon-tile-success-bg, var(--bs-success-50));
|
|
43
|
+
--bs-icon-tile-color: var(--bs-icon-tile-success-color, var(--bs-icon-success));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host([intent='warning']) {
|
|
47
|
+
--bs-icon-tile-bg: var(--bs-icon-tile-warning-bg, var(--bs-color-warning-container));
|
|
48
|
+
--bs-icon-tile-color: var(--bs-icon-tile-warning-color, var(--bs-icon-warning));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([intent='error']) {
|
|
52
|
+
--bs-icon-tile-bg: var(--bs-icon-tile-error-bg, var(--bs-color-error-container));
|
|
53
|
+
--bs-icon-tile-color: var(--bs-icon-tile-error-color, var(--bs-icon-error));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([intent='brand']) {
|
|
57
|
+
--bs-icon-tile-bg: var(--bs-color-primary-container);
|
|
58
|
+
--bs-icon-tile-color: var(--bs-icon-action);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([intent='information']) {
|
|
62
|
+
--bs-icon-tile-bg: var(--bs-icon-tile-information-bg, var(--bs-information-50));
|
|
63
|
+
--bs-icon-tile-color: var(--bs-icon-tile-information-color, var(--bs-icon-info));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.bs-icon-tile {
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
flex: none;
|
|
72
|
+
width: var(--bs-icon-tile-size);
|
|
73
|
+
height: var(--bs-icon-tile-size);
|
|
74
|
+
border-radius: var(--bs-icon-tile-radius);
|
|
75
|
+
background: var(--bs-icon-tile-bg);
|
|
76
|
+
color: var(--bs-icon-tile-color);
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.bs-icon-tile__icon {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
width: var(--bs-icon-tile-icon-size);
|
|
85
|
+
height: var(--bs-icon-tile-icon-size);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.bs-icon-tile__icon svg,
|
|
89
|
+
::slotted(svg),
|
|
90
|
+
::slotted(img) {
|
|
91
|
+
width: var(--bs-icon-tile-icon-size);
|
|
92
|
+
height: var(--bs-icon-tile-icon-size);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* The text beside the square. Hidden (no box, so no gap) until something is slotted, so a tile with no text
|
|
96
|
+
is still exactly its square. */
|
|
97
|
+
.bs-icon-tile__text {
|
|
98
|
+
display: none;
|
|
99
|
+
color: var(--bs-icon-tile-text-color);
|
|
100
|
+
font-size: var(--bs-font-size-md);
|
|
101
|
+
line-height: 24px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.bs-icon-tile__text--visible {
|
|
105
|
+
display: block;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([size='sm']) .bs-icon-tile__text {
|
|
109
|
+
font-size: var(--bs-font-size-sm);
|
|
110
|
+
line-height: 20px;
|
|
111
|
+
}
|
|
112
|
+
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A small rounded square holding an icon, tinted by intent -- the visual marker next to a status,
|
|
4
|
+
* a list item or a feature. Matches the Figma "Icon tile" component (3 sizes x 6 intents).
|
|
5
|
+
*
|
|
6
|
+
* Each intent shows a default glyph (house, check, warning, cross, grid, info); put your own icon in
|
|
7
|
+
* the default slot to replace it. A slotted icon is sized to the tile (12/16/24px) and coloured
|
|
8
|
+
* with the intent's icon colour, as long as it draws with `currentColor`.
|
|
9
|
+
*
|
|
10
|
+
* The tile is decorative by default (hidden from assistive tech). Don't rely on the colour or glyph
|
|
11
|
+
* alone to convey status: slot text into `text` (it sits beside the square, in
|
|
12
|
+
* `--bs-icon-tile-text-color`), or set `label` to give the tile its own accessible name.
|
|
13
|
+
*
|
|
14
|
+
* ## When to use
|
|
15
|
+
* - Marking a row, card or message with a status or category icon.
|
|
16
|
+
*
|
|
17
|
+
* ## When not to use
|
|
18
|
+
* - As a button -- it isn't interactive. Use `bs-icon-button`.
|
|
19
|
+
*
|
|
20
|
+
* @slot - Optional icon replacing the intent's default glyph.
|
|
21
|
+
* @slot text - Optional text shown beside the square (e.g. "Payment received"), in `--bs-icon-tile-text-color`.
|
|
22
|
+
* @part container - The tinted square.
|
|
23
|
+
* @part icon - The wrapper around the glyph (default or slotted).
|
|
24
|
+
* @part text - The wrapper around the `text` slot (only shown when something is slotted).
|
|
25
|
+
*/
|
|
26
|
+
export class BsIconTile {
|
|
27
|
+
/** Tile size: `sm` 24px, `md` 32px, `lg` 48px. */
|
|
28
|
+
size = 'sm';
|
|
29
|
+
/** Colour and default glyph. `brand` uses the brand colours; `information` the info palette. */
|
|
30
|
+
intent = 'default';
|
|
31
|
+
/** Accessible name. When set, the tile is exposed as an image with this name; when empty it is
|
|
32
|
+
* decorative and hidden from assistive tech. */
|
|
33
|
+
label;
|
|
34
|
+
/** True while the default slot holds a real element or non-blank text (a custom icon), not just whitespace. */
|
|
35
|
+
hasCustomIcon = false;
|
|
36
|
+
/** True while something is assigned to the `text` slot, so the text wrapper (and its gap) only exists then. */
|
|
37
|
+
hasText = false;
|
|
38
|
+
render() {
|
|
39
|
+
const labelled = !!this.label;
|
|
40
|
+
return [
|
|
41
|
+
h("div", { key: 'f23caf72680e3224fc8618cbebceac30590d36ce', part: "container", class: "bs-icon-tile", role: labelled ? 'img' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' }, h("span", { key: '944d594e4492b30544f935b217691ec7e53f398d', part: "icon", class: "bs-icon-tile__icon" }, h("slot", { key: 'cd62ccaf12a2ff398d506b865665eae42b2e43ff', onSlotchange: (ev) => (this.hasCustomIcon = hasContent(ev.target)) }), !this.hasCustomIcon && (GLYPHS[this.intent] ?? GLYPHS.default))),
|
|
42
|
+
h("span", { key: 'f33a9fa50a2db0aee33fd8346681a5f56f22f685', part: "text", class: { 'bs-icon-tile__text': true, 'bs-icon-tile__text--visible': this.hasText } }, h("slot", { key: 'cb79316ee18a13c4f8d0dcb1d2271a22a6e71471', name: "text", onSlotchange: (ev) => (this.hasText = ev.target.assignedNodes().length > 0) })),
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
static get is() { return "bs-icon-tile"; }
|
|
46
|
+
static get encapsulation() { return "shadow"; }
|
|
47
|
+
static get originalStyleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["bs-icon-tile.css"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get styleUrls() {
|
|
53
|
+
return {
|
|
54
|
+
"$": ["bs-icon-tile.css"]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
static get properties() {
|
|
58
|
+
return {
|
|
59
|
+
"size": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "BsIconTileSize",
|
|
64
|
+
"resolved": "\"lg\" | \"md\" | \"sm\"",
|
|
65
|
+
"references": {
|
|
66
|
+
"BsIconTileSize": {
|
|
67
|
+
"location": "local",
|
|
68
|
+
"path": "/home/runner/work/eg-brandsync-storybook/eg-brandsync-storybook/packages/wc/src/components/bs-icon-tile/bs-icon-tile.tsx",
|
|
69
|
+
"id": "src/components/bs-icon-tile/bs-icon-tile.tsx::BsIconTileSize"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"required": false,
|
|
74
|
+
"optional": false,
|
|
75
|
+
"docs": {
|
|
76
|
+
"tags": [],
|
|
77
|
+
"text": "Tile size: `sm` 24px, `md` 32px, `lg` 48px."
|
|
78
|
+
},
|
|
79
|
+
"getter": false,
|
|
80
|
+
"setter": false,
|
|
81
|
+
"reflect": true,
|
|
82
|
+
"attribute": "size",
|
|
83
|
+
"defaultValue": "'sm'"
|
|
84
|
+
},
|
|
85
|
+
"intent": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"mutable": false,
|
|
88
|
+
"complexType": {
|
|
89
|
+
"original": "BsIconTileIntent",
|
|
90
|
+
"resolved": "\"brand\" | \"default\" | \"error\" | \"information\" | \"success\" | \"warning\"",
|
|
91
|
+
"references": {
|
|
92
|
+
"BsIconTileIntent": {
|
|
93
|
+
"location": "local",
|
|
94
|
+
"path": "/home/runner/work/eg-brandsync-storybook/eg-brandsync-storybook/packages/wc/src/components/bs-icon-tile/bs-icon-tile.tsx",
|
|
95
|
+
"id": "src/components/bs-icon-tile/bs-icon-tile.tsx::BsIconTileIntent"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"required": false,
|
|
100
|
+
"optional": false,
|
|
101
|
+
"docs": {
|
|
102
|
+
"tags": [],
|
|
103
|
+
"text": "Colour and default glyph. `brand` uses the brand colours; `information` the info palette."
|
|
104
|
+
},
|
|
105
|
+
"getter": false,
|
|
106
|
+
"setter": false,
|
|
107
|
+
"reflect": true,
|
|
108
|
+
"attribute": "intent",
|
|
109
|
+
"defaultValue": "'default'"
|
|
110
|
+
},
|
|
111
|
+
"label": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"mutable": false,
|
|
114
|
+
"complexType": {
|
|
115
|
+
"original": "string",
|
|
116
|
+
"resolved": "string",
|
|
117
|
+
"references": {}
|
|
118
|
+
},
|
|
119
|
+
"required": false,
|
|
120
|
+
"optional": true,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": "Accessible name. When set, the tile is exposed as an image with this name; when empty it is\ndecorative and hidden from assistive tech."
|
|
124
|
+
},
|
|
125
|
+
"getter": false,
|
|
126
|
+
"setter": false,
|
|
127
|
+
"reflect": false,
|
|
128
|
+
"attribute": "label"
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
static get states() {
|
|
133
|
+
return {
|
|
134
|
+
"hasCustomIcon": {},
|
|
135
|
+
"hasText": {}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function hasContent(slot) {
|
|
140
|
+
return slot.assignedNodes().some(n => n.nodeType === Node.ELEMENT_NODE || (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim()));
|
|
141
|
+
}
|
|
142
|
+
const svgProps = {
|
|
143
|
+
viewBox: '0 0 24 24',
|
|
144
|
+
fill: 'none',
|
|
145
|
+
stroke: 'currentColor',
|
|
146
|
+
'stroke-width': '2',
|
|
147
|
+
'stroke-linecap': 'round',
|
|
148
|
+
'stroke-linejoin': 'round',
|
|
149
|
+
'aria-hidden': 'true',
|
|
150
|
+
};
|
|
151
|
+
const GLYPHS = {
|
|
152
|
+
default: (h("svg", { ...svgProps }, h("path", { d: "M4 10.5L12 3.5L20 10.5V19.5H4V10.5Z" }))),
|
|
153
|
+
success: (h("svg", { ...svgProps }, h("circle", { cx: "12", cy: "12", r: "9" }), h("path", { d: "M8 12.5L10.8 15.3L16 9.5" }))),
|
|
154
|
+
warning: (h("svg", { ...svgProps }, h("circle", { cx: "12", cy: "12", r: "9" }), h("path", { d: "M12 7.5V12.5" }), h("path", { d: "M12 16.2V16.3" }))),
|
|
155
|
+
error: (h("svg", { ...svgProps }, h("path", { d: "M5 5L19 19" }), h("path", { d: "M19 5L5 19" }))),
|
|
156
|
+
brand: (h("svg", { ...svgProps }, h("rect", { x: "4", y: "4", width: "6.5", height: "6.5", rx: "0.5" }), h("rect", { x: "13.5", y: "4", width: "6.5", height: "6.5", rx: "0.5" }), h("rect", { x: "4", y: "13.5", width: "6.5", height: "6.5", rx: "0.5" }), h("rect", { x: "13.5", y: "13.5", width: "6.5", height: "6.5", rx: "0.5" }))),
|
|
157
|
+
information: (h("svg", { ...svgProps }, h("circle", { cx: "12", cy: "12", r: "9" }), h("path", { d: "M12 11V16.5" }), h("path", { d: "M12 7.7V7.8" }))),
|
|
158
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
3
|
+
import { componentDescription, propDescription } from "../../stories-utils";
|
|
4
|
+
const INTENTS = ['default', 'success', 'warning', 'error', 'brand', 'information'];
|
|
5
|
+
const SIZES = ['sm', 'md', 'lg'];
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/bs-icon-tile',
|
|
8
|
+
parameters: { docs: { description: { component: componentDescription('bs-icon-tile') } } },
|
|
9
|
+
render: args => html `<bs-icon-tile size=${args.size} intent=${args.intent} label=${ifDefined(args.label || undefined)}></bs-icon-tile>`,
|
|
10
|
+
argTypes: {
|
|
11
|
+
size: { control: 'inline-radio', options: SIZES, description: propDescription('bs-icon-tile', 'size') },
|
|
12
|
+
intent: { control: 'select', options: INTENTS, description: propDescription('bs-icon-tile', 'intent') },
|
|
13
|
+
label: { control: 'text', description: propDescription('bs-icon-tile', 'label') },
|
|
14
|
+
},
|
|
15
|
+
args: { size: 'sm', intent: 'default', label: '' },
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
export const Default = {};
|
|
19
|
+
// The Figma frame: 3 sizes (rows) x 6 intents (columns).
|
|
20
|
+
export const AllSizesAndIntents = {
|
|
21
|
+
name: 'All sizes and intents',
|
|
22
|
+
render: () => html `
|
|
23
|
+
<div style="display: grid; grid-template-columns: repeat(6, auto); gap: 24px; align-items: center; justify-items: center;">
|
|
24
|
+
${SIZES.flatMap(size => INTENTS.map(intent => html `<bs-icon-tile size=${size} intent=${intent}></bs-icon-tile>`))}
|
|
25
|
+
</div>
|
|
26
|
+
`,
|
|
27
|
+
};
|
|
28
|
+
export const CustomIcon = {
|
|
29
|
+
name: 'Custom icon',
|
|
30
|
+
render: () => html `
|
|
31
|
+
<bs-icon-tile size="lg" intent="brand">
|
|
32
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
33
|
+
<path d="M12 3L14.5 9L21 9.5L16 14L17.5 21L12 17.5L6.5 21L8 14L3 9.5L9.5 9L12 3Z" />
|
|
34
|
+
</svg>
|
|
35
|
+
</bs-icon-tile>
|
|
36
|
+
`,
|
|
37
|
+
};
|
|
38
|
+
export const WithText = {
|
|
39
|
+
name: 'With text (status)',
|
|
40
|
+
render: () => html `
|
|
41
|
+
<bs-icon-tile size="md" intent="success">
|
|
42
|
+
<span slot="text">Payment received</span>
|
|
43
|
+
</bs-icon-tile>
|
|
44
|
+
`,
|
|
45
|
+
};
|
|
@@ -414,4 +414,18 @@ describe('bs-input', () => {
|
|
|
414
414
|
expect(field).toHaveClass('bs-input__field--error');
|
|
415
415
|
});
|
|
416
416
|
});
|
|
417
|
+
describe('label custom properties', () => {
|
|
418
|
+
it('keeps the 14px medium label by default', async () => {
|
|
419
|
+
const { root } = await render(h("bs-input", { label: "Name" }));
|
|
420
|
+
const label = getComputedStyle(root.shadowRoot.querySelector('.bs-input__label'));
|
|
421
|
+
expect(label.fontSize).toBe('14px');
|
|
422
|
+
expect(label.fontWeight).toBe('500');
|
|
423
|
+
});
|
|
424
|
+
it('can restyle the label through --bs-input-label-font-size/-weight', async () => {
|
|
425
|
+
const { root } = await render(h("bs-input", { label: "Name", style: { '--bs-input-label-font-size': '16px', '--bs-input-label-font-weight': '600' } }));
|
|
426
|
+
const label = getComputedStyle(root.shadowRoot.querySelector('.bs-input__label'));
|
|
427
|
+
expect(label.fontSize).toBe('16px');
|
|
428
|
+
expect(label.fontWeight).toBe('600');
|
|
429
|
+
});
|
|
430
|
+
});
|
|
417
431
|
});
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
* @prop --bs-input-field-text: Input text color. Aliased to --bs-input-text.
|
|
20
20
|
* @prop --bs-input-field-placeholder: Placeholder text color. Aliased to --bs-input-placeholder.
|
|
21
21
|
* @prop --bs-input-label-color: Label text color. Aliased to --bs-input-label.
|
|
22
|
+
* @prop --bs-input-label-font-size: Label font size. Aliased to --bs-font-size-sm.
|
|
23
|
+
* @prop --bs-input-label-font-weight: Label font weight. Aliased to --bs-font-weight-medium.
|
|
24
|
+
* @prop --bs-input-label-line-height: Label line height. `normal` by default (the label sizes to its font).
|
|
22
25
|
* @prop --bs-input-description-color: Description text color. Aliased to --bs-input-description.
|
|
23
26
|
* @prop --bs-input-error-color: Error message text color. Aliased to --bs-input-error.
|
|
24
27
|
* @prop --bs-input-chip-bg: Chip pill background for type="chip". Aliased to --bs-input-bg-disabled.
|
|
@@ -53,6 +56,9 @@
|
|
|
53
56
|
--bs-input-field-text: var(--bs-input-text);
|
|
54
57
|
--bs-input-field-placeholder: var(--bs-input-placeholder);
|
|
55
58
|
--bs-input-label-color: var(--bs-input-label);
|
|
59
|
+
--bs-input-label-font-size: var(--bs-font-size-sm);
|
|
60
|
+
--bs-input-label-font-weight: var(--bs-font-weight-medium);
|
|
61
|
+
--bs-input-label-line-height: normal;
|
|
56
62
|
--bs-input-description-color: var(--bs-input-description);
|
|
57
63
|
--bs-input-error-color: var(--bs-input-error);
|
|
58
64
|
|
|
@@ -77,8 +83,9 @@
|
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
.bs-input__label {
|
|
80
|
-
font-size: var(--bs-font-size
|
|
81
|
-
font-weight: var(--bs-font-weight
|
|
86
|
+
font-size: var(--bs-input-label-font-size);
|
|
87
|
+
font-weight: var(--bs-input-label-font-weight);
|
|
88
|
+
line-height: var(--bs-input-label-line-height);
|
|
82
89
|
color: var(--bs-input-label-color);
|
|
83
90
|
}
|
|
84
91
|
|
|
@@ -314,7 +314,10 @@ export class BsInput {
|
|
|
314
314
|
}
|
|
315
315
|
renderStandardControl() {
|
|
316
316
|
const nativeType = this.type === 'password' ? (this.passwordVisible ? 'text' : 'password') : this.type === 'dropdown' ? 'text' : this.type;
|
|
317
|
-
return (h("input", { id: "control", part: "control", class: "bs-input__control", type: nativeType, value: this.value, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.type === 'dropdown',
|
|
317
|
+
return (h("input", { id: "control", part: "control", class: "bs-input__control", type: nativeType, value: this.value, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.type === 'dropdown',
|
|
318
|
+
// The popup state belongs on the focusable control (a roleless wrapper div can't carry
|
|
319
|
+
// aria-haspopup/aria-expanded -- axe's aria-allowed-attr flags it).
|
|
320
|
+
role: this.type === 'dropdown' ? 'combobox' : undefined, "aria-haspopup": this.type === 'dropdown' ? 'listbox' : undefined, "aria-expanded": this.type === 'dropdown' ? String(this.open) : undefined, min: this.type === 'number' ? this.min : undefined, max: this.type === 'number' ? this.max : undefined, step: this.type === 'number' ? this.step : undefined, "aria-describedby": this.error || this.description ? 'description-or-error' : undefined, "aria-invalid": this.error ? 'true' : undefined, "aria-required": this.required ? 'true' : undefined, onInput: this.onInput, onChange: this.onChange }));
|
|
318
321
|
}
|
|
319
322
|
renderSelectControl() {
|
|
320
323
|
return (h("select", { id: "control", part: "control", class: "bs-input__control", disabled: this.disabled, "aria-describedby": this.error || this.description ? 'description-or-error' : undefined, "aria-invalid": this.error ? 'true' : undefined, "aria-required": this.required ? 'true' : undefined, onInput: this.onInput, onChange: this.onChange }, this.options.map(opt => (h("option", { value: opt.value, selected: opt.value === this.value }, opt.label)))));
|
|
@@ -374,7 +377,7 @@ export class BsInput {
|
|
|
374
377
|
.filter(Boolean)
|
|
375
378
|
.join(' ');
|
|
376
379
|
const isDropdown = this.type === 'dropdown';
|
|
377
|
-
return (h("div", { class: "bs-input__field-wrapper" }, h("div", { part: "field", class: fieldClasses, onClick: isDropdown ? this.onDropdownToggle : undefined, onKeyDown: isDropdown ? this.onDropdownKeydown : undefined
|
|
380
|
+
return (h("div", { class: "bs-input__field-wrapper" }, h("div", { part: "field", class: fieldClasses, onClick: isDropdown ? this.onDropdownToggle : undefined, onKeyDown: isDropdown ? this.onDropdownKeydown : undefined }, h("span", { part: "icon", class: `bs-input__icon ${this.showsIconArea ? 'bs-input__icon--visible' : ''}` }, this.renderIconContent()), this.renderControl(), h("span", { part: "end-icon", class: `bs-input__end-icon ${this.showsEndIconArea ? 'bs-input__end-icon--visible' : ''}` }, this.renderEndIconContent())), isDropdown && this.open && this.options.length > 0 && (h("bs-menu", { part: "menu", class: "bs-input__dropdown-menu", role: "listbox" }, this.options.map(option => (h("bs-menu-item", { key: option.value, onBsSelect: this.onDropdownOptionSelect(option) }, option.label)))))));
|
|
378
381
|
}
|
|
379
382
|
renderPinField() {
|
|
380
383
|
this.pinInputs = [];
|
|
@@ -383,10 +386,10 @@ export class BsInput {
|
|
|
383
386
|
return (h("div", { part: "field", class: `bs-input__field bs-input__field--pin ${errorClass} ${disabledClass}` }, Array.from({ length: this.length }).map((_, i) => (h("input", { id: i === 0 ? 'control' : undefined, ref: el => (this.pinInputs[i] = el), part: "control", class: "bs-input__pin-cell", type: "text", inputMode: "numeric", maxLength: 1, value: this.value[i] ?? '', disabled: this.disabled, "aria-required": this.required ? 'true' : undefined, onInput: this.onPinInput(i), onKeyDown: this.onPinKeydown(i) })))));
|
|
384
387
|
}
|
|
385
388
|
render() {
|
|
386
|
-
return (h("div", { key: '
|
|
389
|
+
return (h("div", { key: '8fd3623575cfcc750a9cb62d0a30351b305d5a68', class: `bs-input ${this.error ? 'bs-input--error' : ''}` }, this.label && (
|
|
387
390
|
// "control" is a fixed id, not a generated one -- safe because Shadow DOM scopes ids
|
|
388
391
|
// to this instance's own shadow root, so it can never collide with another bs-input.
|
|
389
|
-
h("label", { key: '
|
|
392
|
+
h("label", { key: 'fb67ed85a291856e1fbb7d7f54a4ba98c662deeb', part: "label", class: "bs-input__label", htmlFor: "control" }, this.label, this.required && (h("span", { key: '6cf68bab9f5060898141df96a22df306d98445e5', part: "required", class: "bs-input__required", "aria-hidden": "true" }, "*")))), this.type === 'pin' ? this.renderPinField() : this.type === 'initials' ? this.renderInitialsField() : this.renderField(), this.error ? (h("span", { id: "description-or-error", part: "error", class: "bs-input__error" }, h("svg", { part: "error-icon", class: "bs-input__error-icon", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, h("circle", { cx: "8", cy: "8", r: "6.5", stroke: "currentColor", "stroke-width": "1.2" }), h("path", { d: "M8 5V8.5", stroke: "currentColor", "stroke-width": "1.2", "stroke-linecap": "round" }), h("circle", { cx: "8", cy: "11", r: "0.75", fill: "currentColor" })), this.error)) : this.description ? (h("span", { id: "description-or-error", part: "description", class: "bs-input__description" }, this.description)) : null));
|
|
390
393
|
}
|
|
391
394
|
static get is() { return "bs-input"; }
|
|
392
395
|
static get encapsulation() { return "shadow"; }
|
|
@@ -44,7 +44,7 @@ export class BsMenu {
|
|
|
44
44
|
items[next].shadowRoot?.querySelector('button')?.focus();
|
|
45
45
|
}
|
|
46
46
|
render() {
|
|
47
|
-
return (h("div", { key: '
|
|
47
|
+
return (h("div", { key: 'ba99d3c35c0c7ab4427155ac13e89c434068ef49', part: "list", class: "bs-menu", role: "menu" }, h("slot", { key: '817f29507503adcaad013a8035d35bc1f35ffdef' })));
|
|
48
48
|
}
|
|
49
49
|
static get is() { return "bs-menu"; }
|
|
50
50
|
static get encapsulation() { return "shadow"; }
|