@brandsync/wc 1.2.0 → 1.4.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 +453 -91
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/{p-a35d5ea7.entry.js → p-03a8fbbf.entry.js} +1 -1
- package/dist/brandsync-wc/{p-41732f18.entry.js → p-0534d0a9.entry.js} +1 -1
- package/dist/brandsync-wc/{p-3e6d37a4.entry.js → p-07043faa.entry.js} +1 -1
- package/dist/brandsync-wc/{p-b6425ac2.entry.js → p-0c7f993e.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c76ca89f.entry.js → p-1030c935.entry.js} +1 -1
- package/dist/brandsync-wc/{p-ce08c9d7.entry.js → p-10ad342b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-03f9fd54.entry.js → p-113ed9df.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f6fafbd6.entry.js → p-117a52dc.entry.js} +1 -1
- package/dist/brandsync-wc/{p-17dbd4b3.entry.js → p-17cef278.entry.js} +1 -1
- package/dist/brandsync-wc/{p-6970a24c.entry.js → p-1d50cff0.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7f14660d.entry.js → p-2eb6db9f.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a73bfd31.entry.js → p-3145cc00.entry.js} +1 -1
- package/dist/brandsync-wc/{p-1e9ceb9d.entry.js → p-31fe38dd.entry.js} +1 -1
- package/dist/brandsync-wc/{p-650b7eef.entry.js → p-3b3ef658.entry.js} +1 -1
- package/dist/brandsync-wc/{p-18e0cff4.entry.js → p-3c060d84.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7091f130.entry.js → p-3eecd03e.entry.js} +1 -1
- package/dist/brandsync-wc/p-4567c1d0.entry.js +1 -0
- package/dist/brandsync-wc/{p-ca74c7d9.entry.js → p-4ba7690a.entry.js} +1 -1
- package/dist/brandsync-wc/{p-673546bf.entry.js → p-507b5c4b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a597dc2b.entry.js → p-5bf18d08.entry.js} +1 -1
- package/dist/brandsync-wc/{p-260e14de.entry.js → p-6b850a6c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-ed704126.entry.js → p-6dc7fc4a.entry.js} +1 -1
- package/dist/brandsync-wc/{p-04d6aa95.entry.js → p-6fa6a576.entry.js} +1 -1
- package/dist/brandsync-wc/{p-0299e8e1.entry.js → p-700fb759.entry.js} +1 -1
- package/dist/brandsync-wc/{p-67bc2ec8.entry.js → p-826c08ac.entry.js} +1 -1
- package/dist/brandsync-wc/{p-cff188cb.entry.js → p-8dec61f7.entry.js} +1 -1
- package/dist/brandsync-wc/p-93984743.entry.js +1 -0
- package/dist/brandsync-wc/{p-f94449da.entry.js → p-984e9878.entry.js} +1 -1
- package/dist/brandsync-wc/p-9a2f986d.entry.js +1 -0
- package/dist/brandsync-wc/{p-aac6b59b.entry.js → p-9bc67188.entry.js} +1 -1
- package/dist/brandsync-wc/{p-CvfB8CQv.js → p-CcPfH1dJ.js} +2 -2
- package/dist/brandsync-wc/{p-c8480d21.entry.js → p-a6bc823e.entry.js} +1 -1
- package/dist/brandsync-wc/p-b1353da8.entry.js +1 -0
- package/dist/brandsync-wc/{p-718ce85f.entry.js → p-b176c547.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2e7586dd.entry.js → p-b22038b2.entry.js} +1 -1
- package/dist/brandsync-wc/p-b5ebbc76.entry.js +1 -0
- package/dist/brandsync-wc/{p-fc9d52d4.entry.js → p-b6dba2bf.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f652d79c.entry.js → p-ba650ca9.entry.js} +1 -1
- package/dist/brandsync-wc/p-baea8952.entry.js +1 -0
- package/dist/brandsync-wc/{p-8f2cfe31.entry.js → p-bbd238cd.entry.js} +1 -1
- package/dist/brandsync-wc/{p-0921ca0d.entry.js → p-bca1149c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-72e02bd5.entry.js → p-c89ab519.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2a7cc40c.entry.js → p-c8fabfd0.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c7b9a5c7.entry.js → p-d5ea1b72.entry.js} +1 -1
- package/dist/brandsync-wc/{p-8b5f4ca7.entry.js → p-d7ce9505.entry.js} +1 -1
- package/dist/brandsync-wc/{p-b63362e7.entry.js → p-da6fa359.entry.js} +1 -1
- package/dist/brandsync-wc/p-dc974d62.entry.js +1 -0
- package/dist/brandsync-wc/p-df0fc514.entry.js +1 -0
- package/dist/brandsync-wc/{p-a16afeaa.entry.js → p-e5b1d254.entry.js} +1 -1
- package/dist/brandsync-wc/{p-205deb32.entry.js → p-f0df6653.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7655e741.entry.js → p-fc52e0df.entry.js} +1 -1
- package/dist/cjs/brandsync-wc.cjs.js +2 -2
- 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 +2 -2
- package/dist/cjs/bs-card.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +2 -2
- package/dist/cjs/bs-checkbox-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 +10 -6
- package/dist/cjs/bs-chip-informative.cjs.entry.js +1 -1
- package/dist/cjs/bs-chip-input.cjs.entry.js +1 -1
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +1 -1
- package/dist/cjs/bs-composer.cjs.entry.js +26 -3
- package/dist/cjs/bs-data-table.cjs.entry.js +21 -4
- package/dist/cjs/bs-dialog.cjs.entry.js +1 -1
- package/dist/cjs/bs-icon-button.cjs.entry.js +3 -3
- 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 +3 -3
- package/dist/cjs/bs-navigation-header.cjs.entry.js +3 -3
- package/dist/cjs/bs-pagination.cjs.entry.js +2 -2
- package/dist/cjs/bs-progress-linear.cjs.entry.js +65 -0
- package/dist/cjs/bs-progress.cjs.entry.js +69 -0
- 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 +13 -3
- 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-toast.cjs.entry.js +2 -2
- package/dist/cjs/bs-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{index-CdAh5BFg.js → index-Bj1mNOtg.js} +17 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- 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-list/bs-attachment-list.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.css +15 -5
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.css +15 -7
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.js +1 -1
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.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-chip/bs-chip-filter/bs-chip-filter.cmp.test.js +19 -5
- package/dist/collection/components/bs-chip/bs-chip-filter/bs-chip-filter.js +11 -7
- package/dist/collection/components/bs-composer/bs-composer.cmp.test.js +44 -0
- package/dist/collection/components/bs-composer/bs-composer.js +29 -6
- package/dist/collection/components/bs-data-table/bs-data-table.cmp.test.js +108 -0
- package/dist/collection/components/bs-data-table/bs-data-table.css +5 -3
- package/dist/collection/components/bs-data-table/bs-data-table.js +40 -2
- package/dist/collection/components/bs-input/bs-input.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-progress/bs-progress.cmp.test.js +96 -0
- package/dist/collection/components/bs-progress/bs-progress.css +119 -0
- package/dist/collection/components/bs-progress/bs-progress.js +212 -0
- package/dist/collection/components/bs-progress/bs-progress.stories.js +72 -0
- package/dist/collection/components/bs-progress-linear/bs-progress-linear.cmp.test.js +92 -0
- package/dist/collection/components/bs-progress-linear/bs-progress-linear.css +108 -0
- package/dist/collection/components/bs-progress-linear/bs-progress-linear.js +192 -0
- package/dist/collection/components/bs-progress-linear/bs-progress-linear.stories.js +66 -0
- package/dist/collection/components/bs-radio/bs-radio.js +1 -1
- package/dist/collection/components/bs-slider/bs-slider.js +1 -1
- package/dist/collection/components/bs-snackbar/bs-snackbar.cmp.test.js +4 -1
- package/dist/collection/components/bs-snackbar/bs-snackbar.css +8 -155
- package/dist/collection/components/bs-snackbar/bs-snackbar.js +11 -1
- 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 +1 -1
- package/dist/collection/components/bs-switch/bs-switch.js +1 -1
- 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 +1 -1
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.js +1 -1
- package/dist/collection/components/bs-toast/bs-toast.js +1 -1
- package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.cmp.test.js +6 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.css +43 -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.css +25 -0
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.js +1 -1
- 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-breadcrumb-overflow.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-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-chip-filter.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-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-progress-linear.d.ts +11 -0
- package/dist/components/bs-progress-linear.js +1 -0
- package/dist/components/bs-progress.d.ts +11 -0
- package/dist/components/bs-progress.js +1 -0
- 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-toast.js +1 -1
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/p-BQdQhCjF.js +1 -0
- package/dist/components/{p-Bg98eW9H.js → p-Bi4KsnwA.js} +1 -1
- package/dist/components/p-C5ducC76.js +1 -0
- package/dist/components/{p-BlCziuES.js → p-CKXzHFVu.js} +1 -1
- package/dist/components/{p-BOP5EJrQ.js → p-CbSuTCj1.js} +1 -1
- package/dist/esm/brandsync-wc.js +3 -3
- 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 +2 -2
- package/dist/esm/bs-card.entry.js +1 -1
- package/dist/esm/bs-chatbot-feedback.entry.js +2 -2
- package/dist/esm/bs-chatbot-header.entry.js +2 -2
- package/dist/esm/bs-chatbot-response-action.entry.js +2 -2
- package/dist/esm/bs-chatbot-sources-drawer.entry.js +2 -2
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +2 -2
- package/dist/esm/bs-checkbox-skeleton.entry.js +2 -2
- package/dist/esm/bs-checkbox.entry.js +1 -1
- package/dist/esm/bs-chip-filter.entry.js +10 -6
- package/dist/esm/bs-chip-informative.entry.js +1 -1
- package/dist/esm/bs-chip-input.entry.js +1 -1
- package/dist/esm/bs-composer-status-banner.entry.js +1 -1
- package/dist/esm/bs-composer.entry.js +26 -3
- package/dist/esm/bs-data-table.entry.js +21 -4
- package/dist/esm/bs-dialog.entry.js +1 -1
- package/dist/esm/bs-icon-button.entry.js +3 -3
- 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 +3 -3
- package/dist/esm/bs-navigation-header.entry.js +3 -3
- package/dist/esm/bs-pagination.entry.js +2 -2
- package/dist/esm/bs-progress-linear.entry.js +63 -0
- package/dist/esm/bs-progress.entry.js +67 -0
- 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 +13 -3
- 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-toast.entry.js +2 -2
- package/dist/esm/bs-tooltip.entry.js +2 -2
- package/dist/esm/{index-CvfB8CQv.js → index-CcPfH1dJ.js} +17 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/bs-chip/bs-chip-filter/bs-chip-filter.d.ts +7 -2
- package/dist/types/components/bs-composer/bs-composer.d.ts +15 -1
- package/dist/types/components/bs-data-table/bs-data-table.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-data-table/bs-data-table.d.ts +5 -0
- package/dist/types/components/bs-progress/bs-progress.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-progress/bs-progress.d.ts +46 -0
- package/dist/types/components/bs-progress/bs-progress.stories.d.ts +18 -0
- package/dist/types/components/bs-progress-linear/bs-progress-linear.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-progress-linear/bs-progress-linear.d.ts +50 -0
- package/dist/types/components/bs-progress-linear/bs-progress-linear.stories.d.ts +17 -0
- package/dist/types/components.d.ts +251 -6
- package/package.json +1 -1
- package/dist/brandsync-wc/p-00d40aca.entry.js +0 -1
- package/dist/brandsync-wc/p-127d698d.entry.js +0 -1
- package/dist/brandsync-wc/p-1780224d.entry.js +0 -1
- package/dist/brandsync-wc/p-35bcb932.entry.js +0 -1
- package/dist/brandsync-wc/p-393efb5d.entry.js +0 -1
- package/dist/brandsync-wc/p-b2abd8d9.entry.js +0 -1
- package/dist/components/p-B8JpGodL.js +0 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: block;
|
|
3
|
+
--bs-data-table-cell-padding-y: var(--bs-spacing-200);
|
|
4
|
+
--bs-data-table-cell-padding-x: var(--bs-spacing-300);
|
|
3
5
|
}
|
|
4
6
|
|
|
5
7
|
.bs-data-table {
|
|
@@ -12,7 +14,7 @@
|
|
|
12
14
|
|
|
13
15
|
.bs-data-table__header-cell {
|
|
14
16
|
text-align: left;
|
|
15
|
-
padding: var(--bs-
|
|
17
|
+
padding: var(--bs-data-table-cell-padding-y) var(--bs-data-table-cell-padding-x);
|
|
16
18
|
border-bottom: 1px solid var(--bs-border-default);
|
|
17
19
|
font-weight: var(--bs-font-weight-semibold);
|
|
18
20
|
color: var(--bs-text-secondary);
|
|
@@ -45,12 +47,12 @@
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
.bs-data-table__cell {
|
|
48
|
-
padding: var(--bs-
|
|
50
|
+
padding: var(--bs-data-table-cell-padding-y) var(--bs-data-table-cell-padding-x);
|
|
49
51
|
border-bottom: 1px solid var(--bs-border-default);
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
.bs-data-table__select-col {
|
|
53
55
|
width: var(--bs-spacing-500);
|
|
54
|
-
padding: var(--bs-
|
|
56
|
+
padding: var(--bs-data-table-cell-padding-y) var(--bs-data-table-cell-padding-x);
|
|
55
57
|
border-bottom: 1px solid var(--bs-border-default);
|
|
56
58
|
}
|
|
@@ -53,12 +53,29 @@ export class BsDataTable {
|
|
|
53
53
|
this.selectedIds = next;
|
|
54
54
|
this.bsRowSelect.emit({ id: row.id, selected });
|
|
55
55
|
};
|
|
56
|
+
onSelectAllChange = (ev) => {
|
|
57
|
+
const selected = ev.target.checked;
|
|
58
|
+
this.selectedIds = selected ? new Set(this.rows.map(row => row.id)) : new Set();
|
|
59
|
+
for (const row of this.rows) {
|
|
60
|
+
this.bsRowSelect.emit({ id: row.id, selected });
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
/** Clears the current row selection and emits `bsRowSelect` for each row that was selected, so
|
|
64
|
+
* parent-held selection state stays in sync. Lets consumers reset selection without remounting
|
|
65
|
+
* the whole table. */
|
|
66
|
+
async clearSelection() {
|
|
67
|
+
const previouslySelected = Array.from(this.selectedIds);
|
|
68
|
+
this.selectedIds = new Set();
|
|
69
|
+
for (const id of previouslySelected) {
|
|
70
|
+
this.bsRowSelect.emit({ id, selected: false });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
56
73
|
render() {
|
|
57
|
-
return (h("table", { key: '
|
|
74
|
+
return (h("table", { key: '76fd11f8cad916ca3f33d1da13465246982ded6d', part: "table", class: "bs-data-table" }, h("thead", { key: 'd95c8c072858c50c8f02a2858dbe82c8ab532491', part: "head" }, h("tr", { key: '949e31f6329a890a8602bf487c0436007b58b517' }, this.selectable && (h("th", { key: '228053a10aeb0dc45e2449708fdad3c0de91977f', class: "bs-data-table__select-col" }, this.rows.length > 0 && (h("input", { key: 'd460d518e751e66071e73d65b2bf460b25a282a0', type: "checkbox", "aria-label": "Select all rows", checked: this.selectedIds.size > 0 && this.selectedIds.size === this.rows.length, indeterminate: this.selectedIds.size > 0 && this.selectedIds.size < this.rows.length, onChange: this.onSelectAllChange })))), this.columns.map(column => {
|
|
58
75
|
const isSorted = this.sortColumn === column.key;
|
|
59
76
|
const ariaSort = column.sortable ? (isSorted ? (this.sortDirection === 'asc' ? 'ascending' : 'descending') : 'none') : undefined;
|
|
60
77
|
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: '
|
|
78
|
+
}))), h("tbody", { key: '2f935040a6fd3a3356f178ce23724f95248c2730', 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
79
|
// cellRenderer is a developer-supplied, trusted function (JS-property-only, never
|
|
63
80
|
// derived from untrusted input) -- its HTML output is intentionally not escaped,
|
|
64
81
|
// same trust model as React's dangerouslySetInnerHTML.
|
|
@@ -256,4 +273,25 @@ export class BsDataTable {
|
|
|
256
273
|
}
|
|
257
274
|
}];
|
|
258
275
|
}
|
|
276
|
+
static get methods() {
|
|
277
|
+
return {
|
|
278
|
+
"clearSelection": {
|
|
279
|
+
"complexType": {
|
|
280
|
+
"signature": "() => Promise<void>",
|
|
281
|
+
"parameters": [],
|
|
282
|
+
"references": {
|
|
283
|
+
"Promise": {
|
|
284
|
+
"location": "global",
|
|
285
|
+
"id": "global::Promise"
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"return": "Promise<void>"
|
|
289
|
+
},
|
|
290
|
+
"docs": {
|
|
291
|
+
"text": "Clears the current row selection and emits `bsRowSelect` for each row that was selected, so\nparent-held selection state stays in sync. Lets consumers reset selection without remounting\nthe whole table.",
|
|
292
|
+
"tags": []
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
}
|
|
259
297
|
}
|
|
@@ -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: '94db3f8937d133fc88269d7701401f596f384e32', 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: '19ab0ecbf95c9184c68f6b503ddb7371de678eb3', part: "label", class: "bs-input__label", htmlFor: "control" }, this.label, this.required && (h("span", { key: '5c9198c26c50d03723e333a2071a663448c1ff62', 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"; }
|
|
@@ -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: '9ddd41b5264edea07a8fd9861a5f0c6bcf922e50', part: "list", class: "bs-menu", role: "menu" }, h("slot", { key: '011a7b612195dbd38047c02acb00756fba1cfc69' })));
|
|
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: 'dc2ecd8c91134844ee1aeb520295fc6dc0fb2fba', 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: '0f20ceeb37ddaf28f231f2ce0897ade44c69d98a', part: "icon", class: `bs-menu-item__icon ${this.hasIcon ? 'bs-menu-item__icon--has-content' : ''}` }, h("slot", { key: '0ba45aa14671240b68113a3ed1e1c923552de077', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: 'fdf7916b79e66b3164260ef399de1e7f8654a246', part: "label", class: "bs-menu-item__label" }, h("slot", { key: '66583fc1d0a0958f0e57c1e4c66f01f77900513d' }))));
|
|
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: 'a717e0c64697d3c0da2f15fcd7d12fc4f25d700b', "aria-label": "Pagination" }, h("ul", { key: 'b18b2e0c20057be81a03af983b9fb59ce5f1e782', part: "list", class: "bs-pagination__list" }, h("li", { key: '8255be4c2d821b54f76e2a48e68d68b2efda5b32', part: "item", class: "bs-pagination__item" }, h("button", { key: '35d48190d024595bd5c99c6a897a617b65a08eee', 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: 'c9f3323e63eb497ab717682c0fa28feec19d8033' }))), 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: '809ebb893783eea55974081032bf489761298dce', part: "item", class: "bs-pagination__item" }, h("button", { key: '794f0b9ffd022b5dd973612a54a1c1ac19d46397', 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: 'bb639f2573b34133a77a364a3d3ff2c1e071c694' }))))));
|
|
91
91
|
}
|
|
92
92
|
static get is() { return "bs-pagination"; }
|
|
93
93
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
2
|
+
// Same math as the component's own private `circumference`/`dashOffset` getters, for computing an
|
|
3
|
+
// expected stroke-dashoffset independently of the implementation.
|
|
4
|
+
const expectedDashOffset = (diameter, strokeWidth, value) => {
|
|
5
|
+
const radius = (diameter - strokeWidth) / 2;
|
|
6
|
+
const circumference = 2 * Math.PI * radius;
|
|
7
|
+
const clamped = Math.min(100, Math.max(0, value));
|
|
8
|
+
return circumference * (1 - clamped / 100);
|
|
9
|
+
};
|
|
10
|
+
describe('bs-progress', () => {
|
|
11
|
+
describe('size/type combinations', () => {
|
|
12
|
+
['small', 'medium', 'large'].forEach(size => {
|
|
13
|
+
it(`renders size="${size}" type="determinate"`, async () => {
|
|
14
|
+
const { root } = await render(h("bs-progress", { size: size, type: "determinate", value: 40 }));
|
|
15
|
+
expect(root.shadowRoot.querySelector('.bs-progress__ring')).not.toBeNull();
|
|
16
|
+
expect(root.shadowRoot.querySelector('[part="track"]')).not.toBeNull();
|
|
17
|
+
expect(root.shadowRoot.querySelector('[part="arc"]')).not.toBeNull();
|
|
18
|
+
});
|
|
19
|
+
it(`renders size="${size}" type="indeterminate"`, async () => {
|
|
20
|
+
const { root } = await render(h("bs-progress", { size: size, type: "indeterminate" }));
|
|
21
|
+
expect(root.shadowRoot.querySelector('.bs-progress__spinner')).not.toBeNull();
|
|
22
|
+
expect(root.shadowRoot.querySelector('[part="arc"]')).not.toBeNull();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
describe('arc sweep', () => {
|
|
27
|
+
[0, 50, 100].forEach(value => {
|
|
28
|
+
it(`computes stroke-dashoffset for value=${value} at default size/stroke-width`, async () => {
|
|
29
|
+
const { root } = await render(h("bs-progress", { value: value }));
|
|
30
|
+
const arc = root.shadowRoot.querySelector('[part="arc"]');
|
|
31
|
+
const expected = expectedDashOffset(44, 4, value);
|
|
32
|
+
expect(Number(arc.getAttribute('stroke-dashoffset'))).toBeCloseTo(expected, 5);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
it('produces a smaller (non-zero) dashoffset for a larger value', async () => {
|
|
36
|
+
const { root: rootLow } = await render(h("bs-progress", { value: 10 }));
|
|
37
|
+
const { root: rootHigh } = await render(h("bs-progress", { value: 90 }));
|
|
38
|
+
const lowOffset = Number(rootLow.shadowRoot.querySelector('[part="arc"]').getAttribute('stroke-dashoffset'));
|
|
39
|
+
const highOffset = Number(rootHigh.shadowRoot.querySelector('[part="arc"]').getAttribute('stroke-dashoffset'));
|
|
40
|
+
expect(highOffset).toBeLessThan(lowOffset);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
describe('value clamping', () => {
|
|
44
|
+
it('clamps a value above 100 down to 100', async () => {
|
|
45
|
+
const { root } = await render(h("bs-progress", { value: 150 }));
|
|
46
|
+
const label = root.shadowRoot.querySelector('[part="label"]');
|
|
47
|
+
expect(label.textContent).toBe('100%');
|
|
48
|
+
const arc = root.shadowRoot.querySelector('[part="arc"]');
|
|
49
|
+
expect(Number(arc.getAttribute('stroke-dashoffset'))).toBeCloseTo(0, 5);
|
|
50
|
+
});
|
|
51
|
+
it('clamps a negative value up to 0', async () => {
|
|
52
|
+
const { root } = await render(h("bs-progress", { value: -10 }));
|
|
53
|
+
const label = root.shadowRoot.querySelector('[part="label"]');
|
|
54
|
+
expect(label.textContent).toBe('0%');
|
|
55
|
+
const arc = root.shadowRoot.querySelector('[part="arc"]');
|
|
56
|
+
const expected = expectedDashOffset(44, 4, 0);
|
|
57
|
+
expect(Number(arc.getAttribute('stroke-dashoffset'))).toBeCloseTo(expected, 5);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
describe('label', () => {
|
|
61
|
+
it('renders "${value}%" when determinate and showLabel is true (default)', async () => {
|
|
62
|
+
const { root } = await render(h("bs-progress", { value: 42 }));
|
|
63
|
+
const label = root.shadowRoot.querySelector('[part="label"]');
|
|
64
|
+
expect(label).not.toBeNull();
|
|
65
|
+
expect(label.textContent).toBe('42%');
|
|
66
|
+
});
|
|
67
|
+
it('omits the label when showLabel is false', async () => {
|
|
68
|
+
const { root } = await render(h("bs-progress", { value: 42, showLabel: false }));
|
|
69
|
+
expect(root.shadowRoot.querySelector('[part="label"]')).toBeNull();
|
|
70
|
+
});
|
|
71
|
+
it('omits the label when type is indeterminate, even with showLabel true', async () => {
|
|
72
|
+
const { root } = await render(h("bs-progress", { type: "indeterminate", showLabel: true }));
|
|
73
|
+
expect(root.shadowRoot.querySelector('[part="label"]')).toBeNull();
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('aria attributes', () => {
|
|
77
|
+
it('sets aria-valuemin/max/now for determinate', async () => {
|
|
78
|
+
const { root } = await render(h("bs-progress", { type: "determinate", value: 65 }));
|
|
79
|
+
const box = root.shadowRoot.querySelector('.bs-progress__box');
|
|
80
|
+
expect(box).toEqualAttribute('role', 'progressbar');
|
|
81
|
+
expect(box).toEqualAttribute('aria-valuemin', '0');
|
|
82
|
+
expect(box).toEqualAttribute('aria-valuemax', '100');
|
|
83
|
+
expect(box).toEqualAttribute('aria-valuenow', '65');
|
|
84
|
+
expect(box.hasAttribute('aria-busy')).toBe(false);
|
|
85
|
+
});
|
|
86
|
+
it('omits aria-valuenow and sets aria-busy for indeterminate', async () => {
|
|
87
|
+
const { root } = await render(h("bs-progress", { type: "indeterminate" }));
|
|
88
|
+
const box = root.shadowRoot.querySelector('.bs-progress__box');
|
|
89
|
+
expect(box).toEqualAttribute('role', 'progressbar');
|
|
90
|
+
expect(box.hasAttribute('aria-valuenow')).toBe(false);
|
|
91
|
+
expect(box.hasAttribute('aria-valuemin')).toBe(false);
|
|
92
|
+
expect(box.hasAttribute('aria-valuemax')).toBe(false);
|
|
93
|
+
expect(box).toEqualAttribute('aria-busy', 'true');
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @prop --bs-progress-gap: Gap between the ring and the label. Aliased to --bs-spacing-100.
|
|
3
|
+
* @prop --bs-progress-track: Track circle color (background ring). Aliased to --bs-neutral-200.
|
|
4
|
+
* @prop --bs-progress-arc: Arc/spinner circle color. Aliased to --bs-color-primary-default (the
|
|
5
|
+
* same brand-blue accent bs-button's primary variant uses).
|
|
6
|
+
* @prop --bs-progress-label-color: Percentage label text color. Aliased to --bs-color-primary-default.
|
|
7
|
+
* @prop --bs-progress-label-font-size-sm: Label font size, size="small"/"medium". Aliased to --bs-fontsize-caption-md.
|
|
8
|
+
* @prop --bs-progress-label-line-height-sm: Label line height, size="small"/"medium". Aliased to --bs-line-height-caption-md.
|
|
9
|
+
* @prop --bs-progress-label-font-size-lg: Label font size, size="large". Aliased to --bs-fontsize-body-md.
|
|
10
|
+
* @prop --bs-progress-label-line-height-lg: Label line height, size="large". Aliased to --bs-line-height-body-md.
|
|
11
|
+
* @prop --bs-progress-label-font-weight: Label font weight. Aliased to --bs-font-weight-medium.
|
|
12
|
+
* @prop --bs-progress-spin-duration: Indeterminate spin duration. Aliased to --bs-duration-slower
|
|
13
|
+
* if defined by brandsync-tokens, otherwise a plain 1.4s fallback.
|
|
14
|
+
*/
|
|
15
|
+
:host {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
|
|
18
|
+
--bs-progress-gap: var(--bs-spacing-100);
|
|
19
|
+
--bs-progress-track: var(--bs-neutral-200);
|
|
20
|
+
--bs-progress-arc: var(--bs-color-primary-default);
|
|
21
|
+
--bs-progress-label-color: var(--bs-color-primary-default);
|
|
22
|
+
--bs-progress-label-font-size-sm: var(--bs-fontsize-caption-md);
|
|
23
|
+
--bs-progress-label-line-height-sm: var(--bs-line-height-caption-md);
|
|
24
|
+
--bs-progress-label-font-size-lg: var(--bs-fontsize-body-md);
|
|
25
|
+
--bs-progress-label-line-height-lg: var(--bs-line-height-body-md);
|
|
26
|
+
--bs-progress-label-font-weight: var(--bs-font-weight-medium);
|
|
27
|
+
--bs-progress-spin-duration: 1.4s;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.bs-progress {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: var(--bs-progress-gap);
|
|
35
|
+
font-family: inherit;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.bs-progress__box {
|
|
39
|
+
position: relative;
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.bs-progress__ring {
|
|
44
|
+
/* SVG rings are drawn starting at 3 o'clock by default -- rotate -90deg so the determinate
|
|
45
|
+
sweep starts at 12 o'clock, matching the Figma spec. */
|
|
46
|
+
transform: rotate(-90deg);
|
|
47
|
+
overflow: visible;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.bs-progress__track {
|
|
51
|
+
stroke: var(--bs-progress-track);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.bs-progress__arc {
|
|
55
|
+
stroke: var(--bs-progress-arc);
|
|
56
|
+
transition: stroke-dashoffset 0.3s ease;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Indeterminate: Figma's ring is a fading "comet tail" (transparent -> solid color) sweeping
|
|
60
|
+
around with a visible gap, not a flat-colored partial arc -- SVG has no angular/conic gradient
|
|
61
|
+
primitive, so this uses a CSS conic-gradient (color varies by angle) for the fade, masked down
|
|
62
|
+
from a solid disc to a ring of exactly `strokeWidth` via a radial-gradient mask, then rotated
|
|
63
|
+
continuously. `--bs-progress-spinner-stroke-width`/`--bs-progress-spinner-sweep` are set
|
|
64
|
+
per-instance inline (they depend on the `strokeWidth` prop). */
|
|
65
|
+
.bs-progress__spinner {
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
border-radius: 50%;
|
|
69
|
+
background: conic-gradient(from 0deg, transparent 0deg, var(--bs-progress-arc) var(--bs-progress-spinner-sweep), transparent var(--bs-progress-spinner-sweep));
|
|
70
|
+
-webkit-mask: radial-gradient(
|
|
71
|
+
farthest-side,
|
|
72
|
+
transparent calc(100% - var(--bs-progress-spinner-stroke-width) - 1px),
|
|
73
|
+
#000 calc(100% - var(--bs-progress-spinner-stroke-width))
|
|
74
|
+
);
|
|
75
|
+
mask: radial-gradient(
|
|
76
|
+
farthest-side,
|
|
77
|
+
transparent calc(100% - var(--bs-progress-spinner-stroke-width) - 1px),
|
|
78
|
+
#000 calc(100% - var(--bs-progress-spinner-stroke-width))
|
|
79
|
+
);
|
|
80
|
+
animation: bs-progress-spin var(--bs-progress-spin-duration) linear infinite;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@keyframes bs-progress-spin {
|
|
84
|
+
from {
|
|
85
|
+
transform: rotate(0deg);
|
|
86
|
+
}
|
|
87
|
+
to {
|
|
88
|
+
transform: rotate(360deg);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Reduced motion: freezing the spin entirely would remove the only visual signal that work is
|
|
93
|
+
still in progress (there's no label for indeterminate to fall back on), so this slows the
|
|
94
|
+
rotation to a slow, low-frequency pulse instead of stopping it -- still obviously "in progress"
|
|
95
|
+
without being motion-sickness-inducing. Same intent as bs-snackbar's spinner, applied as a
|
|
96
|
+
duration change rather than `animation: none` since indeterminate has no static fallback state
|
|
97
|
+
to freeze on. */
|
|
98
|
+
@media (prefers-reduced-motion: reduce) {
|
|
99
|
+
.bs-progress__spinner {
|
|
100
|
+
animation-duration: calc(var(--bs-progress-spin-duration) * 4);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.bs-progress__label {
|
|
105
|
+
color: var(--bs-progress-label-color);
|
|
106
|
+
font-weight: var(--bs-progress-label-font-weight);
|
|
107
|
+
text-align: center;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.bs-progress__label--small,
|
|
111
|
+
.bs-progress__label--medium {
|
|
112
|
+
font-size: var(--bs-progress-label-font-size-sm);
|
|
113
|
+
line-height: calc(var(--bs-progress-label-line-height-sm) * 1px);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.bs-progress__label--large {
|
|
117
|
+
font-size: var(--bs-progress-label-font-size-lg);
|
|
118
|
+
line-height: calc(var(--bs-progress-label-line-height-lg) * 1px);
|
|
119
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
// Diameter in px per `size` -- matches the Figma spec's three fixed sizes exactly.
|
|
3
|
+
const DIAMETERS = {
|
|
4
|
+
small: 44,
|
|
5
|
+
medium: 48,
|
|
6
|
+
large: 64,
|
|
7
|
+
};
|
|
8
|
+
// How much of the ring the indeterminate sweep covers before fading back to transparent -- the
|
|
9
|
+
// remainder (to 360deg) is the visible "gap" in the ring. Matches the Figma mock's proportions.
|
|
10
|
+
const INDETERMINATE_SWEEP_DEGREES = 300;
|
|
11
|
+
/**
|
|
12
|
+
* A circular progress indicator -- either a static ring showing a percentage sweep
|
|
13
|
+
* (`type="determinate"`) or a continuously spinning ring signaling in-progress work with no known
|
|
14
|
+
* completion percentage (`type="indeterminate"`).
|
|
15
|
+
*
|
|
16
|
+
* ## When to use
|
|
17
|
+
* - Showing the progress of a task with a known, quantifiable completion percentage (`determinate`).
|
|
18
|
+
* - Signaling that work is happening in the background with no meaningful percentage to report
|
|
19
|
+
* (`indeterminate`), e.g. while waiting on a network response.
|
|
20
|
+
*
|
|
21
|
+
* ## When not to use
|
|
22
|
+
* - For a horizontal, bar-shaped progress indicator -- this component is a ring, not a bar.
|
|
23
|
+
* - For a percentage that's better expressed as plain text, without the reserved space and visual
|
|
24
|
+
* weight of a ring.
|
|
25
|
+
*
|
|
26
|
+
* @part container - The outer wrapper (ring + optional label).
|
|
27
|
+
* @part track - The background track circle.
|
|
28
|
+
* @part arc - The colored progress/spinner arc circle.
|
|
29
|
+
* @part label - The percentage label (`determinate` + `showLabel` only).
|
|
30
|
+
*/
|
|
31
|
+
export class BsProgress {
|
|
32
|
+
/** `determinate` renders a static arc sweep reflecting `value` (with an optional percentage
|
|
33
|
+
* label); `indeterminate` renders a continuously spinning ring and never shows a label, since
|
|
34
|
+
* there's no known percentage to report. */
|
|
35
|
+
type = 'determinate';
|
|
36
|
+
/** Overall diameter: `small` (44px), `medium` (48px), or `large` (64px). */
|
|
37
|
+
size = 'small';
|
|
38
|
+
/** Ring stroke width in px -- `4` or `8`, matching Figma's two stroke-width variants. A number,
|
|
39
|
+
* not the Figma label's literal `"4 px"` string. */
|
|
40
|
+
strokeWidth = 4;
|
|
41
|
+
/** Progress percentage, `0`-`100`. Only meaningful for `type="determinate"` -- ignored (and
|
|
42
|
+
* never rendered) for `type="indeterminate"`. Out-of-range values are clamped defensively. */
|
|
43
|
+
value = 0;
|
|
44
|
+
/** Shows the `${value}%` label below the ring. Only takes effect for `type="determinate"` --
|
|
45
|
+
* `indeterminate` never shows a label regardless of this prop, since there's no percentage to
|
|
46
|
+
* show. Defaults to `true`. */
|
|
47
|
+
showLabel = true;
|
|
48
|
+
get clampedValue() {
|
|
49
|
+
return Math.min(100, Math.max(0, this.value));
|
|
50
|
+
}
|
|
51
|
+
get diameter() {
|
|
52
|
+
return DIAMETERS[this.size];
|
|
53
|
+
}
|
|
54
|
+
get radius() {
|
|
55
|
+
return (this.diameter - this.strokeWidth) / 2;
|
|
56
|
+
}
|
|
57
|
+
get circumference() {
|
|
58
|
+
return 2 * Math.PI * this.radius;
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
const diameter = this.diameter;
|
|
62
|
+
const radius = this.radius;
|
|
63
|
+
const circumference = this.circumference;
|
|
64
|
+
const isDeterminate = this.type === 'determinate';
|
|
65
|
+
const value = this.clampedValue;
|
|
66
|
+
const dashOffset = circumference * (1 - value / 100);
|
|
67
|
+
return (h("div", { key: '19bbc9dc90c75faa2c9cc1571eb782f2df76e14b', part: "container", class: "bs-progress" }, h("div", { key: '5e63bdd093f3bcf09740617fe489b9ed9f2f55ca', class: "bs-progress__box", style: { width: `${diameter}px`, height: `${diameter}px` }, role: "progressbar", "aria-valuemin": isDeterminate ? '0' : undefined, "aria-valuemax": isDeterminate ? '100' : undefined, "aria-valuenow": isDeterminate ? String(value) : undefined, "aria-busy": isDeterminate ? undefined : 'true' }, isDeterminate ? (h("svg", { class: "bs-progress__ring", width: diameter, height: diameter, viewBox: `0 0 ${diameter} ${diameter}` }, h("circle", { part: "track", class: "bs-progress__track", cx: diameter / 2, cy: diameter / 2, r: radius, "stroke-width": this.strokeWidth, fill: "none" }), h("circle", { part: "arc", class: "bs-progress__arc", cx: diameter / 2, cy: diameter / 2, r: radius, "stroke-width": this.strokeWidth, fill: "none", "stroke-linecap": "round", "stroke-dasharray": circumference, "stroke-dashoffset": dashOffset }))) : (
|
|
68
|
+
// Figma's indeterminate ring is a fading "comet tail" (transparent -> solid color),
|
|
69
|
+
// not a flat-colored partial arc -- SVG has no angular/conic gradient primitive, so a
|
|
70
|
+
// CSS conic-gradient (color varying by angle) + a radial-gradient mask (carving the
|
|
71
|
+
// gradient disc down to a ring of exactly `strokeWidth`) is used instead of the
|
|
72
|
+
// stroke-dasharray technique the determinate ring uses.
|
|
73
|
+
h("div", { part: "arc", class: "bs-progress__spinner", style: {
|
|
74
|
+
'--bs-progress-spinner-stroke-width': `${this.strokeWidth}px`,
|
|
75
|
+
'--bs-progress-spinner-sweep': `${INDETERMINATE_SWEEP_DEGREES}deg`,
|
|
76
|
+
} }))), isDeterminate && this.showLabel && (h("span", { key: '9010120dc7781c3ac3c25ced301bc52ad07f4fa6', part: "label", class: `bs-progress__label bs-progress__label--${this.size}` }, value, "%"))));
|
|
77
|
+
}
|
|
78
|
+
static get is() { return "bs-progress"; }
|
|
79
|
+
static get encapsulation() { return "shadow"; }
|
|
80
|
+
static get originalStyleUrls() {
|
|
81
|
+
return {
|
|
82
|
+
"$": ["bs-progress.css"]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
static get styleUrls() {
|
|
86
|
+
return {
|
|
87
|
+
"$": ["bs-progress.css"]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
static get properties() {
|
|
91
|
+
return {
|
|
92
|
+
"type": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "BsProgressType",
|
|
97
|
+
"resolved": "\"determinate\" | \"indeterminate\"",
|
|
98
|
+
"references": {
|
|
99
|
+
"BsProgressType": {
|
|
100
|
+
"location": "local",
|
|
101
|
+
"path": "/home/runner/work/Brandsync-webcomponents/Brandsync-webcomponents/packages/wc/src/components/bs-progress/bs-progress.tsx",
|
|
102
|
+
"id": "src/components/bs-progress/bs-progress.tsx::BsProgressType"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"required": false,
|
|
107
|
+
"optional": false,
|
|
108
|
+
"docs": {
|
|
109
|
+
"tags": [],
|
|
110
|
+
"text": "`determinate` renders a static arc sweep reflecting `value` (with an optional percentage\nlabel); `indeterminate` renders a continuously spinning ring and never shows a label, since\nthere's no known percentage to report."
|
|
111
|
+
},
|
|
112
|
+
"getter": false,
|
|
113
|
+
"setter": false,
|
|
114
|
+
"reflect": false,
|
|
115
|
+
"attribute": "type",
|
|
116
|
+
"defaultValue": "'determinate'"
|
|
117
|
+
},
|
|
118
|
+
"size": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"mutable": false,
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "BsProgressSize",
|
|
123
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
124
|
+
"references": {
|
|
125
|
+
"BsProgressSize": {
|
|
126
|
+
"location": "local",
|
|
127
|
+
"path": "/home/runner/work/Brandsync-webcomponents/Brandsync-webcomponents/packages/wc/src/components/bs-progress/bs-progress.tsx",
|
|
128
|
+
"id": "src/components/bs-progress/bs-progress.tsx::BsProgressSize"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": false,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": "Overall diameter: `small` (44px), `medium` (48px), or `large` (64px)."
|
|
137
|
+
},
|
|
138
|
+
"getter": false,
|
|
139
|
+
"setter": false,
|
|
140
|
+
"reflect": false,
|
|
141
|
+
"attribute": "size",
|
|
142
|
+
"defaultValue": "'small'"
|
|
143
|
+
},
|
|
144
|
+
"strokeWidth": {
|
|
145
|
+
"type": "number",
|
|
146
|
+
"mutable": false,
|
|
147
|
+
"complexType": {
|
|
148
|
+
"original": "BsProgressStrokeWidth",
|
|
149
|
+
"resolved": "4 | 8",
|
|
150
|
+
"references": {
|
|
151
|
+
"BsProgressStrokeWidth": {
|
|
152
|
+
"location": "local",
|
|
153
|
+
"path": "/home/runner/work/Brandsync-webcomponents/Brandsync-webcomponents/packages/wc/src/components/bs-progress/bs-progress.tsx",
|
|
154
|
+
"id": "src/components/bs-progress/bs-progress.tsx::BsProgressStrokeWidth"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"required": false,
|
|
159
|
+
"optional": false,
|
|
160
|
+
"docs": {
|
|
161
|
+
"tags": [],
|
|
162
|
+
"text": "Ring stroke width in px -- `4` or `8`, matching Figma's two stroke-width variants. A number,\nnot the Figma label's literal `\"4 px\"` string."
|
|
163
|
+
},
|
|
164
|
+
"getter": false,
|
|
165
|
+
"setter": false,
|
|
166
|
+
"reflect": false,
|
|
167
|
+
"attribute": "stroke-width",
|
|
168
|
+
"defaultValue": "4"
|
|
169
|
+
},
|
|
170
|
+
"value": {
|
|
171
|
+
"type": "number",
|
|
172
|
+
"mutable": false,
|
|
173
|
+
"complexType": {
|
|
174
|
+
"original": "number",
|
|
175
|
+
"resolved": "number",
|
|
176
|
+
"references": {}
|
|
177
|
+
},
|
|
178
|
+
"required": false,
|
|
179
|
+
"optional": false,
|
|
180
|
+
"docs": {
|
|
181
|
+
"tags": [],
|
|
182
|
+
"text": "Progress percentage, `0`-`100`. Only meaningful for `type=\"determinate\"` -- ignored (and\nnever rendered) for `type=\"indeterminate\"`. Out-of-range values are clamped defensively."
|
|
183
|
+
},
|
|
184
|
+
"getter": false,
|
|
185
|
+
"setter": false,
|
|
186
|
+
"reflect": false,
|
|
187
|
+
"attribute": "value",
|
|
188
|
+
"defaultValue": "0"
|
|
189
|
+
},
|
|
190
|
+
"showLabel": {
|
|
191
|
+
"type": "boolean",
|
|
192
|
+
"mutable": false,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "boolean",
|
|
195
|
+
"resolved": "boolean",
|
|
196
|
+
"references": {}
|
|
197
|
+
},
|
|
198
|
+
"required": false,
|
|
199
|
+
"optional": false,
|
|
200
|
+
"docs": {
|
|
201
|
+
"tags": [],
|
|
202
|
+
"text": "Shows the `${value}%` label below the ring. Only takes effect for `type=\"determinate\"` --\n`indeterminate` never shows a label regardless of this prop, since there's no percentage to\nshow. Defaults to `true`."
|
|
203
|
+
},
|
|
204
|
+
"getter": false,
|
|
205
|
+
"setter": false,
|
|
206
|
+
"reflect": false,
|
|
207
|
+
"attribute": "show-label",
|
|
208
|
+
"defaultValue": "true"
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|