@seta-labs/nuxt-foundation 0.9.0 → 0.10.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/app/components/FoundationMenu.vue +18 -12
- package/app/composables/useFoundation.ts +4 -1
- package/app.config.ts +2 -0
- package/design-system/README.md +1 -1
- package/design-system/components/Menu/README.md +2 -1
- package/design-system/components/Menu/preview.html +2 -2
- package/design-system/components/bundle.css +3 -0
- package/design-system/tokens.css +1 -1
- package/design-system/tokens.json +1 -1
- package/package.json +1 -1
|
@@ -29,19 +29,25 @@ const active = useActiveNav();
|
|
|
29
29
|
>
|
|
30
30
|
<div v-for="(gruppo, n) in gruppi" :key="gruppo.titolo ?? n" class="sf-menu__gruppo">
|
|
31
31
|
<div v-if="gruppo.titolo" class="sf-menu__titolo">{{ gruppo.titolo }}</div>
|
|
32
|
-
<
|
|
33
|
-
v-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
:aria-current="item === active ? 'page' : undefined"
|
|
38
|
-
>
|
|
39
|
-
<SfIcona :name="item.icon" />
|
|
40
|
-
{{ item.label }}
|
|
41
|
-
<span v-if="conteggi[item.to]" class="sf-menu__conteggio">
|
|
42
|
-
{{ conteggi[item.to] }}
|
|
32
|
+
<template v-for="item in gruppo.voci" :key="item.to">
|
|
33
|
+
<span v-if="item.disabled" class="sf-menu__voce" aria-disabled="true">
|
|
34
|
+
<SfIcona :name="item.icon" />
|
|
35
|
+
{{ item.label }}
|
|
36
|
+
<span class="sf-menu__nota">In arrivo</span>
|
|
43
37
|
</span>
|
|
44
|
-
|
|
38
|
+
<NuxtLink
|
|
39
|
+
v-else
|
|
40
|
+
:to="item.to"
|
|
41
|
+
class="sf-menu__voce"
|
|
42
|
+
:aria-current="item === active ? 'page' : undefined"
|
|
43
|
+
>
|
|
44
|
+
<SfIcona :name="item.icon" />
|
|
45
|
+
{{ item.label }}
|
|
46
|
+
<span v-if="conteggi[item.to]" class="sf-menu__conteggio">
|
|
47
|
+
{{ conteggi[item.to] }}
|
|
48
|
+
</span>
|
|
49
|
+
</NuxtLink>
|
|
50
|
+
</template>
|
|
45
51
|
</div>
|
|
46
52
|
</nav>
|
|
47
53
|
</template>
|
|
@@ -40,7 +40,10 @@ export function useActiveNav(): ComputedRef<FoundationNavItem | undefined> {
|
|
|
40
40
|
const route = useRoute();
|
|
41
41
|
const nav = useFoundationNav();
|
|
42
42
|
return computed(() =>
|
|
43
|
-
nav.find(
|
|
43
|
+
nav.find(
|
|
44
|
+
(item) =>
|
|
45
|
+
!item.disabled && (route.path === item.to || route.path.startsWith(`${item.to}/`)),
|
|
46
|
+
),
|
|
44
47
|
);
|
|
45
48
|
}
|
|
46
49
|
|
package/app.config.ts
CHANGED
|
@@ -6,6 +6,8 @@ export interface FoundationNavItem {
|
|
|
6
6
|
icon: IconName;
|
|
7
7
|
/** Title of the side-menu block the item belongs to; consecutive items share it. */
|
|
8
8
|
gruppo?: string;
|
|
9
|
+
/** A section announced but not available yet: shown dimmed with "In arrivo", not a link. */
|
|
10
|
+
disabled?: boolean;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
// Types the host's `defineAppConfig` input: a wrong icon name fails its typecheck.
|
package/design-system/README.md
CHANGED
|
@@ -38,7 +38,7 @@ Seta Foundation è la suite di app interne di Seta Labs (Agency, Proxy, Geo, Imm
|
|
|
38
38
|
## Spazio, griglia, forma
|
|
39
39
|
|
|
40
40
|
- Scala a 4px: `s-1`…`s-10`. Nelle app: `s-3` dentro le card, `s-5` padding di card e pannelli, `s-7` fra i blocchi di una pagina.
|
|
41
|
-
- Shell: barra `shell-barra` (52px), menu laterale `shell-menu` (
|
|
41
|
+
- Shell: barra `shell-barra` (52px), menu laterale `shell-menu` (224px; un'app può ridefinirlo nel proprio CSS), barra di stato `shell-stato` (28px). Controlli alti `controllo` (40px), `controllo-compatto` (32px) in tabelle e barre degli strumenti.
|
|
42
42
|
- Livelli: 0 `bg` (pagina), 1 `surface` + `border` (card, pannelli, tabelle), 2 `surface-2` (hover, selezione, campo attivo).
|
|
43
43
|
- Aree di tocco di almeno 44px per scelte e voci su dispositivi touch.
|
|
44
44
|
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Il menu laterale: la shell lo disegna, l'app lo dichiara nel proprio `app.config` (voci, icone, gruppi, conteggi).
|
|
4
4
|
|
|
5
|
-
- Larghezza `shell-menu` (
|
|
5
|
+
- Larghezza `shell-menu` (224px), bordo destro `hud-tenue`. Un'app con etichette lunghe ridefinisce `--shell-menu` nel proprio CSS; la shell la legge da lì.
|
|
6
6
|
- Voce `sf-menu__voce`: icona 18 + etichetta + conteggio opzionale a destra. La voce attiva ha `aria-current="page"`: fondo `accent-soft`, icona `accent`.
|
|
7
|
+
- Voce disabilitata, per una sezione annunciata ma non ancora disponibile: uno `span` con `aria-disabled="true"` al posto del link, testo attenuato, nessun hover, e a destra la nota `sf-menu__nota` ("In arrivo"). Non riceve il focus e non apre nulla.
|
|
7
8
|
- Gruppi con `sf-menu__titolo` in bronzo e filetto: solo quando le voci sono più di 6.
|
|
8
9
|
- Impostazioni e voci di servizio in fondo. Mai un secondo menu in alto: la navigazione è una sola.
|
|
9
10
|
- Le voci della preview sono un esempio; ogni app porta le sue.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- @dsCard group="Shell" height=420 subtitle="Menu laterale dichiarato dall'app" -->
|
|
1
|
+
<!-- @dsCard group="Shell" height=420 subtitle="Menu laterale dichiarato dall'app, con una voce in arrivo" -->
|
|
2
2
|
<!doctype html>
|
|
3
3
|
<html lang="it">
|
|
4
4
|
<head><meta charset="utf-8"><title>Menu</title>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<div class="sf pv">
|
|
9
9
|
<nav class="sf-menu" aria-label="Proxy" style="height:380px">
|
|
10
10
|
<div class="sf-menu__gruppo"><a class="sf-menu__voce" href="#" aria-current="page"><svg class="sf-icona" viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="4" width="4" height="4"/><rect x="10" y="4" width="4" height="4"/><rect x="16" y="4" width="4" height="4"/><rect x="4" y="10" width="4" height="4"/><rect x="10" y="10" width="4" height="4"/><rect x="16" y="10" width="4" height="4"/><rect x="4" y="16" width="4" height="4"/><rect x="10" y="16" width="4" height="4"/><rect x="16" y="16" width="4" height="4"/></svg>Panoramica</a><a class="sf-menu__voce" href="#"><svg class="sf-icona" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 12h6M15 12h6M12 3v6M12 15v6"/><path d="m18 9 3 3-3 3"/><rect x="9" y="9" width="6" height="6"/></svg>Gateway<span class="sf-menu__conteggio">[N]</span></a><a class="sf-menu__voce" href="#"><svg class="sf-icona" viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="4" width="16" height="6"/><rect x="4" y="14" width="16" height="6"/><path d="M7 7h2M7 17h2M15 7h2M15 17h2M12 10v4"/></svg>Upstream<span class="sf-menu__conteggio">[N]</span></a></div>
|
|
11
|
-
<div class="sf-menu__gruppo"><div class="sf-menu__titolo">Accesso</div><a class="sf-menu__voce" href="#"><svg class="sf-icona" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 3h8l4 4v14H6z"/><path d="M14 3v4h4"/><path d="M9 12h6M9 15h6M9 18h3"/></svg>Consumatori</a><a class="sf-menu__voce" href="#"><svg class="sf-icona" viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="6" width="18" height="12"/><circle cx="8.5" cy="11" r="2"/><path d="M5.5 16c.6-1.5 1.7-2.2 3-2.2s2.4.7 3 2.2"/><path d="M14 10h4M14 13h4"/></svg>Credenziali</a></div>
|
|
11
|
+
<div class="sf-menu__gruppo"><div class="sf-menu__titolo">Accesso</div><a class="sf-menu__voce" href="#"><svg class="sf-icona" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 3h8l4 4v14H6z"/><path d="M14 3v4h4"/><path d="M9 12h6M9 15h6M9 18h3"/></svg>Consumatori</a><a class="sf-menu__voce" href="#"><svg class="sf-icona" viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="6" width="18" height="12"/><circle cx="8.5" cy="11" r="2"/><path d="M5.5 16c.6-1.5 1.7-2.2 3-2.2s2.4.7 3 2.2"/><path d="M14 10h4M14 13h4"/></svg>Credenziali</a><span class="sf-menu__voce" aria-disabled="true"><svg class="sf-icona" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 20V10M10 20V4M16 20v-7M22 20H2"/></svg>Report<span class="sf-menu__nota">In arrivo</span></span></div>
|
|
12
12
|
<div style="flex:1"></div>
|
|
13
13
|
<div class="sf-menu__gruppo"><a class="sf-menu__voce" href="#"><svg class="sf-icona" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h10M18 7h2M4 17h4M12 17h8"/><rect x="14" y="5" width="4" height="4"/><rect x="8" y="15" width="4" height="4"/></svg>Impostazioni</a></div>
|
|
14
14
|
</nav>
|
|
@@ -195,6 +195,9 @@
|
|
|
195
195
|
.sf-menu__voce[aria-current="page"] { color: var(--fg); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 40%, transparent); }
|
|
196
196
|
.sf-menu__voce[aria-current="page"] .sf-icona { color: var(--accent); }
|
|
197
197
|
.sf-menu__conteggio { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
|
|
198
|
+
.sf-menu__voce[aria-disabled="true"] { opacity: 0.55; cursor: default; }
|
|
199
|
+
.sf-menu__voce[aria-disabled="true"]:hover { color: var(--muted); background: none; }
|
|
200
|
+
.sf-menu__nota { margin-left: auto; font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
|
|
198
201
|
|
|
199
202
|
.sf-stato { height: var(--shell-stato); display: flex; align-items: center; gap: 24px; padding: 0 16px; border-top: 1px solid var(--hud-tenue); font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
|
|
200
203
|
.sf-stato b { color: var(--fg); font-weight: 500; }
|
package/design-system/tokens.css
CHANGED
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"layout": {"tokens": [
|
|
106
106
|
{"name": "shell-barra", "value": "52px", "usage": "Altezza della barra superiore della shell."},
|
|
107
107
|
{"name": "shell-stato", "value": "28px", "usage": "Altezza della barra di stato in basso."},
|
|
108
|
-
{"name": "shell-menu", "value": "
|
|
108
|
+
{"name": "shell-menu", "value": "224px", "usage": "Larghezza del menu laterale. Un'app con etichette lunghe può ridefinire --shell-menu nel proprio CSS."},
|
|
109
109
|
{"name": "controllo", "value": "40px", "usage": "Altezza standard di bottoni e campi nelle app."},
|
|
110
110
|
{"name": "controllo-compatto", "value": "32px", "usage": "Bottoni e campi dentro tabelle e barre degli strumenti."},
|
|
111
111
|
{"name": "contenuto-max", "value": "1200px", "usage": "Larghezza massima delle pagine di lettura."}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seta-labs/nuxt-foundation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Seta Foundation: the Nuxt layer every internal Seta panel extends — design system mirror (tokens, sf- components, icons, brand) plus the shared shell (bar, app launcher, side menu, status bar)",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|