@aiaiai-pt/design-system 0.38.0 → 0.38.1
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/components/DateRangePicker.svelte.d.ts +1 -1
- package/components/EChart.svelte.d.ts +2 -0
- package/components/NotificationPrefs.svelte.d.ts +12 -9
- package/components/SiteHeader.svelte.d.ts +40 -5
- package/components/index.d.ts +2 -0
- package/components/map-utils.d.ts +17 -0
- package/components/renderer/EChartWidget.svelte.d.ts +4 -1
- package/components/renderer/types.d.ts +27 -0
- package/package.json +2 -2
|
@@ -35,7 +35,7 @@ declare const DateRangePicker: import("svelte").Component<{
|
|
|
35
35
|
onchange?: any;
|
|
36
36
|
id?: any;
|
|
37
37
|
class?: string;
|
|
38
|
-
} & Record<string, any>, {}, "
|
|
38
|
+
} & Record<string, any>, {}, "start" | "end">;
|
|
39
39
|
type $$ComponentProps = {
|
|
40
40
|
start?: any;
|
|
41
41
|
end?: any;
|
|
@@ -49,6 +49,7 @@ declare const EChart: import("svelte").Component<{
|
|
|
49
49
|
labelHeader?: string;
|
|
50
50
|
valueHeader?: string;
|
|
51
51
|
locale?: string;
|
|
52
|
+
kind?: string;
|
|
52
53
|
height?: string;
|
|
53
54
|
class?: string;
|
|
54
55
|
} & Record<string, any>, {}, "">;
|
|
@@ -58,6 +59,7 @@ type $$ComponentProps = {
|
|
|
58
59
|
labelHeader?: string;
|
|
59
60
|
valueHeader?: string;
|
|
60
61
|
locale?: string;
|
|
62
|
+
kind?: string;
|
|
61
63
|
height?: string;
|
|
62
64
|
class?: string;
|
|
63
65
|
} & Record<string, any>;
|
|
@@ -4,6 +4,7 @@ export type PrefItem = {
|
|
|
4
4
|
label: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
active: boolean;
|
|
7
|
+
group?: string;
|
|
7
8
|
};
|
|
8
9
|
type NotificationPrefs = {
|
|
9
10
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
@@ -19,16 +20,18 @@ type NotificationPrefs = {
|
|
|
19
20
|
* Toggling a row calls `onToggle(id, next)` — the consumer performs the write
|
|
20
21
|
* and re-feeds `items` (or sets `busyId` while it's in flight).
|
|
21
22
|
*
|
|
22
|
-
* Accessibility-first: a bordered semantic list
|
|
23
|
-
* label (
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
23
|
+
* Accessibility-first: a bordered semantic list inside a `<section>` region
|
|
24
|
+
* named by `label` (the visible page heading is the consumer's job — same split
|
|
25
|
+
* as RankingBoard, so one widget can own the page `<h1>`). Each row pairs a real
|
|
26
|
+
* text label (and optional description) with a `Toggle` (`role="switch"`,
|
|
27
|
+
* `aria-checked`); the switch carries its own accessible name via `aria-label`.
|
|
28
|
+
* A row that's saving is `disabled` (no double-submit). Consumes semantic tokens
|
|
29
|
+
* so dark / high-contrast schemes (#244) ride through. Soft-empty: no items →
|
|
30
|
+
* renders the `emptyText` note (never an empty shell).
|
|
28
31
|
*
|
|
29
32
|
* @example
|
|
30
33
|
* <NotificationPrefs
|
|
31
|
-
*
|
|
34
|
+
* label="Notifications"
|
|
32
35
|
* items={[
|
|
33
36
|
* { id: "all", label: "All updates", description: "Every proposal and phase change", active: true },
|
|
34
37
|
* { id: "sub-2", label: "Cycling lane", active: false },
|
|
@@ -39,7 +42,7 @@ type NotificationPrefs = {
|
|
|
39
42
|
*/
|
|
40
43
|
declare const NotificationPrefs: import("svelte").Component<{
|
|
41
44
|
items?: any[];
|
|
42
|
-
|
|
45
|
+
label?: string;
|
|
43
46
|
emptyText?: string;
|
|
44
47
|
onToggle?: any;
|
|
45
48
|
busyId?: any;
|
|
@@ -47,7 +50,7 @@ declare const NotificationPrefs: import("svelte").Component<{
|
|
|
47
50
|
} & Record<string, any>, {}, "">;
|
|
48
51
|
type $$ComponentProps = {
|
|
49
52
|
items?: any[];
|
|
50
|
-
|
|
53
|
+
label?: string;
|
|
51
54
|
emptyText?: string;
|
|
52
55
|
onToggle?: any;
|
|
53
56
|
busyId?: any;
|
|
@@ -7,17 +7,36 @@ type SiteHeader = {
|
|
|
7
7
|
* SiteHeader
|
|
8
8
|
*
|
|
9
9
|
* Public site banner landmark (`<header role="banner">`). Locked accessibility
|
|
10
|
-
* chrome for the citizen portal: a brand area, a primary navigation slot,
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* chrome for the citizen portal: a brand area, a primary navigation slot, an
|
|
11
|
+
* actions slot (locale switch, sign-in), and — for two-level information
|
|
12
|
+
* architectures — an optional contextual `subnav` band and a single unified
|
|
13
|
+
* mobile disclosure. Structure and landmarks are fixed (conformance-checkable);
|
|
14
|
+
* only brand tokens vary per tenant via `data-theme`.
|
|
13
15
|
*
|
|
14
|
-
*
|
|
16
|
+
* Two tiers, one banner:
|
|
17
|
+
* - `nav` — the PRIMARY row (sections), a `ServiceNavigation`.
|
|
18
|
+
* - `subnav` — an OPTIONAL second band directly beneath the primary row,
|
|
19
|
+
* a `SectionNavigation` showing the active section's pages. It
|
|
20
|
+
* lives inside this same sticky banner so it scrolls/sticks as one
|
|
21
|
+
* unit and never reflows the primary row sideways.
|
|
22
|
+
*
|
|
23
|
+
* Unified mobile menu (fixes the "two hamburgers" problem): when a `menu` snippet
|
|
24
|
+
* is provided, this header renders ONE toggle below `--breakpoint` and hides the
|
|
25
|
+
* inline `nav` + `subnav`; both tiers collapse into a single hierarchical panel
|
|
26
|
+
* (the `menu` snippet) instead of each nav growing its own toggle. Consumers
|
|
27
|
+
* without a `menu` snippet keep the previous behaviour unchanged (backward
|
|
28
|
+
* compatible) — the inline `nav`'s own responsive collapse still applies.
|
|
29
|
+
*
|
|
30
|
+
* Icon-agnostic, per DS convention — pass the toggle/close icons as snippets;
|
|
31
|
+
* minimal glyphs are used as defaults.
|
|
15
32
|
*
|
|
16
33
|
* @example
|
|
17
34
|
* <SiteHeader>
|
|
18
35
|
* {#snippet brand()}<a href="/"><Logo /> Valongo</a>{/snippet}
|
|
19
|
-
* {#snippet nav()}<ServiceNavigation items={
|
|
36
|
+
* {#snippet nav()}<ServiceNavigation items={sections} />{/snippet}
|
|
37
|
+
* {#snippet subnav()}<SectionNavigation label={sectionName} items={pages} />{/snippet}
|
|
20
38
|
* {#snippet actions()}<LocaleSwitch /> <Button>Sign in</Button>{/snippet}
|
|
39
|
+
* {#snippet menu()}…hierarchical sections → pages tree…{/snippet}
|
|
21
40
|
* </SiteHeader>
|
|
22
41
|
*/
|
|
23
42
|
declare const SiteHeader: import("svelte").Component<{
|
|
@@ -25,12 +44,28 @@ declare const SiteHeader: import("svelte").Component<{
|
|
|
25
44
|
class?: string;
|
|
26
45
|
brand?: any;
|
|
27
46
|
nav?: any;
|
|
47
|
+
subnav?: any;
|
|
28
48
|
actions?: any;
|
|
49
|
+
menu?: any;
|
|
50
|
+
menuLabel?: string;
|
|
51
|
+
menuPanelLabel?: string;
|
|
52
|
+
closeLabel?: string;
|
|
53
|
+
menuId?: string;
|
|
54
|
+
menuIcon?: any;
|
|
55
|
+
closeIcon?: any;
|
|
29
56
|
} & Record<string, any>, {}, "">;
|
|
30
57
|
type $$ComponentProps = {
|
|
31
58
|
navLabel?: string;
|
|
32
59
|
class?: string;
|
|
33
60
|
brand?: any;
|
|
34
61
|
nav?: any;
|
|
62
|
+
subnav?: any;
|
|
35
63
|
actions?: any;
|
|
64
|
+
menu?: any;
|
|
65
|
+
menuLabel?: string;
|
|
66
|
+
menuPanelLabel?: string;
|
|
67
|
+
closeLabel?: string;
|
|
68
|
+
menuId?: string;
|
|
69
|
+
menuIcon?: any;
|
|
70
|
+
closeIcon?: any;
|
|
36
71
|
} & Record<string, any>;
|
package/components/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { default as TextSizeAdjuster } from "./TextSizeAdjuster.svelte";
|
|
|
25
25
|
export { default as ContrastToggle } from "./ContrastToggle.svelte";
|
|
26
26
|
export { default as LinkHighlightToggle } from "./LinkHighlightToggle.svelte";
|
|
27
27
|
export { default as ServiceNavigation } from "./ServiceNavigation.svelte";
|
|
28
|
+
export { default as SectionNavigation } from "./SectionNavigation.svelte";
|
|
28
29
|
export { default as Link } from "./Link.svelte";
|
|
29
30
|
export { default as Hero } from "./Hero.svelte";
|
|
30
31
|
export { default as ContentBlock } from "./ContentBlock.svelte";
|
|
@@ -64,6 +65,7 @@ export { default as RecordList } from "./RecordList.svelte";
|
|
|
64
65
|
export { default as PhaseTimeline } from "./PhaseTimeline.svelte";
|
|
65
66
|
export { default as RankingBoard } from "./RankingBoard.svelte";
|
|
66
67
|
export { default as ResultsChart } from "./ResultsChart.svelte";
|
|
68
|
+
export { default as EChart } from "./EChart.svelte";
|
|
67
69
|
export { default as NotificationPrefs } from "./NotificationPrefs.svelte";
|
|
68
70
|
export { default as ConsentManager } from "./ConsentManager.svelte";
|
|
69
71
|
export { default as ServiceFlow } from "./ServiceFlow.svelte";
|
|
@@ -116,6 +116,23 @@ export function geoStylerToFlat(style: any): OverlayLayerStyle;
|
|
|
116
116
|
* @returns {Promise<import('ol/layer/Vector.js').default[]>}
|
|
117
117
|
*/
|
|
118
118
|
export function createOverlayLayers(defs: OverlayLayerDef[], styles: import("./map-utils.js").MapStyles): Promise<import("ol/layer/Vector.js").default[]>;
|
|
119
|
+
/**
|
|
120
|
+
* Decide the hover-tooltip text for a feature under the pointer.
|
|
121
|
+
*
|
|
122
|
+
* Markers passed via the `markers` prop go through an OL Cluster source, so
|
|
123
|
+
* each rendered feature carries a `features` collection: one entry → that
|
|
124
|
+
* marker's label; many → "N items". Features served from an overlay `layers`
|
|
125
|
+
* def (a file/WFS source) are added to a plain VectorSource and have NO
|
|
126
|
+
* `features` collection (`undefined`) — for those, fall back to the feature's
|
|
127
|
+
* own descriptive props rather than rendering the misleading "0 items".
|
|
128
|
+
*
|
|
129
|
+
* @param {{ get: (key: string) => any }} feature — an OL Feature (or any
|
|
130
|
+
* object exposing `.get(key)`).
|
|
131
|
+
* @returns {string | null} the label to show, or null to hide the tooltip.
|
|
132
|
+
*/
|
|
133
|
+
export function clusterTooltipLabel(feature: {
|
|
134
|
+
get: (key: string) => any;
|
|
135
|
+
}): string | null;
|
|
119
136
|
/**
|
|
120
137
|
* Normalises a boundary prop into polygon rings (lon/lat WGS84).
|
|
121
138
|
* Accepts: raw ring `number[][]`, GeoJSON Polygon / MultiPolygon,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { WidgetProps } from "./types";
|
|
2
|
-
|
|
2
|
+
type $$ComponentProps = WidgetProps & {
|
|
3
|
+
kind?: "bar" | "line" | "donut";
|
|
4
|
+
};
|
|
5
|
+
declare const EChartWidget: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
6
|
type EChartWidget = ReturnType<typeof EChartWidget>;
|
|
4
7
|
export default EChartWidget;
|
|
@@ -96,6 +96,33 @@ export interface Block {
|
|
|
96
96
|
* (set on the default block), not tenant content.
|
|
97
97
|
*/
|
|
98
98
|
bleed?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* #176 Tier 1 (ADR 0003) — 2D grid placement on a 12-column track. A block
|
|
101
|
+
* WITH `layout` is positioned by the renderer's grid (col `x`, span `w`; row
|
|
102
|
+
* `y`, span `h`); a block WITHOUT it falls back to source order (the shipped
|
|
103
|
+
* ordered-list behaviour — fully back-compatible). This is a DESCRIPTOR field
|
|
104
|
+
* consumed by BOTH render (places the block) and authoring (drag/resize writes
|
|
105
|
+
* the coords); the DS never learns it is being edited. `x`/`y` are 0-based;
|
|
106
|
+
* `w`/`h` are 1-based spans (w clamped to 1..12).
|
|
107
|
+
*/
|
|
108
|
+
layout?: BlockLayout;
|
|
109
|
+
/**
|
|
110
|
+
* #176 Tier 1 — child blocks for a future grid-IN-grid container. Reserved
|
|
111
|
+
* (single-level page grids use `layout` on flat blocks); nesting is deferred
|
|
112
|
+
* until a concrete need (ADR 0003 build-order note).
|
|
113
|
+
*/
|
|
114
|
+
children?: Block[];
|
|
115
|
+
}
|
|
116
|
+
/** 12-column grid placement (#176 Tier 1). All fields in grid track units. */
|
|
117
|
+
export interface BlockLayout {
|
|
118
|
+
/** 0-based start column (0..11). */
|
|
119
|
+
x: number;
|
|
120
|
+
/** 0-based start row. */
|
|
121
|
+
y: number;
|
|
122
|
+
/** Column span (1..12). */
|
|
123
|
+
w: number;
|
|
124
|
+
/** Row span (>=1). */
|
|
125
|
+
h: number;
|
|
99
126
|
}
|
|
100
127
|
export interface PageDescriptor {
|
|
101
128
|
blocks: Block[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiaiai-pt/design-system",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.1",
|
|
4
4
|
"description": "Design system tokens and Svelte components for aiaiai products",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"site"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build:types": "svelte-package --input . --output dist && cp dist/components/*.d.ts components/ && cp dist/components/renderer/*.d.ts components/renderer/ && rm -rf dist",
|
|
18
|
+
"build:types": "rm -f components/*.d.ts components/renderer/*.d.ts && svelte-package --input . --output dist && cp dist/components/*.d.ts components/ && cp dist/components/renderer/*.d.ts components/renderer/ && rm -rf dist",
|
|
19
19
|
"test": "vitest run",
|
|
20
20
|
"prepublishOnly": "npm run build:types"
|
|
21
21
|
},
|