bitboss-ui 3.0.0-beta.63 → 3.0.0-beta.65
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 +25 -20
- package/bin/bitboss-ui.mjs +73 -7
- package/dist/ai/BbAlert.md +10 -1
- package/dist/ai/BbBadge.md +35 -3
- package/dist/ai/BbBadgeButton.md +4 -2
- package/dist/ai/BbBaseButton.md +9 -3
- package/dist/ai/BbBreadcrumbs.md +2 -2
- package/dist/ai/BbButton.md +113 -8
- package/dist/ai/BbCheckbox.md +1 -1
- package/dist/ai/BbCheckboxGroup.md +94 -6
- package/dist/ai/BbColorInput.md +4 -1
- package/dist/ai/BbColorPalette.md +2 -1
- package/dist/ai/BbConfirm.md +7 -3
- package/dist/ai/BbDatePicker.md +2 -1
- package/dist/ai/BbDatePickerInput.md +4 -1
- package/dist/ai/BbDialog.md +12 -11
- package/dist/ai/BbDropdown.md +189 -38
- package/dist/ai/BbDropdownButton.md +27 -7
- package/dist/ai/BbForm.md +55 -22
- package/dist/ai/BbHost.md +2 -2
- package/dist/ai/BbHoverCard.md +7 -3
- package/dist/ai/BbIcon.md +12 -6
- package/dist/ai/BbIndicator.md +11 -1
- package/dist/ai/BbNumberInput.md +4 -1
- package/dist/ai/BbOffCanvas.md +37 -3
- package/dist/ai/BbPopover.md +2 -1
- package/dist/ai/BbRadio.md +1 -1
- package/dist/ai/BbRadioGroup.md +102 -10
- package/dist/ai/BbSelect.md +52 -17
- package/dist/ai/BbSelectPopover.md +93 -26
- package/dist/ai/BbSwitch.md +1 -1
- package/dist/ai/BbSwitchGroup.md +30 -3
- package/dist/ai/BbTable.md +17 -10
- package/dist/ai/BbTabs.md +8 -3
- package/dist/ai/BbTabsList.md +4 -1
- package/dist/ai/BbTag.md +5 -2
- package/dist/ai/BbTextInput.md +4 -1
- package/dist/ai/BbTextarea.md +4 -1
- package/dist/ai/BbTimePicker.md +2 -1
- package/dist/ai/BbTimePickerInput.md +4 -1
- package/dist/ai/BbToast.md +9 -3
- package/dist/ai/BbTooltip.md +71 -9
- package/dist/ai/ChipsBox.md +1 -1
- package/dist/ai/CommonField.md +1 -1
- package/dist/ai/OptionsContainer.md +42 -0
- package/dist/ai/changelog.json +494 -6
- package/dist/ai/components.json +50 -48
- package/dist/ai/composables/useBbConfig.md +8 -1
- package/dist/ai/composables/useConfirm.md +39 -1
- package/dist/ai/design-tokens.json +6 -6
- package/dist/ai/guides/agent-contract.md +2 -2
- package/dist/ai/guides/ai-router.md +24 -23
- package/dist/ai/guides/app-layout.md +5 -0
- package/dist/ai/guides/component-picker.md +9 -2
- package/dist/ai/guides/design-language.md +24 -24
- package/dist/ai/guides/design-tokens.md +15 -8
- package/dist/ai/guides/icons-policy.md +9 -2
- package/dist/ai/guides/inertia-helpers.md +1183 -301
- package/dist/ai/guides/installation-and-plugin-setup.md +12 -2
- package/dist/ai/guides/migration/adoption-checklist.md +235 -0
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +16 -15
- package/dist/ai/guides/migration/components/bb-dialog.md +9 -9
- package/dist/ai/guides/migration/components/bb-dropdown.md +7 -2
- package/dist/ai/guides/migration/components/bb-popover.md +4 -2
- package/dist/ai/guides/migration/components/bb-select.md +19 -0
- package/dist/ai/guides/migration/components/bb-table.md +1 -0
- package/dist/ai/guides/migration/components/bb-toast.md +4 -0
- package/dist/ai/guides/migration/components/bb-tooltip.md +15 -12
- package/dist/ai/guides/migration/components/use-confirm.md +25 -2
- package/dist/ai/guides/migration/v2-to-v3.md +211 -9
- package/dist/ai/guides/migration/v3-beta-css-classes.md +7 -3
- package/dist/ai/guides/options-items-playbook.md +2 -1
- package/dist/ai/guides/passthrough.md +149 -85
- package/dist/ai/guides/preset-components.md +140 -15
- package/dist/ai/helpers/definePreset.json +7 -0
- package/dist/ai/helpers/definePreset.ts +123 -11
- package/dist/ai/helpers/inertia/manifest.json +151 -62
- package/dist/ai/helpers/inertia/messages.ts +33 -0
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +120 -20
- package/dist/ai/helpers/inertia/useHasChanged.ts +34 -16
- package/dist/ai/helpers/inertia/useLazyProp.ts +102 -36
- package/dist/ai/helpers/inertia/useLazyPropGetter.ts +3 -1
- package/dist/ai/helpers/inertia/usePaginatedResponseContext.ts +154 -34
- package/dist/ai/helpers/inertia/usePromiseForm.ts +121 -14
- package/dist/ai/helpers/inertia/useQuery.ts +133 -11
- package/dist/ai/helpers/inertia/useQueryObject.ts +74 -67
- package/dist/ai/helpers/inertia/useResourceContext.ts +60 -14
- package/dist/ai/helpers/inertia/useRouteQuery.ts +38 -27
- package/dist/ai/helpers/inertia/useScreenSizes.ts +9 -7
- package/dist/ai/helpers/inertia/useTableContext.ts +5 -2
- package/dist/ai/helpers/inertia/utils.ts +14 -0
- package/dist/ai/index.md +1 -0
- package/dist/ai/manifest/common.json +0 -1
- package/dist/ai/manifest/components/BbAlert.json +7 -2
- package/dist/ai/manifest/components/BbBadge.json +13 -4
- package/dist/ai/manifest/components/BbBadge.tree.json +2 -0
- package/dist/ai/manifest/components/BbBadgeButton.json +4 -2
- package/dist/ai/manifest/components/BbBaseButton.json +4 -2
- package/dist/ai/manifest/components/BbBreadcrumbs.tree.json +1 -1
- package/dist/ai/manifest/components/BbButton.json +14 -3
- package/dist/ai/manifest/components/BbButton.tree.json +5 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.json +13 -8
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +11 -1
- package/dist/ai/manifest/components/BbColorInput.json +18 -15
- package/dist/ai/manifest/components/BbColorPalette.json +1 -1
- package/dist/ai/manifest/components/BbConfirm.json +4 -2
- package/dist/ai/manifest/components/BbConfirm.tree.json +1 -1
- package/dist/ai/manifest/components/BbDatePicker.json +1 -1
- package/dist/ai/manifest/components/BbDatePickerInput.json +17 -14
- package/dist/ai/manifest/components/BbDialog.tree.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.json +24 -19
- package/dist/ai/manifest/components/BbDropdown.tree.json +9 -2
- package/dist/ai/manifest/components/BbDropdownButton.json +33 -20
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -2
- package/dist/ai/manifest/components/BbForm.json +2 -2
- package/dist/ai/manifest/components/BbHost.tree.json +1 -1
- package/dist/ai/manifest/components/BbHoverCard.json +1 -1
- package/dist/ai/manifest/components/BbIndicator.json +8 -2
- package/dist/ai/manifest/components/BbNumberInput.json +5 -2
- package/dist/ai/manifest/components/BbOffCanvas.json +2 -2
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +1 -1
- package/dist/ai/manifest/components/BbPopover.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +17 -12
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +8 -1
- package/dist/ai/manifest/components/BbSelect.json +21 -18
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -2
- package/dist/ai/manifest/components/BbSelectPopover.json +10 -10
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +3 -2
- package/dist/ai/manifest/components/BbSwitchGroup.json +1 -1
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +3 -1
- package/dist/ai/manifest/components/BbTable.tree.json +14 -1
- package/dist/ai/manifest/components/BbTabs.json +9 -6
- package/dist/ai/manifest/components/BbTabs.tree.json +1 -1
- package/dist/ai/manifest/components/BbTabsList.json +6 -3
- package/dist/ai/manifest/components/BbTag.json +19 -16
- package/dist/ai/manifest/components/BbTag.tree.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.json +6 -3
- package/dist/ai/manifest/components/BbTextarea.json +6 -3
- package/dist/ai/manifest/components/BbTimePicker.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.json +10 -7
- package/dist/ai/manifest/components/BbToast.json +7 -2
- package/dist/ai/manifest/components/BbToast.tree.json +4 -2
- package/dist/ai/manifest/components/BbTooltip.json +6 -5
- package/dist/ai/manifest/components/ChipsBox.tree.json +1 -1
- package/dist/ai/manifest/components/CommonField.json +1 -1
- package/dist/ai/manifest/components/OptionsContainer.json +3 -1
- package/dist/ai/manifest/components/OptionsContainer.tree.json +38 -0
- package/dist/ai/manifest/index.json +3 -3
- package/dist/ai/manifest/meta.json +5 -3
- package/dist/ai/manifest/types.advanced.json +5 -2
- package/dist/ai/manifest/types.api.json +9 -7
- package/dist/ai/recipes/inertia/approvals-inbox.md +1 -1
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/layout-scaffold.md +19 -6
- package/dist/ai/recipes/inertia/ownership-atlas.md +1 -1
- package/dist/ai/recipes/inertia/records-workspace.md +50 -14
- package/dist/ai/recipes/inertia/upload-center.md +1 -1
- package/dist/ai/recipes/nuxt/layout-scaffold.md +19 -6
- package/dist/ai/recipes/nuxt/records-workspace.md +42 -12
- package/dist/ai/recipes/vue/layout-scaffold.md +19 -6
- package/dist/ai/recipes/vue/records-workspace.md +42 -12
- package/dist/ai/source/BbAlert.md +94 -76
- package/dist/ai/source/BbBadge.md +174 -72
- package/dist/ai/source/BbBadgeButton.md +130 -65
- package/dist/ai/source/BbBaseButton.md +46 -124
- package/dist/ai/source/BbBaseCheckboxIcon.md +38 -0
- package/dist/ai/source/BbBaseRadioIcon.md +18 -0
- package/dist/ai/source/BbBaseSwitchIcon.md +51 -0
- package/dist/ai/source/BbButton.md +153 -36
- package/dist/ai/source/BbCheckboxGroup.md +142 -18
- package/dist/ai/source/BbColorInput.md +240 -204
- package/dist/ai/source/BbColorPalette.md +7 -4
- package/dist/ai/source/BbConfirm.md +34 -11
- package/dist/ai/source/BbConfirmPortal.md +24 -9
- package/dist/ai/source/BbDatePicker.md +11 -7
- package/dist/ai/source/BbDatePickerInput.md +306 -269
- package/dist/ai/source/BbDialog.md +49 -14
- package/dist/ai/source/BbDropdown.md +314 -197
- package/dist/ai/source/BbDropdownButton.md +197 -31
- package/dist/ai/source/BbDropdownGroup.md +274 -176
- package/dist/ai/source/BbForm.md +50 -6
- package/dist/ai/source/BbHoverCard.md +12 -5
- package/dist/ai/source/BbIcon.md +4 -3
- package/dist/ai/source/BbIndicator.md +73 -52
- package/dist/ai/source/BbNumberInput.md +293 -257
- package/dist/ai/source/BbOffCanvas.md +55 -29
- package/dist/ai/source/BbPopover.md +14 -10
- package/dist/ai/source/BbRadioGroup.md +413 -297
- package/dist/ai/source/BbSelect.md +549 -435
- package/dist/ai/source/BbSelectPopover.md +153 -34
- package/dist/ai/source/BbSwitchGroup.md +70 -10
- package/dist/ai/source/BbTable.md +369 -37
- package/dist/ai/source/BbTabs.md +115 -39
- package/dist/ai/source/BbTabsList.md +106 -38
- package/dist/ai/source/BbTabsPanels.md +96 -36
- package/dist/ai/source/BbTabsRoot.md +96 -36
- package/dist/ai/source/BbTag.md +267 -233
- package/dist/ai/source/BbTextInput.md +261 -225
- package/dist/ai/source/BbTextarea.md +251 -215
- package/dist/ai/source/BbTimePicker.md +11 -7
- package/dist/ai/source/BbTimePickerInput.md +257 -220
- package/dist/ai/source/BbToast.md +73 -32
- package/dist/ai/source/BbToastPortal.md +65 -30
- package/dist/ai/source/BbTooltip.md +148 -113
- package/dist/ai/source/CommonPopover.md +6 -1
- package/dist/ai/source/FlatListBox.md +19 -9
- package/dist/ai/source/GroupedListBox.md +19 -9
- package/dist/ai/source/OptionsContainer.md +25 -9
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +61 -36
- package/dist/components/BbAlert/types.d.ts +9 -5
- package/dist/components/BbAlert/types.js +8 -3
- package/dist/components/BbBadge/BadgeBodyContent.vue.d.ts +3 -3
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +26 -17
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +103 -50
- package/dist/components/BbBadge/BbBadgeButton.vue_vue_type_script_setup_true_lang.js +20 -15
- package/dist/components/BbBadge/badgeButtonContext.d.ts +12 -1
- package/dist/components/BbBadge/types.d.ts +45 -15
- package/dist/components/BbBadge/types.js +12 -3
- package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +89 -126
- package/dist/components/BbBaseButton/types.d.ts +23 -4
- package/dist/components/BbBaseButton/types.js +7 -1
- package/dist/components/BbBaseButton/useLinkState.d.ts +41 -0
- package/dist/components/BbBaseButton/useLinkState.js +70 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +130 -74
- package/dist/components/BbButton/types.d.ts +50 -13
- package/dist/components/BbButton/types.js +10 -3
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +148 -95
- package/dist/components/BbCheckboxGroup/types.d.ts +34 -11
- package/dist/components/BbCheckboxGroup/types.js +9 -4
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +1 -1
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +134 -93
- package/dist/components/BbColorInput/types.d.ts +11 -4
- package/dist/components/BbColorInput/types.js +9 -3
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +82 -59
- package/dist/components/BbConfirm/types.d.ts +9 -4
- package/dist/components/BbConfirm/types.js +8 -3
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +68 -67
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +259 -215
- package/dist/components/BbDatePickerInput/types.d.ts +12 -5
- package/dist/components/BbDatePickerInput/types.js +9 -3
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +223 -219
- package/dist/components/BbDialog/useDialogStack.d.ts +1 -1
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +104 -89
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +1 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +323 -285
- package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +1 -0
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +411 -319
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +100 -98
- package/dist/components/BbDropdown/DropdownRow.vue.d.ts +4 -3
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +49 -28
- package/dist/components/BbDropdown/normalizeGroups.d.ts +6 -0
- package/dist/components/BbDropdown/normalizeGroups.js +21 -15
- package/dist/components/BbDropdown/types.d.ts +59 -12
- package/dist/components/BbDropdown/types.js +16 -3
- package/dist/components/BbDropdown/useDropdownContext.d.ts +6 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +2 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +179 -68
- package/dist/components/BbDropdownButton/types.d.ts +44 -16
- package/dist/components/BbDropdownButton/types.js +28 -3
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +111 -89
- package/dist/components/BbForm/formSchema.d.ts +13 -0
- package/dist/components/BbHoverCard/BbHoverCard.vue_vue_type_script_setup_true_lang.js +100 -100
- package/dist/components/BbIndicator/BbIndicator.vue_vue_type_script_setup_true_lang.js +40 -25
- package/dist/components/BbIndicator/types.d.ts +9 -5
- package/dist/components/BbIndicator/types.js +8 -3
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +243 -202
- package/dist/components/BbNumberInput/types.d.ts +12 -5
- package/dist/components/BbNumberInput/types.js +9 -3
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +1 -1
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +401 -399
- package/dist/components/BbOffCanvas/types.d.ts +6 -2
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +81 -80
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +158 -105
- package/dist/components/BbRadioGroup/types.d.ts +21 -7
- package/dist/components/BbRadioGroup/types.js +9 -4
- package/dist/components/BbSelect/BbSelect.vue.d.ts +4 -3
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +181 -137
- package/dist/components/BbSelect/types.d.ts +36 -22
- package/dist/components/BbSelect/types.js +22 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +4 -4
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +600 -577
- package/dist/components/BbSelectPopover/knownItems.d.ts +5 -0
- package/dist/components/BbSelectPopover/types.d.ts +46 -12
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbSwitchGroup/types.d.ts +14 -4
- package/dist/components/BbSwitchGroup/types.js +8 -3
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1102 -995
- package/dist/components/BbTable/estimatedFloors.golden.d.ts +25 -0
- package/dist/components/BbTable/measuredFloors.d.ts +46 -0
- package/dist/components/BbTable/measuredFloors.js +322 -0
- package/dist/components/BbTable/measuredFloorsTestKit.d.ts +27 -0
- package/dist/components/BbTable/textRuler.d.ts +71 -0
- package/dist/components/BbTable/textRuler.js +121 -0
- package/dist/components/BbTable/utils.d.ts +113 -6
- package/dist/components/BbTable/utils.js +118 -65
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +53 -35
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +62 -45
- package/dist/components/BbTabs/types.d.ts +26 -11
- package/dist/components/BbTabs/types.js +23 -8
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +205 -164
- package/dist/components/BbTag/types.d.ts +11 -4
- package/dist/components/BbTag/types.js +9 -3
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +98 -57
- package/dist/components/BbTextInput/types.d.ts +12 -5
- package/dist/components/BbTextInput/types.js +9 -3
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +137 -96
- package/dist/components/BbTextarea/types.d.ts +12 -5
- package/dist/components/BbTextarea/types.js +9 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +105 -104
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +241 -197
- package/dist/components/BbTimePickerInput/types.d.ts +12 -5
- package/dist/components/BbTimePickerInput/types.js +9 -3
- package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +74 -32
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +47 -47
- package/dist/components/BbToast/types.d.ts +10 -5
- package/dist/components/BbToast/types.js +18 -3
- package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +85 -71
- package/dist/components/BbTooltip/types.d.ts +13 -8
- package/dist/components/BbTooltip/types.js +8 -3
- package/dist/components/CommonField/CommonField.vue.d.ts +1 -1
- package/dist/components/CommonPopover/CommonPopover.vue.d.ts +1 -1
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +69 -69
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +53 -50
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +146 -143
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/OptionsContainer/types.d.ts +14 -3
- package/dist/composables/useBbConfig.d.ts +1 -0
- package/dist/composables/useBbConfig.js +11 -7
- package/dist/composables/useBbFormContext.d.ts +4 -3
- package/dist/composables/useBbTabsContext.js +99 -85
- package/dist/composables/useChoiceIndicator.d.ts +58 -0
- package/dist/composables/useChoiceIndicator.js +197 -0
- package/dist/composables/useConfirm.d.ts +4 -4
- package/dist/composables/usePassthrough.d.ts +54 -1
- package/dist/composables/usePassthrough.js +100 -71
- package/dist/directives/bbTooltip.d.ts +12 -6
- package/dist/directives/createPopoverDirective.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/llms-full.txt +3467 -801
- package/dist/llms-medium.txt +71 -53
- package/dist/llms.txt +2 -1
- package/dist/passthrough-deduper.js +6 -3
- package/dist/project-dts.d.ts +24 -0
- package/dist/project-dts.js +43 -17
- package/dist/styles.css +2 -2
- package/dist/types/AlertVariant.d.ts +14 -0
- package/dist/types/AlertVariant.js +9 -0
- package/dist/types/BadgeVariant.d.ts +14 -0
- package/dist/types/BadgeVariant.js +9 -0
- package/dist/types/ButtonVariant.d.ts +16 -0
- package/dist/types/ButtonVariant.js +11 -0
- package/dist/types/CheckboxVariant.d.ts +38 -0
- package/dist/types/CheckboxVariant.js +4 -0
- package/dist/types/CommonProps.d.ts +4 -3
- package/dist/types/Config.d.ts +7 -0
- package/dist/types/ConfirmVariant.d.ts +12 -0
- package/dist/types/ConfirmVariant.js +4 -0
- package/dist/types/DropdownItemVariant.d.ts +12 -0
- package/dist/types/DropdownItemVariant.js +4 -0
- package/dist/types/IndicatorVariant.d.ts +15 -0
- package/dist/types/IndicatorVariant.js +10 -0
- package/dist/types/InputVariant.d.ts +13 -0
- package/dist/types/InputVariant.js +8 -0
- package/dist/types/RadioVariant.d.ts +38 -0
- package/dist/types/RadioVariant.js +4 -0
- package/dist/types/TabsVariant.d.ts +13 -0
- package/dist/types/TabsVariant.js +8 -0
- package/dist/types/ToastVariant.d.ts +15 -0
- package/dist/types/ToastVariant.js +10 -0
- package/dist/types/TooltipVariant.d.ts +12 -0
- package/dist/types/TooltipVariant.js +4 -0
- package/dist/types/passthrough.d.ts +83 -15
- package/dist/types/passthrough.js +2 -2
- package/dist/types/ptComponentMap.d.ts +35 -23
- package/dist/utilities/functions/extractDomContainer.d.ts +20 -1
- package/dist/utilities/functions/extractDomContainer.js +8 -3
- package/dist/utils/focusVisibility.d.ts +6 -0
- package/dist/utils/focusVisibility.js +4 -1
- package/dist/utils/passthroughDeduper.d.ts +14 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +64 -7
- package/dist/vite.js +385 -259
- package/llms.txt +2 -1
- package/package.json +5 -4
- package/scripts/lib/adoption-checklist.json +312 -0
- package/scripts/lib/eslint-plugin.d.ts +13 -0
- package/scripts/lib/eslint-plugin.mjs +75 -11
- package/scripts/lib/helpers-add.mjs +26 -2
- package/scripts/lib/idiom-scan.mjs +65 -0
- package/scripts/lib/mcp-config.mjs +203 -9
- package/scripts/lib/migrate-fix.mjs +42 -1
- package/scripts/lib/project-variant-dts.mjs +18 -0
- package/scripts/lib/validate-bb-markup.mjs +99 -2
|
@@ -34,13 +34,27 @@
|
|
|
34
34
|
</Transition>
|
|
35
35
|
<!-- `passthrough.icon` is a BROADCAST: the same binding lands on whichever content
|
|
36
36
|
icons render (at most two of the three). Bound LAST on each so a
|
|
37
|
-
consumer attribute beats ours and a consumer class appends.
|
|
37
|
+
consumer attribute beats ours and a consumer class appends. An icon
|
|
38
|
+
slot (Q81.4) beats its prop and renders INSIDE the part, a box of the
|
|
39
|
+
same class, so `pt:icon`, `--icon-size` and the spinner swap hold. -->
|
|
40
|
+
<span
|
|
41
|
+
v-if="slots.icon"
|
|
42
|
+
class="bb-button__icon bb-button__icon-slot"
|
|
43
|
+
v-bind="passthrough.icon"
|
|
44
|
+
><slot name="icon" v-bind="iconScope"
|
|
45
|
+
/></span>
|
|
38
46
|
<BbIcon
|
|
39
|
-
v-if="props['icon']"
|
|
47
|
+
v-else-if="props['icon']"
|
|
40
48
|
class="bb-button__icon"
|
|
41
49
|
:icon="props['icon']"
|
|
42
50
|
v-bind="passthrough.icon"
|
|
43
51
|
/>
|
|
52
|
+
<span
|
|
53
|
+
v-else-if="slots['prepend:icon']"
|
|
54
|
+
class="bb-button__prepend-icon bb-button__icon-slot"
|
|
55
|
+
v-bind="passthrough.icon"
|
|
56
|
+
><slot name="prepend:icon" v-bind="iconScope"
|
|
57
|
+
/></span>
|
|
44
58
|
<BbIcon
|
|
45
59
|
v-else-if="props['prepend:icon']"
|
|
46
60
|
class="bb-button__prepend-icon"
|
|
@@ -49,20 +63,28 @@
|
|
|
49
63
|
/>
|
|
50
64
|
<span
|
|
51
65
|
class="bb-button__text"
|
|
52
|
-
:class="{ 'bb-sr-only':
|
|
66
|
+
:class="{ 'bb-sr-only': iconOnly }"
|
|
53
67
|
v-bind="passthrough.text"
|
|
54
|
-
><slot>{{ text }}</slot></span
|
|
68
|
+
><slot v-bind="linkState">{{ text }}</slot></span
|
|
55
69
|
>
|
|
56
70
|
<span v-if="loading" class="bb-button__loading-label bb-sr-only">{{
|
|
57
71
|
t('common.loadingText')
|
|
58
72
|
}}</span>
|
|
59
73
|
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
74
|
+
<template v-if="!iconOnly">
|
|
75
|
+
<span
|
|
76
|
+
v-if="slots['append:icon']"
|
|
77
|
+
class="bb-button__append-icon bb-button__icon-slot"
|
|
78
|
+
v-bind="passthrough.icon"
|
|
79
|
+
><slot name="append:icon" v-bind="iconScope"
|
|
80
|
+
/></span>
|
|
81
|
+
<BbIcon
|
|
82
|
+
v-else-if="props['append:icon']"
|
|
83
|
+
class="bb-button__append-icon"
|
|
84
|
+
:icon="props['append:icon']"
|
|
85
|
+
v-bind="passthrough.icon"
|
|
86
|
+
/>
|
|
87
|
+
</template>
|
|
66
88
|
</BbBaseButton>
|
|
67
89
|
</template>
|
|
68
90
|
|
|
@@ -79,15 +101,23 @@ import { useLogger } from '@/composables/useLogger';
|
|
|
79
101
|
import { useUntil } from '../../composables/useUntil';
|
|
80
102
|
import { removedPropsFor } from '@/deprecation/removedProps';
|
|
81
103
|
import { warnRemovedAttrs } from '@/utilities/functions/warnRemovedAttrs';
|
|
82
|
-
import {
|
|
104
|
+
import { extractHtmlContainer } from '@/utilities/functions/extractDomContainer';
|
|
83
105
|
import { isEqual } from '@/utilities/functions/isEqual';
|
|
84
|
-
import { usePassthrough } from '@/composables/usePassthrough';
|
|
85
|
-
import {
|
|
106
|
+
import { usePassthrough, variantPt } from '@/composables/usePassthrough';
|
|
107
|
+
import {
|
|
108
|
+
BB_BUTTON_PT,
|
|
109
|
+
type BbButtonIconSlotProps,
|
|
110
|
+
type BbButtonProps,
|
|
111
|
+
type BbButtonSlots,
|
|
112
|
+
} from './types';
|
|
86
113
|
import { useToggleRoving } from './toggleRoving';
|
|
114
|
+
import { provideLinkState, useLinkState } from '../BbBaseButton/useLinkState';
|
|
87
115
|
import type { Sizes as SizeMap } from '@/types/SizeScale';
|
|
88
116
|
type Sizes = keyof SizeMap;
|
|
89
117
|
|
|
90
118
|
defineOptions({
|
|
119
|
+
// An app's own variants as declared `pt:<part>:<name>` props (Q76.7).
|
|
120
|
+
mixins: [variantPt(BB_BUTTON_PT)],
|
|
91
121
|
inheritAttrs: false,
|
|
92
122
|
});
|
|
93
123
|
/**
|
|
@@ -102,7 +132,7 @@ const props = withDefaults(defineProps<BbButtonProps>(), {
|
|
|
102
132
|
trueValue: true,
|
|
103
133
|
variant: 'primary',
|
|
104
134
|
});
|
|
105
|
-
defineSlots<BbButtonSlots>();
|
|
135
|
+
const slots = defineSlots<BbButtonSlots>();
|
|
106
136
|
|
|
107
137
|
if (process.env.NODE_ENV !== 'production')
|
|
108
138
|
warnRemovedAttrs('BbButton', removedPropsFor('BbButton'));
|
|
@@ -134,7 +164,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
134
164
|
}
|
|
135
165
|
|
|
136
166
|
const setButtonRef = (el: unknown) => {
|
|
137
|
-
buttonDom.value =
|
|
167
|
+
buttonDom.value = extractHtmlContainer(el) ?? undefined;
|
|
138
168
|
};
|
|
139
169
|
|
|
140
170
|
// `class` is not forwarded: it is the instance's base `root` passthrough entry
|
|
@@ -176,6 +206,21 @@ const loading = computed(
|
|
|
176
206
|
/** Latches on the first load; gates the spinner's <Transition> — see the template. */
|
|
177
207
|
const hasLoadedOnce = useUntil(loading);
|
|
178
208
|
|
|
209
|
+
/** Whether the link points at the current page: `pt` states and slot props, here and in the base button. */
|
|
210
|
+
const linkState = useLinkState(props);
|
|
211
|
+
provideLinkState(linkState);
|
|
212
|
+
|
|
213
|
+
/** An icon-only button: the `icon` prop or slot, the label visually hidden. */
|
|
214
|
+
const iconOnly = computed(() => !!props.icon || !!slots.icon);
|
|
215
|
+
|
|
216
|
+
/** What an icon slot sees: the button's `pt` states (Q81.4). */
|
|
217
|
+
const iconScope = computed<BbButtonIconSlotProps>(() => ({
|
|
218
|
+
...linkState.value,
|
|
219
|
+
pressed: isToggle.value && isPressed.value,
|
|
220
|
+
loading: loading.value,
|
|
221
|
+
disabled: !!props.disabled,
|
|
222
|
+
}));
|
|
223
|
+
|
|
179
224
|
/**
|
|
180
225
|
* Passthrough (plans/passthrough/BbButton.md — the exemplar). Named
|
|
181
226
|
* `passthrough`, not `pt`: in the template a bare `pt` is the `pt` PROP (the
|
|
@@ -193,7 +238,10 @@ const passthrough = usePassthrough({
|
|
|
193
238
|
loading: () => loading.value,
|
|
194
239
|
disabled: () => !!props.disabled,
|
|
195
240
|
pressed: () => isToggle.value && isPressed.value,
|
|
241
|
+
activeLink: () => linkState.value.activeLink,
|
|
242
|
+
exactActiveLink: () => linkState.value.exactActiveLink,
|
|
196
243
|
},
|
|
244
|
+
variant: { ...BB_BUTTON_PT.variant, current: () => props.variant },
|
|
197
245
|
});
|
|
198
246
|
|
|
199
247
|
const onClick = async (event: Event) => {
|
|
@@ -352,7 +400,7 @@ const rootBindings = computed(() =>
|
|
|
352
400
|
'bb-button--loading': loading.value,
|
|
353
401
|
'bb-button--soft-disabled': softDisabled.value,
|
|
354
402
|
'bb-button--group': props.group,
|
|
355
|
-
'bb-button--icon':
|
|
403
|
+
'bb-button--icon': iconOnly.value,
|
|
356
404
|
'bb-button--pressed': isToggle.value && isPressed.value,
|
|
357
405
|
[`bb-button--${props.variant}`]: props.variant !== 'none',
|
|
358
406
|
},
|
|
@@ -384,9 +432,15 @@ defineExpose({ $el: buttonDom });
|
|
|
384
432
|
import type { RouteLocationRaw } from 'vue-router';
|
|
385
433
|
import type { ButtonTag } from '@/types/CommonProps';
|
|
386
434
|
import type { IconType } from '@/types/Icon';
|
|
387
|
-
import
|
|
435
|
+
import {
|
|
436
|
+
BUTTON_VARIANTS,
|
|
437
|
+
type ButtonVariantBuiltIn,
|
|
438
|
+
type ButtonVariantRegistry,
|
|
439
|
+
type ButtonVariantType,
|
|
440
|
+
} from '@/types/ButtonVariant';
|
|
388
441
|
import type { Responsive } from '@/types/ResponsiveSize';
|
|
389
|
-
import type { PtMap, PtValue } from '@/types/passthrough';
|
|
442
|
+
import type { PtMap, PtValue, PtVariantAttrs } from '@/types/passthrough';
|
|
443
|
+
import type { BbLinkSlotProps } from '../BbBaseButton/types';
|
|
390
444
|
|
|
391
445
|
type Sizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
392
446
|
|
|
@@ -411,26 +465,43 @@ type Sizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
|
411
465
|
export type BbButtonPtPart = 'root' | 'icon' | 'spinner' | 'text';
|
|
412
466
|
/**
|
|
413
467
|
* Passthrough states of `BbButton`: true while `--loading` / `--disabled` /
|
|
414
|
-
* `--pressed
|
|
415
|
-
*
|
|
416
|
-
* `
|
|
468
|
+
* `--pressed`, and for a link while `activeClass` / `exactActiveClass` are on.
|
|
469
|
+
* There is no `active` state (the pointer press is Tailwind's `active:`
|
|
470
|
+
* variant). A link to the current page is `activeLink` / `exactActiveLink`,
|
|
471
|
+
* on every part: the sidebar entry of the page you are on styles its root,
|
|
472
|
+
* icon and text from them, and the default slot gets the same two booleans.
|
|
417
473
|
*
|
|
474
|
+
* @state activeLink - Component-wide: a link to the current page or one of
|
|
475
|
+
* its ancestors (`/users` on `/users/5`) — exactly when `activeClass` is on.
|
|
476
|
+
* The weakest state: `pressed`, `disabled` and `loading` win a conflict.
|
|
477
|
+
* @state exactActiveLink - Component-wide: a link to the current page itself
|
|
478
|
+
* — exactly when `exactActiveClass` is on (`activeLink` is on too, so its
|
|
479
|
+
* entries apply first and these win).
|
|
418
480
|
* @state disabled - Component-wide: the button is `disabled`.
|
|
419
481
|
* @state loading - Component-wide: `loading` is on — the spinner shows and
|
|
420
482
|
* the button ignores the pointer.
|
|
421
483
|
* @state pressed - Component-wide: a toggle button (`v-model`) is on —
|
|
422
484
|
* `aria-pressed="true"`, `--pressed` on the root.
|
|
423
485
|
*/
|
|
424
|
-
export type BbButtonPtState =
|
|
486
|
+
export type BbButtonPtState =
|
|
487
|
+
| 'activeLink'
|
|
488
|
+
| 'exactActiveLink'
|
|
489
|
+
| 'loading'
|
|
490
|
+
| 'disabled'
|
|
491
|
+
| 'pressed';
|
|
425
492
|
/** The runtime lists the resolver is wired with — kept next to the types so the two cannot drift. */
|
|
426
493
|
export const BB_BUTTON_PT = {
|
|
427
494
|
parts: ['root', 'icon', 'spinner', 'text'],
|
|
428
495
|
// Order = precedence, last wins: a pressed toggle that is also disabled or
|
|
429
|
-
// loading shows the disabled / loading styling
|
|
430
|
-
|
|
496
|
+
// loading shows the disabled / loading styling; the link states sit below
|
|
497
|
+
// all three.
|
|
498
|
+
states: ['activeLink', 'exactActiveLink', 'pressed', 'disabled', 'loading'],
|
|
499
|
+
// The `variant` is a state on every part (Q76.7), below the real ones.
|
|
500
|
+
variant: { names: BUTTON_VARIANTS, option: 'buttonVariants' },
|
|
431
501
|
} as const satisfies {
|
|
432
502
|
parts: readonly BbButtonPtPart[];
|
|
433
503
|
states: readonly BbButtonPtState[];
|
|
504
|
+
variant: { names: readonly ButtonVariantBuiltIn[]; option: string };
|
|
434
505
|
};
|
|
435
506
|
|
|
436
507
|
// The passthrough props are a mapped type written INLINE with this
|
|
@@ -445,15 +516,23 @@ export const BB_BUTTON_PT = {
|
|
|
445
516
|
export type BbButtonProps = {
|
|
446
517
|
[K in
|
|
447
518
|
| `pt:${BbButtonPtPart}`
|
|
448
|
-
| `pt:${BbButtonPtPart}:${BbButtonPtState}`
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
519
|
+
| `pt:${BbButtonPtPart}:${BbButtonPtState}`
|
|
520
|
+
| `pt:${BbButtonPtPart}:${ButtonVariantBuiltIn}`]?: PtValue;
|
|
521
|
+
} & /* @vue-ignore */ PtVariantAttrs<
|
|
522
|
+
BbButtonPtPart,
|
|
523
|
+
keyof ButtonVariantRegistry
|
|
524
|
+
> & {
|
|
525
|
+
/**
|
|
526
|
+
* Passthrough, object form: `{ icon: '…', 'icon:loading': '…' }` — the same
|
|
527
|
+
* keys as the `pt:*` attributes without the prefix. Parts: `root`, `icon`,
|
|
528
|
+
* `spinner`, `text`. States: `loading`, `disabled`, `pressed`, and the
|
|
529
|
+
* registered variants (an app's own included).
|
|
530
|
+
*/
|
|
531
|
+
pt?: PtMap<
|
|
532
|
+
BbButtonPtPart,
|
|
533
|
+
BbButtonPtState | ButtonVariantBuiltIn | keyof ButtonVariantRegistry
|
|
534
|
+
>;
|
|
535
|
+
} & BbButtonOwnProps;
|
|
457
536
|
|
|
458
537
|
/**
|
|
459
538
|
* BbButton's props without its passthrough. `BbDropdownButton` takes them for
|
|
@@ -797,11 +876,35 @@ export type BbButtonOwnProps = {
|
|
|
797
876
|
viewTransition?: boolean;
|
|
798
877
|
};
|
|
799
878
|
|
|
879
|
+
/**
|
|
880
|
+
* What `#icon` / `#prepend:icon` / `#append:icon` see: the button's `pt`
|
|
881
|
+
* states, so a glyph can follow them (a filled icon on the current page's link).
|
|
882
|
+
*/
|
|
883
|
+
export type BbButtonIconSlotProps = BbLinkSlotProps & {
|
|
884
|
+
/** A toggle (`v-model`) that is on. */
|
|
885
|
+
pressed: boolean;
|
|
886
|
+
/** Loading, the automatic loading included: the spinner shows. */
|
|
887
|
+
loading: boolean;
|
|
888
|
+
/** The `disabled` prop. */
|
|
889
|
+
disabled: boolean;
|
|
890
|
+
};
|
|
891
|
+
|
|
800
892
|
export type BbButtonSlots = {
|
|
801
893
|
/**
|
|
802
|
-
* Primary content rendered inside the button. Falls back to the `text` prop
|
|
894
|
+
* Primary content rendered inside the button. Falls back to the `text` prop
|
|
895
|
+
* when empty. A link's slot gets `{ activeLink, exactActiveLink }`: whether it
|
|
896
|
+
* points at the current page (both `false` on a button).
|
|
803
897
|
*/
|
|
804
|
-
default?: (props:
|
|
898
|
+
default?: (props: BbLinkSlotProps) => any;
|
|
899
|
+
/**
|
|
900
|
+
* The icon of an icon-only button, replacing the `icon` prop. Renders inside
|
|
901
|
+
* the `icon` part: `pt:icon`, `--icon-size` and the loading spinner apply.
|
|
902
|
+
*/
|
|
903
|
+
icon?: (props: BbButtonIconSlotProps) => any;
|
|
904
|
+
/** The leading icon, replacing `prepend:icon`; inside the `icon` part. */
|
|
905
|
+
'prepend:icon'?: (props: BbButtonIconSlotProps) => any;
|
|
906
|
+
/** The trailing icon, replacing `append:icon`; inside the `icon` part. */
|
|
907
|
+
'append:icon'?: (props: BbButtonIconSlotProps) => any;
|
|
805
908
|
};
|
|
806
909
|
```
|
|
807
910
|
|
|
@@ -1181,7 +1284,8 @@ export type BbButtonSlots = {
|
|
|
1181
1284
|
.bb-spinner {
|
|
1182
1285
|
/* Whatever icon the spinner is parked on top of — the icon-only glyph
|
|
1183
1286
|
or the prepend icon — fades out from under it. */
|
|
1184
|
-
+ .bb-icon
|
|
1287
|
+
+ .bb-icon,
|
|
1288
|
+
+ .bb-button__icon-slot {
|
|
1185
1289
|
opacity: 0;
|
|
1186
1290
|
}
|
|
1187
1291
|
|
|
@@ -1322,6 +1426,19 @@ export type BbButtonSlots = {
|
|
|
1322
1426
|
width: var(--icon-size);
|
|
1323
1427
|
}
|
|
1324
1428
|
|
|
1429
|
+
/* An icon slot's box (Q81.4): it is the `icon` part, the consumer's glyph
|
|
1430
|
+
sits centred in it, and a BbIcon there takes the part's size, as the
|
|
1431
|
+
prop's own BbIcon does. */
|
|
1432
|
+
.bb-button__icon-slot {
|
|
1433
|
+
align-items: center;
|
|
1434
|
+
display: inline-flex;
|
|
1435
|
+
justify-content: center;
|
|
1436
|
+
|
|
1437
|
+
> .bb-icon {
|
|
1438
|
+
--size: var(--icon-size);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1325
1442
|
/* The spinner mounts only while loading (plus its fade-out), first in the
|
|
1326
1443
|
DOM and at zero layout cost: its width plus the flex gap are cancelled
|
|
1327
1444
|
by an equal negative margin, so it lands exactly on top of the neighbour
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
:has-errors="fieldHasErrors"
|
|
60
60
|
:has-warnings="fieldHasWarnings"
|
|
61
61
|
:hide-label="hideLabel"
|
|
62
|
+
:indicator-ready="indicatorReady"
|
|
62
63
|
:item-input-align="itemInputAlign"
|
|
63
64
|
:item-label-align="itemLabelAlign"
|
|
64
65
|
:item-layout="itemLayout"
|
|
@@ -68,8 +69,22 @@
|
|
|
68
69
|
:loading-text="loadingText"
|
|
69
70
|
:options="options"
|
|
70
71
|
:passthrough="passthrough"
|
|
72
|
+
:variant="variant"
|
|
71
73
|
>
|
|
72
|
-
<template #prepend
|
|
74
|
+
<template #prepend>
|
|
75
|
+
<!-- The `variant` indicators (Q76.11 d): first in the list, so the
|
|
76
|
+
positioned rows paint over them; hidden from the tree (the
|
|
77
|
+
checked state is the inputs'). -->
|
|
78
|
+
<span
|
|
79
|
+
v-for="box in indicatorBoxes"
|
|
80
|
+
:key="box.key"
|
|
81
|
+
aria-hidden="true"
|
|
82
|
+
class="bb-checkbox-group__indicator"
|
|
83
|
+
:style="indicatorStyle(box)"
|
|
84
|
+
v-bind="passthrough.indicator"
|
|
85
|
+
></span>
|
|
86
|
+
<slot name="prepend"></slot>
|
|
87
|
+
</template>
|
|
73
88
|
<template #loading><slot name="loading"></slot></template>
|
|
74
89
|
<template #empty="data"
|
|
75
90
|
><slot name="empty" v-bind="data"></slot
|
|
@@ -135,6 +150,7 @@ import {
|
|
|
135
150
|
formControlPtActive,
|
|
136
151
|
pickActive,
|
|
137
152
|
usePassthrough,
|
|
153
|
+
variantPt,
|
|
138
154
|
} from '@/composables/usePassthrough';
|
|
139
155
|
import {
|
|
140
156
|
computed,
|
|
@@ -159,6 +175,7 @@ import {
|
|
|
159
175
|
toggleInputValue,
|
|
160
176
|
} from '@/utilities/functions/toggleInput';
|
|
161
177
|
import { useToggleListFocus } from '@/composables/useToggleInput';
|
|
178
|
+
import { useChoiceIndicator } from '@/composables/useChoiceIndicator';
|
|
162
179
|
import { useItemsGetter } from '@/composables/useItemsGetter';
|
|
163
180
|
import { useIndexById } from '../../composables/useIndexById';
|
|
164
181
|
import { useBaseOptions } from '@/composables/useBaseOptions';
|
|
@@ -180,7 +197,11 @@ import {
|
|
|
180
197
|
} from './types';
|
|
181
198
|
import { useFormBinding } from '@/composables/useFormBinding';
|
|
182
199
|
|
|
183
|
-
defineOptions({
|
|
200
|
+
defineOptions({
|
|
201
|
+
// An app's own variants as declared `pt:<part>:<name>` props (Q76.7).
|
|
202
|
+
mixins: [variantPt(BB_CHECKBOX_GROUP_PT)],
|
|
203
|
+
inheritAttrs: false,
|
|
204
|
+
});
|
|
184
205
|
const declaredProps = withDefaults(defineProps<BbCheckboxGroupProps<T>>(), {
|
|
185
206
|
inputPosition: 'left',
|
|
186
207
|
multiple: true,
|
|
@@ -396,6 +417,7 @@ const passthrough = usePassthrough({
|
|
|
396
417
|
props,
|
|
397
418
|
parts: BB_CHECKBOX_GROUP_PT.parts,
|
|
398
419
|
states: BB_CHECKBOX_GROUP_PT.states,
|
|
420
|
+
variant: { ...BB_CHECKBOX_GROUP_PT.variant, current: () => props.variant },
|
|
399
421
|
active: {
|
|
400
422
|
...pickActive(
|
|
401
423
|
formControlPtActive(props, () => passthroughHasValue.value),
|
|
@@ -404,6 +426,28 @@ const passthrough = usePassthrough({
|
|
|
404
426
|
loading: () => loading.value,
|
|
405
427
|
},
|
|
406
428
|
});
|
|
429
|
+
/**
|
|
430
|
+
* BbTabs' look (`variant`, Q76.11 d): the indicators under the checked rows,
|
|
431
|
+
* measured on the list. A pill per run of adjacent picks (`pill`), a bar per pick (`line`).
|
|
432
|
+
*/
|
|
433
|
+
/** `list-layout="vertical"` / `"vertical-stretch"` stack the strip into a column. */
|
|
434
|
+
const stripVertical = computed(
|
|
435
|
+
() =>
|
|
436
|
+
props.listLayout === 'vertical' || props.listLayout === 'vertical-stretch'
|
|
437
|
+
);
|
|
438
|
+
const {
|
|
439
|
+
boxes: indicatorBoxes,
|
|
440
|
+
ready: indicatorReady,
|
|
441
|
+
styleOf: indicatorStyle,
|
|
442
|
+
} = useChoiceIndicator({
|
|
443
|
+
kind: 'checkbox',
|
|
444
|
+
variant: () => props.variant,
|
|
445
|
+
vertical: () => stripVertical.value,
|
|
446
|
+
list: () => optionsElement.value,
|
|
447
|
+
rows: () => options.value,
|
|
448
|
+
rowClass: 'bb-checkbox-group__item',
|
|
449
|
+
});
|
|
450
|
+
|
|
407
451
|
/** The container names the heading `label`; this group names it `legend`, after its props. */
|
|
408
452
|
const containerPassthrough = aliasParts(passthrough, { label: 'legend' });
|
|
409
453
|
|
|
@@ -474,7 +518,7 @@ const rowListeners = (option: Option) => ({
|
|
|
474
518
|
onMouseup: (event: MouseEvent) => emit('mouseup', event),
|
|
475
519
|
});
|
|
476
520
|
|
|
477
|
-
/** One row's native checkbox: named by its text
|
|
521
|
+
/** One row's native checkbox: named by its text alone, described by the group then its own description. */
|
|
478
522
|
const rowInputAttrs = (
|
|
479
523
|
option: Option,
|
|
480
524
|
index: number,
|
|
@@ -535,18 +579,26 @@ const rowIconSlotProps = (
|
|
|
535
579
|
|
|
536
580
|
```ts
|
|
537
581
|
import type { Responsive } from '@/types/ResponsiveSize';
|
|
582
|
+
import {
|
|
583
|
+
CHECKBOX_VARIANTS,
|
|
584
|
+
type CheckboxVariantBuiltIn,
|
|
585
|
+
type CheckboxVariantRegistry,
|
|
586
|
+
type CheckboxVariantType,
|
|
587
|
+
} from '@/types/CheckboxVariant';
|
|
538
588
|
import type { BbOptionGroupItemProps } from '@/types/ItemProps';
|
|
539
589
|
import type { HTMLAttributes, InputHTMLAttributes } from 'vue';
|
|
540
590
|
import {
|
|
541
|
-
|
|
591
|
+
CHOICE_PT_PARTS,
|
|
592
|
+
type PtVariantAttrs,
|
|
542
593
|
GROUP_PT_STATES,
|
|
543
594
|
GROUP_ROW_PT_PARTS,
|
|
544
595
|
GROUP_ROW_PT_STATES,
|
|
596
|
+
type ChoiceFieldPtPart,
|
|
597
|
+
type ChoicePtMap,
|
|
598
|
+
type ChoicePtPart,
|
|
545
599
|
type GroupFieldPtPart,
|
|
546
|
-
type GroupPtMap,
|
|
547
600
|
type GroupRowPtPart,
|
|
548
601
|
type GroupWidePtState,
|
|
549
|
-
type GroupPtPart,
|
|
550
602
|
type GroupPtState,
|
|
551
603
|
type PtItemCtx,
|
|
552
604
|
type PtNoInfer,
|
|
@@ -569,46 +621,50 @@ import type { CommonFieldAsteriskSlotProps } from '../CommonField/types';
|
|
|
569
621
|
*
|
|
570
622
|
* Per-item functions: on the instance, a row part (`item`, `icon`, `label`, `itemDescription`) also accepts `({ item, checked, … }) => PtValue | false | null | undefined` — `item` is the raw item of that row, and every state a boolean beside it, on for it (`checked`, `disabled`, …) — in the `pt` object or the `:pt:<part>` attribute, never on a `<part>:<state>` key and never in the global map or a scope (they ship as JSON). Its result is merged last, after every state entry, through the same deduper; a falsy result leaves the row as it was. See the passthrough guide, _Per-item functions_.
|
|
571
623
|
*/
|
|
572
|
-
export type BbCheckboxGroupPtPart =
|
|
624
|
+
export type BbCheckboxGroupPtPart = ChoicePtPart;
|
|
573
625
|
/** Passthrough states of `BbCheckboxGroup`, true while the matching `--` modifier is on. */
|
|
574
626
|
export type BbCheckboxGroupPtState = GroupPtState;
|
|
575
627
|
/** The runtime lists the resolver is wired with — kept next to the types so the two cannot drift. */
|
|
576
628
|
export const BB_CHECKBOX_GROUP_PT = {
|
|
577
|
-
parts:
|
|
629
|
+
parts: CHOICE_PT_PARTS,
|
|
578
630
|
states: GROUP_PT_STATES,
|
|
579
631
|
/** `rowStates` are declared on `rowParts` only — the field parts never have them. */
|
|
580
632
|
rowParts: GROUP_ROW_PT_PARTS,
|
|
581
633
|
rowStates: GROUP_ROW_PT_STATES,
|
|
634
|
+
// The `variant` is a state on every part (Q76.7).
|
|
635
|
+
variant: { names: CHECKBOX_VARIANTS, option: 'checkboxVariants' },
|
|
582
636
|
} as const satisfies {
|
|
583
637
|
parts: readonly BbCheckboxGroupPtPart[];
|
|
584
638
|
states: readonly BbCheckboxGroupPtState[];
|
|
585
639
|
rowParts: readonly GroupRowPtPart[];
|
|
586
640
|
rowStates: readonly BbCheckboxGroupPtState[];
|
|
641
|
+
variant: { names: readonly CheckboxVariantBuiltIn[]; option: string };
|
|
587
642
|
};
|
|
588
643
|
|
|
589
644
|
// Spelled INLINE with this component's own unions (Vue's SFC type resolver
|
|
590
645
|
// does not substitute a generic alias's type parameters — PASSTHROUGH.md T20).
|
|
591
646
|
// Two mapped types, never `Partial<Record<…>>`: the lint autofix rewrites one
|
|
592
647
|
// into the other and the SFC resolver reads only the mapped spelling (T23).
|
|
648
|
+
/**
|
|
649
|
+
* The props BbCheckboxGroup shares with BbSwitchGroup: everything but the
|
|
650
|
+
* object `pt` (each spells its own), the `variant` (a tab-strip look, Q76.11
|
|
651
|
+
* d), its `indicator` part and its pt states, which are the checkbox group's
|
|
652
|
+
* alone.
|
|
653
|
+
*/
|
|
593
654
|
/* eslint-disable @typescript-eslint/consistent-indexed-object-style */
|
|
594
|
-
export type
|
|
655
|
+
export type BbCheckboxGroupBaseProps<T> = {
|
|
595
656
|
[K in
|
|
596
657
|
| `pt:${GroupFieldPtPart}`
|
|
597
658
|
| `pt:${GroupFieldPtPart}:${GroupWidePtState}`
|
|
598
|
-
| `pt:${GroupRowPtPart}:${
|
|
659
|
+
| `pt:${GroupRowPtPart}:${GroupPtState}`]?: PtValue;
|
|
599
660
|
} & {
|
|
600
661
|
// The row parts also take a per-item function, typed on this group's
|
|
601
662
|
// item — a literal function type, not `PtItemFn<T, …>` (T23).
|
|
602
663
|
[K in `pt:${GroupRowPtPart}`]?:
|
|
603
664
|
| PtValue
|
|
604
|
-
| ((ctx: PtItemCtx<PtNoInfer<T>,
|
|
665
|
+
| ((ctx: PtItemCtx<PtNoInfer<T>, GroupPtState>) => PtItemResult);
|
|
605
666
|
} & {
|
|
606
667
|
/* eslint-enable @typescript-eslint/consistent-indexed-object-style */
|
|
607
|
-
/**
|
|
608
|
-
* Passthrough, object form: the same keys as the `pt:*` attributes
|
|
609
|
-
* without the prefix. See the `pt:<part>` row.
|
|
610
|
-
*/
|
|
611
|
-
pt?: GroupPtMap<PtNoInfer<T>>;
|
|
612
668
|
/**
|
|
613
669
|
* Focuses the field when it mounts (a dialog already open included), unless the user is typing in another field.
|
|
614
670
|
*/
|
|
@@ -945,6 +1001,33 @@ export type BbCheckboxGroupEvents = {
|
|
|
945
1001
|
(e: 'update:modelValue', value: any): void;
|
|
946
1002
|
};
|
|
947
1003
|
|
|
1004
|
+
/* eslint-disable @typescript-eslint/consistent-indexed-object-style */
|
|
1005
|
+
export type BbCheckboxGroupProps<T> = BbCheckboxGroupBaseProps<T> & {
|
|
1006
|
+
[K in
|
|
1007
|
+
| `pt:${ChoiceFieldPtPart}`
|
|
1008
|
+
| `pt:${ChoiceFieldPtPart}:${GroupWidePtState}`
|
|
1009
|
+
| `pt:${ChoiceFieldPtPart}:${CheckboxVariantBuiltIn}`
|
|
1010
|
+
| `pt:${GroupRowPtPart}:${CheckboxVariantBuiltIn}`]?: PtValue;
|
|
1011
|
+
} & /* @vue-ignore */ PtVariantAttrs<
|
|
1012
|
+
ChoicePtPart,
|
|
1013
|
+
keyof CheckboxVariantRegistry
|
|
1014
|
+
> & {
|
|
1015
|
+
/**
|
|
1016
|
+
* Passthrough, object form: the same keys as the `pt:*` attributes
|
|
1017
|
+
* without the prefix. See the `pt:<part>` row.
|
|
1018
|
+
*/
|
|
1019
|
+
pt?: ChoicePtMap<PtNoInfer<T>> & {
|
|
1020
|
+
[K in `${ChoicePtPart}:${CheckboxVariantBuiltIn | keyof CheckboxVariantRegistry}`]?: PtValue;
|
|
1021
|
+
};
|
|
1022
|
+
/* eslint-enable @typescript-eslint/consistent-indexed-object-style */
|
|
1023
|
+
/**
|
|
1024
|
+
* A tab-strip look (Q76.11 d): `'pill'` (a pill per run of adjacent picks)
|
|
1025
|
+
* or `'line'` (a bar under each pick). `list-layout="vertical"` stacks it.
|
|
1026
|
+
* Register more with `checkboxVariants`. Unset: the group's own rows.
|
|
1027
|
+
*/
|
|
1028
|
+
variant?: CheckboxVariantType;
|
|
1029
|
+
};
|
|
1030
|
+
|
|
948
1031
|
/**
|
|
949
1032
|
* Props exposed by the `icon` slot for each option: the checkbox state plus
|
|
950
1033
|
* the source item and its display text.
|
|
@@ -1048,6 +1131,8 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1048
1131
|
## Styles
|
|
1049
1132
|
|
|
1050
1133
|
```css
|
|
1134
|
+
@import '../OptionsContainer/choice-strip.css';
|
|
1135
|
+
|
|
1051
1136
|
.bb-checkbox-group {
|
|
1052
1137
|
.bb-field__layout--horizontal {
|
|
1053
1138
|
.bb-field__label {
|
|
@@ -1261,7 +1346,7 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1261
1346
|
}
|
|
1262
1347
|
> :where(
|
|
1263
1348
|
:not(
|
|
1264
|
-
|
|
1349
|
+
[type='hidden'],
|
|
1265
1350
|
.bb-checkbox-group__label,
|
|
1266
1351
|
.bb-checkbox-group__item-description
|
|
1267
1352
|
)
|
|
@@ -1294,7 +1379,7 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1294
1379
|
)
|
|
1295
1380
|
> :where(
|
|
1296
1381
|
:not(
|
|
1297
|
-
|
|
1382
|
+
[type='hidden'],
|
|
1298
1383
|
.bb-checkbox-group__label,
|
|
1299
1384
|
.bb-checkbox-group__item-description
|
|
1300
1385
|
)
|
|
@@ -1368,6 +1453,19 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1368
1453
|
}
|
|
1369
1454
|
}
|
|
1370
1455
|
|
|
1456
|
+
/* A side hidden with the library's or Tailwind's hiding classes takes its gap
|
|
1457
|
+
with it (ATT-11 e): `hideLabel` / `pt:label="sr-only"` (out of flow) or
|
|
1458
|
+
`pt:icon="hidden"` would leave an empty track AND the gap beside it (the
|
|
1459
|
+
row gap in a `vertical` item, Q76.11 c), and the side still shown sat
|
|
1460
|
+
off-centre. `:where` keeps the rule at the row's
|
|
1461
|
+
one class, so a consumer `gap-*` on `pt:item` still wins. */
|
|
1462
|
+
.bb-checkbox-group__item:where(
|
|
1463
|
+
:has(> .bb-checkbox-group__label:is(.bb-sr-only, .sr-only)),
|
|
1464
|
+
:has(> .bb-toggle-input + :is(.hidden, .sr-only, .bb-sr-only))
|
|
1465
|
+
) {
|
|
1466
|
+
gap: 0;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1371
1469
|
.bb-checkbox-group__label {
|
|
1372
1470
|
color: var(--bb-text);
|
|
1373
1471
|
font-size: var(--bb-label-fs);
|
|
@@ -1400,6 +1498,32 @@ export type BbCheckboxGroupSlots<T> = {
|
|
|
1400
1498
|
user-select: none;
|
|
1401
1499
|
}
|
|
1402
1500
|
|
|
1501
|
+
/*
|
|
1502
|
+
* `tiles` (ATT-11 d): the invisible native input covers the WHOLE tile,
|
|
1503
|
+
* padding included, not only the glyph's cell, so a click, a hover tooltip on
|
|
1504
|
+
* the input and a test runner's hit-target check land on it anywhere on the
|
|
1505
|
+
* tile. `grid-area: auto` is load-bearing: an absolutely positioned grid child
|
|
1506
|
+
* is sized against its grid area, so `inset: 0` would still be the glyph
|
|
1507
|
+
* cell. A link or a button inside a tile sits above the input and keeps its
|
|
1508
|
+
* own click. List rows keep the cell overlay.
|
|
1509
|
+
*/
|
|
1510
|
+
.bb-checkbox-group__list--tiles > .bb-checkbox-group__item {
|
|
1511
|
+
position: relative;
|
|
1512
|
+
|
|
1513
|
+
> .bb-toggle-input {
|
|
1514
|
+
border-radius: inherit;
|
|
1515
|
+
grid-area: auto;
|
|
1516
|
+
inset: 0;
|
|
1517
|
+
position: absolute;
|
|
1518
|
+
z-index: 1;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
:is(a, button) {
|
|
1522
|
+
position: relative;
|
|
1523
|
+
z-index: 2;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1403
1527
|
/* ---- Touch targets (Q44.19) -------------------------------------------
|
|
1404
1528
|
* A row is one label line (`--bb-label-lh`, 18px) and the rows sit
|
|
1405
1529
|
* `--row-gap` (10px) apart. On a coarse pointer only, each row gets an
|