@brandsync/wc 0.0.11 → 0.0.12
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 +3388 -598
- package/dist/brandsync-wc/brandsync-wc.css +20 -0
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/{p-6254dcbe.entry.js → p-09aa03d1.entry.js} +1 -1
- package/dist/brandsync-wc/p-0eee5477.entry.js +1 -0
- package/dist/brandsync-wc/p-0fa017ce.entry.js +1 -0
- package/dist/brandsync-wc/p-12ec9e92.entry.js +1 -0
- package/dist/brandsync-wc/{p-4ca15322.entry.js → p-1900f6ce.entry.js} +1 -1
- package/dist/brandsync-wc/{p-1bf0b2d5.entry.js → p-1adc59be.entry.js} +1 -1
- package/dist/brandsync-wc/p-1c6fa697.entry.js +1 -0
- package/dist/brandsync-wc/{p-8d78171b.entry.js → p-1cf715aa.entry.js} +1 -1
- package/dist/brandsync-wc/{p-84ae4420.entry.js → p-20dbc6a1.entry.js} +1 -1
- package/dist/brandsync-wc/{p-74a4dd91.entry.js → p-23457a21.entry.js} +1 -1
- package/dist/brandsync-wc/p-266f5dde.entry.js +1 -0
- package/dist/brandsync-wc/{p-073e5fee.entry.js → p-2a65aabb.entry.js} +1 -1
- package/dist/brandsync-wc/{p-030a8ba7.entry.js → p-2c51d738.entry.js} +1 -1
- package/dist/brandsync-wc/p-3b31f7c7.entry.js +1 -0
- package/dist/brandsync-wc/p-46ddc8e1.entry.js +1 -0
- package/dist/brandsync-wc/p-56c66448.entry.js +1 -0
- package/dist/brandsync-wc/{p-dd224cb3.entry.js → p-57fdbb76.entry.js} +1 -1
- package/dist/brandsync-wc/{p-8dff4f24.entry.js → p-64e2a7d7.entry.js} +1 -1
- package/dist/brandsync-wc/{p-b174403d.entry.js → p-6e854e92.entry.js} +1 -1
- package/dist/brandsync-wc/p-72a33f88.entry.js +1 -0
- package/dist/brandsync-wc/p-8049f9f2.entry.js +1 -0
- package/dist/brandsync-wc/{p-c6d330c3.entry.js → p-88a0abee.entry.js} +1 -1
- package/dist/brandsync-wc/p-8b662ee3.entry.js +1 -0
- package/dist/brandsync-wc/{p-41edb0a2.entry.js → p-8ded1eb6.entry.js} +1 -1
- package/dist/brandsync-wc/{p-DP_bvuvB.js → p-DST5-cTx.js} +2 -2
- package/dist/brandsync-wc/p-a5b15061.entry.js +1 -0
- package/dist/brandsync-wc/{p-7a605d98.entry.js → p-aba300a9.entry.js} +1 -1
- package/dist/brandsync-wc/p-b24a980b.entry.js +1 -0
- package/dist/brandsync-wc/p-b289450a.entry.js +1 -0
- package/dist/brandsync-wc/{p-7131d0a1.entry.js → p-b8a2f882.entry.js} +1 -1
- package/dist/brandsync-wc/p-c320b6b4.entry.js +1 -0
- package/dist/brandsync-wc/{p-d1dc2ced.entry.js → p-d4e3ca77.entry.js} +1 -1
- package/dist/brandsync-wc/{p-0b858120.entry.js → p-dd09d335.entry.js} +1 -1
- package/dist/brandsync-wc/p-ef8522b5.entry.js +1 -0
- package/dist/brandsync-wc/p-f04db1b0.entry.js +1 -0
- package/dist/cjs/brandsync-wc.cjs.js +2 -2
- package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +3 -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 +3 -3
- package/dist/cjs/bs-badge.cjs.entry.js +1 -1
- 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 +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.cjs.entry.js +14 -3
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +14 -2
- package/dist/cjs/bs-composer.cjs.entry.js +37 -4
- package/dist/cjs/bs-data-table.cjs.entry.js +3 -3
- package/dist/cjs/bs-icon-button.cjs.entry.js +40 -0
- package/dist/cjs/bs-inline-tab.cjs.entry.js +69 -0
- package/dist/cjs/bs-input.cjs.entry.js +3 -3
- package/dist/cjs/bs-logo.cjs.entry.js +165 -0
- package/dist/cjs/bs-menu_2.cjs.entry.js +3 -3
- package/dist/cjs/bs-modal.cjs.entry.js +1 -1
- package/dist/cjs/bs-navigation-drawer-item.cjs.entry.js +104 -0
- package/dist/cjs/bs-navigation-drawer.cjs.entry.js +81 -0
- package/dist/cjs/bs-navigation-header.cjs.entry.js +44 -0
- package/dist/cjs/bs-radio.cjs.entry.js +49 -0
- package/dist/cjs/bs-slider.cjs.entry.js +191 -0
- package/dist/cjs/bs-source-link.cjs.entry.js +3 -3
- package/dist/cjs/bs-switch.cjs.entry.js +57 -0
- package/dist/cjs/bs-tab.cjs.entry.js +80 -0
- package/dist/cjs/bs-tabs.cjs.entry.js +39 -0
- package/dist/cjs/bs-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{index-CGrdFg95.js → index-B3sdhEGk.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +13 -2
- package/dist/collection/components/bs-ai-chatbot/bs-ai-chatbot.stories.js +26 -11
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +2 -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.css +12 -33
- package/dist/collection/components/bs-attachment/bs-attachment.js +4 -10
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +1 -1
- package/dist/collection/components/bs-button/{bs-button.cmp.test.js → bs-button/bs-button.cmp.test.js} +26 -0
- package/dist/collection/components/bs-button/{bs-button.css → bs-button/bs-button.css} +57 -6
- package/dist/collection/components/bs-button/{bs-button.js → bs-button/bs-button.js} +10 -5
- package/dist/collection/components/bs-button/{bs-button.stories.js → bs-button/bs-button.stories.js} +2 -27
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.cmp.test.js +83 -0
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.css +346 -0
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.js +185 -0
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.stories.js +74 -0
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +3 -3
- 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.cmp.test.js +10 -0
- package/dist/collection/components/bs-checkbox/bs-checkbox.css +7 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox.js +32 -1
- package/dist/collection/components/bs-composer/bs-composer.cmp.test.js +48 -7
- package/dist/collection/components/bs-composer/bs-composer.css +15 -0
- package/dist/collection/components/bs-composer/bs-composer.js +38 -4
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.js +47 -1
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.js +20 -1
- package/dist/collection/components/bs-data-table/bs-data-table.js +2 -2
- package/dist/collection/components/bs-input/bs-input.js +2 -2
- package/dist/collection/components/bs-logo/brandsync-logo-full-dark.js +44 -0
- package/dist/collection/components/bs-logo/brandsync-logo-full-light.js +40 -0
- package/dist/collection/components/bs-logo/brandsync-logo-mark.js +17 -0
- package/dist/collection/components/bs-logo/bs-logo.cmp.test.js +113 -0
- package/dist/collection/components/bs-logo/bs-logo.css +79 -0
- package/dist/collection/components/bs-logo/bs-logo.js +193 -0
- package/dist/collection/components/bs-logo/bs-logo.stories.js +69 -0
- 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-radio/bs-radio.cmp.test.js +76 -0
- package/dist/collection/components/bs-radio/bs-radio.css +164 -0
- package/dist/collection/components/bs-radio/bs-radio.js +170 -0
- package/dist/collection/components/bs-radio/bs-radio.stories.js +56 -0
- package/dist/collection/components/bs-slider/bs-slider.cmp.test.js +139 -0
- package/dist/collection/components/bs-slider/bs-slider.css +409 -0
- package/dist/collection/components/bs-slider/bs-slider.js +499 -0
- package/dist/collection/components/bs-slider/bs-slider.stories.js +70 -0
- package/dist/collection/components/bs-source-link/bs-source-link.js +2 -2
- package/dist/collection/components/bs-switch/bs-switch.cmp.test.js +71 -0
- package/dist/collection/components/bs-switch/bs-switch.css +196 -0
- package/dist/collection/components/bs-switch/bs-switch.js +185 -0
- package/dist/collection/components/bs-switch/bs-switch.stories.js +60 -0
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.cmp.test.js +104 -0
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.css +163 -0
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.js +192 -0
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.stories.js +95 -0
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.cmp.test.js +120 -0
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.css +216 -0
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.js +232 -0
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.stories.js +138 -0
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.cmp.test.js +61 -0
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.css +39 -0
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.js +133 -0
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.stories.js +39 -0
- package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.cmp.test.js +131 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.css +257 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.js +253 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.stories.js +202 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.cmp.test.js +172 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.css +325 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.js +314 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.stories.js +78 -0
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.cmp.test.js +77 -0
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.css +106 -0
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.js +188 -0
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.stories.js +189 -0
- 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-badge.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-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.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-data-table.js +1 -1
- package/dist/components/bs-icon-button.d.ts +11 -0
- package/dist/components/bs-icon-button.js +1 -0
- package/dist/components/bs-inline-tab.d.ts +11 -0
- package/dist/components/bs-inline-tab.js +1 -0
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-logo.d.ts +11 -0
- package/dist/components/bs-logo.js +1 -0
- package/dist/components/bs-menu-item.js +1 -1
- package/dist/components/bs-menu.js +1 -1
- package/dist/components/bs-modal.js +1 -1
- package/dist/components/bs-navigation-drawer-item.d.ts +11 -0
- package/dist/components/bs-navigation-drawer-item.js +1 -0
- package/dist/components/bs-navigation-drawer.d.ts +11 -0
- package/dist/components/bs-navigation-drawer.js +1 -0
- package/dist/components/bs-navigation-header.d.ts +11 -0
- package/dist/components/bs-navigation-header.js +1 -0
- package/dist/components/bs-radio.d.ts +11 -0
- package/dist/components/bs-radio.js +1 -0
- package/dist/components/bs-slider.d.ts +11 -0
- package/dist/components/bs-slider.js +1 -0
- package/dist/components/bs-source-link.js +1 -1
- package/dist/components/bs-switch.d.ts +11 -0
- package/dist/components/bs-switch.js +1 -0
- package/dist/components/bs-tab.d.ts +11 -0
- package/dist/components/bs-tab.js +1 -0
- package/dist/components/bs-tabs.d.ts +11 -0
- package/dist/components/bs-tabs.js +1 -0
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-BAOJc0V0.js +1 -0
- package/dist/components/{p-D1cYtKyN.js → p-Be1Pfcnm.js} +1 -1
- package/dist/components/{p-B9PrXIl_.js → p-BqYyMGrB.js} +1 -1
- package/dist/components/p-CaWqTQBZ.js +1 -0
- package/dist/components/{p-BUbGEXL7.js → p-DivZLd6i.js} +1 -1
- package/dist/components/{p-D2HDHZjz.js → p-xfx69LQx.js} +1 -1
- package/dist/esm/brandsync-wc.js +3 -3
- package/dist/esm/bs-ai-disclaimer.entry.js +3 -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 +3 -3
- package/dist/esm/bs-badge.entry.js +1 -1
- 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 +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.entry.js +14 -3
- package/dist/esm/bs-composer-status-banner.entry.js +14 -2
- package/dist/esm/bs-composer.entry.js +37 -4
- package/dist/esm/bs-data-table.entry.js +3 -3
- package/dist/esm/bs-icon-button.entry.js +38 -0
- package/dist/esm/bs-inline-tab.entry.js +67 -0
- package/dist/esm/bs-input.entry.js +3 -3
- package/dist/esm/bs-logo.entry.js +163 -0
- package/dist/esm/bs-menu_2.entry.js +3 -3
- package/dist/esm/bs-modal.entry.js +1 -1
- package/dist/esm/bs-navigation-drawer-item.entry.js +102 -0
- package/dist/esm/bs-navigation-drawer.entry.js +79 -0
- package/dist/esm/bs-navigation-header.entry.js +42 -0
- package/dist/esm/bs-radio.entry.js +47 -0
- package/dist/esm/bs-slider.entry.js +189 -0
- package/dist/esm/bs-source-link.entry.js +3 -3
- package/dist/esm/bs-switch.entry.js +55 -0
- package/dist/esm/bs-tab.entry.js +78 -0
- package/dist/esm/bs-tabs.entry.js +37 -0
- package/dist/esm/bs-tooltip.entry.js +2 -2
- package/dist/esm/{index-DP_bvuvB.js → index-DST5-cTx.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/bs-attachment/bs-attachment.d.ts +3 -9
- package/dist/types/components/bs-button/{bs-button.d.ts → bs-button/bs-button.d.ts} +5 -0
- package/dist/types/components/bs-button/{bs-button.stories.d.ts → bs-button/bs-button.stories.d.ts} +0 -2
- package/dist/types/components/bs-button/bs-icon-button/bs-icon-button.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-button/bs-icon-button/bs-icon-button.d.ts +51 -0
- package/dist/types/components/bs-button/bs-icon-button/bs-icon-button.stories.d.ts +16 -0
- package/dist/types/components/bs-button-skeleton/bs-button-skeleton.d.ts +1 -1
- package/dist/types/components/bs-button-skeleton/bs-button-skeleton.stories.d.ts +1 -1
- package/dist/types/components/bs-checkbox/bs-checkbox.d.ts +11 -0
- package/dist/types/components/bs-composer/bs-composer.d.ts +26 -2
- package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.d.ts +14 -0
- package/dist/types/components/bs-logo/brandsync-logo-full-dark.d.ts +1 -0
- package/dist/types/components/bs-logo/brandsync-logo-full-light.d.ts +1 -0
- package/dist/types/components/bs-logo/brandsync-logo-mark.d.ts +1 -0
- package/dist/types/components/bs-logo/bs-logo.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-logo/bs-logo.d.ts +73 -0
- package/dist/types/components/bs-logo/bs-logo.stories.d.ts +17 -0
- package/dist/types/components/bs-radio/bs-radio.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-radio/bs-radio.d.ts +45 -0
- package/dist/types/components/bs-radio/bs-radio.stories.d.ts +16 -0
- package/dist/types/components/bs-slider/bs-slider.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-slider/bs-slider.d.ts +109 -0
- package/dist/types/components/bs-slider/bs-slider.stories.d.ts +24 -0
- package/dist/types/components/bs-switch/bs-switch.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-switch/bs-switch.d.ts +45 -0
- package/dist/types/components/bs-switch/bs-switch.stories.d.ts +17 -0
- package/dist/types/components/bs-tab/bs-inline-tab/bs-inline-tab.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-tab/bs-inline-tab/bs-inline-tab.d.ts +65 -0
- package/dist/types/components/bs-tab/bs-inline-tab/bs-inline-tab.stories.d.ts +22 -0
- package/dist/types/components/bs-tab/bs-tab/bs-tab.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-tab/bs-tab/bs-tab.d.ts +74 -0
- package/dist/types/components/bs-tab/bs-tab/bs-tab.stories.d.ts +30 -0
- package/dist/types/components/bs-tab/bs-tabs/bs-tabs.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-tab/bs-tabs/bs-tabs.d.ts +45 -0
- package/dist/types/components/bs-tab/bs-tabs/bs-tabs.stories.d.ts +13 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.cmp.test.d.ts +1 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.d.ts +96 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.stories.d.ts +16 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.cmp.test.d.ts +1 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.d.ts +103 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.stories.d.ts +20 -0
- package/dist/types/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.cmp.test.d.ts +1 -0
- package/dist/types/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.d.ts +60 -0
- package/dist/types/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.stories.d.ts +21 -0
- package/dist/types/components.d.ts +1842 -53
- package/package.json +1 -1
- package/dist/brandsync-wc/p-2598ca88.entry.js +0 -1
- package/dist/brandsync-wc/p-3c8fbaa8.entry.js +0 -1
- package/dist/brandsync-wc/p-3dd9b814.entry.js +0 -1
- package/dist/brandsync-wc/p-8c302968.entry.js +0 -1
- package/dist/brandsync-wc/p-93e44903.entry.js +0 -1
- package/dist/brandsync-wc/p-aa45d877.entry.js +0 -1
- /package/dist/types/components/bs-button/{bs-button.cmp.test.d.ts → bs-button/bs-button.cmp.test.d.ts} +0 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A left-side persistent navigation sidebar: the BrandSync logo, a "Main Menu" title with a
|
|
4
|
+
* collapse toggle, a reserved slot for a search field, and a scrollable list of nav items.
|
|
5
|
+
*
|
|
6
|
+
* ## When to use
|
|
7
|
+
* - The primary in-app navigation, shown alongside `bs-navigation-header` (typically that
|
|
8
|
+
* header's `with-navigation-drawer` alignment, which omits its own logo since this component
|
|
9
|
+
* already renders one).
|
|
10
|
+
*
|
|
11
|
+
* ## When not to use
|
|
12
|
+
* - The top navigation bar itself -- use `bs-navigation-header` instead.
|
|
13
|
+
*
|
|
14
|
+
* This component renders a real `<nav>` landmark (no explicit `role` needed -- `<nav>` already
|
|
15
|
+
* carries the implicit `navigation` role), labeled via `aria-label={heading}` so the landmark
|
|
16
|
+
* still has a name even when collapsed (see below).
|
|
17
|
+
*
|
|
18
|
+
* `collapsed` narrows the drawer to a 96px icon-only rail, per Figma node 8028:135374
|
|
19
|
+
* ("Type=Collapsed"): the title text disappears, the logo swaps from the full "EG BrandSync"
|
|
20
|
+
* wordmark (`bs-logo variant="full"`) to the real icon-only mark (`bs-logo variant="mark"` -- a
|
|
21
|
+
* second, properly-designed asset, not a CSS crop of the full one) via CSS visibility toggling on
|
|
22
|
+
* both, the same `:host([collapsed])` attribute-selector pattern already used for the
|
|
23
|
+
* `search`/`search-trigger` swap below, the `search` slot is replaced by a compact built-in
|
|
24
|
+
* search-trigger button (this component can't meaningfully shrink arbitrary slotted search-field
|
|
25
|
+
* content down to icon size itself, so it emits `bsSearchClick` instead -- e.g. to open a full
|
|
26
|
+
* search overlay), and every top-level
|
|
27
|
+
* `bs-navigation-drawer-item`'s layout switches from icon-beside-label to icon-above-caption.
|
|
28
|
+
* That last part is real prop propagation, not a CSS trick: this component keeps each direct-child
|
|
29
|
+
* item's own `collapsed` prop in sync with its own (see `syncItemsCollapsed` below), the same
|
|
30
|
+
* direct-children-prop-sync approach `bs-tabs` already uses for coordinating `selected` across its
|
|
31
|
+
* `bs-tab` children. Clicking the toggle self-toggles `collapsed` (simple local UI state, not
|
|
32
|
+
* something needing cross-component coordination -- closer to `bs-switch`'s self-toggling
|
|
33
|
+
* `checked` than `bs-tab`'s non-self-toggling `selected`) and emits `bsCollapse` with the new
|
|
34
|
+
* value. The toggle's own caret icon does NOT rotate when collapsed -- Figma's collapsed mock
|
|
35
|
+
* reuses the identical left-pointing "CaretLeft" asset unchanged, confirmed by directly inspecting
|
|
36
|
+
* that state, so this deliberately does not add the same "flip on toggle" idiom the drawer item's
|
|
37
|
+
* own disclosure chevron does (that one really is an unconfirmed addition; this one was checked).
|
|
38
|
+
*
|
|
39
|
+
* @slot search - Reserved for a search field, e.g. a `bs-input type="search"`. This component
|
|
40
|
+
* does not build one itself. Hidden while `collapsed` (see above).
|
|
41
|
+
* @slot - Default slot: the scrollable list of nav items, typically one or more
|
|
42
|
+
* `bs-navigation-drawer-item` elements.
|
|
43
|
+
* @part logo - The wrapper around the BrandSync brand mark. Two of these exist in the shadow DOM
|
|
44
|
+
* at once (one wrapping a `bs-logo variant="full"`, one wrapping a `bs-logo variant="mark"`),
|
|
45
|
+
* both carrying this same part name (the same "multiple elements, one shared part name"
|
|
46
|
+
* approach `bs-attachment`'s `star` part uses) -- only one is visible at a time, toggled by
|
|
47
|
+
* plain CSS on `collapsed` (see above), so `::part(logo)` always reaches whichever is showing.
|
|
48
|
+
* @part title - The "Main Menu" heading text wrapper.
|
|
49
|
+
* @part collapse - The collapse toggle button.
|
|
50
|
+
* @part search - The wrapper around the `search` slot.
|
|
51
|
+
* @part search-trigger - The compact search button shown instead of the `search` slot while `collapsed`.
|
|
52
|
+
* @part items - The wrapper around the default (items) slot.
|
|
53
|
+
*/
|
|
54
|
+
// Note: this component's CSS Custom Properties are documented via @prop comments in
|
|
55
|
+
// bs-navigation-drawer.css, not here -- see bs-navigation-header.css's identical note.
|
|
56
|
+
export class BsNavigationDrawer {
|
|
57
|
+
el;
|
|
58
|
+
/** Heading text shown next to the collapse toggle, and used as the `<nav>` landmark's
|
|
59
|
+
* `aria-label` (so the landmark keeps a name even when `collapsed` hides the visible text). */
|
|
60
|
+
heading = 'Main Menu';
|
|
61
|
+
/** Whether this drawer can be collapsed at all. `false` renders no collapse toggle/chevron --
|
|
62
|
+
* a "fixed" side nav (Carbon's terminology: a `Fixed Side Nav` never collapses, as opposed to a
|
|
63
|
+
* rail-capable one) that's always fully expanded. `collapsed` is ignored while this is `false`. */
|
|
64
|
+
collapsible = true;
|
|
65
|
+
/** Narrows the drawer to a 96px icon-only rail (Figma node 8028:135374). Mutable and reflected
|
|
66
|
+
* -- clicking the collapse toggle toggles this directly (self-toggling, see the class doc above
|
|
67
|
+
* for why), and this component keeps every direct-child `bs-navigation-drawer-item`'s own
|
|
68
|
+
* `collapsed` prop synced to match (see `syncItemsCollapsed`). */
|
|
69
|
+
collapsed = false;
|
|
70
|
+
/** Fires with the new `collapsed` value when the collapse toggle button is clicked. */
|
|
71
|
+
bsCollapse;
|
|
72
|
+
/** Fires when the compact search-trigger button (shown instead of the `search` slot while
|
|
73
|
+
* `collapsed`) is clicked -- e.g. to open a full search overlay. This component has no
|
|
74
|
+
* visibility into what the `search` slot actually contains, so it can't drive a real search
|
|
75
|
+
* itself once shrunk to icon size. */
|
|
76
|
+
bsSearchClick;
|
|
77
|
+
/** Forwarded straight to both internal `bs-logo` elements' own `background` prop. Defaults to
|
|
78
|
+
* `"auto"`, which follows the ambient `[data-theme="dark"]` state automatically (see `bs-logo`'s
|
|
79
|
+
* own docs) -- so if this drawer ends up on a dark surface via the normal theming mechanism, the
|
|
80
|
+
* logo switches to its dedicated dark-background asset with no wiring needed. Set
|
|
81
|
+
* `"light"`/`"dark"` explicitly only if you've overridden `--bs-navigation-drawer-bg` to
|
|
82
|
+
* something dark yourself *without* setting `[data-theme="dark"]`, and need to pin the logo
|
|
83
|
+
* regardless of theme. Has no visible effect on the `variant="mark"` logo shown while
|
|
84
|
+
* `collapsed` (see `bs-logo`'s own docs -- there's only one real designed mark asset, it's
|
|
85
|
+
* background-agnostic). */
|
|
86
|
+
logoBackground = 'auto';
|
|
87
|
+
onCollapsedChange(collapsed) {
|
|
88
|
+
this.syncItemsCollapsed(collapsed);
|
|
89
|
+
}
|
|
90
|
+
componentDidLoad() {
|
|
91
|
+
this.syncItemsCollapsed(this.collapsed);
|
|
92
|
+
}
|
|
93
|
+
/** Keeps every direct-child `bs-navigation-drawer-item`'s `collapsed` prop in sync with this
|
|
94
|
+
* component's own -- same direct-children-prop-sync approach `bs-tabs` uses for `selected`
|
|
95
|
+
* across its `bs-tab` children. Only direct children (top-level items): Figma's collapsed rail
|
|
96
|
+
* never shows nested/expanded children in the first place (see bs-navigation-drawer-item.css's
|
|
97
|
+
* `:host([collapsed])` rule forcing those hidden), so there's nothing to sync on them. */
|
|
98
|
+
syncItemsCollapsed(collapsed) {
|
|
99
|
+
const items = this.el.querySelectorAll(':scope > bs-navigation-drawer-item');
|
|
100
|
+
items.forEach(item => {
|
|
101
|
+
item.collapsed = collapsed;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
onCollapseClick = () => {
|
|
105
|
+
this.collapsed = !this.collapsed;
|
|
106
|
+
this.bsCollapse.emit(this.collapsed);
|
|
107
|
+
};
|
|
108
|
+
onSearchTriggerClick = () => {
|
|
109
|
+
this.bsSearchClick.emit();
|
|
110
|
+
};
|
|
111
|
+
render() {
|
|
112
|
+
return (h("nav", { key: '643a802cfef5b124603056ca409c67e5e9fa0561', class: "bs-navigation-drawer", "aria-label": this.heading }, h("div", { key: '31384937f95737b961aa4f1cb0b535fc78c8fcfd', part: "logo", class: "bs-navigation-drawer__logo bs-navigation-drawer__logo--full" }, h("bs-logo", { key: '834c8a1a031072803815085036ea6b8a744012a2', variant: "full", background: this.logoBackground })), h("div", { key: '50b877188cea0fce86959517f1e14eb4f6869923', part: "logo", class: "bs-navigation-drawer__logo bs-navigation-drawer__logo--mark" }, h("bs-logo", { key: '64b66e3e221d9641026009e0b7b0a0bbdf7b946a', variant: "mark", background: this.logoBackground })), h("div", { key: 'a7634d178a491940cb43ceca3dd93aa83539a316', class: "bs-navigation-drawer__title-row" }, h("span", { key: 'fc018e4474f3a38f96538be9064da6b472193b3f', part: "title", class: "bs-navigation-drawer__title" }, this.heading), this.collapsible && (h("button", { key: '516e28aba1e037b74ac616fbc8f293c0cef9da1a', type: "button", part: "collapse", class: "bs-navigation-drawer__collapse", "aria-label": this.collapsed ? 'Expand' : 'Collapse', "aria-pressed": this.collapsed ? 'true' : 'false', onClick: this.onCollapseClick }, h(CaretLeftIcon, { key: 'fba23fed9c12283360bd89dddee6248ec45c98fb' })))), h("div", { key: '29279ec0051d495810f177a194f8dc6f3c649f90', part: "search", class: "bs-navigation-drawer__search" }, h("slot", { key: '6eef2761d887ddc776132327c8343626071fc3b3', name: "search" })), h("button", { key: '4ee9e0ca46ca85b17394466b452cba29c0e528cc', type: "button", part: "search-trigger", class: "bs-navigation-drawer__search-trigger", "aria-label": "Search", onClick: this.onSearchTriggerClick }, h(SearchIcon, { key: '844c581c6ea6c496718866150e24415f746daa36' })), h("div", { key: '3f7f3c6bb4eae12aa87c732fbc4da6d5b3a87e40', part: "items", class: "bs-navigation-drawer__items" }, h("slot", { key: '20833d282601ea298a39ead5b928155e2db33a97' }))));
|
|
113
|
+
}
|
|
114
|
+
static get is() { return "bs-navigation-drawer"; }
|
|
115
|
+
static get encapsulation() { return "shadow"; }
|
|
116
|
+
static get originalStyleUrls() {
|
|
117
|
+
return {
|
|
118
|
+
"$": ["bs-navigation-drawer.css"]
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
static get styleUrls() {
|
|
122
|
+
return {
|
|
123
|
+
"$": ["bs-navigation-drawer.css"]
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
static get properties() {
|
|
127
|
+
return {
|
|
128
|
+
"heading": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"mutable": false,
|
|
131
|
+
"complexType": {
|
|
132
|
+
"original": "string",
|
|
133
|
+
"resolved": "string",
|
|
134
|
+
"references": {}
|
|
135
|
+
},
|
|
136
|
+
"required": false,
|
|
137
|
+
"optional": false,
|
|
138
|
+
"docs": {
|
|
139
|
+
"tags": [],
|
|
140
|
+
"text": "Heading text shown next to the collapse toggle, and used as the `<nav>` landmark's\n`aria-label` (so the landmark keeps a name even when `collapsed` hides the visible text)."
|
|
141
|
+
},
|
|
142
|
+
"getter": false,
|
|
143
|
+
"setter": false,
|
|
144
|
+
"reflect": false,
|
|
145
|
+
"attribute": "heading",
|
|
146
|
+
"defaultValue": "'Main Menu'"
|
|
147
|
+
},
|
|
148
|
+
"collapsible": {
|
|
149
|
+
"type": "boolean",
|
|
150
|
+
"mutable": false,
|
|
151
|
+
"complexType": {
|
|
152
|
+
"original": "boolean",
|
|
153
|
+
"resolved": "boolean",
|
|
154
|
+
"references": {}
|
|
155
|
+
},
|
|
156
|
+
"required": false,
|
|
157
|
+
"optional": false,
|
|
158
|
+
"docs": {
|
|
159
|
+
"tags": [],
|
|
160
|
+
"text": "Whether this drawer can be collapsed at all. `false` renders no collapse toggle/chevron --\na \"fixed\" side nav (Carbon's terminology: a `Fixed Side Nav` never collapses, as opposed to a\nrail-capable one) that's always fully expanded. `collapsed` is ignored while this is `false`."
|
|
161
|
+
},
|
|
162
|
+
"getter": false,
|
|
163
|
+
"setter": false,
|
|
164
|
+
"reflect": false,
|
|
165
|
+
"attribute": "collapsible",
|
|
166
|
+
"defaultValue": "true"
|
|
167
|
+
},
|
|
168
|
+
"collapsed": {
|
|
169
|
+
"type": "boolean",
|
|
170
|
+
"mutable": true,
|
|
171
|
+
"complexType": {
|
|
172
|
+
"original": "boolean",
|
|
173
|
+
"resolved": "boolean",
|
|
174
|
+
"references": {}
|
|
175
|
+
},
|
|
176
|
+
"required": false,
|
|
177
|
+
"optional": false,
|
|
178
|
+
"docs": {
|
|
179
|
+
"tags": [],
|
|
180
|
+
"text": "Narrows the drawer to a 96px icon-only rail (Figma node 8028:135374). Mutable and reflected\n-- clicking the collapse toggle toggles this directly (self-toggling, see the class doc above\nfor why), and this component keeps every direct-child `bs-navigation-drawer-item`'s own\n`collapsed` prop synced to match (see `syncItemsCollapsed`)."
|
|
181
|
+
},
|
|
182
|
+
"getter": false,
|
|
183
|
+
"setter": false,
|
|
184
|
+
"reflect": true,
|
|
185
|
+
"attribute": "collapsed",
|
|
186
|
+
"defaultValue": "false"
|
|
187
|
+
},
|
|
188
|
+
"logoBackground": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"mutable": false,
|
|
191
|
+
"complexType": {
|
|
192
|
+
"original": "'auto' | 'light' | 'dark'",
|
|
193
|
+
"resolved": "\"auto\" | \"dark\" | \"light\"",
|
|
194
|
+
"references": {}
|
|
195
|
+
},
|
|
196
|
+
"required": false,
|
|
197
|
+
"optional": false,
|
|
198
|
+
"docs": {
|
|
199
|
+
"tags": [],
|
|
200
|
+
"text": "Forwarded straight to both internal `bs-logo` elements' own `background` prop. Defaults to\n`\"auto\"`, which follows the ambient `[data-theme=\"dark\"]` state automatically (see `bs-logo`'s\nown docs) -- so if this drawer ends up on a dark surface via the normal theming mechanism, the\nlogo switches to its dedicated dark-background asset with no wiring needed. Set\n`\"light\"`/`\"dark\"` explicitly only if you've overridden `--bs-navigation-drawer-bg` to\nsomething dark yourself *without* setting `[data-theme=\"dark\"]`, and need to pin the logo\nregardless of theme. Has no visible effect on the `variant=\"mark\"` logo shown while\n`collapsed` (see `bs-logo`'s own docs -- there's only one real designed mark asset, it's\nbackground-agnostic)."
|
|
201
|
+
},
|
|
202
|
+
"getter": false,
|
|
203
|
+
"setter": false,
|
|
204
|
+
"reflect": false,
|
|
205
|
+
"attribute": "logo-background",
|
|
206
|
+
"defaultValue": "'auto'"
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
static get events() {
|
|
211
|
+
return [{
|
|
212
|
+
"method": "bsCollapse",
|
|
213
|
+
"name": "bsCollapse",
|
|
214
|
+
"bubbles": true,
|
|
215
|
+
"cancelable": true,
|
|
216
|
+
"composed": true,
|
|
217
|
+
"docs": {
|
|
218
|
+
"tags": [],
|
|
219
|
+
"text": "Fires with the new `collapsed` value when the collapse toggle button is clicked."
|
|
220
|
+
},
|
|
221
|
+
"complexType": {
|
|
222
|
+
"original": "boolean",
|
|
223
|
+
"resolved": "boolean",
|
|
224
|
+
"references": {}
|
|
225
|
+
}
|
|
226
|
+
}, {
|
|
227
|
+
"method": "bsSearchClick",
|
|
228
|
+
"name": "bsSearchClick",
|
|
229
|
+
"bubbles": true,
|
|
230
|
+
"cancelable": true,
|
|
231
|
+
"composed": true,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [],
|
|
234
|
+
"text": "Fires when the compact search-trigger button (shown instead of the `search` slot while\n`collapsed`) is clicked -- e.g. to open a full search overlay. This component has no\nvisibility into what the `search` slot actually contains, so it can't drive a real search\nitself once shrunk to icon size."
|
|
235
|
+
},
|
|
236
|
+
"complexType": {
|
|
237
|
+
"original": "void",
|
|
238
|
+
"resolved": "void",
|
|
239
|
+
"references": {}
|
|
240
|
+
}
|
|
241
|
+
}];
|
|
242
|
+
}
|
|
243
|
+
static get elementRef() { return "el"; }
|
|
244
|
+
static get watchers() {
|
|
245
|
+
return [{
|
|
246
|
+
"propName": "collapsed",
|
|
247
|
+
"methodName": "onCollapsedChange"
|
|
248
|
+
}];
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
// Same inline-icon-helper-function pattern as bs-chatbot-header.tsx's NewChatIcon/ExpandIcon/etc.
|
|
252
|
+
const CaretLeftIcon = () => (h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M15 18L9 12L15 6", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
253
|
+
const SearchIcon = () => (h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("circle", { cx: "11", cy: "11", r: "7", stroke: "currentColor", "stroke-width": "2" }), h("path", { d: "M16.5 16.5L21 21", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })));
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { componentDescription, propDescription } from "../../../../stories-utils";
|
|
3
|
+
const bookIcon = html `
|
|
4
|
+
<svg slot="icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
5
|
+
<path
|
|
6
|
+
d="M4 4.5C4 3.67157 4.67157 3 5.5 3H18.5C19.3284 3 20 3.67157 20 4.5V19.5C20 20.3284 19.3284 21 18.5 21H5.5C4.67157 21 4 20.3284 4 19.5V4.5Z"
|
|
7
|
+
stroke="currentColor"
|
|
8
|
+
stroke-width="1.5"
|
|
9
|
+
/>
|
|
10
|
+
<path d="M8 3V21" stroke="currentColor" stroke-width="1.5" />
|
|
11
|
+
</svg>
|
|
12
|
+
`;
|
|
13
|
+
const gridIcon = html `
|
|
14
|
+
<svg slot="icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
15
|
+
<rect x="3.5" y="3.5" width="7" height="7" rx="1" stroke="currentColor" stroke-width="1.5" />
|
|
16
|
+
<rect x="13.5" y="3.5" width="7" height="7" rx="1" stroke="currentColor" stroke-width="1.5" />
|
|
17
|
+
<rect x="3.5" y="13.5" width="7" height="7" rx="1" stroke="currentColor" stroke-width="1.5" />
|
|
18
|
+
<rect x="13.5" y="13.5" width="7" height="7" rx="1" stroke="currentColor" stroke-width="1.5" />
|
|
19
|
+
</svg>
|
|
20
|
+
`;
|
|
21
|
+
const accessibilityIcon = html `
|
|
22
|
+
<svg slot="icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
23
|
+
<circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="1.5" />
|
|
24
|
+
<circle cx="12" cy="8" r="1.25" fill="currentColor" />
|
|
25
|
+
<path d="M6.5 10.5H17.5M12 10.5V17M9.5 17L11 13M14.5 17L13 13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
26
|
+
</svg>
|
|
27
|
+
`;
|
|
28
|
+
// The items list, shared across stories -- one plain leaf item (selected), one plain leaf item
|
|
29
|
+
// (unselected), and one expandable group header with nested children, matching the task spec's
|
|
30
|
+
// requirement of demonstrating all three states assembled together.
|
|
31
|
+
// ariaLabel is optional (the visible caption stays visible even when collapsed), set here anyway
|
|
32
|
+
// just to demonstrate the prop exists.
|
|
33
|
+
const ITEMS = html `
|
|
34
|
+
<bs-navigation-drawer-item selected ariaLabel="Introduction">${accessibilityIcon} Introduction</bs-navigation-drawer-item>
|
|
35
|
+
<bs-navigation-drawer-item ariaLabel="Accessibility">${bookIcon} Accessibility</bs-navigation-drawer-item>
|
|
36
|
+
<bs-navigation-drawer-item expandable expanded ariaLabel="Foundation">
|
|
37
|
+
${gridIcon} Foundation
|
|
38
|
+
<bs-navigation-drawer-item slot="children" nested>Colors</bs-navigation-drawer-item>
|
|
39
|
+
<bs-navigation-drawer-item slot="children" nested>Typography</bs-navigation-drawer-item>
|
|
40
|
+
<bs-navigation-drawer-item slot="children" nested>Spacing</bs-navigation-drawer-item>
|
|
41
|
+
</bs-navigation-drawer-item>
|
|
42
|
+
<bs-navigation-drawer-item expandable ariaLabel="Components">
|
|
43
|
+
${gridIcon} Components
|
|
44
|
+
<bs-navigation-drawer-item slot="children" nested>Button</bs-navigation-drawer-item>
|
|
45
|
+
<bs-navigation-drawer-item slot="children" nested>Checkbox</bs-navigation-drawer-item>
|
|
46
|
+
<bs-navigation-drawer-item slot="children" nested>Switch</bs-navigation-drawer-item>
|
|
47
|
+
</bs-navigation-drawer-item>
|
|
48
|
+
`;
|
|
49
|
+
// Same items, without any icon slot content -- bs-navigation-drawer-item's icon wrapper only
|
|
50
|
+
// reserves space when populated, so these render as plain text rows (Figma's own "nested" rows
|
|
51
|
+
// already never have icons; this additionally omits them from the top-level rows too, for the
|
|
52
|
+
// icon-less "Fixed Side Nav" stories below).
|
|
53
|
+
const ITEMS_NO_ICONS = html `
|
|
54
|
+
<bs-navigation-drawer-item selected>Introduction</bs-navigation-drawer-item>
|
|
55
|
+
<bs-navigation-drawer-item>Accessibility</bs-navigation-drawer-item>
|
|
56
|
+
<bs-navigation-drawer-item expandable expanded>
|
|
57
|
+
Foundation
|
|
58
|
+
<bs-navigation-drawer-item slot="children" nested>Colors</bs-navigation-drawer-item>
|
|
59
|
+
<bs-navigation-drawer-item slot="children" nested>Typography</bs-navigation-drawer-item>
|
|
60
|
+
<bs-navigation-drawer-item slot="children" nested>Spacing</bs-navigation-drawer-item>
|
|
61
|
+
</bs-navigation-drawer-item>
|
|
62
|
+
<bs-navigation-drawer-item expandable>
|
|
63
|
+
Components
|
|
64
|
+
<bs-navigation-drawer-item slot="children" nested>Button</bs-navigation-drawer-item>
|
|
65
|
+
<bs-navigation-drawer-item slot="children" nested>Checkbox</bs-navigation-drawer-item>
|
|
66
|
+
<bs-navigation-drawer-item slot="children" nested>Switch</bs-navigation-drawer-item>
|
|
67
|
+
</bs-navigation-drawer-item>
|
|
68
|
+
`;
|
|
69
|
+
// A plain divider between item groups (e.g. Carbon's cds-side-nav-divider: a 1px rule with 8px
|
|
70
|
+
// vertical / 16px horizontal margin) -- not a Figma-specified element in this design system, so
|
|
71
|
+
// it's kept as story-only markup rather than a new formal bs-* component.
|
|
72
|
+
const DIVIDER = html `<hr style="width: 100%; border: none; border-top: 1px solid var(--bs-border-default); margin: var(--bs-spacing-100) 0;" />`;
|
|
73
|
+
const ITEMS_WITH_DIVIDER = html `
|
|
74
|
+
<bs-navigation-drawer-item selected>Introduction</bs-navigation-drawer-item>
|
|
75
|
+
<bs-navigation-drawer-item>Accessibility</bs-navigation-drawer-item>
|
|
76
|
+
${DIVIDER}
|
|
77
|
+
<bs-navigation-drawer-item expandable expanded>
|
|
78
|
+
Foundation
|
|
79
|
+
<bs-navigation-drawer-item slot="children" nested>Colors</bs-navigation-drawer-item>
|
|
80
|
+
<bs-navigation-drawer-item slot="children" nested>Typography</bs-navigation-drawer-item>
|
|
81
|
+
<bs-navigation-drawer-item slot="children" nested>Spacing</bs-navigation-drawer-item>
|
|
82
|
+
</bs-navigation-drawer-item>
|
|
83
|
+
<bs-navigation-drawer-item expandable>
|
|
84
|
+
Components
|
|
85
|
+
<bs-navigation-drawer-item slot="children" nested>Button</bs-navigation-drawer-item>
|
|
86
|
+
<bs-navigation-drawer-item slot="children" nested>Checkbox</bs-navigation-drawer-item>
|
|
87
|
+
<bs-navigation-drawer-item slot="children" nested>Switch</bs-navigation-drawer-item>
|
|
88
|
+
</bs-navigation-drawer-item>
|
|
89
|
+
`;
|
|
90
|
+
const meta = {
|
|
91
|
+
title: 'UI Shell/bs-navigation-drawer/bs-navigation-drawer',
|
|
92
|
+
parameters: { docs: { description: { component: componentDescription('bs-navigation-drawer') } }, layout: 'fullscreen' },
|
|
93
|
+
// "Fixed Side Nav" (Carbon's own naming) means never collapsible, so args.collapsible defaults
|
|
94
|
+
// to false below for this default render every "Fixed Side Nav*" story shares. The dedicated
|
|
95
|
+
// Collapsed story further down opts back in explicitly.
|
|
96
|
+
//
|
|
97
|
+
// Plain attribute binding (collapsible=${args.collapsible}), NOT lit's ?collapsible= boolean
|
|
98
|
+
// directive -- collapsible defaults to true on the component, and ?attr= booleans OMIT the
|
|
99
|
+
// attribute for a falsy value. Stencil can't tell "never set" apart from "explicitly false" for
|
|
100
|
+
// a prop that defaults true, so it would silently keep its own default (true) -- the exact same
|
|
101
|
+
// bug found and fixed in bs-slider's showLabel earlier this session.
|
|
102
|
+
render: args => html `
|
|
103
|
+
<div style="height: 100vh; display: flex;">
|
|
104
|
+
<bs-navigation-drawer heading=${args.heading} collapsible=${args.collapsible} logo-background=${args.logoBackground}>
|
|
105
|
+
<bs-input slot="search" type="search" placeholder="Search"></bs-input>
|
|
106
|
+
${ITEMS_NO_ICONS}
|
|
107
|
+
</bs-navigation-drawer>
|
|
108
|
+
</div>
|
|
109
|
+
`,
|
|
110
|
+
argTypes: {
|
|
111
|
+
heading: { control: 'text', description: propDescription('bs-navigation-drawer', 'heading') },
|
|
112
|
+
collapsible: { control: 'boolean', description: propDescription('bs-navigation-drawer', 'collapsible') },
|
|
113
|
+
logoBackground: { control: 'select', options: ['auto', 'light', 'dark'], description: propDescription('bs-navigation-drawer', 'logoBackground') },
|
|
114
|
+
},
|
|
115
|
+
args: {
|
|
116
|
+
heading: 'Main Menu',
|
|
117
|
+
collapsible: false,
|
|
118
|
+
logoBackground: 'auto',
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
export default meta;
|
|
122
|
+
// Story naming follows the same "[Base] [with X]" convention as bs-navigation-header's stories,
|
|
123
|
+
// matching Carbon's own side-nav story names (Fixed Side Nav / with Divider / with Icons) as a
|
|
124
|
+
// naming convention reference -- not a design/token match, just the naming pattern.
|
|
125
|
+
export const FixedSideNav = {
|
|
126
|
+
name: 'Fixed Side Nav',
|
|
127
|
+
};
|
|
128
|
+
export const FixedSideNavWithDivider = {
|
|
129
|
+
name: 'Fixed Side Nav with Divider',
|
|
130
|
+
render: args => html `
|
|
131
|
+
<div style="height: 100vh; display: flex;">
|
|
132
|
+
<bs-navigation-drawer heading=${args.heading} collapsible=${args.collapsible}>
|
|
133
|
+
<bs-input slot="search" type="search" placeholder="Search"></bs-input>
|
|
134
|
+
${ITEMS_WITH_DIVIDER}
|
|
135
|
+
</bs-navigation-drawer>
|
|
136
|
+
</div>
|
|
137
|
+
`,
|
|
138
|
+
};
|
|
139
|
+
export const FixedSideNavWithIcons = {
|
|
140
|
+
name: 'Fixed Side Nav with Icons',
|
|
141
|
+
render: args => html `
|
|
142
|
+
<div style="height: 100vh; display: flex;">
|
|
143
|
+
<bs-navigation-drawer heading=${args.heading} collapsible=${args.collapsible}>
|
|
144
|
+
<bs-input slot="search" type="search" placeholder="Search"></bs-input>
|
|
145
|
+
${ITEMS}
|
|
146
|
+
</bs-navigation-drawer>
|
|
147
|
+
</div>
|
|
148
|
+
`,
|
|
149
|
+
};
|
|
150
|
+
export const Collapsed = {
|
|
151
|
+
name: 'Collapsed',
|
|
152
|
+
// Click the collapse toggle (the caret button next to the heading) to see it expand back --
|
|
153
|
+
// `collapsed` is mutable/self-toggling, so this works with no extra story wiring.
|
|
154
|
+
render: args => html `
|
|
155
|
+
<div style="height: 100vh; display: flex;">
|
|
156
|
+
<bs-navigation-drawer heading=${args.heading} collapsed>
|
|
157
|
+
<bs-input slot="search" type="search" placeholder="Search"></bs-input>
|
|
158
|
+
${ITEMS}
|
|
159
|
+
</bs-navigation-drawer>
|
|
160
|
+
</div>
|
|
161
|
+
`,
|
|
162
|
+
};
|
|
163
|
+
export const Dark = {
|
|
164
|
+
name: 'Fixed Side Nav (Dark)',
|
|
165
|
+
// `data-theme="dark"` is set on a wrapper scoped to just this story, NOT via a globals override
|
|
166
|
+
// on the toolbar's Theme switch -- that switch's decorator (see .storybook/preview.ts) sets the
|
|
167
|
+
// attribute on the shared document root, which is fine in isolation but breaks down on this
|
|
168
|
+
// component's Docs page: every story renders together in one document there, so one story
|
|
169
|
+
// forcing a document-wide theme while its siblings render alongside it under the *other* theme
|
|
170
|
+
// causes exactly the kind of thrash/hang a shared mutable global produces. A local wrapper gets
|
|
171
|
+
// the identical CSS custom property cascade (tokens.css's dark block matches any
|
|
172
|
+
// `[data-theme="dark"]` element, not specifically <html>) without touching shared state.
|
|
173
|
+
// logoBackground is left at its "auto" default here deliberately -- this story demonstrates that
|
|
174
|
+
// no manual prop is needed for the logo to follow the theme; see logoBackground's own docs for
|
|
175
|
+
// the explicit-override case.
|
|
176
|
+
render: args => html `
|
|
177
|
+
<div data-theme="dark" style="height: 100vh; display: flex; background: var(--bs-surface-base);">
|
|
178
|
+
<bs-navigation-drawer heading=${args.heading} collapsible=${args.collapsible} logo-background=${args.logoBackground}>
|
|
179
|
+
<bs-input slot="search" type="search" placeholder="Search"></bs-input>
|
|
180
|
+
${ITEMS_NO_ICONS}
|
|
181
|
+
</bs-navigation-drawer>
|
|
182
|
+
</div>
|
|
183
|
+
`,
|
|
184
|
+
};
|
|
185
|
+
export const WithoutSearch = {
|
|
186
|
+
name: 'Without a search slot',
|
|
187
|
+
render: args => html `
|
|
188
|
+
<div style="height: 100vh; display: flex;">
|
|
189
|
+
<bs-navigation-drawer heading=${args.heading}>${ITEMS}</bs-navigation-drawer>
|
|
190
|
+
</div>
|
|
191
|
+
`,
|
|
192
|
+
};
|
|
193
|
+
export const EmptyItems = {
|
|
194
|
+
name: 'Empty items list',
|
|
195
|
+
render: args => html `
|
|
196
|
+
<div style="height: 100vh; display: flex;">
|
|
197
|
+
<bs-navigation-drawer heading=${args.heading}>
|
|
198
|
+
<bs-input slot="search" type="search" placeholder="Search"></bs-input>
|
|
199
|
+
</bs-navigation-drawer>
|
|
200
|
+
</div>
|
|
201
|
+
`,
|
|
202
|
+
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
2
|
+
describe('bs-navigation-drawer-item', () => {
|
|
3
|
+
it('renders a real button with part="item"', async () => {
|
|
4
|
+
const { root } = await render(h("bs-navigation-drawer-item", null, "Introduction"));
|
|
5
|
+
const button = root.shadowRoot.querySelector('[part="item"]');
|
|
6
|
+
expect(button).not.toBeNull();
|
|
7
|
+
expect(button.tagName).toBe('BUTTON');
|
|
8
|
+
expect(button).toEqualAttribute('type', 'button');
|
|
9
|
+
});
|
|
10
|
+
describe('click behavior: expandable vs. non-expandable', () => {
|
|
11
|
+
it('emits bsSelect (not bsToggle) when expandable is false', async () => {
|
|
12
|
+
const { root, spyOnEvent } = await render(h("bs-navigation-drawer-item", null, "Introduction"));
|
|
13
|
+
const selectSpy = spyOnEvent('bsSelect');
|
|
14
|
+
const toggleSpy = spyOnEvent('bsToggle');
|
|
15
|
+
root.shadowRoot.querySelector('[part="item"]').click();
|
|
16
|
+
expect(selectSpy).toHaveReceivedEventTimes(1);
|
|
17
|
+
expect(toggleSpy).toHaveReceivedEventTimes(0);
|
|
18
|
+
});
|
|
19
|
+
it('emits bsToggle (not bsSelect) when expandable is true', async () => {
|
|
20
|
+
const { root, spyOnEvent } = await render(h("bs-navigation-drawer-item", { expandable: true }, "Components"));
|
|
21
|
+
const selectSpy = spyOnEvent('bsSelect');
|
|
22
|
+
const toggleSpy = spyOnEvent('bsToggle');
|
|
23
|
+
root.shadowRoot.querySelector('[part="item"]').click();
|
|
24
|
+
expect(toggleSpy).toHaveReceivedEventTimes(1);
|
|
25
|
+
expect(selectSpy).toHaveReceivedEventTimes(0);
|
|
26
|
+
});
|
|
27
|
+
it('emits bsToggle with the new expanded value', async () => {
|
|
28
|
+
const { root, spyOnEvent } = await render(h("bs-navigation-drawer-item", { expandable: true }, "Components"));
|
|
29
|
+
const toggleSpy = spyOnEvent('bsToggle');
|
|
30
|
+
root.shadowRoot.querySelector('[part="item"]').click();
|
|
31
|
+
expect(toggleSpy).toHaveReceivedEventDetail(true);
|
|
32
|
+
});
|
|
33
|
+
it('does not self-toggle selected when non-expandable is clicked', async () => {
|
|
34
|
+
const { root, waitForChanges } = await render(h("bs-navigation-drawer-item", null, "Introduction"));
|
|
35
|
+
root.shadowRoot.querySelector('[part="item"]').click();
|
|
36
|
+
await waitForChanges();
|
|
37
|
+
expect(root.selected).toBe(false);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
describe('expanded (self-toggling)', () => {
|
|
41
|
+
it('defaults to false', async () => {
|
|
42
|
+
const { root } = await render(h("bs-navigation-drawer-item", { expandable: true }, "Components"));
|
|
43
|
+
expect(root.hasAttribute('expanded')).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
it('self-toggles to true on click and reflects the attribute', async () => {
|
|
46
|
+
const { root, waitForChanges } = await render(h("bs-navigation-drawer-item", { expandable: true }, "Components"));
|
|
47
|
+
root.shadowRoot.querySelector('[part="item"]').click();
|
|
48
|
+
await waitForChanges();
|
|
49
|
+
expect(root.expanded).toBe(true);
|
|
50
|
+
expect(root).toHaveAttribute('expanded');
|
|
51
|
+
});
|
|
52
|
+
it('self-toggles back to false on a second click', async () => {
|
|
53
|
+
const { root, waitForChanges } = await render(h("bs-navigation-drawer-item", { expandable: true, expanded: true }, "Components"));
|
|
54
|
+
root.shadowRoot.querySelector('[part="item"]').click();
|
|
55
|
+
await waitForChanges();
|
|
56
|
+
expect(root.expanded).toBe(false);
|
|
57
|
+
expect(root).not.toHaveAttribute('expanded');
|
|
58
|
+
});
|
|
59
|
+
it('sets aria-expanded on the button when expandable', async () => {
|
|
60
|
+
const { root, waitForChanges } = await render(h("bs-navigation-drawer-item", { expandable: true }, "Components"));
|
|
61
|
+
const button = root.shadowRoot.querySelector('[part="item"]');
|
|
62
|
+
expect(button).toEqualAttribute('aria-expanded', 'false');
|
|
63
|
+
button.click();
|
|
64
|
+
await waitForChanges();
|
|
65
|
+
expect(button).toEqualAttribute('aria-expanded', 'true');
|
|
66
|
+
});
|
|
67
|
+
it('does not set aria-expanded when not expandable', async () => {
|
|
68
|
+
const { root } = await render(h("bs-navigation-drawer-item", null, "Introduction"));
|
|
69
|
+
const button = root.shadowRoot.querySelector('[part="item"]');
|
|
70
|
+
expect(button).not.toHaveAttribute('aria-expanded');
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe('selected', () => {
|
|
74
|
+
it('applies selected styling and reflects the attribute', async () => {
|
|
75
|
+
const { root } = await render(h("bs-navigation-drawer-item", { selected: true }, "Introduction"));
|
|
76
|
+
expect(root).toHaveAttribute('selected');
|
|
77
|
+
const button = root.shadowRoot.querySelector('[part="item"]');
|
|
78
|
+
expect(button).toHaveClass('bs-navigation-drawer-item--selected');
|
|
79
|
+
});
|
|
80
|
+
it('does not apply the selected class when expandable, even if selected is set', async () => {
|
|
81
|
+
const { root } = await render(h("bs-navigation-drawer-item", { selected: true, expandable: true }, "Components"));
|
|
82
|
+
const button = root.shadowRoot.querySelector('[part="item"]');
|
|
83
|
+
expect(button).not.toHaveClass('bs-navigation-drawer-item--selected');
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
describe('nested rows', () => {
|
|
87
|
+
it('applies the nested class', async () => {
|
|
88
|
+
const { root } = await render(h("bs-navigation-drawer-item", { nested: true }, "Button"));
|
|
89
|
+
const button = root.shadowRoot.querySelector('[part="item"]');
|
|
90
|
+
expect(button).toHaveClass('bs-navigation-drawer-item--nested');
|
|
91
|
+
});
|
|
92
|
+
it('does not render an icon slot wrapper at all for nested rows, even if icon content is provided', async () => {
|
|
93
|
+
const { root } = await render(h("bs-navigation-drawer-item", { nested: true }, h("span", { slot: "icon" }, "ICON"), "Button"));
|
|
94
|
+
expect(root.shadowRoot.querySelector('[part="icon"]')).toBeNull();
|
|
95
|
+
});
|
|
96
|
+
it('renders an icon slot wrapper for top-level (non-nested) rows', async () => {
|
|
97
|
+
const { root } = await render(h("bs-navigation-drawer-item", null, "Introduction"));
|
|
98
|
+
expect(root.shadowRoot.querySelector('[part="icon"]')).not.toBeNull();
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
describe('icon slot: only reserves space when populated', () => {
|
|
102
|
+
it('does not reserve icon space by default', async () => {
|
|
103
|
+
const { root } = await render(h("bs-navigation-drawer-item", null, "Introduction"));
|
|
104
|
+
const icon = root.shadowRoot.querySelector('[part="icon"]');
|
|
105
|
+
expect(icon).not.toHaveClass('bs-navigation-drawer-item__icon--has-content');
|
|
106
|
+
expect(getComputedStyle(icon).display).toBe('none');
|
|
107
|
+
});
|
|
108
|
+
it('reserves icon space when the icon slot is populated', async () => {
|
|
109
|
+
const { root } = await render(h("bs-navigation-drawer-item", null, h("span", { slot: "icon" }, "ICON"), "Introduction"));
|
|
110
|
+
const icon = root.shadowRoot.querySelector('[part="icon"]');
|
|
111
|
+
expect(icon).toHaveClass('bs-navigation-drawer-item__icon--has-content');
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
describe('children slot (expandable only)', () => {
|
|
115
|
+
it('does not render a children slot wrapper when not expandable', async () => {
|
|
116
|
+
const { root } = await render(h("bs-navigation-drawer-item", null, "Introduction"));
|
|
117
|
+
expect(root.shadowRoot.querySelector('[part="children"]')).toBeNull();
|
|
118
|
+
});
|
|
119
|
+
it('renders a children slot wrapper when expandable', async () => {
|
|
120
|
+
const { root } = await render(h("bs-navigation-drawer-item", { expandable: true }, "Components"));
|
|
121
|
+
expect(root.shadowRoot.querySelector('[part="children"]')).not.toBeNull();
|
|
122
|
+
});
|
|
123
|
+
it('hides the children slot wrapper when not expanded', async () => {
|
|
124
|
+
const { root } = await render(h("bs-navigation-drawer-item", { expandable: true }, "Components", h("bs-navigation-drawer-item", { slot: "children", nested: true }, "Button")));
|
|
125
|
+
const children = root.shadowRoot.querySelector('[part="children"]');
|
|
126
|
+
expect(getComputedStyle(children).display).toBe('none');
|
|
127
|
+
});
|
|
128
|
+
it('shows the children slot wrapper when expanded', async () => {
|
|
129
|
+
const { root } = await render(h("bs-navigation-drawer-item", { expandable: true, expanded: true }, "Components", h("bs-navigation-drawer-item", { slot: "children", nested: true }, "Button")));
|
|
130
|
+
const children = root.shadowRoot.querySelector('[part="children"]');
|
|
131
|
+
expect(getComputedStyle(children).display).not.toBe('none');
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
describe('collapsed', () => {
|
|
135
|
+
it('keeps the label visible (restyled as a caption), not hidden', async () => {
|
|
136
|
+
const { root } = await render(h("bs-navigation-drawer-item", { collapsed: true }, "Introduction"));
|
|
137
|
+
const label = root.shadowRoot.querySelector('[part="label"]');
|
|
138
|
+
expect(getComputedStyle(label).display).not.toBe('none');
|
|
139
|
+
// .textContent on the shadow-DOM label wrapper doesn't reflect slotted content (a DOM quirk:
|
|
140
|
+
// textContent walks the light tree, not the flattened/slotted one) -- check the host's own
|
|
141
|
+
// text instead, which is what's actually visible on screen via the slot.
|
|
142
|
+
expect(root.textContent.trim()).toBe('Introduction');
|
|
143
|
+
});
|
|
144
|
+
it('forces the chevron hidden even when expandable and expanded', async () => {
|
|
145
|
+
const { root } = await render(h("bs-navigation-drawer-item", { collapsed: true, expandable: true, expanded: true }, "Components"));
|
|
146
|
+
const chevron = root.shadowRoot.querySelector('[part="chevron"]');
|
|
147
|
+
expect(getComputedStyle(chevron).display).toBe('none');
|
|
148
|
+
});
|
|
149
|
+
it('forces the children slot wrapper hidden even when expanded', async () => {
|
|
150
|
+
const { root } = await render(h("bs-navigation-drawer-item", { collapsed: true, expandable: true, expanded: true }, "Components", h("bs-navigation-drawer-item", { slot: "children", nested: true }, "Button")));
|
|
151
|
+
const children = root.shadowRoot.querySelector('[part="children"]');
|
|
152
|
+
expect(getComputedStyle(children).display).toBe('none');
|
|
153
|
+
});
|
|
154
|
+
it('moves the selected tint onto the icon chip instead of the whole row', async () => {
|
|
155
|
+
const { root } = await render(h("bs-navigation-drawer-item", { collapsed: true, selected: true }, h("span", { slot: "icon" }, "ICON"), "Introduction"));
|
|
156
|
+
const button = root.shadowRoot.querySelector('[part="item"]');
|
|
157
|
+
const icon = root.shadowRoot.querySelector('[part="icon"]');
|
|
158
|
+
expect(getComputedStyle(button).backgroundColor).toBe('rgba(0, 0, 0, 0)');
|
|
159
|
+
expect(getComputedStyle(icon).backgroundColor).not.toBe('rgba(0, 0, 0, 0)');
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
describe('ariaLabel', () => {
|
|
163
|
+
it('sets aria-label on the row when provided', async () => {
|
|
164
|
+
const { root } = await render(h("bs-navigation-drawer-item", { ariaLabel: "Introduction page" }, "Introduction"));
|
|
165
|
+
expect(root.shadowRoot.querySelector('[part="item"]')).toEqualAttribute('aria-label', 'Introduction page');
|
|
166
|
+
});
|
|
167
|
+
it('omits aria-label when not provided, falling back to the visible text as the accessible name', async () => {
|
|
168
|
+
const { root } = await render(h("bs-navigation-drawer-item", null, "Introduction"));
|
|
169
|
+
expect(root.shadowRoot.querySelector('[part="item"]').hasAttribute('aria-label')).toBe(false);
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
});
|