@brandsync/wc 1.6.0 → 1.8.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 +1302 -90
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/{p-387ed85f.entry.js → p-002d258d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e35249c4.entry.js → p-03b08508.entry.js} +1 -1
- package/dist/brandsync-wc/{p-db46376b.entry.js → p-051d3064.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c054f493.entry.js → p-05c7de28.entry.js} +1 -1
- package/dist/brandsync-wc/{p-639946e7.entry.js → p-062cfa34.entry.js} +1 -1
- package/dist/brandsync-wc/p-0e39b9cc.entry.js +1 -0
- package/dist/brandsync-wc/{p-9fb8848c.entry.js → p-114d2fd8.entry.js} +1 -1
- package/dist/brandsync-wc/{p-ef68f29b.entry.js → p-153da845.entry.js} +1 -1
- package/dist/brandsync-wc/{p-6754dfa9.entry.js → p-1c0db4d6.entry.js} +1 -1
- package/dist/brandsync-wc/{p-4a1a5d6e.entry.js → p-1f7208cb.entry.js} +1 -1
- package/dist/brandsync-wc/{p-43617f2e.entry.js → p-235ae012.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2700a63e.entry.js → p-275072dd.entry.js} +1 -1
- package/dist/brandsync-wc/p-2891d40b.entry.js +1 -0
- package/dist/brandsync-wc/p-29027559.entry.js +1 -0
- package/dist/brandsync-wc/p-2e7a1082.entry.js +1 -0
- package/dist/brandsync-wc/{p-604553a0.entry.js → p-3176d1d3.entry.js} +1 -1
- package/dist/brandsync-wc/p-33e44094.entry.js +1 -0
- package/dist/brandsync-wc/p-360452c2.entry.js +1 -0
- package/dist/brandsync-wc/p-3ec74d35.entry.js +1 -0
- package/dist/brandsync-wc/p-4574a707.entry.js +1 -0
- package/dist/brandsync-wc/p-4e5dcaff.entry.js +1 -0
- package/dist/brandsync-wc/p-612cf79c.entry.js +1 -0
- package/dist/brandsync-wc/p-61c1a2a3.entry.js +1 -0
- package/dist/brandsync-wc/{p-11224cab.entry.js → p-6331de9c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-d03eba2b.entry.js → p-652d4068.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a603a13a.entry.js → p-6bf2f116.entry.js} +1 -1
- package/dist/brandsync-wc/{p-9b72cc12.entry.js → p-70f64b25.entry.js} +1 -1
- package/dist/brandsync-wc/{p-44bfdd4b.entry.js → p-7b00dd36.entry.js} +1 -1
- package/dist/brandsync-wc/p-7c94e6ae.entry.js +1 -0
- package/dist/brandsync-wc/p-835a8dc7.entry.js +1 -0
- package/dist/brandsync-wc/{p-0aca5f0e.entry.js → p-8ee0153b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-bb77098b.entry.js → p-9f65f998.entry.js} +1 -1
- package/dist/brandsync-wc/p-9f8852a0.entry.js +1 -0
- package/dist/brandsync-wc/{p-DuyFft7h.js → p-AgoOSYvW.js} +2 -2
- package/dist/brandsync-wc/{p-a8e2a2b2.entry.js → p-a09e157f.entry.js} +1 -1
- package/dist/brandsync-wc/p-a0d5a620.entry.js +1 -0
- package/dist/brandsync-wc/{p-525504c2.entry.js → p-a5feaad4.entry.js} +1 -1
- package/dist/brandsync-wc/{p-cbaa19ab.entry.js → p-a92eec48.entry.js} +1 -1
- package/dist/brandsync-wc/{p-57e1dc35.entry.js → p-ae978c9a.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f2ce9a1f.entry.js → p-bbcc47b0.entry.js} +1 -1
- package/dist/brandsync-wc/{p-fcd4ec60.entry.js → p-bc69a96c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-80cf96ff.entry.js → p-be2c1740.entry.js} +1 -1
- package/dist/brandsync-wc/p-bf53ad52.entry.js +1 -0
- package/dist/brandsync-wc/p-c10d2529.entry.js +1 -0
- package/dist/brandsync-wc/{p-abda1d69.entry.js → p-c4de155c.entry.js} +1 -1
- package/dist/brandsync-wc/p-c7f4c114.entry.js +1 -0
- package/dist/brandsync-wc/{p-52d5f6a9.entry.js → p-cfcf3f0a.entry.js} +1 -1
- package/dist/brandsync-wc/p-de7c946d.entry.js +1 -0
- package/dist/brandsync-wc/{p-a8cdf449.entry.js → p-e9b43754.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c5011746.entry.js → p-ee7da23d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-4bff9b4b.entry.js → p-f006d962.entry.js} +1 -1
- package/dist/brandsync-wc/p-f074f94e.entry.js +1 -0
- package/dist/brandsync-wc/p-f7d47c17.entry.js +1 -0
- package/dist/brandsync-wc/{p-7609221f.entry.js → p-fc58c663.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a3a4d541.entry.js → p-fddc7bd1.entry.js} +1 -1
- package/dist/cjs/brandsync-wc.cjs.js +2 -2
- package/dist/cjs/bs-accordion.cjs.entry.js +2 -2
- package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +2 -2
- package/dist/cjs/bs-ai-greeting.cjs.entry.js +2 -2
- package/dist/cjs/bs-ai-thinking.cjs.entry.js +2 -2
- package/dist/cjs/bs-attachment-list.cjs.entry.js +3 -3
- package/dist/cjs/bs-attachment.cjs.entry.js +2 -2
- package/dist/cjs/bs-avatar.cjs.entry.js +1 -1
- package/dist/cjs/bs-badge.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumb-overflow.cjs.entry.js +2 -2
- package/dist/cjs/bs-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumbs.cjs.entry.js +2 -2
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/bs-button.cjs.entry.js +23 -4
- package/dist/cjs/bs-card.cjs.entry.js +2 -2
- package/dist/cjs/bs-carousel.cjs.entry.js +196 -0
- package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +3 -3
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +3 -3
- package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +2 -2
- package/dist/cjs/bs-checkbox-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/bs-checkbox.cjs.entry.js +48 -3
- package/dist/cjs/bs-chip-filter.cjs.entry.js +3 -3
- package/dist/cjs/bs-chip-informative.cjs.entry.js +3 -3
- package/dist/cjs/bs-chip-input.cjs.entry.js +3 -3
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +2 -2
- package/dist/cjs/bs-composer.cjs.entry.js +2 -2
- package/dist/cjs/bs-data-table.cjs.entry.js +4 -4
- package/dist/cjs/bs-dialog.cjs.entry.js +2 -2
- package/dist/cjs/bs-file-upload-item.cjs.entry.js +85 -0
- package/dist/cjs/bs-file-upload.cjs.entry.js +110 -0
- package/dist/cjs/bs-icon-button.cjs.entry.js +22 -3
- package/dist/cjs/bs-inline-tab.cjs.entry.js +7 -3
- package/dist/cjs/bs-input.cjs.entry.js +69 -5
- package/dist/cjs/bs-logo.cjs.entry.js +1 -1
- package/dist/cjs/bs-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/bs-menu.cjs.entry.js +25 -3
- package/dist/cjs/bs-navigation-drawer-item.cjs.entry.js +2 -2
- package/dist/cjs/bs-navigation-drawer.cjs.entry.js +2 -2
- package/dist/cjs/bs-navigation-header.cjs.entry.js +2 -2
- package/dist/cjs/bs-pagination.cjs.entry.js +2 -2
- package/dist/cjs/bs-progress-linear.cjs.entry.js +8 -3
- package/dist/cjs/bs-progress.cjs.entry.js +8 -3
- package/dist/cjs/bs-radio.cjs.entry.js +81 -12
- package/dist/cjs/bs-slider.cjs.entry.js +54 -2
- package/dist/cjs/bs-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/bs-source-link.cjs.entry.js +4 -4
- package/dist/cjs/bs-stepper-step.cjs.entry.js +3 -3
- package/dist/cjs/bs-stepper.cjs.entry.js +3 -2
- package/dist/cjs/bs-switch.cjs.entry.js +36 -3
- package/dist/cjs/bs-tab.cjs.entry.js +7 -3
- package/dist/cjs/bs-tabs.cjs.entry.js +51 -2
- package/dist/cjs/bs-toast.cjs.entry.js +2 -2
- package/dist/cjs/bs-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{index-D7e6DfLV.js → index-kk9YXF2S.js} +43 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/bs-a11y.cmp.test.js +54 -0
- package/dist/collection/components/bs-accordion/bs-accordion.cmp.test.js +5 -0
- package/dist/collection/components/bs-accordion/bs-accordion.css +5 -5
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +1 -1
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +1 -1
- package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +1 -1
- package/dist/collection/components/bs-attachment/bs-attachment.css +1 -1
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.css +1 -1
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +1 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.css +1 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.js +1 -1
- package/dist/collection/components/bs-button/bs-button/bs-button.css +17 -10
- package/dist/collection/components/bs-button/bs-button/bs-button.js +16 -3
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.js +16 -3
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
- package/dist/collection/components/bs-card/bs-card.css +4 -0
- package/dist/collection/components/bs-carousel/bs-carousel.cmp.test.js +198 -0
- package/dist/collection/components/bs-carousel/bs-carousel.css +107 -0
- package/dist/collection/components/bs-carousel/bs-carousel.js +531 -0
- package/dist/collection/components/bs-carousel/bs-carousel.stories.js +68 -0
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.css +1 -1
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +1 -1
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +1 -1
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.css +3 -3
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +1 -1
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +1 -1
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +1 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.js +1 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox.css +8 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox.js +100 -2
- package/dist/collection/components/bs-chip/bs-chip-filter/bs-chip-filter.css +4 -4
- package/dist/collection/components/bs-chip/bs-chip-filter/bs-chip-filter.js +1 -1
- package/dist/collection/components/bs-chip/bs-chip-informative/bs-chip-informative.css +4 -4
- package/dist/collection/components/bs-chip/bs-chip-informative/bs-chip-informative.js +1 -1
- package/dist/collection/components/bs-chip/bs-chip-input/bs-chip-input.css +5 -5
- package/dist/collection/components/bs-chip/bs-chip-input/bs-chip-input.js +1 -1
- package/dist/collection/components/bs-composer/bs-composer.js +1 -1
- package/dist/collection/components/bs-composer-status-banner/bs-composer-status-banner.js +1 -1
- package/dist/collection/components/bs-data-table/bs-data-table.css +1 -1
- package/dist/collection/components/bs-data-table/bs-data-table.js +2 -2
- package/dist/collection/components/bs-dialog/bs-dialog.css +5 -1
- package/dist/collection/components/bs-file-upload/bs-file-upload.cmp.test.js +119 -0
- package/dist/collection/components/bs-file-upload/bs-file-upload.css +139 -0
- package/dist/collection/components/bs-file-upload/bs-file-upload.js +342 -0
- package/dist/collection/components/bs-file-upload/bs-file-upload.stories.js +116 -0
- package/dist/collection/components/bs-file-upload-item/bs-file-upload-item.cmp.test.js +115 -0
- package/dist/collection/components/bs-file-upload-item/bs-file-upload-item.css +154 -0
- package/dist/collection/components/bs-file-upload-item/bs-file-upload-item.js +329 -0
- package/dist/collection/components/bs-file-upload-item/bs-file-upload-item.stories.js +54 -0
- package/dist/collection/components/bs-form-association.cmp.test.js +172 -0
- package/dist/collection/components/bs-input/bs-input.css +10 -4
- package/dist/collection/components/bs-input/bs-input.js +82 -4
- package/dist/collection/components/bs-keyboard-nav.cmp.test.js +100 -0
- package/dist/collection/components/bs-menu/bs-menu.css +4 -0
- package/dist/collection/components/bs-menu/bs-menu.js +33 -1
- package/dist/collection/components/bs-menu-item/bs-menu-item.js +1 -1
- package/dist/collection/components/bs-pagination/bs-pagination.js +1 -1
- package/dist/collection/components/bs-progress/bs-progress.js +27 -2
- package/dist/collection/components/bs-progress-linear/bs-progress-linear.js +27 -2
- package/dist/collection/components/bs-radio/bs-radio.cmp.test.js +4 -10
- package/dist/collection/components/bs-radio/bs-radio.css +7 -1
- package/dist/collection/components/bs-radio/bs-radio.js +92 -14
- package/dist/collection/components/bs-radio/bs-radio.stories.js +1 -10
- package/dist/collection/components/bs-slider/bs-slider.js +68 -2
- package/dist/collection/components/bs-snackbar/bs-snackbar.js +1 -1
- package/dist/collection/components/bs-source-link/bs-source-link.css +2 -2
- package/dist/collection/components/bs-source-link/bs-source-link.js +2 -2
- package/dist/collection/components/bs-stepper/bs-stepper/bs-stepper.js +3 -2
- package/dist/collection/components/bs-stepper/bs-stepper-step/bs-stepper-step.css +3 -3
- package/dist/collection/components/bs-stepper/bs-stepper-step/bs-stepper-step.js +1 -1
- package/dist/collection/components/bs-switch/bs-switch.css +10 -1
- package/dist/collection/components/bs-switch/bs-switch.js +69 -2
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.css +2 -2
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.js +24 -1
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.css +2 -2
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.js +24 -1
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.js +57 -1
- package/dist/collection/components/bs-toast/bs-toast.js +1 -1
- package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
- package/dist/collection/components/forms/forms.stories.js +63 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.js +1 -1
- package/dist/collection/test/helpers/conventions.js +46 -0
- package/dist/collection/test/helpers/conventions.unit.test.js +38 -0
- package/dist/components/bs-accordion.js +1 -1
- package/dist/components/bs-ai-disclaimer.js +1 -1
- package/dist/components/bs-ai-greeting.js +1 -1
- package/dist/components/bs-ai-thinking.js +1 -1
- package/dist/components/bs-attachment-list.js +1 -1
- package/dist/components/bs-attachment.js +1 -1
- package/dist/components/bs-avatar.js +1 -1
- package/dist/components/bs-badge.js +1 -1
- package/dist/components/bs-breadcrumb-overflow.js +1 -1
- package/dist/components/bs-breadcrumb.js +1 -1
- package/dist/components/bs-breadcrumbs.js +1 -1
- package/dist/components/bs-button-skeleton.js +1 -1
- package/dist/components/bs-button.js +1 -1
- package/dist/components/bs-card.js +1 -1
- package/dist/components/bs-carousel.d.ts +11 -0
- package/dist/components/bs-carousel.js +1 -0
- package/dist/components/bs-chatbot-feedback.js +1 -1
- package/dist/components/bs-chatbot-header.js +1 -1
- package/dist/components/bs-chatbot-response-action.js +1 -1
- package/dist/components/bs-chatbot-sources-drawer.js +1 -1
- package/dist/components/bs-chatbot-suggestion-button.js +1 -1
- package/dist/components/bs-checkbox-skeleton.js +1 -1
- package/dist/components/bs-checkbox.js +1 -1
- package/dist/components/bs-chip-filter.js +1 -1
- package/dist/components/bs-chip-informative.js +1 -1
- package/dist/components/bs-chip-input.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.js +1 -1
- package/dist/components/bs-file-upload-item.d.ts +11 -0
- package/dist/components/bs-file-upload-item.js +1 -0
- package/dist/components/bs-file-upload.d.ts +11 -0
- package/dist/components/bs-file-upload.js +1 -0
- package/dist/components/bs-icon-button.js +1 -1
- package/dist/components/bs-inline-tab.js +1 -1
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-logo.js +1 -1
- package/dist/components/bs-menu-item.js +1 -1
- package/dist/components/bs-menu.js +1 -1
- package/dist/components/bs-navigation-drawer-item.js +1 -1
- package/dist/components/bs-navigation-drawer.js +1 -1
- package/dist/components/bs-navigation-header.js +1 -1
- package/dist/components/bs-pagination.js +1 -1
- package/dist/components/bs-progress-linear.js +1 -1
- package/dist/components/bs-progress.js +1 -1
- package/dist/components/bs-radio.js +1 -1
- package/dist/components/bs-slider.js +1 -1
- package/dist/components/bs-snackbar.js +1 -1
- package/dist/components/bs-source-link.js +1 -1
- package/dist/components/bs-stepper-step.js +1 -1
- package/dist/components/bs-stepper.js +1 -1
- package/dist/components/bs-switch.js +1 -1
- package/dist/components/bs-tab.js +1 -1
- package/dist/components/bs-tabs.js +1 -1
- package/dist/components/bs-toast.js +1 -1
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-B8eut73c.js → p-BA3c9Rom.js} +1 -1
- package/dist/components/{p-DIezWdNu.js → p-BfEyD6Ku.js} +1 -1
- package/dist/components/p-BkHYJIyj.js +1 -0
- package/dist/components/p-Buly0d5G.js +1 -0
- package/dist/components/p-CpUHnsq9.js +1 -0
- package/dist/components/p-EtXc94lJ.js +1 -0
- package/dist/components/{p-mnGJPH85.js → p-JYlmcxBn.js} +1 -1
- package/dist/components/{p-BhvV55-6.js → p-R2MlkUzD.js} +1 -1
- package/dist/components/p-wei0Ija2.js +1 -0
- package/dist/esm/brandsync-wc.js +3 -3
- package/dist/esm/bs-accordion.entry.js +2 -2
- package/dist/esm/bs-ai-disclaimer.entry.js +2 -2
- package/dist/esm/bs-ai-greeting.entry.js +2 -2
- package/dist/esm/bs-ai-thinking.entry.js +2 -2
- package/dist/esm/bs-attachment-list.entry.js +3 -3
- package/dist/esm/bs-attachment.entry.js +2 -2
- package/dist/esm/bs-avatar.entry.js +1 -1
- package/dist/esm/bs-badge.entry.js +1 -1
- package/dist/esm/bs-breadcrumb-overflow.entry.js +2 -2
- package/dist/esm/bs-breadcrumb.entry.js +1 -1
- package/dist/esm/bs-breadcrumbs.entry.js +2 -2
- package/dist/esm/bs-button-skeleton.entry.js +2 -2
- package/dist/esm/bs-button.entry.js +23 -4
- package/dist/esm/bs-card.entry.js +2 -2
- package/dist/esm/bs-carousel.entry.js +194 -0
- package/dist/esm/bs-chatbot-feedback.entry.js +3 -3
- package/dist/esm/bs-chatbot-header.entry.js +2 -2
- package/dist/esm/bs-chatbot-response-action.entry.js +3 -3
- package/dist/esm/bs-chatbot-sources-drawer.entry.js +2 -2
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +2 -2
- package/dist/esm/bs-checkbox-skeleton.entry.js +2 -2
- package/dist/esm/bs-checkbox.entry.js +48 -3
- package/dist/esm/bs-chip-filter.entry.js +3 -3
- package/dist/esm/bs-chip-informative.entry.js +3 -3
- package/dist/esm/bs-chip-input.entry.js +3 -3
- package/dist/esm/bs-composer-status-banner.entry.js +2 -2
- package/dist/esm/bs-composer.entry.js +2 -2
- package/dist/esm/bs-data-table.entry.js +4 -4
- package/dist/esm/bs-dialog.entry.js +2 -2
- package/dist/esm/bs-file-upload-item.entry.js +83 -0
- package/dist/esm/bs-file-upload.entry.js +108 -0
- package/dist/esm/bs-icon-button.entry.js +22 -3
- package/dist/esm/bs-inline-tab.entry.js +7 -3
- package/dist/esm/bs-input.entry.js +69 -5
- package/dist/esm/bs-logo.entry.js +1 -1
- package/dist/esm/bs-menu-item.entry.js +2 -2
- package/dist/esm/bs-menu.entry.js +25 -3
- package/dist/esm/bs-navigation-drawer-item.entry.js +2 -2
- package/dist/esm/bs-navigation-drawer.entry.js +2 -2
- package/dist/esm/bs-navigation-header.entry.js +2 -2
- package/dist/esm/bs-pagination.entry.js +2 -2
- package/dist/esm/bs-progress-linear.entry.js +8 -3
- package/dist/esm/bs-progress.entry.js +8 -3
- package/dist/esm/bs-radio.entry.js +81 -12
- package/dist/esm/bs-slider.entry.js +54 -2
- package/dist/esm/bs-snackbar.entry.js +2 -2
- package/dist/esm/bs-source-link.entry.js +4 -4
- package/dist/esm/bs-stepper-step.entry.js +3 -3
- package/dist/esm/bs-stepper.entry.js +3 -2
- package/dist/esm/bs-switch.entry.js +36 -3
- package/dist/esm/bs-tab.entry.js +7 -3
- package/dist/esm/bs-tabs.entry.js +51 -2
- package/dist/esm/bs-toast.entry.js +2 -2
- package/dist/esm/bs-tooltip.entry.js +2 -2
- package/dist/esm/{index-DuyFft7h.js → index-AgoOSYvW.js} +43 -5
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/bs-a11y.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-button/bs-button/bs-button.d.ts +4 -1
- package/dist/types/components/bs-button/bs-icon-button/bs-icon-button.d.ts +4 -1
- package/dist/types/components/bs-carousel/bs-carousel.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-carousel/bs-carousel.d.ts +101 -0
- package/dist/types/components/bs-carousel/bs-carousel.stories.d.ts +17 -0
- package/dist/types/components/bs-checkbox/bs-checkbox.d.ts +12 -0
- package/dist/types/components/bs-file-upload/bs-file-upload.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-file-upload/bs-file-upload.d.ts +59 -0
- package/dist/types/components/bs-file-upload/bs-file-upload.stories.d.ts +21 -0
- package/dist/types/components/bs-file-upload-item/bs-file-upload-item.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-file-upload-item/bs-file-upload-item.d.ts +58 -0
- package/dist/types/components/bs-file-upload-item/bs-file-upload-item.stories.d.ts +18 -0
- package/dist/types/components/bs-form-association.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-input/bs-input.d.ts +12 -0
- package/dist/types/components/bs-keyboard-nav.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-menu/bs-menu.d.ts +4 -0
- package/dist/types/components/bs-progress/bs-progress.d.ts +5 -0
- package/dist/types/components/bs-progress-linear/bs-progress-linear.d.ts +5 -0
- package/dist/types/components/bs-radio/bs-radio.d.ts +23 -9
- package/dist/types/components/bs-slider/bs-slider.d.ts +9 -0
- package/dist/types/components/bs-switch/bs-switch.d.ts +10 -0
- package/dist/types/components/bs-tab/bs-inline-tab/bs-inline-tab.d.ts +4 -0
- package/dist/types/components/bs-tab/bs-tab/bs-tab.d.ts +4 -0
- package/dist/types/components/bs-tab/bs-tabs/bs-tabs.d.ts +7 -0
- package/dist/types/components/forms/forms.stories.d.ts +6 -0
- package/dist/types/components.d.ts +735 -7
- package/dist/types/test/helpers/conventions.d.ts +21 -0
- package/dist/types/test/helpers/conventions.unit.test.d.ts +1 -0
- package/package.json +2 -1
- package/readme.md +14 -0
- package/dist/brandsync-wc/p-00f733ef.entry.js +0 -1
- package/dist/brandsync-wc/p-18c59979.entry.js +0 -1
- package/dist/brandsync-wc/p-3cb58df8.entry.js +0 -1
- package/dist/brandsync-wc/p-3ed5b215.entry.js +0 -1
- package/dist/brandsync-wc/p-413a1ee0.entry.js +0 -1
- package/dist/brandsync-wc/p-512dafc6.entry.js +0 -1
- package/dist/brandsync-wc/p-57609703.entry.js +0 -1
- package/dist/brandsync-wc/p-6bf8a5bd.entry.js +0 -1
- package/dist/brandsync-wc/p-6c769a1d.entry.js +0 -1
- package/dist/brandsync-wc/p-6d0c054b.entry.js +0 -1
- package/dist/brandsync-wc/p-7b9598d9.entry.js +0 -1
- package/dist/brandsync-wc/p-98021881.entry.js +0 -1
- package/dist/brandsync-wc/p-a96856fd.entry.js +0 -1
- package/dist/brandsync-wc/p-bb68e236.entry.js +0 -1
- package/dist/brandsync-wc/p-cfb49342.entry.js +0 -1
- package/dist/brandsync-wc/p-e2ac61c4.entry.js +0 -1
- package/dist/brandsync-wc/p-f714683d.entry.js +0 -1
- package/dist/brandsync-wc/p-fe778b6b.entry.js +0 -1
- package/dist/components/p-3gs695M6.js +0 -1
- package/dist/components/p-BaxFLlKS.js +0 -1
- package/dist/components/p-DKMMCLxx.js +0 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @prop --bs-file-upload-bg: Background of the dropzone at rest. Aliased to --bs-surface-raised.
|
|
3
|
+
* @prop --bs-file-upload-bg-dragging: Background while a file is dragged over it. Aliased to --bs-surface-container.
|
|
4
|
+
* @prop --bs-file-upload-border-color: Dashed border color at rest. Aliased to --bs-border-neutral-container.
|
|
5
|
+
* @prop --bs-file-upload-border-color-dragging: Dashed border color while dragging. Aliased to --bs-border-neutral-container-pressed.
|
|
6
|
+
* @prop --bs-file-upload-border-width: Dashed border width. Aliased to --bs-border-width-medium.
|
|
7
|
+
* @prop --bs-file-upload-radius: Corner radius. Aliased to --bs-border-radius-150.
|
|
8
|
+
* @prop --bs-file-upload-padding: Padding on all sides. Aliased to --bs-spacing-300.
|
|
9
|
+
* @prop --bs-file-upload-gap: Gap between the icon area and the content. Aliased to --bs-spacing-300.
|
|
10
|
+
* @prop --bs-file-upload-icon-size: Diameter of the round icon area. 102px, per the Figma spec.
|
|
11
|
+
* @prop --bs-file-upload-icon-bg: Background of the round icon area at rest. Aliased to --bs-surface-hover.
|
|
12
|
+
* @prop --bs-file-upload-icon-bg-dragging: Background of the icon area while dragging. Aliased to --bs-surface-raised.
|
|
13
|
+
* @prop --bs-file-upload-icon-color: Upload icon color. Aliased to --bs-icon-default.
|
|
14
|
+
* @prop --bs-file-upload-content-gap: Gap between the text and the browse button. Aliased to --bs-spacing-100.
|
|
15
|
+
* @prop --bs-file-upload-text-gap: Gap between the heading and the guidelines. Aliased to --bs-spacing-25.
|
|
16
|
+
* @prop --bs-file-upload-heading-color: Heading color. Aliased to --bs-text-default.
|
|
17
|
+
* @prop --bs-file-upload-description-color: Guidelines color. Aliased to --bs-text-secondary.
|
|
18
|
+
* @prop --bs-file-upload-font-size: Text size. Aliased to --bs-font-size-md.
|
|
19
|
+
* @prop --bs-file-upload-line-height: Text line height. Aliased to --bs-line-height-body-md.
|
|
20
|
+
*/
|
|
21
|
+
:host {
|
|
22
|
+
display: block;
|
|
23
|
+
|
|
24
|
+
--bs-file-upload-bg: var(--bs-surface-raised);
|
|
25
|
+
--bs-file-upload-bg-dragging: var(--bs-surface-container);
|
|
26
|
+
--bs-file-upload-border-color: var(--bs-border-neutral-container);
|
|
27
|
+
--bs-file-upload-border-color-dragging: var(--bs-border-neutral-container-pressed);
|
|
28
|
+
--bs-file-upload-border-width: var(--bs-border-width-medium);
|
|
29
|
+
--bs-file-upload-radius: var(--bs-border-radius-150);
|
|
30
|
+
--bs-file-upload-padding: var(--bs-spacing-300);
|
|
31
|
+
--bs-file-upload-gap: var(--bs-spacing-300);
|
|
32
|
+
|
|
33
|
+
--bs-file-upload-icon-size: 102px;
|
|
34
|
+
--bs-file-upload-icon-bg: var(--bs-surface-hover);
|
|
35
|
+
--bs-file-upload-icon-bg-dragging: var(--bs-surface-raised);
|
|
36
|
+
--bs-file-upload-icon-color: var(--bs-icon-default);
|
|
37
|
+
|
|
38
|
+
--bs-file-upload-content-gap: var(--bs-spacing-100);
|
|
39
|
+
--bs-file-upload-text-gap: var(--bs-spacing-25);
|
|
40
|
+
--bs-file-upload-heading-color: var(--bs-text-default);
|
|
41
|
+
--bs-file-upload-description-color: var(--bs-text-secondary);
|
|
42
|
+
--bs-file-upload-font-size: var(--bs-font-size-md);
|
|
43
|
+
--bs-file-upload-line-height: var(--bs-line-height-body-md);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.bs-file-upload {
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
gap: var(--bs-file-upload-gap);
|
|
52
|
+
padding: var(--bs-file-upload-padding);
|
|
53
|
+
border: var(--bs-file-upload-border-width) dashed var(--bs-file-upload-border-color);
|
|
54
|
+
border-radius: var(--bs-file-upload-radius);
|
|
55
|
+
background: var(--bs-file-upload-bg);
|
|
56
|
+
font-size: var(--bs-file-upload-font-size);
|
|
57
|
+
line-height: calc(var(--bs-file-upload-line-height) * 1px);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.bs-file-upload--horizontal {
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
justify-content: flex-start;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.bs-file-upload--vertical {
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
text-align: center;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.bs-file-upload--dragging {
|
|
71
|
+
background: var(--bs-file-upload-bg-dragging);
|
|
72
|
+
border-color: var(--bs-file-upload-border-color-dragging);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.bs-file-upload__icon {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex: none;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
width: var(--bs-file-upload-icon-size);
|
|
81
|
+
height: var(--bs-file-upload-icon-size);
|
|
82
|
+
border-radius: var(--bs-border-radius-full);
|
|
83
|
+
background: var(--bs-file-upload-icon-bg);
|
|
84
|
+
color: var(--bs-file-upload-icon-color);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.bs-file-upload--dragging .bs-file-upload__icon {
|
|
88
|
+
background: var(--bs-file-upload-icon-bg-dragging);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.bs-file-upload__icon-svg,
|
|
92
|
+
.bs-file-upload__icon ::slotted(*) {
|
|
93
|
+
display: block;
|
|
94
|
+
width: 32px;
|
|
95
|
+
height: 32px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.bs-file-upload__content {
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
gap: var(--bs-file-upload-content-gap);
|
|
102
|
+
min-width: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.bs-file-upload--horizontal .bs-file-upload__content {
|
|
106
|
+
align-items: flex-start;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.bs-file-upload--vertical .bs-file-upload__content {
|
|
110
|
+
align-items: center;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.bs-file-upload__text {
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
gap: var(--bs-file-upload-text-gap);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.bs-file-upload__heading {
|
|
120
|
+
color: var(--bs-file-upload-heading-color);
|
|
121
|
+
font-weight: 600;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.bs-file-upload__description {
|
|
125
|
+
color: var(--bs-file-upload-description-color);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.bs-file-upload--disabled {
|
|
129
|
+
cursor: not-allowed;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media (forced-colors: active) {
|
|
133
|
+
.bs-file-upload {
|
|
134
|
+
border-color: CanvasText;
|
|
135
|
+
}
|
|
136
|
+
.bs-file-upload--dragging {
|
|
137
|
+
border-color: Highlight;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A file dropzone: drag files onto it, or press "Browse file" to open the file picker. It reports
|
|
4
|
+
* the chosen files and does nothing else -- the consuming app owns the upload itself and shows its
|
|
5
|
+
* progress with `bs-file-upload-item`.
|
|
6
|
+
*
|
|
7
|
+
* ## When to use
|
|
8
|
+
* - Letting users add one or more files (documents, images) to upload.
|
|
9
|
+
*
|
|
10
|
+
* ## When not to use
|
|
11
|
+
* - Attaching files to a chat message -- see `bs-composer` / `bs-attachment`.
|
|
12
|
+
* - A file input that must submit with a native `<form>`: this component is **not**
|
|
13
|
+
* form-associated. Read the files from `bsFilesSelect` and submit them yourself.
|
|
14
|
+
*
|
|
15
|
+
* @slot icon - Replaces the default upload icon inside the round icon area.
|
|
16
|
+
* @part dropzone - The dashed drop area.
|
|
17
|
+
* @part icon - The round icon area.
|
|
18
|
+
* @part heading - The heading text.
|
|
19
|
+
* @part description - The guidelines text under the heading.
|
|
20
|
+
* @part browse - The "Browse file" button.
|
|
21
|
+
*/
|
|
22
|
+
// Note: this component's CSS Custom Properties (--bs-file-upload-*) are documented via @prop
|
|
23
|
+
// comments in bs-file-upload.css, not here (see bs-input.tsx's equivalent note).
|
|
24
|
+
export class BsFileUpload {
|
|
25
|
+
el;
|
|
26
|
+
inputEl;
|
|
27
|
+
/** Layout: icon beside the text (`horizontal`) or stacked above it, centered (`vertical`). */
|
|
28
|
+
direction = 'horizontal';
|
|
29
|
+
/** Heading text (e.g. "Upload your documents"). */
|
|
30
|
+
heading;
|
|
31
|
+
/** Guidelines under the heading (e.g. "PDF or JPG, up to 8MB"). */
|
|
32
|
+
description;
|
|
33
|
+
/** Label of the browse button. Override for localisation. */
|
|
34
|
+
buttonLabel = 'Browse file';
|
|
35
|
+
/** Which files are accepted, same syntax as the native `accept` attribute: comma-separated
|
|
36
|
+
* extensions (`.pdf`), MIME types (`image/png`) or wildcards (`image/*`). Applied to the picker
|
|
37
|
+
* and also to dropped files, which the browser does not filter. */
|
|
38
|
+
accept;
|
|
39
|
+
/** Allows selecting/dropping more than one file. Without it only the first file is taken. */
|
|
40
|
+
multiple = false;
|
|
41
|
+
/** Disables the browse button and ignores drops. */
|
|
42
|
+
disabled = false;
|
|
43
|
+
/** Whether a file is currently being dragged over the dropzone (the Figma "Drop" state). Set by
|
|
44
|
+
* the component during a drag; mutable and reflected so it can also be set to show the state
|
|
45
|
+
* statically. */
|
|
46
|
+
dragging = false;
|
|
47
|
+
/** Fires with the accepted files, after the picker closes or files are dropped. */
|
|
48
|
+
bsFilesSelect;
|
|
49
|
+
/** Fires with files that were not taken: they didn't match `accept`, or were extra files
|
|
50
|
+
* dropped while `multiple` is off. */
|
|
51
|
+
bsFilesReject;
|
|
52
|
+
matchesAccept(file) {
|
|
53
|
+
const tokens = (this.accept ?? '')
|
|
54
|
+
.split(',')
|
|
55
|
+
.map(t => t.trim().toLowerCase())
|
|
56
|
+
.filter(Boolean);
|
|
57
|
+
if (tokens.length === 0)
|
|
58
|
+
return true;
|
|
59
|
+
const name = file.name.toLowerCase();
|
|
60
|
+
const type = (file.type || '').toLowerCase();
|
|
61
|
+
return tokens.some(token => {
|
|
62
|
+
if (token.startsWith('.'))
|
|
63
|
+
return name.endsWith(token);
|
|
64
|
+
if (token.endsWith('/*'))
|
|
65
|
+
return type.startsWith(token.slice(0, -1));
|
|
66
|
+
return type === token;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
handleFiles(files) {
|
|
70
|
+
const matching = files.filter(f => this.matchesAccept(f));
|
|
71
|
+
const rejected = files.filter(f => !this.matchesAccept(f));
|
|
72
|
+
const accepted = this.multiple ? matching : matching.slice(0, 1);
|
|
73
|
+
if (!this.multiple)
|
|
74
|
+
rejected.push(...matching.slice(1));
|
|
75
|
+
if (accepted.length)
|
|
76
|
+
this.bsFilesSelect.emit(accepted);
|
|
77
|
+
if (rejected.length)
|
|
78
|
+
this.bsFilesReject.emit(rejected);
|
|
79
|
+
}
|
|
80
|
+
onBrowse = () => {
|
|
81
|
+
if (!this.disabled)
|
|
82
|
+
this.inputEl?.click();
|
|
83
|
+
};
|
|
84
|
+
onInputChange = () => {
|
|
85
|
+
const files = Array.from(this.inputEl?.files ?? []);
|
|
86
|
+
// Reset so choosing the same file again still fires `change`.
|
|
87
|
+
if (this.inputEl)
|
|
88
|
+
this.inputEl.value = '';
|
|
89
|
+
if (files.length)
|
|
90
|
+
this.handleFiles(files);
|
|
91
|
+
};
|
|
92
|
+
onDragOver = (ev) => {
|
|
93
|
+
if (this.disabled)
|
|
94
|
+
return;
|
|
95
|
+
ev.preventDefault();
|
|
96
|
+
this.dragging = true;
|
|
97
|
+
};
|
|
98
|
+
onDragLeave = (ev) => {
|
|
99
|
+
// dragleave also fires when crossing between child elements; only clear when leaving the zone.
|
|
100
|
+
const next = ev.relatedTarget;
|
|
101
|
+
if (next && ev.currentTarget.contains(next))
|
|
102
|
+
return;
|
|
103
|
+
this.dragging = false;
|
|
104
|
+
};
|
|
105
|
+
onDrop = (ev) => {
|
|
106
|
+
if (this.disabled)
|
|
107
|
+
return;
|
|
108
|
+
ev.preventDefault();
|
|
109
|
+
this.dragging = false;
|
|
110
|
+
const files = Array.from(ev.dataTransfer?.files ?? []);
|
|
111
|
+
if (files.length)
|
|
112
|
+
this.handleFiles(files);
|
|
113
|
+
};
|
|
114
|
+
render() {
|
|
115
|
+
return (h("div", { key: 'baa70a704a4c3508cd3186f567d0887218a9c04d', part: "dropzone", class: `bs-file-upload bs-file-upload--${this.direction} ${this.dragging ? 'bs-file-upload--dragging' : ''} ${this.disabled ? 'bs-file-upload--disabled' : ''}`, onDragEnter: this.onDragOver, onDragOver: this.onDragOver, onDragLeave: this.onDragLeave, onDrop: this.onDrop }, h("div", { key: 'c5fe3207ba56506a272c42097ec23881bcf863d4', part: "icon", class: "bs-file-upload__icon" }, h("slot", { key: 'd33d8f0f7b17bab679124823c61a1b7c6d031345', name: "icon" }, h(UploadIcon, { key: 'd0356e97a031867f323de21905a2bbca57963962' }))), h("div", { key: 'a5f4fb403556b2b596291bfddad2b73b1765f91f', class: "bs-file-upload__content" }, h("div", { key: 'b99afac250a8d40e54c97f74afde42620da2ff07', class: "bs-file-upload__text" }, this.heading && (h("span", { key: '33a2ce5aac1d8bf15c55dcf8ccfe4fbce6892fd1', part: "heading", class: "bs-file-upload__heading" }, this.heading)), this.description && (h("span", { key: 'eec7f2fcc598412107e7b9c78efae30a3714c674', part: "description", id: "description", class: "bs-file-upload__description" }, this.description))), h("bs-button", { key: 'f44a5747bb0e9452aefa1fe2fc1d51b1af7da9b1', part: "browse", variant: "neutral", size: "sm", disabled: this.disabled, onClick: this.onBrowse }, this.buttonLabel)), h("input", { key: 'c8e19f95978d103f535bf26fb64c34ff69c4c7ee', ref: el => (this.inputEl = el), class: "bs-file-upload__input", type: "file", hidden: true, tabindex: -1, accept: this.accept, multiple: this.multiple, disabled: this.disabled, "aria-describedby": this.description ? 'description' : undefined, onChange: this.onInputChange })));
|
|
116
|
+
}
|
|
117
|
+
static get is() { return "bs-file-upload"; }
|
|
118
|
+
static get encapsulation() { return "shadow"; }
|
|
119
|
+
static get originalStyleUrls() {
|
|
120
|
+
return {
|
|
121
|
+
"$": ["bs-file-upload.css"]
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
static get styleUrls() {
|
|
125
|
+
return {
|
|
126
|
+
"$": ["bs-file-upload.css"]
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
static get properties() {
|
|
130
|
+
return {
|
|
131
|
+
"direction": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "BsFileUploadDirection",
|
|
136
|
+
"resolved": "\"horizontal\" | \"vertical\"",
|
|
137
|
+
"references": {
|
|
138
|
+
"BsFileUploadDirection": {
|
|
139
|
+
"location": "local",
|
|
140
|
+
"path": "/home/runner/work/eg-brandsync-storybook/eg-brandsync-storybook/packages/wc/src/components/bs-file-upload/bs-file-upload.tsx",
|
|
141
|
+
"id": "src/components/bs-file-upload/bs-file-upload.tsx::BsFileUploadDirection"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"required": false,
|
|
146
|
+
"optional": false,
|
|
147
|
+
"docs": {
|
|
148
|
+
"tags": [],
|
|
149
|
+
"text": "Layout: icon beside the text (`horizontal`) or stacked above it, centered (`vertical`)."
|
|
150
|
+
},
|
|
151
|
+
"getter": false,
|
|
152
|
+
"setter": false,
|
|
153
|
+
"reflect": true,
|
|
154
|
+
"attribute": "direction",
|
|
155
|
+
"defaultValue": "'horizontal'"
|
|
156
|
+
},
|
|
157
|
+
"heading": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"mutable": false,
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "string",
|
|
162
|
+
"resolved": "string",
|
|
163
|
+
"references": {}
|
|
164
|
+
},
|
|
165
|
+
"required": false,
|
|
166
|
+
"optional": true,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [],
|
|
169
|
+
"text": "Heading text (e.g. \"Upload your documents\")."
|
|
170
|
+
},
|
|
171
|
+
"getter": false,
|
|
172
|
+
"setter": false,
|
|
173
|
+
"reflect": false,
|
|
174
|
+
"attribute": "heading"
|
|
175
|
+
},
|
|
176
|
+
"description": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"mutable": false,
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "string",
|
|
181
|
+
"resolved": "string",
|
|
182
|
+
"references": {}
|
|
183
|
+
},
|
|
184
|
+
"required": false,
|
|
185
|
+
"optional": true,
|
|
186
|
+
"docs": {
|
|
187
|
+
"tags": [],
|
|
188
|
+
"text": "Guidelines under the heading (e.g. \"PDF or JPG, up to 8MB\")."
|
|
189
|
+
},
|
|
190
|
+
"getter": false,
|
|
191
|
+
"setter": false,
|
|
192
|
+
"reflect": false,
|
|
193
|
+
"attribute": "description"
|
|
194
|
+
},
|
|
195
|
+
"buttonLabel": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"mutable": false,
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "string",
|
|
200
|
+
"resolved": "string",
|
|
201
|
+
"references": {}
|
|
202
|
+
},
|
|
203
|
+
"required": false,
|
|
204
|
+
"optional": false,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Label of the browse button. Override for localisation."
|
|
208
|
+
},
|
|
209
|
+
"getter": false,
|
|
210
|
+
"setter": false,
|
|
211
|
+
"reflect": false,
|
|
212
|
+
"attribute": "button-label",
|
|
213
|
+
"defaultValue": "'Browse file'"
|
|
214
|
+
},
|
|
215
|
+
"accept": {
|
|
216
|
+
"type": "string",
|
|
217
|
+
"mutable": false,
|
|
218
|
+
"complexType": {
|
|
219
|
+
"original": "string",
|
|
220
|
+
"resolved": "string",
|
|
221
|
+
"references": {}
|
|
222
|
+
},
|
|
223
|
+
"required": false,
|
|
224
|
+
"optional": true,
|
|
225
|
+
"docs": {
|
|
226
|
+
"tags": [],
|
|
227
|
+
"text": "Which files are accepted, same syntax as the native `accept` attribute: comma-separated\nextensions (`.pdf`), MIME types (`image/png`) or wildcards (`image/*`). Applied to the picker\nand also to dropped files, which the browser does not filter."
|
|
228
|
+
},
|
|
229
|
+
"getter": false,
|
|
230
|
+
"setter": false,
|
|
231
|
+
"reflect": false,
|
|
232
|
+
"attribute": "accept"
|
|
233
|
+
},
|
|
234
|
+
"multiple": {
|
|
235
|
+
"type": "boolean",
|
|
236
|
+
"mutable": false,
|
|
237
|
+
"complexType": {
|
|
238
|
+
"original": "boolean",
|
|
239
|
+
"resolved": "boolean",
|
|
240
|
+
"references": {}
|
|
241
|
+
},
|
|
242
|
+
"required": false,
|
|
243
|
+
"optional": false,
|
|
244
|
+
"docs": {
|
|
245
|
+
"tags": [],
|
|
246
|
+
"text": "Allows selecting/dropping more than one file. Without it only the first file is taken."
|
|
247
|
+
},
|
|
248
|
+
"getter": false,
|
|
249
|
+
"setter": false,
|
|
250
|
+
"reflect": false,
|
|
251
|
+
"attribute": "multiple",
|
|
252
|
+
"defaultValue": "false"
|
|
253
|
+
},
|
|
254
|
+
"disabled": {
|
|
255
|
+
"type": "boolean",
|
|
256
|
+
"mutable": false,
|
|
257
|
+
"complexType": {
|
|
258
|
+
"original": "boolean",
|
|
259
|
+
"resolved": "boolean",
|
|
260
|
+
"references": {}
|
|
261
|
+
},
|
|
262
|
+
"required": false,
|
|
263
|
+
"optional": false,
|
|
264
|
+
"docs": {
|
|
265
|
+
"tags": [],
|
|
266
|
+
"text": "Disables the browse button and ignores drops."
|
|
267
|
+
},
|
|
268
|
+
"getter": false,
|
|
269
|
+
"setter": false,
|
|
270
|
+
"reflect": true,
|
|
271
|
+
"attribute": "disabled",
|
|
272
|
+
"defaultValue": "false"
|
|
273
|
+
},
|
|
274
|
+
"dragging": {
|
|
275
|
+
"type": "boolean",
|
|
276
|
+
"mutable": true,
|
|
277
|
+
"complexType": {
|
|
278
|
+
"original": "boolean",
|
|
279
|
+
"resolved": "boolean",
|
|
280
|
+
"references": {}
|
|
281
|
+
},
|
|
282
|
+
"required": false,
|
|
283
|
+
"optional": false,
|
|
284
|
+
"docs": {
|
|
285
|
+
"tags": [],
|
|
286
|
+
"text": "Whether a file is currently being dragged over the dropzone (the Figma \"Drop\" state). Set by\nthe component during a drag; mutable and reflected so it can also be set to show the state\nstatically."
|
|
287
|
+
},
|
|
288
|
+
"getter": false,
|
|
289
|
+
"setter": false,
|
|
290
|
+
"reflect": true,
|
|
291
|
+
"attribute": "dragging",
|
|
292
|
+
"defaultValue": "false"
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
static get events() {
|
|
297
|
+
return [{
|
|
298
|
+
"method": "bsFilesSelect",
|
|
299
|
+
"name": "bsFilesSelect",
|
|
300
|
+
"bubbles": true,
|
|
301
|
+
"cancelable": true,
|
|
302
|
+
"composed": true,
|
|
303
|
+
"docs": {
|
|
304
|
+
"tags": [],
|
|
305
|
+
"text": "Fires with the accepted files, after the picker closes or files are dropped."
|
|
306
|
+
},
|
|
307
|
+
"complexType": {
|
|
308
|
+
"original": "File[]",
|
|
309
|
+
"resolved": "File[]",
|
|
310
|
+
"references": {
|
|
311
|
+
"File": {
|
|
312
|
+
"location": "global",
|
|
313
|
+
"id": "global::File"
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}, {
|
|
318
|
+
"method": "bsFilesReject",
|
|
319
|
+
"name": "bsFilesReject",
|
|
320
|
+
"bubbles": true,
|
|
321
|
+
"cancelable": true,
|
|
322
|
+
"composed": true,
|
|
323
|
+
"docs": {
|
|
324
|
+
"tags": [],
|
|
325
|
+
"text": "Fires with files that were not taken: they didn't match `accept`, or were extra files\ndropped while `multiple` is off."
|
|
326
|
+
},
|
|
327
|
+
"complexType": {
|
|
328
|
+
"original": "File[]",
|
|
329
|
+
"resolved": "File[]",
|
|
330
|
+
"references": {
|
|
331
|
+
"File": {
|
|
332
|
+
"location": "global",
|
|
333
|
+
"id": "global::File"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}];
|
|
338
|
+
}
|
|
339
|
+
static get elementRef() { return "el"; }
|
|
340
|
+
}
|
|
341
|
+
// Figma's "UploadSimple" icon (3272:50330), exported SVG, recolored via currentColor.
|
|
342
|
+
const UploadIcon = () => (h("svg", { class: "bs-file-upload__icon-svg", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("path", { d: "M16 18V4", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M27 18V26H5V18", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M11 9L16 4L21 9", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })));
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { html, render } from "lit";
|
|
2
|
+
import { componentDescription, propDescription } from "../../stories-utils";
|
|
3
|
+
const directions = ['horizontal', 'vertical'];
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/bs-file-upload',
|
|
6
|
+
parameters: { docs: { description: { component: componentDescription('bs-file-upload') } } },
|
|
7
|
+
render: args => html `
|
|
8
|
+
<bs-file-upload
|
|
9
|
+
direction=${args.direction}
|
|
10
|
+
heading=${args.heading}
|
|
11
|
+
description=${args.description}
|
|
12
|
+
button-label=${args.buttonLabel}
|
|
13
|
+
accept=${args.accept}
|
|
14
|
+
?multiple=${args.multiple}
|
|
15
|
+
?disabled=${args.disabled}
|
|
16
|
+
?dragging=${args.dragging}
|
|
17
|
+
></bs-file-upload>
|
|
18
|
+
`,
|
|
19
|
+
argTypes: {
|
|
20
|
+
direction: { control: { type: 'select' }, options: directions, description: propDescription('bs-file-upload', 'direction') },
|
|
21
|
+
heading: { control: 'text', description: propDescription('bs-file-upload', 'heading') },
|
|
22
|
+
description: { control: 'text', description: propDescription('bs-file-upload', 'description') },
|
|
23
|
+
buttonLabel: { control: 'text', description: propDescription('bs-file-upload', 'buttonLabel') },
|
|
24
|
+
accept: { control: 'text', description: propDescription('bs-file-upload', 'accept') },
|
|
25
|
+
multiple: { control: 'boolean', description: propDescription('bs-file-upload', 'multiple') },
|
|
26
|
+
disabled: { control: 'boolean', description: propDescription('bs-file-upload', 'disabled') },
|
|
27
|
+
dragging: { control: 'boolean', description: propDescription('bs-file-upload', 'dragging') },
|
|
28
|
+
},
|
|
29
|
+
args: {
|
|
30
|
+
direction: 'horizontal',
|
|
31
|
+
heading: 'Heading',
|
|
32
|
+
description: 'Upload Guidelines',
|
|
33
|
+
buttonLabel: 'Browse file',
|
|
34
|
+
accept: '',
|
|
35
|
+
multiple: true,
|
|
36
|
+
disabled: false,
|
|
37
|
+
dragging: false,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export default meta;
|
|
41
|
+
// Figma "Direction=Horizontal, States=Enabled".
|
|
42
|
+
export const Default = {};
|
|
43
|
+
// Figma "Direction=Vertical, States=Enabled".
|
|
44
|
+
export const Vertical = { args: { direction: 'vertical' } };
|
|
45
|
+
// Figma "States=Drop" -- what the zone looks like while a file is dragged over it (try it: drag a
|
|
46
|
+
// file from your desktop over the Default story).
|
|
47
|
+
export const Dragging = {
|
|
48
|
+
name: 'Drop state',
|
|
49
|
+
args: { dragging: true },
|
|
50
|
+
};
|
|
51
|
+
export const Disabled = { args: { disabled: true } };
|
|
52
|
+
// Every Figma variant side by side.
|
|
53
|
+
export const AllVariants = {
|
|
54
|
+
name: 'All variants',
|
|
55
|
+
render: () => html `
|
|
56
|
+
<div style="display: flex; flex-direction: column; gap: 20px;">
|
|
57
|
+
${['horizontal', 'vertical'].map(direction => html `
|
|
58
|
+
<bs-file-upload direction=${direction} heading="Heading" description="Upload Guidelines"></bs-file-upload>
|
|
59
|
+
<bs-file-upload direction=${direction} dragging heading="Heading" description="Upload Guidelines"></bs-file-upload>
|
|
60
|
+
`)}
|
|
61
|
+
</div>
|
|
62
|
+
`,
|
|
63
|
+
};
|
|
64
|
+
// The intended pairing: the dropzone reports files, the app uploads them and shows each one with
|
|
65
|
+
// bs-file-upload-item. Uploads here are simulated (a timer drives the progress) -- a real app drives
|
|
66
|
+
// the items from its own upload.
|
|
67
|
+
const formatSize = (bytes) => (bytes >= 1048576 ? `${(bytes / 1048576).toFixed(1)}MB` : `${Math.max(1, Math.round(bytes / 1024))}KB`);
|
|
68
|
+
function simulateUpload(item, file) {
|
|
69
|
+
item.state = 'loading';
|
|
70
|
+
let progress = 0;
|
|
71
|
+
const timer = window.setInterval(() => {
|
|
72
|
+
progress += 10 + Math.round(Math.random() * 15);
|
|
73
|
+
if (progress >= 100) {
|
|
74
|
+
window.clearInterval(timer);
|
|
75
|
+
const failed = /\.exe$/i.test(file.name);
|
|
76
|
+
item.state = failed ? 'error' : 'success';
|
|
77
|
+
if (failed)
|
|
78
|
+
item.message = 'Executable files are not allowed';
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
item.state = 'in-progress';
|
|
82
|
+
item.progress = progress;
|
|
83
|
+
}, 400);
|
|
84
|
+
item.addEventListener('bsCancel', () => window.clearInterval(timer));
|
|
85
|
+
}
|
|
86
|
+
export const WithUploadList = {
|
|
87
|
+
name: 'With upload list',
|
|
88
|
+
render: () => {
|
|
89
|
+
const onSelect = (ev) => {
|
|
90
|
+
const list = ev.currentTarget.parentElement.querySelector('.list');
|
|
91
|
+
ev.detail.forEach(file => {
|
|
92
|
+
const holder = document.createElement('div');
|
|
93
|
+
render(html `<bs-file-upload-item
|
|
94
|
+
file-name=${file.name}
|
|
95
|
+
file-size=${formatSize(file.size)}
|
|
96
|
+
@bsCancel=${() => holder.remove()}
|
|
97
|
+
@bsRemove=${() => holder.remove()}
|
|
98
|
+
></bs-file-upload-item>`, holder);
|
|
99
|
+
list.appendChild(holder);
|
|
100
|
+
simulateUpload(holder.firstElementChild, file);
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
return html `
|
|
104
|
+
<div style="display: flex; flex-direction: column; gap: 16px; max-width: 640px;">
|
|
105
|
+
<bs-file-upload
|
|
106
|
+
direction="vertical"
|
|
107
|
+
multiple
|
|
108
|
+
heading="Upload your documents"
|
|
109
|
+
description="Drag files here, or browse. Uploads are simulated."
|
|
110
|
+
@bsFilesSelect=${onSelect}
|
|
111
|
+
></bs-file-upload>
|
|
112
|
+
<div class="list" style="display: flex; flex-direction: column; gap: 12px;"></div>
|
|
113
|
+
</div>
|
|
114
|
+
`;
|
|
115
|
+
},
|
|
116
|
+
};
|