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
|
@@ -162,6 +162,7 @@ import {
|
|
|
162
162
|
formControlPtActive,
|
|
163
163
|
TEXT_CONTROL_NATIVE_ATTRS,
|
|
164
164
|
usePassthrough,
|
|
165
|
+
variantPt,
|
|
165
166
|
} from '@/composables/usePassthrough';
|
|
166
167
|
import { isHex } from '@/utilities/functions/isHex';
|
|
167
168
|
import { isNotNil } from '@/utilities/functions/isNotNil';
|
|
@@ -178,7 +179,11 @@ import {
|
|
|
178
179
|
type BbColorInputSlots,
|
|
179
180
|
} from './types';
|
|
180
181
|
|
|
181
|
-
defineOptions({
|
|
182
|
+
defineOptions({
|
|
183
|
+
// An app's own variants as declared `pt:<part>:<name>` props (Q76.7).
|
|
184
|
+
mixins: [variantPt(BB_COLOR_INPUT_PT)],
|
|
185
|
+
inheritAttrs: false,
|
|
186
|
+
});
|
|
182
187
|
const declaredProps = withDefaults(defineProps<BbColorInputProps>(), {
|
|
183
188
|
// `undefined` (declared, not omitted) keeps `adaptive` three-state: it
|
|
184
189
|
// disables Vue's absent→`false` Boolean cast so BbColorPalette's
|
|
@@ -248,6 +253,11 @@ const passthrough = usePassthrough({
|
|
|
248
253
|
parts: BB_COLOR_INPUT_PT.parts,
|
|
249
254
|
states: BB_COLOR_INPUT_PT.states,
|
|
250
255
|
active: formControlPtActive(props, () => hasValue.value),
|
|
256
|
+
variant: {
|
|
257
|
+
...BB_COLOR_INPUT_PT.variant,
|
|
258
|
+
// CommonFieldInput's default.
|
|
259
|
+
current: () => props.variant ?? 'outline',
|
|
260
|
+
},
|
|
251
261
|
});
|
|
252
262
|
|
|
253
263
|
const wrapperRef = ref<InstanceType<typeof CommonFieldInput> | null>(null);
|
|
@@ -379,7 +389,12 @@ const indicatorBindings = (dotProps: Record<string, unknown>) =>
|
|
|
379
389
|
```ts
|
|
380
390
|
import type { Responsive } from '@/types/ResponsiveSize';
|
|
381
391
|
import type { BbOffCanvasProps } from '../BbOffCanvas/types';
|
|
382
|
-
import
|
|
392
|
+
import {
|
|
393
|
+
INPUT_VARIANTS,
|
|
394
|
+
type InputVariantBuiltIn,
|
|
395
|
+
type InputVariantRegistry,
|
|
396
|
+
type InputVariantType,
|
|
397
|
+
} from '@/types/InputVariant';
|
|
383
398
|
import type { HTMLAttributes, InputHTMLAttributes } from 'vue';
|
|
384
399
|
import type { FieldCrossAlign, FieldLayout } from '@/types/FieldLayout';
|
|
385
400
|
import type { IconType } from '@/types/Icon';
|
|
@@ -389,6 +404,7 @@ import {
|
|
|
389
404
|
type PtMap,
|
|
390
405
|
type PtValue,
|
|
391
406
|
type TextControlPtPart,
|
|
407
|
+
type PtVariantAttrs,
|
|
392
408
|
} from '@/types/passthrough';
|
|
393
409
|
import type { FormFieldProps } from '@/composables/useFormBinding';
|
|
394
410
|
import type { CommonFieldAsteriskSlotProps } from '../CommonField/types';
|
|
@@ -437,7 +453,19 @@ export const BB_COLOR_INPUT_PT = {
|
|
|
437
453
|
/** `rowStates` are declared on `rowParts` only. */
|
|
438
454
|
rowParts: ['swatch'],
|
|
439
455
|
rowStates: ['selected'],
|
|
456
|
+
// The input `variant` is a state on the field's parts (Q76.7), below
|
|
457
|
+
// the real states; a picker's panel and rows are not the field's.
|
|
458
|
+
variant: {
|
|
459
|
+
names: INPUT_VARIANTS,
|
|
460
|
+
option: 'inputVariants',
|
|
461
|
+
parts: TEXT_CONTROL_PT_PARTS,
|
|
462
|
+
},
|
|
440
463
|
} as const satisfies {
|
|
464
|
+
variant: {
|
|
465
|
+
names: readonly InputVariantBuiltIn[];
|
|
466
|
+
option: string;
|
|
467
|
+
parts: readonly TextControlPtPart[];
|
|
468
|
+
};
|
|
441
469
|
parts: readonly BbColorInputPtPart[];
|
|
442
470
|
states: readonly BbColorInputPtState[];
|
|
443
471
|
rowParts: readonly BbColorInputPtPart[];
|
|
@@ -453,208 +481,216 @@ export type BbColorInputProps = {
|
|
|
453
481
|
[K in
|
|
454
482
|
| `pt:${BbColorInputPtPart}`
|
|
455
483
|
| `pt:${BbColorInputPtPart}:${FormControlPtState}`
|
|
456
|
-
| 'pt:swatch:selected'
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
484
|
+
| 'pt:swatch:selected'
|
|
485
|
+
| `pt:${TextControlPtPart}:${InputVariantBuiltIn}`]?: PtValue;
|
|
486
|
+
} & /* @vue-ignore */ PtVariantAttrs<
|
|
487
|
+
TextControlPtPart,
|
|
488
|
+
keyof InputVariantRegistry
|
|
489
|
+
> & {
|
|
490
|
+
/**
|
|
491
|
+
* Passthrough, object form: `{ box: '…', 'box:errors': '…' }` — the same
|
|
492
|
+
* keys as the `pt:*` attributes without the prefix. See the `pt:<part>` row.
|
|
493
|
+
*/
|
|
494
|
+
/* eslint-disable @typescript-eslint/consistent-indexed-object-style -- mapped, never Record (T23) */
|
|
495
|
+
pt?: PtMap<BbColorInputPtPart, FormControlPtState> & {
|
|
496
|
+
'swatch:selected'?: PtValue;
|
|
497
|
+
} & {
|
|
498
|
+
[K in `${TextControlPtPart}:${InputVariantBuiltIn | keyof InputVariantRegistry}`]?: PtValue;
|
|
499
|
+
};
|
|
500
|
+
/* eslint-enable @typescript-eslint/consistent-indexed-object-style */
|
|
501
|
+
/**
|
|
502
|
+
* When `true`, the color palette opens as a bottom off-canvas sheet on mobile
|
|
503
|
+
* viewports instead of a floating popover; on desktop it stays a popover.
|
|
504
|
+
* Mirrors the adaptive behaviour of `BbSelect`/`BbDatePickerInput`.
|
|
505
|
+
*
|
|
506
|
+
* When unset, falls back to the global `config.adaptive`.
|
|
507
|
+
* @defaultValue `config.adaptive` (`true`)
|
|
508
|
+
*/
|
|
509
|
+
adaptive?: boolean;
|
|
510
|
+
/**
|
|
511
|
+
* Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on
|
|
512
|
+
* mobile), spread over its defaults. A `pt` inside it styles only the sheet
|
|
513
|
+
* (passthrough guide § Inside the sheet). The sheet hides its ✕; `{
|
|
514
|
+
* hideClose: false }` brings it back.
|
|
515
|
+
*/
|
|
516
|
+
offCanvasProps?: Partial<BbOffCanvasProps>;
|
|
517
|
+
/**
|
|
518
|
+
* Enable the alpha channel. Shows an opacity slider and uses `#RRGGBBAA` hex8 format.
|
|
519
|
+
*
|
|
520
|
+
* @defaultValue `false`
|
|
521
|
+
*/
|
|
522
|
+
alpha?: boolean;
|
|
523
|
+
/**
|
|
524
|
+
* Name of the icon to be added at the end of the input.
|
|
525
|
+
*/
|
|
526
|
+
|
|
527
|
+
'append:icon'?: IconType;
|
|
528
|
+
/**
|
|
529
|
+
* Guides the browser as to the type of information expected in the field.
|
|
530
|
+
*
|
|
531
|
+
* @defaultValue `'off'`
|
|
532
|
+
*/
|
|
533
|
+
autocomplete?: InputHTMLAttributes['autocomplete'];
|
|
534
|
+
/**
|
|
535
|
+
* Focuses the field when it mounts (a dialog already open included), unless the user is typing in another field.
|
|
536
|
+
*/
|
|
537
|
+
autofocus?: InputHTMLAttributes['autofocus'];
|
|
538
|
+
/**
|
|
539
|
+
* Displays a clear button when the input has a value and is being interacted with.
|
|
540
|
+
*/
|
|
541
|
+
clearable?: boolean;
|
|
542
|
+
/**
|
|
543
|
+
* Compact density: the field uses the `-compact` twins of `--bb-input-h`,
|
|
544
|
+
* `--bb-input-py` and `--bb-label-spacing-y`, so a `--bb-input-h` set on
|
|
545
|
+
* the component is ignored while it is on. Size a compact field with
|
|
546
|
+
* `--bb-input-h-compact` (and `--bb-input-py-compact`).
|
|
547
|
+
*/
|
|
548
|
+
compact?: boolean;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* The field box's look, with `BbButton`'s names and tokens. Colours only,
|
|
552
|
+
* so a form never reflows; `'ghost'` has no border in any state, `'none'`
|
|
553
|
+
* no look at all (you own hover, focus and the states). Register more with
|
|
554
|
+
* the plugin's `inputVariants`.
|
|
555
|
+
*
|
|
556
|
+
* @defaultValue `'outline'`
|
|
557
|
+
*/
|
|
558
|
+
variant?: InputVariantType;
|
|
559
|
+
/**
|
|
560
|
+
* Text between the label and the input. Unlike the hint it is always
|
|
561
|
+
* visible; it joins the input's `aria-describedby` after any `errors` /
|
|
562
|
+
* `warnings`, before the `hint`.
|
|
563
|
+
*/
|
|
564
|
+
description?: string;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* How label and input sit together: `'vertical'`, `'horizontal'` (50/50),
|
|
568
|
+
* `'auto'`, `'label-fill'`, `'input-fill'`, a ratio like `'xx xxxxx'`, or a
|
|
569
|
+
* per-breakpoint map (`{ default: 'vertical', md: 'xx xxxxx' }`).
|
|
570
|
+
*/
|
|
571
|
+
layout?: Responsive<FieldLayout>;
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Vertical position of the label block in a side-by-side row; not
|
|
575
|
+
* `labelPosition`, the horizontal one. Omitted, the label's first line
|
|
576
|
+
* meets the control's.
|
|
577
|
+
*/
|
|
578
|
+
labelAlign?: FieldCrossAlign;
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Vertical position of the control in a side-by-side row; not
|
|
582
|
+
* `inputPosition`, the horizontal one. Omitted, the control's first line
|
|
583
|
+
* meets the label's.
|
|
584
|
+
*/
|
|
585
|
+
inputAlign?: FieldCrossAlign;
|
|
586
|
+
/**
|
|
587
|
+
* Disables the component.
|
|
588
|
+
*/
|
|
589
|
+
disabled?: boolean;
|
|
590
|
+
/**
|
|
591
|
+
* Error messages under the field, a string or array, in an
|
|
592
|
+
* `aria-live="polite"` region and first in the control's
|
|
593
|
+
* `aria-describedby`, so they are re-read when it regains focus.
|
|
594
|
+
*/
|
|
595
|
+
errors?: string | string[];
|
|
596
|
+
/**
|
|
597
|
+
* Define if the component should be in an error state.
|
|
598
|
+
* It usually attaches a CSS class for styling purposes.
|
|
599
|
+
*/
|
|
600
|
+
hasErrors?: boolean;
|
|
601
|
+
/**
|
|
602
|
+
* Warning messages under the field, a string or array: amber, in their own
|
|
603
|
+
* `aria-live` region and in the control's `aria-describedby` after the
|
|
604
|
+
* errors. Non-empty turns on the warning state; errors win when both are
|
|
605
|
+
* set.
|
|
606
|
+
*/
|
|
607
|
+
warnings?: string | string[];
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Define if the component should be in a warning state.
|
|
611
|
+
* Same chrome as errors with `--bb-warn`; errors take priority.
|
|
612
|
+
*/
|
|
613
|
+
hasWarnings?: boolean;
|
|
614
|
+
/**
|
|
615
|
+
* Visually hides the label of the input while maintaining accessibility.
|
|
616
|
+
*/
|
|
617
|
+
hideLabel?: boolean;
|
|
618
|
+
/**
|
|
619
|
+
* Text box to be displayed near the input, usually to indicate instructions.
|
|
620
|
+
*/
|
|
621
|
+
hint?: string;
|
|
622
|
+
/**
|
|
623
|
+
* The `id` of the native control; the label's `for` and the description
|
|
624
|
+
* and message ids derive from it. Generated when omitted.
|
|
625
|
+
*/
|
|
626
|
+
id?: HTMLAttributes['id'];
|
|
627
|
+
/**
|
|
628
|
+
* Text content of the label of the element.
|
|
629
|
+
*/
|
|
630
|
+
label: string;
|
|
631
|
+
/**
|
|
632
|
+
* Label rendering mode: `outside` places the label above the input,
|
|
633
|
+
* `floating` overlays it on the field and shrinks it when a value is set,
|
|
634
|
+
* `inside` keeps it inside the field.
|
|
635
|
+
*/
|
|
636
|
+
labelMode?: 'outside' | 'floating' | 'inside';
|
|
637
|
+
/**
|
|
638
|
+
* Sets the text alignment of the label.
|
|
639
|
+
*/
|
|
640
|
+
labelPosition?: 'left' | 'center' | 'right';
|
|
641
|
+
/**
|
|
642
|
+
* Sets the component in a loading state, usually triggering some visual styles.
|
|
643
|
+
*/
|
|
644
|
+
loading?: boolean;
|
|
645
|
+
/**
|
|
646
|
+
* Used by v-model.
|
|
647
|
+
* @defaultValue `null`
|
|
648
|
+
*/
|
|
649
|
+
modelValue?: string | null;
|
|
650
|
+
/**
|
|
651
|
+
* Defines the name of the input.
|
|
652
|
+
*/
|
|
653
|
+
name?: InputHTMLAttributes['name'];
|
|
654
|
+
/**
|
|
655
|
+
* Keeps the hint displayed.
|
|
656
|
+
*/
|
|
657
|
+
persistentHint?: boolean;
|
|
658
|
+
/**
|
|
659
|
+
* Show an eyedropper button to sample any color on screen.
|
|
660
|
+
* Uses the native EyeDropper API — hidden automatically on unsupported browsers.
|
|
661
|
+
*
|
|
662
|
+
* @defaultValue `false`
|
|
663
|
+
*/
|
|
664
|
+
eyeDropper?: boolean;
|
|
665
|
+
/**
|
|
666
|
+
* Text shown while the field is empty.
|
|
667
|
+
*/
|
|
668
|
+
placeholder?: InputHTMLAttributes['placeholder'];
|
|
669
|
+
/**
|
|
670
|
+
* Name of the icon to be added at the start of the input.
|
|
671
|
+
*/
|
|
672
|
+
|
|
673
|
+
'prepend:icon'?: IconType;
|
|
674
|
+
/**
|
|
675
|
+
* Sets the input in a readonly state.
|
|
676
|
+
*/
|
|
677
|
+
readonly?: boolean;
|
|
678
|
+
/**
|
|
679
|
+
* Sets the input as required.
|
|
680
|
+
*/
|
|
681
|
+
required?: boolean;
|
|
682
|
+
/**
|
|
683
|
+
* Reverses the layout. Applicable in every direction the order of the label and the input is swapped.
|
|
684
|
+
*/
|
|
685
|
+
reverse?: boolean;
|
|
686
|
+
/**
|
|
687
|
+
* Controls swatches display in the picker:
|
|
688
|
+
* - `true` — show the built-in Material-palette swatches
|
|
689
|
+
* - `string[][]` — show custom swatches (each inner array = a column of shades)
|
|
690
|
+
* - `false` / omitted — no swatches section
|
|
691
|
+
*/
|
|
692
|
+
swatches?: boolean | string[][];
|
|
693
|
+
} & FormFieldProps<string | null>;
|
|
658
694
|
|
|
659
695
|
/**
|
|
660
696
|
* Events emitted by the color input.
|
|
@@ -267,7 +267,10 @@ import {
|
|
|
267
267
|
} from 'vue';
|
|
268
268
|
import { useConfig } from '@/composables/useConfig';
|
|
269
269
|
import { createReusableTemplate } from '@vueuse/core';
|
|
270
|
-
import {
|
|
270
|
+
import {
|
|
271
|
+
extractDomContainer,
|
|
272
|
+
type DomHost,
|
|
273
|
+
} from '@/utilities/functions/extractDomContainer';
|
|
271
274
|
import { useClosingInert } from '@/composables/useClosingInert';
|
|
272
275
|
import { useId } from '@/composables/useId';
|
|
273
276
|
import { useLocale } from '@/composables/useLocale';
|
|
@@ -344,8 +347,8 @@ const [DefinePalette, ReusePalette] = createReusableTemplate();
|
|
|
344
347
|
|
|
345
348
|
// ---- Activator element ---------------------------------------------------------
|
|
346
349
|
|
|
347
|
-
const activatorEl = ref<
|
|
348
|
-
const anchorEl = ref<
|
|
350
|
+
const activatorEl = ref<DomHost | undefined>();
|
|
351
|
+
const anchorEl = ref<DomHost | undefined>();
|
|
349
352
|
const hasExternalActivator = computed(() => props.activator != null);
|
|
350
353
|
|
|
351
354
|
/** Ref callback passed to the activator slot. */
|
|
@@ -550,7 +553,7 @@ const activatorLabelledby = computed(() =>
|
|
|
550
553
|
* `props` and an external `activator` alike. Only what was set here is
|
|
551
554
|
* removed again.
|
|
552
555
|
*/
|
|
553
|
-
const markedDisabled = new WeakSet<
|
|
556
|
+
const markedDisabled = new WeakSet<DomHost>();
|
|
554
557
|
|
|
555
558
|
/** What the `#activator` slot's `props` spread onto the trigger. */
|
|
556
559
|
const activatorSlotProps = computed<BbColorPaletteActivatorProps>(() =>
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
import { useId } from '@/composables/useId';
|
|
106
106
|
import { useConfig } from '@/composables/useConfig';
|
|
107
107
|
import BbDialog from '../BbDialog/BbDialog.vue';
|
|
108
|
-
import { usePassthrough } from '@/composables/usePassthrough';
|
|
108
|
+
import { usePassthrough, variantPt } from '@/composables/usePassthrough';
|
|
109
109
|
import { BB_DIALOG_PT } from '../BbDialog/types';
|
|
110
110
|
import { BB_CONFIRM_PT, type BbConfirmProps } from './types';
|
|
111
111
|
import { CONFIRM_ENTRY } from './confirmEntry';
|
|
@@ -117,7 +117,11 @@ import BbButton from '../BbButton/BbButton.vue';
|
|
|
117
117
|
// Reaches the <dialog> root through fallthrough attrs (same route d8a21c73
|
|
118
118
|
// used for the adaptive sheets' aria-labelledby). Portal content is arbitrary
|
|
119
119
|
// markup, so it deliberately gets no describedby.
|
|
120
|
-
defineOptions({
|
|
120
|
+
defineOptions({
|
|
121
|
+
// An app's own variants as declared `pt:<part>:<name>` props (Q76.7).
|
|
122
|
+
mixins: [variantPt(BB_CONFIRM_PT)],
|
|
123
|
+
inheritAttrs: false,
|
|
124
|
+
});
|
|
121
125
|
const props = defineProps<BbConfirmProps>();
|
|
122
126
|
|
|
123
127
|
/**
|
|
@@ -147,6 +151,10 @@ const passthrough = usePassthrough({
|
|
|
147
151
|
parts: BB_CONFIRM_PT.parts,
|
|
148
152
|
states: BB_CONFIRM_PT.states,
|
|
149
153
|
active: { open: () => state.processing },
|
|
154
|
+
variant: {
|
|
155
|
+
...BB_CONFIRM_PT.variant,
|
|
156
|
+
current: () => current.value?.variant ?? 'default',
|
|
157
|
+
},
|
|
150
158
|
});
|
|
151
159
|
|
|
152
160
|
/**
|
|
@@ -242,7 +250,12 @@ const onClose = (value: boolean) => {
|
|
|
242
250
|
## Types
|
|
243
251
|
|
|
244
252
|
```ts
|
|
245
|
-
import type { PtMap, PtValue } from '@/types/passthrough';
|
|
253
|
+
import type { PtMap, PtValue, PtVariantAttrs } from '@/types/passthrough';
|
|
254
|
+
import {
|
|
255
|
+
CONFIRM_VARIANTS,
|
|
256
|
+
type ConfirmVariantBuiltIn,
|
|
257
|
+
type ConfirmVariantRegistry,
|
|
258
|
+
} from '@/types/ConfirmVariant';
|
|
246
259
|
|
|
247
260
|
/**
|
|
248
261
|
* Passthrough parts of `BbConfirm` (plans/passthrough/BbConfirm.md). Every
|
|
@@ -294,9 +307,12 @@ export const BB_CONFIRM_PT = {
|
|
|
294
307
|
'action',
|
|
295
308
|
],
|
|
296
309
|
states: ['open'],
|
|
310
|
+
// The message's `variant` is a state on every part (Q76.7), below `open`.
|
|
311
|
+
variant: { names: CONFIRM_VARIANTS, option: 'confirmVariants' },
|
|
297
312
|
} as const satisfies {
|
|
298
313
|
parts: readonly BbConfirmPtPart[];
|
|
299
314
|
states: readonly BbConfirmPtState[];
|
|
315
|
+
variant: { names: readonly ConfirmVariantBuiltIn[]; option: string };
|
|
300
316
|
};
|
|
301
317
|
|
|
302
318
|
// Spelled INLINE with this component's own unions (Vue's SFC type resolver
|
|
@@ -305,14 +321,21 @@ export const BB_CONFIRM_PT = {
|
|
|
305
321
|
export type BbConfirmProps = {
|
|
306
322
|
[K in
|
|
307
323
|
| `pt:${BbConfirmPtPart}`
|
|
308
|
-
| `pt:${BbConfirmPtPart}:${BbConfirmPtState}`
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
324
|
+
| `pt:${BbConfirmPtPart}:${BbConfirmPtState}`
|
|
325
|
+
| `pt:${BbConfirmPtPart}:${ConfirmVariantBuiltIn}`]?: PtValue;
|
|
326
|
+
} & /* @vue-ignore */ PtVariantAttrs<
|
|
327
|
+
BbConfirmPtPart,
|
|
328
|
+
keyof ConfirmVariantRegistry
|
|
329
|
+
> & {
|
|
330
|
+
/**
|
|
331
|
+
* Passthrough, object form: the same keys as the `pt:*` attributes
|
|
332
|
+
* without the prefix. See the `pt:<part>` row.
|
|
333
|
+
*/
|
|
334
|
+
pt?: PtMap<
|
|
335
|
+
BbConfirmPtPart,
|
|
336
|
+
BbConfirmPtState | ConfirmVariantBuiltIn | keyof ConfirmVariantRegistry
|
|
337
|
+
>;
|
|
338
|
+
};
|
|
316
339
|
|
|
317
340
|
/**
|
|
318
341
|
* The default slot scope of `<BbConfirmPortal>`: the ONE place this family's
|