@brandsync/wc 0.0.10 → 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 +3584 -508
- package/dist/brandsync-wc/brandsync-wc.css +20 -0
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/{p-b1e1b2d6.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-3dacae70.entry.js → p-1900f6ce.entry.js} +1 -1
- package/dist/brandsync-wc/{p-575ce905.entry.js → p-1adc59be.entry.js} +1 -1
- package/dist/brandsync-wc/p-1c6fa697.entry.js +1 -0
- package/dist/brandsync-wc/{p-dd747a12.entry.js → p-1cf715aa.entry.js} +1 -1
- package/dist/brandsync-wc/{p-8a78d6ea.entry.js → p-20dbc6a1.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a34f460d.entry.js → p-23457a21.entry.js} +1 -1
- package/dist/brandsync-wc/p-266f5dde.entry.js +1 -0
- package/dist/brandsync-wc/p-2a65aabb.entry.js +1 -0
- package/dist/brandsync-wc/{p-8d12ed96.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-18af02df.entry.js → p-57fdbb76.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7776b57b.entry.js → p-64e2a7d7.entry.js} +1 -1
- package/dist/brandsync-wc/{p-805644e4.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-d682675e.entry.js → p-88a0abee.entry.js} +1 -1
- package/dist/brandsync-wc/p-8b662ee3.entry.js +1 -0
- package/dist/brandsync-wc/{p-94ed898a.entry.js → p-8ded1eb6.entry.js} +1 -1
- package/dist/brandsync-wc/{p-nLORuTUY.js → p-DST5-cTx.js} +2 -2
- package/dist/brandsync-wc/p-a5b15061.entry.js +1 -0
- package/dist/brandsync-wc/{p-30a0e168.entry.js → p-aba300a9.entry.js} +1 -1
- package/dist/brandsync-wc/p-b24a980b.entry.js +1 -0
- package/dist/brandsync-wc/{p-96f374be.entry.js → p-b289450a.entry.js} +1 -1
- package/dist/brandsync-wc/{p-880ea3f8.entry.js → p-b8a2f882.entry.js} +1 -1
- package/dist/brandsync-wc/p-c320b6b4.entry.js +1 -0
- package/dist/brandsync-wc/{p-1515498e.entry.js → p-d4e3ca77.entry.js} +1 -1
- package/dist/brandsync-wc/{p-ce0914a7.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 +94 -0
- 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-CVh-sqA_.js → index-B3sdhEGk.js} +74 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +14 -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 +117 -0
- package/dist/collection/components/bs-checkbox/bs-checkbox.css +199 -0
- package/dist/collection/components/bs-checkbox/bs-checkbox.js +265 -0
- package/dist/collection/components/bs-checkbox/bs-checkbox.stories.js +65 -0
- 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.d.ts +11 -0
- package/dist/components/bs-checkbox.js +1 -0
- package/dist/components/bs-composer-status-banner.js +1 -1
- package/dist/components/bs-composer.js +1 -1
- package/dist/components/bs-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-BpvhHQSw.js → p-Be1Pfcnm.js} +1 -1
- package/dist/components/{p-Cz2nfz2j.js → p-BqYyMGrB.js} +1 -1
- package/dist/components/p-CaWqTQBZ.js +1 -0
- package/dist/components/{p-DndQiCMP.js → p-DivZLd6i.js} +1 -1
- package/dist/components/{p-DHbUF0g6.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 +92 -0
- 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-nLORuTUY.js → index-DST5-cTx.js} +74 -2
- 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.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-checkbox/bs-checkbox.d.ts +64 -0
- package/dist/types/components/bs-checkbox/bs-checkbox.stories.d.ts +23 -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 +1973 -49
- package/package.json +1 -1
- package/dist/brandsync-wc/p-0d64ea40.entry.js +0 -1
- package/dist/brandsync-wc/p-16a54578.entry.js +0 -1
- package/dist/brandsync-wc/p-bc72439a.entry.js +0 -1
- package/dist/brandsync-wc/p-dad4a92c.entry.js +0 -1
- package/dist/brandsync-wc/p-eb4d87f0.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,193 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { BRANDSYNC_LOGO_FULL_LIGHT_SVG } from "./brandsync-logo-full-light";
|
|
3
|
+
import { BRANDSYNC_LOGO_FULL_DARK_SVG } from "./brandsync-logo-full-dark";
|
|
4
|
+
import { BRANDSYNC_LOGO_MARK_SVG } from "./brandsync-logo-mark";
|
|
5
|
+
/**
|
|
6
|
+
* The BrandSync brand mark, as its own standalone component -- shared by `bs-navigation-header`
|
|
7
|
+
* and `bs-navigation-drawer`, which used to each render their own duplicated copy of this SVG
|
|
8
|
+
* (the drawer's collapsed state even faked an icon-only look by clipping the full wordmark asset
|
|
9
|
+
* down to a narrowed box, rather than using a real icon-only asset).
|
|
10
|
+
*
|
|
11
|
+
* ## When to use
|
|
12
|
+
* - Anywhere the BrandSync logo/icon needs to render: a navigation header, a nav drawer, etc.
|
|
13
|
+
*
|
|
14
|
+
* ## When not to use
|
|
15
|
+
* - The Genie AI chat panel's own brand mark -- that's a different logo (`bs-chatbot-header`'s
|
|
16
|
+
* own inline Genie asset), not this one.
|
|
17
|
+
*
|
|
18
|
+
* `variant` mirrors Figma's "Logo" component set (node 10909:30421) `Device` property
|
|
19
|
+
* ("Desktop" / "Tab and mobile"), which was originally meant to distinguish the full lockup from
|
|
20
|
+
* the icon-only mark at different responsive breakpoints -- renamed here to
|
|
21
|
+
* `variant: 'full' | 'mark'` since that's what it actually controls (how much of the logo
|
|
22
|
+
* renders), not literally a device/breakpoint switch.
|
|
23
|
+
*
|
|
24
|
+
* `variant="custom"` is not a Figma variant at all -- it's an escape hatch for a consuming app
|
|
25
|
+
* that needs to show a DIFFERENT product's logo in the same slot (e.g. a white-labeled deployment,
|
|
26
|
+
* or a logo fetched at runtime from a service like brand.dev), via `src`/`alt`, instead of the
|
|
27
|
+
* built-in BrandSync assets. This component deliberately does NOT fetch that image itself --
|
|
28
|
+
* network calls, loading/error states, and caching are the consuming app's responsibility, same as
|
|
29
|
+
* every other component in this library (e.g. `bs-attachment` takes `imageSrc` rather than fetching
|
|
30
|
+
* an image on its own). `background` has no effect on `variant="custom"` -- a consumer's own image
|
|
31
|
+
* is already designed for whatever surface it's placed on.
|
|
32
|
+
*
|
|
33
|
+
* @part logo - The rendered SVG/image's wrapper.
|
|
34
|
+
*/
|
|
35
|
+
// Note: this component's CSS Custom Properties are documented via @prop comments in bs-logo.css,
|
|
36
|
+
// not here -- see bs-navigation-header.css's identical note.
|
|
37
|
+
export class BsLogo {
|
|
38
|
+
/** How much of the logo to render. `full` is the icon + "EG BrandSync" wordmark (190.977x44
|
|
39
|
+
* natural size); `mark` is just the icon (44x44 natural size), no wordmark; `custom` renders a
|
|
40
|
+
* consumer-supplied image via `src`/`alt` instead of a built-in BrandSync asset -- see the class
|
|
41
|
+
* doc above. */
|
|
42
|
+
variant = 'full';
|
|
43
|
+
/**
|
|
44
|
+
* Which pre-built asset to use for `variant="full"` -- Figma ships a genuinely separate,
|
|
45
|
+
* differently-drawn dark-background asset (every wordmark path filled solid white, and the
|
|
46
|
+
* icon's outer shape a single solid-white path instead of the light version's two-path
|
|
47
|
+
* white-fill-plus-border-ring), not a CSS currentColor swap of identical paths.
|
|
48
|
+
*
|
|
49
|
+
* `"auto"` (default) renders both assets and lets CSS pick one via
|
|
50
|
+
* `--bs-logo-asset-light-display`/`--bs-logo-asset-dark-display` (defined in
|
|
51
|
+
* `src/global/base.css`, flipped by the same `[data-theme="dark"]` attribute every other
|
|
52
|
+
* `--bs-*` token already reacts to) -- so the logo just follows the ambient theme with no wiring
|
|
53
|
+
* needed, the same way a consuming app's own dark mode already re-themes every other part of
|
|
54
|
+
* this library via ordinary CSS custom property inheritance. Set `"light"`/`"dark"` explicitly
|
|
55
|
+
* to pin one regardless of the ambient theme -- e.g. a dark sidebar that isn't otherwise
|
|
56
|
+
* dark-themed.
|
|
57
|
+
*
|
|
58
|
+
* Has no effect on `variant="mark"`: Figma's component set only has one real designed instance
|
|
59
|
+
* of the icon-only mark (`Device="Tab and mobile"`, `Background="Default"`) -- there's no
|
|
60
|
+
* separate dark version of it, so the mark renders identically regardless of this prop.
|
|
61
|
+
*/
|
|
62
|
+
background = 'auto';
|
|
63
|
+
/** `variant="custom"` only: the image URL to render (e.g. a URL your app already fetched from a
|
|
64
|
+
* logo API). Ignored for `full`/`mark`. */
|
|
65
|
+
src = null;
|
|
66
|
+
/**
|
|
67
|
+
* `variant="custom"` only: accessible alt text for the image -- a product logo is meaningful
|
|
68
|
+
* content (whose brand is this?), not decorative, so set this to something real (e.g. the
|
|
69
|
+
* product/company name). Falls back to `alt=""` (marking the image decorative to assistive
|
|
70
|
+
* tech) when unset, rather than omitting the `alt` attribute entirely -- an `<img>` with no
|
|
71
|
+
* `alt` attribute at all is a harder accessibility failure than one explicitly marked
|
|
72
|
+
* decorative, but an empty fallback is still worse than a real name, so don't rely on it.
|
|
73
|
+
* Ignored for `full`/`mark` (those already carry their own fixed `aria-label="BrandSync"`).
|
|
74
|
+
*/
|
|
75
|
+
alt = null;
|
|
76
|
+
render() {
|
|
77
|
+
if (this.variant === 'custom') {
|
|
78
|
+
return h("img", { part: "logo", class: "bs-logo bs-logo--custom", src: this.src ?? undefined, alt: this.alt ?? '' });
|
|
79
|
+
}
|
|
80
|
+
if (this.variant === 'mark') {
|
|
81
|
+
return h("div", { part: "logo", class: "bs-logo bs-logo--mark", role: "img", "aria-label": "BrandSync", innerHTML: BRANDSYNC_LOGO_MARK_SVG });
|
|
82
|
+
}
|
|
83
|
+
return (h("div", { part: "logo", class: `bs-logo bs-logo--full bs-logo--bg-${this.background}`, role: "img", "aria-label": "BrandSync" }, h("div", { class: "bs-logo__asset bs-logo__asset--light", innerHTML: BRANDSYNC_LOGO_FULL_LIGHT_SVG }), h("div", { class: "bs-logo__asset bs-logo__asset--dark", innerHTML: BRANDSYNC_LOGO_FULL_DARK_SVG })));
|
|
84
|
+
}
|
|
85
|
+
static get is() { return "bs-logo"; }
|
|
86
|
+
static get encapsulation() { return "shadow"; }
|
|
87
|
+
static get originalStyleUrls() {
|
|
88
|
+
return {
|
|
89
|
+
"$": ["bs-logo.css"]
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
static get styleUrls() {
|
|
93
|
+
return {
|
|
94
|
+
"$": ["bs-logo.css"]
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
static get properties() {
|
|
98
|
+
return {
|
|
99
|
+
"variant": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "BsLogoVariant",
|
|
104
|
+
"resolved": "\"custom\" | \"full\" | \"mark\"",
|
|
105
|
+
"references": {
|
|
106
|
+
"BsLogoVariant": {
|
|
107
|
+
"location": "local",
|
|
108
|
+
"path": "/Users/vivka/brandsync-web-components/src/components/bs-logo/bs-logo.tsx",
|
|
109
|
+
"id": "src/components/bs-logo/bs-logo.tsx::BsLogoVariant"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": false,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [],
|
|
117
|
+
"text": "How much of the logo to render. `full` is the icon + \"EG BrandSync\" wordmark (190.977x44\nnatural size); `mark` is just the icon (44x44 natural size), no wordmark; `custom` renders a\nconsumer-supplied image via `src`/`alt` instead of a built-in BrandSync asset -- see the class\ndoc above."
|
|
118
|
+
},
|
|
119
|
+
"getter": false,
|
|
120
|
+
"setter": false,
|
|
121
|
+
"reflect": false,
|
|
122
|
+
"attribute": "variant",
|
|
123
|
+
"defaultValue": "'full'"
|
|
124
|
+
},
|
|
125
|
+
"background": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"mutable": false,
|
|
128
|
+
"complexType": {
|
|
129
|
+
"original": "BsLogoBackground",
|
|
130
|
+
"resolved": "\"auto\" | \"dark\" | \"light\"",
|
|
131
|
+
"references": {
|
|
132
|
+
"BsLogoBackground": {
|
|
133
|
+
"location": "local",
|
|
134
|
+
"path": "/Users/vivka/brandsync-web-components/src/components/bs-logo/bs-logo.tsx",
|
|
135
|
+
"id": "src/components/bs-logo/bs-logo.tsx::BsLogoBackground"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": "Which pre-built asset to use for `variant=\"full\"` -- Figma ships a genuinely separate,\ndifferently-drawn dark-background asset (every wordmark path filled solid white, and the\nicon's outer shape a single solid-white path instead of the light version's two-path\nwhite-fill-plus-border-ring), not a CSS currentColor swap of identical paths.\n\n`\"auto\"` (default) renders both assets and lets CSS pick one via\n`--bs-logo-asset-light-display`/`--bs-logo-asset-dark-display` (defined in\n`src/global/base.css`, flipped by the same `[data-theme=\"dark\"]` attribute every other\n`--bs-*` token already reacts to) -- so the logo just follows the ambient theme with no wiring\nneeded, the same way a consuming app's own dark mode already re-themes every other part of\nthis library via ordinary CSS custom property inheritance. Set `\"light\"`/`\"dark\"` explicitly\nto pin one regardless of the ambient theme -- e.g. a dark sidebar that isn't otherwise\ndark-themed.\n\nHas no effect on `variant=\"mark\"`: Figma's component set only has one real designed instance\nof the icon-only mark (`Device=\"Tab and mobile\"`, `Background=\"Default\"`) -- there's no\nseparate dark version of it, so the mark renders identically regardless of this prop."
|
|
144
|
+
},
|
|
145
|
+
"getter": false,
|
|
146
|
+
"setter": false,
|
|
147
|
+
"reflect": false,
|
|
148
|
+
"attribute": "background",
|
|
149
|
+
"defaultValue": "'auto'"
|
|
150
|
+
},
|
|
151
|
+
"src": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"mutable": false,
|
|
154
|
+
"complexType": {
|
|
155
|
+
"original": "string | null",
|
|
156
|
+
"resolved": "string",
|
|
157
|
+
"references": {}
|
|
158
|
+
},
|
|
159
|
+
"required": false,
|
|
160
|
+
"optional": false,
|
|
161
|
+
"docs": {
|
|
162
|
+
"tags": [],
|
|
163
|
+
"text": "`variant=\"custom\"` only: the image URL to render (e.g. a URL your app already fetched from a\nlogo API). Ignored for `full`/`mark`."
|
|
164
|
+
},
|
|
165
|
+
"getter": false,
|
|
166
|
+
"setter": false,
|
|
167
|
+
"reflect": false,
|
|
168
|
+
"attribute": "src",
|
|
169
|
+
"defaultValue": "null"
|
|
170
|
+
},
|
|
171
|
+
"alt": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"mutable": false,
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "string | null",
|
|
176
|
+
"resolved": "string",
|
|
177
|
+
"references": {}
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"optional": false,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": "`variant=\"custom\"` only: accessible alt text for the image -- a product logo is meaningful\ncontent (whose brand is this?), not decorative, so set this to something real (e.g. the\nproduct/company name). Falls back to `alt=\"\"` (marking the image decorative to assistive\ntech) when unset, rather than omitting the `alt` attribute entirely -- an `<img>` with no\n`alt` attribute at all is a harder accessibility failure than one explicitly marked\ndecorative, but an empty fallback is still worse than a real name, so don't rely on it.\nIgnored for `full`/`mark` (those already carry their own fixed `aria-label=\"BrandSync\"`)."
|
|
184
|
+
},
|
|
185
|
+
"getter": false,
|
|
186
|
+
"setter": false,
|
|
187
|
+
"reflect": false,
|
|
188
|
+
"attribute": "alt",
|
|
189
|
+
"defaultValue": "null"
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { componentDescription, propDescription } from "../../stories-utils";
|
|
3
|
+
const variants = ['full', 'mark', 'custom'];
|
|
4
|
+
const backgrounds = ['auto', 'light', 'dark'];
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/bs-logo',
|
|
7
|
+
parameters: { docs: { description: { component: componentDescription('bs-logo') } } },
|
|
8
|
+
render: args => html `<bs-logo variant=${args.variant} background=${args.background} src=${args.src} alt=${args.alt}></bs-logo>`,
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: { control: 'select', options: variants, description: propDescription('bs-logo', 'variant') },
|
|
11
|
+
background: { control: 'select', options: backgrounds, description: propDescription('bs-logo', 'background') },
|
|
12
|
+
src: { control: 'text', description: propDescription('bs-logo', 'src') },
|
|
13
|
+
alt: { control: 'text', description: propDescription('bs-logo', 'alt') },
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
variant: 'full',
|
|
17
|
+
background: 'auto',
|
|
18
|
+
src: '',
|
|
19
|
+
alt: '',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
export const Full = {
|
|
24
|
+
name: 'Full (light)',
|
|
25
|
+
};
|
|
26
|
+
// `data-theme="dark"` is set on a wrapper scoped to just this story, NOT via a globals override on
|
|
27
|
+
// the toolbar's Theme switch -- that switch's decorator (see .storybook/preview.ts) sets the
|
|
28
|
+
// attribute on the shared document root, which breaks down on this component's Docs page (every
|
|
29
|
+
// story renders together in one document there, so one story forcing a document-wide theme while
|
|
30
|
+
// its siblings render under the *other* theme thrashes). A local wrapper gets the identical CSS
|
|
31
|
+
// custom property cascade (tokens.css's dark block matches any `[data-theme="dark"]` element, not
|
|
32
|
+
// specifically <html>) without touching shared state. background is left at its "auto" default
|
|
33
|
+
// (via args below) so this demonstrates the logo following the ambient theme on its own, the same
|
|
34
|
+
// way every other --bs-* token already does (see the CSS bridge in src/global/base.css).
|
|
35
|
+
export const FullAutoDark = {
|
|
36
|
+
name: 'Full (auto, dark theme)',
|
|
37
|
+
render: args => html `
|
|
38
|
+
<div data-theme="dark" style="background: var(--bs-surface-base); padding: 24px; display: inline-flex;">
|
|
39
|
+
<bs-logo variant=${args.variant} background=${args.background}></bs-logo>
|
|
40
|
+
</div>
|
|
41
|
+
`,
|
|
42
|
+
};
|
|
43
|
+
// Pins the dark asset explicitly via background="dark", regardless of the page's own theme --
|
|
44
|
+
// for a consumer that places this on a dark surface without setting [data-theme="dark"] itself.
|
|
45
|
+
// Rendered on a manually dark canvas (not the global theme switch) to prove the override doesn't
|
|
46
|
+
// depend on that switch at all.
|
|
47
|
+
export const FullDark = {
|
|
48
|
+
name: 'Full (dark, explicit)',
|
|
49
|
+
args: { background: 'dark' },
|
|
50
|
+
render: args => html `
|
|
51
|
+
<div style="background: var(--bs-surface-inverse); padding: 24px; display: inline-flex;">
|
|
52
|
+
<bs-logo variant=${args.variant} background=${args.background}></bs-logo>
|
|
53
|
+
</div>
|
|
54
|
+
`,
|
|
55
|
+
};
|
|
56
|
+
export const Mark = {
|
|
57
|
+
name: 'Mark',
|
|
58
|
+
args: { variant: 'mark' },
|
|
59
|
+
};
|
|
60
|
+
// A consumer-supplied logo (e.g. fetched at runtime from a service like brand.dev) instead of the
|
|
61
|
+
// built-in BrandSync assets -- this component only renders the image, it never fetches it itself.
|
|
62
|
+
export const Custom = {
|
|
63
|
+
name: 'Custom (consumer-supplied image)',
|
|
64
|
+
args: {
|
|
65
|
+
variant: 'custom',
|
|
66
|
+
src: 'https://placehold.co/160x44/0062c1/white?text=Acme+Co',
|
|
67
|
+
alt: 'Acme Co',
|
|
68
|
+
},
|
|
69
|
+
};
|
|
@@ -22,7 +22,7 @@ import { h } from "@stencil/core";
|
|
|
22
22
|
*/
|
|
23
23
|
export class BsMenu {
|
|
24
24
|
render() {
|
|
25
|
-
return (h("div", { key: '
|
|
25
|
+
return (h("div", { key: 'b39f37927ff53201d71b40612720ceb8bb0eda27', part: "list", class: "bs-menu", role: "menu" }, h("slot", { key: 'b6a89f46892cf4e204edc58fe61ab69837514571' })));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "bs-menu"; }
|
|
28
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -47,7 +47,7 @@ export class BsMenuItem {
|
|
|
47
47
|
this.bsSelect.emit();
|
|
48
48
|
};
|
|
49
49
|
render() {
|
|
50
|
-
return (h("button", { key: '
|
|
50
|
+
return (h("button", { key: '1ca79f8c38bb2d8b4dc0d6edfaeafa4b7be1aee9', type: "button", part: "item", role: "menuitem", class: `bs-menu-item ${this.disabled ? 'bs-menu-item--disabled' : ''}`, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.onClick }, h("span", { key: '2efc2485a3ae52e3ee5ca4b622ca853aa6ce8abf', part: "icon", class: `bs-menu-item__icon ${this.hasIcon ? 'bs-menu-item__icon--has-content' : ''}` }, h("slot", { key: '8e426c1974fd8c9d1bd6fb97eb62ccb8e1770f05', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '2b799a8cfc0a546b53cbe2f65847b255e53b4dcc', part: "label", class: "bs-menu-item__label" }, h("slot", { key: '0babde24dcc1265ef9a9e1517701c913a70a6f78' }))));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "bs-menu-item"; }
|
|
53
53
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
2
|
+
describe('bs-radio', () => {
|
|
3
|
+
it('renders an unchecked native radio by default', async () => {
|
|
4
|
+
const { root } = await render(h("bs-radio", null));
|
|
5
|
+
const input = root.shadowRoot.querySelector('input');
|
|
6
|
+
expect(input).toEqualAttribute('type', 'radio');
|
|
7
|
+
expect(input.checked).toBe(false);
|
|
8
|
+
expect(root.shadowRoot.querySelector('[part="dot"]')).toBeNull();
|
|
9
|
+
});
|
|
10
|
+
it('reflects the checked prop to the native input and shows the center dot', async () => {
|
|
11
|
+
const { root } = await render(h("bs-radio", { checked: true }));
|
|
12
|
+
const input = root.shadowRoot.querySelector('input');
|
|
13
|
+
expect(input.checked).toBe(true);
|
|
14
|
+
expect(root.shadowRoot.querySelector('[part="circle"]')).toHaveClass('bs-radio__circle--selected');
|
|
15
|
+
expect(root.shadowRoot.querySelector('[part="dot"]')).not.toBeNull();
|
|
16
|
+
});
|
|
17
|
+
it('clicking the input checks it and emits bsChange with the value', async () => {
|
|
18
|
+
const { root, waitForChanges, spyOnEvent } = await render(h("bs-radio", { value: "one" }));
|
|
19
|
+
const bsChangeSpy = spyOnEvent('bsChange');
|
|
20
|
+
const input = root.shadowRoot.querySelector('input');
|
|
21
|
+
input.click();
|
|
22
|
+
await waitForChanges();
|
|
23
|
+
expect(input.checked).toBe(true);
|
|
24
|
+
expect(bsChangeSpy).toHaveReceivedEventTimes(1);
|
|
25
|
+
expect(bsChangeSpy).toHaveReceivedEventDetail('one');
|
|
26
|
+
});
|
|
27
|
+
it('passes name and value attributes through to the native input', async () => {
|
|
28
|
+
const { root } = await render(h("bs-radio", { name: "fruit", value: "apple" }));
|
|
29
|
+
const input = root.shadowRoot.querySelector('input');
|
|
30
|
+
expect(input).toEqualAttribute('name', 'fruit');
|
|
31
|
+
expect(input).toEqualAttribute('value', 'apple');
|
|
32
|
+
});
|
|
33
|
+
// NOTE: each <bs-radio> has its own shadow root, so its native <input> lives in its own separate
|
|
34
|
+
// DOM tree. Per the HTML spec, a "radio button group" is scoped to a single tree -- shadow DOM
|
|
35
|
+
// boundaries mean same-`name` inputs in *different* <bs-radio> instances are NOT part of the same
|
|
36
|
+
// native radio group, so clicking one does not natively uncheck another. This is a real, tested
|
|
37
|
+
// limitation of composing native <input type="radio"> inside separate shadow roots, not a bug in
|
|
38
|
+
// this component -- see bs-radio.mdx's Accessibility section for the documented gap. Within a
|
|
39
|
+
// single instance's own shadow root the native input still behaves like a normal radio input.
|
|
40
|
+
it('same-name bs-radio instances do NOT natively uncheck each other, since each lives in its own shadow root', async () => {
|
|
41
|
+
const { root, waitForChanges } = await render(h("div", null, h("bs-radio", { name: "fruit", value: "apple" }), h("bs-radio", { name: "fruit", value: "banana" })));
|
|
42
|
+
const [first, second] = Array.from(root.querySelectorAll('bs-radio'));
|
|
43
|
+
const firstInput = first.shadowRoot.querySelector('input');
|
|
44
|
+
const secondInput = second.shadowRoot.querySelector('input');
|
|
45
|
+
firstInput.click();
|
|
46
|
+
await waitForChanges();
|
|
47
|
+
expect(firstInput.checked).toBe(true);
|
|
48
|
+
secondInput.click();
|
|
49
|
+
await waitForChanges();
|
|
50
|
+
expect(secondInput.checked).toBe(true);
|
|
51
|
+
// Real (shadow-DOM-scoped) native behavior: the first input is untouched, not unchecked.
|
|
52
|
+
expect(firstInput.checked).toBe(true);
|
|
53
|
+
});
|
|
54
|
+
describe('disabled', () => {
|
|
55
|
+
it('sets the disabled attribute on the native input', async () => {
|
|
56
|
+
const { root } = await render(h("bs-radio", { disabled: true }));
|
|
57
|
+
const input = root.shadowRoot.querySelector('input');
|
|
58
|
+
expect(input).toHaveAttribute('disabled');
|
|
59
|
+
});
|
|
60
|
+
it('prevents toggling via click', async () => {
|
|
61
|
+
const { root, waitForChanges, spyOnEvent } = await render(h("bs-radio", { disabled: true }));
|
|
62
|
+
const bsChangeSpy = spyOnEvent('bsChange');
|
|
63
|
+
const input = root.shadowRoot.querySelector('input');
|
|
64
|
+
input.click();
|
|
65
|
+
await waitForChanges();
|
|
66
|
+
expect(input.checked).toBe(false);
|
|
67
|
+
expect(bsChangeSpy).toHaveReceivedEventTimes(0);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
it('renders label slot content', async () => {
|
|
71
|
+
const { root } = await render(h("bs-radio", null, "Option A"));
|
|
72
|
+
expect(root).toHaveTextContent('Option A');
|
|
73
|
+
const label = root.shadowRoot.querySelector('[part="label"]');
|
|
74
|
+
expect(label.querySelector('slot')).not.toBeNull();
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @prop --bs-radio-size: Diameter of the visual radio ring. Aliased to --bs-spacing-300.
|
|
3
|
+
* @prop --bs-radio-border-width: Width of the ring border.
|
|
4
|
+
* @prop --bs-radio-state-layer-size: Diameter of the hover/focus/pressed halo behind the ring.
|
|
5
|
+
* @prop --bs-radio-hit-area-size: Diameter of the layout box the state layer is centered in.
|
|
6
|
+
* @prop --bs-radio-gap: Gap between the ring and the label text. Aliased to --bs-spacing-100.
|
|
7
|
+
*/
|
|
8
|
+
:host {
|
|
9
|
+
display: inline-block;
|
|
10
|
+
|
|
11
|
+
--bs-radio-size: var(--bs-spacing-300);
|
|
12
|
+
--bs-radio-border-width: 2px;
|
|
13
|
+
--bs-radio-state-layer-size: 40px;
|
|
14
|
+
--bs-radio-hit-area-size: 48px;
|
|
15
|
+
--bs-radio-gap: var(--bs-spacing-100);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bs-radio {
|
|
19
|
+
position: relative;
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--bs-radio-gap);
|
|
23
|
+
font-family: inherit;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.bs-radio--disabled {
|
|
28
|
+
cursor: not-allowed;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* The native input is visually hidden but stays in the layout/focus/keyboard chain -- opacity: 0
|
|
32
|
+
(not display: none) so it can still receive and show focus. Covers the whole label (same
|
|
33
|
+
pattern as bs-checkbox) so clicking anywhere -- ring or label text -- toggles it. */
|
|
34
|
+
.bs-radio__input {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 100%;
|
|
40
|
+
margin: 0;
|
|
41
|
+
padding: 0;
|
|
42
|
+
opacity: 0;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.bs-radio__input:disabled {
|
|
47
|
+
cursor: not-allowed;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Outer clickable-area layout box -- just sizes/centers the state layer, carries no styling of
|
|
51
|
+
its own (the real hit target is the absolutely-positioned input above, covering the whole
|
|
52
|
+
label). */
|
|
53
|
+
.bs-radio__hit-area {
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
position: relative;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
width: var(--bs-radio-hit-area-size);
|
|
61
|
+
height: var(--bs-radio-hit-area-size);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* State layer -- the soft hover/focus/pressed background wash, distinct from the ring's own
|
|
65
|
+
border color. */
|
|
66
|
+
.bs-radio__state-layer {
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
width: var(--bs-radio-state-layer-size);
|
|
72
|
+
height: var(--bs-radio-state-layer-size);
|
|
73
|
+
border-radius: 50%;
|
|
74
|
+
background: var(--bs-radio-bg-default);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.bs-radio__circle {
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
width: var(--bs-radio-size);
|
|
84
|
+
height: var(--bs-radio-size);
|
|
85
|
+
border: var(--bs-radio-border-width) solid var(--bs-radio-enabled-border-default);
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
background: transparent;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.bs-radio__circle--selected {
|
|
91
|
+
border-color: var(--bs-radio-selected-border-default);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.bs-radio__dot {
|
|
95
|
+
width: 50%;
|
|
96
|
+
height: 50%;
|
|
97
|
+
border-radius: 50%;
|
|
98
|
+
background: var(--bs-radio-icon-checked);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Hover/focus/pressed -- keyed off the hidden native input's pseudo-classes, since it sits on top
|
|
102
|
+
of and covers the whole label, so it always reflects the user's actual pointer/keyboard target. */
|
|
103
|
+
.bs-radio__input:hover:not(:disabled) ~ .bs-radio__hit-area .bs-radio__state-layer {
|
|
104
|
+
background: var(--bs-radio-bg-hover);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.bs-radio__input:hover:not(:disabled) ~ .bs-radio__hit-area .bs-radio__circle {
|
|
108
|
+
border-color: var(--bs-radio-enabled-border-hover);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.bs-radio__input:hover:not(:disabled) ~ .bs-radio__hit-area .bs-radio__circle--selected {
|
|
112
|
+
border-color: var(--bs-radio-selected-border-hover);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.bs-radio__input:hover:not(:disabled) ~ .bs-radio__hit-area .bs-radio__circle--selected .bs-radio__dot {
|
|
116
|
+
background: var(--bs-radio-icon-hover);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.bs-radio__input:focus-visible ~ .bs-radio__hit-area .bs-radio__state-layer {
|
|
120
|
+
background: var(--bs-radio-bg-focus);
|
|
121
|
+
outline: 2px solid var(--bs-radio-focus-ring);
|
|
122
|
+
outline-offset: 2px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.bs-radio__input:focus-visible ~ .bs-radio__hit-area .bs-radio__circle {
|
|
126
|
+
border-color: var(--bs-radio-enabled-border-focus);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.bs-radio__input:focus-visible ~ .bs-radio__hit-area .bs-radio__circle--selected {
|
|
130
|
+
border-color: var(--bs-radio-selected-border-focus);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.bs-radio__input:active:not(:disabled) ~ .bs-radio__hit-area .bs-radio__state-layer {
|
|
134
|
+
background: var(--bs-radio-bg-pressed);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.bs-radio__input:active:not(:disabled) ~ .bs-radio__hit-area .bs-radio__circle {
|
|
138
|
+
border-color: var(--bs-radio-enabled-border-pressed);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.bs-radio__input:active:not(:disabled) ~ .bs-radio__hit-area .bs-radio__circle--selected {
|
|
142
|
+
border-color: var(--bs-radio-selected-border-pressed);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.bs-radio__input:disabled ~ .bs-radio__hit-area .bs-radio__state-layer {
|
|
146
|
+
background: var(--bs-radio-bg-disabled);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.bs-radio__input:disabled ~ .bs-radio__hit-area .bs-radio__circle {
|
|
150
|
+
border-color: var(--bs-radio-border-disabled);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.bs-radio__input:disabled ~ .bs-radio__hit-area .bs-radio__circle--selected .bs-radio__dot {
|
|
154
|
+
background: var(--bs-radio-icon-disabled);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.bs-radio__label {
|
|
158
|
+
font-size: var(--bs-font-size-md);
|
|
159
|
+
color: var(--bs-radio-label-default);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.bs-radio--disabled .bs-radio__label {
|
|
163
|
+
color: var(--bs-radio-label-disabled);
|
|
164
|
+
}
|