@brandsync/wc 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +587 -162
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/p-00d40aca.entry.js +1 -0
- package/dist/brandsync-wc/{p-6e95eb36.entry.js → p-0299e8e1.entry.js} +1 -1
- package/dist/brandsync-wc/{p-613ff380.entry.js → p-0921ca0d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-4f8459ae.entry.js → p-0a2d690f.entry.js} +1 -1
- package/dist/brandsync-wc/{p-b5cbe30b.entry.js → p-0cf117f4.entry.js} +1 -1
- package/dist/brandsync-wc/{p-aa43d478.entry.js → p-127d698d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-9bcd99aa.entry.js → p-1780224d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-55a8d4b5.entry.js → p-18e0cff4.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e2a37bda.entry.js → p-1abacfe8.entry.js} +1 -1
- package/dist/brandsync-wc/{p-10f6f3cd.entry.js → p-2a7cc40c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-9f1e4a91.entry.js → p-2e7586dd.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e3ce0c8c.entry.js → p-31b28025.entry.js} +1 -1
- package/dist/brandsync-wc/{p-17a695af.entry.js → p-32fe390d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-38aad266.entry.js → p-35bcb932.entry.js} +1 -1
- package/dist/brandsync-wc/{p-0ba35c3b.entry.js → p-393efb5d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-37365a51.entry.js → p-3e61d206.entry.js} +1 -1
- package/dist/brandsync-wc/{p-baa4e2e0.entry.js → p-3e8728dc.entry.js} +1 -1
- package/dist/brandsync-wc/{p-45016a37.entry.js → p-5321186f.entry.js} +1 -1
- package/dist/brandsync-wc/{p-4ec24ccb.entry.js → p-579fbe4d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-16c960b5.entry.js → p-63906504.entry.js} +1 -1
- package/dist/brandsync-wc/{p-59ac2495.entry.js → p-673546bf.entry.js} +1 -1
- package/dist/brandsync-wc/{p-69c5bc2e.entry.js → p-696f885c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-27cce165.entry.js → p-6ef0a0ed.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e231e4cf.entry.js → p-6fc78ccf.entry.js} +1 -1
- package/dist/brandsync-wc/{p-917a5bbc.entry.js → p-7091f130.entry.js} +1 -1
- package/dist/brandsync-wc/{p-752c04c8.entry.js → p-72e02bd5.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c04cf1bb.entry.js → p-778fcc55.entry.js} +1 -1
- package/dist/brandsync-wc/{p-63167373.entry.js → p-790fadf9.entry.js} +1 -1
- package/dist/brandsync-wc/{p-196cfcf0.entry.js → p-82953f42.entry.js} +1 -1
- package/dist/brandsync-wc/p-8b5f4ca7.entry.js +1 -0
- package/dist/brandsync-wc/{p-Do3l4of3.js → p-CvfB8CQv.js} +2 -2
- package/dist/brandsync-wc/{p-c3079ad7.entry.js → p-a16afeaa.entry.js} +1 -1
- package/dist/brandsync-wc/{p-cc79e75f.entry.js → p-a73bfd31.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c90f5a74.entry.js → p-a7704457.entry.js} +1 -1
- package/dist/brandsync-wc/{p-1fcc9f47.entry.js → p-aa1cc2b6.entry.js} +1 -1
- package/dist/brandsync-wc/{p-d037b619.entry.js → p-ac12372f.entry.js} +1 -1
- package/dist/brandsync-wc/p-b2abd8d9.entry.js +1 -0
- package/dist/brandsync-wc/p-b63362e7.entry.js +1 -0
- package/dist/brandsync-wc/{p-ab8de9b6.entry.js → p-bb2ec290.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7e544766.entry.js → p-c7427962.entry.js} +1 -1
- package/dist/brandsync-wc/{p-48000949.entry.js → p-c76ca89f.entry.js} +1 -1
- package/dist/brandsync-wc/{p-43e37883.entry.js → p-c7b9a5c7.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c3c383dc.entry.js → p-ca74c7d9.entry.js} +1 -1
- package/dist/brandsync-wc/p-cc9f85d6.entry.js +1 -0
- package/dist/brandsync-wc/p-cff188cb.entry.js +1 -0
- package/dist/brandsync-wc/{p-b18e4845.entry.js → p-e230ed08.entry.js} +1 -1
- package/dist/brandsync-wc/{p-5ae9e60e.entry.js → p-f652d79c.entry.js} +1 -1
- package/dist/brandsync-wc/p-fc9d52d4.entry.js +1 -0
- package/dist/cjs/brandsync-wc.cjs.js +3 -3
- package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +2 -2
- package/dist/cjs/bs-ai-greeting.cjs.entry.js +2 -2
- package/dist/cjs/bs-ai-thinking.cjs.entry.js +2 -2
- package/dist/cjs/bs-attachment-list.cjs.entry.js +2 -2
- package/dist/cjs/bs-attachment.cjs.entry.js +1 -1
- package/dist/cjs/bs-avatar.cjs.entry.js +1 -1
- package/dist/cjs/bs-badge.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumb-overflow.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumbs.cjs.entry.js +2 -2
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/bs-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-card.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +2 -2
- package/dist/cjs/bs-checkbox-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/bs-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/bs-chip-filter.cjs.entry.js +68 -0
- package/dist/cjs/bs-chip-informative.cjs.entry.js +42 -0
- package/dist/cjs/bs-chip-input.cjs.entry.js +76 -0
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +2 -2
- package/dist/cjs/bs-composer.cjs.entry.js +2 -2
- package/dist/cjs/bs-data-table.cjs.entry.js +3 -3
- package/dist/cjs/bs-dialog.cjs.entry.js +13 -3
- package/dist/cjs/bs-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/bs-inline-tab.cjs.entry.js +2 -2
- package/dist/cjs/bs-input.cjs.entry.js +3 -3
- package/dist/cjs/bs-logo.cjs.entry.js +1 -1
- package/dist/cjs/bs-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/bs-menu.cjs.entry.js +2 -2
- package/dist/cjs/bs-navigation-drawer-item.cjs.entry.js +2 -2
- package/dist/cjs/bs-navigation-drawer.cjs.entry.js +2 -2
- package/dist/cjs/bs-navigation-header.cjs.entry.js +2 -2
- package/dist/cjs/bs-pagination.cjs.entry.js +2 -2
- package/dist/cjs/bs-radio.cjs.entry.js +2 -2
- package/dist/cjs/bs-slider.cjs.entry.js +2 -2
- package/dist/cjs/bs-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/bs-source-link.cjs.entry.js +3 -3
- package/dist/cjs/bs-stepper-step.cjs.entry.js +2 -2
- package/dist/cjs/bs-stepper.cjs.entry.js +2 -2
- package/dist/cjs/bs-switch.cjs.entry.js +2 -2
- package/dist/cjs/bs-tab.cjs.entry.js +2 -2
- package/dist/cjs/bs-tabs.cjs.entry.js +2 -2
- package/dist/cjs/bs-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{index-DHVw-IPK.js → index-CdAh5BFg.js} +27 -14
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +1 -1
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +1 -1
- package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +1 -1
- package/dist/collection/components/bs-attachment/bs-attachment.js +1 -1
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +1 -1
- package/dist/collection/components/bs-avatar/bs-avatar.js +2 -2
- package/dist/collection/components/bs-badge/bs-badge.js +1 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb/bs-breadcrumb.js +1 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.js +1 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.js +1 -1
- package/dist/collection/components/bs-button/bs-button/bs-button.js +2 -2
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.js +3 -3
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
- package/dist/collection/components/bs-card/bs-card.css +6 -0
- package/dist/collection/components/bs-card/bs-card.js +1 -1
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +1 -1
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +1 -1
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +1 -1
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +1 -1
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +1 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.js +1 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox.js +1 -1
- package/dist/collection/components/bs-chip/bs-chip-filter/bs-chip-filter.cmp.test.js +99 -0
- package/dist/collection/components/bs-chip/bs-chip-filter/bs-chip-filter.css +156 -0
- package/dist/collection/components/bs-chip/bs-chip-filter/bs-chip-filter.js +222 -0
- package/dist/collection/components/bs-chip/bs-chip-filter/bs-chip-filter.stories.js +76 -0
- package/dist/collection/components/bs-chip/bs-chip-informative/bs-chip-informative.cmp.test.js +43 -0
- package/dist/collection/components/bs-chip/bs-chip-informative/bs-chip-informative.css +135 -0
- package/dist/collection/components/bs-chip/bs-chip-informative/bs-chip-informative.js +143 -0
- package/dist/collection/components/bs-chip/bs-chip-informative/bs-chip-informative.stories.js +70 -0
- package/dist/collection/components/bs-chip/bs-chip-input/bs-chip-input.cmp.test.js +93 -0
- package/dist/collection/components/bs-chip/bs-chip-input/bs-chip-input.css +172 -0
- package/dist/collection/components/bs-chip/bs-chip-input/bs-chip-input.js +208 -0
- package/dist/collection/components/bs-chip/bs-chip-input/bs-chip-input.stories.js +67 -0
- package/dist/collection/components/bs-composer/bs-composer.js +3 -3
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.js +2 -2
- package/dist/collection/components/bs-data-table/bs-data-table.js +6 -6
- package/dist/collection/components/bs-dialog/bs-dialog.cmp.test.js +6 -0
- package/dist/collection/components/bs-dialog/bs-dialog.js +13 -3
- package/dist/collection/components/bs-input/bs-input.js +2 -2
- package/dist/collection/components/bs-logo/bs-logo.js +2 -2
- 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-pagination/bs-pagination.js +1 -1
- package/dist/collection/components/bs-radio/bs-radio.js +1 -1
- package/dist/collection/components/bs-slider/bs-slider.js +2 -2
- package/dist/collection/components/bs-snackbar/bs-snackbar.js +2 -2
- package/dist/collection/components/bs-source-link/bs-source-link.js +2 -2
- package/dist/collection/components/bs-stepper/bs-stepper/bs-stepper.js +1 -1
- package/dist/collection/components/bs-stepper/bs-stepper-step/bs-stepper-step.js +3 -3
- package/dist/collection/components/bs-switch/bs-switch.js +2 -2
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.js +1 -1
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.js +2 -2
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.js +3 -3
- 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.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.js +2 -2
- package/dist/components/bs-ai-disclaimer.js +1 -1
- package/dist/components/bs-ai-greeting.js +1 -1
- package/dist/components/bs-ai-thinking.js +1 -1
- package/dist/components/bs-attachment-list.js +1 -1
- package/dist/components/bs-attachment.js +1 -1
- package/dist/components/bs-avatar.js +1 -1
- package/dist/components/bs-badge.js +1 -1
- package/dist/components/bs-breadcrumb-overflow.js +1 -1
- package/dist/components/bs-breadcrumb.js +1 -1
- package/dist/components/bs-breadcrumbs.js +1 -1
- package/dist/components/bs-button-skeleton.js +1 -1
- package/dist/components/bs-button.js +1 -1
- package/dist/components/bs-card.js +1 -1
- package/dist/components/bs-chatbot-feedback.js +1 -1
- package/dist/components/bs-chatbot-header.js +1 -1
- package/dist/components/bs-chatbot-response-action.js +1 -1
- package/dist/components/bs-chatbot-sources-drawer.js +1 -1
- package/dist/components/bs-chatbot-suggestion-button.js +1 -1
- package/dist/components/bs-checkbox-skeleton.js +1 -1
- package/dist/components/bs-checkbox.js +1 -1
- package/dist/components/bs-chip-filter.d.ts +11 -0
- package/dist/components/bs-chip-filter.js +1 -0
- package/dist/components/bs-chip-informative.d.ts +11 -0
- package/dist/components/bs-chip-informative.js +1 -0
- package/dist/components/bs-chip-input.d.ts +11 -0
- package/dist/components/bs-chip-input.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-dialog.js +1 -1
- package/dist/components/bs-icon-button.js +1 -1
- package/dist/components/bs-inline-tab.js +1 -1
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-logo.js +1 -1
- package/dist/components/bs-menu-item.js +1 -1
- package/dist/components/bs-menu.js +1 -1
- package/dist/components/bs-navigation-drawer-item.js +1 -1
- package/dist/components/bs-navigation-drawer.js +1 -1
- package/dist/components/bs-navigation-header.js +1 -1
- package/dist/components/bs-pagination.js +1 -1
- package/dist/components/bs-radio.js +1 -1
- package/dist/components/bs-slider.js +1 -1
- package/dist/components/bs-snackbar.js +1 -1
- package/dist/components/bs-source-link.js +1 -1
- package/dist/components/bs-stepper-step.js +1 -1
- package/dist/components/bs-stepper.js +1 -1
- package/dist/components/bs-switch.js +1 -1
- package/dist/components/bs-tab.js +1 -1
- package/dist/components/bs-tabs.js +1 -1
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-BFcVSpES.js → p-B8JpGodL.js} +1 -1
- package/dist/components/{p-CUa8zihb.js → p-BFVUq5m5.js} +1 -1
- package/dist/components/{p-Bs7nEbqK.js → p-BPUNjzjH.js} +1 -1
- package/dist/components/{p-CPSCOLIf.js → p-Bb6vh9PN.js} +1 -1
- package/dist/components/{p-BJZYe7M4.js → p-CsnFdZ3v.js} +1 -1
- package/dist/components/{p-BKaZWFE1.js → p-DwVm6HIb.js} +1 -1
- package/dist/esm/brandsync-wc.js +4 -4
- package/dist/esm/bs-ai-disclaimer.entry.js +2 -2
- package/dist/esm/bs-ai-greeting.entry.js +2 -2
- package/dist/esm/bs-ai-thinking.entry.js +2 -2
- package/dist/esm/bs-attachment-list.entry.js +2 -2
- package/dist/esm/bs-attachment.entry.js +1 -1
- package/dist/esm/bs-avatar.entry.js +1 -1
- package/dist/esm/bs-badge.entry.js +1 -1
- package/dist/esm/bs-breadcrumb-overflow.entry.js +1 -1
- package/dist/esm/bs-breadcrumb.entry.js +1 -1
- package/dist/esm/bs-breadcrumbs.entry.js +2 -2
- package/dist/esm/bs-button-skeleton.entry.js +2 -2
- package/dist/esm/bs-button.entry.js +1 -1
- package/dist/esm/bs-card.entry.js +2 -2
- package/dist/esm/bs-chatbot-feedback.entry.js +2 -2
- package/dist/esm/bs-chatbot-header.entry.js +2 -2
- package/dist/esm/bs-chatbot-response-action.entry.js +2 -2
- package/dist/esm/bs-chatbot-sources-drawer.entry.js +2 -2
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +2 -2
- package/dist/esm/bs-checkbox-skeleton.entry.js +2 -2
- package/dist/esm/bs-checkbox.entry.js +1 -1
- package/dist/esm/bs-chip-filter.entry.js +66 -0
- package/dist/esm/bs-chip-informative.entry.js +40 -0
- package/dist/esm/bs-chip-input.entry.js +74 -0
- package/dist/esm/bs-composer-status-banner.entry.js +2 -2
- package/dist/esm/bs-composer.entry.js +2 -2
- package/dist/esm/bs-data-table.entry.js +3 -3
- package/dist/esm/bs-dialog.entry.js +13 -3
- package/dist/esm/bs-icon-button.entry.js +2 -2
- package/dist/esm/bs-inline-tab.entry.js +2 -2
- package/dist/esm/bs-input.entry.js +3 -3
- package/dist/esm/bs-logo.entry.js +1 -1
- package/dist/esm/bs-menu-item.entry.js +2 -2
- package/dist/esm/bs-menu.entry.js +2 -2
- package/dist/esm/bs-navigation-drawer-item.entry.js +2 -2
- package/dist/esm/bs-navigation-drawer.entry.js +2 -2
- package/dist/esm/bs-navigation-header.entry.js +2 -2
- package/dist/esm/bs-pagination.entry.js +2 -2
- package/dist/esm/bs-radio.entry.js +2 -2
- package/dist/esm/bs-slider.entry.js +2 -2
- package/dist/esm/bs-snackbar.entry.js +2 -2
- package/dist/esm/bs-source-link.entry.js +3 -3
- package/dist/esm/bs-stepper-step.entry.js +2 -2
- package/dist/esm/bs-stepper.entry.js +2 -2
- package/dist/esm/bs-switch.entry.js +2 -2
- package/dist/esm/bs-tab.entry.js +2 -2
- package/dist/esm/bs-tabs.entry.js +2 -2
- package/dist/esm/bs-tooltip.entry.js +2 -2
- package/dist/esm/{index-Do3l4of3.js → index-CvfB8CQv.js} +27 -14
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/bs-chip/bs-chip-filter/bs-chip-filter.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-chip/bs-chip-filter/bs-chip-filter.d.ts +56 -0
- package/dist/types/components/bs-chip/bs-chip-filter/bs-chip-filter.stories.d.ts +20 -0
- package/dist/types/components/bs-chip/bs-chip-informative/bs-chip-informative.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-chip/bs-chip-informative/bs-chip-informative.d.ts +41 -0
- package/dist/types/components/bs-chip/bs-chip-informative/bs-chip-informative.stories.d.ts +21 -0
- package/dist/types/components/bs-chip/bs-chip-input/bs-chip-input.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-chip/bs-chip-input/bs-chip-input.d.ts +60 -0
- package/dist/types/components/bs-chip/bs-chip-input/bs-chip-input.stories.d.ts +18 -0
- package/dist/types/components.d.ts +355 -0
- package/dist/types/stencil-public-runtime.d.ts +62 -55
- package/loader/index.d.ts +1 -1
- package/package.json +6 -5
- package/dist/brandsync-wc/p-3efb76dd.entry.js +0 -1
- package/dist/brandsync-wc/p-ce7fc368.entry.js +0 -1
- package/dist/brandsync-wc/p-d22990c0.entry.js +0 -1
- package/dist/brandsync-wc/p-f0ae2740.entry.js +0 -1
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A pill-shaped, removable representation of a discrete piece of user-entered data (e.g. a tag,
|
|
4
|
+
* a selected filter value, an invited email address), optionally paired with a leading icon or
|
|
5
|
+
* avatar. Unlike `bs-chip-filter`, this is a compound control -- the body toggles `selected`, and
|
|
6
|
+
* a separate trailing button removes the chip entirely.
|
|
7
|
+
*
|
|
8
|
+
* ## When to use
|
|
9
|
+
* - Representing one entry in a list the user built themselves (tags, recipients, multi-select
|
|
10
|
+
* values) that they need to be able to remove individually.
|
|
11
|
+
*
|
|
12
|
+
* ## When not to use
|
|
13
|
+
* - A single toggleable filter, with no removal affordance -- use `bs-chip-filter`.
|
|
14
|
+
* - A static, non-interactive status/category label -- use `bs-badge`.
|
|
15
|
+
*
|
|
16
|
+
* @slot - Default slot: the chip's label content.
|
|
17
|
+
* @slot icon - Optional leading visual. Defaults to 16px (a plain icon), except a
|
|
18
|
+
* `<bs-avatar size="xs">` specifically keeps its own natural 24px sizing instead -- Figma specs
|
|
19
|
+
* a plain icon and an avatar (with its own existing border ring) at two different sizes.
|
|
20
|
+
* @part body - The button that toggles `selected`.
|
|
21
|
+
* @part icon - The icon wrapper element.
|
|
22
|
+
* @part label - The text label element.
|
|
23
|
+
* @part remove - The trailing remove button.
|
|
24
|
+
*/
|
|
25
|
+
export class BsChipInput {
|
|
26
|
+
el;
|
|
27
|
+
/** Sizing scale. Controls the chip's height only -- icon size, gap, and font size stay
|
|
28
|
+
* constant across sizes, matching the Figma spec exactly. */
|
|
29
|
+
size = 'lg';
|
|
30
|
+
/** Whether the chip reads as toggled on. Mutable so clicking the body toggles directly, and
|
|
31
|
+
* reflected so consumers can target `bs-chip-input[selected]` via CSS. */
|
|
32
|
+
selected = false;
|
|
33
|
+
/** Disables both the body and the remove button, and reflected so `:host([disabled])` can
|
|
34
|
+
* apply the disabled token set (a plain CSS pseudo-class can't target the host itself here,
|
|
35
|
+
* since :host isn't a native form control). */
|
|
36
|
+
disabled = false;
|
|
37
|
+
/** Tracks whether the `icon` slot has assigned content, so the icon/label gap and left-edge
|
|
38
|
+
* padding only apply when there's actually a leading icon/avatar. */
|
|
39
|
+
hasIcon = false;
|
|
40
|
+
/** The label's current text content, read from the default slot -- used to build the remove
|
|
41
|
+
* button's accessible name ("Remove {label}"), same reasoning as bs-input's identical
|
|
42
|
+
* `Remove ${chip}` pattern for its own inline chip-entry mode. */
|
|
43
|
+
labelText = '';
|
|
44
|
+
/** Emitted when `selected` changes via clicking the body, with the new value. */
|
|
45
|
+
bsChange;
|
|
46
|
+
/** Emitted when the remove button is clicked. No payload -- unlike bs-input's own chip-entry
|
|
47
|
+
* mode (which tracks a `chips: string[]` array internally and can identify which string was
|
|
48
|
+
* removed), a standalone chip doesn't know its own "value" to a consumer; whatever's rendering
|
|
49
|
+
* a list of these already has that context via closure/key. */
|
|
50
|
+
bsRemove;
|
|
51
|
+
componentWillLoad() {
|
|
52
|
+
this.hasIcon = this.hasSlottedContent('icon');
|
|
53
|
+
this.labelText = this.getLabelText();
|
|
54
|
+
}
|
|
55
|
+
hasSlottedContent(slotName) {
|
|
56
|
+
return Array.from(this.el.childNodes).some(node => node.nodeType === Node.ELEMENT_NODE && node.getAttribute('slot') === slotName);
|
|
57
|
+
}
|
|
58
|
+
getLabelText() {
|
|
59
|
+
return Array.from(this.el.childNodes)
|
|
60
|
+
.filter(node => !(node.nodeType === Node.ELEMENT_NODE && node.hasAttribute('slot')))
|
|
61
|
+
.map(node => node.textContent)
|
|
62
|
+
.join('')
|
|
63
|
+
.trim();
|
|
64
|
+
}
|
|
65
|
+
onIconSlotchange = (ev) => {
|
|
66
|
+
this.hasIcon = ev.target.assignedNodes().length > 0;
|
|
67
|
+
};
|
|
68
|
+
onLabelSlotchange = () => {
|
|
69
|
+
this.labelText = this.getLabelText();
|
|
70
|
+
};
|
|
71
|
+
onBodyClick = () => {
|
|
72
|
+
this.selected = !this.selected;
|
|
73
|
+
this.bsChange.emit(this.selected);
|
|
74
|
+
};
|
|
75
|
+
onRemoveClick = () => {
|
|
76
|
+
this.bsRemove.emit();
|
|
77
|
+
};
|
|
78
|
+
render() {
|
|
79
|
+
const paddingVariant = this.hasIcon ? 'icon' : 'text';
|
|
80
|
+
return (h(Host, { key: 'd11302f69f8732c0c1c5c52e25a43ed894bba9d3', class: `bs-chip-input bs-chip-input--${this.size} bs-chip-input--${paddingVariant}` }, h("button", { key: 'e6621eb9e757f639d18287a56ffcbd75131ece65', type: "button", part: "body", class: "bs-chip-input__body", disabled: this.disabled, "aria-pressed": String(this.selected), onClick: this.onBodyClick }, h("span", { key: '3bc20f30643dc95905778053ad892bd728005e41', part: "icon", class: `bs-chip-input__icon ${this.hasIcon ? 'bs-chip-input__icon--visible' : ''}` }, h("slot", { key: '1082ebd7f6e5fee0da8864f15eff7a645097fec9', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '6b93d2229962e9362bf827a127dd0af3b5125059', part: "label", class: "bs-chip-input__label" }, h("slot", { key: 'c53a759951afbe131472252ec3ca45b9ba15200a', onSlotchange: this.onLabelSlotchange }))), h("button", { key: 'e9c0a6d76f6e6be0c7f3fcf4004207d045eb5b6c', type: "button", part: "remove", class: "bs-chip-input__remove", disabled: this.disabled, "aria-label": `Remove ${this.labelText}`, onClick: this.onRemoveClick }, h(CloseIcon, { key: 'f14475776429fa95759f9d6050579bce60d27d13' }))));
|
|
81
|
+
}
|
|
82
|
+
static get is() { return "bs-chip-input"; }
|
|
83
|
+
static get encapsulation() { return "shadow"; }
|
|
84
|
+
static get delegatesFocus() { return true; }
|
|
85
|
+
static get originalStyleUrls() {
|
|
86
|
+
return {
|
|
87
|
+
"$": ["bs-chip-input.css"]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
static get styleUrls() {
|
|
91
|
+
return {
|
|
92
|
+
"$": ["bs-chip-input.css"]
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
static get properties() {
|
|
96
|
+
return {
|
|
97
|
+
"size": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"mutable": false,
|
|
100
|
+
"complexType": {
|
|
101
|
+
"original": "BsChipInputSize",
|
|
102
|
+
"resolved": "\"lg\" | \"md\"",
|
|
103
|
+
"references": {
|
|
104
|
+
"BsChipInputSize": {
|
|
105
|
+
"location": "local",
|
|
106
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-chip/bs-chip-input/bs-chip-input.tsx",
|
|
107
|
+
"id": "src/components/bs-chip/bs-chip-input/bs-chip-input.tsx::BsChipInputSize"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"required": false,
|
|
112
|
+
"optional": false,
|
|
113
|
+
"docs": {
|
|
114
|
+
"tags": [],
|
|
115
|
+
"text": "Sizing scale. Controls the chip's height only -- icon size, gap, and font size stay\nconstant across sizes, matching the Figma spec exactly."
|
|
116
|
+
},
|
|
117
|
+
"getter": false,
|
|
118
|
+
"setter": false,
|
|
119
|
+
"reflect": false,
|
|
120
|
+
"attribute": "size",
|
|
121
|
+
"defaultValue": "'lg'"
|
|
122
|
+
},
|
|
123
|
+
"selected": {
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"mutable": true,
|
|
126
|
+
"complexType": {
|
|
127
|
+
"original": "boolean",
|
|
128
|
+
"resolved": "boolean",
|
|
129
|
+
"references": {}
|
|
130
|
+
},
|
|
131
|
+
"required": false,
|
|
132
|
+
"optional": false,
|
|
133
|
+
"docs": {
|
|
134
|
+
"tags": [],
|
|
135
|
+
"text": "Whether the chip reads as toggled on. Mutable so clicking the body toggles directly, and\nreflected so consumers can target `bs-chip-input[selected]` via CSS."
|
|
136
|
+
},
|
|
137
|
+
"getter": false,
|
|
138
|
+
"setter": false,
|
|
139
|
+
"reflect": true,
|
|
140
|
+
"attribute": "selected",
|
|
141
|
+
"defaultValue": "false"
|
|
142
|
+
},
|
|
143
|
+
"disabled": {
|
|
144
|
+
"type": "boolean",
|
|
145
|
+
"mutable": false,
|
|
146
|
+
"complexType": {
|
|
147
|
+
"original": "boolean",
|
|
148
|
+
"resolved": "boolean",
|
|
149
|
+
"references": {}
|
|
150
|
+
},
|
|
151
|
+
"required": false,
|
|
152
|
+
"optional": false,
|
|
153
|
+
"docs": {
|
|
154
|
+
"tags": [],
|
|
155
|
+
"text": "Disables both the body and the remove button, and reflected so `:host([disabled])` can\napply the disabled token set (a plain CSS pseudo-class can't target the host itself here,\nsince :host isn't a native form control)."
|
|
156
|
+
},
|
|
157
|
+
"getter": false,
|
|
158
|
+
"setter": false,
|
|
159
|
+
"reflect": true,
|
|
160
|
+
"attribute": "disabled",
|
|
161
|
+
"defaultValue": "false"
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
static get states() {
|
|
166
|
+
return {
|
|
167
|
+
"hasIcon": {},
|
|
168
|
+
"labelText": {}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
static get events() {
|
|
172
|
+
return [{
|
|
173
|
+
"method": "bsChange",
|
|
174
|
+
"name": "bsChange",
|
|
175
|
+
"bubbles": true,
|
|
176
|
+
"cancelable": true,
|
|
177
|
+
"composed": true,
|
|
178
|
+
"docs": {
|
|
179
|
+
"tags": [],
|
|
180
|
+
"text": "Emitted when `selected` changes via clicking the body, with the new value."
|
|
181
|
+
},
|
|
182
|
+
"complexType": {
|
|
183
|
+
"original": "boolean",
|
|
184
|
+
"resolved": "boolean",
|
|
185
|
+
"references": {}
|
|
186
|
+
}
|
|
187
|
+
}, {
|
|
188
|
+
"method": "bsRemove",
|
|
189
|
+
"name": "bsRemove",
|
|
190
|
+
"bubbles": true,
|
|
191
|
+
"cancelable": true,
|
|
192
|
+
"composed": true,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": "Emitted when the remove button is clicked. No payload -- unlike bs-input's own chip-entry\nmode (which tracks a `chips: string[]` array internally and can identify which string was\nremoved), a standalone chip doesn't know its own \"value\" to a consumer; whatever's rendering\na list of these already has that context via closure/key."
|
|
196
|
+
},
|
|
197
|
+
"complexType": {
|
|
198
|
+
"original": "void",
|
|
199
|
+
"resolved": "void",
|
|
200
|
+
"references": {}
|
|
201
|
+
}
|
|
202
|
+
}];
|
|
203
|
+
}
|
|
204
|
+
static get elementRef() { return "el"; }
|
|
205
|
+
}
|
|
206
|
+
// Same icon already established for this exact purpose in bs-dialog -- reused verbatim rather
|
|
207
|
+
// than pulling in Figma's own X asset, per this library's existing icon for this purpose.
|
|
208
|
+
const CloseIcon = () => (h("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M12.5 3.5L3.5 12.5", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M12.5 12.5L3.5 3.5", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { componentDescription, propDescription } from "../../../stories-utils";
|
|
3
|
+
const PLACEHOLDER_PHOTO = 'https://i.pravatar.cc/256?img=68';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/bs-chip/bs-chip-input',
|
|
6
|
+
parameters: { docs: { description: { component: componentDescription('bs-chip-input') } } },
|
|
7
|
+
render: args => html ` <bs-chip-input size=${args.size} ?selected=${args.selected} ?disabled=${args.disabled}>${args.label}</bs-chip-input> `,
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: { control: { type: 'select' }, options: ['md', 'lg'], description: propDescription('bs-chip-input', 'size') },
|
|
10
|
+
selected: { control: 'boolean', description: propDescription('bs-chip-input', 'selected') },
|
|
11
|
+
disabled: { control: 'boolean', description: propDescription('bs-chip-input', 'disabled') },
|
|
12
|
+
label: { control: 'text', description: 'Slotted label content (not a real attribute -- see the default slot).' },
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
size: 'lg',
|
|
16
|
+
selected: false,
|
|
17
|
+
disabled: false,
|
|
18
|
+
label: 'Label',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
export const Default = {};
|
|
23
|
+
export const Selected = {
|
|
24
|
+
args: { selected: true },
|
|
25
|
+
};
|
|
26
|
+
export const WithIcon = {
|
|
27
|
+
name: 'With icon',
|
|
28
|
+
render: args => html `
|
|
29
|
+
<bs-chip-input size=${args.size} ?selected=${args.selected} ?disabled=${args.disabled}>
|
|
30
|
+
<svg slot="icon" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
31
|
+
<rect x="3" y="2" width="10" height="12" rx="1.5" stroke="currentColor" stroke-width="1.5" />
|
|
32
|
+
<path d="M7 12H9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
33
|
+
</svg>
|
|
34
|
+
${args.label}
|
|
35
|
+
</bs-chip-input>
|
|
36
|
+
`,
|
|
37
|
+
};
|
|
38
|
+
export const WithAvatar = {
|
|
39
|
+
name: 'With avatar',
|
|
40
|
+
render: args => html `
|
|
41
|
+
<bs-chip-input size=${args.size} ?selected=${args.selected} ?disabled=${args.disabled}>
|
|
42
|
+
<bs-avatar slot="icon" size="xs" type="image" src=${PLACEHOLDER_PHOTO} alt="Sam Lee"></bs-avatar>
|
|
43
|
+
${args.label}
|
|
44
|
+
</bs-chip-input>
|
|
45
|
+
`,
|
|
46
|
+
};
|
|
47
|
+
export const Disabled = {
|
|
48
|
+
args: { disabled: true },
|
|
49
|
+
};
|
|
50
|
+
export const Medium = {
|
|
51
|
+
args: { size: 'md' },
|
|
52
|
+
};
|
|
53
|
+
export const AllVariants = {
|
|
54
|
+
name: 'All variants',
|
|
55
|
+
render: () => html `
|
|
56
|
+
<div style="display:flex; gap:12px; flex-wrap:wrap; align-items:center;">
|
|
57
|
+
<bs-chip-input>Label</bs-chip-input>
|
|
58
|
+
<bs-chip-input selected>Label</bs-chip-input>
|
|
59
|
+
<bs-chip-input disabled>Label</bs-chip-input>
|
|
60
|
+
<bs-chip-input size="md">Label</bs-chip-input>
|
|
61
|
+
<bs-chip-input>
|
|
62
|
+
<bs-avatar slot="icon" size="xs" type="image" src=${PLACEHOLDER_PHOTO} alt="Sam Lee"></bs-avatar>
|
|
63
|
+
Label
|
|
64
|
+
</bs-chip-input>
|
|
65
|
+
</div>
|
|
66
|
+
`,
|
|
67
|
+
};
|
|
@@ -183,7 +183,7 @@ export class BsComposer {
|
|
|
183
183
|
const placeholder = this.placeholder ?? DEFAULT_PLACEHOLDERS[this.variant];
|
|
184
184
|
const disabled = this.state === 'disabled';
|
|
185
185
|
const recording = this.state === 'recording';
|
|
186
|
-
return (h("div", { key: '
|
|
186
|
+
return (h("div", { key: 'f4676a3c110cd683f745e3b0e4d37d8abcab06c5', class: `bs-composer bs-composer--${this.state} bs-composer--${this.variant}` }, h("div", { key: '7970d493b0c0f9ef19f00fea2d33b58085f589e6', part: "attachments", class: `bs-composer__attachments-row ${this.hasAttachments ? 'bs-composer__attachments-row--visible' : ''}` }, h("slot", { key: '4b53a6cfd1d7d0e7cf0fa0d5e4f37fb551f4bcd4', name: "attachments", onSlotchange: this.onAttachmentsSlotchange })), h("div", { key: '44fa49b002b657accd21a01e75cd5458dba337a8', class: "bs-composer__text-row" }, h("textarea", { key: '8fde6e735be83c28a38a59437ad9b2453bc6d074', 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: '6f7a9e1a33d642e3ce847c8df03bc7e119696bbe', class: "bs-composer__controls-row" }, h("button", { key: '3b98d1c4e50373318b64d91e259e22d54cced5a7', type: "button", part: "attach", class: "bs-composer__attach", "aria-label": "Attach", onClick: this.onAttachClick }, h(PlusIcon, { key: 'e80e96ec1ea18d5eec08f77d9601c174382aafbd' })), 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: '6dc198b201f3df52a9646146ea4ddfc3d921ca72', 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: 'a7e626d35aa9cc0b9e2bd67ced5961671cdd7850', 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: '3f81510829b313a0088b7a4ea6f70c41dce16e77', name: "actions-end" }))));
|
|
187
187
|
}
|
|
188
188
|
static get is() { return "bs-composer"; }
|
|
189
189
|
static get encapsulation() { return "shadow"; }
|
|
@@ -209,7 +209,7 @@ export class BsComposer {
|
|
|
209
209
|
"references": {
|
|
210
210
|
"BsComposerVariant": {
|
|
211
211
|
"location": "local",
|
|
212
|
-
"path": "/
|
|
212
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-composer/bs-composer.tsx",
|
|
213
213
|
"id": "src/components/bs-composer/bs-composer.tsx::BsComposerVariant"
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -274,7 +274,7 @@ export class BsComposer {
|
|
|
274
274
|
"references": {
|
|
275
275
|
"BsComposerState": {
|
|
276
276
|
"location": "local",
|
|
277
|
-
"path": "/
|
|
277
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-composer/bs-composer.tsx",
|
|
278
278
|
"id": "src/components/bs-composer/bs-composer.tsx::BsComposerState"
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -106,7 +106,7 @@ export class BsComposerStatusBanner {
|
|
|
106
106
|
return this.type === 'error' || this.type === 'warning' ? h(WarningIcon, null) : h(ClockIcon, null);
|
|
107
107
|
}
|
|
108
108
|
render() {
|
|
109
|
-
return (h("div", { key: '
|
|
109
|
+
return (h("div", { key: '74c67ad03135f3437bed5d267bf61d76e526e258', role: this.roleForType(), class: `bs-composer-status-banner bs-composer-status-banner--${this.type}` }, h("div", { key: '451147bf0c994383f67739be91c1e7208188e268', class: "bs-composer-status-banner__message-group" }, this.showIcon && (h("span", { key: '759e731cd0d26516eae83b5f224791043586b9d3', part: "icon", class: "bs-composer-status-banner__icon" }, h("slot", { key: 'cb3e16644aea43208f3112a6c3305490ce0a9bc8', name: "icon" }, this.renderDefaultIcon()))), h("p", { key: '098ffc238f023ba1ea42e26828b845a0a09ff368', part: "message", class: "bs-composer-status-banner__message" }, this.message)), this.showButton && (h("button", { key: '2bbaefea9de874d4f141566809bc77a3bf1aeae9', type: "button", part: "action", class: "bs-composer-status-banner__action", onClick: this.onActionClick }, this.actionLabel)), this.allowClose && (h("button", { key: '4ba7f094f0435a15612a38ef1bd770d2c3b90453', type: "button", part: "close", class: "bs-composer-status-banner__close", "aria-label": "Dismiss", onClick: this.onCloseClick }, h(CloseIcon, { key: 'd8d6e340f64a3fae396763f1d7897fdc8c02936a' })))));
|
|
110
110
|
}
|
|
111
111
|
static get is() { return "bs-composer-status-banner"; }
|
|
112
112
|
static get encapsulation() { return "shadow"; }
|
|
@@ -131,7 +131,7 @@ export class BsComposerStatusBanner {
|
|
|
131
131
|
"references": {
|
|
132
132
|
"BsComposerStatusBannerType": {
|
|
133
133
|
"location": "local",
|
|
134
|
-
"path": "/
|
|
134
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-composer-status-banner/bs-composer-status-banner.tsx",
|
|
135
135
|
"id": "src/components/bs-composer-status-banner/bs-composer-status-banner.tsx::BsComposerStatusBannerType"
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -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: 'c997c047867ae5d446eda4f2ad5260bd956b4255', part: "table", class: "bs-data-table" }, h("thead", { key: 'bdbe3f8c07ef23115d3a8a32a15e84a02e162894', part: "head" }, h("tr", { key: '84f7e89fefe44c680b397bd92bf2b8070e9b943d' }, this.selectable && h("th", { key: '925dbfa36580ef0818e2739ba602161668eedfd5', 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: '96985dc5ace9126094984bd1b876c5eb5209bb39', 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.
|
|
@@ -90,7 +90,7 @@ export class BsDataTable {
|
|
|
90
90
|
"references": {
|
|
91
91
|
"BsDataTableColumn": {
|
|
92
92
|
"location": "local",
|
|
93
|
-
"path": "/
|
|
93
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-data-table/bs-data-table.tsx",
|
|
94
94
|
"id": "src/components/bs-data-table/bs-data-table.tsx::BsDataTableColumn"
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -114,7 +114,7 @@ export class BsDataTable {
|
|
|
114
114
|
"references": {
|
|
115
115
|
"BsDataTableRow": {
|
|
116
116
|
"location": "local",
|
|
117
|
-
"path": "/
|
|
117
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-data-table/bs-data-table.tsx",
|
|
118
118
|
"id": "src/components/bs-data-table/bs-data-table.tsx::BsDataTableRow"
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -197,12 +197,12 @@ export class BsDataTable {
|
|
|
197
197
|
"references": {
|
|
198
198
|
"BsDataTableRow": {
|
|
199
199
|
"location": "local",
|
|
200
|
-
"path": "/
|
|
200
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-data-table/bs-data-table.tsx",
|
|
201
201
|
"id": "src/components/bs-data-table/bs-data-table.tsx::BsDataTableRow"
|
|
202
202
|
},
|
|
203
203
|
"BsDataTableColumn": {
|
|
204
204
|
"location": "local",
|
|
205
|
-
"path": "/
|
|
205
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-data-table/bs-data-table.tsx",
|
|
206
206
|
"id": "src/components/bs-data-table/bs-data-table.tsx::BsDataTableColumn"
|
|
207
207
|
}
|
|
208
208
|
}
|
|
@@ -2,6 +2,12 @@ import { render, h, describe, it, expect, afterEach } from "@stencil/vitest";
|
|
|
2
2
|
describe('bs-dialog', () => {
|
|
3
3
|
afterEach(() => {
|
|
4
4
|
document.querySelectorAll('button[data-test-trigger]').forEach(el => el.remove());
|
|
5
|
+
// render() doesn't unmount the previous test's element on its own -- without this, a dialog
|
|
6
|
+
// left open by one test stays connected (and its document-level focusin listener stays live)
|
|
7
|
+
// into the next test, silently stealing focus meant for that test's own elements. Confirmed
|
|
8
|
+
// directly: a later test's plain `<button>.focus()` call was losing focus to a completely
|
|
9
|
+
// unrelated *previous* test's still-open `<bs-dialog>`.
|
|
10
|
+
document.querySelectorAll('bs-dialog').forEach(el => el.remove());
|
|
5
11
|
});
|
|
6
12
|
it('renders nothing when closed (default)', async () => {
|
|
7
13
|
const { root } = await render(h("bs-dialog", { heading: "Confirm booking" }, "Body"));
|
|
@@ -87,15 +87,25 @@ export class BsDialog {
|
|
|
87
87
|
// reliably walk into slotted children's own Shadow DOM anyway), redirect any focus that lands
|
|
88
88
|
// outside the dialog back to it. composedPath() correctly reports elements across Shadow DOM
|
|
89
89
|
// boundaries, unlike a plain `.contains()` check.
|
|
90
|
+
//
|
|
91
|
+
// isConnected guard: without it, a dialog instance that's been removed from the document (e.g.
|
|
92
|
+
// a consumer swapping it out for another) but hasn't finished Stencil's disconnect teardown yet
|
|
93
|
+
// would still redirect page-wide focusin events into its own, no-longer-visible dialog.
|
|
90
94
|
onFocusIn(ev) {
|
|
91
|
-
if (this.open && this.dialogRef && !ev.composedPath().includes(this.dialogRef)) {
|
|
95
|
+
if (this.open && this.dialogRef?.isConnected && !ev.composedPath().includes(this.dialogRef)) {
|
|
92
96
|
this.dialogRef.focus();
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
99
|
componentDidRender() {
|
|
96
100
|
if (this.open && !this.wasOpen) {
|
|
97
101
|
this.previouslyFocused = document.activeElement;
|
|
98
|
-
|
|
102
|
+
// Deferred to the next frame -- calling .focus() synchronously here, in the same task as
|
|
103
|
+
// the dialog's shadow tree first connecting, silently fails (confirmed directly: the ref is
|
|
104
|
+
// valid, connected, and has tabindex="-1" at this exact point, yet the shadow root's
|
|
105
|
+
// activeElement stays null right after the call). This is a known class of browser quirk --
|
|
106
|
+
// focusing an element in the same synchronous pass as its own connection doesn't reliably
|
|
107
|
+
// take effect until the browser's finished the layout/connection work for it.
|
|
108
|
+
requestAnimationFrame(() => this.dialogRef?.focus());
|
|
99
109
|
// Locks the page behind the dialog from scrolling while it's open -- a fixed-position
|
|
100
110
|
// backdrop/dialog doesn't block scroll on its own, since scroll input still targets whatever
|
|
101
111
|
// element is under the pointer/has focus, not the topmost painted layer.
|
|
@@ -188,7 +198,7 @@ export class BsDialog {
|
|
|
188
198
|
"references": {
|
|
189
199
|
"BsDialogSize": {
|
|
190
200
|
"location": "local",
|
|
191
|
-
"path": "/
|
|
201
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-dialog/bs-dialog.tsx",
|
|
192
202
|
"id": "src/components/bs-dialog/bs-dialog.tsx::BsDialogSize"
|
|
193
203
|
}
|
|
194
204
|
}
|
|
@@ -341,10 +341,10 @@ export class BsInput {
|
|
|
341
341
|
return (h("div", { part: "field", class: `bs-input__field bs-input__field--pin ${errorClass} ${disabledClass}` }, Array.from({ length: this.length }).map((_, i) => (h("input", { id: i === 0 ? 'control' : undefined, ref: el => (this.pinInputs[i] = el), part: "control", class: "bs-input__pin-cell", type: "text", inputMode: "numeric", maxLength: 1, value: this.value[i] ?? '', disabled: this.disabled, "aria-required": this.required ? 'true' : undefined, onInput: this.onPinInput(i), onKeyDown: this.onPinKeydown(i) })))));
|
|
342
342
|
}
|
|
343
343
|
render() {
|
|
344
|
-
return (h("div", { key: '
|
|
344
|
+
return (h("div", { key: '10554d997d7c52834c033e68f1b0b30e823844d6', class: `bs-input ${this.error ? 'bs-input--error' : ''}` }, this.label && (
|
|
345
345
|
// "control" is a fixed id, not a generated one -- safe because Shadow DOM scopes ids
|
|
346
346
|
// to this instance's own shadow root, so it can never collide with another bs-input.
|
|
347
|
-
h("label", { key: '
|
|
347
|
+
h("label", { key: 'd5819ef4b34973a510dc7582e32baae4a6da4119', part: "label", class: "bs-input__label", htmlFor: "control" }, this.label, this.required && (h("span", { key: '6c066e8c528133288be0f050f8e7ca5527561cba', part: "required", class: "bs-input__required", "aria-hidden": "true" }, "*")))), this.type === 'pin' ? this.renderPinField() : this.type === 'initials' ? this.renderInitialsField() : this.renderField(), this.error ? (h("span", { id: "description-or-error", part: "error", class: "bs-input__error" }, h("svg", { part: "error-icon", class: "bs-input__error-icon", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, h("circle", { cx: "8", cy: "8", r: "6.5", stroke: "currentColor", "stroke-width": "1.2" }), h("path", { d: "M8 5V8.5", stroke: "currentColor", "stroke-width": "1.2", "stroke-linecap": "round" }), h("circle", { cx: "8", cy: "11", r: "0.75", fill: "currentColor" })), this.error)) : this.description ? (h("span", { id: "description-or-error", part: "description", class: "bs-input__description" }, this.description)) : null));
|
|
348
348
|
}
|
|
349
349
|
static get is() { return "bs-input"; }
|
|
350
350
|
static get encapsulation() { return "shadow"; }
|
|
@@ -105,7 +105,7 @@ export class BsLogo {
|
|
|
105
105
|
"references": {
|
|
106
106
|
"BsLogoVariant": {
|
|
107
107
|
"location": "local",
|
|
108
|
-
"path": "/
|
|
108
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-logo/bs-logo.tsx",
|
|
109
109
|
"id": "src/components/bs-logo/bs-logo.tsx::BsLogoVariant"
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -131,7 +131,7 @@ export class BsLogo {
|
|
|
131
131
|
"references": {
|
|
132
132
|
"BsLogoBackground": {
|
|
133
133
|
"location": "local",
|
|
134
|
-
"path": "/
|
|
134
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-logo/bs-logo.tsx",
|
|
135
135
|
"id": "src/components/bs-logo/bs-logo.tsx::BsLogoBackground"
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -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: '23a5c16e982c711bfa9f8e914869601be45812b9', part: "list", class: "bs-menu", role: "menu" }, h("slot", { key: 'a7d9116f56d91721231b3f94e727626c6c221aa8' })));
|
|
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: 'f328aa848cc8ae0c908640a23834f3fd8d8ffea7', 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: '75a23a3ee9a9896e2607222b18155651d6ada39f', part: "icon", class: `bs-menu-item__icon ${this.hasIcon ? 'bs-menu-item__icon--has-content' : ''}` }, h("slot", { key: '08d468b52d6913d89f2443e8597a44bfacc4f2ea', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '148053d9ff48297dfa276ddbf46f57c13675a5c4', part: "label", class: "bs-menu-item__label" }, h("slot", { key: '05d417308229673796e014788f25de2b4c2d4eaf' }))));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "bs-menu-item"; }
|
|
53
53
|
static get encapsulation() { return "shadow"; }
|
|
@@ -87,7 +87,7 @@ export class BsPagination {
|
|
|
87
87
|
}
|
|
88
88
|
render() {
|
|
89
89
|
const pageList = this.getPageList();
|
|
90
|
-
return (h("nav", { key: '
|
|
90
|
+
return (h("nav", { key: '1a60cd70c34f8d1f8f2d3a8aa62f99d4d38ab462', "aria-label": "Pagination" }, h("ul", { key: '42381f91ef2ebff6c4cc1a9c4ffb28a993931c43', part: "list", class: "bs-pagination__list" }, h("li", { key: '655ad21a3198ea47f85d6dbfa09df9fb05d09e4f', part: "item", class: "bs-pagination__item" }, h("button", { key: '8342d94ae7f7164445a09356acee9ce4d0cb6d1b', part: "prev", type: "button", class: "bs-pagination__control", "aria-label": this.previousLabel, disabled: this.currentPage <= 1, onClick: () => this.goToPage(this.currentPage - 1) }, h(ChevronLeftIcon, { key: '8f7b7a32551781a04c5525dedbeeae586453bb7f' }))), pageList.map((item, index) => item === 'ellipsis' ? (h("li", { part: "item", class: "bs-pagination__item", key: `ellipsis-${index}` }, h("span", { part: "ellipsis", class: "bs-pagination__ellipsis", "aria-hidden": "true" }, h(EllipsisIcon, null)))) : (h("li", { part: "item", class: "bs-pagination__item", key: item }, h("button", { part: item === this.currentPage ? 'page current' : 'page', type: "button", class: `bs-pagination__control bs-pagination__page ${item === this.currentPage ? 'bs-pagination__page--current' : ''}`, "aria-label": `Go to page ${item}`, "aria-current": item === this.currentPage ? 'page' : undefined, onClick: () => this.goToPage(item) }, item)))), h("li", { key: '0a7d4a39c332130e865a16d7f3751db44ea777bb', part: "item", class: "bs-pagination__item" }, h("button", { key: 'e3b5276ca79d150bd8fe89f86973a9fb3458c481', part: "next", type: "button", class: "bs-pagination__control", "aria-label": this.nextLabel, disabled: this.currentPage >= this.safeTotalPages, onClick: () => this.goToPage(this.currentPage + 1) }, h(ChevronRightIcon, { key: 'fe89db6f4c5bbd4fdaa3ee499b448c8603a7f132' }))))));
|
|
91
91
|
}
|
|
92
92
|
static get is() { return "bs-pagination"; }
|
|
93
93
|
static get encapsulation() { return "shadow"; }
|
|
@@ -51,7 +51,7 @@ export class BsRadio {
|
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
render() {
|
|
54
|
-
return (h("label", { key: '
|
|
54
|
+
return (h("label", { key: '349589d9d20270aedcbd67d528057b9b0c41c486', class: `bs-radio ${this.disabled ? 'bs-radio--disabled' : ''}` }, h("input", { key: '36da81bb4a82a78cd1e49ca2d27b4837e6077bd9', class: "bs-radio__input", type: "radio", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, onChange: this.onChange }), h("span", { key: '1f5e0d0a2c49875b63b70bf1618f1c374d7f5dae', class: "bs-radio__hit-area" }, h("span", { key: '63f4e1e619aa3faca1cda08ad878f23b83836d0c', class: "bs-radio__state-layer" }, h("span", { key: '5487d7782497766e8d3c1261c035214055b4ecf3', part: "circle", class: `bs-radio__circle ${this.checked ? 'bs-radio__circle--selected' : ''}` }, this.checked && h("span", { key: '6a8cd123cf6588c8e18c5841176556bf8f22b1bb', part: "dot", class: "bs-radio__dot" })))), h("span", { key: 'b21075cb92382cbdcb3d11404b5db27ac5823308', part: "label", class: "bs-radio__label" }, h("slot", { key: '8ca2bb29e32c2f0d52832b42643c0efd7cc89e9a' }))));
|
|
55
55
|
}
|
|
56
56
|
static get is() { return "bs-radio"; }
|
|
57
57
|
static get encapsulation() { return "shadow"; }
|
|
@@ -199,7 +199,7 @@ export class BsSlider {
|
|
|
199
199
|
render() {
|
|
200
200
|
const isRange = this.type === 'range';
|
|
201
201
|
const rootClasses = ['bs-slider', this.disabled ? 'bs-slider--disabled' : ''].filter(Boolean).join(' ');
|
|
202
|
-
return (h("div", { key: '
|
|
202
|
+
return (h("div", { key: 'e4647158959bb507711a1d9872e68f64d5f7bd34', class: rootClasses }, this.showLabel && (h("div", { key: 'eb5d67b8717cc627b63a17f85471e757d35cec85', class: "bs-slider__header" }, h("span", { key: '48f6184206774111a5beb1869857020d7008f013', id: "bs-slider-label", part: "label", class: "bs-slider__label" }, this.label), isRange ? (h("span", { class: "bs-slider__value-fields" }, this.renderPercentField(this.percent(this.effectiveValueStart), this.onStartPercentFieldChange, this.ariaLabel ?? 'Start value'), h("span", { class: "bs-slider__separator" }, "\u2013"), this.renderPercentField(this.percent(this.effectiveValueEnd), this.onEndPercentFieldChange, this.ariaLabel ? `${this.ariaLabel} end` : 'End value'))) : (this.renderPercentField(this.percent(this.value), this.onPercentFieldChange, this.ariaLabel ? `${this.ariaLabel} value` : 'Value')))), h("div", { key: '1ee4796e51f2d29b1b5bad812d81f037d1d2d29f', class: "bs-slider__row" }, this.showLabel && (h("span", { key: '4bfdfd86f9c5ae5c2f8ca08c0758be9fce483056', part: "bound", class: "bs-slider__bound" }, this.min)), isRange ? this.renderRangeThumbs() : this.renderSingleThumb(), this.showLabel && (h("span", { key: '06ee3063570c858bcdf49960b9021a301e56288e', part: "bound", class: "bs-slider__bound" }, this.max)))));
|
|
203
203
|
}
|
|
204
204
|
static get is() { return "bs-slider"; }
|
|
205
205
|
static get encapsulation() { return "shadow"; }
|
|
@@ -225,7 +225,7 @@ export class BsSlider {
|
|
|
225
225
|
"references": {
|
|
226
226
|
"BsSliderType": {
|
|
227
227
|
"location": "local",
|
|
228
|
-
"path": "/
|
|
228
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-slider/bs-slider.tsx",
|
|
229
229
|
"id": "src/components/bs-slider/bs-slider.tsx::BsSliderType"
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -51,7 +51,7 @@ export class BsSnackbar {
|
|
|
51
51
|
this.bsDismiss.emit();
|
|
52
52
|
};
|
|
53
53
|
render() {
|
|
54
|
-
return (h("div", { key: '
|
|
54
|
+
return (h("div", { key: '3dc0997bd057ef72d7322d28ad5c561fb5e24730', part: "container", class: `bs-snackbar bs-snackbar--${this.variant}`, role: "status", "aria-live": this.variant === 'error' ? 'assertive' : 'polite' }, h("div", { key: '3b77e4ac957cd73368883afbb7b47fb5cc46966b', class: "bs-snackbar__content" }, h("span", { key: '45a8c01714b0a3bec9ffcc470a83959a1d9f0539', part: "icon", class: "bs-snackbar__icon", "aria-hidden": "true" }, this.loading ? h("span", { class: "bs-snackbar__spinner" }) : h(CheckCircleIcon, null)), h("span", { key: '6738316060e8da63c45ceda8ec2a2fce0dbcbc24', part: "message", class: "bs-snackbar__message" }, h("slot", { key: 'f88fe59ad8c970a222b2349a86df8c9ccb2836ab' }))), h("div", { key: '171fa694e2faccca014bb75234958cd458b17fe7', class: "bs-snackbar__actions" }, this.actionLabel && (h("button", { key: '2f529c556bbc9b6d01fddb23b434a6e381f38529', part: "action", type: "button", class: "bs-snackbar__action", onClick: this.onAction }, this.actionLabel)), h("button", { key: '1f45a977afdd80ee603e122fe8ac36b8161d6ee3', part: "close", type: "button", class: "bs-snackbar__close", "aria-label": "Dismiss", onClick: this.onDismiss }, h(CloseIcon, { key: 'f16229c70fdbd0329e4a91fe7fbbf58e43e7870f' })))));
|
|
55
55
|
}
|
|
56
56
|
static get is() { return "bs-snackbar"; }
|
|
57
57
|
static get encapsulation() { return "shadow"; }
|
|
@@ -76,7 +76,7 @@ export class BsSnackbar {
|
|
|
76
76
|
"references": {
|
|
77
77
|
"BsSnackbarVariant": {
|
|
78
78
|
"location": "local",
|
|
79
|
-
"path": "/
|
|
79
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-snackbar/bs-snackbar.tsx",
|
|
80
80
|
"id": "src/components/bs-snackbar/bs-snackbar.tsx::BsSnackbarVariant"
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -51,8 +51,8 @@ export class BsSourceLink {
|
|
|
51
51
|
};
|
|
52
52
|
render() {
|
|
53
53
|
const inner = [
|
|
54
|
-
h("span", { key: '
|
|
55
|
-
h("span", { key: '
|
|
54
|
+
h("span", { key: 'f439433f45bc81b4c515903661311431d99637cd', class: "bs-source-link__left" }, h("span", { key: '4ede9ae3793da7453679723866a519e73ee963aa', class: "bs-source-link__filename-row" }, h("span", { key: '6b4b95fde466988248d34d27705df76acce5927a', part: "icon", class: "bs-source-link__icon" }, h("slot", { key: '24cf2dcc3d04fb2d6e543d1e8bae0e96d0df2d14', name: "icon" }, h(FileTextIcon, { key: 'f04e008075912dfac619c1a2e676346bc7d226d5' }))), h("p", { key: '16b2120d5391930dfc239cb5dd18c40de0cb7aa0', part: "filename", class: "bs-source-link__filename" }, this.fileName)), h("span", { key: 'ec10ed741f33eba57624e0840253f96851f1481a', class: "bs-source-link__meta" }, this.sourceName && (h("span", { key: '56d4a784e30ceff1568bb393d4c3b368f81a0f3e', part: "source", class: "bs-source-link__source" }, this.sourceName)), this.sourceName && this.version && h("span", { key: '95db8a3be1c61741e7d30229c642fea7d321b6b0', class: "bs-source-link__dot", "aria-hidden": "true" }), this.version && (h("span", { key: '4f8caac5193d8671811f9972654ab049f23bac49', part: "version", class: "bs-source-link__version" }, this.version)))),
|
|
55
|
+
h("span", { key: '6009485aa7f7d802a82195c50374693f66782737', part: "arrow", class: "bs-source-link__arrow", "aria-hidden": "true" }, h(ArrowUpRightIcon, { key: '1032169a5bfb02f9fbf1d7a5d5d255f313e1da29' })),
|
|
56
56
|
];
|
|
57
57
|
return this.href ? (h("a", { class: "bs-source-link", href: this.href, target: this.target, rel: "noopener noreferrer", onClick: this.onClick }, inner)) : (h("button", { type: "button", class: "bs-source-link", onClick: this.onClick }, inner));
|
|
58
58
|
}
|