bitboss-ui 3.0.0-beta.63 → 3.0.0-beta.64
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 +416 -6
- package/dist/ai/components.json +50 -48
- 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 +79 -49
- 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 +163 -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 +147 -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 +15 -9
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +4 -4
- package/dist/ai/helpers/inertia/usePaginatedResponseContext.ts +39 -24
- package/dist/ai/helpers/inertia/useRouteQuery.ts +10 -4
- 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/layout-scaffold.md +19 -6
- package/dist/ai/recipes/inertia/records-workspace.md +49 -13
- 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 +128 -33
- 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 +543 -532
- 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/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 +2300 -543
- 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 +3 -3
- 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/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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IconType } from '../../types/Icon';
|
|
2
|
-
import { PtMap, PtValue } from '../../types/passthrough';
|
|
2
|
+
import { PtMap, PtValue, PtVariantAttrs } from '../../types/passthrough';
|
|
3
3
|
import { Sizes } from '../../types/SizeScale';
|
|
4
|
-
import { BadgeVariantType } from '../../types/BadgeVariant';
|
|
5
|
-
import { BbBaseButtonProps } from '../BbBaseButton/types';
|
|
4
|
+
import { BadgeVariantBuiltIn, BadgeVariantRegistry, BadgeVariantType } from '../../types/BadgeVariant';
|
|
5
|
+
import { BbBaseButtonProps, BbLinkSlotProps } from '../BbBaseButton/types';
|
|
6
6
|
/**
|
|
7
7
|
* Passthrough parts of `BbBadge` (plans/passthrough/BbBadge.md). `spinner` is
|
|
8
8
|
* named for uniformity with `BbButton`. The `__body` wrapper is layout, not a
|
|
@@ -18,26 +18,37 @@ import { BbBaseButtonProps } from '../BbBaseButton/types';
|
|
|
18
18
|
*/
|
|
19
19
|
export type BbBadgePtPart = 'root' | 'icon' | 'spinner' | 'text' | 'clear';
|
|
20
20
|
/**
|
|
21
|
-
* Passthrough states of `BbBadge`:
|
|
21
|
+
* Passthrough states of `BbBadge`: `loading` while `--loading`; the link
|
|
22
|
+
* states while a slotted `BbBadgeButton` link has its `activeClass` /
|
|
23
|
+
* `exactActiveClass` on — on every part, so the whole chip shows it.
|
|
22
24
|
*
|
|
25
|
+
* @state activeLink - Component-wide: the badge's `BbBadgeButton` is a link to
|
|
26
|
+
* the current page or one of its ancestors. The weakest state.
|
|
27
|
+
* @state exactActiveLink - Component-wide: the badge's `BbBadgeButton` is a
|
|
28
|
+
* link to the current page itself (`activeLink` is on too).
|
|
23
29
|
* @state loading - Component-wide: `loading` is on; the spinner takes an
|
|
24
30
|
* icon's place.
|
|
25
31
|
*/
|
|
26
|
-
export type BbBadgePtState = 'loading';
|
|
32
|
+
export type BbBadgePtState = 'activeLink' | 'exactActiveLink' | 'loading';
|
|
27
33
|
/** The runtime lists the resolver is wired with — kept next to the types so the two cannot drift. */
|
|
28
34
|
export declare const BB_BADGE_PT: {
|
|
29
35
|
readonly parts: readonly ["root", "icon", "spinner", "text", "clear"];
|
|
30
|
-
readonly states: readonly ["loading"];
|
|
36
|
+
readonly states: readonly ["activeLink", "exactActiveLink", "loading"];
|
|
37
|
+
readonly variant: {
|
|
38
|
+
readonly names: readonly ["primary", "secondary", "destructive", "outline"];
|
|
39
|
+
readonly option: "badgeVariants";
|
|
40
|
+
};
|
|
31
41
|
};
|
|
32
42
|
export type BbBadgeProps = {
|
|
33
|
-
[K in `pt:${BbBadgePtPart}` | `pt:${BbBadgePtPart}:${BbBadgePtState}`]?: PtValue;
|
|
34
|
-
} & {
|
|
43
|
+
[K in `pt:${BbBadgePtPart}` | `pt:${BbBadgePtPart}:${BbBadgePtState}` | `pt:${BbBadgePtPart}:${BadgeVariantBuiltIn}`]?: PtValue;
|
|
44
|
+
} & /* @vue-ignore */ PtVariantAttrs<BbBadgePtPart, keyof BadgeVariantRegistry> & {
|
|
35
45
|
/**
|
|
36
46
|
* Passthrough, object form: `{ icon: '…', 'icon:loading': '…' }` — the same
|
|
37
47
|
* keys as the `pt:*` attributes without the prefix. Parts: `root`, `icon`,
|
|
38
|
-
* `spinner`, `text`, `clear`.
|
|
48
|
+
* `spinner`, `text`, `clear`. States: `loading` and the registered
|
|
49
|
+
* variants (an app's own included).
|
|
39
50
|
*/
|
|
40
|
-
pt?: PtMap<BbBadgePtPart, BbBadgePtState>;
|
|
51
|
+
pt?: PtMap<BbBadgePtPart, BbBadgePtState | BadgeVariantBuiltIn | keyof BadgeVariantRegistry>;
|
|
41
52
|
/**
|
|
42
53
|
* Renders an icon-only badge. When set, `prepend:icon` / `append:icon` are
|
|
43
54
|
* ignored and the default slot becomes the badge's visually hidden accessible
|
|
@@ -66,9 +77,10 @@ export type BbBadgeProps = {
|
|
|
66
77
|
*/
|
|
67
78
|
clearable?: boolean;
|
|
68
79
|
/**
|
|
69
|
-
* Accessible name of the clear button
|
|
70
|
-
*
|
|
71
|
-
*
|
|
80
|
+
* Accessible name of the clear button, whole: set, it is the name on any
|
|
81
|
+
* body ("Remove the filter Deleted"). Rarely needed: unset, the name is
|
|
82
|
+
* composed from the localized `badge.clearLabel` verb and the badge text
|
|
83
|
+
* ("Remove Italy"), or the verb alone when a `BbBadgeButton` owns the body.
|
|
72
84
|
*/
|
|
73
85
|
clearableLabel?: string;
|
|
74
86
|
/**
|
|
@@ -88,6 +100,14 @@ export type BbBadgeProps = {
|
|
|
88
100
|
export type BbBadgeEvents =
|
|
89
101
|
/** Emitted when the clear button is pressed (only rendered when `clearable`). */
|
|
90
102
|
(e: 'click:clear', event: MouseEvent) => void;
|
|
103
|
+
/**
|
|
104
|
+
* What `#icon` / `#prepend:icon` / `#append:icon` see: the badge's `pt` states.
|
|
105
|
+
* The link state comes from a slotted `BbBadgeButton` link, after hydration.
|
|
106
|
+
*/
|
|
107
|
+
export type BbBadgeIconSlotProps = BbLinkSlotProps & {
|
|
108
|
+
/** The `loading` prop. While it is on, the spinner takes the icon's place. */
|
|
109
|
+
loading: boolean;
|
|
110
|
+
};
|
|
91
111
|
export type BbBadgeSlots = {
|
|
92
112
|
/**
|
|
93
113
|
* The badge's label content. When `icon` is set this becomes the visually
|
|
@@ -95,6 +115,15 @@ export type BbBadgeSlots = {
|
|
|
95
115
|
* body interactive (the wrapper stays a passive `<span>`).
|
|
96
116
|
*/
|
|
97
117
|
default?: (props: object) => any;
|
|
118
|
+
/**
|
|
119
|
+
* The glyph of an icon-only badge, replacing the `icon` prop. Renders inside
|
|
120
|
+
* the `icon` part: `pt:icon`, `--icon-size` and the loading spinner apply.
|
|
121
|
+
*/
|
|
122
|
+
icon?: (props: BbBadgeIconSlotProps) => any;
|
|
123
|
+
/** The leading icon, replacing `prepend:icon`; inside the `icon` part. */
|
|
124
|
+
'prepend:icon'?: (props: BbBadgeIconSlotProps) => any;
|
|
125
|
+
/** The trailing icon, replacing `append:icon`; inside the `icon` part. */
|
|
126
|
+
'append:icon'?: (props: BbBadgeIconSlotProps) => any;
|
|
98
127
|
};
|
|
99
128
|
/**
|
|
100
129
|
* `BbBadgeButton` has full `BbBaseButton` parity: the badge body can do
|
|
@@ -107,7 +136,8 @@ export type BbBadgeSlots = {
|
|
|
107
136
|
export type BbBadgeButtonProps = Omit<BbBaseButtonProps, 'block' | 'text'>;
|
|
108
137
|
export type BbBadgeButtonSlots = {
|
|
109
138
|
/**
|
|
110
|
-
* The action's label — what the badge displays as its body.
|
|
139
|
+
* The action's label — what the badge displays as its body. A link's slot
|
|
140
|
+
* gets `{ activeLink, exactActiveLink }`, as on `BbBaseButton`.
|
|
111
141
|
*/
|
|
112
|
-
default?: (props:
|
|
142
|
+
default?: (props: BbLinkSlotProps) => any;
|
|
113
143
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { BADGE_VARIANTS as e } from "../../types/BadgeVariant.js";
|
|
1
2
|
//#region src/components/BbBadge/types.ts
|
|
2
|
-
var
|
|
3
|
+
var t = {
|
|
3
4
|
parts: [
|
|
4
5
|
"root",
|
|
5
6
|
"icon",
|
|
@@ -7,7 +8,15 @@ var e = {
|
|
|
7
8
|
"text",
|
|
8
9
|
"clear"
|
|
9
10
|
],
|
|
10
|
-
states: [
|
|
11
|
+
states: [
|
|
12
|
+
"activeLink",
|
|
13
|
+
"exactActiveLink",
|
|
14
|
+
"loading"
|
|
15
|
+
],
|
|
16
|
+
variant: {
|
|
17
|
+
names: e,
|
|
18
|
+
option: "badgeVariants"
|
|
19
|
+
}
|
|
11
20
|
};
|
|
12
21
|
//#endregion
|
|
13
|
-
export {
|
|
22
|
+
export { t as BB_BADGE_PT };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { usePassthrough as e } from "../../composables/usePassthrough.js";
|
|
2
2
|
import { useConfig as t } from "../../composables/useConfig.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import a from "./
|
|
7
|
-
import {
|
|
8
|
-
import { computed as s, createBlock as c, createElementBlock as l, createTextVNode as u, defineComponent as d, mergeProps as f, openBlock as p, renderSlot as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, useAttrs as v, withCtx as y } from "vue";
|
|
3
|
+
import { useFrameworkDetection as n } from "../../composables/useFrameworkDetection.js";
|
|
4
|
+
import { BB_BASE_BUTTON_PT as r } from "./types.js";
|
|
5
|
+
import i from "./RouterComponent.vue.js";
|
|
6
|
+
import { currentOrigin as a, isNonRoutable as o, useBaseLinkState as s } from "./useLinkState.js";
|
|
7
|
+
import { computed as c, createBlock as l, createElementBlock as u, createTextVNode as d, defineComponent as f, guardReactiveProps as p, mergeProps as m, normalizeProps as h, openBlock as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useAttrs as x, withCtx as S } from "vue";
|
|
9
8
|
//#region src/components/BbBaseButton/BbBaseButton.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
9
|
+
var C = /*@__PURE__*/ f({
|
|
11
10
|
inheritAttrs: !1,
|
|
12
11
|
__name: "BbBaseButton",
|
|
13
12
|
props: {
|
|
14
13
|
"pt:root": {},
|
|
14
|
+
"pt:root:activeLink": {},
|
|
15
|
+
"pt:root:exactActiveLink": {},
|
|
15
16
|
"pt:root:disabled": {},
|
|
16
17
|
pt: {},
|
|
17
18
|
activeClass: {},
|
|
@@ -65,143 +66,105 @@ var b = "http://localhost", x = /*@__PURE__*/ d({
|
|
|
65
66
|
preserveUrl: { type: Boolean },
|
|
66
67
|
viewTransition: { type: Boolean }
|
|
67
68
|
},
|
|
68
|
-
setup(
|
|
69
|
-
let
|
|
69
|
+
setup(f) {
|
|
70
|
+
let C = f, w = s(C), T = e({
|
|
70
71
|
component: "BbBaseButton",
|
|
71
|
-
attrs:
|
|
72
|
-
props:
|
|
73
|
-
parts:
|
|
74
|
-
states:
|
|
75
|
-
active: {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (n.startsWith("#") || n.startsWith("//")) return !0;
|
|
80
|
-
if (!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)) return !1;
|
|
81
|
-
if (!t) return !0;
|
|
82
|
-
try {
|
|
83
|
-
return new URL(n).origin !== t;
|
|
84
|
-
} catch {
|
|
85
|
-
return !0;
|
|
72
|
+
attrs: x(),
|
|
73
|
+
props: C,
|
|
74
|
+
parts: r.parts,
|
|
75
|
+
states: r.states,
|
|
76
|
+
active: {
|
|
77
|
+
disabled: () => !!C.disabled,
|
|
78
|
+
activeLink: () => w.value.activeLink,
|
|
79
|
+
exactActiveLink: () => w.value.exactActiveLink
|
|
86
80
|
}
|
|
87
|
-
},
|
|
88
|
-
let e = D();
|
|
89
|
-
if (e) try {
|
|
90
|
-
return j(new URL(e, b).pathname);
|
|
91
|
-
} catch {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
}), N = s(() => !!(x.href && !A(x.href, k))), P = s(() => {
|
|
95
|
-
if (!N.value || !x.href) return;
|
|
96
|
-
let e = M.value ?? "/";
|
|
97
|
-
try {
|
|
98
|
-
return j(new URL(x.href, `${b}${e}`).pathname);
|
|
99
|
-
} catch {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
}), F = s(() => O && E.value ? j(window.location.pathname) : void 0), I = s(() => {
|
|
103
|
-
if (!x.href || A(x.href, k)) return;
|
|
104
|
-
let e = F.value ?? "/";
|
|
105
|
-
try {
|
|
106
|
-
return j(new URL(x.href, `${b}${e}`).pathname);
|
|
107
|
-
} catch {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
}), L = s(() => w ? M.value : F.value), R = s(() => w ? P.value : I.value), z = s(() => {
|
|
111
|
-
if (x.to) return !1;
|
|
112
|
-
let e = L.value, t = R.value;
|
|
113
|
-
return !e || !t ? !1 : t === e;
|
|
114
|
-
}), B = s(() => {
|
|
115
|
-
if (x.to) return !1;
|
|
116
|
-
let e = L.value, t = R.value;
|
|
117
|
-
return !e || !t ? !1 : t === "/" ? e.startsWith("/") : e === t || e.startsWith(`${t}/`);
|
|
118
|
-
}), V = s(() => !!(x.href && w && N.value && !x.disabled && !x.target && !x.download && !x.external || x.to && !x.disabled)), H = s(() => !!(x.href || x.to && x.disabled)), U = s(() => x.activeClass ?? C.linkActiveClass), W = s(() => x.exactActiveClass ?? C.linkExactActiveClass), G = s(() => ({
|
|
81
|
+
}), E = t(), { isInertia: D, isNuxt: O } = n(), k = c(() => !C.to && w.value.activeLink), A = c(() => !C.to && w.value.exactActiveLink), j = c(() => !!(C.href && !o(C.href, a))), M = c(() => !!(C.href && D && j.value && !C.disabled && !C.target && !C.download && !C.external || C.to && !C.disabled)), N = c(() => !!(C.href || C.to && C.disabled)), P = c(() => C.activeClass ?? E.linkActiveClass), F = c(() => C.exactActiveClass ?? E.linkExactActiveClass), I = c(() => ({
|
|
119
82
|
"bb-base-button": !0,
|
|
120
|
-
"bb-base-button--block":
|
|
121
|
-
"bb-base-button--disabled":
|
|
122
|
-
[
|
|
123
|
-
[
|
|
124
|
-
})),
|
|
125
|
-
let e =
|
|
126
|
-
if (!
|
|
83
|
+
"bb-base-button--block": C.block,
|
|
84
|
+
"bb-base-button--disabled": C.disabled,
|
|
85
|
+
[P.value]: k.value,
|
|
86
|
+
[F.value]: A.value
|
|
87
|
+
})), L = c(() => {
|
|
88
|
+
let e = C.rel?.trim() ?? "";
|
|
89
|
+
if (!C.target || C.target === "_self") return e || void 0;
|
|
127
90
|
let t = new Set(e.split(/\s+/).filter(Boolean));
|
|
128
91
|
return t.add("noopener"), t.add("noreferrer"), Array.from(t).join(" ");
|
|
129
|
-
}),
|
|
130
|
-
disabled:
|
|
131
|
-
type:
|
|
132
|
-
}),
|
|
133
|
-
if (
|
|
92
|
+
}), R = () => ({
|
|
93
|
+
disabled: C.disabled,
|
|
94
|
+
type: C.type
|
|
95
|
+
}), z = () => {
|
|
96
|
+
if (C.disabled) return {
|
|
134
97
|
"aria-disabled": !0,
|
|
135
98
|
role: "link",
|
|
136
99
|
href: void 0,
|
|
137
100
|
tabindex: -1
|
|
138
101
|
};
|
|
139
102
|
let e = {
|
|
140
|
-
href:
|
|
141
|
-
rel:
|
|
142
|
-
target:
|
|
143
|
-
download:
|
|
103
|
+
href: C.href,
|
|
104
|
+
rel: L.value,
|
|
105
|
+
target: C.target,
|
|
106
|
+
download: C.download === !0 ? "" : (C.download ?? void 0) || void 0
|
|
144
107
|
};
|
|
145
|
-
return
|
|
146
|
-
},
|
|
147
|
-
data:
|
|
148
|
-
async:
|
|
149
|
-
cacheFor:
|
|
150
|
-
cacheTags:
|
|
151
|
-
component:
|
|
152
|
-
except:
|
|
153
|
-
instant:
|
|
154
|
-
onError:
|
|
155
|
-
onPrefetched:
|
|
156
|
-
onPrefetching:
|
|
157
|
-
pageProps:
|
|
158
|
-
prefetch:
|
|
159
|
-
preserveUrl:
|
|
160
|
-
viewTransition:
|
|
161
|
-
headers:
|
|
162
|
-
method:
|
|
163
|
-
onBefore:
|
|
164
|
-
onCancel:
|
|
165
|
-
onCancelToken:
|
|
166
|
-
onFinish:
|
|
167
|
-
only:
|
|
168
|
-
onProgress:
|
|
169
|
-
onStart:
|
|
170
|
-
onSuccess:
|
|
171
|
-
preserveScroll:
|
|
172
|
-
preserveState:
|
|
173
|
-
queryStringArrayFormat:
|
|
174
|
-
replace:
|
|
175
|
-
}),
|
|
176
|
-
activeClass:
|
|
177
|
-
ariaCurrentValue:
|
|
178
|
-
exactActiveClass:
|
|
179
|
-
...
|
|
180
|
-
rel:
|
|
181
|
-
replace:
|
|
182
|
-
target:
|
|
183
|
-
to:
|
|
184
|
-
}),
|
|
185
|
-
|
|
186
|
-
...
|
|
187
|
-
} :
|
|
188
|
-
return (e, t) =>
|
|
108
|
+
return A.value && (e["aria-current"] = C.ariaCurrentValue ?? "page"), e;
|
|
109
|
+
}, B = () => ({
|
|
110
|
+
data: C.data,
|
|
111
|
+
async: C.async,
|
|
112
|
+
cacheFor: C.cacheFor,
|
|
113
|
+
cacheTags: C.cacheTags,
|
|
114
|
+
component: C.component,
|
|
115
|
+
except: C.except,
|
|
116
|
+
instant: C.instant,
|
|
117
|
+
onError: C.onError,
|
|
118
|
+
onPrefetched: C.onPrefetched,
|
|
119
|
+
onPrefetching: C.onPrefetching,
|
|
120
|
+
pageProps: C.pageProps,
|
|
121
|
+
prefetch: C.prefetch,
|
|
122
|
+
preserveUrl: C.preserveUrl,
|
|
123
|
+
viewTransition: C.viewTransition,
|
|
124
|
+
headers: C.headers,
|
|
125
|
+
method: C.method,
|
|
126
|
+
onBefore: C.onBefore,
|
|
127
|
+
onCancel: C.onCancel,
|
|
128
|
+
onCancelToken: C.onCancelToken,
|
|
129
|
+
onFinish: C.onFinish,
|
|
130
|
+
only: C.only,
|
|
131
|
+
onProgress: C.onProgress,
|
|
132
|
+
onStart: C.onStart,
|
|
133
|
+
onSuccess: C.onSuccess,
|
|
134
|
+
preserveScroll: C.preserveScroll,
|
|
135
|
+
preserveState: C.preserveState,
|
|
136
|
+
queryStringArrayFormat: C.queryStringArrayFormat,
|
|
137
|
+
replace: C.replace
|
|
138
|
+
}), V = () => ({
|
|
139
|
+
activeClass: P.value,
|
|
140
|
+
ariaCurrentValue: C.ariaCurrentValue,
|
|
141
|
+
exactActiveClass: F.value,
|
|
142
|
+
...O ? { external: C.external } : {},
|
|
143
|
+
rel: L.value,
|
|
144
|
+
replace: C.replace,
|
|
145
|
+
target: C.target,
|
|
146
|
+
to: C.to
|
|
147
|
+
}), H = c(() => C.tag ?? "button"), U = c(() => H.value === "button" ? R() : {}), W = c(() => z()), G = c(() => V()), K = c(() => D ? {
|
|
148
|
+
...W.value,
|
|
149
|
+
...B()
|
|
150
|
+
} : G.value);
|
|
151
|
+
return (e, t) => M.value ? (g(), l(i, m({
|
|
189
152
|
key: 0,
|
|
190
|
-
class:
|
|
191
|
-
},
|
|
192
|
-
default:
|
|
153
|
+
class: I.value
|
|
154
|
+
}, m(K.value, b(T).forwardAttrs, b(T).root)), {
|
|
155
|
+
default: S(() => [_(e.$slots, "default", h(p(b(w))), () => [d(y(e.text), 1)])]),
|
|
193
156
|
_: 3
|
|
194
|
-
}, 16, ["class"])) :
|
|
157
|
+
}, 16, ["class"])) : N.value ? (g(), u("a", m({
|
|
195
158
|
key: 1,
|
|
196
|
-
class:
|
|
197
|
-
},
|
|
159
|
+
class: I.value
|
|
160
|
+
}, m(W.value, b(T).forwardAttrs, b(T).root)), [_(e.$slots, "default", h(p(b(w))), () => [d(y(e.text), 1)])], 16)) : (g(), l(v(H.value), m({
|
|
198
161
|
key: 2,
|
|
199
|
-
class:
|
|
200
|
-
},
|
|
201
|
-
default:
|
|
162
|
+
class: I.value
|
|
163
|
+
}, m(U.value, b(T).forwardAttrs, b(T).root)), {
|
|
164
|
+
default: S(() => [_(e.$slots, "default", h(p(b(w))), () => [d(y(e.text), 1)])]),
|
|
202
165
|
_: 3
|
|
203
166
|
}, 16, ["class"]));
|
|
204
167
|
}
|
|
205
168
|
});
|
|
206
169
|
//#endregion
|
|
207
|
-
export {
|
|
170
|
+
export { C as default };
|
|
@@ -11,15 +11,23 @@ import { RouteLocationRaw } from 'vue-router';
|
|
|
11
11
|
*/
|
|
12
12
|
export type BbBaseButtonPtPart = 'root';
|
|
13
13
|
/**
|
|
14
|
-
* Passthrough states of `BbBaseButton
|
|
14
|
+
* Passthrough states of `BbBaseButton`: `disabled` while `--disabled` is on,
|
|
15
|
+
* the link states while `activeClass` / `exactActiveClass` are. Order =
|
|
16
|
+
* precedence, last wins: `disabled` outranks the link states.
|
|
15
17
|
*
|
|
18
|
+
* @state activeLink - Component-wide: a link to the current page or one of its
|
|
19
|
+
* ancestors (`/users` on `/users/5`) — exactly when `activeClass` is on.
|
|
20
|
+
* The default slot gets it too, as `activeLink`.
|
|
21
|
+
* @state exactActiveLink - Component-wide: a link to the current page itself —
|
|
22
|
+
* exactly when `exactActiveClass` is on (`activeLink` is on too). The default
|
|
23
|
+
* slot gets it as `exactActiveLink`.
|
|
16
24
|
* @state disabled - Component-wide: the button is `disabled`.
|
|
17
25
|
*/
|
|
18
|
-
export type BbBaseButtonPtState = 'disabled';
|
|
26
|
+
export type BbBaseButtonPtState = 'activeLink' | 'exactActiveLink' | 'disabled';
|
|
19
27
|
/** The runtime lists the resolver is wired with — kept next to the types so the two cannot drift. */
|
|
20
28
|
export declare const BB_BASE_BUTTON_PT: {
|
|
21
29
|
readonly parts: readonly ["root"];
|
|
22
|
-
readonly states: readonly ["disabled"];
|
|
30
|
+
readonly states: readonly ["activeLink", "exactActiveLink", "disabled"];
|
|
23
31
|
};
|
|
24
32
|
export type BbBaseButtonProps = {
|
|
25
33
|
[K in `pt:${BbBaseButtonPtPart}` | `pt:${BbBaseButtonPtPart}:${BbBaseButtonPtState}`]?: PtValue;
|
|
@@ -273,11 +281,22 @@ export type BbBaseButtonProps = {
|
|
|
273
281
|
*/
|
|
274
282
|
viewTransition?: boolean;
|
|
275
283
|
};
|
|
284
|
+
/**
|
|
285
|
+
* The default slot's props: whether the link points at the current page, the
|
|
286
|
+
* same facts as its `activeClass` / `exactActiveClass` and its
|
|
287
|
+
* `activeLink` / `exactActiveLink` `pt` states. Always `false` on a button.
|
|
288
|
+
*/
|
|
289
|
+
export type BbLinkSlotProps = {
|
|
290
|
+
/** A link to the current page or one of its ancestors: `activeClass` is on. */
|
|
291
|
+
activeLink: boolean;
|
|
292
|
+
/** A link to the current page itself: `exactActiveClass` is on. */
|
|
293
|
+
exactActiveLink: boolean;
|
|
294
|
+
};
|
|
276
295
|
export type BbBaseButtonSlots = {
|
|
277
296
|
/**
|
|
278
297
|
* Primary content rendered inside the button element. Falls back to the `text` prop when empty.
|
|
279
298
|
*/
|
|
280
|
-
default?: (props:
|
|
299
|
+
default?: (props: BbLinkSlotProps) => any;
|
|
281
300
|
};
|
|
282
301
|
/** Runtime list of every {@link BbBaseButtonProps} key (kept exhaustive by the map above). */
|
|
283
302
|
export declare const BB_BASE_BUTTON_PROP_KEYS: Array<keyof BbBaseButtonProps>;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
//#region src/components/BbBaseButton/types.ts
|
|
2
2
|
var e = {
|
|
3
3
|
parts: ["root"],
|
|
4
|
-
states: [
|
|
4
|
+
states: [
|
|
5
|
+
"activeLink",
|
|
6
|
+
"exactActiveLink",
|
|
7
|
+
"disabled"
|
|
8
|
+
]
|
|
5
9
|
}, t = Object.keys({
|
|
6
10
|
pt: !0,
|
|
7
11
|
"pt:root": !0,
|
|
12
|
+
"pt:root:activeLink": !0,
|
|
13
|
+
"pt:root:exactActiveLink": !0,
|
|
8
14
|
"pt:root:disabled": !0,
|
|
9
15
|
activeClass: !0,
|
|
10
16
|
async: !0,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { BbBaseButtonProps } from './types';
|
|
3
|
+
/** What a link knows about the current page: the `activeClass` / `exactActiveClass` facts. */
|
|
4
|
+
export type LinkState = {
|
|
5
|
+
/** The link's target is the current page or one of its ancestors. */
|
|
6
|
+
activeLink: boolean;
|
|
7
|
+
/** The link's target is the current page. */
|
|
8
|
+
exactActiveLink: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** The props a link reads to place itself against the current page. */
|
|
11
|
+
export type LinkStateSource = Pick<BbBaseButtonProps, 'to' | 'href' | 'disabled' | 'external' | 'target' | 'replace'>;
|
|
12
|
+
export declare const currentOrigin: string | null;
|
|
13
|
+
export declare const isNonRoutable: (href: string, originToMatch?: string | null) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether a link points at the current page — the one fact behind its
|
|
16
|
+
* `activeClass` / `exactActiveClass`, its `activeLink` / `exactActiveLink`
|
|
17
|
+
* `pt` states and its default-slot props, so the three always agree.
|
|
18
|
+
*
|
|
19
|
+
* - `to` links take the router's own answer (`useLink`, see `findUseLink`).
|
|
20
|
+
* An external NuxtLink is never active, as NuxtLink itself reports.
|
|
21
|
+
* - `href` links match the path against Inertia's `$page.url` when present,
|
|
22
|
+
* otherwise the browser URL: a prefix match for `activeLink`, the same path
|
|
23
|
+
* for `exactActiveLink`.
|
|
24
|
+
*
|
|
25
|
+
* A disabled `to` link renders a plain `<a>` without RouterLink, so it is not
|
|
26
|
+
* active; a disabled `href` link keeps its classes (and so its state).
|
|
27
|
+
*/
|
|
28
|
+
export declare function useLinkState(props: LinkStateSource): ComputedRef<LinkState>;
|
|
29
|
+
/**
|
|
30
|
+
* A wrapper that renders a `BbBaseButton` as its root (BbButton, BbBadgeButton,
|
|
31
|
+
* a dropdown row) computes the link state for its own `pt` and slot, then hands
|
|
32
|
+
* it down so the base button does not compute it a second time. Only for a
|
|
33
|
+
* wrapper whose root IS the base button, bound with the same `to` / `href`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const provideLinkState: (state: ComputedRef<LinkState>) => void;
|
|
36
|
+
/**
|
|
37
|
+
* The base button's side: its wrapper's state when there is one, else its own.
|
|
38
|
+
* A handed-down state is shielded from the slot content, so a base button
|
|
39
|
+
* nested inside never takes its parent's.
|
|
40
|
+
*/
|
|
41
|
+
export declare const useBaseLinkState: (props: LinkStateSource) => ComputedRef<LinkState>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useConfig as e } from "../../composables/useConfig.js";
|
|
2
|
+
import { useHydrated as t } from "../../composables/useHydrated.js";
|
|
3
|
+
import { useFrameworkDetection as n } from "../../composables/useFrameworkDetection.js";
|
|
4
|
+
import { useInertiaPage as r } from "../../composables/useInertiaPage.js";
|
|
5
|
+
import { computed as i, getCurrentInstance as a, inject as o, provide as s, reactive as c } from "vue";
|
|
6
|
+
//#region src/components/BbBaseButton/useLinkState.ts
|
|
7
|
+
var l = "http://localhost", u = typeof window < "u", d = u ? window.location.origin : null, f = (e, t) => {
|
|
8
|
+
let n = e.trim();
|
|
9
|
+
if (!n) return !1;
|
|
10
|
+
if (n.startsWith("#") || n.startsWith("//")) return !0;
|
|
11
|
+
if (!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)) return !1;
|
|
12
|
+
if (!t) return !0;
|
|
13
|
+
try {
|
|
14
|
+
return new URL(n).origin !== t;
|
|
15
|
+
} catch {
|
|
16
|
+
return !0;
|
|
17
|
+
}
|
|
18
|
+
}, p = (e) => e === "/" ? e : e.replace(/\/+$/, ""), m = (e, t) => {
|
|
19
|
+
try {
|
|
20
|
+
return p(new URL(e, `${l}${t}`).pathname);
|
|
21
|
+
} catch {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}, h = (e, t) => {
|
|
25
|
+
let n = a()?.appContext.components ?? {}, r = (e) => {
|
|
26
|
+
let t = n[e]?.useLink;
|
|
27
|
+
return typeof t == "function" ? t : void 0;
|
|
28
|
+
};
|
|
29
|
+
return (e ? r(t) : void 0) ?? r("RouterLink");
|
|
30
|
+
};
|
|
31
|
+
function g(o) {
|
|
32
|
+
let s = e(), { isInertia: g, isNuxt: _ } = n(), { isHydrated: v } = t(), { getPageUrl: y } = r(), b = g ? void 0 : h(_, s.nuxtLinkName), x = b ? a()?.appContext.config.globalProperties.$router : void 0, S = x ? b(c({
|
|
33
|
+
to: i(() => o.to ?? x.currentRoute.value.fullPath),
|
|
34
|
+
replace: i(() => o.replace),
|
|
35
|
+
target: i(() => o.target),
|
|
36
|
+
external: i(() => o.external)
|
|
37
|
+
})) : void 0, C = i(() => {
|
|
38
|
+
let e = y();
|
|
39
|
+
if (e) try {
|
|
40
|
+
return p(new URL(e, l).pathname);
|
|
41
|
+
} catch {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}), w = i(() => u && v.value ? p(window.location.pathname) : void 0), T = i(() => g ? C.value : w.value), E = i(() => {
|
|
45
|
+
if (!(!o.href || f(o.href, d))) return m(o.href, T.value ?? "/");
|
|
46
|
+
});
|
|
47
|
+
return i(() => {
|
|
48
|
+
if (o.to) {
|
|
49
|
+
let e = !!S && !o.disabled && !S.isExternal?.value;
|
|
50
|
+
return {
|
|
51
|
+
activeLink: e && S.isActive.value,
|
|
52
|
+
exactActiveLink: e && S.isExactActive.value
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
let e = T.value, t = E.value;
|
|
56
|
+
return !e || !t ? {
|
|
57
|
+
activeLink: !1,
|
|
58
|
+
exactActiveLink: !1
|
|
59
|
+
} : {
|
|
60
|
+
activeLink: t === "/" || e === t || e.startsWith(`${t}/`),
|
|
61
|
+
exactActiveLink: t === e
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
var _ = Symbol("bitboss-ui:link-state"), v = (e) => s(_, e), y = (e) => {
|
|
66
|
+
let t = o(_, null);
|
|
67
|
+
return t ? (s(_, null), t) : g(e);
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { d as currentOrigin, f as isNonRoutable, v as provideLinkState, y as useBaseLinkState, g as useLinkState };
|