bitboss-ui 2.1.135 → 3.0.0-alpha.4
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/LICENSE +21 -0
- package/README.md +274 -24
- package/bin/bitboss-ui-mcp.mjs +662 -0
- package/bin/bitboss-ui.mjs +710 -0
- package/bin/bitboss-ui.node.test.mjs +113 -0
- package/dist/ai/BbAccordion.md +528 -113
- package/dist/ai/BbAlert.md +380 -197
- package/dist/ai/BbAsterisk.md +46 -0
- package/dist/ai/BbAvatar.md +458 -178
- package/dist/ai/BbBadge.md +697 -225
- package/dist/ai/BbBadgeButton.md +54 -0
- package/dist/ai/BbBaseButton.md +491 -0
- package/dist/ai/BbBaseCheckbox.md +49 -0
- package/dist/ai/BbBaseCheckboxGroup.md +64 -0
- package/dist/ai/BbBaseCheckboxIcon.md +176 -0
- package/dist/ai/BbBaseColorInput.md +64 -0
- package/dist/ai/BbBaseColorPalette.md +39 -0
- package/dist/ai/BbBaseDatePicker.md +42 -0
- package/dist/ai/BbBaseDatePickerInput.md +73 -0
- package/dist/ai/BbBaseInputContainer.md +48 -0
- package/dist/ai/BbBaseNumberInput.md +71 -0
- package/dist/ai/BbBaseRadio.md +46 -0
- package/dist/ai/BbBaseRadioGroup.md +64 -0
- package/dist/ai/BbBaseRadioIcon.md +191 -0
- package/dist/ai/BbBaseRating.md +51 -0
- package/dist/ai/BbBaseSelect.md +88 -0
- package/dist/ai/BbBaseSlider.md +56 -0
- package/dist/ai/BbBaseSwitch.md +49 -0
- package/dist/ai/BbBaseSwitchGroup.md +64 -0
- package/dist/ai/BbBaseSwitchIcon.md +186 -0
- package/dist/ai/BbBaseTag.md +68 -0
- package/dist/ai/BbBaseTextInput.md +75 -0
- package/dist/ai/BbBaseTextarea.md +62 -0
- package/dist/ai/BbBaseTimePickerInput.md +62 -0
- package/dist/ai/BbBreadcrumbs.md +553 -503
- package/dist/ai/BbButton.md +841 -636
- package/dist/ai/BbCheckbox.md +585 -254
- package/dist/ai/BbCheckboxGroup.md +573 -361
- package/dist/ai/BbCollapsible.md +425 -103
- package/dist/ai/BbColorInput.md +536 -323
- package/dist/ai/BbColorPalette.md +569 -330
- package/dist/ai/BbConfirm.md +659 -136
- package/dist/ai/BbConfirmPortal.md +28 -0
- package/dist/ai/BbDatePicker.md +244 -0
- package/dist/ai/BbDatePickerInput.md +720 -388
- package/dist/ai/BbDialog.md +778 -99
- package/dist/ai/BbDropdown.md +1072 -763
- package/dist/ai/BbDropdownButton.md +525 -614
- package/dist/ai/BbDropdownGroup.md +34 -0
- package/dist/ai/BbDropzone.md +1206 -436
- package/dist/ai/BbForm.md +239 -0
- package/dist/ai/BbIcon.md +382 -212
- package/dist/ai/BbIndicator.md +283 -0
- package/dist/ai/BbNumberInput.md +717 -355
- package/dist/ai/BbOffCanvas.md +897 -498
- package/dist/ai/BbPagination.md +489 -535
- package/dist/ai/BbPopover.md +591 -546
- package/dist/ai/BbProgress.md +462 -69
- package/dist/ai/BbRadio.md +352 -229
- package/dist/ai/BbRadioGroup.md +437 -353
- package/dist/ai/BbRating.md +372 -225
- package/dist/ai/BbSelect.md +1399 -536
- package/dist/ai/BbSelectPopover.md +1255 -1578
- package/dist/ai/BbSlider.md +500 -256
- package/dist/ai/BbSmoothHeight.md +485 -139
- package/dist/ai/BbSpinner.md +718 -131
- package/dist/ai/BbSwitch.md +573 -119
- package/dist/ai/BbSwitchGroup.md +521 -214
- package/dist/ai/BbTable.md +1996 -2365
- package/dist/ai/BbTabs.md +1147 -0
- package/dist/ai/BbTabsList.md +29 -0
- package/dist/ai/BbTabsPanes.md +27 -0
- package/dist/ai/BbTabsRoot.md +57 -0
- package/dist/ai/BbTag.md +416 -292
- package/dist/ai/BbTextInput.md +878 -333
- package/dist/ai/BbTextarea.md +850 -255
- package/dist/ai/BbTimePicker.md +231 -0
- package/dist/ai/BbTimePickerInput.md +200 -0
- package/dist/ai/BbToast.md +669 -196
- package/dist/ai/BbToastPortal.md +28 -0
- package/dist/ai/BbTooltip.md +453 -346
- package/dist/ai/BbTree.md +993 -234
- package/dist/ai/ChipsBox.md +27 -199
- package/dist/ai/ClearableButton.md +21 -55
- package/dist/ai/CommaBox.md +25 -200
- package/dist/ai/CommonInputWrapper.md +42 -0
- package/dist/ai/CommonPopover.md +30 -510
- package/dist/ai/ErrorIcon.md +19 -56
- package/dist/ai/FlatListBox.md +35 -379
- package/dist/ai/GroupedListBox.md +37 -535
- package/dist/ai/GuidesComponent.md +21 -0
- package/dist/ai/ListBox.md +38 -231
- package/dist/ai/OptionsContainer.md +34 -253
- package/dist/ai/WarningIcon.md +21 -0
- package/dist/ai/components.json +15897 -0
- package/dist/ai/composables/useBbConfig.md +80 -0
- package/dist/ai/composables/useBbFormContext.md +110 -0
- package/dist/ai/composables/useBbTableContext.md +167 -0
- package/dist/ai/composables/useBbTabsContext.md +118 -0
- package/dist/ai/composables/useBroadcastChannelInstance.md +97 -0
- package/dist/ai/composables/useConfirm.md +313 -0
- package/dist/ai/composables/useCountdown.md +86 -0
- package/dist/ai/composables/useId.md +60 -0
- package/dist/ai/composables/useMobile.md +85 -0
- package/dist/ai/composables/useToast.md +238 -0
- package/dist/ai/guides/agent-contract.md +165 -0
- package/dist/ai/guides/ai-router.md +113 -0
- package/dist/ai/guides/app-layout.md +318 -0
- package/dist/ai/guides/coherence-playbook.md +136 -0
- package/dist/ai/guides/component-picker.md +236 -0
- package/dist/ai/guides/design-language.md +478 -0
- package/dist/ai/guides/design-tokens.md +450 -0
- package/dist/ai/guides/fetch-items-playbook.md +161 -0
- package/dist/ai/guides/floating-bottom-panel.md +130 -0
- package/dist/ai/guides/icons-policy.md +257 -0
- package/dist/ai/guides/inertia-helpers.md +1443 -0
- package/dist/ai/guides/inline-edit-playbook.md +267 -0
- package/dist/ai/guides/installation-and-plugin-setup.md +440 -0
- package/dist/ai/guides/migration/components/bb-alert.md +37 -0
- package/dist/ai/guides/migration/components/bb-avatar.md +24 -0
- package/dist/ai/guides/migration/components/bb-badge.md +110 -0
- package/dist/ai/guides/migration/components/bb-breadcrumbs.md +26 -0
- package/dist/ai/guides/migration/components/bb-button.md +55 -0
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +54 -0
- package/dist/ai/guides/migration/components/bb-checkbox.md +45 -0
- package/dist/ai/guides/migration/components/bb-chip.md +35 -0
- package/dist/ai/guides/migration/components/bb-collapsible.md +26 -0
- package/dist/ai/guides/migration/components/bb-color-input.md +23 -0
- package/dist/ai/guides/migration/components/bb-color-palette.md +31 -0
- package/dist/ai/guides/migration/components/bb-date-picker-input.md +84 -0
- package/dist/ai/guides/migration/components/bb-dialog.md +46 -0
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +31 -0
- package/dist/ai/guides/migration/components/bb-dropdown.md +36 -0
- package/dist/ai/guides/migration/components/bb-dropzone.md +27 -0
- package/dist/ai/guides/migration/components/bb-icon.md +27 -0
- package/dist/ai/guides/migration/components/bb-offcanvas.md +63 -0
- package/dist/ai/guides/migration/components/bb-pagination.md +24 -0
- package/dist/ai/guides/migration/components/bb-popover.md +52 -0
- package/dist/ai/guides/migration/components/bb-rating.md +24 -0
- package/dist/ai/guides/migration/components/bb-select-popover.md +59 -0
- package/dist/ai/guides/migration/components/bb-select.md +69 -0
- package/dist/ai/guides/migration/components/bb-slider.md +25 -0
- package/dist/ai/guides/migration/components/bb-smooth-height.md +45 -0
- package/dist/ai/guides/migration/components/bb-spinner.md +23 -0
- package/dist/ai/guides/migration/components/bb-table.md +66 -0
- package/dist/ai/guides/migration/components/bb-tabs.md +47 -0
- package/dist/ai/guides/migration/components/bb-tag.md +29 -0
- package/dist/ai/guides/migration/components/bb-text-input.md +37 -0
- package/dist/ai/guides/migration/components/bb-toast.md +47 -0
- package/dist/ai/guides/migration/components/bb-tooltip.md +34 -0
- package/dist/ai/guides/migration/components/bb-tree.md +77 -0
- package/dist/ai/guides/migration/components/use-confirm.md +46 -0
- package/dist/ai/guides/migration/v2-to-v3.md +649 -0
- package/dist/ai/guides/options-items-playbook.md +222 -0
- package/dist/ai/guides/page-shell.md +113 -0
- package/dist/ai/guides/validated-forms.md +177 -0
- package/dist/ai/index.md +158 -32
- package/dist/ai/recipes/inertia/approvals-inbox.md +1635 -0
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1765 -0
- package/dist/ai/recipes/inertia/layout-scaffold.md +385 -0
- package/dist/ai/recipes/inertia/onboarding.md +1791 -0
- package/dist/ai/recipes/inertia/ownership-atlas.md +1327 -0
- package/dist/ai/recipes/inertia/record-form.md +1489 -0
- package/dist/ai/recipes/inertia/records-workspace.md +1416 -0
- package/dist/ai/recipes/inertia/upload-center.md +2003 -0
- package/dist/ai/recipes/inertia/wizard-form.md +1500 -0
- package/dist/ai/recipes/nuxt/approvals-inbox.md +1578 -0
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1703 -0
- package/dist/ai/recipes/nuxt/layout-scaffold.md +385 -0
- package/dist/ai/recipes/nuxt/onboarding.md +1724 -0
- package/dist/ai/recipes/nuxt/record-form.md +1502 -0
- package/dist/ai/recipes/nuxt/records-workspace.md +1329 -0
- package/dist/ai/recipes/nuxt/upload-center.md +1886 -0
- package/dist/ai/recipes/nuxt/wizard-form.md +1509 -0
- package/dist/ai/recipes/vue/approvals-inbox.md +1496 -0
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1594 -0
- package/dist/ai/recipes/vue/layout-scaffold.md +385 -0
- package/dist/ai/recipes/vue/onboarding.md +1679 -0
- package/dist/ai/recipes/vue/record-form.md +1586 -0
- package/dist/ai/recipes/vue/records-workspace.md +1245 -0
- package/dist/ai/recipes/vue/upload-center.md +1845 -0
- package/dist/ai/recipes/vue/wizard-form.md +1441 -0
- package/dist/ai/source/BbAccordion.md +123 -0
- package/dist/ai/source/BbAlert.md +401 -0
- package/dist/ai/source/BbAsterisk.md +32 -0
- package/dist/ai/source/BbAvatar.md +258 -0
- package/dist/ai/source/BbBadge.md +560 -0
- package/dist/ai/source/BbBadgeButton.md +490 -0
- package/dist/ai/source/BbBaseButton.md +682 -0
- package/dist/ai/source/BbBaseCheckbox.md +461 -0
- package/dist/ai/source/BbBaseCheckboxGroup.md +554 -0
- package/dist/ai/source/BbBaseCheckboxIcon.md +201 -0
- package/dist/ai/source/BbBaseColorInput.md +416 -0
- package/dist/ai/source/BbBaseColorPalette.md +934 -0
- package/dist/ai/source/BbBaseDatePicker.md +1001 -0
- package/dist/ai/source/BbBaseDatePickerInput.md +1785 -0
- package/dist/ai/source/BbBaseInputContainer.md +1210 -0
- package/dist/ai/source/BbBaseNumberInput.md +617 -0
- package/dist/ai/source/BbBaseRadio.md +377 -0
- package/dist/ai/source/BbBaseRadioGroup.md +533 -0
- package/dist/ai/source/BbBaseRadioIcon.md +153 -0
- package/dist/ai/source/BbBaseRating.md +573 -0
- package/dist/ai/source/BbBaseSelect.md +898 -0
- package/dist/ai/source/BbBaseSlider.md +1085 -0
- package/dist/ai/source/BbBaseSwitch.md +246 -0
- package/dist/ai/source/BbBaseSwitchGroup.md +302 -0
- package/dist/ai/source/BbBaseSwitchIcon.md +206 -0
- package/dist/ai/source/BbBaseTag.md +694 -0
- package/dist/ai/source/BbBaseTextInput.md +511 -0
- package/dist/ai/source/BbBaseTextarea.md +480 -0
- package/dist/ai/source/BbBaseTimePickerInput.md +1031 -0
- package/dist/ai/source/BbBreadcrumbs.md +815 -0
- package/dist/ai/source/BbButton.md +1006 -0
- package/dist/ai/source/BbCheckbox.md +326 -0
- package/dist/ai/source/BbCheckboxGroup.md +419 -0
- package/dist/ai/source/BbCollapsible.md +137 -0
- package/dist/ai/source/BbColorInput.md +322 -0
- package/dist/ai/source/BbColorPalette.md +371 -0
- package/dist/ai/source/BbConfirm.md +193 -0
- package/dist/ai/source/BbConfirmPortal.md +74 -0
- package/dist/ai/source/BbDatePicker.md +729 -0
- package/dist/ai/source/BbDatePickerInput.md +525 -0
- package/dist/ai/source/BbDialog.md +818 -0
- package/dist/ai/source/BbDropdown.md +2387 -0
- package/dist/ai/source/BbDropdownButton.md +315 -0
- package/dist/ai/source/BbDropdownGroup.md +1259 -0
- package/dist/ai/source/BbDropzone.md +864 -0
- package/dist/ai/source/BbForm.md +100 -0
- package/dist/ai/source/BbIcon.md +214 -0
- package/dist/ai/source/BbIndicator.md +298 -0
- package/dist/ai/source/BbNumberInput.md +374 -0
- package/dist/ai/source/BbOffCanvas.md +1266 -0
- package/dist/ai/source/BbPagination.md +835 -0
- package/dist/ai/source/BbPopover.md +860 -0
- package/dist/ai/source/BbProgress.md +140 -0
- package/dist/ai/source/BbRadio.md +303 -0
- package/dist/ai/source/BbRadioGroup.md +420 -0
- package/dist/ai/source/BbRating.md +369 -0
- package/dist/ai/source/BbSelect.md +688 -0
- package/dist/ai/source/BbSelectPopover.md +2234 -0
- package/dist/ai/source/BbSlider.md +378 -0
- package/dist/ai/source/BbSmoothHeight.md +265 -0
- package/dist/ai/source/BbSpinner.md +127 -0
- package/dist/ai/source/BbSwitch.md +175 -0
- package/dist/ai/source/BbSwitchGroup.md +240 -0
- package/dist/ai/source/BbTable.md +3433 -0
- package/dist/ai/source/BbTabs.md +403 -0
- package/dist/ai/source/BbTabsList.md +578 -0
- package/dist/ai/source/BbTabsPanes.md +368 -0
- package/dist/ai/source/BbTabsRoot.md +372 -0
- package/dist/ai/source/BbTag.md +390 -0
- package/dist/ai/source/BbTextInput.md +352 -0
- package/dist/ai/source/BbTextarea.md +337 -0
- package/dist/ai/source/BbTimePicker.md +595 -0
- package/dist/ai/source/BbTimePickerInput.md +376 -0
- package/dist/ai/source/BbToast.md +525 -0
- package/dist/ai/source/BbToastPortal.md +482 -0
- package/dist/ai/source/BbTooltip.md +522 -0
- package/dist/ai/source/BbTree.md +323 -0
- package/dist/ai/source/ChipsBox.md +201 -0
- package/dist/ai/source/ClearableButton.md +70 -0
- package/dist/ai/source/CommaBox.md +202 -0
- package/dist/ai/source/CommonInputWrapper.md +554 -0
- package/dist/ai/source/CommonPopover.md +616 -0
- package/dist/ai/source/ErrorIcon.md +43 -0
- package/dist/ai/source/FlatListBox.md +396 -0
- package/dist/ai/source/GroupedListBox.md +540 -0
- package/dist/ai/source/GuidesComponent.md +383 -0
- package/dist/ai/source/ListBox.md +238 -0
- package/dist/ai/source/OptionsContainer.md +191 -0
- package/dist/ai/source/WarningIcon.md +47 -0
- package/dist/alert-variants.d.ts +19 -0
- package/dist/assets/css/reset.css_inline.js +4 -0
- package/dist/assets/svgs/alert.svg_raw.js +4 -0
- package/dist/assets/svgs/calendar.svg_raw.js +4 -0
- package/dist/assets/svgs/check_stroke.svg_raw.js +4 -0
- package/dist/assets/svgs/chevron_down.svg_raw.js +4 -0
- package/dist/assets/svgs/chevron_right.svg_raw.js +4 -0
- package/dist/assets/svgs/clear.svg_raw.js +4 -0
- package/dist/assets/svgs/clock.svg_raw.js +4 -0
- package/dist/assets/svgs/error.svg_raw.js +4 -0
- package/dist/assets/svgs/search.svg_raw.js +4 -0
- package/dist/assets/svgs/sort.svg_raw.js +4 -0
- package/dist/assets/svgs/spinner.svg_raw.js +4 -0
- package/dist/assets/svgs/user.svg_raw.js +4 -0
- package/dist/badge-variants.d.ts +19 -0
- package/dist/button-variants.d.ts +21 -0
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +9 -3
- package/dist/components/BbAccordion/BbAccordion.vue.js +6 -0
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/components/BbAccordion/types.d.ts +12 -8
- package/dist/components/BbAlert/BbAlert.vue.d.ts +12 -3
- package/dist/components/BbAlert/BbAlert.vue.js +6 -0
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/components/BbAlert/types.d.ts +56 -12
- package/dist/components/BbAsterisk/BbAsterisk.vue.d.ts +3 -0
- package/dist/components/BbAsterisk/BbAsterisk.vue.js +6 -0
- package/dist/components/BbAsterisk/BbAsterisk.vue_vue_type_script_setup_true_lang.js +13 -0
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +5 -0
- package/dist/components/BbAvatar/BbAvatar.vue.js +6 -0
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/components/BbAvatar/types.d.ts +6 -5
- package/dist/components/BbBadge/BadgeAppendIcon.vue.d.ts +3 -0
- package/dist/components/BbBadge/BadgeAppendIcon.vue.js +5 -0
- package/dist/components/BbBadge/BadgeAppendIcon.vue_vue_type_script_setup_true_lang.js +22 -0
- package/dist/components/BbBadge/BadgeBodyContent.vue.d.ts +15 -0
- package/dist/components/BbBadge/BadgeBodyContent.vue.js +5 -0
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/components/BbBadge/BbBadge.vue.d.ts +8 -1
- package/dist/components/BbBadge/BbBadge.vue.js +6 -0
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/components/BbBadge/BbBadgeButton.vue.d.ts +12 -0
- package/dist/components/BbBadge/BbBadgeButton.vue.js +5 -0
- package/dist/components/BbBadge/BbBadgeButton.vue_vue_type_script_setup_true_lang.js +54 -0
- package/dist/components/BbBadge/badgeButtonContext.d.ts +27 -0
- package/dist/components/BbBadge/badgeButtonContext.js +5 -0
- package/dist/components/BbBadge/types.d.ts +61 -16
- package/dist/components/BbBaseButton/BbBaseButton.vue.d.ts +13 -0
- package/dist/components/BbBaseButton/BbBaseButton.vue.js +6 -0
- package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +171 -0
- package/dist/components/BbBaseButton/RouterComponent.vue.js +5 -0
- package/dist/components/BbBaseButton/RouterComponent.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/BbBaseButton/types.d.ts +191 -0
- package/dist/components/BbBaseButton/types.js +33 -0
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue.d.ts +40 -0
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue.js +6 -0
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue_vue_type_script_setup_true_lang.js +145 -0
- package/dist/components/BbBaseCheckbox/types.d.ts +224 -0
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue.d.ts +19 -0
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue.js +6 -0
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue_vue_type_script_setup_true_lang.js +190 -0
- package/dist/components/BbBaseCheckboxGroup/types.d.ts +257 -0
- package/dist/components/BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue.d.ts +4 -0
- package/dist/components/BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue.js +6 -0
- package/dist/components/BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/BbBaseCheckboxIcon/types.d.ts +47 -0
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue.d.ts +42 -0
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue.js +6 -0
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue_vue_type_script_setup_true_lang.js +178 -0
- package/dist/components/BbBaseColorInput/types.d.ts +210 -0
- package/dist/components/BbBaseColorPalette/BbBaseColorPalette.vue.d.ts +13 -0
- package/dist/components/BbBaseColorPalette/BbBaseColorPalette.vue.js +6 -0
- package/dist/components/BbBaseColorPalette/BbBaseColorPalette.vue_vue_type_script_setup_true_lang.js +395 -0
- package/dist/components/BbBaseColorPalette/types.d.ts +40 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue.js +6 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue_vue_type_script_setup_true_lang.js +300 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue.d.ts +44 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue.js +5 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue_vue_type_script_setup_true_lang.js +310 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue.d.ts +5 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue.js +5 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerYearSelector.vue.d.ts +5 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerYearSelector.vue.js +5 -0
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerYearSelector.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/components/BbBaseDatePicker/typeahead.d.ts +112 -0
- package/dist/components/BbBaseDatePicker/typeahead.js +37 -0
- package/dist/components/BbBaseDatePicker/types.d.ts +97 -0
- package/dist/components/BbBaseDatePicker/useDatePickerContext.d.ts +58 -0
- package/dist/components/BbBaseDatePicker/useDatePickerContext.js +11 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue.d.ts +30 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue.js +6 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue_vue_type_script_setup_true_lang.js +716 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue.d.ts +30 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue.js +6 -0
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue_vue_type_script_setup_true_lang.js +204 -0
- package/dist/components/BbBaseDatePickerInput/types.d.ts +311 -0
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue.d.ts +17 -0
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue.js +6 -0
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue_vue_type_script_setup_true_lang.js +191 -0
- package/dist/components/BbBaseInputContainer/types.d.ts +197 -0
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue.d.ts +52 -0
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue.js +6 -0
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue_vue_type_script_setup_true_lang.js +215 -0
- package/dist/components/BbBaseNumberInput/types.d.ts +211 -0
- package/dist/components/BbBaseRadio/BbBaseRadio.vue.d.ts +33 -0
- package/dist/components/BbBaseRadio/BbBaseRadio.vue.js +6 -0
- package/dist/components/BbBaseRadio/BbBaseRadio.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/BbBaseRadio/types.d.ts +179 -0
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue.d.ts +19 -0
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue.js +6 -0
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue_vue_type_script_setup_true_lang.js +177 -0
- package/dist/components/BbBaseRadioGroup/types.d.ts +223 -0
- package/dist/components/BbBaseRadioIcon/BbBaseRadioIcon.vue.d.ts +4 -0
- package/dist/components/BbBaseRadioIcon/BbBaseRadioIcon.vue.js +6 -0
- package/dist/components/BbBaseRadioIcon/BbBaseRadioIcon.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/BbBaseRadioIcon/types.d.ts +41 -0
- package/dist/components/BbBaseRating/BbBaseRating.vue.d.ts +38 -0
- package/dist/components/BbBaseRating/BbBaseRating.vue.js +6 -0
- package/dist/components/BbBaseRating/BbBaseRating.vue_vue_type_script_setup_true_lang.js +184 -0
- package/dist/components/BbBaseRating/types.d.ts +168 -0
- package/dist/components/BbBaseSelect/BbBaseSelect.vue.d.ts +19 -0
- package/dist/components/BbBaseSelect/BbBaseSelect.vue.js +6 -0
- package/dist/components/BbBaseSelect/BbBaseSelect.vue_vue_type_script_setup_true_lang.js +307 -0
- package/dist/components/BbBaseSelect/types.d.ts +297 -0
- package/dist/components/BbBaseSlider/BbBaseSlider.vue.d.ts +35 -0
- package/dist/components/BbBaseSlider/BbBaseSlider.vue.js +6 -0
- package/dist/components/BbBaseSlider/BbBaseSlider.vue_vue_type_script_setup_true_lang.js +324 -0
- package/dist/components/BbBaseSlider/types.d.ts +200 -0
- package/dist/components/BbBaseSwitch/BbBaseSwitch.vue.d.ts +35 -0
- package/dist/components/BbBaseSwitch/BbBaseSwitch.vue.js +6 -0
- package/dist/components/BbBaseSwitch/BbBaseSwitch.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BbBaseSwitch/types.d.ts +10 -0
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue.d.ts +19 -0
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue.js +6 -0
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue_vue_type_script_setup_true_lang.js +190 -0
- package/dist/components/BbBaseSwitchGroup/types.d.ts +8 -0
- package/dist/components/BbBaseSwitchIcon/BbBaseSwitchIcon.vue.d.ts +4 -0
- package/dist/components/BbBaseSwitchIcon/BbBaseSwitchIcon.vue.js +6 -0
- package/dist/components/BbBaseSwitchIcon/BbBaseSwitchIcon.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/BbBaseSwitchIcon/types.d.ts +48 -0
- package/dist/components/BbBaseTag/BbBaseTag.vue.d.ts +50 -0
- package/dist/components/BbBaseTag/BbBaseTag.vue.js +6 -0
- package/dist/components/BbBaseTag/BbBaseTag.vue_vue_type_script_setup_true_lang.js +266 -0
- package/dist/components/BbBaseTag/types.d.ts +160 -0
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue.d.ts +45 -0
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue.js +6 -0
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue_vue_type_script_setup_true_lang.js +200 -0
- package/dist/components/BbBaseTextInput/types.d.ts +209 -0
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue.d.ts +39 -0
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue.js +6 -0
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue_vue_type_script_setup_true_lang.js +175 -0
- package/dist/components/BbBaseTextarea/types.d.ts +170 -0
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue.d.ts +27 -0
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue.js +6 -0
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue_vue_type_script_setup_true_lang.js +522 -0
- package/dist/components/BbBaseTimePickerInput/types.d.ts +151 -0
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +0 -1
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.js +6 -0
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +224 -0
- package/dist/components/BbBreadcrumbs/estimateBreadcrumbItemWidth.js +47 -0
- package/dist/components/BbBreadcrumbs/types.d.ts +37 -22
- package/dist/components/BbButton/BbButton.vue.d.ts +6 -5
- package/dist/components/BbButton/BbButton.vue.js +6 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +181 -0
- package/dist/components/BbButton/types.d.ts +48 -47
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +4 -3
- package/dist/components/BbCheckbox/BbCheckbox.vue.js +6 -0
- package/dist/components/BbCheckbox/BbCheckbox.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BbCheckbox/types.d.ts +31 -10
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +2 -13
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.js +6 -0
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +190 -0
- package/dist/components/BbCheckboxGroup/types.d.ts +51 -23
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +2 -1
- package/dist/components/BbCollapsible/BbCollapsible.vue.js +6 -0
- package/dist/components/BbCollapsible/BbCollapsible.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/BbCollapsible/types.d.ts +13 -8
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +10 -1
- package/dist/components/BbColorInput/BbColorInput.vue.js +6 -0
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +177 -0
- package/dist/components/BbColorInput/types.d.ts +44 -11
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +5 -8
- package/dist/components/BbColorPalette/BbColorPalette.vue.js +5 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/components/BbColorPalette/types.d.ts +71 -52
- package/dist/components/BbConfirm/BbConfirm.vue.js +6 -0
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +138 -0
- package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +5 -6
- package/dist/components/BbConfirm/BbConfirmPortal.vue.js +5 -0
- package/dist/components/BbConfirm/BbConfirmPortal.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +37 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.js +6 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +319 -0
- package/dist/components/BbDatePicker/types.d.ts +159 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.js +6 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/components/BbDatePickerInput/types.d.ts +134 -16
- package/dist/components/BbDialog/BbDialog.vue.d.ts +14 -6
- package/dist/components/BbDialog/BbDialog.vue.js +6 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +214 -0
- package/dist/components/BbDialog/types.d.ts +146 -1
- package/dist/components/BbDialog/useDialogStack.d.ts +5 -0
- package/dist/components/BbDialog/useDialogStack.js +20 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue.d.ts +24 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue.js +6 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +14 -7
- package/dist/components/BbDropdown/BbDropdown.vue.js +6 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +561 -0
- package/dist/components/BbDropdown/BbDropdownGroup.vue.d.ts +44 -0
- package/dist/components/BbDropdown/BbDropdownGroup.vue.js +5 -0
- package/dist/components/BbDropdown/BbDropdownGroup.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +31 -0
- package/dist/components/BbDropdown/BbDropdownList.vue.js +6 -0
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +470 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue.d.ts +16 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue.js +5 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/components/BbDropdown/normalizeGroups.d.ts +18 -0
- package/dist/components/BbDropdown/normalizeGroups.js +46 -0
- package/dist/components/BbDropdown/types.d.ts +468 -46
- package/dist/components/BbDropdown/types.js +4 -0
- package/dist/components/BbDropdown/useDropdownContext.d.ts +89 -0
- package/dist/components/BbDropdown/useDropdownContext.js +9 -0
- package/dist/components/BbDropdown/useDropdownGroupRegistry.d.ts +108 -0
- package/dist/components/BbDropdown/useDropdownGroupRegistry.js +5 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +3 -3
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.js +6 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +119 -0
- package/dist/components/BbDropdownButton/types.d.ts +47 -52
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +5 -4
- package/dist/components/BbDropzone/BbDropzone.vue.js +6 -0
- package/dist/components/BbDropzone/BbDropzone.vue_vue_type_script_setup_true_lang.js +308 -0
- package/dist/components/BbDropzone/types.d.ts +77 -8
- package/dist/components/BbIcon/BbIcon.vue.d.ts +3 -2
- package/dist/components/BbIcon/BbIcon.vue.js +6 -0
- package/dist/components/BbIcon/BbIcon.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/components/BbIcon/types.d.ts +6 -19
- package/dist/components/BbIndicator/BbIndicator.vue.d.ts +14 -0
- package/dist/components/BbIndicator/BbIndicator.vue.js +6 -0
- package/dist/components/BbIndicator/BbIndicator.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/components/BbIndicator/types.d.ts +49 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +12 -6
- package/dist/components/BbNumberInput/BbNumberInput.vue.js +6 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +194 -0
- package/dist/components/BbNumberInput/types.d.ts +40 -4
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +16 -10
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.js +6 -0
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +284 -0
- package/dist/components/BbOffCanvas/types.d.ts +71 -39
- package/dist/components/BbOffCanvas/useOffCanvasStack.d.ts +25 -0
- package/dist/components/BbOffCanvas/useOffCanvasStack.js +68 -0
- package/dist/components/BbPagination/BbPagination.vue.d.ts +9 -4
- package/dist/components/BbPagination/BbPagination.vue.js +6 -0
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BbPagination/paginationFit.d.ts +38 -0
- package/dist/components/BbPagination/paginationFit.js +13 -0
- package/dist/components/BbPagination/types.d.ts +51 -16
- package/dist/components/BbPopover/BbPopover.vue.d.ts +16 -15
- package/dist/components/BbPopover/BbPopover.vue.js +6 -0
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +309 -0
- package/dist/components/BbPopover/escapeStack.d.ts +6 -0
- package/dist/components/BbPopover/escapeStack.js +10 -0
- package/dist/components/BbPopover/types.d.ts +90 -31
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -0
- package/dist/components/BbProgress/BbProgress.vue.js +6 -0
- package/dist/components/BbProgress/BbProgress.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/BbProgress/types.d.ts +15 -1
- package/dist/components/BbRadio/BbRadio.vue.d.ts +5 -3
- package/dist/components/BbRadio/BbRadio.vue.js +6 -0
- package/dist/components/BbRadio/BbRadio.vue_vue_type_script_setup_true_lang.js +133 -0
- package/dist/components/BbRadio/types.d.ts +32 -9
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -14
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.js +6 -0
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +186 -0
- package/dist/components/BbRadioGroup/types.d.ts +48 -22
- package/dist/components/BbRating/BbRating.vue.d.ts +4 -1
- package/dist/components/BbRating/BbRating.vue.js +6 -0
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +150 -0
- package/dist/components/BbRating/types.d.ts +44 -10
- package/dist/components/BbSelect/BbSelect.vue.d.ts +2 -11
- package/dist/components/BbSelect/BbSelect.vue.js +6 -0
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +241 -0
- package/dist/components/BbSelect/types.d.ts +112 -59
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +1 -10
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.js +6 -0
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +639 -0
- package/dist/components/BbSelectPopover/types.d.ts +197 -105
- package/dist/components/BbSlider/BbSlider.vue.d.ts +3 -6
- package/dist/components/BbSlider/BbSlider.vue.js +6 -0
- package/dist/components/BbSlider/BbSlider.vue_vue_type_script_setup_true_lang.js +166 -0
- package/dist/components/BbSlider/types.d.ts +44 -13
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +3 -1
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.js +6 -0
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/BbSmoothHeight/types.d.ts +17 -2
- package/dist/components/BbSpinner/BbSpinner.vue.d.ts +1 -1
- package/dist/components/BbSpinner/BbSpinner.vue.js +6 -0
- package/dist/components/BbSpinner/BbSpinner.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/BbSpinner/types.d.ts +10 -3
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +5 -3
- package/dist/components/BbSwitch/BbSwitch.vue.js +6 -0
- package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/components/BbSwitch/types.d.ts +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +4 -14
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.js +6 -0
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +190 -0
- package/dist/components/BbSwitchGroup/types.d.ts +3 -22
- package/dist/components/BbTable/BbTable.vue.d.ts +58 -31
- package/dist/components/BbTable/BbTable.vue.js +6 -0
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +900 -0
- package/dist/components/BbTable/types.d.ts +213 -37
- package/dist/components/BbTable/utils.d.ts +9 -1
- package/dist/components/BbTable/utils.js +53 -0
- package/dist/components/BbTabs/BbTabs.vue.d.ts +20 -0
- package/dist/components/BbTabs/BbTabs.vue.js +6 -0
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/components/BbTabs/BbTabsList.vue.d.ts +19 -0
- package/dist/components/BbTabs/BbTabsList.vue.js +6 -0
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/components/BbTabs/BbTabsPanes.vue.d.ts +16 -0
- package/dist/components/BbTabs/BbTabsPanes.vue.js +6 -0
- package/dist/components/BbTabs/BbTabsPanes.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/components/BbTabs/BbTabsRoot.vue.d.ts +20 -0
- package/dist/components/BbTabs/BbTabsRoot.vue.js +5 -0
- package/dist/components/BbTabs/BbTabsRoot.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/BbTabs/types.d.ts +264 -0
- package/dist/components/BbTag/BbTag.vue.d.ts +19 -6
- package/dist/components/BbTag/BbTag.vue.js +6 -0
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/BbTag/types.d.ts +55 -17
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +10 -1
- package/dist/components/BbTextInput/BbTextInput.vue.js +6 -0
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +195 -0
- package/dist/components/BbTextInput/types.d.ts +31 -4
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +10 -1
- package/dist/components/BbTextarea/BbTextarea.vue.js +6 -0
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +178 -0
- package/dist/components/BbTextarea/types.d.ts +33 -2
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +33 -0
- package/dist/components/BbTimePicker/BbTimePicker.vue.js +6 -0
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BbTimePicker/types.d.ts +133 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +25 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.js +6 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/components/BbTimePickerInput/types.d.ts +174 -0
- package/dist/components/BbToast/BbToast.vue.d.ts +2 -3
- package/dist/components/BbToast/BbToast.vue.js +6 -0
- package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +17 -8
- package/dist/components/BbToast/BbToastMessage.vue.js +5 -0
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/components/BbToast/BbToastPortal.vue.d.ts +30 -0
- package/dist/components/BbToast/BbToastPortal.vue.js +5 -0
- package/dist/components/BbToast/BbToastPortal.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/components/BbToast/BbToastRegion.vue.d.ts +8 -0
- package/dist/components/BbToast/BbToastRegion.vue.js +5 -0
- package/dist/components/BbToast/BbToastRegion.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/BbToast/types.d.ts +69 -5
- package/dist/components/BbTooltip/BbTooltip.vue.d.ts +10 -3
- package/dist/components/BbTooltip/BbTooltip.vue.js +6 -0
- package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +160 -0
- package/dist/components/BbTooltip/types.d.ts +69 -11
- package/dist/components/BbTree/BbTree.vue.d.ts +28 -13
- package/dist/components/BbTree/BbTree.vue.js +6 -0
- package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/BbTree/BbTreeLevel.vue.d.ts +19 -0
- package/dist/components/BbTree/BbTreeLevel.vue.js +5 -0
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/components/BbTree/context.d.ts +17 -0
- package/dist/components/BbTree/context.js +4 -0
- package/dist/components/BbTree/types.d.ts +94 -41
- package/dist/components/ChipsBox/ChipsBox.vue.d.ts +2 -1
- package/dist/components/ChipsBox/ChipsBox.vue.js +5 -0
- package/dist/components/ChipsBox/ChipsBox.vue_vue_type_script_setup_true_lang.js +98 -0
- package/dist/components/ChipsBox/types.d.ts +12 -5
- package/dist/components/ClearableButton/ClearableButton.vue.d.ts +2 -1
- package/dist/components/ClearableButton/ClearableButton.vue.js +6 -0
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/components/ClearableButton/types.d.ts +7 -1
- package/dist/components/CloseIcon/CloseButton.vue.d.ts +5 -0
- package/dist/components/CloseIcon/CloseButton.vue.js +7 -0
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +23 -0
- package/dist/components/CloseIcon/types.d.ts +2 -0
- package/dist/components/CommaBox/CommaBox.vue.d.ts +2 -1
- package/dist/components/CommaBox/CommaBox.vue.js +6 -0
- package/dist/components/CommaBox/CommaBox.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/components/CommaBox/types.d.ts +6 -7
- package/dist/components/CommonInputWrapper/CommonInputWrapper.vue.d.ts +19 -0
- package/dist/components/CommonInputWrapper/CommonInputWrapper.vue.js +6 -0
- package/dist/components/CommonInputWrapper/CommonInputWrapper.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/components/CommonInputWrapper/types.d.ts +96 -0
- package/dist/components/CommonPopover/CommonPopover.vue.d.ts +9 -3
- package/dist/components/CommonPopover/CommonPopover.vue.js +6 -0
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +160 -0
- package/dist/components/CommonPopover/types.d.ts +65 -16
- package/dist/components/ErrorIcon/ErrorIcon.vue.d.ts +2 -0
- package/dist/components/ErrorIcon/ErrorIcon.vue.js +6 -0
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/FlatListBox/FlatListBox.vue.d.ts +2 -5
- package/dist/components/FlatListBox/FlatListBox.vue.js +5 -0
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +167 -0
- package/dist/components/FlatListBox/types.d.ts +1 -1
- package/dist/components/GroupedListBox/GroupedListBox.vue.d.ts +2 -5
- package/dist/components/GroupedListBox/GroupedListBox.vue.js +5 -0
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/components/ListBox/ListBox.vue.d.ts +3 -6
- package/dist/components/ListBox/ListBox.vue.js +5 -0
- package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/components/ListBox/types.d.ts +1 -1
- package/dist/components/OptionsContainer/OptionsContainer.vue.d.ts +1 -0
- package/dist/components/OptionsContainer/OptionsContainer.vue.js +5 -0
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/OptionsContainer/types.d.ts +14 -24
- package/dist/components/Transitions/ScaleFade.vue.d.ts +2 -2
- package/dist/components/Transitions/ScaleFade.vue.js +5 -0
- package/dist/components/Transitions/ScaleFade.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/components/Transitions/Slide.vue.d.ts +15 -0
- package/dist/components/Transitions/Slide.vue.js +7 -0
- package/dist/components/Transitions/Slide.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/WarningIcon/WarningIcon.vue.d.ts +5 -0
- package/dist/components/WarningIcon/WarningIcon.vue.js +6 -0
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/WarningIcon/types.d.ts +3 -0
- package/dist/composables/__testResets.d.ts +1 -0
- package/dist/composables/useActiveInactiveState.d.ts +4 -0
- package/dist/composables/useActiveInactiveState.js +21 -0
- package/dist/composables/useBaseOptions.d.ts +3 -3
- package/dist/composables/useBaseOptions.js +31 -0
- package/dist/composables/useBbConfig.d.ts +8 -37
- package/dist/composables/useBbConfig.js +5 -0
- package/dist/composables/useBbDropdownContext.d.ts +89 -0
- package/dist/composables/useBbDropdownContext.js +46 -0
- package/dist/composables/useBbFormContext.d.ts +90 -0
- package/dist/composables/useBbFormContext.js +69 -0
- package/dist/composables/useBbTableContext.d.ts +195 -0
- package/dist/composables/useBbTableContext.js +208 -0
- package/dist/composables/useBbTabsContext.d.ts +111 -0
- package/dist/composables/useBbTabsContext.js +225 -0
- package/dist/composables/useBreakpoint.d.ts +13 -0
- package/dist/composables/useBreakpoint.js +39 -0
- package/dist/composables/useBroadcastChannelInstance.d.ts +1 -3
- package/dist/composables/useBroadcastChannelInstance.js +39 -0
- package/dist/composables/useCancelableFunction.js +37 -0
- package/dist/composables/useClosingInert.d.ts +28 -0
- package/dist/composables/useClosingInert.js +23 -0
- package/dist/composables/useCoherence.js +16 -0
- package/dist/composables/useConfirm.d.ts +278 -68
- package/dist/composables/useConfirm.js +130 -0
- package/dist/composables/useCountdown.js +42 -0
- package/dist/composables/useHashedWatcher.d.ts +17 -0
- package/dist/composables/useHashedWatcher.js +14 -0
- package/dist/composables/useId.d.ts +3 -2
- package/dist/composables/useIndexById.js +16 -0
- package/dist/composables/useInertiaPage.d.ts +10 -0
- package/dist/composables/useInertiaPage.js +8 -0
- package/dist/composables/useItemText.js +17 -0
- package/dist/composables/useItemValue.js +9 -0
- package/dist/composables/useItemsGetter.d.ts +1 -1
- package/dist/composables/useItemsGetter.js +30 -0
- package/dist/composables/useListboxFocus.js +66 -0
- package/dist/composables/useLocale.d.ts +1 -1
- package/dist/composables/useLocale.js +11 -0
- package/dist/composables/useLogger.d.ts +1 -1
- package/dist/composables/useLogger.js +10 -0
- package/dist/composables/useMinimalQueue.d.ts +1 -1
- package/dist/composables/useMobile.js +7 -0
- package/dist/composables/useOnFalsy.d.ts +2 -0
- package/dist/composables/useOnFalsy.js +9 -0
- package/dist/composables/useOnTruthy.d.ts +7 -0
- package/dist/composables/useOnTruthy.js +9 -0
- package/dist/composables/usePrefill.d.ts +2 -1
- package/dist/composables/usePrefill.js +24 -0
- package/dist/composables/useQuery.d.ts +15 -3
- package/dist/composables/useQuery.js +42 -0
- package/dist/composables/useRoute.js +11 -0
- package/dist/composables/useRouter.js +8 -0
- package/dist/composables/useSafeArea.d.ts +51 -0
- package/dist/composables/useSafeArea.js +16 -0
- package/dist/composables/useSegmentedFields.d.ts +104 -0
- package/dist/composables/useSegmentedFields.js +159 -0
- package/dist/composables/useTableWidthContext.d.ts +5 -0
- package/dist/composables/useTableWidthContext.js +42 -0
- package/dist/composables/useToast.d.ts +40 -70
- package/dist/composables/useToast.js +58 -0
- package/dist/composables/useTopLayer.d.ts +9 -0
- package/dist/composables/useTopLayer.js +7 -0
- package/dist/composables/useUntil.js +13 -0
- package/dist/composables/useViewportWidth.d.ts +17 -0
- package/dist/composables/useViewportWidth.js +6 -0
- package/dist/confirm-variants.d.ts +17 -0
- package/dist/deprecation/ai-deprecations.json.d.ts +784 -0
- package/dist/deprecation/ai-deprecations.json.js +4 -0
- package/dist/deprecation/removedProps.d.ts +3 -0
- package/dist/deprecation/removedProps.js +13 -0
- package/dist/directives/bbColor.d.ts +65 -0
- package/dist/directives/bbColor.js +24 -0
- package/dist/directives/bbDate.d.ts +66 -0
- package/dist/directives/bbDate.js +24 -0
- package/dist/directives/bbDropdown.d.ts +15 -11
- package/dist/directives/bbDropdown.js +23 -0
- package/dist/directives/bbTime.d.ts +64 -0
- package/dist/directives/bbTime.js +24 -0
- package/dist/directives/bbTooltip.d.ts +16 -11
- package/dist/directives/bbTooltip.js +24 -0
- package/dist/directives/createPopoverDirective.js +54 -0
- package/dist/dropdown-item-variants.d.ts +17 -0
- package/dist/i18n/index.d.ts +51 -3
- package/dist/i18n/index.js +27 -0
- package/dist/i18n/locales/cs.json +115 -0
- package/dist/i18n/locales/da.json +115 -0
- package/dist/i18n/locales/de.json +115 -0
- package/dist/i18n/locales/el.json +115 -0
- package/dist/i18n/locales/en.json +115 -0
- package/dist/i18n/locales/es.json +115 -0
- package/dist/i18n/locales/fi.json +115 -0
- package/dist/i18n/locales/fr.json +115 -0
- package/dist/i18n/locales/hu.json +115 -0
- package/dist/i18n/locales/it.json +115 -0
- package/dist/i18n/locales/ja.json +115 -0
- package/dist/i18n/locales/ko.json +115 -0
- package/dist/i18n/locales/nb.json +115 -0
- package/dist/i18n/locales/nl.json +115 -0
- package/dist/i18n/locales/pl.json +115 -0
- package/dist/i18n/locales/pt.json +115 -0
- package/dist/i18n/locales/ro.json +115 -0
- package/dist/i18n/locales/ru.json +115 -0
- package/dist/i18n/locales/sv.json +115 -0
- package/dist/i18n/locales/tr.json +115 -0
- package/dist/i18n/locales/uk.json +115 -0
- package/dist/i18n/locales/zh-cn.json +115 -0
- package/dist/icons-whitelist.d.ts +8 -0
- package/dist/index.d.ts +96 -79
- package/dist/index.js +76 -82
- package/dist/indicator-variants.d.ts +20 -0
- package/dist/llms-full.txt +79703 -0
- package/dist/llms-medium.txt +1514 -0
- package/dist/llms.txt +105 -0
- package/dist/locale-blueprint.json +141 -0
- package/dist/locale-registry.d.ts +37 -0
- package/dist/nuxt-module.d.ts +3 -0
- package/dist/nuxt.js +19 -0
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.js +22 -0
- package/dist/reset.css +1 -0
- package/dist/reset.d.ts +0 -0
- package/dist/runtime/nuxt-plugin.d.ts +2 -0
- package/dist/runtime/nuxt-plugin.js +24 -0
- package/dist/styles.css +2 -0
- package/dist/styles.d.ts +0 -0
- package/dist/toast-variants.d.ts +20 -0
- package/dist/tooltip-variants.d.ts +17 -0
- package/dist/types/ActionButton.d.ts +32 -0
- package/dist/types/AlertVariant.d.ts +16 -0
- package/dist/types/BadgeVariant.d.ts +16 -0
- package/dist/types/ButtonVariant.d.ts +17 -0
- package/dist/types/Classes.d.ts +1 -1
- package/dist/types/ColumnName.d.ts +1 -1
- package/dist/types/CommonProps.d.ts +68 -277
- package/dist/types/Config.d.ts +84 -0
- package/dist/types/ConfirmVariant.d.ts +15 -0
- package/dist/types/DropdownItemVariant.d.ts +18 -0
- package/dist/types/Icon.d.ts +5 -7
- package/dist/types/IndicatorVariant.d.ts +16 -0
- package/dist/types/InputDirection.d.ts +15 -0
- package/dist/types/ItemAccessor.d.ts +21 -0
- package/dist/types/Placement.d.ts +6 -0
- package/dist/types/ResponsiveSize.d.ts +20 -0
- package/dist/types/SizeScale.d.ts +8 -0
- package/dist/types/ToastVariant.d.ts +17 -0
- package/dist/types/TooltipVariant.d.ts +18 -0
- package/dist/utilities/functions/bytesToUnit.d.ts +2 -0
- package/dist/utilities/functions/bytesToUnit.js +18 -0
- package/dist/utilities/functions/clampPrecision.js +10 -0
- package/dist/utilities/functions/convertDateValue.d.ts +23 -10
- package/dist/utilities/functions/convertDateValue.js +12 -0
- package/dist/utilities/functions/deburr.js +5 -0
- package/dist/utilities/functions/empty.js +5 -0
- package/dist/utilities/functions/flattenTree.d.ts +1 -1
- package/dist/utilities/functions/hash.js +5 -0
- package/dist/utilities/functions/isDateDisabled.d.ts +1 -0
- package/dist/utilities/functions/isDateDisabled.js +20 -0
- package/dist/utilities/functions/isEqual.js +5 -0
- package/dist/utilities/functions/isNotEmpty.js +5 -0
- package/dist/utilities/functions/matchAnyKey.d.ts +1 -1
- package/dist/utilities/functions/matchAnyKey.js +15 -0
- package/dist/utilities/functions/parseSize.d.ts +1 -1
- package/dist/utilities/functions/parseSize.js +15 -0
- package/dist/utilities/functions/percentage.js +11 -0
- package/dist/utilities/functions/pipe.d.ts +1 -1
- package/dist/utilities/functions/reject.d.ts +25 -0
- package/dist/utilities/functions/reject.js +28 -0
- package/dist/utilities/functions/resolveEnumProp.d.ts +19 -0
- package/dist/utilities/functions/resolveEnumProp.js +5 -0
- package/dist/utilities/functions/slotKey.d.ts +13 -0
- package/dist/utilities/functions/slotKey.js +4 -0
- package/dist/utilities/functions/sort.d.ts +2 -2
- package/dist/utilities/functions/sort.js +19 -0
- package/dist/utilities/functions/throttle.js +5 -0
- package/dist/utilities/functions/waitFor.d.ts +9 -2
- package/dist/utilities/functions/waitFor.js +14 -0
- package/dist/utilities/functions/warnRemovedAttrs.d.ts +11 -0
- package/dist/utilities/functions/warnRemovedAttrs.js +20 -0
- package/dist/utilities/functions/when.js +5 -0
- package/dist/utilities/misc/iconsInjectionKey.d.ts +15 -0
- package/dist/utilities/misc/iconsInjectionKey.js +4 -0
- package/dist/utilities/misc/transitions.d.ts +5 -0
- package/dist/utilities/misc/transitions.js +8 -0
- package/dist/utils/injectLibraryStyles.d.ts +6 -0
- package/dist/utils/injectLibraryStyles.js +38 -0
- package/dist/validated/BbCheckbox.vue.d.ts +29 -0
- package/dist/validated/BbCheckbox.vue.js +5 -0
- package/dist/validated/BbCheckbox.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/validated/BbCheckboxGroup.vue.d.ts +34 -0
- package/dist/validated/BbCheckboxGroup.vue.js +5 -0
- package/dist/validated/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +82 -0
- package/dist/validated/BbColorInput.vue.d.ts +36 -0
- package/dist/validated/BbColorInput.vue.js +5 -0
- package/dist/validated/BbColorInput.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/validated/BbDatePickerInput.vue.d.ts +41 -0
- package/dist/validated/BbDatePickerInput.vue.js +5 -0
- package/dist/validated/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +90 -0
- package/dist/validated/BbDropzone.vue.d.ts +24 -0
- package/dist/validated/BbDropzone.vue.js +5 -0
- package/dist/validated/BbDropzone.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/validated/BbForm.vue.d.ts +28 -0
- package/dist/validated/BbForm.vue.js +5 -0
- package/dist/validated/BbForm.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/validated/BbNumberInput.vue.d.ts +36 -0
- package/dist/validated/BbNumberInput.vue.js +5 -0
- package/dist/validated/BbNumberInput.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/validated/BbRadioGroup.vue.d.ts +34 -0
- package/dist/validated/BbRadioGroup.vue.js +5 -0
- package/dist/validated/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/validated/BbRating.vue.d.ts +30 -0
- package/dist/validated/BbRating.vue.js +5 -0
- package/dist/validated/BbRating.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/validated/BbSelect.vue.d.ts +46 -0
- package/dist/validated/BbSelect.vue.js +5 -0
- package/dist/validated/BbSelect.vue_vue_type_script_setup_true_lang.js +109 -0
- package/dist/validated/BbSlider.vue.d.ts +36 -0
- package/dist/validated/BbSlider.vue.js +5 -0
- package/dist/validated/BbSlider.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/validated/BbSwitch.vue.d.ts +29 -0
- package/dist/validated/BbSwitch.vue.js +5 -0
- package/dist/validated/BbSwitch.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/validated/BbSwitchGroup.vue.d.ts +34 -0
- package/dist/validated/BbSwitchGroup.vue.js +5 -0
- package/dist/validated/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +82 -0
- package/dist/validated/BbTag.vue.d.ts +36 -0
- package/dist/validated/BbTag.vue.js +5 -0
- package/dist/validated/BbTag.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/validated/BbTextInput.vue.d.ts +36 -0
- package/dist/validated/BbTextInput.vue.js +5 -0
- package/dist/validated/BbTextInput.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/validated/BbTextarea.vue.d.ts +36 -0
- package/dist/validated/BbTextarea.vue.js +5 -0
- package/dist/validated/BbTextarea.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/validated/BbTimePickerInput.vue.d.ts +37 -0
- package/dist/validated/BbTimePickerInput.vue.js +5 -0
- package/dist/validated/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/validated/index.d.ts +29 -0
- package/dist/validated/useValidatedField.d.ts +93 -0
- package/dist/validated/useValidatedField.js +51 -0
- package/dist/validated.js +21 -0
- package/dist/vite-plugin.d.ts +261 -0
- package/dist/vite.js +603 -0
- package/llms.txt +107 -0
- package/package.json +181 -60
- package/scripts/lib/__fixtures__/validated-manifest.json +65 -0
- package/scripts/lib/ensure-manifest.mjs +39 -0
- package/scripts/lib/eslint-plugin-autofix.node.test.mjs +109 -0
- package/scripts/lib/eslint-plugin-recommended.node.test.mjs +87 -0
- package/scripts/lib/eslint-plugin-slots.node.test.mjs +271 -0
- package/scripts/lib/eslint-plugin.mjs +702 -0
- package/scripts/lib/eslint-plugin.node.test.mjs +193 -0
- package/scripts/lib/html-attributes.mjs +191 -0
- package/scripts/lib/mcp-config.mjs +126 -0
- package/scripts/lib/migrate-fix.mjs +115 -0
- package/scripts/lib/validate-bb-markup.mjs +488 -0
- package/dist/ai/BaseButton.md +0 -449
- package/dist/ai/BaseCheckbox.md +0 -512
- package/dist/ai/BaseCheckboxGroup.md +0 -597
- package/dist/ai/BaseColorInput.md +0 -461
- package/dist/ai/BaseDatePicker.md +0 -739
- package/dist/ai/BaseDatePickerInput.md +0 -1517
- package/dist/ai/BaseDialog.md +0 -610
- package/dist/ai/BaseInputContainer.md +0 -570
- package/dist/ai/BaseNumberInput.md +0 -509
- package/dist/ai/BaseRadio.md +0 -405
- package/dist/ai/BaseRadioGroup.md +0 -535
- package/dist/ai/BaseRating.md +0 -489
- package/dist/ai/BaseSelect.md +0 -1742
- package/dist/ai/BaseSlider.md +0 -871
- package/dist/ai/BaseSwitch.md +0 -322
- package/dist/ai/BaseSwitchGroup.md +0 -298
- package/dist/ai/BaseTag.md +0 -623
- package/dist/ai/BaseTextInput.md +0 -392
- package/dist/ai/BaseTextarea.md +0 -398
- package/dist/ai/BbChip.md +0 -147
- package/dist/ai/BbIntersection.md +0 -120
- package/dist/ai/BbRatio.md +0 -61
- package/dist/ai/BbRows.md +0 -307
- package/dist/ai/BbTab.md +0 -950
- package/dist/ai/CommonInputInnerContainer.md +0 -414
- package/dist/ai/CommonInputOuterContainer.md +0 -55
- package/dist/components/BaseButton/BaseButton.vue.d.ts +0 -14
- package/dist/components/BaseButton/types.d.ts +0 -159
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +0 -39
- package/dist/components/BaseCheckbox/types.d.ts +0 -213
- package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +0 -30
- package/dist/components/BaseCheckboxGroup/types.d.ts +0 -282
- package/dist/components/BaseColorInput/BaseColorInput.vue.d.ts +0 -35
- package/dist/components/BaseColorInput/ColorPalette.vue.d.ts +0 -13
- package/dist/components/BaseColorInput/types.d.ts +0 -233
- package/dist/components/BaseDatePicker/BaseDatePickerHeader.vue.d.ts +0 -15
- package/dist/components/BaseDatePicker/BaseDatePickerInputDaySelector.vue.d.ts +0 -58
- package/dist/components/BaseDatePicker/BaseDatePickerMonthSelector.vue.d.ts +0 -12
- package/dist/components/BaseDatePicker/BaseDatePickerYearSelector.vue.d.ts +0 -12
- package/dist/components/BaseDatePicker/types.d.ts +0 -100
- package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +0 -26
- package/dist/components/BaseDatePickerInput/types.d.ts +0 -206
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +0 -37
- package/dist/components/BaseDialog/types.d.ts +0 -180
- package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +0 -18
- package/dist/components/BaseInputContainer/types.d.ts +0 -126
- package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +0 -46
- package/dist/components/BaseNumberInput/types.d.ts +0 -191
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +0 -31
- package/dist/components/BaseRadio/types.d.ts +0 -173
- package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +0 -30
- package/dist/components/BaseRadioGroup/types.d.ts +0 -240
- package/dist/components/BaseRating/BaseRating.vue.d.ts +0 -35
- package/dist/components/BaseRating/types.d.ts +0 -144
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +0 -28
- package/dist/components/BaseSelect/types.d.ts +0 -470
- package/dist/components/BaseSlider/BaseSlider.vue.d.ts +0 -38
- package/dist/components/BaseSlider/types.d.ts +0 -201
- package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +0 -34
- package/dist/components/BaseSwitch/types.d.ts +0 -25
- package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +0 -30
- package/dist/components/BaseSwitchGroup/types.d.ts +0 -8
- package/dist/components/BaseTag/BaseTag.vue.d.ts +0 -37
- package/dist/components/BaseTag/types.d.ts +0 -136
- package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +0 -33
- package/dist/components/BaseTextInput/types.d.ts +0 -166
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +0 -31
- package/dist/components/BaseTextarea/types.d.ts +0 -151
- package/dist/components/BbChip/BbChip.vue.d.ts +0 -17
- package/dist/components/BbChip/types.d.ts +0 -23
- package/dist/components/BbIntersection/BbIntersection.vue.d.ts +0 -23
- package/dist/components/BbIntersection/types.d.ts +0 -36
- package/dist/components/BbRatio/BbRatio.vue.d.ts +0 -14
- package/dist/components/BbRatio/types.d.ts +0 -15
- package/dist/components/BbRows/BbRows.vue.d.ts +0 -62
- package/dist/components/BbRows/types.d.ts +0 -21
- package/dist/components/BbTab/BbTab.vue.d.ts +0 -27
- package/dist/components/BbTab/types.d.ts +0 -186
- package/dist/components/CommonInputInnerContainer/CommonInputInnerContainer.vue.d.ts +0 -15
- package/dist/components/CommonInputInnerContainer/types.d.ts +0 -47
- package/dist/components/CommonInputOuterContainer/CommonInputOuterContainer.vue.d.ts +0 -11
- package/dist/components/CommonInputOuterContainer/types.d.ts +0 -16
- package/dist/composables/useModalsState.d.ts +0 -5
- package/dist/composables/useQueue.d.ts +0 -58
- package/dist/composables/useWizard.d.ts +0 -85
- package/dist/i18n/en.d.ts +0 -67
- package/dist/i18n/it.d.ts +0 -67
- package/dist/index.css +0 -2
- package/dist/index100.js +0 -6
- package/dist/index101.js +0 -300
- package/dist/index102.js +0 -16
- package/dist/index103.js +0 -16
- package/dist/index104.js +0 -27
- package/dist/index109.js +0 -19
- package/dist/index11.js +0 -42
- package/dist/index110.js +0 -12
- package/dist/index111.js +0 -19
- package/dist/index112.js +0 -25
- package/dist/index114.js +0 -7
- package/dist/index115.js +0 -241
- package/dist/index116.js +0 -5
- package/dist/index117.js +0 -42
- package/dist/index118.js +0 -5
- package/dist/index119.js +0 -53
- package/dist/index120.js +0 -5
- package/dist/index121.js +0 -32
- package/dist/index122.js +0 -5
- package/dist/index124.js +0 -52
- package/dist/index125.js +0 -5
- package/dist/index126.js +0 -223
- package/dist/index128.js +0 -6
- package/dist/index129.js +0 -162
- package/dist/index13.js +0 -92
- package/dist/index130.js +0 -25
- package/dist/index131.js +0 -51
- package/dist/index132.js +0 -5
- package/dist/index133.js +0 -607
- package/dist/index135.js +0 -6
- package/dist/index136.js +0 -14
- package/dist/index137.js +0 -153
- package/dist/index139.js +0 -6
- package/dist/index14.js +0 -306
- package/dist/index140.js +0 -224
- package/dist/index141.js +0 -5
- package/dist/index143.js +0 -128
- package/dist/index145.js +0 -6
- package/dist/index146.js +0 -8
- package/dist/index147.js +0 -182
- package/dist/index149.js +0 -6
- package/dist/index15.js +0 -10
- package/dist/index151.js +0 -4
- package/dist/index152.js +0 -95
- package/dist/index154.js +0 -6
- package/dist/index155.js +0 -168
- package/dist/index157.js +0 -6
- package/dist/index158.js +0 -145
- package/dist/index16.js +0 -59
- package/dist/index160.js +0 -6
- package/dist/index161.js +0 -53
- package/dist/index163.js +0 -6
- package/dist/index164.js +0 -16
- package/dist/index166.js +0 -35
- package/dist/index168.js +0 -6
- package/dist/index169.js +0 -89
- package/dist/index171.js +0 -6
- package/dist/index172.js +0 -82
- package/dist/index174.js +0 -6
- package/dist/index175.js +0 -38
- package/dist/index176.js +0 -461
- package/dist/index177.js +0 -28
- package/dist/index178.js +0 -66
- package/dist/index18.js +0 -35
- package/dist/index180.js +0 -162
- package/dist/index181.js +0 -5
- package/dist/index182.js +0 -217
- package/dist/index183.js +0 -5
- package/dist/index184.js +0 -112
- package/dist/index185.js +0 -5
- package/dist/index186.js +0 -459
- package/dist/index188.js +0 -6
- package/dist/index19.js +0 -4
- package/dist/index192.js +0 -268
- package/dist/index194.js +0 -6
- package/dist/index195.js +0 -124
- package/dist/index197.js +0 -6
- package/dist/index198.js +0 -174
- package/dist/index2.js +0 -20
- package/dist/index20.js +0 -9
- package/dist/index200.js +0 -6
- package/dist/index201.js +0 -224
- package/dist/index203.js +0 -6
- package/dist/index204.js +0 -135
- package/dist/index206.js +0 -6
- package/dist/index207.js +0 -5
- package/dist/index208.js +0 -170
- package/dist/index21.js +0 -35
- package/dist/index210.js +0 -6
- package/dist/index211.js +0 -37
- package/dist/index213.js +0 -6
- package/dist/index214.js +0 -63
- package/dist/index216.js +0 -6
- package/dist/index217.js +0 -74
- package/dist/index219.js +0 -6
- package/dist/index22.js +0 -6
- package/dist/index220.js +0 -65
- package/dist/index222.js +0 -6
- package/dist/index223.js +0 -67
- package/dist/index225.js +0 -6
- package/dist/index226.js +0 -41
- package/dist/index228.js +0 -6
- package/dist/index229.js +0 -10
- package/dist/index23.js +0 -7
- package/dist/index230.js +0 -22
- package/dist/index232.js +0 -8
- package/dist/index233.js +0 -297
- package/dist/index235.js +0 -6
- package/dist/index236.js +0 -47
- package/dist/index237.js +0 -165
- package/dist/index239.js +0 -6
- package/dist/index24.js +0 -9
- package/dist/index241.js +0 -159
- package/dist/index243.js +0 -6
- package/dist/index244.js +0 -134
- package/dist/index246.js +0 -6
- package/dist/index247.js +0 -167
- package/dist/index249.js +0 -6
- package/dist/index25.js +0 -24
- package/dist/index250.js +0 -147
- package/dist/index252.js +0 -6
- package/dist/index253.js +0 -35
- package/dist/index255.js +0 -6
- package/dist/index256.js +0 -65
- package/dist/index258.js +0 -6
- package/dist/index259.js +0 -19
- package/dist/index260.js +0 -5
- package/dist/index261.js +0 -160
- package/dist/index263.js +0 -6
- package/dist/index264.js +0 -60
- package/dist/index266.js +0 -6
- package/dist/index267.js +0 -134
- package/dist/index269.js +0 -6
- package/dist/index27.js +0 -4
- package/dist/index271.js +0 -206
- package/dist/index273.js +0 -6
- package/dist/index274.js +0 -85
- package/dist/index275.js +0 -5
- package/dist/index276.js +0 -55
- package/dist/index277.js +0 -5
- package/dist/index278.js +0 -164
- package/dist/index28.js +0 -8
- package/dist/index280.js +0 -6
- package/dist/index281.js +0 -145
- package/dist/index283.js +0 -6
- package/dist/index284.js +0 -11
- package/dist/index285.js +0 -200
- package/dist/index287.js +0 -6
- package/dist/index288.js +0 -241
- package/dist/index29.js +0 -7
- package/dist/index290.js +0 -6
- package/dist/index291.js +0 -21
- package/dist/index293.js +0 -6
- package/dist/index294.js +0 -125
- package/dist/index296.js +0 -6
- package/dist/index297.js +0 -161
- package/dist/index299.js +0 -6
- package/dist/index30.js +0 -118
- package/dist/index300.js +0 -127
- package/dist/index302.js +0 -6
- package/dist/index303.js +0 -20
- package/dist/index305.js +0 -6
- package/dist/index306.js +0 -116
- package/dist/index307.js +0 -5
- package/dist/index308.js +0 -507
- package/dist/index31.js +0 -10
- package/dist/index310.js +0 -6
- package/dist/index311.js +0 -196
- package/dist/index313.js +0 -6
- package/dist/index314.js +0 -142
- package/dist/index316.js +0 -6
- package/dist/index317.js +0 -134
- package/dist/index319.js +0 -6
- package/dist/index32.js +0 -28
- package/dist/index320.js +0 -162
- package/dist/index322.js +0 -6
- package/dist/index323.js +0 -319
- package/dist/index325.js +0 -6
- package/dist/index326.js +0 -40
- package/dist/index327.js +0 -43
- package/dist/index328.js +0 -665
- package/dist/index33.js +0 -5
- package/dist/index330.js +0 -6
- package/dist/index331.js +0 -155
- package/dist/index333.js +0 -6
- package/dist/index334.js +0 -142
- package/dist/index336.js +0 -6
- package/dist/index337.js +0 -155
- package/dist/index339.js +0 -6
- package/dist/index34.js +0 -112
- package/dist/index340.js +0 -58
- package/dist/index341.js +0 -5
- package/dist/index342.js +0 -20
- package/dist/index344.js +0 -6
- package/dist/index345.js +0 -142
- package/dist/index347.js +0 -6
- package/dist/index349.js +0 -109
- package/dist/index351.js +0 -6
- package/dist/index352.js +0 -55
- package/dist/index353.js +0 -24
- package/dist/index354.js +0 -23
- package/dist/index355.js +0 -839
- package/dist/index356.js +0 -474
- package/dist/index357.js +0 -52
- package/dist/index358.js +0 -7
- package/dist/index36.js +0 -6
- package/dist/index38.js +0 -63
- package/dist/index39.js +0 -63
- package/dist/index40.js +0 -9
- package/dist/index42.js +0 -8
- package/dist/index43.js +0 -179
- package/dist/index44.js +0 -21
- package/dist/index46.js +0 -385
- package/dist/index48.js +0 -6
- package/dist/index49.js +0 -33
- package/dist/index5.js +0 -34
- package/dist/index50.js +0 -12
- package/dist/index51.js +0 -8
- package/dist/index52.js +0 -106
- package/dist/index53.js +0 -330
- package/dist/index54.js +0 -97
- package/dist/index55.js +0 -328
- package/dist/index56.js +0 -28
- package/dist/index57.js +0 -102
- package/dist/index58.js +0 -157
- package/dist/index6.js +0 -38
- package/dist/index60.js +0 -6
- package/dist/index61.js +0 -131
- package/dist/index62.js +0 -5
- package/dist/index65.js +0 -35
- package/dist/index66.js +0 -26
- package/dist/index68.js +0 -6
- package/dist/index69.js +0 -54
- package/dist/index7.js +0 -58
- package/dist/index71.js +0 -6
- package/dist/index72.js +0 -14
- package/dist/index74.js +0 -6
- package/dist/index75.js +0 -159
- package/dist/index77.js +0 -6
- package/dist/index78.js +0 -4
- package/dist/index79.js +0 -4
- package/dist/index80.js +0 -54
- package/dist/index81.js +0 -5
- package/dist/index82.js +0 -5
- package/dist/index83.js +0 -141
- package/dist/index85.js +0 -6
- package/dist/index86.js +0 -65
- package/dist/index88.js +0 -6
- package/dist/index89.js +0 -30
- package/dist/index9.js +0 -11
- package/dist/index90.js +0 -19
- package/dist/index91.js +0 -17
- package/dist/index92.js +0 -9
- package/dist/index93.js +0 -34
- package/dist/index95.js +0 -16
- package/dist/index96.js +0 -10
- package/dist/index97.js +0 -18
- package/dist/index98.js +0 -189
- package/dist/types/VoidHtmlElements.d.ts +0 -1
- package/dist/utilities/functions/add.d.ts +0 -1
- package/dist/utilities/functions/booleanishToBoolean.d.ts +0 -6
- package/dist/utilities/functions/capitalize.d.ts +0 -4
- package/dist/utilities/functions/cloneDeep.d.ts +0 -1
- package/dist/utilities/functions/debounce.d.ts +0 -1
- package/dist/utilities/functions/drop.d.ts +0 -1
- package/dist/utilities/functions/exceedsPrecision.d.ts +0 -1
- package/dist/utilities/functions/findRight.d.ts +0 -4
- package/dist/utilities/functions/findRightIndex.d.ts +0 -4
- package/dist/utilities/functions/flow.d.ts +0 -1
- package/dist/utilities/functions/getHueFromRGB.d.ts +0 -9
- package/dist/utilities/functions/groupBy.d.ts +0 -6
- package/dist/utilities/functions/gt.d.ts +0 -7
- package/dist/utilities/functions/hexToRGB.d.ts +0 -7
- package/dist/utilities/functions/hslToHex.d.ts +0 -1
- package/dist/utilities/functions/includes.d.ts +0 -1
- package/dist/utilities/functions/initial.d.ts +0 -1
- package/dist/utilities/functions/isCssColor.d.ts +0 -5
- package/dist/utilities/functions/lt.d.ts +0 -7
- package/dist/utilities/functions/makeUrl.d.ts +0 -1
- package/dist/utilities/functions/mapKeys.d.ts +0 -5
- package/dist/utilities/functions/mapValues.d.ts +0 -1
- package/dist/utilities/functions/matchesPropertyInsensitive.d.ts +0 -1
- package/dist/utilities/functions/max.d.ts +0 -2
- package/dist/utilities/functions/mean.d.ts +0 -4
- package/dist/utilities/functions/merge.d.ts +0 -11
- package/dist/utilities/functions/millisecondsTo.d.ts +0 -1
- package/dist/utilities/functions/negate.d.ts +0 -4
- package/dist/utilities/functions/normalizeItemGroups.d.ts +0 -13
- package/dist/utilities/functions/omit.d.ts +0 -2
- package/dist/utilities/functions/overEvery.d.ts +0 -4
- package/dist/utilities/functions/pick.d.ts +0 -1
- package/dist/utilities/functions/replace.d.ts +0 -1
- package/dist/utilities/functions/replaceInTree.d.ts +0 -4
- package/dist/utilities/functions/retry.d.ts +0 -5
- package/dist/utilities/functions/roundToTheNearest.d.ts +0 -8
- package/dist/utilities/functions/set.d.ts +0 -15
- package/dist/utilities/functions/stub.d.ts +0 -6
- package/dist/utilities/functions/transposePercent.d.ts +0 -9
- package/dist/utilities/functions/tryTo.d.ts +0 -2
- package/dist/utilities/functions/uniqBy.d.ts +0 -1
- /package/dist/{index64.js → _virtual/_plugin-vue_export-helper.js} +0 -0
- /package/dist/components/{BaseButton → BbBaseButton}/RouterComponent.vue.d.ts +0 -0
- /package/dist/components/{BaseDatePicker/BaseDatePicker.vue.d.ts → BbBaseDatePicker/BbBaseDatePicker.vue.d.ts} +0 -0
- /package/dist/{index165.js → composables/useArray.js} +0 -0
- /package/dist/{index17.js → composables/useFrameworkDetection.js} +0 -0
- /package/dist/{index12.js → composables/useId.js} +0 -0
- /package/dist/{index107.js → utilities/functions/chunk.js} +0 -0
- /package/dist/{index8.js → utilities/functions/clamp.js} +0 -0
- /package/dist/{index150.js → utilities/functions/curry.js} +0 -0
- /package/dist/{index45.js → utilities/functions/extractDomContainer.js} +0 -0
- /package/dist/{index270.js → utilities/functions/findInTree.js} +0 -0
- /package/dist/{index348.js → utilities/functions/flattenTree.js} +0 -0
- /package/dist/{index41.js → utilities/functions/get.js} +0 -0
- /package/dist/{index189.js → utilities/functions/head.js} +0 -0
- /package/dist/{index108.js → utilities/functions/identity.js} +0 -0
- /package/dist/{index179.js → utilities/functions/indexBy.js} +0 -0
- /package/dist/{index37.js → utilities/functions/isHex.js} +0 -0
- /package/dist/{index94.js → utilities/functions/isNil.js} +0 -0
- /package/dist/{index26.js → utilities/functions/isNotNil.js} +0 -0
- /package/dist/{index105.js → utilities/functions/last.js} +0 -0
- /package/dist/{index142.js → utilities/functions/noop.js} +0 -0
- /package/dist/{index231.js → utilities/functions/parseWidthString.js} +0 -0
- /package/dist/{index240.js → utilities/functions/pickBy.js} +0 -0
- /package/dist/{index123.js → utilities/functions/range.js} +0 -0
- /package/dist/{index190.js → utilities/functions/snapToStep.js} +0 -0
- /package/dist/{index191.js → utilities/functions/transpose.js} +0 -0
- /package/dist/{index106.js → utilities/functions/validateDateFormat.js} +0 -0
- /package/dist/{index10.js → utilities/functions/wait.js} +0 -0
package/dist/ai/BbDropdown.md
CHANGED
|
@@ -1,819 +1,1128 @@
|
|
|
1
1
|
# BbDropdown
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Agent Contract
|
|
4
|
+
|
|
5
|
+
- Safety level: **Consumer API**
|
|
6
|
+
- Group: **Overlay**
|
|
7
|
+
- Description: Displays contextual action menus and menu content.
|
|
8
|
+
- Usage rule: Prefer this component for consumer-facing implementations.
|
|
9
|
+
- Implementation source (only when the contract below is not enough): [source/BbDropdown.md](./source/BbDropdown.md)
|
|
10
|
+
|
|
11
|
+
## Usage & Guidelines
|
|
12
|
+
|
|
13
|
+
### When to use
|
|
14
|
+
|
|
15
|
+
Reach for `BbDropdown` to collect **actions** (and navigation) behind a single
|
|
16
|
+
trigger: an overflow "…" menu on a row, an account menu, a context menu. You
|
|
17
|
+
describe the menu declaratively through `items` and spread the `activator`
|
|
18
|
+
slot's `props` onto your own trigger (or attach the menu with the
|
|
19
|
+
`v-bb-dropdown` directive — see below).
|
|
20
|
+
|
|
21
|
+
Pick a sibling instead when:
|
|
22
|
+
|
|
23
|
+
- the menu has **one obvious primary action** plus a few alternates → use
|
|
24
|
+
[BbDropdownButton](./BbDropdownButton.md) (a split button).
|
|
25
|
+
- the user is **choosing a value for a field** (searchable, form-bound) → use
|
|
26
|
+
[BbSelect](./BbSelect.md), not a menu.
|
|
27
|
+
- the action is **destructive and needs confirmation** → trigger it, then gate
|
|
28
|
+
with [useConfirm](./composables/useConfirm.md).
|
|
29
|
+
|
|
30
|
+
Everything is driven by data: never rebuild rows, dividers, checks, or keyboard
|
|
31
|
+
handling in markup — hand `BbDropdown` an `items` array.
|
|
32
|
+
|
|
33
|
+
### The items grammar
|
|
34
|
+
|
|
35
|
+
An `items` entry is one of three shapes, and you can mix them freely:
|
|
36
|
+
|
|
37
|
+
- a **menu item** — an object with a `key` and a `text`;
|
|
38
|
+
- a **separator section** — a nested `[ … ]` array, rendered as its own
|
|
39
|
+
divider-separated anonymous group;
|
|
40
|
+
- a **group object** — `{ key, label?, items, selectable?, … }`, a titled and/or
|
|
41
|
+
selectable section (next sections). A group's heading is `label` (not `text`);
|
|
42
|
+
add `hideLabel` to keep the `label` for the adaptive sheet title / chips /
|
|
43
|
+
`useBbDropdownContext` while rendering no heading in the menu.
|
|
44
|
+
|
|
45
|
+
Each item extends `BbBaseButton`'s prop surface, so an item is an action, a
|
|
46
|
+
link, or a submenu opener depending on which fields it carries:
|
|
47
|
+
|
|
48
|
+
- `key` (required) — stable identity; also the selection token in selectable
|
|
49
|
+
groups and the base name for per-item slots.
|
|
50
|
+
- `text` — the label; `description` adds a muted second line (the row grows,
|
|
51
|
+
icons stay aligned with the title line).
|
|
52
|
+
- `onClick` — makes it an **action**. Never navigate from here.
|
|
53
|
+
- `href` (anchor / Inertia visit, with `method`/`data`) or `to` (vue-router) —
|
|
54
|
+
makes it a **navigation link**; the dropdown renders an `<a>` / router link,
|
|
55
|
+
and any other BbBaseButton nav prop (`target`, active-class props) passes
|
|
56
|
+
through.
|
|
57
|
+
- `items` — makes it a **submenu opener** (see Nested submenus).
|
|
58
|
+
- `prepend:icon` / `append:icon` — leading/trailing icons. The trailing icon is
|
|
59
|
+
ignored when the row shows a submenu chevron or a selection check.
|
|
60
|
+
- `variant` — visual tone. Only `destructive` is styled out of the box; the
|
|
61
|
+
`dropdownItemVariants` plugin option registers more typed names, each
|
|
62
|
+
rendering a `bb-dropdown__item--variant-<name>` class hook you style yourself.
|
|
63
|
+
- `disabled` — non-interactive row, skipped by keyboard navigation.
|
|
64
|
+
|
|
65
|
+
Note how the destructive item below follows the design rule end to end: its
|
|
66
|
+
`onClick` awaits [useConfirm](./composables/useConfirm.md) and acts only on a
|
|
67
|
+
yes (the `<BbConfirm>` host mounts once per app, e.g. in the root layout).
|
|
68
|
+
|
|
69
|
+
**A mixed action menu**
|
|
4
70
|
|
|
5
71
|
```vue
|
|
6
72
|
<template>
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
name="activator"
|
|
10
|
-
v-bind="{
|
|
11
|
-
props: {
|
|
12
|
-
ref: setActivatorRef,
|
|
13
|
-
},
|
|
14
|
-
disabled,
|
|
15
|
-
open,
|
|
16
|
-
placement,
|
|
17
|
-
}"
|
|
18
|
-
></slot>
|
|
19
|
-
<CommonPopover
|
|
20
|
-
ref="popover"
|
|
21
|
-
v-model="open"
|
|
22
|
-
:anchor="effectiveAnchor"
|
|
23
|
-
:arrow-padding="arrowPadding"
|
|
24
|
-
:boundary="boundary"
|
|
25
|
-
class="bb-dropdown"
|
|
26
|
-
:class="{
|
|
27
|
-
[`bb-dropdown--${theme}`]: true,
|
|
28
|
-
}"
|
|
29
|
-
:eager="eager"
|
|
30
|
-
:offset="offset"
|
|
31
|
-
:hide-arrow="placement === 'cursor'"
|
|
32
|
-
:padding="padding"
|
|
33
|
-
:placement="placement === 'cursor' ? 'bottom-start' : placement"
|
|
34
|
-
:transition-duration="transitionDuration"
|
|
35
|
-
v-bind="$attrs"
|
|
73
|
+
<div
|
|
74
|
+
class="flex max-w-sm items-center gap-2 rounded-[var(--bb-radius)] border p-2"
|
|
36
75
|
>
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
:
|
|
40
|
-
role="menu"
|
|
41
|
-
class="bb-dropdown__items-container"
|
|
42
|
-
:inert="!open"
|
|
43
|
-
:style="parsedWidth ? { width: parsedWidth } : undefined"
|
|
76
|
+
<div
|
|
77
|
+
aria-hidden="true"
|
|
78
|
+
class="flex size-8 shrink-0 items-center justify-center rounded-[var(--bb-radius-sm)] bg-[color:var(--bb-muted)] text-[color:var(--bb-text-muted)]"
|
|
44
79
|
>
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
>
|
|
55
|
-
<
|
|
56
|
-
v-
|
|
57
|
-
aria-
|
|
58
|
-
|
|
80
|
+
<span class="text-xs font-medium">PDF</span>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="min-w-0 flex-1">
|
|
83
|
+
<p class="truncate text-sm font-medium">Q3-report.pdf</p>
|
|
84
|
+
<p class="text-xs text-[color:var(--bb-text-muted)]">
|
|
85
|
+
248 KB · <span data-last>{{ last }}</span>
|
|
86
|
+
</p>
|
|
87
|
+
</div>
|
|
88
|
+
<BbDropdown :items="items" placement="bottom-end" :width="240">
|
|
89
|
+
<template #activator="{ props }">
|
|
90
|
+
<BbButton
|
|
91
|
+
v-bind="props"
|
|
92
|
+
aria-label="File actions"
|
|
93
|
+
icon="lucide:ellipsis"
|
|
94
|
+
size="xs"
|
|
95
|
+
variant="ghost"
|
|
59
96
|
/>
|
|
60
|
-
<slot
|
|
61
|
-
:disabled="item.disabled"
|
|
62
|
-
:index="index"
|
|
63
|
-
:item="flatItems[index]"
|
|
64
|
-
:name="`item:prepend`"
|
|
65
|
-
:open="open"
|
|
66
|
-
:placement="placement"
|
|
67
|
-
:text="item.text"
|
|
68
|
-
></slot>
|
|
69
|
-
<BaseButton
|
|
70
|
-
role="menuitem"
|
|
71
|
-
class="bb-dropdown__item"
|
|
72
|
-
:class="{
|
|
73
|
-
'bb-dropdown__item--first': index === 0,
|
|
74
|
-
'bb-dropdown__item--last': index === flatItems.length - 1,
|
|
75
|
-
}"
|
|
76
|
-
:data-dropdown-item="true"
|
|
77
|
-
v-bind="item"
|
|
78
|
-
>
|
|
79
|
-
<slot
|
|
80
|
-
:disabled="item.disabled"
|
|
81
|
-
:index="index"
|
|
82
|
-
:item="original"
|
|
83
|
-
:name="item.key"
|
|
84
|
-
:open="open"
|
|
85
|
-
:placement="placement"
|
|
86
|
-
:text="item.text"
|
|
87
|
-
><BbIcon
|
|
88
|
-
v-if="item['prepend:icon']"
|
|
89
|
-
class="item__prepend-icon"
|
|
90
|
-
:type="item['prepend:icon']" />
|
|
91
|
-
<span class="item__content">{{ item.text }}</span>
|
|
92
|
-
<BbIcon
|
|
93
|
-
v-if="item['append:icon']"
|
|
94
|
-
class="item__append-icon"
|
|
95
|
-
:type="item['append:icon']" /></slot></BaseButton
|
|
96
|
-
><slot
|
|
97
|
-
:disabled="item.disabled"
|
|
98
|
-
:index="index"
|
|
99
|
-
:item="flatItems[index]"
|
|
100
|
-
:name="`item:append`"
|
|
101
|
-
:open="open"
|
|
102
|
-
:placement="placement"
|
|
103
|
-
:text="item.text"
|
|
104
|
-
></slot>
|
|
105
97
|
</template>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
98
|
+
</BbDropdown>
|
|
99
|
+
|
|
100
|
+
<!--
|
|
101
|
+
Standalone example: it mounts its own host because it has no app root.
|
|
102
|
+
A real app mounts exactly one <BbConfirm /> at the app root, and pages
|
|
103
|
+
mount none. See ai/guides/agent-contract.md § Global Host Rule.
|
|
104
|
+
-->
|
|
105
|
+
<BbConfirm />
|
|
106
|
+
</div>
|
|
114
107
|
</template>
|
|
115
|
-
|
|
116
108
|
<script setup lang="ts">
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
const triggers = computed(() => {
|
|
169
|
-
const raw = props.trigger;
|
|
170
|
-
return new Set(Array.isArray(raw) ? raw : [raw]);
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
const createVirtualElement = (x: number, y: number) => ({
|
|
174
|
-
getBoundingClientRect: () => ({
|
|
175
|
-
x,
|
|
176
|
-
y,
|
|
177
|
-
width: 0,
|
|
178
|
-
height: 0,
|
|
179
|
-
top: y,
|
|
180
|
-
left: x,
|
|
181
|
-
right: x,
|
|
182
|
-
bottom: y,
|
|
183
|
-
toJSON() {
|
|
184
|
-
return this;
|
|
109
|
+
import { ref } from 'vue';
|
|
110
|
+
import { BbButton, BbConfirm, BbDropdown, useConfirm } from 'bitboss-ui';
|
|
111
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
112
|
+
|
|
113
|
+
const last = ref('No action yet');
|
|
114
|
+
const { confirm } = useConfirm();
|
|
115
|
+
|
|
116
|
+
const items: BbDropdownItem[] = [
|
|
117
|
+
// Plain leaf actions carry an `onClick`.
|
|
118
|
+
{
|
|
119
|
+
key: 'rename',
|
|
120
|
+
text: 'Rename',
|
|
121
|
+
'prepend:icon': 'lucide:pencil',
|
|
122
|
+
onClick: () => (last.value = 'Renamed'),
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
key: 'duplicate',
|
|
126
|
+
text: 'Duplicate',
|
|
127
|
+
'prepend:icon': 'lucide:copy',
|
|
128
|
+
onClick: () => (last.value = 'Duplicated'),
|
|
129
|
+
},
|
|
130
|
+
// A navigation item: the dropdown renders an <a>. Never wire navigation
|
|
131
|
+
// through onClick — pass href (or `to` in a router app) instead.
|
|
132
|
+
{
|
|
133
|
+
key: 'preview',
|
|
134
|
+
text: 'Open preview',
|
|
135
|
+
'prepend:icon': 'lucide:external-link',
|
|
136
|
+
href: '#preview',
|
|
137
|
+
target: '_blank',
|
|
138
|
+
},
|
|
139
|
+
// A nested array becomes its own divider-separated section. A destructive
|
|
140
|
+
// item never acts directly: its onClick awaits useConfirm and only
|
|
141
|
+
// proceeds on a yes.
|
|
142
|
+
[
|
|
143
|
+
{
|
|
144
|
+
key: 'delete',
|
|
145
|
+
text: 'Delete file',
|
|
146
|
+
description: 'This cannot be undone',
|
|
147
|
+
'prepend:icon': 'lucide:trash-2',
|
|
148
|
+
variant: 'destructive',
|
|
149
|
+
onClick: async () => {
|
|
150
|
+
const ok = await confirm({
|
|
151
|
+
title: 'Delete "Q3-report.pdf"?',
|
|
152
|
+
text: 'The file will be removed for everyone in the workspace.',
|
|
153
|
+
variant: 'destructive',
|
|
154
|
+
yes: { text: 'Delete file', 'prepend:icon': 'lucide:trash-2' },
|
|
155
|
+
no: 'Keep file',
|
|
156
|
+
});
|
|
157
|
+
if (ok) last.value = 'Deleted';
|
|
158
|
+
},
|
|
185
159
|
},
|
|
186
|
-
|
|
187
|
-
|
|
160
|
+
],
|
|
161
|
+
];
|
|
162
|
+
</script>
|
|
163
|
+
```
|
|
188
164
|
|
|
189
|
-
|
|
165
|
+
In a Nuxt or Inertia app, the same items navigate through the platform — pass
|
|
166
|
+
`to` for a router route, or `href` with an Inertia `method`/`data`:
|
|
190
167
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
168
|
+
```vue
|
|
169
|
+
<script setup lang="ts">
|
|
170
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
171
|
+
|
|
172
|
+
const items: BbDropdownItem[] = [
|
|
173
|
+
// Nuxt / vue-router route
|
|
174
|
+
{ key: 'settings', text: 'Settings', to: { name: 'settings' } },
|
|
175
|
+
// Inertia visit
|
|
176
|
+
{ key: 'logout', text: 'Log out', href: '/logout', method: 'post' },
|
|
177
|
+
];
|
|
178
|
+
</script>
|
|
179
|
+
```
|
|
196
180
|
|
|
197
|
-
|
|
198
|
-
const el = extractDomContainer(reference);
|
|
199
|
-
if (!el) return;
|
|
200
|
-
activator.value = el;
|
|
201
|
-
};
|
|
181
|
+
### Async actions and the loading flag
|
|
202
182
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
);
|
|
183
|
+
Clicking a plain action closes the menu immediately and returns focus to the
|
|
184
|
+
trigger (unless the action moved focus elsewhere, e.g. opened a dialog). When
|
|
185
|
+
the `onClick` returns a promise, the dropdown keeps tracking it after the menu
|
|
186
|
+
has closed: the `activator` slot's `loading` flag stays `true` until it
|
|
187
|
+
settles, and re-clicks on that item are ignored while it's in flight. Reflect
|
|
188
|
+
`loading` on your trigger and you get a busy state for free. Inside a
|
|
189
|
+
selectable group the menu stays open instead, and the row itself carries
|
|
190
|
+
`aria-busy` while its handler runs.
|
|
212
191
|
|
|
213
|
-
|
|
214
|
-
* Items normalized into divider-separated groups. A flat `items` array yields a
|
|
215
|
-
* single group; nested arrays (or loose items around them) become their own
|
|
216
|
-
* groups. See {@link normalizeItemGroups}.
|
|
217
|
-
*/
|
|
218
|
-
const itemGroups = computed(() => normalizeItemGroups(props.items));
|
|
219
|
-
/** Flattened view of {@link itemGroups}; keyboard navigation and indices are flat. */
|
|
220
|
-
const flatItems = computed(() => itemGroups.value.flat());
|
|
221
|
-
/** Flat indices that begin a new group, used to render dividers between groups. */
|
|
222
|
-
const groupStartIndices = computed(() => {
|
|
223
|
-
const set = new Set<number>();
|
|
224
|
-
let offset = 0;
|
|
225
|
-
for (const group of itemGroups.value) {
|
|
226
|
-
set.add(offset);
|
|
227
|
-
offset += group.length;
|
|
228
|
-
}
|
|
229
|
-
return set;
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
const mappedItems = computed(() => {
|
|
233
|
-
let firstFocusableIndex: number = flatItems.value.findIndex(
|
|
234
|
-
(el) => !el.disabled
|
|
235
|
-
);
|
|
236
|
-
let lastFocusableIndex: number = findRightIndex(
|
|
237
|
-
flatItems.value,
|
|
238
|
-
(item) => !item.disabled
|
|
239
|
-
);
|
|
240
|
-
|
|
241
|
-
return flatItems.value.map((item, index) => {
|
|
242
|
-
const itemid = `${id}-item-${item.key}`;
|
|
243
|
-
const { onClick: handler, ...rest } = item;
|
|
244
|
-
|
|
245
|
-
/* If a click handler has been passed close the dropdown,
|
|
246
|
-
* return focus and run the handler
|
|
247
|
-
*/
|
|
248
|
-
const onClick = async (event: MouseEvent) => {
|
|
249
|
-
event.stopPropagation();
|
|
250
|
-
await closeDropdown();
|
|
251
|
-
const nextElement = document.querySelector<HTMLElement>(`#${id}`);
|
|
252
|
-
if (nextElement) nextElement.focus();
|
|
253
|
-
handler?.(event);
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* On keydown
|
|
258
|
-
* arrow down move to the next focusable element if it's not the last
|
|
259
|
-
* arrow up move to the previous focusable element if it's not the first
|
|
260
|
-
* on tab search the next focusable element after the button that opens the dropdown
|
|
261
|
-
* if an element is found focus on that
|
|
262
|
-
* (the menu is attached to body so it's not in order)
|
|
263
|
-
*/
|
|
264
|
-
const onKeydown = (event: KeyboardEvent) => {
|
|
265
|
-
if (
|
|
266
|
-
!(event.target instanceof HTMLElement) ||
|
|
267
|
-
!event.target.dataset['dropdownItem'] ||
|
|
268
|
-
!popoverDom.value
|
|
269
|
-
) {
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
if (event.key === 'ArrowDown') {
|
|
274
|
-
event.preventDefault();
|
|
275
|
-
if (index !== lastFocusableIndex) {
|
|
276
|
-
const option = popoverDom.value.querySelector(
|
|
277
|
-
selectors.map((selector) => `#${itemid} ~ ${selector}`).join(',')
|
|
278
|
-
);
|
|
279
|
-
if (option instanceof HTMLElement) {
|
|
280
|
-
option.focus();
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
} else if (event.key === 'ArrowUp') {
|
|
284
|
-
event.preventDefault();
|
|
285
|
-
if (index !== firstFocusableIndex) {
|
|
286
|
-
const indexOfPrevious = findRightIndex(
|
|
287
|
-
flatItems.value,
|
|
288
|
-
(item, i) => i < index && !item.disabled
|
|
289
|
-
);
|
|
290
|
-
const options = Array.from(
|
|
291
|
-
popoverDom.value.querySelectorAll(`.bb-dropdown__item`)
|
|
292
|
-
);
|
|
293
|
-
const option = options[indexOfPrevious];
|
|
294
|
-
if (option instanceof HTMLElement) {
|
|
295
|
-
option.focus();
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
} else if (event.key === 'Tab') {
|
|
299
|
-
if (index === lastFocusableIndex && !event.shiftKey) {
|
|
300
|
-
const focusableElements = Array.from(
|
|
301
|
-
document.querySelectorAll(selectors.join(','))
|
|
302
|
-
);
|
|
303
|
-
const indexOfButton = focusableElements.findIndex(
|
|
304
|
-
(el) => el.id === id
|
|
305
|
-
);
|
|
306
|
-
const nextElement = focusableElements[indexOfButton + 1];
|
|
307
|
-
if (nextElement instanceof HTMLElement) {
|
|
308
|
-
event.preventDefault();
|
|
309
|
-
closeDropdown();
|
|
310
|
-
nextElement.focus();
|
|
311
|
-
}
|
|
312
|
-
} else if (index === firstFocusableIndex && event.shiftKey) {
|
|
313
|
-
const nextElement = document.querySelector<HTMLElement>(`#${id}`);
|
|
314
|
-
if (nextElement) {
|
|
315
|
-
event.preventDefault();
|
|
316
|
-
nextElement.focus();
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
return {
|
|
323
|
-
...rest,
|
|
324
|
-
original: item,
|
|
325
|
-
key: item.key.split(/\W+/g).join('_').toLowerCase() as InferredBodySlots,
|
|
326
|
-
disabled: rest.disabled || props.disabled,
|
|
327
|
-
id: itemid,
|
|
328
|
-
isGroupStart: groupStartIndices.value.has(index),
|
|
329
|
-
onClick,
|
|
330
|
-
onKeydown,
|
|
331
|
-
};
|
|
332
|
-
});
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
const onClick = (event: MouseEvent) => {
|
|
336
|
-
if (props.disabled) return;
|
|
337
|
-
if (longPressTriggered) {
|
|
338
|
-
longPressTriggered = false;
|
|
339
|
-
event.preventDefault();
|
|
340
|
-
event.stopPropagation();
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
event.stopPropagation();
|
|
344
|
-
if (props.placement === 'cursor') {
|
|
345
|
-
cursorAnchor.value = createVirtualElement(event.clientX, event.clientY);
|
|
346
|
-
}
|
|
347
|
-
open.value ? closeDropdown() : openDropdown();
|
|
348
|
-
};
|
|
192
|
+
**Background sync with a busy trigger**
|
|
349
193
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
194
|
+
```vue
|
|
195
|
+
<template>
|
|
196
|
+
<div
|
|
197
|
+
class="flex max-w-sm items-center gap-2 rounded-[var(--bb-radius)] border p-2"
|
|
198
|
+
>
|
|
199
|
+
<div class="min-w-0 flex-1">
|
|
200
|
+
<p class="truncate text-sm font-medium">bitboss/storefront</p>
|
|
201
|
+
<p class="text-xs text-[color:var(--bb-text-muted)]" data-sync>
|
|
202
|
+
{{ status }}
|
|
203
|
+
</p>
|
|
204
|
+
</div>
|
|
205
|
+
<!-- `adaptive` is pinned off so the demo behaves identically on any
|
|
206
|
+
viewport; leave it at the project default in real apps. -->
|
|
207
|
+
<BbDropdown :adaptive="false" :items="items" :width="220">
|
|
208
|
+
<template #activator="{ props, loading }">
|
|
209
|
+
<!-- The slot's `loading` flag is true while any item's async
|
|
210
|
+
`onClick` is in flight — even after the menu has closed. -->
|
|
211
|
+
<BbButton
|
|
212
|
+
v-bind="props"
|
|
213
|
+
append:icon="lucide:chevron-down"
|
|
214
|
+
:loading="loading"
|
|
215
|
+
size="xs"
|
|
216
|
+
variant="outline"
|
|
217
|
+
>
|
|
218
|
+
Sync
|
|
219
|
+
</BbButton>
|
|
220
|
+
</template>
|
|
221
|
+
</BbDropdown>
|
|
222
|
+
</div>
|
|
223
|
+
</template>
|
|
224
|
+
<script setup lang="ts">
|
|
225
|
+
import { ref } from 'vue';
|
|
226
|
+
import { BbButton, BbDropdown } from 'bitboss-ui';
|
|
227
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
360
228
|
|
|
361
|
-
|
|
229
|
+
const status = ref('Idle');
|
|
362
230
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
231
|
+
// A plain action closes the menu the moment it's clicked; when its `onClick`
|
|
232
|
+
// returns a promise the dropdown keeps tracking it until it settles, so the
|
|
233
|
+
// activator can stay busy while the work runs in the background.
|
|
234
|
+
const items: BbDropdownItem[] = [
|
|
235
|
+
{
|
|
236
|
+
key: 'sync',
|
|
237
|
+
text: 'Sync now',
|
|
238
|
+
'prepend:icon': 'lucide:refresh-cw',
|
|
239
|
+
onClick: async () => {
|
|
240
|
+
status.value = 'Syncing…';
|
|
241
|
+
await new Promise((resolve) => setTimeout(resolve, 400));
|
|
242
|
+
status.value = 'Synced';
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
key: 'history',
|
|
247
|
+
text: 'View sync history',
|
|
248
|
+
'prepend:icon': 'lucide:history',
|
|
249
|
+
href: '#history',
|
|
250
|
+
},
|
|
251
|
+
];
|
|
252
|
+
</script>
|
|
253
|
+
```
|
|
368
254
|
|
|
369
|
-
|
|
370
|
-
clearTimeout(longPressTimer);
|
|
371
|
-
longPressOrigin = null;
|
|
372
|
-
};
|
|
255
|
+
### Nested submenus
|
|
373
256
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
longPressOrigin.x,
|
|
383
|
-
longPressOrigin.y
|
|
384
|
-
);
|
|
385
|
-
}
|
|
386
|
-
longPressOrigin = null;
|
|
387
|
-
openDropdown();
|
|
388
|
-
}, LONG_PRESS_DELAY);
|
|
389
|
-
};
|
|
257
|
+
Give an item its own `items` array and it opens a submenu — recursively, to any
|
|
258
|
+
depth. A chevron is shown automatically (it replaces any `append:icon`). On
|
|
259
|
+
desktop, submenus are hover-intent flyouts (opening waits for the parent
|
|
260
|
+
panel's transition; leaving tolerates a short diagonal move); clicking a parent
|
|
261
|
+
row opens its submenu and never closes the menu. On the mobile sheet the same
|
|
262
|
+
items **drill down** one level at a time with a back control instead. Use
|
|
263
|
+
submenus to group rarely-used options without crowding the top level; keep the
|
|
264
|
+
nesting shallow (two levels is plenty).
|
|
390
265
|
|
|
391
|
-
|
|
392
|
-
if (!longPressOrigin) return;
|
|
393
|
-
const dx = event.clientX - longPressOrigin.x;
|
|
394
|
-
const dy = event.clientY - longPressOrigin.y;
|
|
395
|
-
if (Math.sqrt(dx * dx + dy * dy) > LONG_PRESS_MOVE_THRESHOLD) {
|
|
396
|
-
clearLongPress();
|
|
397
|
-
}
|
|
398
|
-
};
|
|
266
|
+
**Submenus to any depth**
|
|
399
267
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
268
|
+
```vue
|
|
269
|
+
<template>
|
|
270
|
+
<div
|
|
271
|
+
class="flex max-w-xs items-center justify-between gap-2 rounded-[var(--bb-radius)] border p-2"
|
|
272
|
+
>
|
|
273
|
+
<span class="text-sm font-medium">Acme Studio</span>
|
|
274
|
+
<BbDropdown :items="items" placement="bottom-end" :width="240">
|
|
275
|
+
<template #activator="{ props }">
|
|
276
|
+
<BbButton
|
|
277
|
+
v-bind="props"
|
|
278
|
+
aria-label="Account menu"
|
|
279
|
+
class="gap-1.5"
|
|
280
|
+
size="xs"
|
|
281
|
+
variant="ghost"
|
|
282
|
+
>
|
|
283
|
+
<BbAvatar size="xs">SE</BbAvatar>
|
|
284
|
+
<span class="hidden sm:inline">Sofia</span>
|
|
285
|
+
</BbButton>
|
|
286
|
+
</template>
|
|
287
|
+
</BbDropdown>
|
|
288
|
+
</div>
|
|
289
|
+
</template>
|
|
290
|
+
<script setup lang="ts">
|
|
291
|
+
import { BbAvatar, BbButton, BbDropdown } from 'bitboss-ui';
|
|
292
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
403
293
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
294
|
+
// An item with its own `items` opens a submenu. Submenus nest to any depth —
|
|
295
|
+
// a chevron replaces the item's own `append:icon`.
|
|
296
|
+
const items: BbDropdownItem[] = [
|
|
297
|
+
{
|
|
298
|
+
key: 'account',
|
|
299
|
+
text: 'Account',
|
|
300
|
+
'prepend:icon': 'lucide:user',
|
|
301
|
+
items: [
|
|
302
|
+
{ key: 'profile', text: 'View profile', href: '#profile' },
|
|
303
|
+
{ key: 'billing', text: 'Billing & plans', href: '#billing' },
|
|
304
|
+
{
|
|
305
|
+
key: 'security',
|
|
306
|
+
text: 'Security',
|
|
307
|
+
items: [
|
|
308
|
+
{ key: '2fa', text: 'Two-factor auth', href: '#2fa' },
|
|
309
|
+
{ key: 'sessions', text: 'Active sessions', href: '#sessions' },
|
|
310
|
+
],
|
|
311
|
+
},
|
|
312
|
+
],
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
key: 'help',
|
|
316
|
+
text: 'Help & support',
|
|
317
|
+
'prepend:icon': 'lucide:life-buoy',
|
|
318
|
+
href: '#help',
|
|
319
|
+
},
|
|
320
|
+
[
|
|
321
|
+
{
|
|
322
|
+
key: 'signout',
|
|
323
|
+
text: 'Sign out',
|
|
324
|
+
'prepend:icon': 'lucide:log-out',
|
|
325
|
+
href: '#signout',
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
];
|
|
329
|
+
</script>
|
|
330
|
+
```
|
|
432
331
|
|
|
433
|
-
|
|
434
|
-
const target = event.target;
|
|
435
|
-
if (!(target instanceof HTMLElement)) return;
|
|
332
|
+
### Selectable groups
|
|
436
333
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
334
|
+
Turn a group into a chooser by marking it `selectable` (single choice, radio
|
|
335
|
+
semantics) or `selectable` + `multiple` (many choices, checkbox semantics).
|
|
336
|
+
Selected rows render a check on the right (replacing any `append:icon`).
|
|
337
|
+
Behavior you can rely on:
|
|
440
338
|
|
|
441
|
-
|
|
442
|
-
|
|
339
|
+
- a **single** selection re-clicked clears itself; when the group is the sole
|
|
340
|
+
top-level selectable group, picking a value also closes the menu;
|
|
341
|
+
- a **multiple** group keeps the menu open while you toggle;
|
|
342
|
+
- the dropdown emits `item:selected` / `item:unselected` with the changed item's
|
|
343
|
+
**value** (its `item-value` for pipeline groups, else its `key`) whenever any
|
|
344
|
+
selectable group changes — the same value shape `BbTable` emits.
|
|
443
345
|
|
|
444
|
-
|
|
445
|
-
|
|
346
|
+
Selection state lives on the dropdown; a companion `<BbDropdownGroup>` in the
|
|
347
|
+
default slot binds to it. The companion is intentionally minimal — it takes
|
|
348
|
+
only the group's `id` (which must match the group's `key` in `items`) and a
|
|
349
|
+
`v-model`; the options themselves stay declared in the host's `items`. Its
|
|
350
|
+
`v-model` seeds the initial selection before the menu ever opens, and it emits
|
|
351
|
+
the same `item:selected` / `item:unselected` pair. Two hard rules, enforced
|
|
352
|
+
with thrown errors: a `multiple` group's model must be an array, and the `id`
|
|
353
|
+
must point at a _group_ (not a plain item, not a missing key).
|
|
446
354
|
|
|
447
|
-
|
|
448
|
-
const button = document.querySelector<HTMLElement>(`#${id}`);
|
|
449
|
-
button?.focus();
|
|
450
|
-
}
|
|
451
|
-
closeDropdown();
|
|
452
|
-
};
|
|
453
|
-
const openDropdown = async () => {
|
|
454
|
-
resume();
|
|
455
|
-
await wait(50);
|
|
456
|
-
open.value = true;
|
|
457
|
-
document.addEventListener('click', onOutsideInteraction, { passive: true });
|
|
458
|
-
document.addEventListener('contextmenu', onOutsideInteraction, {
|
|
459
|
-
passive: true,
|
|
460
|
-
});
|
|
461
|
-
document.addEventListener('focusin', onOutsideInteraction, { passive: true });
|
|
462
|
-
document.addEventListener('keydown', onEsc, { capture: true });
|
|
463
|
-
};
|
|
355
|
+
**Radio and checkbox groups**
|
|
464
356
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
357
|
+
```vue
|
|
358
|
+
<template>
|
|
359
|
+
<div
|
|
360
|
+
class="flex max-w-md flex-wrap items-center gap-2 rounded-[var(--bb-radius)] border p-2"
|
|
361
|
+
>
|
|
362
|
+
<span class="pr-1 text-xs font-medium text-[color:var(--bb-text-muted)]"
|
|
363
|
+
>Invoices</span
|
|
364
|
+
>
|
|
365
|
+
<BbDropdown :adaptive="false" :items="items" :width="220">
|
|
366
|
+
<template #activator="{ props }">
|
|
367
|
+
<BbButton
|
|
368
|
+
v-bind="props"
|
|
369
|
+
append:icon="lucide:chevron-down"
|
|
370
|
+
size="xs"
|
|
371
|
+
variant="outline"
|
|
372
|
+
>
|
|
373
|
+
View
|
|
374
|
+
</BbButton>
|
|
375
|
+
</template>
|
|
376
|
+
<!-- Companions bind to a group by `id`; the group itself is declared
|
|
377
|
+
in `items`. They only need an `id` and a `v-model`. -->
|
|
378
|
+
<BbDropdownGroup id="sort" v-model="sortBy" />
|
|
379
|
+
<BbDropdownGroup id="tags" v-model="tags" />
|
|
380
|
+
</BbDropdown>
|
|
381
|
+
<span class="text-xs text-[color:var(--bb-text-muted)]">
|
|
382
|
+
Sort: <span data-sort>{{ sortBy }}</span> · Tags:
|
|
383
|
+
<span data-tags>{{ tags.join(', ') || 'none' }}</span>
|
|
384
|
+
</span>
|
|
385
|
+
</div>
|
|
386
|
+
</template>
|
|
387
|
+
<script setup lang="ts">
|
|
388
|
+
import { ref } from 'vue';
|
|
389
|
+
import { BbButton, BbDropdown, BbDropdownGroup } from 'bitboss-ui';
|
|
390
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
469
391
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
if (val) setActivatorRef(val);
|
|
392
|
+
// `selectable` → single choice (radio semantics, closes on pick).
|
|
393
|
+
// `multiple` → many choices (checkbox semantics, stays open while toggling).
|
|
394
|
+
const items: BbDropdownItem[] = [
|
|
395
|
+
{
|
|
396
|
+
key: 'sort',
|
|
397
|
+
label: 'Sort by',
|
|
398
|
+
selectable: true,
|
|
399
|
+
items: [
|
|
400
|
+
{ key: 'recent', text: 'Most recent' },
|
|
401
|
+
{ key: 'name', text: 'Name (A–Z)' },
|
|
402
|
+
{ key: 'amount', text: 'Amount (high → low)' },
|
|
403
|
+
],
|
|
483
404
|
},
|
|
484
|
-
{
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
cleanupActivator = null;
|
|
495
|
-
}
|
|
496
|
-
if (!el) return;
|
|
497
|
-
|
|
498
|
-
// Adopt an existing id rather than overwriting it (the menu is labelled by
|
|
499
|
-
// the activator via `aria-labelledby`); only assign one when absent.
|
|
500
|
-
let assignedId = false;
|
|
501
|
-
if (!el.id) {
|
|
502
|
-
el.id = id;
|
|
503
|
-
assignedId = true;
|
|
504
|
-
}
|
|
505
|
-
activatorId.value = el.id;
|
|
506
|
-
el.setAttribute('aria-haspopup', 'menu');
|
|
507
|
-
|
|
508
|
-
const removers: (() => void)[] = [];
|
|
509
|
-
|
|
510
|
-
if (active.has('click')) {
|
|
511
|
-
el.addEventListener('click', onClick);
|
|
512
|
-
removers.push(() => el.removeEventListener('click', onClick));
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
if (active.has('contextMenu')) {
|
|
516
|
-
el.addEventListener('contextmenu', onContextMenu);
|
|
517
|
-
el.addEventListener('pointerdown', onPointerDown);
|
|
518
|
-
el.addEventListener('pointermove', onPointerMove);
|
|
519
|
-
el.addEventListener('pointerup', onPointerUp);
|
|
520
|
-
el.addEventListener('pointercancel', onPointerUp);
|
|
521
|
-
removers.push(() => {
|
|
522
|
-
el.removeEventListener('contextmenu', onContextMenu);
|
|
523
|
-
el.removeEventListener('pointerdown', onPointerDown);
|
|
524
|
-
el.removeEventListener('pointermove', onPointerMove);
|
|
525
|
-
el.removeEventListener('pointerup', onPointerUp);
|
|
526
|
-
el.removeEventListener('pointercancel', onPointerUp);
|
|
527
|
-
clearLongPress();
|
|
528
|
-
});
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
el.addEventListener('keydown', onKeydown);
|
|
532
|
-
removers.push(() => el.removeEventListener('keydown', onKeydown));
|
|
533
|
-
|
|
534
|
-
cleanupActivator = () => {
|
|
535
|
-
removers.forEach((fn) => fn());
|
|
536
|
-
if (assignedId) el.removeAttribute('id');
|
|
537
|
-
el.removeAttribute('aria-haspopup');
|
|
538
|
-
el.removeAttribute('aria-expanded');
|
|
539
|
-
el.removeAttribute('aria-controls');
|
|
540
|
-
};
|
|
405
|
+
{
|
|
406
|
+
key: 'tags',
|
|
407
|
+
label: 'Tags',
|
|
408
|
+
selectable: true,
|
|
409
|
+
multiple: true,
|
|
410
|
+
items: [
|
|
411
|
+
{ key: 'overdue', text: 'Overdue' },
|
|
412
|
+
{ key: 'vip', text: 'VIP' },
|
|
413
|
+
{ key: 'review', text: 'Needs review' },
|
|
414
|
+
],
|
|
541
415
|
},
|
|
542
|
-
|
|
543
|
-
|
|
416
|
+
];
|
|
417
|
+
|
|
418
|
+
const sortBy = ref('recent');
|
|
419
|
+
const tags = ref<string[]>(['overdue']);
|
|
420
|
+
</script>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### Loading options on demand
|
|
424
|
+
|
|
425
|
+
For options that come from an API, make the group a **pipeline group**: pass an
|
|
426
|
+
(async) getter as `items` and an `item-text` / `item-value` pair. This mirrors
|
|
427
|
+
`BbSelect`'s fetch model, so the same data source drops into either component.
|
|
428
|
+
The full grammar:
|
|
429
|
+
|
|
430
|
+
- `items: (prefill, modelValue) => raw[] | Promise<raw[]>` — called lazily on
|
|
431
|
+
the menu's **first open**, never on mount, and again whenever `dependencies`
|
|
432
|
+
change. `modelValue` is the group's current selection; `prefill` is always
|
|
433
|
+
`true` here (it reads `false` only for a user-typed query, which a menu has
|
|
434
|
+
no field for) and exists so the same provider can serve a `BbSelect`. A plain
|
|
435
|
+
raw array also works when you just need the mapping.
|
|
436
|
+
- `itemText` / `itemValue` — a path string or getter producing each raw item's
|
|
437
|
+
label and value. `v-model` on the companion surfaces the selected value(s);
|
|
438
|
+
internally the selection key is a hash of the value. BbBaseButton props on the
|
|
439
|
+
raw items (`href`, `disabled`, icons, `variant`, `onClick`, …) pass through
|
|
440
|
+
to the rendered rows.
|
|
441
|
+
- `max` — caps a multiple selection; once reached, unselected rows render
|
|
442
|
+
disabled.
|
|
443
|
+
- `loadingText` / `noDataText` — placeholder row text per group; the
|
|
444
|
+
dropdown-level `loading-text` / `no-data-text` props set the default for all
|
|
445
|
+
groups, and the `#loading` / `#no-data` slots (payload: `{ text, groupKey }`)
|
|
446
|
+
replace the placeholder rows entirely.
|
|
447
|
+
- `dependencies: [...]` + `depsDebounceTime` — re-run the getter (debounced)
|
|
448
|
+
when any dependency changes, e.g. a search field feeding the fetch.
|
|
449
|
+
- `enforceCoherence` — after a re-fetch, drop selected values that no longer
|
|
450
|
+
exist in the items (and update `v-model`). Settable per group or as a
|
|
451
|
+
dropdown-level default.
|
|
452
|
+
|
|
453
|
+
**Async assignee picker**
|
|
544
454
|
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
455
|
+
```vue
|
|
456
|
+
<template>
|
|
457
|
+
<div
|
|
458
|
+
class="flex max-w-sm flex-wrap items-center gap-2 rounded-[var(--bb-radius)] border p-2"
|
|
459
|
+
>
|
|
460
|
+
<div class="min-w-0 flex-1">
|
|
461
|
+
<p class="truncate text-sm font-medium">INV-2048 · Northwind</p>
|
|
462
|
+
<p class="text-xs text-[color:var(--bb-text-muted)]">
|
|
463
|
+
Assignees ·
|
|
464
|
+
<span data-count>{{ assignees.length }} selected</span>
|
|
465
|
+
</p>
|
|
466
|
+
</div>
|
|
467
|
+
<BbDropdown :items="items" loading-text="Loading team…" :width="240">
|
|
468
|
+
<template #activator="{ props, loading }">
|
|
469
|
+
<BbButton
|
|
470
|
+
v-bind="props"
|
|
471
|
+
append:icon="lucide:chevron-down"
|
|
472
|
+
:loading="loading"
|
|
473
|
+
size="xs"
|
|
474
|
+
variant="outline"
|
|
475
|
+
>
|
|
476
|
+
Assign
|
|
477
|
+
</BbButton>
|
|
478
|
+
</template>
|
|
479
|
+
<BbDropdownGroup id="assignees" v-model="assignees" />
|
|
480
|
+
</BbDropdown>
|
|
481
|
+
</div>
|
|
482
|
+
</template>
|
|
483
|
+
<script setup lang="ts">
|
|
484
|
+
import { ref } from 'vue';
|
|
485
|
+
import { BbButton, BbDropdown, BbDropdownGroup } from 'bitboss-ui';
|
|
486
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
487
|
+
|
|
488
|
+
type Member = { id: string; name: string };
|
|
489
|
+
|
|
490
|
+
const team: Member[] = [
|
|
491
|
+
{ id: 'u1', name: 'Sofia Esposito' },
|
|
492
|
+
{ id: 'u2', name: 'Marco Bianchi' },
|
|
493
|
+
{ id: 'u3', name: 'Aisha Khan' },
|
|
494
|
+
{ id: 'u4', name: 'Leo Rossi' },
|
|
495
|
+
];
|
|
496
|
+
|
|
497
|
+
// A pipeline group: `items` is an async getter resolved through
|
|
498
|
+
// `itemText` / `itemValue`. It runs lazily on the menu's first open, never on
|
|
499
|
+
// mount, and again whenever `dependencies` change. `v-model` surfaces the
|
|
500
|
+
// selected `itemValue`s. Signature matches the non-query provider shape
|
|
501
|
+
// (prefill is always `true` here — menus have no search field).
|
|
502
|
+
const items: BbDropdownItem[] = [
|
|
503
|
+
{
|
|
504
|
+
key: 'assignees',
|
|
505
|
+
label: 'Assign to',
|
|
506
|
+
selectable: true,
|
|
507
|
+
multiple: true,
|
|
508
|
+
max: 3,
|
|
509
|
+
itemText: 'name',
|
|
510
|
+
itemValue: 'id',
|
|
511
|
+
items: async (_prefill: boolean, _modelValue?: string[]) => {
|
|
512
|
+
await new Promise((resolve) => setTimeout(resolve, 400));
|
|
513
|
+
return team;
|
|
514
|
+
},
|
|
557
515
|
},
|
|
558
|
-
|
|
559
|
-
|
|
516
|
+
];
|
|
517
|
+
|
|
518
|
+
const assignees = ref<string[]>([]);
|
|
519
|
+
</script>
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
Tie a pipeline group to other state with `dependencies`: when any entry
|
|
523
|
+
changes, the getter re-runs (debounced by `depsDebounceTime`), and with
|
|
524
|
+
`enforceCoherence` any pick missing from the fresh items is dropped from the
|
|
525
|
+
selection and the companion's `v-model`. Because `dependencies` lives inside
|
|
526
|
+
the group's config, declare the `items` array as a `computed` so it
|
|
527
|
+
re-evaluates when the source state changes. Coherence stays lazy — a group
|
|
528
|
+
that was never opened never fetches, and never prunes; pruning also never
|
|
529
|
+
runs against an empty or still-loading item set, so a slow refetch can't wipe
|
|
530
|
+
a valid selection.
|
|
560
531
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
532
|
+
**Dependent options that stay coherent**
|
|
533
|
+
|
|
534
|
+
```vue
|
|
535
|
+
<template>
|
|
536
|
+
<div
|
|
537
|
+
class="flex max-w-md flex-wrap items-center gap-2 rounded-[var(--bb-radius)] border p-2"
|
|
538
|
+
>
|
|
539
|
+
<span class="pr-1 text-xs font-medium text-[color:var(--bb-text-muted)]"
|
|
540
|
+
>Board</span
|
|
541
|
+
>
|
|
542
|
+
<BbDropdown
|
|
543
|
+
:adaptive="false"
|
|
544
|
+
:items="menu"
|
|
545
|
+
loading-text="Loading members…"
|
|
546
|
+
:width="230"
|
|
547
|
+
>
|
|
548
|
+
<template #activator="{ props, loading }">
|
|
549
|
+
<BbButton
|
|
550
|
+
v-bind="props"
|
|
551
|
+
append:icon="lucide:list-filter"
|
|
552
|
+
:loading="loading"
|
|
553
|
+
size="xs"
|
|
554
|
+
variant="outline"
|
|
555
|
+
>
|
|
556
|
+
Filter
|
|
557
|
+
</BbButton>
|
|
558
|
+
</template>
|
|
559
|
+
<BbDropdownGroup id="board" v-model="board" />
|
|
560
|
+
<BbDropdownGroup id="assignees" v-model="assignees" />
|
|
561
|
+
</BbDropdown>
|
|
562
|
+
<span class="text-xs text-[color:var(--bb-text-muted)]">
|
|
563
|
+
<span data-board>{{ board ?? 'all boards' }}</span> ·
|
|
564
|
+
<span data-assignees>{{ assigneeNames || 'anyone' }}</span>
|
|
565
|
+
</span>
|
|
566
|
+
</div>
|
|
567
|
+
</template>
|
|
568
|
+
<script setup lang="ts">
|
|
569
|
+
import { computed, ref } from 'vue';
|
|
570
|
+
import { BbButton, BbDropdown, BbDropdownGroup } from 'bitboss-ui';
|
|
571
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
572
|
+
|
|
573
|
+
type Member = { id: string; name: string; boards: string[] };
|
|
574
|
+
|
|
575
|
+
const members: Member[] = [
|
|
576
|
+
{ id: 'u1', name: 'Sofia Esposito', boards: ['website'] },
|
|
577
|
+
{ id: 'u2', name: 'Marco Bianchi', boards: ['website', 'mobile-app'] },
|
|
578
|
+
{ id: 'u3', name: 'Aisha Khan', boards: ['mobile-app'] },
|
|
579
|
+
{ id: 'u4', name: 'Leo Rossi', boards: ['mobile-app'] },
|
|
580
|
+
];
|
|
581
|
+
|
|
582
|
+
const board = ref<string | null>('website');
|
|
583
|
+
const assignees = ref<string[]>([]);
|
|
584
|
+
|
|
585
|
+
// Dropdown pipeline getter signature: `(prefill, modelValue)` — the non-query
|
|
586
|
+
// provider shape, shared with BbTable and the checkbox/radio/switch groups.
|
|
587
|
+
// `prefill` is `true` on every fetch (only a user-typed query reads `false`,
|
|
588
|
+
// and a menu has no search field); `modelValue` is the group's selection. Read
|
|
589
|
+
// anything else (the board) from your own refs.
|
|
590
|
+
const loadMembers = (
|
|
591
|
+
_prefill: boolean,
|
|
592
|
+
_modelValue?: string[]
|
|
593
|
+
): Promise<Member[]> =>
|
|
594
|
+
new Promise((resolve) => {
|
|
595
|
+
setTimeout(
|
|
596
|
+
() =>
|
|
597
|
+
resolve(
|
|
598
|
+
members.filter((member) => member.boards.includes(board.value ?? ''))
|
|
599
|
+
),
|
|
600
|
+
300
|
|
601
|
+
);
|
|
602
|
+
});
|
|
564
603
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
604
|
+
// `items` is a computed so the assignee group's `dependencies` re-evaluates
|
|
605
|
+
// when the board changes — that change is what schedules the debounced
|
|
606
|
+
// refetch. `enforceCoherence` then drops picks missing from the fresh items.
|
|
607
|
+
const menu = computed<BbDropdownItem[]>(() => [
|
|
568
608
|
{
|
|
569
|
-
|
|
570
|
-
|
|
609
|
+
key: 'board',
|
|
610
|
+
label: 'Board',
|
|
611
|
+
selectable: true,
|
|
612
|
+
items: [
|
|
613
|
+
{ key: 'website', text: 'Website' },
|
|
614
|
+
{ key: 'mobile-app', text: 'Mobile app' },
|
|
615
|
+
],
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
key: 'assignees',
|
|
619
|
+
label: 'Assignee',
|
|
620
|
+
selectable: true,
|
|
621
|
+
multiple: true,
|
|
622
|
+
itemText: 'name',
|
|
623
|
+
itemValue: 'id',
|
|
624
|
+
items: loadMembers,
|
|
625
|
+
dependencies: [board.value],
|
|
626
|
+
depsDebounceTime: 150,
|
|
627
|
+
enforceCoherence: true,
|
|
628
|
+
},
|
|
629
|
+
]);
|
|
630
|
+
|
|
631
|
+
const assigneeNames = computed(() =>
|
|
632
|
+
members
|
|
633
|
+
.filter((member) => assignees.value.includes(member.id))
|
|
634
|
+
.map((member) => member.name.split(' ')[0])
|
|
635
|
+
.join(', ')
|
|
571
636
|
);
|
|
572
|
-
const parsedWidth = computed(() => {
|
|
573
|
-
if (props.width === 'auto') return undefined;
|
|
574
|
-
if (props.width) {
|
|
575
|
-
const { value, unit } = parseWidthString(props.width);
|
|
576
|
-
if (unit === '%') {
|
|
577
|
-
if (!activatorDom.value) return '0px';
|
|
578
|
-
return `${activatorWidth.value * (value / 100)}px`;
|
|
579
|
-
}
|
|
580
|
-
return `${value}px`;
|
|
581
|
-
}
|
|
582
|
-
return '0px';
|
|
583
|
-
});
|
|
584
637
|
</script>
|
|
585
|
-
|
|
586
|
-
<style lang="postcss">
|
|
587
|
-
@import './index.css';
|
|
588
|
-
</style>
|
|
589
638
|
```
|
|
590
639
|
|
|
591
|
-
|
|
640
|
+
### Reading a dropdown from anywhere: `useBbDropdownContext`
|
|
641
|
+
|
|
642
|
+
Give the dropdown an explicit `id` and any component — no shared parent needed —
|
|
643
|
+
can read its live state. This is how you render **filter chips outside the menu
|
|
644
|
+
without a second fetch**: the dropdown already resolved each pick's label when
|
|
645
|
+
the user chose it, so the context hands it back.
|
|
592
646
|
|
|
593
647
|
```ts
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
import type { IconType } from '@/types/Icon';
|
|
597
|
-
|
|
598
|
-
export type DropdownTrigger = 'click' | 'contextMenu';
|
|
599
|
-
|
|
600
|
-
export type InternalItem = Omit<BaseButtonProps, 'block' | 'tag' | 'type'> & {
|
|
601
|
-
/**
|
|
602
|
-
* Click handler of the item.
|
|
603
|
-
*/
|
|
604
|
-
onClick?: (...args: any[]) => any;
|
|
605
|
-
/**
|
|
606
|
-
* Key used to identify the element.
|
|
607
|
-
*/
|
|
608
|
-
key: string;
|
|
609
|
-
/**
|
|
610
|
-
* Icon to be displayed before the text.
|
|
611
|
-
*/
|
|
612
|
-
'prepend:icon'?: IconType;
|
|
613
|
-
/**
|
|
614
|
-
* Icon to be displayed after the text.
|
|
615
|
-
*/
|
|
616
|
-
'append:icon'?: IconType;
|
|
617
|
-
};
|
|
648
|
+
const { isReady, open, groups } = useBbDropdownContext('invoice-filters');
|
|
649
|
+
```
|
|
618
650
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
* The two shapes can be mixed, e.g. `[item, item, [item, item], item]`.
|
|
623
|
-
*/
|
|
624
|
-
export type Item = InternalItem | InternalItem[];
|
|
625
|
-
|
|
626
|
-
/** Unwraps the item type out of the (possibly nested) {@link InternalItem} shape. */
|
|
627
|
-
export type FlatItem<T> = T extends (infer U)[] ? U : T;
|
|
628
|
-
|
|
629
|
-
export type MappedItem = InternalItem & {
|
|
630
|
-
/**
|
|
631
|
-
* Identifier of the element among its siblings.
|
|
632
|
-
*/
|
|
633
|
-
id: string;
|
|
634
|
-
/**
|
|
635
|
-
* Keydown event used to handle accessibility.
|
|
636
|
-
*/
|
|
637
|
-
onKeydown: (event: KeyboardEvent) => void;
|
|
638
|
-
};
|
|
651
|
+
- `isReady` — a dropdown with that id is mounted.
|
|
652
|
+
- `open` — the panel/sheet is open.
|
|
653
|
+
- `groups` — one entry per **selectable** group, keyed by group key.
|
|
639
654
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
| 'arrowPadding'
|
|
643
|
-
| 'disabled'
|
|
644
|
-
| 'eager'
|
|
645
|
-
| 'id'
|
|
646
|
-
| 'offset'
|
|
647
|
-
| 'padding'
|
|
648
|
-
| 'transitionDuration'
|
|
649
|
-
> & {
|
|
650
|
-
/**
|
|
651
|
-
* Position of the dropdown relative to the activator.
|
|
652
|
-
* Use `'cursor'` to anchor at the mouse/touch coordinates (hides arrow).
|
|
653
|
-
*
|
|
654
|
-
* @defaultValue `'bottom'`
|
|
655
|
-
*/
|
|
656
|
-
placement?: CommonProps['placement'] | 'cursor';
|
|
657
|
-
/**
|
|
658
|
-
* External activator element or component ref.
|
|
659
|
-
* When provided, the activator slot is not rendered and event listeners
|
|
660
|
-
* are attached programmatically to the referenced element.
|
|
661
|
-
*/
|
|
662
|
-
activator?: HTMLElement | Record<string, any> | null;
|
|
663
|
-
/**
|
|
664
|
-
* Constrains the dropdown within a bounding element.
|
|
665
|
-
* Accepts an HTMLElement, a Vue component ref, or a CSS selector string.
|
|
666
|
-
*/
|
|
667
|
-
boundary?: HTMLElement | Record<string, any> | string | null;
|
|
668
|
-
/**
|
|
669
|
-
* Array used to render each dropdown button.
|
|
670
|
-
* They can act as `button`, as `a`, or as `router-link`
|
|
671
|
-
* as they are based on the functionality provided by `BaseButton`.
|
|
672
|
-
*
|
|
673
|
-
* Pass a flat array for a single group, or nest arrays to split the items
|
|
674
|
-
* into divider-separated groups. The two shapes can be mixed, e.g.
|
|
675
|
-
* `[item, item, [item, item], item]`.
|
|
676
|
-
*/
|
|
677
|
-
items: Item[];
|
|
678
|
-
/**
|
|
679
|
-
* Name of the theme to apply to the component. It creates a CSS class with the name of the theme.
|
|
680
|
-
*
|
|
681
|
-
* @deprecated since the popover is local you should use a normal css class applied to the top level element
|
|
682
|
-
* @defaultValue `'default'`
|
|
683
|
-
*/
|
|
684
|
-
theme?: string;
|
|
685
|
-
/**
|
|
686
|
-
* Interaction(s) that open the dropdown.
|
|
687
|
-
* Accepts a single trigger or an array to combine them.
|
|
688
|
-
* - `'click'` — left-click / tap (default)
|
|
689
|
-
* - `'contextMenu'` — right-click on desktop, long-press on mobile
|
|
690
|
-
*
|
|
691
|
-
* @defaultValue `'click'`
|
|
692
|
-
*/
|
|
693
|
-
trigger?: DropdownTrigger | DropdownTrigger[];
|
|
694
|
-
/**
|
|
695
|
-
* Width of the dropdown in pixels, percentage, or 'auto' to fit content.
|
|
696
|
-
*
|
|
697
|
-
* @defaultValue `'auto'`
|
|
698
|
-
*/
|
|
699
|
-
width?: number | string;
|
|
700
|
-
};
|
|
655
|
+
Each entry is **the group exactly as you declared it, with live state on top**,
|
|
656
|
+
so a chip can be driven entirely from the group config:
|
|
701
657
|
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
ref: (reference: unknown) => void;
|
|
706
|
-
};
|
|
658
|
+
| From your config | Added live |
|
|
659
|
+
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
660
|
+
| `key`, `label`, `hideLabel`, `max`, `filterBy`, `prepend:icon`, `variant`, … | `value` (the `v-model`), `selectedOptions`, `multiple`, `selectable`, `loading` |
|
|
707
661
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
/** Whether the dropdown is globally disabled. */
|
|
713
|
-
disabled?: boolean;
|
|
714
|
-
/** Whether the dropdown panel is currently open. */
|
|
715
|
-
open: boolean;
|
|
716
|
-
/** The current placement of the dropdown panel. */
|
|
717
|
-
placement: BbDropdownProps['placement'];
|
|
718
|
-
};
|
|
662
|
+
`selectedOptions` is `{ value, text?, original? }[]`. `value` is always there;
|
|
663
|
+
`text`/`original` fill in once the owning group has the item — so use
|
|
664
|
+
`hideLabel` when a group's name is already shown by its parent category but you
|
|
665
|
+
still want a chip prefix.
|
|
719
666
|
|
|
720
|
-
|
|
721
|
-
export type BbDropdownEdgeSlotProps = {
|
|
722
|
-
/** Whether the dropdown is globally disabled. */
|
|
723
|
-
disabled?: boolean;
|
|
724
|
-
/** Whether the dropdown panel is currently open. */
|
|
725
|
-
open: boolean;
|
|
726
|
-
/** The current placement of the dropdown panel. */
|
|
727
|
-
placement: BbDropdownProps['placement'];
|
|
728
|
-
};
|
|
667
|
+
Two rules worth knowing:
|
|
729
668
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
669
|
+
- **It is read-only.** To change a selection, write to that group's own
|
|
670
|
+
`v-model` — the context never mutates.
|
|
671
|
+
- **It is lazy.** Reading never triggers a fetch, so a seeded value in a
|
|
672
|
+
search-first group stays `{ value }` (no label) until that group loads. Set
|
|
673
|
+
`prefill: true` on the group to resolve a seeded selection eagerly.
|
|
674
|
+
|
|
675
|
+
`items` is the one field not carried through: on a pipeline group it is a
|
|
676
|
+
fetcher, and a state snapshot must never invite a fetch. `selectedOptions` is
|
|
677
|
+
its resolved counterpart.
|
|
678
|
+
|
|
679
|
+
### Per-item and per-group slots
|
|
680
|
+
|
|
681
|
+
Every row (and every titled group header) can be customized without leaving
|
|
682
|
+
the config-driven model:
|
|
683
|
+
|
|
684
|
+
- `item:prepend` / `item:append` — generic edge slots rendered before/after
|
|
685
|
+
**every** row's content, and inside group headers too (there the payload's
|
|
686
|
+
`item` is the group descriptor).
|
|
687
|
+
- `#<key>` — a named slot for one specific entry, matched by its `key`
|
|
688
|
+
(sanitized: non-alphanumeric runs become underscores, dashes are kept,
|
|
689
|
+
lowercased — key `"Delete file"` → slot `#delete_file`, key `"delete-file"`
|
|
690
|
+
→ slot `#delete-file`). It replaces the entry's label
|
|
691
|
+
region; `#<key>:prepend` / `#<key>:append` replace just its leading/trailing
|
|
692
|
+
region. Per-key slots win over the generic ones, which win over
|
|
693
|
+
`prepend:icon` / `append:icon`. In pipeline groups the slot name derives
|
|
694
|
+
from the item's resolved `item-value` instead.
|
|
695
|
+
|
|
696
|
+
The payload is one-way: `{ item, index, text, description, selected, loading,
|
|
697
|
+
disabled, open, placement }`. There are no callbacks in it — clicks and
|
|
698
|
+
selection stay wired by the dropdown itself, so keep slot content
|
|
699
|
+
presentational. There is **no** generic `#item` slot; to restyle every row use
|
|
700
|
+
the edge slots, to replace one row's content use its key.
|
|
701
|
+
|
|
702
|
+
**Status dots and a per-row badge**
|
|
745
703
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
704
|
+
```vue
|
|
705
|
+
<template>
|
|
706
|
+
<div
|
|
707
|
+
class="flex max-w-xs items-center gap-2 rounded-[var(--bb-radius)] border p-2"
|
|
708
|
+
>
|
|
709
|
+
<span class="text-xs font-medium text-[color:var(--bb-text-muted)]"
|
|
710
|
+
>Workspace</span
|
|
711
|
+
>
|
|
712
|
+
<!-- `adaptive` is pinned off so the demo behaves identically on any
|
|
713
|
+
viewport; leave it at the project default in real apps. -->
|
|
714
|
+
<BbDropdown :adaptive="false" :items="items" :width="200">
|
|
715
|
+
<template #activator="{ props }">
|
|
716
|
+
<BbButton
|
|
717
|
+
v-bind="props"
|
|
718
|
+
append:icon="lucide:chevron-down"
|
|
719
|
+
size="xs"
|
|
720
|
+
variant="outline"
|
|
721
|
+
>
|
|
722
|
+
Acme Inc
|
|
723
|
+
</BbButton>
|
|
724
|
+
</template>
|
|
725
|
+
|
|
726
|
+
<!-- Generic edge slot: rendered before EVERY row's content
|
|
727
|
+
(and inside group headers). Payload is read-only. -->
|
|
728
|
+
<template #item:prepend="{ item }">
|
|
729
|
+
<BbIcon
|
|
730
|
+
class="text-[color:var(--bb-text-muted)]"
|
|
731
|
+
data-env-dot
|
|
732
|
+
:icon="envIcon(item.key)"
|
|
733
|
+
size="xs"
|
|
734
|
+
/>
|
|
735
|
+
</template>
|
|
736
|
+
|
|
737
|
+
<!-- Per-key slot: replaces just this row's label region. The name is
|
|
738
|
+
the item's `key` (sanitized: non-alphanumerics become underscores). -->
|
|
739
|
+
<template #billing="{ text }">
|
|
740
|
+
<span class="flex flex-1 items-center justify-between gap-2 text-left">
|
|
741
|
+
{{ text }}
|
|
742
|
+
<BbBadge variant="soft-amber">3 due</BbBadge>
|
|
743
|
+
</span>
|
|
744
|
+
</template>
|
|
745
|
+
</BbDropdown>
|
|
746
|
+
</div>
|
|
747
|
+
</template>
|
|
748
|
+
<script setup lang="ts">
|
|
749
|
+
import { BbBadge, BbButton, BbDropdown, BbIcon } from 'bitboss-ui';
|
|
750
|
+
import type { BbDropdownItem, IconType } from 'bitboss-ui';
|
|
751
|
+
|
|
752
|
+
const items: BbDropdownItem[] = [
|
|
753
|
+
{ key: 'production', text: 'Production', href: '#production' },
|
|
754
|
+
{ key: 'staging', text: 'Staging', href: '#staging' },
|
|
755
|
+
[{ key: 'billing', text: 'Billing', href: '#billing' }],
|
|
756
|
+
];
|
|
757
|
+
|
|
758
|
+
/** Status glyph per workspace row — color inherits via currentColor. */
|
|
759
|
+
const envIcon = (key: string): IconType => {
|
|
760
|
+
if (key === 'production') return 'lucide:circle-check';
|
|
761
|
+
if (key === 'staging') return 'lucide:circle-dashed';
|
|
762
|
+
return 'lucide:circle';
|
|
772
763
|
};
|
|
773
|
-
|
|
764
|
+
</script>
|
|
774
765
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
.bb-dropdown__divider {
|
|
787
|
-
/* Negative inline margins cancel the container padding so the rule
|
|
788
|
-
* spans the full width of the dropdown panel, edge to edge. */
|
|
789
|
-
border: none;
|
|
790
|
-
border-top: 1px solid color-mix(in srgb, var(--bb-text) 15%, transparent);
|
|
791
|
-
height: 0;
|
|
792
|
-
margin: 6px -6px;
|
|
793
|
-
}
|
|
794
|
-
.bb-dropdown__item {
|
|
795
|
-
border-radius: var(--bb-radius);
|
|
796
|
-
column-gap: 6px;
|
|
797
|
-
display: inline-flex;
|
|
798
|
-
align-items: center;
|
|
799
|
-
padding: 6px 8px;
|
|
800
|
-
text-align: left;
|
|
801
|
-
min-width: 100px;
|
|
802
|
-
|
|
803
|
-
&:hover {
|
|
804
|
-
background-color: color-mix(in srgb, var(--bb-text) 5%, transparent);
|
|
805
|
-
}
|
|
806
|
-
&:focus {
|
|
807
|
-
background-color: color-mix(in srgb, var(--bb-text) 15%, transparent);
|
|
808
|
-
}
|
|
809
|
-
.item__prepend-icon,
|
|
810
|
-
.item__append-icon {
|
|
811
|
-
flex-shrink: 0;
|
|
812
|
-
}
|
|
813
|
-
.item__content {
|
|
814
|
-
flex: auto;
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
}
|
|
766
|
+
<!-- Non-scoped on purpose: styles the child badge's soft variant (scoped CSS
|
|
767
|
+
can't reach it without :deep). Canonical palette:
|
|
768
|
+
ai/guides/design-language.md § Using color. -->
|
|
769
|
+
<style>
|
|
770
|
+
.bb-badge.bb-badge--soft-amber {
|
|
771
|
+
--accent: #d97706;
|
|
772
|
+
--bg: color-mix(in oklab, var(--accent) 15%, var(--bb-panel));
|
|
773
|
+
--color: color-mix(in oklab, var(--accent) 80%, var(--bb-text));
|
|
774
|
+
--border-width: 1px;
|
|
775
|
+
--border-color: color-mix(in oklab, var(--accent) 25%, var(--bb-panel));
|
|
776
|
+
--ring: color-mix(in oklab, var(--accent) 45%, transparent);
|
|
818
777
|
}
|
|
778
|
+
</style>
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
### Header and footer
|
|
782
|
+
|
|
783
|
+
`header` and `footer` slots (payload: `{ open, disabled, placement }`) pin
|
|
784
|
+
content above and below the scrolling items, each separated by a divider. Use
|
|
785
|
+
the header for a title or a filter field and the footer for a persistent
|
|
786
|
+
action — they stay put while the list scrolls. On the mobile sheet they become
|
|
787
|
+
the sheet's pinned header and footer.
|
|
788
|
+
|
|
789
|
+
**Pinned header and footer**
|
|
790
|
+
|
|
791
|
+
```vue
|
|
792
|
+
<BbDropdown
|
|
793
|
+
:items="[
|
|
794
|
+
{ key: 'jan', text: 'January', href: '#jan' },
|
|
795
|
+
{ key: 'feb', text: 'February', href: '#feb' },
|
|
796
|
+
{ key: 'mar', text: 'March', href: '#mar' },
|
|
797
|
+
]"
|
|
798
|
+
:width="240"
|
|
799
|
+
>
|
|
800
|
+
<template #activator="{ props }">
|
|
801
|
+
<BbButton
|
|
802
|
+
v-bind="props"
|
|
803
|
+
append:icon="lucide:chevron-down"
|
|
804
|
+
variant="outline"
|
|
805
|
+
>
|
|
806
|
+
Period
|
|
807
|
+
</BbButton>
|
|
808
|
+
</template>
|
|
809
|
+
<template #header>
|
|
810
|
+
<div class="px-3 py-2 text-xs font-semibold text-[color:var(--bb-text-muted)]">
|
|
811
|
+
Jump to month
|
|
812
|
+
</div>
|
|
813
|
+
</template>
|
|
814
|
+
<template #footer>
|
|
815
|
+
<div class="p-2">
|
|
816
|
+
<BbButton block href="#calendar" size="sm" variant="ghost">
|
|
817
|
+
Open calendar
|
|
818
|
+
</BbButton>
|
|
819
|
+
</div>
|
|
820
|
+
</template>
|
|
821
|
+
</BbDropdown>
|
|
819
822
|
```
|
|
823
|
+
|
|
824
|
+
### Right-click and cursor menus
|
|
825
|
+
|
|
826
|
+
Set `trigger` to `'contextMenu'` (or an array like `['click', 'contextMenu']`)
|
|
827
|
+
for an OS-style menu that opens on right-click — on touch devices the
|
|
828
|
+
equivalent is a **long-press** (about half a second, cancelled if the finger
|
|
829
|
+
drifts). Pair it with `placement="cursor"` to anchor the panel at the pointer
|
|
830
|
+
coordinates instead of the activator; right-clicking again while open moves
|
|
831
|
+
the menu to the new position. Everything else — items, selection, slots —
|
|
832
|
+
behaves exactly as with a click menu.
|
|
833
|
+
|
|
834
|
+
**Context menu at the cursor**
|
|
835
|
+
|
|
836
|
+
```vue
|
|
837
|
+
<template>
|
|
838
|
+
<div
|
|
839
|
+
class="flex max-w-sm items-center gap-2 rounded-[var(--bb-radius)] border p-2"
|
|
840
|
+
>
|
|
841
|
+
<div class="min-w-0 flex-1">
|
|
842
|
+
<p class="truncate text-sm font-medium">INV-2048</p>
|
|
843
|
+
<p class="text-xs text-[color:var(--bb-text-muted)]">
|
|
844
|
+
Northwind · €1,240.00 ·
|
|
845
|
+
<span data-last>{{ last }}</span>
|
|
846
|
+
</p>
|
|
847
|
+
</div>
|
|
848
|
+
<!-- `trigger: 'contextMenu'` opens on right-click / long-press;
|
|
849
|
+
`placement: 'cursor'` anchors the panel at the pointer. -->
|
|
850
|
+
<BbDropdown
|
|
851
|
+
:items="items"
|
|
852
|
+
placement="cursor"
|
|
853
|
+
:trigger="['click', 'contextMenu']"
|
|
854
|
+
:width="200"
|
|
855
|
+
>
|
|
856
|
+
<template #activator="{ props }">
|
|
857
|
+
<BbButton
|
|
858
|
+
v-bind="props"
|
|
859
|
+
aria-label="Invoice actions"
|
|
860
|
+
icon="lucide:ellipsis"
|
|
861
|
+
size="xs"
|
|
862
|
+
variant="ghost"
|
|
863
|
+
/>
|
|
864
|
+
</template>
|
|
865
|
+
</BbDropdown>
|
|
866
|
+
</div>
|
|
867
|
+
</template>
|
|
868
|
+
<script setup lang="ts">
|
|
869
|
+
import { ref } from 'vue';
|
|
870
|
+
import { BbButton, BbDropdown } from 'bitboss-ui';
|
|
871
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
872
|
+
|
|
873
|
+
const last = ref('Right-click the row');
|
|
874
|
+
|
|
875
|
+
const items: BbDropdownItem[] = [
|
|
876
|
+
{
|
|
877
|
+
key: 'download',
|
|
878
|
+
text: 'Download PDF',
|
|
879
|
+
'prepend:icon': 'lucide:download',
|
|
880
|
+
onClick: () => (last.value = 'Downloading'),
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
key: 'share',
|
|
884
|
+
text: 'Share link',
|
|
885
|
+
'prepend:icon': 'lucide:link',
|
|
886
|
+
href: '#share',
|
|
887
|
+
},
|
|
888
|
+
// A real delete would be `variant: 'destructive'` with an onClick that
|
|
889
|
+
// awaits useConfirm — see the mixed action menu example.
|
|
890
|
+
[
|
|
891
|
+
{
|
|
892
|
+
key: 'trash',
|
|
893
|
+
text: 'Move to trash',
|
|
894
|
+
'prepend:icon': 'lucide:trash-2',
|
|
895
|
+
onClick: () => (last.value = 'Moved to trash'),
|
|
896
|
+
},
|
|
897
|
+
],
|
|
898
|
+
];
|
|
899
|
+
</script>
|
|
900
|
+
```
|
|
901
|
+
|
|
902
|
+
### Placement, width and boundaries
|
|
903
|
+
|
|
904
|
+
- `placement` (default `'bottom'`) accepts every floating-UI placement
|
|
905
|
+
(`top`, `bottom-start`, `right-end`, …) plus `'cursor'`; the panel flips
|
|
906
|
+
automatically when there's no room, and the item list caps its height to the
|
|
907
|
+
available space (scrolling inside).
|
|
908
|
+
- `width` — `'auto'` (default) sizes to content with a 128px floor; a number
|
|
909
|
+
is pixels; a percentage is relative to the **anchor's width**, so
|
|
910
|
+
`width="100%"` makes the menu match its trigger.
|
|
911
|
+
- `anchor` — an element or component ref the panel positions against instead of
|
|
912
|
+
the activator, for when the trigger is only part of a larger control: a split
|
|
913
|
+
button whose right half opens a menu aligned to (and as wide as) the pair.
|
|
914
|
+
`placement` and a percentage `width` both resolve against it. Ignored when
|
|
915
|
+
`placement` is `'cursor'`.
|
|
916
|
+
- `offset` (gap from the anchor), `padding` (minimum space kept from the
|
|
917
|
+
viewport edge), and `boundary` (an element, component ref, or CSS selector
|
|
918
|
+
that confines the panel) tune positioning; `eager` pre-renders the panel
|
|
919
|
+
before first open; `transitionDuration` controls the open/close animation.
|
|
920
|
+
- The menu closes itself on outside click/focus, on `Escape`, when another
|
|
921
|
+
dropdown opens, and when the activator scrolls out of view. `disabled`
|
|
922
|
+
freezes the whole component.
|
|
923
|
+
|
|
924
|
+
**Menu as wide as its trigger**
|
|
925
|
+
|
|
926
|
+
```vue
|
|
927
|
+
<BbDropdown
|
|
928
|
+
placement="bottom-start"
|
|
929
|
+
width="100%"
|
|
930
|
+
:items="[
|
|
931
|
+
{
|
|
932
|
+
key: 'starter',
|
|
933
|
+
text: 'Starter',
|
|
934
|
+
description: 'For side projects',
|
|
935
|
+
href: '#starter',
|
|
936
|
+
},
|
|
937
|
+
{ key: 'pro', text: 'Pro', description: 'For growing teams', href: '#pro' },
|
|
938
|
+
{
|
|
939
|
+
key: 'enterprise',
|
|
940
|
+
text: 'Enterprise',
|
|
941
|
+
description: 'Custom contracts',
|
|
942
|
+
href: '#enterprise',
|
|
943
|
+
},
|
|
944
|
+
]"
|
|
945
|
+
>
|
|
946
|
+
<template #activator="{ props }">
|
|
947
|
+
<BbButton
|
|
948
|
+
v-bind="props"
|
|
949
|
+
append:icon="lucide:chevrons-up-down"
|
|
950
|
+
block
|
|
951
|
+
class="w-72"
|
|
952
|
+
variant="outline"
|
|
953
|
+
>
|
|
954
|
+
Choose a plan
|
|
955
|
+
</BbButton>
|
|
956
|
+
</template>
|
|
957
|
+
</BbDropdown>
|
|
958
|
+
```
|
|
959
|
+
|
|
960
|
+
### The v-bb-dropdown directive
|
|
961
|
+
|
|
962
|
+
**Default to the directive.** When the menu is just an `items` array on a
|
|
963
|
+
trigger you already have, attach the `v-bb-dropdown` directive instead of
|
|
964
|
+
importing `BbDropdown` and wiring an activator — no import, no wrapper element.
|
|
965
|
+
It is registered globally while the plugin config's `injectDirectives` stays on
|
|
966
|
+
(the default; otherwise register it with `app.use(BbDropdownDirectivePlugin)`,
|
|
967
|
+
optionally passing a custom name). The value is either:
|
|
968
|
+
|
|
969
|
+
- an **items array** — used directly as the menu's items, or
|
|
970
|
+
- an **object of `BbDropdown` props** with a required `items` — e.g.
|
|
971
|
+
`{ items, trigger: 'contextMenu', placement: 'cursor', width: 240 }`.
|
|
972
|
+
|
|
973
|
+
The directive argument is a placement shorthand (`v-bb-dropdown:bottom-end`)
|
|
974
|
+
and wins over a `placement` in the object. Trigger, ARIA and keyboard wiring
|
|
975
|
+
attach to the host element directly, so use it on a real focusable element.
|
|
976
|
+
Reach for the full component when you need `header`/`footer` slots, per-item
|
|
977
|
+
slots, or `<BbDropdownGroup>` companions — the directive can't express those.
|
|
978
|
+
(The component's `activator` prop offers the same "no wrapper" wiring when you
|
|
979
|
+
already hold an element or component ref: the activator slot is skipped and
|
|
980
|
+
listeners attach to the referenced element. ARIA — `aria-haspopup`,
|
|
981
|
+
`aria-expanded`, `aria-controls` — attaches programmatically to that element
|
|
982
|
+
too, the same as it would to the slot's `props`; don't hand-write your own
|
|
983
|
+
`aria-*` attributes on it, or you get a double-set conflict.)
|
|
984
|
+
|
|
985
|
+
**Menu on any element, no wrapper**
|
|
986
|
+
|
|
987
|
+
```vue
|
|
988
|
+
<BbButton
|
|
989
|
+
v-bb-dropdown="[
|
|
990
|
+
{ key: 'profile', text: 'View profile', href: '#profile' },
|
|
991
|
+
{
|
|
992
|
+
key: 'settings',
|
|
993
|
+
text: 'Settings',
|
|
994
|
+
'prepend:icon': 'lucide:settings',
|
|
995
|
+
href: '#settings',
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
key: 'signout',
|
|
999
|
+
text: 'Sign out',
|
|
1000
|
+
variant: 'destructive',
|
|
1001
|
+
href: '#signout',
|
|
1002
|
+
},
|
|
1003
|
+
]"
|
|
1004
|
+
append:icon="lucide:chevron-down"
|
|
1005
|
+
variant="outline"
|
|
1006
|
+
>
|
|
1007
|
+
Account
|
|
1008
|
+
</BbButton>
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
### Mobile: the adaptive sheet
|
|
1012
|
+
|
|
1013
|
+
On viewports below the config's `mobileMaxWidth`, the menu renders as a
|
|
1014
|
+
bottom-anchored, draggable, auto-sized off-canvas sheet instead of a flyout.
|
|
1015
|
+
Nested submenus become drill-down levels with a back control (the parent
|
|
1016
|
+
item's text becomes the level title); selection, slots and events behave
|
|
1017
|
+
exactly as on desktop. The surface is **latched per open**: resizing
|
|
1018
|
+
mid-session never swaps a live menu between flyout and sheet.
|
|
1019
|
+
|
|
1020
|
+
- The default comes from the global `config.adaptive` (`true`); the `adaptive`
|
|
1021
|
+
prop overrides it per component. Pin `:adaptive="false"` when a menu must
|
|
1022
|
+
stay a flyout everywhere — e.g. deterministic UI tests or dense desktop-only
|
|
1023
|
+
tooling.
|
|
1024
|
+
- `offCanvasProps` forwards overrides to the underlying `BbOffCanvas` (merged
|
|
1025
|
+
over `direction: 'bottom'`, `size: 'auto'`, `draggable: true`); it is
|
|
1026
|
+
ignored when `adaptive` resolves to `false`.
|
|
1027
|
+
|
|
1028
|
+
### Works well with
|
|
1029
|
+
|
|
1030
|
+
- `BbDropdownButton` — the same `items` model behind a split button when one
|
|
1031
|
+
action dominates.
|
|
1032
|
+
- [useConfirm](./composables/useConfirm.md) — a `variant: 'destructive'`
|
|
1033
|
+
item's `onClick` should `await confirm(...)` before acting.
|
|
1034
|
+
- `BbTable` — a per-row overflow "…" menu (icon-only `BbButton` activator) or
|
|
1035
|
+
a `trigger="contextMenu"` menu on the row itself.
|
|
1036
|
+
- `BbAvatar` in the activator for account menus; `BbBadge` in per-item slots
|
|
1037
|
+
for counts (see the slots example).
|
|
1038
|
+
- [useToast](./composables/useToast.md) — fire a toast from an item's
|
|
1039
|
+
`onClick` once background work settles.
|
|
1040
|
+
|
|
1041
|
+
### Gotchas and anti-patterns
|
|
1042
|
+
|
|
1043
|
+
- **Don't navigate from `onClick`** (`router.push`, `window.location`) — give
|
|
1044
|
+
the item `href`/`to` and let it render a real link.
|
|
1045
|
+
- **Don't rebuild selection** with `onClick` + your own state — mark the group
|
|
1046
|
+
`selectable` and bind a `<BbDropdownGroup v-model>`.
|
|
1047
|
+
- **There is no `#item` slot** — a template slot named `item` renders nothing.
|
|
1048
|
+
Use `item:prepend`/`item:append` or a per-key slot.
|
|
1049
|
+
- `width` defaults to `'auto'` (content-sized, ≥128px) — not a fixed pixel
|
|
1050
|
+
width; pass a number when menus must align across rows.
|
|
1051
|
+
- Item `variant`s other than `destructive` render only a class hook — register
|
|
1052
|
+
names via the `dropdownItemVariants` plugin option and ship their CSS.
|
|
1053
|
+
- `<BbDropdownGroup>` must sit in a `BbDropdown` (or `BbDropdownButton`)
|
|
1054
|
+
default slot, its `id` must match a group `key`, and a `multiple` group's
|
|
1055
|
+
model must be an array — all three misuses throw.
|
|
1056
|
+
- Placeholder texts default to the config locale's "Loading…" / "No results"
|
|
1057
|
+
strings (`locale` plugin option) unless you set `loading-text` /
|
|
1058
|
+
`no-data-text`.
|
|
1059
|
+
|
|
1060
|
+
### Accessibility
|
|
1061
|
+
|
|
1062
|
+
- The activator gets `aria-haspopup="menu"`, `aria-expanded` and (once opened)
|
|
1063
|
+
`aria-controls` wired automatically — always spread the slot `props` onto a
|
|
1064
|
+
real focusable element (a `<button>`; `BbButton` qualifies). An existing
|
|
1065
|
+
`id` on your element is adopted, never overwritten. The `activator` **prop**
|
|
1066
|
+
path gets the same three attributes, attached programmatically to the
|
|
1067
|
+
referenced element — don't hand-write your own `aria-*` there either; it's
|
|
1068
|
+
the same double-set conflict as skipping the slot `props`.
|
|
1069
|
+
- An icon-only trigger still needs an `aria-label` (see the nested-menu
|
|
1070
|
+
example).
|
|
1071
|
+
- The panel is a `role="menu"` labelled by the activator; rows render as
|
|
1072
|
+
`menuitem`, or `menuitemradio` / `menuitemcheckbox` with `aria-checked` in
|
|
1073
|
+
selectable groups; submenu openers carry their own `aria-haspopup` /
|
|
1074
|
+
`aria-expanded`.
|
|
1075
|
+
- Keyboard is fully handled — don't add your own handlers: `ArrowDown` /
|
|
1076
|
+
`ArrowUp` on the trigger open the menu focusing the first/last item; inside,
|
|
1077
|
+
arrows rove (skipping disabled rows, wrapping), `Home`/`End` jump,
|
|
1078
|
+
`ArrowRight` enters a submenu, `ArrowLeft` closes the level (or navigates
|
|
1079
|
+
back in the sheet), `Escape` closes and refocuses the trigger. Focus returns
|
|
1080
|
+
to the activator after an action unless the action moved it (e.g. opened a
|
|
1081
|
+
dialog).
|
|
1082
|
+
|
|
1083
|
+
## Props
|
|
1084
|
+
|
|
1085
|
+
| Prop | Type | Default | Required | Description |
|
|
1086
|
+
| --- | --- | --- | --- | --- |
|
|
1087
|
+
| `activator` | `Record<string, any> \| HTMLElement \| null \| undefined` | | | External activator element or component ref. When provided, the activator slot is not rendered and event listeners are attached programmatically to the referenced element. ARIA (`aria-haspopup`/`aria-expanded`/`aria-controls`) is attached p… |
|
|
1088
|
+
| `adaptive` | `boolean \| undefined` | `undefined` | | On mobile viewports (below `config.mobileMaxWidth`), render the dropdown as a bottom-anchored, auto-sized off-canvas sheet that **navigates** through nested submenus (drilling one level at a time with a back control) instead of showing hove… |
|
|
1089
|
+
| `anchor` | `Record<string, any> \| HTMLElement \| null \| undefined` | | | Element the panel positions itself against, when it should differ from the activator — e.g. a wrapper that the activator is only a part of, so the menu aligns to the whole control while a single button opens it. Accepts an HTMLElement or a … |
|
|
1090
|
+
| `boundary` | `string \| Record<string, any> \| HTMLElement \| null \| undefined` | | | Constrains the dropdown within a bounding element. Accepts an HTMLElement, a Vue component ref, or a CSS selector string. |
|
|
1091
|
+
| `disabled` | `boolean \| undefined` | | | Disables the component |
|
|
1092
|
+
| `eager` | `boolean \| undefined` | | | Prevents rendering content before it's made visible. |
|
|
1093
|
+
| `enforceCoherence` | `boolean \| undefined` | | | Default for pipeline groups: drop selections that are no longer present in a group's current items (e.g. after a `dependencies` re-fetch) from the selection and `v-model`. A group's own `enforceCoherence` overrides this. |
|
|
1094
|
+
| `id` | `string \| undefined` | | | The identifier of the component. |
|
|
1095
|
+
| `items` | `Item[]` | | yes | Array used to render each dropdown button. They can act as `button`, as `a`, or as `router-link` as they are based on the functionality provided by `BbBaseButton`. Pass a flat array for a single group, nest arrays for divider-separated grou… |
|
|
1096
|
+
| `loadingText` | `string \| undefined` | | | Default placeholder text shown while a pipeline group's async items load. A group's own `loadingText` overrides this; both fall back to the localized `common.loadingText` (`'Loading...'`). |
|
|
1097
|
+
| `noDataText` | `string \| undefined` | | | Default placeholder text shown when a pipeline group resolves to no items. A group's own `noDataText` overrides this; both fall back to the localized `common.noDataText` (`'No data to display'`). |
|
|
1098
|
+
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Overrides forwarded to the underlying `BbOffCanvas` when `adaptive` renders the sheet on mobile. Merged over the adaptive defaults (`direction: 'bottom'`, `size: 'auto'`, `draggable: true`). Ignored when `adaptive` is `false`. |
|
|
1099
|
+
| `offset` | `number \| undefined` | `3` | | Space the floating container will maintain from the activator. |
|
|
1100
|
+
| `padding` | `number \| undefined` | `10` | | Minimum empty space to keep from the edge of the page |
|
|
1101
|
+
| `placement` | `Placement \| "cursor" \| undefined` | `"bottom"` | | Position of the dropdown relative to the activator. Use `'cursor'` to anchor at the mouse/touch coordinates (hides arrow). |
|
|
1102
|
+
| `queryDebounceTime` | `number \| undefined` | `300` | | Debounce (ms) applied to the async re-fetch a `searchable` group fires as the user types. Applies to every searchable group in the menu. |
|
|
1103
|
+
| `transitionDuration` | `number \| undefined` | `transitions.fast` | | How long the transition has to last in milliseconds. Menus use the fast transition rather than the medium one the other popovers default to. |
|
|
1104
|
+
| `trigger` | `DropdownTrigger \| DropdownTrigger[] \| undefined` | `"click"` | | Interaction(s) that open the dropdown. Accepts a single trigger or an array to combine them. - `'click'` — left-click / tap (default) - `'contextMenu'` — right-click on desktop, long-press on mobile |
|
|
1105
|
+
| `width` | `string \| number \| undefined` | `"auto"` | | Width of the dropdown in pixels, percentage, or 'auto' to fit content. |
|
|
1106
|
+
|
|
1107
|
+
## Events
|
|
1108
|
+
|
|
1109
|
+
- `item:selected` — `(event: "item:selected", value: any): void`
|
|
1110
|
+
- `item:unselected` — `(event: "item:unselected", value: any): void`
|
|
1111
|
+
|
|
1112
|
+
## Slots
|
|
1113
|
+
|
|
1114
|
+
- `activator` — scope: `BbDropdownActivatorSlotProps` — The element that triggers the dropdown to open. Spread `props` onto your trigger element.
|
|
1115
|
+
- `default` — scope: `any` — Hosts `<BbDropdownGroup>` companions. They register their group with the dropdown and render nothing themselves.
|
|
1116
|
+
- `footer` — scope: `BbDropdownEdgeSlotProps` — Content pinned to the bottom of the dropdown panel, outside the scroll area. Stays visible while the items scroll and is separated from them by a divider — for action buttons.
|
|
1117
|
+
- `header` — scope: `BbDropdownEdgeSlotProps` — Content pinned to the top of the dropdown panel, outside the scroll area. Stays visible while the items scroll and is separated from them by a divider — for a title or a filter field.
|
|
1118
|
+
- `item:append` — scope: `BbDropdownItemSlotProps` — Content rendered after each dropdown item's default button content.
|
|
1119
|
+
- `item:prepend` — scope: `BbDropdownItemSlotProps` — Content rendered before each dropdown item's default button content.
|
|
1120
|
+
- `loading` — scope: `BbDropdownPlaceholderSlotProps` — Replaces the default loading placeholder row shown in a pipeline group while its async items load. Rendered once per loading group.
|
|
1121
|
+
- `no-data` — scope: `BbDropdownPlaceholderSlotProps` — Replaces the default "no data" placeholder row shown in a pipeline group that resolved to no items. Rendered once per empty group.
|
|
1122
|
+
|
|
1123
|
+
## See Also
|
|
1124
|
+
|
|
1125
|
+
- [BbDropdownButton](./BbDropdownButton.md) — A button with primary action and all other actions collected in a dropdown.
|
|
1126
|
+
- [BbButton](./BbButton.md) — Button with loading state, tooltip, and icon support.
|
|
1127
|
+
- [BbPopover](./BbPopover.md) — Anchors floating content to reference elements.
|
|
1128
|
+
- [BbBaseButton](./BbBaseButton.md) — Unstyled button/link primitive: element resolution (button/anchor/router link) and the full navigation engine, with no visual chrome. Use for any clickable or navigable surface that is not a variant-first BbButton — cards, list rows, custom links.
|