@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
|
@@ -74,7 +74,7 @@ export class BsChatbotHeader {
|
|
|
74
74
|
this.bsClose.emit();
|
|
75
75
|
};
|
|
76
76
|
render() {
|
|
77
|
-
return (h("div", { key: '
|
|
77
|
+
return (h("div", { key: 'f867f6c63e8931079fbbee1ce4dc7b74f6bf7ddd', class: "bs-chatbot-header", role: "banner", "aria-label": this.heading }, h("div", { key: 'a91afd437bbe43e9be65d64df36688d8d885916d', part: "logo", class: "bs-chatbot-header__logo", role: "img", "aria-label": this.heading, innerHTML: GENIE_LOGO_SVG }), h("div", { key: '3dddaab00c3b983b1e86be356eec9c07c415de1b', class: "bs-chatbot-header__actions" }, h("span", { key: '0f0b3388022c75ef0e04c1bb41a826fb0318764d', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: '7b1eb2edc2414fece90681b1d56de3a9b0c7171c', type: "button", part: "new-chat", class: "bs-chatbot-header__button", "aria-label": "New chat", onClick: this.onNewChatClick }, h("slot", { key: 'a4ff761ddc7b3dbcfe449a89f731561cb3b85d0a', name: "new-chat-icon" }, h(NewChatIcon, { key: 'b2244e10010085b85a258413f7391180f6b3a20f' }))), h("bs-tooltip", { key: 'b24f3b73d6cfca88f14e12e7bc0ad0634d3338c1', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, "New chat")), h("span", { key: '94a5bf67800ea1a608a04a0bb33d1a7aed053045', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: '49bb1dc0956c021becaaf562146352b9abcc415b', type: "button", part: "history", class: "bs-chatbot-header__button", "aria-label": "History", onClick: this.onHistoryClick }, h("slot", { key: 'f2c6dc057674cfc803d822d936b3fcf9d6f2f576', name: "history-icon" }, h(HistoryIcon, { key: '0ededb5c7c553f1a6723f3d20b734cb5200b2a4d' }))), h("bs-tooltip", { key: 'd533c9ac7661d89d8c8fe4865639c6d4fdab5ca3', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, "History")), h("span", { key: 'e183c44cd967d683fa8de2c53c53913b0a1a19e4', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: 'f3af2b7730e1410f97fc46612148c1728be67517', type: "button", part: "expand", class: "bs-chatbot-header__button", "aria-label": this.expanded ? 'Collapse' : 'Expand', "aria-pressed": this.expanded ? 'true' : 'false', onClick: this.onExpandClick }, h("slot", { key: '808dcea2f16a09615efa1e17c7cdaadb35cac494', name: "expand-icon" }, h(ExpandIcon, { key: '58487c506c21b5e4214be89ef37126ee9404550b' }))), h("bs-tooltip", { key: 'e89cd45c9c34e840bb316ac2acc281d8bbc09eb4', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, this.expanded ? 'Collapse' : 'Expand')), h("span", { key: '1ccdb12018a5e0bffb6e50fb4974799f177cf943', class: "bs-chatbot-header__tooltip-wrapper" }, h("button", { key: 'e416fe4e56f37b9c623e86764cf5e3a510e89657', type: "button", part: "close", class: "bs-chatbot-header__button", "aria-label": "Close", onClick: this.onCloseClick }, h("slot", { key: 'db32a3957b3d635e34665ea4b3022d888bd4c5c8', name: "close-icon" }, h(CloseIcon, { key: '1062922ee3b32445503c2bc81913806f1684683b' }))), h("bs-tooltip", { key: '90d5458d0eb14e99767ea5b1d0e8c9b23b51aaeb', class: "bs-chatbot-header__tooltip", placement: "top", "aria-hidden": "true" }, "Close")))));
|
|
78
78
|
}
|
|
79
79
|
static get is() { return "bs-chatbot-header"; }
|
|
80
80
|
static get encapsulation() { return "shadow"; }
|
|
@@ -105,7 +105,7 @@ export class BsChatbotResponseAction {
|
|
|
105
105
|
};
|
|
106
106
|
render() {
|
|
107
107
|
const hasSources = !!this.sourcesCount && this.sourcesCount > 0;
|
|
108
|
-
return (h("div", { key: '
|
|
108
|
+
return (h("div", { key: '7bec7f4a10f842d706ae24aca5d4e265420d9ddf', class: "bs-chatbot-response-action" }, h("button", { key: '750e004f98f72f3737468bda9985484d344ebaa3', type: "button", part: "like", class: "bs-chatbot-response-action__button", "aria-label": "Like", onClick: this.onLikeClick }, h("slot", { key: '2706c270afcf0c71b94e28bef5ab803a29168508', name: "like-icon" }, h(ThumbsUpIcon, { key: '8fe6d8d403e8d2a80b37edd10e7b4f56197ad544' }))), h("button", { key: 'e807b85ddd08e2a37239fe3927f1a385371b6e60', type: "button", part: "dislike", class: "bs-chatbot-response-action__button", "aria-label": "Dislike", onClick: this.onDislikeClick }, h("slot", { key: 'd6dbcbd2ee1b7e74e05dd2cbae1c69d98e414904', name: "dislike-icon" }, h(ThumbsDownIcon, { key: 'f10796ec4a207e9f8eb55441b762e8873a2c615f' }))), h("button", { key: 'd6452d6a3cbb9aec60e65085086c312dc8723ce9', type: "button", part: "copy", class: "bs-chatbot-response-action__button", "aria-label": "Copy", onClick: this.onCopyClick }, h("slot", { key: '9f650bebcaef7cdf4797bc94c28f934887954722', name: "copy-icon" }, h(CopyIcon, { key: 'bc8fcfd2c9b2d3b0b634f3c92750ffea8b301270' }))), h("button", { key: 'f7b7fc1048a3e641c460e0708e3f751178c337da', type: "button", part: "regenerate", class: "bs-chatbot-response-action__button", "aria-label": "Regenerate", onClick: this.onRegenerateClick }, h("slot", { key: '79cc6721191aff640823fdea839668edddfb5746', name: "regenerate-icon" }, h(RegenerateIcon, { key: '4f8dcfcae578dc5d66e7707f961717a5dd513e20' }))), h("div", { key: '15282bbecdec01239855b7e6637fab4f12801122', class: "bs-chatbot-response-action__menu-wrapper" }, h("button", { key: 'f5d2b3db52c76e129e1d56a4bef819cf1e8bc5ed', type: "button", part: "menu", class: "bs-chatbot-response-action__button", "aria-label": "More options", "aria-haspopup": "menu", "aria-expanded": this.menuOpen ? 'true' : 'false', onClick: this.onMenuClick }, h("slot", { key: '8796afebcc39b15c858bbea22ae377631da8ce2e', name: "menu-icon" }, h(MenuIcon, { key: '21a189fb8e61033e7644bf6e6c3eecb2ffa8e880' }))), this.menuOpen && (h("div", { key: 'd6617d1ff68199cdbdeabda382018fb48c0a1bd9', class: "bs-chatbot-response-action__menu-popup" }, h("slot", { key: 'b4645cb0ccf01b265efa56726ffb1fd5a8ec13db', name: "menu" })))), hasSources && (h("button", { key: '736c23e7560404a0e7177b372993317a84a19bf5', type: "button", part: "sources", class: "bs-chatbot-response-action__sources", onClick: this.onSourcesClick }, h("slot", { key: 'bb5187741f2cb4e470038753df41dcee2ceaf02e', name: "sources-icon" }, h(SourcesIcon, { key: '4d488a150dc6b86d1d6045b55f16bce22c5cdd22' })), h("span", { key: '02da04e9df74b4926cf8f0d6a4c7548c1bb1e699', class: "bs-chatbot-response-action__sources-label" }, this.sourcesCount, " ", this.sourcesCount === 1 ? 'source' : 'sources')))));
|
|
109
109
|
}
|
|
110
110
|
static get is() { return "bs-chatbot-response-action"; }
|
|
111
111
|
static get encapsulation() { return "shadow"; }
|
|
@@ -57,7 +57,7 @@ export class BsChatbotSourcesDrawer {
|
|
|
57
57
|
};
|
|
58
58
|
render() {
|
|
59
59
|
const displayCount = this.count ?? this.slottedCount;
|
|
60
|
-
return (h("div", { key: '
|
|
60
|
+
return (h("div", { key: '8f71e38ceb897b13d7726495c8b27619e246af2b', class: "bs-chatbot-sources-drawer", role: "region", "aria-label": this.heading }, h("div", { key: 'ee57cd05934a900b71b5445f7d31caf8e038e774', class: "bs-chatbot-sources-drawer__header" }, h("div", { key: 'd9aa9f82aad30480bf52b7a701f094b9175e3a98', class: "bs-chatbot-sources-drawer__title-group" }, h("h2", { key: '913ac293e7af80ee142635ae7bd4b3339ac746b0', part: "heading", class: "bs-chatbot-sources-drawer__heading" }, this.heading), displayCount > 0 && (h("span", { key: 'ad659ddf56b745f915df9909c07a6a617e8e7d5a', part: "count", class: "bs-chatbot-sources-drawer__count" }, displayCount))), h("button", { key: '30ac395d5087496a955b956437dc9459eabcbe10', type: "button", part: "collapse", class: "bs-chatbot-sources-drawer__collapse", "aria-label": "Collapse sources", onClick: this.onCollapseClick }, h("slot", { key: 'aaa9629de257bb416c24e9b5b15ac634e71caf38', name: "collapse-icon" }, h(CaretRightIcon, { key: '9bbb6d7875cd5ce27ec63c03113a7982a6309814' })))), h("div", { key: 'aa0d81e61701b50231a802120443f0819b2b0a98', part: "list", class: "bs-chatbot-sources-drawer__list" }, h("slot", { key: 'cbfd567766318fc4d360804c4de5e591654a29c0', onSlotchange: this.onSlotchange }))));
|
|
61
61
|
}
|
|
62
62
|
static get is() { return "bs-chatbot-sources-drawer"; }
|
|
63
63
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js
CHANGED
|
@@ -45,7 +45,7 @@ export class BsChatbotSuggestionButton {
|
|
|
45
45
|
this.bsSelect.emit();
|
|
46
46
|
};
|
|
47
47
|
render() {
|
|
48
|
-
return (h("button", { key: '
|
|
48
|
+
return (h("button", { key: '4a8fe89091ddc9d343c58d22b35b9f8dc2691490', type: "button", part: "button", class: "bs-chatbot-suggestion-button", disabled: this.disabled, onClick: this.onClick }, h("slot", { key: 'f0295569d8aac7ad51116d3fde445dda7bcb24a6' })));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "bs-chatbot-suggestion-button"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,6 +7,16 @@ describe('bs-checkbox', () => {
|
|
|
7
7
|
expect(input.checked).toBe(false);
|
|
8
8
|
expect(root.shadowRoot.querySelector('[part="box"] [part="icon"]')).toBeNull();
|
|
9
9
|
});
|
|
10
|
+
it('reflects ariaLabel to the native input, for label-less accessible names', async () => {
|
|
11
|
+
const { root } = await render(h("bs-checkbox", { ariaLabel: "Select all rows" }));
|
|
12
|
+
const input = root.shadowRoot.querySelector('input');
|
|
13
|
+
expect(input).toEqualAttribute('aria-label', 'Select all rows');
|
|
14
|
+
});
|
|
15
|
+
it('does not set aria-label on the native input when ariaLabel is not provided', async () => {
|
|
16
|
+
const { root } = await render(h("bs-checkbox", null));
|
|
17
|
+
const input = root.shadowRoot.querySelector('input');
|
|
18
|
+
expect(input).not.toHaveAttribute('aria-label');
|
|
19
|
+
});
|
|
10
20
|
it('reflects the checked prop to the native input and shows the check icon', async () => {
|
|
11
21
|
const { root } = await render(h("bs-checkbox", { checked: true }));
|
|
12
22
|
const input = root.shadowRoot.querySelector('input');
|
|
@@ -180,10 +180,16 @@
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.bs-checkbox__label {
|
|
183
|
-
font-size: var(--bs-font-size-
|
|
183
|
+
font-size: var(--bs-font-size-md);
|
|
184
184
|
color: var(--bs-checkbox-label-color);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
/* Figma specs the label at fontsize/body/sm (14px) only for size="sm" -- size="md"/"lg" both use
|
|
188
|
+
fontsize/body/md (16px), which is the default set above. */
|
|
189
|
+
.bs-checkbox__box--sm ~ .bs-checkbox__label {
|
|
190
|
+
font-size: var(--bs-font-size-sm);
|
|
191
|
+
}
|
|
192
|
+
|
|
187
193
|
.bs-checkbox--disabled .bs-checkbox__label {
|
|
188
194
|
color: var(--bs-checkbox-label-color-disabled);
|
|
189
195
|
}
|
|
@@ -43,6 +43,17 @@ export class BsCheckbox {
|
|
|
43
43
|
/** Applies the error border/label-color treatment. This component's spec has no error message
|
|
44
44
|
* text of its own (unlike `bs-input`'s `error: string`), so it's a plain boolean. */
|
|
45
45
|
error = false;
|
|
46
|
+
/**
|
|
47
|
+
* Accessible name for the checkbox. Required whenever the default (label) slot is empty (e.g. a
|
|
48
|
+
* bare "select row" checkbox in a table) -- without it, the internal native `<input>` has no
|
|
49
|
+
* accessible name at all. Setting `aria-label` directly on the `<bs-checkbox>` host does NOT
|
|
50
|
+
* work for this: that attribute stays on the light-DOM host and is never forwarded into the
|
|
51
|
+
* shadow DOM by the browser, so the actual focusable element (the native `<input>` inside) stays
|
|
52
|
+
* nameless. This prop exists specifically to bridge that gap -- same pattern as `bs-button`'s and
|
|
53
|
+
* `bs-tab`'s identical `ariaLabel` prop, both of which explicitly bind it onto their own internal
|
|
54
|
+
* focusable element for the same reason.
|
|
55
|
+
*/
|
|
56
|
+
ariaLabel = null;
|
|
46
57
|
/** Emitted when the checked state changes via user interaction, with the new `checked` value. */
|
|
47
58
|
bsChange;
|
|
48
59
|
/** Keeps the native input's `.indeterminate` JS property in sync -- this can't be expressed as a
|
|
@@ -81,7 +92,7 @@ export class BsCheckbox {
|
|
|
81
92
|
]
|
|
82
93
|
.filter(Boolean)
|
|
83
94
|
.join(' ');
|
|
84
|
-
return (h("label", { key: '
|
|
95
|
+
return (h("label", { key: '04fb1da55eb6a0e91fd705db9217f5e2c0992f89', class: `bs-checkbox ${this.disabled ? 'bs-checkbox--disabled' : ''}` }, h("input", { key: '06b83f45f7dfe52cd81eab603742d04d74135c7a', ref: el => (this.inputEl = el), class: "bs-checkbox__input", type: "checkbox", checked: this.checked, disabled: this.disabled, "aria-checked": this.indeterminate ? 'mixed' : String(this.checked), "aria-label": this.ariaLabel, onChange: this.onChange }), h("span", { key: 'a8a8b45074eef7cfcb5f579eff0fb7b27b71d25a', part: "box", class: boxClasses }, showIcon && (h("svg", { key: '78cf717b4cd7fbf8c56a76788a22c8aecf7fcc28', part: "icon", class: "bs-checkbox__icon", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, this.indeterminate ? (h("path", { d: "M3 8H13", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })) : (h("path", { d: "M3 8.5L6.2 11.5L13 4.5", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))))), h("span", { key: '2d78205d8091c89ac3a6d07cbb74b6d6a9c09971', part: "label", class: "bs-checkbox__label" }, h("slot", { key: '7da0c6d1f84b788b242b95b11d78e566f482b48c' }))));
|
|
85
96
|
}
|
|
86
97
|
static get is() { return "bs-checkbox"; }
|
|
87
98
|
static get encapsulation() { return "shadow"; }
|
|
@@ -203,6 +214,26 @@ export class BsCheckbox {
|
|
|
203
214
|
"reflect": false,
|
|
204
215
|
"attribute": "error",
|
|
205
216
|
"defaultValue": "false"
|
|
217
|
+
},
|
|
218
|
+
"ariaLabel": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"mutable": false,
|
|
221
|
+
"complexType": {
|
|
222
|
+
"original": "string | null",
|
|
223
|
+
"resolved": "string",
|
|
224
|
+
"references": {}
|
|
225
|
+
},
|
|
226
|
+
"required": false,
|
|
227
|
+
"optional": false,
|
|
228
|
+
"docs": {
|
|
229
|
+
"tags": [],
|
|
230
|
+
"text": "Accessible name for the checkbox. Required whenever the default (label) slot is empty (e.g. a\nbare \"select row\" checkbox in a table) -- without it, the internal native `<input>` has no\naccessible name at all. Setting `aria-label` directly on the `<bs-checkbox>` host does NOT\nwork for this: that attribute stays on the light-DOM host and is never forwarded into the\nshadow DOM by the browser, so the actual focusable element (the native `<input>` inside) stays\nnameless. This prop exists specifically to bridge that gap -- same pattern as `bs-button`'s and\n`bs-tab`'s identical `ariaLabel` prop, both of which explicitly bind it onto their own internal\nfocusable element for the same reason."
|
|
231
|
+
},
|
|
232
|
+
"getter": false,
|
|
233
|
+
"setter": false,
|
|
234
|
+
"reflect": false,
|
|
235
|
+
"attribute": "aria-label",
|
|
236
|
+
"defaultValue": "null"
|
|
206
237
|
}
|
|
207
238
|
};
|
|
208
239
|
}
|
|
@@ -2,7 +2,7 @@ import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
|
2
2
|
describe('bs-composer', () => {
|
|
3
3
|
it('renders with idle state defaults: ai variant placeholder, enabled mic/action buttons', async () => {
|
|
4
4
|
const { root } = await render(h("bs-composer", null));
|
|
5
|
-
const input = root.shadowRoot.querySelector('
|
|
5
|
+
const input = root.shadowRoot.querySelector('textarea');
|
|
6
6
|
expect(input).toEqualAttribute('placeholder', 'Ask Genie something...');
|
|
7
7
|
expect(input).not.toHaveAttribute('disabled');
|
|
8
8
|
const mic = root.shadowRoot.querySelector('[part="mic"]');
|
|
@@ -13,22 +13,22 @@ describe('bs-composer', () => {
|
|
|
13
13
|
});
|
|
14
14
|
it('uses the human variant default placeholder', async () => {
|
|
15
15
|
const { root } = await render(h("bs-composer", { variant: "human" }));
|
|
16
|
-
const input = root.shadowRoot.querySelector('
|
|
16
|
+
const input = root.shadowRoot.querySelector('textarea');
|
|
17
17
|
expect(input).toEqualAttribute('placeholder', 'Message your support agent...');
|
|
18
18
|
});
|
|
19
19
|
it('overrides the variant default placeholder when placeholder is set', async () => {
|
|
20
20
|
const { root } = await render(h("bs-composer", { variant: "ai", placeholder: "Custom prompt" }));
|
|
21
|
-
const input = root.shadowRoot.querySelector('
|
|
21
|
+
const input = root.shadowRoot.querySelector('textarea');
|
|
22
22
|
expect(input).toEqualAttribute('placeholder', 'Custom prompt');
|
|
23
23
|
});
|
|
24
24
|
it('reflects the value prop to the native input', async () => {
|
|
25
25
|
const { root } = await render(h("bs-composer", { value: "hello there" }));
|
|
26
|
-
const input = root.shadowRoot.querySelector('
|
|
26
|
+
const input = root.shadowRoot.querySelector('textarea');
|
|
27
27
|
expect(input.value).toBe('hello there');
|
|
28
28
|
});
|
|
29
29
|
it('sets aria-label on the input from the ariaLabel prop', async () => {
|
|
30
30
|
const { root } = await render(h("bs-composer", { ariaLabel: "Message" }));
|
|
31
|
-
const input = root.shadowRoot.querySelector('
|
|
31
|
+
const input = root.shadowRoot.querySelector('textarea');
|
|
32
32
|
expect(input).toEqualAttribute('aria-label', 'Message');
|
|
33
33
|
});
|
|
34
34
|
it('renders consumer-supplied content in the actions-end slot, after the primary action button', async () => {
|
|
@@ -59,12 +59,53 @@ describe('bs-composer', () => {
|
|
|
59
59
|
it('emits bsInput with the current value as the user types', async () => {
|
|
60
60
|
const { root, spyOnEvent } = await render(h("bs-composer", null));
|
|
61
61
|
const spy = spyOnEvent('bsInput');
|
|
62
|
-
const input = root.shadowRoot.querySelector('
|
|
62
|
+
const input = root.shadowRoot.querySelector('textarea');
|
|
63
63
|
input.value = 'a';
|
|
64
64
|
input.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
|
|
65
65
|
expect(spy).toHaveReceivedEventTimes(1);
|
|
66
66
|
expect(spy).toHaveReceivedEventDetail('a');
|
|
67
67
|
});
|
|
68
|
+
describe('auto-grow', () => {
|
|
69
|
+
it('grows taller as multi-line content is typed', async () => {
|
|
70
|
+
const { root } = await render(h("bs-composer", null));
|
|
71
|
+
const textarea = root.shadowRoot.querySelector('textarea');
|
|
72
|
+
const oneLineHeight = textarea.getBoundingClientRect().height;
|
|
73
|
+
textarea.value = 'line one\nline two\nline three';
|
|
74
|
+
textarea.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
|
|
75
|
+
const threeLineHeight = textarea.getBoundingClientRect().height;
|
|
76
|
+
expect(threeLineHeight).toBeGreaterThan(oneLineHeight);
|
|
77
|
+
});
|
|
78
|
+
it('caps growth at --bs-composer-input-max-lines and scrolls internally beyond that', async () => {
|
|
79
|
+
const { root } = await render(h("bs-composer", null));
|
|
80
|
+
const textarea = root.shadowRoot.querySelector('textarea');
|
|
81
|
+
const lineHeight = textarea.getBoundingClientRect().height;
|
|
82
|
+
const fifteenLines = Array.from({ length: 15 }, (_, i) => `line ${i}`).join('\n');
|
|
83
|
+
textarea.value = fifteenLines;
|
|
84
|
+
textarea.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
|
|
85
|
+
const cappedHeight = textarea.getBoundingClientRect().height;
|
|
86
|
+
// 10 lines' worth of height, not 15 -- the default max-lines is 10 (see bs-composer.css).
|
|
87
|
+
expect(cappedHeight).toBeCloseTo(lineHeight * 10, 0);
|
|
88
|
+
expect(textarea.scrollHeight).toBeGreaterThan(textarea.clientHeight);
|
|
89
|
+
});
|
|
90
|
+
it('resizes to fit an initial multi-line value prop, not just user typing', async () => {
|
|
91
|
+
// Measure each render's height before the other render() call runs -- a second render() in
|
|
92
|
+
// the same test can detach the first instance from the layout tree, which would make its
|
|
93
|
+
// getBoundingClientRect() report 0 rather than its real (but by-then-detached) height.
|
|
94
|
+
const single = await render(h("bs-composer", { value: "one line" }));
|
|
95
|
+
const singleLineHeight = single.root.shadowRoot.querySelector('textarea').getBoundingClientRect().height;
|
|
96
|
+
const multi = await render(h("bs-composer", { value: 'line one\nline two\nline three' }));
|
|
97
|
+
const multiLineHeight = multi.root.shadowRoot.querySelector('textarea').getBoundingClientRect().height;
|
|
98
|
+
expect(multiLineHeight).toBeGreaterThan(singleLineHeight);
|
|
99
|
+
});
|
|
100
|
+
it('re-runs the resize when the value prop is updated programmatically (not via typing)', async () => {
|
|
101
|
+
const { root, setProps, waitForChanges } = await render(h("bs-composer", { value: "one line" }));
|
|
102
|
+
const textarea = root.shadowRoot.querySelector('textarea');
|
|
103
|
+
const oneLineHeight = textarea.getBoundingClientRect().height;
|
|
104
|
+
await setProps({ value: 'line one\nline two\nline three\nline four' });
|
|
105
|
+
await waitForChanges();
|
|
106
|
+
expect(textarea.getBoundingClientRect().height).toBeGreaterThan(oneLineHeight);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
68
109
|
it('emits bsAttach when the attach button is clicked', async () => {
|
|
69
110
|
const { root, spyOnEvent } = await render(h("bs-composer", null));
|
|
70
111
|
const spy = spyOnEvent('bsAttach');
|
|
@@ -107,7 +148,7 @@ describe('bs-composer', () => {
|
|
|
107
148
|
describe('state="disabled"', () => {
|
|
108
149
|
it('natively disables both the mic and action buttons and the text input', async () => {
|
|
109
150
|
const { root } = await render(h("bs-composer", { state: "disabled" }));
|
|
110
|
-
expect(root.shadowRoot.querySelector('
|
|
151
|
+
expect(root.shadowRoot.querySelector('textarea')).toHaveAttribute('disabled');
|
|
111
152
|
expect(root.shadowRoot.querySelector('[part="mic"]')).toHaveAttribute('disabled');
|
|
112
153
|
expect(root.shadowRoot.querySelector('[part="action"]')).toHaveAttribute('disabled');
|
|
113
154
|
});
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
--bs-composer-subtle-pressed: var(--bs-color-neutral-container-pressed);
|
|
23
23
|
|
|
24
24
|
--bs-composer-waveform-color: var(--bs-border-default);
|
|
25
|
+
|
|
26
|
+
--bs-composer-input-max-lines: 10;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
.bs-composer {
|
|
@@ -62,12 +64,25 @@
|
|
|
62
64
|
.bs-composer__input {
|
|
63
65
|
flex: 1;
|
|
64
66
|
min-width: 0;
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
/* Browsers apply their own default padding to <textarea> (Chromium: 2px) -- zero it out so the
|
|
69
|
+
auto-grow height math (line-height * number of lines) isn't thrown off by unaccounted-for
|
|
70
|
+
padding. */
|
|
71
|
+
padding: 0;
|
|
65
72
|
border: none;
|
|
66
73
|
outline: none;
|
|
74
|
+
resize: none;
|
|
67
75
|
background: transparent;
|
|
68
76
|
color: var(--bs-input-text);
|
|
69
77
|
font-family: inherit;
|
|
70
78
|
font-size: var(--bs-font-size-md);
|
|
79
|
+
/* Explicit, not the textarea's default line-height -- the auto-grow max-height below is computed
|
|
80
|
+
in terms of this exact value times --bs-composer-input-max-lines, so it has to be pinned down. */
|
|
81
|
+
line-height: calc(var(--bs-line-height-body-md) * 1px);
|
|
82
|
+
/* Grows with content (see bs-composer.tsx's resizeInput) up to this many lines' worth of height,
|
|
83
|
+
then scrolls internally instead of growing the whole composer further. */
|
|
84
|
+
max-height: calc(var(--bs-composer-input-max-lines) * var(--bs-line-height-body-md) * 1px);
|
|
85
|
+
overflow-y: auto;
|
|
71
86
|
}
|
|
72
87
|
|
|
73
88
|
.bs-composer__input::placeholder {
|
|
@@ -37,7 +37,7 @@ const WAVEFORM_BAR_HEIGHTS = [
|
|
|
37
37
|
* roughly match `--bs-composer-button-size` to align visually.
|
|
38
38
|
* @part attachments - The wrapper around the `attachments` slot.
|
|
39
39
|
* @part attach - The "+" attach button.
|
|
40
|
-
* @part input - The native text `<
|
|
40
|
+
* @part input - The native text `<textarea>`.
|
|
41
41
|
* @part mic - The secondary icon button (microphone, or the stop-recording square while `state="recording"`).
|
|
42
42
|
* @part action - The primary circular action button (send, stop, or confirm depending on `state`).
|
|
43
43
|
* @prop --bs-composer-radius - Corner radius of the container. Aliased to `--bs-border-radius-150`.
|
|
@@ -57,9 +57,11 @@ const WAVEFORM_BAR_HEIGHTS = [
|
|
|
57
57
|
* @prop --bs-composer-mic-icon-disabled - Aliased to `--bs-icon-disabled`.
|
|
58
58
|
* @prop --bs-composer-subtle-hover - Background of the attach/mic buttons on hover (subtle-button treatment, same as `bs-button`'s `subtle` variant). Aliased to `--bs-color-neutral-container`.
|
|
59
59
|
* @prop --bs-composer-subtle-pressed - Background of the attach/mic buttons when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
60
|
+
* @prop --bs-composer-input-max-lines - How many lines the text field grows to before scrolling internally instead of growing further. Aliased to `10`.
|
|
60
61
|
*/
|
|
61
62
|
export class BsComposer {
|
|
62
63
|
el;
|
|
64
|
+
inputEl;
|
|
63
65
|
/**
|
|
64
66
|
* Which flavor of composer this is: changes the *default* placeholder text (set `placeholder`
|
|
65
67
|
* directly to override it) and, per the Figma design, renders the container border dashed
|
|
@@ -70,7 +72,12 @@ export class BsComposer {
|
|
|
70
72
|
/** Overrides the variant's default placeholder. */
|
|
71
73
|
placeholder;
|
|
72
74
|
/** Current text value. Native `input` events don't cross the Shadow DOM boundary, so this
|
|
73
|
-
* component re-dispatches them as a `bsInput` custom event instead.
|
|
75
|
+
* component re-dispatches them as a `bsInput` custom event instead.
|
|
76
|
+
*
|
|
77
|
+
* The field is a `<textarea>` (not a single-line `<input>`) that grows with its content, up to
|
|
78
|
+
* `--bs-composer-input-max-lines` (10 by default) -- beyond that it scrolls internally instead
|
|
79
|
+
* of growing further. Setting `value` as a prop (not just typing) also re-triggers the resize,
|
|
80
|
+
* so e.g. programmatically clearing the field after submit correctly shrinks it back down. */
|
|
74
81
|
value = '';
|
|
75
82
|
/**
|
|
76
83
|
* Which of the four mutually-exclusive composer states to render: `idle` (send, enabled),
|
|
@@ -107,11 +114,38 @@ export class BsComposer {
|
|
|
107
114
|
componentWillLoad() {
|
|
108
115
|
this.hasAttachments = Array.from(this.el.childNodes).some(node => node.nodeType === Node.ELEMENT_NODE && node.getAttribute('slot') === 'attachments');
|
|
109
116
|
}
|
|
117
|
+
componentDidLoad() {
|
|
118
|
+
this.resizeInput();
|
|
119
|
+
}
|
|
120
|
+
/** Re-runs the auto-grow calculation after every re-render -- notably including a `value` prop
|
|
121
|
+
* change from the outside (e.g. a consumer clearing the field after submit, or pre-filling it),
|
|
122
|
+
* not just while the user is typing. This has to be `componentDidUpdate`, not a `@Watch('value')`
|
|
123
|
+
* callback: `@Watch` fires as soon as the prop is reassigned, which is BEFORE Stencil's next
|
|
124
|
+
* render actually pushes the new value into the textarea's DOM `.value` -- reading `scrollHeight`
|
|
125
|
+
* at that point still reflects the OLD content, so the resize would silently no-op. */
|
|
126
|
+
componentDidUpdate() {
|
|
127
|
+
this.resizeInput();
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Grows the textarea to fit its content, up to `--bs-composer-input-max-lines` worth of height
|
|
131
|
+
* (CSS `max-height` clamps the visual result and `overflow-y: auto` takes over beyond that --
|
|
132
|
+
* see bs-composer.css). Resetting `height` to `auto` first is required before reading
|
|
133
|
+
* `scrollHeight`, otherwise a shrinking edit (e.g. deleting a line) would never shrink the
|
|
134
|
+
* textarea back down -- `scrollHeight` only ever reports the larger of "current height" and
|
|
135
|
+
* "content height" if the height isn't cleared first.
|
|
136
|
+
*/
|
|
137
|
+
resizeInput() {
|
|
138
|
+
if (!this.inputEl)
|
|
139
|
+
return;
|
|
140
|
+
this.inputEl.style.height = 'auto';
|
|
141
|
+
this.inputEl.style.height = `${this.inputEl.scrollHeight}px`;
|
|
142
|
+
}
|
|
110
143
|
onAttachmentsSlotchange = (ev) => {
|
|
111
144
|
this.hasAttachments = ev.target.assignedNodes().length > 0;
|
|
112
145
|
};
|
|
113
146
|
onInput = (ev) => {
|
|
114
147
|
const value = ev.target.value;
|
|
148
|
+
this.resizeInput();
|
|
115
149
|
this.bsInput.emit(value);
|
|
116
150
|
};
|
|
117
151
|
onAttachClick = () => {
|
|
@@ -149,7 +183,7 @@ export class BsComposer {
|
|
|
149
183
|
const placeholder = this.placeholder ?? DEFAULT_PLACEHOLDERS[this.variant];
|
|
150
184
|
const disabled = this.state === 'disabled';
|
|
151
185
|
const recording = this.state === 'recording';
|
|
152
|
-
return (h("div", { key: '
|
|
186
|
+
return (h("div", { key: '4d6ea6241693e45065388f34f9fe2c141eb6379f', class: `bs-composer bs-composer--${this.state} bs-composer--${this.variant}` }, h("div", { key: '952853cd4a36c5dc6057186825432616c5c99b38', part: "attachments", class: `bs-composer__attachments-row ${this.hasAttachments ? 'bs-composer__attachments-row--visible' : ''}` }, h("slot", { key: '65311f5b1f1b8fd1e6c9f33741a53c94bbe292b0', name: "attachments", onSlotchange: this.onAttachmentsSlotchange })), h("div", { key: '8699568430ff2140b0869a004a253e6c01e1984f', class: "bs-composer__text-row" }, h("textarea", { key: '5505815f7bb6ff19191ffea375fcd7fb856371fd', ref: el => (this.inputEl = el), part: "input", class: "bs-composer__input", rows: 1, value: this.value, placeholder: placeholder, disabled: disabled, "aria-label": this.ariaLabel, onInput: this.onInput })), h("div", { key: 'fd65f7928117afd583e3f1e2372cbb66305a530e', class: "bs-composer__controls-row" }, h("button", { key: '4e691d7ca567a4ece45601f47836d1ac7c5e2a1d', type: "button", part: "attach", class: "bs-composer__attach", "aria-label": "Attach", onClick: this.onAttachClick }, h(PlusIcon, { key: 'e363bbfcd346090dbceafd20d893af0903952223' })), recording ? (h("span", { class: "bs-composer__waveform", "aria-hidden": "true" }, WAVEFORM_BAR_HEIGHTS.map(height => (h("span", { class: "bs-composer__waveform-bar", style: { '--bs-composer-bar-height': `${height}px` } }))))) : (h("span", { class: "bs-composer__spacer" })), h("button", { key: 'e0f113e189ec7ded494c7ef7cf91fe3e13df01bc', type: "button", part: "mic", class: `bs-composer__mic ${recording ? 'bs-composer__mic--recording' : ''}`, "aria-label": recording ? 'Stop recording' : 'Start voice input', disabled: disabled, onClick: this.onMicClick }, recording ? h(StopIcon, null) : h(MicIcon, null)), h("button", { key: '3603219c2c3781a9e2894142313f84dfa52c21ed', type: "button", part: "action", class: `bs-composer__action bs-composer__action--${this.state}`, "aria-label": this.actionLabel(), disabled: disabled, onClick: this.onActionClick }, this.renderActionIcon()), h("slot", { key: '3d143aa3f254310dba537c19a6ac4c40205a405d', name: "actions-end" }))));
|
|
153
187
|
}
|
|
154
188
|
static get is() { return "bs-composer"; }
|
|
155
189
|
static get encapsulation() { return "shadow"; }
|
|
@@ -223,7 +257,7 @@ export class BsComposer {
|
|
|
223
257
|
"optional": false,
|
|
224
258
|
"docs": {
|
|
225
259
|
"tags": [],
|
|
226
|
-
"text": "Current text value. Native `input` events don't cross the Shadow DOM boundary, so this\ncomponent re-dispatches them as a `bsInput` custom event instead."
|
|
260
|
+
"text": "Current text value. Native `input` events don't cross the Shadow DOM boundary, so this\ncomponent re-dispatches them as a `bsInput` custom event instead.\n\nThe field is a `<textarea>` (not a single-line `<input>`) that grows with its content, up to\n`--bs-composer-input-max-lines` (10 by default) -- beyond that it scrolls internally instead\nof growing further. Setting `value` as a prop (not just typing) also re-triggers the resize,\nso e.g. programmatically clearing the field after submit correctly shrinks it back down."
|
|
227
261
|
},
|
|
228
262
|
"getter": false,
|
|
229
263
|
"setter": false,
|
package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.js
CHANGED
|
@@ -1,10 +1,56 @@
|
|
|
1
1
|
import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
2
2
|
describe('bs-composer-status-banner', () => {
|
|
3
|
-
it('renders the message and a default
|
|
3
|
+
it('renders the message and a default icon', async () => {
|
|
4
4
|
const { root } = await render(h("bs-composer-status-banner", { message: "Something went wrong" }));
|
|
5
5
|
expect(root).toHaveTextContent('Something went wrong');
|
|
6
6
|
expect(root.shadowRoot.querySelector('[part="icon"] svg')).not.toBeNull();
|
|
7
7
|
});
|
|
8
|
+
describe('accessibility', () => {
|
|
9
|
+
it('sets role="alert" for type="error" (the default)', async () => {
|
|
10
|
+
const { root } = await render(h("bs-composer-status-banner", null));
|
|
11
|
+
expect(root.shadowRoot.querySelector('.bs-composer-status-banner')).toEqualAttribute('role', 'alert');
|
|
12
|
+
});
|
|
13
|
+
it('sets role="alert" for type="warning"', async () => {
|
|
14
|
+
const { root } = await render(h("bs-composer-status-banner", { type: "warning" }));
|
|
15
|
+
expect(root.shadowRoot.querySelector('.bs-composer-status-banner')).toEqualAttribute('role', 'alert');
|
|
16
|
+
});
|
|
17
|
+
it('sets role="status" for type="info"', async () => {
|
|
18
|
+
const { root } = await render(h("bs-composer-status-banner", { type: "info" }));
|
|
19
|
+
expect(root.shadowRoot.querySelector('.bs-composer-status-banner')).toEqualAttribute('role', 'status');
|
|
20
|
+
});
|
|
21
|
+
it('sets role="status" for type="neutral"', async () => {
|
|
22
|
+
const { root } = await render(h("bs-composer-status-banner", { type: "neutral" }));
|
|
23
|
+
expect(root.shadowRoot.querySelector('.bs-composer-status-banner')).toEqualAttribute('role', 'status');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
describe('default icon per type', () => {
|
|
27
|
+
it('shows the warning-triangle icon for type="error"', async () => {
|
|
28
|
+
const { root } = await render(h("bs-composer-status-banner", { type: "error" }));
|
|
29
|
+
const svg = root.shadowRoot.querySelector('[part="icon"] svg');
|
|
30
|
+
expect(svg.querySelector('circle[r="0.75"]')).not.toBeNull();
|
|
31
|
+
});
|
|
32
|
+
it('shows the warning-triangle icon for type="warning"', async () => {
|
|
33
|
+
const { root } = await render(h("bs-composer-status-banner", { type: "warning" }));
|
|
34
|
+
const svg = root.shadowRoot.querySelector('[part="icon"] svg');
|
|
35
|
+
expect(svg.querySelector('circle[r="0.75"]')).not.toBeNull();
|
|
36
|
+
});
|
|
37
|
+
it('shows the clock icon for type="info"', async () => {
|
|
38
|
+
const { root } = await render(h("bs-composer-status-banner", { type: "info" }));
|
|
39
|
+
const svg = root.shadowRoot.querySelector('[part="icon"] svg');
|
|
40
|
+
expect(svg.querySelector('circle[r="7.25"]')).not.toBeNull();
|
|
41
|
+
});
|
|
42
|
+
it('shows the clock icon for type="neutral"', async () => {
|
|
43
|
+
const { root } = await render(h("bs-composer-status-banner", { type: "neutral" }));
|
|
44
|
+
const svg = root.shadowRoot.querySelector('[part="icon"] svg');
|
|
45
|
+
expect(svg.querySelector('circle[r="7.25"]')).not.toBeNull();
|
|
46
|
+
});
|
|
47
|
+
it('a slotted icon still overrides the type-based default', async () => {
|
|
48
|
+
const { root } = await render(h("bs-composer-status-banner", { type: "error" }, h("svg", { slot: "icon", class: "custom-icon" })));
|
|
49
|
+
const slot = root.shadowRoot.querySelector('slot[name="icon"]');
|
|
50
|
+
expect(slot.assignedElements()).toHaveLength(1);
|
|
51
|
+
expect(slot.assignedElements()[0]).toHaveClass('custom-icon');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
8
54
|
it('does not render the icon when showIcon is false', async () => {
|
|
9
55
|
const { root } = await render(h("bs-composer-status-banner", { showIcon: false }));
|
|
10
56
|
expect(root.shadowRoot.querySelector('[part="icon"]')).toBeNull();
|
|
@@ -13,6 +13,13 @@ import { h } from "@stencil/core";
|
|
|
13
13
|
* - A toast/snackbar notification unrelated to the composer -- this component is not
|
|
14
14
|
* self-dismissing and has no positioning of its own (it's a static block, not an overlay).
|
|
15
15
|
*
|
|
16
|
+
* ## Accessibility
|
|
17
|
+
* Sets `role="status"` for `type="info"`/`type="neutral"` and `role="alert"` for
|
|
18
|
+
* `type="error"`/`type="warning"` on its own root element automatically -- no opt-in prop needed.
|
|
19
|
+
* Both roles carry implicit ARIA live-region semantics (`status` is polite, `alert` is assertive),
|
|
20
|
+
* so a screen reader announces the message as soon as this banner is inserted into the DOM,
|
|
21
|
+
* without a consumer having to remember to add `role`/`aria-live` themselves.
|
|
22
|
+
*
|
|
16
23
|
* @slot icon - Overrides the default leading icon. Only rendered when `showIcon` is true.
|
|
17
24
|
* @part icon - The leading icon wrapper.
|
|
18
25
|
* @part message - The message text.
|
|
@@ -87,8 +94,19 @@ export class BsComposerStatusBanner {
|
|
|
87
94
|
onCloseClick = () => {
|
|
88
95
|
this.bsClose.emit();
|
|
89
96
|
};
|
|
97
|
+
/** `error`/`warning` need immediate, interrupting announcement (`alert`); `info`/`neutral` only
|
|
98
|
+
* need a polite one (`status`) -- matches the Figma Accessibility guidelines for this component. */
|
|
99
|
+
roleForType() {
|
|
100
|
+
return this.type === 'error' || this.type === 'warning' ? 'alert' : 'status';
|
|
101
|
+
}
|
|
102
|
+
/** Clock reads as "waiting/pending", a reasonable default for info/neutral notices -- but is a
|
|
103
|
+
* weak match for error/warning, which get a warning-triangle icon instead. Either default is
|
|
104
|
+
* still overridable via the `icon` slot. */
|
|
105
|
+
renderDefaultIcon() {
|
|
106
|
+
return this.type === 'error' || this.type === 'warning' ? h(WarningIcon, null) : h(ClockIcon, null);
|
|
107
|
+
}
|
|
90
108
|
render() {
|
|
91
|
-
return (h("div", { key: '
|
|
109
|
+
return (h("div", { key: '1c8597f28e99e0900448fade97c53fd21a945b68', role: this.roleForType(), class: `bs-composer-status-banner bs-composer-status-banner--${this.type}` }, h("div", { key: 'f4d0b098780368863d92c43bac129d58cea2ccfd', class: "bs-composer-status-banner__message-group" }, this.showIcon && (h("span", { key: 'a713386fa868bdc244f9b84780fe1672c0a8f60e', part: "icon", class: "bs-composer-status-banner__icon" }, h("slot", { key: '8aa2007e7f744712c142f26d21bba54f6fa9dec7', name: "icon" }, this.renderDefaultIcon()))), h("p", { key: '000009a01e08ea49bd73f2d3490f1f13bfa9d597', part: "message", class: "bs-composer-status-banner__message" }, this.message)), this.showButton && (h("button", { key: 'd323a702a0f3f4f3cb16c23bb75d0f26a2b13b4b', type: "button", part: "action", class: "bs-composer-status-banner__action", onClick: this.onActionClick }, this.actionLabel)), this.allowClose && (h("button", { key: 'b62fa5da8b4fb8c40004f955b9368b71ae0b054c', type: "button", part: "close", class: "bs-composer-status-banner__close", "aria-label": "Dismiss", onClick: this.onCloseClick }, h(CloseIcon, { key: '4c8396f98eff345569ca9ca8940115aa4bc7c3f8' })))));
|
|
92
110
|
}
|
|
93
111
|
static get is() { return "bs-composer-status-banner"; }
|
|
94
112
|
static get encapsulation() { return "shadow"; }
|
|
@@ -267,4 +285,5 @@ export class BsComposerStatusBanner {
|
|
|
267
285
|
}
|
|
268
286
|
}
|
|
269
287
|
const ClockIcon = () => (h("svg", { viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("circle", { cx: "10", cy: "10", r: "7.25", stroke: "currentColor", "stroke-width": "1.3" }), h("path", { d: "M10 5.83V10L12.5 11.67", stroke: "currentColor", "stroke-width": "1.3", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
288
|
+
const WarningIcon = () => (h("svg", { viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M10 3L18 17H2L10 3Z", stroke: "currentColor", "stroke-width": "1.3", "stroke-linejoin": "round" }), h("path", { d: "M10 8V11.5", stroke: "currentColor", "stroke-width": "1.3", "stroke-linecap": "round" }), h("circle", { cx: "10", cy: "14", r: "0.75", fill: "currentColor" })));
|
|
270
289
|
const CloseIcon = () => (h("svg", { viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M15 5L5 15", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M15 15L5 5", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
@@ -54,11 +54,11 @@ export class BsDataTable {
|
|
|
54
54
|
this.bsRowSelect.emit({ id: row.id, selected });
|
|
55
55
|
};
|
|
56
56
|
render() {
|
|
57
|
-
return (h("table", { key: '
|
|
57
|
+
return (h("table", { key: 'b22d3029ddc85bd7125d69b53be2ed427cc7e3c4', part: "table", class: "bs-data-table" }, h("thead", { key: '469ff536b8e09ed6f866b1a883ad06f9df75f003', part: "head" }, h("tr", { key: '8394e3bfe1259bb2342a324ded83dfac41eb8271' }, this.selectable && h("th", { key: '9d2b97169b92b9e45209f91f855431901e8897c1', class: "bs-data-table__select-col" }), this.columns.map(column => {
|
|
58
58
|
const isSorted = this.sortColumn === column.key;
|
|
59
59
|
const ariaSort = column.sortable ? (isSorted ? (this.sortDirection === 'asc' ? 'ascending' : 'descending') : 'none') : undefined;
|
|
60
60
|
return (h("th", { part: "header-cell", class: "bs-data-table__header-cell", "aria-sort": ariaSort }, column.sortable ? (h("button", { type: "button", class: "bs-data-table__sort-button", onClick: () => this.onHeaderClick(column) }, column.label, isSorted && h("span", { class: "bs-data-table__sort-indicator" }, this.sortDirection === 'asc' ? ' ▲' : ' ▼'))) : (column.label)));
|
|
61
|
-
}))), h("tbody", { key: '
|
|
61
|
+
}))), h("tbody", { key: '8a9fa723abcb83820c489b8f07eab58ee306e491', part: "body" }, this.rows.map(row => (h("tr", { part: "row", class: "bs-data-table__row" }, this.selectable && (h("td", { class: "bs-data-table__select-col" }, h("input", { type: "checkbox", checked: this.selectedIds.has(row.id), onChange: ev => this.onRowCheckboxChange(row, ev) }))), this.columns.map(column => this.cellRenderer ? (
|
|
62
62
|
// cellRenderer is a developer-supplied, trusted function (JS-property-only, never
|
|
63
63
|
// derived from untrusted input) -- its HTML output is intentionally not escaped,
|
|
64
64
|
// same trust model as React's dangerouslySetInnerHTML.
|
|
@@ -323,10 +323,10 @@ export class BsInput {
|
|
|
323
323
|
return (h("div", { part: "field", class: `bs-input__field bs-input__field--pin ${this.disabled ? 'bs-input__field--disabled' : ''}` }, Array.from({ length: this.length }).map((_, i) => (h("input", { id: i === 0 ? 'control' : undefined, ref: el => (this.pinInputs[i] = el), part: "control", class: "bs-input__pin-cell", type: "text", inputMode: "numeric", maxLength: 1, value: this.value[i] ?? '', disabled: this.disabled, "aria-required": this.required ? 'true' : undefined, onInput: this.onPinInput(i), onKeyDown: this.onPinKeydown(i) })))));
|
|
324
324
|
}
|
|
325
325
|
render() {
|
|
326
|
-
return (h("div", { key: '
|
|
326
|
+
return (h("div", { key: '766dae0bf2565f45a9fffffc9684a83c89cea122', class: `bs-input ${this.error ? 'bs-input--error' : ''}` }, this.label && (
|
|
327
327
|
// "control" is a fixed id, not a generated one -- safe because Shadow DOM scopes ids
|
|
328
328
|
// to this instance's own shadow root, so it can never collide with another bs-input.
|
|
329
|
-
h("label", { key: '
|
|
329
|
+
h("label", { key: '7935c91837b4882a9b2a416e43f43b1e0d311c8f', part: "label", class: "bs-input__label", htmlFor: "control" }, this.label, this.required && (h("span", { key: '4db3ccc8647ebb5e0fb6635fb9c0e6050872b10c', part: "required", class: "bs-input__required", "aria-hidden": "true" }, "*")))), this.type === 'pin' ? this.renderPinField() : this.renderField(), this.error ? (h("span", { id: "description-or-error", part: "error", class: "bs-input__error" }, h("svg", { part: "error-icon", class: "bs-input__error-icon", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, h("circle", { cx: "8", cy: "8", r: "6.5", stroke: "currentColor", "stroke-width": "1.2" }), h("path", { d: "M8 5V8.5", stroke: "currentColor", "stroke-width": "1.2", "stroke-linecap": "round" }), h("circle", { cx: "8", cy: "11", r: "0.75", fill: "currentColor" })), this.error)) : this.description ? (h("span", { id: "description-or-error", part: "description", class: "bs-input__description" }, this.description)) : null));
|
|
330
330
|
}
|
|
331
331
|
static get is() { return "bs-input"; }
|
|
332
332
|
static get encapsulation() { return "shadow"; }
|