@wow-two-beta/fe 0.0.41 → 0.0.43
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 +21 -3
- package/dist/auth/BffSession.d.ts +5 -0
- package/dist/auth/BffSession.js +2 -0
- package/dist/auth/BffSession.js.map +1 -1
- package/dist/foundation/net/hooks/UseRunningVersion.d.ts +30 -0
- package/dist/foundation/net/hooks/UseRunningVersion.js +19 -0
- package/dist/foundation/net/hooks/UseRunningVersion.js.map +1 -0
- package/dist/foundation/net/index.d.ts +1 -0
- package/dist/foundation/net/index.js +2 -0
- package/dist/foundation/net/index.js.map +1 -1
- package/dist/foundation/storage/StorageBroker.d.ts +6 -0
- package/dist/foundation/storage/StorageBroker.js +41 -36
- package/dist/foundation/storage/StorageBroker.js.map +1 -1
- package/dist/foundation/storage/index.d.ts +1 -1
- package/dist/foundation/storage/index.js +2 -1
- package/dist/foundation/themes/constants/Authored.js +21 -0
- package/dist/foundation/themes/constants/Authored.js.map +1 -1
- package/dist/index.css +16 -0
- package/dist/index.js +812 -806
- package/dist/index.js.map +1 -1
- package/dist/presentation/display/index.d.ts +1 -0
- package/dist/presentation/display/index.js +6 -4
- package/dist/presentation/display/index.js.map +1 -1
- package/dist/presentation/display/versionBadge/VersionBadge.vue.d.ts +27 -0
- package/dist/presentation/display/versionBadge/VersionBadge.vue.js +80 -0
- package/dist/presentation/display/versionBadge/VersionBadge.vue.js.map +1 -0
- package/dist/presentation/display/versionBadge/VersionBadge2.vue.js +5 -0
- package/dist/presentation/display/versionBadge/VersionBadge2.vue.js.map +1 -0
- package/dist/presentation/display/versionBadge/VersionBadgeExtensions.d.ts +9 -0
- package/dist/presentation/display/versionBadge/VersionBadgeExtensions.js +21 -0
- package/dist/presentation/display/versionBadge/VersionBadgeExtensions.js.map +1 -0
- package/dist/presentation/display/versionBadge/index.d.ts +1 -0
- package/dist/presentation/forms/imageEditor/ImageEditor.vue.d.ts +1 -1
- package/dist/presentation/layout/appFrame/AppFrame.vue.d.ts +168 -0
- package/dist/presentation/layout/appFrame/AppFrame.vue.js +408 -0
- package/dist/presentation/layout/appFrame/AppFrame.vue.js.map +1 -0
- package/dist/presentation/layout/appFrame/AppFrame2.vue.js +8 -0
- package/dist/presentation/layout/appFrame/AppFrame2.vue.js.map +1 -0
- package/dist/presentation/layout/appFrame/index.d.ts +1 -0
- package/dist/presentation/layout/index.d.ts +1 -0
- package/dist/presentation/layout/index.js +90 -86
- package/dist/presentation/layout/index.js.map +1 -1
- package/dist/presentation/nav/accountMenu/AccountMenu.vue.d.ts +7 -4
- package/dist/presentation/nav/accountMenu/AccountMenu.vue.js +20 -5
- package/dist/presentation/nav/accountMenu/AccountMenu.vue.js.map +1 -1
- package/dist/presentation/nav/appSwitcherMenu/AppSwitcherMenu.vue.d.ts +2 -0
- package/dist/presentation/nav/appSwitcherMenu/AppSwitcherMenu.vue.js +15 -8
- package/dist/presentation/nav/appSwitcherMenu/AppSwitcherMenu.vue.js.map +1 -1
- package/dist/presentation/nav/breadcrumb/Breadcrumb.vue.d.ts +8 -1
- package/dist/presentation/nav/breadcrumb/Breadcrumb.vue.js +38 -19
- package/dist/presentation/nav/breadcrumb/Breadcrumb.vue.js.map +1 -1
- package/dist/themes.css +14 -0
- package/package.json +1 -1
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
import { default as default2, AnchorLayoutAppearOn } from "./anchorLayout/AnchorLayout.vue.js";
|
|
2
|
-
import { default as default3,
|
|
3
|
-
import { default as default4 } from "./appShell/
|
|
4
|
-
import { default as default5
|
|
5
|
-
import { default as default6 } from "./appShell/
|
|
6
|
-
import { default as default7
|
|
7
|
-
import { default as default8 } from "./appShell/
|
|
8
|
-
import { default as default9 } from "./appShell/
|
|
9
|
-
import { default as default10 } from "./
|
|
10
|
-
import { default as default11 } from "./
|
|
11
|
-
import { default as default12
|
|
12
|
-
import { default as default13 } from "./
|
|
13
|
-
import { default as default14 } from "./
|
|
14
|
-
import { default as default15 } from "./
|
|
15
|
-
import { default as default16 } from "./
|
|
16
|
-
import { default as default17 } from "./
|
|
17
|
-
import { default as default18 } from "./
|
|
18
|
-
import { default as default19
|
|
19
|
-
import { default as default20 } from "./
|
|
20
|
-
import { default as default21 } from "./
|
|
21
|
-
import { default as default22
|
|
22
|
-
import { default as default23 } from "./
|
|
23
|
-
import { default as default24 } from "./
|
|
24
|
-
import { default as default25 } from "./
|
|
25
|
-
import { default as default26 } from "./
|
|
26
|
-
import { default as default27 } from "./
|
|
27
|
-
import { default as default28 } from "./
|
|
28
|
-
import { default as default29 } from "./pageHeader/
|
|
29
|
-
import { default as default30 } from "./
|
|
30
|
-
import { default as default31 } from "./
|
|
31
|
-
import { default as default32
|
|
32
|
-
import { default as default33 } from "./resizablePanelsLayout/
|
|
33
|
-
import { default as default34
|
|
34
|
-
import { default as default35 } from "./
|
|
35
|
-
import { default as default36 } from "./
|
|
36
|
-
import { default as default37 } from "./
|
|
37
|
-
import { default as default38 } from "./
|
|
38
|
-
import { default as default39
|
|
39
|
-
import { default as default40 } from "./
|
|
40
|
-
import { default as default41 } from "./
|
|
41
|
-
import { default as default42 } from "./
|
|
42
|
-
import { default as default43 } from "./
|
|
43
|
-
import { default as default44 } from "./
|
|
44
|
-
import { default as default45 } from "./
|
|
2
|
+
import { default as default3, AppFrameContentWidth, AppFrameVariant } from "./appFrame/AppFrame.vue.js";
|
|
3
|
+
import { default as default4, AppShellNavigation, AppShellScroll, Breakpoint, useAppShell } from "./appShell/AppShell.vue.js";
|
|
4
|
+
import { default as default5 } from "./appShell/AppShellAside.vue.js";
|
|
5
|
+
import { default as default6, AppShellContentGutter } from "./appShell/AppShellContent.vue.js";
|
|
6
|
+
import { default as default7 } from "./appShell/AppShellFooter.vue.js";
|
|
7
|
+
import { default as default8, AppShellHeaderHeight } from "./appShell/AppShellHeader.vue.js";
|
|
8
|
+
import { default as default9 } from "./appShell/AppShellMain.vue.js";
|
|
9
|
+
import { default as default10 } from "./appShell/AppShellSidebar.vue.js";
|
|
10
|
+
import { default as default11 } from "./aspectRatioLayout/AspectRatioLayout.vue.js";
|
|
11
|
+
import { default as default12 } from "./boxLayout/BoxLayout.vue.js";
|
|
12
|
+
import { default as default13, CanvasBounds, CanvasWheel } from "./canvasArea/CanvasArea.vue.js";
|
|
13
|
+
import { default as default14 } from "./centerLayout/CenterLayout.vue.js";
|
|
14
|
+
import { default as default15 } from "./clusterLayout/ClusterLayout.vue.js";
|
|
15
|
+
import { default as default16 } from "./containerLayout/ContainerLayout.vue.js";
|
|
16
|
+
import { default as default17 } from "./dividerLayout/DividerLayout.vue.js";
|
|
17
|
+
import { default as default18 } from "./fieldsetLayout/FieldsetLayout.vue.js";
|
|
18
|
+
import { default as default19 } from "./flexLayout/FlexLayout.vue.js";
|
|
19
|
+
import { default as default20, FrameLayoutSurface } from "./frameLayout/FrameLayout.vue.js";
|
|
20
|
+
import { default as default21 } from "./grid/Grid.vue.js";
|
|
21
|
+
import { default as default22 } from "./hStackLayout/HStackLayout.vue.js";
|
|
22
|
+
import { default as default23, InlineLayoutAlign } from "./inlineLayout/InlineLayout.vue.js";
|
|
23
|
+
import { default as default24 } from "./inputAddonLayout/InputAddonLayout.vue.js";
|
|
24
|
+
import { default as default25 } from "./inputGroup/InputGroup.vue.js";
|
|
25
|
+
import { default as default26 } from "./listDetailLayout/ListDetailLayout.vue.js";
|
|
26
|
+
import { default as default27 } from "./masonryLayout/MasonryLayout.vue.js";
|
|
27
|
+
import { default as default28 } from "./navbar/Navbar.vue.js";
|
|
28
|
+
import { default as default29 } from "./pageHeader/PageHeader.vue.js";
|
|
29
|
+
import { default as default30 } from "./pageHeader/PageHeaderActions.vue.js";
|
|
30
|
+
import { default as default31 } from "./pullToRefreshLayout/PullToRefreshLayout.vue.js";
|
|
31
|
+
import { default as default32 } from "./resizablePanelsLayout/ResizablePanel.vue.js";
|
|
32
|
+
import { default as default33, useResizableContext } from "./resizablePanelsLayout/ResizablePanelsLayout.vue.js";
|
|
33
|
+
import { default as default34 } from "./resizablePanelsLayout/ResizableSeparator.vue.js";
|
|
34
|
+
import { default as default35, ScrollAxis } from "./scrollArea/ScrollArea.vue.js";
|
|
35
|
+
import { default as default36 } from "./section/Section.vue.js";
|
|
36
|
+
import { default as default37 } from "./separatorLayout/SeparatorLayout.vue.js";
|
|
37
|
+
import { default as default38 } from "./spacerLayout/SpacerLayout.vue.js";
|
|
38
|
+
import { default as default39 } from "./stackLayout/StackLayout.vue.js";
|
|
39
|
+
import { default as default40, StickyLayoutSide } from "./stickyLayout/StickyLayout.vue.js";
|
|
40
|
+
import { default as default41 } from "./surfaceLayout/SurfaceLayout.vue.js";
|
|
41
|
+
import { default as default42 } from "./swipeActionsLayout/SwipeActionsLayout.vue.js";
|
|
42
|
+
import { default as default43 } from "./tiltLayout/TiltLayout.vue.js";
|
|
43
|
+
import { default as default44 } from "./twoColumnLayout/TwoColumnLayout.vue.js";
|
|
44
|
+
import { default as default45 } from "./vStackLayout/VStackLayout.vue.js";
|
|
45
|
+
import { default as default46 } from "./virtualScrollArea/VirtualScrollArea.vue.js";
|
|
45
46
|
import { AnchorLayoutTransition, AnchorLayoutVisibilityMode } from "./anchorLayout/AnchorLayout.variants.js";
|
|
46
47
|
import { ContainerLayoutSize, containerVariants } from "./containerLayout/ContainerLayout.variants.js";
|
|
47
48
|
import { GridBreakpoint, gridVariants, resolveGridColumns, resolveGridGap } from "./grid/Grid.variants.js";
|
|
@@ -55,71 +56,74 @@ export {
|
|
|
55
56
|
AnchorLayoutAppearOn,
|
|
56
57
|
AnchorLayoutTransition,
|
|
57
58
|
AnchorLayoutVisibilityMode,
|
|
58
|
-
default3 as
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
default3 as AppFrame,
|
|
60
|
+
AppFrameContentWidth,
|
|
61
|
+
AppFrameVariant,
|
|
62
|
+
default4 as AppShell,
|
|
63
|
+
default5 as AppShellAside,
|
|
64
|
+
default6 as AppShellContent,
|
|
61
65
|
AppShellContentGutter,
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
default7 as AppShellFooter,
|
|
67
|
+
default8 as AppShellHeader,
|
|
64
68
|
AppShellHeaderHeight,
|
|
65
|
-
|
|
69
|
+
default9 as AppShellMain,
|
|
66
70
|
AppShellNavigation,
|
|
67
71
|
AppShellScroll,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
default10 as AppShellSidebar,
|
|
73
|
+
default11 as AspectRatioLayout,
|
|
74
|
+
default12 as BoxLayout,
|
|
71
75
|
Breakpoint,
|
|
72
|
-
|
|
76
|
+
default13 as CanvasArea,
|
|
73
77
|
CanvasBounds,
|
|
74
78
|
CanvasWheel,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
default14 as CenterLayout,
|
|
80
|
+
default15 as ClusterLayout,
|
|
81
|
+
default16 as ContainerLayout,
|
|
78
82
|
ContainerLayoutSize,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
default17 as DividerLayout,
|
|
84
|
+
default18 as FieldsetLayout,
|
|
85
|
+
default19 as FlexLayout,
|
|
86
|
+
default20 as FrameLayout,
|
|
83
87
|
FrameLayoutSurface,
|
|
84
|
-
|
|
88
|
+
default21 as Grid,
|
|
85
89
|
GridBreakpoint,
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
default22 as HStackLayout,
|
|
91
|
+
default23 as InlineLayout,
|
|
88
92
|
InlineLayoutAlign,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
default24 as InputAddonLayout,
|
|
94
|
+
default25 as InputGroup,
|
|
95
|
+
default26 as ListDetailLayout,
|
|
96
|
+
default27 as MasonryLayout,
|
|
97
|
+
default28 as Navbar,
|
|
94
98
|
NavbarElement,
|
|
95
99
|
NavbarHeight,
|
|
96
100
|
NavbarOrientation,
|
|
97
101
|
NavbarVariant,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
default29 as PageHeader,
|
|
103
|
+
default30 as PageHeaderActions,
|
|
104
|
+
default31 as PullToRefreshLayout,
|
|
105
|
+
default32 as ResizablePanel,
|
|
106
|
+
default33 as ResizablePanelsLayout,
|
|
107
|
+
default34 as ResizableSeparator,
|
|
108
|
+
default35 as ScrollArea,
|
|
105
109
|
ScrollAxis,
|
|
106
|
-
|
|
110
|
+
default36 as Section,
|
|
107
111
|
SectionPaddingY,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
default37 as SeparatorLayout,
|
|
113
|
+
default38 as SpacerLayout,
|
|
114
|
+
default39 as StackLayout,
|
|
111
115
|
StackLayoutAlign,
|
|
112
116
|
StackLayoutDirection,
|
|
113
117
|
StackLayoutJustify,
|
|
114
118
|
StackLayoutWrap,
|
|
115
|
-
|
|
119
|
+
default40 as StickyLayout,
|
|
116
120
|
StickyLayoutSide,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
default41 as SurfaceLayout,
|
|
122
|
+
default42 as SwipeActionsLayout,
|
|
123
|
+
default43 as TiltLayout,
|
|
124
|
+
default44 as TwoColumnLayout,
|
|
125
|
+
default45 as VStackLayout,
|
|
126
|
+
default46 as VirtualScrollArea,
|
|
123
127
|
containerVariants,
|
|
124
128
|
dividerVariants,
|
|
125
129
|
gridVariants,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -32,8 +32,11 @@ export interface AccountMenuProps {
|
|
|
32
32
|
readonly name?: string;
|
|
33
33
|
/** The header's second line — the email or the role. */
|
|
34
34
|
readonly description?: string;
|
|
35
|
-
/**
|
|
36
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The avatar image — a BFF session's `person.picture` binds as is. Without it (`null` included), or when it fails,
|
|
37
|
+
* the avatar shows the name's initials, or the person glyph without a name.
|
|
38
|
+
*/
|
|
39
|
+
readonly avatarSrc?: string | null;
|
|
37
40
|
/** The open state, controlled. The `v-model:open` binding target. */
|
|
38
41
|
readonly open?: boolean;
|
|
39
42
|
/** The initial open state when uncontrolled. Default `false`. */
|
|
@@ -111,14 +114,14 @@ declare const _default: __VLS_WithSlots<import('vue').DefineComponent<AccountMen
|
|
|
111
114
|
readonly defaultOpen: boolean;
|
|
112
115
|
readonly panelClass: string | false | Record<string, any> | import('vue').ClassValue[] | null;
|
|
113
116
|
readonly organization: string;
|
|
117
|
+
readonly avatarSrc: string | null;
|
|
114
118
|
readonly isBusy: boolean;
|
|
115
|
-
readonly triggerLabel: string;
|
|
116
|
-
readonly avatarSrc: string;
|
|
117
119
|
readonly showAppearance: boolean;
|
|
118
120
|
readonly locales: ReadonlyArray<AccountMenuLocale>;
|
|
119
121
|
readonly organizations: ReadonlyArray<AccountMenuOrganization>;
|
|
120
122
|
readonly versions: ReadonlyArray<AccountMenuVersion>;
|
|
121
123
|
readonly onSignOut: () => unknown;
|
|
124
|
+
readonly triggerLabel: string;
|
|
122
125
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
123
126
|
/** The account-level destinations — `MenuItem` rows such as account settings, placed after the switcher. */
|
|
124
127
|
items?(): unknown;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useSlots, useAttrs, useTemplateRef, inject, computed, watch, openBlock, createBlock, unref, withCtx, createVNode, createElementVNode, mergeProps, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createTextVNode, Fragment, renderList, renderSlot } from "vue";
|
|
1
|
+
import { defineComponent, useSlots, useAttrs, useTemplateRef, inject, computed, watch, openBlock, createBlock, unref, withCtx, createVNode, createElementVNode, mergeProps, createSlots, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createTextVNode, Fragment, renderList, renderSlot } from "vue";
|
|
2
2
|
import { Monitor, Sun, Moon, UserRound, ChevronDown, Check, LogOut } from "lucide-vue-next";
|
|
3
3
|
import { dataAttr } from "../../../foundation/dom/DataAttr.js";
|
|
4
4
|
import { useLocale } from "../../../foundation/i18n/providers/LocaleContext.js";
|
|
@@ -131,6 +131,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
131
131
|
if (blocked && isOpen.value) controlled.setValue(false);
|
|
132
132
|
});
|
|
133
133
|
const hasName = computed(() => (props.name ?? "").trim() !== "");
|
|
134
|
+
const pictureSrc = computed(() => {
|
|
135
|
+
const src = (props.avatarSrc ?? "").trim();
|
|
136
|
+
return src === "" ? void 0 : src;
|
|
137
|
+
});
|
|
134
138
|
const triggerName = computed(() => {
|
|
135
139
|
if (!hasName.value) return props.anonymousTriggerLabel;
|
|
136
140
|
const name = (props.name ?? "").trim();
|
|
@@ -228,15 +232,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
228
232
|
disabled: isBlocked.value,
|
|
229
233
|
"data-busy": unref(dataAttr)(unref(props).isBusy)
|
|
230
234
|
}, rest.value, { class: triggerClasses.value }), [
|
|
231
|
-
hasName.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
235
|
+
hasName.value || pictureSrc.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
232
236
|
key: 0,
|
|
233
|
-
name: unref(props).name,
|
|
234
|
-
src:
|
|
237
|
+
name: hasName.value ? unref(props).name : void 0,
|
|
238
|
+
src: pictureSrc.value,
|
|
235
239
|
alt: "",
|
|
236
240
|
size: "sm",
|
|
237
241
|
"is-loading": unref(props).isBusy,
|
|
238
242
|
"data-account-menu-avatar": ""
|
|
239
|
-
},
|
|
243
|
+
}, createSlots({ _: 2 }, [
|
|
244
|
+
!hasName.value ? {
|
|
245
|
+
name: "fallback",
|
|
246
|
+
fn: withCtx(() => [
|
|
247
|
+
createVNode(unref(_sfc_main$4), {
|
|
248
|
+
icon: unref(UserRound),
|
|
249
|
+
size: 18
|
|
250
|
+
}, null, 8, ["icon"])
|
|
251
|
+
]),
|
|
252
|
+
key: "0"
|
|
253
|
+
} : void 0
|
|
254
|
+
]), 1032, ["name", "src", "is-loading"])) : (openBlock(), createElementBlock("span", _hoisted_2, [
|
|
240
255
|
createVNode(unref(_sfc_main$4), {
|
|
241
256
|
icon: unref(UserRound),
|
|
242
257
|
size: 18
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountMenu.vue.js","sources":["../../../../src/presentation/nav/accountMenu/AccountMenu.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\nimport type { Placement } from '@floating-ui/vue';\nimport type { SurfaceVariant } from '../../../foundation/styles';\n\n/** Represents one interface language an `AccountMenu` offers. */\nexport interface AccountMenuLocale {\n /** The locale tag the `locale` model holds — `uz`, `ru`, `en-GB`; also the row's `lang`. */\n readonly value: string;\n\n /** The language's own name in its own language — `O‘zbekcha`, `Русский`, `English`. */\n readonly label: string;\n}\n\n/** Represents one organization the signed-in person belongs to. */\nexport interface AccountMenuOrganization {\n /** The stable identity the `organization` model holds. */\n readonly id: string;\n\n /** The organization name, already translated. */\n readonly label: string;\n\n /** One muted line beside the name — the person's role there, already translated. */\n readonly description?: string;\n}\n\n/** Represents one running service whose version the menu reports. */\nexport interface AccountMenuVersion {\n /** The service name, already translated — `Catalogue`, `API`. */\n readonly label: string;\n\n /** The running version — `0.1.3`, or the caller's translated placeholder while it loads. */\n readonly version: string;\n\n /** The commit the service was built from; the menu shows its first seven characters. */\n readonly commit?: string;\n}\n\n/** Defines props for the avatar menu that ends an app's top bar. */\nexport interface AccountMenuProps {\n /** The signed-in person's display name. Omitted, the trigger shows a person glyph and the header hides. */\n readonly name?: string;\n\n /** The header's second line — the email or the role. */\n readonly description?: string;\n\n /** The avatar image. Without it, or when it fails, the avatar shows the name's initials. */\n readonly avatarSrc?: string;\n\n /** The open state, controlled. The `v-model:open` binding target. */\n readonly open?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n readonly defaultOpen?: boolean;\n\n /** The Floating UI placement. Default `bottom-end`, for a trigger at the end of the bar. */\n readonly placement?: Placement;\n\n /** The disabled state — the trigger cannot open the menu, and an open menu closes. */\n readonly isDisabled?: boolean;\n\n /** The busy state — a session or sign-out in flight; blocks the trigger like `isDisabled` and marks it busy. */\n readonly isBusy?: boolean;\n\n /** The appearance toggle — the system, light and dark rows. Default `true`; needs a `ColorModeProvider`. */\n readonly showAppearance?: boolean;\n\n /** The interface languages, in display order. Fewer than two hide the language rows. */\n readonly locales?: ReadonlyArray<AccountMenuLocale>;\n\n /** The current interface language's `value`. The `v-model:locale` binding target. */\n readonly locale?: string;\n\n /** The person's organizations, in display order. Fewer than two hide the switcher. */\n readonly organizations?: ReadonlyArray<AccountMenuOrganization>;\n\n /** The current organization's `id`. The `v-model:organization` binding target. */\n readonly organization?: string;\n\n /** Every running service's version, in display order — the frontend first, then each backend service. */\n readonly versions?: ReadonlyArray<AccountMenuVersion>;\n\n /**\n * Fires when the reader picks sign out.\n *\n * Kept a PROP, not an emit: its presence renders the sign-out row, and Vue strips a declared emit's\n * listener out of `useAttrs()`, so an emit could never be detected. Bind it as `@sign-out`.\n */\n readonly onSignOut?: () => unknown;\n\n /** The menu's accessible name. Default `\"Account\"`, localized. */\n readonly menuLabel?: string;\n\n /** The trigger's accessible name; `{name}` becomes the name. Default `\"Account menu for {name}\"`, localized. */\n readonly triggerLabel?: string;\n\n /** The trigger's accessible name without a `name`. Default `\"Account menu\"`, localized. */\n readonly anonymousTriggerLabel?: string;\n\n /** The appearance group heading. Default `\"Appearance\"`, localized. */\n readonly appearanceLabel?: string;\n\n /** The row that follows the device setting. Default `\"System\"`, localized. */\n readonly systemModeLabel?: string;\n\n /** The light row. Default `\"Light\"`, localized. */\n readonly lightModeLabel?: string;\n\n /** The dark row. Default `\"Dark\"`, localized. */\n readonly darkModeLabel?: string;\n\n /** The language group heading. Default `\"Language\"`, localized. */\n readonly languageLabel?: string;\n\n /** The organization group heading. Default `\"Organization\"`, localized. */\n readonly organizationLabel?: string;\n\n /** The versions group heading. Default `\"Versions\"`, localized. */\n readonly versionsLabel?: string;\n\n /** The sign-out row. Default `\"Sign out\"`, localized. */\n readonly signOutLabel?: string;\n\n /** The panel's surface recipe — `glass` or `glass-outline` for translucent chrome. Default the menu's own. */\n readonly variant?: SurfaceVariant;\n\n /** The panel class — the hook for an app's own material. */\n readonly panelClass?: HTMLAttributes['class'];\n}\n\n/** @internal The appearance rows' values; `system` hands the mode back to the device. */\nconst Appearance = {\n System: 'system',\n Light: 'light',\n Dark: 'dark',\n} as const;\n\ntype Appearance = (typeof Appearance)[keyof typeof Appearance];\n\n/** @internal The visible length of a commit hash. */\nconst CommitLength = 7;\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, inject, useAttrs, useTemplateRef, watch } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { Check, ChevronDown, LogOut, Monitor, Moon, Sun, UserRound } from 'lucide-vue-next';\nimport { dataAttr } from '../../../foundation/dom';\nimport { Icon, type IconAdapter } from '../../../foundation/icons';\nimport { useLocale, useLocaleDefaults } from '../../../foundation/i18n';\nimport { useId } from '../../../foundation/identifiers';\nimport { ColorMode, ColorModeKey } from '../../../foundation/primitives';\nimport { useControlled } from '../../../foundation/state';\nimport { cn } from '../../../foundation/styles';\nimport Avatar from '../../display/avatar/Avatar.vue';\nimport DropdownMenu from '../dropdownMenu/DropdownMenu.vue';\nimport DropdownMenuContent from '../dropdownMenu/DropdownMenuContent.vue';\nimport DropdownMenuTrigger from '../dropdownMenu/DropdownMenuTrigger.vue';\nimport MenuGroup from '../menu/MenuGroup.vue';\nimport MenuItem from '../menu/MenuItem.vue';\nimport MenuRadioGroup from '../menu/MenuRadioGroup.vue';\nimport MenuRadioItem from '../menu/MenuRadioItem.vue';\nimport MenuSeparator from '../menu/MenuSeparator.vue';\n\n/**\n * Renders the account menu that ends an app's top bar: an avatar trigger that opens who is signed in, the\n * organization switcher, the caller's account destinations, the colour mode, the interface language, each\n * service's version and sign out — always last.\n */\ndefineOptions({ name: 'AccountMenu', inheritAttrs: false });\n\nconst slots = defineSlots<{\n /** The account-level destinations — `MenuItem` rows such as account settings, placed after the switcher. */\n items?(): unknown;\n}>();\n\nconst componentProps = withDefaults(defineProps<AccountMenuProps>(), {\n name: undefined,\n description: undefined,\n avatarSrc: undefined,\n open: undefined,\n defaultOpen: false,\n placement: 'bottom-end',\n isDisabled: false,\n isBusy: false,\n showAppearance: true,\n locales: () => [],\n locale: undefined,\n organizations: () => [],\n organization: undefined,\n versions: () => [],\n onSignOut: undefined,\n triggerLabel: undefined,\n variant: undefined,\n panelClass: undefined,\n});\n\nconst props = useLocaleDefaults(componentProps, 'AccountMenu', {\n menuLabel: 'Account',\n anonymousTriggerLabel: 'Account menu',\n appearanceLabel: 'Appearance',\n systemModeLabel: 'System',\n lightModeLabel: 'Light',\n darkModeLabel: 'Dark',\n languageLabel: 'Language',\n organizationLabel: 'Organization',\n versionsLabel: 'Versions',\n signOutLabel: 'Sign out',\n});\n\nconst emit = defineEmits<{\n /** Fires when the menu opens or closes — the `v-model:open` half. */\n 'update:open': [open: boolean];\n\n /** Fires when the reader picks another interface language — the `v-model:locale` half. */\n 'update:locale': [locale: string];\n\n /** Fires when the reader picks another organization — the `v-model:organization` half. */\n 'update:organization': [organization: string];\n}>();\n\nconst attrs = useAttrs();\nconst i18n = useLocale();\nconst identityId = useId('account-menu-identity');\nconst trigger = useTemplateRef<InstanceType<typeof DropdownMenuTrigger>>('trigger');\n\n/* Optional: without a provider the appearance rows hide instead of throwing. */\nconst colorMode = inject(ColorModeKey, null);\n\nconst controlled = useControlled<boolean>({\n controlled: () => props.open,\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n },\n});\n\nconst isOpen = controlled.value;\n\n/** Whether the trigger refuses to open the menu. */\nconst isBlocked = computed(() => props.isDisabled || props.isBusy);\n\nfunction setOpen(open: boolean): void {\n if (open && isBlocked.value) return;\n controlled.setValue(open);\n}\n\n/* A menu open when the trigger becomes disabled or busy closes, since nothing in it may act now. */\nwatch(isBlocked, (blocked) => {\n if (blocked && isOpen.value) controlled.setValue(false);\n});\n\nconst hasName = computed(() => (props.name ?? '').trim() !== '');\n\nconst triggerName = computed(() => {\n if (!hasName.value) return props.anonymousTriggerLabel;\n const name = (props.name ?? '').trim();\n return props.triggerLabel === undefined\n ? i18n.t('AccountMenu.triggerLabel', { name }, 'Account menu for {name}')\n : props.triggerLabel.replaceAll('{name}', name);\n});\n\nconst hasOrganizationSwitcher = computed(() => props.organizations.length > 1);\n\n/** The one organization a person belongs to, named in the header instead of a one-row switcher. */\nconst soleOrganization = computed(() => (props.organizations.length === 1 ? props.organizations[0] : undefined));\n\nconst hasIdentity = computed(() => hasName.value || Boolean(props.description) || soleOrganization.value !== undefined);\n\nconst hasAppearance = computed(() => props.showAppearance && colorMode !== null);\nconst hasLanguages = computed(() => props.locales.length > 1);\nconst hasVersions = computed(() => props.versions.length > 0);\nconst hasSignOut = computed(() => typeof props.onSignOut === 'function');\n\nconst appearances = computed((): ReadonlyArray<{ value: Appearance; label: string; icon: IconAdapter }> => [\n { value: Appearance.System, label: props.systemModeLabel, icon: Monitor },\n { value: Appearance.Light, label: props.lightModeLabel, icon: Sun },\n { value: Appearance.Dark, label: props.darkModeLabel, icon: Moon },\n]);\n\n/** The row the ambient mode marks: `system` while it follows the device, else the mode itself. */\nconst appearance = computed<Appearance | null>(() => {\n if (!colorMode) return null;\n if (colorMode.followsSystem) return Appearance.System;\n return colorMode.mode === ColorMode.Dark ? Appearance.Dark : Appearance.Light;\n});\n\nfunction chooseAppearance(value: string | null): void {\n if (!colorMode) return;\n if (value === Appearance.System) colorMode.followSystem();\n else if (value === Appearance.Light) colorMode.setMode(ColorMode.Light);\n else if (value === Appearance.Dark) colorMode.setMode(ColorMode.Dark);\n}\n\nfunction chooseLocale(value: string | null): void {\n if (value !== null && value !== props.locale) emit('update:locale', value);\n}\n\nfunction chooseOrganization(id: string | null): void {\n if (id !== null && id !== props.organization) emit('update:organization', id);\n}\n\nfunction signOut(): void {\n void props.onSignOut?.();\n}\n\nfunction shortCommit(commit: string): string {\n return commit.trim().slice(0, CommitLength);\n}\n\n/**\n * The sections present, in display order. Read during render, so a section that appears or a slot that is\n * added re-places every separator; a separator sits before each section but the first.\n */\nfunction sections(): ReadonlyArray<string> {\n return [\n hasIdentity.value && 'identity',\n hasOrganizationSwitcher.value && 'organizations',\n slots.items !== undefined && 'items',\n hasAppearance.value && 'appearance',\n hasLanguages.value && 'languages',\n hasVersions.value && 'versions',\n hasSignOut.value && 'signOut',\n ].filter((section): section is string => typeof section === 'string');\n}\n\nfunction isSeparated(section: string): boolean {\n return sections().indexOf(section) > 0;\n}\n\nconst triggerClasses = computed(() =>\n cn(\n 'group/account-menu inline-flex min-h-11 shrink-0 items-center gap-1.5 rounded-xl border border-transparent',\n 'py-1 ps-1 pe-2 text-foreground transition-colors motion-reduce:transition-none',\n 'hover:border-primary/15 hover:bg-primary-soft',\n 'data-[state=open]:border-primary/15 data-[state=open]:bg-primary-soft',\n 'outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60',\n attrs.class as ClassValue,\n ),\n);\n\n/* The panel fits a phone: never wider than the viewport, never taller than the space under a top bar, and\n scrolling inside itself when the sections outgrow it. As the scroll box it spans the surface's inline padding\n (`-mx-1 px-1`): a separator bleeds that padding to meet the surface edges, and inside a narrower scroll box the\n bleed overflowed it by 4px and drew a sideways scrollbar. The width adds the padding back, so the surface keeps\n its size. */\nconst panelClasses = computed(() =>\n cn(\n '-mx-1 flex w-[min(18.5rem,calc(100vw-1.5rem))] max-h-[calc(100dvh-5rem)] flex-col gap-0.5 px-1',\n 'overflow-y-auto overscroll-contain',\n props.panelClass as ClassValue,\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/** The trigger button. */\nconst el = computed(() => trigger.value?.el ?? null);\n\ndefineExpose({ el });\n</script>\n\n<template>\n <DropdownMenu :open=\"isOpen\" :placement=\"props.placement\" @update:open=\"setOpen\">\n <DropdownMenuTrigger ref=\"trigger\" as-child>\n <button\n type=\"button\"\n :aria-label=\"triggerName\"\n :aria-busy=\"props.isBusy || undefined\"\n :disabled=\"isBlocked\"\n :data-busy=\"dataAttr(props.isBusy)\"\n v-bind=\"rest\"\n :class=\"triggerClasses\"\n >\n <Avatar\n v-if=\"hasName\"\n :name=\"props.name\"\n :src=\"props.avatarSrc\"\n alt=\"\"\n size=\"sm\"\n :is-loading=\"props.isBusy\"\n data-account-menu-avatar\n />\n <span\n v-else\n aria-hidden=\"true\"\n class=\"grid size-8 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground\"\n data-account-menu-avatar\n >\n <Icon :icon=\"UserRound\" :size=\"18\" />\n </span>\n <Icon\n :icon=\"ChevronDown\"\n :size=\"14\"\n class=\"shrink-0 text-muted-foreground transition-transform duration-200 group-data-[state=open]/account-menu:rotate-180 motion-reduce:transition-none\"\n data-account-menu-chevron\n />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n :aria-label=\"props.menuLabel\"\n :aria-describedby=\"hasIdentity ? identityId : undefined\"\n :variant=\"props.variant\"\n :class=\"panelClasses\"\n >\n <div v-if=\"hasIdentity\" :id=\"identityId\" class=\"min-w-0 px-2 py-1.5\" data-account-menu-identity>\n <p v-if=\"hasName\" class=\"truncate text-sm font-semibold text-foreground\">{{ props.name }}</p>\n <p v-if=\"props.description\" class=\"truncate text-xs text-muted-foreground\">{{ props.description }}</p>\n <p v-if=\"soleOrganization\" class=\"truncate text-xs text-muted-foreground\" data-account-menu-organization>\n {{ soleOrganization.label\n }}<template v-if=\"soleOrganization.description\"> · {{ soleOrganization.description }}</template>\n </p>\n </div>\n\n <template v-if=\"hasOrganizationSwitcher\">\n <MenuSeparator v-if=\"isSeparated('organizations')\" />\n <MenuRadioGroup\n :label=\"props.organizationLabel\"\n :model-value=\"props.organization ?? null\"\n data-account-menu-organizations\n @update:model-value=\"chooseOrganization\"\n >\n <!-- Many memberships scroll inside their own band, so appearance and sign out stay in reach. -->\n <div class=\"max-h-44 overflow-y-auto overscroll-contain\" data-account-menu-organization-list>\n <MenuRadioItem v-for=\"entry in props.organizations\" :key=\"entry.id\" :value=\"entry.id\">\n <template #indicator=\"{ checked }\"><Icon v-if=\"checked\" :icon=\"Check\" :size=\"14\" /></template>\n <span class=\"min-w-0 truncate\">{{ entry.label }}</span>\n <span v-if=\"entry.description\" class=\"ms-auto shrink-0 text-xs text-muted-foreground\">\n {{ entry.description }}\n </span>\n </MenuRadioItem>\n </div>\n </MenuRadioGroup>\n </template>\n\n <template v-if=\"slots.items\">\n <MenuSeparator v-if=\"isSeparated('items')\" />\n <slot name=\"items\" />\n </template>\n\n <template v-if=\"hasAppearance\">\n <MenuSeparator v-if=\"isSeparated('appearance')\" />\n <MenuRadioGroup\n :label=\"props.appearanceLabel\"\n :model-value=\"appearance\"\n data-account-menu-appearance\n @update:model-value=\"chooseAppearance\"\n >\n <MenuRadioItem v-for=\"entry in appearances\" :key=\"entry.value\" :value=\"entry.value\">\n <template #indicator=\"{ checked }\"><Icon v-if=\"checked\" :icon=\"Check\" :size=\"14\" /></template>\n <Icon :icon=\"entry.icon\" :size=\"15\" class=\"shrink-0 text-muted-foreground\" />\n {{ entry.label }}\n </MenuRadioItem>\n </MenuRadioGroup>\n </template>\n\n <template v-if=\"hasLanguages\">\n <MenuSeparator v-if=\"isSeparated('languages')\" />\n <MenuRadioGroup\n :label=\"props.languageLabel\"\n :model-value=\"props.locale ?? null\"\n data-account-menu-languages\n @update:model-value=\"chooseLocale\"\n >\n <MenuRadioItem v-for=\"entry in props.locales\" :key=\"entry.value\" :value=\"entry.value\" :lang=\"entry.value\">\n <template #indicator=\"{ checked }\"><Icon v-if=\"checked\" :icon=\"Check\" :size=\"14\" /></template>\n {{ entry.label }}\n </MenuRadioItem>\n </MenuRadioGroup>\n </template>\n\n <template v-if=\"hasVersions\">\n <MenuSeparator v-if=\"isSeparated('versions')\" />\n <MenuGroup :label=\"props.versionsLabel\" data-account-menu-versions>\n <div\n v-for=\"(entry, index) in props.versions\"\n :key=\"`${index}:${entry.label}`\"\n class=\"flex items-baseline justify-between gap-3 px-2 py-0.5 text-xs\"\n data-account-menu-version\n >\n <span class=\"min-w-0 truncate text-muted-foreground\">{{ entry.label }}</span>\n <span class=\"shrink-0 font-mono tabular-nums text-foreground\"\n >{{ entry.version\n }}<span v-if=\"entry.commit\" class=\"text-muted-foreground\"> · {{ shortCommit(entry.commit) }}</span></span\n >\n </div>\n </MenuGroup>\n </template>\n\n <template v-if=\"hasSignOut\">\n <MenuSeparator v-if=\"isSeparated('signOut')\" />\n <MenuItem state=\"destructive\" data-account-menu-sign-out @select=\"signOut\">\n <Icon :icon=\"LogOut\" :size=\"15\" class=\"shrink-0\" />\n {{ props.signOutLabel }}\n </MenuItem>\n </template>\n </DropdownMenuContent>\n </DropdownMenu>\n</template>\n"],"names":["_useSlots","_createBlock","DropdownMenu","_unref","_createVNode","DropdownMenuTrigger","_createElementVNode","_mergeProps","Avatar","_openBlock","_createElementBlock","Icon","DropdownMenuContent","_toDisplayString","_createTextVNode","_Fragment","MenuSeparator","MenuRadioGroup","_renderList","MenuRadioItem","_withCtx","_renderSlot","MenuGroup","MenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmIA,MAAM,aAAa;AAAA,EACjB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AACR;AAKA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BrB,UAAM,QAAQA,SAAA;AAKd,UAAM,iBAAiB;AAqBvB,UAAM,QAAQ,kBAAkB,gBAAgB,e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,UAAA,EAAA,KAAA,KAAA;AAAA,gBALY,YAAW,SAAA,kBAAhCd,YAA+Ce,aAAA,EAAA,KAAA,EAAA,CAAA;gBAC/CZ,YAGWmB,aAAA;AAAA,kBAHD,OAAM;AAAA,kBAAc,8BAAA;AAAA,kBAA4B,UAAQ;AAAA,gBAAA;mCAChE,MAAmD;AAAA,oBAAnDnB,YAAmDD,MAAAQ,WAAA,GAAA;AAAA,sBAA5C,MAAMR,MAAA,MAAA;AAAA,sBAAS,MAAM;AAAA,sBAAI,OAAM;AAAA,oBAAA;oCAAa,MACnDU,gBAAGV,MAAA,KAAA,EAAM,YAAY,GAAA,CAAA;AAAA,kBAAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"AccountMenu.vue.js","sources":["../../../../src/presentation/nav/accountMenu/AccountMenu.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { HTMLAttributes } from 'vue';\nimport type { Placement } from '@floating-ui/vue';\nimport type { SurfaceVariant } from '../../../foundation/styles';\n\n/** Represents one interface language an `AccountMenu` offers. */\nexport interface AccountMenuLocale {\n /** The locale tag the `locale` model holds — `uz`, `ru`, `en-GB`; also the row's `lang`. */\n readonly value: string;\n\n /** The language's own name in its own language — `O‘zbekcha`, `Русский`, `English`. */\n readonly label: string;\n}\n\n/** Represents one organization the signed-in person belongs to. */\nexport interface AccountMenuOrganization {\n /** The stable identity the `organization` model holds. */\n readonly id: string;\n\n /** The organization name, already translated. */\n readonly label: string;\n\n /** One muted line beside the name — the person's role there, already translated. */\n readonly description?: string;\n}\n\n/** Represents one running service whose version the menu reports. */\nexport interface AccountMenuVersion {\n /** The service name, already translated — `Catalogue`, `API`. */\n readonly label: string;\n\n /** The running version — `0.1.3`, or the caller's translated placeholder while it loads. */\n readonly version: string;\n\n /** The commit the service was built from; the menu shows its first seven characters. */\n readonly commit?: string;\n}\n\n/** Defines props for the avatar menu that ends an app's top bar. */\nexport interface AccountMenuProps {\n /** The signed-in person's display name. Omitted, the trigger shows a person glyph and the header hides. */\n readonly name?: string;\n\n /** The header's second line — the email or the role. */\n readonly description?: string;\n\n /**\n * The avatar image — a BFF session's `person.picture` binds as is. Without it (`null` included), or when it fails,\n * the avatar shows the name's initials, or the person glyph without a name.\n */\n readonly avatarSrc?: string | null;\n\n /** The open state, controlled. The `v-model:open` binding target. */\n readonly open?: boolean;\n\n /** The initial open state when uncontrolled. Default `false`. */\n readonly defaultOpen?: boolean;\n\n /** The Floating UI placement. Default `bottom-end`, for a trigger at the end of the bar. */\n readonly placement?: Placement;\n\n /** The disabled state — the trigger cannot open the menu, and an open menu closes. */\n readonly isDisabled?: boolean;\n\n /** The busy state — a session or sign-out in flight; blocks the trigger like `isDisabled` and marks it busy. */\n readonly isBusy?: boolean;\n\n /** The appearance toggle — the system, light and dark rows. Default `true`; needs a `ColorModeProvider`. */\n readonly showAppearance?: boolean;\n\n /** The interface languages, in display order. Fewer than two hide the language rows. */\n readonly locales?: ReadonlyArray<AccountMenuLocale>;\n\n /** The current interface language's `value`. The `v-model:locale` binding target. */\n readonly locale?: string;\n\n /** The person's organizations, in display order. Fewer than two hide the switcher. */\n readonly organizations?: ReadonlyArray<AccountMenuOrganization>;\n\n /** The current organization's `id`. The `v-model:organization` binding target. */\n readonly organization?: string;\n\n /** Every running service's version, in display order — the frontend first, then each backend service. */\n readonly versions?: ReadonlyArray<AccountMenuVersion>;\n\n /**\n * Fires when the reader picks sign out.\n *\n * Kept a PROP, not an emit: its presence renders the sign-out row, and Vue strips a declared emit's\n * listener out of `useAttrs()`, so an emit could never be detected. Bind it as `@sign-out`.\n */\n readonly onSignOut?: () => unknown;\n\n /** The menu's accessible name. Default `\"Account\"`, localized. */\n readonly menuLabel?: string;\n\n /** The trigger's accessible name; `{name}` becomes the name. Default `\"Account menu for {name}\"`, localized. */\n readonly triggerLabel?: string;\n\n /** The trigger's accessible name without a `name`. Default `\"Account menu\"`, localized. */\n readonly anonymousTriggerLabel?: string;\n\n /** The appearance group heading. Default `\"Appearance\"`, localized. */\n readonly appearanceLabel?: string;\n\n /** The row that follows the device setting. Default `\"System\"`, localized. */\n readonly systemModeLabel?: string;\n\n /** The light row. Default `\"Light\"`, localized. */\n readonly lightModeLabel?: string;\n\n /** The dark row. Default `\"Dark\"`, localized. */\n readonly darkModeLabel?: string;\n\n /** The language group heading. Default `\"Language\"`, localized. */\n readonly languageLabel?: string;\n\n /** The organization group heading. Default `\"Organization\"`, localized. */\n readonly organizationLabel?: string;\n\n /** The versions group heading. Default `\"Versions\"`, localized. */\n readonly versionsLabel?: string;\n\n /** The sign-out row. Default `\"Sign out\"`, localized. */\n readonly signOutLabel?: string;\n\n /** The panel's surface recipe — `glass` or `glass-outline` for translucent chrome. Default the menu's own. */\n readonly variant?: SurfaceVariant;\n\n /** The panel class — the hook for an app's own material. */\n readonly panelClass?: HTMLAttributes['class'];\n}\n\n/** @internal The appearance rows' values; `system` hands the mode back to the device. */\nconst Appearance = {\n System: 'system',\n Light: 'light',\n Dark: 'dark',\n} as const;\n\ntype Appearance = (typeof Appearance)[keyof typeof Appearance];\n\n/** @internal The visible length of a commit hash. */\nconst CommitLength = 7;\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, inject, useAttrs, useTemplateRef, watch } from 'vue';\nimport type { ClassValue } from 'clsx';\nimport { Check, ChevronDown, LogOut, Monitor, Moon, Sun, UserRound } from 'lucide-vue-next';\nimport { dataAttr } from '../../../foundation/dom';\nimport { Icon, type IconAdapter } from '../../../foundation/icons';\nimport { useLocale, useLocaleDefaults } from '../../../foundation/i18n';\nimport { useId } from '../../../foundation/identifiers';\nimport { ColorMode, ColorModeKey } from '../../../foundation/primitives';\nimport { useControlled } from '../../../foundation/state';\nimport { cn } from '../../../foundation/styles';\nimport Avatar from '../../display/avatar/Avatar.vue';\nimport DropdownMenu from '../dropdownMenu/DropdownMenu.vue';\nimport DropdownMenuContent from '../dropdownMenu/DropdownMenuContent.vue';\nimport DropdownMenuTrigger from '../dropdownMenu/DropdownMenuTrigger.vue';\nimport MenuGroup from '../menu/MenuGroup.vue';\nimport MenuItem from '../menu/MenuItem.vue';\nimport MenuRadioGroup from '../menu/MenuRadioGroup.vue';\nimport MenuRadioItem from '../menu/MenuRadioItem.vue';\nimport MenuSeparator from '../menu/MenuSeparator.vue';\n\n/**\n * Renders the account menu that ends an app's top bar: an avatar trigger that opens who is signed in, the\n * organization switcher, the caller's account destinations, the colour mode, the interface language, each\n * service's version and sign out — always last.\n */\ndefineOptions({ name: 'AccountMenu', inheritAttrs: false });\n\nconst slots = defineSlots<{\n /** The account-level destinations — `MenuItem` rows such as account settings, placed after the switcher. */\n items?(): unknown;\n}>();\n\nconst componentProps = withDefaults(defineProps<AccountMenuProps>(), {\n name: undefined,\n description: undefined,\n avatarSrc: undefined,\n open: undefined,\n defaultOpen: false,\n placement: 'bottom-end',\n isDisabled: false,\n isBusy: false,\n showAppearance: true,\n locales: () => [],\n locale: undefined,\n organizations: () => [],\n organization: undefined,\n versions: () => [],\n onSignOut: undefined,\n triggerLabel: undefined,\n variant: undefined,\n panelClass: undefined,\n});\n\nconst props = useLocaleDefaults(componentProps, 'AccountMenu', {\n menuLabel: 'Account',\n anonymousTriggerLabel: 'Account menu',\n appearanceLabel: 'Appearance',\n systemModeLabel: 'System',\n lightModeLabel: 'Light',\n darkModeLabel: 'Dark',\n languageLabel: 'Language',\n organizationLabel: 'Organization',\n versionsLabel: 'Versions',\n signOutLabel: 'Sign out',\n});\n\nconst emit = defineEmits<{\n /** Fires when the menu opens or closes — the `v-model:open` half. */\n 'update:open': [open: boolean];\n\n /** Fires when the reader picks another interface language — the `v-model:locale` half. */\n 'update:locale': [locale: string];\n\n /** Fires when the reader picks another organization — the `v-model:organization` half. */\n 'update:organization': [organization: string];\n}>();\n\nconst attrs = useAttrs();\nconst i18n = useLocale();\nconst identityId = useId('account-menu-identity');\nconst trigger = useTemplateRef<InstanceType<typeof DropdownMenuTrigger>>('trigger');\n\n/* Optional: without a provider the appearance rows hide instead of throwing. */\nconst colorMode = inject(ColorModeKey, null);\n\nconst controlled = useControlled<boolean>({\n controlled: () => props.open,\n default: () => props.defaultOpen,\n onChange: (value) => {\n emit('update:open', value);\n },\n});\n\nconst isOpen = controlled.value;\n\n/** Whether the trigger refuses to open the menu. */\nconst isBlocked = computed(() => props.isDisabled || props.isBusy);\n\nfunction setOpen(open: boolean): void {\n if (open && isBlocked.value) return;\n controlled.setValue(open);\n}\n\n/* A menu open when the trigger becomes disabled or busy closes, since nothing in it may act now. */\nwatch(isBlocked, (blocked) => {\n if (blocked && isOpen.value) controlled.setValue(false);\n});\n\nconst hasName = computed(() => (props.name ?? '').trim() !== '');\n\n/** The picture to show, or `undefined` for none — the avatar then falls back to initials or the glyph. */\nconst pictureSrc = computed(() => {\n const src = (props.avatarSrc ?? '').trim();\n return src === '' ? undefined : src;\n});\n\nconst triggerName = computed(() => {\n if (!hasName.value) return props.anonymousTriggerLabel;\n const name = (props.name ?? '').trim();\n return props.triggerLabel === undefined\n ? i18n.t('AccountMenu.triggerLabel', { name }, 'Account menu for {name}')\n : props.triggerLabel.replaceAll('{name}', name);\n});\n\nconst hasOrganizationSwitcher = computed(() => props.organizations.length > 1);\n\n/** The one organization a person belongs to, named in the header instead of a one-row switcher. */\nconst soleOrganization = computed(() => (props.organizations.length === 1 ? props.organizations[0] : undefined));\n\nconst hasIdentity = computed(() => hasName.value || Boolean(props.description) || soleOrganization.value !== undefined);\n\nconst hasAppearance = computed(() => props.showAppearance && colorMode !== null);\nconst hasLanguages = computed(() => props.locales.length > 1);\nconst hasVersions = computed(() => props.versions.length > 0);\nconst hasSignOut = computed(() => typeof props.onSignOut === 'function');\n\nconst appearances = computed((): ReadonlyArray<{ value: Appearance; label: string; icon: IconAdapter }> => [\n { value: Appearance.System, label: props.systemModeLabel, icon: Monitor },\n { value: Appearance.Light, label: props.lightModeLabel, icon: Sun },\n { value: Appearance.Dark, label: props.darkModeLabel, icon: Moon },\n]);\n\n/** The row the ambient mode marks: `system` while it follows the device, else the mode itself. */\nconst appearance = computed<Appearance | null>(() => {\n if (!colorMode) return null;\n if (colorMode.followsSystem) return Appearance.System;\n return colorMode.mode === ColorMode.Dark ? Appearance.Dark : Appearance.Light;\n});\n\nfunction chooseAppearance(value: string | null): void {\n if (!colorMode) return;\n if (value === Appearance.System) colorMode.followSystem();\n else if (value === Appearance.Light) colorMode.setMode(ColorMode.Light);\n else if (value === Appearance.Dark) colorMode.setMode(ColorMode.Dark);\n}\n\nfunction chooseLocale(value: string | null): void {\n if (value !== null && value !== props.locale) emit('update:locale', value);\n}\n\nfunction chooseOrganization(id: string | null): void {\n if (id !== null && id !== props.organization) emit('update:organization', id);\n}\n\nfunction signOut(): void {\n void props.onSignOut?.();\n}\n\nfunction shortCommit(commit: string): string {\n return commit.trim().slice(0, CommitLength);\n}\n\n/**\n * The sections present, in display order. Read during render, so a section that appears or a slot that is\n * added re-places every separator; a separator sits before each section but the first.\n */\nfunction sections(): ReadonlyArray<string> {\n return [\n hasIdentity.value && 'identity',\n hasOrganizationSwitcher.value && 'organizations',\n slots.items !== undefined && 'items',\n hasAppearance.value && 'appearance',\n hasLanguages.value && 'languages',\n hasVersions.value && 'versions',\n hasSignOut.value && 'signOut',\n ].filter((section): section is string => typeof section === 'string');\n}\n\nfunction isSeparated(section: string): boolean {\n return sections().indexOf(section) > 0;\n}\n\nconst triggerClasses = computed(() =>\n cn(\n 'group/account-menu inline-flex min-h-11 shrink-0 items-center gap-1.5 rounded-xl border border-transparent',\n 'py-1 ps-1 pe-2 text-foreground transition-colors motion-reduce:transition-none',\n 'hover:border-primary/15 hover:bg-primary-soft',\n 'data-[state=open]:border-primary/15 data-[state=open]:bg-primary-soft',\n 'outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60',\n attrs.class as ClassValue,\n ),\n);\n\n/* The panel fits a phone: never wider than the viewport, never taller than the space under a top bar, and\n scrolling inside itself when the sections outgrow it. As the scroll box it spans the surface's inline padding\n (`-mx-1 px-1`): a separator bleeds that padding to meet the surface edges, and inside a narrower scroll box the\n bleed overflowed it by 4px and drew a sideways scrollbar. The width adds the padding back, so the surface keeps\n its size. */\nconst panelClasses = computed(() =>\n cn(\n '-mx-1 flex w-[min(18.5rem,calc(100vw-1.5rem))] max-h-[calc(100dvh-5rem)] flex-col gap-0.5 px-1',\n 'overflow-y-auto overscroll-contain',\n props.panelClass as ClassValue,\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/** The trigger button. */\nconst el = computed(() => trigger.value?.el ?? null);\n\ndefineExpose({ el });\n</script>\n\n<template>\n <DropdownMenu :open=\"isOpen\" :placement=\"props.placement\" @update:open=\"setOpen\">\n <DropdownMenuTrigger ref=\"trigger\" as-child>\n <button\n type=\"button\"\n :aria-label=\"triggerName\"\n :aria-busy=\"props.isBusy || undefined\"\n :disabled=\"isBlocked\"\n :data-busy=\"dataAttr(props.isBusy)\"\n v-bind=\"rest\"\n :class=\"triggerClasses\"\n >\n <Avatar\n v-if=\"hasName || pictureSrc\"\n :name=\"hasName ? props.name : undefined\"\n :src=\"pictureSrc\"\n alt=\"\"\n size=\"sm\"\n :is-loading=\"props.isBusy\"\n data-account-menu-avatar\n >\n <!-- A picture without a name that fails to load falls back to the glyph, not to empty initials. -->\n <template v-if=\"!hasName\" #fallback><Icon :icon=\"UserRound\" :size=\"18\" /></template>\n </Avatar>\n <span\n v-else\n aria-hidden=\"true\"\n class=\"grid size-8 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground\"\n data-account-menu-avatar\n >\n <Icon :icon=\"UserRound\" :size=\"18\" />\n </span>\n <Icon\n :icon=\"ChevronDown\"\n :size=\"14\"\n class=\"shrink-0 text-muted-foreground transition-transform duration-200 group-data-[state=open]/account-menu:rotate-180 motion-reduce:transition-none\"\n data-account-menu-chevron\n />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n :aria-label=\"props.menuLabel\"\n :aria-describedby=\"hasIdentity ? identityId : undefined\"\n :variant=\"props.variant\"\n :class=\"panelClasses\"\n >\n <div v-if=\"hasIdentity\" :id=\"identityId\" class=\"min-w-0 px-2 py-1.5\" data-account-menu-identity>\n <p v-if=\"hasName\" class=\"truncate text-sm font-semibold text-foreground\">{{ props.name }}</p>\n <p v-if=\"props.description\" class=\"truncate text-xs text-muted-foreground\">{{ props.description }}</p>\n <p v-if=\"soleOrganization\" class=\"truncate text-xs text-muted-foreground\" data-account-menu-organization>\n {{ soleOrganization.label\n }}<template v-if=\"soleOrganization.description\"> · {{ soleOrganization.description }}</template>\n </p>\n </div>\n\n <template v-if=\"hasOrganizationSwitcher\">\n <MenuSeparator v-if=\"isSeparated('organizations')\" />\n <MenuRadioGroup\n :label=\"props.organizationLabel\"\n :model-value=\"props.organization ?? null\"\n data-account-menu-organizations\n @update:model-value=\"chooseOrganization\"\n >\n <!-- Many memberships scroll inside their own band, so appearance and sign out stay in reach. -->\n <div class=\"max-h-44 overflow-y-auto overscroll-contain\" data-account-menu-organization-list>\n <MenuRadioItem v-for=\"entry in props.organizations\" :key=\"entry.id\" :value=\"entry.id\">\n <template #indicator=\"{ checked }\"><Icon v-if=\"checked\" :icon=\"Check\" :size=\"14\" /></template>\n <span class=\"min-w-0 truncate\">{{ entry.label }}</span>\n <span v-if=\"entry.description\" class=\"ms-auto shrink-0 text-xs text-muted-foreground\">\n {{ entry.description }}\n </span>\n </MenuRadioItem>\n </div>\n </MenuRadioGroup>\n </template>\n\n <template v-if=\"slots.items\">\n <MenuSeparator v-if=\"isSeparated('items')\" />\n <slot name=\"items\" />\n </template>\n\n <template v-if=\"hasAppearance\">\n <MenuSeparator v-if=\"isSeparated('appearance')\" />\n <MenuRadioGroup\n :label=\"props.appearanceLabel\"\n :model-value=\"appearance\"\n data-account-menu-appearance\n @update:model-value=\"chooseAppearance\"\n >\n <MenuRadioItem v-for=\"entry in appearances\" :key=\"entry.value\" :value=\"entry.value\">\n <template #indicator=\"{ checked }\"><Icon v-if=\"checked\" :icon=\"Check\" :size=\"14\" /></template>\n <Icon :icon=\"entry.icon\" :size=\"15\" class=\"shrink-0 text-muted-foreground\" />\n {{ entry.label }}\n </MenuRadioItem>\n </MenuRadioGroup>\n </template>\n\n <template v-if=\"hasLanguages\">\n <MenuSeparator v-if=\"isSeparated('languages')\" />\n <MenuRadioGroup\n :label=\"props.languageLabel\"\n :model-value=\"props.locale ?? null\"\n data-account-menu-languages\n @update:model-value=\"chooseLocale\"\n >\n <MenuRadioItem v-for=\"entry in props.locales\" :key=\"entry.value\" :value=\"entry.value\" :lang=\"entry.value\">\n <template #indicator=\"{ checked }\"><Icon v-if=\"checked\" :icon=\"Check\" :size=\"14\" /></template>\n {{ entry.label }}\n </MenuRadioItem>\n </MenuRadioGroup>\n </template>\n\n <template v-if=\"hasVersions\">\n <MenuSeparator v-if=\"isSeparated('versions')\" />\n <MenuGroup :label=\"props.versionsLabel\" data-account-menu-versions>\n <div\n v-for=\"(entry, index) in props.versions\"\n :key=\"`${index}:${entry.label}`\"\n class=\"flex items-baseline justify-between gap-3 px-2 py-0.5 text-xs\"\n data-account-menu-version\n >\n <span class=\"min-w-0 truncate text-muted-foreground\">{{ entry.label }}</span>\n <span class=\"shrink-0 font-mono tabular-nums text-foreground\"\n >{{ entry.version\n }}<span v-if=\"entry.commit\" class=\"text-muted-foreground\"> · {{ shortCommit(entry.commit) }}</span></span\n >\n </div>\n </MenuGroup>\n </template>\n\n <template v-if=\"hasSignOut\">\n <MenuSeparator v-if=\"isSeparated('signOut')\" />\n <MenuItem state=\"destructive\" data-account-menu-sign-out @select=\"signOut\">\n <Icon :icon=\"LogOut\" :size=\"15\" class=\"shrink-0\" />\n {{ props.signOutLabel }}\n </MenuItem>\n </template>\n </DropdownMenuContent>\n </DropdownMenu>\n</template>\n"],"names":["_useSlots","_createBlock","DropdownMenu","_unref","_createVNode","DropdownMenuTrigger","_createElementVNode","_mergeProps","Avatar","Icon","_openBlock","_createElementBlock","DropdownMenuContent","_toDisplayString","_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AgDe,aAAA,EAAA,KAAA,EAAA,CAAA;gBAChDZ,YAaYkB,aAAA;AAAA,kBAbA,OAAOnB,MAAA,KAAA,EAAM;AAAA,kBAAe,8BAAA;AAAA,gBAAA;mCAEpC,MAAwC;AAAA,qBAD1CO,UAAA,IAAA,GAAAC,mBAWMI,2BAVqBZ,MAAA,KAAA,EAAM,UAAQ,CAA/B,OAAO,UAAK;0CADtBQ,mBAWM,OAAA;AAAA,wBATH,KAAG,GAAK,KAAK,IAAI,MAAM,KAAK;AAAA,wBAC7B,OAAM;AAAA,wBACN,6BAAA;AAAA,sBAAA;wBAEAL,mBAA6E,QAA7E,aAA6EO,gBAArB,MAAM,KAAK,GAAA,CAAA;AAAA,wBACnEP,mBAGC,QAHD,aAGC;AAAA,0BAFKQ,gBAAAD,gBAAA,MAAM,OAAO,GAAA,CAAA;AAAA,0BACH,MAAM,uBAAlBF,mBAAiG,QAAjG,aAAwD,wBAAM,YAAY,MAAM,MAAM,CAAA,GAAA,CAAA;;;;;;;;cAMhF,WAAA,sBAAhBA,mBAMWI,UAAA,EAAA,KAAA,KAAA;AAAA,gBALY,YAAW,SAAA,kBAAhCd,YAA+Ce,aAAA,EAAA,KAAA,EAAA,CAAA;gBAC/CZ,YAGWmB,aAAA;AAAA,kBAHD,OAAM;AAAA,kBAAc,8BAAA;AAAA,kBAA4B,UAAQ;AAAA,gBAAA;mCAChE,MAAmD;AAAA,oBAAnDnB,YAAmDD,MAAAM,WAAA,GAAA;AAAA,sBAA5C,MAAMN,MAAA,MAAA;AAAA,sBAAS,MAAM;AAAA,sBAAI,OAAM;AAAA,oBAAA;oCAAa,MACnDU,gBAAGV,MAAA,KAAA,EAAM,YAAY,GAAA,CAAA;AAAA,kBAAA;;;;;;;;;;;;;"}
|
|
@@ -35,6 +35,8 @@ export interface AppSwitcherMenuProps<T extends AppSwitcherItem = AppSwitcherIte
|
|
|
35
35
|
readonly label?: string;
|
|
36
36
|
/** A second line on the trigger — the organisation or workspace. Hidden below `breakpoint`. */
|
|
37
37
|
readonly subtitle?: string;
|
|
38
|
+
/** The compact state — the trigger shows the mark alone, as above an icon rail; its accessible name stays. */
|
|
39
|
+
readonly isCompact?: boolean;
|
|
38
40
|
/** The open state, controlled. The `v-model:open` binding target. */
|
|
39
41
|
readonly open?: boolean;
|
|
40
42
|
/** The initial open state when uncontrolled. Default `false`. */
|
|
@@ -17,14 +17,17 @@ import _sfc_main$2 from "../../overlays/popover/PopoverTrigger.vue.js";
|
|
|
17
17
|
import _sfc_main$5 from "./AppSwitcherMenuPanel.vue.js";
|
|
18
18
|
import { AppSwitcherMenuExtensions } from "./AppSwitcherMenuExtensions.js";
|
|
19
19
|
import _sfc_main$3 from "../../../foundation/icons/icon/Icon.vue.js";
|
|
20
|
-
const _hoisted_1 = ["aria-expanded", "aria-label", "data-state"];
|
|
20
|
+
const _hoisted_1 = ["aria-expanded", "aria-label", "data-state", "data-compact"];
|
|
21
21
|
const _hoisted_2 = {
|
|
22
22
|
"aria-hidden": "true",
|
|
23
23
|
class: "flex shrink-0",
|
|
24
24
|
"data-app-switcher-mark": ""
|
|
25
25
|
};
|
|
26
26
|
const _hoisted_3 = { class: "grid size-9 place-items-center rounded-lg bg-primary text-primary-foreground" };
|
|
27
|
-
const _hoisted_4 = {
|
|
27
|
+
const _hoisted_4 = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "min-w-0"
|
|
30
|
+
};
|
|
28
31
|
const _hoisted_5 = { class: "block truncate text-sm font-semibold leading-tight" };
|
|
29
32
|
const _hoisted_6 = ["id"];
|
|
30
33
|
const _hoisted_7 = { class: "mb-4 flex shrink-0 items-center justify-between gap-3" };
|
|
@@ -49,6 +52,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
49
52
|
current: {},
|
|
50
53
|
label: { default: void 0 },
|
|
51
54
|
subtitle: { default: void 0 },
|
|
55
|
+
isCompact: { type: Boolean, default: false },
|
|
52
56
|
open: { type: Boolean, default: void 0 },
|
|
53
57
|
defaultOpen: { type: Boolean, default: false },
|
|
54
58
|
breakpoint: { default: "md" },
|
|
@@ -115,7 +119,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
115
119
|
const triggerClasses = computed(
|
|
116
120
|
() => cn(
|
|
117
121
|
"group/app-switcher inline-flex min-h-11 min-w-0 max-w-full shrink-0 items-center gap-2.5 rounded-xl border",
|
|
118
|
-
"border-transparent
|
|
122
|
+
"border-transparent text-start text-foreground transition-colors motion-reduce:transition-none",
|
|
123
|
+
props.isCompact ? "p-1" : "py-1 ps-1 pe-2",
|
|
119
124
|
"hover:border-primary/15 hover:bg-primary-soft data-[state=open]:border-primary/15 data-[state=open]:bg-primary-soft",
|
|
120
125
|
"outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
121
126
|
attrs.class
|
|
@@ -150,7 +155,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
150
155
|
"aria-haspopup": "dialog",
|
|
151
156
|
"aria-expanded": unref(isOpen),
|
|
152
157
|
"aria-label": triggerName.value,
|
|
153
|
-
"data-state": unref(isOpen) ? "open" : "closed"
|
|
158
|
+
"data-state": unref(isOpen) ? "open" : "closed",
|
|
159
|
+
"data-compact": unref(props).isCompact ? "" : void 0
|
|
154
160
|
}, rest.value, { class: triggerClasses.value }), [
|
|
155
161
|
createElementVNode("span", _hoisted_2, [
|
|
156
162
|
renderSlot(_ctx.$slots, "mark", { current: currentItem.value }, () => [
|
|
@@ -162,20 +168,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
162
168
|
])
|
|
163
169
|
])
|
|
164
170
|
]),
|
|
165
|
-
|
|
171
|
+
!unref(props).isCompact ? (openBlock(), createElementBlock("span", _hoisted_4, [
|
|
166
172
|
createElementVNode("span", _hoisted_5, toDisplayString(appName.value), 1),
|
|
167
173
|
unref(props).subtitle ? (openBlock(), createElementBlock("span", {
|
|
168
174
|
key: 0,
|
|
169
175
|
class: normalizeClass(subtitleClasses.value),
|
|
170
176
|
"data-app-switcher-subtitle": ""
|
|
171
177
|
}, toDisplayString(unref(props).subtitle), 3)) : createCommentVNode("", true)
|
|
172
|
-
]),
|
|
173
|
-
|
|
178
|
+
])) : createCommentVNode("", true),
|
|
179
|
+
!unref(props).isCompact ? (openBlock(), createBlock(unref(_sfc_main$3), {
|
|
180
|
+
key: 1,
|
|
174
181
|
icon: unref(ChevronDown),
|
|
175
182
|
size: 16,
|
|
176
183
|
class: "shrink-0 text-muted-foreground transition-transform duration-200 group-data-[state=open]/app-switcher:rotate-180 motion-reduce:transition-none",
|
|
177
184
|
"data-app-switcher-chevron": ""
|
|
178
|
-
}, null, 8, ["icon"])
|
|
185
|
+
}, null, 8, ["icon"])) : createCommentVNode("", true)
|
|
179
186
|
], 16, _hoisted_1)
|
|
180
187
|
]),
|
|
181
188
|
_: 3
|