@brandsync/wc 1.15.0 → 1.17.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/CHANGELOG.md +16 -0
- package/REFERENCE.md +313 -0
- package/custom-elements.json +4760 -1555
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/p-044ac86c.entry.js +1 -0
- package/dist/brandsync-wc/p-065c7e7c.entry.js +1 -0
- package/dist/brandsync-wc/p-07673a48.entry.js +1 -0
- package/dist/brandsync-wc/{p-54f9529f.entry.js → p-08e96f13.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f3cc961b.entry.js → p-0bbaef51.entry.js} +1 -1
- package/dist/brandsync-wc/p-11d80e17.entry.js +1 -0
- package/dist/brandsync-wc/{p-c85fe37b.entry.js → p-1bd99669.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f4d1d56e.entry.js → p-225148be.entry.js} +1 -1
- package/dist/brandsync-wc/{p-6df48031.entry.js → p-2bd30709.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e294f698.entry.js → p-32297416.entry.js} +1 -1
- package/dist/brandsync-wc/{p-d165a742.entry.js → p-35f76ea7.entry.js} +1 -1
- package/dist/brandsync-wc/{p-4ca40386.entry.js → p-3bad5e1b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-ed71eb02.entry.js → p-3bdeeb9d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-1bf8fbbb.entry.js → p-3c6ec5d0.entry.js} +1 -1
- package/dist/brandsync-wc/{p-abfa43f5.entry.js → p-3cb79512.entry.js} +1 -1
- package/dist/brandsync-wc/p-3d2c62a6.entry.js +1 -0
- package/dist/brandsync-wc/{p-23379d7c.entry.js → p-3d7b0708.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2e285364.entry.js → p-43d5f708.entry.js} +1 -1
- package/dist/brandsync-wc/{p-d81c4f58.entry.js → p-4b460eda.entry.js} +1 -1
- package/dist/brandsync-wc/{p-b6081bba.entry.js → p-4eaa9ed4.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c25553bc.entry.js → p-4f4c0c68.entry.js} +1 -1
- package/dist/brandsync-wc/{p-a56bc608.entry.js → p-5057e4fe.entry.js} +1 -1
- package/dist/brandsync-wc/p-54d91ac9.entry.js +1 -0
- package/dist/brandsync-wc/{p-65fa1b21.entry.js → p-57ff14ca.entry.js} +1 -1
- package/dist/brandsync-wc/{p-538d5b58.entry.js → p-5b933ff4.entry.js} +1 -1
- package/dist/brandsync-wc/{p-b67a0c8f.entry.js → p-5c61eb06.entry.js} +1 -1
- package/dist/brandsync-wc/{p-86774165.entry.js → p-5eb5795f.entry.js} +1 -1
- package/dist/brandsync-wc/{p-b663ee67.entry.js → p-61deb48c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-ac9472ec.entry.js → p-67f125e8.entry.js} +1 -1
- package/dist/brandsync-wc/{p-3488c4fc.entry.js → p-6ea02b98.entry.js} +1 -1
- package/dist/brandsync-wc/p-70c650b2.entry.js +1 -0
- package/dist/brandsync-wc/p-79fc849c.entry.js +1 -0
- package/dist/brandsync-wc/{p-5a45ef51.entry.js → p-7ed071fb.entry.js} +1 -1
- package/dist/brandsync-wc/{p-3c21d0bf.entry.js → p-8134f97c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-4ed00786.entry.js → p-844205d9.entry.js} +1 -1
- package/dist/brandsync-wc/p-84d6d6eb.entry.js +1 -0
- package/dist/brandsync-wc/{p-401b3d3d.entry.js → p-857987f9.entry.js} +1 -1
- package/dist/brandsync-wc/{p-b9c9bcba.entry.js → p-8c4dfccb.entry.js} +1 -1
- package/dist/brandsync-wc/{p-38ac9aad.entry.js → p-90ba3032.entry.js} +1 -1
- package/dist/brandsync-wc/{p-1ca8b01e.entry.js → p-9396c67e.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e9b6b30f.entry.js → p-9d740928.entry.js} +1 -1
- package/dist/brandsync-wc/{p-baa3d37a.entry.js → p-a7fa839a.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f271e1d2.entry.js → p-a7fb0b59.entry.js} +1 -1
- package/dist/brandsync-wc/{p-89ea6366.entry.js → p-ab14a07d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-912629c6.entry.js → p-aec2dfeb.entry.js} +1 -1
- package/dist/brandsync-wc/{p-8390a155.entry.js → p-b02bf1ca.entry.js} +1 -1
- package/dist/brandsync-wc/{p-9beeb30c.entry.js → p-b142d8c9.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7a072e64.entry.js → p-b4511ad3.entry.js} +1 -1
- package/dist/brandsync-wc/{p-5ed1f45e.entry.js → p-b5710db6.entry.js} +1 -1
- package/dist/brandsync-wc/{p-34b0c048.entry.js → p-baa39c08.entry.js} +1 -1
- package/dist/brandsync-wc/{p-87d44938.entry.js → p-be7aac52.entry.js} +1 -1
- package/dist/brandsync-wc/p-c835afb7.entry.js +1 -0
- package/dist/brandsync-wc/{p-45986ad4.entry.js → p-d25adab2.entry.js} +1 -1
- package/dist/brandsync-wc/p-d2a15599.entry.js +1 -0
- package/dist/brandsync-wc/{p-b9c0b481.entry.js → p-d7956c51.entry.js} +1 -1
- package/dist/brandsync-wc/p-d9184940.entry.js +1 -0
- package/dist/brandsync-wc/{p-0f97fe35.entry.js → p-dcbeb143.entry.js} +1 -1
- package/dist/brandsync-wc/{p-cf287ff1.entry.js → p-debc83cc.entry.js} +1 -1
- package/dist/brandsync-wc/{p-dcacee29.entry.js → p-e0a9f2d1.entry.js} +1 -1
- package/dist/brandsync-wc/p-e123b391.entry.js +1 -0
- package/dist/brandsync-wc/p-e8ae626d.entry.js +1 -0
- package/dist/brandsync-wc/p-e8e22238.entry.js +1 -0
- package/dist/brandsync-wc/{p-6cb21302.entry.js → p-eb0dc5bf.entry.js} +1 -1
- package/dist/brandsync-wc/{p-1b4c0971.entry.js → p-f43a7f16.entry.js} +1 -1
- package/dist/brandsync-wc/{p-7b3518b8.entry.js → p-f82a9f0d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f0be9125.entry.js → p-f98dfa85.entry.js} +1 -1
- package/dist/brandsync-wc/{p-36fe783a.entry.js → p-fdc168ec.entry.js} +1 -1
- package/dist/brandsync-wc/{p-bc97ece8.entry.js → p-ffccc1ee.entry.js} +1 -1
- package/dist/cjs/brandsync-wc.cjs.js +1 -1
- package/dist/cjs/bs-accordion-group.cjs.entry.js +1 -1
- package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +1 -1
- package/dist/cjs/bs-ai-greeting.cjs.entry.js +1 -1
- package/dist/cjs/bs-ai-thinking.cjs.entry.js +1 -1
- package/dist/cjs/bs-app-shell.cjs.entry.js +1 -1
- package/dist/cjs/bs-attachment-list.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-checkbox-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bs-citation-preview.cjs.entry.js +1 -1
- package/dist/cjs/bs-command-palette.cjs.entry.js +374 -0
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +1 -1
- package/dist/cjs/bs-composer.cjs.entry.js +1 -1
- package/dist/cjs/bs-container.cjs.entry.js +1 -1
- package/dist/cjs/bs-data-table.cjs.entry.js +2 -2
- package/dist/cjs/bs-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/bs-divider.cjs.entry.js +1 -1
- package/dist/cjs/bs-empty-state.cjs.entry.js +47 -0
- package/dist/cjs/bs-error-page.cjs.entry.js +1 -1
- package/dist/cjs/bs-file-upload-item.cjs.entry.js +1 -1
- package/dist/cjs/bs-file-upload.cjs.entry.js +1 -1
- package/dist/cjs/bs-global-search.cjs.entry.js +326 -0
- package/dist/cjs/bs-grid.cjs.entry.js +2 -2
- package/dist/cjs/bs-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-icon-tile.cjs.entry.js +2 -2
- package/dist/cjs/bs-inline-tab.cjs.entry.js +1 -1
- package/dist/cjs/bs-input_3.cjs.entry.js +4 -4
- package/dist/cjs/bs-key-caps.cjs.entry.js +39 -0
- package/dist/cjs/bs-key.cjs.entry.js +28 -0
- package/dist/cjs/bs-keyboard-shortcuts.cjs.entry.js +112 -0
- package/dist/cjs/bs-list-item.cjs.entry.js +66 -0
- package/dist/cjs/bs-list.cjs.entry.js +103 -0
- package/dist/cjs/bs-message-list.cjs.entry.js +1 -1
- package/dist/cjs/bs-message.cjs.entry.js +1 -1
- package/dist/cjs/bs-navigation-drawer-item.cjs.entry.js +1 -1
- package/dist/cjs/bs-navigation-drawer.cjs.entry.js +2 -2
- package/dist/cjs/bs-navigation-header.cjs.entry.js +1 -1
- package/dist/cjs/bs-pagination.cjs.entry.js +1 -1
- package/dist/cjs/bs-popover.cjs.entry.js +1 -1
- package/dist/cjs/bs-progress-linear.cjs.entry.js +2 -2
- package/dist/cjs/bs-progress.cjs.entry.js +2 -2
- package/dist/cjs/bs-qr-code.cjs.entry.js +1 -1
- package/dist/cjs/bs-radio.cjs.entry.js +1 -1
- package/dist/cjs/bs-search-item.cjs.entry.js +47 -0
- package/dist/cjs/bs-session-timeout.cjs.entry.js +1 -1
- package/dist/cjs/bs-shortcut-row.cjs.entry.js +27 -0
- package/dist/cjs/bs-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bs-slider.cjs.entry.js +1 -1
- package/dist/cjs/bs-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/bs-source-link.cjs.entry.js +2 -2
- package/dist/cjs/bs-spinner.cjs.entry.js +1 -1
- package/dist/cjs/bs-split-pane.cjs.entry.js +1 -1
- package/dist/cjs/bs-stack.cjs.entry.js +1 -1
- package/dist/cjs/bs-stepper-step.cjs.entry.js +1 -1
- package/dist/cjs/bs-stepper.cjs.entry.js +1 -1
- package/dist/cjs/bs-switch.cjs.entry.js +1 -1
- package/dist/cjs/bs-tab_3.cjs.entry.js +3 -3
- package/dist/cjs/bs-timepicker.cjs.entry.js +2 -2
- package/dist/cjs/bs-toast.cjs.entry.js +1 -1
- package/dist/cjs/bs-tooltip-trigger.cjs.entry.js +1 -1
- package/dist/cjs/bs-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/bs-tree-item.cjs.entry.js +94 -0
- package/dist/cjs/bs-tree.cjs.entry.js +197 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +13 -1
- package/dist/collection/components/bs-accordion-group/bs-accordion-group.js +1 -1
- package/dist/collection/components/bs-ai-disclaimer/bs-ai-disclaimer.js +1 -1
- package/dist/collection/components/bs-ai-greeting/bs-ai-greeting.js +1 -1
- package/dist/collection/components/bs-ai-thinking/bs-ai-thinking.js +1 -1
- package/dist/collection/components/bs-app-shell/bs-app-shell.js +1 -1
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.js +1 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumbs/bs-breadcrumbs.js +1 -1
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.js +1 -1
- package/dist/collection/components/bs-button-skeleton/bs-button-skeleton.js +1 -1
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.js +1 -1
- package/dist/collection/components/bs-chatbot-header/bs-chatbot-header.js +1 -1
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.js +1 -1
- package/dist/collection/components/bs-chatbot-sources-drawer/bs-chatbot-sources-drawer.js +1 -1
- package/dist/collection/components/bs-chatbot-suggestion-button/bs-chatbot-suggestion-button.js +1 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox-skeleton/bs-checkbox-skeleton.js +1 -1
- package/dist/collection/components/bs-citation-preview/bs-citation-preview.js +1 -1
- package/dist/collection/components/bs-command-palette/bs-command-palette.cmp.test.js +207 -0
- package/dist/collection/components/bs-command-palette/bs-command-palette.css +214 -0
- package/dist/collection/components/bs-command-palette/bs-command-palette.js +1114 -0
- package/dist/collection/components/bs-command-palette/bs-command-palette.stories.js +194 -0
- 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-container/bs-container.js +1 -1
- package/dist/collection/components/bs-data-table/bs-data-table.js +2 -2
- package/dist/collection/components/bs-datepicker/bs-datepicker.js +1 -1
- package/dist/collection/components/bs-divider/bs-divider.js +1 -1
- package/dist/collection/components/bs-empty-state/bs-empty-state.cmp.test.js +102 -0
- package/dist/collection/components/bs-empty-state/bs-empty-state.css +45 -0
- package/dist/collection/components/bs-empty-state/bs-empty-state.js +175 -0
- package/dist/collection/components/bs-empty-state/bs-empty-state.stories.js +52 -0
- package/dist/collection/components/bs-error-page/bs-error-page.js +1 -1
- package/dist/collection/components/bs-file-upload/bs-file-upload.js +1 -1
- package/dist/collection/components/bs-file-upload-item/bs-file-upload-item.js +1 -1
- package/dist/collection/components/bs-global-search/bs-global-search.cmp.test.js +491 -0
- package/dist/collection/components/bs-global-search/bs-global-search.css +115 -0
- package/dist/collection/components/bs-global-search/bs-global-search.js +1024 -0
- package/dist/collection/components/bs-global-search/bs-global-search.stories.js +146 -0
- package/dist/collection/components/bs-grid/bs-grid.js +2 -2
- package/dist/collection/components/bs-icon-tile/bs-icon-tile.js +2 -2
- package/dist/collection/components/bs-input/bs-input.js +2 -2
- package/dist/collection/components/bs-key/bs-key.cmp.test.js +59 -0
- package/dist/collection/components/bs-key/bs-key.css +58 -0
- package/dist/collection/components/bs-key/bs-key.js +84 -0
- package/dist/collection/components/bs-key/bs-key.stories.js +19 -0
- package/dist/collection/components/bs-key-caps/bs-key-caps.cmp.test.js +60 -0
- package/dist/collection/components/bs-key-caps/bs-key-caps.css +28 -0
- package/dist/collection/components/bs-key-caps/bs-key-caps.js +120 -0
- package/dist/collection/components/bs-key-caps/bs-key-caps.stories.js +29 -0
- package/dist/collection/components/bs-keyboard-shortcuts/bs-keyboard-shortcuts.cmp.test.js +194 -0
- package/dist/collection/components/bs-keyboard-shortcuts/bs-keyboard-shortcuts.css +138 -0
- package/dist/collection/components/bs-keyboard-shortcuts/bs-keyboard-shortcuts.js +485 -0
- package/dist/collection/components/bs-keyboard-shortcuts/bs-keyboard-shortcuts.stories.js +111 -0
- package/dist/collection/components/bs-list/bs-list.cmp.test.js +99 -0
- package/dist/collection/components/bs-list/bs-list.css +15 -0
- package/dist/collection/components/bs-list/bs-list.js +241 -0
- package/dist/collection/components/bs-list/bs-list.stories.js +43 -0
- package/dist/collection/components/bs-list-item/bs-list-item.cmp.test.js +137 -0
- package/dist/collection/components/bs-list-item/bs-list-item.css +139 -0
- package/dist/collection/components/bs-list-item/bs-list-item.js +343 -0
- package/dist/collection/components/bs-list-item/bs-list-item.stories.js +86 -0
- package/dist/collection/components/bs-menu/bs-menu.js +1 -1
- package/dist/collection/components/bs-menu-item/bs-menu-item.cmp.test.js +6 -0
- package/dist/collection/components/bs-menu-item/bs-menu-item.js +1 -1
- package/dist/collection/components/bs-message/bs-message.js +1 -1
- package/dist/collection/components/bs-message-list/bs-message-list.js +1 -1
- package/dist/collection/components/bs-pagination/bs-pagination.js +1 -1
- package/dist/collection/components/bs-popover/bs-popover.js +1 -1
- package/dist/collection/components/bs-progress/bs-progress.js +2 -2
- package/dist/collection/components/bs-progress-linear/bs-progress-linear.js +2 -2
- package/dist/collection/components/bs-qr-code/bs-qr-code.js +1 -1
- package/dist/collection/components/bs-radio/bs-radio.js +1 -1
- package/dist/collection/components/bs-search-item/bs-search-item.cmp.test.js +147 -0
- package/dist/collection/components/bs-search-item/bs-search-item.css +112 -0
- package/dist/collection/components/bs-search-item/bs-search-item.js +222 -0
- package/dist/collection/components/bs-search-item/bs-search-item.stories.js +31 -0
- package/dist/collection/components/bs-session-timeout/bs-session-timeout.js +1 -1
- package/dist/collection/components/bs-shortcut-row/bs-shortcut-row.cmp.test.js +60 -0
- package/dist/collection/components/bs-shortcut-row/bs-shortcut-row.css +42 -0
- package/dist/collection/components/bs-shortcut-row/bs-shortcut-row.js +154 -0
- package/dist/collection/components/bs-shortcut-row/bs-shortcut-row.stories.js +24 -0
- package/dist/collection/components/bs-skeleton/bs-skeleton.js +1 -1
- package/dist/collection/components/bs-slider/bs-slider.js +1 -1
- package/dist/collection/components/bs-snackbar/bs-snackbar.js +1 -1
- package/dist/collection/components/bs-source-link/bs-source-link.js +2 -2
- package/dist/collection/components/bs-spinner/bs-spinner.js +1 -1
- package/dist/collection/components/bs-split-pane/bs-split-pane.js +1 -1
- package/dist/collection/components/bs-stack/bs-stack.js +1 -1
- package/dist/collection/components/bs-stepper/bs-stepper/bs-stepper.js +1 -1
- package/dist/collection/components/bs-stepper/bs-stepper-step/bs-stepper-step.js +1 -1
- package/dist/collection/components/bs-switch/bs-switch.js +1 -1
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.js +1 -1
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.js +1 -1
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.js +1 -1
- package/dist/collection/components/bs-timepicker/bs-timepicker.js +2 -2
- 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/bs-tooltip-trigger/bs-tooltip-trigger.js +1 -1
- package/dist/collection/components/bs-tree/bs-tree.cmp.test.js +166 -0
- package/dist/collection/components/bs-tree/bs-tree.css +8 -0
- package/dist/collection/components/bs-tree/bs-tree.js +354 -0
- package/dist/collection/components/bs-tree/bs-tree.stories.js +34 -0
- package/dist/collection/components/bs-tree-item/bs-tree-item.cmp.test.js +187 -0
- package/dist/collection/components/bs-tree-item/bs-tree-item.css +161 -0
- package/dist/collection/components/bs-tree-item/bs-tree-item.js +305 -0
- package/dist/collection/components/bs-tree-item/bs-tree-item.stories.js +54 -0
- package/dist/collection/components/bs-whats-new-entry/bs-whats-new-entry.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.js +2 -2
- 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/components/bs-accordion-group.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-app-shell.js +1 -1
- package/dist/components/bs-attachment-list.js +1 -1
- package/dist/components/bs-attachment.js +1 -1
- package/dist/components/bs-breadcrumb-overflow.js +1 -1
- package/dist/components/bs-breadcrumbs.js +1 -1
- package/dist/components/bs-button-skeleton.js +1 -1
- package/dist/components/bs-carousel.js +1 -1
- package/dist/components/bs-chatbot-feedback.js +1 -1
- package/dist/components/bs-chatbot-header.js +1 -1
- package/dist/components/bs-chatbot-response-action.js +1 -1
- package/dist/components/bs-chatbot-sources-drawer.js +1 -1
- package/dist/components/bs-chatbot-suggestion-button.js +1 -1
- package/dist/components/bs-checkbox-skeleton.js +1 -1
- package/dist/components/bs-citation-preview.js +1 -1
- package/dist/components/bs-command-palette.d.ts +11 -0
- package/dist/components/bs-command-palette.js +1 -0
- package/dist/components/bs-composer-status-banner.js +1 -1
- package/dist/components/bs-composer.js +1 -1
- package/dist/components/bs-container.js +1 -1
- package/dist/components/bs-cookie-consent.js +1 -1
- package/dist/components/bs-data-table.js +1 -1
- package/dist/components/bs-datepicker.js +1 -1
- package/dist/components/bs-dialog.js +1 -1
- package/dist/components/bs-divider.js +1 -1
- package/dist/components/bs-empty-state.d.ts +11 -0
- package/dist/components/bs-empty-state.js +1 -0
- package/dist/components/bs-error-page.js +1 -1
- package/dist/components/bs-file-upload-item.js +1 -1
- package/dist/components/bs-file-upload.js +1 -1
- package/dist/components/bs-global-search.d.ts +11 -0
- package/dist/components/bs-global-search.js +1 -0
- package/dist/components/bs-grid.js +1 -1
- package/dist/components/bs-icon-button.js +1 -1
- package/dist/components/bs-icon-tile.js +1 -1
- package/dist/components/bs-inline-tab.js +1 -1
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-key-caps.d.ts +11 -0
- package/dist/components/bs-key-caps.js +1 -0
- package/dist/components/bs-key.d.ts +11 -0
- package/dist/components/bs-key.js +1 -0
- package/dist/components/bs-keyboard-shortcuts.d.ts +11 -0
- package/dist/components/bs-keyboard-shortcuts.js +1 -0
- package/dist/components/bs-list-item.d.ts +11 -0
- package/dist/components/bs-list-item.js +1 -0
- package/dist/components/bs-list.d.ts +11 -0
- package/dist/components/bs-list.js +1 -0
- package/dist/components/bs-menu-item.js +1 -1
- package/dist/components/bs-menu.js +1 -1
- package/dist/components/bs-message-list.js +1 -1
- package/dist/components/bs-message.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-onboarding-checklist.js +1 -1
- package/dist/components/bs-pagination.js +1 -1
- package/dist/components/bs-popover.js +1 -1
- package/dist/components/bs-product-tour.js +1 -1
- package/dist/components/bs-progress-linear.js +1 -1
- package/dist/components/bs-progress.js +1 -1
- package/dist/components/bs-qr-code.js +1 -1
- package/dist/components/bs-radio.js +1 -1
- package/dist/components/bs-search-item.d.ts +11 -0
- package/dist/components/bs-search-item.js +1 -0
- package/dist/components/bs-session-timeout.js +1 -1
- package/dist/components/bs-shortcut-row.d.ts +11 -0
- package/dist/components/bs-shortcut-row.js +1 -0
- package/dist/components/bs-side-panel.js +1 -1
- package/dist/components/bs-skeleton.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-spinner.js +1 -1
- package/dist/components/bs-split-pane.js +1 -1
- package/dist/components/bs-stack.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-timepicker.js +1 -1
- package/dist/components/bs-toast.js +1 -1
- package/dist/components/bs-tooltip-trigger.js +1 -1
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/bs-tree-item.d.ts +11 -0
- package/dist/components/bs-tree-item.js +1 -0
- package/dist/components/bs-tree.d.ts +11 -0
- package/dist/components/bs-tree.js +1 -0
- package/dist/components/bs-whats-new-entry.js +1 -1
- package/dist/components/bs-whats-new.js +1 -1
- package/dist/components/{p-GTDI4Ibw.js → p-B32Kl4IB.js} +1 -1
- package/dist/components/{p-B128GX8H.js → p-BDnZvjlq.js} +1 -1
- package/dist/components/{p-Bqe4waKJ.js → p-BUpnOUIM.js} +1 -1
- package/dist/components/p-BcYNrEOB.js +1 -0
- package/dist/components/{p-B80vOwH6.js → p-BcbaiZLh.js} +1 -1
- package/dist/components/p-Bp3DIxjT.js +1 -0
- package/dist/components/p-CH5atin4.js +1 -0
- package/dist/components/{p-kDJsWjTN.js → p-CRM1wIX9.js} +1 -1
- package/dist/components/{p-Mf1jorXP.js → p-CYzBTzzf.js} +1 -1
- package/dist/components/p-CervX0wH.js +1 -0
- package/dist/components/{p-ElcsxZSh.js → p-Cpe2k7ZC.js} +1 -1
- package/dist/components/{p-BvYkZcOU.js → p-D7AXo5NT.js} +1 -1
- package/dist/components/{p-B3l4WpgS.js → p-D8bvv9QQ.js} +1 -1
- package/dist/components/{p-ByKcHsj0.js → p-DG9eT5yi.js} +1 -1
- package/dist/components/{p-D0KM1R2i.js → p-DMLfXpva.js} +1 -1
- package/dist/components/{p-CQjSDdH7.js → p-DYDk73TF.js} +1 -1
- package/dist/components/{p-C7RZ6qZC.js → p-DcjgRtSQ.js} +1 -1
- package/dist/components/p-Dt4JNhHT.js +1 -0
- package/dist/components/{p-CK7fiES5.js → p-DtYTs9Kh.js} +1 -1
- package/dist/components/{p-BsbtyRJV.js → p-TAY9S9yG.js} +1 -1
- package/dist/components/{p-ByLUtXxO.js → p-w-DkdA4O.js} +1 -1
- package/dist/esm/brandsync-wc.js +1 -1
- package/dist/esm/bs-accordion-group.entry.js +1 -1
- package/dist/esm/bs-ai-disclaimer.entry.js +1 -1
- package/dist/esm/bs-ai-greeting.entry.js +1 -1
- package/dist/esm/bs-ai-thinking.entry.js +1 -1
- package/dist/esm/bs-app-shell.entry.js +1 -1
- package/dist/esm/bs-attachment-list.entry.js +1 -1
- package/dist/esm/bs-breadcrumbs.entry.js +1 -1
- package/dist/esm/bs-button-skeleton.entry.js +1 -1
- package/dist/esm/bs-chatbot-feedback.entry.js +1 -1
- package/dist/esm/bs-chatbot-header.entry.js +1 -1
- package/dist/esm/bs-chatbot-response-action.entry.js +1 -1
- package/dist/esm/bs-chatbot-sources-drawer.entry.js +1 -1
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +1 -1
- package/dist/esm/bs-checkbox-skeleton.entry.js +1 -1
- package/dist/esm/bs-citation-preview.entry.js +1 -1
- package/dist/esm/bs-command-palette.entry.js +372 -0
- package/dist/esm/bs-composer-status-banner.entry.js +1 -1
- package/dist/esm/bs-composer.entry.js +1 -1
- package/dist/esm/bs-container.entry.js +1 -1
- package/dist/esm/bs-data-table.entry.js +2 -2
- package/dist/esm/bs-datepicker.entry.js +1 -1
- package/dist/esm/bs-divider.entry.js +1 -1
- package/dist/esm/bs-empty-state.entry.js +45 -0
- package/dist/esm/bs-error-page.entry.js +1 -1
- package/dist/esm/bs-file-upload-item.entry.js +1 -1
- package/dist/esm/bs-file-upload.entry.js +1 -1
- package/dist/esm/bs-global-search.entry.js +324 -0
- package/dist/esm/bs-grid.entry.js +2 -2
- package/dist/esm/bs-icon-button.entry.js +1 -1
- package/dist/esm/bs-icon-tile.entry.js +2 -2
- package/dist/esm/bs-inline-tab.entry.js +1 -1
- package/dist/esm/bs-input_3.entry.js +4 -4
- package/dist/esm/bs-key-caps.entry.js +37 -0
- package/dist/esm/bs-key.entry.js +26 -0
- package/dist/esm/bs-keyboard-shortcuts.entry.js +110 -0
- package/dist/esm/bs-list-item.entry.js +64 -0
- package/dist/esm/bs-list.entry.js +101 -0
- package/dist/esm/bs-message-list.entry.js +1 -1
- package/dist/esm/bs-message.entry.js +1 -1
- package/dist/esm/bs-navigation-drawer-item.entry.js +1 -1
- package/dist/esm/bs-navigation-drawer.entry.js +2 -2
- package/dist/esm/bs-navigation-header.entry.js +1 -1
- package/dist/esm/bs-pagination.entry.js +1 -1
- package/dist/esm/bs-popover.entry.js +1 -1
- package/dist/esm/bs-progress-linear.entry.js +2 -2
- package/dist/esm/bs-progress.entry.js +2 -2
- package/dist/esm/bs-qr-code.entry.js +1 -1
- package/dist/esm/bs-radio.entry.js +1 -1
- package/dist/esm/bs-search-item.entry.js +45 -0
- package/dist/esm/bs-session-timeout.entry.js +1 -1
- package/dist/esm/bs-shortcut-row.entry.js +25 -0
- package/dist/esm/bs-skeleton.entry.js +1 -1
- package/dist/esm/bs-slider.entry.js +1 -1
- package/dist/esm/bs-snackbar.entry.js +1 -1
- package/dist/esm/bs-source-link.entry.js +2 -2
- package/dist/esm/bs-spinner.entry.js +1 -1
- package/dist/esm/bs-split-pane.entry.js +1 -1
- package/dist/esm/bs-stack.entry.js +1 -1
- package/dist/esm/bs-stepper-step.entry.js +1 -1
- package/dist/esm/bs-stepper.entry.js +1 -1
- package/dist/esm/bs-switch.entry.js +1 -1
- package/dist/esm/bs-tab_3.entry.js +3 -3
- package/dist/esm/bs-timepicker.entry.js +2 -2
- package/dist/esm/bs-toast.entry.js +1 -1
- package/dist/esm/bs-tooltip-trigger.entry.js +1 -1
- package/dist/esm/bs-tooltip.entry.js +1 -1
- package/dist/esm/bs-tree-item.entry.js +92 -0
- package/dist/esm/bs-tree.entry.js +195 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/bs-command-palette/bs-command-palette.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-command-palette/bs-command-palette.d.ts +172 -0
- package/dist/types/components/bs-command-palette/bs-command-palette.stories.d.ts +56 -0
- package/dist/types/components/bs-empty-state/bs-empty-state.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-empty-state/bs-empty-state.d.ts +50 -0
- package/dist/types/components/bs-empty-state/bs-empty-state.stories.d.ts +13 -0
- package/dist/types/components/bs-global-search/bs-global-search.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-global-search/bs-global-search.d.ts +166 -0
- package/dist/types/components/bs-global-search/bs-global-search.stories.d.ts +61 -0
- package/dist/types/components/bs-key/bs-key.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-key/bs-key.d.ts +36 -0
- package/dist/types/components/bs-key/bs-key.stories.d.ts +11 -0
- package/dist/types/components/bs-key-caps/bs-key-caps.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-key-caps/bs-key-caps.d.ts +31 -0
- package/dist/types/components/bs-key-caps/bs-key-caps.stories.d.ts +15 -0
- package/dist/types/components/bs-keyboard-shortcuts/bs-keyboard-shortcuts.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-keyboard-shortcuts/bs-keyboard-shortcuts.d.ts +95 -0
- package/dist/types/components/bs-keyboard-shortcuts/bs-keyboard-shortcuts.stories.d.ts +43 -0
- package/dist/types/components/bs-list/bs-list.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-list/bs-list.d.ts +42 -0
- package/dist/types/components/bs-list/bs-list.stories.d.ts +13 -0
- package/dist/types/components/bs-list-item/bs-list-item.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-list-item/bs-list-item.d.ts +85 -0
- package/dist/types/components/bs-list-item/bs-list-item.stories.d.ts +22 -0
- package/dist/types/components/bs-search-item/bs-search-item.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-search-item/bs-search-item.d.ts +61 -0
- package/dist/types/components/bs-search-item/bs-search-item.stories.d.ts +13 -0
- package/dist/types/components/bs-shortcut-row/bs-shortcut-row.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-shortcut-row/bs-shortcut-row.d.ts +38 -0
- package/dist/types/components/bs-shortcut-row/bs-shortcut-row.stories.d.ts +13 -0
- package/dist/types/components/bs-tree/bs-tree.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-tree/bs-tree.d.ts +53 -0
- package/dist/types/components/bs-tree/bs-tree.stories.d.ts +11 -0
- package/dist/types/components/bs-tree-item/bs-tree-item.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-tree-item/bs-tree-item.d.ts +60 -0
- package/dist/types/components/bs-tree-item/bs-tree-item.stories.d.ts +19 -0
- package/dist/types/components.d.ts +2700 -199
- package/package.json +1 -1
- package/reference.d.ts +36 -0
- package/reference.json +1076 -47
- package/dist/brandsync-wc/p-769c5b4a.entry.js +0 -1
- package/dist/brandsync-wc/p-e5f50e93.entry.js +0 -1
- package/dist/brandsync-wc/p-e72dd05e.entry.js +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { componentDescription } from "../../stories-utils";
|
|
3
|
+
const SEARCH_ICON = html `<svg slot="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" /></svg>`;
|
|
4
|
+
const WARNING_ICON = html `<svg slot="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9" /><path d="M12 7.5v5M12 16.2v.1" /></svg>`;
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/bs-empty-state',
|
|
7
|
+
parameters: { docs: { description: { component: componentDescription('bs-empty-state') } } },
|
|
8
|
+
argTypes: {
|
|
9
|
+
heading: { control: 'text' },
|
|
10
|
+
description: { control: 'text' },
|
|
11
|
+
intent: { control: 'select', options: ['default', 'success', 'warning', 'error', 'brand', 'information'] },
|
|
12
|
+
headingLevel: { control: 'select', options: [2, 3, 4, 5, 6] },
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
heading: 'No events match these filters',
|
|
16
|
+
description: 'Try a wider date range or clear filters.',
|
|
17
|
+
intent: 'default',
|
|
18
|
+
headingLevel: 3,
|
|
19
|
+
},
|
|
20
|
+
render: args => html `
|
|
21
|
+
<div style="width: 480px">
|
|
22
|
+
<bs-empty-state heading=${args.heading} description=${args.description} intent=${args.intent} .headingLevel=${args.headingLevel}>
|
|
23
|
+
${SEARCH_ICON}
|
|
24
|
+
<bs-button slot="action" variant="outlined">Clear filters</bs-button>
|
|
25
|
+
</bs-empty-state>
|
|
26
|
+
</div>
|
|
27
|
+
`,
|
|
28
|
+
};
|
|
29
|
+
export default meta;
|
|
30
|
+
export const NoResults = {};
|
|
31
|
+
export const Error = {
|
|
32
|
+
args: {
|
|
33
|
+
heading: 'Search isn’t available right now',
|
|
34
|
+
description: 'We couldn’t reach the server. Your query is kept — try again in a moment.',
|
|
35
|
+
intent: 'error',
|
|
36
|
+
},
|
|
37
|
+
render: args => html `
|
|
38
|
+
<div style="width: 480px">
|
|
39
|
+
<bs-empty-state heading=${args.heading} description=${args.description} intent=${args.intent}>
|
|
40
|
+
${WARNING_ICON}
|
|
41
|
+
<bs-button slot="action" variant="outlined">Try again</bs-button>
|
|
42
|
+
</bs-empty-state>
|
|
43
|
+
</div>
|
|
44
|
+
`,
|
|
45
|
+
};
|
|
46
|
+
export const WithoutAction = {
|
|
47
|
+
render: args => html `
|
|
48
|
+
<div style="width: 480px">
|
|
49
|
+
<bs-empty-state heading=${args.heading} description=${args.description}>${SEARCH_ICON}</bs-empty-state>
|
|
50
|
+
</div>
|
|
51
|
+
`,
|
|
52
|
+
};
|
|
@@ -65,7 +65,7 @@ export class BsErrorPage {
|
|
|
65
65
|
const primary = this.primaryLabel ?? d.primary;
|
|
66
66
|
const secondary = this.secondaryLabel ?? d.secondary;
|
|
67
67
|
const level = Math.min(6, Math.max(1, Math.trunc(Number(this.headingLevel)) || 1));
|
|
68
|
-
return (h("bs-card", { key: '
|
|
68
|
+
return (h("bs-card", { key: '376ab30f0eeaf89fb522373b375d0c68eebe8e99', part: "container", class: "bs-error-page", surface: "base" }, h("div", { key: '380013c4a4ac5208823856bb565f841e4b9aace3', class: "bs-error-page__body" }, h("div", { key: 'ce3ed8170977a0e2c4b1247140734fa3ba4c4896', class: "bs-error-page__art-group" }, h("bs-icon-tile", { key: '625d8cef3b2969f15e6ba5e94913359f54f277dd', part: "art", class: `bs-error-page__art ${d.info ? 'bs-error-page__art--info' : ''}`, intent: d.intent, size: "lg" }, h("slot", { key: 'e4415c41729cc3e9b52f1c61dfb8906a1d8dcc6a', name: "icon" }, d.glyph())), code && (h("span", { key: 'a6d8d24456746f9da3387c2acae20410382d7b62', part: "code", class: "bs-error-page__code" }, code))), h(`h${level}`, { part: 'heading', class: { 'bs-error-page__heading': true } }, heading), description && (h("p", { key: '4cace21798cbd9f40f2eb493938b5c12db43be97', part: "description", class: "bs-error-page__description" }, description)), (primary || secondary) && (h("div", { key: 'aca6cc9c414530bbb657e02c0910bbc4cae35ae6', part: "actions", class: "bs-error-page__actions" }, primary && (h("bs-button", { key: 'e5ec7c649b3b49e42e2f8132372e5b1b25f850bf', part: "primary", variant: "primary", onClick: () => this.bsPrimary.emit() }, primary)), secondary && (h("bs-button", { key: '7414d2d76186402404cf36ad662340f30e4b65aa', part: "secondary", variant: "outlined", onClick: () => this.bsSecondary.emit() }, secondary)))), this.reference && (h("p", { key: 'cf2fff2d7d2a77dd9f5a1fca1464ae0f687e4b5a', part: "reference", class: "bs-error-page__reference" }, this.reference)))));
|
|
69
69
|
}
|
|
70
70
|
static get is() { return "bs-error-page"; }
|
|
71
71
|
static get encapsulation() { return "shadow"; }
|
|
@@ -112,7 +112,7 @@ export class BsFileUpload {
|
|
|
112
112
|
this.handleFiles(files);
|
|
113
113
|
};
|
|
114
114
|
render() {
|
|
115
|
-
return (h("div", { key: '
|
|
115
|
+
return (h("div", { key: '58fece79d4fb5204ba4edadbdac4a26b5ef3186b', 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: '9339e7a61fd8d2d337c442518b0feca4eac56f4e', part: "icon", class: "bs-file-upload__icon" }, h("slot", { key: 'b361ea7dda65426da604485f8d00022520e96643', name: "icon" }, h(UploadIcon, { key: 'fb08c4f2ec4250293ca66ab7a84c0b77599b15b9' }))), h("div", { key: '1ee60fe58d4196a8aaf95d38e7ba1d6aaaf269fb', class: "bs-file-upload__content" }, h("div", { key: '57e91a29e74a9e02831b32e3ab674607a256e68c', class: "bs-file-upload__text" }, this.heading && (h("span", { key: '389ea949446b63bb976071fec70d3e5398d3ebef', part: "heading", class: "bs-file-upload__heading" }, this.heading)), this.description && (h("span", { key: 'f6709820df651e915ee7b0073672820478e3c483', part: "description", id: "description", class: "bs-file-upload__description" }, this.description))), h("bs-button", { key: '29abda9026efccb881b26794ca5441888ef4c02c', part: "browse", variant: "neutral", size: "sm", disabled: this.disabled, onClick: this.onBrowse }, this.buttonLabel)), h("input", { key: '3ea4af2d866795676c74138f5ce6f75f5cb13111', 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
116
|
}
|
|
117
117
|
static get is() { return "bs-file-upload"; }
|
|
118
118
|
static get encapsulation() { return "shadow"; }
|
|
@@ -86,7 +86,7 @@ export class BsFileUploadItem {
|
|
|
86
86
|
}
|
|
87
87
|
render() {
|
|
88
88
|
const removing = this.state === 'success';
|
|
89
|
-
return (h("div", { key: '
|
|
89
|
+
return (h("div", { key: '02ddff16491c33fa61626bca72275ea0a1037c14', part: "item", class: `bs-file-upload-item bs-file-upload-item--${this.state}` }, h("div", { key: 'c465a9216d363ee858933d24abb468d73d66190e', part: "thumbnail", class: "bs-file-upload-item__thumbnail" }, h("slot", { key: '5aeaec4d3e9120163dab89c9bb3ca71e8976cae3', name: "thumbnail" }, this.thumbnailSrc ? (h("img", { class: "bs-file-upload-item__image", src: this.thumbnailSrc, alt: this.thumbnailAlt })) : (h(ImageIcon, null)))), h("div", { key: '3fdf5cb05270ae986e59404758f487932da10fbe', class: "bs-file-upload-item__content" }, h("div", { key: 'eb783412a8f97eaf6d566c06283c0ca0cc735570', class: "bs-file-upload-item__meta" }, h("span", { key: 'a456cfbcbaa19329715d55d80845a6b824bb2d64', part: "name", class: "bs-file-upload-item__name" }, this.fileName), this.fileSize && (h("span", { key: '7810e2855de50d3fa42d7ee29af81e2c58ea1a42', part: "size", class: "bs-file-upload-item__size" }, this.fileSize))), this.renderStatus()), h("bs-icon-button", { key: '7be3bf3d73ec51a2ce3bc23b4e401306c2d6bcc9', part: "action", variant: "subtle", size: "lg", ariaLabel: removing ? this.removeLabel : this.cancelLabel, onClick: this.onAction }, removing ? h(TrashIcon, null) : h(CloseIcon, null))));
|
|
90
90
|
}
|
|
91
91
|
static get is() { return "bs-file-upload-item"; }
|
|
92
92
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
import { render, h, describe, it, expect } from "@stencil/vitest";
|
|
2
|
+
import { userEvent } from "vitest/browser";
|
|
3
|
+
import { assertShadowParts, runAxeCheck } from "../../test/helpers/conventions";
|
|
4
|
+
import { RECENT, JUMP_TO, TOP_MATCHES, SEARCH_IN } from "./bs-global-search.stories";
|
|
5
|
+
const q = (el, s) => el.shadowRoot.querySelector(s);
|
|
6
|
+
const qa = (el, s) => Array.from(el.shadowRoot.querySelectorAll(s));
|
|
7
|
+
const items = (el) => Array.from(el.querySelectorAll('bs-search-item'));
|
|
8
|
+
const activeItems = (el) => items(el).filter(i => i.hasAttribute('active'));
|
|
9
|
+
const settle = (ms = 60) => new Promise(r => setTimeout(r, ms));
|
|
10
|
+
const tokenColor = (token) => {
|
|
11
|
+
const p = document.createElement('div');
|
|
12
|
+
p.style.color = `var(${token})`;
|
|
13
|
+
document.body.appendChild(p);
|
|
14
|
+
const c = getComputedStyle(p).color;
|
|
15
|
+
p.remove();
|
|
16
|
+
return c;
|
|
17
|
+
};
|
|
18
|
+
const make = async (props = {}, opts = {}) => {
|
|
19
|
+
const r = await render(h("div", { style: { width: '700px' } }, h("bs-global-search", null, RECENT.map(i => (h("bs-search-item", { slot: "recent", value: i.value, trailing: i.trailing }, i.label))), JUMP_TO.map(i => (h("bs-search-item", { slot: "jump-to", value: i.value, trailing: i.trailing, disabled: i.value === opts.disabledJump }, i.label))), TOP_MATCHES.map(i => (h("bs-search-item", { slot: "top-matches", value: i.value }, h("strong", null, i.match), i.rest, h("span", { slot: "description" }, i.description)))), SEARCH_IN.map(i => (h("bs-search-item", { slot: "search-in", value: i.value, trailing: i.trailing }, i.label))))));
|
|
20
|
+
const el = r.root.querySelector('bs-global-search');
|
|
21
|
+
Object.assign(el, props);
|
|
22
|
+
await r.waitForChanges();
|
|
23
|
+
const focus = async () => {
|
|
24
|
+
q(el, 'bs-input').focus();
|
|
25
|
+
await r.waitForChanges();
|
|
26
|
+
await settle();
|
|
27
|
+
};
|
|
28
|
+
const press = async (k) => {
|
|
29
|
+
await userEvent.keyboard(k);
|
|
30
|
+
await r.waitForChanges();
|
|
31
|
+
};
|
|
32
|
+
return { ...r, wrap: r.root, el, focus, press };
|
|
33
|
+
};
|
|
34
|
+
const sectionHeaders = (el) => qa(el, '[part="section-header"]').map(h => h.textContent);
|
|
35
|
+
const footerText = (el) => q(el, '[part="footer"]').innerText.replace(/\s+/g, ' ').trim();
|
|
36
|
+
describe('bs-global-search', () => {
|
|
37
|
+
it('is a 480px field with no panel while closed', async () => {
|
|
38
|
+
const { el } = await make();
|
|
39
|
+
expect(Math.round(el.getBoundingClientRect().width)).toBe(480);
|
|
40
|
+
const input = q(el, 'bs-input');
|
|
41
|
+
expect(input.type).toBe('search');
|
|
42
|
+
expect(Math.round(input.getBoundingClientRect().height)).toBe(44);
|
|
43
|
+
expect(q(el, '[part="panel"]')).toBeNull();
|
|
44
|
+
expect(input.placeholder).toBe('Search customers, orders, products…');
|
|
45
|
+
expect(el.hasAttribute('open')).toBe(false);
|
|
46
|
+
assertShadowParts(el.shadowRoot, ['field']);
|
|
47
|
+
});
|
|
48
|
+
it('caps its width at 100% of the container', async () => {
|
|
49
|
+
const r = await render(h("div", { style: { width: '300px' } }, h("bs-global-search", null)));
|
|
50
|
+
const gs = r.root.querySelector('bs-global-search');
|
|
51
|
+
expect(Math.round(gs.getBoundingClientRect().width)).toBe(300);
|
|
52
|
+
});
|
|
53
|
+
it('opens on focus, reflects open and emits bsOpenChange', async () => {
|
|
54
|
+
const { el, focus } = await make();
|
|
55
|
+
const got = [];
|
|
56
|
+
el.addEventListener('bsOpenChange', (e) => got.push(e.detail));
|
|
57
|
+
await focus();
|
|
58
|
+
expect(el.open).toBe(true);
|
|
59
|
+
expect(el.hasAttribute('open')).toBe(true);
|
|
60
|
+
expect(q(el, '[part="panel"]')).not.toBeNull();
|
|
61
|
+
expect(got).toEqual([true]);
|
|
62
|
+
});
|
|
63
|
+
it('has the Figma panel geometry', async () => {
|
|
64
|
+
const { el } = await make({ open: true });
|
|
65
|
+
const panel = q(el, '[part="panel"]');
|
|
66
|
+
const field = q(el, '[part="field"]');
|
|
67
|
+
const cs = getComputedStyle(panel);
|
|
68
|
+
expect(cs.position).toBe('absolute');
|
|
69
|
+
expect(cs.borderRadius).toBe('8px');
|
|
70
|
+
expect(cs.paddingTop).toBe('8px');
|
|
71
|
+
expect(cs.rowGap).toBe('8px');
|
|
72
|
+
expect(cs.flexDirection).toBe('column');
|
|
73
|
+
expect(cs.overflow).toBe('clip');
|
|
74
|
+
expect(cs.zIndex).toBe('100');
|
|
75
|
+
expect(cs.boxShadow).not.toBe('none');
|
|
76
|
+
expect(Math.round(panel.getBoundingClientRect().width)).toBe(480);
|
|
77
|
+
expect(Math.round(panel.getBoundingClientRect().top - field.getBoundingClientRect().bottom)).toBe(8);
|
|
78
|
+
expect(cs.backgroundColor).toBe(tokenColor('--bs-surface-base'));
|
|
79
|
+
});
|
|
80
|
+
it('closes on Escape without clearing the value, on outside pointerdown, and after selecting', async () => {
|
|
81
|
+
const { el, focus, press, waitForChanges } = await make({ value: 'abc' });
|
|
82
|
+
const got = [];
|
|
83
|
+
el.addEventListener('bsOpenChange', (e) => got.push(e.detail));
|
|
84
|
+
await focus();
|
|
85
|
+
expect(el.open).toBe(true);
|
|
86
|
+
await press('{Escape}');
|
|
87
|
+
expect(el.open).toBe(false);
|
|
88
|
+
expect(el.value).toBe('abc');
|
|
89
|
+
expect(q(el, '[part="panel"]')).toBeNull();
|
|
90
|
+
// click on the field re-opens
|
|
91
|
+
await userEvent.click(q(el, 'bs-input'));
|
|
92
|
+
await waitForChanges();
|
|
93
|
+
expect(el.open).toBe(true);
|
|
94
|
+
// outside click
|
|
95
|
+
document.body.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, composed: true }));
|
|
96
|
+
await waitForChanges();
|
|
97
|
+
expect(el.open).toBe(false);
|
|
98
|
+
// pointerdown inside does not close
|
|
99
|
+
el.open = true;
|
|
100
|
+
await waitForChanges();
|
|
101
|
+
q(el, '[part="panel"]').dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, composed: true }));
|
|
102
|
+
await waitForChanges();
|
|
103
|
+
expect(el.open).toBe(true);
|
|
104
|
+
// selecting closes
|
|
105
|
+
items(el)[0].click();
|
|
106
|
+
await waitForChanges();
|
|
107
|
+
expect(el.open).toBe(false);
|
|
108
|
+
expect(got).toEqual([true, false, true, false, false]);
|
|
109
|
+
});
|
|
110
|
+
it('does not open while disabled', async () => {
|
|
111
|
+
const { el, waitForChanges } = await make({ disabled: true });
|
|
112
|
+
q(el, '[part="field"]').click();
|
|
113
|
+
await waitForChanges();
|
|
114
|
+
expect(el.open).toBe(false);
|
|
115
|
+
});
|
|
116
|
+
it('renders sections with headers only for filled slots (default view)', async () => {
|
|
117
|
+
const { el } = await make({ open: true });
|
|
118
|
+
expect(sectionHeaders(el)).toEqual(['Recent searches', 'Jump to']);
|
|
119
|
+
const h = q(el, '[part="section-header"]');
|
|
120
|
+
const cs = getComputedStyle(h);
|
|
121
|
+
expect(cs.paddingTop).toBe('12px');
|
|
122
|
+
expect(cs.paddingBottom).toBe('8px');
|
|
123
|
+
expect(cs.paddingLeft).toBe('12px');
|
|
124
|
+
expect(cs.borderBottomWidth).toBe('1px');
|
|
125
|
+
expect(cs.borderBottomColor).toBe(tokenColor('--bs-border-neutral-container'));
|
|
126
|
+
expect(cs.fontSize).toBe('14px');
|
|
127
|
+
expect(cs.lineHeight).toBe('20px');
|
|
128
|
+
expect(cs.fontWeight).toBe('500');
|
|
129
|
+
expect(cs.color).toBe(tokenColor('--bs-text-muted'));
|
|
130
|
+
const sections = qa(el, '[part="section"]');
|
|
131
|
+
expect(sections.length).toBe(2);
|
|
132
|
+
expect(Math.round(sections[1].getBoundingClientRect().top - sections[0].getBoundingClientRect().bottom)).toBe(8);
|
|
133
|
+
});
|
|
134
|
+
it('omits sections whose slot is empty and uses custom header labels', async () => {
|
|
135
|
+
const r = await render(h("bs-global-search", { open: true, jumpToLabel: "Go to" }, h("bs-search-item", { slot: "jump-to", value: "a" }, "A")));
|
|
136
|
+
const el = r.root;
|
|
137
|
+
expect(sectionHeaders(el)).toEqual(['Go to']);
|
|
138
|
+
const added = document.createElement('bs-search-item');
|
|
139
|
+
added.slot = 'recent';
|
|
140
|
+
added.textContent = 'x';
|
|
141
|
+
el.appendChild(added);
|
|
142
|
+
await settle();
|
|
143
|
+
await r.waitForChanges();
|
|
144
|
+
expect(sectionHeaders(el)).toEqual(['Recent searches', 'Go to']);
|
|
145
|
+
added.remove();
|
|
146
|
+
await settle();
|
|
147
|
+
await r.waitForChanges();
|
|
148
|
+
expect(sectionHeaders(el)).toEqual(['Go to']);
|
|
149
|
+
});
|
|
150
|
+
it('shows top matches and search in for the results view', async () => {
|
|
151
|
+
const { el } = await make({ open: true, status: 'results', totalResults: 196 });
|
|
152
|
+
expect(el.getAttribute('status')).toBe('results');
|
|
153
|
+
expect(sectionHeaders(el)).toEqual(['Top matches', 'Search in']);
|
|
154
|
+
});
|
|
155
|
+
it('shows the default footer with hints and a Clear recent button', async () => {
|
|
156
|
+
const { el } = await make({ open: true });
|
|
157
|
+
const footer = q(el, '[part="footer"]');
|
|
158
|
+
const cs = getComputedStyle(footer);
|
|
159
|
+
expect(cs.borderTopWidth).toBe('1px');
|
|
160
|
+
expect(cs.borderTopColor).toBe(tokenColor('--bs-border-default'));
|
|
161
|
+
expect(cs.paddingTop).toBe('8px');
|
|
162
|
+
expect(cs.paddingBottom).toBe('4px');
|
|
163
|
+
expect(cs.columnGap).toBe('16px');
|
|
164
|
+
// the keycaps are bs-key shadow content, so innerText holds only the hint labels
|
|
165
|
+
expect(footerText(el)).toBe('Navigate Search Close Clear recent');
|
|
166
|
+
expect(qa(el, '[part="hint"] bs-key').map(k => k.label)).toEqual([undefined, undefined, undefined, 'Esc']);
|
|
167
|
+
expect(qa(el, '[part="hint"]').length).toBe(3);
|
|
168
|
+
expect(qa(el, '[part="hint"] bs-key').length).toBe(4);
|
|
169
|
+
expect(getComputedStyle(q(el, '[part="hint"]')).columnGap).toBe('4px');
|
|
170
|
+
expect(getComputedStyle(q(el, '[part="hint"]')).color).toBe(tokenColor('--bs-text-secondary'));
|
|
171
|
+
// the Clear recent button is pushed right and has a 44px target
|
|
172
|
+
const action = q(el, '[part="clear-recent"]');
|
|
173
|
+
expect(Math.round(action.getBoundingClientRect().height)).toBe(44);
|
|
174
|
+
expect(Math.round(footer.getBoundingClientRect().right - 8 - action.getBoundingClientRect().right)).toBeLessThanOrEqual(1);
|
|
175
|
+
expect(Math.round(action.querySelector('bs-button').getBoundingClientRect().height)).toBe(32);
|
|
176
|
+
});
|
|
177
|
+
it('hides Clear recent when the recent slot is empty, and the footer via showFooter', async () => {
|
|
178
|
+
const r = await render(h("bs-global-search", { open: true }, h("bs-search-item", { slot: "jump-to", value: "a" }, "A")));
|
|
179
|
+
const el = r.root;
|
|
180
|
+
expect(q(el, '[part="clear-recent"]')).toBeNull();
|
|
181
|
+
expect(q(el, '[part="footer"]')).not.toBeNull();
|
|
182
|
+
el.showFooter = false;
|
|
183
|
+
await r.waitForChanges();
|
|
184
|
+
expect(q(el, '[part="footer"]')).toBeNull();
|
|
185
|
+
});
|
|
186
|
+
it('emits bsClearRecent from the button and from its 44px wrapper', async () => {
|
|
187
|
+
const { el, waitForChanges } = await make({ open: true });
|
|
188
|
+
let n = 0;
|
|
189
|
+
el.addEventListener('bsClearRecent', () => n++);
|
|
190
|
+
q(el, '[part="clear-recent"] bs-button').click();
|
|
191
|
+
q(el, '[part="clear-recent"]').click();
|
|
192
|
+
await waitForChanges();
|
|
193
|
+
expect(n).toBe(2);
|
|
194
|
+
expect(el.open).toBe(true);
|
|
195
|
+
});
|
|
196
|
+
it('shows the results footer with See all (count) on the left and a Full results hint on the right', async () => {
|
|
197
|
+
const { el, waitForChanges } = await make({ open: true, status: 'results', totalResults: 196 });
|
|
198
|
+
expect(footerText(el)).toBe('See all 196 results Full results');
|
|
199
|
+
expect(qa(el, '[part="hint"]').length).toBe(1);
|
|
200
|
+
const see = q(el, '[part="see-all"]');
|
|
201
|
+
const hint = q(el, '[part="hint"]');
|
|
202
|
+
expect(see.getBoundingClientRect().left).toBeLessThan(hint.getBoundingClientRect().left);
|
|
203
|
+
let n = 0;
|
|
204
|
+
el.addEventListener('bsSeeAll', () => n++);
|
|
205
|
+
see.querySelector('bs-button').click();
|
|
206
|
+
await waitForChanges();
|
|
207
|
+
expect(n).toBe(1);
|
|
208
|
+
expect(el.open).toBe(false);
|
|
209
|
+
el.open = true;
|
|
210
|
+
el.totalResults = undefined;
|
|
211
|
+
await waitForChanges();
|
|
212
|
+
expect(footerText(el)).toContain('See all results');
|
|
213
|
+
});
|
|
214
|
+
it('localises hints and labels through props', async () => {
|
|
215
|
+
const { el, waitForChanges } = await make({ open: true, navigateLabel: 'Naviger', clearRecentLabel: 'Ryd' });
|
|
216
|
+
expect(footerText(el)).toContain('Naviger');
|
|
217
|
+
expect(footerText(el)).toContain('Ryd');
|
|
218
|
+
Object.assign(el, { status: 'results', seeAllLabel: 'Vis alle', fullResultsLabel: 'Fuld' });
|
|
219
|
+
await waitForChanges();
|
|
220
|
+
expect(footerText(el)).toBe('Vis alle Fuld');
|
|
221
|
+
});
|
|
222
|
+
it('shows the built-in empty state with a Clear search action that clears the value', async () => {
|
|
223
|
+
const { el, waitForChanges } = await make({ open: true, status: 'empty', value: 'zzz', emptyHeading: 'No events match these filters', emptyDescription: 'Try a wider date range or clear filters.' });
|
|
224
|
+
const es = q(el, '[part="empty"]');
|
|
225
|
+
expect(es.tagName).toBe('BS-EMPTY-STATE');
|
|
226
|
+
expect(es.getAttribute('intent')).toBe('default');
|
|
227
|
+
expect(es.shadowRoot.querySelector('[part="heading"]').textContent).toBe('No events match these filters');
|
|
228
|
+
expect(es.shadowRoot.querySelector('[part="description"]').textContent).toBe('Try a wider date range or clear filters.');
|
|
229
|
+
expect(q(el, '[part="footer"]')).toBeNull();
|
|
230
|
+
expect(qa(el, '[part="section"]').length).toBe(0);
|
|
231
|
+
let n = 0;
|
|
232
|
+
el.addEventListener('bsClearSearch', () => n++);
|
|
233
|
+
es.querySelector('bs-button').click();
|
|
234
|
+
await waitForChanges();
|
|
235
|
+
expect(n).toBe(1);
|
|
236
|
+
expect(el.value).toBe('');
|
|
237
|
+
expect(es.querySelector('bs-button').textContent).toBe('Clear search');
|
|
238
|
+
});
|
|
239
|
+
it('uses the default empty copy', async () => {
|
|
240
|
+
const { el } = await make({ open: true, status: 'empty' });
|
|
241
|
+
const es = q(el, '[part="empty"]');
|
|
242
|
+
expect(es.shadowRoot.querySelector('[part="heading"]').textContent).toBe('No results');
|
|
243
|
+
expect(es.shadowRoot.querySelector('[part="description"]').textContent).toBe('Try a different search.');
|
|
244
|
+
});
|
|
245
|
+
it('shows the built-in error state with a Try again action that keeps the query', async () => {
|
|
246
|
+
const { el, waitForChanges } = await make({ open: true, status: 'error', value: 'nordic' });
|
|
247
|
+
const es = q(el, '[part="empty"]');
|
|
248
|
+
expect(es.getAttribute('intent')).toBe('error');
|
|
249
|
+
expect(es.shadowRoot.querySelector('[part="heading"]').textContent).toBe('Search isn’t available right now');
|
|
250
|
+
expect(es.shadowRoot.querySelector('[part="description"]').textContent).toContain('Your query is kept');
|
|
251
|
+
expect(q(el, '[part="footer"]')).toBeNull();
|
|
252
|
+
let n = 0;
|
|
253
|
+
el.addEventListener('bsRetry', () => n++);
|
|
254
|
+
es.querySelector('bs-button').click();
|
|
255
|
+
await waitForChanges();
|
|
256
|
+
expect(n).toBe(1);
|
|
257
|
+
expect(el.value).toBe('nordic');
|
|
258
|
+
expect(el.open).toBe(true);
|
|
259
|
+
});
|
|
260
|
+
it('lets the empty and error slots replace the built-in block', async () => {
|
|
261
|
+
const r = await render(h("bs-global-search", { open: true, status: "empty" }, h("p", { slot: "empty", id: "custom" }, "Nothing here")));
|
|
262
|
+
const el = r.root;
|
|
263
|
+
const slot = q(el, 'slot[name="empty"]');
|
|
264
|
+
expect(slot.assignedElements()[0].id).toBe('custom');
|
|
265
|
+
});
|
|
266
|
+
it('puts the combobox ARIA on the field and the listbox on the items container', async () => {
|
|
267
|
+
const { el, focus, press } = await make();
|
|
268
|
+
const field = q(el, '[part="field"]');
|
|
269
|
+
expect(field).toEqualAttribute('role', 'combobox');
|
|
270
|
+
expect(field).toEqualAttribute('aria-expanded', 'false');
|
|
271
|
+
expect(field).toEqualAttribute('aria-haspopup', 'listbox');
|
|
272
|
+
expect(field.hasAttribute('aria-controls')).toBe(false);
|
|
273
|
+
expect(field).toEqualAttribute('aria-label', 'Search customers, orders, products…');
|
|
274
|
+
await focus();
|
|
275
|
+
expect(field).toEqualAttribute('aria-expanded', 'true');
|
|
276
|
+
const list = q(el, '[role="listbox"]');
|
|
277
|
+
expect(list).toEqualAttribute('aria-label', 'Search suggestions');
|
|
278
|
+
expect(field).toEqualAttribute('aria-controls', list.id);
|
|
279
|
+
expect(field.hasAttribute('aria-activedescendant')).toBe(false);
|
|
280
|
+
await press('{ArrowDown}');
|
|
281
|
+
expect(field).toEqualAttribute('aria-activedescendant', items(el)[0].id);
|
|
282
|
+
expect(items(el)[0].id).not.toBe('');
|
|
283
|
+
});
|
|
284
|
+
it('uses the label prop as the accessible name', async () => {
|
|
285
|
+
const { el } = await make({ label: 'Global search' });
|
|
286
|
+
expect(q(el, '[part="field"]')).toEqualAttribute('aria-label', 'Global search');
|
|
287
|
+
});
|
|
288
|
+
it('gives items the option role and unique ids', async () => {
|
|
289
|
+
const { el } = await make({ open: true });
|
|
290
|
+
const all = items(el);
|
|
291
|
+
for (const i of all)
|
|
292
|
+
expect(i.shadowRoot.querySelector('[part="container"]')).toEqualAttribute('role', 'option');
|
|
293
|
+
expect(new Set(all.map(i => i.id)).size).toBe(all.length);
|
|
294
|
+
});
|
|
295
|
+
it('sets up items added after load', async () => {
|
|
296
|
+
const { el, waitForChanges } = await make({ open: true });
|
|
297
|
+
const added = document.createElement('bs-search-item');
|
|
298
|
+
added.slot = 'recent';
|
|
299
|
+
added.textContent = 'late';
|
|
300
|
+
el.appendChild(added);
|
|
301
|
+
await settle();
|
|
302
|
+
await waitForChanges();
|
|
303
|
+
expect(added.id).not.toBe('');
|
|
304
|
+
expect(added.selectionRole).toBe('option');
|
|
305
|
+
});
|
|
306
|
+
it('moves the highlight with ArrowDown/ArrowUp across sections, wrapping at both ends', async () => {
|
|
307
|
+
const { el, focus, press } = await make();
|
|
308
|
+
await focus();
|
|
309
|
+
const first = items(el).filter(i => ['recent', 'jump-to'].includes(i.slot));
|
|
310
|
+
expect(first.length).toBe(7);
|
|
311
|
+
await press('{ArrowDown}');
|
|
312
|
+
expect(activeItems(el)).toEqual([first[0]]);
|
|
313
|
+
await press('{ArrowDown}');
|
|
314
|
+
await press('{ArrowDown}');
|
|
315
|
+
await press('{ArrowDown}');
|
|
316
|
+
// 4th press crosses from the last recent item into the first jump-to item
|
|
317
|
+
expect(activeItems(el)).toEqual([first[3]]);
|
|
318
|
+
expect(first[3].slot).toBe('jump-to');
|
|
319
|
+
for (let i = 0; i < 3; i++)
|
|
320
|
+
await press('{ArrowDown}');
|
|
321
|
+
expect(activeItems(el)).toEqual([first[6]]);
|
|
322
|
+
await press('{ArrowDown}');
|
|
323
|
+
expect(activeItems(el)).toEqual([first[0]]);
|
|
324
|
+
await press('{ArrowUp}');
|
|
325
|
+
expect(activeItems(el)).toEqual([first[6]]);
|
|
326
|
+
expect(q(el, '[part="field"]')).toEqualAttribute('aria-activedescendant', first[6].id);
|
|
327
|
+
});
|
|
328
|
+
it('starts from the last item on ArrowUp and skips disabled items', async () => {
|
|
329
|
+
const { el, focus, press } = await make({}, { disabledJump: 'orders' });
|
|
330
|
+
await focus();
|
|
331
|
+
await press('{ArrowUp}');
|
|
332
|
+
const all = items(el).filter(i => ['recent', 'jump-to'].includes(i.slot));
|
|
333
|
+
expect(activeItems(el)).toEqual([all[6]]);
|
|
334
|
+
await press('{ArrowUp}');
|
|
335
|
+
// skips the disabled Orders row
|
|
336
|
+
expect(activeItems(el)).toEqual([all[4]]);
|
|
337
|
+
expect(all[5].disabled).toBe(true);
|
|
338
|
+
});
|
|
339
|
+
it('opens on ArrowDown when closed, without moving the highlight', async () => {
|
|
340
|
+
const { el, focus, press } = await make();
|
|
341
|
+
await focus();
|
|
342
|
+
await press('{Escape}');
|
|
343
|
+
expect(el.open).toBe(false);
|
|
344
|
+
await press('{ArrowDown}');
|
|
345
|
+
expect(el.open).toBe(true);
|
|
346
|
+
expect(activeItems(el).length).toBe(0);
|
|
347
|
+
});
|
|
348
|
+
it('navigates only the visible sections of the current status', async () => {
|
|
349
|
+
const { el, focus, press } = await make({ status: 'results' });
|
|
350
|
+
await focus();
|
|
351
|
+
await press('{ArrowDown}');
|
|
352
|
+
const top = items(el).filter(i => i.slot === 'top-matches');
|
|
353
|
+
expect(activeItems(el)).toEqual([top[0]]);
|
|
354
|
+
await press('{ArrowUp}');
|
|
355
|
+
await press('{ArrowUp}');
|
|
356
|
+
expect(activeItems(el)[0].slot).toBe('search-in');
|
|
357
|
+
});
|
|
358
|
+
it('keeps Home and End native in the field', async () => {
|
|
359
|
+
const { el, focus, press } = await make({ value: 'abc' });
|
|
360
|
+
await focus();
|
|
361
|
+
await press('{Home}');
|
|
362
|
+
await press('{End}');
|
|
363
|
+
expect(activeItems(el).length).toBe(0);
|
|
364
|
+
expect(el.open).toBe(true);
|
|
365
|
+
});
|
|
366
|
+
it('sets the active item on hover', async () => {
|
|
367
|
+
const { el, waitForChanges } = await make({ open: true });
|
|
368
|
+
const target = items(el)[2];
|
|
369
|
+
target.dispatchEvent(new MouseEvent('mouseover', { bubbles: true, composed: true }));
|
|
370
|
+
await waitForChanges();
|
|
371
|
+
expect(activeItems(el)).toEqual([target]);
|
|
372
|
+
expect(q(el, '[part="field"]')).toEqualAttribute('aria-activedescendant', target.id);
|
|
373
|
+
});
|
|
374
|
+
it('does not highlight disabled items on hover', async () => {
|
|
375
|
+
const { el, waitForChanges } = await make({ open: true }, { disabledJump: 'customers' });
|
|
376
|
+
const dis = items(el).find(i => i.disabled);
|
|
377
|
+
dis.dispatchEvent(new MouseEvent('mouseover', { bubbles: true, composed: true }));
|
|
378
|
+
await waitForChanges();
|
|
379
|
+
expect(activeItems(el).length).toBe(0);
|
|
380
|
+
});
|
|
381
|
+
it('Enter selects the active item with value and section, and closes', async () => {
|
|
382
|
+
const { el, focus, press } = await make();
|
|
383
|
+
const got = [];
|
|
384
|
+
el.addEventListener('bsSelect', (e) => got.push(e.detail));
|
|
385
|
+
let searches = 0;
|
|
386
|
+
el.addEventListener('bsSearch', () => searches++);
|
|
387
|
+
await focus();
|
|
388
|
+
for (let i = 0; i < 5; i++)
|
|
389
|
+
await press('{ArrowDown}');
|
|
390
|
+
await press('{Enter}');
|
|
391
|
+
expect(got).toEqual([{ value: 'products', section: 'jump-to' }]);
|
|
392
|
+
expect(searches).toBe(0);
|
|
393
|
+
expect(el.open).toBe(false);
|
|
394
|
+
});
|
|
395
|
+
it('Enter without an active item emits bsSearch with the query and closes', async () => {
|
|
396
|
+
const { el, focus, press } = await make({ value: 'nordic' });
|
|
397
|
+
const got = [];
|
|
398
|
+
el.addEventListener('bsSearch', (e) => got.push(e.detail));
|
|
399
|
+
let selects = 0;
|
|
400
|
+
el.addEventListener('bsSelect', () => selects++);
|
|
401
|
+
await focus();
|
|
402
|
+
await press('{Enter}');
|
|
403
|
+
expect(got).toEqual(['nordic']);
|
|
404
|
+
expect(selects).toBe(0);
|
|
405
|
+
expect(el.open).toBe(false);
|
|
406
|
+
});
|
|
407
|
+
it('clicking an item emits bsSelect once (not the inner bsItemSelect)', async () => {
|
|
408
|
+
const { el, wrap, waitForChanges } = await make({ open: true, status: 'results' });
|
|
409
|
+
const sel = [];
|
|
410
|
+
let raw = 0;
|
|
411
|
+
wrap.addEventListener('bsSelect', (e) => sel.push(e.detail));
|
|
412
|
+
wrap.addEventListener('bsItemSelect', () => raw++);
|
|
413
|
+
items(el).find(i => i.slot === 'search-in').click();
|
|
414
|
+
await waitForChanges();
|
|
415
|
+
expect(sel).toEqual([{ value: 'in-customers', section: 'search-in' }]);
|
|
416
|
+
expect(raw).toBe(0);
|
|
417
|
+
});
|
|
418
|
+
it('emits one bsInput per keystroke, updates value, opens, and clears the highlight', async () => {
|
|
419
|
+
const { el, focus, press } = await make();
|
|
420
|
+
const got = [];
|
|
421
|
+
el.addEventListener('bsInput', (e) => got.push(e.detail));
|
|
422
|
+
await focus();
|
|
423
|
+
await press('{ArrowDown}');
|
|
424
|
+
expect(activeItems(el).length).toBe(1);
|
|
425
|
+
await userEvent.keyboard('no');
|
|
426
|
+
await settle();
|
|
427
|
+
expect(got).toEqual(['n', 'no']);
|
|
428
|
+
expect(el.value).toBe('no');
|
|
429
|
+
expect(activeItems(el).length).toBe(0);
|
|
430
|
+
await press('{Escape}');
|
|
431
|
+
await userEvent.keyboard('r');
|
|
432
|
+
await settle();
|
|
433
|
+
expect(el.open).toBe(true);
|
|
434
|
+
});
|
|
435
|
+
it('passes the value to the field', async () => {
|
|
436
|
+
const { el } = await make({ value: 'nordic' });
|
|
437
|
+
expect(q(el, 'bs-input').value).toBe('nordic');
|
|
438
|
+
});
|
|
439
|
+
it('announces the result count, empty and error headings politely', async () => {
|
|
440
|
+
const { el, waitForChanges } = await make({ open: true, status: 'results', totalResults: 196 });
|
|
441
|
+
const live = q(el, '[aria-live="polite"]');
|
|
442
|
+
expect(live.textContent).toBe('196 results');
|
|
443
|
+
el.totalResults = undefined;
|
|
444
|
+
await waitForChanges();
|
|
445
|
+
expect(live.textContent).toBe('');
|
|
446
|
+
el.status = 'empty';
|
|
447
|
+
await waitForChanges();
|
|
448
|
+
expect(live.textContent).toBe('No results');
|
|
449
|
+
el.status = 'error';
|
|
450
|
+
await waitForChanges();
|
|
451
|
+
expect(live.textContent).toBe('Search isn’t available right now');
|
|
452
|
+
expect(Math.round(live.getBoundingClientRect().width)).toBeLessThanOrEqual(1);
|
|
453
|
+
});
|
|
454
|
+
it('uses the light and dark panel colour from tokens', async () => {
|
|
455
|
+
const { el } = await make({ open: true });
|
|
456
|
+
const light = getComputedStyle(q(el, '[part="section-header"]')).color;
|
|
457
|
+
const lightBg = getComputedStyle(q(el, '[part="panel"]')).backgroundColor;
|
|
458
|
+
document.documentElement.setAttribute('data-theme', 'dark');
|
|
459
|
+
try {
|
|
460
|
+
await settle(150);
|
|
461
|
+
expect(getComputedStyle(q(el, '[part="section-header"]')).color).not.toBe(light);
|
|
462
|
+
expect(getComputedStyle(q(el, '[part="panel"]')).backgroundColor).not.toBe(lightBg);
|
|
463
|
+
}
|
|
464
|
+
finally {
|
|
465
|
+
document.documentElement.removeAttribute('data-theme');
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
for (const status of ['default', 'results', 'empty', 'error']) {
|
|
469
|
+
it(`passes axe with the panel open (${status})`, async () => {
|
|
470
|
+
const { el } = await make({ open: true, status, totalResults: 196 });
|
|
471
|
+
await runAxeCheck(el);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
it('uses the Figma level-3 shadow (0 4px 8px) and strengthens it from 10% to 30% black in dark mode', async () => {
|
|
475
|
+
const shadowOf = async (dark) => {
|
|
476
|
+
if (dark)
|
|
477
|
+
document.documentElement.setAttribute('data-theme', 'dark');
|
|
478
|
+
try {
|
|
479
|
+
const { root, waitForChanges } = await render(h("bs-global-search", { open: true }));
|
|
480
|
+
await waitForChanges();
|
|
481
|
+
const panel = root.shadowRoot.querySelector('[part="panel"]');
|
|
482
|
+
return getComputedStyle(panel).boxShadow;
|
|
483
|
+
}
|
|
484
|
+
finally {
|
|
485
|
+
document.documentElement.removeAttribute('data-theme');
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
expect(await shadowOf(false)).toBe('rgba(0, 0, 0, 0.1) 0px 4px 8px 0px');
|
|
489
|
+
expect(await shadowOf(true)).toBe('rgba(0, 0, 0, 0.3) 0px 4px 8px 0px');
|
|
490
|
+
});
|
|
491
|
+
});
|