@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,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @prop --bs-chip-filter-height-md: Height at size="md". Aliased to --bs-spacing-300.
|
|
3
|
+
* @prop --bs-chip-filter-height-lg: Height at size="lg". Aliased to --bs-spacing-400.
|
|
4
|
+
* @prop --bs-chip-filter-gap: Gap between icon/label/caret. Aliased to --bs-spacing-50.
|
|
5
|
+
* @prop --bs-chip-filter-icon-size: Icon/caret glyph size. 16px, matching Figma exactly --
|
|
6
|
+
* constant across both sizes, only the chip's own height changes.
|
|
7
|
+
* @prop --bs-chip-filter-padding-x-glyph-side: Horizontal padding on an edge adjacent to the icon
|
|
8
|
+
* or the caret. Aliased to --bs-spacing-100.
|
|
9
|
+
* @prop --bs-chip-filter-padding-x-plain-side: Horizontal padding on a label-only edge, when the
|
|
10
|
+
* opposite edge has a glyph. Aliased to --bs-spacing-150.
|
|
11
|
+
* @prop --bs-chip-filter-padding-x-text-only: Horizontal padding on both edges, when neither has
|
|
12
|
+
* a glyph. Aliased to --bs-spacing-200 -- deliberately not the same as
|
|
13
|
+
* --bs-chip-filter-padding-x-plain-side; verified against Figma that a plain-text chip (no icon,
|
|
14
|
+
* no dropdown) uses a bigger value on both sides rather than the smaller one-sided compensating
|
|
15
|
+
* value used when only one edge lacks a glyph.
|
|
16
|
+
* @prop --bs-chip-filter-font-size: Aliased to --bs-font-size-sm.
|
|
17
|
+
* @prop --bs-chip-filter-line-height: Aliased to --bs-line-height-body-sm.
|
|
18
|
+
* @prop --bs-chip-filter-font-weight: Aliased to --bs-font-weight-regular.
|
|
19
|
+
*
|
|
20
|
+
* Color (background/text per selected/hover/focus/pressed/disabled state) comes directly from
|
|
21
|
+
* brandsync-tokens' own pre-built chip token set (--bs-chip-bg-..., --bs-chip-text-...,
|
|
22
|
+
* --bs-chip-border-...) below -- those are shared across the whole bs-chip family, not local to
|
|
23
|
+
* this component, so they're consumed directly rather than re-aliased under a
|
|
24
|
+
* bs-chip-filter-specific name.
|
|
25
|
+
*/
|
|
26
|
+
:host {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
|
|
29
|
+
--bs-chip-filter-height-md: var(--bs-spacing-300);
|
|
30
|
+
--bs-chip-filter-height-lg: var(--bs-spacing-400);
|
|
31
|
+
--bs-chip-filter-gap: var(--bs-spacing-50);
|
|
32
|
+
--bs-chip-filter-icon-size: 16px;
|
|
33
|
+
--bs-chip-filter-padding-x-glyph-side: var(--bs-spacing-100);
|
|
34
|
+
--bs-chip-filter-padding-x-plain-side: var(--bs-spacing-150);
|
|
35
|
+
--bs-chip-filter-padding-x-text-only: var(--bs-spacing-200);
|
|
36
|
+
--bs-chip-filter-font-size: var(--bs-font-size-sm);
|
|
37
|
+
--bs-chip-filter-line-height: var(--bs-line-height-body-sm);
|
|
38
|
+
--bs-chip-filter-font-weight: var(--bs-font-weight-regular);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bs-chip-filter {
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
gap: var(--bs-chip-filter-gap);
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
border: none;
|
|
47
|
+
border-radius: var(--bs-border-radius-full);
|
|
48
|
+
font-family: inherit;
|
|
49
|
+
font-size: var(--bs-chip-filter-font-size);
|
|
50
|
+
font-weight: var(--bs-chip-filter-font-weight);
|
|
51
|
+
line-height: calc(var(--bs-chip-filter-line-height) * 1px);
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
background: var(--bs-chip-bg-primary-container);
|
|
55
|
+
color: var(--bs-chip-text-primary);
|
|
56
|
+
transition: background-color var(--bs-duration-fast, 120ms) var(--bs-easing-standard, ease);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.bs-chip-filter--md {
|
|
60
|
+
height: var(--bs-chip-filter-height-md);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.bs-chip-filter--lg {
|
|
64
|
+
height: var(--bs-chip-filter-height-lg);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.bs-chip-filter--icon-dropdown {
|
|
68
|
+
padding: 0 var(--bs-chip-filter-padding-x-glyph-side);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.bs-chip-filter--icon-only {
|
|
72
|
+
padding-left: var(--bs-chip-filter-padding-x-glyph-side);
|
|
73
|
+
padding-right: var(--bs-chip-filter-padding-x-plain-side);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.bs-chip-filter--dropdown-only {
|
|
77
|
+
padding-left: var(--bs-chip-filter-padding-x-plain-side);
|
|
78
|
+
padding-right: var(--bs-chip-filter-padding-x-glyph-side);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.bs-chip-filter--text-only {
|
|
82
|
+
padding: 0 var(--bs-chip-filter-padding-x-text-only);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.bs-chip-filter__icon {
|
|
86
|
+
display: none;
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
width: var(--bs-chip-filter-icon-size);
|
|
89
|
+
height: var(--bs-chip-filter-icon-size);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.bs-chip-filter__icon--visible {
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.bs-chip-filter__icon ::slotted(*) {
|
|
99
|
+
display: block;
|
|
100
|
+
width: var(--bs-chip-filter-icon-size);
|
|
101
|
+
height: var(--bs-chip-filter-icon-size);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.bs-chip-filter__label {
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.bs-chip-filter__caret {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
width: var(--bs-chip-filter-icon-size);
|
|
115
|
+
height: var(--bs-chip-filter-icon-size);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Unselected (default): the light "container" background set. */
|
|
119
|
+
.bs-chip-filter:hover:not(:disabled) {
|
|
120
|
+
background: var(--bs-chip-bg-primary-container-hover);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.bs-chip-filter:active:not(:disabled) {
|
|
124
|
+
background: var(--bs-chip-bg-primary-container-pressed);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.bs-chip-filter:focus-visible {
|
|
128
|
+
background: var(--bs-chip-bg-primary-container-focused);
|
|
129
|
+
outline: 2px solid var(--bs-chip-border-focus);
|
|
130
|
+
outline-offset: 2px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Selected: the dark "primary" background set, inverse (white) text -- swaps every state above
|
|
134
|
+
to its --primary-* (not --primary-container-*) counterpart. */
|
|
135
|
+
.bs-chip-filter--selected {
|
|
136
|
+
background: var(--bs-chip-bg-primary);
|
|
137
|
+
color: var(--bs-chip-text-inverse);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.bs-chip-filter--selected:hover:not(:disabled) {
|
|
141
|
+
background: var(--bs-chip-bg-primary-hover);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.bs-chip-filter--selected:active:not(:disabled) {
|
|
145
|
+
background: var(--bs-chip-bg-primary-pressed);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.bs-chip-filter--selected:focus-visible {
|
|
149
|
+
background: var(--bs-chip-bg-primary-focused);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.bs-chip-filter:disabled {
|
|
153
|
+
background: var(--bs-chip-bg-disabled);
|
|
154
|
+
color: var(--bs-chip-text-disabled);
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A pill-shaped, selectable toggle used to filter a list or dataset (e.g. a "Filter chip" row
|
|
4
|
+
* above a table or search results), optionally paired with a leading icon and/or a dropdown caret
|
|
5
|
+
* that signals it opens a menu of further options.
|
|
6
|
+
*
|
|
7
|
+
* ## When to use
|
|
8
|
+
* - Letting a user toggle a filter on/off, or open a menu of filter options (pair `dropdown` with
|
|
9
|
+
* your own `bs-menu` -- this component only renders the caret affordance, it doesn't manage a
|
|
10
|
+
* menu itself).
|
|
11
|
+
*
|
|
12
|
+
* ## When not to use
|
|
13
|
+
* - A static, non-interactive status/category label -- use `bs-badge` instead.
|
|
14
|
+
* - A single primary action -- use `bs-button`.
|
|
15
|
+
*
|
|
16
|
+
* @slot - Default slot: the chip's label content.
|
|
17
|
+
* @slot icon - Optional leading icon, rendered before the label.
|
|
18
|
+
* @part icon - The icon wrapper element.
|
|
19
|
+
* @part label - The text label element.
|
|
20
|
+
* @part caret - The dropdown caret wrapper element, when `dropdown` is set.
|
|
21
|
+
*/
|
|
22
|
+
export class BsChipFilter {
|
|
23
|
+
el;
|
|
24
|
+
/** Sizing scale. Controls the chip's height only -- icon size, gap, and font size stay
|
|
25
|
+
* constant across sizes, matching the Figma spec exactly. */
|
|
26
|
+
size = 'lg';
|
|
27
|
+
/** Whether the chip reads as toggled on. Mutable so clicking it toggles directly, and
|
|
28
|
+
* reflected so consumers can target `bs-chip-filter[selected]` via CSS. */
|
|
29
|
+
selected = false;
|
|
30
|
+
/** Shows a trailing dropdown caret, signaling this chip opens a menu of further options.
|
|
31
|
+
* Purely a visual affordance -- wire up the actual menu (e.g. `bs-menu`) yourself. */
|
|
32
|
+
dropdown = false;
|
|
33
|
+
/** Disables the chip: sets the native `disabled` attribute, suppresses hover/focus/pressed
|
|
34
|
+
* styling, and prevents toggling. */
|
|
35
|
+
disabled = false;
|
|
36
|
+
/**
|
|
37
|
+
* Accessible name override. The visible label (default slot) already gives the native button
|
|
38
|
+
* an accessible name, so this is only needed if that text isn't sufficient on its own (e.g. it
|
|
39
|
+
* doesn't convey that activating the chip toggles a filter).
|
|
40
|
+
*/
|
|
41
|
+
ariaLabel = null;
|
|
42
|
+
/** Tracks whether the `icon` slot has assigned content, so the icon/label gap only applies
|
|
43
|
+
* when there's actually a leading icon. */
|
|
44
|
+
hasIcon = false;
|
|
45
|
+
/** Emitted when `selected` changes via user interaction, with the new value. */
|
|
46
|
+
bsChange;
|
|
47
|
+
/** Same reasoning as bs-button's identical method: computes the initial state directly from
|
|
48
|
+
* the host's light DOM children, since a slot that starts (and stays) empty never fires
|
|
49
|
+
* `slotchange`. */
|
|
50
|
+
componentWillLoad() {
|
|
51
|
+
this.hasIcon = this.hasSlottedContent('icon');
|
|
52
|
+
}
|
|
53
|
+
hasSlottedContent(slotName) {
|
|
54
|
+
return Array.from(this.el.childNodes).some(node => node.nodeType === Node.ELEMENT_NODE && node.getAttribute('slot') === slotName);
|
|
55
|
+
}
|
|
56
|
+
onIconSlotchange = (ev) => {
|
|
57
|
+
this.hasIcon = ev.target.assignedNodes().length > 0;
|
|
58
|
+
};
|
|
59
|
+
onClick = () => {
|
|
60
|
+
this.selected = !this.selected;
|
|
61
|
+
this.bsChange.emit(this.selected);
|
|
62
|
+
};
|
|
63
|
+
render() {
|
|
64
|
+
// Matches the four Icon x Dropdown combinations verified against Figma (node 1905:9151):
|
|
65
|
+
// whichever edge is adjacent to a glyph (icon and/or caret) gets tighter padding, and a
|
|
66
|
+
// label-only edge gets more -- except when NEITHER edge has a glyph, where both edges use a
|
|
67
|
+
// third, larger value rather than the label-only one (see bs-chip-filter.css's own comment).
|
|
68
|
+
const paddingVariant = this.hasIcon && this.dropdown ? 'icon-dropdown' : this.hasIcon ? 'icon-only' : this.dropdown ? 'dropdown-only' : 'text-only';
|
|
69
|
+
return (h("button", { key: 'c585746cca27a4d60d2a0c242e26e19ba8b41677', type: "button", class: `bs-chip-filter bs-chip-filter--${this.size} bs-chip-filter--${paddingVariant} ${this.selected ? 'bs-chip-filter--selected' : ''}`, disabled: this.disabled, "aria-pressed": String(this.selected), "aria-label": this.ariaLabel, onClick: this.onClick }, h("span", { key: 'f62eda39d506b130e5cfe0881bfa80dd0241e1cf', part: "icon", class: `bs-chip-filter__icon ${this.hasIcon ? 'bs-chip-filter__icon--visible' : ''}` }, h("slot", { key: '233f80cba2500aa4fed6e1ccdb6d19f14fb64384', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '74d101de8d1dd20bda1fbc789733282ae1a3784a', part: "label", class: "bs-chip-filter__label" }, h("slot", { key: '15db7eea134a9d3eac56a159c920141daed4e467' })), this.dropdown && (h("span", { key: 'e070c37932fa4bdc4f494472f361870e2f3d6b22', part: "caret", class: "bs-chip-filter__caret", "aria-hidden": "true" }, h(ChevronDownIcon, { key: '642401f2ddc833731875cfdd3b7d5d96f2272167' })))));
|
|
70
|
+
}
|
|
71
|
+
static get is() { return "bs-chip-filter"; }
|
|
72
|
+
static get encapsulation() { return "shadow"; }
|
|
73
|
+
static get delegatesFocus() { return true; }
|
|
74
|
+
static get originalStyleUrls() {
|
|
75
|
+
return {
|
|
76
|
+
"$": ["bs-chip-filter.css"]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
static get styleUrls() {
|
|
80
|
+
return {
|
|
81
|
+
"$": ["bs-chip-filter.css"]
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
static get properties() {
|
|
85
|
+
return {
|
|
86
|
+
"size": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"mutable": false,
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "BsChipFilterSize",
|
|
91
|
+
"resolved": "\"lg\" | \"md\"",
|
|
92
|
+
"references": {
|
|
93
|
+
"BsChipFilterSize": {
|
|
94
|
+
"location": "local",
|
|
95
|
+
"path": "/home/runner/work/Brandsync-web-components/Brandsync-web-components/packages/wc/src/components/bs-chip/bs-chip-filter/bs-chip-filter.tsx",
|
|
96
|
+
"id": "src/components/bs-chip/bs-chip-filter/bs-chip-filter.tsx::BsChipFilterSize"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": "Sizing scale. Controls the chip's height only -- icon size, gap, and font size stay\nconstant across sizes, matching the Figma spec exactly."
|
|
105
|
+
},
|
|
106
|
+
"getter": false,
|
|
107
|
+
"setter": false,
|
|
108
|
+
"reflect": false,
|
|
109
|
+
"attribute": "size",
|
|
110
|
+
"defaultValue": "'lg'"
|
|
111
|
+
},
|
|
112
|
+
"selected": {
|
|
113
|
+
"type": "boolean",
|
|
114
|
+
"mutable": true,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "boolean",
|
|
117
|
+
"resolved": "boolean",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "Whether the chip reads as toggled on. Mutable so clicking it toggles directly, and\nreflected so consumers can target `bs-chip-filter[selected]` via CSS."
|
|
125
|
+
},
|
|
126
|
+
"getter": false,
|
|
127
|
+
"setter": false,
|
|
128
|
+
"reflect": true,
|
|
129
|
+
"attribute": "selected",
|
|
130
|
+
"defaultValue": "false"
|
|
131
|
+
},
|
|
132
|
+
"dropdown": {
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"mutable": false,
|
|
135
|
+
"complexType": {
|
|
136
|
+
"original": "boolean",
|
|
137
|
+
"resolved": "boolean",
|
|
138
|
+
"references": {}
|
|
139
|
+
},
|
|
140
|
+
"required": false,
|
|
141
|
+
"optional": false,
|
|
142
|
+
"docs": {
|
|
143
|
+
"tags": [],
|
|
144
|
+
"text": "Shows a trailing dropdown caret, signaling this chip opens a menu of further options.\nPurely a visual affordance -- wire up the actual menu (e.g. `bs-menu`) yourself."
|
|
145
|
+
},
|
|
146
|
+
"getter": false,
|
|
147
|
+
"setter": false,
|
|
148
|
+
"reflect": false,
|
|
149
|
+
"attribute": "dropdown",
|
|
150
|
+
"defaultValue": "false"
|
|
151
|
+
},
|
|
152
|
+
"disabled": {
|
|
153
|
+
"type": "boolean",
|
|
154
|
+
"mutable": false,
|
|
155
|
+
"complexType": {
|
|
156
|
+
"original": "boolean",
|
|
157
|
+
"resolved": "boolean",
|
|
158
|
+
"references": {}
|
|
159
|
+
},
|
|
160
|
+
"required": false,
|
|
161
|
+
"optional": false,
|
|
162
|
+
"docs": {
|
|
163
|
+
"tags": [],
|
|
164
|
+
"text": "Disables the chip: sets the native `disabled` attribute, suppresses hover/focus/pressed\nstyling, and prevents toggling."
|
|
165
|
+
},
|
|
166
|
+
"getter": false,
|
|
167
|
+
"setter": false,
|
|
168
|
+
"reflect": false,
|
|
169
|
+
"attribute": "disabled",
|
|
170
|
+
"defaultValue": "false"
|
|
171
|
+
},
|
|
172
|
+
"ariaLabel": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"mutable": false,
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "string | null",
|
|
177
|
+
"resolved": "string",
|
|
178
|
+
"references": {}
|
|
179
|
+
},
|
|
180
|
+
"required": false,
|
|
181
|
+
"optional": false,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": "Accessible name override. The visible label (default slot) already gives the native button\nan accessible name, so this is only needed if that text isn't sufficient on its own (e.g. it\ndoesn't convey that activating the chip toggles a filter)."
|
|
185
|
+
},
|
|
186
|
+
"getter": false,
|
|
187
|
+
"setter": false,
|
|
188
|
+
"reflect": false,
|
|
189
|
+
"attribute": "aria-label",
|
|
190
|
+
"defaultValue": "null"
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
static get states() {
|
|
195
|
+
return {
|
|
196
|
+
"hasIcon": {}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
static get events() {
|
|
200
|
+
return [{
|
|
201
|
+
"method": "bsChange",
|
|
202
|
+
"name": "bsChange",
|
|
203
|
+
"bubbles": true,
|
|
204
|
+
"cancelable": true,
|
|
205
|
+
"composed": true,
|
|
206
|
+
"docs": {
|
|
207
|
+
"tags": [],
|
|
208
|
+
"text": "Emitted when `selected` changes via user interaction, with the new value."
|
|
209
|
+
},
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "boolean",
|
|
212
|
+
"resolved": "boolean",
|
|
213
|
+
"references": {}
|
|
214
|
+
}
|
|
215
|
+
}];
|
|
216
|
+
}
|
|
217
|
+
static get elementRef() { return "el"; }
|
|
218
|
+
}
|
|
219
|
+
// Same icon already established for this exact "expand/collapse" affordance in
|
|
220
|
+
// bs-navigation-drawer-item -- reused verbatim rather than pulling in Figma's own CaretDown
|
|
221
|
+
// asset, per this library's existing icon for this purpose.
|
|
222
|
+
const ChevronDownIcon = () => (h("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M4 6L8 10L12 6", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { componentDescription, propDescription } from "../../../stories-utils";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Components/bs-chip/bs-chip-filter',
|
|
5
|
+
parameters: { docs: { description: { component: componentDescription('bs-chip-filter') } } },
|
|
6
|
+
render: args => html `
|
|
7
|
+
<bs-chip-filter size=${args.size} ?selected=${args.selected} ?dropdown=${args.dropdown} ?disabled=${args.disabled}>${args.label}</bs-chip-filter>
|
|
8
|
+
`,
|
|
9
|
+
argTypes: {
|
|
10
|
+
size: { control: { type: 'select' }, options: ['md', 'lg'], description: propDescription('bs-chip-filter', 'size') },
|
|
11
|
+
selected: { control: 'boolean', description: propDescription('bs-chip-filter', 'selected') },
|
|
12
|
+
dropdown: { control: 'boolean', description: propDescription('bs-chip-filter', 'dropdown') },
|
|
13
|
+
disabled: { control: 'boolean', description: propDescription('bs-chip-filter', 'disabled') },
|
|
14
|
+
label: { control: 'text', description: 'Slotted label content (not a real attribute -- see the default slot).' },
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
size: 'lg',
|
|
18
|
+
selected: false,
|
|
19
|
+
dropdown: false,
|
|
20
|
+
disabled: false,
|
|
21
|
+
label: 'Label',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export default meta;
|
|
25
|
+
export const Default = {};
|
|
26
|
+
export const Selected = {
|
|
27
|
+
args: { selected: true },
|
|
28
|
+
};
|
|
29
|
+
export const WithDropdown = {
|
|
30
|
+
name: 'With dropdown caret',
|
|
31
|
+
args: { dropdown: true },
|
|
32
|
+
};
|
|
33
|
+
export const WithIcon = {
|
|
34
|
+
name: 'With icon',
|
|
35
|
+
render: args => html `
|
|
36
|
+
<bs-chip-filter size=${args.size} ?selected=${args.selected} ?dropdown=${args.dropdown} ?disabled=${args.disabled}>
|
|
37
|
+
<svg slot="icon" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
38
|
+
<rect x="3" y="2" width="10" height="12" rx="1.5" stroke="currentColor" stroke-width="1.5" />
|
|
39
|
+
<path d="M7 12H9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
40
|
+
</svg>
|
|
41
|
+
${args.label}
|
|
42
|
+
</bs-chip-filter>
|
|
43
|
+
`,
|
|
44
|
+
};
|
|
45
|
+
export const WithIconAndDropdown = {
|
|
46
|
+
name: 'With icon and dropdown caret',
|
|
47
|
+
args: { dropdown: true },
|
|
48
|
+
render: args => html `
|
|
49
|
+
<bs-chip-filter size=${args.size} ?selected=${args.selected} ?dropdown=${args.dropdown} ?disabled=${args.disabled}>
|
|
50
|
+
<svg slot="icon" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
51
|
+
<rect x="3" y="2" width="10" height="12" rx="1.5" stroke="currentColor" stroke-width="1.5" />
|
|
52
|
+
<path d="M7 12H9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
53
|
+
</svg>
|
|
54
|
+
${args.label}
|
|
55
|
+
</bs-chip-filter>
|
|
56
|
+
`,
|
|
57
|
+
};
|
|
58
|
+
export const Disabled = {
|
|
59
|
+
args: { disabled: true },
|
|
60
|
+
};
|
|
61
|
+
export const Medium = {
|
|
62
|
+
args: { size: 'md' },
|
|
63
|
+
};
|
|
64
|
+
export const AllVariants = {
|
|
65
|
+
name: 'All variants',
|
|
66
|
+
render: () => html `
|
|
67
|
+
<div style="display:flex; gap:12px; flex-wrap:wrap; align-items:center;">
|
|
68
|
+
<bs-chip-filter>Label</bs-chip-filter>
|
|
69
|
+
<bs-chip-filter selected>Label</bs-chip-filter>
|
|
70
|
+
<bs-chip-filter dropdown>Label</bs-chip-filter>
|
|
71
|
+
<bs-chip-filter selected dropdown>Label</bs-chip-filter>
|
|
72
|
+
<bs-chip-filter disabled>Label</bs-chip-filter>
|
|
73
|
+
<bs-chip-filter size="md">Label</bs-chip-filter>
|
|
74
|
+
</div>
|
|
75
|
+
`,
|
|
76
|
+
};
|
package/dist/collection/components/bs-chip/bs-chip-informative/bs-chip-informative.cmp.test.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
2
|
+
describe('bs-chip-informative', () => {
|
|
3
|
+
it('defaults to color="neutral" and size="lg"', async () => {
|
|
4
|
+
const { root } = await render(h("bs-chip-informative", null, "Label"));
|
|
5
|
+
expect(root).toHaveClass('bs-chip-informative--neutral');
|
|
6
|
+
expect(root).toHaveClass('bs-chip-informative--lg');
|
|
7
|
+
});
|
|
8
|
+
['neutral', 'warning', 'success', 'info', 'error'].forEach(color => {
|
|
9
|
+
it(`renders color="${color}" with the matching modifier class`, async () => {
|
|
10
|
+
const { root } = await render(h("bs-chip-informative", { color: color }, "Label"));
|
|
11
|
+
expect(root).toHaveClass(`bs-chip-informative--${color}`);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
['sm', 'md', 'lg'].forEach(size => {
|
|
15
|
+
it(`renders size="${size}" with the matching modifier class`, async () => {
|
|
16
|
+
const { root } = await render(h("bs-chip-informative", { size: size }, "Label"));
|
|
17
|
+
expect(root).toHaveClass(`bs-chip-informative--${size}`);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
it('reflects disabled to the host attribute regardless of color', async () => {
|
|
21
|
+
const { root } = await render(h("bs-chip-informative", { color: "error", disabled: true }, "Label"));
|
|
22
|
+
expect(root).toEqualAttribute('disabled', '');
|
|
23
|
+
// The color class is still applied -- CSS source order makes the [disabled] rule win, not JS.
|
|
24
|
+
expect(root).toHaveClass('bs-chip-informative--error');
|
|
25
|
+
});
|
|
26
|
+
describe('icon slot and padding variant', () => {
|
|
27
|
+
it('has no icon and the text padding variant by default', async () => {
|
|
28
|
+
const { root } = await render(h("bs-chip-informative", null, "Label"));
|
|
29
|
+
expect(root.shadowRoot.querySelector('[part="icon"]')).not.toHaveClass('bs-chip-informative__icon--visible');
|
|
30
|
+
expect(root).toHaveClass('bs-chip-informative--text');
|
|
31
|
+
});
|
|
32
|
+
it('marks the icon visible and picks the icon padding variant when the icon slot has content', async () => {
|
|
33
|
+
const { root, waitForChanges } = await render(h("bs-chip-informative", null, h("svg", { slot: "icon" }), "Label"));
|
|
34
|
+
await waitForChanges();
|
|
35
|
+
expect(root.shadowRoot.querySelector('[part="icon"]')).toHaveClass('bs-chip-informative__icon--visible');
|
|
36
|
+
expect(root).toHaveClass('bs-chip-informative--icon');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
it('renders label slot content', async () => {
|
|
40
|
+
const { root } = await render(h("bs-chip-informative", null, "Active"));
|
|
41
|
+
expect(root).toHaveTextContent('Active');
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @prop --bs-chip-informative-height-sm: Height at size="sm". Aliased to --bs-spacing-250.
|
|
3
|
+
* @prop --bs-chip-informative-height-md: Height at size="md". Aliased to --bs-spacing-300.
|
|
4
|
+
* @prop --bs-chip-informative-height-lg: Height at size="lg". Aliased to --bs-spacing-400.
|
|
5
|
+
* @prop --bs-chip-informative-gap: Gap between icon and label. Aliased to --bs-spacing-50.
|
|
6
|
+
* @prop --bs-chip-informative-icon-size: Icon glyph size. 16px, matching Figma exactly -- constant
|
|
7
|
+
* across all sizes, only the chip's own height/font changes.
|
|
8
|
+
* @prop --bs-chip-informative-padding-x-glyph-side: Left-edge padding when there's a leading icon.
|
|
9
|
+
* Aliased to --bs-spacing-100.
|
|
10
|
+
* @prop --bs-chip-informative-padding-x-plain-side: Both edges' padding when there's no leading
|
|
11
|
+
* icon. Aliased to --bs-spacing-200 -- deliberately not the icon variant's own right-edge value
|
|
12
|
+
* (--bs-spacing-150) below; verified against Figma that the no-icon variant uses a bigger value on
|
|
13
|
+
* both sides rather than reusing the icon variant's smaller one-sided value.
|
|
14
|
+
* @prop --bs-chip-informative-padding-right-icon-variant: Right-edge padding specifically when
|
|
15
|
+
* there's a leading icon (the label-only edge in that case). Aliased to --bs-spacing-150.
|
|
16
|
+
* @prop --bs-chip-informative-font-size-sm: Aliased to --bs-font-size-xs (size="sm" only --
|
|
17
|
+
* every other size uses --bs-chip-informative-font-size below).
|
|
18
|
+
* @prop --bs-chip-informative-line-height-sm: Aliased to --bs-line-height-caption-sm (size="sm"
|
|
19
|
+
* only).
|
|
20
|
+
* @prop --bs-chip-informative-font-size: Aliased to --bs-font-size-sm (size="md"/"lg").
|
|
21
|
+
* @prop --bs-chip-informative-line-height: Aliased to --bs-line-height-body-sm (size="md"/"lg").
|
|
22
|
+
* @prop --bs-chip-informative-font-weight: Aliased to --bs-font-weight-regular.
|
|
23
|
+
*
|
|
24
|
+
* Color (background/text per color/disabled) comes directly from brandsync-tokens' own pre-built
|
|
25
|
+
* chip token set below -- shared across the whole bs-chip family, not local to this component,
|
|
26
|
+
* consumed directly rather than re-aliased under a bs-chip-informative-specific name.
|
|
27
|
+
*/
|
|
28
|
+
:host {
|
|
29
|
+
display: inline-flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
gap: var(--bs-chip-informative-gap);
|
|
33
|
+
border-radius: var(--bs-border-radius-full);
|
|
34
|
+
font-family: inherit;
|
|
35
|
+
font-weight: var(--bs-chip-informative-font-weight);
|
|
36
|
+
white-space: nowrap;
|
|
37
|
+
|
|
38
|
+
--bs-chip-informative-height-sm: var(--bs-spacing-250);
|
|
39
|
+
--bs-chip-informative-height-md: var(--bs-spacing-300);
|
|
40
|
+
--bs-chip-informative-height-lg: var(--bs-spacing-400);
|
|
41
|
+
--bs-chip-informative-gap: var(--bs-spacing-50);
|
|
42
|
+
--bs-chip-informative-icon-size: 16px;
|
|
43
|
+
--bs-chip-informative-padding-x-glyph-side: var(--bs-spacing-100);
|
|
44
|
+
--bs-chip-informative-padding-right-icon-variant: var(--bs-spacing-150);
|
|
45
|
+
--bs-chip-informative-padding-x-plain-side: var(--bs-spacing-200);
|
|
46
|
+
--bs-chip-informative-font-size-sm: var(--bs-font-size-xs);
|
|
47
|
+
--bs-chip-informative-line-height-sm: var(--bs-line-height-caption-sm);
|
|
48
|
+
--bs-chip-informative-font-size: var(--bs-font-size-sm);
|
|
49
|
+
--bs-chip-informative-line-height: var(--bs-line-height-body-sm);
|
|
50
|
+
--bs-chip-informative-font-weight: var(--bs-font-weight-regular);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host(.bs-chip-informative--lg) {
|
|
54
|
+
height: var(--bs-chip-informative-height-lg);
|
|
55
|
+
font-size: var(--bs-chip-informative-font-size);
|
|
56
|
+
line-height: calc(var(--bs-chip-informative-line-height) * 1px);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host(.bs-chip-informative--md) {
|
|
60
|
+
height: var(--bs-chip-informative-height-md);
|
|
61
|
+
font-size: var(--bs-chip-informative-font-size);
|
|
62
|
+
line-height: calc(var(--bs-chip-informative-line-height) * 1px);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host(.bs-chip-informative--sm) {
|
|
66
|
+
height: var(--bs-chip-informative-height-sm);
|
|
67
|
+
font-size: var(--bs-chip-informative-font-size-sm);
|
|
68
|
+
line-height: calc(var(--bs-chip-informative-line-height-sm) * 1px);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host(.bs-chip-informative--icon) {
|
|
72
|
+
padding-left: var(--bs-chip-informative-padding-x-glyph-side);
|
|
73
|
+
padding-right: var(--bs-chip-informative-padding-right-icon-variant);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host(.bs-chip-informative--text) {
|
|
77
|
+
padding-left: var(--bs-chip-informative-padding-x-plain-side);
|
|
78
|
+
padding-right: var(--bs-chip-informative-padding-x-plain-side);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.bs-chip-informative__icon {
|
|
82
|
+
display: none;
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
width: var(--bs-chip-informative-icon-size);
|
|
85
|
+
height: var(--bs-chip-informative-icon-size);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.bs-chip-informative__icon--visible {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.bs-chip-informative__icon ::slotted(*) {
|
|
95
|
+
display: block;
|
|
96
|
+
width: var(--bs-chip-informative-icon-size);
|
|
97
|
+
height: var(--bs-chip-informative-icon-size);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.bs-chip-informative__label {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host(.bs-chip-informative--neutral) {
|
|
106
|
+
background: var(--bs-chip-bg-neutral-container);
|
|
107
|
+
color: var(--bs-chip-text-neutral);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host(.bs-chip-informative--warning) {
|
|
111
|
+
background: var(--bs-chip-bg-warning-container);
|
|
112
|
+
color: var(--bs-chip-text-warning);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:host(.bs-chip-informative--success) {
|
|
116
|
+
background: var(--bs-chip-bg-success-container);
|
|
117
|
+
color: var(--bs-chip-text-success);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host(.bs-chip-informative--info) {
|
|
121
|
+
background: var(--bs-chip-bg-info-container);
|
|
122
|
+
color: var(--bs-chip-text-info);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host(.bs-chip-informative--error) {
|
|
126
|
+
background: var(--bs-chip-bg-error-container);
|
|
127
|
+
color: var(--bs-chip-text-error);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Overrides whichever color class is also present -- declared last, plain attribute selector
|
|
131
|
+
specificity (0,1,0) ties with the color classes' own (0,1,0), so source order decides. */
|
|
132
|
+
:host([disabled]) {
|
|
133
|
+
background: var(--bs-chip-bg-disabled);
|
|
134
|
+
color: var(--bs-chip-text-disabled);
|
|
135
|
+
}
|