@brandsync/wc 0.0.11 → 0.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 +5869 -1633
- package/dist/brandsync-wc/brandsync-wc.css +20 -0
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/p-00bb9bda.entry.js +1 -0
- package/dist/brandsync-wc/{p-8dff4f24.entry.js → p-0847f5c0.entry.js} +1 -1
- package/dist/brandsync-wc/p-0ba35c3b.entry.js +1 -0
- package/dist/brandsync-wc/{p-073e5fee.entry.js → p-0f3cb0c4.entry.js} +1 -1
- package/dist/brandsync-wc/p-10f6f3cd.entry.js +1 -0
- package/dist/brandsync-wc/{p-c6d330c3.entry.js → p-111974df.entry.js} +1 -1
- package/dist/brandsync-wc/p-11f3fceb.entry.js +1 -0
- package/dist/brandsync-wc/p-171fed0c.entry.js +1 -0
- package/dist/brandsync-wc/{p-dd224cb3.entry.js → p-18813680.entry.js} +1 -1
- package/dist/brandsync-wc/p-1b7c9928.entry.js +1 -0
- package/dist/brandsync-wc/p-1ce7dd64.entry.js +1 -0
- package/dist/brandsync-wc/p-2063a6d6.entry.js +1 -0
- package/dist/brandsync-wc/{p-4ca15322.entry.js → p-20c24179.entry.js} +1 -1
- package/dist/brandsync-wc/{p-b174403d.entry.js → p-321ed4d3.entry.js} +1 -1
- package/dist/brandsync-wc/p-38aad266.entry.js +1 -0
- package/dist/brandsync-wc/p-43e37883.entry.js +1 -0
- package/dist/brandsync-wc/p-55a8d4b5.entry.js +1 -0
- package/dist/brandsync-wc/p-59ac2495.entry.js +1 -0
- package/dist/brandsync-wc/p-5ae9e60e.entry.js +1 -0
- package/dist/brandsync-wc/p-6b469b2d.entry.js +1 -0
- package/dist/brandsync-wc/p-6d85fba4.entry.js +1 -0
- package/dist/brandsync-wc/p-6e95eb36.entry.js +1 -0
- package/dist/brandsync-wc/{p-84ae4420.entry.js → p-73217b90.entry.js} +1 -1
- package/dist/brandsync-wc/p-752c04c8.entry.js +1 -0
- package/dist/brandsync-wc/p-79af762c.entry.js +1 -0
- package/dist/brandsync-wc/p-81d49240.entry.js +1 -0
- package/dist/brandsync-wc/p-91551e7b.entry.js +1 -0
- package/dist/brandsync-wc/p-917a5bbc.entry.js +1 -0
- package/dist/brandsync-wc/{p-0b858120.entry.js → p-9876e83c.entry.js} +1 -1
- package/dist/brandsync-wc/p-9bcd99aa.entry.js +1 -0
- package/dist/brandsync-wc/{p-d1dc2ced.entry.js → p-9c4768aa.entry.js} +1 -1
- package/dist/brandsync-wc/{p-DP_bvuvB.js → p-Do3l4of3.js} +2 -2
- package/dist/brandsync-wc/p-aa43d478.entry.js +1 -0
- package/dist/brandsync-wc/p-c3079ad7.entry.js +1 -0
- package/dist/brandsync-wc/{p-74a4dd91.entry.js → p-c3c383dc.entry.js} +1 -1
- package/dist/brandsync-wc/p-cc79e75f.entry.js +1 -0
- package/dist/brandsync-wc/p-ce7fc368.entry.js +1 -0
- package/dist/brandsync-wc/{p-030a8ba7.entry.js → p-d3265e70.entry.js} +1 -1
- package/dist/brandsync-wc/p-d55bbcec.entry.js +1 -0
- package/dist/brandsync-wc/{p-1bf0b2d5.entry.js → p-e93e944b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7a605d98.entry.js → p-eb04c578.entry.js} +1 -1
- package/dist/brandsync-wc/{p-3c8fbaa8.entry.js → p-f0ae2740.entry.js} +1 -1
- package/dist/brandsync-wc/p-f4f22015.entry.js +1 -0
- package/dist/cjs/brandsync-wc.cjs.js +2 -2
- package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +3 -2
- package/dist/cjs/bs-ai-greeting.cjs.entry.js +2 -2
- package/dist/cjs/bs-ai-thinking.cjs.entry.js +2 -2
- package/dist/cjs/bs-attachment-list.cjs.entry.js +2 -2
- package/dist/cjs/bs-attachment.cjs.entry.js +3 -3
- package/dist/cjs/bs-avatar.cjs.entry.js +60 -0
- package/dist/cjs/bs-badge.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumb-overflow.cjs.entry.js +56 -0
- package/dist/cjs/bs-breadcrumb.cjs.entry.js +33 -0
- package/dist/cjs/bs-breadcrumbs.cjs.entry.js +49 -0
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/bs-button.cjs.entry.js +3 -3
- package/dist/cjs/bs-card.cjs.entry.js +10 -3
- 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 +20 -0
- package/dist/cjs/bs-checkbox.cjs.entry.js +14 -3
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +14 -2
- package/dist/cjs/bs-composer.cjs.entry.js +37 -4
- package/dist/cjs/bs-data-table.cjs.entry.js +3 -3
- package/dist/cjs/bs-dialog.cjs.entry.js +110 -0
- package/dist/cjs/bs-icon-button.cjs.entry.js +40 -0
- package/dist/cjs/bs-inline-tab.cjs.entry.js +69 -0
- package/dist/cjs/bs-input.cjs.entry.js +24 -12
- package/dist/cjs/bs-logo.cjs.entry.js +165 -0
- package/dist/cjs/{bs-menu_2.cjs.entry.js → bs-menu-item.cjs.entry.js} +2 -15
- package/dist/cjs/bs-menu.cjs.entry.js +17 -0
- package/dist/cjs/bs-navigation-drawer-item.cjs.entry.js +104 -0
- package/dist/cjs/bs-navigation-drawer.cjs.entry.js +87 -0
- package/dist/cjs/bs-navigation-header.cjs.entry.js +44 -0
- package/dist/cjs/bs-pagination.cjs.entry.js +85 -0
- package/dist/cjs/bs-radio.cjs.entry.js +49 -0
- package/dist/cjs/bs-slider.cjs.entry.js +191 -0
- package/dist/cjs/bs-snackbar.cjs.entry.js +41 -0
- package/dist/cjs/bs-source-link.cjs.entry.js +3 -3
- package/dist/cjs/bs-switch.cjs.entry.js +57 -0
- package/dist/cjs/bs-tab.cjs.entry.js +80 -0
- package/dist/cjs/bs-tabs.cjs.entry.js +39 -0
- package/dist/cjs/bs-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{index-CGrdFg95.js → index-DHVw-IPK.js} +2 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +21 -3
- package/dist/collection/components/bs-ai-chatbot/bs-ai-chatbot.stories.js +26 -11
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +2 -1
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +1 -1
- package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +1 -1
- package/dist/collection/components/bs-attachment/bs-attachment.css +12 -33
- package/dist/collection/components/bs-attachment/bs-attachment.js +4 -10
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +1 -1
- package/dist/collection/components/bs-avatar/bs-avatar.cmp.test.js +54 -0
- package/dist/collection/components/bs-avatar/bs-avatar.css +197 -0
- package/dist/collection/components/bs-avatar/bs-avatar.js +251 -0
- package/dist/collection/components/bs-avatar/bs-avatar.stories.js +67 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb/bs-breadcrumb.cmp.test.js +62 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb/bs-breadcrumb.css +93 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb/bs-breadcrumb.js +130 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.cmp.test.js +118 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.css +125 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.js +192 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.cmp.test.js +58 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.css +18 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.js +129 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.stories.js +84 -0
- package/dist/collection/components/bs-button/{bs-button.cmp.test.js → bs-button/bs-button.cmp.test.js} +26 -0
- package/dist/collection/components/bs-button/{bs-button.css → bs-button/bs-button.css} +57 -6
- package/dist/collection/components/bs-button/{bs-button.js → bs-button/bs-button.js} +10 -5
- package/dist/collection/components/bs-button/{bs-button.stories.js → bs-button/bs-button.stories.js} +2 -27
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.cmp.test.js +83 -0
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.css +346 -0
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.js +185 -0
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.stories.js +74 -0
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +3 -3
- package/dist/collection/components/bs-card/bs-card.cmp.test.js +19 -0
- package/dist/collection/components/bs-card/bs-card.css +37 -5
- package/dist/collection/components/bs-card/bs-card.js +18 -2
- package/dist/collection/components/bs-card/bs-card.stories.js +17 -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.css +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.cmp.test.js +23 -0
- package/dist/collection/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.css +64 -0
- package/dist/collection/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.js +81 -0
- package/dist/collection/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.stories.js +25 -0
- package/dist/collection/components/bs-checkbox/bs-checkbox.cmp.test.js +10 -0
- package/dist/collection/components/bs-checkbox/bs-checkbox.css +7 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox.js +32 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox.stories.js +12 -0
- package/dist/collection/components/bs-composer/bs-composer.cmp.test.js +48 -7
- package/dist/collection/components/bs-composer/bs-composer.css +15 -0
- package/dist/collection/components/bs-composer/bs-composer.js +38 -4
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.cmp.test.js +47 -1
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.js +20 -1
- package/dist/collection/components/bs-data-table/bs-data-table.js +2 -2
- package/dist/collection/components/{bs-modal/bs-modal.cmp.test.js → bs-dialog/bs-dialog.cmp.test.js} +63 -19
- package/dist/collection/components/bs-dialog/bs-dialog.css +130 -0
- package/dist/collection/components/bs-dialog/bs-dialog.js +273 -0
- package/dist/collection/components/bs-dialog/bs-dialog.stories.js +115 -0
- package/dist/collection/components/bs-input/bs-input.cmp.test.js +20 -0
- package/dist/collection/components/bs-input/bs-input.css +80 -2
- package/dist/collection/components/bs-input/bs-input.js +28 -10
- package/dist/collection/components/bs-input/bs-input.stories.js +14 -11
- package/dist/collection/components/bs-logo/brandsync-logo-full-dark.js +44 -0
- package/dist/collection/components/bs-logo/brandsync-logo-full-light.js +40 -0
- package/dist/collection/components/bs-logo/brandsync-logo-mark.js +17 -0
- package/dist/collection/components/bs-logo/bs-logo.cmp.test.js +113 -0
- package/dist/collection/components/bs-logo/bs-logo.css +79 -0
- package/dist/collection/components/bs-logo/bs-logo.js +193 -0
- package/dist/collection/components/bs-logo/bs-logo.stories.js +69 -0
- package/dist/collection/components/bs-menu/bs-menu.js +1 -1
- package/dist/collection/components/bs-menu-item/bs-menu-item.js +1 -1
- package/dist/collection/components/bs-pagination/bs-pagination.cmp.test.js +102 -0
- package/dist/collection/components/bs-pagination/bs-pagination.css +120 -0
- package/dist/collection/components/bs-pagination/bs-pagination.js +233 -0
- package/dist/collection/components/bs-pagination/bs-pagination.stories.js +43 -0
- package/dist/collection/components/bs-radio/bs-radio.cmp.test.js +76 -0
- package/dist/collection/components/bs-radio/bs-radio.css +164 -0
- package/dist/collection/components/bs-radio/bs-radio.js +170 -0
- package/dist/collection/components/bs-radio/bs-radio.stories.js +56 -0
- package/dist/collection/components/bs-slider/bs-slider.cmp.test.js +139 -0
- package/dist/collection/components/bs-slider/bs-slider.css +409 -0
- package/dist/collection/components/bs-slider/bs-slider.js +499 -0
- package/dist/collection/components/bs-slider/bs-slider.stories.js +70 -0
- package/dist/collection/components/bs-snackbar/bs-snackbar.cmp.test.js +77 -0
- package/dist/collection/components/bs-snackbar/bs-snackbar.css +321 -0
- package/dist/collection/components/bs-snackbar/bs-snackbar.js +172 -0
- package/dist/collection/components/bs-snackbar/bs-snackbar.stories.js +59 -0
- package/dist/collection/components/bs-source-link/bs-source-link.js +2 -2
- package/dist/collection/components/bs-switch/bs-switch.cmp.test.js +71 -0
- package/dist/collection/components/bs-switch/bs-switch.css +196 -0
- package/dist/collection/components/bs-switch/bs-switch.js +185 -0
- package/dist/collection/components/bs-switch/bs-switch.stories.js +60 -0
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.cmp.test.js +104 -0
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.css +163 -0
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.js +192 -0
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.stories.js +95 -0
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.cmp.test.js +120 -0
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.css +216 -0
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.js +232 -0
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.stories.js +138 -0
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.cmp.test.js +61 -0
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.css +39 -0
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.js +133 -0
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.stories.js +39 -0
- package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.cmp.test.js +143 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.css +257 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.js +281 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.stories.js +274 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.cmp.test.js +172 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.css +325 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.js +314 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.stories.js +78 -0
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.cmp.test.js +77 -0
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.css +106 -0
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.js +188 -0
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.stories.js +446 -0
- package/dist/components/bs-ai-disclaimer.js +1 -1
- package/dist/components/bs-ai-greeting.js +1 -1
- package/dist/components/bs-ai-thinking.js +1 -1
- package/dist/components/bs-attachment-list.js +1 -1
- package/dist/components/bs-attachment.js +1 -1
- package/dist/components/bs-avatar.d.ts +11 -0
- package/dist/components/bs-avatar.js +1 -0
- package/dist/components/bs-badge.js +1 -1
- package/dist/components/bs-breadcrumb-overflow.d.ts +11 -0
- package/dist/components/bs-breadcrumb-overflow.js +1 -0
- package/dist/components/bs-breadcrumb.d.ts +11 -0
- package/dist/components/bs-breadcrumb.js +1 -0
- package/dist/components/bs-breadcrumbs.d.ts +11 -0
- package/dist/components/bs-breadcrumbs.js +1 -0
- 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.d.ts +11 -0
- package/dist/components/bs-checkbox-skeleton.js +1 -0
- package/dist/components/bs-checkbox.js +1 -1
- package/dist/components/bs-composer-status-banner.js +1 -1
- package/dist/components/bs-composer.js +1 -1
- package/dist/components/bs-data-table.js +1 -1
- package/dist/components/bs-dialog.d.ts +11 -0
- package/dist/components/bs-dialog.js +1 -0
- package/dist/components/bs-icon-button.d.ts +11 -0
- package/dist/components/bs-icon-button.js +1 -0
- package/dist/components/bs-inline-tab.d.ts +11 -0
- package/dist/components/bs-inline-tab.js +1 -0
- package/dist/components/bs-input.js +1 -1
- package/dist/components/{bs-modal.d.ts → bs-logo.d.ts} +4 -4
- package/dist/components/bs-logo.js +1 -0
- package/dist/components/bs-menu-item.js +1 -1
- package/dist/components/bs-menu.js +1 -1
- package/dist/components/bs-navigation-drawer-item.d.ts +11 -0
- package/dist/components/bs-navigation-drawer-item.js +1 -0
- package/dist/components/bs-navigation-drawer.d.ts +11 -0
- package/dist/components/bs-navigation-drawer.js +1 -0
- package/dist/components/bs-navigation-header.d.ts +11 -0
- package/dist/components/bs-navigation-header.js +1 -0
- package/dist/components/bs-pagination.d.ts +11 -0
- package/dist/components/bs-pagination.js +1 -0
- package/dist/components/bs-radio.d.ts +11 -0
- package/dist/components/bs-radio.js +1 -0
- package/dist/components/bs-slider.d.ts +11 -0
- package/dist/components/bs-slider.js +1 -0
- package/dist/components/bs-snackbar.d.ts +11 -0
- package/dist/components/bs-snackbar.js +1 -0
- package/dist/components/bs-source-link.js +1 -1
- package/dist/components/bs-switch.d.ts +11 -0
- package/dist/components/bs-switch.js +1 -0
- package/dist/components/bs-tab.d.ts +11 -0
- package/dist/components/bs-tab.js +1 -0
- package/dist/components/bs-tabs.d.ts +11 -0
- package/dist/components/bs-tabs.js +1 -0
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-BFcVSpES.js +1 -0
- package/dist/components/{p-D1cYtKyN.js → p-BJZYe7M4.js} +1 -1
- package/dist/components/p-BKaZWFE1.js +1 -0
- package/dist/components/{p-BUbGEXL7.js → p-BtX5URLk.js} +1 -1
- package/dist/components/{p-B9PrXIl_.js → p-CgaPcyEJ.js} +1 -1
- package/dist/components/{p-D2HDHZjz.js → p-qK1XlpTA.js} +1 -1
- package/dist/esm/brandsync-wc.js +3 -3
- package/dist/esm/bs-ai-disclaimer.entry.js +3 -2
- package/dist/esm/bs-ai-greeting.entry.js +2 -2
- package/dist/esm/bs-ai-thinking.entry.js +2 -2
- package/dist/esm/bs-attachment-list.entry.js +2 -2
- package/dist/esm/bs-attachment.entry.js +3 -3
- package/dist/esm/bs-avatar.entry.js +58 -0
- package/dist/esm/bs-badge.entry.js +1 -1
- package/dist/esm/bs-breadcrumb-overflow.entry.js +54 -0
- package/dist/esm/bs-breadcrumb.entry.js +31 -0
- package/dist/esm/bs-breadcrumbs.entry.js +47 -0
- package/dist/esm/bs-button-skeleton.entry.js +2 -2
- package/dist/esm/bs-button.entry.js +3 -3
- package/dist/esm/bs-card.entry.js +10 -3
- 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 +18 -0
- package/dist/esm/bs-checkbox.entry.js +14 -3
- package/dist/esm/bs-composer-status-banner.entry.js +14 -2
- package/dist/esm/bs-composer.entry.js +37 -4
- package/dist/esm/bs-data-table.entry.js +3 -3
- package/dist/esm/bs-dialog.entry.js +108 -0
- package/dist/esm/bs-icon-button.entry.js +38 -0
- package/dist/esm/bs-inline-tab.entry.js +67 -0
- package/dist/esm/bs-input.entry.js +24 -12
- package/dist/esm/bs-logo.entry.js +163 -0
- package/dist/esm/{bs-menu_2.entry.js → bs-menu-item.entry.js} +3 -15
- package/dist/esm/bs-menu.entry.js +15 -0
- package/dist/esm/bs-navigation-drawer-item.entry.js +102 -0
- package/dist/esm/bs-navigation-drawer.entry.js +85 -0
- package/dist/esm/bs-navigation-header.entry.js +42 -0
- package/dist/esm/bs-pagination.entry.js +83 -0
- package/dist/esm/bs-radio.entry.js +47 -0
- package/dist/esm/bs-slider.entry.js +189 -0
- package/dist/esm/bs-snackbar.entry.js +39 -0
- package/dist/esm/bs-source-link.entry.js +3 -3
- package/dist/esm/bs-switch.entry.js +55 -0
- package/dist/esm/bs-tab.entry.js +78 -0
- package/dist/esm/bs-tabs.entry.js +37 -0
- package/dist/esm/bs-tooltip.entry.js +2 -2
- package/dist/esm/{index-DP_bvuvB.js → index-Do3l4of3.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/bs-attachment/bs-attachment.d.ts +3 -9
- package/dist/types/components/bs-avatar/bs-avatar.d.ts +67 -0
- package/dist/types/components/bs-avatar/bs-avatar.stories.d.ts +20 -0
- package/dist/types/components/bs-breadcrumb/bs-breadcrumb/bs-breadcrumb.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-breadcrumb/bs-breadcrumb/bs-breadcrumb.d.ts +44 -0
- package/dist/types/components/bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.d.ts +69 -0
- package/dist/types/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.d.ts +45 -0
- package/dist/types/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.stories.d.ts +14 -0
- package/dist/types/components/bs-button/bs-button/bs-button.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-button/{bs-button.d.ts → bs-button/bs-button.d.ts} +5 -0
- package/dist/types/components/bs-button/{bs-button.stories.d.ts → bs-button/bs-button.stories.d.ts} +0 -2
- package/dist/types/components/bs-button/bs-icon-button/bs-icon-button.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-button/bs-icon-button/bs-icon-button.d.ts +51 -0
- package/dist/types/components/bs-button/bs-icon-button/bs-icon-button.stories.d.ts +16 -0
- package/dist/types/components/bs-button-skeleton/bs-button-skeleton.d.ts +1 -1
- package/dist/types/components/bs-button-skeleton/bs-button-skeleton.stories.d.ts +1 -1
- package/dist/types/components/bs-card/bs-card.d.ts +10 -1
- package/dist/types/components/bs-card/bs-card.stories.d.ts +1 -0
- package/dist/types/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.d.ts +36 -0
- package/dist/types/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.stories.d.ts +10 -0
- package/dist/types/components/bs-checkbox/bs-checkbox.d.ts +11 -0
- package/dist/types/components/bs-checkbox/bs-checkbox.stories.d.ts +1 -0
- package/dist/types/components/bs-composer/bs-composer.d.ts +26 -2
- package/dist/types/components/bs-composer-status-banner/bs-composer-status-banner.d.ts +14 -0
- package/dist/types/components/bs-dialog/bs-dialog.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-dialog/bs-dialog.d.ts +74 -0
- package/dist/types/components/{bs-modal/bs-modal.stories.d.ts → bs-dialog/bs-dialog.stories.d.ts} +5 -3
- package/dist/types/components/bs-input/bs-input.d.ts +8 -1
- package/dist/types/components/bs-logo/brandsync-logo-full-dark.d.ts +1 -0
- package/dist/types/components/bs-logo/brandsync-logo-full-light.d.ts +1 -0
- package/dist/types/components/bs-logo/brandsync-logo-mark.d.ts +1 -0
- package/dist/types/components/bs-logo/bs-logo.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-logo/bs-logo.d.ts +73 -0
- package/dist/types/components/bs-logo/bs-logo.stories.d.ts +17 -0
- package/dist/types/components/bs-pagination/bs-pagination.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-pagination/bs-pagination.d.ts +51 -0
- package/dist/types/components/bs-pagination/bs-pagination.stories.d.ts +14 -0
- package/dist/types/components/bs-radio/bs-radio.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-radio/bs-radio.d.ts +45 -0
- package/dist/types/components/bs-radio/bs-radio.stories.d.ts +16 -0
- package/dist/types/components/bs-slider/bs-slider.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-slider/bs-slider.d.ts +109 -0
- package/dist/types/components/bs-slider/bs-slider.stories.d.ts +24 -0
- package/dist/types/components/bs-snackbar/bs-snackbar.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-snackbar/bs-snackbar.d.ts +51 -0
- package/dist/types/components/bs-snackbar/bs-snackbar.stories.d.ts +16 -0
- package/dist/types/components/bs-switch/bs-switch.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-switch/bs-switch.d.ts +45 -0
- package/dist/types/components/bs-switch/bs-switch.stories.d.ts +17 -0
- package/dist/types/components/bs-tab/bs-inline-tab/bs-inline-tab.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-tab/bs-inline-tab/bs-inline-tab.d.ts +65 -0
- package/dist/types/components/bs-tab/bs-inline-tab/bs-inline-tab.stories.d.ts +22 -0
- package/dist/types/components/bs-tab/bs-tab/bs-tab.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-tab/bs-tab/bs-tab.d.ts +74 -0
- package/dist/types/components/bs-tab/bs-tab/bs-tab.stories.d.ts +30 -0
- package/dist/types/components/bs-tab/bs-tabs/bs-tabs.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-tab/bs-tabs/bs-tabs.d.ts +45 -0
- package/dist/types/components/bs-tab/bs-tabs/bs-tabs.stories.d.ts +13 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.cmp.test.d.ts +1 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.d.ts +104 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.stories.d.ts +19 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.cmp.test.d.ts +1 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.d.ts +103 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.stories.d.ts +20 -0
- package/dist/types/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.cmp.test.d.ts +1 -0
- package/dist/types/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.d.ts +60 -0
- package/dist/types/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.stories.d.ts +25 -0
- package/dist/types/components.d.ts +2908 -114
- package/package.json +1 -1
- package/dist/brandsync-wc/p-2598ca88.entry.js +0 -1
- package/dist/brandsync-wc/p-3dd9b814.entry.js +0 -1
- package/dist/brandsync-wc/p-41edb0a2.entry.js +0 -1
- package/dist/brandsync-wc/p-6254dcbe.entry.js +0 -1
- package/dist/brandsync-wc/p-7131d0a1.entry.js +0 -1
- package/dist/brandsync-wc/p-8c302968.entry.js +0 -1
- package/dist/brandsync-wc/p-8d78171b.entry.js +0 -1
- package/dist/brandsync-wc/p-93e44903.entry.js +0 -1
- package/dist/brandsync-wc/p-aa45d877.entry.js +0 -1
- package/dist/cjs/bs-modal.cjs.entry.js +0 -69
- package/dist/collection/components/bs-modal/bs-modal.css +0 -66
- package/dist/collection/components/bs-modal/bs-modal.js +0 -198
- package/dist/collection/components/bs-modal/bs-modal.stories.js +0 -38
- package/dist/components/bs-modal.js +0 -1
- package/dist/esm/bs-modal.entry.js +0 -67
- package/dist/types/components/bs-modal/bs-modal.d.ts +0 -45
- /package/dist/types/components/{bs-button/bs-button.cmp.test.d.ts → bs-avatar/bs-avatar.cmp.test.d.ts} +0 -0
- /package/dist/types/components/{bs-modal/bs-modal.cmp.test.d.ts → bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.cmp.test.d.ts} +0 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A numbered page control -- previous/next chevrons, page-number buttons, and `...` overflow for
|
|
4
|
+
* large page counts. Matches the Figma "Pagination" component's "Default" type (the classic
|
|
5
|
+
* numbered pagination); its other type ("jumper" -- a rows-per-page dropdown plus a page-jump
|
|
6
|
+
* input) is a structurally different composite widget and isn't covered by this component.
|
|
7
|
+
*
|
|
8
|
+
* `totalPages`/`currentPage` drive everything -- this computes which page numbers to show and
|
|
9
|
+
* where to collapse into `...` itself, the consumer never builds the button list by hand.
|
|
10
|
+
*
|
|
11
|
+
* ## When to use
|
|
12
|
+
* - Paging through a large, ordered result set (a table, a search results list) where jumping
|
|
13
|
+
* directly to a specific page number is useful.
|
|
14
|
+
*
|
|
15
|
+
* ## When not to use
|
|
16
|
+
* - Infinite-scroll or "load more" patterns -- those don't have a fixed, addressable page number.
|
|
17
|
+
* - A huge page count where users realistically only ever go forward/back one page at a time --
|
|
18
|
+
* plain prev/next controls (no numbers) are simpler there.
|
|
19
|
+
*
|
|
20
|
+
* @part list - The `<ul>` element.
|
|
21
|
+
* @part item - Each `<li>` in the list.
|
|
22
|
+
* @part prev - The previous-page button.
|
|
23
|
+
* @part next - The next-page button.
|
|
24
|
+
* @part page - Each page-number button.
|
|
25
|
+
* @part current - The current page's button (in addition to `page`).
|
|
26
|
+
* @part ellipsis - Each collapsed-range indicator.
|
|
27
|
+
*/
|
|
28
|
+
export class BsPagination {
|
|
29
|
+
/** Total number of pages. Must be a positive integer -- there's always at least one page. */
|
|
30
|
+
totalPages = 1;
|
|
31
|
+
/** The active page (1-indexed). Mutable + reflected so clicking a page button updates it
|
|
32
|
+
* directly, the same way `bs-modal`'s `open` self-manages, while `bsPageChange` still fires for
|
|
33
|
+
* the consumer to react to (e.g. fetching that page's data). */
|
|
34
|
+
currentPage = 1;
|
|
35
|
+
/** How many page numbers to show on each side of the current page before collapsing the rest
|
|
36
|
+
* into `...`. `1` (the default) reproduces the Figma spec's example exactly (page 1 of 12 shows
|
|
37
|
+
* `1 2 3 ... 12`). */
|
|
38
|
+
siblingCount = 1;
|
|
39
|
+
/** Accessible name for the previous-page button. */
|
|
40
|
+
previousLabel = 'Previous page';
|
|
41
|
+
/** Accessible name for the next-page button. */
|
|
42
|
+
nextLabel = 'Next page';
|
|
43
|
+
/** Fires whenever the active page changes as a result of the user clicking a page/prev/next
|
|
44
|
+
* button -- not when `currentPage` is set programmatically from outside. */
|
|
45
|
+
bsPageChange;
|
|
46
|
+
// Defends against any non-finite/negative input reaching the render/list-building logic below --
|
|
47
|
+
// e.g. an HTML attribute that failed to parse as a number resolves to an empty string, which
|
|
48
|
+
// Stencil can't coerce into a valid `number` prop, leaving it `undefined`/`null` rather than
|
|
49
|
+
// falling back to the class field's own default. `undefined * 2` is `NaN`, which silently
|
|
50
|
+
// corrupted every comparison in `getPageList` (confirmed: it rendered as two adjacent `...`s with
|
|
51
|
+
// pages 2/3 missing, not a crash) -- exactly the kind of quiet, hard-to-notice breakage a boundary
|
|
52
|
+
// check here prevents outright. Computed once and reused by both `getPageList` and `render`'s
|
|
53
|
+
// disabled checks, rather than repeating the same fallback logic in two places.
|
|
54
|
+
get safeTotalPages() {
|
|
55
|
+
return Number.isFinite(this.totalPages) && this.totalPages >= 1 ? this.totalPages : 1;
|
|
56
|
+
}
|
|
57
|
+
get safeSiblingCount() {
|
|
58
|
+
return Number.isFinite(this.siblingCount) && this.siblingCount >= 0 ? this.siblingCount : 1;
|
|
59
|
+
}
|
|
60
|
+
goToPage(page) {
|
|
61
|
+
if (page === this.currentPage || page < 1 || page > this.safeTotalPages)
|
|
62
|
+
return;
|
|
63
|
+
this.currentPage = page;
|
|
64
|
+
this.bsPageChange.emit(page);
|
|
65
|
+
}
|
|
66
|
+
getPageList() {
|
|
67
|
+
const { currentPage } = this;
|
|
68
|
+
const totalPages = this.safeTotalPages;
|
|
69
|
+
const siblingCount = this.safeSiblingCount;
|
|
70
|
+
const totalNumbersToShowBeforeCollapsing = siblingCount * 2 + 5;
|
|
71
|
+
if (totalNumbersToShowBeforeCollapsing >= totalPages) {
|
|
72
|
+
return range(1, totalPages);
|
|
73
|
+
}
|
|
74
|
+
const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
75
|
+
const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);
|
|
76
|
+
const showLeftEllipsis = leftSiblingIndex > 2;
|
|
77
|
+
const showRightEllipsis = rightSiblingIndex < totalPages - 1;
|
|
78
|
+
if (!showLeftEllipsis && showRightEllipsis) {
|
|
79
|
+
const leftItemCount = siblingCount * 2 + 1;
|
|
80
|
+
return [...range(1, leftItemCount), 'ellipsis', totalPages];
|
|
81
|
+
}
|
|
82
|
+
if (showLeftEllipsis && !showRightEllipsis) {
|
|
83
|
+
const rightItemCount = siblingCount * 2 + 1;
|
|
84
|
+
return [1, 'ellipsis', ...range(totalPages - rightItemCount + 1, totalPages)];
|
|
85
|
+
}
|
|
86
|
+
return [1, 'ellipsis', ...range(leftSiblingIndex, rightSiblingIndex), 'ellipsis', totalPages];
|
|
87
|
+
}
|
|
88
|
+
render() {
|
|
89
|
+
const pageList = this.getPageList();
|
|
90
|
+
return (h("nav", { key: '5c11c5d41a0ea748a6564dd6afe95acd1e1f7233', "aria-label": "Pagination" }, h("ul", { key: 'bbb88ec648d773e31cdfb5afadba74f465510acb', part: "list", class: "bs-pagination__list" }, h("li", { key: '7eb6c6c6b4e4f129d1b0ad09d6ad33bd1e529c39', part: "item", class: "bs-pagination__item" }, h("button", { key: '1b30bbf87077802e5fb70d0b5d5bde9b1556efbe', 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: 'e5f834332744d5caace2ff2da50dc9ea0fad6c51' }))), 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: '5e52c579ff5c2501470af0749f44dddf97bf268c', part: "item", class: "bs-pagination__item" }, h("button", { key: '6ae764d141460b432834dc79be6e094149e6f7c5', 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: 'c4e25fa5b69848ca35b9e907b0f90d0a2d8fbf14' }))))));
|
|
91
|
+
}
|
|
92
|
+
static get is() { return "bs-pagination"; }
|
|
93
|
+
static get encapsulation() { return "shadow"; }
|
|
94
|
+
static get originalStyleUrls() {
|
|
95
|
+
return {
|
|
96
|
+
"$": ["bs-pagination.css"]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static get styleUrls() {
|
|
100
|
+
return {
|
|
101
|
+
"$": ["bs-pagination.css"]
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
static get properties() {
|
|
105
|
+
return {
|
|
106
|
+
"totalPages": {
|
|
107
|
+
"type": "number",
|
|
108
|
+
"mutable": false,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "number",
|
|
111
|
+
"resolved": "number",
|
|
112
|
+
"references": {}
|
|
113
|
+
},
|
|
114
|
+
"required": false,
|
|
115
|
+
"optional": false,
|
|
116
|
+
"docs": {
|
|
117
|
+
"tags": [],
|
|
118
|
+
"text": "Total number of pages. Must be a positive integer -- there's always at least one page."
|
|
119
|
+
},
|
|
120
|
+
"getter": false,
|
|
121
|
+
"setter": false,
|
|
122
|
+
"reflect": false,
|
|
123
|
+
"attribute": "total-pages",
|
|
124
|
+
"defaultValue": "1"
|
|
125
|
+
},
|
|
126
|
+
"currentPage": {
|
|
127
|
+
"type": "number",
|
|
128
|
+
"mutable": true,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "number",
|
|
131
|
+
"resolved": "number",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": false,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "The active page (1-indexed). Mutable + reflected so clicking a page button updates it\ndirectly, the same way `bs-modal`'s `open` self-manages, while `bsPageChange` still fires for\nthe consumer to react to (e.g. fetching that page's data)."
|
|
139
|
+
},
|
|
140
|
+
"getter": false,
|
|
141
|
+
"setter": false,
|
|
142
|
+
"reflect": true,
|
|
143
|
+
"attribute": "current-page",
|
|
144
|
+
"defaultValue": "1"
|
|
145
|
+
},
|
|
146
|
+
"siblingCount": {
|
|
147
|
+
"type": "number",
|
|
148
|
+
"mutable": false,
|
|
149
|
+
"complexType": {
|
|
150
|
+
"original": "number",
|
|
151
|
+
"resolved": "number",
|
|
152
|
+
"references": {}
|
|
153
|
+
},
|
|
154
|
+
"required": false,
|
|
155
|
+
"optional": false,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": "How many page numbers to show on each side of the current page before collapsing the rest\ninto `...`. `1` (the default) reproduces the Figma spec's example exactly (page 1 of 12 shows\n`1 2 3 ... 12`)."
|
|
159
|
+
},
|
|
160
|
+
"getter": false,
|
|
161
|
+
"setter": false,
|
|
162
|
+
"reflect": false,
|
|
163
|
+
"attribute": "sibling-count",
|
|
164
|
+
"defaultValue": "1"
|
|
165
|
+
},
|
|
166
|
+
"previousLabel": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"mutable": false,
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "string",
|
|
171
|
+
"resolved": "string",
|
|
172
|
+
"references": {}
|
|
173
|
+
},
|
|
174
|
+
"required": false,
|
|
175
|
+
"optional": false,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": "Accessible name for the previous-page button."
|
|
179
|
+
},
|
|
180
|
+
"getter": false,
|
|
181
|
+
"setter": false,
|
|
182
|
+
"reflect": false,
|
|
183
|
+
"attribute": "previous-label",
|
|
184
|
+
"defaultValue": "'Previous page'"
|
|
185
|
+
},
|
|
186
|
+
"nextLabel": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"mutable": false,
|
|
189
|
+
"complexType": {
|
|
190
|
+
"original": "string",
|
|
191
|
+
"resolved": "string",
|
|
192
|
+
"references": {}
|
|
193
|
+
},
|
|
194
|
+
"required": false,
|
|
195
|
+
"optional": false,
|
|
196
|
+
"docs": {
|
|
197
|
+
"tags": [],
|
|
198
|
+
"text": "Accessible name for the next-page button."
|
|
199
|
+
},
|
|
200
|
+
"getter": false,
|
|
201
|
+
"setter": false,
|
|
202
|
+
"reflect": false,
|
|
203
|
+
"attribute": "next-label",
|
|
204
|
+
"defaultValue": "'Next page'"
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
static get events() {
|
|
209
|
+
return [{
|
|
210
|
+
"method": "bsPageChange",
|
|
211
|
+
"name": "bsPageChange",
|
|
212
|
+
"bubbles": true,
|
|
213
|
+
"cancelable": true,
|
|
214
|
+
"composed": true,
|
|
215
|
+
"docs": {
|
|
216
|
+
"tags": [],
|
|
217
|
+
"text": "Fires whenever the active page changes as a result of the user clicking a page/prev/next\nbutton -- not when `currentPage` is set programmatically from outside."
|
|
218
|
+
},
|
|
219
|
+
"complexType": {
|
|
220
|
+
"original": "number",
|
|
221
|
+
"resolved": "number",
|
|
222
|
+
"references": {}
|
|
223
|
+
}
|
|
224
|
+
}];
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function range(start, end) {
|
|
228
|
+
const length = end - start + 1;
|
|
229
|
+
return Array.from({ length }, (_, i) => start + i);
|
|
230
|
+
}
|
|
231
|
+
const ChevronLeftIcon = () => (h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M15 18L9 12L15 6", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
232
|
+
const ChevronRightIcon = () => (h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M9 18L15 12L9 6", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
233
|
+
const EllipsisIcon = () => (h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { componentDescription, propDescription } from "../../stories-utils";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Components/bs-pagination',
|
|
5
|
+
parameters: { docs: { description: { component: componentDescription('bs-pagination') } } },
|
|
6
|
+
render: args => html `
|
|
7
|
+
<bs-pagination
|
|
8
|
+
total-pages=${args.totalPages}
|
|
9
|
+
current-page=${args.currentPage}
|
|
10
|
+
sibling-count=${args.siblingCount}
|
|
11
|
+
@bsPageChange=${(ev) => console.log('bsPageChange', ev.detail)}
|
|
12
|
+
></bs-pagination>
|
|
13
|
+
`,
|
|
14
|
+
argTypes: {
|
|
15
|
+
totalPages: { control: { type: 'number', min: 1 }, description: propDescription('bs-pagination', 'totalPages') },
|
|
16
|
+
currentPage: { control: { type: 'number', min: 1 }, description: propDescription('bs-pagination', 'currentPage') },
|
|
17
|
+
siblingCount: { control: { type: 'number', min: 0 }, description: propDescription('bs-pagination', 'siblingCount') },
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
totalPages: 12,
|
|
21
|
+
currentPage: 1,
|
|
22
|
+
siblingCount: 1,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export default meta;
|
|
26
|
+
// Matches the Figma spec's own example exactly: 1 2 3 ... 12.
|
|
27
|
+
export const Default = {};
|
|
28
|
+
export const MiddlePage = {
|
|
29
|
+
name: 'Middle page (both ellipses)',
|
|
30
|
+
args: { currentPage: 6 },
|
|
31
|
+
};
|
|
32
|
+
export const LastPage = {
|
|
33
|
+
name: 'Last page',
|
|
34
|
+
args: { currentPage: 12 },
|
|
35
|
+
};
|
|
36
|
+
export const FewPages = {
|
|
37
|
+
name: 'Few pages (no ellipsis)',
|
|
38
|
+
args: { totalPages: 5, currentPage: 1 },
|
|
39
|
+
};
|
|
40
|
+
export const WiderSiblingCount = {
|
|
41
|
+
name: 'Wider sibling count',
|
|
42
|
+
args: { currentPage: 6, siblingCount: 2 },
|
|
43
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
2
|
+
describe('bs-radio', () => {
|
|
3
|
+
it('renders an unchecked native radio by default', async () => {
|
|
4
|
+
const { root } = await render(h("bs-radio", null));
|
|
5
|
+
const input = root.shadowRoot.querySelector('input');
|
|
6
|
+
expect(input).toEqualAttribute('type', 'radio');
|
|
7
|
+
expect(input.checked).toBe(false);
|
|
8
|
+
expect(root.shadowRoot.querySelector('[part="dot"]')).toBeNull();
|
|
9
|
+
});
|
|
10
|
+
it('reflects the checked prop to the native input and shows the center dot', async () => {
|
|
11
|
+
const { root } = await render(h("bs-radio", { checked: true }));
|
|
12
|
+
const input = root.shadowRoot.querySelector('input');
|
|
13
|
+
expect(input.checked).toBe(true);
|
|
14
|
+
expect(root.shadowRoot.querySelector('[part="circle"]')).toHaveClass('bs-radio__circle--selected');
|
|
15
|
+
expect(root.shadowRoot.querySelector('[part="dot"]')).not.toBeNull();
|
|
16
|
+
});
|
|
17
|
+
it('clicking the input checks it and emits bsChange with the value', async () => {
|
|
18
|
+
const { root, waitForChanges, spyOnEvent } = await render(h("bs-radio", { value: "one" }));
|
|
19
|
+
const bsChangeSpy = spyOnEvent('bsChange');
|
|
20
|
+
const input = root.shadowRoot.querySelector('input');
|
|
21
|
+
input.click();
|
|
22
|
+
await waitForChanges();
|
|
23
|
+
expect(input.checked).toBe(true);
|
|
24
|
+
expect(bsChangeSpy).toHaveReceivedEventTimes(1);
|
|
25
|
+
expect(bsChangeSpy).toHaveReceivedEventDetail('one');
|
|
26
|
+
});
|
|
27
|
+
it('passes name and value attributes through to the native input', async () => {
|
|
28
|
+
const { root } = await render(h("bs-radio", { name: "fruit", value: "apple" }));
|
|
29
|
+
const input = root.shadowRoot.querySelector('input');
|
|
30
|
+
expect(input).toEqualAttribute('name', 'fruit');
|
|
31
|
+
expect(input).toEqualAttribute('value', 'apple');
|
|
32
|
+
});
|
|
33
|
+
// NOTE: each <bs-radio> has its own shadow root, so its native <input> lives in its own separate
|
|
34
|
+
// DOM tree. Per the HTML spec, a "radio button group" is scoped to a single tree -- shadow DOM
|
|
35
|
+
// boundaries mean same-`name` inputs in *different* <bs-radio> instances are NOT part of the same
|
|
36
|
+
// native radio group, so clicking one does not natively uncheck another. This is a real, tested
|
|
37
|
+
// limitation of composing native <input type="radio"> inside separate shadow roots, not a bug in
|
|
38
|
+
// this component -- see bs-radio.mdx's Accessibility section for the documented gap. Within a
|
|
39
|
+
// single instance's own shadow root the native input still behaves like a normal radio input.
|
|
40
|
+
it('same-name bs-radio instances do NOT natively uncheck each other, since each lives in its own shadow root', async () => {
|
|
41
|
+
const { root, waitForChanges } = await render(h("div", null, h("bs-radio", { name: "fruit", value: "apple" }), h("bs-radio", { name: "fruit", value: "banana" })));
|
|
42
|
+
const [first, second] = Array.from(root.querySelectorAll('bs-radio'));
|
|
43
|
+
const firstInput = first.shadowRoot.querySelector('input');
|
|
44
|
+
const secondInput = second.shadowRoot.querySelector('input');
|
|
45
|
+
firstInput.click();
|
|
46
|
+
await waitForChanges();
|
|
47
|
+
expect(firstInput.checked).toBe(true);
|
|
48
|
+
secondInput.click();
|
|
49
|
+
await waitForChanges();
|
|
50
|
+
expect(secondInput.checked).toBe(true);
|
|
51
|
+
// Real (shadow-DOM-scoped) native behavior: the first input is untouched, not unchecked.
|
|
52
|
+
expect(firstInput.checked).toBe(true);
|
|
53
|
+
});
|
|
54
|
+
describe('disabled', () => {
|
|
55
|
+
it('sets the disabled attribute on the native input', async () => {
|
|
56
|
+
const { root } = await render(h("bs-radio", { disabled: true }));
|
|
57
|
+
const input = root.shadowRoot.querySelector('input');
|
|
58
|
+
expect(input).toHaveAttribute('disabled');
|
|
59
|
+
});
|
|
60
|
+
it('prevents toggling via click', async () => {
|
|
61
|
+
const { root, waitForChanges, spyOnEvent } = await render(h("bs-radio", { disabled: true }));
|
|
62
|
+
const bsChangeSpy = spyOnEvent('bsChange');
|
|
63
|
+
const input = root.shadowRoot.querySelector('input');
|
|
64
|
+
input.click();
|
|
65
|
+
await waitForChanges();
|
|
66
|
+
expect(input.checked).toBe(false);
|
|
67
|
+
expect(bsChangeSpy).toHaveReceivedEventTimes(0);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
it('renders label slot content', async () => {
|
|
71
|
+
const { root } = await render(h("bs-radio", null, "Option A"));
|
|
72
|
+
expect(root).toHaveTextContent('Option A');
|
|
73
|
+
const label = root.shadowRoot.querySelector('[part="label"]');
|
|
74
|
+
expect(label.querySelector('slot')).not.toBeNull();
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @prop --bs-radio-size: Diameter of the visual radio ring. Aliased to --bs-spacing-300.
|
|
3
|
+
* @prop --bs-radio-border-width: Width of the ring border.
|
|
4
|
+
* @prop --bs-radio-state-layer-size: Diameter of the hover/focus/pressed halo behind the ring.
|
|
5
|
+
* @prop --bs-radio-hit-area-size: Diameter of the layout box the state layer is centered in.
|
|
6
|
+
* @prop --bs-radio-gap: Gap between the ring and the label text. Aliased to --bs-spacing-100.
|
|
7
|
+
*/
|
|
8
|
+
:host {
|
|
9
|
+
display: inline-block;
|
|
10
|
+
|
|
11
|
+
--bs-radio-size: var(--bs-spacing-300);
|
|
12
|
+
--bs-radio-border-width: 2px;
|
|
13
|
+
--bs-radio-state-layer-size: 40px;
|
|
14
|
+
--bs-radio-hit-area-size: 48px;
|
|
15
|
+
--bs-radio-gap: var(--bs-spacing-100);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bs-radio {
|
|
19
|
+
position: relative;
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--bs-radio-gap);
|
|
23
|
+
font-family: inherit;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.bs-radio--disabled {
|
|
28
|
+
cursor: not-allowed;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* The native input is visually hidden but stays in the layout/focus/keyboard chain -- opacity: 0
|
|
32
|
+
(not display: none) so it can still receive and show focus. Covers the whole label (same
|
|
33
|
+
pattern as bs-checkbox) so clicking anywhere -- ring or label text -- toggles it. */
|
|
34
|
+
.bs-radio__input {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 100%;
|
|
40
|
+
margin: 0;
|
|
41
|
+
padding: 0;
|
|
42
|
+
opacity: 0;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.bs-radio__input:disabled {
|
|
47
|
+
cursor: not-allowed;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Outer clickable-area layout box -- just sizes/centers the state layer, carries no styling of
|
|
51
|
+
its own (the real hit target is the absolutely-positioned input above, covering the whole
|
|
52
|
+
label). */
|
|
53
|
+
.bs-radio__hit-area {
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
position: relative;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
width: var(--bs-radio-hit-area-size);
|
|
61
|
+
height: var(--bs-radio-hit-area-size);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* State layer -- the soft hover/focus/pressed background wash, distinct from the ring's own
|
|
65
|
+
border color. */
|
|
66
|
+
.bs-radio__state-layer {
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
width: var(--bs-radio-state-layer-size);
|
|
72
|
+
height: var(--bs-radio-state-layer-size);
|
|
73
|
+
border-radius: 50%;
|
|
74
|
+
background: var(--bs-radio-bg-default);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.bs-radio__circle {
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
width: var(--bs-radio-size);
|
|
84
|
+
height: var(--bs-radio-size);
|
|
85
|
+
border: var(--bs-radio-border-width) solid var(--bs-radio-enabled-border-default);
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
background: transparent;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.bs-radio__circle--selected {
|
|
91
|
+
border-color: var(--bs-radio-selected-border-default);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.bs-radio__dot {
|
|
95
|
+
width: 50%;
|
|
96
|
+
height: 50%;
|
|
97
|
+
border-radius: 50%;
|
|
98
|
+
background: var(--bs-radio-icon-checked);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Hover/focus/pressed -- keyed off the hidden native input's pseudo-classes, since it sits on top
|
|
102
|
+
of and covers the whole label, so it always reflects the user's actual pointer/keyboard target. */
|
|
103
|
+
.bs-radio__input:hover:not(:disabled) ~ .bs-radio__hit-area .bs-radio__state-layer {
|
|
104
|
+
background: var(--bs-radio-bg-hover);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.bs-radio__input:hover:not(:disabled) ~ .bs-radio__hit-area .bs-radio__circle {
|
|
108
|
+
border-color: var(--bs-radio-enabled-border-hover);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.bs-radio__input:hover:not(:disabled) ~ .bs-radio__hit-area .bs-radio__circle--selected {
|
|
112
|
+
border-color: var(--bs-radio-selected-border-hover);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.bs-radio__input:hover:not(:disabled) ~ .bs-radio__hit-area .bs-radio__circle--selected .bs-radio__dot {
|
|
116
|
+
background: var(--bs-radio-icon-hover);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.bs-radio__input:focus-visible ~ .bs-radio__hit-area .bs-radio__state-layer {
|
|
120
|
+
background: var(--bs-radio-bg-focus);
|
|
121
|
+
outline: 2px solid var(--bs-radio-focus-ring);
|
|
122
|
+
outline-offset: 2px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.bs-radio__input:focus-visible ~ .bs-radio__hit-area .bs-radio__circle {
|
|
126
|
+
border-color: var(--bs-radio-enabled-border-focus);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.bs-radio__input:focus-visible ~ .bs-radio__hit-area .bs-radio__circle--selected {
|
|
130
|
+
border-color: var(--bs-radio-selected-border-focus);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.bs-radio__input:active:not(:disabled) ~ .bs-radio__hit-area .bs-radio__state-layer {
|
|
134
|
+
background: var(--bs-radio-bg-pressed);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.bs-radio__input:active:not(:disabled) ~ .bs-radio__hit-area .bs-radio__circle {
|
|
138
|
+
border-color: var(--bs-radio-enabled-border-pressed);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.bs-radio__input:active:not(:disabled) ~ .bs-radio__hit-area .bs-radio__circle--selected {
|
|
142
|
+
border-color: var(--bs-radio-selected-border-pressed);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.bs-radio__input:disabled ~ .bs-radio__hit-area .bs-radio__state-layer {
|
|
146
|
+
background: var(--bs-radio-bg-disabled);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.bs-radio__input:disabled ~ .bs-radio__hit-area .bs-radio__circle {
|
|
150
|
+
border-color: var(--bs-radio-border-disabled);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.bs-radio__input:disabled ~ .bs-radio__hit-area .bs-radio__circle--selected .bs-radio__dot {
|
|
154
|
+
background: var(--bs-radio-icon-disabled);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.bs-radio__label {
|
|
158
|
+
font-size: var(--bs-font-size-md);
|
|
159
|
+
color: var(--bs-radio-label-default);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.bs-radio--disabled .bs-radio__label {
|
|
163
|
+
color: var(--bs-radio-label-disabled);
|
|
164
|
+
}
|