bitboss-ui 3.0.0-beta.73 → 3.0.0-beta.75
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 +4 -2
- package/bin/bitboss-ui-mcp.mjs +101 -3
- package/bin/bitboss-ui.mjs +6 -1
- package/bin/cli.mjs +31 -5
- package/dist/ai/BbAvatar.md +86 -58
- package/dist/ai/BbBadge.md +5 -5
- package/dist/ai/BbBreadcrumbs.md +2 -2
- package/dist/ai/BbButton.md +2 -2
- package/dist/ai/BbCalendar.md +9 -5
- package/dist/ai/BbCheckboxGroup.md +5 -4
- package/dist/ai/BbColorInput.md +12 -0
- package/dist/ai/BbColorPalette.md +19 -15
- package/dist/ai/BbConfirmPortal.md +1 -1
- package/dist/ai/BbDatePicker.md +16 -3
- package/dist/ai/BbDatePickerInput.md +17 -1
- package/dist/ai/BbDialog.md +16 -4
- package/dist/ai/BbDropdown.md +175 -67
- package/dist/ai/BbDropdownButton.md +27 -8
- package/dist/ai/BbForm.md +4 -1
- package/dist/ai/BbHoverCardPortal.md +1 -1
- package/dist/ai/BbNumberInput.md +8 -4
- package/dist/ai/BbPopoverPortal.md +1 -1
- package/dist/ai/BbRadioGroup.md +4 -4
- package/dist/ai/BbSelect.md +79 -67
- package/dist/ai/BbSelectPopover.md +24 -5
- package/dist/ai/BbSwitchGroup.md +5 -4
- package/dist/ai/BbTable.md +59 -34
- package/dist/ai/BbTimePicker.md +16 -3
- package/dist/ai/BbTimePickerInput.md +15 -1
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbToastPortal.md +1 -1
- package/dist/ai/BbTree.md +5 -1
- package/dist/ai/CommonPopover.md +1 -0
- package/dist/ai/FlatListBox.md +1 -0
- package/dist/ai/GroupedListBox.md +1 -0
- package/dist/ai/ListBox.md +1 -0
- package/dist/ai/OptionsContainer.md +4 -4
- package/dist/ai/changelog.json +215 -6
- package/dist/ai/components.json +77 -43
- package/dist/ai/composables/useToast.md +2 -2
- package/dist/ai/design-tokens.json +60 -0
- package/dist/ai/guides/agent-contract.md +8 -4
- package/dist/ai/guides/design-tokens.md +33 -0
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/fetch-items-playbook.md +7 -11
- package/dist/ai/guides/inertia-helpers.md +613 -53
- package/dist/ai/guides/migration/adoption-checklist.md +5 -5
- package/dist/ai/guides/migration/components/bb-color-palette.md +11 -11
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +1 -0
- package/dist/ai/guides/migration/components/bb-dropdown.md +1 -0
- package/dist/ai/guides/migration/components/bb-table.md +2 -1
- package/dist/ai/guides/migration/components/bb-toast.md +2 -2
- package/dist/ai/guides/migration/v2-to-v3.md +46 -5
- package/dist/ai/guides/migration/v3-beta-tooling.md +4 -0
- package/dist/ai/guides/passthrough.md +3 -3
- package/dist/ai/guides/preset-components.md +15 -2
- package/dist/ai/guides/reporting.md +49 -0
- package/dist/ai/helpers/inertia/manifest.json +33 -38
- package/dist/ai/helpers/inertia/useHasChanged.ts +25 -37
- package/dist/ai/helpers/inertia/useQuery.ts +24 -6
- package/dist/ai/helpers/inertia/utils.ts +552 -3
- package/dist/ai/index.md +2 -1
- package/dist/ai/manifest/common.json +1 -0
- package/dist/ai/manifest/components/BbAlert.tree.json +1 -1
- package/dist/ai/manifest/components/BbAvatar.json +5 -2
- package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
- package/dist/ai/manifest/components/BbCalendar.json +2 -2
- package/dist/ai/manifest/components/BbCarousel.json +0 -3
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbColorInput.json +5 -2
- package/dist/ai/manifest/components/BbColorPalette.json +7 -4
- package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
- package/dist/ai/manifest/components/BbConfirmPortal.json +1 -1
- package/dist/ai/manifest/components/BbDatePicker.json +6 -3
- package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
- package/dist/ai/manifest/components/BbDialog.tree.json +7 -1
- package/dist/ai/manifest/components/BbDropdown.json +23 -17
- package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.tree.json +16 -5
- package/dist/ai/manifest/components/BbDropdownButton.json +15 -9
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -0
- package/dist/ai/manifest/components/BbForm.json +1 -1
- package/dist/ai/manifest/components/BbHoverCard.json +1 -1
- package/dist/ai/manifest/components/BbHoverCardPortal.json +1 -1
- package/dist/ai/manifest/components/BbNumberInput.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +2 -0
- package/dist/ai/manifest/components/BbPopover.json +1 -1
- package/dist/ai/manifest/components/BbPopoverPortal.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbSelect.json +10 -7
- package/dist/ai/manifest/components/BbSelectPopover.json +7 -4
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +5 -1
- package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -0
- package/dist/ai/manifest/components/BbTable.json +6 -6
- package/dist/ai/manifest/components/BbTable.tree.json +16 -6
- package/dist/ai/manifest/components/BbTimePicker.json +7 -4
- package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
- package/dist/ai/manifest/components/BbToastPortal.json +1 -1
- package/dist/ai/manifest/components/BbTree.json +1 -1
- package/dist/ai/manifest/components/CommonPopover.json +2 -1
- package/dist/ai/manifest/components/FlatListBox.json +2 -1
- package/dist/ai/manifest/components/GroupedListBox.json +2 -1
- package/dist/ai/manifest/components/ListBox.json +2 -1
- package/dist/ai/manifest/components/OptionsContainer.json +6 -4
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/manifest/meta.json +36 -3
- package/dist/ai/manifest/types.advanced.json +81 -80
- package/dist/ai/manifest/types.api.json +64 -65
- package/dist/ai/manifest/types.wrapper.json +155 -118
- package/dist/ai/recipes/inertia/layout-scaffold.md +3 -1
- package/dist/ai/recipes/nuxt/layout-scaffold.md +3 -1
- package/dist/ai/recipes/vue/layout-scaffold.md +3 -1
- package/dist/ai/source/BbAlert.md +16 -4
- package/dist/ai/source/BbAvatar.md +121 -9
- package/dist/ai/source/BbBadge.md +12 -5
- package/dist/ai/source/BbBreadcrumbs.md +56 -55
- package/dist/ai/source/BbButton.md +41 -25
- package/dist/ai/source/BbCalendar.md +22 -12
- package/dist/ai/source/BbCarousel.md +31 -28
- package/dist/ai/source/BbCheckboxGroup.md +15 -9
- package/dist/ai/source/BbColorInput.md +19 -0
- package/dist/ai/source/BbColorPalette.md +59 -12
- package/dist/ai/source/BbConfirm.md +7 -0
- package/dist/ai/source/BbConfirmPortal.md +9 -4
- package/dist/ai/source/BbDatePicker.md +71 -22
- package/dist/ai/source/BbDatePickerInput.md +72 -9
- package/dist/ai/source/BbDialog.md +45 -2
- package/dist/ai/source/BbDropdown.md +263 -63
- package/dist/ai/source/BbDropdownButton.md +27 -2
- package/dist/ai/source/BbDropdownGroup.md +121 -59
- package/dist/ai/source/BbForm.md +73 -6
- package/dist/ai/source/BbGallery.md +76 -55
- package/dist/ai/source/BbHost.md +12 -0
- package/dist/ai/source/BbHoverCard.md +7 -0
- package/dist/ai/source/BbHoverCardPortal.md +9 -5
- package/dist/ai/source/BbNumberInput.md +22 -16
- package/dist/ai/source/BbOffCanvas.md +48 -2
- package/dist/ai/source/BbPopover.md +7 -0
- package/dist/ai/source/BbPopoverPortal.md +9 -5
- package/dist/ai/source/BbRadio.md +4 -3
- package/dist/ai/source/BbRadioGroup.md +19 -10
- package/dist/ai/source/BbSelect.md +35 -20
- package/dist/ai/source/BbSelectPopover.md +116 -8
- package/dist/ai/source/BbSwitchGroup.md +11 -4
- package/dist/ai/source/BbTable.md +126 -32
- package/dist/ai/source/BbTag.md +10 -3
- package/dist/ai/source/BbTimePicker.md +69 -15
- package/dist/ai/source/BbTimePickerInput.md +45 -7
- package/dist/ai/source/BbToast.md +16 -2
- package/dist/ai/source/BbToastPortal.md +18 -6
- package/dist/ai/source/BbTree.md +1 -1
- package/dist/ai/source/CommonFieldInput.md +11 -5
- package/dist/ai/source/CommonPopover.md +28 -2
- package/dist/ai/source/FlatListBox.md +26 -5
- package/dist/ai/source/GroupedListBox.md +63 -11
- package/dist/ai/source/ListBox.md +4 -0
- package/dist/ai/source/OptionsContainer.md +29 -11
- package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +31 -26
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +61 -43
- package/dist/components/BbAvatar/avatarIdentity.js +25 -0
- package/dist/components/BbAvatar/ptKeys.generated.d.ts +5 -1
- package/dist/components/BbAvatar/types.d.ts +24 -5
- package/dist/components/BbAvatar/types.js +5 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -23
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +80 -79
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +152 -158
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +100 -85
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +235 -234
- package/dist/components/BbCalendar/types.d.ts +2 -2
- package/dist/components/BbCalendar/useDayGrid.js +120 -123
- package/dist/components/BbCalendar/useDayjsLocale.js +11 -8
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +126 -122
- package/dist/components/BbCheckboxGroup/types.d.ts +7 -11
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +2 -0
- package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +148 -141
- package/dist/components/BbColorInput/types.d.ts +7 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -0
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +239 -223
- package/dist/components/BbColorPalette/types.d.ts +8 -1
- package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +2 -4
- package/dist/components/BbConfirm/types.d.ts +5 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +4 -2
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +160 -143
- package/dist/components/BbDatePicker/types.d.ts +9 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +483 -496
- package/dist/components/BbDatePickerInput/types.d.ts +7 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +252 -236
- package/dist/components/BbDialog/leaveGhost.js +38 -0
- package/dist/components/BbDialog/overlayActions.js +34 -20
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +92 -87
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +419 -368
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +384 -340
- package/dist/components/BbDropdown/DropdownFailures.vue.js +4 -0
- package/dist/components/BbDropdown/DropdownFailures.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +133 -119
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +73 -45
- package/dist/components/BbDropdown/normalizeGroups.js +6 -2
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +8 -0
- package/dist/components/BbDropdown/types.d.ts +73 -58
- package/dist/components/BbDropdown/types.js +1 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +2 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +93 -72
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +48 -0
- package/dist/components/BbDropdownButton/types.d.ts +13 -2
- package/dist/components/BbDropdownButton/types.js +2 -0
- package/dist/components/BbForm/BbForm.vue.d.ts +2 -21
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +229 -227
- package/dist/components/BbForm/types.d.ts +31 -0
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +318 -296
- package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/BbHoverCard/BbHoverCardPortal.vue.d.ts +2 -5
- package/dist/components/BbHoverCard/types.d.ts +5 -0
- package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +10 -6
- package/dist/components/BbNumberInput/numberDisplay.js +102 -106
- package/dist/components/BbNumberInput/types.d.ts +4 -3
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +425 -409
- package/dist/components/BbPopover/BbPopoverPortal.vue.d.ts +2 -5
- package/dist/components/BbPopover/types.d.ts +5 -0
- package/dist/components/BbRadio/types.d.ts +4 -3
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -106
- package/dist/components/BbRadioGroup/types.d.ts +4 -7
- package/dist/components/BbSelect/BbSelect.vue.d.ts +3 -1
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +167 -163
- package/dist/components/BbSelect/types.d.ts +23 -20
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +3 -1
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +680 -637
- package/dist/components/BbSelectPopover/types.d.ts +10 -4
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +159 -155
- package/dist/components/BbSwitchGroup/types.d.ts +3 -6
- package/dist/components/BbTable/BbTable.vue.d.ts +1 -3
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1182 -1165
- package/dist/components/BbTable/BbTableDataRow.js +96 -96
- package/dist/components/BbTable/types.d.ts +11 -10
- package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +4 -2
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +157 -140
- package/dist/components/BbTimePicker/types.d.ts +9 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +3 -1
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +278 -268
- package/dist/components/BbTimePickerInput/types.d.ts +7 -0
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +12 -12
- package/dist/components/BbToast/BbToastPortal.vue.d.ts +2 -4
- package/dist/components/BbToast/types.d.ts +7 -2
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +56 -46
- package/dist/components/BbTree/types.d.ts +1 -1
- package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +36 -36
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +14 -2
- package/dist/components/CommonTimeSelector/useMeridiem.js +6 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +115 -96
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +194 -166
- package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +7 -4
- package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +86 -77
- package/dist/composables/formSubmitLock.js +2 -1
- package/dist/composables/overlayRegistry.js +52 -42
- package/dist/composables/useActiveInactiveState.js +8 -4
- package/dist/composables/useBbDialog.js +5 -5
- package/dist/composables/useItemsGetter.js +34 -32
- package/dist/composables/useOpenModel.js +20 -0
- package/dist/composables/useOwnModel.js +16 -0
- package/dist/composables/useSegmentedFields.js +31 -20
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/i18n/currencyDigits.js +58 -0
- package/dist/i18n/locales/ar.json +2 -0
- package/dist/i18n/locales/cs.json +2 -0
- package/dist/i18n/locales/da.json +2 -0
- package/dist/i18n/locales/de-CH.json +2 -0
- package/dist/i18n/locales/de.json +2 -0
- package/dist/i18n/locales/el.json +2 -0
- package/dist/i18n/locales/en-GB.json +2 -0
- package/dist/i18n/locales/en.json +2 -0
- package/dist/i18n/locales/es-MX.json +2 -0
- package/dist/i18n/locales/es.json +2 -0
- package/dist/i18n/locales/fa.json +2 -0
- package/dist/i18n/locales/fi.json +2 -0
- package/dist/i18n/locales/fr.json +2 -0
- package/dist/i18n/locales/he.json +2 -0
- package/dist/i18n/locales/hu.json +2 -0
- package/dist/i18n/locales/it.json +2 -0
- package/dist/i18n/locales/ja.json +2 -0
- package/dist/i18n/locales/ko.json +2 -0
- package/dist/i18n/locales/nb.json +2 -0
- package/dist/i18n/locales/nl.json +2 -0
- package/dist/i18n/locales/pl.json +2 -0
- package/dist/i18n/locales/pt-BR.json +2 -0
- package/dist/i18n/locales/pt-PT.json +2 -0
- package/dist/i18n/locales/ro.json +2 -0
- package/dist/i18n/locales/ru.json +2 -0
- package/dist/i18n/locales/sv.json +2 -0
- package/dist/i18n/locales/tr.json +2 -0
- package/dist/i18n/locales/uk.json +2 -0
- package/dist/i18n/locales/zh-CN.json +2 -0
- package/dist/i18n/locales/zh-HK.json +2 -0
- package/dist/i18n/locales/zh-TW.json +2 -0
- package/dist/i18n/regionDates.js +250 -0
- package/dist/i18n/regionHints.js +30 -41
- package/dist/icon-scan.js +68 -61
- package/dist/index.d.ts +35 -31
- package/dist/llms-full.txt +1428 -400
- package/dist/llms-medium.txt +8 -4
- package/dist/llms.txt +4 -2
- package/dist/locale-blueprint.json +2 -0
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +2 -1
- package/dist/types/CommonProps.d.ts +8 -0
- package/dist/types/Option.d.ts +10 -0
- package/dist/types/ptComponentMap.d.ts +3 -3
- package/dist/utilities/functions/hash.js +97 -64
- package/dist/utilities/functions/isEqual.js +33 -25
- package/dist/utilities/functions/slotContent.js +19 -0
- package/dist/utils/loadRetry.js +8 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +2 -1
- package/dist/vite.js +11 -4
- package/llms.txt +4 -2
- package/package.json +3 -2
- package/scripts/README.md +3 -1
- package/scripts/lib/adoption-checklist.json +6 -5
- package/scripts/lib/agent-manifest.mjs +33 -6
- package/scripts/lib/agent-setup.mjs +90 -24
- package/scripts/lib/cldr-pins.ts +182 -0
- package/scripts/lib/engines-include.d.mts +5 -0
- package/scripts/lib/engines-include.mjs +40 -0
- package/scripts/lib/eslint-plugin.mjs +8 -2
- package/scripts/lib/hidden-label-placeholder.mjs +25 -5
- package/scripts/lib/idiom-scan.mjs +30 -3
- package/scripts/lib/legacy-agent-files.json +152 -0
- package/scripts/lib/mcp-config.mjs +74 -7
- package/scripts/lib/portal-names.mjs +78 -8
- package/scripts/lib/release-results.mjs +5 -2
- package/scripts/lib/report.mjs +340 -0
- package/scripts/lib/run-beat.mjs +14 -0
- package/scripts/lib/run-records.mjs +313 -0
- package/scripts/lib/selector-log.mjs +98 -0
- package/scripts/lib/ticket-beat.mjs +30 -0
- package/scripts/lib/validate-bb-markup.mjs +37 -2
- package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -6,36 +6,38 @@ import { useConfigDefaults as i, useConfigSetting as a } from "../../composables
|
|
|
6
6
|
import { extractDomContainer as o } from "../../utilities/functions/extractDomContainer.js";
|
|
7
7
|
import { useClosingInert as s } from "../../composables/useClosingInert.js";
|
|
8
8
|
import { useId as ee } from "../../composables/useId.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import ie from "
|
|
13
|
-
import {
|
|
14
|
-
import oe from "../
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
9
|
+
import { useOwnModel as te } from "../../composables/useOwnModel.js";
|
|
10
|
+
import { useOpenModel as ne } from "../../composables/useOpenModel.js";
|
|
11
|
+
import { useLocale as re } from "../../composables/useLocale.js";
|
|
12
|
+
import { useEscapeStackEntry as ie } from "../../composables/useEscapeStackEntry.js";
|
|
13
|
+
import { useMobile as ae } from "../../composables/useMobile.js";
|
|
14
|
+
import oe from "../BbOffCanvas/BbOffCanvas.vue.js";
|
|
15
|
+
import { BB_OFF_CANVAS_PT as se } from "../BbOffCanvas/types.js";
|
|
16
|
+
import ce from "../CommonPopover/CommonPopover.vue.js";
|
|
17
|
+
import { removedPropsFor as le } from "../../deprecation/removedProps.js";
|
|
18
|
+
import { warnRemovedAttrs as ue } from "../../utilities/functions/warnRemovedAttrs.js";
|
|
19
|
+
import { BB_COLOR_PALETTE_PT as de } from "./types.js";
|
|
20
|
+
import { usePassthrough as fe } from "../../composables/usePassthrough.js";
|
|
21
|
+
import { withoutPt as pe } from "../../utils/passthrough.js";
|
|
20
22
|
import { transitions as c } from "../../utilities/misc/transitions.js";
|
|
21
|
-
import { Fragment as
|
|
22
|
-
import { createReusableTemplate as
|
|
23
|
+
import { Fragment as me, computed as l, createBlock as he, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as ge, guardReactiveProps as _e, mergeProps as m, nextTick as ve, normalizeClass as ye, normalizeProps as be, normalizeStyle as h, onBeforeUnmount as xe, onDeactivated as Se, openBlock as g, ref as _, renderList as Ce, renderSlot as we, toDisplayString as Te, unref as v, useAttrs as Ee, watch as y, withCtx as De } from "vue";
|
|
24
|
+
import { createReusableTemplate as Oe } from "@vueuse/core";
|
|
23
25
|
// src/components/BbColorPalette/BbColorPalette.vue?vue&type=script&setup=true&lang.ts
|
|
24
|
-
var
|
|
26
|
+
var ke = ["aria-label"], Ae = {
|
|
25
27
|
"aria-live": "polite",
|
|
26
28
|
class: "bb-color-palette__canvas-announcer",
|
|
27
29
|
role: "status"
|
|
28
|
-
},
|
|
30
|
+
}, je = { class: "bb-color-palette__controls" }, Me = { class: "bb-color-palette__preview-wrap" }, Ne = { class: "bb-color-palette__sliders" }, Pe = ["aria-label", "aria-valuenow"], Fe = ["aria-label", "aria-valuenow"], Ie = ["aria-label", "disabled"], Le = {
|
|
29
31
|
key: 0,
|
|
30
32
|
class: "bb-color-palette__swatches"
|
|
31
|
-
},
|
|
33
|
+
}, Re = [
|
|
32
34
|
"aria-label",
|
|
33
35
|
"aria-pressed",
|
|
34
36
|
"tabindex",
|
|
35
37
|
"onClick",
|
|
36
38
|
"onFocus",
|
|
37
39
|
"onKeydown"
|
|
38
|
-
],
|
|
40
|
+
], b = /*@__PURE__*/ ge({
|
|
39
41
|
inheritAttrs: !1,
|
|
40
42
|
__name: "BbColorPalette",
|
|
41
43
|
props: {
|
|
@@ -48,6 +50,7 @@ var Ee = ["aria-label"], De = {
|
|
|
48
50
|
"pt:swatch": {},
|
|
49
51
|
"pt:swatch:selected": {},
|
|
50
52
|
"pt:swatch:open": {},
|
|
53
|
+
open: { type: Boolean },
|
|
51
54
|
pt: {},
|
|
52
55
|
activator: {},
|
|
53
56
|
adaptive: {
|
|
@@ -81,78 +84,91 @@ var Ee = ["aria-label"], De = {
|
|
|
81
84
|
"show",
|
|
82
85
|
"shown",
|
|
83
86
|
"hide",
|
|
87
|
+
"update:open",
|
|
84
88
|
"hidden",
|
|
85
89
|
"update:modelValue"
|
|
86
90
|
],
|
|
87
|
-
setup(c, { emit:
|
|
88
|
-
let
|
|
91
|
+
setup(c, { emit: ge }) {
|
|
92
|
+
let b = c, x = ge, { model: ze, set: Be } = te(b, "modelValue", (e, t) => t !== null && x(e, t), () => null), Ve = a(null, "popoverOffset"), S = fe({
|
|
89
93
|
component: "BbColorPalette",
|
|
90
|
-
props:
|
|
91
|
-
parts:
|
|
92
|
-
states:
|
|
93
|
-
active: { open: () =>
|
|
94
|
-
attrs:
|
|
94
|
+
props: b,
|
|
95
|
+
parts: de.parts,
|
|
96
|
+
states: de.states,
|
|
97
|
+
active: { open: () => T.value },
|
|
98
|
+
attrs: Ee()
|
|
95
99
|
});
|
|
96
|
-
process.env.NODE_ENV !== "production" &&
|
|
97
|
-
let { t:
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
|
|
100
|
+
process.env.NODE_ENV !== "production" && ue("BbColorPalette", le("BbColorPalette"));
|
|
101
|
+
let { t: C } = re(), { isMobile: He } = ae(), Ue = ee().id.value, We = `${Ue}_panel`, [Ge, Ke] = Oe(), w = _(), qe = _(), Je = l(() => b.activator != null), Ye = (e) => {
|
|
102
|
+
w.value = o(e) ?? void 0;
|
|
103
|
+
}, Xe = (e) => {
|
|
104
|
+
qe.value = o(e) ?? void 0;
|
|
101
105
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}, { immediate: !0 }),
|
|
105
|
-
|
|
106
|
+
y(() => b.activator, (e) => {
|
|
107
|
+
w.value = o(e) ?? void 0;
|
|
108
|
+
}, { immediate: !0 }), y(() => b.anchor, (e) => {
|
|
109
|
+
qe.value = e == null ? void 0 : o(e) ?? void 0;
|
|
106
110
|
}, { immediate: !0 });
|
|
107
|
-
let
|
|
108
|
-
|
|
109
|
-
}, Xe = (e) => {
|
|
110
|
-
e.target instanceof HTMLDialogElement && (E.value = !1);
|
|
111
|
+
let Ze = l(() => qe.value ?? w.value), T = _(!1), Qe = s(T, () => b.transitionDuration), $e = null, et = (e) => {
|
|
112
|
+
b.disabled || b.readonly || (e.stopPropagation(), T.value = !T.value);
|
|
111
113
|
};
|
|
112
|
-
b
|
|
113
|
-
|
|
114
|
+
ne(b, x, {
|
|
115
|
+
isOpen: () => T.value,
|
|
116
|
+
open: () => {
|
|
117
|
+
b.disabled || b.readonly || (T.value = !0);
|
|
118
|
+
},
|
|
119
|
+
close: () => T.value = !1
|
|
114
120
|
});
|
|
115
|
-
let
|
|
116
|
-
|
|
117
|
-
()
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
let tt = (e) => {
|
|
122
|
+
let t = e.target;
|
|
123
|
+
t instanceof Node && ((H.value?.closest(".bb-common-popover"))?.contains(t) || w.value?.contains(t) || (T.value = !1));
|
|
124
|
+
};
|
|
125
|
+
y(T, async (e) => {
|
|
126
|
+
e ? (E.value = rt(), $e = document.activeElement instanceof HTMLElement ? document.activeElement : null, D.value || document.addEventListener("click", tt, {
|
|
127
|
+
passive: !0,
|
|
128
|
+
capture: !0
|
|
129
|
+
}), await ve(), H.value?.focus()) : (document.removeEventListener("click", tt, { capture: !0 }), $e?.focus(), $e = null);
|
|
130
|
+
});
|
|
131
|
+
let nt = i("BbColorPalette", b, { adaptive: !0 }), rt = () => nt.adaptive && He.value ? "canvas" : "popover", E = _(rt()), D = l(() => E.value === "canvas");
|
|
132
|
+
y([
|
|
133
|
+
() => nt.adaptive,
|
|
134
|
+
He,
|
|
135
|
+
T
|
|
120
136
|
], () => {
|
|
121
|
-
|
|
122
|
-
}),
|
|
123
|
-
let
|
|
137
|
+
T.value || (E.value = rt());
|
|
138
|
+
}), ie(() => T.value && !D.value, () => T.value = !1);
|
|
139
|
+
let it = l(() => ({
|
|
124
140
|
side: "bottom",
|
|
125
141
|
size: "auto",
|
|
126
142
|
draggable: !0,
|
|
127
143
|
hideClose: !0,
|
|
128
|
-
eager:
|
|
129
|
-
transitionDuration:
|
|
130
|
-
...
|
|
131
|
-
...
|
|
132
|
-
})),
|
|
133
|
-
|
|
134
|
-
}, O = null, k =
|
|
135
|
-
|
|
144
|
+
eager: b.eager,
|
|
145
|
+
transitionDuration: b.transitionDuration,
|
|
146
|
+
...b.offCanvasProps?.title ? {} : { "aria-labelledby": st.value },
|
|
147
|
+
...pe(b.offCanvasProps)
|
|
148
|
+
})), at = () => {
|
|
149
|
+
w.value?.focus(), x("hidden");
|
|
150
|
+
}, O = null, k = _();
|
|
151
|
+
y(w, (e) => {
|
|
136
152
|
if (O?.(), O = null, !e) return;
|
|
137
153
|
let t = !e.id;
|
|
138
|
-
t && (e.id = `${
|
|
139
|
-
e.removeEventListener("click",
|
|
154
|
+
t && (e.id = `${Ue}_activator`), k.value = e.id, e.addEventListener("click", et), O = () => {
|
|
155
|
+
e.removeEventListener("click", et), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-labelledby"), e.removeAttribute("aria-controls"), j.has(e) && (e.removeAttribute("disabled"), e.removeAttribute("aria-disabled"), j.delete(e)), t && e.removeAttribute("id"), k.value = void 0;
|
|
140
156
|
};
|
|
141
157
|
}, { immediate: !0 });
|
|
142
|
-
let
|
|
143
|
-
ref:
|
|
158
|
+
let ot = l(() => b.label ?? C("colorInput.openPicker").value), A = `${Ue}_label`, st = l(() => k.value ? `${A} ${k.value}` : A), j = /* @__PURE__ */ new WeakSet(), ct = l(() => b.disabled ? {
|
|
159
|
+
ref: Ye,
|
|
144
160
|
disabled: !0,
|
|
145
161
|
"aria-disabled": "true"
|
|
146
|
-
} : { ref:
|
|
147
|
-
|
|
162
|
+
} : { ref: Ye });
|
|
163
|
+
y([
|
|
164
|
+
w,
|
|
148
165
|
T,
|
|
149
|
-
|
|
150
|
-
() =>
|
|
151
|
-
() => x.readonly
|
|
166
|
+
() => b.disabled,
|
|
167
|
+
() => b.readonly
|
|
152
168
|
], ([e, t, n, r]) => {
|
|
153
|
-
e && (e.setAttribute("aria-labelledby", `${A} ${e.id}`), n ? (e.setAttribute("disabled", ""), e.setAttribute("aria-disabled", "true"), j.add(e)) : j.has(e) && (e.removeAttribute("disabled"), e.removeAttribute("aria-disabled"), j.delete(e)), n || r ? (e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls")) : (e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", t ? "true" : "false"), t ? e.setAttribute("aria-controls",
|
|
154
|
-
}, { immediate: !0 }),
|
|
155
|
-
O?.(), document.removeEventListener("click",
|
|
169
|
+
e && (e.setAttribute("aria-labelledby", `${A} ${e.id}`), n ? (e.setAttribute("disabled", ""), e.setAttribute("aria-disabled", "true"), j.add(e)) : j.has(e) && (e.removeAttribute("disabled"), e.removeAttribute("aria-disabled"), j.delete(e)), n || r ? (e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls")) : (e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", t ? "true" : "false"), t ? e.setAttribute("aria-controls", We) : e.removeAttribute("aria-controls")));
|
|
170
|
+
}, { immediate: !0 }), xe(() => {
|
|
171
|
+
O?.(), document.removeEventListener("click", tt, { capture: !0 });
|
|
156
172
|
});
|
|
157
173
|
function M(e, t, n) {
|
|
158
174
|
let r = (r) => {
|
|
@@ -165,7 +181,7 @@ var Ee = ["aria-label"], De = {
|
|
|
165
181
|
Math.round(r(1) * 255)
|
|
166
182
|
];
|
|
167
183
|
}
|
|
168
|
-
function
|
|
184
|
+
function lt(e, t, n) {
|
|
169
185
|
let r = e / 255, i = t / 255, a = n / 255, o = Math.max(r, i, a), s = o - Math.min(r, i, a), ee = o === 0 ? 0 : s / o, te = o, ne = 0;
|
|
170
186
|
return s !== 0 && (ne = o === r ? ((i - a) / s + (i < a ? 6 : 0)) / 6 : o === i ? ((a - r) / s + 2) / 6 : ((r - i) / s + 4) / 6), [
|
|
171
187
|
ne * 360,
|
|
@@ -173,7 +189,7 @@ var Ee = ["aria-label"], De = {
|
|
|
173
189
|
te
|
|
174
190
|
];
|
|
175
191
|
}
|
|
176
|
-
function
|
|
192
|
+
function ut(e) {
|
|
177
193
|
let t = e.replace(/^#/, "");
|
|
178
194
|
return t.length === 3 ? [
|
|
179
195
|
parseInt(t[0] + t[0], 16),
|
|
@@ -200,11 +216,11 @@ var Ee = ["aria-label"], De = {
|
|
|
200
216
|
function N(e) {
|
|
201
217
|
return Math.round(Math.max(0, Math.min(255, e))).toString(16).padStart(2, "0");
|
|
202
218
|
}
|
|
203
|
-
function
|
|
219
|
+
function dt(e, t, n, r, i) {
|
|
204
220
|
let a = `#${N(e)}${N(t)}${N(n)}`;
|
|
205
221
|
return i ? a + N(r * 255) : a;
|
|
206
222
|
}
|
|
207
|
-
let
|
|
223
|
+
let ft = [
|
|
208
224
|
[
|
|
209
225
|
"#FFCDD2",
|
|
210
226
|
"#EF9A9A",
|
|
@@ -247,13 +263,13 @@ var Ee = ["aria-label"], De = {
|
|
|
247
263
|
"#7B1FA2",
|
|
248
264
|
"#4A148C"
|
|
249
265
|
]
|
|
250
|
-
], P =
|
|
266
|
+
], P = _(0), F = _(1), I = _(1), L = _(1), R = l(() => {
|
|
251
267
|
let [e, t, n] = M(P.value, F.value, I.value);
|
|
252
|
-
return
|
|
253
|
-
}),
|
|
268
|
+
return dt(e, t, n, L.value, b.alpha);
|
|
269
|
+
}), pt = l(() => {
|
|
254
270
|
let [e, t, n] = M(P.value, F.value, I.value);
|
|
255
|
-
return
|
|
256
|
-
}),
|
|
271
|
+
return b.alpha ? `rgba(${e},${t},${n},${L.value})` : `rgb(${e},${t},${n})`;
|
|
272
|
+
}), mt = l(() => !!b.swatches), z = l(() => Array.isArray(b.swatches) ? b.swatches : ft), B = _(null), ht = _(null), V = _(null), H = _(null), U = _(null), W = _(null), G = () => {
|
|
257
273
|
let e = B.value;
|
|
258
274
|
if (!e || e.width === 0 || e.height === 0) return;
|
|
259
275
|
let t = e.getContext("2d");
|
|
@@ -262,8 +278,8 @@ var Ee = ["aria-label"], De = {
|
|
|
262
278
|
a.addColorStop(0, "#ffffff"), a.addColorStop(1, `rgb(${n},${r},${i})`), t.fillStyle = a, t.fillRect(0, 0, e.width, e.height);
|
|
263
279
|
let o = t.createLinearGradient(0, 0, 0, e.height);
|
|
264
280
|
o.addColorStop(0, "rgba(0,0,0,0)"), o.addColorStop(1, "rgba(0,0,0,1)"), t.fillStyle = o, t.fillRect(0, 0, e.width, e.height);
|
|
265
|
-
},
|
|
266
|
-
let e =
|
|
281
|
+
}, gt = () => {
|
|
282
|
+
let e = ht.value;
|
|
267
283
|
if (!e || e.width === 0 || e.height === 0) return;
|
|
268
284
|
let t = e.getContext("2d");
|
|
269
285
|
if (!t) return;
|
|
@@ -278,33 +294,33 @@ var Ee = ["aria-label"], De = {
|
|
|
278
294
|
t.clearRect(0, 0, e.width, e.height);
|
|
279
295
|
let [n, r, i] = M(P.value, F.value, I.value), a = t.createLinearGradient(0, 0, e.width, 0);
|
|
280
296
|
a.addColorStop(0, `rgba(${n},${r},${i},0)`), a.addColorStop(1, `rgba(${n},${r},${i},1)`), t.fillStyle = a, t.fillRect(0, 0, e.width, e.height);
|
|
281
|
-
},
|
|
282
|
-
G(),
|
|
283
|
-
}, q = null,
|
|
297
|
+
}, _t = () => {
|
|
298
|
+
G(), gt(), b.alpha && K();
|
|
299
|
+
}, q = null, vt = (e) => {
|
|
284
300
|
e.width = e.offsetWidth, e.height = e.offsetHeight;
|
|
285
|
-
}, ht = () => {
|
|
286
|
-
let e = B.value, t = dt.value;
|
|
287
|
-
e && t && e.offsetWidth !== 0 && (mt(e), mt(t), x.alpha && V.value && mt(V.value), pt());
|
|
288
|
-
}, gt = !1, _t = () => {
|
|
289
|
-
P.value = 0, F.value = 1, I.value = 1, L.value = 1, Tt.value = "", Y.value = !1, X.value = !1, Z.value = !1, Q.value = !1, zt = void 0;
|
|
290
|
-
}, vt = () => {
|
|
291
|
-
gt = !0, q = new ResizeObserver(ht), B.value && q.observe(B.value), xt(x.modelValue), ht();
|
|
292
301
|
}, yt = () => {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
302
|
+
let e = B.value, t = ht.value;
|
|
303
|
+
e && t && e.offsetWidth !== 0 && (vt(e), vt(t), b.alpha && V.value && vt(V.value), _t());
|
|
304
|
+
}, bt = !1, xt = () => {
|
|
305
|
+
P.value = 0, F.value = 1, I.value = 1, L.value = 1, kt.value = "", Y.value = !1, X.value = !1, Z.value = !1, Q.value = !1, Ut = void 0;
|
|
306
|
+
}, St = () => {
|
|
307
|
+
bt = !0, q = new ResizeObserver(yt), B.value && q.observe(B.value), Tt(ze.value), yt();
|
|
308
|
+
}, Ct = () => {
|
|
309
|
+
bt = !1, q?.disconnect(), q = null, xt();
|
|
310
|
+
}, wt = l(() => m({
|
|
311
|
+
id: We,
|
|
296
312
|
class: "bb-color-palette__panel",
|
|
297
|
-
inert:
|
|
298
|
-
}, D.value ? {} :
|
|
313
|
+
inert: Qe.value
|
|
314
|
+
}, D.value ? {} : S.panel ?? {})), Tt = (e) => {
|
|
299
315
|
if (e) try {
|
|
300
|
-
let [t, n, r, i] =
|
|
316
|
+
let [t, n, r, i] = ut(e), [a, o, s] = lt(t, n, r);
|
|
301
317
|
o > .01 && (P.value = a), F.value = o, I.value = s, L.value = i;
|
|
302
318
|
} catch {}
|
|
303
319
|
};
|
|
304
|
-
|
|
305
|
-
|
|
320
|
+
y(() => ze.value, (e) => {
|
|
321
|
+
bt && (e && e === R.value || (e ? Tt(e) : (P.value = 0, F.value = 1, I.value = 1, L.value = 1), G(), b.alpha && K()));
|
|
306
322
|
});
|
|
307
|
-
let J = () =>
|
|
323
|
+
let J = () => Be(R.value), Y = _(!1), Et = (e) => {
|
|
308
324
|
let t = H.value;
|
|
309
325
|
if (!t) return {
|
|
310
326
|
s: F.value,
|
|
@@ -315,19 +331,19 @@ var Ee = ["aria-label"], De = {
|
|
|
315
331
|
s: Math.max(0, Math.min(1, (e.clientX - n.left) / n.width)),
|
|
316
332
|
v: Math.max(0, Math.min(1, 1 - (e.clientY - n.top) / n.height))
|
|
317
333
|
};
|
|
318
|
-
}, Ct = (e) => {
|
|
319
|
-
H.value?.setPointerCapture(e.pointerId), Y.value = !0;
|
|
320
|
-
let { s: t, v: n } = St(e);
|
|
321
|
-
F.value = t, I.value = n, x.alpha && K(), J();
|
|
322
|
-
}, wt = (e) => {
|
|
323
|
-
if (!Y.value) return;
|
|
324
|
-
let { s: t, v: n } = St(e);
|
|
325
|
-
F.value = t, I.value = n, x.alpha && K(), J();
|
|
326
|
-
}, Tt = v(""), Et = () => {
|
|
327
|
-
Tt.value = w("colorInput.mainCanvasSelectedColor", R.value).value;
|
|
328
334
|
}, Dt = (e) => {
|
|
329
|
-
H.value?.
|
|
335
|
+
H.value?.setPointerCapture(e.pointerId), Y.value = !0;
|
|
336
|
+
let { s: t, v: n } = Et(e);
|
|
337
|
+
F.value = t, I.value = n, b.alpha && K(), J();
|
|
330
338
|
}, Ot = (e) => {
|
|
339
|
+
if (!Y.value) return;
|
|
340
|
+
let { s: t, v: n } = Et(e);
|
|
341
|
+
F.value = t, I.value = n, b.alpha && K(), J();
|
|
342
|
+
}, kt = _(""), At = () => {
|
|
343
|
+
kt.value = C("colorInput.mainCanvasSelectedColor", R.value).value;
|
|
344
|
+
}, jt = (e) => {
|
|
345
|
+
H.value?.releasePointerCapture(e.pointerId), Y.value && At(), Y.value = !1;
|
|
346
|
+
}, Mt = (e) => {
|
|
331
347
|
let t = e.shiftKey ? .05 : .01;
|
|
332
348
|
switch (e.key) {
|
|
333
349
|
case "ArrowLeft":
|
|
@@ -344,19 +360,19 @@ var Ee = ["aria-label"], De = {
|
|
|
344
360
|
break;
|
|
345
361
|
default: return;
|
|
346
362
|
}
|
|
347
|
-
|
|
348
|
-
}, X =
|
|
363
|
+
b.alpha && K(), J(), At(), e.preventDefault();
|
|
364
|
+
}, X = _(!1), Nt = (e) => {
|
|
349
365
|
let t = U.value;
|
|
350
366
|
if (!t) return P.value;
|
|
351
367
|
let n = t.getBoundingClientRect();
|
|
352
368
|
return Math.max(0, Math.min(360, (e.clientX - n.left) / n.width * 360));
|
|
353
|
-
},
|
|
354
|
-
U.value?.setPointerCapture(e.pointerId), X.value = !0, P.value =
|
|
355
|
-
},
|
|
356
|
-
X.value && (P.value =
|
|
357
|
-
},
|
|
369
|
+
}, Pt = (e) => {
|
|
370
|
+
U.value?.setPointerCapture(e.pointerId), X.value = !0, P.value = Nt(e), G(), b.alpha && K(), J();
|
|
371
|
+
}, Ft = (e) => {
|
|
372
|
+
X.value && (P.value = Nt(e), G(), b.alpha && K(), J());
|
|
373
|
+
}, It = (e) => {
|
|
358
374
|
U.value?.releasePointerCapture(e.pointerId), X.value = !1;
|
|
359
|
-
},
|
|
375
|
+
}, Lt = (e) => {
|
|
360
376
|
let t = e.shiftKey ? 10 : 1;
|
|
361
377
|
switch (e.key) {
|
|
362
378
|
case "ArrowLeft":
|
|
@@ -367,19 +383,19 @@ var Ee = ["aria-label"], De = {
|
|
|
367
383
|
break;
|
|
368
384
|
default: return;
|
|
369
385
|
}
|
|
370
|
-
G(),
|
|
371
|
-
}, Z =
|
|
386
|
+
G(), b.alpha && K(), J(), e.preventDefault();
|
|
387
|
+
}, Z = _(!1), Rt = (e) => {
|
|
372
388
|
let t = W.value;
|
|
373
389
|
if (!t) return L.value;
|
|
374
390
|
let n = t.getBoundingClientRect();
|
|
375
391
|
return Math.max(0, Math.min(1, (e.clientX - n.left) / n.width));
|
|
376
|
-
},
|
|
377
|
-
W.value?.setPointerCapture(e.pointerId), Z.value = !0, L.value =
|
|
378
|
-
},
|
|
379
|
-
Z.value && (L.value =
|
|
380
|
-
},
|
|
392
|
+
}, zt = (e) => {
|
|
393
|
+
W.value?.setPointerCapture(e.pointerId), Z.value = !0, L.value = Rt(e), J();
|
|
394
|
+
}, Bt = (e) => {
|
|
395
|
+
Z.value && (L.value = Rt(e), J());
|
|
396
|
+
}, Vt = (e) => {
|
|
381
397
|
W.value?.releasePointerCapture(e.pointerId), Z.value = !1;
|
|
382
|
-
},
|
|
398
|
+
}, Ht = (e) => {
|
|
383
399
|
let t = e.shiftKey ? .05 : .01;
|
|
384
400
|
switch (e.key) {
|
|
385
401
|
case "ArrowLeft":
|
|
@@ -391,16 +407,16 @@ var Ee = ["aria-label"], De = {
|
|
|
391
407
|
default: return;
|
|
392
408
|
}
|
|
393
409
|
J(), e.preventDefault();
|
|
394
|
-
},
|
|
395
|
-
if (
|
|
410
|
+
}, Ut, Wt = () => Ut ??= typeof window < "u" && "EyeDropper" in window, Q = _(!1), Gt = async () => {
|
|
411
|
+
if (Wt()) try {
|
|
396
412
|
Q.value = !0;
|
|
397
413
|
let e = await new window.EyeDropper().open();
|
|
398
|
-
|
|
414
|
+
Zt(e.sRGBHex);
|
|
399
415
|
} catch {} finally {
|
|
400
416
|
Q.value = !1;
|
|
401
417
|
}
|
|
402
|
-
},
|
|
403
|
-
let e =
|
|
418
|
+
}, Kt = _(null), qt = (e) => e && z.value[e[0]]?.[e[1]] !== void 0 ? e : null, Jt = l(() => {
|
|
419
|
+
let e = qt(Kt.value);
|
|
404
420
|
if (e) return e;
|
|
405
421
|
let t = z.value;
|
|
406
422
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -409,7 +425,7 @@ var Ee = ["aria-label"], De = {
|
|
|
409
425
|
}
|
|
410
426
|
let n = t.findIndex((e) => e.length > 0);
|
|
411
427
|
return [Math.max(n, 0), 0];
|
|
412
|
-
}),
|
|
428
|
+
}), Yt = (e, t) => Jt.value[0] === e && Jt.value[1] === t ? 0 : -1, Xt = (t, n, r) => {
|
|
413
429
|
if (t.altKey || t.ctrlKey || t.metaKey || t.shiftKey) return;
|
|
414
430
|
let i = z.value, a = e(t.key, t.currentTarget), o = null;
|
|
415
431
|
if (a) {
|
|
@@ -429,64 +445,64 @@ var Ee = ["aria-label"], De = {
|
|
|
429
445
|
e !== -1 && (o = [e, i[e].length - 1]);
|
|
430
446
|
} else return;
|
|
431
447
|
t.preventDefault(), o && (t.currentTarget.closest(".bb-color-palette__swatches")?.children[o[0]]?.children[o[1]])?.focus();
|
|
432
|
-
}, $ = (e) => R.value.slice(0, 7).toLowerCase() === e.slice(0, 7).toLowerCase(),
|
|
433
|
-
let [t, n, r, i] =
|
|
434
|
-
o > .01 && (P.value = a), F.value = o, I.value = s, L.value = i, G(),
|
|
448
|
+
}, $ = (e) => R.value.slice(0, 7).toLowerCase() === e.slice(0, 7).toLowerCase(), Zt = (e) => {
|
|
449
|
+
let [t, n, r, i] = ut(e), [a, o, s] = lt(t, n, r);
|
|
450
|
+
o > .01 && (P.value = a), F.value = o, I.value = s, L.value = i, G(), b.alpha && K(), J();
|
|
435
451
|
};
|
|
436
|
-
return
|
|
437
|
-
|
|
438
|
-
}), (e, i) => (
|
|
439
|
-
|
|
440
|
-
props:
|
|
441
|
-
anchorProps: { ref:
|
|
442
|
-
open:
|
|
443
|
-
value:
|
|
452
|
+
return Se(() => {
|
|
453
|
+
T.value = !1;
|
|
454
|
+
}), (e, i) => (g(), d(me, null, [
|
|
455
|
+
Je.value ? u("", !0) : we(e.$slots, "activator", be(_e({
|
|
456
|
+
props: ct.value,
|
|
457
|
+
anchorProps: { ref: Xe },
|
|
458
|
+
open: T.value,
|
|
459
|
+
value: v(ze),
|
|
444
460
|
disabled: c.disabled
|
|
445
461
|
})), void 0, void 0, 0),
|
|
446
|
-
|
|
462
|
+
f("span", {
|
|
447
463
|
id: A,
|
|
448
464
|
hidden: ""
|
|
449
|
-
},
|
|
450
|
-
|
|
451
|
-
default:
|
|
452
|
-
|
|
465
|
+
}, Te(ot.value), 1),
|
|
466
|
+
p(v(Ge), null, {
|
|
467
|
+
default: De(() => [
|
|
468
|
+
f("div", {
|
|
453
469
|
ref_key: "canvasWrapRef",
|
|
454
470
|
ref: H,
|
|
455
|
-
"aria-label":
|
|
471
|
+
"aria-label": v(C)("colorInput.mainCanvasDesc").value,
|
|
456
472
|
class: "bb-color-palette__canvas-wrap",
|
|
457
473
|
"data-bb-no-drag": "",
|
|
458
474
|
role: "application",
|
|
459
475
|
tabindex: "0",
|
|
460
|
-
onKeydown:
|
|
461
|
-
onPointercancel:
|
|
462
|
-
onPointerdown:
|
|
463
|
-
onPointermove:
|
|
464
|
-
onPointerup:
|
|
465
|
-
onVnodeBeforeUnmount:
|
|
466
|
-
onVnodeMounted:
|
|
467
|
-
}, [
|
|
476
|
+
onKeydown: Mt,
|
|
477
|
+
onPointercancel: jt,
|
|
478
|
+
onPointerdown: Dt,
|
|
479
|
+
onPointermove: Ot,
|
|
480
|
+
onPointerup: jt,
|
|
481
|
+
onVnodeBeforeUnmount: Ct,
|
|
482
|
+
onVnodeMounted: St
|
|
483
|
+
}, [f("canvas", {
|
|
468
484
|
ref_key: "mainCanvasRef",
|
|
469
485
|
ref: B,
|
|
470
486
|
"aria-hidden": "true",
|
|
471
487
|
class: "bb-color-palette__canvas"
|
|
472
|
-
}, null, 512),
|
|
488
|
+
}, null, 512), f("div", {
|
|
473
489
|
"aria-hidden": "true",
|
|
474
490
|
class: "bb-color-palette__canvas-thumb",
|
|
475
|
-
style:
|
|
491
|
+
style: h({
|
|
476
492
|
left: `${F.value * 100}%`,
|
|
477
493
|
top: `${(1 - I.value) * 100}%`
|
|
478
494
|
})
|
|
479
|
-
}, null, 4)], 40,
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
class:
|
|
484
|
-
style:
|
|
495
|
+
}, null, 4)], 40, ke),
|
|
496
|
+
f("div", Ae, Te(kt.value), 1),
|
|
497
|
+
f("div", je, [
|
|
498
|
+
f("div", Me, [f("div", {
|
|
499
|
+
class: ye(["bb-color-palette__preview", { "bb-color-palette__preview--alpha": c.alpha }]),
|
|
500
|
+
style: h({ "--picker-preview-color": pt.value })
|
|
485
501
|
}, null, 6)]),
|
|
486
|
-
|
|
502
|
+
f("div", Ne, [f("div", {
|
|
487
503
|
ref_key: "hueWrapRef",
|
|
488
504
|
ref: U,
|
|
489
|
-
"aria-label":
|
|
505
|
+
"aria-label": v(C)("colorInput.hueCanvasDesc").value,
|
|
490
506
|
"aria-valuemax": "360",
|
|
491
507
|
"aria-valuemin": "0",
|
|
492
508
|
"aria-valuenow": Math.round(P.value),
|
|
@@ -494,25 +510,25 @@ var Ee = ["aria-label"], De = {
|
|
|
494
510
|
"data-bb-no-drag": "",
|
|
495
511
|
role: "slider",
|
|
496
512
|
tabindex: "0",
|
|
497
|
-
onKeydown:
|
|
498
|
-
onPointercancel:
|
|
499
|
-
onPointerdown:
|
|
500
|
-
onPointermove:
|
|
501
|
-
onPointerup:
|
|
502
|
-
}, [
|
|
513
|
+
onKeydown: Lt,
|
|
514
|
+
onPointercancel: It,
|
|
515
|
+
onPointerdown: Pt,
|
|
516
|
+
onPointermove: Ft,
|
|
517
|
+
onPointerup: It
|
|
518
|
+
}, [f("canvas", {
|
|
503
519
|
ref_key: "hueCanvasRef",
|
|
504
|
-
ref:
|
|
520
|
+
ref: ht,
|
|
505
521
|
"aria-hidden": "true",
|
|
506
522
|
class: "bb-color-palette__slider-track"
|
|
507
|
-
}, null, 512),
|
|
523
|
+
}, null, 512), f("div", {
|
|
508
524
|
"aria-hidden": "true",
|
|
509
525
|
class: "bb-color-palette__slider-thumb",
|
|
510
|
-
style:
|
|
511
|
-
}, null, 4)], 40,
|
|
526
|
+
style: h({ left: `${P.value / 360 * 100}%` })
|
|
527
|
+
}, null, 4)], 40, Pe), c.alpha ? (g(), d("div", {
|
|
512
528
|
key: 0,
|
|
513
529
|
ref_key: "alphaWrapRef",
|
|
514
530
|
ref: W,
|
|
515
|
-
"aria-label":
|
|
531
|
+
"aria-label": v(C)("colorInput.alphaSliderDesc").value,
|
|
516
532
|
"aria-valuemax": "100",
|
|
517
533
|
"aria-valuemin": "0",
|
|
518
534
|
"aria-valuenow": Math.round(L.value * 100),
|
|
@@ -520,91 +536,91 @@ var Ee = ["aria-label"], De = {
|
|
|
520
536
|
"data-bb-no-drag": "",
|
|
521
537
|
role: "slider",
|
|
522
538
|
tabindex: "0",
|
|
523
|
-
onKeydown:
|
|
524
|
-
onPointercancel:
|
|
525
|
-
onPointerdown:
|
|
526
|
-
onPointermove:
|
|
527
|
-
onPointerup:
|
|
528
|
-
}, [
|
|
539
|
+
onKeydown: Ht,
|
|
540
|
+
onPointercancel: Vt,
|
|
541
|
+
onPointerdown: zt,
|
|
542
|
+
onPointermove: Bt,
|
|
543
|
+
onPointerup: Vt
|
|
544
|
+
}, [f("canvas", {
|
|
529
545
|
ref_key: "alphaCanvasRef",
|
|
530
546
|
ref: V,
|
|
531
547
|
"aria-hidden": "true",
|
|
532
548
|
class: "bb-color-palette__slider-track"
|
|
533
|
-
}, null, 512),
|
|
549
|
+
}, null, 512), f("div", {
|
|
534
550
|
"aria-hidden": "true",
|
|
535
551
|
class: "bb-color-palette__slider-thumb",
|
|
536
|
-
style:
|
|
537
|
-
}, null, 4)], 40,
|
|
538
|
-
|
|
552
|
+
style: h({ left: `${L.value * 100}%` })
|
|
553
|
+
}, null, 4)], 40, Fe)) : u("", !0)]),
|
|
554
|
+
Wt() && c.eyeDropper ? (g(), d("button", {
|
|
539
555
|
key: 0,
|
|
540
|
-
"aria-label":
|
|
556
|
+
"aria-label": v(C)("colorInput.eyeDropper").value,
|
|
541
557
|
class: "bb-color-palette__eyedropper",
|
|
542
558
|
disabled: Q.value || void 0,
|
|
543
559
|
type: "button",
|
|
544
|
-
onClick:
|
|
545
|
-
}, [
|
|
546
|
-
icon:
|
|
560
|
+
onClick: Gt
|
|
561
|
+
}, [p(t, {
|
|
562
|
+
icon: v(n),
|
|
547
563
|
size: "16"
|
|
548
|
-
}, null, 8, ["icon"])], 8,
|
|
564
|
+
}, null, 8, ["icon"])], 8, Ie)) : u("", !0)
|
|
549
565
|
]),
|
|
550
|
-
|
|
566
|
+
mt.value ? (g(), d("div", Le, [(g(!0), d(me, null, Ce(z.value, (e, t) => (g(), d("div", {
|
|
551
567
|
key: t,
|
|
552
568
|
class: "bb-color-palette__swatch-group"
|
|
553
|
-
}, [(
|
|
569
|
+
}, [(g(!0), d(me, null, Ce(e, (e, n) => (g(), d("button", m({
|
|
554
570
|
key: e,
|
|
555
571
|
"aria-label": e,
|
|
556
572
|
"aria-pressed": $(e),
|
|
557
573
|
class: ["bb-color-palette__swatch", { "bb-color-palette__swatch--active": $(e) }],
|
|
558
574
|
style: { background: e },
|
|
559
|
-
tabindex:
|
|
575
|
+
tabindex: Yt(t, n),
|
|
560
576
|
type: "button",
|
|
561
|
-
onClick: (t) =>
|
|
562
|
-
onFocus: (e) =>
|
|
563
|
-
onKeydown: (e) =>
|
|
564
|
-
}, { ref_for: !0 },
|
|
577
|
+
onClick: (t) => Zt(e),
|
|
578
|
+
onFocus: (e) => Kt.value = [t, n],
|
|
579
|
+
onKeydown: (e) => Xt(e, t, n)
|
|
580
|
+
}, { ref_for: !0 }, v(S).part?.("swatch", { selected: $(e) })), null, 16, Re))), 128))]))), 128))])) : u("", !0)
|
|
565
581
|
]),
|
|
566
582
|
_: 1
|
|
567
583
|
}),
|
|
568
|
-
D.value ? (
|
|
584
|
+
D.value ? (g(), he(oe, m({
|
|
569
585
|
key: 1,
|
|
570
|
-
modelValue:
|
|
571
|
-
"onUpdate:modelValue": i[0] ||= (e) =>
|
|
586
|
+
modelValue: T.value,
|
|
587
|
+
"onUpdate:modelValue": i[0] ||= (e) => T.value = e,
|
|
572
588
|
class: "bb-color-palette__sheet",
|
|
573
|
-
pt:
|
|
589
|
+
pt: v(S).forward({
|
|
574
590
|
panel: "root",
|
|
575
591
|
sheet: "root"
|
|
576
|
-
},
|
|
577
|
-
},
|
|
578
|
-
onHidden:
|
|
579
|
-
onHide: i[1] ||= (e) =>
|
|
580
|
-
onShow: i[2] ||= (e) =>
|
|
581
|
-
onShown: i[3] ||= (e) =>
|
|
592
|
+
}, v(se).states, () => c.offCanvasProps?.pt)
|
|
593
|
+
}, m(it.value, v(r)(v(S).forwardAttrs)), {
|
|
594
|
+
onHidden: at,
|
|
595
|
+
onHide: i[1] ||= (e) => x("hide"),
|
|
596
|
+
onShow: i[2] ||= (e) => x("show"),
|
|
597
|
+
onShown: i[3] ||= (e) => x("shown")
|
|
582
598
|
}), {
|
|
583
|
-
default:
|
|
599
|
+
default: De(() => [f("div", be(_e(wt.value)), [p(v(Ke))], 16)]),
|
|
584
600
|
_: 1
|
|
585
|
-
}, 16, ["modelValue", "pt"])) : (
|
|
601
|
+
}, 16, ["modelValue", "pt"])) : (g(), he(ce, m({
|
|
586
602
|
key: 2,
|
|
587
|
-
modelValue:
|
|
588
|
-
"onUpdate:modelValue": i[4] ||= (e) =>
|
|
589
|
-
anchor:
|
|
590
|
-
"aria-label":
|
|
603
|
+
modelValue: T.value,
|
|
604
|
+
"onUpdate:modelValue": i[4] ||= (e) => T.value = e,
|
|
605
|
+
anchor: Ze.value,
|
|
606
|
+
"aria-label": v(C)("colorInput.dialogLabel").value,
|
|
591
607
|
boundary: c.boundary,
|
|
592
|
-
"bubble-attrs":
|
|
608
|
+
"bubble-attrs": wt.value,
|
|
593
609
|
class: "bb-color-palette",
|
|
594
610
|
dialog: "",
|
|
595
611
|
"disable-flip": c.disableFlip,
|
|
596
612
|
eager: c.eager,
|
|
597
613
|
"hide-arrow": "",
|
|
598
|
-
offset: c.offset ??
|
|
614
|
+
offset: c.offset ?? v(Ve)() ?? 4,
|
|
599
615
|
padding: c.padding,
|
|
600
616
|
placement: c.placement,
|
|
601
617
|
"transition-duration": c.transitionDuration,
|
|
602
|
-
onHidden: i[5] ||= (e) =>
|
|
603
|
-
onHide: i[6] ||= (e) =>
|
|
604
|
-
onShow: i[7] ||= (e) =>
|
|
605
|
-
onShown: i[8] ||= (e) =>
|
|
606
|
-
},
|
|
607
|
-
default:
|
|
618
|
+
onHidden: i[5] ||= (e) => x("hidden"),
|
|
619
|
+
onHide: i[6] ||= (e) => x("hide"),
|
|
620
|
+
onShow: i[7] ||= (e) => x("show"),
|
|
621
|
+
onShown: i[8] ||= (e) => x("shown")
|
|
622
|
+
}, v(S).rootAttrs), {
|
|
623
|
+
default: De(() => [p(v(Ke))]),
|
|
608
624
|
_: 1
|
|
609
625
|
}, 16, [
|
|
610
626
|
"modelValue",
|
|
@@ -622,4 +638,4 @@ var Ee = ["aria-label"], De = {
|
|
|
622
638
|
], 64));
|
|
623
639
|
}
|
|
624
640
|
});
|
|
625
|
-
export {
|
|
641
|
+
export { b as default };
|