@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,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DHVw-IPK.js');
|
|
4
|
+
|
|
5
|
+
const bsPaginationCss = () => `:host{display:inline-block;--bs-pagination-gap:var(--bs-spacing-50);--bs-pagination-size:var(--bs-spacing-550);--bs-pagination-radius:var(--bs-border-radius-100);--bs-pagination-font-size:var(--bs-font-size-md);--bs-pagination-line-height:var(--bs-line-height-body-md);--bs-pagination-color:var(--bs-text-secondary);--bs-pagination-color-disabled:var(--bs-icon-disabled);--bs-pagination-hover:var(--bs-color-neutral-container-hover);--bs-pagination-pressed:var(--bs-color-neutral-container-pressed);--bs-pagination-current-bg:var(--bs-color-primary-default);--bs-pagination-current-bg-hover:var(--bs-color-primary-hover);--bs-pagination-current-bg-pressed:var(--bs-color-primary-pressed);--bs-pagination-current-color:var(--bs-text-on-action);--bs-pagination-focus-ring-color:var(--bs-border-neutral-focus)}.bs-pagination__list{display:flex;align-items:center;flex-wrap:wrap;margin:0;padding:0;list-style:none;gap:var(--bs-pagination-gap);font-family:inherit}.bs-pagination__item{display:flex}.bs-pagination__control{display:flex;align-items:center;justify-content:center;width:var(--bs-pagination-size);height:var(--bs-pagination-size);padding:0;border:none;border-radius:var(--bs-pagination-radius);background:transparent;color:var(--bs-pagination-color);font-family:inherit;font-size:var(--bs-pagination-font-size);line-height:calc(var(--bs-pagination-line-height) * 1px);cursor:pointer}.bs-pagination__control svg{width:24px;height:24px}.bs-pagination__control:disabled{color:var(--bs-pagination-color-disabled);cursor:not-allowed}.bs-pagination__page:not(:disabled):hover{background:var(--bs-pagination-hover)}.bs-pagination__page:not(:disabled):active{background:var(--bs-pagination-pressed)}.bs-pagination__control:focus-visible{outline:2px solid var(--bs-pagination-focus-ring-color);outline-offset:2px}.bs-pagination__page--current{background:var(--bs-pagination-current-bg);color:var(--bs-pagination-current-color)}.bs-pagination__page--current:hover{background:var(--bs-pagination-current-bg-hover)}.bs-pagination__page--current:active{background:var(--bs-pagination-current-bg-pressed)}.bs-pagination__ellipsis{display:flex;align-items:center;justify-content:center;width:var(--bs-pagination-size);height:var(--bs-pagination-size);color:var(--bs-pagination-color)}.bs-pagination__ellipsis svg{width:24px;height:24px}`;
|
|
6
|
+
|
|
7
|
+
const BsPagination = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.bsPageChange = index.createEvent(this, "bsPageChange");
|
|
11
|
+
}
|
|
12
|
+
/** Total number of pages. Must be a positive integer -- there's always at least one page. */
|
|
13
|
+
totalPages = 1;
|
|
14
|
+
/** The active page (1-indexed). Mutable + reflected so clicking a page button updates it
|
|
15
|
+
* directly, the same way `bs-modal`'s `open` self-manages, while `bsPageChange` still fires for
|
|
16
|
+
* the consumer to react to (e.g. fetching that page's data). */
|
|
17
|
+
currentPage = 1;
|
|
18
|
+
/** How many page numbers to show on each side of the current page before collapsing the rest
|
|
19
|
+
* into `...`. `1` (the default) reproduces the Figma spec's example exactly (page 1 of 12 shows
|
|
20
|
+
* `1 2 3 ... 12`). */
|
|
21
|
+
siblingCount = 1;
|
|
22
|
+
/** Accessible name for the previous-page button. */
|
|
23
|
+
previousLabel = 'Previous page';
|
|
24
|
+
/** Accessible name for the next-page button. */
|
|
25
|
+
nextLabel = 'Next page';
|
|
26
|
+
/** Fires whenever the active page changes as a result of the user clicking a page/prev/next
|
|
27
|
+
* button -- not when `currentPage` is set programmatically from outside. */
|
|
28
|
+
bsPageChange;
|
|
29
|
+
// Defends against any non-finite/negative input reaching the render/list-building logic below --
|
|
30
|
+
// e.g. an HTML attribute that failed to parse as a number resolves to an empty string, which
|
|
31
|
+
// Stencil can't coerce into a valid `number` prop, leaving it `undefined`/`null` rather than
|
|
32
|
+
// falling back to the class field's own default. `undefined * 2` is `NaN`, which silently
|
|
33
|
+
// corrupted every comparison in `getPageList` (confirmed: it rendered as two adjacent `...`s with
|
|
34
|
+
// pages 2/3 missing, not a crash) -- exactly the kind of quiet, hard-to-notice breakage a boundary
|
|
35
|
+
// check here prevents outright. Computed once and reused by both `getPageList` and `render`'s
|
|
36
|
+
// disabled checks, rather than repeating the same fallback logic in two places.
|
|
37
|
+
get safeTotalPages() {
|
|
38
|
+
return Number.isFinite(this.totalPages) && this.totalPages >= 1 ? this.totalPages : 1;
|
|
39
|
+
}
|
|
40
|
+
get safeSiblingCount() {
|
|
41
|
+
return Number.isFinite(this.siblingCount) && this.siblingCount >= 0 ? this.siblingCount : 1;
|
|
42
|
+
}
|
|
43
|
+
goToPage(page) {
|
|
44
|
+
if (page === this.currentPage || page < 1 || page > this.safeTotalPages)
|
|
45
|
+
return;
|
|
46
|
+
this.currentPage = page;
|
|
47
|
+
this.bsPageChange.emit(page);
|
|
48
|
+
}
|
|
49
|
+
getPageList() {
|
|
50
|
+
const { currentPage } = this;
|
|
51
|
+
const totalPages = this.safeTotalPages;
|
|
52
|
+
const siblingCount = this.safeSiblingCount;
|
|
53
|
+
const totalNumbersToShowBeforeCollapsing = siblingCount * 2 + 5;
|
|
54
|
+
if (totalNumbersToShowBeforeCollapsing >= totalPages) {
|
|
55
|
+
return range(1, totalPages);
|
|
56
|
+
}
|
|
57
|
+
const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
58
|
+
const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);
|
|
59
|
+
const showLeftEllipsis = leftSiblingIndex > 2;
|
|
60
|
+
const showRightEllipsis = rightSiblingIndex < totalPages - 1;
|
|
61
|
+
if (!showLeftEllipsis && showRightEllipsis) {
|
|
62
|
+
const leftItemCount = siblingCount * 2 + 1;
|
|
63
|
+
return [...range(1, leftItemCount), 'ellipsis', totalPages];
|
|
64
|
+
}
|
|
65
|
+
if (showLeftEllipsis && !showRightEllipsis) {
|
|
66
|
+
const rightItemCount = siblingCount * 2 + 1;
|
|
67
|
+
return [1, 'ellipsis', ...range(totalPages - rightItemCount + 1, totalPages)];
|
|
68
|
+
}
|
|
69
|
+
return [1, 'ellipsis', ...range(leftSiblingIndex, rightSiblingIndex), 'ellipsis', totalPages];
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
const pageList = this.getPageList();
|
|
73
|
+
return (index.h("nav", { key: '5c11c5d41a0ea748a6564dd6afe95acd1e1f7233', "aria-label": "Pagination" }, index.h("ul", { key: 'bbb88ec648d773e31cdfb5afadba74f465510acb', part: "list", class: "bs-pagination__list" }, index.h("li", { key: '7eb6c6c6b4e4f129d1b0ad09d6ad33bd1e529c39', part: "item", class: "bs-pagination__item" }, index.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) }, index.h(ChevronLeftIcon, { key: 'e5f834332744d5caace2ff2da50dc9ea0fad6c51' }))), pageList.map((item, index$1) => item === 'ellipsis' ? (index.h("li", { part: "item", class: "bs-pagination__item", key: `ellipsis-${index$1}` }, index.h("span", { part: "ellipsis", class: "bs-pagination__ellipsis", "aria-hidden": "true" }, index.h(EllipsisIcon, null)))) : (index.h("li", { part: "item", class: "bs-pagination__item", key: item }, index.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)))), index.h("li", { key: '5e52c579ff5c2501470af0749f44dddf97bf268c', part: "item", class: "bs-pagination__item" }, index.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) }, index.h(ChevronRightIcon, { key: 'c4e25fa5b69848ca35b9e907b0f90d0a2d8fbf14' }))))));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
function range(start, end) {
|
|
77
|
+
const length = end - start + 1;
|
|
78
|
+
return Array.from({ length }, (_, i) => start + i);
|
|
79
|
+
}
|
|
80
|
+
const ChevronLeftIcon = () => (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, index.h("path", { d: "M15 18L9 12L15 6", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
81
|
+
const ChevronRightIcon = () => (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, index.h("path", { d: "M9 18L15 12L9 6", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
82
|
+
const EllipsisIcon = () => (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, index.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" }), index.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" }), index.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" })));
|
|
83
|
+
BsPagination.style = bsPaginationCss();
|
|
84
|
+
|
|
85
|
+
exports.bs_pagination = BsPagination;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DHVw-IPK.js');
|
|
4
|
+
|
|
5
|
+
const bsRadioCss = () => `:host{display:inline-block;--bs-radio-size:var(--bs-spacing-300);--bs-radio-border-width:2px;--bs-radio-state-layer-size:40px;--bs-radio-hit-area-size:48px;--bs-radio-gap:var(--bs-spacing-100)}.bs-radio{position:relative;display:inline-flex;align-items:center;gap:var(--bs-radio-gap);font-family:inherit;cursor:pointer}.bs-radio--disabled{cursor:not-allowed}.bs-radio__input{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:pointer}.bs-radio__input:disabled{cursor:not-allowed}.bs-radio__hit-area{box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--bs-radio-hit-area-size);height:var(--bs-radio-hit-area-size)}.bs-radio__state-layer{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:var(--bs-radio-state-layer-size);height:var(--bs-radio-state-layer-size);border-radius:50%;background:var(--bs-radio-bg-default)}.bs-radio__circle{box-sizing:border-box;display:flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--bs-radio-size);height:var(--bs-radio-size);border:var(--bs-radio-border-width) solid var(--bs-radio-enabled-border-default);border-radius:50%;background:transparent}.bs-radio__circle--selected{border-color:var(--bs-radio-selected-border-default)}.bs-radio__dot{width:50%;height:50%;border-radius:50%;background:var(--bs-radio-icon-checked)}.bs-radio__input:hover:not(:disabled)~.bs-radio__hit-area .bs-radio__state-layer{background:var(--bs-radio-bg-hover)}.bs-radio__input:hover:not(:disabled)~.bs-radio__hit-area .bs-radio__circle{border-color:var(--bs-radio-enabled-border-hover)}.bs-radio__input:hover:not(:disabled)~.bs-radio__hit-area .bs-radio__circle--selected{border-color:var(--bs-radio-selected-border-hover)}.bs-radio__input:hover:not(:disabled)~.bs-radio__hit-area .bs-radio__circle--selected .bs-radio__dot{background:var(--bs-radio-icon-hover)}.bs-radio__input:focus-visible~.bs-radio__hit-area .bs-radio__state-layer{background:var(--bs-radio-bg-focus);outline:2px solid var(--bs-radio-focus-ring);outline-offset:2px}.bs-radio__input:focus-visible~.bs-radio__hit-area .bs-radio__circle{border-color:var(--bs-radio-enabled-border-focus)}.bs-radio__input:focus-visible~.bs-radio__hit-area .bs-radio__circle--selected{border-color:var(--bs-radio-selected-border-focus)}.bs-radio__input:active:not(:disabled)~.bs-radio__hit-area .bs-radio__state-layer{background:var(--bs-radio-bg-pressed)}.bs-radio__input:active:not(:disabled)~.bs-radio__hit-area .bs-radio__circle{border-color:var(--bs-radio-enabled-border-pressed)}.bs-radio__input:active:not(:disabled)~.bs-radio__hit-area .bs-radio__circle--selected{border-color:var(--bs-radio-selected-border-pressed)}.bs-radio__input:disabled~.bs-radio__hit-area .bs-radio__state-layer{background:var(--bs-radio-bg-disabled)}.bs-radio__input:disabled~.bs-radio__hit-area .bs-radio__circle{border-color:var(--bs-radio-border-disabled)}.bs-radio__input:disabled~.bs-radio__hit-area .bs-radio__circle--selected .bs-radio__dot{background:var(--bs-radio-icon-disabled)}.bs-radio__label{font-size:var(--bs-font-size-md);color:var(--bs-radio-label-default)}.bs-radio--disabled .bs-radio__label{color:var(--bs-radio-label-disabled)}`;
|
|
6
|
+
|
|
7
|
+
const BsRadio = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.bsChange = index.createEvent(this, "bsChange");
|
|
11
|
+
}
|
|
12
|
+
get el() { return index.getElement(this); }
|
|
13
|
+
/** The native radio input's `name` attribute. Passed straight through to the native input inside.
|
|
14
|
+
* NOTE: because each `bs-radio` renders its own shadow root, native `<input type="radio">`
|
|
15
|
+
* mutual-exclusion grouping (which the HTML spec scopes to a single DOM tree) does NOT extend
|
|
16
|
+
* across separate `bs-radio` instances sharing the same `name` -- checking one will not natively
|
|
17
|
+
* uncheck another. Within a single instance this still behaves like a normal radio input. See
|
|
18
|
+
* bs-radio.mdx's Accessibility section for this known gap; consumers building a group currently
|
|
19
|
+
* need to manage mutual exclusivity themselves (e.g. via `bsChange`) until a `bs-radio-group`
|
|
20
|
+
* wrapper exists. */
|
|
21
|
+
name;
|
|
22
|
+
/** The native radio input's `value` attribute -- read from `event.target.value`, or used when
|
|
23
|
+
* wiring the group up to a form. */
|
|
24
|
+
value;
|
|
25
|
+
/** Whether the radio is checked. Mutable so clicking the label/input sets it directly. */
|
|
26
|
+
checked = false;
|
|
27
|
+
/** Disables the radio: sets the native `disabled` attribute, suppresses hover/focus styling, and
|
|
28
|
+
* prevents toggling. */
|
|
29
|
+
disabled = false;
|
|
30
|
+
/** Emitted with this radio's own `value` when it becomes checked via user interaction. Since
|
|
31
|
+
* native same-`name` grouping doesn't cross shadow-root boundaries (see the `name` prop's doc),
|
|
32
|
+
* a consumer wiring up a group of `bs-radio`s must itself set `checked = false` on the others in
|
|
33
|
+
* response to this event -- there's no automatic un-checking to rely on here. */
|
|
34
|
+
bsChange;
|
|
35
|
+
onChange = (ev) => {
|
|
36
|
+
const checked = ev.target.checked;
|
|
37
|
+
this.checked = checked;
|
|
38
|
+
if (checked) {
|
|
39
|
+
this.bsChange.emit(this.value);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
render() {
|
|
43
|
+
return (index.h("label", { key: '4c6ce599b279240445e60b89fc909f55e105cc69', class: `bs-radio ${this.disabled ? 'bs-radio--disabled' : ''}` }, index.h("input", { key: '26ca5de7011a9c0b1d2d61c35e8859ebe5e2041f', class: "bs-radio__input", type: "radio", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, onChange: this.onChange }), index.h("span", { key: '3cd825f6153e79c6aede28a9ebb9f4d9ee3b2d6e', class: "bs-radio__hit-area" }, index.h("span", { key: '3a1e5b58a14a6f94770ae9dca5a541ade38efcfc', class: "bs-radio__state-layer" }, index.h("span", { key: '83391c2364a58a1cb1582fca112abd77886e5b10', part: "circle", class: `bs-radio__circle ${this.checked ? 'bs-radio__circle--selected' : ''}` }, this.checked && index.h("span", { key: '799e979b2b299f05b535a66604fa7c975fd43456', part: "dot", class: "bs-radio__dot" })))), index.h("span", { key: '89271b1d0c8460b4fce80a21b3c3fe2029630046', part: "label", class: "bs-radio__label" }, index.h("slot", { key: 'e5401f3f384330a51e51b7309a459bcb237e9034' }))));
|
|
44
|
+
}
|
|
45
|
+
static get delegatesFocus() { return true; }
|
|
46
|
+
};
|
|
47
|
+
BsRadio.style = bsRadioCss();
|
|
48
|
+
|
|
49
|
+
exports.bs_radio = BsRadio;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DHVw-IPK.js');
|
|
4
|
+
|
|
5
|
+
const bsSliderCss = () => `:host{display:block;--bs-slider-gap:var(--bs-spacing-100);--bs-slider-label-color:var(--bs-text-default);--bs-slider-label-color-disabled:var(--bs-text-muted);--bs-slider-label-font-weight:var(--bs-font-weight-semibold);--bs-slider-track-height:var(--bs-spacing-50);--bs-slider-track-radius:var(--bs-border-radius-full);--bs-slider-track-bg:var(--bs-surface-container);--bs-slider-track-bg-disabled:var(--bs-surface-action-disabled);--bs-slider-fill-bg:var(--bs-surface-action);--bs-slider-fill-bg-disabled:var(--bs-surface-on-action-disabled);--bs-slider-knob-hit-size:var(--bs-spacing-600);--bs-slider-knob-size:var(--bs-spacing-300);--bs-slider-knob-bg:var(--bs-surface-action);--bs-slider-knob-color-disabled:var(--bs-surface-on-action-disabled);--bs-slider-focus-ring-color:var(--bs-border-primary-focus);--bs-slider-focus-ring-gap-color:var(--bs-surface-base);--bs-slider-tick-bg:var(--bs-surface-inset);--bs-slider-tooltip-bg:var(--bs-surface-inverse);--bs-slider-tooltip-color:var(--bs-text-inverse);--bs-slider-tooltip-radius:var(--bs-border-radius-50);--bs-slider-field-width:56px;--bs-slider-field-border:var(--bs-input-border-default);--bs-slider-field-bg:var(--bs-input-bg-default);--bs-slider-field-radius:var(--bs-border-radius-100);--bs-slider-field-text:var(--bs-input-text);--bs-slider-field-text-disabled:var(--bs-text-on-disabled);--bs-slider-bound-color:var(--bs-text-default);--bs-slider-bound-color-disabled:var(--bs-text-on-disabled)}.bs-slider{display:flex;flex-direction:column;gap:var(--bs-slider-gap);font-family:inherit}.bs-slider__label{font-size:var(--bs-font-size-sm);font-weight:var(--bs-slider-label-font-weight);color:var(--bs-slider-label-color)}.bs-slider--disabled .bs-slider__label{color:var(--bs-slider-label-color-disabled);font-weight:normal}.bs-slider__header{display:flex;align-items:center;justify-content:space-between;gap:var(--bs-slider-gap)}.bs-slider__value-fields{display:flex;align-items:center;gap:var(--bs-spacing-100)}.bs-slider__row{display:flex;align-items:center;gap:var(--bs-slider-gap)}.bs-slider__bound{color:var(--bs-slider-bound-color);font-size:var(--bs-font-size-md);flex-shrink:0}.bs-slider--disabled .bs-slider__bound{color:var(--bs-slider-bound-color-disabled)}.bs-slider__separator{color:var(--bs-slider-field-text);flex-shrink:0}.bs-slider--disabled .bs-slider__separator{color:var(--bs-slider-field-text-disabled)}.bs-slider__field{box-sizing:border-box;display:flex;align-items:center;gap:var(--bs-spacing-25);flex-shrink:0;width:var(--bs-slider-field-width);border:1px solid var(--bs-slider-field-border);border-radius:var(--bs-slider-field-radius);background:var(--bs-slider-field-bg);padding:var(--bs-spacing-50) var(--bs-spacing-100)}.bs-slider--disabled .bs-slider__field{cursor:not-allowed}.bs-slider__field-input{flex:1;min-width:0;border:none;outline:none;padding:0;background:transparent;color:var(--bs-slider-field-text);font-size:var(--bs-font-size-sm);font-family:inherit;text-align:left;-moz-appearance:textfield}.bs-slider__field-suffix{flex-shrink:0;color:var(--bs-slider-field-text);font-size:var(--bs-font-size-sm)}.bs-slider--disabled .bs-slider__field-suffix{color:var(--bs-slider-field-text-disabled)}.bs-slider__field-input::-webkit-outer-spin-button,.bs-slider__field-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.bs-slider__field-input:disabled{color:var(--bs-slider-field-text-disabled);cursor:not-allowed}.bs-slider__track-wrapper{position:relative;flex:1;min-width:0;height:var(--bs-slider-knob-hit-size);display:flex;align-items:center}.bs-slider__track{position:relative;width:100%;height:var(--bs-slider-track-height);border-radius:var(--bs-slider-track-radius);background:var(--bs-slider-track-bg);overflow:visible;pointer-events:none}.bs-slider--disabled .bs-slider__track{background:var(--bs-slider-track-bg-disabled)}.bs-slider__track-fill{position:absolute;top:0;bottom:0;left:var(--bs-slider-fill-start, 0%);right:calc(100% - var(--bs-slider-fill-end, 0%));border-radius:var(--bs-slider-track-radius);background:var(--bs-slider-fill-bg)}.bs-slider--disabled .bs-slider__track-fill{background:var(--bs-slider-fill-bg-disabled)}.bs-slider__ticks{position:absolute;top:50%;left:0;width:100%;height:0;display:flex;justify-content:space-between;transform:translateY(-50%);pointer-events:none}.bs-slider__tick{width:2px;height:var(--bs-spacing-50);background:var(--bs-slider-tick-bg)}.bs-slider__tick--hidden{opacity:0}.bs-slider__input{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;appearance:none;background:transparent;cursor:pointer}.bs-slider--disabled .bs-slider__input{cursor:not-allowed}.bs-slider__input::-webkit-slider-runnable-track{background:transparent}.bs-slider__input::-moz-range-track{background:transparent}.bs-slider__input::-webkit-slider-thumb{appearance:none;box-sizing:border-box;width:var(--bs-slider-knob-size);height:var(--bs-slider-knob-size);border-radius:var(--bs-border-radius-full);border:none;background:var(--bs-slider-knob-bg);cursor:pointer}.bs-slider__input::-moz-range-thumb{box-sizing:border-box;width:var(--bs-slider-knob-size);height:var(--bs-slider-knob-size);border-radius:var(--bs-border-radius-full);border:none;background:var(--bs-slider-knob-bg);cursor:pointer}.bs-slider--disabled .bs-slider__input::-webkit-slider-thumb{cursor:not-allowed;background:var(--bs-slider-knob-color-disabled)}.bs-slider--disabled .bs-slider__input::-moz-range-thumb{cursor:not-allowed;background:var(--bs-slider-knob-color-disabled)}.bs-slider__input--start,.bs-slider__input--end{pointer-events:none}.bs-slider__input--start::-webkit-slider-thumb,.bs-slider__input--end::-webkit-slider-thumb{pointer-events:auto}.bs-slider__input--start::-moz-range-thumb,.bs-slider__input--end::-moz-range-thumb{pointer-events:auto}.bs-slider__input:focus-visible::-webkit-slider-thumb,.bs-slider__input:active::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--bs-slider-focus-ring-gap-color), 0 0 0 4px var(--bs-slider-focus-ring-color)}.bs-slider__input:focus-visible::-moz-range-thumb,.bs-slider__input:active::-moz-range-thumb{box-shadow:0 0 0 2px var(--bs-slider-focus-ring-gap-color), 0 0 0 4px var(--bs-slider-focus-ring-color)}.bs-slider__tooltip{position:absolute;bottom:calc(50% + 38px);transform:translateX(-50%);padding:var(--bs-spacing-25) var(--bs-spacing-100);background:var(--bs-slider-tooltip-bg);color:var(--bs-slider-tooltip-color);border-radius:var(--bs-slider-tooltip-radius);font-size:var(--bs-font-size-xs);white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.1s ease}.bs-slider__tooltip::after{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);width:8px;height:8px;background:var(--bs-slider-tooltip-bg);clip-path:polygon(50% 100%, 0% 0%, 100% 0%)}.bs-slider__input:focus-visible~.bs-slider__tooltip,.bs-slider__input:active~.bs-slider__tooltip{opacity:1}.bs-slider__input--start:focus-visible~.bs-slider__tooltip--end,.bs-slider__input--start:active~.bs-slider__tooltip--end,.bs-slider__input--end:focus-visible~.bs-slider__tooltip--start,.bs-slider__input--end:active~.bs-slider__tooltip--start{opacity:0}`;
|
|
6
|
+
|
|
7
|
+
const BsSlider = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.bsChange = index.createEvent(this, "bsChange");
|
|
11
|
+
this.bsRangeChange = index.createEvent(this, "bsRangeChange");
|
|
12
|
+
}
|
|
13
|
+
get el() { return index.getElement(this); }
|
|
14
|
+
/** Which slider shape to render. `range` uses two thumbs (`valueStart`/`valueEnd`); `default`
|
|
15
|
+
* and `segmented` use one thumb (`value`). `segmented` additionally draws `segments` tick marks
|
|
16
|
+
* along the track. */
|
|
17
|
+
type = 'default';
|
|
18
|
+
/** Shows/hides the "Label" text and editable percentage field(s) above the track, and the
|
|
19
|
+
* static min/max bound labels flanking it. When `false`, only the bare track (and its
|
|
20
|
+
* knob/knobs) renders. */
|
|
21
|
+
showLabel = true;
|
|
22
|
+
/** Label text shown above the track when `showLabel` is set. */
|
|
23
|
+
label = 'Label';
|
|
24
|
+
/** Minimum selectable value, for all `type`s. */
|
|
25
|
+
min = 0;
|
|
26
|
+
/** Maximum selectable value, for all `type`s. */
|
|
27
|
+
max = 100;
|
|
28
|
+
/** Step size between selectable values. For `type="segmented"`, the effective step is derived
|
|
29
|
+
* from `(max - min) / segments` instead, so the thumb always snaps to a tick. */
|
|
30
|
+
step = 1;
|
|
31
|
+
/** Current value for `type="default"`/`type="segmented"`. Ignored for `type="range"` -- use
|
|
32
|
+
* `valueStart`/`valueEnd` instead. Mutable so dragging the thumb updates it directly. */
|
|
33
|
+
value = 0;
|
|
34
|
+
/** Lower thumb's value for `type="range"`. Defaults to `min` when unset. Mutable so dragging the
|
|
35
|
+
* thumb updates it directly. */
|
|
36
|
+
valueStart;
|
|
37
|
+
/** Upper thumb's value for `type="range"`. Defaults to `max` when unset. Mutable so dragging the
|
|
38
|
+
* thumb updates it directly. */
|
|
39
|
+
valueEnd;
|
|
40
|
+
/** Number of equal divisions marked by tick lines along the track, for `type="segmented"` only.
|
|
41
|
+
* The first tick (at the very start of the track) is rendered with `opacity: 0` to keep the
|
|
42
|
+
* tick spacing math consistent while not visually doubling up with the track's own start edge --
|
|
43
|
+
* this matches the design spec, not a bug. */
|
|
44
|
+
segments = 10;
|
|
45
|
+
/** Disables the slider: sets the native `disabled` attribute on the range input(s), suppresses
|
|
46
|
+
* hover/focus/drag styling and the value tooltip, and prevents interaction. */
|
|
47
|
+
disabled = false;
|
|
48
|
+
/**
|
|
49
|
+
* Accessible name for the slider's native range input(s). Required whenever `showLabel` is
|
|
50
|
+
* `false` (a bare track with no visible "Label" text) -- without it, the internal native
|
|
51
|
+
* `<input>` has no accessible name at all. Setting `aria-label` directly on the `<bs-slider>`
|
|
52
|
+
* host does NOT work for this: that attribute stays on the light-DOM host and is never forwarded
|
|
53
|
+
* into the shadow DOM by the browser. Same pattern/reasoning as `bs-switch`'s and `bs-checkbox`'s
|
|
54
|
+
* identical `ariaLabel` prop. For `type="range"`, this labels the lower-bound thumb; the
|
|
55
|
+
* upper-bound thumb gets `"${ariaLabel} end"` (or `"End value"` when `ariaLabel` is unset).
|
|
56
|
+
*/
|
|
57
|
+
ariaLabel = null;
|
|
58
|
+
/** Emitted when `value` changes via user interaction (dragging the thumb, or committing the
|
|
59
|
+
* value field), with the new value. Only fires for `type="default"`/`type="segmented"`. */
|
|
60
|
+
bsChange;
|
|
61
|
+
/** Emitted when `valueStart`/`valueEnd` changes via user interaction, with both current values.
|
|
62
|
+
* Only fires for `type="range"`. */
|
|
63
|
+
bsRangeChange;
|
|
64
|
+
get effectiveValueStart() {
|
|
65
|
+
return this.valueStart ?? this.min;
|
|
66
|
+
}
|
|
67
|
+
get effectiveValueEnd() {
|
|
68
|
+
return this.valueEnd ?? this.max;
|
|
69
|
+
}
|
|
70
|
+
/** Effective step for the native range input(s): `step` as-is, except for `type="segmented"`,
|
|
71
|
+
* where it's derived from `segments` so the thumb always lands on a tick. */
|
|
72
|
+
get effectiveStep() {
|
|
73
|
+
if (this.type === 'segmented' && this.segments > 0) {
|
|
74
|
+
return (this.max - this.min) / this.segments;
|
|
75
|
+
}
|
|
76
|
+
return this.step;
|
|
77
|
+
}
|
|
78
|
+
clamp(n) {
|
|
79
|
+
if (Number.isNaN(n))
|
|
80
|
+
return this.min;
|
|
81
|
+
return Math.min(this.max, Math.max(this.min, n));
|
|
82
|
+
}
|
|
83
|
+
percent(value) {
|
|
84
|
+
if (this.max === this.min)
|
|
85
|
+
return 0;
|
|
86
|
+
return ((value - this.min) / (this.max - this.min)) * 100;
|
|
87
|
+
}
|
|
88
|
+
onInputChange = (ev) => {
|
|
89
|
+
if (this.disabled)
|
|
90
|
+
return;
|
|
91
|
+
const next = this.clamp(parseFloat(ev.target.value));
|
|
92
|
+
this.value = next;
|
|
93
|
+
this.bsChange.emit(next);
|
|
94
|
+
};
|
|
95
|
+
clampPercent(n) {
|
|
96
|
+
if (Number.isNaN(n))
|
|
97
|
+
return 0;
|
|
98
|
+
return Math.min(100, Math.max(0, n));
|
|
99
|
+
}
|
|
100
|
+
/** Converts an edited percentage (0-100, from the header field) back to a raw value in
|
|
101
|
+
* min/max units. */
|
|
102
|
+
fromPercent(pct) {
|
|
103
|
+
return this.min + (this.clampPercent(pct) / 100) * (this.max - this.min);
|
|
104
|
+
}
|
|
105
|
+
onPercentFieldChange = (ev) => {
|
|
106
|
+
if (this.disabled)
|
|
107
|
+
return;
|
|
108
|
+
const next = this.clamp(this.fromPercent(parseFloat(ev.target.value)));
|
|
109
|
+
this.value = next;
|
|
110
|
+
this.bsChange.emit(next);
|
|
111
|
+
};
|
|
112
|
+
onStartInputChange = (ev) => {
|
|
113
|
+
if (this.disabled)
|
|
114
|
+
return;
|
|
115
|
+
let next = this.clamp(parseFloat(ev.target.value));
|
|
116
|
+
next = Math.min(next, this.effectiveValueEnd);
|
|
117
|
+
this.valueStart = next;
|
|
118
|
+
this.bsRangeChange.emit({ start: next, end: this.effectiveValueEnd });
|
|
119
|
+
};
|
|
120
|
+
onEndInputChange = (ev) => {
|
|
121
|
+
if (this.disabled)
|
|
122
|
+
return;
|
|
123
|
+
let next = this.clamp(parseFloat(ev.target.value));
|
|
124
|
+
next = Math.max(next, this.effectiveValueStart);
|
|
125
|
+
this.valueEnd = next;
|
|
126
|
+
this.bsRangeChange.emit({ start: this.effectiveValueStart, end: next });
|
|
127
|
+
};
|
|
128
|
+
onStartPercentFieldChange = (ev) => {
|
|
129
|
+
if (this.disabled)
|
|
130
|
+
return;
|
|
131
|
+
let next = this.clamp(this.fromPercent(parseFloat(ev.target.value)));
|
|
132
|
+
next = Math.min(next, this.effectiveValueEnd);
|
|
133
|
+
this.valueStart = next;
|
|
134
|
+
this.bsRangeChange.emit({ start: next, end: this.effectiveValueEnd });
|
|
135
|
+
};
|
|
136
|
+
onEndPercentFieldChange = (ev) => {
|
|
137
|
+
if (this.disabled)
|
|
138
|
+
return;
|
|
139
|
+
let next = this.clamp(this.fromPercent(parseFloat(ev.target.value)));
|
|
140
|
+
next = Math.max(next, this.effectiveValueStart);
|
|
141
|
+
this.valueEnd = next;
|
|
142
|
+
this.bsRangeChange.emit({ start: this.effectiveValueStart, end: next });
|
|
143
|
+
};
|
|
144
|
+
/** The editable field shown top-right (or as a pair for `type="range"`), displaying/editing
|
|
145
|
+
* the thumb's position as a rounded 0-100 percentage of min/max -- not the raw value -- per
|
|
146
|
+
* the Figma spec (every state screenshot shows this field suffixed "%", matching the same
|
|
147
|
+
* percentage the tooltip shows while dragging). */
|
|
148
|
+
renderPercentField(percentValue, onChange, ariaLabel) {
|
|
149
|
+
return (index.h("span", { part: "field", class: "bs-slider__field" }, index.h("input", { type: "number", class: "bs-slider__field-input", value: Math.round(this.clampPercent(percentValue)), min: 0, max: 100, disabled: this.disabled, "aria-label": ariaLabel, onChange: onChange }), index.h("span", { class: "bs-slider__field-suffix", "aria-hidden": "true" }, "%")));
|
|
150
|
+
}
|
|
151
|
+
renderSegmentedTicks() {
|
|
152
|
+
if (this.type !== 'segmented' || this.segments <= 0)
|
|
153
|
+
return null;
|
|
154
|
+
// segments+1 ticks (both track ends plus every division), per the Figma spec -- the first
|
|
155
|
+
// tick is invisible (opacity: 0) so the spacing math stays consistent even though it would
|
|
156
|
+
// otherwise sit right on top of the track's own start edge.
|
|
157
|
+
const tickCount = this.segments + 1;
|
|
158
|
+
return (index.h("div", { class: "bs-slider__ticks", "aria-hidden": "true" }, Array.from({ length: tickCount }).map((_, i) => (index.h("span", { class: `bs-slider__tick ${i === 0 ? 'bs-slider__tick--hidden' : ''}` })))));
|
|
159
|
+
}
|
|
160
|
+
renderSingleThumb() {
|
|
161
|
+
const fillEnd = this.percent(this.value);
|
|
162
|
+
return (index.h("div", { class: "bs-slider__track-wrapper", style: { '--bs-slider-fill-start': '0%', '--bs-slider-fill-end': `${fillEnd}%` } }, index.h("div", { part: "track", class: "bs-slider__track" }, index.h("div", { part: "fill", class: "bs-slider__track-fill" }), this.renderSegmentedTicks()), index.h("input", { type: "range", part: "control", class: "bs-slider__input", min: this.min, max: this.max, step: this.effectiveStep, value: this.value, disabled: this.disabled, "aria-label": this.ariaLabel ?? undefined, "aria-labelledby": !this.ariaLabel && this.showLabel ? 'bs-slider-label' : undefined, onInput: this.onInputChange, onChange: this.onInputChange }), index.h("span", { class: "bs-slider__tooltip", part: "tooltip", style: { left: `${fillEnd}%` }, "aria-hidden": "true" }, Math.round(this.percent(this.value)), "%")));
|
|
163
|
+
}
|
|
164
|
+
renderRangeThumbs() {
|
|
165
|
+
const start = this.effectiveValueStart;
|
|
166
|
+
const end = this.effectiveValueEnd;
|
|
167
|
+
const fillStart = this.percent(start);
|
|
168
|
+
const fillEnd = this.percent(end);
|
|
169
|
+
// Two thumbs can't be done with a single native <input type="range"> -- the CSS spec only
|
|
170
|
+
// gives a range input one thumb. This is the well-known dual-range-slider pattern instead:
|
|
171
|
+
// two overlapping native range inputs, each with a fully transparent track (only their thumb
|
|
172
|
+
// is visible/interactive -- see bs-slider.css's pointer-events rules), plus a separate
|
|
173
|
+
// absolutely-positioned div for the "filled" segment between them.
|
|
174
|
+
//
|
|
175
|
+
// Both inputs sit at the same z-index by default, except whichever thumb is in the upper half
|
|
176
|
+
// of the track gets a higher z-index -- without that, once the two thumbs are close together
|
|
177
|
+
// near one end, only the topmost one is reachable by click, and the topmost one is always the
|
|
178
|
+
// one rendered last (the end thumb) unless we compensate.
|
|
179
|
+
const startOnTop = this.percent(start) > 50;
|
|
180
|
+
return (index.h("div", { class: "bs-slider__track-wrapper", style: { '--bs-slider-fill-start': `${fillStart}%`, '--bs-slider-fill-end': `${fillEnd}%` } }, index.h("div", { part: "track", class: "bs-slider__track" }, index.h("div", { part: "fill", class: "bs-slider__track-fill" })), index.h("input", { type: "range", part: "control", class: "bs-slider__input bs-slider__input--start", style: { zIndex: startOnTop ? '4' : '3' }, min: this.min, max: this.max, step: this.step, value: start, disabled: this.disabled, "aria-label": this.ariaLabel ?? 'Start value', onInput: this.onStartInputChange, onChange: this.onStartInputChange }), index.h("input", { type: "range", part: "control", class: "bs-slider__input bs-slider__input--end", style: { zIndex: startOnTop ? '3' : '4' }, min: this.min, max: this.max, step: this.step, value: end, disabled: this.disabled, "aria-label": this.ariaLabel ? `${this.ariaLabel} end` : 'End value', onInput: this.onEndInputChange, onChange: this.onEndInputChange }), index.h("span", { class: "bs-slider__tooltip bs-slider__tooltip--start", part: "tooltip", style: { left: `${fillStart}%` }, "aria-hidden": "true" }, Math.round(this.percent(start)), "%"), index.h("span", { class: "bs-slider__tooltip bs-slider__tooltip--end", part: "tooltip", style: { left: `${fillEnd}%` }, "aria-hidden": "true" }, Math.round(this.percent(end)), "%")));
|
|
181
|
+
}
|
|
182
|
+
render() {
|
|
183
|
+
const isRange = this.type === 'range';
|
|
184
|
+
const rootClasses = ['bs-slider', this.disabled ? 'bs-slider--disabled' : ''].filter(Boolean).join(' ');
|
|
185
|
+
return (index.h("div", { key: '94e7804dd4e03881c5b53e3eb60ad6d4908b3c6d', class: rootClasses }, this.showLabel && (index.h("div", { key: '5a175e2c755c316e31637a99f32bbee4529a060e', class: "bs-slider__header" }, index.h("span", { key: '31c8b1ee83e4f86d9df201bb3e98be143c1bb4fb', id: "bs-slider-label", part: "label", class: "bs-slider__label" }, this.label), isRange ? (index.h("span", { class: "bs-slider__value-fields" }, this.renderPercentField(this.percent(this.effectiveValueStart), this.onStartPercentFieldChange, this.ariaLabel ?? 'Start value'), index.h("span", { class: "bs-slider__separator" }, "\u2013"), this.renderPercentField(this.percent(this.effectiveValueEnd), this.onEndPercentFieldChange, this.ariaLabel ? `${this.ariaLabel} end` : 'End value'))) : (this.renderPercentField(this.percent(this.value), this.onPercentFieldChange, this.ariaLabel ? `${this.ariaLabel} value` : 'Value')))), index.h("div", { key: '3e76e43398df4e013544e14cda18d61297f586c1', class: "bs-slider__row" }, this.showLabel && (index.h("span", { key: '68b68fb76315c024e8a58ef6e69ef5d3bcef8b8a', part: "bound", class: "bs-slider__bound" }, this.min)), isRange ? this.renderRangeThumbs() : this.renderSingleThumb(), this.showLabel && (index.h("span", { key: '37cd8e768c6c374f972ab7e00893193eeaaa14ec', part: "bound", class: "bs-slider__bound" }, this.max)))));
|
|
186
|
+
}
|
|
187
|
+
static get delegatesFocus() { return true; }
|
|
188
|
+
};
|
|
189
|
+
BsSlider.style = bsSliderCss();
|
|
190
|
+
|
|
191
|
+
exports.bs_slider = BsSlider;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DHVw-IPK.js');
|
|
4
|
+
|
|
5
|
+
const bsSnackbarCss = () => `:host{display:inline-flex;--bs-snackbar-radius:var(--bs-border-radius-100);--bs-snackbar-shadow:var(--bs-shadow-md);--bs-snackbar-gap:var(--bs-spacing-100);--bs-snackbar-content-padding-y:var(--bs-spacing-200);--bs-snackbar-content-padding-x:var(--bs-spacing-200);--bs-snackbar-content-gap:var(--bs-spacing-150);--bs-snackbar-font-size:var(--bs-font-size-md);--bs-snackbar-line-height:var(--bs-line-height-body-md);--bs-snackbar-actions-padding-y:var(--bs-spacing-50);--bs-snackbar-actions-padding-x:var(--bs-spacing-100);--bs-snackbar-actions-gap:var(--bs-spacing-50);--bs-snackbar-action-radius:var(--bs-border-radius-100);--bs-snackbar-action-font-size:var(--bs-font-size-sm);--bs-snackbar-action-font-weight:var(--bs-font-weight-medium);--bs-snackbar-action-line-height:var(--bs-line-height-body-sm);--bs-snackbar-close-radius:var(--bs-border-radius-100);--bs-snackbar-surface-default:var(--bs-snackbar-bg-default);--bs-snackbar-color-default:var(--bs-snackbar-text-default);--bs-snackbar-action-border-default:var(--bs-blue-300);--bs-snackbar-action-text-default:var(--bs-snackbar-action-text);--bs-snackbar-surface-info:var(--bs-color-info-container);--bs-snackbar-text-info:var(--bs-text-info);--bs-snackbar-action-bg-info:var(--bs-snackbar-bg-info);--bs-snackbar-action-bg-info-hover:var(--bs-color-info-hover);--bs-snackbar-action-bg-info-pressed:var(--bs-color-info-pressed);--bs-snackbar-surface-warning:var(--bs-color-warning-container);--bs-snackbar-text-warning:var(--bs-text-warning);--bs-snackbar-action-bg-warning:var(--bs-snackbar-bg-warning);--bs-snackbar-action-bg-warning-hover:var(--bs-color-warning-hover);--bs-snackbar-action-bg-warning-pressed:var(--bs-color-warning-pressed);--bs-snackbar-surface-success:var(--bs-color-success-container);--bs-snackbar-text-success:var(--bs-text-success);--bs-snackbar-action-bg-success:var(--bs-snackbar-bg-success);--bs-snackbar-action-bg-success-hover:var(--bs-color-success-hover);--bs-snackbar-action-bg-success-pressed:var(--bs-color-success-pressed);--bs-snackbar-surface-error:var(--bs-color-error-container);--bs-snackbar-text-error:var(--bs-text-error);--bs-snackbar-action-bg-error:var(--bs-snackbar-bg-error);--bs-snackbar-action-bg-error-hover:var(--bs-color-error-hover);--bs-snackbar-action-bg-error-pressed:var(--bs-color-error-pressed);--bs-snackbar-action-text-on-action:var(--bs-text-on-action);--bs-snackbar-spinner-track:var(--bs-neutral-200)}.bs-snackbar{display:flex;align-items:center;gap:var(--bs-snackbar-gap);border-radius:var(--bs-snackbar-radius);box-shadow:var(--bs-snackbar-shadow);font-family:inherit}.bs-snackbar--default{background:var(--bs-snackbar-surface-default);color:var(--bs-snackbar-color-default)}.bs-snackbar--info{background:var(--bs-snackbar-surface-info);color:var(--bs-snackbar-text-info)}.bs-snackbar--warning{background:var(--bs-snackbar-surface-warning);color:var(--bs-snackbar-text-warning)}.bs-snackbar--success{background:var(--bs-snackbar-surface-success);color:var(--bs-snackbar-text-success)}.bs-snackbar--error{background:var(--bs-snackbar-surface-error);color:var(--bs-snackbar-text-error)}.bs-snackbar__content{display:flex;align-items:center;gap:var(--bs-snackbar-content-gap);flex:1 1 auto;min-width:0;padding:var(--bs-snackbar-content-padding-y) 0 var(--bs-snackbar-content-padding-y) var(--bs-snackbar-content-padding-x)}.bs-snackbar__icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;color:inherit}.bs-snackbar__icon svg{width:24px;height:24px}.bs-snackbar__spinner{display:inline-block;box-sizing:border-box;width:24px;height:24px;border:2px solid var(--bs-snackbar-spinner-track);border-top-color:currentColor;border-radius:50%;animation:bs-snackbar-spin 0.8s linear infinite}@keyframes bs-snackbar-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.bs-snackbar__spinner{animation:none}}.bs-snackbar__message{flex:1 1 auto;min-width:0;font-size:var(--bs-snackbar-font-size);line-height:calc(var(--bs-snackbar-line-height) * 1px)}.bs-snackbar__actions{display:flex;align-items:center;align-self:stretch;gap:var(--bs-snackbar-actions-gap);flex-shrink:0;padding:var(--bs-snackbar-actions-padding-y) var(--bs-snackbar-actions-padding-x) var(--bs-snackbar-actions-padding-y) 0}.bs-snackbar__action{height:32px;padding:0 var(--bs-spacing-150);border-radius:var(--bs-snackbar-action-radius);font-family:inherit;font-size:var(--bs-snackbar-action-font-size);font-weight:var(--bs-snackbar-action-font-weight);line-height:calc(var(--bs-snackbar-action-line-height) * 1px);white-space:nowrap;cursor:pointer;border:none;background:transparent}.bs-snackbar--default .bs-snackbar__action{border:1px solid var(--bs-snackbar-action-border-default);color:var(--bs-snackbar-action-text-default)}.bs-snackbar--info .bs-snackbar__action{background:var(--bs-snackbar-action-bg-info);color:var(--bs-snackbar-action-text-on-action)}.bs-snackbar--info .bs-snackbar__action:hover{background:var(--bs-snackbar-action-bg-info-hover)}.bs-snackbar--info .bs-snackbar__action:active{background:var(--bs-snackbar-action-bg-info-pressed)}.bs-snackbar--warning .bs-snackbar__action{background:var(--bs-snackbar-action-bg-warning);color:var(--bs-snackbar-action-text-on-action)}.bs-snackbar--warning .bs-snackbar__action:hover{background:var(--bs-snackbar-action-bg-warning-hover)}.bs-snackbar--warning .bs-snackbar__action:active{background:var(--bs-snackbar-action-bg-warning-pressed)}.bs-snackbar--success .bs-snackbar__action{background:var(--bs-snackbar-action-bg-success);color:var(--bs-snackbar-action-text-on-action)}.bs-snackbar--success .bs-snackbar__action:hover{background:var(--bs-snackbar-action-bg-success-hover)}.bs-snackbar--success .bs-snackbar__action:active{background:var(--bs-snackbar-action-bg-success-pressed)}.bs-snackbar--error .bs-snackbar__action{background:var(--bs-snackbar-action-bg-error);color:var(--bs-snackbar-action-text-on-action)}.bs-snackbar--error .bs-snackbar__action:hover{background:var(--bs-snackbar-action-bg-error-hover)}.bs-snackbar--error .bs-snackbar__action:active{background:var(--bs-snackbar-action-bg-error-pressed)}.bs-snackbar__close{display:flex;align-items:center;justify-content:center;width:44px;height:44px;flex-shrink:0;padding:0;border:none;background:transparent;border-radius:var(--bs-snackbar-close-radius);color:inherit;cursor:pointer}.bs-snackbar__close svg{width:24px;height:24px}.bs-snackbar--default .bs-snackbar__action:hover,.bs-snackbar__close:hover{background:color-mix(in srgb, currentColor 12%, transparent)}.bs-snackbar--default .bs-snackbar__action:active,.bs-snackbar__close:active{background:color-mix(in srgb, currentColor 24%, transparent)}.bs-snackbar__action:focus-visible,.bs-snackbar__close:focus-visible{outline:2px solid currentColor;outline-offset:2px}`;
|
|
6
|
+
|
|
7
|
+
const BsSnackbar = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.bsAction = index.createEvent(this, "bsAction");
|
|
11
|
+
this.bsDismiss = index.createEvent(this, "bsDismiss");
|
|
12
|
+
}
|
|
13
|
+
/** Color/semantic variant. `default` is the neutral (dark, inverse-surface) bar Figma shows as
|
|
14
|
+
* the baseline; `info`/`warning`/`success`/`error` use their matching container/text tokens. */
|
|
15
|
+
variant = 'default';
|
|
16
|
+
/** Replaces the checkmark icon with a spinning loading indicator, for a message describing
|
|
17
|
+
* in-progress work (e.g. "Uploading files...") rather than a completed result. */
|
|
18
|
+
loading = false;
|
|
19
|
+
/** Label for the optional action button (e.g. "Undo", "Retry"). Omit this prop entirely to
|
|
20
|
+
* render no action button at all -- its presence, not a boolean flag, is what shows it. */
|
|
21
|
+
actionLabel;
|
|
22
|
+
/** Fires when the action button is clicked. Ignored/never fires if `actionLabel` isn't set. */
|
|
23
|
+
bsAction;
|
|
24
|
+
/** Fires when the close button is clicked. This component doesn't remove itself from the DOM --
|
|
25
|
+
* the consumer is expected to do that (or hide it) in response to this event. */
|
|
26
|
+
bsDismiss;
|
|
27
|
+
onAction = () => {
|
|
28
|
+
this.bsAction.emit();
|
|
29
|
+
};
|
|
30
|
+
onDismiss = () => {
|
|
31
|
+
this.bsDismiss.emit();
|
|
32
|
+
};
|
|
33
|
+
render() {
|
|
34
|
+
return (index.h("div", { key: '9106411da12b9a4687fc15cf51c3398e9f44cf61', part: "container", class: `bs-snackbar bs-snackbar--${this.variant}`, role: "status", "aria-live": this.variant === 'error' ? 'assertive' : 'polite' }, index.h("div", { key: '47d66fbf472070db51cc4ef1da513068a06bd4cf', class: "bs-snackbar__content" }, index.h("span", { key: 'aabe82b54a892ae9ce0ec299a8a8282b9c64a158', part: "icon", class: "bs-snackbar__icon", "aria-hidden": "true" }, this.loading ? index.h("span", { class: "bs-snackbar__spinner" }) : index.h(CheckCircleIcon, null)), index.h("span", { key: '0d349ebe58140aed06a6a887a71105aab8218c55', part: "message", class: "bs-snackbar__message" }, index.h("slot", { key: 'c95af54cae4327a956196c5e252c2e1bafc26e92' }))), index.h("div", { key: '9d85cb2e47cc696523bc3921afa804648ea13553', class: "bs-snackbar__actions" }, this.actionLabel && (index.h("button", { key: '59e85117a9351385d258ec9b5bac6cfb6b2d88bf', part: "action", type: "button", class: "bs-snackbar__action", onClick: this.onAction }, this.actionLabel)), index.h("button", { key: '9e60406a369a599d9a43fb3c9c321e1aa8e1144d', part: "close", type: "button", class: "bs-snackbar__close", "aria-label": "Dismiss", onClick: this.onDismiss }, index.h(CloseIcon, { key: '93e815dace277cbee4f0f67a2ec1b3321c9ff495' })))));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const CheckCircleIcon = () => (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, index.h("path", { d: "M8.25 12.75L10.5 15L15.75 9.75", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
38
|
+
const CloseIcon = () => (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, index.h("path", { d: "M18.75 5.25L5.25 18.75", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M18.75 18.75L5.25 5.25", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
39
|
+
BsSnackbar.style = bsSnackbarCss();
|
|
40
|
+
|
|
41
|
+
exports.bs_snackbar = BsSnackbar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DHVw-IPK.js');
|
|
4
4
|
|
|
5
5
|
const bsSourceLinkCss = () => `:host{display:block;--bs-source-link-radius:var(--bs-border-radius-150);--bs-source-link-padding:var(--bs-spacing-150);--bs-source-link-gap:var(--bs-spacing-50);--bs-source-link-icon-gap:var(--bs-spacing-75);--bs-source-link-hover:var(--bs-surface-hover);--bs-source-link-pressed:var(--bs-surface-pressed);--bs-source-link-focus:var(--bs-border-neutral-focus);--bs-source-link-filename-color:var(--bs-text-default);--bs-source-link-meta-color:var(--bs-text-secondary);--bs-source-link-icon-color:var(--bs-icon-default);--bs-source-link-dot-color:var(--bs-text-secondary)}.bs-source-link{box-sizing:border-box;display:flex;align-items:center;gap:var(--bs-source-link-gap);width:100%;padding:var(--bs-source-link-padding);background:none;border:none;border-radius:var(--bs-source-link-radius);font-family:inherit;text-align:left;text-decoration:none;cursor:pointer;transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-source-link:hover,.bs-source-link:focus-visible{background:var(--bs-source-link-hover)}.bs-source-link:active{background:var(--bs-source-link-pressed)}.bs-source-link:focus-visible{outline:2px solid var(--bs-source-link-focus);outline-offset:1px}.bs-source-link__icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:16px;height:16px;color:var(--bs-source-link-icon-color)}.bs-source-link__left{display:flex;flex:1 0 0;flex-direction:column;gap:2px;min-width:0}.bs-source-link__filename-row{display:flex;align-items:center;gap:var(--bs-source-link-icon-gap);width:100%}.bs-source-link__filename{margin:0;overflow:hidden;color:var(--bs-source-link-filename-color);font-size:var(--bs-font-size-md);font-weight:var(--bs-font-weight-semibold);line-height:var(--bs-line-height-normal);text-overflow:ellipsis;white-space:nowrap}.bs-source-link__meta{display:flex;align-items:center;gap:var(--bs-spacing-50);padding-left:22px}.bs-source-link__source,.bs-source-link__version{color:var(--bs-source-link-meta-color);font-size:var(--bs-font-size-sm);line-height:var(--bs-line-height-normal);white-space:nowrap}.bs-source-link__dot{width:4px;height:4px;border-radius:50%;background:var(--bs-source-link-dot-color);flex-shrink:0}.bs-source-link__arrow{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:24px;height:24px;color:var(--bs-source-link-icon-color)}`;
|
|
6
6
|
|
|
@@ -26,8 +26,8 @@ const BsSourceLink = class {
|
|
|
26
26
|
};
|
|
27
27
|
render() {
|
|
28
28
|
const inner = [
|
|
29
|
-
index.h("span", { key: '
|
|
30
|
-
index.h("span", { key: '
|
|
29
|
+
index.h("span", { key: '87d5b005650458dac01edfc249af98f004281345', class: "bs-source-link__left" }, index.h("span", { key: '8eff72ca308f2617826f29312a755925526ffbd6', class: "bs-source-link__filename-row" }, index.h("span", { key: 'f0d435557cabaf12ee9bd2d155e432accf2fe858', part: "icon", class: "bs-source-link__icon" }, index.h("slot", { key: '51d36a29f3d77280bc575e32929a64e31e953fb3', name: "icon" }, index.h(FileTextIcon, { key: 'c51889f0f2cb3ab048b0a6cca1541accb720c4b2' }))), index.h("p", { key: '213eeb131f508e49f0b22aedce477cc68d0ebe54', part: "filename", class: "bs-source-link__filename" }, this.fileName)), index.h("span", { key: 'c6ca408b2707ed208f02a85baf393330536a126e', class: "bs-source-link__meta" }, this.sourceName && (index.h("span", { key: '7ec7920ab0a44d2169e53e24c958b0ad5c9ee58c', part: "source", class: "bs-source-link__source" }, this.sourceName)), this.sourceName && this.version && index.h("span", { key: 'e5687303c97b0cc5c655c5646c7be367d41d35b8', class: "bs-source-link__dot", "aria-hidden": "true" }), this.version && (index.h("span", { key: 'b0abbfc1b477d85ac25fe281d0404da62f2f21b0', part: "version", class: "bs-source-link__version" }, this.version)))),
|
|
30
|
+
index.h("span", { key: 'a2b93f18243778d72c77e2790ee43a4c3b7214a5', part: "arrow", class: "bs-source-link__arrow", "aria-hidden": "true" }, index.h(ArrowUpRightIcon, { key: '2cc849857b592ea425ea43cf55a202adde726826' })),
|
|
31
31
|
];
|
|
32
32
|
return this.href ? (index.h("a", { class: "bs-source-link", href: this.href, target: this.target, rel: "noopener noreferrer", onClick: this.onClick }, inner)) : (index.h("button", { type: "button", class: "bs-source-link", onClick: this.onClick }, inner));
|
|
33
33
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DHVw-IPK.js');
|
|
4
|
+
|
|
5
|
+
const bsSwitchCss = () => `:host{display:inline-block;--bs-switch-radius:var(--bs-border-radius-full);--bs-switch-padding:var(--bs-spacing-25);--bs-switch-gap:var(--bs-spacing-100);--bs-switch-track-width-md:36px;--bs-switch-track-height-md:20px;--bs-switch-track-width-lg:48px;--bs-switch-track-height-lg:28px;--bs-switch-knob-size-md:16px;--bs-switch-knob-size-lg:24px;--bs-switch-border-width:1px;--bs-switch-track-bg:var(--bs-switch-track-bg-default);--bs-switch-track-bg-checked:var(--bs-switch-track-bg-checked-default);--bs-switch-track-bg-checked-focus:var(--bs-switch-track-bg-checked-focused);--bs-switch-track-border:var(--bs-switch-track-border-default);--bs-switch-focus-ring-color:var(--bs-switch-track-border-focus);--bs-switch-knob-bg:var(--bs-switch-thumb-bg-default);--bs-switch-knob-bg-hover:var(--bs-switch-thumb-bg-hover);--bs-switch-knob-bg-checked:var(--bs-switch-thumb-bg-checked);--bs-switch-knob-bg-disabled:var(--bs-switch-thumb-bg-disabled);--bs-switch-label-color:var(--bs-text-default);--bs-switch-label-color-disabled:var(--bs-text-on-disabled)}.bs-switch{position:relative;display:inline-flex;align-items:center;gap:var(--bs-switch-gap);font-family:inherit;cursor:pointer}.bs-switch--disabled{cursor:not-allowed}.bs-switch__input{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:pointer}.bs-switch__input:disabled{cursor:not-allowed}.bs-switch__track{box-sizing:border-box;position:relative;display:flex;align-items:center;justify-content:flex-start;flex-shrink:0;padding:var(--bs-switch-padding);border:var(--bs-switch-border-width) solid var(--bs-switch-track-border);border-radius:var(--bs-switch-radius);background:var(--bs-switch-track-bg);transition:background-color 0.15s ease, border-color 0.15s ease}.bs-switch__track--md{width:var(--bs-switch-track-width-md);height:var(--bs-switch-track-height-md)}.bs-switch__track--lg{width:var(--bs-switch-track-width-lg);height:var(--bs-switch-track-height-lg)}.bs-switch__track--checked{justify-content:flex-end;background:var(--bs-switch-track-bg-checked)}.bs-switch__knob{box-sizing:border-box;border-radius:var(--bs-border-radius-full);background:var(--bs-switch-knob-bg);transition:background-color 0.15s ease}.bs-switch__knob--md{width:var(--bs-switch-knob-size-md);height:var(--bs-switch-knob-size-md)}.bs-switch__knob--lg{width:var(--bs-switch-knob-size-lg);height:var(--bs-switch-knob-size-lg)}.bs-switch__track--checked .bs-switch__knob{background:var(--bs-switch-knob-bg-checked)}.bs-switch__input:hover:not(:disabled)~.bs-switch__track{background:var(--bs-switch-track-bg-hover);border-color:var(--bs-switch-track-border-hover)}.bs-switch__input:hover:not(:disabled)~.bs-switch__track .bs-switch__knob{background:var(--bs-switch-knob-bg-hover)}.bs-switch__input:hover:not(:disabled)~.bs-switch__track--checked{background:var(--bs-switch-track-bg-checked-hover)}.bs-switch__input:focus-visible~.bs-switch__track{border-color:var(--bs-switch-track-border-hover);outline:2px solid var(--bs-switch-focus-ring-color);outline-offset:2px}.bs-switch__input:focus-visible~.bs-switch__track--checked{background:var(--bs-switch-track-bg-checked-focus)}.bs-switch__track--disabled{background:var(--bs-switch-track-bg-disabled);border-color:var(--bs-switch-track-border)}.bs-switch__track--disabled.bs-switch__track--checked{background:var(--bs-switch-track-bg-disabled)}.bs-switch__knob--disabled{background:var(--bs-switch-knob-bg-disabled)}.bs-switch__label{font-size:var(--bs-font-size-md);color:var(--bs-switch-label-color)}.bs-switch--disabled .bs-switch__label{color:var(--bs-switch-label-color-disabled)}`;
|
|
6
|
+
|
|
7
|
+
const BsSwitch = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.bsChange = index.createEvent(this, "bsChange");
|
|
11
|
+
}
|
|
12
|
+
get el() { return index.getElement(this); }
|
|
13
|
+
/** Sizing scale. Controls the track's width/height and the knob's diameter. */
|
|
14
|
+
size = 'lg';
|
|
15
|
+
/** Whether the switch is on. Mutable so clicking the label/input toggles it directly, and
|
|
16
|
+
* reflected so consumers can target `bs-switch[checked]` via CSS. */
|
|
17
|
+
checked = false;
|
|
18
|
+
/** Disables the switch: sets the native `disabled` attribute, suppresses hover/focus styling,
|
|
19
|
+
* and prevents toggling. */
|
|
20
|
+
disabled = false;
|
|
21
|
+
/**
|
|
22
|
+
* Accessible name for the switch. Required whenever the default (label) slot is empty (e.g. a
|
|
23
|
+
* bare "enabled" switch in a table row) -- without it, the internal native `<input>` has no
|
|
24
|
+
* accessible name at all. Setting `aria-label` directly on the `<bs-switch>` host does NOT
|
|
25
|
+
* work for this: that attribute stays on the light-DOM host and is never forwarded into the
|
|
26
|
+
* shadow DOM by the browser, so the actual focusable element (the native `<input>` inside) stays
|
|
27
|
+
* nameless. This prop exists specifically to bridge that gap -- same pattern as `bs-button`'s and
|
|
28
|
+
* `bs-checkbox`'s identical `ariaLabel` prop, both of which explicitly bind it onto their own
|
|
29
|
+
* internal focusable element for the same reason.
|
|
30
|
+
*/
|
|
31
|
+
ariaLabel = null;
|
|
32
|
+
/** Emitted when the checked state changes via user interaction, with the new `checked` value. */
|
|
33
|
+
bsChange;
|
|
34
|
+
onChange = (ev) => {
|
|
35
|
+
const checked = ev.target.checked;
|
|
36
|
+
this.checked = checked;
|
|
37
|
+
this.bsChange.emit(checked);
|
|
38
|
+
};
|
|
39
|
+
render() {
|
|
40
|
+
const trackClasses = [
|
|
41
|
+
'bs-switch__track',
|
|
42
|
+
`bs-switch__track--${this.size}`,
|
|
43
|
+
this.checked ? 'bs-switch__track--checked' : '',
|
|
44
|
+
this.disabled ? 'bs-switch__track--disabled' : '',
|
|
45
|
+
]
|
|
46
|
+
.filter(Boolean)
|
|
47
|
+
.join(' ');
|
|
48
|
+
const knobClasses = ['bs-switch__knob', `bs-switch__knob--${this.size}`, this.disabled ? 'bs-switch__knob--disabled' : '']
|
|
49
|
+
.filter(Boolean)
|
|
50
|
+
.join(' ');
|
|
51
|
+
return (index.h("label", { key: '888dbe0671ca3c921bc3407c3b78f3cedc772054', class: `bs-switch ${this.disabled ? 'bs-switch--disabled' : ''}` }, index.h("input", { key: '8883e408fb0f81448bbe7acbf69e3ea73b27b372', class: "bs-switch__input", type: "checkbox", role: "switch", checked: this.checked, disabled: this.disabled, "aria-checked": String(this.checked), "aria-label": this.ariaLabel, onChange: this.onChange }), index.h("span", { key: '84aa58e74886151ed394543f493d09faa3d5cb89', part: "track", class: trackClasses }, index.h("span", { key: 'e4bceff4f3419d1f1aa7345fe2083e9e1f1e3b91', part: "knob", class: knobClasses })), index.h("span", { key: 'e9816fb5961fea50b9c51d395fc359a08d1c4df9', part: "label", class: "bs-switch__label" }, index.h("slot", { key: '7ec1076999b1a249756a61feee2f9caf969f71c2' }))));
|
|
52
|
+
}
|
|
53
|
+
static get delegatesFocus() { return true; }
|
|
54
|
+
};
|
|
55
|
+
BsSwitch.style = bsSwitchCss();
|
|
56
|
+
|
|
57
|
+
exports.bs_switch = BsSwitch;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DHVw-IPK.js');
|
|
4
|
+
|
|
5
|
+
const bsTabCss = () => `:host{display:inline-block;--bs-tab-radius:var(--bs-border-radius-100);--bs-tab-padding-y:var(--bs-spacing-150);--bs-tab-padding-x:var(--bs-spacing-200);--bs-tab-gap:var(--bs-spacing-75);--bs-tab-gap-vertical:var(--bs-spacing-50);--bs-tab-color-default:var(--bs-text-muted);--bs-tab-icon-color-default:var(--bs-icon-muted);--bs-tab-color-hover:var(--bs-text-default);--bs-tab-icon-color-hover:var(--bs-icon-default);--bs-tab-indicator-hover:var(--bs-border-neutral-hover);--bs-tab-color-selected:var(--bs-color-primary-default);--bs-tab-color-selected-hover:var(--bs-color-primary-hover);--bs-tab-color-selected-pressed:var(--bs-color-primary-pressed);--bs-tab-indicator-selected:var(--bs-color-primary-default);--bs-tab-indicator-selected-hover:var(--bs-color-primary-hover);--bs-tab-indicator-selected-pressed:var(--bs-color-primary-pressed);--bs-tab-focus-ring-color:var(--bs-border-neutral-focus);--bs-tab-color-disabled:var(--bs-text-on-disabled);--bs-tab-icon-color-disabled:var(--bs-icon-disabled);--bs-tab-font-size:var(--bs-font-size-md);--bs-tab-line-height:var(--bs-line-height-body-md)}.bs-tab{box-sizing:border-box;position:relative;display:flex;flex-direction:row;align-items:center;justify-content:center;border:none;cursor:pointer;background:transparent;color:var(--bs-tab-color-default);font-family:inherit;border-radius:var(--bs-tab-radius);padding:var(--bs-tab-padding-y) var(--bs-tab-padding-x);gap:var(--bs-tab-gap);transition:color var(--bs-duration-fast) var(--bs-easing-standard), background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-tab--vertical{flex-direction:column;gap:var(--bs-tab-gap-vertical)}.bs-tab:focus-visible{outline:2px solid var(--bs-tab-focus-ring-color);outline-offset:2px}.bs-tab:not(.bs-tab--selected):not(.bs-tab--disabled):hover,.bs-tab:not(.bs-tab--selected):not(.bs-tab--disabled):focus-visible,.bs-tab:not(.bs-tab--selected):not(.bs-tab--disabled):active{color:var(--bs-tab-color-hover)}.bs-tab:not(.bs-tab--selected):not(.bs-tab--disabled):hover .bs-tab__icon,.bs-tab:not(.bs-tab--selected):not(.bs-tab--disabled):focus-visible .bs-tab__icon,.bs-tab:not(.bs-tab--selected):not(.bs-tab--disabled):active .bs-tab__icon{color:var(--bs-tab-icon-color-hover)}.bs-tab:not(.bs-tab--selected):not(.bs-tab--disabled):hover .bs-tab__indicator,.bs-tab:not(.bs-tab--selected):not(.bs-tab--disabled):focus-visible .bs-tab__indicator,.bs-tab:not(.bs-tab--selected):not(.bs-tab--disabled):active .bs-tab__indicator{background:var(--bs-tab-indicator-hover)}.bs-tab--selected{color:var(--bs-tab-color-selected)}.bs-tab--selected .bs-tab__icon--has-content{color:var(--bs-tab-color-selected)}.bs-tab--selected .bs-tab__indicator{background:var(--bs-tab-indicator-selected)}.bs-tab--selected:not(.bs-tab--disabled):hover,.bs-tab--selected:not(.bs-tab--disabled):focus-visible{color:var(--bs-tab-color-selected-hover)}.bs-tab--selected:not(.bs-tab--disabled):hover .bs-tab__icon--has-content,.bs-tab--selected:not(.bs-tab--disabled):focus-visible .bs-tab__icon--has-content{color:var(--bs-tab-color-selected-hover)}.bs-tab--selected:not(.bs-tab--disabled):hover .bs-tab__indicator,.bs-tab--selected:not(.bs-tab--disabled):focus-visible .bs-tab__indicator{background:var(--bs-tab-indicator-selected-hover)}.bs-tab--selected:not(.bs-tab--disabled):active{color:var(--bs-tab-color-selected-pressed)}.bs-tab--selected:not(.bs-tab--disabled):active .bs-tab__icon--has-content{color:var(--bs-tab-color-selected-pressed)}.bs-tab--selected:not(.bs-tab--disabled):active .bs-tab__indicator{background:var(--bs-tab-indicator-selected-pressed)}.bs-tab--disabled{color:var(--bs-tab-color-disabled);cursor:not-allowed}.bs-tab--disabled .bs-tab__icon--has-content{color:var(--bs-tab-icon-color-disabled)}.bs-tab--disabled .bs-tab__indicator{background:transparent}.bs-tab__icon{display:none;width:24px;height:24px;flex-shrink:0;color:var(--bs-tab-icon-color-default)}.bs-tab__icon--has-content{display:inline-flex;align-items:center;justify-content:center}.bs-tab__icon ::slotted(svg){width:24px;height:24px}.bs-tab__label{display:none;font-size:var(--bs-tab-font-size);line-height:calc(var(--bs-tab-line-height) * 1px);white-space:nowrap}.bs-tab__label--has-content{display:inline-block}.bs-tab__badge{display:none}.bs-tab__badge--has-content{display:inline-flex;align-items:center}.bs-tab__indicator{position:absolute;left:var(--bs-tab-padding-x);right:var(--bs-tab-padding-x);bottom:0;height:2px;background:transparent;border-radius:var(--bs-border-radius-50, 2px)}`;
|
|
6
|
+
|
|
7
|
+
const BsTab = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.bsSelect = index.createEvent(this, "bsSelect");
|
|
11
|
+
}
|
|
12
|
+
get el() { return index.getElement(this); }
|
|
13
|
+
/** Whether this tab is the currently active one. NOT mutable and NOT self-toggling -- see the
|
|
14
|
+
* "Known gap" note in the class JSDoc. Still reflected as an attribute so consumers/CSS can
|
|
15
|
+
* target `bs-tab[selected]`. */
|
|
16
|
+
selected = false;
|
|
17
|
+
/** Disables the tab: sets the native `disabled` attribute, suppresses hover/focus styling, and
|
|
18
|
+
* prevents clicking from emitting `bsSelect`. */
|
|
19
|
+
disabled = false;
|
|
20
|
+
/** Where the icon sits relative to the label, when both `icon` and the default slot are
|
|
21
|
+
* populated. Ignored for icon-only/text-only layouts. */
|
|
22
|
+
iconPosition = 'start';
|
|
23
|
+
/** Accessible name for the tab. Required for icon-only usage (no visible label text via the
|
|
24
|
+
* default slot) so screen readers still announce what the tab does -- without it, an icon-only
|
|
25
|
+
* tab has no discernible name at all (axe-core flags this as a critical `button-name`
|
|
26
|
+
* violation). Stencil reflects this camelCase prop to the `aria-label` HTML attribute
|
|
27
|
+
* automatically, same as `bs-button`'s identical prop. */
|
|
28
|
+
ariaLabel = null;
|
|
29
|
+
/** Tracks whether the `icon` slot has assigned content. */
|
|
30
|
+
hasIcon = false;
|
|
31
|
+
/** Tracks whether the default (label) slot has assigned content. */
|
|
32
|
+
hasLabel = false;
|
|
33
|
+
/** Tracks whether the `badge` slot has assigned content. */
|
|
34
|
+
hasBadge = false;
|
|
35
|
+
/** Fires when the tab is clicked. Does not toggle `selected` itself -- see the class JSDoc. */
|
|
36
|
+
bsSelect;
|
|
37
|
+
/**
|
|
38
|
+
* Computes the initial `hasIcon`/`hasLabel`/`hasBadge` state directly from the host's light DOM
|
|
39
|
+
* children, before first render -- same reasoning as `bs-button.componentWillLoad` (a slot with
|
|
40
|
+
* zero assigned nodes from the start never fires `slotchange`).
|
|
41
|
+
*/
|
|
42
|
+
componentWillLoad() {
|
|
43
|
+
this.hasIcon = this.hasSlottedContent('icon');
|
|
44
|
+
this.hasLabel = this.hasSlottedContent(null);
|
|
45
|
+
this.hasBadge = this.hasSlottedContent('badge');
|
|
46
|
+
}
|
|
47
|
+
hasSlottedContent(slotName) {
|
|
48
|
+
return Array.from(this.el.childNodes).some(node => {
|
|
49
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
50
|
+
return node.getAttribute('slot') === slotName;
|
|
51
|
+
}
|
|
52
|
+
// Only elements can carry a `slot` attribute -- any other node type (text, comments) can
|
|
53
|
+
// only ever be assigned to the default slot.
|
|
54
|
+
return slotName === null;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
onIconSlotchange = (ev) => {
|
|
58
|
+
this.hasIcon = ev.target.assignedNodes().length > 0;
|
|
59
|
+
};
|
|
60
|
+
onLabelSlotchange = (ev) => {
|
|
61
|
+
this.hasLabel = ev.target.assignedNodes().length > 0;
|
|
62
|
+
};
|
|
63
|
+
onBadgeSlotchange = (ev) => {
|
|
64
|
+
this.hasBadge = ev.target.assignedNodes().length > 0;
|
|
65
|
+
};
|
|
66
|
+
onClick = () => {
|
|
67
|
+
if (this.disabled)
|
|
68
|
+
return;
|
|
69
|
+
this.bsSelect.emit();
|
|
70
|
+
};
|
|
71
|
+
render() {
|
|
72
|
+
const iconOnly = this.hasIcon && !this.hasLabel;
|
|
73
|
+
const vertical = this.hasIcon && this.hasLabel && this.iconPosition === 'top';
|
|
74
|
+
const showBadge = this.hasBadge && !iconOnly && !vertical;
|
|
75
|
+
return (index.h("button", { key: 'f546b2a1795c272666671e0b103382921e417763', type: "button", part: "tab", role: "tab", class: `bs-tab ${this.selected ? 'bs-tab--selected' : ''} ${this.disabled ? 'bs-tab--disabled' : ''} ${iconOnly ? 'bs-tab--icon-only' : ''} ${vertical ? 'bs-tab--vertical' : ''}`, disabled: this.disabled, "aria-selected": String(this.selected), "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": this.ariaLabel, onClick: this.onClick }, index.h("span", { key: 'e9818e0796ed9be7df02c07ae535e265f99543c5', part: "icon", class: `bs-tab__icon ${this.hasIcon ? 'bs-tab__icon--has-content' : ''}` }, index.h("slot", { key: '550d7967e028e781509c1017e13d485bac304387', name: "icon", onSlotchange: this.onIconSlotchange })), index.h("span", { key: '10939082cb36c48a98fe7783914880385d213ba8', part: "label", class: `bs-tab__label ${this.hasLabel ? 'bs-tab__label--has-content' : ''}` }, index.h("slot", { key: 'a2e6cd4f0afbf3ffc3f1ca5c19746cab26d5f6fb', onSlotchange: this.onLabelSlotchange })), index.h("span", { key: '7a7fca9d63bb63b03b2db1b100c92c2090e45e36', part: "badge", class: `bs-tab__badge ${showBadge ? 'bs-tab__badge--has-content' : ''}` }, index.h("slot", { key: '1eb43aabca6e01d777e506fb546ad76ce9527eee', name: "badge", onSlotchange: this.onBadgeSlotchange })), index.h("span", { key: '8e9426213e4bc2d60a01b0cdbaeb15d42c0e6269', part: "indicator", class: "bs-tab__indicator" })));
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
BsTab.style = bsTabCss();
|
|
79
|
+
|
|
80
|
+
exports.bs_tab = BsTab;
|