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
|
@@ -1,942 +0,0 @@
|
|
|
1
|
-
# BbBaseColorPalette — Implementation Source
|
|
2
|
-
|
|
3
|
-
> Full implementation for deep dives. For everyday usage read the typed contract: [../BbBaseColorPalette.md](../BbBaseColorPalette.md).
|
|
4
|
-
>
|
|
5
|
-
> Safety level: **Reference Only - Internal** — do not use in consumer-facing code unless explicitly requested.
|
|
6
|
-
|
|
7
|
-
## Template & Script
|
|
8
|
-
|
|
9
|
-
```vue
|
|
10
|
-
<template>
|
|
11
|
-
<div ref="pickerRef" class="bb-base-color-palette">
|
|
12
|
-
<!-- Main SV gradient canvas -->
|
|
13
|
-
<div
|
|
14
|
-
ref="canvasWrapRef"
|
|
15
|
-
:aria-label="t('colorInput.mainCanvasDesc').value"
|
|
16
|
-
class="bb-base-color-palette__canvas-wrap"
|
|
17
|
-
role="application"
|
|
18
|
-
tabindex="0"
|
|
19
|
-
@keydown="onCanvasKeyDown"
|
|
20
|
-
@pointercancel="onCanvasPointerUp"
|
|
21
|
-
@pointerdown="onCanvasPointerDown"
|
|
22
|
-
@pointermove="onCanvasPointerMove"
|
|
23
|
-
@pointerup="onCanvasPointerUp"
|
|
24
|
-
>
|
|
25
|
-
<canvas
|
|
26
|
-
ref="mainCanvasRef"
|
|
27
|
-
aria-hidden="true"
|
|
28
|
-
class="bb-base-color-palette__canvas"
|
|
29
|
-
/>
|
|
30
|
-
<div
|
|
31
|
-
aria-hidden="true"
|
|
32
|
-
class="bb-base-color-palette__canvas-thumb"
|
|
33
|
-
:style="{ left: `${sat * 100}%`, top: `${(1 - val) * 100}%` }"
|
|
34
|
-
/>
|
|
35
|
-
</div>
|
|
36
|
-
<!--
|
|
37
|
-
The SV area is a 2D control, so `role="application"` is right but
|
|
38
|
-
`aria-valuetext` would be inert on it (screen readers only read that on
|
|
39
|
-
range roles). Announce the resulting colour through a polite live region
|
|
40
|
-
instead — updated per arrow key, and once at the end of a drag rather
|
|
41
|
-
than on every pointermove, so it informs without chattering.
|
|
42
|
-
-->
|
|
43
|
-
<div
|
|
44
|
-
aria-live="polite"
|
|
45
|
-
class="bb-base-color-palette__canvas-announcer"
|
|
46
|
-
role="status"
|
|
47
|
-
>
|
|
48
|
-
{{ announcedColor }}
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<!-- Controls row: preview + sliders + optional eyedropper -->
|
|
52
|
-
<div class="bb-base-color-palette__controls">
|
|
53
|
-
<div class="bb-base-color-palette__preview-wrap">
|
|
54
|
-
<div
|
|
55
|
-
class="bb-base-color-palette__preview"
|
|
56
|
-
:class="{ 'bb-base-color-palette__preview--alpha': alpha }"
|
|
57
|
-
:style="{ '--picker-preview-color': previewColor }"
|
|
58
|
-
/>
|
|
59
|
-
</div>
|
|
60
|
-
|
|
61
|
-
<div class="bb-base-color-palette__sliders">
|
|
62
|
-
<!-- Hue slider -->
|
|
63
|
-
<div
|
|
64
|
-
ref="hueWrapRef"
|
|
65
|
-
:aria-label="t('colorInput.hueCanvasDesc').value"
|
|
66
|
-
aria-valuemax="360"
|
|
67
|
-
aria-valuemin="0"
|
|
68
|
-
:aria-valuenow="Math.round(hue)"
|
|
69
|
-
class="bb-base-color-palette__slider-wrap"
|
|
70
|
-
role="slider"
|
|
71
|
-
tabindex="0"
|
|
72
|
-
@keydown="onHueKeyDown"
|
|
73
|
-
@pointercancel="onHuePointerUp"
|
|
74
|
-
@pointerdown="onHuePointerDown"
|
|
75
|
-
@pointermove="onHuePointerMove"
|
|
76
|
-
@pointerup="onHuePointerUp"
|
|
77
|
-
>
|
|
78
|
-
<canvas
|
|
79
|
-
ref="hueCanvasRef"
|
|
80
|
-
aria-hidden="true"
|
|
81
|
-
class="bb-base-color-palette__slider-track"
|
|
82
|
-
/>
|
|
83
|
-
<div
|
|
84
|
-
aria-hidden="true"
|
|
85
|
-
class="bb-base-color-palette__slider-thumb"
|
|
86
|
-
:style="{ left: `${(hue / 360) * 100}%` }"
|
|
87
|
-
/>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
<!-- Alpha slider -->
|
|
91
|
-
<div
|
|
92
|
-
v-if="alpha"
|
|
93
|
-
ref="alphaWrapRef"
|
|
94
|
-
:aria-label="t('colorInput.alphaSliderDesc').value"
|
|
95
|
-
aria-valuemax="100"
|
|
96
|
-
aria-valuemin="0"
|
|
97
|
-
:aria-valuenow="Math.round(alphaValue * 100)"
|
|
98
|
-
class="bb-base-color-palette__slider-wrap bb-base-color-palette__slider-wrap--alpha"
|
|
99
|
-
role="slider"
|
|
100
|
-
tabindex="0"
|
|
101
|
-
@keydown="onAlphaKeyDown"
|
|
102
|
-
@pointercancel="onAlphaPointerUp"
|
|
103
|
-
@pointerdown="onAlphaPointerDown"
|
|
104
|
-
@pointermove="onAlphaPointerMove"
|
|
105
|
-
@pointerup="onAlphaPointerUp"
|
|
106
|
-
>
|
|
107
|
-
<canvas
|
|
108
|
-
ref="alphaCanvasRef"
|
|
109
|
-
aria-hidden="true"
|
|
110
|
-
class="bb-base-color-palette__slider-track"
|
|
111
|
-
/>
|
|
112
|
-
<div
|
|
113
|
-
aria-hidden="true"
|
|
114
|
-
class="bb-base-color-palette__slider-thumb"
|
|
115
|
-
:style="{ left: `${alphaValue * 100}%` }"
|
|
116
|
-
/>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<!-- EyeDropper button — only shown when eyeDropper=true and API is supported -->
|
|
121
|
-
<button
|
|
122
|
-
v-if="eyeDropper && eyeDropperSupported"
|
|
123
|
-
:aria-label="t('colorInput.eyeDropper').value"
|
|
124
|
-
class="bb-base-color-palette__eyedropper"
|
|
125
|
-
:disabled="isPickingColor || undefined"
|
|
126
|
-
type="button"
|
|
127
|
-
@click="onEyeDropper"
|
|
128
|
-
>
|
|
129
|
-
<svg
|
|
130
|
-
aria-hidden="true"
|
|
131
|
-
fill="currentColor"
|
|
132
|
-
height="16"
|
|
133
|
-
viewBox="0 0 24 24"
|
|
134
|
-
width="16"
|
|
135
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
136
|
-
>
|
|
137
|
-
<path
|
|
138
|
-
d="M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L13.71,3.71L12.29,5.12L13.41,6.24L3,16.59V21H7.41L17.76,10.59L18.88,11.71L20.29,10.29L18.88,8.88L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63M6.58,19H5V17.42L13.29,9.12L14.88,10.71L6.58,19Z"
|
|
139
|
-
/>
|
|
140
|
-
</svg>
|
|
141
|
-
</button>
|
|
142
|
-
</div>
|
|
143
|
-
|
|
144
|
-
<!-- Swatches — each inner array is a column; groups stretch to fill full width -->
|
|
145
|
-
<div v-if="hasSwatches" class="bb-base-color-palette__swatches">
|
|
146
|
-
<div
|
|
147
|
-
v-for="(group, gi) in effectiveSwatches"
|
|
148
|
-
:key="gi"
|
|
149
|
-
class="bb-base-color-palette__swatch-group"
|
|
150
|
-
>
|
|
151
|
-
<button
|
|
152
|
-
v-for="swatch in group"
|
|
153
|
-
:key="swatch"
|
|
154
|
-
:aria-label="swatch"
|
|
155
|
-
:aria-pressed="isSwatchActive(swatch)"
|
|
156
|
-
class="bb-base-color-palette__swatch"
|
|
157
|
-
:class="{
|
|
158
|
-
'bb-base-color-palette__swatch--active': isSwatchActive(swatch),
|
|
159
|
-
}"
|
|
160
|
-
:style="{ background: swatch }"
|
|
161
|
-
type="button"
|
|
162
|
-
@click="selectSwatch(swatch)"
|
|
163
|
-
/>
|
|
164
|
-
</div>
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
</template>
|
|
168
|
-
|
|
169
|
-
<script setup lang="ts">
|
|
170
|
-
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
|
|
171
|
-
import { useLocale } from '@/composables/useLocale';
|
|
172
|
-
import type { ColorPaletteEvents, ColorPaletteProps } from './types';
|
|
173
|
-
|
|
174
|
-
// ---- Props / emits -------------------------------------------------------------
|
|
175
|
-
|
|
176
|
-
const props = withDefaults(defineProps<ColorPaletteProps>(), {
|
|
177
|
-
alpha: false,
|
|
178
|
-
eyeDropper: false,
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
const emit = defineEmits<ColorPaletteEvents>();
|
|
182
|
-
|
|
183
|
-
// ---- Color math ----------------------------------------------------------------
|
|
184
|
-
|
|
185
|
-
function hsvToRgb(h: number, s: number, v: number): [number, number, number] {
|
|
186
|
-
const f = (n: number) => {
|
|
187
|
-
const k = (n + h / 60) % 6;
|
|
188
|
-
return v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
|
|
189
|
-
};
|
|
190
|
-
return [
|
|
191
|
-
Math.round(f(5) * 255),
|
|
192
|
-
Math.round(f(3) * 255),
|
|
193
|
-
Math.round(f(1) * 255),
|
|
194
|
-
];
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
function rgbToHsv(r: number, g: number, b: number): [number, number, number] {
|
|
198
|
-
const rn = r / 255,
|
|
199
|
-
gn = g / 255,
|
|
200
|
-
bn = b / 255;
|
|
201
|
-
const max = Math.max(rn, gn, bn);
|
|
202
|
-
const min = Math.min(rn, gn, bn);
|
|
203
|
-
const d = max - min;
|
|
204
|
-
const s = max === 0 ? 0 : d / max;
|
|
205
|
-
const v = max;
|
|
206
|
-
let h = 0;
|
|
207
|
-
if (d !== 0) {
|
|
208
|
-
if (max === rn) h = ((gn - bn) / d + (gn < bn ? 6 : 0)) / 6;
|
|
209
|
-
else if (max === gn) h = ((bn - rn) / d + 2) / 6;
|
|
210
|
-
else h = ((rn - gn) / d + 4) / 6;
|
|
211
|
-
}
|
|
212
|
-
return [h * 360, s, v];
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
function hexToRgba(hex: string): [number, number, number, number] {
|
|
216
|
-
const raw = hex.replace(/^#/, '');
|
|
217
|
-
if (raw.length === 3) {
|
|
218
|
-
return [
|
|
219
|
-
parseInt(raw[0] + raw[0], 16),
|
|
220
|
-
parseInt(raw[1] + raw[1], 16),
|
|
221
|
-
parseInt(raw[2] + raw[2], 16),
|
|
222
|
-
1,
|
|
223
|
-
];
|
|
224
|
-
}
|
|
225
|
-
if (raw.length === 6) {
|
|
226
|
-
return [
|
|
227
|
-
parseInt(raw.slice(0, 2), 16),
|
|
228
|
-
parseInt(raw.slice(2, 4), 16),
|
|
229
|
-
parseInt(raw.slice(4, 6), 16),
|
|
230
|
-
1,
|
|
231
|
-
];
|
|
232
|
-
}
|
|
233
|
-
if (raw.length === 8) {
|
|
234
|
-
return [
|
|
235
|
-
parseInt(raw.slice(0, 2), 16),
|
|
236
|
-
parseInt(raw.slice(2, 4), 16),
|
|
237
|
-
parseInt(raw.slice(4, 6), 16),
|
|
238
|
-
parseInt(raw.slice(6, 8), 16) / 255,
|
|
239
|
-
];
|
|
240
|
-
}
|
|
241
|
-
return [0, 0, 0, 1];
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function toHex2(n: number): string {
|
|
245
|
-
return Math.round(Math.max(0, Math.min(255, n)))
|
|
246
|
-
.toString(16)
|
|
247
|
-
.padStart(2, '0');
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function buildHex(
|
|
251
|
-
r: number,
|
|
252
|
-
g: number,
|
|
253
|
-
b: number,
|
|
254
|
-
a: number,
|
|
255
|
-
withAlpha: boolean
|
|
256
|
-
): string {
|
|
257
|
-
const base = `#${toHex2(r)}${toHex2(g)}${toHex2(b)}`;
|
|
258
|
-
return withAlpha ? base + toHex2(a * 255) : base;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// ---- Default swatches ----------------------------------------------------------
|
|
262
|
-
// 6 columns, one per major hue family (Red → Orange → Yellow → Green → Blue → Purple).
|
|
263
|
-
// Each column is a smooth 5-step tint ramp (100 → 300 → 500 → 700 → 900) so the
|
|
264
|
-
// colours read as coherent gradients when stacked top-to-bottom.
|
|
265
|
-
// The flex layout stretches every group to fill the full container width, so
|
|
266
|
-
// each swatch is roughly 38 px wide — comfortably clickable.
|
|
267
|
-
|
|
268
|
-
const DEFAULT_SWATCHES: string[][] = [
|
|
269
|
-
['#FFCDD2', '#EF9A9A', '#F44336', '#D32F2F', '#B71C1C'], // Red
|
|
270
|
-
['#FFE0B2', '#FFCC80', '#FF9800', '#F57C00', '#E65100'], // Orange
|
|
271
|
-
['#FFF9C4', '#FFF59D', '#FFEB3B', '#FBC02D', '#F57F17'], // Yellow
|
|
272
|
-
['#C8E6C9', '#A5D6A7', '#4CAF50', '#388E3C', '#1B5E20'], // Green
|
|
273
|
-
['#BBDEFB', '#90CAF9', '#2196F3', '#1976D2', '#0D47A1'], // Blue
|
|
274
|
-
['#E1BEE7', '#CE93D8', '#9C27B0', '#7B1FA2', '#4A148C'], // Purple
|
|
275
|
-
];
|
|
276
|
-
|
|
277
|
-
const { t } = useLocale();
|
|
278
|
-
|
|
279
|
-
// ---- Internal HSVA state -------------------------------------------------------
|
|
280
|
-
|
|
281
|
-
const hue = ref(0); // 0–360
|
|
282
|
-
const sat = ref(1); // 0–1
|
|
283
|
-
const val = ref(1); // 0–1
|
|
284
|
-
const alphaValue = ref(1); // 0–1
|
|
285
|
-
|
|
286
|
-
// ---- Computed ------------------------------------------------------------------
|
|
287
|
-
|
|
288
|
-
const currentHex = computed(() => {
|
|
289
|
-
const [r, g, b] = hsvToRgb(hue.value, sat.value, val.value);
|
|
290
|
-
return buildHex(r, g, b, alphaValue.value, props.alpha);
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
const previewColor = computed(() => {
|
|
294
|
-
const [r, g, b] = hsvToRgb(hue.value, sat.value, val.value);
|
|
295
|
-
return props.alpha
|
|
296
|
-
? `rgba(${r},${g},${b},${alphaValue.value})`
|
|
297
|
-
: `rgb(${r},${g},${b})`;
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
const hasSwatches = computed(() => !!props.swatches);
|
|
301
|
-
|
|
302
|
-
const effectiveSwatches = computed<string[][]>(() =>
|
|
303
|
-
Array.isArray(props.swatches) ? props.swatches : DEFAULT_SWATCHES
|
|
304
|
-
);
|
|
305
|
-
|
|
306
|
-
// ---- Canvas refs ---------------------------------------------------------------
|
|
307
|
-
|
|
308
|
-
const pickerRef = ref<HTMLDivElement | null>(null);
|
|
309
|
-
const mainCanvasRef = ref<HTMLCanvasElement | null>(null);
|
|
310
|
-
const hueCanvasRef = ref<HTMLCanvasElement | null>(null);
|
|
311
|
-
const alphaCanvasRef = ref<HTMLCanvasElement | null>(null);
|
|
312
|
-
const canvasWrapRef = ref<HTMLDivElement | null>(null);
|
|
313
|
-
const hueWrapRef = ref<HTMLDivElement | null>(null);
|
|
314
|
-
const alphaWrapRef = ref<HTMLDivElement | null>(null);
|
|
315
|
-
|
|
316
|
-
// ---- Drawing -------------------------------------------------------------------
|
|
317
|
-
|
|
318
|
-
const drawMainCanvas = () => {
|
|
319
|
-
const canvas = mainCanvasRef.value;
|
|
320
|
-
if (!canvas || canvas.width === 0 || canvas.height === 0) return;
|
|
321
|
-
const ctx = canvas.getContext('2d');
|
|
322
|
-
if (!ctx) return;
|
|
323
|
-
|
|
324
|
-
const [hr, hg, hb] = hsvToRgb(hue.value, 1, 1);
|
|
325
|
-
|
|
326
|
-
// White → pure hue (left → right = saturation axis)
|
|
327
|
-
const hGrad = ctx.createLinearGradient(0, 0, canvas.width, 0);
|
|
328
|
-
hGrad.addColorStop(0, '#ffffff');
|
|
329
|
-
hGrad.addColorStop(1, `rgb(${hr},${hg},${hb})`);
|
|
330
|
-
ctx.fillStyle = hGrad;
|
|
331
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
332
|
-
|
|
333
|
-
// Transparent → black (top → bottom = value axis)
|
|
334
|
-
const vGrad = ctx.createLinearGradient(0, 0, 0, canvas.height);
|
|
335
|
-
vGrad.addColorStop(0, 'rgba(0,0,0,0)');
|
|
336
|
-
vGrad.addColorStop(1, 'rgba(0,0,0,1)');
|
|
337
|
-
ctx.fillStyle = vGrad;
|
|
338
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
const drawHueCanvas = () => {
|
|
342
|
-
const canvas = hueCanvasRef.value;
|
|
343
|
-
if (!canvas || canvas.width === 0 || canvas.height === 0) return;
|
|
344
|
-
const ctx = canvas.getContext('2d');
|
|
345
|
-
if (!ctx) return;
|
|
346
|
-
|
|
347
|
-
const grad = ctx.createLinearGradient(0, 0, canvas.width, 0);
|
|
348
|
-
for (let i = 0; i <= 6; i++) {
|
|
349
|
-
grad.addColorStop(i / 6, `hsl(${i * 60},100%,50%)`);
|
|
350
|
-
}
|
|
351
|
-
ctx.fillStyle = grad;
|
|
352
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
const drawAlphaCanvas = () => {
|
|
356
|
-
const canvas = alphaCanvasRef.value;
|
|
357
|
-
if (!canvas || canvas.width === 0 || canvas.height === 0) return;
|
|
358
|
-
const ctx = canvas.getContext('2d');
|
|
359
|
-
if (!ctx) return;
|
|
360
|
-
|
|
361
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
362
|
-
const [r, g, b] = hsvToRgb(hue.value, sat.value, val.value);
|
|
363
|
-
const grad = ctx.createLinearGradient(0, 0, canvas.width, 0);
|
|
364
|
-
grad.addColorStop(0, `rgba(${r},${g},${b},0)`);
|
|
365
|
-
grad.addColorStop(1, `rgba(${r},${g},${b},1)`);
|
|
366
|
-
ctx.fillStyle = grad;
|
|
367
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
const redrawAll = () => {
|
|
371
|
-
drawMainCanvas();
|
|
372
|
-
drawHueCanvas();
|
|
373
|
-
if (props.alpha) drawAlphaCanvas();
|
|
374
|
-
};
|
|
375
|
-
|
|
376
|
-
// ---- Canvas setup (ResizeObserver) --------------------------------------------
|
|
377
|
-
|
|
378
|
-
let resizeObserver: ResizeObserver | null = null;
|
|
379
|
-
|
|
380
|
-
const fitCanvas = (canvas: HTMLCanvasElement) => {
|
|
381
|
-
canvas.width = canvas.offsetWidth;
|
|
382
|
-
canvas.height = canvas.offsetHeight;
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
const initCanvases = () => {
|
|
386
|
-
const mc = mainCanvasRef.value;
|
|
387
|
-
const hc = hueCanvasRef.value;
|
|
388
|
-
if (!mc || !hc || mc.offsetWidth === 0) return;
|
|
389
|
-
|
|
390
|
-
fitCanvas(mc);
|
|
391
|
-
fitCanvas(hc);
|
|
392
|
-
if (props.alpha && alphaCanvasRef.value) fitCanvas(alphaCanvasRef.value);
|
|
393
|
-
redrawAll();
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
onMounted(() => {
|
|
397
|
-
resizeObserver = new ResizeObserver(initCanvases);
|
|
398
|
-
if (mainCanvasRef.value) resizeObserver.observe(mainCanvasRef.value);
|
|
399
|
-
|
|
400
|
-
setFromHex(props.modelValue);
|
|
401
|
-
initCanvases();
|
|
402
|
-
});
|
|
403
|
-
|
|
404
|
-
onUnmounted(() => {
|
|
405
|
-
resizeObserver?.disconnect();
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
// ---- Parse incoming hex -------------------------------------------------------
|
|
409
|
-
|
|
410
|
-
const setFromHex = (hex: string | null) => {
|
|
411
|
-
if (!hex) return;
|
|
412
|
-
try {
|
|
413
|
-
const [r, g, b, a] = hexToRgba(hex);
|
|
414
|
-
const [h, s, v] = rgbToHsv(r, g, b);
|
|
415
|
-
if (s > 0.01) hue.value = h; // preserve hue for achromatic colors
|
|
416
|
-
sat.value = s;
|
|
417
|
-
val.value = v;
|
|
418
|
-
alphaValue.value = a;
|
|
419
|
-
} catch {
|
|
420
|
-
// invalid hex — leave state unchanged
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
watch(
|
|
425
|
-
() => props.modelValue,
|
|
426
|
-
(newVal) => {
|
|
427
|
-
if (!newVal || newVal === currentHex.value) return;
|
|
428
|
-
setFromHex(newVal);
|
|
429
|
-
drawMainCanvas();
|
|
430
|
-
if (props.alpha) drawAlphaCanvas();
|
|
431
|
-
}
|
|
432
|
-
);
|
|
433
|
-
|
|
434
|
-
// ---- Emit helper ---------------------------------------------------------------
|
|
435
|
-
|
|
436
|
-
const emitColor = () => emit('update:modelValue', currentHex.value);
|
|
437
|
-
|
|
438
|
-
// ---- Main canvas (SV) pointer events -------------------------------------------
|
|
439
|
-
|
|
440
|
-
const isCanvasDragging = ref(false);
|
|
441
|
-
|
|
442
|
-
const getSVFromPointer = (e: PointerEvent) => {
|
|
443
|
-
const wrap = canvasWrapRef.value;
|
|
444
|
-
if (!wrap) return { s: sat.value, v: val.value };
|
|
445
|
-
const rect = wrap.getBoundingClientRect();
|
|
446
|
-
return {
|
|
447
|
-
s: Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width)),
|
|
448
|
-
v: Math.max(0, Math.min(1, 1 - (e.clientY - rect.top) / rect.height)),
|
|
449
|
-
};
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
const onCanvasPointerDown = (e: PointerEvent) => {
|
|
453
|
-
canvasWrapRef.value?.setPointerCapture(e.pointerId);
|
|
454
|
-
isCanvasDragging.value = true;
|
|
455
|
-
const { s, v } = getSVFromPointer(e);
|
|
456
|
-
sat.value = s;
|
|
457
|
-
val.value = v;
|
|
458
|
-
if (props.alpha) drawAlphaCanvas();
|
|
459
|
-
emitColor();
|
|
460
|
-
};
|
|
461
|
-
|
|
462
|
-
const onCanvasPointerMove = (e: PointerEvent) => {
|
|
463
|
-
if (!isCanvasDragging.value) return;
|
|
464
|
-
const { s, v } = getSVFromPointer(e);
|
|
465
|
-
sat.value = s;
|
|
466
|
-
val.value = v;
|
|
467
|
-
if (props.alpha) drawAlphaCanvas();
|
|
468
|
-
emitColor();
|
|
469
|
-
};
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* Text of the SV area's polite live region. Empty until the user actually moves
|
|
473
|
-
* the selection, so mounting the picker doesn't announce anything.
|
|
474
|
-
*/
|
|
475
|
-
const announcedColor = ref('');
|
|
476
|
-
|
|
477
|
-
/** Publish the current colour to the live region (see the template comment). */
|
|
478
|
-
const announceColor = () => {
|
|
479
|
-
announcedColor.value = t(
|
|
480
|
-
'colorInput.mainCanvasSelectedColor',
|
|
481
|
-
currentHex.value
|
|
482
|
-
).value;
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
const onCanvasPointerUp = (e: PointerEvent) => {
|
|
486
|
-
canvasWrapRef.value?.releasePointerCapture(e.pointerId);
|
|
487
|
-
// Announce once the drag settles rather than on every pointermove.
|
|
488
|
-
if (isCanvasDragging.value) announceColor();
|
|
489
|
-
isCanvasDragging.value = false;
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
const onCanvasKeyDown = (e: KeyboardEvent) => {
|
|
493
|
-
const step = e.shiftKey ? 0.05 : 0.01;
|
|
494
|
-
switch (e.key) {
|
|
495
|
-
case 'ArrowLeft':
|
|
496
|
-
sat.value = Math.max(0, sat.value - step);
|
|
497
|
-
break;
|
|
498
|
-
case 'ArrowRight':
|
|
499
|
-
sat.value = Math.min(1, sat.value + step);
|
|
500
|
-
break;
|
|
501
|
-
case 'ArrowUp':
|
|
502
|
-
val.value = Math.min(1, val.value + step);
|
|
503
|
-
break;
|
|
504
|
-
case 'ArrowDown':
|
|
505
|
-
val.value = Math.max(0, val.value - step);
|
|
506
|
-
break;
|
|
507
|
-
default:
|
|
508
|
-
return;
|
|
509
|
-
}
|
|
510
|
-
if (props.alpha) drawAlphaCanvas();
|
|
511
|
-
emitColor();
|
|
512
|
-
announceColor();
|
|
513
|
-
e.preventDefault();
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
// ---- Hue slider pointer events -------------------------------------------------
|
|
517
|
-
|
|
518
|
-
const isHueDragging = ref(false);
|
|
519
|
-
|
|
520
|
-
const getHueFromPointer = (e: PointerEvent) => {
|
|
521
|
-
const wrap = hueWrapRef.value;
|
|
522
|
-
if (!wrap) return hue.value;
|
|
523
|
-
const rect = wrap.getBoundingClientRect();
|
|
524
|
-
return Math.max(
|
|
525
|
-
0,
|
|
526
|
-
Math.min(360, ((e.clientX - rect.left) / rect.width) * 360)
|
|
527
|
-
);
|
|
528
|
-
};
|
|
529
|
-
|
|
530
|
-
const onHuePointerDown = (e: PointerEvent) => {
|
|
531
|
-
hueWrapRef.value?.setPointerCapture(e.pointerId);
|
|
532
|
-
isHueDragging.value = true;
|
|
533
|
-
hue.value = getHueFromPointer(e);
|
|
534
|
-
drawMainCanvas();
|
|
535
|
-
if (props.alpha) drawAlphaCanvas();
|
|
536
|
-
emitColor();
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
const onHuePointerMove = (e: PointerEvent) => {
|
|
540
|
-
if (!isHueDragging.value) return;
|
|
541
|
-
hue.value = getHueFromPointer(e);
|
|
542
|
-
drawMainCanvas();
|
|
543
|
-
if (props.alpha) drawAlphaCanvas();
|
|
544
|
-
emitColor();
|
|
545
|
-
};
|
|
546
|
-
|
|
547
|
-
const onHuePointerUp = (e: PointerEvent) => {
|
|
548
|
-
hueWrapRef.value?.releasePointerCapture(e.pointerId);
|
|
549
|
-
isHueDragging.value = false;
|
|
550
|
-
};
|
|
551
|
-
|
|
552
|
-
const onHueKeyDown = (e: KeyboardEvent) => {
|
|
553
|
-
const step = e.shiftKey ? 10 : 1;
|
|
554
|
-
switch (e.key) {
|
|
555
|
-
case 'ArrowLeft':
|
|
556
|
-
hue.value = Math.max(0, hue.value - step);
|
|
557
|
-
break;
|
|
558
|
-
case 'ArrowRight':
|
|
559
|
-
hue.value = Math.min(360, hue.value + step);
|
|
560
|
-
break;
|
|
561
|
-
default:
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
drawMainCanvas();
|
|
565
|
-
if (props.alpha) drawAlphaCanvas();
|
|
566
|
-
emitColor();
|
|
567
|
-
e.preventDefault();
|
|
568
|
-
};
|
|
569
|
-
|
|
570
|
-
// ---- Alpha slider pointer events -----------------------------------------------
|
|
571
|
-
|
|
572
|
-
const isAlphaDragging = ref(false);
|
|
573
|
-
|
|
574
|
-
const getAlphaFromPointer = (e: PointerEvent) => {
|
|
575
|
-
const wrap = alphaWrapRef.value;
|
|
576
|
-
if (!wrap) return alphaValue.value;
|
|
577
|
-
const rect = wrap.getBoundingClientRect();
|
|
578
|
-
return Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
|
|
579
|
-
};
|
|
580
|
-
|
|
581
|
-
const onAlphaPointerDown = (e: PointerEvent) => {
|
|
582
|
-
alphaWrapRef.value?.setPointerCapture(e.pointerId);
|
|
583
|
-
isAlphaDragging.value = true;
|
|
584
|
-
alphaValue.value = getAlphaFromPointer(e);
|
|
585
|
-
emitColor();
|
|
586
|
-
};
|
|
587
|
-
|
|
588
|
-
const onAlphaPointerMove = (e: PointerEvent) => {
|
|
589
|
-
if (!isAlphaDragging.value) return;
|
|
590
|
-
alphaValue.value = getAlphaFromPointer(e);
|
|
591
|
-
emitColor();
|
|
592
|
-
};
|
|
593
|
-
|
|
594
|
-
const onAlphaPointerUp = (e: PointerEvent) => {
|
|
595
|
-
alphaWrapRef.value?.releasePointerCapture(e.pointerId);
|
|
596
|
-
isAlphaDragging.value = false;
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
const onAlphaKeyDown = (e: KeyboardEvent) => {
|
|
600
|
-
const step = e.shiftKey ? 0.05 : 0.01;
|
|
601
|
-
switch (e.key) {
|
|
602
|
-
case 'ArrowLeft':
|
|
603
|
-
alphaValue.value = Math.max(0, alphaValue.value - step);
|
|
604
|
-
break;
|
|
605
|
-
case 'ArrowRight':
|
|
606
|
-
alphaValue.value = Math.min(1, alphaValue.value + step);
|
|
607
|
-
break;
|
|
608
|
-
default:
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
emitColor();
|
|
612
|
-
e.preventDefault();
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
// ---- EyeDropper ----------------------------------------------------------------
|
|
616
|
-
|
|
617
|
-
const eyeDropperSupported =
|
|
618
|
-
typeof window !== 'undefined' && 'EyeDropper' in window;
|
|
619
|
-
const isPickingColor = ref(false);
|
|
620
|
-
|
|
621
|
-
const onEyeDropper = async () => {
|
|
622
|
-
if (!eyeDropperSupported) return;
|
|
623
|
-
try {
|
|
624
|
-
isPickingColor.value = true;
|
|
625
|
-
const W = window as unknown as {
|
|
626
|
-
EyeDropper: new () => { open(): Promise<{ sRGBHex: string }> };
|
|
627
|
-
};
|
|
628
|
-
const eyeDropper = new W.EyeDropper();
|
|
629
|
-
const result = await eyeDropper.open();
|
|
630
|
-
selectSwatch(result.sRGBHex);
|
|
631
|
-
} catch {
|
|
632
|
-
// User cancelled (AbortError) — do nothing
|
|
633
|
-
} finally {
|
|
634
|
-
isPickingColor.value = false;
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
|
|
638
|
-
// ---- Swatches ------------------------------------------------------------------
|
|
639
|
-
|
|
640
|
-
const isSwatchActive = (swatch: string): boolean =>
|
|
641
|
-
currentHex.value.slice(0, 7).toLowerCase() ===
|
|
642
|
-
swatch.slice(0, 7).toLowerCase();
|
|
643
|
-
|
|
644
|
-
const selectSwatch = (swatch: string) => {
|
|
645
|
-
const [r, g, b, a] = hexToRgba(swatch);
|
|
646
|
-
const [h, s, v] = rgbToHsv(r, g, b);
|
|
647
|
-
if (s > 0.01) hue.value = h;
|
|
648
|
-
sat.value = s;
|
|
649
|
-
val.value = v;
|
|
650
|
-
alphaValue.value = a;
|
|
651
|
-
drawMainCanvas();
|
|
652
|
-
if (props.alpha) drawAlphaCanvas();
|
|
653
|
-
emitColor();
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
defineExpose({ el: pickerRef });
|
|
657
|
-
</script>
|
|
658
|
-
|
|
659
|
-
<style lang="postcss">
|
|
660
|
-
@import './index.css';
|
|
661
|
-
</style>
|
|
662
|
-
```
|
|
663
|
-
|
|
664
|
-
## Types
|
|
665
|
-
|
|
666
|
-
```ts
|
|
667
|
-
export type ColorPaletteProps = {
|
|
668
|
-
/**
|
|
669
|
-
* Current color value bound via `v-model`.
|
|
670
|
-
* Accepts `#RRGGBB` and `#RRGGBBAA` (alpha) formats, or `null` for no value.
|
|
671
|
-
*/
|
|
672
|
-
modelValue: string | null;
|
|
673
|
-
/**
|
|
674
|
-
* Enable alpha channel support.
|
|
675
|
-
* When true, an alpha slider is shown and emitted values include alpha as hex8.
|
|
676
|
-
* @defaultValue `false`
|
|
677
|
-
*/
|
|
678
|
-
alpha?: boolean;
|
|
679
|
-
/**
|
|
680
|
-
* Show an eyedropper button that lets the user sample any color on screen.
|
|
681
|
-
* Uses the native EyeDropper API — hidden automatically on unsupported browsers.
|
|
682
|
-
* @defaultValue `false`
|
|
683
|
-
*/
|
|
684
|
-
eyeDropper?: boolean;
|
|
685
|
-
/**
|
|
686
|
-
* Controls swatches display:
|
|
687
|
-
* - `true` — show the built-in Material-palette swatches
|
|
688
|
-
* - `string[][]` — show custom swatches (each inner array = a column of shades)
|
|
689
|
-
* - `false` / omitted — no swatches section
|
|
690
|
-
*/
|
|
691
|
-
swatches?: boolean | string[][];
|
|
692
|
-
};
|
|
693
|
-
|
|
694
|
-
export type ColorPaletteEvents =
|
|
695
|
-
/**
|
|
696
|
-
* Emitted whenever the user changes color through:
|
|
697
|
-
* - SV canvas dragging/keyboard
|
|
698
|
-
* - hue slider dragging/keyboard
|
|
699
|
-
* - alpha slider dragging/keyboard (when enabled)
|
|
700
|
-
* - swatch selection
|
|
701
|
-
* - eyedropper pick
|
|
702
|
-
*
|
|
703
|
-
* Payload format:
|
|
704
|
-
* - `#RRGGBB` when `alpha` is disabled
|
|
705
|
-
* - `#RRGGBBAA` when `alpha` is enabled
|
|
706
|
-
*/
|
|
707
|
-
(e: 'update:modelValue', value: string) => void;
|
|
708
|
-
```
|
|
709
|
-
|
|
710
|
-
## Styles
|
|
711
|
-
|
|
712
|
-
```css
|
|
713
|
-
.bb-base-color-palette {
|
|
714
|
-
display: flex;
|
|
715
|
-
flex-direction: column;
|
|
716
|
-
gap: 12px;
|
|
717
|
-
padding: 12px;
|
|
718
|
-
-webkit-user-select: none;
|
|
719
|
-
user-select: none;
|
|
720
|
-
width: 272px;
|
|
721
|
-
|
|
722
|
-
/* ---- Main SV canvas ---- */
|
|
723
|
-
&__canvas-wrap {
|
|
724
|
-
border-radius: var(--bb-radius);
|
|
725
|
-
cursor: crosshair;
|
|
726
|
-
flex-shrink: 0;
|
|
727
|
-
height: 150px;
|
|
728
|
-
outline: none;
|
|
729
|
-
overflow: hidden;
|
|
730
|
-
position: relative;
|
|
731
|
-
touch-action: none;
|
|
732
|
-
|
|
733
|
-
&:focus-visible {
|
|
734
|
-
box-shadow: 0 0 0 var(--bb-ring-size) var(--bb-ring);
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
&__canvas {
|
|
739
|
-
display: block;
|
|
740
|
-
height: 100%;
|
|
741
|
-
width: 100%;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
&__canvas-thumb {
|
|
745
|
-
border: 2px solid white;
|
|
746
|
-
border-radius: 50%;
|
|
747
|
-
box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.25);
|
|
748
|
-
height: 14px;
|
|
749
|
-
pointer-events: none;
|
|
750
|
-
position: absolute;
|
|
751
|
-
transform: translate(-50%, -50%);
|
|
752
|
-
width: 14px;
|
|
753
|
-
will-change: left, top;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
/* Screen-reader-only live region announcing the SV area's selected colour. */
|
|
757
|
-
&__canvas-announcer {
|
|
758
|
-
border-width: 0;
|
|
759
|
-
clip: rect(0, 0, 0, 0);
|
|
760
|
-
height: 1px;
|
|
761
|
-
margin: -1px;
|
|
762
|
-
overflow: hidden;
|
|
763
|
-
padding: 0;
|
|
764
|
-
position: absolute;
|
|
765
|
-
white-space: nowrap;
|
|
766
|
-
width: 1px;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
/* ---- Controls row ---- */
|
|
770
|
-
&__controls {
|
|
771
|
-
align-items: center;
|
|
772
|
-
display: flex;
|
|
773
|
-
gap: 12px;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
/* ---- Preview circle ---- */
|
|
777
|
-
&__preview-wrap {
|
|
778
|
-
flex-shrink: 0;
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
&__preview {
|
|
782
|
-
background: var(--picker-preview-color, #000);
|
|
783
|
-
border: 1px solid var(--bb-border);
|
|
784
|
-
border-radius: 50%;
|
|
785
|
-
height: 36px;
|
|
786
|
-
width: 36px;
|
|
787
|
-
|
|
788
|
-
&--alpha {
|
|
789
|
-
background-image:
|
|
790
|
-
linear-gradient(
|
|
791
|
-
var(--picker-preview-color, transparent),
|
|
792
|
-
var(--picker-preview-color, transparent)
|
|
793
|
-
),
|
|
794
|
-
repeating-conic-gradient(#d1d5db 0% 25%, white 0% 50%);
|
|
795
|
-
background-size:
|
|
796
|
-
100% 100%,
|
|
797
|
-
6px 6px;
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
/* ---- EyeDropper button ---- */
|
|
802
|
-
&__eyedropper {
|
|
803
|
-
align-items: center;
|
|
804
|
-
background: transparent;
|
|
805
|
-
border: 1px solid var(--bb-border);
|
|
806
|
-
border-radius: var(--bb-radius);
|
|
807
|
-
color: var(--bb-text-muted, #6b7280);
|
|
808
|
-
cursor: pointer;
|
|
809
|
-
display: flex;
|
|
810
|
-
flex-shrink: 0;
|
|
811
|
-
height: 32px;
|
|
812
|
-
justify-content: center;
|
|
813
|
-
outline: none;
|
|
814
|
-
padding: 0;
|
|
815
|
-
transition:
|
|
816
|
-
background 100ms ease,
|
|
817
|
-
color 100ms ease,
|
|
818
|
-
border-color 100ms ease;
|
|
819
|
-
width: 32px;
|
|
820
|
-
|
|
821
|
-
&:hover {
|
|
822
|
-
background: rgba(0, 0, 0, 0.05);
|
|
823
|
-
border-color: #9ca3af;
|
|
824
|
-
color: var(--bb-text, #111827);
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
&:focus-visible {
|
|
828
|
-
box-shadow: 0 0 0 var(--bb-ring-size) var(--bb-ring);
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
&:disabled {
|
|
832
|
-
cursor: default;
|
|
833
|
-
opacity: 0.4;
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
/* ---- Slider group ---- */
|
|
838
|
-
&__sliders {
|
|
839
|
-
display: flex;
|
|
840
|
-
flex: 1;
|
|
841
|
-
flex-direction: column;
|
|
842
|
-
gap: 10px;
|
|
843
|
-
min-width: 0;
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
&__slider-wrap {
|
|
847
|
-
border-radius: 100px;
|
|
848
|
-
cursor: pointer;
|
|
849
|
-
height: 12px;
|
|
850
|
-
outline: none;
|
|
851
|
-
position: relative;
|
|
852
|
-
touch-action: none;
|
|
853
|
-
|
|
854
|
-
&:focus-visible {
|
|
855
|
-
box-shadow: 0 0 0 var(--bb-ring-size) var(--bb-ring);
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
/* Checkerboard base for alpha slider */
|
|
859
|
-
&--alpha {
|
|
860
|
-
background-image: repeating-conic-gradient(#d1d5db 0% 25%, white 0% 50%);
|
|
861
|
-
background-size: 6px 6px;
|
|
862
|
-
border-radius: 100px;
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
&__slider-track {
|
|
867
|
-
border-radius: 100px;
|
|
868
|
-
display: block;
|
|
869
|
-
height: 100%;
|
|
870
|
-
width: 100%;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
&__slider-thumb {
|
|
874
|
-
background: white;
|
|
875
|
-
border: 2px solid white;
|
|
876
|
-
border-radius: 50%;
|
|
877
|
-
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
|
|
878
|
-
height: 16px;
|
|
879
|
-
pointer-events: none;
|
|
880
|
-
position: absolute;
|
|
881
|
-
top: 50%;
|
|
882
|
-
transform: translate(-50%, -50%);
|
|
883
|
-
width: 16px;
|
|
884
|
-
will-change: left;
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
/* ---- Swatches ---- */
|
|
888
|
-
/* Columns stretch equally to fill the full container width, so 6 default columns
|
|
889
|
-
each become ~38 px wide. Custom arrays with more or fewer columns adapt
|
|
890
|
-
automatically — the swatch always uses the full available space. */
|
|
891
|
-
&__swatches {
|
|
892
|
-
border-top: 1px solid var(--bb-border);
|
|
893
|
-
display: flex;
|
|
894
|
-
gap: 4px;
|
|
895
|
-
padding-top: 10px;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
&__swatch-group {
|
|
899
|
-
display: flex;
|
|
900
|
-
flex: 1;
|
|
901
|
-
flex-direction: column;
|
|
902
|
-
gap: 3px;
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
&__swatch {
|
|
906
|
-
border: none;
|
|
907
|
-
border-radius: var(--bb-radius-sm);
|
|
908
|
-
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
|
|
909
|
-
cursor: pointer;
|
|
910
|
-
height: 20px;
|
|
911
|
-
outline: none;
|
|
912
|
-
padding: 0;
|
|
913
|
-
transition:
|
|
914
|
-
filter 100ms ease,
|
|
915
|
-
box-shadow 100ms ease;
|
|
916
|
-
width: 100%;
|
|
917
|
-
|
|
918
|
-
&:hover {
|
|
919
|
-
filter: brightness(0.9);
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
&:focus-visible {
|
|
923
|
-
box-shadow: 0 0 0 var(--bb-ring-size) var(--bb-ring);
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
/*
|
|
927
|
-
* The middle layer is the library's "panel-colored gap" idiom (see
|
|
928
|
-
* BbBaseDatePicker's selected day): it must be the surface the swatch
|
|
929
|
-
* sits on, not literal white, or in dark mode it merges with the white
|
|
930
|
-
* `--bb-primary` outer ring into one solid halo with no gap. The
|
|
931
|
-
* neighboring `white`/`#d1d5db` literals in this file sit over
|
|
932
|
-
* user-chosen colors and are scheme-independent on purpose.
|
|
933
|
-
*/
|
|
934
|
-
&--active {
|
|
935
|
-
box-shadow:
|
|
936
|
-
inset 0 0 0 1px rgba(0, 0, 0, 0.08),
|
|
937
|
-
0 0 0 2px var(--bb-panel),
|
|
938
|
-
0 0 0 3.5px var(--bb-primary);
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
```
|