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
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
:has-errors="fieldHasErrors"
|
|
63
63
|
:has-warnings="fieldHasWarnings"
|
|
64
64
|
:hide-label="hideLabel"
|
|
65
|
+
:indicator-ready="indicatorReady"
|
|
65
66
|
:item-input-align="itemInputAlign"
|
|
66
67
|
:item-label-align="itemLabelAlign"
|
|
67
68
|
:item-layout="itemLayout"
|
|
@@ -72,8 +73,22 @@
|
|
|
72
73
|
:options="options"
|
|
73
74
|
:passthrough="passthrough"
|
|
74
75
|
:role="hasLegend() ? 'radiogroup' : undefined"
|
|
76
|
+
:variant="variant"
|
|
75
77
|
>
|
|
76
|
-
<template #prepend
|
|
78
|
+
<template #prepend>
|
|
79
|
+
<!-- The `variant` indicators (Q76.11 d): first in the list, so the
|
|
80
|
+
positioned rows paint over them; hidden from the tree (the
|
|
81
|
+
checked state is the inputs'). -->
|
|
82
|
+
<span
|
|
83
|
+
v-for="box in indicatorBoxes"
|
|
84
|
+
:key="box.key"
|
|
85
|
+
aria-hidden="true"
|
|
86
|
+
class="bb-radio-group__indicator"
|
|
87
|
+
:style="indicatorStyle(box)"
|
|
88
|
+
v-bind="passthrough.indicator"
|
|
89
|
+
></span>
|
|
90
|
+
<slot name="prepend"></slot>
|
|
91
|
+
</template>
|
|
77
92
|
<template #loading><slot name="loading"></slot></template>
|
|
78
93
|
<template #empty="data"
|
|
79
94
|
><slot name="empty" v-bind="data"></slot
|
|
@@ -138,6 +153,7 @@ import {
|
|
|
138
153
|
formControlPtActive,
|
|
139
154
|
pickActive,
|
|
140
155
|
usePassthrough,
|
|
156
|
+
variantPt,
|
|
141
157
|
} from '@/composables/usePassthrough';
|
|
142
158
|
import {
|
|
143
159
|
type ComponentPublicInstance,
|
|
@@ -161,6 +177,7 @@ import {
|
|
|
161
177
|
toggleInputValue,
|
|
162
178
|
} from '@/utilities/functions/toggleInput';
|
|
163
179
|
import { useToggleListFocus } from '@/composables/useToggleInput';
|
|
180
|
+
import { useChoiceIndicator } from '@/composables/useChoiceIndicator';
|
|
164
181
|
import { useItemsGetter } from '@/composables/useItemsGetter';
|
|
165
182
|
import { usePrefill } from '@/composables/usePrefill';
|
|
166
183
|
import { useIndexById } from '../../composables/useIndexById';
|
|
@@ -182,7 +199,11 @@ import {
|
|
|
182
199
|
import { useFormBinding } from '@/composables/useFormBinding';
|
|
183
200
|
export type { BbRadioGroupProps, BbRadioGroupEvents, BbRadioGroupSlots };
|
|
184
201
|
|
|
185
|
-
defineOptions({
|
|
202
|
+
defineOptions({
|
|
203
|
+
// An app's own variants as declared `pt:<part>:<name>` props (Q76.7).
|
|
204
|
+
mixins: [variantPt(BB_RADIO_GROUP_PT)],
|
|
205
|
+
inheritAttrs: false,
|
|
206
|
+
});
|
|
186
207
|
const declaredProps = withDefaults(defineProps<BbRadioGroupProps<T>>(), {
|
|
187
208
|
inputPosition: 'left',
|
|
188
209
|
selectable: true,
|
|
@@ -400,6 +421,7 @@ const passthrough = usePassthrough({
|
|
|
400
421
|
props,
|
|
401
422
|
parts: BB_RADIO_GROUP_PT.parts,
|
|
402
423
|
states: BB_RADIO_GROUP_PT.states,
|
|
424
|
+
variant: { ...BB_RADIO_GROUP_PT.variant, current: () => props.variant },
|
|
403
425
|
active: {
|
|
404
426
|
...pickActive(
|
|
405
427
|
formControlPtActive(props, () => passthroughHasValue.value),
|
|
@@ -408,6 +430,28 @@ const passthrough = usePassthrough({
|
|
|
408
430
|
loading: () => loading.value,
|
|
409
431
|
},
|
|
410
432
|
});
|
|
433
|
+
/**
|
|
434
|
+
* BbTabs' look (`variant`, Q76.11 d): the indicators under the checked rows,
|
|
435
|
+
* measured on the list. One that slides from row to row.
|
|
436
|
+
*/
|
|
437
|
+
/** `list-layout="vertical"` / `"vertical-stretch"` stack the strip into a column. */
|
|
438
|
+
const stripVertical = computed(
|
|
439
|
+
() =>
|
|
440
|
+
props.listLayout === 'vertical' || props.listLayout === 'vertical-stretch'
|
|
441
|
+
);
|
|
442
|
+
const {
|
|
443
|
+
boxes: indicatorBoxes,
|
|
444
|
+
ready: indicatorReady,
|
|
445
|
+
styleOf: indicatorStyle,
|
|
446
|
+
} = useChoiceIndicator({
|
|
447
|
+
kind: 'radio',
|
|
448
|
+
variant: () => props.variant,
|
|
449
|
+
vertical: () => stripVertical.value,
|
|
450
|
+
list: () => optionsElement.value,
|
|
451
|
+
rows: () => options.value,
|
|
452
|
+
rowClass: 'bb-radio-group__item',
|
|
453
|
+
});
|
|
454
|
+
|
|
411
455
|
/** The container names the heading `label`; this group names it `legend`, after its props. */
|
|
412
456
|
const containerPassthrough = aliasParts(passthrough, { label: 'legend' });
|
|
413
457
|
|
|
@@ -468,7 +512,7 @@ const rowListeners = (option: Option) => ({
|
|
|
468
512
|
onMouseup: (event: MouseEvent) => emit('mouseup', event),
|
|
469
513
|
});
|
|
470
514
|
|
|
471
|
-
/** One row's native radio: named by its text
|
|
515
|
+
/** One row's native radio: named by its text alone, described by the group then its own description. */
|
|
472
516
|
const rowInputAttrs = (
|
|
473
517
|
option: Option,
|
|
474
518
|
index: number,
|
|
@@ -522,18 +566,25 @@ const rowIconSlotProps = (
|
|
|
522
566
|
|
|
523
567
|
```ts
|
|
524
568
|
import type { Responsive } from '@/types/ResponsiveSize';
|
|
569
|
+
import {
|
|
570
|
+
RADIO_VARIANTS,
|
|
571
|
+
type RadioVariantBuiltIn,
|
|
572
|
+
type RadioVariantRegistry,
|
|
573
|
+
type RadioVariantType,
|
|
574
|
+
} from '@/types/RadioVariant';
|
|
525
575
|
import type { BbOptionGroupItemProps } from '@/types/ItemProps';
|
|
526
576
|
import type { HTMLAttributes, InputHTMLAttributes } from 'vue';
|
|
527
577
|
import {
|
|
528
|
-
|
|
578
|
+
CHOICE_PT_PARTS,
|
|
579
|
+
type PtVariantAttrs,
|
|
529
580
|
GROUP_PT_STATES,
|
|
530
581
|
GROUP_ROW_PT_PARTS,
|
|
531
582
|
GROUP_ROW_PT_STATES,
|
|
532
|
-
type
|
|
533
|
-
type
|
|
583
|
+
type ChoiceFieldPtPart,
|
|
584
|
+
type ChoicePtMap,
|
|
585
|
+
type ChoicePtPart,
|
|
534
586
|
type GroupRowPtPart,
|
|
535
587
|
type GroupWidePtState,
|
|
536
|
-
type GroupPtPart,
|
|
537
588
|
type GroupPtState,
|
|
538
589
|
type PtItemCtx,
|
|
539
590
|
type PtNoInfer,
|
|
@@ -556,21 +607,24 @@ import type { CommonFieldAsteriskSlotProps } from '../CommonField/types';
|
|
|
556
607
|
*
|
|
557
608
|
* 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_.
|
|
558
609
|
*/
|
|
559
|
-
export type BbRadioGroupPtPart =
|
|
610
|
+
export type BbRadioGroupPtPart = ChoicePtPart;
|
|
560
611
|
/** Passthrough states of `BbRadioGroup`, true while the matching `--` modifier is on. */
|
|
561
612
|
export type BbRadioGroupPtState = GroupPtState;
|
|
562
613
|
/** The runtime lists the resolver is wired with — kept next to the types so the two cannot drift. */
|
|
563
614
|
export const BB_RADIO_GROUP_PT = {
|
|
564
|
-
parts:
|
|
615
|
+
parts: CHOICE_PT_PARTS,
|
|
565
616
|
states: GROUP_PT_STATES,
|
|
566
617
|
/** `rowStates` are declared on `rowParts` only — the field parts never have them. */
|
|
567
618
|
rowParts: GROUP_ROW_PT_PARTS,
|
|
568
619
|
rowStates: GROUP_ROW_PT_STATES,
|
|
620
|
+
// The `variant` is a state on every part (Q76.7).
|
|
621
|
+
variant: { names: RADIO_VARIANTS, option: 'radioVariants' },
|
|
569
622
|
} as const satisfies {
|
|
570
623
|
parts: readonly BbRadioGroupPtPart[];
|
|
571
624
|
states: readonly BbRadioGroupPtState[];
|
|
572
625
|
rowParts: readonly GroupRowPtPart[];
|
|
573
626
|
rowStates: readonly BbRadioGroupPtState[];
|
|
627
|
+
variant: { names: readonly RadioVariantBuiltIn[]; option: string };
|
|
574
628
|
};
|
|
575
629
|
|
|
576
630
|
// Spelled INLINE with this component's own unions (Vue's SFC type resolver
|
|
@@ -580,294 +634,315 @@ export const BB_RADIO_GROUP_PT = {
|
|
|
580
634
|
/* eslint-disable @typescript-eslint/consistent-indexed-object-style */
|
|
581
635
|
export type BbRadioGroupProps<T> = {
|
|
582
636
|
[K in
|
|
583
|
-
| `pt:${
|
|
584
|
-
| `pt:${
|
|
585
|
-
| `pt:${
|
|
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
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
637
|
+
| `pt:${ChoiceFieldPtPart}`
|
|
638
|
+
| `pt:${ChoiceFieldPtPart}:${GroupWidePtState}`
|
|
639
|
+
| `pt:${ChoiceFieldPtPart}:${RadioVariantBuiltIn}`
|
|
640
|
+
| `pt:${GroupRowPtPart}:${BbRadioGroupPtState}`
|
|
641
|
+
| `pt:${GroupRowPtPart}:${RadioVariantBuiltIn}`]?: PtValue;
|
|
642
|
+
} & /* @vue-ignore */ PtVariantAttrs<
|
|
643
|
+
ChoicePtPart,
|
|
644
|
+
keyof RadioVariantRegistry
|
|
645
|
+
> & {
|
|
646
|
+
// The row parts also take a per-item function, typed on this group's
|
|
647
|
+
// item — a literal function type, not `PtItemFn<T, …>` (T23).
|
|
648
|
+
[K in `pt:${GroupRowPtPart}`]?:
|
|
649
|
+
| PtValue
|
|
650
|
+
| ((
|
|
651
|
+
ctx: PtItemCtx<
|
|
652
|
+
PtNoInfer<T>,
|
|
653
|
+
BbRadioGroupPtState,
|
|
654
|
+
RadioVariantBuiltIn | keyof RadioVariantRegistry
|
|
655
|
+
>
|
|
656
|
+
) => PtItemResult);
|
|
657
|
+
} & {
|
|
658
|
+
/**
|
|
659
|
+
* Passthrough, object form: the same keys as the `pt:*` attributes
|
|
660
|
+
* without the prefix. See the `pt:<part>` row.
|
|
661
|
+
*/
|
|
662
|
+
pt?: ChoicePtMap<PtNoInfer<T>> & {
|
|
663
|
+
[K in `${ChoicePtPart}:${RadioVariantBuiltIn | keyof RadioVariantRegistry}`]?: PtValue;
|
|
664
|
+
};
|
|
665
|
+
/* eslint-enable @typescript-eslint/consistent-indexed-object-style */
|
|
666
|
+
/**
|
|
667
|
+
* Focuses the field when it mounts (a dialog already open included), unless the user is typing in another field.
|
|
668
|
+
*/
|
|
669
|
+
autofocus?: InputHTMLAttributes['autofocus'];
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Compact density. Swaps `--bb-label-spacing-y` for
|
|
673
|
+
* `--bb-label-spacing-y-compact`, so tune a compact group's label gap with
|
|
674
|
+
* the `-compact` token, not the base one.
|
|
675
|
+
*/
|
|
676
|
+
compact?: boolean;
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Defines an array of dependencies that will trigger actions in the component upon change.
|
|
680
|
+
*/
|
|
681
|
+
dependencies?: unknown[];
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Timeout used to debounce response to changes to dependencies.
|
|
685
|
+
*/
|
|
686
|
+
depsDebounceTime?: number;
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Text between the label and the input. Unlike the hint it is always
|
|
690
|
+
* visible; it joins the input's `aria-describedby` after any `errors` /
|
|
691
|
+
* `warnings`, before the `hint`.
|
|
692
|
+
*/
|
|
693
|
+
description?: string;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* How label and input sit together: `'vertical'`, `'horizontal'` (50/50),
|
|
697
|
+
* `'auto'`, `'label-fill'`, `'input-fill'`, a ratio like `'xx xxxxx'`, or a
|
|
698
|
+
* per-breakpoint map (`{ default: 'vertical', md: 'xx xxxxx' }`).
|
|
699
|
+
*/
|
|
700
|
+
layout?: Responsive<FieldLayout>;
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Vertical position of the label block in a side-by-side row; not
|
|
704
|
+
* `labelPosition`, the horizontal one. Omitted, the label's first line
|
|
705
|
+
* meets the control's.
|
|
706
|
+
*/
|
|
707
|
+
labelAlign?: FieldCrossAlign;
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Vertical position of the control in a side-by-side row; not
|
|
711
|
+
* `inputPosition`, the horizontal one. Omitted, the control's first line
|
|
712
|
+
* meets the label's.
|
|
713
|
+
*/
|
|
714
|
+
inputAlign?: FieldCrossAlign;
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Disables the component.
|
|
718
|
+
*/
|
|
719
|
+
disabled?: boolean;
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* After every applied, successful load (an empty one included), drops the
|
|
723
|
+
* model values the options no longer contain (a single value resets to
|
|
724
|
+
* `null`). A failed load never prunes.
|
|
725
|
+
*/
|
|
726
|
+
enforceCoherence?: boolean;
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Error messages under the field, a string or array, in an
|
|
730
|
+
* `aria-live="polite"` region and first in the control's
|
|
731
|
+
* `aria-describedby`, so they are re-read when it regains focus.
|
|
732
|
+
*/
|
|
733
|
+
errors?: string | string[];
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Define if the component should be in an error state.
|
|
737
|
+
* It usually attaches a CSS class for styling purposes.
|
|
738
|
+
*/
|
|
739
|
+
hasErrors?: boolean;
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Warning messages under the field, a string or array: amber, in their own
|
|
743
|
+
* `aria-live` region and in the control's `aria-describedby` after the
|
|
744
|
+
* errors. Non-empty turns on the warning state; errors win when both are
|
|
745
|
+
* set.
|
|
746
|
+
*/
|
|
747
|
+
warnings?: string | string[];
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Define if the component should be in a warning state.
|
|
751
|
+
* Same chrome as errors with `--bb-warn`; errors take priority.
|
|
752
|
+
*/
|
|
753
|
+
hasWarnings?: boolean;
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Visually hides each option's label text (the text rendered next to every
|
|
757
|
+
* input) while keeping it accessible to screen readers.
|
|
758
|
+
* Does not affect the fieldset legend — use `hideLegend` for that.
|
|
759
|
+
*/
|
|
760
|
+
hideLabel?: boolean;
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* Visually hides the legend of the fieldset while maintaining accessibility.
|
|
764
|
+
*/
|
|
765
|
+
hideLegend?: boolean;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Text box to be displayed near the input, usually to indicate instructions.
|
|
769
|
+
*/
|
|
770
|
+
hint?: string;
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Prefix for the ids of each option's input and of the label, description
|
|
774
|
+
* and message. Generated when omitted.
|
|
775
|
+
*/
|
|
776
|
+
id?: HTMLAttributes['id'];
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Sets the alignment of the input. Since inputs are inline block they can be aligned just as text can.
|
|
780
|
+
*
|
|
781
|
+
* @defaultValue `'left'`
|
|
782
|
+
*/
|
|
783
|
+
inputPosition?: 'left' | 'center' | 'right';
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* The options: an array, or a provider called with a
|
|
787
|
+
* `BbRadioGroupItemsContext` (`reason`, `modelValue`, `signal`), sync or
|
|
788
|
+
* async. A provider fails by THROWING, never by returning `[]`: the rows
|
|
789
|
+
* clear and `#empty` gets the `error`.
|
|
790
|
+
*/
|
|
791
|
+
items: T[] | ((context: BbRadioGroupItemsContext) => T[] | Promise<T[]>);
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Defines a path that returns a property of the object to use as text or a function that returns a string.
|
|
795
|
+
*
|
|
796
|
+
* Unset: own `label`, else `text` (`{ label, value }` needs no accessor).
|
|
797
|
+
*
|
|
798
|
+
* @defaultValue own `label`, else `text`, else `JSON.stringify(item)`
|
|
799
|
+
*/
|
|
800
|
+
itemText?: ItemAccessor<T, string>;
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Defines a path that returns a property of the object to use as value or a function that returns any value.
|
|
804
|
+
*
|
|
805
|
+
* Unset: own `value`, even `null`.
|
|
806
|
+
*
|
|
807
|
+
* @defaultValue own `value`, else the whole item
|
|
808
|
+
*/
|
|
809
|
+
itemValue?: ItemAccessor<T>;
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* ADDITIONAL row fields, never the text or value: `description`, a muted
|
|
813
|
+
* line under the label (it may wrap; announced as the option's
|
|
814
|
+
* description). An object of paths or getters, or a function of the item;
|
|
815
|
+
* nothing is read implicitly.
|
|
816
|
+
*/
|
|
817
|
+
itemProps?: BbOptionGroupItemProps<T>;
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* How each row's input and label sit together, in the `layout` keywords:
|
|
821
|
+
* `'auto'`, `'vertical'`, `'horizontal'`, `'label-fill'`, `'input-fill'`,
|
|
822
|
+
* or a two-word ratio pattern like `'xx xxxxx'`.
|
|
823
|
+
*
|
|
824
|
+
* @defaultValue `'auto'`
|
|
825
|
+
*/
|
|
826
|
+
itemLayout?: FieldLayout;
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* Swaps each row's input and label from their natural order (input first),
|
|
830
|
+
* in every `item-layout`. `reverse` swaps the legend and the options instead.
|
|
831
|
+
*/
|
|
832
|
+
itemReverse?: boolean;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Vertical position of each option's label in its row. Omitted, it stays
|
|
836
|
+
* as it is.
|
|
837
|
+
*/
|
|
838
|
+
itemLabelAlign?: FieldCrossAlign;
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* Vertical position of each option's control in its row; `'center'` is
|
|
842
|
+
* the middle of the label plus its description. Omitted, it sits on the
|
|
843
|
+
* label's first line.
|
|
844
|
+
*/
|
|
845
|
+
itemInputAlign?: FieldCrossAlign;
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Sets the text alignment of the label.
|
|
849
|
+
*/
|
|
850
|
+
legendPosition?: 'left' | 'center' | 'right';
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Text content of the legend.
|
|
854
|
+
*/
|
|
855
|
+
legend: string;
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Legend rendering mode. `'outside'` renders the legend above the fieldset in the normal flow;
|
|
859
|
+
* `'inside'` overlays the legend inside the fieldset border.
|
|
860
|
+
* Floating mode is not supported for radio groups.
|
|
861
|
+
*/
|
|
862
|
+
legendMode?: 'outside' | 'inside';
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* A tab-strip look (Q76.11 d): `'pill'` (a raised pill under the pick) or
|
|
866
|
+
* `'line'` (a bar on a baseline); the indicator slides like a tab strip's.
|
|
867
|
+
* `list-layout="vertical"` stacks it. Register more with `radioVariants`.
|
|
868
|
+
* Unset: the group's own rows.
|
|
869
|
+
*/
|
|
870
|
+
variant?: RadioVariantType;
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* How the rows sit in the list: `'horizontal'` (on a line, wrapping),
|
|
874
|
+
* `'vertical'` (stacked), `'vertical-stretch'` (stacked, as wide as the
|
|
875
|
+
* list) or `'tiles'` (equal boxes; `--tile-min-width` on `pt:list` sets the
|
|
876
|
+
* narrowest). Layout only: the cards are `pt` (guide § Radio cards).
|
|
877
|
+
*
|
|
878
|
+
* @defaultValue `'horizontal'`
|
|
879
|
+
*/
|
|
880
|
+
listLayout?: ListLayout;
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* String displayed while items are being loaded.
|
|
884
|
+
*/
|
|
885
|
+
loadingText?: string;
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* Used by v-model. Can be any serializable type.
|
|
889
|
+
*/
|
|
890
|
+
modelValue?: any;
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* Timeout used to debounce response to changes to modelValue.
|
|
894
|
+
*/
|
|
895
|
+
modelValueDebounceTime?: number;
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Name of the option inputs. Optional: a generated one, unique per group
|
|
899
|
+
* and stable, groups them. Pass one only when a native (non-JS) form post
|
|
900
|
+
* must submit the value under a known key.
|
|
901
|
+
*/
|
|
902
|
+
name?: InputHTMLAttributes['name'];
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* String displayed when there are no items to display.
|
|
906
|
+
*/
|
|
907
|
+
emptyText?: string;
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* String displayed in the empty state while the latest load FAILED (the
|
|
911
|
+
* `items` provider threw): the twin of `emptyText` for that case.
|
|
912
|
+
*
|
|
913
|
+
* @defaultValue the localized `common.failedText` ("Couldn't load items")
|
|
914
|
+
*/
|
|
915
|
+
failedText?: string;
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Keeps the hint displayed.
|
|
919
|
+
*/
|
|
920
|
+
persistentHint?: boolean;
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Sets the input in a readonly state.
|
|
924
|
+
*/
|
|
925
|
+
readonly?: boolean;
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Sets the input as required.
|
|
929
|
+
*/
|
|
930
|
+
required?: boolean;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Reverses the layout. Applicable in every direction the order of the label and the input is swapped.
|
|
934
|
+
*/
|
|
935
|
+
reverse?: boolean;
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Defines whether options are selectable.
|
|
939
|
+
* Can be a global boolean that affects all options or a function
|
|
940
|
+
* that accepts an item and returns a boolean that only affects that item.
|
|
941
|
+
* Non-selectable options are rendered disabled.
|
|
942
|
+
* @defaultValue `true`
|
|
943
|
+
*/
|
|
944
|
+
selectable?: boolean | ((item: T) => boolean);
|
|
945
|
+
} & FormFieldProps<any>;
|
|
871
946
|
|
|
872
947
|
export type BbRadioGroupEvents = {
|
|
873
948
|
/**
|
|
@@ -1027,6 +1102,8 @@ export type BbRadioGroupSlots<T> = {
|
|
|
1027
1102
|
## Styles
|
|
1028
1103
|
|
|
1029
1104
|
```css
|
|
1105
|
+
@import '../OptionsContainer/choice-strip.css';
|
|
1106
|
+
|
|
1030
1107
|
.bb-radio-group {
|
|
1031
1108
|
.bb-field__layout--horizontal {
|
|
1032
1109
|
.bb-field__label {
|
|
@@ -1343,6 +1420,19 @@ export type BbRadioGroupSlots<T> = {
|
|
|
1343
1420
|
}
|
|
1344
1421
|
}
|
|
1345
1422
|
|
|
1423
|
+
/* A side hidden with the library's or Tailwind's hiding classes takes its gap
|
|
1424
|
+
with it (ATT-11 e): `hideLabel` / `pt:label="sr-only"` (out of flow) or
|
|
1425
|
+
`pt:icon="hidden"` would leave an empty track AND the gap beside it (the
|
|
1426
|
+
row gap in a `vertical` item, Q76.11 c), and the side still shown sat
|
|
1427
|
+
off-centre. `:where` keeps the rule at the row's
|
|
1428
|
+
one class, so a consumer `gap-*` on `pt:item` still wins. */
|
|
1429
|
+
.bb-radio-group__item:where(
|
|
1430
|
+
:has(> .bb-radio-group__label:is(.bb-sr-only, .sr-only)),
|
|
1431
|
+
:has(> .bb-toggle-input + :is(.hidden, .sr-only, .bb-sr-only))
|
|
1432
|
+
) {
|
|
1433
|
+
gap: 0;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1346
1436
|
.bb-radio-group__label {
|
|
1347
1437
|
color: var(--bb-text);
|
|
1348
1438
|
font-size: var(--bb-label-fs);
|
|
@@ -1375,6 +1465,32 @@ export type BbRadioGroupSlots<T> = {
|
|
|
1375
1465
|
user-select: none;
|
|
1376
1466
|
}
|
|
1377
1467
|
|
|
1468
|
+
/*
|
|
1469
|
+
* `tiles` (ATT-11 d): the invisible native input covers the WHOLE tile,
|
|
1470
|
+
* padding included, not only the glyph's cell, so a click, a hover tooltip on
|
|
1471
|
+
* the input and a test runner's hit-target check land on it anywhere on the
|
|
1472
|
+
* tile. `grid-area: auto` is load-bearing: an absolutely positioned grid child
|
|
1473
|
+
* is sized against its grid area, so `inset: 0` would still be the glyph
|
|
1474
|
+
* cell. A link or a button inside a tile sits above the input and keeps its
|
|
1475
|
+
* own click. List rows keep the cell overlay.
|
|
1476
|
+
*/
|
|
1477
|
+
.bb-radio-group__list--tiles > .bb-radio-group__item {
|
|
1478
|
+
position: relative;
|
|
1479
|
+
|
|
1480
|
+
> .bb-toggle-input {
|
|
1481
|
+
border-radius: inherit;
|
|
1482
|
+
grid-area: auto;
|
|
1483
|
+
inset: 0;
|
|
1484
|
+
position: absolute;
|
|
1485
|
+
z-index: 1;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
:is(a, button) {
|
|
1489
|
+
position: relative;
|
|
1490
|
+
z-index: 2;
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1378
1494
|
/* ---- Touch targets (Q44.19) -------------------------------------------
|
|
1379
1495
|
* A row is one label line (`--bb-label-lh`, 18px) and the rows sit
|
|
1380
1496
|
* `--row-gap` (10px) apart. On a coarse pointer only, each row gets an
|