bitboss-ui 3.0.0-beta.4 → 3.0.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +317 -98
- package/bin/bitboss-ui-mcp.mjs +1566 -75
- package/bin/bitboss-ui.mjs +716 -72
- package/dist/ai/BbAccordion.md +178 -56
- package/dist/ai/BbAlert.md +140 -28
- package/dist/ai/BbAsterisk.md +61 -4
- package/dist/ai/BbAvatar.md +194 -53
- package/dist/ai/BbBadge.md +250 -50
- package/dist/ai/BbBadgeButton.md +74 -21
- package/dist/ai/BbBaseButton.md +132 -51
- package/dist/ai/BbBaseCheckboxIcon.md +118 -26
- package/dist/ai/BbBaseRadioIcon.md +115 -26
- package/dist/ai/BbBaseSwitchIcon.md +123 -28
- package/dist/ai/BbBreadcrumbs.md +221 -51
- package/dist/ai/BbButton.md +389 -107
- package/dist/ai/BbCalendar.md +667 -0
- package/dist/ai/BbCheckbox.md +242 -80
- package/dist/ai/BbCheckboxGroup.md +575 -66
- package/dist/ai/BbCollapsible.md +158 -39
- package/dist/ai/BbColorInput.md +322 -82
- package/dist/ai/BbColorPalette.md +261 -61
- package/dist/ai/BbConfirm.md +220 -51
- package/dist/ai/BbConfirmPortal.md +1 -1
- package/dist/ai/BbDatePicker.md +272 -37
- package/dist/ai/BbDatePickerInput.md +321 -92
- package/dist/ai/BbDialog.md +492 -87
- package/dist/ai/BbDropdown.md +1182 -104
- package/dist/ai/BbDropdownButton.md +239 -61
- package/dist/ai/BbDropdownGroup.md +5 -5
- package/dist/ai/BbDropzone.md +140 -36
- package/dist/ai/BbForm.md +1165 -40
- package/dist/ai/BbIcon.md +100 -33
- package/dist/ai/BbIndicator.md +79 -12
- package/dist/ai/BbNumberInput.md +257 -87
- package/dist/ai/BbOffCanvas.md +396 -91
- package/dist/ai/BbPagination.md +199 -32
- package/dist/ai/BbPopover.md +219 -54
- package/dist/ai/BbProgress.md +137 -71
- package/dist/ai/BbPtScope.md +136 -0
- package/dist/ai/BbRadio.md +234 -43
- package/dist/ai/BbRadioGroup.md +529 -91
- package/dist/ai/BbRating.md +243 -61
- package/dist/ai/BbSelect.md +690 -120
- package/dist/ai/BbSelectPopover.md +434 -122
- package/dist/ai/BbSlider.md +275 -79
- package/dist/ai/BbSmoothHeight.md +142 -34
- package/dist/ai/BbSpinner.md +179 -81
- package/dist/ai/BbSwitch.md +249 -63
- package/dist/ai/BbSwitchGroup.md +394 -65
- package/dist/ai/BbTable.md +1666 -222
- package/dist/ai/BbTabs.md +898 -178
- package/dist/ai/BbTabsList.md +81 -7
- package/dist/ai/BbTabsPanels.md +77 -0
- package/dist/ai/BbTabsRoot.md +16 -15
- package/dist/ai/BbTag.md +256 -76
- package/dist/ai/BbTextInput.md +480 -102
- package/dist/ai/BbTextarea.md +310 -96
- package/dist/ai/BbTimePicker.md +159 -24
- package/dist/ai/BbTimePickerInput.md +277 -46
- package/dist/ai/BbToast.md +286 -40
- package/dist/ai/BbToastPortal.md +3 -3
- package/dist/ai/BbTooltip.md +187 -34
- package/dist/ai/BbTree.md +260 -85
- package/dist/ai/ChipsBox.md +43 -2
- package/dist/ai/ClearableButton.md +12 -0
- package/dist/ai/CommaBox.md +2 -1
- package/dist/ai/CommonField.md +63 -0
- package/dist/ai/CommonFieldInput.md +90 -0
- package/dist/ai/CommonPopover.md +17 -12
- package/dist/ai/CommonTimeSelector.md +63 -0
- package/dist/ai/ErrorIcon.md +20 -0
- package/dist/ai/FlatListBox.md +41 -11
- package/dist/ai/GroupedListBox.md +42 -12
- package/dist/ai/ListBox.md +46 -11
- package/dist/ai/OptionsContainer.md +13 -10
- package/dist/ai/WarningIcon.md +20 -0
- package/dist/ai/changelog.json +4025 -141
- package/dist/ai/components.json +51872 -10136
- package/dist/ai/composables/useBbConfig.md +72 -11
- package/dist/ai/composables/useBbDropdownContext.md +168 -0
- package/dist/ai/composables/useBbFormContext.md +51 -24
- package/dist/ai/composables/useBbFormField.md +134 -0
- package/dist/ai/composables/useBbTableContext.md +41 -19
- package/dist/ai/composables/useConfirm.md +16 -8
- package/dist/ai/composables/useCountdown.md +1 -1
- package/dist/ai/composables/useId.md +10 -10
- package/dist/ai/composables/useMobile.md +17 -10
- package/dist/ai/composables/useToast.md +25 -19
- package/dist/ai/design-tokens.json +940 -0
- package/dist/ai/design-tokens.manifest.yaml +175 -0
- package/dist/ai/guides/agent-contract.md +168 -22
- package/dist/ai/guides/ai-router.md +79 -40
- package/dist/ai/guides/app-layout.md +8 -4
- package/dist/ai/guides/coherence-playbook.md +8 -8
- package/dist/ai/guides/component-picker.md +42 -34
- package/dist/ai/guides/design-language.md +274 -97
- package/dist/ai/guides/design-tokens.md +493 -105
- package/dist/ai/guides/fetch-items-playbook.md +22 -16
- package/dist/ai/guides/icons-policy.md +67 -35
- package/dist/ai/guides/inertia-helpers.md +4 -1
- package/dist/ai/guides/inline-edit-playbook.md +13 -6
- package/dist/ai/guides/installation-and-plugin-setup.md +817 -73
- package/dist/ai/guides/migration/components/bb-accordion.md +37 -0
- package/dist/ai/guides/migration/components/bb-alert.md +2 -2
- package/dist/ai/guides/migration/components/bb-avatar.md +13 -14
- package/dist/ai/guides/migration/components/bb-badge.md +5 -5
- package/dist/ai/guides/migration/components/bb-breadcrumbs.md +9 -8
- package/dist/ai/guides/migration/components/bb-button.md +80 -20
- package/dist/ai/guides/migration/components/bb-checkbox-group.md +116 -29
- package/dist/ai/guides/migration/components/bb-checkbox.md +53 -10
- package/dist/ai/guides/migration/components/bb-chip.md +6 -6
- package/dist/ai/guides/migration/components/bb-collapsible.md +5 -5
- package/dist/ai/guides/migration/components/bb-color-input.md +5 -5
- package/dist/ai/guides/migration/components/bb-color-palette.md +16 -9
- package/dist/ai/guides/migration/components/bb-date-picker-input.md +45 -35
- package/dist/ai/guides/migration/components/bb-dialog.md +69 -36
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +7 -1
- package/dist/ai/guides/migration/components/bb-dropdown.md +31 -8
- package/dist/ai/guides/migration/components/bb-dropzone.md +8 -0
- package/dist/ai/guides/migration/components/bb-icon.md +7 -7
- package/dist/ai/guides/migration/components/bb-intersection.md +1 -1
- package/dist/ai/guides/migration/components/bb-offcanvas.md +29 -31
- package/dist/ai/guides/migration/components/bb-pagination.md +10 -0
- package/dist/ai/guides/migration/components/bb-popover.md +19 -11
- package/dist/ai/guides/migration/components/bb-radio-group.md +14 -0
- package/dist/ai/guides/migration/components/bb-rating.md +61 -24
- package/dist/ai/guides/migration/components/bb-select-popover.md +9 -1
- package/dist/ai/guides/migration/components/bb-select.md +21 -4
- package/dist/ai/guides/migration/components/bb-slider.md +14 -6
- package/dist/ai/guides/migration/components/bb-switch-group.md +14 -0
- package/dist/ai/guides/migration/components/bb-table.md +574 -33
- package/dist/ai/guides/migration/components/bb-tabs.md +91 -41
- package/dist/ai/guides/migration/components/bb-tag.md +9 -7
- package/dist/ai/guides/migration/components/bb-text-input.md +12 -12
- package/dist/ai/guides/migration/components/bb-toast.md +2 -2
- package/dist/ai/guides/migration/components/bb-tooltip.md +18 -0
- package/dist/ai/guides/migration/components/bb-tree.md +11 -9
- package/dist/ai/guides/migration/components/use-confirm.md +9 -1
- package/dist/ai/guides/migration/v2-to-v3.md +828 -240
- package/dist/ai/guides/migration/v3-beta-css-classes.md +751 -0
- package/dist/ai/guides/migration/v3-beta-tooling.md +119 -0
- package/dist/ai/guides/options-items-playbook.md +161 -12
- package/dist/ai/guides/page-shell.md +1 -1
- package/dist/ai/guides/passthrough.md +958 -0
- package/dist/ai/guides/preset-components.md +361 -0
- package/dist/ai/guides/ssr-prefill.md +127 -0
- package/dist/ai/guides/validated-forms.md +466 -55
- package/dist/ai/guides/validation-libraries.md +171 -0
- package/dist/ai/guides/validation-providers.md +113 -0
- package/dist/ai/index.md +45 -44
- package/dist/ai/recipes/inertia/approvals-inbox.md +26 -10
- package/dist/ai/recipes/inertia/command-palette.md +2 -2
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +46 -30
- package/dist/ai/recipes/inertia/layout-scaffold.md +6 -2
- package/dist/ai/recipes/inertia/onboarding.md +30 -8
- package/dist/ai/recipes/inertia/ownership-atlas.md +72 -49
- package/dist/ai/recipes/inertia/record-form.md +53 -19
- package/dist/ai/recipes/inertia/records-workspace.md +201 -49
- package/dist/ai/recipes/inertia/settings-workspace.md +3809 -0
- package/dist/ai/recipes/inertia/upload-center.md +54 -43
- package/dist/ai/recipes/inertia/wizard-form.md +98 -14
- package/dist/ai/recipes/nuxt/approvals-inbox.md +26 -10
- package/dist/ai/recipes/nuxt/command-palette.md +2 -2
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +68 -52
- package/dist/ai/recipes/nuxt/layout-scaffold.md +6 -2
- package/dist/ai/recipes/nuxt/onboarding.md +30 -8
- package/dist/ai/recipes/nuxt/record-form.md +66 -22
- package/dist/ai/recipes/nuxt/records-workspace.md +199 -48
- package/dist/ai/recipes/nuxt/settings-workspace.md +3898 -0
- package/dist/ai/recipes/nuxt/upload-center.md +52 -41
- package/dist/ai/recipes/nuxt/wizard-form.md +98 -14
- package/dist/ai/recipes/vue/approvals-inbox.md +28 -12
- package/dist/ai/recipes/vue/command-palette.md +2 -2
- package/dist/ai/recipes/vue/inline-edit-workspace.md +69 -53
- package/dist/ai/recipes/vue/layout-scaffold.md +6 -2
- package/dist/ai/recipes/vue/onboarding.md +32 -8
- package/dist/ai/recipes/vue/record-form.md +81 -54
- package/dist/ai/recipes/vue/records-workspace.md +198 -49
- package/dist/ai/recipes/vue/settings-workspace.md +3836 -0
- package/dist/ai/recipes/vue/upload-center.md +53 -42
- package/dist/ai/recipes/vue/wizard-form.md +97 -14
- package/dist/ai/source/BbAccordion.md +90 -24
- package/dist/ai/source/BbAlert.md +209 -62
- package/dist/ai/source/BbAsterisk.md +54 -4
- package/dist/ai/source/BbAvatar.md +73 -16
- package/dist/ai/source/BbBadge.md +265 -97
- package/dist/ai/source/BbBadgeButton.md +218 -79
- package/dist/ai/source/BbBaseButton.md +108 -12
- package/dist/ai/source/BbBaseCheckboxIcon.md +151 -36
- package/dist/ai/source/BbBaseRadioIcon.md +121 -17
- package/dist/ai/source/BbBaseSwitchIcon.md +138 -28
- package/dist/ai/source/BbBreadcrumbs.md +363 -69
- package/dist/ai/source/BbButton.md +563 -174
- package/dist/ai/source/BbCalendar.md +1744 -0
- package/dist/ai/source/BbCheckbox.md +470 -68
- package/dist/ai/source/BbCheckboxGroup.md +976 -95
- package/dist/ai/source/BbCollapsible.md +96 -8
- package/dist/ai/source/BbColorInput.md +597 -67
- package/dist/ai/source/BbColorPalette.md +1284 -65
- package/dist/ai/source/BbConfirm.md +149 -7
- package/dist/ai/source/BbConfirmPortal.md +89 -3
- package/dist/ai/source/BbDatePicker.md +527 -381
- package/dist/ai/source/BbDatePickerInput.md +2015 -118
- package/dist/ai/source/BbDialog.md +531 -64
- package/dist/ai/source/BbDropdown.md +885 -175
- package/dist/ai/source/BbDropdownButton.md +377 -79
- package/dist/ai/source/BbDropdownGroup.md +687 -96
- package/dist/ai/source/BbDropzone.md +140 -31
- package/dist/ai/source/BbForm.md +875 -17
- package/dist/ai/source/BbIcon.md +130 -52
- package/dist/ai/source/BbIndicator.md +117 -60
- package/dist/ai/source/BbNumberInput.md +667 -84
- package/dist/ai/source/BbOffCanvas.md +1007 -261
- package/dist/ai/source/BbPagination.md +203 -31
- package/dist/ai/source/BbPopover.md +267 -90
- package/dist/ai/source/BbProgress.md +88 -26
- package/dist/ai/source/BbPtScope.md +54 -0
- package/dist/ai/source/BbRadio.md +388 -58
- package/dist/ai/source/BbRadioGroup.md +940 -109
- package/dist/ai/source/BbRating.md +736 -84
- package/dist/ai/source/BbSelect.md +1096 -96
- package/dist/ai/source/BbSelectPopover.md +807 -114
- package/dist/ai/source/BbSlider.md +1390 -98
- package/dist/ai/source/BbSmoothHeight.md +48 -2
- package/dist/ai/source/BbSpinner.md +62 -6
- package/dist/ai/source/BbSwitch.md +297 -60
- package/dist/ai/source/BbSwitchGroup.md +761 -83
- package/dist/ai/source/BbTable.md +6950 -1864
- package/dist/ai/source/BbTabs.md +368 -111
- package/dist/ai/source/BbTabsList.md +503 -146
- package/dist/ai/source/BbTabsPanels.md +625 -0
- package/dist/ai/source/BbTabsRoot.md +319 -100
- package/dist/ai/source/BbTag.md +796 -87
- package/dist/ai/source/BbTextInput.md +497 -68
- package/dist/ai/source/BbTextarea.md +550 -65
- package/dist/ai/source/BbTimePicker.md +395 -69
- package/dist/ai/source/BbTimePickerInput.md +1233 -106
- package/dist/ai/source/BbToast.md +250 -74
- package/dist/ai/source/BbToastPortal.md +210 -66
- package/dist/ai/source/BbTooltip.md +181 -30
- package/dist/ai/source/BbTree.md +76 -11
- package/dist/ai/source/ChipsBox.md +25 -5
- package/dist/ai/source/CommaBox.md +21 -6
- package/dist/ai/source/{BbBaseInputContainer.md → CommonField.md} +467 -250
- package/dist/ai/source/CommonFieldInput.md +848 -0
- package/dist/ai/source/CommonPopover.md +116 -30
- package/dist/ai/source/CommonTimeSelector.md +726 -0
- package/dist/ai/source/ErrorIcon.md +2 -2
- package/dist/ai/source/FlatListBox.md +188 -17
- package/dist/ai/source/GroupedListBox.md +236 -44
- package/dist/ai/source/GuidesComponent.md +14 -7
- package/dist/ai/source/ListBox.md +46 -8
- package/dist/ai/source/OptionsContainer.md +288 -60
- package/dist/ai/source/WarningIcon.md +2 -2
- package/dist/assets/css/reset.css_inline.js +1 -1
- package/dist/assets/svgs/star.svg_raw.js +4 -0
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +49 -32
- package/dist/components/BbAccordion/types.d.ts +35 -3
- package/dist/components/BbAccordion/types.js +11 -0
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +46 -30
- package/dist/components/BbAlert/types.d.ts +37 -3
- package/dist/components/BbAlert/types.js +13 -0
- package/dist/components/BbAsterisk/BbAsterisk.vue.d.ts +3 -1
- package/dist/components/BbAsterisk/BbAsterisk.vue_vue_type_script_setup_true_lang.js +23 -8
- package/dist/components/BbAsterisk/types.d.ts +18 -0
- package/dist/components/BbAsterisk/types.js +7 -0
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -1
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +57 -44
- package/dist/components/BbAvatar/types.d.ts +23 -0
- package/dist/components/BbAvatar/types.js +7 -0
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -18
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +96 -53
- package/dist/components/BbBadge/BbBadgeButton.vue_vue_type_script_setup_true_lang.js +27 -8
- package/dist/components/BbBadge/badgeButtonContext.d.ts +25 -8
- package/dist/components/BbBadge/types.d.ts +46 -3
- package/dist/components/BbBadge/types.js +13 -0
- package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +109 -96
- package/dist/components/BbBaseButton/RouterComponent.vue_vue_type_script_setup_true_lang.js +11 -11
- package/dist/components/BbBaseButton/types.d.ts +33 -3
- package/dist/components/BbBaseButton/types.js +9 -2
- package/dist/components/BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue_vue_type_script_setup_true_lang.js +50 -18
- package/dist/components/BbBaseCheckboxIcon/types.d.ts +31 -2
- package/dist/components/BbBaseCheckboxIcon/types.js +8 -0
- package/dist/components/BbBaseRadioIcon/BbBaseRadioIcon.vue_vue_type_script_setup_true_lang.js +45 -15
- package/dist/components/BbBaseRadioIcon/types.d.ts +31 -2
- package/dist/components/BbBaseRadioIcon/types.js +8 -0
- package/dist/components/BbBaseSwitchIcon/BbBaseSwitchIcon.vue_vue_type_script_setup_true_lang.js +48 -16
- package/dist/components/BbBaseSwitchIcon/types.d.ts +31 -2
- package/dist/components/BbBaseSwitchIcon/types.js +8 -0
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +187 -132
- package/dist/components/BbBreadcrumbs/types.d.ts +45 -3
- package/dist/components/BbBreadcrumbs/types.js +12 -0
- package/dist/components/BbButton/BbButton.vue.d.ts +5 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +107 -81
- package/dist/components/BbButton/types.d.ts +113 -2
- package/dist/components/BbButton/types.js +12 -0
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +34 -0
- package/dist/components/BbCalendar/BbCalendar.vue.js +6 -0
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +608 -0
- package/dist/components/BbCalendar/CalendarMonthPanel.vue.js +5 -0
- package/dist/components/BbCalendar/CalendarMonthPanel.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/components/BbCalendar/CalendarYearPanel.vue.js +5 -0
- package/dist/components/BbCalendar/CalendarYearPanel.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/components/BbCalendar/calendarHost.d.ts +29 -0
- package/dist/components/BbCalendar/calendarHost.js +10 -0
- package/dist/components/BbCalendar/types.d.ts +225 -0
- package/dist/components/BbCalendar/types.js +29 -0
- package/dist/components/{BbBaseDatePicker/useDatePickerContext.d.ts → BbCalendar/useCalendarContext.d.ts} +10 -7
- package/dist/components/BbCalendar/useCalendarContext.js +11 -0
- package/dist/components/BbCalendar/useCalendarGrid.d.ts +208 -0
- package/dist/components/BbCalendar/useCalendarGrid.js +274 -0
- package/dist/components/BbCalendar/useDayGrid.d.ts +79 -0
- package/dist/components/BbCalendar/useDayGrid.js +204 -0
- package/dist/components/BbCalendar/useToday.d.ts +23 -0
- package/dist/components/BbCalendar/useToday.js +21 -0
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +7 -7
- package/dist/components/BbCheckbox/BbCheckbox.vue_vue_type_script_setup_true_lang.js +214 -72
- package/dist/components/BbCheckbox/types.d.ts +180 -13
- package/dist/components/BbCheckbox/types.js +8 -0
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +15 -3
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +338 -90
- package/dist/components/BbCheckboxGroup/types.d.ts +195 -20
- package/dist/components/BbCheckboxGroup/types.js +10 -0
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +2 -1
- package/dist/components/BbCollapsible/BbCollapsible.vue_vue_type_script_setup_true_lang.js +41 -19
- package/dist/components/BbCollapsible/types.d.ts +44 -1
- package/dist/components/BbCollapsible/types.js +7 -0
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +17 -7
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +330 -86
- package/dist/components/BbColorInput/types.d.ts +230 -12
- package/dist/components/BbColorInput/types.js +24 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +10 -2
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +515 -108
- package/dist/components/BbColorPalette/types.d.ts +76 -7
- package/dist/components/BbColorPalette/types.js +12 -0
- package/dist/components/BbConfirm/BbConfirm.vue.d.ts +2 -1
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +125 -76
- package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +1 -0
- package/dist/components/BbConfirm/types.d.ts +49 -0
- package/dist/components/BbConfirm/types.js +17 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +16 -10
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +320 -223
- package/dist/components/BbDatePicker/types.d.ts +111 -17
- package/dist/components/BbDatePicker/types.js +33 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +16 -4
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +1172 -87
- package/dist/components/BbDatePickerInput/types.d.ts +224 -19
- package/dist/components/BbDatePickerInput/types.js +39 -0
- package/dist/components/BbDialog/BbDialog.vue.d.ts +3 -3
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +227 -136
- package/dist/components/BbDialog/types.d.ts +92 -3
- package/dist/components/BbDialog/types.js +16 -0
- package/dist/components/BbDialog/useDialogStack.d.ts +12 -0
- package/dist/components/BbDialog/useDialogStack.js +9 -2
- package/dist/components/BbDropdown/AdaptiveDropdown.vue.d.ts +2 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +108 -96
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +10 -2
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +337 -268
- package/dist/components/BbDropdown/BbDropdownGroup.vue.d.ts +5 -1
- package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +8 -2
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +377 -293
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +129 -118
- package/dist/components/BbDropdown/normalizeGroups.js +55 -31
- package/dist/components/BbDropdown/types.d.ts +288 -30
- package/dist/components/BbDropdown/types.js +21 -2
- package/dist/components/BbDropdown/useDropdownContext.d.ts +10 -4
- package/dist/components/BbDropdown/useDropdownGroupRegistry.d.ts +1 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +18 -3
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +172 -40
- package/dist/components/BbDropdownButton/types.d.ts +137 -8
- package/dist/components/BbDropdownButton/types.js +35 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +2 -2
- package/dist/components/BbDropzone/BbDropzone.vue_vue_type_script_setup_true_lang.js +186 -144
- package/dist/components/BbDropzone/types.d.ts +38 -4
- package/dist/components/BbDropzone/types.js +16 -0
- package/dist/components/BbForm/BbForm.vue.d.ts +94 -0
- package/dist/{validated → components/BbForm}/BbForm.vue.js +1 -1
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +317 -0
- package/dist/components/BbForm/BbFormCustomField.d.ts +14 -0
- package/dist/components/BbForm/BbFormCustomField.js +43 -0
- package/dist/components/BbForm/bindFormField.d.ts +16 -0
- package/dist/components/BbForm/bindFormField.js +85 -0
- package/dist/components/BbForm/formFields.d.ts +64 -0
- package/dist/components/BbForm/formFields.js +11 -0
- package/dist/components/BbForm/formSchema.d.ts +56 -0
- package/dist/components/BbForm/formSchema.js +196 -0
- package/dist/components/BbForm/standardSchema.d.ts +59 -0
- package/dist/components/BbIcon/BbIcon.vue_vue_type_script_setup_true_lang.js +58 -48
- package/dist/components/BbIcon/iconCache.d.ts +63 -0
- package/dist/components/BbIcon/iconCache.js +35 -0
- package/dist/components/BbIcon/types.d.ts +22 -2
- package/dist/components/BbIcon/types.js +7 -0
- package/dist/components/BbIndicator/BbIndicator.vue_vue_type_script_setup_true_lang.js +34 -21
- package/dist/components/BbIndicator/types.d.ts +24 -0
- package/dist/components/BbIndicator/types.js +7 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +12 -8
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +308 -85
- package/dist/components/BbNumberInput/types.d.ts +201 -18
- package/dist/components/BbNumberInput/types.js +8 -0
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +3 -3
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +311 -210
- package/dist/components/BbOffCanvas/types.d.ts +79 -6
- package/dist/components/BbOffCanvas/types.js +15 -0
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +125 -90
- package/dist/components/BbPagination/types.d.ts +38 -0
- package/dist/components/BbPagination/types.js +13 -0
- package/dist/components/BbPopover/BbPopover.vue.d.ts +4 -4
- package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +219 -179
- package/dist/components/BbPopover/types.d.ts +51 -5
- package/dist/components/BbPopover/types.js +14 -0
- package/dist/components/BbProgress/BbProgress.vue_vue_type_script_setup_true_lang.js +29 -16
- package/dist/components/BbProgress/types.d.ts +25 -0
- package/dist/components/BbProgress/types.js +7 -0
- package/dist/components/BbPtScope/BbPtScope.vue.d.ts +12 -0
- package/dist/components/BbPtScope/BbPtScope.vue.js +5 -0
- package/dist/components/BbPtScope/BbPtScope.vue_vue_type_script_setup_true_lang.js +13 -0
- package/dist/components/BbPtScope/types.d.ts +15 -0
- package/dist/components/BbRadio/BbRadio.vue.d.ts +7 -7
- package/dist/components/BbRadio/BbRadio.vue_vue_type_script_setup_true_lang.js +172 -59
- package/dist/components/BbRadio/types.d.ts +152 -13
- package/dist/components/BbRadio/types.js +8 -0
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +14 -2
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +319 -92
- package/dist/components/BbRadioGroup/types.d.ts +198 -22
- package/dist/components/BbRadioGroup/types.js +10 -0
- package/dist/components/BbRating/BbRating.vue.d.ts +10 -8
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +259 -78
- package/dist/components/BbRating/types.d.ts +174 -13
- package/dist/components/BbRating/types.js +21 -0
- package/dist/components/BbSelect/BbSelect.vue.d.ts +17 -3
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +553 -83
- package/dist/components/BbSelect/types.d.ts +235 -20
- package/dist/components/BbSelect/types.js +41 -0
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +15 -1
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +541 -391
- package/dist/components/BbSelectPopover/types.d.ts +124 -8
- package/dist/components/BbSelectPopover/types.js +24 -0
- package/dist/components/BbSlider/BbSlider.vue.d.ts +13 -8
- package/dist/components/BbSlider/BbSlider.vue_vue_type_script_setup_true_lang.js +472 -96
- package/dist/components/BbSlider/types.d.ts +202 -13
- package/dist/components/BbSlider/types.js +26 -0
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue_vue_type_script_setup_true_lang.js +60 -48
- package/dist/components/BbSmoothHeight/types.d.ts +19 -0
- package/dist/components/BbSmoothHeight/types.js +7 -0
- package/dist/components/BbSpinner/BbSpinner.vue_vue_type_script_setup_true_lang.js +27 -14
- package/dist/components/BbSpinner/types.d.ts +22 -1
- package/dist/components/BbSpinner/types.js +7 -0
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +7 -7
- package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +220 -78
- package/dist/components/BbSwitch/types.d.ts +25 -10
- package/dist/components/BbSwitch/types.js +5 -0
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +14 -2
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +338 -90
- package/dist/components/BbSwitchGroup/types.d.ts +30 -7
- package/dist/components/BbSwitchGroup/types.js +5 -0
- package/dist/components/BbTable/BbTable.vue.d.ts +27 -6
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +2013 -685
- package/dist/components/BbTable/BbTableDataRow.d.ts +196 -0
- package/dist/components/BbTable/BbTableDataRow.js +151 -0
- package/dist/components/BbTable/BbTableExpandRow.d.ts +84 -0
- package/dist/components/BbTable/BbTableExpandRow.js +62 -0
- package/dist/components/BbTable/BbTableSelectToggle.d.ts +120 -0
- package/dist/components/BbTable/BbTableSelectToggle.js +122 -0
- package/dist/components/BbTable/gridWidgets.d.ts +30 -0
- package/dist/components/BbTable/gridWidgets.js +14 -0
- package/dist/components/BbTable/types.d.ts +473 -123
- package/dist/components/BbTable/types.js +31 -0
- package/dist/components/BbTable/utils.d.ts +145 -4
- package/dist/components/BbTable/utils.js +154 -37
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -1
- package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +62 -26
- package/dist/components/BbTabs/BbTabsList.vue.d.ts +3 -10
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +143 -81
- package/dist/components/BbTabs/BbTabsPanels.vue.d.ts +12 -0
- package/dist/components/{BbBaseSwitch/BbBaseSwitch.vue.js → BbTabs/BbTabsPanels.vue.js} +2 -2
- package/dist/components/BbTabs/BbTabsPanels.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/BbTabs/BbTabsRoot.vue.d.ts +3 -1
- package/dist/components/BbTabs/BbTabsRoot.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BbTabs/types.d.ts +183 -23
- package/dist/components/BbTabs/types.js +34 -0
- package/dist/components/BbTag/BbTag.vue.d.ts +13 -10
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +383 -92
- package/dist/components/BbTag/types.d.ts +139 -14
- package/dist/components/BbTag/types.js +22 -0
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +10 -8
- package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +257 -84
- package/dist/components/BbTextInput/types.d.ts +168 -13
- package/dist/components/BbTextInput/types.js +8 -0
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +7 -7
- package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +291 -94
- package/dist/components/BbTextarea/types.d.ts +158 -14
- package/dist/components/BbTextarea/types.js +8 -0
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +12 -4
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +199 -122
- package/dist/components/BbTimePicker/types.d.ts +94 -7
- package/dist/components/BbTimePicker/types.js +18 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +14 -4
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +749 -86
- package/dist/components/BbTimePickerInput/types.d.ts +171 -22
- package/dist/components/BbTimePickerInput/types.js +25 -0
- package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +63 -25
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +4 -1
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +79 -76
- package/dist/components/BbToast/BbToastPortal.vue.d.ts +1 -0
- package/dist/components/BbToast/BbToastRegion.vue.d.ts +4 -1
- package/dist/components/BbToast/BbToastRegion.vue_vue_type_script_setup_true_lang.js +72 -64
- package/dist/components/BbToast/types.d.ts +54 -1
- package/dist/components/BbToast/types.js +28 -0
- package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +104 -87
- package/dist/components/BbTooltip/types.d.ts +40 -2
- package/dist/components/BbTooltip/types.js +7 -0
- package/dist/components/BbTree/BbTree.vue.d.ts +15 -3
- package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +51 -29
- package/dist/components/BbTree/BbTreeLevel.vue.d.ts +1 -1
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +17 -16
- package/dist/components/BbTree/context.d.ts +9 -1
- package/dist/components/BbTree/types.d.ts +40 -5
- package/dist/components/BbTree/types.js +7 -0
- package/dist/components/ChipsBox/ChipsBox.vue_vue_type_script_setup_true_lang.js +46 -44
- package/dist/components/ChipsBox/types.d.ts +7 -0
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/CommaBox/CommaBox.vue_vue_type_script_setup_true_lang.js +11 -7
- package/dist/components/CommaBox/types.d.ts +7 -0
- package/dist/components/{BbBaseInputContainer/BbBaseInputContainer.vue.d.ts → CommonField/CommonField.vue.d.ts} +5 -5
- package/dist/components/{BbBaseRadio/BbBaseRadio.vue.js → CommonField/CommonField.vue.js} +2 -2
- package/dist/components/CommonField/CommonField.vue_vue_type_script_setup_true_lang.js +189 -0
- package/dist/components/CommonField/messageHeightMatrix.d.ts +2 -0
- package/dist/components/{BbBaseInputContainer → CommonField}/types.d.ts +52 -16
- package/dist/components/{CommonInputWrapper/CommonInputWrapper.vue.d.ts → CommonFieldInput/CommonFieldInput.vue.d.ts} +5 -4
- package/dist/components/{BbBaseRadioGroup/BbBaseRadioGroup.vue.js → CommonFieldInput/CommonFieldInput.vue.js} +2 -2
- package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/components/CommonFieldInput/boxBorderMatrix.d.ts +10 -0
- package/dist/components/{CommonInputWrapper → CommonFieldInput}/types.d.ts +27 -8
- package/dist/components/CommonPopover/CommonPopover.vue.d.ts +11 -2
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +76 -63
- package/dist/components/CommonPopover/types.d.ts +27 -8
- package/dist/components/{BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue.d.ts → CommonTimeSelector/CommonTimeSelector.vue.d.ts} +21 -2
- package/dist/components/{BbBaseColorPalette/BbBaseColorPalette.vue.js → CommonTimeSelector/CommonTimeSelector.vue.js} +2 -2
- package/dist/components/CommonTimeSelector/CommonTimeSelector.vue_vue_type_script_setup_true_lang.js +232 -0
- package/dist/components/CommonTimeSelector/types.d.ts +6 -0
- package/dist/components/FlatListBox/FlatListBox.vue.d.ts +5 -1
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +165 -95
- package/dist/components/FlatListBox/types.d.ts +24 -2
- package/dist/components/GroupedListBox/GroupedListBox.vue.d.ts +5 -1
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +217 -134
- package/dist/components/GroupedListBox/types.d.ts +24 -2
- package/dist/components/ListBox/ListBox.vue.d.ts +5 -1
- package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +95 -69
- package/dist/components/ListBox/types.d.ts +24 -2
- package/dist/components/OptionsContainer/OptionsContainer.vue.d.ts +1 -1
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +109 -37
- package/dist/components/OptionsContainer/types.d.ts +53 -9
- package/dist/components/Transitions/ScaleFade.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/Transitions/Slide.vue.js +1 -1
- package/dist/composables/useBaseOptions.d.ts +12 -1
- package/dist/composables/useBaseOptions.js +77 -37
- package/dist/composables/useBbConfig.d.ts +27 -6
- package/dist/composables/useBbConfig.js +8 -2
- package/dist/composables/useBbDropdownContext.d.ts +5 -0
- package/dist/composables/useBbFormContext.d.ts +131 -8
- package/dist/composables/useBbFormContext.js +49 -30
- package/dist/composables/useBbFormField.d.ts +40 -0
- package/dist/composables/useBbFormField.js +39 -0
- package/dist/composables/useBbTableContext.d.ts +45 -1
- package/dist/composables/useBbTableContext.js +93 -87
- package/dist/composables/useBbTabsContext.d.ts +15 -9
- package/dist/composables/useBbTabsContext.js +121 -90
- package/dist/composables/useClosingInert.d.ts +4 -4
- package/dist/composables/useCoarsePointer.js +7 -10
- package/dist/composables/useCoherence.js +1 -1
- package/dist/composables/useConfig.d.ts +59 -0
- package/dist/composables/useConfig.js +15 -0
- package/dist/composables/useConfirm.d.ts +39 -7
- package/dist/composables/useConfirm.js +50 -41
- package/dist/composables/useEscapeStackEntry.d.ts +13 -0
- package/dist/composables/useEscapeStackEntry.js +16 -0
- package/dist/composables/useFormBinding.d.ts +116 -0
- package/dist/composables/useFormBinding.js +34 -0
- package/dist/composables/useHydrated.d.ts +18 -0
- package/dist/composables/useHydrated.js +13 -7
- package/dist/composables/useId.d.ts +4 -3
- package/dist/composables/useId.js +1 -7
- package/dist/composables/useItemsGetter.d.ts +11 -0
- package/dist/composables/useItemsGetter.js +44 -18
- package/dist/composables/useKeyboardInset.d.ts +28 -0
- package/dist/composables/useKeyboardInset.js +32 -0
- package/dist/composables/useLocale.js +10 -7
- package/dist/composables/useMobile.js +7 -10
- package/dist/composables/usePassthrough.d.ts +228 -0
- package/dist/composables/usePassthrough.js +247 -0
- package/dist/composables/usePrefill.d.ts +22 -2
- package/dist/composables/usePrefill.js +35 -19
- package/dist/composables/useSafeAreaInternal.js +1 -1
- package/dist/composables/useSegmentedFields.d.ts +2 -2
- package/dist/composables/useSsrState.d.ts +20 -0
- package/dist/composables/useSsrState.js +13 -0
- package/dist/composables/useTableWidthContext.d.ts +24 -4
- package/dist/composables/useTableWidthContext.js +31 -28
- package/dist/composables/useToast.d.ts +18 -1
- package/dist/composables/useToast.js +31 -18
- package/dist/composables/useToggleInput.d.ts +44 -0
- package/dist/composables/useToggleInput.js +39 -0
- package/dist/composables/useViewportWidth.d.ts +5 -25
- package/dist/composables/useViewportWidth.js +14 -7
- package/dist/deprecation/ai-deprecations.json.d.ts +1977 -289
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/deprecation/removedProps.js +9 -4
- package/dist/directives/bbDropdown.d.ts +15 -4
- package/dist/directives/bbDropdown.js +31 -9
- package/dist/directives/bbTooltip.d.ts +6 -0
- package/dist/directives/createPopoverDirective.d.ts +62 -0
- package/dist/directives/createPopoverDirective.js +92 -37
- package/dist/i18n/index.d.ts +10 -16
- package/dist/i18n/locales/cs.json +9 -5
- package/dist/i18n/locales/da.json +9 -5
- package/dist/i18n/locales/de.json +9 -5
- package/dist/i18n/locales/el.json +9 -5
- package/dist/i18n/locales/en.json +9 -5
- package/dist/i18n/locales/es.json +9 -5
- package/dist/i18n/locales/fi.json +9 -5
- package/dist/i18n/locales/fr.json +9 -5
- package/dist/i18n/locales/hu.json +9 -5
- package/dist/i18n/locales/it.json +9 -5
- package/dist/i18n/locales/ja.json +9 -5
- package/dist/i18n/locales/ko.json +9 -5
- package/dist/i18n/locales/nb.json +9 -5
- package/dist/i18n/locales/nl.json +9 -5
- package/dist/i18n/locales/pl.json +9 -5
- package/dist/i18n/locales/pt.json +9 -5
- package/dist/i18n/locales/ro.json +9 -5
- package/dist/i18n/locales/ru.json +9 -5
- package/dist/i18n/locales/sv.json +9 -5
- package/dist/i18n/locales/tr.json +9 -5
- package/dist/i18n/locales/uk.json +9 -5
- package/dist/i18n/locales/zh-cn.json +9 -5
- package/dist/icon-scan.d.ts +276 -0
- package/dist/icon-scan.js +485 -0
- package/dist/icons-whitelist.d.ts +5 -4
- package/dist/index.d.ts +40 -21
- package/dist/index.js +78 -71
- package/dist/llms-full.txt +61164 -27972
- package/dist/llms-medium.txt +1482 -366
- package/dist/llms.txt +32 -15
- package/dist/locale-blueprint.json +9 -5
- package/dist/nuxt-auto-imports.d.ts +76 -0
- package/dist/nuxt-auto-imports.js +32 -0
- package/dist/nuxt-module.d.ts +30 -15
- package/dist/nuxt.js +35 -9
- package/dist/passthrough-deduper.js +5 -0
- package/dist/plugin.d.ts +10 -1
- package/dist/plugin.js +29 -19
- package/dist/project-dts.d.ts +84 -0
- package/dist/project-dts.js +170 -0
- package/dist/reset.css +1 -1
- package/dist/runtime/nuxt-plugin.js +34 -21
- package/dist/styles.css +3 -2
- package/dist/types/AlertVariant.d.ts +10 -1
- package/dist/types/BadgeVariant.d.ts +16 -5
- package/dist/types/ButtonVariant.d.ts +12 -1
- package/dist/types/ColumnName.d.ts +30 -3
- package/dist/types/CommonProps.d.ts +2 -2
- package/dist/types/Config.d.ts +94 -1
- package/dist/types/ConfirmVariant.d.ts +8 -1
- package/dist/types/DropdownItemVariant.d.ts +8 -1
- package/dist/types/FieldLayout.d.ts +32 -0
- package/dist/types/IndicatorVariant.d.ts +11 -1
- package/dist/types/InputVariant.d.ts +30 -0
- package/dist/types/ItemProps.d.ts +50 -0
- package/dist/types/Option.d.ts +6 -0
- package/dist/types/PtScope.d.ts +15 -0
- package/dist/types/RegistryKey.d.ts +10 -0
- package/dist/types/TabsVariant.d.ts +25 -0
- package/dist/types/ToastVariant.d.ts +12 -2
- package/dist/types/TooltipVariant.d.ts +8 -1
- package/dist/types/passthrough.d.ts +362 -0
- package/dist/types/passthrough.js +78 -0
- package/dist/types/ptComponentMap.d.ts +62 -0
- package/dist/utilities/functions/hasVnodeListener.d.ts +16 -0
- package/dist/utilities/functions/hasVnodeListener.js +12 -0
- package/dist/utilities/functions/isImeComposing.d.ts +7 -0
- package/dist/utilities/functions/isImeComposing.js +4 -0
- package/dist/utilities/functions/itemProps.d.ts +46 -0
- package/dist/utilities/functions/itemProps.js +47 -0
- package/dist/utilities/functions/slotKey.d.ts +13 -8
- package/dist/utilities/functions/slotKey.js +78 -2
- package/dist/utilities/functions/snapToStep.js +2 -1
- package/dist/utilities/functions/toggleInput.d.ts +98 -0
- package/dist/utilities/functions/toggleInput.js +56 -0
- package/dist/utilities/functions/warnRemovedAttrs.d.ts +27 -1
- package/dist/utilities/functions/warnRemovedAttrs.js +75 -14
- package/dist/utilities/misc/listboxMetrics.d.ts +9 -3
- package/dist/utilities/misc/listboxMetrics.js +5 -2
- package/dist/utilities/misc/ssrStateInjectionKey.d.ts +42 -0
- package/dist/utilities/misc/ssrStateInjectionKey.js +4 -0
- package/dist/utils/cssLayers.d.ts +91 -0
- package/dist/utils/cssLayers.js +43 -0
- package/dist/utils/injectLibraryStyles.d.ts +3 -1
- package/dist/utils/injectLibraryStyles.js +24 -23
- package/dist/utils/overlayEscapeStack.d.ts +10 -0
- package/dist/utils/overlayEscapeStack.js +5 -3
- package/dist/utils/passthrough.d.ts +67 -0
- package/dist/utils/passthrough.js +100 -0
- package/dist/utils/passthroughDeduper.d.ts +2 -0
- package/dist/utils/ptScope.d.ts +8 -0
- package/dist/utils/ptScope.js +4 -0
- package/dist/utils/versionCheck.d.ts +19 -0
- package/dist/utils/versionCheck.js +18 -0
- package/dist/vite-plugin.d.ts +301 -53
- package/dist/vite.js +547 -375
- package/llms.txt +33 -16
- package/package.json +49 -27
- package/scripts/lib/check-fix.mjs +129 -0
- package/scripts/lib/component-attr-targets.ts +123 -0
- package/scripts/lib/component-tree.ts +648 -0
- package/scripts/lib/css-class-check.mjs +326 -0
- package/scripts/lib/css-class-surface.mjs +292 -0
- package/scripts/lib/css-color-resolve.mjs +172 -0
- package/scripts/lib/css-local-check.mjs +267 -0
- package/scripts/lib/design-token-manifest.mjs +499 -0
- package/scripts/lib/doc-sections.mjs +248 -0
- package/scripts/lib/ensure-manifest.mjs +28 -5
- package/scripts/lib/eslint-disable.mjs +141 -0
- package/scripts/lib/eslint-plugin.d.ts +64 -1
- package/scripts/lib/eslint-plugin.mjs +1285 -30
- package/scripts/lib/hand-imported-styles.mjs +326 -0
- package/scripts/lib/hand-roll-hints.mjs +50 -6
- package/scripts/lib/html-attributes.mjs +353 -0
- package/scripts/lib/local-components.mjs +177 -0
- package/scripts/lib/mcp-config.mjs +87 -58
- package/scripts/lib/migrate-fix.mjs +62 -3
- package/scripts/lib/project-variant-dts.mjs +122 -0
- package/scripts/lib/public-type-exports.mjs +273 -0
- package/scripts/lib/slot-key.mjs +147 -0
- package/scripts/lib/slot-renames.mjs +46 -0
- package/scripts/lib/squashed-slot-words.mjs +133 -0
- package/scripts/lib/validate-bb-markup.mjs +2213 -76
- package/scripts/lib/wrapper-props.mjs +188 -0
- package/dist/ai/BbBaseCheckbox.md +0 -49
- package/dist/ai/BbBaseCheckboxGroup.md +0 -64
- package/dist/ai/BbBaseColorInput.md +0 -65
- package/dist/ai/BbBaseColorPalette.md +0 -39
- package/dist/ai/BbBaseDatePicker.md +0 -43
- package/dist/ai/BbBaseDatePickerInput.md +0 -73
- package/dist/ai/BbBaseInputContainer.md +0 -48
- package/dist/ai/BbBaseNumberInput.md +0 -71
- package/dist/ai/BbBaseRadio.md +0 -46
- package/dist/ai/BbBaseRadioGroup.md +0 -64
- package/dist/ai/BbBaseRating.md +0 -52
- package/dist/ai/BbBaseSelect.md +0 -88
- package/dist/ai/BbBaseSlider.md +0 -56
- package/dist/ai/BbBaseSwitch.md +0 -49
- package/dist/ai/BbBaseSwitchGroup.md +0 -64
- package/dist/ai/BbBaseTag.md +0 -68
- package/dist/ai/BbBaseTextInput.md +0 -75
- package/dist/ai/BbBaseTextarea.md +0 -62
- package/dist/ai/BbBaseTimePickerInput.md +0 -62
- package/dist/ai/BbTabsPanes.md +0 -27
- package/dist/ai/CommonInputWrapper.md +0 -42
- package/dist/ai/source/BbBaseCheckbox.md +0 -461
- package/dist/ai/source/BbBaseCheckboxGroup.md +0 -554
- package/dist/ai/source/BbBaseColorInput.md +0 -431
- package/dist/ai/source/BbBaseColorPalette.md +0 -942
- package/dist/ai/source/BbBaseDatePicker.md +0 -1448
- package/dist/ai/source/BbBaseDatePickerInput.md +0 -1940
- package/dist/ai/source/BbBaseNumberInput.md +0 -617
- package/dist/ai/source/BbBaseRadio.md +0 -381
- package/dist/ai/source/BbBaseRadioGroup.md +0 -539
- package/dist/ai/source/BbBaseRating.md +0 -607
- package/dist/ai/source/BbBaseSelect.md +0 -945
- package/dist/ai/source/BbBaseSlider.md +0 -1144
- package/dist/ai/source/BbBaseSwitch.md +0 -246
- package/dist/ai/source/BbBaseSwitchGroup.md +0 -302
- package/dist/ai/source/BbBaseTag.md +0 -694
- package/dist/ai/source/BbBaseTextInput.md +0 -511
- package/dist/ai/source/BbBaseTextarea.md +0 -504
- package/dist/ai/source/BbBaseTimePickerInput.md +0 -1037
- package/dist/ai/source/BbTabsPanes.md +0 -377
- package/dist/ai/source/CommonInputWrapper.md +0 -584
- package/dist/alert-variants.d.ts +0 -19
- package/dist/assets/svgs/sort.svg_raw.js +0 -4
- package/dist/badge-variants.d.ts +0 -19
- package/dist/button-variants.d.ts +0 -21
- package/dist/components/BbBadge/BadgeAppendIcon.vue.d.ts +0 -3
- package/dist/components/BbBadge/BadgeAppendIcon.vue.js +0 -5
- package/dist/components/BbBadge/BadgeAppendIcon.vue_vue_type_script_setup_true_lang.js +0 -22
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue.d.ts +0 -40
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue.js +0 -6
- package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue_vue_type_script_setup_true_lang.js +0 -145
- package/dist/components/BbBaseCheckbox/types.d.ts +0 -224
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue.d.ts +0 -19
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue.js +0 -6
- package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue_vue_type_script_setup_true_lang.js +0 -190
- package/dist/components/BbBaseCheckboxGroup/types.d.ts +0 -257
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue.d.ts +0 -43
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue.js +0 -6
- package/dist/components/BbBaseColorInput/BbBaseColorInput.vue_vue_type_script_setup_true_lang.js +0 -184
- package/dist/components/BbBaseColorInput/types.d.ts +0 -219
- package/dist/components/BbBaseColorPalette/BbBaseColorPalette.vue.d.ts +0 -13
- package/dist/components/BbBaseColorPalette/BbBaseColorPalette.vue_vue_type_script_setup_true_lang.js +0 -395
- package/dist/components/BbBaseColorPalette/types.d.ts +0 -40
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue.d.ts +0 -20
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue.js +0 -6
- package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue_vue_type_script_setup_true_lang.js +0 -407
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue.d.ts +0 -47
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue.js +0 -5
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue_vue_type_script_setup_true_lang.js +0 -318
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue.js +0 -5
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue_vue_type_script_setup_true_lang.js +0 -115
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerYearSelector.vue.js +0 -5
- package/dist/components/BbBaseDatePicker/BbBaseDatePickerYearSelector.vue_vue_type_script_setup_true_lang.js +0 -116
- package/dist/components/BbBaseDatePicker/types.d.ts +0 -108
- package/dist/components/BbBaseDatePicker/useDatePickerContext.js +0 -11
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue.d.ts +0 -31
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue.js +0 -6
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue_vue_type_script_setup_true_lang.js +0 -737
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue.js +0 -6
- package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerTimeSelector.vue_vue_type_script_setup_true_lang.js +0 -204
- package/dist/components/BbBaseDatePickerInput/types.d.ts +0 -325
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue.js +0 -6
- package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue_vue_type_script_setup_true_lang.js +0 -190
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue.d.ts +0 -52
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue.js +0 -6
- package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue_vue_type_script_setup_true_lang.js +0 -215
- package/dist/components/BbBaseNumberInput/types.d.ts +0 -211
- package/dist/components/BbBaseRadio/BbBaseRadio.vue.d.ts +0 -33
- package/dist/components/BbBaseRadio/BbBaseRadio.vue_vue_type_script_setup_true_lang.js +0 -113
- package/dist/components/BbBaseRadio/types.d.ts +0 -179
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue.d.ts +0 -19
- package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue_vue_type_script_setup_true_lang.js +0 -179
- package/dist/components/BbBaseRadioGroup/types.d.ts +0 -223
- package/dist/components/BbBaseRating/BbBaseRating.vue.d.ts +0 -38
- package/dist/components/BbBaseRating/BbBaseRating.vue.js +0 -6
- package/dist/components/BbBaseRating/BbBaseRating.vue_vue_type_script_setup_true_lang.js +0 -192
- package/dist/components/BbBaseRating/types.d.ts +0 -176
- package/dist/components/BbBaseSelect/BbBaseSelect.vue.d.ts +0 -19
- package/dist/components/BbBaseSelect/BbBaseSelect.vue.js +0 -6
- package/dist/components/BbBaseSelect/BbBaseSelect.vue_vue_type_script_setup_true_lang.js +0 -311
- package/dist/components/BbBaseSelect/types.d.ts +0 -297
- package/dist/components/BbBaseSlider/BbBaseSlider.vue.d.ts +0 -35
- package/dist/components/BbBaseSlider/BbBaseSlider.vue.js +0 -6
- package/dist/components/BbBaseSlider/BbBaseSlider.vue_vue_type_script_setup_true_lang.js +0 -340
- package/dist/components/BbBaseSlider/types.d.ts +0 -200
- package/dist/components/BbBaseSwitch/BbBaseSwitch.vue.d.ts +0 -35
- package/dist/components/BbBaseSwitch/BbBaseSwitch.vue_vue_type_script_setup_true_lang.js +0 -146
- package/dist/components/BbBaseSwitch/types.d.ts +0 -10
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue.d.ts +0 -19
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue.js +0 -6
- package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue_vue_type_script_setup_true_lang.js +0 -190
- package/dist/components/BbBaseSwitchGroup/types.d.ts +0 -8
- package/dist/components/BbBaseTag/BbBaseTag.vue.d.ts +0 -50
- package/dist/components/BbBaseTag/BbBaseTag.vue.js +0 -6
- package/dist/components/BbBaseTag/BbBaseTag.vue_vue_type_script_setup_true_lang.js +0 -266
- package/dist/components/BbBaseTag/types.d.ts +0 -160
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue.d.ts +0 -45
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue.js +0 -6
- package/dist/components/BbBaseTextInput/BbBaseTextInput.vue_vue_type_script_setup_true_lang.js +0 -200
- package/dist/components/BbBaseTextInput/types.d.ts +0 -209
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue.d.ts +0 -39
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue.js +0 -6
- package/dist/components/BbBaseTextarea/BbBaseTextarea.vue_vue_type_script_setup_true_lang.js +0 -187
- package/dist/components/BbBaseTextarea/types.d.ts +0 -170
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue.d.ts +0 -27
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue.js +0 -6
- package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue_vue_type_script_setup_true_lang.js +0 -519
- package/dist/components/BbBaseTimePickerInput/types.d.ts +0 -151
- package/dist/components/BbTabs/BbTabsPanes.vue.d.ts +0 -16
- package/dist/components/BbTabs/BbTabsPanes.vue.js +0 -6
- package/dist/components/BbTabs/BbTabsPanes.vue_vue_type_script_setup_true_lang.js +0 -35
- package/dist/components/CommonInputWrapper/CommonInputWrapper.vue.js +0 -6
- package/dist/components/CommonInputWrapper/CommonInputWrapper.vue_vue_type_script_setup_true_lang.js +0 -107
- package/dist/confirm-variants.d.ts +0 -17
- package/dist/dropdown-item-variants.d.ts +0 -17
- package/dist/indicator-variants.d.ts +0 -20
- package/dist/locale-registry.d.ts +0 -37
- package/dist/toast-variants.d.ts +0 -20
- package/dist/tooltip-variants.d.ts +0 -17
- package/dist/types/InputDirection.d.ts +0 -15
- package/dist/validated/BbCheckbox.vue.d.ts +0 -29
- package/dist/validated/BbCheckbox.vue.js +0 -5
- package/dist/validated/BbCheckbox.vue_vue_type_script_setup_true_lang.js +0 -75
- package/dist/validated/BbCheckboxGroup.vue.d.ts +0 -34
- package/dist/validated/BbCheckboxGroup.vue.js +0 -5
- package/dist/validated/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +0 -82
- package/dist/validated/BbColorInput.vue.d.ts +0 -37
- package/dist/validated/BbColorInput.vue.js +0 -5
- package/dist/validated/BbColorInput.vue_vue_type_script_setup_true_lang.js +0 -75
- package/dist/validated/BbDatePickerInput.vue.d.ts +0 -41
- package/dist/validated/BbDatePickerInput.vue.js +0 -5
- package/dist/validated/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +0 -90
- package/dist/validated/BbDropzone.vue.d.ts +0 -24
- package/dist/validated/BbDropzone.vue.js +0 -5
- package/dist/validated/BbDropzone.vue_vue_type_script_setup_true_lang.js +0 -45
- package/dist/validated/BbForm.vue.d.ts +0 -28
- package/dist/validated/BbForm.vue_vue_type_script_setup_true_lang.js +0 -42
- package/dist/validated/BbNumberInput.vue.d.ts +0 -36
- package/dist/validated/BbNumberInput.vue.js +0 -5
- package/dist/validated/BbNumberInput.vue_vue_type_script_setup_true_lang.js +0 -72
- package/dist/validated/BbRadioGroup.vue.d.ts +0 -34
- package/dist/validated/BbRadioGroup.vue.js +0 -5
- package/dist/validated/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +0 -78
- package/dist/validated/BbRating.vue.d.ts +0 -30
- package/dist/validated/BbRating.vue.js +0 -5
- package/dist/validated/BbRating.vue_vue_type_script_setup_true_lang.js +0 -63
- package/dist/validated/BbSelect.vue.d.ts +0 -46
- package/dist/validated/BbSelect.vue.js +0 -5
- package/dist/validated/BbSelect.vue_vue_type_script_setup_true_lang.js +0 -109
- package/dist/validated/BbSlider.vue.d.ts +0 -36
- package/dist/validated/BbSlider.vue.js +0 -5
- package/dist/validated/BbSlider.vue_vue_type_script_setup_true_lang.js +0 -69
- package/dist/validated/BbSwitch.vue.d.ts +0 -29
- package/dist/validated/BbSwitch.vue.js +0 -5
- package/dist/validated/BbSwitch.vue_vue_type_script_setup_true_lang.js +0 -75
- package/dist/validated/BbSwitchGroup.vue.d.ts +0 -34
- package/dist/validated/BbSwitchGroup.vue.js +0 -5
- package/dist/validated/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +0 -82
- package/dist/validated/BbTag.vue.d.ts +0 -36
- package/dist/validated/BbTag.vue.js +0 -5
- package/dist/validated/BbTag.vue_vue_type_script_setup_true_lang.js +0 -72
- package/dist/validated/BbTextInput.vue.d.ts +0 -36
- package/dist/validated/BbTextInput.vue.js +0 -5
- package/dist/validated/BbTextInput.vue_vue_type_script_setup_true_lang.js +0 -72
- package/dist/validated/BbTextarea.vue.d.ts +0 -36
- package/dist/validated/BbTextarea.vue.js +0 -5
- package/dist/validated/BbTextarea.vue_vue_type_script_setup_true_lang.js +0 -70
- package/dist/validated/BbTimePickerInput.vue.d.ts +0 -37
- package/dist/validated/BbTimePickerInput.vue.js +0 -5
- package/dist/validated/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +0 -81
- package/dist/validated/index.d.ts +0 -43
- package/dist/validated/useValidatedField.d.ts +0 -93
- package/dist/validated/useValidatedField.js +0 -51
- package/dist/validated.js +0 -21
- /package/dist/components/{BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue.d.ts → BbCalendar/CalendarMonthPanel.vue.d.ts} +0 -0
- /package/dist/components/{BbBaseDatePicker/BbBaseDatePickerYearSelector.vue.d.ts → BbCalendar/CalendarYearPanel.vue.d.ts} +0 -0
- /package/dist/{components/BbBaseDatePicker/typeahead.d.ts → composables/useTypeahead.d.ts} +0 -0
- /package/dist/{components/BbBaseDatePicker/typeahead.js → composables/useTypeahead.js} +0 -0
|
@@ -50,22 +50,84 @@
|
|
|
50
50
|
* BbBadgeButton), is not an anchor. The attribute renders, inert, and
|
|
51
51
|
* nothing ever warns (Bottega P3-R2, BTG-006: `<BbBadge href>` painted a
|
|
52
52
|
* non-interactive pill).
|
|
53
|
+
* - `no-unknown-event` — an `@event` a Bb* component does not emit. The
|
|
54
|
+
* event twin of `no-navigation-attr-fallthrough`, and the only rule the
|
|
55
|
+
* recommended preset sets to `warn`: an undeclared listener falls through
|
|
56
|
+
* to the root element, so it may be a deliberate native listener rather
|
|
57
|
+
* than a mistake. `<BbDialog @close>` is the case that prompted it — live,
|
|
58
|
+
* because that root is a native `<dialog>`, but outside the contract and
|
|
59
|
+
* unordered against the component's own `hidden`; a consumer's migration
|
|
60
|
+
* report filed it as dead code. `bitboss-ui check` has flagged this since
|
|
61
|
+
* Q10.12 via the shared `checkEvent`; the editor never did, because every
|
|
62
|
+
* rule here read `bind`/`model` and skipped `on`.
|
|
63
|
+
* - `no-state-text-color` — a colour-shade `text-*` in a toggle glyph's
|
|
64
|
+
* errors / warnings / disabled entry, which paints nothing: those states
|
|
65
|
+
* paint from the glyph's `--accent`, and CSS cannot tell a state entry's
|
|
66
|
+
* `color` from the resting one. Suggests the `[--accent:…]` spelling.
|
|
67
|
+
* - `no-star-color` — any colour utility (`text-*`, `fill-*`, `stroke-*`,
|
|
68
|
+
* shade, keyword, `(--var)` or arbitrary colour) in BbRating's `pt:item`,
|
|
69
|
+
* any state. The rating paints each star's colour per state (filled, the
|
|
70
|
+
* hover preview, errors), so a colour utility freezes the stars. Points at
|
|
71
|
+
* the root variables `--accent` / `--empty` / `--border-color`.
|
|
72
|
+
* - `no-box-border-color` — a colour-shade `border-*` in a text-like
|
|
73
|
+
* control's BASE `pt:box`, which hides the errors / warnings frame.
|
|
74
|
+
* Suggests the `[--border-color:…]` token the frame outranks; state
|
|
75
|
+
* entries are never reported.
|
|
76
|
+
* - `no-unknown-token` — a bare `var(--bb-…)` naming a token the installed
|
|
77
|
+
* package does not declare. The first rule here that reads CSS rather than
|
|
78
|
+
* the template AST, and the first promoted from a `bitboss-ui check`
|
|
79
|
+
* ADVISORY HINT: the same consumer report that filed `no-unknown-event`
|
|
80
|
+
* made the structural point that `check` is what nobody runs while ESLint
|
|
81
|
+
* runs in the editor and in pre-commit. Only this hint crossed over, of the
|
|
82
|
+
* three `check` carries. It is the only one stating a fact rather than a
|
|
83
|
+
* guess — an undefined custom property is invalid-at-computed-value-time,
|
|
84
|
+
* so CSS discards the entire declaration. The hand-rolled avatar and
|
|
85
|
+
* spinner detectors stay in `check` on purpose: they are guesses (a round
|
|
86
|
+
* `<img>` is sometimes a logo), and a rule that fires on correct code
|
|
87
|
+
* spends the trust every other rule here depends on.
|
|
53
88
|
*/
|
|
54
89
|
|
|
55
90
|
import { createRequire } from 'node:module';
|
|
91
|
+
import { dirname, join } from 'node:path';
|
|
92
|
+
import { fileURLToPath } from 'node:url';
|
|
93
|
+
import { findTokenUses, loadKnownTokens } from './hand-roll-hints.mjs';
|
|
56
94
|
import {
|
|
95
|
+
checkAccessibleName,
|
|
57
96
|
checkNavAttrFallthrough,
|
|
58
97
|
checkPartnerProps,
|
|
59
98
|
createComponentChecker,
|
|
60
99
|
loadManifest,
|
|
100
|
+
NAMED_COMPONENTS,
|
|
61
101
|
NAV_ATTRS,
|
|
102
|
+
unknownComponentFinding,
|
|
62
103
|
PARTNER_PROP_PAIRS,
|
|
63
104
|
toCamel,
|
|
105
|
+
keyedSlotLookup,
|
|
106
|
+
scriptSetupArrayConsts,
|
|
64
107
|
} from './validate-bb-markup.mjs';
|
|
108
|
+
import { libraryAliases, localBbImports } from './local-components.mjs';
|
|
65
109
|
import { matchNameStyle, planAttributeFix } from './migrate-fix.mjs';
|
|
66
110
|
|
|
111
|
+
/**
|
|
112
|
+
* The components a rule skips entirely: the configured `allowComponents`, plus
|
|
113
|
+
* every `Bb*` name this file imports from a non-`bitboss-ui` path — the app's
|
|
114
|
+
* own components, never checked or rewritten (Q53.18).
|
|
115
|
+
*/
|
|
116
|
+
const allowedComponentsFor = (context, options) => {
|
|
117
|
+
const text = (context.sourceCode ?? context.getSourceCode()).text;
|
|
118
|
+
return new Set([
|
|
119
|
+
...(options.allowComponents ?? []),
|
|
120
|
+
...localBbImports(text).keys(),
|
|
121
|
+
// A library component under another name (`{ BbButton as BbSave }`):
|
|
122
|
+
// `check` validates it as the real component; the rules skip it rather
|
|
123
|
+
// than report the alias as unknown.
|
|
124
|
+
...libraryAliases(text).keys(),
|
|
125
|
+
]);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
67
129
|
const BB_TAG = /^Bb[A-Za-z0-9]+$/;
|
|
68
|
-
/** `bitboss-ui` and its subpath entrypoints (`bitboss-ui/
|
|
130
|
+
/** `bitboss-ui` and its subpath entrypoints (`bitboss-ui/vite`, …). */
|
|
69
131
|
const BITBOSS_IMPORT = /^bitboss-ui(\/|$)/;
|
|
70
132
|
|
|
71
133
|
/** Kebab or Pascal tag → Pascal (`bb-button` and `BbButton` both match). */
|
|
@@ -150,8 +212,15 @@ const noUnknownAttributes = {
|
|
|
150
212
|
},
|
|
151
213
|
],
|
|
152
214
|
messages: {
|
|
153
|
-
|
|
154
|
-
|
|
215
|
+
/*
|
|
216
|
+
* One message with the hint folded in, rather than the bare
|
|
217
|
+
* "not in the manifest" this used to print. The three reasons a `Bb*`
|
|
218
|
+
* tag is unknown want three different answers — a public TYPE written
|
|
219
|
+
* as a tag, a typo, an app-owned component — and the editor is exactly
|
|
220
|
+
* where the reader acts on the answer without opening a terminal. See
|
|
221
|
+
* `unknownComponentFinding`.
|
|
222
|
+
*/
|
|
223
|
+
unknownComponent: '{{message}} — {{hint}}',
|
|
155
224
|
finding: '{{message}}',
|
|
156
225
|
},
|
|
157
226
|
},
|
|
@@ -165,7 +234,7 @@ const noUnknownAttributes = {
|
|
|
165
234
|
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
166
235
|
|
|
167
236
|
const allowAttrs = new Set(options.allowAttributes ?? []);
|
|
168
|
-
const allowComps =
|
|
237
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
169
238
|
|
|
170
239
|
/**
|
|
171
240
|
* Which bitboss-ui entrypoint each local name came from. Unlike a
|
|
@@ -262,16 +331,14 @@ const noUnknownAttributes = {
|
|
|
262
331
|
context.report({
|
|
263
332
|
node: node.startTag,
|
|
264
333
|
messageId: 'unknownComponent',
|
|
265
|
-
data:
|
|
334
|
+
data: unknownComponentFinding(name, manifest),
|
|
266
335
|
});
|
|
267
336
|
return;
|
|
268
337
|
}
|
|
269
338
|
|
|
270
|
-
//
|
|
271
|
-
// entrypoint that is NOT `/validated`.
|
|
339
|
+
// Q54.4: every form control is form-aware wherever it comes from.
|
|
272
340
|
const checker = createComponentChecker(surface, {
|
|
273
|
-
includeValidated:
|
|
274
|
-
!importedLocals.has(name) || validatedLocals.has(name),
|
|
341
|
+
includeValidated: true,
|
|
275
342
|
});
|
|
276
343
|
for (const attr of node.startTag.attributes) {
|
|
277
344
|
if (!attr.directive) {
|
|
@@ -305,6 +372,48 @@ const noUnknownAttributes = {
|
|
|
305
372
|
// the author's casing (needed to match camelCase props).
|
|
306
373
|
const argName = arg.rawName ?? arg.name;
|
|
307
374
|
if (allowAttrs.has(argName)) continue;
|
|
375
|
+
// `:pt="{ … }"`: the object form's keys are the same part /
|
|
376
|
+
// part:state vocabulary as the `pt:*` attributes, checked
|
|
377
|
+
// per static key (a spread or a computed key is unbounded).
|
|
378
|
+
if (argName === 'pt') {
|
|
379
|
+
const obj = attr.value?.expression;
|
|
380
|
+
if (obj?.type === 'ObjectExpression') {
|
|
381
|
+
for (const prop of obj.properties) {
|
|
382
|
+
if (prop.type !== 'Property' || prop.computed) continue;
|
|
383
|
+
const key =
|
|
384
|
+
prop.key.type === 'Identifier'
|
|
385
|
+
? prop.key.name
|
|
386
|
+
: typeof prop.key.value === 'string'
|
|
387
|
+
? prop.key.value
|
|
388
|
+
: null;
|
|
389
|
+
if (key === null) continue;
|
|
390
|
+
const ptFinding = checker.checkPtKey(key);
|
|
391
|
+
if (!ptFinding) continue;
|
|
392
|
+
// A renamed part (Q51.16) is rewritten in the key's
|
|
393
|
+
// own spelling: bare stays bare when it can, a
|
|
394
|
+
// quoted key keeps its quote.
|
|
395
|
+
// A shorthand `{ input }` can't be renamed without
|
|
396
|
+
// changing its value: report only.
|
|
397
|
+
const to = prop.shorthand ? null : ptFinding.to;
|
|
398
|
+
const keyNode = prop.key;
|
|
399
|
+
report(
|
|
400
|
+
keyNode,
|
|
401
|
+
ptFinding,
|
|
402
|
+
to
|
|
403
|
+
? (fixer) =>
|
|
404
|
+
fixer.replaceText(
|
|
405
|
+
keyNode,
|
|
406
|
+
keyNode.type === 'Identifier' &&
|
|
407
|
+
/^[A-Za-z_$][\w$]*$/.test(to)
|
|
408
|
+
? to
|
|
409
|
+
: `${sourceCode.getText(keyNode)[0] === '"' ? '"' : "'"}${to}${sourceCode.getText(keyNode)[0] === '"' ? '"' : "'"}`
|
|
410
|
+
)
|
|
411
|
+
: undefined
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
308
417
|
const finding = checker.checkAttr(argName);
|
|
309
418
|
if (!finding) continue;
|
|
310
419
|
const exprNode =
|
|
@@ -413,22 +522,17 @@ function attrBinding(startTag, camelName) {
|
|
|
413
522
|
/**
|
|
414
523
|
* `#slot` name ↔ gating prop pairs on `BbTable`. Each of these slots is
|
|
415
524
|
* rendered from a `v-if`/coherence check on the paired prop/model
|
|
416
|
-
* (`BbTable.vue`: `v-if="
|
|
417
|
-
*
|
|
418
|
-
*
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
*
|
|
525
|
+
* (`BbTable.vue`: `v-if="selectable"`, `v-if="item.expanded"` — itself driven
|
|
526
|
+
* by whatever `expandedItems` holds) — so a template that fills the slot but
|
|
527
|
+
* never sets the prop compiles clean, ships clean, and renders nothing, with
|
|
528
|
+
* no warning anywhere (W6-R1). `header:select` shares the same gating prop
|
|
529
|
+
* as its row-level counterpart and is deliberately NOT listed separately —
|
|
530
|
+
* flagging `#select` already catches the same missing `selectable` prop.
|
|
531
|
+
* `#actions` is NOT a pair any more: since 2026-09-07 the slot itself creates
|
|
532
|
+
* the actions column (the `actions` prop was retired), so an `#actions`
|
|
533
|
+
* template can never be orphaned.
|
|
423
534
|
*/
|
|
424
535
|
const TABLE_SLOT_PROP_PAIRS = [
|
|
425
|
-
{
|
|
426
|
-
slot: 'actions',
|
|
427
|
-
prop: 'actions',
|
|
428
|
-
missing: 'the `actions` prop is not set',
|
|
429
|
-
explain: 'the actions cell — and this slot — never renders',
|
|
430
|
-
action: 'Set the `actions` prop',
|
|
431
|
-
},
|
|
432
536
|
{
|
|
433
537
|
slot: 'select',
|
|
434
538
|
prop: 'selectable',
|
|
@@ -479,7 +583,7 @@ const requireTableSlotProp = {
|
|
|
479
583
|
const services = sourceCode.parserServices;
|
|
480
584
|
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
481
585
|
|
|
482
|
-
const allowComps =
|
|
586
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
483
587
|
|
|
484
588
|
return services.defineTemplateBodyVisitor({
|
|
485
589
|
VElement(node) {
|
|
@@ -584,7 +688,7 @@ const requirePartnerProp = {
|
|
|
584
688
|
const services = sourceCode.parserServices;
|
|
585
689
|
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
586
690
|
|
|
587
|
-
const allowComps =
|
|
691
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
588
692
|
const gatedComponents = new Set(
|
|
589
693
|
PARTNER_PROP_PAIRS.map((pair) => pair.component)
|
|
590
694
|
);
|
|
@@ -657,6 +761,8 @@ const noUnknownSlots = {
|
|
|
657
761
|
messages: {
|
|
658
762
|
unknownSlot: '{{message}}',
|
|
659
763
|
},
|
|
764
|
+
// A slot the library renamed (Q53.15) is rewritten to its new name.
|
|
765
|
+
fixable: 'code',
|
|
660
766
|
},
|
|
661
767
|
|
|
662
768
|
create(context) {
|
|
@@ -666,8 +772,14 @@ const noUnknownSlots = {
|
|
|
666
772
|
const services = sourceCode.parserServices;
|
|
667
773
|
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
668
774
|
|
|
669
|
-
const allowComps =
|
|
775
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
670
776
|
const allowSlots = new Set(options.allowSlots ?? []);
|
|
777
|
+
// Same-file literal arrays (Q53.14), read once per file, so a slot
|
|
778
|
+
// spelled like a visible key's OLD name is a certain, fixable rename
|
|
779
|
+
// (Q53.15 C9a) — the path `check --fix` takes.
|
|
780
|
+
let arrays = null;
|
|
781
|
+
const fileArrays = () =>
|
|
782
|
+
(arrays ??= scriptSetupArrayConsts(sourceCode.text));
|
|
671
783
|
|
|
672
784
|
return services.defineTemplateBodyVisitor({
|
|
673
785
|
VElement(node) {
|
|
@@ -680,6 +792,23 @@ const noUnknownSlots = {
|
|
|
680
792
|
// literal slot name is classified identically no matter which AST
|
|
681
793
|
// it came from.
|
|
682
794
|
const checker = createComponentChecker(surface);
|
|
795
|
+
const keyed = keyedSlotLookup(
|
|
796
|
+
name,
|
|
797
|
+
surface,
|
|
798
|
+
(propName) => {
|
|
799
|
+
const bound = node.startTag.attributes.find(
|
|
800
|
+
(a) =>
|
|
801
|
+
a.directive &&
|
|
802
|
+
a.key.name.name === 'bind' &&
|
|
803
|
+
a.key.argument?.type === 'VIdentifier' &&
|
|
804
|
+
a.key.argument.name === propName
|
|
805
|
+
);
|
|
806
|
+
return bound?.value?.expression
|
|
807
|
+
? sourceCode.getText(bound.value.expression)
|
|
808
|
+
: null;
|
|
809
|
+
},
|
|
810
|
+
fileArrays()
|
|
811
|
+
);
|
|
683
812
|
|
|
684
813
|
for (const child of node.children) {
|
|
685
814
|
if (child.type !== 'VElement' || child.rawName !== 'template')
|
|
@@ -699,12 +828,17 @@ const noUnknownSlots = {
|
|
|
699
828
|
const rawName = arg.rawName ?? arg.name;
|
|
700
829
|
if (allowSlots.has(rawName)) continue;
|
|
701
830
|
|
|
702
|
-
const finding =
|
|
831
|
+
const finding =
|
|
832
|
+
(keyed ? keyed(rawName) : null) ??
|
|
833
|
+
(keyed?.expects(rawName) ? null : checker.checkSlot(rawName));
|
|
703
834
|
if (!finding) continue;
|
|
704
835
|
context.report({
|
|
705
836
|
node: attr.key,
|
|
706
837
|
messageId: 'unknownSlot',
|
|
707
838
|
data: { message: finding.message },
|
|
839
|
+
...(finding.to
|
|
840
|
+
? { fix: (fixer) => fixer.replaceText(arg, finding.to) }
|
|
841
|
+
: {}),
|
|
708
842
|
});
|
|
709
843
|
}
|
|
710
844
|
}
|
|
@@ -774,7 +908,7 @@ const noActiveClassOnRootLink = {
|
|
|
774
908
|
const services = sourceCode.parserServices;
|
|
775
909
|
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
776
910
|
|
|
777
|
-
const allowComps =
|
|
911
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
778
912
|
|
|
779
913
|
return services.defineTemplateBodyVisitor({
|
|
780
914
|
VElement(node) {
|
|
@@ -882,7 +1016,7 @@ const noNavigationAttrFallthrough = {
|
|
|
882
1016
|
const services = sourceCode.parserServices;
|
|
883
1017
|
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
884
1018
|
|
|
885
|
-
const allowComps =
|
|
1019
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
886
1020
|
|
|
887
1021
|
return services.defineTemplateBodyVisitor({
|
|
888
1022
|
VElement(node) {
|
|
@@ -924,8 +1058,1090 @@ const noNavigationAttrFallthrough = {
|
|
|
924
1058
|
},
|
|
925
1059
|
};
|
|
926
1060
|
|
|
1061
|
+
/**
|
|
1062
|
+
* An `@event` on a `Bb*` component that names nothing the component emits.
|
|
1063
|
+
*
|
|
1064
|
+
* The check itself is not new — `createComponentChecker`'s `checkEvent` has
|
|
1065
|
+
* driven it in `bitboss-ui check` and the MCP `validate` tool since Q10.12.
|
|
1066
|
+
* What was new is that the EDITOR never ran it: every rule in this plugin read
|
|
1067
|
+
* `bind` and `model` directives and skipped `on` entirely, so the one gate a
|
|
1068
|
+
* consuming agent actually works against was the one gate blind to it.
|
|
1069
|
+
*
|
|
1070
|
+
* That is how `<WhatsAppConnectedCard @close>` shipped. The migration report
|
|
1071
|
+
* that found it called the handler dead code; it was not. BbDialog's root is a
|
|
1072
|
+
* native `<dialog>`, so the listener bound as a real DOM listener and fired.
|
|
1073
|
+
* `close` is in `ELEMENT_DOM_EVENTS` for that reason, and `checkEvent` returns
|
|
1074
|
+
* it as a `fallthrough` finding rather than an unknown one.
|
|
1075
|
+
*
|
|
1076
|
+
* Reported at `warn` in the recommended preset — alone among these rules, all
|
|
1077
|
+
* of which are `error`. That asymmetry is the point. An unknown prop is a typo
|
|
1078
|
+
* with one correct fix. An undeclared event listener may be a deliberate native
|
|
1079
|
+
* listener on a root the author knows, so this rule flags the contract, not a
|
|
1080
|
+
* mistake, and leaves `eslint-disable-next-line` as the answer for anyone who
|
|
1081
|
+
* meant it.
|
|
1082
|
+
* @type {import('eslint').Rule.RuleModule}
|
|
1083
|
+
*/
|
|
1084
|
+
const noUnknownEvent = {
|
|
1085
|
+
meta: {
|
|
1086
|
+
type: 'problem',
|
|
1087
|
+
docs: {
|
|
1088
|
+
description:
|
|
1089
|
+
"Flag an `@event` on a Bb* component that the component does not emit. Vue passes an undeclared listener through to the root element, so the markup compiles clean and `vue-tsc` stays quiet outside `strictTemplates`: a renamed event (beta.9's `resize` → `resize:column`) reads as working code, and an element-specific DOM event like `@close` binds to whatever the root happens to be — live on BbDialog, whose root is a native `<dialog>`, inert on BbAlert. A third case is neither: `@success` on BbButton binds the declared `onSuccess` PROP, so it runs, and the rule points at the documented `:on-success` spelling instead. Universal DOM events (`@click`, `@keydown`) are always allowed.",
|
|
1090
|
+
recommended: true,
|
|
1091
|
+
},
|
|
1092
|
+
schema: [
|
|
1093
|
+
{
|
|
1094
|
+
type: 'object',
|
|
1095
|
+
properties: {
|
|
1096
|
+
manifestPath: { type: 'string' },
|
|
1097
|
+
failClosed: { type: 'boolean' },
|
|
1098
|
+
allowComponents: { type: 'array', items: { type: 'string' } },
|
|
1099
|
+
allowEvents: { type: 'array', items: { type: 'string' } },
|
|
1100
|
+
},
|
|
1101
|
+
additionalProperties: false,
|
|
1102
|
+
},
|
|
1103
|
+
],
|
|
1104
|
+
messages: {
|
|
1105
|
+
// Two ids, not one: the fallthrough case is a different claim about
|
|
1106
|
+
// the code, and a consumer suppressing one should not lose the other.
|
|
1107
|
+
unknownEvent: '{{message}} — {{hint}}',
|
|
1108
|
+
fallthroughEvent: '{{message}}. {{hint}}',
|
|
1109
|
+
},
|
|
1110
|
+
},
|
|
1111
|
+
|
|
1112
|
+
create(context) {
|
|
1113
|
+
const options = context.options[0] ?? {};
|
|
1114
|
+
const manifest = getManifest(options.manifestPath, options);
|
|
1115
|
+
const sourceCode = context.sourceCode ?? context.getSourceCode();
|
|
1116
|
+
const services = sourceCode.parserServices;
|
|
1117
|
+
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
1118
|
+
|
|
1119
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
1120
|
+
const allowEvents = new Set(options.allowEvents ?? []);
|
|
1121
|
+
|
|
1122
|
+
return services.defineTemplateBodyVisitor({
|
|
1123
|
+
VElement(node) {
|
|
1124
|
+
const name = toPascalTag(node.rawName);
|
|
1125
|
+
if (!BB_TAG.test(name) || allowComps.has(name)) return;
|
|
1126
|
+
const surface = manifest.get(name);
|
|
1127
|
+
if (!surface) return; // unknown component — no-unknown-attributes owns this
|
|
1128
|
+
|
|
1129
|
+
const checker = createComponentChecker(surface);
|
|
1130
|
+
|
|
1131
|
+
for (const attr of node.startTag.attributes) {
|
|
1132
|
+
if (!attr.directive || attr.key.name.name !== 'on') continue;
|
|
1133
|
+
const arg = attr.key.argument;
|
|
1134
|
+
// `v-on="obj"` (no arg) and `@[expr]` (dynamic) are unbounded.
|
|
1135
|
+
if (!arg || arg.type !== 'VIdentifier') continue;
|
|
1136
|
+
|
|
1137
|
+
// `vue-eslint-parser` splits `@click.stop` into an argument plus
|
|
1138
|
+
// modifiers, so the raw name here is already bare — unlike the
|
|
1139
|
+
// compiler AST `checkEvent`'s other caller walks, which keeps the
|
|
1140
|
+
// dots. `checkEvent` strips them either way; nothing to do here.
|
|
1141
|
+
const rawName = arg.rawName ?? arg.name;
|
|
1142
|
+
if (allowEvents.has(rawName)) continue;
|
|
1143
|
+
|
|
1144
|
+
const finding = checker.checkEvent(rawName);
|
|
1145
|
+
if (!finding) continue;
|
|
1146
|
+
|
|
1147
|
+
context.report({
|
|
1148
|
+
node: attr.key,
|
|
1149
|
+
messageId: finding.fallthrough
|
|
1150
|
+
? 'fallthroughEvent'
|
|
1151
|
+
: 'unknownEvent',
|
|
1152
|
+
data: { message: finding.message, hint: finding.hint ?? '' },
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
});
|
|
1157
|
+
},
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1160
|
+
/*
|
|
1161
|
+
* The three v3 controls whose `reverse` prop kept its NAME but inverted its
|
|
1162
|
+
* MEANING between v2 and v3. Hardcoded on purpose: this is a fact about one
|
|
1163
|
+
* historical migration, not a property the manifest can express — the manifest
|
|
1164
|
+
* records that `reverse` exists and defaults to `false`, which is true in both
|
|
1165
|
+
* versions and says nothing about which layout that produces.
|
|
1166
|
+
*
|
|
1167
|
+
* Verified against both branches rather than assumed:
|
|
1168
|
+
* v2 `BbSwitch.vue` withDefaults `reverse: true`, passed RAW to the base
|
|
1169
|
+
* container. v3 defaults the public prop `false` and passes `!props.reverse`
|
|
1170
|
+
* down. Both defaults therefore reach the base as `true` — the default
|
|
1171
|
+
* layout never moved — but every EXPLICIT value flips.
|
|
1172
|
+
*/
|
|
1173
|
+
const INVERTED_REVERSE_COMPONENTS = new Set([
|
|
1174
|
+
'BbCheckbox',
|
|
1175
|
+
'BbRadio',
|
|
1176
|
+
'BbSwitch',
|
|
1177
|
+
]);
|
|
1178
|
+
|
|
1179
|
+
/** @type {import('eslint').Rule.RuleModule} */
|
|
1180
|
+
const noReverseFalse = {
|
|
1181
|
+
meta: {
|
|
1182
|
+
type: 'problem',
|
|
1183
|
+
hasSuggestions: true,
|
|
1184
|
+
fixable: 'code',
|
|
1185
|
+
docs: {
|
|
1186
|
+
description:
|
|
1187
|
+
'Flag `:reverse="false"` on BbCheckbox/BbRadio/BbSwitch — the v2 spelling for a right-hand control. `reverse` kept its name and inverted its meaning in v3, so the v2 spelling is now a no-op that renders the OPPOSITE layout, and nothing else catches it: it is valid TypeScript, a declared prop, and its own default.',
|
|
1188
|
+
recommended: true,
|
|
1189
|
+
},
|
|
1190
|
+
schema: [
|
|
1191
|
+
{
|
|
1192
|
+
type: 'object',
|
|
1193
|
+
properties: {
|
|
1194
|
+
manifestPath: { type: 'string' },
|
|
1195
|
+
failClosed: { type: 'boolean' },
|
|
1196
|
+
allowComponents: { type: 'array', items: { type: 'string' } },
|
|
1197
|
+
// Opt-in for a bulk v2→v3 sweep: turn the "control on the right"
|
|
1198
|
+
// rewrite into a real `--fix`. Off by default because the two
|
|
1199
|
+
// readings produce OPPOSITE layouts, and a v3-native codebase
|
|
1200
|
+
// that wrote the redundant `:reverse="false"` would silently have
|
|
1201
|
+
// its rows flipped by a fix it never asked for.
|
|
1202
|
+
assumeV2: { type: 'boolean' },
|
|
1203
|
+
},
|
|
1204
|
+
additionalProperties: false,
|
|
1205
|
+
},
|
|
1206
|
+
],
|
|
1207
|
+
messages: {
|
|
1208
|
+
reverseFalse:
|
|
1209
|
+
'`:reverse="false"` on {{component}} is the v2 spelling for a right-hand control, and in v3 it is a no-op that renders the control on the LEFT. v3 inverted the prop\'s meaning while keeping its name: pass bare `reverse` for the v2 layout, or delete the prop (it is already the default). See ai/guides/migration/components/bb-checkbox.md.',
|
|
1210
|
+
reverseStringFalse:
|
|
1211
|
+
'`reverse="false"` on {{component}} is a STRING, which is truthy — so it does the opposite of what it reads like and behaves as `reverse`. Write bare `reverse` if that is what you want, or delete the prop.',
|
|
1212
|
+
},
|
|
1213
|
+
},
|
|
1214
|
+
|
|
1215
|
+
create(context) {
|
|
1216
|
+
const options = context.options[0] ?? {};
|
|
1217
|
+
const manifest = getManifest(options.manifestPath, options);
|
|
1218
|
+
const sourceCode = context.sourceCode ?? context.getSourceCode();
|
|
1219
|
+
const services = sourceCode.parserServices;
|
|
1220
|
+
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
1221
|
+
|
|
1222
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
1223
|
+
|
|
1224
|
+
return services.defineTemplateBodyVisitor({
|
|
1225
|
+
VElement(node) {
|
|
1226
|
+
const name = toPascalTag(node.rawName);
|
|
1227
|
+
if (!INVERTED_REVERSE_COMPONENTS.has(name) || allowComps.has(name)) {
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
// Stay honest against the installed manifest: if this build of the
|
|
1231
|
+
// library no longer declares `reverse` on the component, the rule has
|
|
1232
|
+
// nothing to say and `no-unknown-attributes` owns the diagnostic.
|
|
1233
|
+
const surface = manifest.get(name);
|
|
1234
|
+
if (!surface) return;
|
|
1235
|
+
const checker = createComponentChecker(surface);
|
|
1236
|
+
if (!checker.isKnownProp('reverse')) return;
|
|
1237
|
+
|
|
1238
|
+
for (const attr of node.startTag.attributes) {
|
|
1239
|
+
// `reverse="false"` — a plain attribute, so the value is the STRING
|
|
1240
|
+
// "false", which Vue leaves truthy. Reads as off, behaves as on.
|
|
1241
|
+
if (!attr.directive) {
|
|
1242
|
+
const attrName = attr.key.rawName ?? attr.key.name;
|
|
1243
|
+
if (toCamel(attrName) !== 'reverse') continue;
|
|
1244
|
+
if (attr.value?.value !== 'false') continue;
|
|
1245
|
+
context.report({
|
|
1246
|
+
node: attr,
|
|
1247
|
+
messageId: 'reverseStringFalse',
|
|
1248
|
+
data: { component: name },
|
|
1249
|
+
suggest: [
|
|
1250
|
+
{
|
|
1251
|
+
desc: 'Use bare `reverse` (same result, says what it does)',
|
|
1252
|
+
fix: (fixer) => fixer.replaceText(attr, 'reverse'),
|
|
1253
|
+
},
|
|
1254
|
+
{
|
|
1255
|
+
desc: 'Remove it (control on the left, the v3 default)',
|
|
1256
|
+
fix: (fixer) => fixer.remove(attr),
|
|
1257
|
+
},
|
|
1258
|
+
],
|
|
1259
|
+
});
|
|
1260
|
+
continue;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
if (attr.key.name.name !== 'bind') continue;
|
|
1264
|
+
const arg = attr.key.argument;
|
|
1265
|
+
// `v-bind="obj"` and `:[expr]` are unbounded — nothing to assert.
|
|
1266
|
+
if (!arg || arg.type !== 'VIdentifier') continue;
|
|
1267
|
+
if (toCamel(arg.rawName ?? arg.name) !== 'reverse') continue;
|
|
1268
|
+
const expr =
|
|
1269
|
+
attr.value?.type === 'VExpressionContainer'
|
|
1270
|
+
? attr.value.expression
|
|
1271
|
+
: null;
|
|
1272
|
+
// ONLY a literal `false`. A dynamic `:reverse="isRtl"` that happens
|
|
1273
|
+
// to evaluate false is legitimate v3 code, and the template AST is
|
|
1274
|
+
// the one place that distinction survives — which is exactly why
|
|
1275
|
+
// this is a lint rule and not a runtime warning.
|
|
1276
|
+
if (!expr || expr.type !== 'Literal' || expr.value !== false) {
|
|
1277
|
+
continue;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
const toBare = (fixer) => fixer.replaceText(attr, 'reverse');
|
|
1281
|
+
context.report({
|
|
1282
|
+
node: attr,
|
|
1283
|
+
messageId: 'reverseFalse',
|
|
1284
|
+
data: { component: name },
|
|
1285
|
+
...(options.assumeV2 ? { fix: toBare } : {}),
|
|
1286
|
+
suggest: [
|
|
1287
|
+
{
|
|
1288
|
+
desc: 'Control on the right (what this meant in v2): `reverse`',
|
|
1289
|
+
fix: toBare,
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
desc: 'Control on the left: remove the prop (it is the default)',
|
|
1293
|
+
fix: (fixer) => fixer.remove(attr),
|
|
1294
|
+
},
|
|
1295
|
+
],
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
},
|
|
1299
|
+
});
|
|
1300
|
+
},
|
|
1301
|
+
};
|
|
1302
|
+
|
|
1303
|
+
/*
|
|
1304
|
+
* `no-state-text-color` — a colour-shade text utility (`text-red-800`) in a
|
|
1305
|
+
* toggle glyph's STATE entry: `pt:icon:errors` / `warnings` / `disabled` on
|
|
1306
|
+
* BbCheckbox / BbRadio / BbSwitch and their groups, `pt:root:<state>` on
|
|
1307
|
+
* their standalone glyphs. The glyph paints those states from its own `--accent`, never from
|
|
1308
|
+
* `color`, so the class resolves, lands on the element, and paints nothing.
|
|
1309
|
+
* CSS cannot let an entry's colour win a state while a resting `pt:icon`
|
|
1310
|
+
* colour loses it — at cascade time both are just a `color` utility — so the
|
|
1311
|
+
* limitation is permanent and this rule states it where the class is written.
|
|
1312
|
+
*
|
|
1313
|
+
* Only `text-<name>-<shade>` (optionally `/opacity`, variants, `!`): `text-xs`,
|
|
1314
|
+
* `text-sm`, `text-left` are not colours and are never reported. Errors and
|
|
1315
|
+
* warnings get a suggestion — the same colour as the glyph's `--accent`, which
|
|
1316
|
+
* a state does read; disabled gets the explanation only (its plate is not
|
|
1317
|
+
* painted from `--accent` on every glyph).
|
|
1318
|
+
*/
|
|
1319
|
+
const STATE_TEXT_COLOR_TARGETS = new Map([
|
|
1320
|
+
['BbCheckbox', 'icon'],
|
|
1321
|
+
['BbRadio', 'icon'],
|
|
1322
|
+
['BbSwitch', 'icon'],
|
|
1323
|
+
['BbCheckboxGroup', 'icon'],
|
|
1324
|
+
['BbRadioGroup', 'icon'],
|
|
1325
|
+
['BbSwitchGroup', 'icon'],
|
|
1326
|
+
['BbBaseCheckboxIcon', 'root'],
|
|
1327
|
+
['BbBaseRadioIcon', 'root'],
|
|
1328
|
+
['BbBaseSwitchIcon', 'root'],
|
|
1329
|
+
]);
|
|
1330
|
+
const PAINTED_STATES = ['errors', 'warnings', 'disabled'];
|
|
1331
|
+
const TEXT_SHADE =
|
|
1332
|
+
/^(!?)((?:[^\s:[\]]+:|\[[^\]]*\]:)*)(!?)text-([a-z]+)-(\d{1,3})(\/\d{1,3})?(!?)$/;
|
|
1333
|
+
|
|
1334
|
+
/** Every colour-shade text utility in a class string, with its rewrite. */
|
|
1335
|
+
function stateTextColors(classes) {
|
|
1336
|
+
const hits = [];
|
|
1337
|
+
for (const token of classes.split(/\s+/)) {
|
|
1338
|
+
const m = TEXT_SHADE.exec(token);
|
|
1339
|
+
if (!m) continue;
|
|
1340
|
+
const [, lead, variants, midBang, name, shade, opacity, tail] = m;
|
|
1341
|
+
const bang = lead || midBang || tail ? '!' : '';
|
|
1342
|
+
hits.push({
|
|
1343
|
+
token,
|
|
1344
|
+
accent: opacity
|
|
1345
|
+
? null
|
|
1346
|
+
: `${variants}[--accent:var(--color-${name}-${shade})]${bang}`,
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
return hits;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
/** @type {import('eslint').Rule.RuleModule} */
|
|
1353
|
+
const noStateTextColor = {
|
|
1354
|
+
meta: {
|
|
1355
|
+
type: 'problem',
|
|
1356
|
+
hasSuggestions: true,
|
|
1357
|
+
docs: {
|
|
1358
|
+
description:
|
|
1359
|
+
"Flag a colour-shade `text-*` utility in `pt:icon:errors|warnings|disabled` on BbCheckbox/BbRadio/BbSwitch (or `pt:root:<state>` on their glyphs). Those states paint from the glyph's own `--accent`, never from `color`, so the class paints nothing.",
|
|
1360
|
+
recommended: true,
|
|
1361
|
+
},
|
|
1362
|
+
schema: [
|
|
1363
|
+
{
|
|
1364
|
+
type: 'object',
|
|
1365
|
+
properties: {
|
|
1366
|
+
manifestPath: { type: 'string' },
|
|
1367
|
+
failClosed: { type: 'boolean' },
|
|
1368
|
+
allowComponents: { type: 'array', items: { type: 'string' } },
|
|
1369
|
+
},
|
|
1370
|
+
additionalProperties: false,
|
|
1371
|
+
},
|
|
1372
|
+
],
|
|
1373
|
+
messages: {
|
|
1374
|
+
stateTextColor:
|
|
1375
|
+
"`{{token}}` in `{{key}}` on {{component}} paints nothing: the {{state}} state keeps its own colour against any text colour (a CSS limitation — a state entry's `color` and the resting one cannot be told apart). Recolour the state through the glyph's accent instead: `{{accent}}`.",
|
|
1376
|
+
disabledTextColor:
|
|
1377
|
+
'`{{token}}` in `{{key}}` on {{component}} paints nothing: the disabled state keeps its own colour against any text colour (a CSS limitation). Style the disabled glyph with a fill or border utility (`bg-*`, `border-*`) instead.',
|
|
1378
|
+
opacityTextColor:
|
|
1379
|
+
"`{{token}}` in `{{key}}` on {{component}} paints nothing: the {{state}} state keeps its own colour against any text colour (a CSS limitation). Recolour the state through the glyph's accent instead, e.g. `[--accent:…]`.",
|
|
1380
|
+
},
|
|
1381
|
+
},
|
|
1382
|
+
|
|
1383
|
+
create(context) {
|
|
1384
|
+
const options = context.options[0] ?? {};
|
|
1385
|
+
const manifest = getManifest(options.manifestPath, options);
|
|
1386
|
+
const sourceCode = context.sourceCode ?? context.getSourceCode();
|
|
1387
|
+
const services = sourceCode.parserServices;
|
|
1388
|
+
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
1389
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
1390
|
+
|
|
1391
|
+
/** `pt:<part>:<state>` → the painted state, or null. */
|
|
1392
|
+
const stateOf = (key, part) => {
|
|
1393
|
+
const m = /^pt:([a-z]+):([a-z-]+)$/.exec(key);
|
|
1394
|
+
return m && m[1] === part && PAINTED_STATES.includes(m[2]) ? m[2] : null;
|
|
1395
|
+
};
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* Report every hit in one class string. `node` is the string's own AST
|
|
1399
|
+
* node; `rewrite(newText)` returns the fixer for the whole string.
|
|
1400
|
+
*/
|
|
1401
|
+
const reportClasses = (node, classes, ctx, rewrite) => {
|
|
1402
|
+
for (const hit of stateTextColors(classes)) {
|
|
1403
|
+
const data = { ...ctx, token: hit.token, accent: hit.accent ?? '' };
|
|
1404
|
+
if (ctx.state === 'disabled') {
|
|
1405
|
+
context.report({ node, messageId: 'disabledTextColor', data });
|
|
1406
|
+
continue;
|
|
1407
|
+
}
|
|
1408
|
+
if (!hit.accent) {
|
|
1409
|
+
context.report({ node, messageId: 'opacityTextColor', data });
|
|
1410
|
+
continue;
|
|
1411
|
+
}
|
|
1412
|
+
const replaced = classes
|
|
1413
|
+
.split(/(\s+)/)
|
|
1414
|
+
.map((t) => (t === hit.token ? hit.accent : t))
|
|
1415
|
+
.join('');
|
|
1416
|
+
context.report({
|
|
1417
|
+
node,
|
|
1418
|
+
messageId: 'stateTextColor',
|
|
1419
|
+
data,
|
|
1420
|
+
suggest: [
|
|
1421
|
+
{
|
|
1422
|
+
desc: `Use \`${hit.accent}\` (the glyph's accent, which the ${ctx.state} state reads)`,
|
|
1423
|
+
fix: rewrite(replaced),
|
|
1424
|
+
},
|
|
1425
|
+
],
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
};
|
|
1429
|
+
|
|
1430
|
+
/** A JS string node → its text, or null when it is not a literal. */
|
|
1431
|
+
const literalText = (expr) => {
|
|
1432
|
+
if (!expr) return null;
|
|
1433
|
+
if (expr.type === 'Literal' && typeof expr.value === 'string')
|
|
1434
|
+
return expr.value;
|
|
1435
|
+
if (expr.type === 'TemplateLiteral' && expr.expressions.length === 0)
|
|
1436
|
+
return expr.quasis[0].value.cooked;
|
|
1437
|
+
return null;
|
|
1438
|
+
};
|
|
1439
|
+
const rewriteJs = (expr) => (text) => (fixer) => {
|
|
1440
|
+
const quote =
|
|
1441
|
+
expr.type === 'TemplateLiteral' ? '`' : sourceCode.getText(expr)[0];
|
|
1442
|
+
return fixer.replaceText(expr, `${quote}${text}${quote}`);
|
|
1443
|
+
};
|
|
1444
|
+
|
|
1445
|
+
/** A pt VALUE expression: a class string, or `{ class: '…' }`. */
|
|
1446
|
+
const checkValueExpr = (expr, ctx) => {
|
|
1447
|
+
const text = literalText(expr);
|
|
1448
|
+
if (text !== null) return reportClasses(expr, text, ctx, rewriteJs(expr));
|
|
1449
|
+
if (expr?.type !== 'ObjectExpression') return;
|
|
1450
|
+
for (const prop of expr.properties) {
|
|
1451
|
+
if (prop.type !== 'Property' || prop.computed) continue;
|
|
1452
|
+
const name =
|
|
1453
|
+
prop.key.type === 'Identifier' ? prop.key.name : prop.key.value;
|
|
1454
|
+
if (name !== 'class') continue;
|
|
1455
|
+
const cls = literalText(prop.value);
|
|
1456
|
+
if (cls !== null)
|
|
1457
|
+
reportClasses(prop.value, cls, ctx, rewriteJs(prop.value));
|
|
1458
|
+
}
|
|
1459
|
+
};
|
|
1460
|
+
|
|
1461
|
+
return services.defineTemplateBodyVisitor({
|
|
1462
|
+
VElement(node) {
|
|
1463
|
+
const component = toPascalTag(node.rawName);
|
|
1464
|
+
const part = STATE_TEXT_COLOR_TARGETS.get(component);
|
|
1465
|
+
if (!part || allowComps.has(component)) return;
|
|
1466
|
+
if (!manifest.get(component)) return;
|
|
1467
|
+
|
|
1468
|
+
for (const attr of node.startTag.attributes) {
|
|
1469
|
+
// pt:icon:errors="text-red-800"
|
|
1470
|
+
if (!attr.directive) {
|
|
1471
|
+
const key = attr.key.rawName ?? attr.key.name;
|
|
1472
|
+
const state = stateOf(key, part);
|
|
1473
|
+
if (!state || !attr.value) continue;
|
|
1474
|
+
const valueNode = attr.value;
|
|
1475
|
+
reportClasses(
|
|
1476
|
+
valueNode,
|
|
1477
|
+
valueNode.value,
|
|
1478
|
+
{ key, component, state },
|
|
1479
|
+
(text) => (fixer) => {
|
|
1480
|
+
const raw = sourceCode.getText(valueNode);
|
|
1481
|
+
const quote = raw[0] === "'" || raw[0] === '"' ? raw[0] : '"';
|
|
1482
|
+
return fixer.replaceText(valueNode, `${quote}${text}${quote}`);
|
|
1483
|
+
}
|
|
1484
|
+
);
|
|
1485
|
+
continue;
|
|
1486
|
+
}
|
|
1487
|
+
if (attr.key.name.name !== 'bind') continue;
|
|
1488
|
+
const arg = attr.key.argument;
|
|
1489
|
+
if (!arg || arg.type !== 'VIdentifier') continue;
|
|
1490
|
+
const expr =
|
|
1491
|
+
attr.value?.type === 'VExpressionContainer'
|
|
1492
|
+
? attr.value.expression
|
|
1493
|
+
: null;
|
|
1494
|
+
const argName = arg.rawName ?? arg.name;
|
|
1495
|
+
// :pt:icon:errors="'text-red-800'" / "{ class: '…' }"
|
|
1496
|
+
const state = stateOf(argName, part);
|
|
1497
|
+
if (state) {
|
|
1498
|
+
checkValueExpr(expr, { key: argName, component, state });
|
|
1499
|
+
continue;
|
|
1500
|
+
}
|
|
1501
|
+
// :pt="{ 'icon:errors': '…' }"
|
|
1502
|
+
if (argName !== 'pt' || expr?.type !== 'ObjectExpression') continue;
|
|
1503
|
+
for (const prop of expr.properties) {
|
|
1504
|
+
if (prop.type !== 'Property' || prop.computed) continue;
|
|
1505
|
+
const name =
|
|
1506
|
+
prop.key.type === 'Identifier' ? prop.key.name : prop.key.value;
|
|
1507
|
+
if (typeof name !== 'string') continue;
|
|
1508
|
+
const keyState = stateOf(`pt:${name}`, part);
|
|
1509
|
+
if (keyState)
|
|
1510
|
+
checkValueExpr(prop.value, {
|
|
1511
|
+
key: `pt.${name}`,
|
|
1512
|
+
component,
|
|
1513
|
+
state: keyState,
|
|
1514
|
+
});
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1518
|
+
});
|
|
1519
|
+
},
|
|
1520
|
+
};
|
|
1521
|
+
|
|
1522
|
+
/*
|
|
1523
|
+
* `no-star-color` — a colour utility in BbRating's `pt:item`, base or any
|
|
1524
|
+
* state. The rating paints every star's colour itself, per state: filled
|
|
1525
|
+
* stars, the stars a hover previews, the empty ones after the pointer, the
|
|
1526
|
+
* error / warning / disabled tints. It does that by setting each star's
|
|
1527
|
+
* `color` from `--accent` / `--empty` (and the outline from `--border-color`).
|
|
1528
|
+
* A colour utility on the star beats those rules in the layered build, so it
|
|
1529
|
+
* looks right at rest and freezes the stars: no hover preview, no error tint,
|
|
1530
|
+
* no warning. The guide's own example shipped this (2026-09-23), which is why
|
|
1531
|
+
* it is a rule and not only a paragraph.
|
|
1532
|
+
*
|
|
1533
|
+
* Wider than `no-state-text-color`: every state, the BASE entry too, and every
|
|
1534
|
+
* colour spelling — shade (`text-amber-500`), keyword (`text-white`,
|
|
1535
|
+
* `fill-current`), a variable (`text-(--bb-text-faint)`) and an arbitrary
|
|
1536
|
+
* colour (`text-[#f59e0b]`) — on `text-*`, `fill-*` and `stroke-*`. Sizes,
|
|
1537
|
+
* widths and weights (`text-sm`, `stroke-2`, `stroke-[1.5]`) never match.
|
|
1538
|
+
* No suggestion: the fix moves to ANOTHER attribute (`pt:root`), which a
|
|
1539
|
+
* one-string rewrite cannot express.
|
|
1540
|
+
*/
|
|
1541
|
+
const STAR_COLOR_COMPONENTS = new Set(['BbRating']);
|
|
1542
|
+
const STAR_COLOR_VARIANTS = String.raw`(?:[^\s:[\]()]+:|\[[^\]]*\]:)*`;
|
|
1543
|
+
const STAR_COLOR_TOKEN = new RegExp(
|
|
1544
|
+
'^!?' +
|
|
1545
|
+
STAR_COLOR_VARIANTS +
|
|
1546
|
+
'!?(?:text|fill|stroke)-' +
|
|
1547
|
+
'(?:' +
|
|
1548
|
+
String.raw`[a-z]+-\d{1,3}(?:\/\d{1,3})?` + // text-amber-500(/50)
|
|
1549
|
+
'|(?:black|white|current|inherit|transparent)' + // keywords
|
|
1550
|
+
String.raw`|\((?!length:)(?:color:)?--[^)]+\)` + // text-(--x)
|
|
1551
|
+
String.raw`|\[(?:color:)?(?:#|rgb|hsl|oklch|oklab|lab|lch|color\(|var\()[^\]]*\]` + // text-[#…]
|
|
1552
|
+
')' +
|
|
1553
|
+
String.raw`(?:\/\d{1,3})?!?$`
|
|
1554
|
+
);
|
|
1555
|
+
|
|
1556
|
+
/** Every colour utility in a class string. */
|
|
1557
|
+
const starColors = (classes) =>
|
|
1558
|
+
classes.split(/\s+/).filter((token) => STAR_COLOR_TOKEN.test(token));
|
|
1559
|
+
|
|
1560
|
+
/** @type {import('eslint').Rule.RuleModule} */
|
|
1561
|
+
const noStarColor = {
|
|
1562
|
+
meta: {
|
|
1563
|
+
type: 'problem',
|
|
1564
|
+
docs: {
|
|
1565
|
+
description:
|
|
1566
|
+
"Flag a colour utility (`text-*`, `fill-*`, `stroke-*`) in BbRating's `pt:item`, any state. The rating paints each star's colour per state, so the class freezes the hover preview and the error tint. Set `--accent` / `--empty` / `--border-color` on the root instead.",
|
|
1567
|
+
recommended: true,
|
|
1568
|
+
},
|
|
1569
|
+
schema: [
|
|
1570
|
+
{
|
|
1571
|
+
type: 'object',
|
|
1572
|
+
properties: {
|
|
1573
|
+
manifestPath: { type: 'string' },
|
|
1574
|
+
failClosed: { type: 'boolean' },
|
|
1575
|
+
allowComponents: { type: 'array', items: { type: 'string' } },
|
|
1576
|
+
},
|
|
1577
|
+
additionalProperties: false,
|
|
1578
|
+
},
|
|
1579
|
+
],
|
|
1580
|
+
messages: {
|
|
1581
|
+
starColor:
|
|
1582
|
+
'`{{token}}` in `{{key}}` on {{component}} freezes the stars: the rating paints each star\'s colour per state (filled, the hover preview, errors), and a colour utility beats those rules, so hovering stops previewing and an invalid rating keeps your colour. Set the colour as a variable on the root instead: `pt:root="[--accent:…]"` (filled stars and the preview), `[--empty:…]` (unfilled), `[--border-color:…]` (the outline).',
|
|
1583
|
+
},
|
|
1584
|
+
},
|
|
1585
|
+
|
|
1586
|
+
create(context) {
|
|
1587
|
+
const options = context.options[0] ?? {};
|
|
1588
|
+
const manifest = getManifest(options.manifestPath, options);
|
|
1589
|
+
const sourceCode = context.sourceCode ?? context.getSourceCode();
|
|
1590
|
+
const services = sourceCode.parserServices;
|
|
1591
|
+
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
1592
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
1593
|
+
|
|
1594
|
+
/** `pt:item` or `pt:item:<state>`. */
|
|
1595
|
+
const isItemKey = (key) => /^pt:item(?::[a-zA-Z-]+)?$/.test(key);
|
|
1596
|
+
|
|
1597
|
+
const report = (node, classes, key, component) => {
|
|
1598
|
+
for (const token of starColors(classes))
|
|
1599
|
+
context.report({
|
|
1600
|
+
node,
|
|
1601
|
+
messageId: 'starColor',
|
|
1602
|
+
data: { token, key, component },
|
|
1603
|
+
});
|
|
1604
|
+
};
|
|
1605
|
+
|
|
1606
|
+
const literalText = (expr) => {
|
|
1607
|
+
if (!expr) return null;
|
|
1608
|
+
if (expr.type === 'Literal' && typeof expr.value === 'string')
|
|
1609
|
+
return expr.value;
|
|
1610
|
+
if (expr.type === 'TemplateLiteral' && expr.expressions.length === 0)
|
|
1611
|
+
return expr.quasis[0].value.cooked;
|
|
1612
|
+
return null;
|
|
1613
|
+
};
|
|
1614
|
+
|
|
1615
|
+
/** A pt VALUE expression: a class string, or `{ class: '…' }`. */
|
|
1616
|
+
const checkValueExpr = (expr, key, component) => {
|
|
1617
|
+
const text = literalText(expr);
|
|
1618
|
+
if (text !== null) return report(expr, text, key, component);
|
|
1619
|
+
if (expr?.type !== 'ObjectExpression') return;
|
|
1620
|
+
for (const prop of expr.properties) {
|
|
1621
|
+
if (prop.type !== 'Property' || prop.computed) continue;
|
|
1622
|
+
const name =
|
|
1623
|
+
prop.key.type === 'Identifier' ? prop.key.name : prop.key.value;
|
|
1624
|
+
if (name !== 'class') continue;
|
|
1625
|
+
const cls = literalText(prop.value);
|
|
1626
|
+
if (cls !== null) report(prop.value, cls, key, component);
|
|
1627
|
+
}
|
|
1628
|
+
};
|
|
1629
|
+
|
|
1630
|
+
return services.defineTemplateBodyVisitor({
|
|
1631
|
+
VElement(node) {
|
|
1632
|
+
const component = toPascalTag(node.rawName);
|
|
1633
|
+
if (!STAR_COLOR_COMPONENTS.has(component) || allowComps.has(component))
|
|
1634
|
+
return;
|
|
1635
|
+
if (!manifest.get(component)) return;
|
|
1636
|
+
|
|
1637
|
+
for (const attr of node.startTag.attributes) {
|
|
1638
|
+
// pt:item="text-amber-500"
|
|
1639
|
+
if (!attr.directive) {
|
|
1640
|
+
const key = attr.key.rawName ?? attr.key.name;
|
|
1641
|
+
if (isItemKey(key) && attr.value)
|
|
1642
|
+
report(attr.value, attr.value.value, key, component);
|
|
1643
|
+
continue;
|
|
1644
|
+
}
|
|
1645
|
+
if (attr.key.name.name !== 'bind') continue;
|
|
1646
|
+
const arg = attr.key.argument;
|
|
1647
|
+
if (!arg || arg.type !== 'VIdentifier') continue;
|
|
1648
|
+
const expr =
|
|
1649
|
+
attr.value?.type === 'VExpressionContainer'
|
|
1650
|
+
? attr.value.expression
|
|
1651
|
+
: null;
|
|
1652
|
+
const argName = arg.rawName ?? arg.name;
|
|
1653
|
+
// :pt:item="'text-amber-500'" / "{ class: '…' }"
|
|
1654
|
+
if (isItemKey(argName)) {
|
|
1655
|
+
checkValueExpr(expr, argName, component);
|
|
1656
|
+
continue;
|
|
1657
|
+
}
|
|
1658
|
+
// :pt="{ item: '…', 'item:selected': '…' }"
|
|
1659
|
+
if (argName !== 'pt' || expr?.type !== 'ObjectExpression') continue;
|
|
1660
|
+
for (const prop of expr.properties) {
|
|
1661
|
+
if (prop.type !== 'Property' || prop.computed) continue;
|
|
1662
|
+
const name =
|
|
1663
|
+
prop.key.type === 'Identifier' ? prop.key.name : prop.key.value;
|
|
1664
|
+
if (typeof name === 'string' && isItemKey(`pt:${name}`))
|
|
1665
|
+
checkValueExpr(prop.value, `pt.${name}`, component);
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
},
|
|
1669
|
+
});
|
|
1670
|
+
},
|
|
1671
|
+
};
|
|
1672
|
+
|
|
1673
|
+
/*
|
|
1674
|
+
* `no-box-border-color` — a colour-shade border utility (`border-green-500`) in
|
|
1675
|
+
* the BASE `pt:box` entry of a text-like control. The box paints its resting
|
|
1676
|
+
* border from `--border-color` and its errors / warnings frame over it, but a
|
|
1677
|
+
* border utility sets `border-color` itself, so a resting one wins over the
|
|
1678
|
+
* frame and an invalid field keeps looking valid (owner, 2026-09-15). The fix
|
|
1679
|
+
* is the token, which the frame outranks: `[--border-color:var(--color-green-500)]`.
|
|
1680
|
+
*
|
|
1681
|
+
* Only the base entry. A state entry (`pt:box:errors="border-red-800"`) IS
|
|
1682
|
+
* that state and paints plainly — never reported. Only
|
|
1683
|
+
* `border-<name>-<shade>` (optionally with variants and `!`): widths
|
|
1684
|
+
* (`border-2`), sides (`border-t-4`) and non-colours are not reported; an
|
|
1685
|
+
* opacity modifier is explained without a mechanical rewrite.
|
|
1686
|
+
*/
|
|
1687
|
+
const BOX_BORDER_TARGETS = new Set([
|
|
1688
|
+
'BbTextInput',
|
|
1689
|
+
'BbTextarea',
|
|
1690
|
+
'BbNumberInput',
|
|
1691
|
+
'BbSelect',
|
|
1692
|
+
'BbTag',
|
|
1693
|
+
'BbColorInput',
|
|
1694
|
+
'BbDatePickerInput',
|
|
1695
|
+
'BbTimePickerInput',
|
|
1696
|
+
]);
|
|
1697
|
+
const BORDER_SHADE =
|
|
1698
|
+
/^(!?)((?:[^\s:[\]]+:|\[[^\]]*\]:)*)(!?)border-([a-z]{3,})-(\d{1,3})(\/\d{1,3})?(!?)$/;
|
|
1699
|
+
|
|
1700
|
+
/** Every colour-shade border utility in a class string, with its rewrite. */
|
|
1701
|
+
function boxBorderColors(classes) {
|
|
1702
|
+
const hits = [];
|
|
1703
|
+
for (const token of classes.split(/\s+/)) {
|
|
1704
|
+
const m = BORDER_SHADE.exec(token);
|
|
1705
|
+
if (!m) continue;
|
|
1706
|
+
const [, lead, variants, midBang, name, shade, opacity, tail] = m;
|
|
1707
|
+
const bang = lead || midBang || tail ? '!' : '';
|
|
1708
|
+
hits.push({
|
|
1709
|
+
token,
|
|
1710
|
+
fix: opacity
|
|
1711
|
+
? null
|
|
1712
|
+
: `${variants}[--border-color:var(--color-${name}-${shade})]${bang}`,
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
return hits;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
/** @type {import('eslint').Rule.RuleModule} */
|
|
1719
|
+
const noBoxBorderColor = {
|
|
1720
|
+
meta: {
|
|
1721
|
+
type: 'problem',
|
|
1722
|
+
hasSuggestions: true,
|
|
1723
|
+
docs: {
|
|
1724
|
+
description:
|
|
1725
|
+
'Flag a colour-shade `border-*` utility in the base `pt:box` of a text-like control: it hides the errors / warnings frame. Set the resting border through `[--border-color:…]`, which the frame outranks.',
|
|
1726
|
+
recommended: true,
|
|
1727
|
+
},
|
|
1728
|
+
schema: [
|
|
1729
|
+
{
|
|
1730
|
+
type: 'object',
|
|
1731
|
+
properties: {
|
|
1732
|
+
manifestPath: { type: 'string' },
|
|
1733
|
+
failClosed: { type: 'boolean' },
|
|
1734
|
+
allowComponents: { type: 'array', items: { type: 'string' } },
|
|
1735
|
+
},
|
|
1736
|
+
additionalProperties: false,
|
|
1737
|
+
},
|
|
1738
|
+
],
|
|
1739
|
+
messages: {
|
|
1740
|
+
boxBorderColor:
|
|
1741
|
+
'`{{token}}` in `{{key}}` on {{component}} hides the errors / warnings frame: a border utility beats the state colour. Set the resting border through the box token instead, which errors and warnings outrank: `{{fix}}`. (A state entry — `pt:box:errors="border-red-800"` — is fine as it is.)',
|
|
1742
|
+
opacityBoxBorderColor:
|
|
1743
|
+
'`{{token}}` in `{{key}}` on {{component}} hides the errors / warnings frame: a border utility beats the state colour. Set the resting border through the box token instead, e.g. `[--border-color:…]`.',
|
|
1744
|
+
},
|
|
1745
|
+
},
|
|
1746
|
+
|
|
1747
|
+
create(context) {
|
|
1748
|
+
const options = context.options[0] ?? {};
|
|
1749
|
+
const manifest = getManifest(options.manifestPath, options);
|
|
1750
|
+
const sourceCode = context.sourceCode ?? context.getSourceCode();
|
|
1751
|
+
const services = sourceCode.parserServices;
|
|
1752
|
+
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
1753
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
1754
|
+
|
|
1755
|
+
const reportClasses = (node, classes, ctx, rewrite) => {
|
|
1756
|
+
for (const hit of boxBorderColors(classes)) {
|
|
1757
|
+
const data = { ...ctx, token: hit.token, fix: hit.fix ?? '' };
|
|
1758
|
+
if (!hit.fix) {
|
|
1759
|
+
context.report({ node, messageId: 'opacityBoxBorderColor', data });
|
|
1760
|
+
continue;
|
|
1761
|
+
}
|
|
1762
|
+
const replaced = classes
|
|
1763
|
+
.split(/(\s+)/)
|
|
1764
|
+
.map((t) => (t === hit.token ? hit.fix : t))
|
|
1765
|
+
.join('');
|
|
1766
|
+
context.report({
|
|
1767
|
+
node,
|
|
1768
|
+
messageId: 'boxBorderColor',
|
|
1769
|
+
data,
|
|
1770
|
+
suggest: [
|
|
1771
|
+
{
|
|
1772
|
+
desc: `Use \`${hit.fix}\` (the resting border, which errors and warnings outrank)`,
|
|
1773
|
+
fix: rewrite(replaced),
|
|
1774
|
+
},
|
|
1775
|
+
],
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
};
|
|
1779
|
+
|
|
1780
|
+
const literalText = (expr) => {
|
|
1781
|
+
if (!expr) return null;
|
|
1782
|
+
if (expr.type === 'Literal' && typeof expr.value === 'string')
|
|
1783
|
+
return expr.value;
|
|
1784
|
+
if (expr.type === 'TemplateLiteral' && expr.expressions.length === 0)
|
|
1785
|
+
return expr.quasis[0].value.cooked;
|
|
1786
|
+
return null;
|
|
1787
|
+
};
|
|
1788
|
+
const rewriteJs = (expr) => (text) => (fixer) => {
|
|
1789
|
+
const quote =
|
|
1790
|
+
expr.type === 'TemplateLiteral' ? '`' : sourceCode.getText(expr)[0];
|
|
1791
|
+
return fixer.replaceText(expr, `${quote}${text}${quote}`);
|
|
1792
|
+
};
|
|
1793
|
+
const checkValueExpr = (expr, ctx) => {
|
|
1794
|
+
const text = literalText(expr);
|
|
1795
|
+
if (text !== null) return reportClasses(expr, text, ctx, rewriteJs(expr));
|
|
1796
|
+
if (expr?.type !== 'ObjectExpression') return;
|
|
1797
|
+
for (const prop of expr.properties) {
|
|
1798
|
+
if (prop.type !== 'Property' || prop.computed) continue;
|
|
1799
|
+
const name =
|
|
1800
|
+
prop.key.type === 'Identifier' ? prop.key.name : prop.key.value;
|
|
1801
|
+
if (name !== 'class') continue;
|
|
1802
|
+
const cls = literalText(prop.value);
|
|
1803
|
+
if (cls !== null)
|
|
1804
|
+
reportClasses(prop.value, cls, ctx, rewriteJs(prop.value));
|
|
1805
|
+
}
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
return services.defineTemplateBodyVisitor({
|
|
1809
|
+
VElement(node) {
|
|
1810
|
+
const component = toPascalTag(node.rawName);
|
|
1811
|
+
if (!BOX_BORDER_TARGETS.has(component) || allowComps.has(component))
|
|
1812
|
+
return;
|
|
1813
|
+
if (!manifest.get(component)) return;
|
|
1814
|
+
|
|
1815
|
+
for (const attr of node.startTag.attributes) {
|
|
1816
|
+
// pt:box="border-green-500"
|
|
1817
|
+
if (!attr.directive) {
|
|
1818
|
+
const key = attr.key.rawName ?? attr.key.name;
|
|
1819
|
+
if (key !== 'pt:box' || !attr.value) continue;
|
|
1820
|
+
const valueNode = attr.value;
|
|
1821
|
+
reportClasses(
|
|
1822
|
+
valueNode,
|
|
1823
|
+
valueNode.value,
|
|
1824
|
+
{ key, component },
|
|
1825
|
+
(text) => (fixer) => {
|
|
1826
|
+
const raw = sourceCode.getText(valueNode);
|
|
1827
|
+
const quote = raw[0] === "'" || raw[0] === '"' ? raw[0] : '"';
|
|
1828
|
+
return fixer.replaceText(valueNode, `${quote}${text}${quote}`);
|
|
1829
|
+
}
|
|
1830
|
+
);
|
|
1831
|
+
continue;
|
|
1832
|
+
}
|
|
1833
|
+
if (attr.key.name.name !== 'bind') continue;
|
|
1834
|
+
const arg = attr.key.argument;
|
|
1835
|
+
if (!arg || arg.type !== 'VIdentifier') continue;
|
|
1836
|
+
const expr =
|
|
1837
|
+
attr.value?.type === 'VExpressionContainer'
|
|
1838
|
+
? attr.value.expression
|
|
1839
|
+
: null;
|
|
1840
|
+
const argName = arg.rawName ?? arg.name;
|
|
1841
|
+
// :pt:box="'border-green-500'" / "{ class: '…' }"
|
|
1842
|
+
if (argName === 'pt:box') {
|
|
1843
|
+
checkValueExpr(expr, { key: argName, component });
|
|
1844
|
+
continue;
|
|
1845
|
+
}
|
|
1846
|
+
// :pt="{ box: '…' }"
|
|
1847
|
+
if (argName !== 'pt' || expr?.type !== 'ObjectExpression') continue;
|
|
1848
|
+
for (const prop of expr.properties) {
|
|
1849
|
+
if (prop.type !== 'Property' || prop.computed) continue;
|
|
1850
|
+
const name =
|
|
1851
|
+
prop.key.type === 'Identifier' ? prop.key.name : prop.key.value;
|
|
1852
|
+
if (name === 'box')
|
|
1853
|
+
checkValueExpr(prop.value, { key: 'pt.box', component });
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
},
|
|
1857
|
+
});
|
|
1858
|
+
},
|
|
1859
|
+
};
|
|
1860
|
+
|
|
1861
|
+
/*
|
|
1862
|
+
* Every `--bb-*` the installed package declares, keyed by resolved stylesheet
|
|
1863
|
+
* path. Same caching shape as `manifestCache`, including the miss: an absent
|
|
1864
|
+
* stylesheet caches an EMPTY set, and the rule reads that as "say nothing".
|
|
1865
|
+
*
|
|
1866
|
+
* No warning on a miss, unlike the manifest. `dist/styles.css` is a BUILD
|
|
1867
|
+
* artifact, absent in a source checkout that has not run `vite build`, so a
|
|
1868
|
+
* console warning here would fire constantly in this repo's own dev loop.
|
|
1869
|
+
* A missing manifest means every rule is silently inactive, which is worth
|
|
1870
|
+
* shouting about; a missing stylesheet disarms exactly one advisory rule.
|
|
1871
|
+
*/
|
|
1872
|
+
const tokenCache = new Map();
|
|
1873
|
+
function getKnownTokens(stylesPath) {
|
|
1874
|
+
const resolved = stylesPath ?? join(HERE, '..', '..', 'dist', 'styles.css');
|
|
1875
|
+
if (!tokenCache.has(resolved))
|
|
1876
|
+
tokenCache.set(resolved, loadKnownTokens(resolved));
|
|
1877
|
+
return tokenCache.get(resolved);
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
/**
|
|
1881
|
+
* A bare `var(--bb-…)` in a `<style>` block naming a token the installed
|
|
1882
|
+
* package does not declare.
|
|
1883
|
+
*
|
|
1884
|
+
* WHY THIS ONE MOVED TO ESLINT AND ITS TWO SIBLINGS DID NOT. `bitboss-ui
|
|
1885
|
+
* check` has carried three advisory hints — this, plus the hand-rolled avatar
|
|
1886
|
+
* and spinner detectors. A consumer's migration report (2026-09-09) made the
|
|
1887
|
+
* structural point that `check` is what nobody runs, while ESLint runs in the
|
|
1888
|
+
* editor and in pre-commit, so a check-only warning does not really exist.
|
|
1889
|
+
*
|
|
1890
|
+
* Only this one crossed over, on the owner's ruling, because only this one is
|
|
1891
|
+
* a FACT rather than a guess. An undeclared custom property is
|
|
1892
|
+
* invalid-at-computed-value-time: CSS discards the WHOLE declaration, so the
|
|
1893
|
+
* rule silently does nothing — there is no reading of `var(--bb-canvas)`, with
|
|
1894
|
+
* no such token and no fallback, that is correct code. The avatar and spinner
|
|
1895
|
+
* detectors are guesses by design (a round `<img>` is sometimes a logo), and a
|
|
1896
|
+
* rule that fires on correct code spends the trust that makes every other rule
|
|
1897
|
+
* here worth reading. They stay in `check`, where they cannot fail a build.
|
|
1898
|
+
*
|
|
1899
|
+
* A FALLBACK DISARMS IT, exactly as in the CLI hint: `var(--bb-canvas, #f8fafc)`
|
|
1900
|
+
* is a deliberate override hook with defined behaviour and nothing silently
|
|
1901
|
+
* disappears. Shared with the CLI through `findTokenUses`, so the two can never
|
|
1902
|
+
* disagree about what counts as a use.
|
|
1903
|
+
*
|
|
1904
|
+
* Reported at `warn`, joining `no-unknown-event`: the token may be one the
|
|
1905
|
+
* consumer means to define in their own stylesheet, which this rule cannot see.
|
|
1906
|
+
* @type {import('eslint').Rule.RuleModule}
|
|
1907
|
+
*/
|
|
1908
|
+
const noUnknownToken = {
|
|
1909
|
+
meta: {
|
|
1910
|
+
type: 'problem',
|
|
1911
|
+
docs: {
|
|
1912
|
+
description:
|
|
1913
|
+
'Flag a bare `var(--bb-…)` naming a token bitboss-ui does not declare. CSS treats an undefined custom property as invalid-at-computed-value-time and throws away the entire declaration, so the rule silently does nothing rather than falling back — an invented token name is invisible at runtime and in review. Supplying a fallback (`var(--bb-x, #fff)`) is defined behaviour and never reported. Reads the token list from the installed `dist/styles.css`, so it can never claim a token is invented when your version declares it; with no stylesheet to read, the rule stays silent.',
|
|
1914
|
+
recommended: true,
|
|
1915
|
+
},
|
|
1916
|
+
schema: [
|
|
1917
|
+
{
|
|
1918
|
+
type: 'object',
|
|
1919
|
+
properties: {
|
|
1920
|
+
stylesPath: { type: 'string' },
|
|
1921
|
+
allowTokens: { type: 'array', items: { type: 'string' } },
|
|
1922
|
+
},
|
|
1923
|
+
additionalProperties: false,
|
|
1924
|
+
},
|
|
1925
|
+
],
|
|
1926
|
+
messages: {
|
|
1927
|
+
unknownToken:
|
|
1928
|
+
'`{{name}}` is not a bitboss-ui token. An undefined custom property invalidates the whole declaration, so this rule silently does nothing at runtime. Check the token list in the design-tokens guide, or supply a fallback (`var({{name}}, …)`) if you define it yourself.',
|
|
1929
|
+
},
|
|
1930
|
+
},
|
|
1931
|
+
|
|
1932
|
+
create(context) {
|
|
1933
|
+
const options = context.options[0] ?? {};
|
|
1934
|
+
const known = getKnownTokens(options.stylesPath);
|
|
1935
|
+
// No stylesheet to compare against — no data, no accusation.
|
|
1936
|
+
if (known.size === 0) return {};
|
|
1937
|
+
|
|
1938
|
+
const sourceCode = context.sourceCode ?? context.getSourceCode();
|
|
1939
|
+
const services = sourceCode.parserServices;
|
|
1940
|
+
if (!services?.getDocumentFragment) return {};
|
|
1941
|
+
const allowTokens = new Set(options.allowTokens ?? []);
|
|
1942
|
+
|
|
1943
|
+
/**
|
|
1944
|
+
* Report every unknown token in one chunk of CSS text. `offset` is that
|
|
1945
|
+
* chunk's own start in the FILE, so a match position inside it maps
|
|
1946
|
+
* straight onto a source location.
|
|
1947
|
+
*/
|
|
1948
|
+
const reportIn = (css, offset) => {
|
|
1949
|
+
for (const use of findTokenUses(css)) {
|
|
1950
|
+
if (known.has(use.name) || allowTokens.has(use.name)) continue;
|
|
1951
|
+
const start = offset + use.index;
|
|
1952
|
+
context.report({
|
|
1953
|
+
loc: {
|
|
1954
|
+
start: sourceCode.getLocFromIndex(start),
|
|
1955
|
+
// `var(` + the name, which is the part worth underlining.
|
|
1956
|
+
end: sourceCode.getLocFromIndex(start + use.name.length + 4),
|
|
1957
|
+
},
|
|
1958
|
+
messageId: 'unknownToken',
|
|
1959
|
+
data: { name: use.name },
|
|
1960
|
+
});
|
|
1961
|
+
}
|
|
1962
|
+
};
|
|
1963
|
+
|
|
1964
|
+
/*
|
|
1965
|
+
* The two places real CSS lives in an SFC: a `<style>` block, and a
|
|
1966
|
+
* static `style="…"` attribute. Both are scanned, because `check` reads
|
|
1967
|
+
* the whole file and a rule that saw only one of them would put the two
|
|
1968
|
+
* tools back into the disagreement this rule exists to end.
|
|
1969
|
+
*
|
|
1970
|
+
* A BOUND `:style` is deliberately NOT scanned: it is a JS expression,
|
|
1971
|
+
* the token name may be computed, and guessing at string literals inside
|
|
1972
|
+
* it is how a rule starts firing on correct code.
|
|
1973
|
+
*/
|
|
1974
|
+
const walk = (node) => {
|
|
1975
|
+
if (!node || node.type !== 'VElement') return;
|
|
1976
|
+
|
|
1977
|
+
if (node.rawName === 'style') {
|
|
1978
|
+
for (const text of node.children ?? [])
|
|
1979
|
+
if (text.type === 'VText' && typeof text.value === 'string')
|
|
1980
|
+
reportIn(text.value, text.range[0]);
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
for (const attr of node.startTag?.attributes ?? []) {
|
|
1984
|
+
if (attr.directive || attr.key?.name !== 'style') continue;
|
|
1985
|
+
const value = attr.value;
|
|
1986
|
+
if (!value || typeof value.value !== 'string') continue;
|
|
1987
|
+
// `range` spans the quotes; the value starts one character in.
|
|
1988
|
+
reportIn(value.value, value.range[0] + 1);
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
for (const child of node.children ?? []) walk(child);
|
|
1992
|
+
};
|
|
1993
|
+
|
|
1994
|
+
return {
|
|
1995
|
+
// The template-body visitors every sibling rule uses cannot see a
|
|
1996
|
+
// `<style>` block; the document fragment is the whole SFC.
|
|
1997
|
+
'Program:exit'() {
|
|
1998
|
+
const fragment = services.getDocumentFragment();
|
|
1999
|
+
if (!fragment) return;
|
|
2000
|
+
for (const child of fragment.children ?? []) walk(child);
|
|
2001
|
+
},
|
|
2002
|
+
};
|
|
2003
|
+
},
|
|
2004
|
+
};
|
|
2005
|
+
|
|
2006
|
+
// ESLint hashes `name@version` into its `--cache` key; a fixed version would
|
|
2007
|
+
// keep an upgraded project's cached verdicts from the previous manifest.
|
|
2008
|
+
const { version: PACKAGE_VERSION } = createRequire(import.meta.url)(
|
|
2009
|
+
'../../package.json'
|
|
2010
|
+
);
|
|
2011
|
+
|
|
2012
|
+
/**
|
|
2013
|
+
* Q52.3: an icon-only BbButton or BbBadge, or a BbProgress, with no accessible name. The
|
|
2014
|
+
* finding (and its wording) comes from `checkAccessibleName`, which
|
|
2015
|
+
* `bitboss-ui check` runs too.
|
|
2016
|
+
* @type {import('eslint').Rule.RuleModule}
|
|
2017
|
+
*/
|
|
2018
|
+
const requireAccessibleName = {
|
|
2019
|
+
meta: {
|
|
2020
|
+
type: 'problem',
|
|
2021
|
+
docs: {
|
|
2022
|
+
description:
|
|
2023
|
+
'Require an accessible name on an icon-only BbButton (words in the default slot, `text`, or `aria-label`), an icon-only BbBadge (words in the default slot) and BbProgress (`label` or `aria-labelledby`). Without one a screen reader announces a bare "button" or "progress bar".',
|
|
2024
|
+
recommended: true,
|
|
2025
|
+
},
|
|
2026
|
+
schema: [
|
|
2027
|
+
{
|
|
2028
|
+
type: 'object',
|
|
2029
|
+
properties: {
|
|
2030
|
+
manifestPath: { type: 'string' },
|
|
2031
|
+
failClosed: { type: 'boolean' },
|
|
2032
|
+
allowComponents: { type: 'array', items: { type: 'string' } },
|
|
2033
|
+
},
|
|
2034
|
+
additionalProperties: false,
|
|
2035
|
+
},
|
|
2036
|
+
],
|
|
2037
|
+
messages: {
|
|
2038
|
+
nameless: '{{message}} {{hint}}',
|
|
2039
|
+
},
|
|
2040
|
+
},
|
|
2041
|
+
|
|
2042
|
+
create(context) {
|
|
2043
|
+
const options = context.options[0] ?? {};
|
|
2044
|
+
const manifest = getManifest(options.manifestPath, options);
|
|
2045
|
+
const sourceCode = context.sourceCode ?? context.getSourceCode();
|
|
2046
|
+
const services = sourceCode.parserServices;
|
|
2047
|
+
if (!manifest || !services?.defineTemplateBodyVisitor) return {};
|
|
2048
|
+
|
|
2049
|
+
const allowComps = allowedComponentsFor(context, options);
|
|
2050
|
+
|
|
2051
|
+
/** Anything in the default slot: text, `{{ }}`, an element, or a
|
|
2052
|
+
* `<template #default>` / bare `v-slot` with content. */
|
|
2053
|
+
const hasDefaultContent = (children) =>
|
|
2054
|
+
children.some((child) => {
|
|
2055
|
+
if (child.type === 'VExpressionContainer') return true;
|
|
2056
|
+
if (child.type === 'VText') return child.value.trim() !== '';
|
|
2057
|
+
if (child.type !== 'VElement') return false;
|
|
2058
|
+
if (child.rawName !== 'template') return true;
|
|
2059
|
+
const slot = child.startTag.attributes.find(
|
|
2060
|
+
(attr) => attr.directive && attr.key.name.name === 'slot'
|
|
2061
|
+
);
|
|
2062
|
+
if (!slot) return hasDefaultContent(child.children);
|
|
2063
|
+
const arg = slot.key.argument;
|
|
2064
|
+
const isDefault =
|
|
2065
|
+
arg == null ||
|
|
2066
|
+
(arg.type === 'VIdentifier' &&
|
|
2067
|
+
(arg.rawName ?? arg.name) === 'default');
|
|
2068
|
+
return isDefault && hasDefaultContent(child.children);
|
|
2069
|
+
});
|
|
2070
|
+
|
|
2071
|
+
return services.defineTemplateBodyVisitor({
|
|
2072
|
+
VElement(node) {
|
|
2073
|
+
const name = toPascalTag(node.rawName);
|
|
2074
|
+
if (!NAMED_COMPONENTS.has(name)) return;
|
|
2075
|
+
if (allowComps.has(name) || !manifest.get(name)) return;
|
|
2076
|
+
const directives = node.startTag.attributes.filter(
|
|
2077
|
+
(attr) => attr.directive
|
|
2078
|
+
);
|
|
2079
|
+
const directive = (attr) => attr.key.name.name;
|
|
2080
|
+
for (const finding of checkAccessibleName(name, {
|
|
2081
|
+
hasProp: (camelName) => {
|
|
2082
|
+
const binding = attrBinding(node.startTag, camelName);
|
|
2083
|
+
return binding.present && !binding.literalFalse;
|
|
2084
|
+
},
|
|
2085
|
+
hasSpread: directives.some(
|
|
2086
|
+
(attr) =>
|
|
2087
|
+
directive(attr) === 'bind' &&
|
|
2088
|
+
(attr.key.argument == null ||
|
|
2089
|
+
attr.key.argument.type !== 'VIdentifier')
|
|
2090
|
+
),
|
|
2091
|
+
hasDefaultContent:
|
|
2092
|
+
hasDefaultContent(node.children) ||
|
|
2093
|
+
directives.some(
|
|
2094
|
+
(attr) => directive(attr) === 'text' || directive(attr) === 'html'
|
|
2095
|
+
),
|
|
2096
|
+
})) {
|
|
2097
|
+
context.report({
|
|
2098
|
+
node: node.startTag,
|
|
2099
|
+
messageId: 'nameless',
|
|
2100
|
+
data: { message: finding.message, hint: finding.hint },
|
|
2101
|
+
});
|
|
2102
|
+
}
|
|
2103
|
+
},
|
|
2104
|
+
});
|
|
2105
|
+
},
|
|
2106
|
+
};
|
|
2107
|
+
|
|
2108
|
+
/**
|
|
2109
|
+
* Q54.4 — `bitboss-ui/validated` is retired: everything it exported is in the
|
|
2110
|
+
* root entry. Reports the import and fixes its source (`check --fix`).
|
|
2111
|
+
* @type {import('eslint').Rule.RuleModule}
|
|
2112
|
+
*/
|
|
2113
|
+
const noRetiredEntrypoint = {
|
|
2114
|
+
meta: {
|
|
2115
|
+
type: 'problem',
|
|
2116
|
+
fixable: 'code',
|
|
2117
|
+
docs: {
|
|
2118
|
+
description:
|
|
2119
|
+
"`bitboss-ui/validated` is retired: import BbForm, useBbFormContext and the form controls from 'bitboss-ui'.",
|
|
2120
|
+
},
|
|
2121
|
+
messages: {
|
|
2122
|
+
retired:
|
|
2123
|
+
"`bitboss-ui/validated` is retired: import from 'bitboss-ui' (BbForm, useBbFormContext and the form controls are there; the controls are form-aware inside a BbForm).",
|
|
2124
|
+
},
|
|
2125
|
+
schema: [],
|
|
2126
|
+
},
|
|
2127
|
+
create(context) {
|
|
2128
|
+
const check = (node) => {
|
|
2129
|
+
if (node.source?.value !== 'bitboss-ui/validated') return;
|
|
2130
|
+
context.report({
|
|
2131
|
+
node: node.source,
|
|
2132
|
+
messageId: 'retired',
|
|
2133
|
+
fix: (fixer) => {
|
|
2134
|
+
const quote = node.source.raw?.[0] === '"' ? '"' : "'";
|
|
2135
|
+
return fixer.replaceText(node.source, `${quote}bitboss-ui${quote}`);
|
|
2136
|
+
},
|
|
2137
|
+
});
|
|
2138
|
+
};
|
|
2139
|
+
return { ImportDeclaration: check, ExportNamedDeclaration: check };
|
|
2140
|
+
},
|
|
2141
|
+
};
|
|
2142
|
+
|
|
927
2143
|
const plugin = {
|
|
928
|
-
meta: { name: 'bitboss-ui', version:
|
|
2144
|
+
meta: { name: 'bitboss-ui', version: PACKAGE_VERSION },
|
|
929
2145
|
rules: {
|
|
930
2146
|
'no-unknown-attributes': noUnknownAttributes,
|
|
931
2147
|
'require-table-slot-prop': requireTableSlotProp,
|
|
@@ -933,6 +2149,14 @@ const plugin = {
|
|
|
933
2149
|
'no-unknown-slots': noUnknownSlots,
|
|
934
2150
|
'no-active-class-on-root-link': noActiveClassOnRootLink,
|
|
935
2151
|
'no-navigation-attr-fallthrough': noNavigationAttrFallthrough,
|
|
2152
|
+
'no-unknown-event': noUnknownEvent,
|
|
2153
|
+
'no-unknown-token': noUnknownToken,
|
|
2154
|
+
'no-reverse-false': noReverseFalse,
|
|
2155
|
+
'no-state-text-color': noStateTextColor,
|
|
2156
|
+
'no-box-border-color': noBoxBorderColor,
|
|
2157
|
+
'no-star-color': noStarColor,
|
|
2158
|
+
'require-accessible-name': requireAccessibleName,
|
|
2159
|
+
'no-retired-entrypoint': noRetiredEntrypoint,
|
|
936
2160
|
},
|
|
937
2161
|
};
|
|
938
2162
|
|
|
@@ -991,6 +2215,30 @@ plugin.configs = {
|
|
|
991
2215
|
'bitboss-ui/no-unknown-slots': 'error',
|
|
992
2216
|
'bitboss-ui/no-active-class-on-root-link': 'error',
|
|
993
2217
|
'bitboss-ui/no-navigation-attr-fallthrough': 'error',
|
|
2218
|
+
// The only `warn` in this preset, deliberately. Every other rule
|
|
2219
|
+
// here describes markup with exactly one correct fix. An
|
|
2220
|
+
// undeclared event listener does not: it may be a considered
|
|
2221
|
+
// native listener on a root the author knows, and erroring on a
|
|
2222
|
+
// real JS event would make the plugin wrong about working code.
|
|
2223
|
+
// Warning states the contract and leaves the choice; the CLI
|
|
2224
|
+
// (`bitboss-ui check`) still reports it the same way it always
|
|
2225
|
+
// has, so nothing silently relaxes in CI.
|
|
2226
|
+
'bitboss-ui/no-unknown-event': 'warn',
|
|
2227
|
+
// Also `warn`, for a different reason: the fact is certain (the
|
|
2228
|
+
// declaration is discarded), but the token may be one the consumer
|
|
2229
|
+
// intends to define in their own stylesheet, which this rule cannot
|
|
2230
|
+
// see. `var(--bb-x, fallback)` is the documented way to say so.
|
|
2231
|
+
'bitboss-ui/no-unknown-token': 'warn',
|
|
2232
|
+
'bitboss-ui/no-reverse-false': 'error',
|
|
2233
|
+
// `error`, like every rule that describes markup with no correct
|
|
2234
|
+
// reading: the class can never paint the state, so there is no
|
|
2235
|
+
// deliberate use to protect. The message names the spelling that works.
|
|
2236
|
+
'bitboss-ui/no-state-text-color': 'error',
|
|
2237
|
+
'bitboss-ui/no-box-border-color': 'error',
|
|
2238
|
+
'bitboss-ui/no-star-color': 'error',
|
|
2239
|
+
// `error`: a nameless control has one fix, and the message names it.
|
|
2240
|
+
'bitboss-ui/require-accessible-name': 'error',
|
|
2241
|
+
'bitboss-ui/no-retired-entrypoint': 'error',
|
|
994
2242
|
},
|
|
995
2243
|
},
|
|
996
2244
|
],
|
|
@@ -1004,5 +2252,12 @@ export {
|
|
|
1004
2252
|
noUnknownSlots,
|
|
1005
2253
|
noActiveClassOnRootLink,
|
|
1006
2254
|
noNavigationAttrFallthrough,
|
|
2255
|
+
noUnknownEvent,
|
|
2256
|
+
noUnknownToken,
|
|
2257
|
+
noReverseFalse,
|
|
2258
|
+
noStateTextColor,
|
|
2259
|
+
noBoxBorderColor,
|
|
2260
|
+
noStarColor,
|
|
2261
|
+
requireAccessibleName,
|
|
1007
2262
|
resolveOptionalTsParser,
|
|
1008
2263
|
};
|