bitboss-ui 3.0.0-beta.74 → 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/dist/ai/BbAvatar.md +86 -58
- package/dist/ai/BbBadge.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +2 -2
- package/dist/ai/BbButton.md +2 -2
- package/dist/ai/BbCalendar.md +5 -2
- package/dist/ai/BbCheckboxGroup.md +5 -4
- package/dist/ai/BbColorInput.md +12 -0
- package/dist/ai/BbColorPalette.md +11 -6
- package/dist/ai/BbDatePicker.md +12 -0
- package/dist/ai/BbDatePickerInput.md +17 -1
- package/dist/ai/BbDialog.md +3 -1
- package/dist/ai/BbDropdown.md +155 -60
- package/dist/ai/BbDropdownButton.md +25 -6
- package/dist/ai/BbNumberInput.md +3 -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 +17 -16
- package/dist/ai/BbTimePicker.md +12 -0
- package/dist/ai/BbTimePickerInput.md +15 -1
- package/dist/ai/BbToast.md +3 -2
- 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 +163 -6
- package/dist/ai/components.json +32 -34
- 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 +13 -0
- package/dist/ai/guides/fetch-items-playbook.md +7 -11
- 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 +22 -5
- package/dist/ai/guides/migration/v3-beta-tooling.md +1 -0
- package/dist/ai/guides/passthrough.md +3 -3
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/index.md +1 -1
- package/dist/ai/manifest/common.json +1 -0
- package/dist/ai/manifest/components/BbAvatar.json +5 -2
- package/dist/ai/manifest/components/BbAvatar.tree.json +32 -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 +5 -2
- package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
- package/dist/ai/manifest/components/BbDatePicker.json +3 -0
- package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
- package/dist/ai/manifest/components/BbDialog.tree.json +2 -0
- package/dist/ai/manifest/components/BbDropdown.json +20 -14
- package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
- package/dist/ai/manifest/components/BbDropdown.tree.json +13 -3
- package/dist/ai/manifest/components/BbDropdownButton.json +13 -7
- 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/BbOffCanvas.tree.json +2 -0
- 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 +6 -3
- 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 +4 -0
- package/dist/ai/manifest/components/BbTimePicker.json +5 -2
- package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
- package/dist/ai/manifest/components/BbTree.json +1 -1
- package/dist/ai/manifest/components/CommonPopover.json +1 -0
- 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 +0 -3
- package/dist/ai/manifest/types.advanced.json +6 -6
- package/dist/ai/manifest/types.api.json +1 -3
- package/dist/ai/source/BbAvatar.md +119 -9
- package/dist/ai/source/BbBadge.md +12 -5
- package/dist/ai/source/BbBreadcrumbs.md +52 -54
- package/dist/ai/source/BbButton.md +41 -25
- 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 +18 -0
- package/dist/ai/source/BbDatePicker.md +18 -0
- package/dist/ai/source/BbDatePickerInput.md +40 -1
- package/dist/ai/source/BbDialog.md +14 -1
- package/dist/ai/source/BbDropdown.md +211 -39
- package/dist/ai/source/BbDropdownButton.md +27 -2
- package/dist/ai/source/BbDropdownGroup.md +104 -38
- package/dist/ai/source/BbGallery.md +76 -55
- package/dist/ai/source/BbHost.md +12 -0
- package/dist/ai/source/BbNumberInput.md +17 -10
- package/dist/ai/source/BbOffCanvas.md +14 -1
- package/dist/ai/source/BbRadioGroup.md +12 -5
- 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 +72 -26
- package/dist/ai/source/BbTimePicker.md +19 -0
- package/dist/ai/source/BbTimePickerInput.md +15 -0
- package/dist/ai/source/BbToast.md +2 -2
- package/dist/ai/source/BbToastPortal.md +2 -2
- package/dist/ai/source/BbTree.md +1 -1
- package/dist/ai/source/CommonPopover.md +24 -1
- 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/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/useDayGrid.js +120 -123
- 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 +213 -202
- package/dist/components/BbColorPalette/types.d.ts +7 -0
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +3 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +84 -73
- package/dist/components/BbDatePicker/types.d.ts +7 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +495 -510
- package/dist/components/BbDatePickerInput/types.d.ts +7 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +219 -211
- package/dist/components/BbDialog/leaveGhost.js +22 -17
- 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 +412 -369
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +382 -338
- 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 +117 -102
- 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 +65 -41
- 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/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/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +9 -5
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +152 -144
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -104
- 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 +1086 -1069
- package/dist/components/BbTable/types.d.ts +11 -10
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +3 -1
- package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +145 -134
- package/dist/components/BbTimePicker/types.d.ts +7 -0
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +3 -1
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +268 -259
- 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/types.d.ts +2 -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/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +13 -1
- 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/useItemsGetter.js +34 -32
- package/dist/composables/useOpenModel.js +20 -0
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- 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/icon-scan.js +68 -61
- package/dist/index.d.ts +2 -2
- package/dist/llms-full.txt +573 -276
- package/dist/llms-medium.txt +8 -4
- package/dist/llms.txt +1 -1
- package/dist/locale-blueprint.json +2 -0
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +2 -3
- package/dist/types/Option.d.ts +10 -0
- package/dist/types/ptComponentMap.d.ts +3 -3
- 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.js +4 -1
- package/llms.txt +1 -1
- package/package.json +3 -1
- package/scripts/README.md +2 -0
- package/scripts/lib/agent-setup.mjs +44 -26
- package/scripts/lib/validate-bb-markup.mjs +20 -0
- package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
|
@@ -6,15 +6,13 @@
|
|
|
6
6
|
{"name":"BadgeVariantType","component":null,"usedBy":["BbBadge.prop.variant"],"definition":"type BadgeVariantType = BadgeVariantFromRegistry | 'none';","values":["primary","secondary","destructive","outline","none"],"extensibleVia":"BadgeVariantRegistry"},
|
|
7
7
|
{"name":"BbBreadcrumbsItem","component":"BbBreadcrumbs","usedBy":["BbBreadcrumbs.prop.items"],"definition":"type BbBreadcrumbsItem = Omit<BbBaseButtonProps, 'block' | 'tag' | 'type' | 'text'> & { onClick?: (event: MouseEvent) => void | Promise<void>; label?: string; value?: string; hidden?: boolean; key?: never; text?: never; 'prepend:icon'?: IconType; 'append:icon'?: IconType; };"},
|
|
8
8
|
{"name":"BbCalendarSegment","component":"BbCalendar","usedBy":["BbCalendar.prop.activeSegment","BbCalendar.event.update:activeSegment","BbDatePicker.prop.activeSegment","BbDatePicker.event.update:activeSegment"],"values":["start","end"]},
|
|
9
|
-
{"name":"BbCarouselSlotProps","component":"BbCarousel","usedBy":["BbCarousel.slot.overlay|slide|slide:footer|slide:header"],"definition":"type BbCarouselSlotProps<T = number> = { item: T; index: number; active: boolean; current: boolean; };"},
|
|
10
9
|
{"name":"BbCheckboxGroupItemsContext","component":null,"usedBy":["BbCheckboxGroup.prop.items","BbSwitchGroup.prop.items"],"definition":"type BbCheckboxGroupItemsContext<M = any> = BbItemsProviderContext<M> & { reason: 'initial' | 'dependencies' | 'model'; };"},
|
|
11
10
|
{"name":"BbComponentsMap","component":"BbConfigScope","usedBy":["BbConfigScope.prop.config"],"definition":"type BbComponentsMap<Mode extends 'global' | 'scope' = 'global', V = BbUninferredVariants> = { all?: BbAllConfig; } & { [C in AnyComponent]?: Mode extends 'scope' ? ScopeEntry<C, V> : BbComponentConfig<C, V>; };","fields":["all?: BbAllConfig","BbAccordion?: unknown","BbAlert?: unknown","BbAsterisk?: unknown","BbAvatar?: unknown","BbBadge?: unknown","BbBaseButton?: unknown","BbBaseCheckboxIcon?: unknown","BbBaseRadioIcon?: unknown","BbBaseSwitchIcon?: unknown","BbBreadcrumbs?: unknown","BbButton?: unknown","BbCalendar?: unknown","BbCarousel?: unknown","BbCheckbox?: unknown","BbCheckboxGroup?: unknown","BbCollapsible?: unknown","BbColorInput?: unknown","BbColorPalette?: unknown","BbConfirm?: unknown","BbDatePicker?: unknown","BbDatePickerInput?: unknown","BbDialog?: unknown","BbDropdown?: unknown","BbDropdownButton?: unknown","BbDropzone?: unknown","BbGallery?: unknown","BbHoverCard?: unknown","BbIcon?: unknown","BbIndicator?: unknown","BbNumberInput?: unknown","BbOffCanvas?: unknown","BbPagination?: unknown","BbPopover?: unknown","BbProgress?: unknown","BbRadio?: unknown","BbRadioGroup?: unknown","BbRating?: unknown","BbSelect?: unknown","BbSelectPopover?: unknown","BbSlider?: unknown","BbSmoothHeight?: unknown","BbSpinner?: unknown","BbSwitch?: unknown","BbSwitchGroup?: unknown","BbTable?: unknown","BbTabs?: unknown","BbTabsList?: unknown","BbTabsPanels?: unknown","BbTag?: unknown","BbTextInput?: unknown","BbTextarea?: unknown","BbTimePicker?: unknown","BbTimePickerInput?: unknown","BbToast?: unknown","BbTooltip?: unknown","BbTree?: unknown"]},
|
|
12
11
|
{"name":"BbConfigScopeName","component":"BbConfigScope","usedBy":["BbConfigScope.prop.name"],"definition":"type BbConfigScopeName = RegistryKey<ConfigScopeRegistry, 'bitboss-ui: no configScopes configured — add configScopes to bitbossUi() and commit bitboss-ui.d.ts'>;","extensibleVia":"ConfigScopeRegistry"},
|
|
13
12
|
{"name":"BbConfirmPortalSlotProps","component":"BbConfirm","usedBy":["BbConfirmPortal.slot.default"],"definition":"type BbConfirmPortalSlotProps<P = any> = { data: P; ok: () => void; cancel: () => void; };"},
|
|
14
13
|
{"name":"BbDialogResult","component":null,"usedBy":["BbDialog.event.hide","BbOffCanvas.event.hide"],"definition":"type BbDialogResult<Out = any> = { completed: true; value: Out; } | { completed: false; reason: BbDialogDismissReason; };"},
|
|
15
14
|
{"name":"BbDialogSizes","component":"BbDialog","usedBy":["BbDialog.prop.size"],"definition":"type BbDialogSizes = { xs: number; sm: number; md: number; lg: number; xl: number; '2xl': number; };"},
|
|
16
|
-
{"name":"BbDropdownItem","component":"BbDropdown","usedBy":["BbDropdown.prop.items","BbDropdownButton.prop.items"],"definition":"type BbDropdownItem = InternalItem | InternalGroup | (ItemEntry[] & { searchable?: never; });","members":{"InternalItem":["disabled?: boolean","except?: string[]","rel?: string","target?: string","activeClass?: string","ariaCurrentValue?: \"page\" | \"step\" | \"location\" | \"date\" | \"time\" | \"true\" | \"false\"","data?: object","exactActiveClass?: string","headers?: object","href?: string | { url: string; method: \"get\" | \"post\" | \"put\" | \"patch\" | \"delete\"; }","download?: string | boolean","external?: boolean","method?: \"get\" | \"post\" | \"put\" | \"patch\" | \"delete\"","onBefore?: (() => void)","onCancel?: (() => void)","onCancelToken?: ((cancelToken: unknown) => void)","onFinish?: (() => void)","only?: string[]","onProgress?: ((progress: { percentage: number | undefined; }) => void)","onStart?: (() => void)","onSuccess?: (() => void)","preserveScroll?: boolean | ((props: Record<string, unknown>) => boolean)","preserveState?: boolean | ((props: Record<string, unknown>) => boolean) | null","queryStringArrayFormat?: \"brackets\" | \"indices\"","replace?: boolean","to?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric","async?: boolean","cacheFor?: string | number | (string | number)[]","cacheTags?: string | string[]","component?: string","instant?: boolean","onError?: ((errors: Record<string, string>) => void)","onPrefetched?: (() => void)","onPrefetching?: (() => void)","pageProps?: Record<string, unknown> | ((currentProps: Record<string, unknown>, sharedProps: Record<string, unknown>) => Record<string, unknown>) | null","prefetch?: string | boolean | string[]","preserveUrl?: boolean","viewTransition?: boolean","items?: ItemEntry[]","onClick?: ((...args: any[]) => any)","append:icon?: string","hidden?: boolean","meta?: any","prepend:icon?: string","variant?: keyof DropdownItemVariantRegistry","label: string","value?: unknown","description?: string"],"InternalGroup":["append:icon?: string","hidden?: boolean","meta?: any","onClick?: ((...args: any[]) => any)","prepend:icon?: string","variant?: keyof DropdownItemVariantRegistry","id?: string","dependencies?: unknown[]","depsDebounceTime?: number","enforceCoherence?: boolean","filterBy?: false | string[]","group?: true","itemText?: string | ((item: any) => string)","itemProps?: BbDropdownItemProps<any>","itemValue?: string | ((item: any) => any)","loadingText?: string","max?: number","maxHeight?: string | number","multiple?: boolean","clearable?: boolean","emptyText?: string","failedText?: string","prefill?: boolean | \"interaction\"","searchPlaceholder?: string","groupBy?: string | ((row: any) => string | null | undefined)","selectable?: boolean | ((item: any) => boolean)","stash?: boolean","label?: string","hideLabel?: boolean","searchable?: boolean","items: SearchGetter | GroupRows | PlainGetter"]}},
|
|
17
|
-
{"name":"BbDropdownItemSlotProps","component":"BbDropdown","usedBy":["BbDropdown.slot.item:append|item:prepend|<value>|<value>:prepend|<value>:append|<groupId>:item|<groupId>:item:prepend|<groupId>:item:append|<groupId>|<groupId>:prepend|<groupId>:append","BbDropdownButton.slot.<value>|<value>:prepend|<value>:append|<groupId>:item|<groupId>:item:prepend|<groupId>:item:append|<groupId>|<groupId>:prepend|<groupId>:append"],"fields":["description?: string","disabled?: boolean","group: BbDropdownSlotGroup","groupTitle: boolean","level: number","index: number","item: InternalItem","loading: boolean","open: boolean","placement: Placement | \"cursor\"","selected: boolean","label: string","activeLink?: boolean","exactActiveLink?: boolean"]},
|
|
15
|
+
{"name":"BbDropdownItem","component":"BbDropdown","usedBy":["BbDropdown.prop.items","BbDropdownButton.prop.items"],"definition":"type BbDropdownItem = InternalItem | InternalGroup | (ItemEntry[] & { searchable?: never; });","members":{"InternalItem":["disabled?: boolean","except?: string[]","rel?: string","target?: string","activeClass?: string","ariaCurrentValue?: \"page\" | \"step\" | \"location\" | \"date\" | \"time\" | \"true\" | \"false\"","data?: object","exactActiveClass?: string","headers?: object","href?: string | { url: string; method: \"get\" | \"post\" | \"put\" | \"patch\" | \"delete\"; }","download?: string | boolean","external?: boolean","method?: \"get\" | \"post\" | \"put\" | \"patch\" | \"delete\"","onBefore?: (() => void)","onCancel?: (() => void)","onCancelToken?: ((cancelToken: unknown) => void)","onFinish?: (() => void)","only?: string[]","onProgress?: ((progress: { percentage: number | undefined; }) => void)","onStart?: (() => void)","onSuccess?: (() => void)","preserveScroll?: boolean | ((props: Record<string, unknown>) => boolean)","preserveState?: boolean | ((props: Record<string, unknown>) => boolean) | null","queryStringArrayFormat?: \"brackets\" | \"indices\"","replace?: boolean","to?: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric","async?: boolean","cacheFor?: string | number | (string | number)[]","cacheTags?: string | string[]","component?: string","instant?: boolean","onError?: ((errors: Record<string, string>) => void)","onPrefetched?: (() => void)","onPrefetching?: (() => void)","pageProps?: Record<string, unknown> | ((currentProps: Record<string, unknown>, sharedProps: Record<string, unknown>) => Record<string, unknown>) | null","prefetch?: string | boolean | string[]","preserveUrl?: boolean","viewTransition?: boolean","items?: ItemEntry[]","onClick?: ((...args: any[]) => any)","append:icon?: string","hidden?: boolean","meta?: any","prepend:icon?: string","variant?: keyof DropdownItemVariantRegistry","label: string","value?: unknown","description?: string"],"InternalGroup":["append:icon?: string","hidden?: boolean","meta?: any","onClick?: ((...args: any[]) => any)","prepend:icon?: string","variant?: keyof DropdownItemVariantRegistry","id?: string","dependencies?: unknown[]","depsDebounceTime?: number","enforceCoherence?: boolean","filterBy?: false | string[]","group?: true","itemText?: string | ((item: any) => string)","itemProps?: BbDropdownItemProps<any>","itemValue?: string | ((item: any) => any)","loadingText?: string","max?: number","maxHeight?: string | number","multiple?: boolean","clearable?: boolean","emptyText?: string","failedText?: string","prefill?: boolean | \"interaction\"","searchPlaceholder?: string","minQueryLength?: number","groupBy?: string | ((row: any) => string | null | undefined)","selectable?: boolean | ((item: any) => boolean)","stash?: boolean","label?: string","hideLabel?: boolean","searchable?: boolean","items: SearchGetter | GroupRows | PlainGetter"]}},
|
|
18
16
|
{"name":"BbFormFieldEntry","component":null,"usedBy":["BbForm.slot.default"],"definition":"type BbFormFieldEntry = { mounted: boolean; label: string | undefined; validationLabel: string | undefined; errors: string[]; dirty: boolean; touched: boolean; };"},
|
|
19
17
|
{"name":"BbFormInvalidPayload","component":null,"usedBy":["BbForm.event.invalid"],"definition":"type BbFormInvalidPayload = { errors: Record<string, string[]>; values: Record<string, unknown>; unmatched: Record<string, string[]>; source: 'submit' | 'server'; };"},
|
|
20
18
|
{"name":"BbFormServerErrors","component":null,"usedBy":["BbForm.slot.default"],"definition":"type BbFormServerErrors = Record<string, string | readonly string[] | null | undefined>;"},
|
|
@@ -6,11 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
```vue
|
|
8
8
|
<template>
|
|
9
|
-
<span
|
|
9
|
+
<span
|
|
10
|
+
class="bb-avatar"
|
|
11
|
+
:class="colorClasses"
|
|
12
|
+
:style="avatarStyle"
|
|
13
|
+
v-bind="passthrough.rootAttrs"
|
|
14
|
+
>
|
|
10
15
|
<img
|
|
11
16
|
v-if="shouldRenderImage"
|
|
12
17
|
ref="image"
|
|
13
|
-
:alt="
|
|
18
|
+
:alt="label"
|
|
14
19
|
:aria-hidden="imageHidden || undefined"
|
|
15
20
|
class="bb-avatar__img"
|
|
16
21
|
:class="{ 'bb-avatar__img--hidden': imageHidden }"
|
|
@@ -26,7 +31,15 @@
|
|
|
26
31
|
v-bind="fallbackAccessibilityAttributes"
|
|
27
32
|
>
|
|
28
33
|
<slot>
|
|
34
|
+
<span
|
|
35
|
+
v-if="initials"
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
class="bb-avatar__initials"
|
|
38
|
+
v-bind="passthrough.initials"
|
|
39
|
+
>{{ initials }}</span
|
|
40
|
+
>
|
|
29
41
|
<BbIcon
|
|
42
|
+
v-else
|
|
30
43
|
class="bb-avatar__default-icon"
|
|
31
44
|
:icon="defaultFallbackIcon"
|
|
32
45
|
v-bind="passthrough.icon"
|
|
@@ -50,6 +63,9 @@ import BbIcon from '../BbIcon/BbIcon.vue';
|
|
|
50
63
|
import defaultFallbackIcon from '@/assets/svgs/user.svg?raw';
|
|
51
64
|
import { BB_AVATAR_PT, type BbAvatarProps, type BbAvatarSlots } from './types';
|
|
52
65
|
import { usePassthrough } from '@/composables/usePassthrough';
|
|
66
|
+
import { useConfig } from '@/composables/useConfig';
|
|
67
|
+
import { LOCALE_TABLE, localeKeyOf } from '@/i18n/regions';
|
|
68
|
+
import { avatarHue, initialsOf } from './avatarIdentity';
|
|
53
69
|
|
|
54
70
|
defineOptions({ inheritAttrs: false });
|
|
55
71
|
const props = withDefaults(
|
|
@@ -60,6 +76,7 @@ const props = withDefaults(
|
|
|
60
76
|
alt: '',
|
|
61
77
|
timeout: 400,
|
|
62
78
|
size: 'md',
|
|
79
|
+
color: false,
|
|
63
80
|
}
|
|
64
81
|
);
|
|
65
82
|
|
|
@@ -95,11 +112,29 @@ const parsedSize = computed(() => {
|
|
|
95
112
|
}
|
|
96
113
|
});
|
|
97
114
|
|
|
115
|
+
const config = useConfig();
|
|
116
|
+
/** The initials from `name`, cased with the locale's rules. */
|
|
117
|
+
const initials = computed(() =>
|
|
118
|
+
initialsOf(props.name, LOCALE_TABLE[localeKeyOf(config.locale) ?? 'en'].tag)
|
|
119
|
+
);
|
|
120
|
+
/** The accessible name: `alt`, else `name`. */
|
|
121
|
+
const label = computed(() => props.alt?.trim() || props.name?.trim() || '');
|
|
122
|
+
|
|
123
|
+
/** `color`: a palette hue from `name`, or the app's colour (`--bg` below). */
|
|
124
|
+
const colorClasses = computed(() => {
|
|
125
|
+
if (typeof props.color === 'string' && props.color)
|
|
126
|
+
return 'bb-avatar--custom';
|
|
127
|
+
const hue = props.color === true ? avatarHue(props.name) : undefined;
|
|
128
|
+
return hue ? ['bb-avatar--colored', `bb-avatar--${hue}`] : undefined;
|
|
129
|
+
});
|
|
130
|
+
|
|
98
131
|
const avatarStyle = computed(() => {
|
|
99
132
|
const style: Record<string, string> = {};
|
|
100
133
|
if (parsedSize.value) {
|
|
101
134
|
style['--size'] = parsedSize.value;
|
|
102
135
|
}
|
|
136
|
+
if (typeof props.color === 'string' && props.color)
|
|
137
|
+
style['--bg'] = props.color;
|
|
103
138
|
return style;
|
|
104
139
|
});
|
|
105
140
|
const shouldRenderImage = computed<boolean>(
|
|
@@ -116,10 +151,10 @@ const showFallback = computed<boolean>(
|
|
|
116
151
|
() => !shouldRenderImage.value || imageHidden.value
|
|
117
152
|
);
|
|
118
153
|
const fallbackAccessibilityAttributes = computed(() => {
|
|
119
|
-
if (!showFallback.value || !
|
|
154
|
+
if (!showFallback.value || !label.value) return {};
|
|
120
155
|
return {
|
|
121
156
|
role: 'img',
|
|
122
|
-
'aria-label':
|
|
157
|
+
'aria-label': label.value,
|
|
123
158
|
};
|
|
124
159
|
});
|
|
125
160
|
|
|
@@ -196,13 +231,15 @@ import type { BbAvatarPtKeys } from './ptKeys.generated';
|
|
|
196
231
|
*
|
|
197
232
|
* @part root - The avatar frame, with the image or the fallback inside.
|
|
198
233
|
* @part icon - The default user glyph — rendered only while there is no image
|
|
199
|
-
* to show
|
|
200
|
-
* otherwise.
|
|
234
|
+
* to show, the default slot is not overridden and `name` gives no
|
|
235
|
+
* initials, so it lands nowhere otherwise.
|
|
236
|
+
* @part initials - The initials from `name` — rendered only while there is
|
|
237
|
+
* no image to show and the default slot is not overridden.
|
|
201
238
|
*/
|
|
202
|
-
export type BbAvatarPtPart = 'root' | 'icon';
|
|
239
|
+
export type BbAvatarPtPart = 'root' | 'icon' | 'initials';
|
|
203
240
|
/** The runtime lists the resolver is wired with — no states: nothing this component paints is a state. */
|
|
204
241
|
export const BB_AVATAR_PT = {
|
|
205
|
-
parts: ['root', 'icon'],
|
|
242
|
+
parts: ['root', 'icon', 'initials'],
|
|
206
243
|
states: [],
|
|
207
244
|
} as const satisfies {
|
|
208
245
|
parts: readonly BbAvatarPtPart[];
|
|
@@ -221,11 +258,28 @@ export type BbAvatarProps = Pick<BbIconProps, 'size'> &
|
|
|
221
258
|
*/
|
|
222
259
|
pt?: PtMap<BbAvatarPtPart, never>;
|
|
223
260
|
/**
|
|
224
|
-
* Alternative text for the image, used for accessibility.
|
|
261
|
+
* Alternative text for the image, used for accessibility. Without it
|
|
262
|
+
* the avatar is labelled with `name`.
|
|
225
263
|
*
|
|
226
264
|
* @defaultValue `''`
|
|
227
265
|
*/
|
|
228
266
|
alt?: ImgHTMLAttributes['alt'];
|
|
267
|
+
/**
|
|
268
|
+
* The person's name. With no image and no default slot, the avatar
|
|
269
|
+
* shows its initials (first letters of the first and last word; none:
|
|
270
|
+
* the person icon). Also the accessible name when `alt` is empty, and
|
|
271
|
+
* the input of `color`.
|
|
272
|
+
*/
|
|
273
|
+
name?: string;
|
|
274
|
+
/**
|
|
275
|
+
* Paints the fallback (initials or icon). `true`: a palette colour
|
|
276
|
+
* picked from `name`, stable across renders and the server. A string:
|
|
277
|
+
* any CSS colour or `var()` as the background, with black or white
|
|
278
|
+
* ink, whichever reads. Unset: the primary colour.
|
|
279
|
+
*
|
|
280
|
+
* @defaultValue `false`
|
|
281
|
+
*/
|
|
282
|
+
color?: boolean | string;
|
|
229
283
|
/**
|
|
230
284
|
* Source URL of the avatar image.
|
|
231
285
|
*/
|
|
@@ -271,6 +325,8 @@ export type { BbIconSize as Size };
|
|
|
271
325
|
--default-icon-size: clamp(14px, calc(var(--size) * 0.7), 48px);
|
|
272
326
|
/* Initials: 40% of the avatar, floored at 8px */
|
|
273
327
|
--fs: max(8px, calc(var(--size) * 0.4));
|
|
328
|
+
/* The palette hue `color` picks (a modifier class sets it). */
|
|
329
|
+
--hue: 0;
|
|
274
330
|
/* The theme's resting lift on small chrome, declared here so an
|
|
275
331
|
ancestor's `--elev` cannot reach in; `--elev: none` flattens one. */
|
|
276
332
|
--elev: var(--bb-elev-sm);
|
|
@@ -316,9 +372,63 @@ export type { BbIconSize as Size };
|
|
|
316
372
|
place-items: center;
|
|
317
373
|
}
|
|
318
374
|
|
|
375
|
+
.bb-avatar__initials {
|
|
376
|
+
font-weight: 600;
|
|
377
|
+
letter-spacing: 0.02em;
|
|
378
|
+
}
|
|
379
|
+
|
|
319
380
|
.bb-avatar__default-icon {
|
|
320
381
|
--size: var(--default-icon-size);
|
|
321
382
|
color: color-mix(in oklab, var(--fg) 80%, var(--bg));
|
|
322
383
|
}
|
|
384
|
+
|
|
385
|
+
/* `color`: a palette hue from the `name` (the modifier sets `--hue`), the
|
|
386
|
+
scheme's fill and ink from the theme tokens. */
|
|
387
|
+
&.bb-avatar--colored {
|
|
388
|
+
--bg: oklch(var(--bb-avatar-bg-l) var(--bb-avatar-bg-c) var(--hue));
|
|
389
|
+
--fg: oklch(var(--bb-avatar-ink-l) var(--bb-avatar-ink-c) var(--hue));
|
|
390
|
+
}
|
|
391
|
+
&.bb-avatar--coral {
|
|
392
|
+
--hue: var(--bb-avatar-hue-coral);
|
|
393
|
+
}
|
|
394
|
+
&.bb-avatar--tangerine {
|
|
395
|
+
--hue: var(--bb-avatar-hue-tangerine);
|
|
396
|
+
}
|
|
397
|
+
&.bb-avatar--sunflower {
|
|
398
|
+
--hue: var(--bb-avatar-hue-sunflower);
|
|
399
|
+
}
|
|
400
|
+
&.bb-avatar--mint {
|
|
401
|
+
--hue: var(--bb-avatar-hue-mint);
|
|
402
|
+
}
|
|
403
|
+
&.bb-avatar--teal {
|
|
404
|
+
--hue: var(--bb-avatar-hue-teal);
|
|
405
|
+
}
|
|
406
|
+
&.bb-avatar--sky {
|
|
407
|
+
--hue: var(--bb-avatar-hue-sky);
|
|
408
|
+
}
|
|
409
|
+
&.bb-avatar--blue {
|
|
410
|
+
--hue: var(--bb-avatar-hue-blue);
|
|
411
|
+
}
|
|
412
|
+
&.bb-avatar--violet {
|
|
413
|
+
--hue: var(--bb-avatar-hue-violet);
|
|
414
|
+
}
|
|
415
|
+
&.bb-avatar--orchid {
|
|
416
|
+
--hue: var(--bb-avatar-hue-orchid);
|
|
417
|
+
}
|
|
418
|
+
&.bb-avatar--rose {
|
|
419
|
+
--hue: var(--bb-avatar-hue-rose);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* `color` as a CSS colour: `--bg` is set inline; the ink is black or
|
|
423
|
+
white, whichever reads — `contrast-color()` where supported, else by the
|
|
424
|
+
colour's OKLCH lightness. */
|
|
425
|
+
&.bb-avatar--custom {
|
|
426
|
+
--fg: oklch(from var(--bg) clamp(0, (0.63 - l) * 1000, 1) 0 0);
|
|
427
|
+
}
|
|
428
|
+
@supports (color: contrast-color(white)) {
|
|
429
|
+
&.bb-avatar--custom {
|
|
430
|
+
--fg: contrast-color(var(--bg));
|
|
431
|
+
}
|
|
432
|
+
}
|
|
323
433
|
}
|
|
324
434
|
```
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
v-bind="passthrough.spinner"
|
|
29
29
|
/>
|
|
30
30
|
<span
|
|
31
|
-
v-else-if="
|
|
31
|
+
v-else-if="iconNodes('append')"
|
|
32
32
|
class="bb-badge__append-icon bb-badge__icon-slot"
|
|
33
33
|
v-bind="passthrough.icon"
|
|
34
|
-
><
|
|
34
|
+
><SlotNodes :nodes="iconNodes('append')!"
|
|
35
35
|
/></span>
|
|
36
36
|
<BbIcon
|
|
37
37
|
v-else-if="props['append:icon']"
|
|
@@ -71,6 +71,7 @@ import { removedPropsFor } from '@/deprecation/removedProps';
|
|
|
71
71
|
import { warnRemovedAttrs } from '@/utilities/functions/warnRemovedAttrs';
|
|
72
72
|
import BbIcon from '../BbIcon/BbIcon.vue';
|
|
73
73
|
import BbSpinner from '../BbSpinner/BbSpinner.vue';
|
|
74
|
+
import { SlotNodes, slotContent } from '@/utilities/functions/slotContent';
|
|
74
75
|
import BadgeBodyContent from './BadgeBodyContent.vue';
|
|
75
76
|
import BbBadgeButton from './BbBadgeButton.vue';
|
|
76
77
|
import { provideBadgeHost, type HostValue } from './badgeButtonContext';
|
|
@@ -177,8 +178,14 @@ const iconOnlyBands = () => {
|
|
|
177
178
|
return on ? [`bb-badge--icon-${band}`] : [];
|
|
178
179
|
});
|
|
179
180
|
};
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
/**
|
|
182
|
+
* What an icon slot renders, `undefined` for none or an empty one (the
|
|
183
|
+
* empty-slot rule: it falls back to the prop). Read in render only.
|
|
184
|
+
*/
|
|
185
|
+
const iconNodes = (side: 'prepend' | 'append') =>
|
|
186
|
+
slotContent(slots[`${side}:icon`], iconScope());
|
|
187
|
+
const hasPrepend = () => !!props['prepend:icon'] || !!iconNodes('prepend');
|
|
188
|
+
const hasAppend = () => !!props['append:icon'] || !!iconNodes('append');
|
|
182
189
|
|
|
183
190
|
/** What an icon slot sees: the badge's `pt` states. */
|
|
184
191
|
const iconScope = (): BbBadgeIconSlotProps => ({
|
|
@@ -223,7 +230,7 @@ provideBadgeHost({
|
|
|
223
230
|
return iconOnly();
|
|
224
231
|
},
|
|
225
232
|
},
|
|
226
|
-
|
|
233
|
+
iconNodes,
|
|
227
234
|
iconScope: {
|
|
228
235
|
get value() {
|
|
229
236
|
return iconScope();
|
|
@@ -110,28 +110,25 @@
|
|
|
110
110
|
:disabled="item.disabled || disabled"
|
|
111
111
|
:tag="isCurrent(item, index) ? 'span' : undefined"
|
|
112
112
|
>
|
|
113
|
-
<!-- prepend: <value>:prepend | item:prepend | inline prepend:icon
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
:
|
|
117
|
-
:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
})
|
|
133
|
-
"
|
|
134
|
-
/>
|
|
113
|
+
<!-- prepend: <value>:prepend | item:prepend | inline prepend:icon; a slot
|
|
114
|
+
rendering nothing for this crumb falls through -->
|
|
115
|
+
<SlotChain
|
|
116
|
+
:props="edgeProps(item, index)"
|
|
117
|
+
:slots="edgeSlots(item, 'prepend')"
|
|
118
|
+
>
|
|
119
|
+
<BbIcon
|
|
120
|
+
v-if="item['prepend:icon']"
|
|
121
|
+
class="bb-breadcrumbs__item-icon bb-breadcrumbs__item-icon--prepend"
|
|
122
|
+
:icon="item['prepend:icon']"
|
|
123
|
+
size="14"
|
|
124
|
+
v-bind="
|
|
125
|
+
passthrough.part('icon', {
|
|
126
|
+
active: isCurrent(item, index),
|
|
127
|
+
disabled: item.disabled || disabled || undefined,
|
|
128
|
+
})
|
|
129
|
+
"
|
|
130
|
+
/>
|
|
131
|
+
</SlotChain>
|
|
135
132
|
<span
|
|
136
133
|
class="bb-breadcrumbs__text"
|
|
137
134
|
:title="
|
|
@@ -156,26 +153,25 @@
|
|
|
156
153
|
>{{ item.label }}</slot
|
|
157
154
|
>
|
|
158
155
|
</span>
|
|
159
|
-
<!-- append: <value>:append | item:append | inline append:icon
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
:
|
|
163
|
-
:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
/>
|
|
156
|
+
<!-- append: <value>:append | item:append | inline append:icon; a slot
|
|
157
|
+
rendering nothing for this crumb falls through -->
|
|
158
|
+
<SlotChain
|
|
159
|
+
:props="edgeProps(item, index)"
|
|
160
|
+
:slots="edgeSlots(item, 'append')"
|
|
161
|
+
>
|
|
162
|
+
<BbIcon
|
|
163
|
+
v-if="item['append:icon']"
|
|
164
|
+
class="bb-breadcrumbs__item-icon bb-breadcrumbs__item-icon--append"
|
|
165
|
+
:icon="item['append:icon']"
|
|
166
|
+
size="14"
|
|
167
|
+
v-bind="
|
|
168
|
+
passthrough.part('icon', {
|
|
169
|
+
active: isCurrent(item, index),
|
|
170
|
+
disabled: item.disabled || disabled || undefined,
|
|
171
|
+
})
|
|
172
|
+
"
|
|
173
|
+
/>
|
|
174
|
+
</SlotChain>
|
|
179
175
|
</BbBaseButton>
|
|
180
176
|
<span
|
|
181
177
|
v-if="index < visibleItems.length - 1"
|
|
@@ -207,6 +203,7 @@ import { useResizeObserver } from '@vueuse/core';
|
|
|
207
203
|
import { useLocale } from '@/composables/useLocale';
|
|
208
204
|
import { useLogger } from '@/composables/useLogger';
|
|
209
205
|
import { slotKey } from '@/utilities/functions/slotKey';
|
|
206
|
+
import { SlotChain } from '@/utilities/functions/slotContent';
|
|
210
207
|
import { removedPropsFor } from '@/deprecation/removedProps';
|
|
211
208
|
import { warnRemovedAttrs } from '@/utilities/functions/warnRemovedAttrs';
|
|
212
209
|
import BbBaseButton from '../BbBaseButton/BbBaseButton.vue';
|
|
@@ -358,19 +355,20 @@ const buttonProps = (item: Item, index: number) => {
|
|
|
358
355
|
};
|
|
359
356
|
|
|
360
357
|
/**
|
|
361
|
-
*
|
|
362
|
-
* `item:suffix
|
|
363
|
-
*
|
|
364
|
-
* `name` is the (absent) per-key name so the outlet renders nothing and the
|
|
365
|
-
* inline icon takes over. The slot is rendered unconditionally (no `v-if`) so
|
|
366
|
-
* Vue doesn't inject a branch `key` into the consumer's slot scope.
|
|
358
|
+
* An edge region's slots, strongest first: `<value>:suffix` (per item), then
|
|
359
|
+
* `item:suffix`; the inline `prepend:icon`/`append:icon` is the fallback when
|
|
360
|
+
* neither renders anything for the crumb.
|
|
367
361
|
*/
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
362
|
+
const edgeSlots = (item: Item, suffix: 'prepend' | 'append') => [
|
|
363
|
+
slots[`${itemSlotBase(item)}:${suffix}`],
|
|
364
|
+
slots[`item:${suffix}`],
|
|
365
|
+
];
|
|
366
|
+
const edgeProps = (item: Item, index: number) => ({
|
|
367
|
+
disabled: !!(item.disabled || props.disabled),
|
|
368
|
+
index,
|
|
369
|
+
item,
|
|
370
|
+
label: item.label,
|
|
371
|
+
});
|
|
374
372
|
|
|
375
373
|
/** Slot names forwarded into the overflow `<BbDropdown>` (per-item slots only). */
|
|
376
374
|
const forwardedItemSlots = computed(() =>
|
|
@@ -36,22 +36,30 @@
|
|
|
36
36
|
icons render (one or both). Bound LAST on each so a consumer
|
|
37
37
|
attribute beats ours and a consumer class appends. An icon slot
|
|
38
38
|
beats its prop and renders INSIDE the part, a box of the
|
|
39
|
-
same class, so `pt:icon`, `--icon-size` and the spinner swap hold.
|
|
39
|
+
same class, so `pt:icon`, `--icon-size` and the spinner swap hold. A
|
|
40
|
+
slot that renders nothing falls back to the prop (the empty-slot rule).
|
|
40
41
|
`icon-only` is CSS alone: the label is hidden
|
|
41
42
|
but stays the name, and the append icon goes when a prepend one is
|
|
42
43
|
there, so a breakpoint can switch it with no render. -->
|
|
43
|
-
<
|
|
44
|
-
v-if="slots['prepend:icon']"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
<SlotContent
|
|
45
|
+
v-if="slots['prepend:icon'] || props['prepend:icon']"
|
|
46
|
+
v-slot="{ nodes: prependNodes }"
|
|
47
|
+
:of="slots['prepend:icon']"
|
|
48
|
+
:props="iconScope"
|
|
49
|
+
>
|
|
50
|
+
<span
|
|
51
|
+
v-if="prependNodes"
|
|
52
|
+
class="bb-button__prepend-icon bb-button__icon-slot"
|
|
53
|
+
v-bind="passthrough.icon"
|
|
54
|
+
><SlotNodes :nodes="prependNodes"
|
|
55
|
+
/></span>
|
|
56
|
+
<BbIcon
|
|
57
|
+
v-else-if="props['prepend:icon']"
|
|
58
|
+
class="bb-button__prepend-icon"
|
|
59
|
+
:icon="props['prepend:icon']"
|
|
60
|
+
v-bind="passthrough.icon"
|
|
61
|
+
/>
|
|
62
|
+
</SlotContent>
|
|
55
63
|
<span
|
|
56
64
|
class="bb-button__text"
|
|
57
65
|
:class="{ 'bb-sr-only': props.iconOnly === true }"
|
|
@@ -62,18 +70,25 @@
|
|
|
62
70
|
t('common.loadingText')
|
|
63
71
|
}}</span>
|
|
64
72
|
|
|
65
|
-
<
|
|
66
|
-
v-if="slots['append:icon']"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
<SlotContent
|
|
74
|
+
v-if="slots['append:icon'] || props['append:icon']"
|
|
75
|
+
v-slot="{ nodes: appendNodes }"
|
|
76
|
+
:of="slots['append:icon']"
|
|
77
|
+
:props="iconScope"
|
|
78
|
+
>
|
|
79
|
+
<span
|
|
80
|
+
v-if="appendNodes"
|
|
81
|
+
class="bb-button__append-icon bb-button__icon-slot"
|
|
82
|
+
v-bind="passthrough.icon"
|
|
83
|
+
><SlotNodes :nodes="appendNodes"
|
|
84
|
+
/></span>
|
|
85
|
+
<BbIcon
|
|
86
|
+
v-else-if="props['append:icon']"
|
|
87
|
+
class="bb-button__append-icon"
|
|
88
|
+
:icon="props['append:icon']"
|
|
89
|
+
v-bind="passthrough.icon"
|
|
90
|
+
/>
|
|
91
|
+
</SlotContent>
|
|
77
92
|
</BbBaseButton>
|
|
78
93
|
</template>
|
|
79
94
|
|
|
@@ -83,6 +98,7 @@ import { useBbFormSavingById } from '@/composables/useBbForm';
|
|
|
83
98
|
import BbBaseButton from '@/components/BbBaseButton/BbBaseButton.vue';
|
|
84
99
|
import BbSpinner from '@/components/BbSpinner/BbSpinner.vue';
|
|
85
100
|
import BbIcon from '../BbIcon/BbIcon.vue';
|
|
101
|
+
import { SlotContent, SlotNodes } from '@/utilities/functions/slotContent';
|
|
86
102
|
import { computed, inject, mergeProps, ref, useAttrs, watchEffect } from 'vue';
|
|
87
103
|
import { BB_FORM_SUBMIT_LOCK } from '@/composables/formSubmitLock';
|
|
88
104
|
import { pickBy } from '@/utilities/functions/pickBy';
|
|
@@ -166,29 +166,44 @@
|
|
|
166
166
|
name="slide:header"
|
|
167
167
|
/>
|
|
168
168
|
<component :is="entry.node" v-if="entry.node" />
|
|
169
|
+
<!-- The built-in image is the slot's fallback, so a `slide` slot
|
|
170
|
+
that renders nothing for an item (a `v-if` false) keeps it. -->
|
|
169
171
|
<slot
|
|
170
|
-
v-else
|
|
172
|
+
v-else
|
|
171
173
|
:active="isActive(entry.real)"
|
|
172
174
|
:current="isCurrent(entry.real)"
|
|
173
175
|
:index="entry.real"
|
|
174
176
|
:item="entry.item as T"
|
|
175
177
|
name="slide"
|
|
176
|
-
/>
|
|
177
|
-
<!-- A picker's built-in image is a button (the thumbs are the
|
|
178
|
-
control): named by the image, `aria-current` on the current
|
|
179
|
-
one. Its click picks through the track's, like any slide
|
|
180
|
-
click; inert and clone slides take it out of reach with them.
|
|
181
|
-
`slide` slot content is never wrapped. -->
|
|
182
|
-
<button
|
|
183
|
-
v-else-if="props.picker && imageOf(entry.item)"
|
|
184
|
-
:aria-current="isCurrent(entry.real) || undefined"
|
|
185
|
-
:aria-label="thumbLabel(entry.item, entry.real)"
|
|
186
|
-
class="bb-carousel__thumb"
|
|
187
|
-
type="button"
|
|
188
|
-
v-bind="passthrough.thumb"
|
|
189
178
|
>
|
|
179
|
+
<!-- A picker's built-in image is a button (the thumbs are the
|
|
180
|
+
control): named by the image, `aria-current` on the current
|
|
181
|
+
one. Its click picks through the track's, like any slide
|
|
182
|
+
click; inert and clone slides take it out of reach with them.
|
|
183
|
+
`slide` slot content is never wrapped. -->
|
|
184
|
+
<button
|
|
185
|
+
v-if="props.picker && imageOf(entry.item)"
|
|
186
|
+
:aria-current="isCurrent(entry.real) || undefined"
|
|
187
|
+
:aria-label="thumbLabel(entry.item, entry.real)"
|
|
188
|
+
class="bb-carousel__thumb"
|
|
189
|
+
type="button"
|
|
190
|
+
v-bind="passthrough.thumb"
|
|
191
|
+
>
|
|
192
|
+
<img
|
|
193
|
+
alt=""
|
|
194
|
+
class="bb-carousel__image"
|
|
195
|
+
decoding="async"
|
|
196
|
+
draggable="false"
|
|
197
|
+
:loading="near(entry.real) ? undefined : 'lazy'"
|
|
198
|
+
:sizes="imageOf(entry.item)!.sizes"
|
|
199
|
+
:src="imageOf(entry.item)!.src"
|
|
200
|
+
:srcset="imageOf(entry.item)!.srcset"
|
|
201
|
+
v-bind="passthrough.image"
|
|
202
|
+
/>
|
|
203
|
+
</button>
|
|
190
204
|
<img
|
|
191
|
-
|
|
205
|
+
v-else-if="imageOf(entry.item)"
|
|
206
|
+
:alt="imageOf(entry.item)!.alt"
|
|
192
207
|
class="bb-carousel__image"
|
|
193
208
|
decoding="async"
|
|
194
209
|
draggable="false"
|
|
@@ -198,19 +213,7 @@
|
|
|
198
213
|
:srcset="imageOf(entry.item)!.srcset"
|
|
199
214
|
v-bind="passthrough.image"
|
|
200
215
|
/>
|
|
201
|
-
</
|
|
202
|
-
<img
|
|
203
|
-
v-else-if="imageOf(entry.item)"
|
|
204
|
-
:alt="imageOf(entry.item)!.alt"
|
|
205
|
-
class="bb-carousel__image"
|
|
206
|
-
decoding="async"
|
|
207
|
-
draggable="false"
|
|
208
|
-
:loading="near(entry.real) ? undefined : 'lazy'"
|
|
209
|
-
:sizes="imageOf(entry.item)!.sizes"
|
|
210
|
-
:src="imageOf(entry.item)!.src"
|
|
211
|
-
:srcset="imageOf(entry.item)!.srcset"
|
|
212
|
-
v-bind="passthrough.image"
|
|
213
|
-
/>
|
|
216
|
+
</slot>
|
|
214
217
|
<slot
|
|
215
218
|
v-if="slots['slide:footer']"
|
|
216
219
|
:active="isActive(entry.real)"
|