@altafusion/fugue-app-shell 0.0.0-stage → 0.9.0
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/CHANGELOG.md +153 -0
- package/LICENSE +21 -0
- package/README.md +110 -2
- package/app/app.config.ts +15 -0
- package/app/components/ShellAsidePlaceholder.vue +16 -0
- package/app/components/ShellBrandLogo.vue +26 -0
- package/app/components/ShellLangToggle.vue +129 -0
- package/app/components/ShellPageHeader.vue +25 -0
- package/app/components/ShellSiteHeader.vue +63 -0
- package/app/composables/useAppNav.ts +67 -0
- package/app/composables/useBrandTheme.ts +37 -0
- package/app/composables/usePageChrome.ts +40 -0
- package/app/composables/useShellChrome.ts +122 -0
- package/app/composables/useShellFooterRight.ts +13 -0
- package/app/composables/useShellHeaderActions.ts +18 -0
- package/app/composables/useShellHeaderRight.ts +13 -0
- package/app/composables/useShellI18n.ts +31 -0
- package/app/layouts/default.vue +80 -0
- package/app/layouts/fullscreen.vue +20 -0
- package/app/layouts/minimal.vue +11 -0
- package/app/layouts/product.vue +23 -0
- package/app/plugins/brand-theme.ts +29 -0
- package/app/plugins/shell-brand-head.ts +30 -0
- package/assets/css/brand-variants.css +50 -0
- package/assets/css/sections/landing-header.css +249 -0
- package/assets/css/sections/shell-chrome.css +34 -0
- package/assets/css/shell-sections.css +2 -0
- package/components/BaseButton.vue +106 -0
- package/eslint.config.mjs +4 -0
- package/lib/fugue-content-public-config.ts +39 -0
- package/lib/injection-keys.ts +9 -0
- package/lib/locale-switch-path.ts +20 -0
- package/lib/nuxt-ui-icons.ts +14 -0
- package/nuxt.config.ts +47 -0
- package/package.json +58 -3
- package/themes/tailwind-shell.css +28 -0
- package/types/app-brand.ts +42 -0
- package/types/nuxt-shell.d.ts +38 -0
- package/utils/altafusionBrandTheme.ts +15 -0
- package/utils/formatDate.ts +13 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Landing section header chrome — fixed or static top bar with mobile drawer.
|
|
3
|
+
* Theme via CSS vars on `.landing-header`; site token files override personality.
|
|
4
|
+
*
|
|
5
|
+
* Intentionally unlayered (not @layer components): Tailwind preflight in app
|
|
6
|
+
* main.css sets `@layer base { * { padding: 0 } }`. While stylesheets load,
|
|
7
|
+
* layered link padding loses to base and menu chrome snaps (padding 0 → 1rem).
|
|
8
|
+
* Unlayered rules in theme.css apply with sheet 2 and beat preflight always.
|
|
9
|
+
*/
|
|
10
|
+
.landing-header {
|
|
11
|
+
--landing-header-menu-font-size: 0.875rem;
|
|
12
|
+
--landing-header-menu-font-weight: 400;
|
|
13
|
+
--landing-header-menu-min-width: 5.95rem;
|
|
14
|
+
--landing-header-menu-padding-x: 1rem;
|
|
15
|
+
--landing-header-lang-width: 6.75rem;
|
|
16
|
+
--shell-header-height: 2.5rem;
|
|
17
|
+
/* Nav item gap — override on `.landing-header` (mobile drawer uses rem; desktop uses vw clamps). */
|
|
18
|
+
--landing-header-nav-gap: 0.75rem;
|
|
19
|
+
--landing-header-nav-gap-md: clamp(0.125rem, 0.35vw, 0.375rem);
|
|
20
|
+
--landing-header-nav-gap-lg: clamp(0.1875rem, 0.55vw, 0.5rem);
|
|
21
|
+
/* In theme.css, unlayered `header { padding: … }` also matches — reset for landing chrome. */
|
|
22
|
+
padding: 0;
|
|
23
|
+
border-bottom: 1px solid var(--border-default, var(--color-border));
|
|
24
|
+
background-color: color-mix(in srgb, var(--ui-bg, var(--color-background)) 95%, transparent);
|
|
25
|
+
-webkit-backdrop-filter: blur(4px);
|
|
26
|
+
backdrop-filter: blur(4px);
|
|
27
|
+
transition:
|
|
28
|
+
color 200ms,
|
|
29
|
+
background-color 200ms;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.landing-header__bar {
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
margin-inline: auto;
|
|
35
|
+
display: flex;
|
|
36
|
+
height: var(--shell-header-height);
|
|
37
|
+
width: 100%;
|
|
38
|
+
max-width: 80rem;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: space-between;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@media (width >= 80rem) {
|
|
44
|
+
.landing-header__bar {
|
|
45
|
+
max-width: 90rem;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.landing-header__home {
|
|
50
|
+
margin-inline-start: 0.5rem;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-shrink: 0;
|
|
53
|
+
align-items: center;
|
|
54
|
+
color: var(--ui-text-highlighted, var(--color-text));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.landing-header__menu-btn {
|
|
58
|
+
margin-inline-end: 0.5rem;
|
|
59
|
+
display: inline-flex;
|
|
60
|
+
padding: 0.5rem;
|
|
61
|
+
color: var(--ui-text-highlighted, var(--color-text));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.landing-header__menu-icon {
|
|
65
|
+
width: 1.5rem;
|
|
66
|
+
height: 1.5rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.landing-header nav {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media (width >= 48rem) {
|
|
75
|
+
.landing-header__menu-btn {
|
|
76
|
+
display: none;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@media (width >= 48rem) {
|
|
81
|
+
:root {
|
|
82
|
+
--shell-header-height: 3rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.landing-header {
|
|
86
|
+
--shell-header-height: 3rem;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.landing-header--fixed {
|
|
91
|
+
position: fixed;
|
|
92
|
+
inset-inline: 0;
|
|
93
|
+
top: 0;
|
|
94
|
+
z-index: 50;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.landing-header--static {
|
|
98
|
+
position: static;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.landing-header--scrolled {
|
|
102
|
+
background-color: color-mix(in srgb, var(--ui-bg) 90%, transparent);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.landing-header__logo {
|
|
106
|
+
height: 1.75rem;
|
|
107
|
+
width: auto;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media (width >= 48rem) {
|
|
111
|
+
.landing-header__logo {
|
|
112
|
+
height: 2rem;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.landing-header__nav {
|
|
117
|
+
position: fixed;
|
|
118
|
+
inset-inline: 0;
|
|
119
|
+
bottom: 0;
|
|
120
|
+
top: var(--shell-header-height);
|
|
121
|
+
display: flex;
|
|
122
|
+
translate: 100% 0;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
gap: var(--landing-header-nav-gap);
|
|
125
|
+
background-color: var(--ui-bg);
|
|
126
|
+
padding: 2rem 2rem 0;
|
|
127
|
+
transition: translate 300ms;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.landing-header__nav--open {
|
|
131
|
+
translate: 0 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (width >= 48rem) {
|
|
135
|
+
.landing-header__nav {
|
|
136
|
+
position: static;
|
|
137
|
+
inset: auto;
|
|
138
|
+
translate: none;
|
|
139
|
+
flex-direction: row;
|
|
140
|
+
align-items: center;
|
|
141
|
+
gap: var(--landing-header-nav-gap-md);
|
|
142
|
+
background-color: transparent;
|
|
143
|
+
padding: 0;
|
|
144
|
+
transition: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.landing-header__nav--open {
|
|
148
|
+
translate: none;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@media (width >= 64rem) {
|
|
153
|
+
.landing-header__nav {
|
|
154
|
+
gap: var(--landing-header-nav-gap-lg);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.landing-header__link,
|
|
159
|
+
.landing-header__lang-btn {
|
|
160
|
+
padding-inline: var(--landing-header-menu-padding-x);
|
|
161
|
+
font: var(--landing-header-menu-font-weight) var(--landing-header-menu-font-size) / 1.25
|
|
162
|
+
var(--font-sans, ui-sans-serif, system-ui, sans-serif);
|
|
163
|
+
box-shadow: inset 0 0 0 1px transparent;
|
|
164
|
+
display: inline-flex;
|
|
165
|
+
flex-shrink: 0;
|
|
166
|
+
align-items: center;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
padding-block: 0.25rem;
|
|
169
|
+
text-align: center;
|
|
170
|
+
border-radius: var(--border-radius, 0.25rem);
|
|
171
|
+
border: 0;
|
|
172
|
+
outline: none;
|
|
173
|
+
transition:
|
|
174
|
+
color 200ms,
|
|
175
|
+
background-color 200ms,
|
|
176
|
+
box-shadow 200ms;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.landing-header__link:hover,
|
|
180
|
+
.landing-header__link:active,
|
|
181
|
+
.landing-header__link:focus-visible,
|
|
182
|
+
.landing-header__lang-btn:hover,
|
|
183
|
+
.landing-header__lang-btn:active,
|
|
184
|
+
.landing-header__lang-btn:focus-visible {
|
|
185
|
+
box-shadow: inset 0 0 0 1px var(--color-primary);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@media (width >= 48rem) {
|
|
189
|
+
.landing-header__link {
|
|
190
|
+
min-width: var(--landing-header-menu-min-width);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.landing-header__lang-btn {
|
|
194
|
+
width: var(--landing-header-lang-width);
|
|
195
|
+
min-width: var(--landing-header-lang-width);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.landing-header__lang-btn :where(svg, .iconify, [class*='iconify']) {
|
|
200
|
+
font-size: 1em;
|
|
201
|
+
width: 1em;
|
|
202
|
+
height: 1em;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.landing-header__link {
|
|
206
|
+
color: var(--ui-text-highlighted, var(--color-text));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.landing-header__link:hover,
|
|
210
|
+
.landing-header__link:active {
|
|
211
|
+
background-color: var(--ui-bg-elevated);
|
|
212
|
+
color: var(--color-primary);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.landing-header__actions {
|
|
216
|
+
margin-top: 1rem;
|
|
217
|
+
display: flex;
|
|
218
|
+
flex-direction: column;
|
|
219
|
+
align-items: flex-start;
|
|
220
|
+
gap: 0.5rem;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@media (width >= 48rem) {
|
|
224
|
+
.landing-header__actions {
|
|
225
|
+
margin-top: 0;
|
|
226
|
+
margin-left: 0.5rem;
|
|
227
|
+
flex-direction: row;
|
|
228
|
+
align-items: center;
|
|
229
|
+
gap: 0.25rem;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.landing-header__right {
|
|
234
|
+
display: inline-flex;
|
|
235
|
+
align-items: center;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.landing-header__lang-btn {
|
|
239
|
+
box-shadow: inset 0 0 0 1px var(--color-border);
|
|
240
|
+
cursor: pointer;
|
|
241
|
+
gap: 0.25rem;
|
|
242
|
+
background-color: transparent;
|
|
243
|
+
color: var(--color-text-secondary);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.landing-header__lang-btn:hover,
|
|
247
|
+
.landing-header__lang-btn:active {
|
|
248
|
+
background-color: var(--ui-bg-elevated);
|
|
249
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell layout canvas — applies to all header visual styles.
|
|
3
|
+
*/
|
|
4
|
+
@layer base {
|
|
5
|
+
.shell {
|
|
6
|
+
min-height: 100dvh;
|
|
7
|
+
background-color: var(--ui-bg);
|
|
8
|
+
color: var(--ui-text);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
main.shell-main:not(.shell-main--padded) {
|
|
12
|
+
min-height: unset;
|
|
13
|
+
padding: 0;
|
|
14
|
+
background-color: var(--ui-bg);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
main.shell-main.shell-main--padded {
|
|
18
|
+
min-height: unset;
|
|
19
|
+
padding-top: 0;
|
|
20
|
+
padding-left: 0;
|
|
21
|
+
padding-right: 0;
|
|
22
|
+
padding-bottom: 0;
|
|
23
|
+
background-color: var(--ui-bg);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.shell:has(.landing-header--fixed) main.shell-main {
|
|
27
|
+
padding-top: var(--shell-header-height, 2.5rem);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Static landing header — content does not need fixed offset */
|
|
31
|
+
.shell:has(.landing-header--static) main.shell-main {
|
|
32
|
+
padding-top: 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
variant = 'primary',
|
|
6
|
+
size = 'default',
|
|
7
|
+
disabled = false,
|
|
8
|
+
} = defineProps<{
|
|
9
|
+
variant?: 'primary' | 'secondary' | 'danger'
|
|
10
|
+
size?: 'small' | 'default' | 'large'
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
}>()
|
|
13
|
+
|
|
14
|
+
defineEmits<{
|
|
15
|
+
(e: 'click', event: MouseEvent): void
|
|
16
|
+
}>()
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<button
|
|
21
|
+
v-bind="$attrs"
|
|
22
|
+
class="base-button" :class="[
|
|
23
|
+
`base-button--${variant}`,
|
|
24
|
+
size !== 'default' && `base-button--${size}`,
|
|
25
|
+
]"
|
|
26
|
+
:disabled="disabled"
|
|
27
|
+
@click="$emit('click', $event)"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
</button>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<style scoped>
|
|
34
|
+
.base-button {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
padding: var(--button-padding-y) var(--button-padding-x);
|
|
39
|
+
border: var(--button-border-width) solid transparent;
|
|
40
|
+
border-radius: var(--button-border-radius);
|
|
41
|
+
font-size: var(--button-font-size);
|
|
42
|
+
font-weight: var(--button-font-weight);
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
transition: all var(--button-transition);
|
|
45
|
+
text-decoration: none;
|
|
46
|
+
user-select: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.base-button:disabled {
|
|
50
|
+
opacity: 0.5;
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.base-button--primary {
|
|
55
|
+
background-color: var(--button-primary-bg);
|
|
56
|
+
color: var(--button-primary-text);
|
|
57
|
+
border-color: var(--button-primary-border);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.base-button--primary:hover:not(:disabled) {
|
|
61
|
+
background-color: var(--button-primary-bg-hover);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.base-button--primary:active:not(:disabled) {
|
|
65
|
+
background-color: var(--button-primary-bg-active);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.base-button--secondary {
|
|
69
|
+
background-color: var(--button-secondary-bg);
|
|
70
|
+
color: var(--button-secondary-text);
|
|
71
|
+
border-color: var(--button-secondary-border);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.base-button--secondary:hover:not(:disabled) {
|
|
75
|
+
background-color: var(--button-secondary-bg-hover);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.base-button--secondary:active:not(:disabled) {
|
|
79
|
+
background-color: var(--button-secondary-bg-active);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.base-button--danger {
|
|
83
|
+
background-color: var(--button-danger-bg);
|
|
84
|
+
color: var(--button-danger-text);
|
|
85
|
+
border-color: var(--button-danger-border);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.base-button--danger:hover:not(:disabled) {
|
|
89
|
+
background-color: var(--button-danger-bg-hover);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.base-button--danger:active:not(:disabled) {
|
|
93
|
+
background-color: var(--button-danger-bg-active);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Size variants */
|
|
97
|
+
.base-button--small {
|
|
98
|
+
padding: var(--space-1_5) var(--space-3);
|
|
99
|
+
font-size: var(--font-size-xs);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.base-button--large {
|
|
103
|
+
padding: var(--space-3) var(--space-6);
|
|
104
|
+
font-size: var(--font-size-base);
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface FugueContentLocaleEntry {
|
|
2
|
+
code: string
|
|
3
|
+
name?: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface ShellFugueContentPublicConfig {
|
|
7
|
+
i18nEnabled?: boolean
|
|
8
|
+
defaultLocale?: string
|
|
9
|
+
filteredLocales?: FugueContentLocaleEntry[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function isFugueContentLocaleEntry(value: unknown): value is FugueContentLocaleEntry {
|
|
13
|
+
return typeof value === 'object'
|
|
14
|
+
&& value !== null
|
|
15
|
+
&& typeof (value as FugueContentLocaleEntry).code === 'string'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function normalizeFugueContentLocales(value: unknown): FugueContentLocaleEntry[] {
|
|
19
|
+
if (!Array.isArray(value))
|
|
20
|
+
return []
|
|
21
|
+
return value.filter(isFugueContentLocaleEntry)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Read `runtimeConfig.public.cms` with normalized locale entries. */
|
|
25
|
+
export function useShellFugueContentPublicConfig(): ShellFugueContentPublicConfig | undefined {
|
|
26
|
+
const cms = useRuntimeConfig().public.cms
|
|
27
|
+
if (!cms || typeof cms !== 'object')
|
|
28
|
+
return undefined
|
|
29
|
+
|
|
30
|
+
const record = cms as Record<string, unknown>
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
i18nEnabled: record.i18nEnabled === true,
|
|
34
|
+
defaultLocale: typeof record.defaultLocale === 'string'
|
|
35
|
+
? record.defaultLocale
|
|
36
|
+
: undefined,
|
|
37
|
+
filteredLocales: normalizeFugueContentLocales(record.filteredLocales)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Optional Studio-driven display name from `settings.site.yml` (`siteName`).
|
|
5
|
+
* Provided by `@altafusion/fugue-content` when the settings collection is enabled.
|
|
6
|
+
*/
|
|
7
|
+
export const shellDisplayNameKey: InjectionKey<Ref<string | undefined>> = Symbol(
|
|
8
|
+
'altafusion:shell-display-name'
|
|
9
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const STUDIO_SCAN_HASH = '#_studio_scan'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Path-only locale switch target — strips fragments so SSR and client hydration agree.
|
|
5
|
+
* Browsers do not send the hash to the server; @nuxtjs/i18n may add it on the client only.
|
|
6
|
+
*/
|
|
7
|
+
export function localeSwitchPathBase(raw: string): string {
|
|
8
|
+
let path = raw.replace(/#_studio_scan$/, '')
|
|
9
|
+
const hashIndex = path.indexOf('#')
|
|
10
|
+
if (hashIndex !== -1)
|
|
11
|
+
path = path.slice(0, hashIndex)
|
|
12
|
+
return path || '/'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Re-apply in-page anchor after hydration (hash-nav one-page sites). */
|
|
16
|
+
export function localeSwitchPathWithHash(base: string, hash: string | undefined): string {
|
|
17
|
+
if (!hash || hash === STUDIO_SCAN_HASH)
|
|
18
|
+
return base
|
|
19
|
+
return `${base}${hash}`
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lucide icons used by Nuxt UI + shell chrome.
|
|
3
|
+
* Bundled via `@nuxt/icon` clientBundle so SSR does not HTTP-fetch `/api/_nuxt_icon` (self-deadlock timeout).
|
|
4
|
+
*/
|
|
5
|
+
export const nuxtUiLucideIcons = [
|
|
6
|
+
'lucide:menu',
|
|
7
|
+
'lucide:x',
|
|
8
|
+
'lucide:sun',
|
|
9
|
+
'lucide:moon',
|
|
10
|
+
'lucide:globe',
|
|
11
|
+
'lucide:chevron-down',
|
|
12
|
+
'lucide:home',
|
|
13
|
+
'lucide:info'
|
|
14
|
+
] as const
|
package/nuxt.config.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @altafusion/fugue-app-shell — Nuxt layer
|
|
3
|
+
*
|
|
4
|
+
* Site layouts (default, minimal), product layout (Nuxt UI page chrome),
|
|
5
|
+
* shell composables, runtime brand switcher with its CSS (`assets/css/brand-variants.css`),
|
|
6
|
+
* and landing/shell section CSS. No fonts: sites declare their own (see fugue-theme `--site-font-*`).
|
|
7
|
+
* Extends fugue-ui for generic widgets.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/// <reference path="./types/nuxt-shell.d.ts" />
|
|
11
|
+
|
|
12
|
+
import { resolve } from 'node:path'
|
|
13
|
+
import { fileURLToPath } from 'node:url'
|
|
14
|
+
import { nuxtUiLucideIcons } from './lib/nuxt-ui-icons'
|
|
15
|
+
|
|
16
|
+
const layerRoot = fileURLToPath(new URL('.', import.meta.url))
|
|
17
|
+
|
|
18
|
+
export default defineNuxtConfig({
|
|
19
|
+
extends: ['@altafusion/fugue-ui'],
|
|
20
|
+
|
|
21
|
+
css: [
|
|
22
|
+
resolve(layerRoot, './assets/css/brand-variants.css'),
|
|
23
|
+
resolve(layerRoot, './assets/css/shell-sections.css')
|
|
24
|
+
],
|
|
25
|
+
|
|
26
|
+
icon: {
|
|
27
|
+
clientBundle: {
|
|
28
|
+
icons: [...nuxtUiLucideIcons]
|
|
29
|
+
},
|
|
30
|
+
serverBundle: {
|
|
31
|
+
collections: ['lucide']
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
imports: {
|
|
36
|
+
dirs: [
|
|
37
|
+
resolve(layerRoot, 'utils')
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
components: [
|
|
42
|
+
{
|
|
43
|
+
path: './components',
|
|
44
|
+
pathPrefix: false
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altafusion/fugue-app-shell",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.9.0",
|
|
5
|
+
"description": "Site chrome layer on fugue-ui: layouts, header/footer, nav composables and a runtime brand switcher. No fonts; sites own typography",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/altafusion/fugue/tree/main/packages-product/fugue-app-shell#readme",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/altafusion/fugue/issues"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/altafusion/fugue.git",
|
|
14
|
+
"directory": "packages-product/fugue-app-shell"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./nuxt.config.ts",
|
|
21
|
+
"./app/composables/useBrandTheme": "./app/composables/useBrandTheme.ts",
|
|
22
|
+
"./utils/altafusionBrandTheme": "./utils/altafusionBrandTheme.ts",
|
|
23
|
+
"./lib/fugue-content-public-config": "./lib/fugue-content-public-config.ts",
|
|
24
|
+
"./lib/injection-keys": "./lib/injection-keys.ts",
|
|
25
|
+
"./themes/tailwind-shell.css": "./themes/tailwind-shell.css"
|
|
26
|
+
},
|
|
27
|
+
"main": "./nuxt.config.ts",
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"nuxt": ">=4.0.0",
|
|
30
|
+
"vue": "^3.5.0",
|
|
31
|
+
"vue-router": "^5.0.0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@altafusion/fugue-ui": "0.9.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@altafusion/eslint-config-preset": "0.9.0",
|
|
38
|
+
"@altafusion/nuxt-base": "0.9.0",
|
|
39
|
+
"@iconify-json/lucide": "^1.2.161",
|
|
40
|
+
"@types/node": "^26.6.11",
|
|
41
|
+
"eslint": "^10.16.0",
|
|
42
|
+
"nuxt": "^4.7.0",
|
|
43
|
+
"typescript": "^6.0.3",
|
|
44
|
+
"vue": "^3.5.46",
|
|
45
|
+
"vue-router": "^5.5.3"
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"**",
|
|
49
|
+
"!**/*.test.ts",
|
|
50
|
+
"!**/.nuxt",
|
|
51
|
+
"!**/.output",
|
|
52
|
+
"!**/.data",
|
|
53
|
+
"!**/coverage",
|
|
54
|
+
"!**/node_modules"
|
|
55
|
+
],
|
|
56
|
+
"scripts": {
|
|
57
|
+
"clean": "rm -rf .output .nuxt node_modules/.cache dist",
|
|
58
|
+
"lint": "eslint .",
|
|
59
|
+
"lint:fix": "eslint . --fix"
|
|
60
|
+
}
|
|
6
61
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell Tailwind extensions: header height and page overflow. Fonts are not set here; sites own them.
|
|
3
|
+
* Import after `@altafusion/fugue-theme/themes/tailwind.css` in app `main.css`.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@layer theme {
|
|
7
|
+
:root {
|
|
8
|
+
--ui-header-height: calc(var(--shell-header-height, 2.5rem) + 1px);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (width >= 48rem) {
|
|
12
|
+
:root {
|
|
13
|
+
--ui-header-height: calc(3rem + 1px);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@layer base {
|
|
19
|
+
html {
|
|
20
|
+
font-family: var(--font-sans);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
html,
|
|
24
|
+
body {
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
overflow-x: clip;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Product app branding — set in each app's `app.config.ts`. */
|
|
2
|
+
export interface ShellBrandConfig {
|
|
3
|
+
/** Display name (header title fallback, logo alt fallback). */
|
|
4
|
+
name?: string
|
|
5
|
+
/** Public asset path, e.g. `/logo.svg`. */
|
|
6
|
+
logo?: string
|
|
7
|
+
logoAlt?: string
|
|
8
|
+
/** Extra classes on the logo `<img>` (e.g. `dark:brightness-0 dark:invert`). */
|
|
9
|
+
logoClass?: string
|
|
10
|
+
/** Public favicon path, e.g. `/favicon.svg`. */
|
|
11
|
+
favicon?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Resolved brand values after shell composable fallbacks. */
|
|
15
|
+
export interface ShellBrand {
|
|
16
|
+
name: string
|
|
17
|
+
logo?: string
|
|
18
|
+
logoAlt: string
|
|
19
|
+
logoClass?: string
|
|
20
|
+
favicon?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ShellSeoConfig {
|
|
24
|
+
title?: string
|
|
25
|
+
titleTemplate?: string
|
|
26
|
+
description?: string
|
|
27
|
+
ogImage?: string
|
|
28
|
+
twitterCard?: 'summary' | 'summary_large_image'
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ShellHeaderConfig {
|
|
32
|
+
title?: string
|
|
33
|
+
showColorMode?: boolean
|
|
34
|
+
/** Structural chrome preset — `default` (UHeader) or landing hash-nav styles. */
|
|
35
|
+
visualStyle?: 'default' | 'landing-fixed' | 'landing-static'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ShellAppConfig {
|
|
39
|
+
brand?: ShellBrandConfig
|
|
40
|
+
seo?: ShellSeoConfig
|
|
41
|
+
header?: ShellHeaderConfig
|
|
42
|
+
}
|