bitboss-ui 3.0.0-beta.4 → 3.0.0-beta.41
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/README.md +317 -98
- package/bin/bitboss-ui-mcp.mjs +1566 -75
- package/bin/bitboss-ui.mjs +716 -72
- package/dist/ai/BbAccordion.md +178 -56
- package/dist/ai/BbAlert.md +140 -28
- package/dist/ai/BbAsterisk.md +61 -4
- package/dist/ai/BbAvatar.md +194 -53
- package/dist/ai/BbBadge.md +250 -50
- package/dist/ai/BbBadgeButton.md +74 -21
- package/dist/ai/BbBaseButton.md +132 -51
- package/dist/ai/BbBaseCheckboxIcon.md +118 -26
- package/dist/ai/BbBaseRadioIcon.md +115 -26
- package/dist/ai/BbBaseSwitchIcon.md +123 -28
- package/dist/ai/BbBreadcrumbs.md +221 -51
- package/dist/ai/BbButton.md +389 -107
- package/dist/ai/BbCalendar.md +667 -0
- package/dist/ai/BbCheckbox.md +242 -80
- package/dist/ai/BbCheckboxGroup.md +575 -66
- package/dist/ai/BbCollapsible.md +158 -39
- package/dist/ai/BbColorInput.md +322 -82
- package/dist/ai/BbColorPalette.md +261 -61
- package/dist/ai/BbConfirm.md +220 -51
- package/dist/ai/BbConfirmPortal.md +1 -1
- package/dist/ai/BbDatePicker.md +272 -37
- package/dist/ai/BbDatePickerInput.md +321 -92
- package/dist/ai/BbDialog.md +492 -87
- package/dist/ai/BbDropdown.md +1182 -104
- package/dist/ai/BbDropdownButton.md +239 -61
- package/dist/ai/BbDropdownGroup.md +5 -5
- package/dist/ai/BbDropzone.md +140 -36
- package/dist/ai/BbForm.md +1165 -40
- package/dist/ai/BbIcon.md +100 -33
- package/dist/ai/BbIndicator.md +79 -12
- package/dist/ai/BbNumberInput.md +257 -87
- package/dist/ai/BbOffCanvas.md +396 -91
- package/dist/ai/BbPagination.md +199 -32
- package/dist/ai/BbPopover.md +219 -54
- package/dist/ai/BbProgress.md +137 -71
- package/dist/ai/BbPtScope.md +136 -0
- package/dist/ai/BbRadio.md +234 -43
- package/dist/ai/BbRadioGroup.md +529 -91
- package/dist/ai/BbRating.md +243 -61
- package/dist/ai/BbSelect.md +690 -120
- package/dist/ai/BbSelectPopover.md +434 -122
- package/dist/ai/BbSlider.md +275 -79
- package/dist/ai/BbSmoothHeight.md +142 -34
- package/dist/ai/BbSpinner.md +179 -81
- package/dist/ai/BbSwitch.md +249 -63
- package/dist/ai/BbSwitchGroup.md +394 -65
- package/dist/ai/BbTable.md +1666 -222
- package/dist/ai/BbTabs.md +898 -178
- package/dist/ai/BbTabsList.md +81 -7
- package/dist/ai/BbTabsPanels.md +77 -0
- package/dist/ai/BbTabsRoot.md +16 -15
- package/dist/ai/BbTag.md +256 -76
- package/dist/ai/BbTextInput.md +480 -102
- package/dist/ai/BbTextarea.md +310 -96
- package/dist/ai/BbTimePicker.md +159 -24
- package/dist/ai/BbTimePickerInput.md +277 -46
- package/dist/ai/BbToast.md +286 -40
- package/dist/ai/BbToastPortal.md +3 -3
- package/dist/ai/BbTooltip.md +187 -34
- package/dist/ai/BbTree.md +260 -85
- package/dist/ai/ChipsBox.md +43 -2
- package/dist/ai/ClearableButton.md +12 -0
- package/dist/ai/CommaBox.md +2 -1
- package/dist/ai/CommonField.md +63 -0
- package/dist/ai/CommonFieldInput.md +90 -0
- package/dist/ai/CommonPopover.md +17 -12
- package/dist/ai/CommonTimeSelector.md +63 -0
- package/dist/ai/ErrorIcon.md +20 -0
- package/dist/ai/FlatListBox.md +41 -11
- package/dist/ai/GroupedListBox.md +42 -12
- package/dist/ai/ListBox.md +46 -11
- package/dist/ai/OptionsContainer.md +13 -10
- package/dist/ai/WarningIcon.md +20 -0
- package/dist/ai/changelog.json +4025 -141
- package/dist/ai/components.json +51872 -10136
- package/dist/ai/composables/useBbConfig.md +72 -11
- package/dist/ai/composables/useBbDropdownContext.md +168 -0
- package/dist/ai/composables/useBbFormContext.md +51 -24
- package/dist/ai/composables/useBbFormField.md +134 -0
- package/dist/ai/composables/useBbTableContext.md +41 -19
- package/dist/ai/composables/useConfirm.md +16 -8
- package/dist/ai/composables/useCountdown.md +1 -1
- package/dist/ai/composables/useId.md +10 -10
- package/dist/ai/composables/useMobile.md +17 -10
- package/dist/ai/composables/useToast.md +25 -19
- package/dist/ai/design-tokens.json +940 -0
- package/dist/ai/design-tokens.manifest.yaml +175 -0
- package/dist/ai/guides/agent-contract.md +168 -22
- package/dist/ai/guides/ai-router.md +79 -40
- package/dist/ai/guides/app-layout.md +8 -4
- package/dist/ai/guides/coherence-playbook.md +8 -8
- package/dist/ai/guides/component-picker.md +42 -34
- package/dist/ai/guides/design-language.md +274 -97
- package/dist/ai/guides/design-tokens.md +493 -105
- package/dist/ai/guides/fetch-items-playbook.md +22 -16
- package/dist/ai/guides/icons-policy.md +67 -35
- package/dist/ai/guides/inertia-helpers.md +4 -1
- package/dist/ai/guides/inline-edit-playbook.md +13 -6
- package/dist/ai/guides/installation-and-plugin-setup.md +817 -73
- package/dist/ai/guides/migration/components/bb-accordion.md +37 -0
- package/dist/ai/guides/migration/components/bb-alert.md +2 -2
- package/dist/ai/guides/migration/components/bb-avatar.md +13 -14
- package/dist/ai/guides/migration/components/bb-badge.md +5 -5
- package/dist/ai/guides/migration/components/bb-breadcrumbs.md +9 -8
- package/dist/ai/guides/migration/components/bb-button.md +80 -20
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +116 -29
- package/dist/ai/guides/migration/components/bb-checkbox.md +53 -10
- package/dist/ai/guides/migration/components/bb-chip.md +6 -6
- package/dist/ai/guides/migration/components/bb-collapsible.md +5 -5
- package/dist/ai/guides/migration/components/bb-color-input.md +5 -5
- package/dist/ai/guides/migration/components/bb-color-palette.md +16 -9
- package/dist/ai/guides/migration/components/bb-date-picker-input.md +45 -35
- package/dist/ai/guides/migration/components/bb-dialog.md +69 -36
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +7 -1
- package/dist/ai/guides/migration/components/bb-dropdown.md +31 -8
- package/dist/ai/guides/migration/components/bb-dropzone.md +8 -0
- package/dist/ai/guides/migration/components/bb-icon.md +7 -7
- package/dist/ai/guides/migration/components/bb-intersection.md +1 -1
- package/dist/ai/guides/migration/components/bb-offcanvas.md +29 -31
- package/dist/ai/guides/migration/components/bb-pagination.md +10 -0
- package/dist/ai/guides/migration/components/bb-popover.md +19 -11
- package/dist/ai/guides/migration/components/bb-radio-group.md +14 -0
- package/dist/ai/guides/migration/components/bb-rating.md +61 -24
- package/dist/ai/guides/migration/components/bb-select-popover.md +9 -1
- package/dist/ai/guides/migration/components/bb-select.md +21 -4
- package/dist/ai/guides/migration/components/bb-slider.md +14 -6
- package/dist/ai/guides/migration/components/bb-switch-group.md +14 -0
- package/dist/ai/guides/migration/components/bb-table.md +574 -33
- package/dist/ai/guides/migration/components/bb-tabs.md +91 -41
- package/dist/ai/guides/migration/components/bb-tag.md +9 -7
- package/dist/ai/guides/migration/components/bb-text-input.md +12 -12
- package/dist/ai/guides/migration/components/bb-toast.md +2 -2
- package/dist/ai/guides/migration/components/bb-tooltip.md +18 -0
- package/dist/ai/guides/migration/components/bb-tree.md +11 -9
- package/dist/ai/guides/migration/components/use-confirm.md +9 -1
- package/dist/ai/guides/migration/v2-to-v3.md +828 -240
- package/dist/ai/guides/migration/v3-beta-css-classes.md +751 -0
- package/dist/ai/guides/migration/v3-beta-tooling.md +119 -0
- package/dist/ai/guides/options-items-playbook.md +161 -12
- package/dist/ai/guides/page-shell.md +1 -1
- package/dist/ai/guides/passthrough.md +958 -0
- package/dist/ai/guides/preset-components.md +361 -0
- package/dist/ai/guides/ssr-prefill.md +127 -0
- package/dist/ai/guides/validated-forms.md +466 -55
- package/dist/ai/guides/validation-libraries.md +171 -0
- package/dist/ai/guides/validation-providers.md +113 -0
- package/dist/ai/index.md +45 -44
- package/dist/ai/recipes/inertia/approvals-inbox.md +26 -10
- package/dist/ai/recipes/inertia/command-palette.md +2 -2
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +46 -30
- package/dist/ai/recipes/inertia/layout-scaffold.md +6 -2
- package/dist/ai/recipes/inertia/onboarding.md +30 -8
- package/dist/ai/recipes/inertia/ownership-atlas.md +72 -49
- package/dist/ai/recipes/inertia/record-form.md +53 -19
- package/dist/ai/recipes/inertia/records-workspace.md +201 -49
- package/dist/ai/recipes/inertia/settings-workspace.md +3809 -0
- package/dist/ai/recipes/inertia/upload-center.md +54 -43
- package/dist/ai/recipes/inertia/wizard-form.md +98 -14
- package/dist/ai/recipes/nuxt/approvals-inbox.md +26 -10
- package/dist/ai/recipes/nuxt/command-palette.md +2 -2
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +68 -52
- package/dist/ai/recipes/nuxt/layout-scaffold.md +6 -2
- package/dist/ai/recipes/nuxt/onboarding.md +30 -8
- package/dist/ai/recipes/nuxt/record-form.md +66 -22
- package/dist/ai/recipes/nuxt/records-workspace.md +199 -48
- package/dist/ai/recipes/nuxt/settings-workspace.md +3898 -0
- package/dist/ai/recipes/nuxt/upload-center.md +52 -41
- package/dist/ai/recipes/nuxt/wizard-form.md +98 -14
- package/dist/ai/recipes/vue/approvals-inbox.md +28 -12
- package/dist/ai/recipes/vue/command-palette.md +2 -2
- package/dist/ai/recipes/vue/inline-edit-workspace.md +69 -53
- package/dist/ai/recipes/vue/layout-scaffold.md +6 -2
- package/dist/ai/recipes/vue/onboarding.md +32 -8
- package/dist/ai/recipes/vue/record-form.md +81 -54
- package/dist/ai/recipes/vue/records-workspace.md +198 -49
- package/dist/ai/recipes/vue/settings-workspace.md +3836 -0
- package/dist/ai/recipes/vue/upload-center.md +53 -42
- package/dist/ai/recipes/vue/wizard-form.md +97 -14
- package/dist/ai/source/BbAccordion.md +90 -24
- package/dist/ai/source/BbAlert.md +209 -62
- package/dist/ai/source/BbAsterisk.md +54 -4
- package/dist/ai/source/BbAvatar.md +73 -16
- package/dist/ai/source/BbBadge.md +265 -97
- package/dist/ai/source/BbBadgeButton.md +218 -79
- package/dist/ai/source/BbBaseButton.md +108 -12
- package/dist/ai/source/BbBaseCheckboxIcon.md +151 -36
- package/dist/ai/source/BbBaseRadioIcon.md +121 -17
- package/dist/ai/source/BbBaseSwitchIcon.md +138 -28
- package/dist/ai/source/BbBreadcrumbs.md +363 -69
- package/dist/ai/source/BbButton.md +563 -174
- package/dist/ai/source/BbCalendar.md +1744 -0
- package/dist/ai/source/BbCheckbox.md +470 -68
- package/dist/ai/source/BbCheckboxGroup.md +976 -95
- package/dist/ai/source/BbCollapsible.md +96 -8
- package/dist/ai/source/BbColorInput.md +597 -67
- package/dist/ai/source/BbColorPalette.md +1284 -65
- package/dist/ai/source/BbConfirm.md +149 -7
- package/dist/ai/source/BbConfirmPortal.md +89 -3
- package/dist/ai/source/BbDatePicker.md +527 -381
- package/dist/ai/source/BbDatePickerInput.md +2015 -118
- package/dist/ai/source/BbDialog.md +531 -64
- package/dist/ai/source/BbDropdown.md +885 -175
- package/dist/ai/source/BbDropdownButton.md +377 -79
- package/dist/ai/source/BbDropdownGroup.md +687 -96
- package/dist/ai/source/BbDropzone.md +140 -31
- package/dist/ai/source/BbForm.md +875 -17
- package/dist/ai/source/BbIcon.md +130 -52
- package/dist/ai/source/BbIndicator.md +117 -60
- package/dist/ai/source/BbNumberInput.md +667 -84
- package/dist/ai/source/BbOffCanvas.md +1007 -261
- package/dist/ai/source/BbPagination.md +203 -31
- package/dist/ai/source/BbPopover.md +267 -90
- package/dist/ai/source/BbProgress.md +88 -26
- package/dist/ai/source/BbPtScope.md +54 -0
- package/dist/ai/source/BbRadio.md +388 -58
- package/dist/ai/source/BbRadioGroup.md +940 -109
- package/dist/ai/source/BbRating.md +736 -84
- package/dist/ai/source/BbSelect.md +1096 -96
- package/dist/ai/source/BbSelectPopover.md +807 -114
- package/dist/ai/source/BbSlider.md +1390 -98
- package/dist/ai/source/BbSmoothHeight.md +48 -2
- package/dist/ai/source/BbSpinner.md +62 -6
- package/dist/ai/source/BbSwitch.md +297 -60
- package/dist/ai/source/BbSwitchGroup.md +761 -83
- package/dist/ai/source/BbTable.md +6950 -1864
- package/dist/ai/source/BbTabs.md +368 -111
- package/dist/ai/source/BbTabsList.md +503 -146
- package/dist/ai/source/BbTabsPanels.md +625 -0
- package/dist/ai/source/BbTabsRoot.md +319 -100
- package/dist/ai/source/BbTag.md +796 -87
- package/dist/ai/source/BbTextInput.md +497 -68
- package/dist/ai/source/BbTextarea.md +550 -65
- package/dist/ai/source/BbTimePicker.md +395 -69
- package/dist/ai/source/BbTimePickerInput.md +1233 -106
- package/dist/ai/source/BbToast.md +250 -74
- package/dist/ai/source/BbToastPortal.md +210 -66
- package/dist/ai/source/BbTooltip.md +181 -30
- package/dist/ai/source/BbTree.md +76 -11
- package/dist/ai/source/ChipsBox.md +25 -5
- package/dist/ai/source/CommaBox.md +21 -6
- package/dist/ai/source/{BbBaseInputContainer.md → CommonField.md} +467 -250
- package/dist/ai/source/CommonFieldInput.md +848 -0
- package/dist/ai/source/CommonPopover.md +116 -30
- package/dist/ai/source/CommonTimeSelector.md +726 -0
- package/dist/ai/source/ErrorIcon.md +2 -2
- package/dist/ai/source/FlatListBox.md +188 -17
- package/dist/ai/source/GroupedListBox.md +236 -44
- package/dist/ai/source/GuidesComponent.md +14 -7
- package/dist/ai/source/ListBox.md +46 -8
- package/dist/ai/source/OptionsContainer.md +288 -60
- package/dist/ai/source/WarningIcon.md +2 -2
- package/dist/assets/css/reset.css_inline.js +1 -1
- package/dist/assets/svgs/star.svg_raw.js +4 -0
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +49 -32
- package/dist/components/BbAccordion/types.d.ts +35 -3
- package/dist/components/BbAccordion/types.js +11 -0
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +46 -30
- package/dist/components/BbAlert/types.d.ts +37 -3
- package/dist/components/BbAlert/types.js +13 -0
- package/dist/components/BbAsterisk/BbAsterisk.vue.d.ts +3 -1
- package/dist/components/BbAsterisk/BbAsterisk.vue_vue_type_script_setup_true_lang.js +23 -8
- package/dist/components/BbAsterisk/types.d.ts +18 -0
- package/dist/components/BbAsterisk/types.js +7 -0
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -1
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +57 -44
- package/dist/components/BbAvatar/types.d.ts +23 -0
- package/dist/components/BbAvatar/types.js +7 -0
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -18
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +96 -53
- package/dist/components/BbBadge/BbBadgeButton.vue_vue_type_script_setup_true_lang.js +27 -8
- package/dist/components/BbBadge/badgeButtonContext.d.ts +25 -8
- package/dist/components/BbBadge/types.d.ts +46 -3
- package/dist/components/BbBadge/types.js +13 -0
- package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +109 -96
- package/dist/components/BbBaseButton/RouterComponent.vue_vue_type_script_setup_true_lang.js +11 -11
- package/dist/components/BbBaseButton/types.d.ts +33 -3
- package/dist/components/BbBaseButton/types.js +9 -2
- package/dist/components/BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue_vue_type_script_setup_true_lang.js +50 -18
- package/dist/components/BbBaseCheckboxIcon/types.d.ts +31 -2
- package/dist/components/BbBaseCheckboxIcon/types.js +8 -0
- package/dist/components/BbBaseRadioIcon/BbBaseRadioIcon.vue_vue_type_script_setup_true_lang.js +45 -15
- package/dist/components/BbBaseRadioIcon/types.d.ts +31 -2
- package/dist/components/BbBaseRadioIcon/types.js +8 -0
- package/dist/components/BbBaseSwitchIcon/BbBaseSwitchIcon.vue_vue_type_script_setup_true_lang.js +48 -16
- package/dist/components/BbBaseSwitchIcon/types.d.ts +31 -2
- package/dist/components/BbBaseSwitchIcon/types.js +8 -0
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +187 -132
- package/dist/components/BbBreadcrumbs/types.d.ts +45 -3
- package/dist/components/BbBreadcrumbs/types.js +12 -0
- package/dist/components/BbButton/BbButton.vue.d.ts +5 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +107 -81
- package/dist/components/BbButton/types.d.ts +113 -2
- package/dist/components/BbButton/types.js +12 -0
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +34 -0
- package/dist/components/BbCalendar/BbCalendar.vue.js +6 -0
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +608 -0
- package/dist/components/BbCalendar/CalendarMonthPanel.vue.js +5 -0
- package/dist/components/BbCalendar/CalendarMonthPanel.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/components/BbCalendar/CalendarYearPanel.vue.js +5 -0
- package/dist/components/BbCalendar/CalendarYearPanel.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/components/BbCalendar/calendarHost.d.ts +29 -0
- package/dist/components/BbCalendar/calendarHost.js +10 -0
- package/dist/components/BbCalendar/types.d.ts +225 -0
- package/dist/components/BbCalendar/types.js +29 -0
- package/dist/components/{BbBaseDatePicker/useDatePickerContext.d.ts → BbCalendar/useCalendarContext.d.ts} +10 -7
- package/dist/components/BbCalendar/useCalendarContext.js +11 -0
- package/dist/components/BbCalendar/useCalendarGrid.d.ts +208 -0
- package/dist/components/BbCalendar/useCalendarGrid.js +274 -0
- package/dist/components/BbCalendar/useDayGrid.d.ts +79 -0
- package/dist/components/BbCalendar/useDayGrid.js +204 -0
- package/dist/components/BbCalendar/useToday.d.ts +23 -0
- package/dist/components/BbCalendar/useToday.js +21 -0
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +7 -7
- package/dist/components/BbCheckbox/BbCheckbox.vue_vue_type_script_setup_true_lang.js +214 -72
- package/dist/components/BbCheckbox/types.d.ts +180 -13
- package/dist/components/BbCheckbox/types.js +8 -0
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +15 -3
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +338 -90
- package/dist/components/BbCheckboxGroup/types.d.ts +195 -20
- package/dist/components/BbCheckboxGroup/types.js +10 -0
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +2 -1
- package/dist/components/BbCollapsible/BbCollapsible.vue_vue_type_script_setup_true_lang.js +41 -19
- package/dist/components/BbCollapsible/types.d.ts +44 -1
- package/dist/components/BbCollapsible/types.js +7 -0
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +17 -7
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +330 -86
- package/dist/components/BbColorInput/types.d.ts +230 -12
- package/dist/components/BbColorInput/types.js +24 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +10 -2
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +515 -108
- package/dist/components/BbColorPalette/types.d.ts +76 -7
- package/dist/components/BbColorPalette/types.js +12 -0
- package/dist/components/BbConfirm/BbConfirm.vue.d.ts +2 -1
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +125 -76
- package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +1 -0
- package/dist/components/BbConfirm/types.d.ts +49 -0
- package/dist/components/BbConfirm/types.js +17 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +16 -10
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +320 -223
- package/dist/components/BbDatePicker/types.d.ts +111 -17
- package/dist/components/BbDatePicker/types.js +33 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +16 -4
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +1172 -87
- package/dist/components/BbDatePickerInput/types.d.ts +224 -19
- package/dist/components/BbDatePickerInput/types.js +39 -0
- package/dist/components/BbDialog/BbDialog.vue.d.ts +3 -3
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +227 -136
- package/dist/components/BbDialog/types.d.ts +92 -3
- package/dist/components/BbDialog/types.js +16 -0
- package/dist/components/BbDialog/useDialogStack.d.ts +12 -0
- package/dist/components/BbDialog/useDialogStack.js +9 -2
- package/dist/components/BbDropdown/AdaptiveDropdown.vue.d.ts +2 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +108 -96
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +10 -2
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +337 -268
- package/dist/components/BbDropdown/BbDropdownGroup.vue.d.ts +5 -1
- package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +8 -2
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +377 -293
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +129 -118
- package/dist/components/BbDropdown/normalizeGroups.js +55 -31
- package/dist/components/BbDropdown/types.d.ts +288 -30
- package/dist/components/BbDropdown/types.js +21 -2
- package/dist/components/BbDropdown/useDropdownContext.d.ts +10 -4
- package/dist/components/BbDropdown/useDropdownGroupRegistry.d.ts +1 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +18 -3
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +172 -40
- package/dist/components/BbDropdownButton/types.d.ts +137 -8
- package/dist/components/BbDropdownButton/types.js +35 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +2 -2
- package/dist/components/BbDropzone/BbDropzone.vue_vue_type_script_setup_true_lang.js +186 -144
- package/dist/components/BbDropzone/types.d.ts +38 -4
- package/dist/components/BbDropzone/types.js +16 -0
- package/dist/components/BbForm/BbForm.vue.d.ts +94 -0
- package/dist/{validated → components/BbForm}/BbForm.vue.js +1 -1
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +317 -0
- package/dist/components/BbForm/BbFormCustomField.d.ts +14 -0
- package/dist/components/BbForm/BbFormCustomField.js +43 -0
- package/dist/components/BbForm/bindFormField.d.ts +16 -0
- package/dist/components/BbForm/bindFormField.js +85 -0
- package/dist/components/BbForm/formFields.d.ts +64 -0
- package/dist/components/BbForm/formFields.js +11 -0
- package/dist/components/BbForm/formSchema.d.ts +56 -0
- package/dist/components/BbForm/formSchema.js +196 -0
- package/dist/components/BbForm/standardSchema.d.ts +59 -0
- package/dist/components/BbIcon/BbIcon.vue_vue_type_script_setup_true_lang.js +58 -48
- package/dist/components/BbIcon/iconCache.d.ts +63 -0
- package/dist/components/BbIcon/iconCache.js +35 -0
- package/dist/components/BbIcon/types.d.ts +22 -2
- package/dist/components/BbIcon/types.js +7 -0
- package/dist/components/BbIndicator/BbIndicator.vue_vue_type_script_setup_true_lang.js +34 -21
- package/dist/components/BbIndicator/types.d.ts +24 -0
- package/dist/components/BbIndicator/types.js +7 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +12 -8
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +308 -85
- package/dist/components/BbNumberInput/types.d.ts +201 -18
- package/dist/components/BbNumberInput/types.js +8 -0
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +3 -3
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +311 -210
- package/dist/components/BbOffCanvas/types.d.ts +79 -6
- package/dist/components/BbOffCanvas/types.js +15 -0
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +125 -90
- package/dist/components/BbPagination/types.d.ts +38 -0
- package/dist/components/BbPagination/types.js +13 -0
- package/dist/components/BbPopover/BbPopover.vue.d.ts +4 -4
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +219 -179
- package/dist/components/BbPopover/types.d.ts +51 -5
- package/dist/components/BbPopover/types.js +14 -0
- package/dist/components/BbProgress/BbProgress.vue_vue_type_script_setup_true_lang.js +29 -16
- package/dist/components/BbProgress/types.d.ts +25 -0
- package/dist/components/BbProgress/types.js +7 -0
- package/dist/components/BbPtScope/BbPtScope.vue.d.ts +12 -0
- package/dist/components/BbPtScope/BbPtScope.vue.js +5 -0
- package/dist/components/BbPtScope/BbPtScope.vue_vue_type_script_setup_true_lang.js +13 -0
- package/dist/components/BbPtScope/types.d.ts +15 -0
- package/dist/components/BbRadio/BbRadio.vue.d.ts +7 -7
- package/dist/components/BbRadio/BbRadio.vue_vue_type_script_setup_true_lang.js +172 -59
- package/dist/components/BbRadio/types.d.ts +152 -13
- package/dist/components/BbRadio/types.js +8 -0
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +14 -2
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +319 -92
- package/dist/components/BbRadioGroup/types.d.ts +198 -22
- package/dist/components/BbRadioGroup/types.js +10 -0
- package/dist/components/BbRating/BbRating.vue.d.ts +10 -8
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +259 -78
- package/dist/components/BbRating/types.d.ts +174 -13
- package/dist/components/BbRating/types.js +21 -0
- package/dist/components/BbSelect/BbSelect.vue.d.ts +17 -3
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +553 -83
- package/dist/components/BbSelect/types.d.ts +235 -20
- package/dist/components/BbSelect/types.js +41 -0
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +15 -1
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +541 -391
- package/dist/components/BbSelectPopover/types.d.ts +124 -8
- package/dist/components/BbSelectPopover/types.js +24 -0
- package/dist/components/BbSlider/BbSlider.vue.d.ts +13 -8
- package/dist/components/BbSlider/BbSlider.vue_vue_type_script_setup_true_lang.js +472 -96
- package/dist/components/BbSlider/types.d.ts +202 -13
- package/dist/components/BbSlider/types.js +26 -0
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue_vue_type_script_setup_true_lang.js +60 -48
- package/dist/components/BbSmoothHeight/types.d.ts +19 -0
- package/dist/components/BbSmoothHeight/types.js +7 -0
- package/dist/components/BbSpinner/BbSpinner.vue_vue_type_script_setup_true_lang.js +27 -14
- package/dist/components/BbSpinner/types.d.ts +22 -1
- package/dist/components/BbSpinner/types.js +7 -0
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +7 -7
- package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +220 -78
- package/dist/components/BbSwitch/types.d.ts +25 -10
- package/dist/components/BbSwitch/types.js +5 -0
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +14 -2
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +338 -90
- package/dist/components/BbSwitchGroup/types.d.ts +30 -7
- package/dist/components/BbSwitchGroup/types.js +5 -0
- package/dist/components/BbTable/BbTable.vue.d.ts +27 -6
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +2013 -685
- package/dist/components/BbTable/BbTableDataRow.d.ts +196 -0
- package/dist/components/BbTable/BbTableDataRow.js +151 -0
- package/dist/components/BbTable/BbTableExpandRow.d.ts +84 -0
- package/dist/components/BbTable/BbTableExpandRow.js +62 -0
- package/dist/components/BbTable/BbTableSelectToggle.d.ts +120 -0
- package/dist/components/BbTable/BbTableSelectToggle.js +122 -0
- package/dist/components/BbTable/gridWidgets.d.ts +30 -0
- package/dist/components/BbTable/gridWidgets.js +14 -0
- package/dist/components/BbTable/types.d.ts +473 -123
- package/dist/components/BbTable/types.js +31 -0
- package/dist/components/BbTable/utils.d.ts +145 -4
- package/dist/components/BbTable/utils.js +154 -37
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -1
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +62 -26
- package/dist/components/BbTabs/BbTabsList.vue.d.ts +3 -10
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +143 -81
- package/dist/components/BbTabs/BbTabsPanels.vue.d.ts +12 -0
- package/dist/components/{BbBaseSwitch/BbBaseSwitch.vue.js → BbTabs/BbTabsPanels.vue.js} +2 -2
- package/dist/components/BbTabs/BbTabsPanels.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/BbTabs/BbTabsRoot.vue.d.ts +3 -1
- package/dist/components/BbTabs/BbTabsRoot.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BbTabs/types.d.ts +183 -23
- package/dist/components/BbTabs/types.js +34 -0
- package/dist/components/BbTag/BbTag.vue.d.ts +13 -10
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +383 -92
- package/dist/components/BbTag/types.d.ts +139 -14
- package/dist/components/BbTag/types.js +22 -0
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +10 -8
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +257 -84
- package/dist/components/BbTextInput/types.d.ts +168 -13
- package/dist/components/BbTextInput/types.js +8 -0
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +7 -7
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +291 -94
- package/dist/components/BbTextarea/types.d.ts +158 -14
- package/dist/components/BbTextarea/types.js +8 -0
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +12 -4
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +199 -122
- package/dist/components/BbTimePicker/types.d.ts +94 -7
- package/dist/components/BbTimePicker/types.js +18 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +14 -4
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +749 -86
- package/dist/components/BbTimePickerInput/types.d.ts +171 -22
- package/dist/components/BbTimePickerInput/types.js +25 -0
- package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +63 -25
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +4 -1
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +79 -76
- package/dist/components/BbToast/BbToastPortal.vue.d.ts +1 -0
- package/dist/components/BbToast/BbToastRegion.vue.d.ts +4 -1
- package/dist/components/BbToast/BbToastRegion.vue_vue_type_script_setup_true_lang.js +72 -64
- package/dist/components/BbToast/types.d.ts +54 -1
- package/dist/components/BbToast/types.js +28 -0
- package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +104 -87
- package/dist/components/BbTooltip/types.d.ts +40 -2
- package/dist/components/BbTooltip/types.js +7 -0
- package/dist/components/BbTree/BbTree.vue.d.ts +15 -3
- package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +51 -29
- package/dist/components/BbTree/BbTreeLevel.vue.d.ts +1 -1
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +17 -16
- package/dist/components/BbTree/context.d.ts +9 -1
- package/dist/components/BbTree/types.d.ts +40 -5
- package/dist/components/BbTree/types.js +7 -0
- package/dist/components/ChipsBox/ChipsBox.vue_vue_type_script_setup_true_lang.js +46 -44
- package/dist/components/ChipsBox/types.d.ts +7 -0
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/CommaBox/CommaBox.vue_vue_type_script_setup_true_lang.js +11 -7
- package/dist/components/CommaBox/types.d.ts +7 -0
- package/dist/components/{BbBaseInputContainer/BbBaseInputContainer.vue.d.ts → CommonField/CommonField.vue.d.ts} +5 -5
- package/dist/components/{BbBaseRadio/BbBaseRadio.vue.js → CommonField/CommonField.vue.js} +2 -2
- package/dist/components/CommonField/CommonField.vue_vue_type_script_setup_true_lang.js +189 -0
- package/dist/components/CommonField/messageHeightMatrix.d.ts +2 -0
- package/dist/components/{BbBaseInputContainer → CommonField}/types.d.ts +52 -16
- package/dist/components/{CommonInputWrapper/CommonInputWrapper.vue.d.ts → CommonFieldInput/CommonFieldInput.vue.d.ts} +5 -4
- package/dist/components/{BbBaseRadioGroup/BbBaseRadioGroup.vue.js → CommonFieldInput/CommonFieldInput.vue.js} +2 -2
- package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/components/CommonFieldInput/boxBorderMatrix.d.ts +10 -0
- package/dist/components/{CommonInputWrapper → CommonFieldInput}/types.d.ts +27 -8
- package/dist/components/CommonPopover/CommonPopover.vue.d.ts +11 -2
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +76 -63
- package/dist/components/CommonPopover/types.d.ts +27 -8
- package/dist/components/{BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue.d.ts → CommonTimeSelector/CommonTimeSelector.vue.d.ts} +21 -2
- package/dist/components/{BbBaseColorPalette/BbBaseColorPalette.vue.js → CommonTimeSelector/CommonTimeSelector.vue.js} +2 -2
- package/dist/components/CommonTimeSelector/CommonTimeSelector.vue_vue_type_script_setup_true_lang.js +232 -0
- package/dist/components/CommonTimeSelector/types.d.ts +6 -0
- package/dist/components/FlatListBox/FlatListBox.vue.d.ts +5 -1
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +165 -95
- package/dist/components/FlatListBox/types.d.ts +24 -2
- package/dist/components/GroupedListBox/GroupedListBox.vue.d.ts +5 -1
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +217 -134
- package/dist/components/GroupedListBox/types.d.ts +24 -2
- package/dist/components/ListBox/ListBox.vue.d.ts +5 -1
- package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +95 -69
- package/dist/components/ListBox/types.d.ts +24 -2
- package/dist/components/OptionsContainer/OptionsContainer.vue.d.ts +1 -1
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +109 -37
- package/dist/components/OptionsContainer/types.d.ts +53 -9
- package/dist/components/Transitions/ScaleFade.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/Transitions/Slide.vue.js +1 -1
- package/dist/composables/useBaseOptions.d.ts +12 -1
- package/dist/composables/useBaseOptions.js +77 -37
- package/dist/composables/useBbConfig.d.ts +27 -6
- package/dist/composables/useBbConfig.js +8 -2
- package/dist/composables/useBbDropdownContext.d.ts +5 -0
- package/dist/composables/useBbFormContext.d.ts +131 -8
- package/dist/composables/useBbFormContext.js +49 -30
- package/dist/composables/useBbFormField.d.ts +40 -0
- package/dist/composables/useBbFormField.js +39 -0
- package/dist/composables/useBbTableContext.d.ts +45 -1
- package/dist/composables/useBbTableContext.js +93 -87
- package/dist/composables/useBbTabsContext.d.ts +15 -9
- package/dist/composables/useBbTabsContext.js +121 -90
- package/dist/composables/useClosingInert.d.ts +4 -4
- package/dist/composables/useCoarsePointer.js +7 -10
- package/dist/composables/useCoherence.js +1 -1
- package/dist/composables/useConfig.d.ts +59 -0
- package/dist/composables/useConfig.js +15 -0
- package/dist/composables/useConfirm.d.ts +39 -7
- package/dist/composables/useConfirm.js +50 -41
- package/dist/composables/useEscapeStackEntry.d.ts +13 -0
- package/dist/composables/useEscapeStackEntry.js +16 -0
- package/dist/composables/useFormBinding.d.ts +116 -0
- package/dist/composables/useFormBinding.js +34 -0
- package/dist/composables/useHydrated.d.ts +18 -0
- package/dist/composables/useHydrated.js +13 -7
- package/dist/composables/useId.d.ts +4 -3
- package/dist/composables/useId.js +1 -7
- package/dist/composables/useItemsGetter.d.ts +11 -0
- package/dist/composables/useItemsGetter.js +44 -18
- package/dist/composables/useKeyboardInset.d.ts +28 -0
- package/dist/composables/useKeyboardInset.js +32 -0
- package/dist/composables/useLocale.js +10 -7
- package/dist/composables/useMobile.js +7 -10
- package/dist/composables/usePassthrough.d.ts +228 -0
- package/dist/composables/usePassthrough.js +247 -0
- package/dist/composables/usePrefill.d.ts +22 -2
- package/dist/composables/usePrefill.js +35 -19
- package/dist/composables/useSafeAreaInternal.js +1 -1
- package/dist/composables/useSegmentedFields.d.ts +2 -2
- package/dist/composables/useSsrState.d.ts +20 -0
- package/dist/composables/useSsrState.js +13 -0
- package/dist/composables/useTableWidthContext.d.ts +24 -4
- package/dist/composables/useTableWidthContext.js +31 -28
- package/dist/composables/useToast.d.ts +18 -1
- package/dist/composables/useToast.js +31 -18
- package/dist/composables/useToggleInput.d.ts +44 -0
- package/dist/composables/useToggleInput.js +39 -0
- package/dist/composables/useViewportWidth.d.ts +5 -25
- package/dist/composables/useViewportWidth.js +14 -7
- package/dist/deprecation/ai-deprecations.json.d.ts +1977 -289
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/deprecation/removedProps.js +9 -4
- package/dist/directives/bbDropdown.d.ts +15 -4
- package/dist/directives/bbDropdown.js +31 -9
- package/dist/directives/bbTooltip.d.ts +6 -0
- package/dist/directives/createPopoverDirective.d.ts +62 -0
- package/dist/directives/createPopoverDirective.js +92 -37
- package/dist/i18n/index.d.ts +10 -16
- package/dist/i18n/locales/cs.json +9 -5
- package/dist/i18n/locales/da.json +9 -5
- package/dist/i18n/locales/de.json +9 -5
- package/dist/i18n/locales/el.json +9 -5
- package/dist/i18n/locales/en.json +9 -5
- package/dist/i18n/locales/es.json +9 -5
- package/dist/i18n/locales/fi.json +9 -5
- package/dist/i18n/locales/fr.json +9 -5
- package/dist/i18n/locales/hu.json +9 -5
- package/dist/i18n/locales/it.json +9 -5
- package/dist/i18n/locales/ja.json +9 -5
- package/dist/i18n/locales/ko.json +9 -5
- package/dist/i18n/locales/nb.json +9 -5
- package/dist/i18n/locales/nl.json +9 -5
- package/dist/i18n/locales/pl.json +9 -5
- package/dist/i18n/locales/pt.json +9 -5
- package/dist/i18n/locales/ro.json +9 -5
- package/dist/i18n/locales/ru.json +9 -5
- package/dist/i18n/locales/sv.json +9 -5
- package/dist/i18n/locales/tr.json +9 -5
- package/dist/i18n/locales/uk.json +9 -5
- package/dist/i18n/locales/zh-cn.json +9 -5
- package/dist/icon-scan.d.ts +276 -0
- package/dist/icon-scan.js +485 -0
- package/dist/icons-whitelist.d.ts +5 -4
- package/dist/index.d.ts +40 -21
- package/dist/index.js +78 -71
- package/dist/llms-full.txt +61164 -27972
- package/dist/llms-medium.txt +1482 -366
- package/dist/llms.txt +32 -15
- package/dist/locale-blueprint.json +9 -5
- package/dist/nuxt-auto-imports.d.ts +76 -0
- package/dist/nuxt-auto-imports.js +32 -0
- package/dist/nuxt-module.d.ts +30 -15
- package/dist/nuxt.js +35 -9
- package/dist/passthrough-deduper.js +5 -0
- package/dist/plugin.d.ts +10 -1
- package/dist/plugin.js +29 -19
- package/dist/project-dts.d.ts +84 -0
- package/dist/project-dts.js +170 -0
- package/dist/reset.css +1 -1
- package/dist/runtime/nuxt-plugin.js +34 -21
- package/dist/styles.css +3 -2
- package/dist/types/AlertVariant.d.ts +10 -1
- package/dist/types/BadgeVariant.d.ts +16 -5
- package/dist/types/ButtonVariant.d.ts +12 -1
- package/dist/types/ColumnName.d.ts +30 -3
- package/dist/types/CommonProps.d.ts +2 -2
- package/dist/types/Config.d.ts +94 -1
- package/dist/types/ConfirmVariant.d.ts +8 -1
- package/dist/types/DropdownItemVariant.d.ts +8 -1
- package/dist/types/FieldLayout.d.ts +32 -0
- package/dist/types/IndicatorVariant.d.ts +11 -1
- package/dist/types/InputVariant.d.ts +30 -0
- package/dist/types/ItemProps.d.ts +50 -0
- package/dist/types/Option.d.ts +6 -0
- package/dist/types/PtScope.d.ts +15 -0
- package/dist/types/RegistryKey.d.ts +10 -0
- package/dist/types/TabsVariant.d.ts +25 -0
- package/dist/types/ToastVariant.d.ts +12 -2
- package/dist/types/TooltipVariant.d.ts +8 -1
- package/dist/types/passthrough.d.ts +362 -0
- package/dist/types/passthrough.js +78 -0
- package/dist/types/ptComponentMap.d.ts +62 -0
- package/dist/utilities/functions/hasVnodeListener.d.ts +16 -0
- package/dist/utilities/functions/hasVnodeListener.js +12 -0
- package/dist/utilities/functions/isImeComposing.d.ts +7 -0
- package/dist/utilities/functions/isImeComposing.js +4 -0
- package/dist/utilities/functions/itemProps.d.ts +46 -0
- package/dist/utilities/functions/itemProps.js +47 -0
- package/dist/utilities/functions/slotKey.d.ts +13 -8
- package/dist/utilities/functions/slotKey.js +78 -2
- package/dist/utilities/functions/snapToStep.js +2 -1
- package/dist/utilities/functions/toggleInput.d.ts +98 -0
- package/dist/utilities/functions/toggleInput.js +56 -0
- package/dist/utilities/functions/warnRemovedAttrs.d.ts +27 -1
- package/dist/utilities/functions/warnRemovedAttrs.js +75 -14
- package/dist/utilities/misc/listboxMetrics.d.ts +9 -3
- package/dist/utilities/misc/listboxMetrics.js +5 -2
- package/dist/utilities/misc/ssrStateInjectionKey.d.ts +42 -0
- package/dist/utilities/misc/ssrStateInjectionKey.js +4 -0
- package/dist/utils/cssLayers.d.ts +91 -0
- package/dist/utils/cssLayers.js +43 -0
- package/dist/utils/injectLibraryStyles.d.ts +3 -1
- package/dist/utils/injectLibraryStyles.js +24 -23
- package/dist/utils/overlayEscapeStack.d.ts +10 -0
- package/dist/utils/overlayEscapeStack.js +5 -3
- package/dist/utils/passthrough.d.ts +67 -0
- package/dist/utils/passthrough.js +100 -0
- package/dist/utils/passthroughDeduper.d.ts +2 -0
- package/dist/utils/ptScope.d.ts +8 -0
- package/dist/utils/ptScope.js +4 -0
- package/dist/utils/versionCheck.d.ts +19 -0
- package/dist/utils/versionCheck.js +18 -0
- package/dist/vite-plugin.d.ts +301 -53
- package/dist/vite.js +547 -375
- package/llms.txt +33 -16
- package/package.json +49 -27
- package/scripts/lib/check-fix.mjs +129 -0
- package/scripts/lib/component-attr-targets.ts +123 -0
- package/scripts/lib/component-tree.ts +648 -0
- package/scripts/lib/css-class-check.mjs +326 -0
- package/scripts/lib/css-class-surface.mjs +292 -0
- package/scripts/lib/css-color-resolve.mjs +172 -0
- package/scripts/lib/css-local-check.mjs +267 -0
- package/scripts/lib/design-token-manifest.mjs +499 -0
- package/scripts/lib/doc-sections.mjs +248 -0
- package/scripts/lib/ensure-manifest.mjs +28 -5
- package/scripts/lib/eslint-disable.mjs +141 -0
- package/scripts/lib/eslint-plugin.d.ts +64 -1
- package/scripts/lib/eslint-plugin.mjs +1285 -30
- package/scripts/lib/hand-imported-styles.mjs +326 -0
- package/scripts/lib/hand-roll-hints.mjs +50 -6
- package/scripts/lib/html-attributes.mjs +353 -0
- package/scripts/lib/local-components.mjs +177 -0
- package/scripts/lib/mcp-config.mjs +87 -58
- package/scripts/lib/migrate-fix.mjs +62 -3
- package/scripts/lib/project-variant-dts.mjs +122 -0
- package/scripts/lib/public-type-exports.mjs +273 -0
- package/scripts/lib/slot-key.mjs +147 -0
- package/scripts/lib/slot-renames.mjs +46 -0
- package/scripts/lib/squashed-slot-words.mjs +133 -0
- package/scripts/lib/validate-bb-markup.mjs +2213 -76
- package/scripts/lib/wrapper-props.mjs +188 -0
- package/dist/ai/BbBaseCheckbox.md +0 -49
- package/dist/ai/BbBaseCheckboxGroup.md +0 -64
- package/dist/ai/BbBaseColorInput.md +0 -65
- package/dist/ai/BbBaseColorPalette.md +0 -39
- package/dist/ai/BbBaseDatePicker.md +0 -43
- package/dist/ai/BbBaseDatePickerInput.md +0 -73
- package/dist/ai/BbBaseInputContainer.md +0 -48
- package/dist/ai/BbBaseNumberInput.md +0 -71
- package/dist/ai/BbBaseRadio.md +0 -46
- package/dist/ai/BbBaseRadioGroup.md +0 -64
- package/dist/ai/BbBaseRating.md +0 -52
- package/dist/ai/BbBaseSelect.md +0 -88
- package/dist/ai/BbBaseSlider.md +0 -56
- package/dist/ai/BbBaseSwitch.md +0 -49
- package/dist/ai/BbBaseSwitchGroup.md +0 -64
- package/dist/ai/BbBaseTag.md +0 -68
- package/dist/ai/BbBaseTextInput.md +0 -75
- package/dist/ai/BbBaseTextarea.md +0 -62
- package/dist/ai/BbBaseTimePickerInput.md +0 -62
- package/dist/ai/BbTabsPanes.md +0 -27
- package/dist/ai/CommonInputWrapper.md +0 -42
- package/dist/ai/source/BbBaseCheckbox.md +0 -461
- package/dist/ai/source/BbBaseCheckboxGroup.md +0 -554
- package/dist/ai/source/BbBaseColorInput.md +0 -431
- package/dist/ai/source/BbBaseColorPalette.md +0 -942
- package/dist/ai/source/BbBaseDatePicker.md +0 -1448
- package/dist/ai/source/BbBaseDatePickerInput.md +0 -1940
- package/dist/ai/source/BbBaseNumberInput.md +0 -617
- package/dist/ai/source/BbBaseRadio.md +0 -381
- package/dist/ai/source/BbBaseRadioGroup.md +0 -539
- package/dist/ai/source/BbBaseRating.md +0 -607
- package/dist/ai/source/BbBaseSelect.md +0 -945
- package/dist/ai/source/BbBaseSlider.md +0 -1144
- package/dist/ai/source/BbBaseSwitch.md +0 -246
- package/dist/ai/source/BbBaseSwitchGroup.md +0 -302
- package/dist/ai/source/BbBaseTag.md +0 -694
- package/dist/ai/source/BbBaseTextInput.md +0 -511
- package/dist/ai/source/BbBaseTextarea.md +0 -504
- package/dist/ai/source/BbBaseTimePickerInput.md +0 -1037
- package/dist/ai/source/BbTabsPanes.md +0 -377
- package/dist/ai/source/CommonInputWrapper.md +0 -584
- package/dist/alert-variants.d.ts +0 -19
- package/dist/assets/svgs/sort.svg_raw.js +0 -4
- package/dist/badge-variants.d.ts +0 -19
- package/dist/button-variants.d.ts +0 -21
- package/dist/components/BbBadge/BadgeAppendIcon.vue.d.ts +0 -3
- package/dist/components/BbBadge/BadgeAppendIcon.vue.js +0 -5
- package/dist/components/BbBadge/BadgeAppendIcon.vue_vue_type_script_setup_true_lang.js +0 -22
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue.d.ts +0 -40
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue.js +0 -6
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue_vue_type_script_setup_true_lang.js +0 -145
- package/dist/components/BbBaseCheckbox/types.d.ts +0 -224
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue.d.ts +0 -19
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue.js +0 -6
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue_vue_type_script_setup_true_lang.js +0 -190
- package/dist/components/BbBaseCheckboxGroup/types.d.ts +0 -257
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue.d.ts +0 -43
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue.js +0 -6
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue_vue_type_script_setup_true_lang.js +0 -184
- package/dist/components/BbBaseColorInput/types.d.ts +0 -219
- package/dist/components/BbBaseColorPalette/BbBaseColorPalette.vue.d.ts +0 -13
- package/dist/components/BbBaseColorPalette/BbBaseColorPalette.vue_vue_type_script_setup_true_lang.js +0 -395
- package/dist/components/BbBaseColorPalette/types.d.ts +0 -40
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue.d.ts +0 -20
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue.js +0 -6
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue_vue_type_script_setup_true_lang.js +0 -407
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue.d.ts +0 -47
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue.js +0 -5
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue_vue_type_script_setup_true_lang.js +0 -318
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue.js +0 -5
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue_vue_type_script_setup_true_lang.js +0 -115
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerYearSelector.vue.js +0 -5
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerYearSelector.vue_vue_type_script_setup_true_lang.js +0 -116
- package/dist/components/BbBaseDatePicker/types.d.ts +0 -108
- package/dist/components/BbBaseDatePicker/useDatePickerContext.js +0 -11
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue.d.ts +0 -31
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue.js +0 -6
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue_vue_type_script_setup_true_lang.js +0 -737
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue.js +0 -6
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue_vue_type_script_setup_true_lang.js +0 -204
- package/dist/components/BbBaseDatePickerInput/types.d.ts +0 -325
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue.js +0 -6
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue_vue_type_script_setup_true_lang.js +0 -190
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue.d.ts +0 -52
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue.js +0 -6
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue_vue_type_script_setup_true_lang.js +0 -215
- package/dist/components/BbBaseNumberInput/types.d.ts +0 -211
- package/dist/components/BbBaseRadio/BbBaseRadio.vue.d.ts +0 -33
- package/dist/components/BbBaseRadio/BbBaseRadio.vue_vue_type_script_setup_true_lang.js +0 -113
- package/dist/components/BbBaseRadio/types.d.ts +0 -179
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue.d.ts +0 -19
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue_vue_type_script_setup_true_lang.js +0 -179
- package/dist/components/BbBaseRadioGroup/types.d.ts +0 -223
- package/dist/components/BbBaseRating/BbBaseRating.vue.d.ts +0 -38
- package/dist/components/BbBaseRating/BbBaseRating.vue.js +0 -6
- package/dist/components/BbBaseRating/BbBaseRating.vue_vue_type_script_setup_true_lang.js +0 -192
- package/dist/components/BbBaseRating/types.d.ts +0 -176
- package/dist/components/BbBaseSelect/BbBaseSelect.vue.d.ts +0 -19
- package/dist/components/BbBaseSelect/BbBaseSelect.vue.js +0 -6
- package/dist/components/BbBaseSelect/BbBaseSelect.vue_vue_type_script_setup_true_lang.js +0 -311
- package/dist/components/BbBaseSelect/types.d.ts +0 -297
- package/dist/components/BbBaseSlider/BbBaseSlider.vue.d.ts +0 -35
- package/dist/components/BbBaseSlider/BbBaseSlider.vue.js +0 -6
- package/dist/components/BbBaseSlider/BbBaseSlider.vue_vue_type_script_setup_true_lang.js +0 -340
- package/dist/components/BbBaseSlider/types.d.ts +0 -200
- package/dist/components/BbBaseSwitch/BbBaseSwitch.vue.d.ts +0 -35
- package/dist/components/BbBaseSwitch/BbBaseSwitch.vue_vue_type_script_setup_true_lang.js +0 -146
- package/dist/components/BbBaseSwitch/types.d.ts +0 -10
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue.d.ts +0 -19
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue.js +0 -6
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue_vue_type_script_setup_true_lang.js +0 -190
- package/dist/components/BbBaseSwitchGroup/types.d.ts +0 -8
- package/dist/components/BbBaseTag/BbBaseTag.vue.d.ts +0 -50
- package/dist/components/BbBaseTag/BbBaseTag.vue.js +0 -6
- package/dist/components/BbBaseTag/BbBaseTag.vue_vue_type_script_setup_true_lang.js +0 -266
- package/dist/components/BbBaseTag/types.d.ts +0 -160
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue.d.ts +0 -45
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue.js +0 -6
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue_vue_type_script_setup_true_lang.js +0 -200
- package/dist/components/BbBaseTextInput/types.d.ts +0 -209
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue.d.ts +0 -39
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue.js +0 -6
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue_vue_type_script_setup_true_lang.js +0 -187
- package/dist/components/BbBaseTextarea/types.d.ts +0 -170
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue.d.ts +0 -27
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue.js +0 -6
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue_vue_type_script_setup_true_lang.js +0 -519
- package/dist/components/BbBaseTimePickerInput/types.d.ts +0 -151
- package/dist/components/BbTabs/BbTabsPanes.vue.d.ts +0 -16
- package/dist/components/BbTabs/BbTabsPanes.vue.js +0 -6
- package/dist/components/BbTabs/BbTabsPanes.vue_vue_type_script_setup_true_lang.js +0 -35
- package/dist/components/CommonInputWrapper/CommonInputWrapper.vue.js +0 -6
- package/dist/components/CommonInputWrapper/CommonInputWrapper.vue_vue_type_script_setup_true_lang.js +0 -107
- package/dist/confirm-variants.d.ts +0 -17
- package/dist/dropdown-item-variants.d.ts +0 -17
- package/dist/indicator-variants.d.ts +0 -20
- package/dist/locale-registry.d.ts +0 -37
- package/dist/toast-variants.d.ts +0 -20
- package/dist/tooltip-variants.d.ts +0 -17
- package/dist/types/InputDirection.d.ts +0 -15
- package/dist/validated/BbCheckbox.vue.d.ts +0 -29
- package/dist/validated/BbCheckbox.vue.js +0 -5
- package/dist/validated/BbCheckbox.vue_vue_type_script_setup_true_lang.js +0 -75
- package/dist/validated/BbCheckboxGroup.vue.d.ts +0 -34
- package/dist/validated/BbCheckboxGroup.vue.js +0 -5
- package/dist/validated/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +0 -82
- package/dist/validated/BbColorInput.vue.d.ts +0 -37
- package/dist/validated/BbColorInput.vue.js +0 -5
- package/dist/validated/BbColorInput.vue_vue_type_script_setup_true_lang.js +0 -75
- package/dist/validated/BbDatePickerInput.vue.d.ts +0 -41
- package/dist/validated/BbDatePickerInput.vue.js +0 -5
- package/dist/validated/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +0 -90
- package/dist/validated/BbDropzone.vue.d.ts +0 -24
- package/dist/validated/BbDropzone.vue.js +0 -5
- package/dist/validated/BbDropzone.vue_vue_type_script_setup_true_lang.js +0 -45
- package/dist/validated/BbForm.vue.d.ts +0 -28
- package/dist/validated/BbForm.vue_vue_type_script_setup_true_lang.js +0 -42
- package/dist/validated/BbNumberInput.vue.d.ts +0 -36
- package/dist/validated/BbNumberInput.vue.js +0 -5
- package/dist/validated/BbNumberInput.vue_vue_type_script_setup_true_lang.js +0 -72
- package/dist/validated/BbRadioGroup.vue.d.ts +0 -34
- package/dist/validated/BbRadioGroup.vue.js +0 -5
- package/dist/validated/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +0 -78
- package/dist/validated/BbRating.vue.d.ts +0 -30
- package/dist/validated/BbRating.vue.js +0 -5
- package/dist/validated/BbRating.vue_vue_type_script_setup_true_lang.js +0 -63
- package/dist/validated/BbSelect.vue.d.ts +0 -46
- package/dist/validated/BbSelect.vue.js +0 -5
- package/dist/validated/BbSelect.vue_vue_type_script_setup_true_lang.js +0 -109
- package/dist/validated/BbSlider.vue.d.ts +0 -36
- package/dist/validated/BbSlider.vue.js +0 -5
- package/dist/validated/BbSlider.vue_vue_type_script_setup_true_lang.js +0 -69
- package/dist/validated/BbSwitch.vue.d.ts +0 -29
- package/dist/validated/BbSwitch.vue.js +0 -5
- package/dist/validated/BbSwitch.vue_vue_type_script_setup_true_lang.js +0 -75
- package/dist/validated/BbSwitchGroup.vue.d.ts +0 -34
- package/dist/validated/BbSwitchGroup.vue.js +0 -5
- package/dist/validated/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +0 -82
- package/dist/validated/BbTag.vue.d.ts +0 -36
- package/dist/validated/BbTag.vue.js +0 -5
- package/dist/validated/BbTag.vue_vue_type_script_setup_true_lang.js +0 -72
- package/dist/validated/BbTextInput.vue.d.ts +0 -36
- package/dist/validated/BbTextInput.vue.js +0 -5
- package/dist/validated/BbTextInput.vue_vue_type_script_setup_true_lang.js +0 -72
- package/dist/validated/BbTextarea.vue.d.ts +0 -36
- package/dist/validated/BbTextarea.vue.js +0 -5
- package/dist/validated/BbTextarea.vue_vue_type_script_setup_true_lang.js +0 -70
- package/dist/validated/BbTimePickerInput.vue.d.ts +0 -37
- package/dist/validated/BbTimePickerInput.vue.js +0 -5
- package/dist/validated/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +0 -81
- package/dist/validated/index.d.ts +0 -43
- package/dist/validated/useValidatedField.d.ts +0 -93
- package/dist/validated/useValidatedField.js +0 -51
- package/dist/validated.js +0 -21
- /package/dist/components/{BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue.d.ts → BbCalendar/CalendarMonthPanel.vue.d.ts} +0 -0
- /package/dist/components/{BbBaseDatePicker/BbBaseDatePickerYearSelector.vue.d.ts → BbCalendar/CalendarYearPanel.vue.d.ts} +0 -0
- /package/dist/{components/BbBaseDatePicker/typeahead.d.ts → composables/useTypeahead.d.ts} +0 -0
- /package/dist/{components/BbBaseDatePicker/typeahead.js → composables/useTypeahead.js} +0 -0
package/dist/ai/BbDropdown.md
CHANGED
|
@@ -4,16 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
- Safety level: **Consumer API**
|
|
6
6
|
- Group: **Overlay**
|
|
7
|
-
- Description: Displays contextual action menus and menu content.
|
|
7
|
+
- Description: Displays contextual action menus and menu content (includes the co-located BbDropdownGroup export, which is how a selectable group is bound).
|
|
8
8
|
- Usage rule: Prefer this component for consumer-facing implementations.
|
|
9
9
|
- Implementation source (only when the contract below is not enough): [source/BbDropdown.md](./source/BbDropdown.md)
|
|
10
10
|
|
|
11
|
+
## Reachable through `BbDropdown`
|
|
12
|
+
|
|
13
|
+
`BbDropdown` mounts other components (all of them: _Component tree_, near the end). These are the parts of its API that land inside them. Prefer these over `:deep()` on an inner class (allowed, unsupported: it can break on upgrade) — and never an import of an internal component.
|
|
14
|
+
|
|
15
|
+
| pt part | Lands on | In |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `pt:panel` | the root of `CommonPopover` | `CommonPopover` _(internal)_ |
|
|
18
|
+
| `pt:root` | the root of `CommonPopover` | `CommonPopover` _(internal)_ |
|
|
19
|
+
| `pt:header` | `pt:header` of `BbOffCanvas` | `BbOffCanvas` ([contract](./BbOffCanvas.md)) |
|
|
20
|
+
| `pt:footer` | `pt:footer` of `BbOffCanvas` | `BbOffCanvas` ([contract](./BbOffCanvas.md)) |
|
|
21
|
+
| `pt:panel` | `pt:root` of `BbOffCanvas` | `BbOffCanvas` ([contract](./BbOffCanvas.md)) |
|
|
22
|
+
| `pt:sheet` | `pt:root` of `BbOffCanvas` | `BbOffCanvas` ([contract](./BbOffCanvas.md)) |
|
|
23
|
+
|
|
11
24
|
## Usage & Guidelines
|
|
12
25
|
|
|
13
26
|
### When to use
|
|
14
27
|
|
|
15
28
|
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
|
|
29
|
+
trigger: an overflow "…" menu on a row, an account menu, a context menu, a
|
|
30
|
+
workspace / team / tenant **switcher** (see § Rows that stand for records). You
|
|
17
31
|
describe the menu declaratively through `items` and spread the `activator`
|
|
18
32
|
slot's `props` onto your own trigger (or attach the menu with the
|
|
19
33
|
`v-bb-dropdown` directive — see below).
|
|
@@ -45,8 +59,18 @@ An `items` entry is one of three shapes, and you can mix them freely:
|
|
|
45
59
|
Each item extends `BbBaseButton`'s prop surface, so an item is an action, a
|
|
46
60
|
link, or a submenu opener depending on which fields it carries:
|
|
47
61
|
|
|
48
|
-
- `key`
|
|
49
|
-
|
|
62
|
+
- `key` — stable identity. **Required** wherever something outside the menu
|
|
63
|
+
reads it: a row in a `selectable` group (the v-model holds it), a row or
|
|
64
|
+
group with a slot of its own (`#<key>` is named by it), and a group that is
|
|
65
|
+
selectable or bound by a `<BbDropdownGroup id>`. **Optional** on a plain
|
|
66
|
+
action row (one with an `onClick`, `href` or submenu) and on a layout-only
|
|
67
|
+
group: the dropdown then keys the row internally from its text, and nothing
|
|
68
|
+
outside ever sees that identity. Why the split: an identifier something
|
|
69
|
+
outside reads must be one you wrote — derived from the label it would change
|
|
70
|
+
with every translation and copy edit. So a keyless row in a selectable group
|
|
71
|
+
renders but can't be selected, and two keyless rows with the same text in one
|
|
72
|
+
group need keys (the same text across groups is fine); `bitboss-ui check`
|
|
73
|
+
flags both when the items are in the same file.
|
|
50
74
|
- `text` — the label; `description` adds a muted second line (the row grows,
|
|
51
75
|
icons stay aligned with the title line).
|
|
52
76
|
- `onClick` — makes it an **action**. Never navigate from here.
|
|
@@ -55,8 +79,9 @@ link, or a submenu opener depending on which fields it carries:
|
|
|
55
79
|
and any other BbBaseButton nav prop (`target`, active-class props) passes
|
|
56
80
|
through.
|
|
57
81
|
- `items` — makes it a **submenu opener** (see Nested submenus).
|
|
58
|
-
- `prepend:icon` / `append:icon` — leading/trailing icons.
|
|
59
|
-
|
|
82
|
+
- `prepend:icon` / `append:icon` — leading/trailing icons. An edge slot
|
|
83
|
+
replaces them; the trailing icon also gives way to a submenu chevron and, on
|
|
84
|
+
the selected row, to the selection check (see § Per-item and per-group slots).
|
|
60
85
|
- `variant` — visual tone. Only `destructive` is styled out of the box; the
|
|
61
86
|
`dropdownItemVariants` plugin option registers more typed names, each
|
|
62
87
|
rendering a `bb-dropdown__item--variant-<name>` class hook you style yourself.
|
|
@@ -71,21 +96,21 @@ yes (the `<BbConfirm>` host mounts once per app, e.g. in the root layout).
|
|
|
71
96
|
```vue
|
|
72
97
|
<template>
|
|
73
98
|
<div
|
|
74
|
-
class="flex max-w-sm items-center gap-2 rounded-
|
|
99
|
+
class="flex max-w-sm items-center gap-2 rounded-(--bb-radius) border p-2"
|
|
75
100
|
>
|
|
76
101
|
<div
|
|
77
102
|
aria-hidden="true"
|
|
78
|
-
class="flex size-8 shrink-0 items-center justify-center rounded-
|
|
103
|
+
class="flex size-8 shrink-0 items-center justify-center rounded-(--bb-radius-sm) bg-(--bb-muted) text-(--bb-text-muted)"
|
|
79
104
|
>
|
|
80
105
|
<span class="text-xs font-medium">PDF</span>
|
|
81
106
|
</div>
|
|
82
107
|
<div class="min-w-0 flex-1">
|
|
83
108
|
<p class="truncate text-sm font-medium">Q3-report.pdf</p>
|
|
84
|
-
<p class="text-xs text-
|
|
109
|
+
<p class="text-xs text-(--bb-text-muted)">
|
|
85
110
|
248 KB · <span data-last>{{ last }}</span>
|
|
86
111
|
</p>
|
|
87
112
|
</div>
|
|
88
|
-
<BbDropdown :items="items" placement="bottom-end"
|
|
113
|
+
<BbDropdown :items="items" placement="bottom-end">
|
|
89
114
|
<template #activator="{ props }">
|
|
90
115
|
<BbButton
|
|
91
116
|
v-bind="props"
|
|
@@ -194,17 +219,17 @@ selectable group the menu stays open instead, and the row itself carries
|
|
|
194
219
|
```vue
|
|
195
220
|
<template>
|
|
196
221
|
<div
|
|
197
|
-
class="flex max-w-sm items-center gap-2 rounded-
|
|
222
|
+
class="flex max-w-sm items-center gap-2 rounded-(--bb-radius) border p-2"
|
|
198
223
|
>
|
|
199
224
|
<div class="min-w-0 flex-1">
|
|
200
225
|
<p class="truncate text-sm font-medium">bitboss/storefront</p>
|
|
201
|
-
<p class="text-xs text-
|
|
226
|
+
<p class="text-xs text-(--bb-text-muted)" data-sync>
|
|
202
227
|
{{ status }}
|
|
203
228
|
</p>
|
|
204
229
|
</div>
|
|
205
230
|
<!-- `adaptive` is pinned off so the demo behaves identically on any
|
|
206
231
|
viewport; leave it at the project default in real apps. -->
|
|
207
|
-
<BbDropdown :adaptive="false" :items="items"
|
|
232
|
+
<BbDropdown :adaptive="false" :items="items">
|
|
208
233
|
<template #activator="{ props, loading }">
|
|
209
234
|
<!-- The slot's `loading` flag is true while any item's async
|
|
210
235
|
`onClick` is in flight — even after the menu has closed. -->
|
|
@@ -268,10 +293,10 @@ nesting shallow (two levels is plenty).
|
|
|
268
293
|
```vue
|
|
269
294
|
<template>
|
|
270
295
|
<div
|
|
271
|
-
class="flex max-w-xs items-center justify-between gap-2 rounded-
|
|
296
|
+
class="flex max-w-xs items-center justify-between gap-2 rounded-(--bb-radius) border p-2"
|
|
272
297
|
>
|
|
273
298
|
<span class="text-sm font-medium">Acme Studio</span>
|
|
274
|
-
<BbDropdown :items="items" placement="bottom-end"
|
|
299
|
+
<BbDropdown :items="items" placement="bottom-end">
|
|
275
300
|
<template #activator="{ props }">
|
|
276
301
|
<BbButton
|
|
277
302
|
v-bind="props"
|
|
@@ -334,15 +359,69 @@ const items: BbDropdownItem[] = [
|
|
|
334
359
|
Turn a group into a chooser by marking it `selectable` (single choice, radio
|
|
335
360
|
semantics) or `selectable` + `multiple` (many choices, checkbox semantics).
|
|
336
361
|
Selected rows render a check on the right (replacing any `append:icon`).
|
|
362
|
+
**Bind the selection with a `<BbDropdownGroup>` companion** whose `id` is the
|
|
363
|
+
group's `key` (details below):
|
|
364
|
+
|
|
365
|
+
```vue
|
|
366
|
+
<BbDropdown
|
|
367
|
+
:items="[
|
|
368
|
+
{
|
|
369
|
+
key: 'status',
|
|
370
|
+
label: 'Status',
|
|
371
|
+
selectable: true,
|
|
372
|
+
multiple: true,
|
|
373
|
+
items: [
|
|
374
|
+
{ key: 'open', text: 'Open' },
|
|
375
|
+
{ key: 'paid', text: 'Paid' },
|
|
376
|
+
],
|
|
377
|
+
},
|
|
378
|
+
]"
|
|
379
|
+
>
|
|
380
|
+
<!-- selectedStatuses = ref<string[]>([]) — the checked rows' keys -->
|
|
381
|
+
<BbDropdownGroup id="status" v-model="selectedStatuses" />
|
|
382
|
+
</BbDropdown>
|
|
383
|
+
```
|
|
384
|
+
|
|
337
385
|
Behavior you can rely on:
|
|
338
386
|
|
|
339
|
-
- a **single**
|
|
340
|
-
|
|
387
|
+
- a **single** group is a radio group: re-clicking the selected row keeps it
|
|
388
|
+
(the row's `onClick` still runs, no `item:selected` / `item:unselected`
|
|
389
|
+
fires). Add `clearable: true` to the group to make that re-click clear it.
|
|
390
|
+
When the group is the sole top-level selectable group, picking a value
|
|
391
|
+
(the same one included) also closes the menu;
|
|
341
392
|
- a **multiple** group keeps the menu open while you toggle;
|
|
342
393
|
- the dropdown emits `item:selected` / `item:unselected` with the changed item's
|
|
343
394
|
**value** (its `item-value` for pipeline groups, else its `key`) whenever any
|
|
344
395
|
selectable group changes — the same value shape `BbTable` emits.
|
|
345
396
|
|
|
397
|
+
**Gating individual rows.** `selectable` also takes a function
|
|
398
|
+
`(item) => boolean`, the same contract as `BbSelect` and the option groups:
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
const statusGroup = {
|
|
402
|
+
key: 'status',
|
|
403
|
+
multiple: true,
|
|
404
|
+
selectable: (row: { archived?: boolean }) => !row.archived,
|
|
405
|
+
items: statuses,
|
|
406
|
+
};
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
- The group is still a selectable group (a function counts as `true`): checks,
|
|
410
|
+
`menuitemcheckbox` / `menuitemradio` roles, the menu stays open while
|
|
411
|
+
toggling.
|
|
412
|
+
- A row the function rejects renders **disabled**: clicks do nothing and
|
|
413
|
+
keyboard navigation skips it.
|
|
414
|
+
- The lock holds on a row that is **already selected** — it cannot be
|
|
415
|
+
unselected by a click.
|
|
416
|
+
- `max` stays a soft cap on top: at the limit, unselected rows disable but
|
|
417
|
+
selected ones stay live so the user can swap.
|
|
418
|
+
- The function receives the **row object** in a hand-written group and the
|
|
419
|
+
**raw fetched item** in a fetched group.
|
|
420
|
+
- `useBbDropdownContext(id).groups[key].selectable` stays a plain `true`.
|
|
421
|
+
|
|
422
|
+
This is also how a fetched row gets disabled — see
|
|
423
|
+
[why fetched rows have no `disabled`](#additional-row-fields-itemprops).
|
|
424
|
+
|
|
346
425
|
Selection state lives on the dropdown; a companion `<BbDropdownGroup>` in the
|
|
347
426
|
default slot binds to it. The companion is intentionally minimal — it takes
|
|
348
427
|
only the group's `id` (which must match the group's `key` in `items`) and a
|
|
@@ -352,17 +431,21 @@ the same `item:selected` / `item:unselected` pair. Two hard rules, enforced
|
|
|
352
431
|
with thrown errors: a `multiple` group's model must be an array, and the `id`
|
|
353
432
|
must point at a _group_ (not a plain item, not a missing key).
|
|
354
433
|
|
|
434
|
+
Bind that `v-model` straight to your own state. A single group can no longer
|
|
435
|
+
be emptied by accident, so there is nothing to guard: no `@update` handler
|
|
436
|
+
that refuses `null`, no computed setter that writes the value back.
|
|
437
|
+
|
|
355
438
|
**Radio and checkbox groups**
|
|
356
439
|
|
|
357
440
|
```vue
|
|
358
441
|
<template>
|
|
359
442
|
<div
|
|
360
|
-
class="flex max-w-md flex-wrap items-center gap-2 rounded-
|
|
443
|
+
class="flex max-w-md flex-wrap items-center gap-2 rounded-(--bb-radius) border p-2"
|
|
361
444
|
>
|
|
362
|
-
<span class="pr-1 text-xs font-medium text-
|
|
445
|
+
<span class="pr-1 text-xs font-medium text-(--bb-text-muted)"
|
|
363
446
|
>Invoices</span
|
|
364
447
|
>
|
|
365
|
-
<BbDropdown :adaptive="false" :items="items" :width="
|
|
448
|
+
<BbDropdown :adaptive="false" :items="items" :width="200">
|
|
366
449
|
<template #activator="{ props }">
|
|
367
450
|
<BbButton
|
|
368
451
|
v-bind="props"
|
|
@@ -378,7 +461,7 @@ must point at a _group_ (not a plain item, not a missing key).
|
|
|
378
461
|
<BbDropdownGroup id="sort" v-model="sortBy" />
|
|
379
462
|
<BbDropdownGroup id="tags" v-model="tags" />
|
|
380
463
|
</BbDropdown>
|
|
381
|
-
<span class="text-xs text-
|
|
464
|
+
<span class="text-xs text-(--bb-text-muted)">
|
|
382
465
|
Sort: <span data-sort>{{ sortBy }}</span> · Tags:
|
|
383
466
|
<span data-tags>{{ tags.join(', ') || 'none' }}</span>
|
|
384
467
|
</span>
|
|
@@ -420,6 +503,84 @@ const tags = ref<string[]>(['overdue']);
|
|
|
420
503
|
</script>
|
|
421
504
|
```
|
|
422
505
|
|
|
506
|
+
#### The same choices in two places
|
|
507
|
+
|
|
508
|
+
Item keys are scoped to their **group** for selection. Two groups can both
|
|
509
|
+
list `doctors` and `rooms` (say a day layout at the top level and a week
|
|
510
|
+
layout inside a `Week ›` submenu) and each keeps its own pick, with its own
|
|
511
|
+
companion and `v-model`.
|
|
512
|
+
|
|
513
|
+
To show a submenu's current pick on its parent row, compute the row from the
|
|
514
|
+
same state. `items` is reactive config, so the parent's `description` (or its
|
|
515
|
+
`#<key>:append` slot) follows the submenu group's `v-model`:
|
|
516
|
+
|
|
517
|
+
**A submenu's pick on its parent row**
|
|
518
|
+
|
|
519
|
+
```vue
|
|
520
|
+
<template>
|
|
521
|
+
<div class="flex max-w-md flex-wrap items-center gap-2">
|
|
522
|
+
<BbDropdown :adaptive="false" :items="items" :width="220">
|
|
523
|
+
<template #activator="{ props }">
|
|
524
|
+
<BbButton
|
|
525
|
+
v-bind="props"
|
|
526
|
+
append:icon="lucide:chevron-down"
|
|
527
|
+
size="xs"
|
|
528
|
+
variant="outline"
|
|
529
|
+
>
|
|
530
|
+
Layout
|
|
531
|
+
</BbButton>
|
|
532
|
+
</template>
|
|
533
|
+
<!-- Both groups list the same keys; each keeps its own selection. -->
|
|
534
|
+
<BbDropdownGroup id="day" v-model="day" />
|
|
535
|
+
<BbDropdownGroup id="week" v-model="week" />
|
|
536
|
+
</BbDropdown>
|
|
537
|
+
<span class="text-xs text-(--bb-text-muted)">
|
|
538
|
+
Day: <span data-day>{{ day }}</span> · Week:
|
|
539
|
+
<span data-week>{{ week }}</span>
|
|
540
|
+
</span>
|
|
541
|
+
</div>
|
|
542
|
+
</template>
|
|
543
|
+
<script setup lang="ts">
|
|
544
|
+
import { computed, ref } from 'vue';
|
|
545
|
+
import { BbButton, BbDropdown, BbDropdownGroup } from 'bitboss-ui';
|
|
546
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
547
|
+
|
|
548
|
+
const choices = [
|
|
549
|
+
{ key: 'doctors', text: 'Doctors' },
|
|
550
|
+
{ key: 'rooms', text: 'Rooms' },
|
|
551
|
+
];
|
|
552
|
+
const label = (key: string) =>
|
|
553
|
+
choices.find((choice) => choice.key === key)?.text ?? key;
|
|
554
|
+
|
|
555
|
+
const day = ref('doctors');
|
|
556
|
+
const week = ref('rooms');
|
|
557
|
+
|
|
558
|
+
// `items` is reactive config: the submenu row's `description` is computed
|
|
559
|
+
// from the same state its group writes, so the parent row always shows the
|
|
560
|
+
// current pick ("Week · Rooms") without opening the submenu.
|
|
561
|
+
const items = computed<BbDropdownItem[]>(() => [
|
|
562
|
+
{ key: 'day', label: 'Day', selectable: true, items: choices },
|
|
563
|
+
{
|
|
564
|
+
key: 'week-menu',
|
|
565
|
+
text: 'Week',
|
|
566
|
+
description: label(week.value),
|
|
567
|
+
items: [{ key: 'week', selectable: true, items: choices }],
|
|
568
|
+
},
|
|
569
|
+
]);
|
|
570
|
+
</script>
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
Three things still go by the bare key across the whole menu, so give those
|
|
574
|
+
rows distinct keys when it matters:
|
|
575
|
+
|
|
576
|
+
- **`#<key>` row slots.** `#doctors` fills every row keyed `doctors`, in every
|
|
577
|
+
group. Use `#<groupKey>:item` (with the `item` payload) to target one
|
|
578
|
+
group's rows.
|
|
579
|
+
- **The async loading flag.** While a row's async `onClick` runs, every row
|
|
580
|
+
with that key shows as loading.
|
|
581
|
+
- **Submenu parents.** A row that opens a submenu needs a key unique in the
|
|
582
|
+
whole menu; the flyout is addressed by it.
|
|
583
|
+
|
|
423
584
|
### Loading options on demand
|
|
424
585
|
|
|
425
586
|
For options that come from an API, make the group a **pipeline group**: pass an
|
|
@@ -429,20 +590,22 @@ The full grammar:
|
|
|
429
590
|
|
|
430
591
|
- `items: (prefill, modelValue) => raw[] | Promise<raw[]>` — called lazily on
|
|
431
592
|
the menu's **first open**, never on mount, and again whenever `dependencies`
|
|
432
|
-
change. `modelValue` is the group's current selection
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
593
|
+
change. `modelValue` is the group's current selection. A plain raw array also
|
|
594
|
+
works when you just need the mapping.
|
|
595
|
+
On a **`searchable`** group the signature gains a leading query argument —
|
|
596
|
+
`(query, prefill, modelValue)`, identical to `BbSelect`'s — which is why the
|
|
597
|
+
same provider drops into both.
|
|
436
598
|
- `itemText` / `itemValue` — a path string or getter producing each raw item's
|
|
437
599
|
label and value. `v-model` on the companion surfaces the selected value(s);
|
|
438
|
-
internally the selection key is a hash of the value.
|
|
439
|
-
|
|
440
|
-
|
|
600
|
+
internally the selection key is a hash of the value.
|
|
601
|
+
- `itemProps` — every **additional** field of a row (see
|
|
602
|
+
[Additional row fields](#additional-row-fields-itemprops) below). Nothing
|
|
603
|
+
else is read off the raw item.
|
|
441
604
|
- `max` — caps a multiple selection; once reached, unselected rows render
|
|
442
605
|
disabled.
|
|
443
|
-
- `loadingText` / `
|
|
444
|
-
dropdown-level `loading-text` / `
|
|
445
|
-
groups, and the `#loading` / `#
|
|
606
|
+
- `loadingText` / `emptyText` — placeholder row text per group; the
|
|
607
|
+
dropdown-level `loading-text` / `empty-text` props set the default for all
|
|
608
|
+
groups, and the `#loading` / `#empty` slots (payload: `{ text, groupKey }`)
|
|
446
609
|
replace the placeholder rows entirely.
|
|
447
610
|
- `dependencies: [...]` + `depsDebounceTime` — re-run the getter (debounced)
|
|
448
611
|
when any dependency changes, e.g. a search field feeding the fetch.
|
|
@@ -455,11 +618,11 @@ The full grammar:
|
|
|
455
618
|
```vue
|
|
456
619
|
<template>
|
|
457
620
|
<div
|
|
458
|
-
class="flex max-w-sm flex-wrap items-center gap-2 rounded-
|
|
621
|
+
class="flex max-w-sm flex-wrap items-center gap-2 rounded-(--bb-radius) border p-2"
|
|
459
622
|
>
|
|
460
623
|
<div class="min-w-0 flex-1">
|
|
461
624
|
<p class="truncate text-sm font-medium">INV-2048 · Northwind</p>
|
|
462
|
-
<p class="text-xs text-
|
|
625
|
+
<p class="text-xs text-(--bb-text-muted)">
|
|
463
626
|
Assignees ·
|
|
464
627
|
<span data-count>{{ assignees.length }} selected</span>
|
|
465
628
|
</p>
|
|
@@ -534,16 +697,17 @@ a valid selection.
|
|
|
534
697
|
```vue
|
|
535
698
|
<template>
|
|
536
699
|
<div
|
|
537
|
-
class="flex max-w-md flex-wrap items-center gap-2 rounded-
|
|
700
|
+
class="flex max-w-md flex-wrap items-center gap-2 rounded-(--bb-radius) border p-2"
|
|
538
701
|
>
|
|
539
|
-
<span class="pr-1 text-xs font-medium text-
|
|
540
|
-
|
|
541
|
-
|
|
702
|
+
<span class="pr-1 text-xs font-medium text-(--bb-text-muted)">Board</span>
|
|
703
|
+
<!-- A filter toolbar is a dense surface: `compact` rows, like the
|
|
704
|
+
BbSelectPopover filter pills. -->
|
|
542
705
|
<BbDropdown
|
|
543
706
|
:adaptive="false"
|
|
707
|
+
compact
|
|
544
708
|
:items="menu"
|
|
545
709
|
loading-text="Loading members…"
|
|
546
|
-
:width="
|
|
710
|
+
:width="200"
|
|
547
711
|
>
|
|
548
712
|
<template #activator="{ props, loading }">
|
|
549
713
|
<BbButton
|
|
@@ -559,7 +723,7 @@ a valid selection.
|
|
|
559
723
|
<BbDropdownGroup id="board" v-model="board" />
|
|
560
724
|
<BbDropdownGroup id="assignees" v-model="assignees" />
|
|
561
725
|
</BbDropdown>
|
|
562
|
-
<span class="text-xs text-
|
|
726
|
+
<span class="text-xs text-(--bb-text-muted)">
|
|
563
727
|
<span data-board>{{ board ?? 'all boards' }}</span> ·
|
|
564
728
|
<span data-assignees>{{ assigneeNames || 'anyone' }}</span>
|
|
565
729
|
</span>
|
|
@@ -637,6 +801,303 @@ const assigneeNames = computed(() =>
|
|
|
637
801
|
</script>
|
|
638
802
|
```
|
|
639
803
|
|
|
804
|
+
### Additional row fields: `itemProps`
|
|
805
|
+
|
|
806
|
+
A fetched row's **text** and **value** come from `itemText` and `itemValue`.
|
|
807
|
+
Everything **else** about the row comes from `itemProps` — and only from there.
|
|
808
|
+
The raw item is data: a `href`, `disabled` or `prepend:icon` field sitting on it
|
|
809
|
+
does nothing on its own.
|
|
810
|
+
|
|
811
|
+
```ts
|
|
812
|
+
const assigneeGroup = {
|
|
813
|
+
key: 'assignee',
|
|
814
|
+
selectable: true,
|
|
815
|
+
items: () => api.users(),
|
|
816
|
+
itemText: 'name',
|
|
817
|
+
itemValue: 'id',
|
|
818
|
+
itemProps: { description: 'email', 'prepend:icon': 'avatarIcon' },
|
|
819
|
+
};
|
|
820
|
+
```
|
|
821
|
+
|
|
822
|
+
**Fetched assignees: description, icon, selectable gate, context**
|
|
823
|
+
|
|
824
|
+
```vue
|
|
825
|
+
<template>
|
|
826
|
+
<div
|
|
827
|
+
class="flex max-w-sm flex-wrap items-center gap-2 rounded-(--bb-radius) border p-2"
|
|
828
|
+
>
|
|
829
|
+
<div class="min-w-0 flex-1">
|
|
830
|
+
<p class="truncate text-sm font-medium">INV-2048 · Northwind</p>
|
|
831
|
+
<p class="assignee-emails truncate text-xs text-(--bb-text-muted)">
|
|
832
|
+
{{ emails || 'No assignees' }}
|
|
833
|
+
</p>
|
|
834
|
+
</div>
|
|
835
|
+
<BbDropdown
|
|
836
|
+
id="invoice-assignees"
|
|
837
|
+
:items="items"
|
|
838
|
+
loading-text="Loading team…"
|
|
839
|
+
:width="260"
|
|
840
|
+
>
|
|
841
|
+
<template #activator="{ props, loading }">
|
|
842
|
+
<BbButton
|
|
843
|
+
v-bind="props"
|
|
844
|
+
append:icon="lucide:chevron-down"
|
|
845
|
+
:loading="loading"
|
|
846
|
+
size="xs"
|
|
847
|
+
variant="outline"
|
|
848
|
+
>
|
|
849
|
+
Assign
|
|
850
|
+
</BbButton>
|
|
851
|
+
</template>
|
|
852
|
+
<BbDropdownGroup id="assignees" v-model="assignees" />
|
|
853
|
+
</BbDropdown>
|
|
854
|
+
</div>
|
|
855
|
+
</template>
|
|
856
|
+
<script setup lang="ts">
|
|
857
|
+
import { computed, ref } from 'vue';
|
|
858
|
+
import {
|
|
859
|
+
BbButton,
|
|
860
|
+
BbDropdown,
|
|
861
|
+
BbDropdownGroup,
|
|
862
|
+
useBbDropdownContext,
|
|
863
|
+
} from 'bitboss-ui';
|
|
864
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
865
|
+
|
|
866
|
+
type Member = { id: string; name: string; email: string; active: boolean };
|
|
867
|
+
|
|
868
|
+
const team: Member[] = [
|
|
869
|
+
{
|
|
870
|
+
id: 'u1',
|
|
871
|
+
name: 'Sofia Esposito',
|
|
872
|
+
email: 'sofia@example.com',
|
|
873
|
+
active: true,
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
id: 'u2',
|
|
877
|
+
name: 'Marco Bianchi',
|
|
878
|
+
email: 'marco@example.com',
|
|
879
|
+
active: false,
|
|
880
|
+
},
|
|
881
|
+
{ id: 'u3', name: 'Aisha Khan', email: 'aisha@example.com', active: true },
|
|
882
|
+
];
|
|
883
|
+
|
|
884
|
+
const items: BbDropdownItem[] = [
|
|
885
|
+
{
|
|
886
|
+
key: 'assignees',
|
|
887
|
+
label: 'Assign to',
|
|
888
|
+
multiple: true,
|
|
889
|
+
// Fetched rows take their text and value from `itemText` / `itemValue`,
|
|
890
|
+
// and EVERY other field only from `itemProps` — a raw `disabled` or
|
|
891
|
+
// `prepend:icon` sitting on the item would do nothing.
|
|
892
|
+
itemText: 'name',
|
|
893
|
+
itemValue: 'id',
|
|
894
|
+
itemProps: { description: 'email', 'prepend:icon': () => 'lucide:user' },
|
|
895
|
+
// Fetched groups are for selection, so a row is disabled by the group's
|
|
896
|
+
// `selectable` predicate (it receives the RAW member), not by a field.
|
|
897
|
+
selectable: (member: Member) => member.active,
|
|
898
|
+
items: async () => {
|
|
899
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
900
|
+
return team;
|
|
901
|
+
},
|
|
902
|
+
},
|
|
903
|
+
];
|
|
904
|
+
|
|
905
|
+
const assignees = ref<string[]>(['u1']);
|
|
906
|
+
|
|
907
|
+
// The resolved description is on the context's `selectedOptions` too — no
|
|
908
|
+
// second fetch to show the picked emails outside the menu.
|
|
909
|
+
const context = useBbDropdownContext('invoice-assignees');
|
|
910
|
+
const emails = computed(() =>
|
|
911
|
+
(context.groups.value.assignees?.selectedOptions ?? [])
|
|
912
|
+
.map((option) => option.description)
|
|
913
|
+
.filter(Boolean)
|
|
914
|
+
.join(', ')
|
|
915
|
+
);
|
|
916
|
+
</script>
|
|
917
|
+
```
|
|
918
|
+
|
|
919
|
+
**Fetched links: function form with href and a handler**
|
|
920
|
+
|
|
921
|
+
```vue
|
|
922
|
+
<template>
|
|
923
|
+
<div
|
|
924
|
+
class="flex max-w-sm items-center gap-2 rounded-(--bb-radius) border p-2"
|
|
925
|
+
>
|
|
926
|
+
<span class="flex-1 text-sm">Workspace</span>
|
|
927
|
+
<BbDropdown :items="items" :width="260">
|
|
928
|
+
<template #activator="{ props }">
|
|
929
|
+
<BbButton
|
|
930
|
+
v-bind="props"
|
|
931
|
+
append:icon="lucide:chevron-down"
|
|
932
|
+
size="xs"
|
|
933
|
+
variant="outline"
|
|
934
|
+
>
|
|
935
|
+
Projects
|
|
936
|
+
</BbButton>
|
|
937
|
+
</template>
|
|
938
|
+
</BbDropdown>
|
|
939
|
+
<p class="last-opened text-xs text-(--bb-text-muted)">
|
|
940
|
+
{{ lastOpened ?? '' }}
|
|
941
|
+
</p>
|
|
942
|
+
</div>
|
|
943
|
+
</template>
|
|
944
|
+
<script setup lang="ts">
|
|
945
|
+
import { ref } from 'vue';
|
|
946
|
+
import { BbButton, BbDropdown } from 'bitboss-ui';
|
|
947
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
948
|
+
|
|
949
|
+
type Project = { id: string; name: string; client: string; path: string };
|
|
950
|
+
|
|
951
|
+
const recent: Project[] = [
|
|
952
|
+
{ id: 'p1', name: 'Apollo redesign', client: 'Northwind', path: '#apollo' },
|
|
953
|
+
{ id: 'p2', name: 'Gemini billing', client: 'Contoso', path: '#gemini' },
|
|
954
|
+
];
|
|
955
|
+
|
|
956
|
+
const lastOpened = ref<string | null>(null);
|
|
957
|
+
|
|
958
|
+
const items: BbDropdownItem[] = [
|
|
959
|
+
{ key: 'new', text: 'New project', 'prepend:icon': 'lucide:plus' },
|
|
960
|
+
{
|
|
961
|
+
// A fetched group of LINKS (not selectable). Its rows get `href`, an icon,
|
|
962
|
+
// a description and a click handler from `itemProps`, using the function
|
|
963
|
+
// form. In the object form a function is a GETTER, so a handler would be
|
|
964
|
+
// written `onClick: (project) => () => …`; here the function form returns
|
|
965
|
+
// the handler directly.
|
|
966
|
+
key: 'recent',
|
|
967
|
+
label: 'Recent',
|
|
968
|
+
itemText: 'name',
|
|
969
|
+
itemValue: 'id',
|
|
970
|
+
itemProps: (project: Project) => ({
|
|
971
|
+
description: project.client,
|
|
972
|
+
href: project.path,
|
|
973
|
+
'prepend:icon': 'lucide:folder',
|
|
974
|
+
onClick: () => {
|
|
975
|
+
lastOpened.value = project.name;
|
|
976
|
+
},
|
|
977
|
+
}),
|
|
978
|
+
items: async () => recent,
|
|
979
|
+
},
|
|
980
|
+
];
|
|
981
|
+
</script>
|
|
982
|
+
```
|
|
983
|
+
|
|
984
|
+
**Two forms.**
|
|
985
|
+
|
|
986
|
+
- **Object** — one dot-path or getter per field:
|
|
987
|
+
`{ description: 'email', href: (user) => '/users/' + user.id }`. Each field
|
|
988
|
+
resolves on its own.
|
|
989
|
+
- **Function** — one function returning the fields:
|
|
990
|
+
`(user) => ({ description: user.email, href: user.url })`. Called once per
|
|
991
|
+
item and cached.
|
|
992
|
+
|
|
993
|
+
In the object form **a function is always a getter**, so a handler field
|
|
994
|
+
returns the handler: `onClick: (user) => () => openProfile(user)`. (The types
|
|
995
|
+
reject the common slip `onClick: () => openProfile()`, because it doesn't return
|
|
996
|
+
a function.)
|
|
997
|
+
|
|
998
|
+
**Which fields.** Everything a hand-written row accepts, except its identity and
|
|
999
|
+
structure — `key`, `text`, `items`, `group` — and `disabled`:
|
|
1000
|
+
|
|
1001
|
+
- `description` — a muted second line under the text, announced as the row's
|
|
1002
|
+
description (never part of its name), searched with the text, and exposed as
|
|
1003
|
+
`description` on `useBbDropdownContext(id).groups[key].selectedOptions`.
|
|
1004
|
+
- `prepend:icon`, `append:icon`, `variant`.
|
|
1005
|
+
- `onClick`, `href`, `to`, `target`, `rel`, `download`, `external`, and the
|
|
1006
|
+
Inertia visit options.
|
|
1007
|
+
- `meta` — your own data for the row's slots, typically the raw item itself:
|
|
1008
|
+
`(user) => ({ meta: user })`. See § Rows that stand for records.
|
|
1009
|
+
|
|
1010
|
+
An empty value (`null`, `undefined`, `''`) means the field is absent — no empty
|
|
1011
|
+
line, no blank icon, no `href=""`.
|
|
1012
|
+
|
|
1013
|
+
**Why there is no `disabled`: fetched groups are for selection.** This is the
|
|
1014
|
+
subtle part, so here it is step by step.
|
|
1015
|
+
|
|
1016
|
+
1. A greyed-out row can mean two different things: _"this can't be picked"_ (a
|
|
1017
|
+
choice) or _"this can't be used"_ (an action or a link).
|
|
1018
|
+
2. A group holds one kind of rows. Its `items` is either hand-written rows or a
|
|
1019
|
+
fetched source (a getter, or a raw array read through `itemText` /
|
|
1020
|
+
`itemValue`) — never a mix. Mixing happens only **across** groups: a
|
|
1021
|
+
hand-written "Actions" group next to a fetched "Assignees" group.
|
|
1022
|
+
3. A fetched group is meant to be **selectable** — assignees, labels, filters.
|
|
1023
|
+
There, "can't be picked" is the only question, and the group's `selectable`
|
|
1024
|
+
answers it: pass `(item) => boolean` and a rejected row renders disabled,
|
|
1025
|
+
exactly as in `BbSelect` and the option groups.
|
|
1026
|
+
4. So a fetched row has no `disabled` field. The one case that loses out is a
|
|
1027
|
+
fetched group of **actions or links** that needs to disable a single row —
|
|
1028
|
+
no such menu exists in the library or its fixtures. If one ever does,
|
|
1029
|
+
`disabled` can be added to `itemProps` later without breaking anything.
|
|
1030
|
+
5. Hand-written rows keep their `disabled` field as always — that is where
|
|
1031
|
+
action menus live.
|
|
1032
|
+
|
|
1033
|
+
### Searchable groups
|
|
1034
|
+
|
|
1035
|
+
A group can render **its own search field**, scoped to itself alone — the
|
|
1036
|
+
nested "category › searchable options" pattern. Set `searchable` on the group,
|
|
1037
|
+
not on the dropdown: there is no dropdown-level search, and each searchable
|
|
1038
|
+
group owns an independent query.
|
|
1039
|
+
|
|
1040
|
+
```vue
|
|
1041
|
+
<BbDropdown
|
|
1042
|
+
:items="[
|
|
1043
|
+
{
|
|
1044
|
+
key: 'assignee',
|
|
1045
|
+
label: 'Assignee',
|
|
1046
|
+
searchable: true,
|
|
1047
|
+
searchPlaceholder: 'Find a teammate…',
|
|
1048
|
+
selectable: true,
|
|
1049
|
+
multiple: true,
|
|
1050
|
+
stash: true,
|
|
1051
|
+
prefill: false,
|
|
1052
|
+
items: (query, prefill, modelValue) => api.users({ q: query }),
|
|
1053
|
+
itemText: 'name',
|
|
1054
|
+
itemValue: 'id',
|
|
1055
|
+
itemProps: { description: 'email' },
|
|
1056
|
+
},
|
|
1057
|
+
]"
|
|
1058
|
+
/>
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
What each knob does:
|
|
1062
|
+
|
|
1063
|
+
- **`searchable`** puts the field at the top of that group — inside its submenu
|
|
1064
|
+
when the group is nested. Typing narrows the group's rows by case-insensitive
|
|
1065
|
+
substring, and on an async group passes the query to the getter as the
|
|
1066
|
+
**leading** argument: `(query, prefill, modelValue)`, the same shape
|
|
1067
|
+
`BbSelect` uses, so one provider serves both.
|
|
1068
|
+
- **`filterBy`** picks which raw fields the local substring match reads. Empty
|
|
1069
|
+
(the default) matches the resolved display text, plus the resolved
|
|
1070
|
+
description when the group's `itemProps` gives one.
|
|
1071
|
+
- **`searchPlaceholder`** overrides the field's placeholder; it defaults to the
|
|
1072
|
+
localized label.
|
|
1073
|
+
- **`prefill: false`** means _search-first_ — nothing loads until the user
|
|
1074
|
+
types, and the group shows a hint row until then. It **requires**
|
|
1075
|
+
`searchable`, which is the one place the three-state `prefill` differs from a
|
|
1076
|
+
plain menu group (`'interaction'`, the default, fetches when the group is
|
|
1077
|
+
first reached; `true` fetches on mount).
|
|
1078
|
+
- **`stash`** accumulates the items behind _selected_ keys so they stay
|
|
1079
|
+
resolvable after the query changes. Without it, selecting in one search and
|
|
1080
|
+
then searching for something else leaves the earlier selection unresolvable
|
|
1081
|
+
and breaks the `v-model` round-trip. **Recommended for every `multiple`
|
|
1082
|
+
searchable group.**
|
|
1083
|
+
- **`maxHeight`** defaults to `280` (≈ 10 rows) on a searchable group **in the
|
|
1084
|
+
flyout**, because a searched list should scroll rather than grow. The
|
|
1085
|
+
adaptive sheet ignores that default (and any explicit cap): the off-canvas
|
|
1086
|
+
body is the only scrollport, so a downward swipe on a row can dismiss the
|
|
1087
|
+
sheet the same way a swipe on the handle does. Non-searchable flyout groups
|
|
1088
|
+
are uncapped unless you set it.
|
|
1089
|
+
|
|
1090
|
+
Two knobs live on the **dropdown**, not the group, because they apply to every
|
|
1091
|
+
searchable group in the menu:
|
|
1092
|
+
|
|
1093
|
+
- **`queryDebounceTime`** (default `300`) debounces the async re-fetch a
|
|
1094
|
+
searchable group fires as the user types. Distinct from the per-group
|
|
1095
|
+
`depsDebounceTime`, which debounces refetches caused by `dependencies`
|
|
1096
|
+
changing.
|
|
1097
|
+
- **`compact`** tightens the rows, search field included.
|
|
1098
|
+
|
|
1099
|
+
A searchable surface is a `role="dialog"`, not a `menu` — see Accessibility.
|
|
1100
|
+
|
|
640
1101
|
### Reading a dropdown from anywhere: `useBbDropdownContext`
|
|
641
1102
|
|
|
642
1103
|
Give the dropdown an explicit `id` and any component — no shared parent needed —
|
|
@@ -679,39 +1140,67 @@ its resolved counterpart.
|
|
|
679
1140
|
### Per-item and per-group slots
|
|
680
1141
|
|
|
681
1142
|
Every row (and every titled group header) can be customized without leaving
|
|
682
|
-
the config-driven model
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
1143
|
+
the config-driven model. Slot names come from keys through `slotKey`, which is
|
|
1144
|
+
kebab-case (words split at separators, camelCase humps and digits, lowercased,
|
|
1145
|
+
joined by `-`): key `"Delete file"`, `"delete_file"` and `"deleteFile"` all →
|
|
1146
|
+
`#delete-file`. For a key with accents, non-Latin letters or punctuation, or
|
|
1147
|
+
when unsure, write `#[slotKey('Qualità')]` (`import { slotKey } from
|
|
1148
|
+
'bitboss-ui'`) instead of spelling it by hand.
|
|
1149
|
+
|
|
1150
|
+
| Slot | Renders for |
|
|
1151
|
+
| --------------------------------------------------------------- | --------------------------------------------------------- |
|
|
1152
|
+
| `#<key>`, `#<key>:prepend`, `#<key>:append` | one row — its content, leading or trailing region |
|
|
1153
|
+
| `#<groupKey>:item`, `#<groupKey>:item:prepend`, `…:item:append` | **every row of that group**, and nothing else |
|
|
1154
|
+
| `#<groupKey>`, `#<groupKey>:prepend`, `#<groupKey>:append` | that group's title line |
|
|
1155
|
+
| `item:prepend`, `item:append` | every row **and** every group title line, across the menu |
|
|
1156
|
+
|
|
1157
|
+
Each edge of a row has **one occupant** — nothing renders side by side. From
|
|
1158
|
+
strongest to weakest:
|
|
1159
|
+
|
|
1160
|
+
| Leading edge | Trailing edge |
|
|
1161
|
+
| -------------------------- | -------------------------------------------------------- |
|
|
1162
|
+
| — | the check, on the **selected** row of a selectable group |
|
|
1163
|
+
| `#<key>:prepend` | `#<key>:append` |
|
|
1164
|
+
| — | the submenu chevron |
|
|
1165
|
+
| `#<groupKey>:item:prepend` | `#<groupKey>:item:append` |
|
|
1166
|
+
| `item:prepend` | `item:append` |
|
|
1167
|
+
| `prepend:icon` | `append:icon` |
|
|
1168
|
+
|
|
1169
|
+
So a slot always replaces the row's icon and the most specific slot wins. A
|
|
1170
|
+
row's own `#<key>:append` is written for that one row, so it may replace its
|
|
1171
|
+
submenu chevron; the group-wide and shared append slots never do, so a submenu
|
|
1172
|
+
row keeps its chevron unless you name it. The check beats everything — as in
|
|
1173
|
+
`BbSelect`, it takes the append content's place on the selected row only, so unselected rows of a selectable group still show their
|
|
1174
|
+
`append:icon` or append slot. Group title lines follow the same order with
|
|
1175
|
+
their own `#<groupKey>:prepend` / `:append`. In fetched groups a row's `#<key>`
|
|
1176
|
+
derives from its resolved `itemValue`.
|
|
1177
|
+
|
|
1178
|
+
The payload is one-way — no callbacks; clicks and selection stay wired by the
|
|
1179
|
+
dropdown, so keep slot content presentational:
|
|
1180
|
+
|
|
1181
|
+
- `item`, `text`, `description`, `index`, `selected`, `disabled`, `loading`,
|
|
1182
|
+
`open`, `placement`
|
|
1183
|
+
- `group` — `{ key, label, meta, selectable, multiple }` of the group the row
|
|
1184
|
+
sits in (`key` is `undefined` for loose rows and plain arrays)
|
|
1185
|
+
- `level` — `0` in the root menu, `1` in a submenu, and so on, on the flyout
|
|
1186
|
+
and the phone sheet alike
|
|
1187
|
+
- `groupTitle` — `true` when the shared `item:prepend` / `item:append` is
|
|
1188
|
+
drawing a group's title line (with the group as `item`), `false` on a row
|
|
1189
|
+
|
|
1190
|
+
There is **no** bare `#item` slot: restyle every row with the shared edge
|
|
1191
|
+
slots, one group's rows with `#<groupKey>:item…`, one row with its key.
|
|
701
1192
|
|
|
702
1193
|
**Status dots and a per-row badge**
|
|
703
1194
|
|
|
704
1195
|
```vue
|
|
705
1196
|
<template>
|
|
706
1197
|
<div
|
|
707
|
-
class="flex max-w-xs items-center gap-2 rounded-
|
|
1198
|
+
class="flex max-w-xs items-center gap-2 rounded-(--bb-radius) border p-2"
|
|
708
1199
|
>
|
|
709
|
-
<span class="text-xs font-medium text-
|
|
710
|
-
>Workspace</span
|
|
711
|
-
>
|
|
1200
|
+
<span class="text-xs font-medium text-(--bb-text-muted)">Workspace</span>
|
|
712
1201
|
<!-- `adaptive` is pinned off so the demo behaves identically on any
|
|
713
1202
|
viewport; leave it at the project default in real apps. -->
|
|
714
|
-
<BbDropdown :adaptive="false" :items="items"
|
|
1203
|
+
<BbDropdown :adaptive="false" :items="items">
|
|
715
1204
|
<template #activator="{ props }">
|
|
716
1205
|
<BbButton
|
|
717
1206
|
v-bind="props"
|
|
@@ -727,7 +1216,7 @@ the edge slots, to replace one row's content use its key.
|
|
|
727
1216
|
(and inside group headers). Payload is read-only. -->
|
|
728
1217
|
<template #item:prepend="{ item }">
|
|
729
1218
|
<BbIcon
|
|
730
|
-
class="text-
|
|
1219
|
+
class="text-(--bb-text-muted)"
|
|
731
1220
|
data-env-dot
|
|
732
1221
|
:icon="envIcon(item.key)"
|
|
733
1222
|
size="xs"
|
|
@@ -735,7 +1224,7 @@ the edge slots, to replace one row's content use its key.
|
|
|
735
1224
|
</template>
|
|
736
1225
|
|
|
737
1226
|
<!-- Per-key slot: replaces just this row's label region. The name is
|
|
738
|
-
the item's `key`
|
|
1227
|
+
the item's `key` in kebab-case (`slotKey`: `billingInfo` → `#billing-info`). -->
|
|
739
1228
|
<template #billing="{ text }">
|
|
740
1229
|
<span class="flex flex-1 items-center justify-between gap-2 text-left">
|
|
741
1230
|
{{ text }}
|
|
@@ -756,7 +1245,8 @@ const items: BbDropdownItem[] = [
|
|
|
756
1245
|
];
|
|
757
1246
|
|
|
758
1247
|
/** Status glyph per workspace row — color inherits via currentColor. */
|
|
759
|
-
|
|
1248
|
+
// `key` is optional on a row (Q53.17), so a slot reading it may see none.
|
|
1249
|
+
const envIcon = (key?: string): IconType => {
|
|
760
1250
|
if (key === 'production') return 'lucide:circle-check';
|
|
761
1251
|
if (key === 'staging') return 'lucide:circle-dashed';
|
|
762
1252
|
return 'lucide:circle';
|
|
@@ -768,16 +1258,179 @@ const envIcon = (key: string): IconType => {
|
|
|
768
1258
|
ai/guides/design-language.md § Using color. -->
|
|
769
1259
|
<style>
|
|
770
1260
|
.bb-badge.bb-badge--soft-amber {
|
|
771
|
-
--accent:
|
|
1261
|
+
--accent: var(--bb-warn);
|
|
772
1262
|
--bg: color-mix(in oklab, var(--accent) 15%, var(--bb-panel));
|
|
773
|
-
--
|
|
774
|
-
--
|
|
1263
|
+
--fg: color-mix(in oklab, var(--accent) 80%, var(--bb-text));
|
|
1264
|
+
--bw: 1px;
|
|
775
1265
|
--border-color: color-mix(in oklab, var(--accent) 25%, var(--bb-panel));
|
|
776
|
-
--ring: color-mix(in oklab, var(--accent) 45%, transparent);
|
|
1266
|
+
--ring-color: color-mix(in oklab, var(--accent) 45%, transparent);
|
|
777
1267
|
}
|
|
778
1268
|
</style>
|
|
779
1269
|
```
|
|
780
1270
|
|
|
1271
|
+
#### Rows that stand for records: `meta` and group row slots
|
|
1272
|
+
|
|
1273
|
+
A **switcher** — workspace, team, organization, tenant, clinic, project — is
|
|
1274
|
+
an account menu whose rows are all records of one kind: the current one opens
|
|
1275
|
+
a submenu, and the submenu lists the others to pick from. Build it from three
|
|
1276
|
+
pieces, and nothing else:
|
|
1277
|
+
|
|
1278
|
+
1. **A row for the current record, with `items`** — its text is the current
|
|
1279
|
+
record's name (or a "Choose a workspace" prompt), and its submenu holds the
|
|
1280
|
+
list.
|
|
1281
|
+
2. **A selectable group of records** — `selectable` (single) marks and
|
|
1282
|
+
announces the current one with the built-in check; `searchable` plus a
|
|
1283
|
+
fetched `items` getter scales to hundreds; bind its `<BbDropdownGroup
|
|
1284
|
+
v-model>` to the current id and switch when it changes.
|
|
1285
|
+
3. **`meta` + `#<groupKey>:item:prepend`** — every entry takes a `meta`: your
|
|
1286
|
+
own data, carried untouched to its slots as `item.meta` (and to per-item
|
|
1287
|
+
`pt` functions), never read by the dropdown, never put on the DOM. A
|
|
1288
|
+
hand-written row sets it directly (`meta: workspace`); a fetched row sets it
|
|
1289
|
+
through `itemProps` (`(workspace) => ({ meta: workspace })`) — the raw item
|
|
1290
|
+
never reaches a slot on its own. The group row slot then draws each record
|
|
1291
|
+
(an avatar, a logo) on the group's rows only, so every other row keeps its
|
|
1292
|
+
`prepend:icon`.
|
|
1293
|
+
|
|
1294
|
+
**A workspace switcher in an account menu**
|
|
1295
|
+
|
|
1296
|
+
```vue
|
|
1297
|
+
<template>
|
|
1298
|
+
<div
|
|
1299
|
+
class="flex max-w-xs items-center justify-between gap-2 rounded-(--bb-radius) border p-2"
|
|
1300
|
+
>
|
|
1301
|
+
<span class="current-workspace truncate text-sm font-medium">
|
|
1302
|
+
{{ current?.name ?? 'No workspace' }}
|
|
1303
|
+
</span>
|
|
1304
|
+
<BbDropdown :items="items" placement="bottom-end" :width="240">
|
|
1305
|
+
<template #activator="{ props }">
|
|
1306
|
+
<BbButton
|
|
1307
|
+
v-bind="props"
|
|
1308
|
+
aria-label="Account menu"
|
|
1309
|
+
size="sm"
|
|
1310
|
+
variant="ghost"
|
|
1311
|
+
>
|
|
1312
|
+
<BbAvatar size="lg">SE</BbAvatar>
|
|
1313
|
+
</BbButton>
|
|
1314
|
+
</template>
|
|
1315
|
+
<!-- The row that opens the switcher: its workspace rides in `meta`. -->
|
|
1316
|
+
<template #current-workspace:prepend="{ item }">
|
|
1317
|
+
<BbAvatar v-if="item.meta" size="md">
|
|
1318
|
+
{{ initials(item.meta) }}
|
|
1319
|
+
</BbAvatar>
|
|
1320
|
+
</template>
|
|
1321
|
+
<!-- Every row of the `workspaces` group, and nothing else: Profile,
|
|
1322
|
+
Settings and Sign out keep their own `prepend:icon`. -->
|
|
1323
|
+
<template #workspaces:item:prepend="{ item }">
|
|
1324
|
+
<BbAvatar size="md">{{ initials(item.meta) }}</BbAvatar>
|
|
1325
|
+
</template>
|
|
1326
|
+
<BbDropdownGroup id="workspaces" v-model="workspaceId" />
|
|
1327
|
+
</BbDropdown>
|
|
1328
|
+
</div>
|
|
1329
|
+
</template>
|
|
1330
|
+
<script setup lang="ts">
|
|
1331
|
+
import { computed, ref } from 'vue';
|
|
1332
|
+
import {
|
|
1333
|
+
BbAvatar,
|
|
1334
|
+
BbButton,
|
|
1335
|
+
BbDropdown,
|
|
1336
|
+
BbDropdownGroup,
|
|
1337
|
+
type BbDropdownItem,
|
|
1338
|
+
} from 'bitboss-ui';
|
|
1339
|
+
|
|
1340
|
+
type Workspace = { id: string; name: string; plan: string };
|
|
1341
|
+
|
|
1342
|
+
const workspaces: Workspace[] = [
|
|
1343
|
+
{ id: 'w1', name: 'Acme Studio', plan: 'Pro · 12 members' },
|
|
1344
|
+
{ id: 'w2', name: 'Northwind Labs', plan: 'Team · 34 members' },
|
|
1345
|
+
{ id: 'w3', name: 'Globex Retail', plan: 'Free · 3 members' },
|
|
1346
|
+
{ id: 'w4', name: 'Initech Finance', plan: 'Enterprise · 210 members' },
|
|
1347
|
+
];
|
|
1348
|
+
|
|
1349
|
+
// Single-select: the workspace you are in. In an app, switching is a request
|
|
1350
|
+
// to the server — watch this model and make the visit there.
|
|
1351
|
+
const workspaceId = ref<string | null>('w1');
|
|
1352
|
+
const current = computed(() =>
|
|
1353
|
+
workspaces.find((workspace) => workspace.id === workspaceId.value)
|
|
1354
|
+
);
|
|
1355
|
+
|
|
1356
|
+
const initials = (workspace: Workspace) =>
|
|
1357
|
+
workspace.name
|
|
1358
|
+
.split(' ')
|
|
1359
|
+
.map((word) => word[0])
|
|
1360
|
+
.slice(0, 2)
|
|
1361
|
+
.join('');
|
|
1362
|
+
|
|
1363
|
+
// A constant, so the fetched group is declared once while the row above it
|
|
1364
|
+
// follows the current workspace.
|
|
1365
|
+
const switcher: BbDropdownItem = {
|
|
1366
|
+
key: 'workspaces',
|
|
1367
|
+
label: 'Switch workspace',
|
|
1368
|
+
// The row that opens this submenu already names it.
|
|
1369
|
+
hideLabel: true,
|
|
1370
|
+
// Selectable: the current workspace is checked and announced as such.
|
|
1371
|
+
selectable: true,
|
|
1372
|
+
searchable: true,
|
|
1373
|
+
searchPlaceholder: 'Find a workspace…',
|
|
1374
|
+
itemText: 'name',
|
|
1375
|
+
itemValue: 'id',
|
|
1376
|
+
// `meta` hands each row its workspace, so the slot draws from the record
|
|
1377
|
+
// instead of looking it up by key.
|
|
1378
|
+
itemProps: (workspace: Workspace) => ({
|
|
1379
|
+
description: workspace.plan,
|
|
1380
|
+
meta: workspace,
|
|
1381
|
+
}),
|
|
1382
|
+
items: async (query: string) => {
|
|
1383
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
1384
|
+
const needle = query.toLowerCase();
|
|
1385
|
+
return workspaces.filter((workspace) =>
|
|
1386
|
+
workspace.name.toLowerCase().includes(needle)
|
|
1387
|
+
);
|
|
1388
|
+
},
|
|
1389
|
+
};
|
|
1390
|
+
|
|
1391
|
+
const items = computed<BbDropdownItem[]>(() => [
|
|
1392
|
+
{
|
|
1393
|
+
key: 'current-workspace',
|
|
1394
|
+
text: current.value?.name ?? 'Choose a workspace',
|
|
1395
|
+
description: current.value?.plan,
|
|
1396
|
+
meta: current.value,
|
|
1397
|
+
items: [switcher],
|
|
1398
|
+
},
|
|
1399
|
+
[
|
|
1400
|
+
{
|
|
1401
|
+
key: 'profile',
|
|
1402
|
+
text: 'Profile',
|
|
1403
|
+
'prepend:icon': 'lucide:user',
|
|
1404
|
+
href: '#profile',
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
key: 'settings',
|
|
1408
|
+
text: 'Settings',
|
|
1409
|
+
'prepend:icon': 'lucide:settings',
|
|
1410
|
+
href: '#settings',
|
|
1411
|
+
},
|
|
1412
|
+
],
|
|
1413
|
+
[
|
|
1414
|
+
{
|
|
1415
|
+
key: 'sign-out',
|
|
1416
|
+
text: 'Sign out',
|
|
1417
|
+
'prepend:icon': 'lucide:log-out',
|
|
1418
|
+
href: '#sign-out',
|
|
1419
|
+
},
|
|
1420
|
+
],
|
|
1421
|
+
]);
|
|
1422
|
+
</script>
|
|
1423
|
+
```
|
|
1424
|
+
|
|
1425
|
+
Two things this replaces, both seen in real apps:
|
|
1426
|
+
|
|
1427
|
+
- **Matching keys in the shared slots** (`v-if="item.key === 'current'"`,
|
|
1428
|
+
`v-else-if="clinicsById.get(item.key)"`) to tell a record row from an action
|
|
1429
|
+
row, and a lookup map rebuilt from the fetch to get the record back. The
|
|
1430
|
+
group row slot is the "which rows" answer; `item.meta` is the record.
|
|
1431
|
+
- **Re-drawing the other rows' icons**, because a shared `item:prepend`
|
|
1432
|
+
replaces every row's `prepend:icon`.
|
|
1433
|
+
|
|
781
1434
|
### Header and footer
|
|
782
1435
|
|
|
783
1436
|
`header` and `footer` slots (payload: `{ open, disabled, placement }`) pin
|
|
@@ -807,7 +1460,7 @@ the sheet's pinned header and footer.
|
|
|
807
1460
|
</BbButton>
|
|
808
1461
|
</template>
|
|
809
1462
|
<template #header>
|
|
810
|
-
<div class="px-3 py-2 text-xs font-semibold text-
|
|
1463
|
+
<div class="px-3 py-2 text-xs font-semibold text-(--bb-text-muted)">
|
|
811
1464
|
Jump to month
|
|
812
1465
|
</div>
|
|
813
1466
|
</template>
|
|
@@ -836,11 +1489,11 @@ behaves exactly as with a click menu.
|
|
|
836
1489
|
```vue
|
|
837
1490
|
<template>
|
|
838
1491
|
<div
|
|
839
|
-
class="flex max-w-sm items-center gap-2 rounded-
|
|
1492
|
+
class="flex max-w-sm items-center gap-2 rounded-(--bb-radius) border p-2"
|
|
840
1493
|
>
|
|
841
1494
|
<div class="min-w-0 flex-1">
|
|
842
1495
|
<p class="truncate text-sm font-medium">INV-2048</p>
|
|
843
|
-
<p class="text-xs text-
|
|
1496
|
+
<p class="text-xs text-(--bb-text-muted)">
|
|
844
1497
|
Northwind · €1,240.00 ·
|
|
845
1498
|
<span data-last>{{ last }}</span>
|
|
846
1499
|
</p>
|
|
@@ -851,7 +1504,6 @@ behaves exactly as with a click menu.
|
|
|
851
1504
|
:items="items"
|
|
852
1505
|
placement="cursor"
|
|
853
1506
|
:trigger="['click', 'contextMenu']"
|
|
854
|
-
:width="200"
|
|
855
1507
|
>
|
|
856
1508
|
<template #activator="{ props }">
|
|
857
1509
|
<BbButton
|
|
@@ -1008,6 +1660,46 @@ too, the same as it would to the slot's `props`; don't hand-write your own
|
|
|
1008
1660
|
</BbButton>
|
|
1009
1661
|
```
|
|
1010
1662
|
|
|
1663
|
+
### Density: `compact`
|
|
1664
|
+
|
|
1665
|
+
`compact` walks the same ladder `BbSelect` does, so a dense toolbar can hold a
|
|
1666
|
+
select and a menu that agree: flyout rows go 28px → 24px, sheet rows 44px →
|
|
1667
|
+
36px. The label does not shrink — density here is height, exactly as it is for a
|
|
1668
|
+
select.
|
|
1669
|
+
|
|
1670
|
+
The sheet stops at 36px and never follows the flyout down to 24px. A menu row is
|
|
1671
|
+
a touch target whose mis-tap fires the neighbouring **command**, where a
|
|
1672
|
+
mis-tapped option merely picks the wrong value and can be picked again; 36px is
|
|
1673
|
+
the same floor the select's own sheet holds.
|
|
1674
|
+
|
|
1675
|
+
**A compact menu beside a compact select**
|
|
1676
|
+
|
|
1677
|
+
```vue
|
|
1678
|
+
<div class="flex items-center gap-2">
|
|
1679
|
+
<BbSelect
|
|
1680
|
+
v-model="state.owner"
|
|
1681
|
+
compact
|
|
1682
|
+
hide-label
|
|
1683
|
+
label="Owner"
|
|
1684
|
+
:items="['Ada', 'Grace', 'Alan']"
|
|
1685
|
+
placeholder="Owner"
|
|
1686
|
+
/>
|
|
1687
|
+
<BbButton
|
|
1688
|
+
v-bb-dropdown="{
|
|
1689
|
+
compact: true,
|
|
1690
|
+
items: [
|
|
1691
|
+
{ key: 'rename', text: 'Rename' },
|
|
1692
|
+
{ key: 'duplicate', text: 'Duplicate' },
|
|
1693
|
+
],
|
|
1694
|
+
}"
|
|
1695
|
+
size="sm"
|
|
1696
|
+
variant="outline"
|
|
1697
|
+
>
|
|
1698
|
+
Actions
|
|
1699
|
+
</BbButton>
|
|
1700
|
+
</div>
|
|
1701
|
+
```
|
|
1702
|
+
|
|
1011
1703
|
### Mobile: the adaptive sheet
|
|
1012
1704
|
|
|
1013
1705
|
On viewports below the config's `mobileMaxWidth`, the menu renders as a
|
|
@@ -1022,8 +1714,306 @@ mid-session never swaps a live menu between flyout and sheet.
|
|
|
1022
1714
|
stay a flyout everywhere — e.g. deterministic UI tests or dense desktop-only
|
|
1023
1715
|
tooling.
|
|
1024
1716
|
- `offCanvasProps` forwards overrides to the underlying `BbOffCanvas` (merged
|
|
1025
|
-
over `
|
|
1026
|
-
ignored when `adaptive` resolves to `false`.
|
|
1717
|
+
over `side: 'bottom'`, `size: 'auto'`, `draggable: true`,
|
|
1718
|
+
`hideClose: true`); it is ignored when `adaptive` resolves to `false`.
|
|
1719
|
+
Pass `hideClose: false` to bring the close control back. The sheet search
|
|
1720
|
+
field (on `searchable` groups) uses the same soft filled treatment as
|
|
1721
|
+
`BbSelect`'s adaptive sheet.
|
|
1722
|
+
|
|
1723
|
+
### Restyling with passthrough
|
|
1724
|
+
|
|
1725
|
+
`pt` reaches a named part of the menu with a class list — or, in the
|
|
1726
|
+
object form, a style and attributes — optionally only while a state is on.
|
|
1727
|
+
Parts: `root` (the flyout — an invisible positioning wrapper, no node on
|
|
1728
|
+
mobile), `panel` (the menu surface you see — background, border, radius and
|
|
1729
|
+
shadow live here; the sheet itself on mobile), `sheet` (the bottom sheet the surface becomes on a phone — only that sheet, never the desktop surface; applied after `panel`, so it wins a conflict there),
|
|
1730
|
+
`header`, `footer`, `input` (every `searchable` group's search field — a
|
|
1731
|
+
broadcast, on the flyout and the phone sheet alike; its magnifier is chrome),
|
|
1732
|
+
`list` (the top-level entries container between the bands
|
|
1733
|
+
— a flex column with a 1px gap; a submenu's list is not reached), `item` — every entry, submenus included, a broadcast
|
|
1734
|
+
resolved per entry — and `itemText` / `itemIcon` / `itemDescription`, that
|
|
1735
|
+
entry's label, its prepend / append icons and its muted second line (the item's
|
|
1736
|
+
`text` / `prepend:icon` · `append:icon` / `description`), resolved with the entry's
|
|
1737
|
+
states (a per-entry `#<key>` slot replaces the label and description). States: `open`, and `selected` / `disabled` per entry.
|
|
1738
|
+
Groups, headings and dividers are not parts.
|
|
1739
|
+
|
|
1740
|
+
The invoice View menu, restyled through those parts: a muted wash on
|
|
1741
|
+
`pt:header` and on `pt:item:selected` (per entry), muted
|
|
1742
|
+
`pt:item:disabled`, `overflow-hidden` on `pt:panel` so the header wash
|
|
1743
|
+
clips, a primary ring with offset while `pt:root:open`. The example pins
|
|
1744
|
+
`:adaptive="false"` so it always shows the floating menu.
|
|
1745
|
+
|
|
1746
|
+
**pt:item:selected — the invoice View menu**
|
|
1747
|
+
|
|
1748
|
+
```vue
|
|
1749
|
+
<template>
|
|
1750
|
+
<div
|
|
1751
|
+
class="flex max-w-md flex-wrap items-center gap-2 rounded-(--bb-radius) border border-(--bb-border) p-2"
|
|
1752
|
+
>
|
|
1753
|
+
<span class="pr-1 text-xs font-medium text-(--bb-text-muted)"
|
|
1754
|
+
>Invoices</span
|
|
1755
|
+
>
|
|
1756
|
+
<BbDropdown
|
|
1757
|
+
:adaptive="false"
|
|
1758
|
+
:items="items"
|
|
1759
|
+
pt:header="bg-(--bb-muted) text-xs font-medium"
|
|
1760
|
+
pt:item:disabled="text-(--bb-text-muted)"
|
|
1761
|
+
pt:item:selected="bg-(--bb-muted) font-medium"
|
|
1762
|
+
pt:panel="overflow-hidden"
|
|
1763
|
+
pt:root:open="ring-2 ring-offset-2 ring-(--bb-primary)"
|
|
1764
|
+
:width="200"
|
|
1765
|
+
>
|
|
1766
|
+
<template #activator="{ props }">
|
|
1767
|
+
<BbButton
|
|
1768
|
+
v-bind="props"
|
|
1769
|
+
append:icon="lucide:chevron-down"
|
|
1770
|
+
size="xs"
|
|
1771
|
+
variant="outline"
|
|
1772
|
+
>
|
|
1773
|
+
View
|
|
1774
|
+
</BbButton>
|
|
1775
|
+
</template>
|
|
1776
|
+
<template #header>Invoice list</template>
|
|
1777
|
+
<BbDropdownGroup id="sort" v-model="sortBy" />
|
|
1778
|
+
<BbDropdownGroup id="tags" v-model="tags" />
|
|
1779
|
+
</BbDropdown>
|
|
1780
|
+
<span class="text-xs text-(--bb-text-muted)">
|
|
1781
|
+
Sort: <span data-sort>{{ sortBy }}</span> · Tags:
|
|
1782
|
+
<span data-tags>{{ tags.join(', ') || 'none' }}</span>
|
|
1783
|
+
</span>
|
|
1784
|
+
</div>
|
|
1785
|
+
</template>
|
|
1786
|
+
|
|
1787
|
+
<script setup lang="ts">
|
|
1788
|
+
import { ref } from 'vue';
|
|
1789
|
+
import { BbButton, BbDropdown, BbDropdownGroup } from 'bitboss-ui';
|
|
1790
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
1791
|
+
|
|
1792
|
+
// Same invoice View menu as `SelectableMenu.vue`, restyled through
|
|
1793
|
+
// passthrough: muted wash on `pt:header` and on `pt:item:selected` (per
|
|
1794
|
+
// entry), muted `pt:item:disabled`, `pt:panel` clips the header wash,
|
|
1795
|
+
// `pt:root:open` is the open ring. Adaptive is pinned off so the demo always
|
|
1796
|
+
// shows the floating menu (on a phone `panel` reaches the sheet's menu
|
|
1797
|
+
// container instead).
|
|
1798
|
+
const items: BbDropdownItem[] = [
|
|
1799
|
+
{
|
|
1800
|
+
key: 'sort',
|
|
1801
|
+
label: 'Sort by',
|
|
1802
|
+
selectable: true,
|
|
1803
|
+
items: [
|
|
1804
|
+
{ key: 'recent', text: 'Most recent' },
|
|
1805
|
+
{ key: 'name', text: 'Name (A–Z)' },
|
|
1806
|
+
{ key: 'amount', text: 'Amount (high → low)' },
|
|
1807
|
+
],
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
key: 'tags',
|
|
1811
|
+
label: 'Tags',
|
|
1812
|
+
selectable: true,
|
|
1813
|
+
multiple: true,
|
|
1814
|
+
items: [
|
|
1815
|
+
{ key: 'overdue', text: 'Overdue' },
|
|
1816
|
+
{ key: 'vip', text: 'VIP' },
|
|
1817
|
+
{ key: 'review', text: 'Needs review' },
|
|
1818
|
+
],
|
|
1819
|
+
},
|
|
1820
|
+
[
|
|
1821
|
+
{
|
|
1822
|
+
key: 'export',
|
|
1823
|
+
text: 'Export CSV',
|
|
1824
|
+
disabled: true,
|
|
1825
|
+
},
|
|
1826
|
+
],
|
|
1827
|
+
];
|
|
1828
|
+
|
|
1829
|
+
const sortBy = ref('recent');
|
|
1830
|
+
const tags = ref<string[]>(['overdue']);
|
|
1831
|
+
</script>
|
|
1832
|
+
```
|
|
1833
|
+
|
|
1834
|
+
A look that depends on the ENTRY'S DATA — a destructive action, an entry
|
|
1835
|
+
flagged by the row it came from — is a **per-item function** on an entry
|
|
1836
|
+
part: `:pt:item="({ item, selected, disabled }) => …"`, called with the menu
|
|
1837
|
+
entry and every state as a boolean for it, its result merged after the state entries. Entry
|
|
1838
|
+
parts only (`item`, `itemText`, `itemIcon`, `itemDescription`), on the
|
|
1839
|
+
instance only; `variant: 'destructive'` on the item is still the shipped look
|
|
1840
|
+
for the common case — the function is for a look of your own.
|
|
1841
|
+
|
|
1842
|
+
**pt:item as a function — a destructive entry by its data**
|
|
1843
|
+
|
|
1844
|
+
```vue
|
|
1845
|
+
<template>
|
|
1846
|
+
<div
|
|
1847
|
+
class="flex max-w-md flex-wrap items-center gap-2 rounded-(--bb-radius) border border-(--bb-border) p-2"
|
|
1848
|
+
>
|
|
1849
|
+
<span class="pr-1 text-xs font-medium text-(--bb-text-muted)">Project</span>
|
|
1850
|
+
<BbDropdown
|
|
1851
|
+
:adaptive="false"
|
|
1852
|
+
:items="items"
|
|
1853
|
+
:pt="{ item: 'text-sm' }"
|
|
1854
|
+
:pt:item="dangerRow"
|
|
1855
|
+
:pt:item-text="dangerText"
|
|
1856
|
+
:width="220"
|
|
1857
|
+
>
|
|
1858
|
+
<template #activator="{ props }">
|
|
1859
|
+
<BbButton
|
|
1860
|
+
v-bind="props"
|
|
1861
|
+
append:icon="lucide:chevron-down"
|
|
1862
|
+
size="xs"
|
|
1863
|
+
variant="outline"
|
|
1864
|
+
>
|
|
1865
|
+
Actions
|
|
1866
|
+
</BbButton>
|
|
1867
|
+
</template>
|
|
1868
|
+
</BbDropdown>
|
|
1869
|
+
<span class="text-xs text-(--bb-text-muted)">
|
|
1870
|
+
Last: <span data-last>{{ last }}</span>
|
|
1871
|
+
</span>
|
|
1872
|
+
</div>
|
|
1873
|
+
</template>
|
|
1874
|
+
|
|
1875
|
+
<script setup lang="ts">
|
|
1876
|
+
import { ref } from 'vue';
|
|
1877
|
+
import { BbButton, BbDropdown } from 'bitboss-ui';
|
|
1878
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
1879
|
+
|
|
1880
|
+
// The entries carry their own flag; the per-item function reads it. The
|
|
1881
|
+
// function receives the menu entry (`item`) and every state as a boolean
|
|
1882
|
+
// beside it (`disabled` here), and its result is merged after every state
|
|
1883
|
+
// entry. `:pt:item-text` takes one too, for the label alone. `danger` is a field
|
|
1884
|
+
// of our own, so the functions live here, typed on `Action`.
|
|
1885
|
+
type Action = BbDropdownItem & { danger?: boolean };
|
|
1886
|
+
|
|
1887
|
+
const last = ref('—');
|
|
1888
|
+
const run = (name: string) => () => {
|
|
1889
|
+
last.value = name;
|
|
1890
|
+
};
|
|
1891
|
+
|
|
1892
|
+
const items: Action[] = [
|
|
1893
|
+
{ key: 'rename', text: 'Rename', onClick: run('rename') },
|
|
1894
|
+
{ key: 'duplicate', text: 'Duplicate', onClick: run('duplicate') },
|
|
1895
|
+
{
|
|
1896
|
+
key: 'archive',
|
|
1897
|
+
text: 'Archive',
|
|
1898
|
+
description: 'Hidden from the board, kept for 30 days',
|
|
1899
|
+
onClick: run('archive'),
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
key: 'delete',
|
|
1903
|
+
text: 'Delete project',
|
|
1904
|
+
danger: true,
|
|
1905
|
+
onClick: run('delete'),
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
key: 'purge',
|
|
1909
|
+
text: 'Purge history',
|
|
1910
|
+
danger: true,
|
|
1911
|
+
disabled: true,
|
|
1912
|
+
},
|
|
1913
|
+
];
|
|
1914
|
+
|
|
1915
|
+
const dangerRow = ({ item, disabled }: { item: Action; disabled: boolean }) =>
|
|
1916
|
+
item.danger
|
|
1917
|
+
? {
|
|
1918
|
+
class: disabled ? 'text-red-300' : 'text-red-600',
|
|
1919
|
+
attrs: { 'data-danger': '' },
|
|
1920
|
+
}
|
|
1921
|
+
: null;
|
|
1922
|
+
|
|
1923
|
+
const dangerText = ({ item }: { item: Action }) => item.danger && 'font-medium';
|
|
1924
|
+
</script>
|
|
1925
|
+
```
|
|
1926
|
+
|
|
1927
|
+
The function can also map a VALUE to its own classes. Here every status in a
|
|
1928
|
+
single-choice group gets its own tone: `pt:item-icon` looks the entry's `key`
|
|
1929
|
+
up in a map for the dot's color, and `pt:item` adds a wash of the same tone
|
|
1930
|
+
while that entry is the `selected` one. Adding a status is one row in the map.
|
|
1931
|
+
|
|
1932
|
+
**pt:item / pt:item-icon as functions — a tone per status**
|
|
1933
|
+
|
|
1934
|
+
```vue
|
|
1935
|
+
<template>
|
|
1936
|
+
<div
|
|
1937
|
+
class="flex max-w-md flex-wrap items-center gap-2 rounded-(--bb-radius) border border-(--bb-border) p-2"
|
|
1938
|
+
>
|
|
1939
|
+
<span class="pr-1 text-xs font-medium text-(--bb-text-muted)">
|
|
1940
|
+
INV-2048
|
|
1941
|
+
</span>
|
|
1942
|
+
<BbDropdown
|
|
1943
|
+
:adaptive="false"
|
|
1944
|
+
:items="items"
|
|
1945
|
+
:pt:item="({ item, selected }) => selected && toneOf(item)?.wash"
|
|
1946
|
+
:pt:item-icon="({ item }) => toneOf(item)?.dot"
|
|
1947
|
+
:width="200"
|
|
1948
|
+
>
|
|
1949
|
+
<template #activator="{ props }">
|
|
1950
|
+
<BbButton
|
|
1951
|
+
v-bind="props"
|
|
1952
|
+
append:icon="lucide:chevron-down"
|
|
1953
|
+
size="xs"
|
|
1954
|
+
variant="outline"
|
|
1955
|
+
>
|
|
1956
|
+
Status: {{ labels[status] }}
|
|
1957
|
+
</BbButton>
|
|
1958
|
+
</template>
|
|
1959
|
+
<BbDropdownGroup id="status" v-model="status" />
|
|
1960
|
+
</BbDropdown>
|
|
1961
|
+
</div>
|
|
1962
|
+
</template>
|
|
1963
|
+
|
|
1964
|
+
<script setup lang="ts">
|
|
1965
|
+
import { ref } from 'vue';
|
|
1966
|
+
import { BbButton, BbDropdown, BbDropdownGroup } from 'bitboss-ui';
|
|
1967
|
+
import type { BbDropdownItem } from 'bitboss-ui';
|
|
1968
|
+
|
|
1969
|
+
// One look per VALUE: the per-item function reads the entry's `key` and looks
|
|
1970
|
+
// its classes up in a map, so every status gets its own tone — the dot on
|
|
1971
|
+
// `:pt:item-icon`, a wash of the same tone on `item` while it is the `selected`
|
|
1972
|
+
// one. A new status is one row in `tones`.
|
|
1973
|
+
type Status = 'draft' | 'sent' | 'overdue' | 'paid';
|
|
1974
|
+
|
|
1975
|
+
const tones: Record<Status, { dot: string; wash: string }> = {
|
|
1976
|
+
draft: { dot: 'text-(--bb-text-muted)', wash: 'bg-(--bb-muted)' },
|
|
1977
|
+
sent: { dot: 'text-sky-500', wash: 'bg-sky-500/10' },
|
|
1978
|
+
overdue: { dot: 'text-amber-500', wash: 'bg-amber-500/10' },
|
|
1979
|
+
paid: { dot: 'text-emerald-500', wash: 'bg-emerald-500/10' },
|
|
1980
|
+
};
|
|
1981
|
+
|
|
1982
|
+
const labels: Record<Status, string> = {
|
|
1983
|
+
draft: 'Draft',
|
|
1984
|
+
sent: 'Sent',
|
|
1985
|
+
overdue: 'Overdue',
|
|
1986
|
+
paid: 'Paid',
|
|
1987
|
+
};
|
|
1988
|
+
|
|
1989
|
+
const items: BbDropdownItem[] = [
|
|
1990
|
+
{
|
|
1991
|
+
key: 'status',
|
|
1992
|
+
label: 'Set status',
|
|
1993
|
+
selectable: true,
|
|
1994
|
+
items: (Object.keys(labels) as Status[]).map((key) => ({
|
|
1995
|
+
key,
|
|
1996
|
+
text: labels[key],
|
|
1997
|
+
'prepend:icon': 'lucide:circle',
|
|
1998
|
+
})),
|
|
1999
|
+
},
|
|
2000
|
+
];
|
|
2001
|
+
|
|
2002
|
+
const status = ref<Status>('overdue');
|
|
2003
|
+
|
|
2004
|
+
// A group has no `key` in `tones`, so only the status entries match.
|
|
2005
|
+
// (`BbDropdownItem` also covers a nested list, which has no `key`.)
|
|
2006
|
+
const toneOf = (item: BbDropdownItem) =>
|
|
2007
|
+
'key' in item ? tones[item.key as Status] : undefined;
|
|
2008
|
+
</script>
|
|
2009
|
+
```
|
|
2010
|
+
|
|
2011
|
+
The full grammar, the merge rules and the global map are in the
|
|
2012
|
+
[passthrough guide](./guides/passthrough.md).
|
|
2013
|
+
|
|
2014
|
+
A `pt` value written in `<script>` (a constant, a preset, a wrapper's
|
|
2015
|
+
`pt` prop) is typed as `BbDropdownProps['pt']`, never an imported `PtValue`: see
|
|
2016
|
+
[passthrough § Typing `pt` in `<script>`](./guides/passthrough.md#typing-pt-in-script).
|
|
1027
2017
|
|
|
1028
2018
|
### Works well with
|
|
1029
2019
|
|
|
@@ -1040,12 +2030,30 @@ mid-session never swaps a live menu between flyout and sheet.
|
|
|
1040
2030
|
|
|
1041
2031
|
### Gotchas and anti-patterns
|
|
1042
2032
|
|
|
2033
|
+
- **A `class` on `<BbDropdown>` styles the menu, not the button.** Attributes
|
|
2034
|
+
land on the floating menu, like every floating component: its box on desktop,
|
|
2035
|
+
the sheet on a phone (`class` rides `pt:root`, which has no node on a sheet).
|
|
2036
|
+
To hide or style the trigger, put the class on your element in `#activator`.
|
|
2037
|
+
- **There is no open flag to bind.** The menu keeps its open state internal
|
|
2038
|
+
(no `v-model:open`, by design): the activator opens it, a pick or an outside
|
|
2039
|
+
press closes it, and `@show` / `@hide` tell you when. Don't reopen it from a
|
|
2040
|
+
`@focus` handler on the activator — closing returns focus there, and the two
|
|
2041
|
+
fight in a loop.
|
|
1043
2042
|
- **Don't navigate from `onClick`** (`router.push`, `window.location`) — give
|
|
1044
2043
|
the item `href`/`to` and let it render a real link.
|
|
1045
2044
|
- **Don't rebuild selection** with `onClick` + your own state — mark the group
|
|
1046
2045
|
`selectable` and bind a `<BbDropdownGroup v-model>`.
|
|
1047
|
-
- **There is no `#item` slot** — a template slot named `item` renders
|
|
1048
|
-
Use `item:prepend`/`item:append
|
|
2046
|
+
- **There is no bare `#item` slot** — a template slot named `item` renders
|
|
2047
|
+
nothing. Use `item:prepend`/`item:append`, a group's `#<groupKey>:item…`, or
|
|
2048
|
+
a per-key slot.
|
|
2049
|
+
- **Don't sort rows by key inside the shared slots.** When only one group's
|
|
2050
|
+
rows need a custom look, use `#<groupKey>:item:prepend`; when a slot needs the
|
|
2051
|
+
record behind a row, put it in `meta` (through `itemProps` on a fetched group)
|
|
2052
|
+
instead of looking it up by `item.key`.
|
|
2053
|
+
- **Don't hand-roll the "current" mark in a switcher** (a custom `variant` plus
|
|
2054
|
+
a check in `item:append`). Make the group `selectable` and bind its
|
|
2055
|
+
`v-model` to the current id — the check, `aria-checked` and the radio role
|
|
2056
|
+
come with it.
|
|
1049
2057
|
- `width` defaults to `'auto'` (content-sized, ≥128px) — not a fixed pixel
|
|
1050
2058
|
width; pass a number when menus must align across rows.
|
|
1051
2059
|
- Item `variant`s other than `destructive` render only a class hook — register
|
|
@@ -1055,12 +2063,12 @@ mid-session never swaps a live menu between flyout and sheet.
|
|
|
1055
2063
|
model must be an array — all three misuses throw.
|
|
1056
2064
|
- Placeholder texts default to the config locale's "Loading…" / "No results"
|
|
1057
2065
|
strings (`locale` plugin option) unless you set `loading-text` /
|
|
1058
|
-
`
|
|
2066
|
+
`empty-text`.
|
|
1059
2067
|
|
|
1060
2068
|
### Accessibility
|
|
1061
2069
|
|
|
1062
2070
|
- The activator gets `aria-haspopup` (`"menu"`, or `"dialog"` when the panel
|
|
1063
|
-
has a search field), `aria-expanded` and (once opened)
|
|
2071
|
+
has a search field or opens as the phone sheet), `aria-expanded` and (once opened)
|
|
1064
2072
|
`aria-controls` wired automatically — always spread the slot `props` onto a
|
|
1065
2073
|
real focusable element (a `<button>`; `BbButton` qualifies). An existing
|
|
1066
2074
|
`id` on your element is adopted, never overwritten. The `activator` **prop**
|
|
@@ -1088,8 +2096,9 @@ mid-session never swaps a live menu between flyout and sheet.
|
|
|
1088
2096
|
Surfaces with no search field are unchanged.
|
|
1089
2097
|
- Keyboard is fully handled — don't add your own handlers: `ArrowDown` /
|
|
1090
2098
|
`ArrowUp` on the trigger open the menu focusing the first/last item; inside,
|
|
1091
|
-
arrows rove (skipping disabled rows, wrapping), `Home`/`End` jump,
|
|
1092
|
-
|
|
2099
|
+
arrows rove (skipping disabled rows, wrapping), `Home`/`End` jump, typing
|
|
2100
|
+
a letter jumps to the next enabled item whose label starts with it
|
|
2101
|
+
(typeahead, like a native menu), `ArrowRight` enters a submenu, `ArrowLeft` closes the level (or navigates
|
|
1093
2102
|
back in the sheet), `Escape` closes and refocuses the trigger. The menu is a
|
|
1094
2103
|
single tab stop (rows are `tabindex="-1"` per the ARIA menu pattern): `Tab`
|
|
1095
2104
|
leaves the menu and closes it. Focus returns to the activator after an
|
|
@@ -1103,41 +2112,110 @@ mid-session never swaps a live menu between flyout and sheet.
|
|
|
1103
2112
|
|
|
1104
2113
|
| Prop | Type | Default | Required | Description |
|
|
1105
2114
|
| --- | --- | --- | --- | --- |
|
|
1106
|
-
| `
|
|
1107
|
-
| `
|
|
1108
|
-
| `
|
|
2115
|
+
| `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `footer`, `header`, `input`, `item`, `itemDescription`, `itemIcon`, `itemText`, `list`, `panel`, `root`, `sheet`. States: `disabled`, `open`, `selected`. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbDropdownProps['pt']` (`PtValue` is not exported): § Typing `pt` in `<script>`. |
|
|
2116
|
+
| `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 programmatically too — don't add your own, or you get a double-set conflict. |
|
|
2117
|
+
| `adaptive` | `boolean \| undefined` | ``config.adaptive` (`true`)` | | 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 hover flyouts. Slots and selection behave exactly as on desktop. When unset, falls back to the global `config.adaptive`. |
|
|
2118
|
+
| `anchor` | `Record<string, any> \| HTMLElement \| null \| undefined` | `the activator element` | | 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 Vue component ref. Also drives a percentage `width`. Ignored when `placement` is `'cursor'`. |
|
|
1109
2119
|
| `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. |
|
|
1110
|
-
| `
|
|
1111
|
-
| `
|
|
1112
|
-
| `
|
|
1113
|
-
| `
|
|
1114
|
-
| `
|
|
2120
|
+
| `compact` | `boolean \| undefined` | `false` | | Apply the compact density variant — the same ladder `BbSelect` uses, on both surfaces: flyout rows go 28px → 24px, sheet rows 44px → 36px. The label size does not change; density here is height, as it is for a select. A menu row is a touch target in a way a select option is not quite — a mis-tap fires the neighbouring COMMAND rather than picking the wrong value — so the compact sheet stops at 36px and never follows the flyout down to 24px. That is the same floor the select's sheet holds. |
|
|
2121
|
+
| `disabled` | `boolean \| undefined` | `false` | | Disables the component |
|
|
2122
|
+
| `eager` | `boolean \| undefined` | `false` | | Prevents rendering content before it's made visible. |
|
|
2123
|
+
| `emptyText` | `string \| undefined` | | | Default placeholder text shown when a pipeline group resolves to no items. A group's own `emptyText` overrides this; both fall back to the localized `common.emptyText` (`'No data to display'`). |
|
|
2124
|
+
| `enforceCoherence` | `boolean \| undefined` | `false` | | 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. |
|
|
2125
|
+
| `id` | `string \| undefined` | | | Names this dropdown: the activator's id (unless it already has one), the menu's `menu_<id>`, and the key `useBbDropdownContext(id)` and a companion `BbDropdownGroup` pair by. Generated when omitted. |
|
|
2126
|
+
| `items` | `BbDropdownItem[]` | `[]` | 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 groups, or pass {@link InternalGroup} objects for titled / selectable sections. An item may carry its own `items` to open a submenu. The shapes can be mixed. |
|
|
1115
2127
|
| `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...'`). |
|
|
1116
|
-
| `
|
|
1117
|
-
| `
|
|
1118
|
-
| `offset` | `number \| undefined` | `3` | | Space the floating container will maintain from the activator. |
|
|
2128
|
+
| `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet. A `pt` inside it, object or colon keys, styles only that sheet. Overrides forwarded to the underlying `BbOffCanvas` when `adaptive` renders the sheet on mobile. Merged over the adaptive defaults (`side: 'bottom'`, `size: 'auto'`, `draggable: true`). Ignored when `adaptive` is `false`. A `pt` inside it styles ONLY the sheet, in `BbOffCanvas`'s part words (`root`, `header`, `title`, `description`, `content`, `footer`, `close`; state `open`), object (`{ pt: { header: '…' } }`) or colon keys (`{ 'pt:header': '…' }`) alike. It merges after what this component forwards to its sheet, so it wins a conflict and drops nothing — see the passthrough guide § Inside the sheet. |
|
|
2129
|
+
| `offset` | `number \| undefined` | `4` | | Space the floating container will maintain from the activator. |
|
|
1119
2130
|
| `padding` | `number \| undefined` | `10` | | Minimum empty space to keep from the edge of the page |
|
|
1120
|
-
| `placement` | `
|
|
2131
|
+
| `placement` | `'left'` \| `'right'` \| `'top'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'cursor'` | `"bottom"` | | Position of the dropdown relative to the activator. Use `'cursor'` to anchor at the mouse/touch coordinates. (No arrow is drawn either way — arrows are tooltip-only in v3.) |
|
|
1121
2132
|
| `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. |
|
|
1122
|
-
| `transitionDuration` | `number \| undefined` | `
|
|
2133
|
+
| `transitionDuration` | `number \| undefined` | `150` | | How long the transition has to last in milliseconds. Menus use the fast transition (150) rather than the medium one (250) the other popovers default to: a menu is opened to pick one command and is gone again, so it answers faster than a panel the user reads or edits in. |
|
|
1123
2134
|
| `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 |
|
|
1124
2135
|
| `width` | `string \| number \| undefined` | `"auto"` | | Width of the dropdown in pixels, percentage, or 'auto' to fit content. |
|
|
1125
2136
|
|
|
2137
|
+
## Passthrough parts and states
|
|
2138
|
+
|
|
2139
|
+
`pt:<part>="…"` restyles a part; `pt:<part>:<state>="…"` applies only while the state is on. A component-wide state is on for every part at once; a _per node_ state resolves on each node of a broadcast part (one row, one option, one day). Grammar and merge rules: `guides/passthrough.md`. In `<script>`, type a `pt` value as `<Component>Props['pt']` (`<Component>Props<Row>['pt']` on a generic component); `PtValue` is not exported: `guides/passthrough.md` § Typing `pt` in `<script>`.
|
|
2140
|
+
|
|
2141
|
+
| Part | What it is |
|
|
2142
|
+
| --- | --- |
|
|
2143
|
+
| `root` | The floating element — an invisible positioning wrapper; a `class` on the component lands here. No node on the phone sheet: style what you see with `panel`. |
|
|
2144
|
+
| `panel` | The menu surface you see — the bordered flyout box on desktop, the sheet itself on a phone. |
|
|
2145
|
+
| `sheet` | The bottom sheet the menu becomes on a phone (the `BbOffCanvas` root) — never the desktop surface. Applied after `panel`, so it wins a conflict there. |
|
|
2146
|
+
| `header` | The menu's header band. |
|
|
2147
|
+
| `footer` | The menu's footer band. |
|
|
2148
|
+
| `input` | A searchable group's search field — a broadcast: it lands on every searchable group's field, desktop and phone alike. Its magnifier glyph is chrome. |
|
|
2149
|
+
| `list` | The top-level items container between the bands — the node that lays the entries out (a flex column with a 1px gap; on a phone, the sheet's items container). A submenu's list is not reached. Groups, headings and dividers are not parts. |
|
|
2150
|
+
| `item` | One menu entry, submenus included — a broadcast resolved per entry. Also takes a per-item function, called with the entry. |
|
|
2151
|
+
| `itemText` | An entry's label (its `text`) — resolved with that entry's states. A per-entry `#<key>` slot replaces it. Also takes a per-item function. |
|
|
2152
|
+
| `itemIcon` | An entry's prepend / append icons — resolved with that entry's states. Also takes a per-item function. |
|
|
2153
|
+
| `itemDescription` | An entry's muted second line (its `description`) — resolved with that entry's states. A per-entry `#<key>` slot replaces it. Also takes a per-item function. |
|
|
2154
|
+
|
|
2155
|
+
States are listed in precedence order: when two are on at once and their entries conflict, the later one wins.
|
|
2156
|
+
|
|
2157
|
+
| State | When it is on |
|
|
2158
|
+
| --- | --- |
|
|
2159
|
+
| `selected` | Per node, on the entry parts: a selectable group's checked entry. |
|
|
2160
|
+
| `disabled` | Per node, on the entry parts: an entry that is disabled. |
|
|
2161
|
+
| `open` | Component-wide: the menu is open. |
|
|
2162
|
+
|
|
1126
2163
|
## Events
|
|
1127
2164
|
|
|
1128
|
-
- `
|
|
1129
|
-
- `
|
|
2165
|
+
- `hidden` — `(): void` — Emitted once the menu has finished closing.
|
|
2166
|
+
- `hide` — `(): void` — Emitted as soon as the menu starts to close.
|
|
2167
|
+
- `item:selected` — `(value: any): void` — Fired when an item in any selectable group becomes selected. The payload is the item's resolved value (its `item-value` for pipeline groups, else its `key`) — symmetric with `BbTable`'s `item:selected`.
|
|
2168
|
+
- `item:unselected` — `(value: any): void` — Fired when an item in any selectable group becomes unselected. Payload is the item's resolved value, matching `item:selected`.
|
|
2169
|
+
- `show` — `(): void` — Emitted as soon as the menu (the popover, or the sheet on a phone) starts to open.
|
|
2170
|
+
- `shown` — `(): void` — Emitted once the menu is open and its open transition has finished.
|
|
1130
2171
|
|
|
1131
2172
|
## Slots
|
|
1132
2173
|
|
|
1133
|
-
- `activator` — scope: `BbDropdownActivatorSlotProps` — The element that triggers the dropdown to open. Spread `props` onto your trigger element.
|
|
2174
|
+
- `activator` — scope: `BbDropdownActivatorSlotProps` `{ disabled?: boolean; loading: boolean; open: boolean; placement: Placement \| "cursor"; props: BbDropdownActivatorProps }` — The element that triggers the dropdown to open. Spread `props` onto your trigger element.
|
|
1134
2175
|
- `default` — scope: `any` — Hosts `<BbDropdownGroup>` companions. They register their group with the dropdown and render nothing themselves.
|
|
1135
|
-
- `
|
|
1136
|
-
- `
|
|
1137
|
-
- `
|
|
1138
|
-
- `item:
|
|
1139
|
-
- `
|
|
1140
|
-
- `
|
|
2176
|
+
- `empty` — scope: `BbDropdownPlaceholderSlotProps` `{ groupKey?: string; text: string }` — Replaces the default "no data" placeholder row shown in a pipeline group that resolved to no items. Rendered once per empty group.
|
|
2177
|
+
- `footer` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — 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.
|
|
2178
|
+
- `header` — scope: `BbDropdownEdgeSlotProps` `{ disabled?: boolean; open: boolean; placement: Placement \| "cursor" }` — 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.
|
|
2179
|
+
- `item:append` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; text: string }` — The trailing region of every row (and group title line), replacing its `append:icon`. A named slot wins over it; the submenu chevron and the check on a selected row take its place.
|
|
2180
|
+
- `item:prepend` — scope: `BbDropdownItemSlotProps` `{ description?: string; disabled?: boolean; group: BbDropdownSlotGroup; groupTitle: boolean; level: number; index: number; item: InternalItem; loading: boolean; open: boolean; placement: Placement \| "cursor"; selected: boolean; text: string }` — The leading region of every row (and group title line), replacing its `prepend:icon`. A row's own or its group's named slot wins over it.
|
|
2181
|
+
- `loading` — scope: `BbDropdownPlaceholderSlotProps` `{ groupKey?: string; text: string }` — Replaces the default loading placeholder row shown in a pipeline group while its async items load. Rendered once per loading group.
|
|
2182
|
+
- `#<key>` (named from data) — scope: `BbDropdownItemSlotProps` — One row's content (text and description), by its key; in a fetched group, by its resolved `itemValue`. Reserved keys (their slot is one of this component's own, so a key spelled like them is an error): `activator`, `default`, `empty`, `footer`, `header`, `item`, `loading`.
|
|
2183
|
+
- `#<key>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — One row's leading region; replaces its `prepend:icon`.
|
|
2184
|
+
- `#<key>:append` (named from data) — scope: `BbDropdownItemSlotProps` — One row's trailing region; replaces its `append:icon` and its submenu chevron. The check takes its place on the selected row.
|
|
2185
|
+
- `#<groupKey>:item` (named from data) — scope: `BbDropdownItemSlotProps` — The content of every row of that group, and no other; a row's own `#<key>` still wins.
|
|
2186
|
+
- `#<groupKey>:item:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of every row of that group — e.g. an avatar per record, drawn from `item.meta`, while other rows keep their `prepend:icon`.
|
|
2187
|
+
- `#<groupKey>:item:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of every row of that group; replaces their `append:icon`. The check takes its place on the selected row.
|
|
2188
|
+
- `#<groupKey>` (named from data) — scope: `BbDropdownItemSlotProps` — That group's title line (the group is passed as `item`, `groupTitle` is `true`). Reserved keys (their slot is one of this component's own, so a key spelled like them is an error): `activator`, `default`, `empty`, `footer`, `header`, `item`, `loading`.
|
|
2189
|
+
- `#<groupKey>:prepend` (named from data) — scope: `BbDropdownItemSlotProps` — The leading region of that group's title line.
|
|
2190
|
+
- `#<groupKey>:append` (named from data) — scope: `BbDropdownItemSlotProps` — The trailing region of that group's title line.
|
|
2191
|
+
|
|
2192
|
+
## CSS custom properties
|
|
2193
|
+
|
|
2194
|
+
Set these on the element, or on a class you put on it, to retune this component alone — the sanctioned alternative to reaching past the API with `:deep()`. They are this component's own locals — a **Set on** of `pt:<part>` means the local lives on that part's element, so set it through that entry (`pt:box="[--border-color:var(--color-green-500)]"`); the global `--bb-*` theme tokens are a separate tier (see the [design-tokens guide](./guides/design-tokens.md), or the MCP `list_tokens` tool).
|
|
2195
|
+
|
|
2196
|
+
| Property | Set on | Default | What it is |
|
|
2197
|
+
| --- | --- | --- | --- |
|
|
2198
|
+
| `--bg` | `.bb-dropdown__group-search` | `var(--bb-panel)` | |
|
|
2199
|
+
| `--menu-inset` | `.bb-dropdown` | `4px` | Inset between the menu's outer chrome and its first item — owned here and * consumed by both `.bb-dropdown__list`'s padding and the submenu * lead-in below, so the two can never drift apart. |
|
|
2200
|
+
|
|
2201
|
+
## Component tree
|
|
2202
|
+
|
|
2203
|
+
`BbDropdown` is not one component: rendering it mounts every component below, and each one is live inside it. **Read this before styling, theming or debugging `BbDropdown`, and before concluding a part, a token or a behaviour does not exist** — it may live on a component further down. How to read it:
|
|
2204
|
+
|
|
2205
|
+
- **_internal_** nodes are building blocks with no API of their own: you reach them only through `BbDropdown`. A pt part listed as landing there is set on `BbDropdown` (`pt:<part>`).
|
|
2206
|
+
- **_public_** nodes are components with their own contract. `BbDropdown` reaches one only through a pt part of its own that lands on it (shown on the parent node as `part → Component`, e.g. `spinner → BbSpinner`) or through a pt map it hands it (shown as "hands … the pt map", in `BbDropdown`'s words → the child's). The child's other props and parts are not exposed; its contract explains what it renders.
|
|
2207
|
+
- **CSS custom properties** listed on a node are declared on THAT node's root and read by elements inside it. Set one on that node's root or on the element inside it that reads it — the pt part that lands there is how you reach it (`pt:box="[--border-color:…]"` on a text input) — never on `BbDropdown`'s root, where the node's own declaration masks it (design-tokens guide, _Overriding one from a consumer app_, rule 0).
|
|
2208
|
+
- Listed nodes are the ones `BbDropdown`'s API reaches or that declare a documented CSS variable; the rest fold into "also mounts". The complete tree, repeats and undocumented locals included, is the `tree` field of this component in `components.json`.
|
|
2209
|
+
|
|
2210
|
+
- `BbDropdown` _(this component)_ — its own template binds: `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-dropdown__header`, `list` → `span.bb-dropdown__list`, `footer` → `div.bb-dropdown__footer`
|
|
2211
|
+
- `BbDropdownList` _(internal — not importable, reach it through `BbDropdown`)_ — also mounts `BbIcon`, `CommonPopover`, `BbDropdownList`
|
|
2212
|
+
- `BbBaseButton` _(public — [contract](./BbBaseButton.md))_ — its own pt parts (`BbBaseButton`): `root` → `RouterComponent`, `root` → `a`, `root` → `component`; also mounts `RouterComponent`
|
|
2213
|
+
- `BbBadge` _(public — [contract](./BbBadge.md))_ — its own pt parts (`BbBadge`): `spinner` → `BbSpinner`, `icon` → `BbIcon`, `clear` → `button.bb-badge__clear`; documented CSS variables: `--bg`, `--fg`, `--bw`, `--ring-color`, `--ring-size`, `--min-size-md`, `--min-size`, `--elev`, `--r`, `--fs`, `--icon-size`, `--gap`, `--px`, `--clear-size`, `--pad-left`; also mounts `BbIcon`, `BbSpinner`, `BadgeBodyContent`
|
|
2214
|
+
- `AdaptiveDropdown` _(internal — not importable, reach it through `BbDropdown`)_ — hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbSmoothHeight`, `BbDropdownList`
|
|
2215
|
+
- `BbOffCanvas` _(public — [contract](./BbOffCanvas.md))_ — its own pt parts (`BbOffCanvas`): `header` → `div.bb-offcanvas__header`, `title` → `span.bb-offcanvas__title`, `description` → `p.bb-offcanvas__description`, `close` → `CloseButton`, `content` → `div.bb-offcanvas__content`, `footer` → `div.bb-offcanvas__footer`; documented CSS variables: `--stack-x`, `--stack-fill`, `--stack-transition-duration`, `--px`, `--handle-w`, `--handle-h`, `--handle-bg`, `--safe-top`, `--close-size`
|
|
2216
|
+
- `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`
|
|
2217
|
+
- `BbButton` _(public — [contract](./BbButton.md))_ — its own pt parts (`BbButton`): `root` → `BbBaseButton`, `spinner` → `BbSpinner`, `icon` → `BbIcon`, `text` → `span.bb-button__text`; documented CSS variables: `--h-xs`, `--h`, `--icon-size`, `--px`, `--fs`, `--r`, `--gap`, `--bg`, `--bg-hover`, `--bg-pressed`, `--fg`, `--border-color`, `--ring-color`, `--ring-size`, `--bw`, `--fg-hover`, `--border-hover`, `--fg-pressed`, `--border-pressed`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--opacity-disabled`, `--elev-tier`, `--elev`; also mounts `BbIcon`, `BbBaseButton`, `BbSpinner`
|
|
2218
|
+
- Also mounts `CommonPopover`, `DropdownPipelineResolver`
|
|
1141
2219
|
|
|
1142
2220
|
## See Also
|
|
1143
2221
|
|