@seniorsistemas/scala-ng 2.1.0 → 2.2.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/README.md +4 -5
- package/avatar-summary/README.md +6 -2
- package/avatar-summary/public-api.d.ts +1 -1
- package/avatar-summary/src/avatar-summary/avatar-summary.component.d.ts +1 -1
- package/banner/README.md +13 -9
- package/banner/public-api.d.ts +1 -1
- package/breadcrumb/README.md +15 -8
- package/breadcrumb/public-api.d.ts +3 -3
- package/breadcrumb/src/breadcrumb-router/breadcrumb-route-data.d.ts +1 -0
- package/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.d.ts +7 -1
- package/card/README.md +1 -0
- package/checkbox/README.md +3 -1
- package/date-picker/README.md +1 -0
- package/date-picker/public-api.d.ts +1 -1
- package/drawer/README.md +4 -0
- package/empty-state/README.md +17 -11
- package/empty-state/src/empty-state/empty-state.component.d.ts +1 -1
- package/esm2022/autocomplete/src/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2022/avatar-summary/public-api.mjs +1 -1
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.component.mjs +2 -2
- package/esm2022/banner/public-api.mjs +2 -2
- package/esm2022/banner/src/banner/banner.component.mjs +4 -4
- package/esm2022/breadcrumb/public-api.mjs +2 -2
- package/esm2022/breadcrumb/src/breadcrumb/breadcrumb.component.mjs +4 -4
- package/esm2022/breadcrumb/src/breadcrumb-item/breadcrumb-item.component.mjs +6 -3
- package/esm2022/breadcrumb/src/breadcrumb-router/breadcrumb-route-data.mjs +1 -1
- package/esm2022/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.mjs +23 -6
- package/esm2022/breadcrumb/src/breadcrumb-truncator/breadcrumb-truncator.component.mjs +2 -2
- package/esm2022/card/src/card/card.component.mjs +4 -4
- package/esm2022/checkbox/src/checkbox/checkbox.component.mjs +3 -3
- package/esm2022/date-picker/public-api.mjs +2 -2
- package/esm2022/date-picker/src/date-picker/datepicker.component.mjs +4 -4
- package/esm2022/drawer/src/drawer/drawer.component.mjs +3 -3
- package/esm2022/empty-state/src/empty-state/empty-state.component.mjs +4 -4
- package/esm2022/input/src/input/input.component.mjs +3 -4
- package/esm2022/item-strip/public-api.mjs +1 -1
- package/esm2022/item-strip/src/item-strip/item-strip.component.mjs +59 -11
- package/esm2022/item-strip/src/item-strip-item/item-strip-item.component.mjs +97 -9
- package/esm2022/lib/chip/chip.utils.mjs +2 -2
- package/esm2022/lib/overlay/scroll-lock.utils.mjs +1 -1
- package/esm2022/lib/theme/theme.service.mjs +2 -2
- package/esm2022/list/public-api.mjs +1 -1
- package/esm2022/list/src/list/list.component.mjs +3 -3
- package/esm2022/list/src/list/list.models.mjs +1 -1
- package/esm2022/list/src/list-item/list-item.component.mjs +26 -5
- package/esm2022/locale/fallback.mjs +1 -2
- package/esm2022/page-header/src/page-header/page-header.component.mjs +8 -6
- package/esm2022/paginator/src/paginator/paginator.component.mjs +2 -2
- package/esm2022/panel/src/panel/panel.component.mjs +4 -4
- package/esm2022/public-api.mjs +5 -5
- package/esm2022/radio-button/public-api.mjs +2 -2
- package/esm2022/radio-button/src/radio-button/radio-button.component.mjs +3 -3
- package/esm2022/select/src/select/select.component.mjs +5 -5
- package/esm2022/select-button/src/select-button/select-button.component.mjs +4 -4
- package/esm2022/stats-card/src/stats-card/stats-card.component.mjs +5 -28
- package/esm2022/switch/src/switch/switch.component.mjs +3 -3
- package/esm2022/table/public-api.mjs +1 -1
- package/esm2022/table/src/components/actions-cell/table-actions-cell.component.mjs +10 -5
- package/esm2022/table/src/components/fields/rich-field-table/rich-field-table.component.mjs +1 -1
- package/esm2022/table/src/components/selection-cell/table-selection-cell.component.mjs +2 -2
- package/esm2022/table/src/components/toolbar/table-toolbar.component.mjs +3 -3
- package/esm2022/table/src/directives/table-container.directive.mjs +3 -3
- package/esm2022/table/src/table/table.component.mjs +3 -3
- package/esm2022/table/src/table/table.models.mjs +1 -1
- package/esm2022/table/src/utils/table-lazy-event.utils.mjs +1 -1
- package/esm2022/tooltip/src/tooltip/tooltip-focus-origin.service.mjs +32 -0
- package/esm2022/tooltip/src/tooltip-panel/tooltip-panel.component.mjs +5 -3
- package/esm2022/tooltip/src/tooltip-trigger/tooltip-trigger.directive.mjs +77 -23
- package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-banner.mjs +53 -53
- package/fesm2022/seniorsistemas-scala-ng-banner.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs +30 -11
- package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-card.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-drawer.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-drawer.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-input.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs +154 -18
- package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-list.mjs +27 -6
- package/fesm2022/seniorsistemas-scala-ng-list.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-locale.mjs +0 -1
- package/fesm2022/seniorsistemas-scala-ng-locale.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-page-header.mjs +7 -5
- package/fesm2022/seniorsistemas-scala-ng-page-header.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-paginator.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-paginator.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-panel.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-panel.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-select-button.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-select-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-select.mjs +4 -4
- package/fesm2022/seniorsistemas-scala-ng-select.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs +4 -27
- package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-switch.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-switch.mjs.map +1 -1
- package/fesm2022/{seniorsistemas-scala-ng-table-table-actions-cell.component-DZU3DYW8.mjs → seniorsistemas-scala-ng-table-table-actions-cell.component-D6ffnUl1.mjs} +10 -5
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-D6ffnUl1.mjs.map +1 -0
- package/fesm2022/{seniorsistemas-scala-ng-table-table-toolbar.component-DWhF_ejJ.mjs → seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs} +3 -3
- package/fesm2022/{seniorsistemas-scala-ng-table-table-toolbar.component-DWhF_ejJ.mjs.map → seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs.map} +1 -1
- package/fesm2022/seniorsistemas-scala-ng-table.mjs +21 -21
- package/fesm2022/seniorsistemas-scala-ng-table.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs +109 -24
- package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng.mjs +55 -55
- package/fesm2022/seniorsistemas-scala-ng.mjs.map +1 -1
- package/filter-tag/README.md +2 -1
- package/item-strip/README.md +11 -4
- package/item-strip/public-api.d.ts +1 -1
- package/item-strip/src/item-strip/item-strip.component.d.ts +12 -1
- package/item-strip/src/item-strip-item/item-strip-item.component.d.ts +32 -3
- package/list/README.md +17 -0
- package/list/public-api.d.ts +1 -1
- package/list/src/list/list.models.d.ts +19 -0
- package/list/src/list-item/list-item.component.d.ts +15 -2
- package/package.json +1 -7
- package/page-header/README.md +68 -24
- package/page-header/src/page-header/page-header.component.d.ts +5 -3
- package/panel/README.md +5 -1
- package/public-api.d.ts +7 -7
- package/radio-button/README.md +8 -1
- package/radio-button/public-api.d.ts +2 -2
- package/schematics/ng-add/index.js +39 -23
- package/schematics/ng-add/index.js.map +1 -1
- package/select/src/select/select.component.d.ts +3 -3
- package/select-button/README.md +1 -0
- package/selection-chip/README.md +1 -0
- package/stats-card/README.md +35 -29
- package/stats-card/src/stats-card/stats-card.component.d.ts +18 -31
- package/styles/tailwind-tokens.js +103 -1
- package/styles/tokens/radius.scss +0 -2
- package/styles/tokens/spacing.scss +0 -2
- package/styles/tokens/typography.scss +0 -2
- package/styles.scss +2 -0
- package/switch/README.md +7 -1
- package/table/README.md +21 -10
- package/table/public-api.d.ts +4 -4
- package/table/src/table/table.models.d.ts +2 -1
- package/tooltip/README.md +15 -5
- package/tooltip/src/tooltip/tooltip-focus-origin.service.d.ts +16 -0
- package/tooltip/src/tooltip-panel/tooltip-panel.component.d.ts +3 -1
- package/tooltip/src/tooltip-trigger/tooltip-trigger.directive.d.ts +21 -5
- package/avatar-profile/README.md +0 -204
- package/avatar-profile/index.d.ts +0 -5
- package/avatar-profile/package.json +0 -3
- package/avatar-profile/public-api.d.ts +0 -1
- package/avatar-profile/src/avatar-profile/avatar-profile.component.d.ts +0 -21
- package/esm2022/avatar-profile/public-api.mjs +0 -2
- package/esm2022/avatar-profile/seniorsistemas-scala-ng-avatar-profile.mjs +0 -5
- package/esm2022/avatar-profile/src/avatar-profile/avatar-profile.component.mjs +0 -33
- package/fesm2022/seniorsistemas-scala-ng-avatar-profile.mjs +0 -40
- package/fesm2022/seniorsistemas-scala-ng-avatar-profile.mjs.map +0 -1
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-DZU3DYW8.mjs.map +0 -1
|
@@ -1,9 +1,62 @@
|
|
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
3
|
import { inject, signal, Injectable, afterNextRender } from '@angular/core';
|
|
3
|
-
import { DOCUMENT } from '@angular/common';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { startWith } from 'rxjs';
|
|
6
6
|
|
|
7
|
+
function buildBlock(selector, overrides) {
|
|
8
|
+
const declarations = Object.entries(overrides)
|
|
9
|
+
.map(([token, value]) => ` ${token}: ${value};`)
|
|
10
|
+
.join("\n");
|
|
11
|
+
return `${selector} {\n${declarations}\n}`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates a theme that overrides semantic tokens under `[data-theme="{name}"]`.
|
|
15
|
+
* Activate it with `mount()` and `SdsThemeService.setTheme(name)`.
|
|
16
|
+
*/
|
|
17
|
+
function createTheme(name, config) {
|
|
18
|
+
function generateCss() {
|
|
19
|
+
const rules = [];
|
|
20
|
+
if (config.light && Object.keys(config.light).length > 0) {
|
|
21
|
+
rules.push(buildBlock(`[data-theme="${name}"]`, config.light));
|
|
22
|
+
}
|
|
23
|
+
if (config.dark && Object.keys(config.dark).length > 0) {
|
|
24
|
+
rules.push(buildBlock(`[data-theme="${name}"][data-mode="dark"]`, config.dark));
|
|
25
|
+
}
|
|
26
|
+
if (config.variants) {
|
|
27
|
+
for (const [variantName, variant] of Object.entries(config.variants)) {
|
|
28
|
+
const baseOverrides = variant.base === "dark" && config.dark ? { ...config.dark } : {};
|
|
29
|
+
const merged = { ...baseOverrides, ...variant.overrides };
|
|
30
|
+
if (Object.keys(merged).length > 0) {
|
|
31
|
+
rules.push(buildBlock(`[data-theme="${name}"][data-mode="${variantName}"]`, merged));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return rules.join("\n\n");
|
|
36
|
+
}
|
|
37
|
+
let styleEl = null;
|
|
38
|
+
return {
|
|
39
|
+
name,
|
|
40
|
+
css: generateCss,
|
|
41
|
+
mount() {
|
|
42
|
+
if (typeof document === "undefined") {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (styleEl) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
styleEl = document.createElement("style");
|
|
49
|
+
styleEl.setAttribute("data-sds-theme", name);
|
|
50
|
+
styleEl.textContent = generateCss();
|
|
51
|
+
document.head.appendChild(styleEl);
|
|
52
|
+
},
|
|
53
|
+
unmount() {
|
|
54
|
+
styleEl?.remove();
|
|
55
|
+
styleEl = null;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
7
60
|
/**
|
|
8
61
|
* localStorage key for the mode. Exported for scripts that run before Angular boots
|
|
9
62
|
* (e.g. an inline script in `index.html` that prevents a theme flash).
|
|
@@ -81,59 +134,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
81
134
|
args: [{ providedIn: "root" }]
|
|
82
135
|
}], ctorParameters: () => [] });
|
|
83
136
|
|
|
84
|
-
function buildBlock(selector, overrides) {
|
|
85
|
-
const declarations = Object.entries(overrides)
|
|
86
|
-
.map(([token, value]) => ` ${token}: ${value};`)
|
|
87
|
-
.join("\n");
|
|
88
|
-
return `${selector} {\n${declarations}\n}`;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Creates a theme that overrides semantic tokens under `[data-theme="{name}"]`.
|
|
92
|
-
* Activate it with `mount()` and `SdsThemeService.setTheme(name)`.
|
|
93
|
-
*/
|
|
94
|
-
function createTheme(name, config) {
|
|
95
|
-
function generateCss() {
|
|
96
|
-
const rules = [];
|
|
97
|
-
if (config.light && Object.keys(config.light).length > 0) {
|
|
98
|
-
rules.push(buildBlock(`[data-theme="${name}"]`, config.light));
|
|
99
|
-
}
|
|
100
|
-
if (config.dark && Object.keys(config.dark).length > 0) {
|
|
101
|
-
rules.push(buildBlock(`[data-theme="${name}"][data-mode="dark"]`, config.dark));
|
|
102
|
-
}
|
|
103
|
-
if (config.variants) {
|
|
104
|
-
for (const [variantName, variant] of Object.entries(config.variants)) {
|
|
105
|
-
const baseOverrides = variant.base === "dark" && config.dark ? { ...config.dark } : {};
|
|
106
|
-
const merged = { ...baseOverrides, ...variant.overrides };
|
|
107
|
-
if (Object.keys(merged).length > 0) {
|
|
108
|
-
rules.push(buildBlock(`[data-theme="${name}"][data-mode="${variantName}"]`, merged));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return rules.join("\n\n");
|
|
113
|
-
}
|
|
114
|
-
let styleEl = null;
|
|
115
|
-
return {
|
|
116
|
-
name,
|
|
117
|
-
css: generateCss,
|
|
118
|
-
mount() {
|
|
119
|
-
if (typeof document === "undefined") {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (styleEl) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
styleEl = document.createElement("style");
|
|
126
|
-
styleEl.setAttribute("data-sds-theme", name);
|
|
127
|
-
styleEl.textContent = generateCss();
|
|
128
|
-
document.head.appendChild(styleEl);
|
|
129
|
-
},
|
|
130
|
-
unmount() {
|
|
131
|
-
styleEl?.remove();
|
|
132
|
-
styleEl = null;
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
137
|
/** Converts options into display rows, inserting a header row whenever `group` changes. */
|
|
138
138
|
function buildDisplayRows(options) {
|
|
139
139
|
const rows = [];
|
|
@@ -221,7 +221,7 @@ class FocusableItemAdapter {
|
|
|
221
221
|
const CHIP_STATE_CLASSES = {
|
|
222
222
|
disabled: {
|
|
223
223
|
"bg-color-background-disable": true,
|
|
224
|
-
"border-color-border
|
|
224
|
+
"border-color-border": true,
|
|
225
225
|
},
|
|
226
226
|
hovered: {
|
|
227
227
|
"bg-color-background-interactive-secondary-hovered": true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-scala-ng.mjs","sources":["../../projects/scala-ng/src/lib/theme/theme.service.ts","../../projects/scala-ng/src/lib/theme/create-theme.ts","../../projects/scala-ng/src/lib/combobox/combobox.utils.ts","../../projects/scala-ng/src/lib/forms/control-state.utils.ts","../../projects/scala-ng/src/lib/a11y/focusable-item.utils.ts","../../projects/scala-ng/src/lib/chip/chip.utils.ts","../../projects/scala-ng/src/lib/overlay/aria-hide.utils.ts","../../projects/scala-ng/src/lib/overlay/scroll-lock.utils.ts","../../projects/scala-ng/src/public-api.ts","../../projects/scala-ng/src/seniorsistemas-scala-ng.ts"],"sourcesContent":["import { inject, Injectable, signal } from \"@angular/core\";\nimport { DOCUMENT } from \"@angular/common\";\n\nexport type Mode = \"light\" | \"dark\";\n\n/**\n * localStorage key for the mode. Exported for scripts that run before Angular boots\n * (e.g. an inline script in `index.html` that prevents a theme flash).\n */\nexport const SDS_THEME_MODE_STORAGE_KEY = \"sds-theme-mode\";\n\n/** localStorage key for the product theme (`data-theme`); see {@link SDS_THEME_MODE_STORAGE_KEY}. */\nexport const SDS_THEME_NAME_STORAGE_KEY = \"sds-theme-name\";\n\n/** Applies and persists the `data-mode` and `data-theme` attributes on the document root. */\n@Injectable({ providedIn: \"root\" })\nexport class SdsThemeService {\n private readonly _document = inject(DOCUMENT);\n\n readonly mode = signal<Mode>(\"light\");\n readonly theme = signal<string | null>(null);\n\n /** Restores mode and theme from localStorage so they survive a full reload. */\n constructor() {\n const storedMode = this._readStorage(SDS_THEME_MODE_STORAGE_KEY);\n if (storedMode === \"light\" || storedMode === \"dark\") {\n this.setMode(storedMode);\n }\n\n const storedTheme = this._readStorage(SDS_THEME_NAME_STORAGE_KEY);\n if (storedTheme) {\n this.setTheme(storedTheme);\n }\n }\n\n setMode(mode: Mode): void {\n this.mode.set(mode);\n const root = this._document.documentElement;\n if (mode === \"dark\") {\n root.setAttribute(\"data-mode\", \"dark\");\n } else {\n root.removeAttribute(\"data-mode\");\n }\n this._writeStorage(SDS_THEME_MODE_STORAGE_KEY, mode);\n }\n\n setTheme(theme: string | null): void {\n this.theme.set(theme);\n const root = this._document.documentElement;\n if (theme) {\n root.setAttribute(\"data-theme\", theme);\n } else {\n root.removeAttribute(\"data-theme\");\n }\n this._writeStorage(SDS_THEME_NAME_STORAGE_KEY, theme);\n }\n\n toggleMode(): void {\n this.setMode(this.mode() === \"light\" ? \"dark\" : \"light\");\n }\n\n private _readStorage(key: string): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n }\n\n private _writeStorage(key: string, value: string | null): void {\n try {\n if (value === null) {\n localStorage.removeItem(key);\n } else {\n localStorage.setItem(key, value);\n }\n } catch {\n // localStorage unavailable (private mode, SSR): the preference is just not persisted.\n }\n }\n}\n","import type { SemanticToken } from \"./semantic-tokens\";\n\n/** Partial semantic token overrides; each value is a CSS value or a `var(--sds-…)` reference. */\nexport type ThemeOverrides = Partial<Record<SemanticToken, string>>;\n\n/**\n * Extra mode besides light and dark, applied on `[data-theme=\"{name}\"][data-mode=\"{variantName}\"]`.\n * Inherits the tokens of `base` (default `'light'`) and overrides only those in `overrides`.\n */\nexport interface ThemeVariant {\n base?: \"light\" | \"dark\";\n overrides: ThemeOverrides;\n}\n\n/** Token overrides per mode, passed to `createTheme`. */\nexport interface ThemeConfig {\n /** Tokens applied on `[data-theme=\"{name}\"]` (light mode). */\n light?: ThemeOverrides;\n /** Tokens applied on `[data-theme=\"{name}\"][data-mode=\"dark\"]`. */\n dark?: ThemeOverrides;\n /** Extra modes besides light and dark. */\n variants?: Record<string, ThemeVariant>;\n}\n\n/** Theme returned by `createTheme`. */\nexport interface SdsTheme {\n /** Theme name passed to `createTheme`. */\n readonly name: string;\n\n /** Injects the theme `<style>` into `<head>`. Idempotent; no-op without `document` (SSR). */\n mount(): void;\n\n /** Removes the `<style>` injected by `mount()`. */\n unmount(): void;\n\n /** Returns the generated CSS without touching the DOM. */\n css(): string;\n}\n\nfunction buildBlock(selector: string, overrides: ThemeOverrides): string {\n const declarations = Object.entries(overrides)\n .map(([token, value]) => ` ${token}: ${value};`)\n .join(\"\\n\");\n return `${selector} {\\n${declarations}\\n}`;\n}\n\n/**\n * Creates a theme that overrides semantic tokens under `[data-theme=\"{name}\"]`.\n * Activate it with `mount()` and `SdsThemeService.setTheme(name)`.\n */\nexport function createTheme(name: string, config: ThemeConfig): SdsTheme {\n function generateCss(): string {\n const rules: string[] = [];\n\n if (config.light && Object.keys(config.light).length > 0) {\n rules.push(buildBlock(`[data-theme=\"${name}\"]`, config.light));\n }\n\n if (config.dark && Object.keys(config.dark).length > 0) {\n rules.push(buildBlock(`[data-theme=\"${name}\"][data-mode=\"dark\"]`, config.dark));\n }\n\n if (config.variants) {\n for (const [variantName, variant] of Object.entries(config.variants)) {\n const baseOverrides = variant.base === \"dark\" && config.dark ? { ...config.dark } : {};\n const merged: ThemeOverrides = { ...baseOverrides, ...variant.overrides };\n\n if (Object.keys(merged).length > 0) {\n rules.push(buildBlock(`[data-theme=\"${name}\"][data-mode=\"${variantName}\"]`, merged));\n }\n }\n }\n\n return rules.join(\"\\n\\n\");\n }\n\n let styleEl: HTMLStyleElement | null = null;\n\n return {\n name,\n\n css: generateCss,\n\n mount(): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n if (styleEl) {\n return;\n }\n\n styleEl = document.createElement(\"style\");\n styleEl.setAttribute(\"data-sds-theme\", name);\n styleEl.textContent = generateCss();\n\n document.head.appendChild(styleEl);\n },\n\n unmount(): void {\n styleEl?.remove();\n styleEl = null;\n },\n };\n}\n","/** Minimal shape required for an option to be used in combobox utilities. */\nexport interface ComboboxItem<T> {\n label: string;\n value: T;\n disabled?: boolean;\n group?: string;\n _trackId: string;\n}\n\n/** A rendered combobox row: either a group header or an option. */\nexport type ComboboxDisplayRow<T, O extends ComboboxItem<T>> =\n | { trackId: string; type: \"header\"; label: string }\n | { trackId: string; type: \"option\"; option: O; optionIndex: number };\n\n/** Converts options into display rows, inserting a header row whenever `group` changes. */\nexport function buildDisplayRows<T, O extends ComboboxItem<T>>(\n options: O[],\n): ComboboxDisplayRow<T, O>[] {\n const rows: ComboboxDisplayRow<T, O>[] = [];\n let lastGroup: string | undefined;\n options.forEach((option, optionIndex) => {\n if (option.group !== undefined && option.group !== lastGroup) {\n rows.push({ trackId: `group:${option.group}`, type: \"header\", label: option.group });\n lastGroup = option.group;\n }\n rows.push({ trackId: option._trackId, type: \"option\", option, optionIndex });\n });\n return rows;\n}\n\n/** Stringifies primitives and dates; anything else becomes `\"\"` to avoid `\"[object Object]\"`. */\nfunction stringifyForFilter(val: unknown): string {\n if (\n typeof val === \"string\" ||\n typeof val === \"number\" ||\n typeof val === \"boolean\" ||\n val instanceof Date\n ) {\n return String(val);\n }\n return \"\";\n}\n\n/** Filters options by `search` using `filterBy` (function, property key, or `label` by default). */\nexport function filterComboboxOptions<T, O extends ComboboxItem<T>>(\n options: O[],\n search: string,\n filterBy?: keyof T | ((item: T, search: string) => boolean),\n): O[] {\n const normalized = search.toLowerCase().trim();\n if (!normalized) {\n return options;\n }\n return options.filter((option) => {\n if (typeof filterBy === \"function\") {\n return filterBy(option.value, normalized);\n }\n if (filterBy !== undefined) {\n const val = (option.value as Record<PropertyKey, unknown>)[filterBy as PropertyKey];\n return stringifyForFilter(val).toLowerCase().includes(normalized);\n }\n return option.label.toLowerCase().includes(normalized);\n });\n}\n\n/** Returns the DOM element for a combobox option by its index, or `null` if not found. */\nexport function getComboboxOptionEl(\n ownerDocument: Document | null | undefined,\n idPrefix: string,\n index: number,\n): HTMLElement | null {\n return (\n (ownerDocument?.getElementById(`${idPrefix}-option-${index}`) as HTMLElement | null) ?? null\n );\n}\n","import { afterNextRender, DestroyRef, WritableSignal } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { NgControl } from \"@angular/forms\";\nimport { startWith } from \"rxjs\";\n\n/**\n * Keeps `invalidSignal` and `touchedSignal` in sync with the control's state.\n * Must be called in an injection context.\n */\nexport function syncControlState(\n ngControl: NgControl | null,\n destroyRef: DestroyRef,\n invalidSignal: WritableSignal<boolean>,\n touchedSignal: WritableSignal<boolean>,\n): void {\n afterNextRender(() => {\n const control = ngControl?.control;\n if (!control) {\n return;\n }\n control.events.pipe(startWith(null), takeUntilDestroyed(destroyRef)).subscribe(() => {\n invalidSignal.set(control.invalid);\n touchedSignal.set(control.touched);\n });\n });\n}\n","import { FocusableOption, FocusOrigin } from \"@angular/cdk/a11y\";\n\n/** Minimal shape an item must expose to be adapted by `FocusableItemAdapter`. */\nexport interface FocusableItem {\n focus(origin?: FocusOrigin): void;\n}\n\n/**\n * Adapts a `FocusableItem` to CDK's `FocusableOption` for use with `FocusKeyManager`.\n * Needed when the item's own `disabled` is not a plain `boolean` (e.g. a signal input).\n */\nexport class FocusableItemAdapter<TItem extends FocusableItem> implements FocusableOption {\n constructor(\n readonly item: TItem,\n readonly disabled = false,\n private readonly label = \"\",\n ) {}\n\n focus(origin?: FocusOrigin): void {\n this.item.focus(origin);\n }\n\n getLabel(): string {\n return this.label;\n }\n}\n","import { ElementRef } from \"@angular/core\";\n\n/** Visual states shared by `sds-selection-chip` and `sds-filter-tag`. */\nexport type ChipBaseVisualState = \"disabled\" | \"hovered\" | \"default\";\n\n/** Background and border color classes for each shared chip visual state. */\nexport const CHIP_STATE_CLASSES: Readonly<Record<ChipBaseVisualState, Record<string, boolean>>> = {\n disabled: {\n \"bg-color-background-disable\": true,\n \"border-color-border-bold\": true,\n },\n hovered: {\n \"bg-color-background-interactive-secondary-hovered\": true,\n \"border-color-border-interactive-secondary\": true,\n },\n default: {\n \"bg-color-background-interactive-secondary\": true,\n \"border-color-border-interactive-secondary\": true,\n },\n};\n\nexport interface ChipContainerClassOptions {\n readonly size: \"default\" | \"small\";\n readonly stateClasses: Record<string, boolean>;\n readonly isFocusVisible: boolean;\n readonly highlight: boolean;\n}\n\n/** Merges the size, state and focus outline classes of a chip container. */\nexport function buildChipContainerClasses(\n options: ChipContainerClassOptions,\n): Record<string, boolean> {\n const sizeClasses = {\n \"h-[32px]\": options.size === \"default\",\n \"h-[28px]\": options.size === \"small\",\n };\n if (!options.isFocusVisible) {\n return { ...sizeClasses, ...options.stateClasses };\n }\n // Deliberate deviation from Figma (1.5px focused border): keeps the outline ring used by the other components.\n return {\n ...sizeClasses,\n ...options.stateClasses,\n outline: true,\n \"outline-2\": true,\n \"outline-offset-[3px]\": options.highlight,\n \"outline-offset-[-2px]\": !options.highlight,\n \"outline-color-border-focused\": true,\n };\n}\n\n/** Handles a remove button click: never reaches the container and runs `remove` only when enabled. */\nexport function handleChipRemove(event: Event, isDisabled: boolean, remove: () => void): void {\n event.stopPropagation();\n if (isDisabled) {\n return;\n }\n remove();\n}\n\n/**\n * Stops only Enter/Space on a chip's remove button so they don't reach the container; navigation\n * keys keep bubbling to a parent `FocusKeyManager`.\n */\nexport function stopChipActivationKeys(event: KeyboardEvent): void {\n switch (event.key) {\n case \"Enter\":\n case \" \": {\n event.stopPropagation();\n break;\n }\n default: {\n break;\n }\n }\n}\n\n/** Focuses the chip's remove button when rendered, otherwise its container. */\nexport function focusChip(\n removeButton: ElementRef<HTMLElement> | undefined,\n container: ElementRef<HTMLElement>,\n): void {\n (removeButton ?? container).nativeElement.focus();\n}\n","const ariaHiddenElements = new Map<Element, string | null>();\nlet ariaHideCount = 0;\n\n/** Hides everything except the overlay container from screen readers (ref-counted), since\n * `cdkTrapFocus` only traps Tab, not virtual-cursor navigation. Mirrors what CDK `Dialog` does. */\nexport function hideNonDialogContentFromAssistiveTechnology(\n overlayContainerElement: HTMLElement,\n): void {\n if (ariaHideCount === 0) {\n const parent = overlayContainerElement.parentElement;\n if (parent) {\n Array.from(parent.children).forEach((sibling) => {\n if (\n sibling !== overlayContainerElement &&\n sibling.nodeName !== \"SCRIPT\" &&\n sibling.nodeName !== \"STYLE\" &&\n !sibling.hasAttribute(\"aria-live\")\n ) {\n ariaHiddenElements.set(sibling, sibling.getAttribute(\"aria-hidden\"));\n sibling.setAttribute(\"aria-hidden\", \"true\");\n }\n });\n }\n }\n ariaHideCount++;\n}\n\nexport function restoreNonDialogContentFromAssistiveTechnology(): void {\n if (ariaHideCount === 0) {\n return;\n }\n ariaHideCount--;\n if (ariaHideCount === 0) {\n ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue === null) {\n element.removeAttribute(\"aria-hidden\");\n } else {\n element.setAttribute(\"aria-hidden\", previousValue);\n }\n });\n ariaHiddenElements.clear();\n }\n}\n\n/** @internal Test-only: resets module state shared across specs. */\nexport function _resetAriaHideForTesting(): void {\n ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue === null) {\n element.removeAttribute(\"aria-hidden\");\n } else {\n element.setAttribute(\"aria-hidden\", previousValue);\n }\n });\n ariaHiddenElements.clear();\n ariaHideCount = 0;\n}\n","let scrollLockCount = 0;\nlet previousBodyOverflow: string | null = null;\nlet previousBodyPaddingRight: string | null = null;\n\n/** Locks page scroll, ref-counted so it stays locked while any modal overlay is open. CDK's\n * `scrollStrategies.block()` is per instance, so closing one overlay would unlock it. */\nexport function lockPageScroll(): void {\n if (scrollLockCount === 0) {\n // Measured before hiding the overflow, which removes the scrollbar and widens the content.\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n previousBodyOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n if (scrollbarWidth > 0) {\n previousBodyPaddingRight = document.body.style.paddingRight;\n const currentPaddingRight = Number.parseFloat(getComputedStyle(document.body).paddingRight) || 0;\n document.body.style.paddingRight = `${currentPaddingRight + scrollbarWidth}px`;\n }\n }\n scrollLockCount++;\n}\n\nexport function unlockPageScroll(): void {\n if (scrollLockCount === 0) {\n return;\n }\n scrollLockCount--;\n if (scrollLockCount === 0) {\n document.body.style.overflow = previousBodyOverflow ?? \"\";\n previousBodyOverflow = null;\n if (previousBodyPaddingRight !== null) {\n document.body.style.paddingRight = previousBodyPaddingRight;\n previousBodyPaddingRight = null;\n }\n }\n}\n\n/** @internal Test-only: resets module state, which Karma shares across all specs. */\nexport function _resetScrollLockForTesting(): void {\n scrollLockCount = 0;\n previousBodyOverflow = null;\n previousBodyPaddingRight = null;\n document.body.style.overflow = \"\";\n document.body.style.paddingRight = \"\";\n}\n","// Theme\nexport {\n SdsThemeService,\n type Mode,\n SDS_THEME_MODE_STORAGE_KEY,\n SDS_THEME_NAME_STORAGE_KEY,\n} from \"./lib/theme/theme.service\";\nexport {\n createTheme,\n type ThemeConfig,\n type ThemeOverrides,\n type ThemeVariant,\n type SdsTheme,\n} from \"./lib/theme/create-theme\";\nexport { type SemanticToken } from \"./lib/theme/semantic-tokens\";\n\n// Combobox\nexport {\n type ComboboxItem,\n type ComboboxDisplayRow,\n buildDisplayRows,\n filterComboboxOptions,\n getComboboxOptionEl,\n} from \"./lib/combobox/combobox.utils\";\n\n// Forms\nexport { syncControlState } from \"./lib/forms/control-state.utils\";\n\n// A11y\nexport { type FocusableItem, FocusableItemAdapter } from \"./lib/a11y/focusable-item.utils\";\n\n// Chip\nexport {\n type ChipBaseVisualState,\n type ChipContainerClassOptions,\n CHIP_STATE_CLASSES,\n buildChipContainerClasses,\n stopChipActivationKeys,\n focusChip,\n handleChipRemove,\n} from \"./lib/chip/chip.utils\";\n\n// Overlay\nexport {\n hideNonDialogContentFromAssistiveTechnology,\n restoreNonDialogContentFromAssistiveTechnology,\n _resetAriaHideForTesting,\n} from \"./lib/overlay/aria-hide.utils\";\nexport {\n lockPageScroll,\n unlockPageScroll,\n _resetScrollLockForTesting,\n} from \"./lib/overlay/scroll-lock.utils\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAKA;;;AAGG;AACI,MAAM,0BAA0B,GAAG,iBAAiB;AAE3D;AACO,MAAM,0BAA0B,GAAG,iBAAiB;AAE3D;MAEa,eAAe,CAAA;AACT,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAErC,IAAA,IAAI,GAAG,MAAM,CAAO,OAAO,CAAC,CAAC;AAC7B,IAAA,KAAK,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;;AAG7C,IAAA,WAAA,GAAA;QACE,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC;QACjE,IAAI,UAAU,KAAK,OAAO,IAAI,UAAU,KAAK,MAAM,EAAE;AACnD,YAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SAC1B;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC;QAClE,IAAI,WAAW,EAAE;AACf,YAAA,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;SAC5B;KACF;AAED,IAAA,OAAO,CAAC,IAAU,EAAA;AAChB,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpB,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC;AAC5C,QAAA,IAAI,IAAI,KAAK,MAAM,EAAE;AACnB,YAAA,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;SACxC;aAAM;AACL,YAAA,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;SACnC;AACD,QAAA,IAAI,CAAC,aAAa,CAAC,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,GAAG,IAAI,CAAC;IAC5B,wBAAwB,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC;IAClC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC;AACxC;;AC3CA;;ACAA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-scala-ng.mjs","sources":["../../projects/scala-ng/src/lib/theme/create-theme.ts","../../projects/scala-ng/src/lib/theme/theme.service.ts","../../projects/scala-ng/src/lib/combobox/combobox.utils.ts","../../projects/scala-ng/src/lib/forms/control-state.utils.ts","../../projects/scala-ng/src/lib/a11y/focusable-item.utils.ts","../../projects/scala-ng/src/lib/chip/chip.utils.ts","../../projects/scala-ng/src/lib/overlay/aria-hide.utils.ts","../../projects/scala-ng/src/lib/overlay/scroll-lock.utils.ts","../../projects/scala-ng/src/public-api.ts","../../projects/scala-ng/src/seniorsistemas-scala-ng.ts"],"sourcesContent":["import type { SemanticToken } from \"./semantic-tokens\";\n\n/** Partial semantic token overrides; each value is a CSS value or a `var(--sds-…)` reference. */\nexport type ThemeOverrides = Partial<Record<SemanticToken, string>>;\n\n/**\n * Extra mode besides light and dark, applied on `[data-theme=\"{name}\"][data-mode=\"{variantName}\"]`.\n * Inherits the tokens of `base` (default `'light'`) and overrides only those in `overrides`.\n */\nexport interface ThemeVariant {\n base?: \"light\" | \"dark\";\n overrides: ThemeOverrides;\n}\n\n/** Token overrides per mode, passed to `createTheme`. */\nexport interface ThemeConfig {\n /** Tokens applied on `[data-theme=\"{name}\"]` (light mode). */\n light?: ThemeOverrides;\n /** Tokens applied on `[data-theme=\"{name}\"][data-mode=\"dark\"]`. */\n dark?: ThemeOverrides;\n /** Extra modes besides light and dark. */\n variants?: Record<string, ThemeVariant>;\n}\n\n/** Theme returned by `createTheme`. */\nexport interface SdsTheme {\n /** Theme name passed to `createTheme`. */\n readonly name: string;\n\n /** Injects the theme `<style>` into `<head>`. Idempotent; no-op without `document` (SSR). */\n mount(): void;\n\n /** Removes the `<style>` injected by `mount()`. */\n unmount(): void;\n\n /** Returns the generated CSS without touching the DOM. */\n css(): string;\n}\n\nfunction buildBlock(selector: string, overrides: ThemeOverrides): string {\n const declarations = Object.entries(overrides)\n .map(([token, value]) => ` ${token}: ${value};`)\n .join(\"\\n\");\n return `${selector} {\\n${declarations}\\n}`;\n}\n\n/**\n * Creates a theme that overrides semantic tokens under `[data-theme=\"{name}\"]`.\n * Activate it with `mount()` and `SdsThemeService.setTheme(name)`.\n */\nexport function createTheme(name: string, config: ThemeConfig): SdsTheme {\n function generateCss(): string {\n const rules: string[] = [];\n\n if (config.light && Object.keys(config.light).length > 0) {\n rules.push(buildBlock(`[data-theme=\"${name}\"]`, config.light));\n }\n\n if (config.dark && Object.keys(config.dark).length > 0) {\n rules.push(buildBlock(`[data-theme=\"${name}\"][data-mode=\"dark\"]`, config.dark));\n }\n\n if (config.variants) {\n for (const [variantName, variant] of Object.entries(config.variants)) {\n const baseOverrides = variant.base === \"dark\" && config.dark ? { ...config.dark } : {};\n const merged: ThemeOverrides = { ...baseOverrides, ...variant.overrides };\n\n if (Object.keys(merged).length > 0) {\n rules.push(buildBlock(`[data-theme=\"${name}\"][data-mode=\"${variantName}\"]`, merged));\n }\n }\n }\n\n return rules.join(\"\\n\\n\");\n }\n\n let styleEl: HTMLStyleElement | null = null;\n\n return {\n name,\n\n css: generateCss,\n\n mount(): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n if (styleEl) {\n return;\n }\n\n styleEl = document.createElement(\"style\");\n styleEl.setAttribute(\"data-sds-theme\", name);\n styleEl.textContent = generateCss();\n\n document.head.appendChild(styleEl);\n },\n\n unmount(): void {\n styleEl?.remove();\n styleEl = null;\n },\n };\n}\n","import { DOCUMENT } from \"@angular/common\";\nimport { inject, Injectable, signal } from \"@angular/core\";\n\nexport type Mode = \"light\" | \"dark\";\n\n/**\n * localStorage key for the mode. Exported for scripts that run before Angular boots\n * (e.g. an inline script in `index.html` that prevents a theme flash).\n */\nexport const SDS_THEME_MODE_STORAGE_KEY = \"sds-theme-mode\";\n\n/** localStorage key for the product theme (`data-theme`); see {@link SDS_THEME_MODE_STORAGE_KEY}. */\nexport const SDS_THEME_NAME_STORAGE_KEY = \"sds-theme-name\";\n\n/** Applies and persists the `data-mode` and `data-theme` attributes on the document root. */\n@Injectable({ providedIn: \"root\" })\nexport class SdsThemeService {\n private readonly _document = inject(DOCUMENT);\n\n readonly mode = signal<Mode>(\"light\");\n readonly theme = signal<string | null>(null);\n\n /** Restores mode and theme from localStorage so they survive a full reload. */\n constructor() {\n const storedMode = this._readStorage(SDS_THEME_MODE_STORAGE_KEY);\n if (storedMode === \"light\" || storedMode === \"dark\") {\n this.setMode(storedMode);\n }\n\n const storedTheme = this._readStorage(SDS_THEME_NAME_STORAGE_KEY);\n if (storedTheme) {\n this.setTheme(storedTheme);\n }\n }\n\n setMode(mode: Mode): void {\n this.mode.set(mode);\n const root = this._document.documentElement;\n if (mode === \"dark\") {\n root.setAttribute(\"data-mode\", \"dark\");\n } else {\n root.removeAttribute(\"data-mode\");\n }\n this._writeStorage(SDS_THEME_MODE_STORAGE_KEY, mode);\n }\n\n setTheme(theme: string | null): void {\n this.theme.set(theme);\n const root = this._document.documentElement;\n if (theme) {\n root.setAttribute(\"data-theme\", theme);\n } else {\n root.removeAttribute(\"data-theme\");\n }\n this._writeStorage(SDS_THEME_NAME_STORAGE_KEY, theme);\n }\n\n toggleMode(): void {\n this.setMode(this.mode() === \"light\" ? \"dark\" : \"light\");\n }\n\n private _readStorage(key: string): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n }\n\n private _writeStorage(key: string, value: string | null): void {\n try {\n if (value === null) {\n localStorage.removeItem(key);\n } else {\n localStorage.setItem(key, value);\n }\n } catch {\n // localStorage unavailable (private mode, SSR): the preference is just not persisted.\n }\n }\n}\n","/** Minimal shape required for an option to be used in combobox utilities. */\nexport interface ComboboxItem<T> {\n label: string;\n value: T;\n disabled?: boolean;\n group?: string;\n _trackId: string;\n}\n\n/** A rendered combobox row: either a group header or an option. */\nexport type ComboboxDisplayRow<T, O extends ComboboxItem<T>> =\n | { trackId: string; type: \"header\"; label: string }\n | { trackId: string; type: \"option\"; option: O; optionIndex: number };\n\n/** Converts options into display rows, inserting a header row whenever `group` changes. */\nexport function buildDisplayRows<T, O extends ComboboxItem<T>>(\n options: O[],\n): ComboboxDisplayRow<T, O>[] {\n const rows: ComboboxDisplayRow<T, O>[] = [];\n let lastGroup: string | undefined;\n options.forEach((option, optionIndex) => {\n if (option.group !== undefined && option.group !== lastGroup) {\n rows.push({ trackId: `group:${option.group}`, type: \"header\", label: option.group });\n lastGroup = option.group;\n }\n rows.push({ trackId: option._trackId, type: \"option\", option, optionIndex });\n });\n return rows;\n}\n\n/** Stringifies primitives and dates; anything else becomes `\"\"` to avoid `\"[object Object]\"`. */\nfunction stringifyForFilter(val: unknown): string {\n if (\n typeof val === \"string\" ||\n typeof val === \"number\" ||\n typeof val === \"boolean\" ||\n val instanceof Date\n ) {\n return String(val);\n }\n return \"\";\n}\n\n/** Filters options by `search` using `filterBy` (function, property key, or `label` by default). */\nexport function filterComboboxOptions<T, O extends ComboboxItem<T>>(\n options: O[],\n search: string,\n filterBy?: keyof T | ((item: T, search: string) => boolean),\n): O[] {\n const normalized = search.toLowerCase().trim();\n if (!normalized) {\n return options;\n }\n return options.filter((option) => {\n if (typeof filterBy === \"function\") {\n return filterBy(option.value, normalized);\n }\n if (filterBy !== undefined) {\n const val = (option.value as Record<PropertyKey, unknown>)[filterBy as PropertyKey];\n return stringifyForFilter(val).toLowerCase().includes(normalized);\n }\n return option.label.toLowerCase().includes(normalized);\n });\n}\n\n/** Returns the DOM element for a combobox option by its index, or `null` if not found. */\nexport function getComboboxOptionEl(\n ownerDocument: Document | null | undefined,\n idPrefix: string,\n index: number,\n): HTMLElement | null {\n return (\n (ownerDocument?.getElementById(`${idPrefix}-option-${index}`) as HTMLElement | null) ?? null\n );\n}\n","import { afterNextRender, DestroyRef, WritableSignal } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { NgControl } from \"@angular/forms\";\nimport { startWith } from \"rxjs\";\n\n/**\n * Keeps `invalidSignal` and `touchedSignal` in sync with the control's state.\n * Must be called in an injection context.\n */\nexport function syncControlState(\n ngControl: NgControl | null,\n destroyRef: DestroyRef,\n invalidSignal: WritableSignal<boolean>,\n touchedSignal: WritableSignal<boolean>,\n): void {\n afterNextRender(() => {\n const control = ngControl?.control;\n if (!control) {\n return;\n }\n control.events.pipe(startWith(null), takeUntilDestroyed(destroyRef)).subscribe(() => {\n invalidSignal.set(control.invalid);\n touchedSignal.set(control.touched);\n });\n });\n}\n","import { FocusableOption, FocusOrigin } from \"@angular/cdk/a11y\";\n\n/** Minimal shape an item must expose to be adapted by `FocusableItemAdapter`. */\nexport interface FocusableItem {\n focus(origin?: FocusOrigin): void;\n}\n\n/**\n * Adapts a `FocusableItem` to CDK's `FocusableOption` for use with `FocusKeyManager`.\n * Needed when the item's own `disabled` is not a plain `boolean` (e.g. a signal input).\n */\nexport class FocusableItemAdapter<TItem extends FocusableItem> implements FocusableOption {\n constructor(\n readonly item: TItem,\n readonly disabled = false,\n private readonly label = \"\",\n ) {}\n\n focus(origin?: FocusOrigin): void {\n this.item.focus(origin);\n }\n\n getLabel(): string {\n return this.label;\n }\n}\n","import { ElementRef } from \"@angular/core\";\n\n/** Visual states shared by `sds-selection-chip` and `sds-filter-tag`. */\nexport type ChipBaseVisualState = \"disabled\" | \"hovered\" | \"default\";\n\n/** Background and border color classes for each shared chip visual state. */\nexport const CHIP_STATE_CLASSES: Readonly<Record<ChipBaseVisualState, Record<string, boolean>>> = {\n disabled: {\n \"bg-color-background-disable\": true,\n \"border-color-border\": true,\n },\n hovered: {\n \"bg-color-background-interactive-secondary-hovered\": true,\n \"border-color-border-interactive-secondary\": true,\n },\n default: {\n \"bg-color-background-interactive-secondary\": true,\n \"border-color-border-interactive-secondary\": true,\n },\n};\n\nexport interface ChipContainerClassOptions {\n readonly size: \"default\" | \"small\";\n readonly stateClasses: Record<string, boolean>;\n readonly isFocusVisible: boolean;\n readonly highlight: boolean;\n}\n\n/** Merges the size, state and focus outline classes of a chip container. */\nexport function buildChipContainerClasses(\n options: ChipContainerClassOptions,\n): Record<string, boolean> {\n const sizeClasses = {\n \"h-[32px]\": options.size === \"default\",\n \"h-[28px]\": options.size === \"small\",\n };\n if (!options.isFocusVisible) {\n return { ...sizeClasses, ...options.stateClasses };\n }\n // Deliberate deviation from Figma (1.5px focused border): keeps the outline ring used by the other components.\n return {\n ...sizeClasses,\n ...options.stateClasses,\n outline: true,\n \"outline-2\": true,\n \"outline-offset-[3px]\": options.highlight,\n \"outline-offset-[-2px]\": !options.highlight,\n \"outline-color-border-focused\": true,\n };\n}\n\n/** Handles a remove button click: never reaches the container and runs `remove` only when enabled. */\nexport function handleChipRemove(event: Event, isDisabled: boolean, remove: () => void): void {\n event.stopPropagation();\n if (isDisabled) {\n return;\n }\n remove();\n}\n\n/**\n * Stops only Enter/Space on a chip's remove button so they don't reach the container; navigation\n * keys keep bubbling to a parent `FocusKeyManager`.\n */\nexport function stopChipActivationKeys(event: KeyboardEvent): void {\n switch (event.key) {\n case \"Enter\":\n case \" \": {\n event.stopPropagation();\n break;\n }\n default: {\n break;\n }\n }\n}\n\n/** Focuses the chip's remove button when rendered, otherwise its container. */\nexport function focusChip(\n removeButton: ElementRef<HTMLElement> | undefined,\n container: ElementRef<HTMLElement>,\n): void {\n (removeButton ?? container).nativeElement.focus();\n}\n","const ariaHiddenElements = new Map<Element, string | null>();\nlet ariaHideCount = 0;\n\n/** Hides everything except the overlay container from screen readers (ref-counted), since\n * `cdkTrapFocus` only traps Tab, not virtual-cursor navigation. Mirrors what CDK `Dialog` does. */\nexport function hideNonDialogContentFromAssistiveTechnology(\n overlayContainerElement: HTMLElement,\n): void {\n if (ariaHideCount === 0) {\n const parent = overlayContainerElement.parentElement;\n if (parent) {\n Array.from(parent.children).forEach((sibling) => {\n if (\n sibling !== overlayContainerElement &&\n sibling.nodeName !== \"SCRIPT\" &&\n sibling.nodeName !== \"STYLE\" &&\n !sibling.hasAttribute(\"aria-live\")\n ) {\n ariaHiddenElements.set(sibling, sibling.getAttribute(\"aria-hidden\"));\n sibling.setAttribute(\"aria-hidden\", \"true\");\n }\n });\n }\n }\n ariaHideCount++;\n}\n\nexport function restoreNonDialogContentFromAssistiveTechnology(): void {\n if (ariaHideCount === 0) {\n return;\n }\n ariaHideCount--;\n if (ariaHideCount === 0) {\n ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue === null) {\n element.removeAttribute(\"aria-hidden\");\n } else {\n element.setAttribute(\"aria-hidden\", previousValue);\n }\n });\n ariaHiddenElements.clear();\n }\n}\n\n/** @internal Test-only: resets module state shared across specs. */\nexport function _resetAriaHideForTesting(): void {\n ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue === null) {\n element.removeAttribute(\"aria-hidden\");\n } else {\n element.setAttribute(\"aria-hidden\", previousValue);\n }\n });\n ariaHiddenElements.clear();\n ariaHideCount = 0;\n}\n","let scrollLockCount = 0;\nlet previousBodyOverflow: string | null = null;\nlet previousBodyPaddingRight: string | null = null;\n\n/** Locks page scroll, ref-counted so it stays locked while any modal overlay is open. CDK's\n * `scrollStrategies.block()` is per instance, so closing one overlay would unlock it. */\nexport function lockPageScroll(): void {\n if (scrollLockCount === 0) {\n // Measured before hiding the overflow, which removes the scrollbar and widens the content.\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n previousBodyOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n if (scrollbarWidth > 0) {\n previousBodyPaddingRight = document.body.style.paddingRight;\n const currentPaddingRight =\n Number.parseFloat(getComputedStyle(document.body).paddingRight) || 0;\n document.body.style.paddingRight = `${currentPaddingRight + scrollbarWidth}px`;\n }\n }\n scrollLockCount++;\n}\n\nexport function unlockPageScroll(): void {\n if (scrollLockCount === 0) {\n return;\n }\n scrollLockCount--;\n if (scrollLockCount === 0) {\n document.body.style.overflow = previousBodyOverflow ?? \"\";\n previousBodyOverflow = null;\n if (previousBodyPaddingRight !== null) {\n document.body.style.paddingRight = previousBodyPaddingRight;\n previousBodyPaddingRight = null;\n }\n }\n}\n\n/** @internal Test-only: resets module state, which Karma shares across all specs. */\nexport function _resetScrollLockForTesting(): void {\n scrollLockCount = 0;\n previousBodyOverflow = null;\n previousBodyPaddingRight = null;\n document.body.style.overflow = \"\";\n document.body.style.paddingRight = \"\";\n}\n","// Theme\nexport {\n createTheme,\n type SdsTheme,\n type ThemeConfig,\n type ThemeOverrides,\n type ThemeVariant,\n} from \"./lib/theme/create-theme\";\nexport { type SemanticToken } from \"./lib/theme/semantic-tokens\";\nexport {\n SDS_THEME_MODE_STORAGE_KEY,\n SDS_THEME_NAME_STORAGE_KEY,\n SdsThemeService,\n type Mode,\n} from \"./lib/theme/theme.service\";\n\n// Combobox\nexport {\n buildDisplayRows,\n filterComboboxOptions,\n getComboboxOptionEl,\n type ComboboxDisplayRow,\n type ComboboxItem,\n} from \"./lib/combobox/combobox.utils\";\n\n// Forms\nexport { syncControlState } from \"./lib/forms/control-state.utils\";\n\n// A11y\nexport { FocusableItemAdapter, type FocusableItem } from \"./lib/a11y/focusable-item.utils\";\n\n// Chip\nexport {\n CHIP_STATE_CLASSES,\n buildChipContainerClasses,\n focusChip,\n handleChipRemove,\n stopChipActivationKeys,\n type ChipBaseVisualState,\n type ChipContainerClassOptions,\n} from \"./lib/chip/chip.utils\";\n\n// Overlay\nexport {\n _resetAriaHideForTesting,\n hideNonDialogContentFromAssistiveTechnology,\n restoreNonDialogContentFromAssistiveTechnology,\n} from \"./lib/overlay/aria-hide.utils\";\nexport {\n _resetScrollLockForTesting,\n lockPageScroll,\n unlockPageScroll,\n} from \"./lib/overlay/scroll-lock.utils\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names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AE,CAAC;AACxC;;AC5CA;;ACAA;;AAEG;;;;"}
|
package/filter-tag/README.md
CHANGED
|
@@ -36,7 +36,7 @@ Use para mostrar, de forma explícita, quais filtros estão ativos em uma busca,
|
|
|
36
36
|
- **Estados**:
|
|
37
37
|
- `default` — em repouso (`background-interactive-secondary`, borda `border-interactive-secondary`).
|
|
38
38
|
- `hover` — `background-interactive-secondary-hovered`.
|
|
39
|
-
- `disabled` — `background-disable`, borda `border
|
|
39
|
+
- `disabled` — `background-disable`, borda `border`, texto `text-disable`, X desabilitado com `opacity-50` (conforme o Figma), fora da ordem de foco.
|
|
40
40
|
- **Foco**: o anel de foco fica no X, o único elemento focável, porque é ele que Enter e Espaço acionam. O anel (`outline`) tem 2px, na cor `border-focused`, com 2px de offset por fora do X, e cabe no espaço interno da tag nos dois tamanhos; por isso não é cortado por controles que escondem overflow, como o trigger do `SdsSelectComponent`. **Desvio deliberado do Figma**: o estado Focused do protótipo mostra uma borda de 1.5px `border-focused` na tag inteira; o código mantém o anel no X para o indicador ficar no elemento que a tecla vai acionar, seguindo o padrão de foco dos outros componentes.
|
|
41
41
|
|
|
42
42
|
## Accessibility
|
|
@@ -177,3 +177,4 @@ export class MyComponent {}
|
|
|
177
177
|
- O X passa a ser a única parada de Tab, com o anel de foco nele: o corpo da tag não é mais focável.
|
|
178
178
|
- O nome acessível do X inclui o rótulo do filtro ("Remover Categoria: Design" no lugar de "Remover").
|
|
179
179
|
- Alinhado ao Figma: padding de 12px à esquerda e 8px à direita, ícone de 14px (`showIcon` + `[sdsIcon]`, em vez de `showLeading` + `[sdsLeading]` de 16px), X visível por padrão (`showRemove` = `true`) e X desabilitado com `opacity-50`.
|
|
180
|
+
- Borda do estado desabilitado passa a usar o token `border` (`border-color-border`) em vez de `border-bold`.
|
package/item-strip/README.md
CHANGED
|
@@ -30,8 +30,8 @@ Todos os itens de uma mesma faixa devem usar o mesmo `displayMode` — a faixa n
|
|
|
30
30
|
A faixa gerencia seleção única e navegação por teclado; o overflow é recalculado em tempo real conforme a largura dos itens.
|
|
31
31
|
|
|
32
32
|
- **`displayMode`** controla o que aparece em cada item, para a faixa inteira: `'title-only'` (só o label), `'title-icon'` (ícone acima do label) ou `'title-secondary'` (texto secundário menor acima do label).
|
|
33
|
-
- **Largura
|
|
34
|
-
- **
|
|
33
|
+
- **Largura e altura uniformes**: todos os itens da faixa recebem a largura e a altura do item mais largo/mais alto, medidas em tempo real — labels de tamanhos diferentes nunca deixam itens com dimensões desiguais entre si. Cada item tem 12px de respiro de cada lado (`sds-space-1-5`), 8px entre os itens (`sds-space-1`) e largura mínima de 40px (`sds-space-5`).
|
|
34
|
+
- **Quebra de texto sem reticências**: um label com mais de uma palavra quebra em várias linhas em vez de truncar com "…". Uma palavra única que sozinha exceda a largura máxima (`sds-space-10`, 80px) faz a faixa inteira ficar mais larga, em vez de cortar ou quebrar a palavra no meio.
|
|
35
35
|
- **Seleção**: clique ou Enter/Espaço no item focado seleciona; `disabled` bloqueia clique e é pulado na navegação por teclado (item ativo nunca é `disabled`).
|
|
36
36
|
- **Overflow automático**: as setas de navegação aparecem/somem sozinhas, comparando em tempo real a largura do conteúdo com a largura visível (via `ResizeObserver`) — não existe um input booleano ou threshold fixo para isso. As duas setas sempre nascem/morrem juntas (nunca uma sozinha), pra não deslocar a largura da faixa no meio de uma rolagem.
|
|
37
37
|
- **Rolagem ao selecionar**: se o item selecionado — por clique ou por navegação com as setas do teclado — estiver parcialmente cortado pela borda visível da faixa, ele é rolado automaticamente até ficar 100% visível.
|
|
@@ -69,11 +69,11 @@ Segue o padrão ARIA APG de tabs com ativação manual (mover o foco não seleci
|
|
|
69
69
|
|
|
70
70
|
- Não misture `displayMode` dentro da mesma faixa — se um item tem `icon`, todos os itens dessa faixa precisam ter; sem ícone disponível para algum, use `'title-only'` para a faixa inteira.
|
|
71
71
|
- Não dependa de `secondary`/`icon` aparecerem visualmente sem declarar o `displayMode` correspondente — eles são ignorados nos outros modos.
|
|
72
|
-
- Não passe labels
|
|
72
|
+
- Não passe labels muito longos esperando truncamento com reticências — o componente quebra linha ou alarga o item, nunca corta o texto.
|
|
73
73
|
|
|
74
74
|
## Content Guidelines
|
|
75
75
|
|
|
76
|
-
- Prefira labels curtos
|
|
76
|
+
- Prefira labels curtos, que caibam nos ~56px de área útil de um item (80px de largura máxima menos padding) sem precisar quebrar linha. Se um label com mais de uma palavra for inevitável, garanta que nenhuma palavra individual seja longa demais — ela não pode ser quebrada no meio e vai alargar a faixa toda.
|
|
77
77
|
- Em `displayMode="title-secondary"`, mantenha o texto secundário curto (ex.: abreviação de dia da semana) — é sempre a linha menor, acima do label.
|
|
78
78
|
|
|
79
79
|
---
|
|
@@ -238,10 +238,17 @@ Quando os itens não cabem na largura de 360px, as setas de rolagem aparecem aut
|
|
|
238
238
|
|
|
239
239
|
## Patch Notes
|
|
240
240
|
|
|
241
|
+
### [Unreleased] — 2026-10-23
|
|
242
|
+
|
|
243
|
+
#### Changed
|
|
244
|
+
|
|
245
|
+
- Volta a largura e a altura uniformes entre os itens (as do item mais largo e mais alto) e a quebra de linha sem reticências, a pedido do UX. Desfaz a largura pelo conteúdo e o limite de 30 caracteres com "…" de 2026-09-30.
|
|
246
|
+
|
|
241
247
|
### [Unreleased] — 2026-09-30
|
|
242
248
|
|
|
243
249
|
#### Fixed
|
|
244
250
|
|
|
251
|
+
- O anel de foco não aparece mais no clique do mouse, só na navegação por teclado. O item cancelava o foco nativo do `mousedown` e focava por código no clique, o que fazia o navegador herdar o anel do foco anterior. A rolagem até um item cortado continua começando depois que ele aparece selecionado.
|
|
245
252
|
- Cada item passa a ter a largura do próprio conteúdo (12px de padding de cada lado, 8px entre itens, mínimo de 40px), conforme o Figma. Antes todos recebiam a largura do item mais largo, o que deixava o espaço entre os rótulos irregular (reprovado na QA de design).
|
|
246
253
|
- Label e texto secundário em uma linha, comportando até 30 caracteres (`max-width: 30ch`) e truncados com "…" acima disso, conforme definido com o UX, em vez de quebrar linha.
|
|
247
254
|
- Borda de seleção desenhada para dentro do item (sombra `inset` de 1px), para selecionar não alterar a largura.
|
|
@@ -35,6 +35,13 @@ export declare class SdsItemStripComponent<T = unknown> {
|
|
|
35
35
|
* `clientWidth` and makes the browser re-clamp `scrollLeft`, causing a visible jump.
|
|
36
36
|
*/
|
|
37
37
|
protected readonly hasAnyOverflow: import("@angular/core").Signal<boolean>;
|
|
38
|
+
/** Uniform width (px) for all items: the widest item's. `null` until measured. */
|
|
39
|
+
protected readonly itemWidthPx: import("@angular/core").WritableSignal<number | null>;
|
|
40
|
+
/**
|
|
41
|
+
* Uniform height (px) for all items: the tallest item's. Measured only after `itemWidthPx`
|
|
42
|
+
* settles, since line wrapping depends on the final width. `null` until measured.
|
|
43
|
+
*/
|
|
44
|
+
protected readonly itemHeightPx: import("@angular/core").WritableSignal<number | null>;
|
|
38
45
|
/** Index of the item holding focus; -1 while focus is outside the strip. */
|
|
39
46
|
private readonly isFocusedIndex;
|
|
40
47
|
private readonly itemFocusItems;
|
|
@@ -45,10 +52,14 @@ export declare class SdsItemStripComponent<T = unknown> {
|
|
|
45
52
|
*/
|
|
46
53
|
protected readonly rovingTabIndexTarget: import("@angular/core").Signal<number>;
|
|
47
54
|
constructor();
|
|
48
|
-
private
|
|
55
|
+
private scheduleWidthRemeasure;
|
|
56
|
+
private scheduleHeightRemeasure;
|
|
57
|
+
private measureItemWidth;
|
|
58
|
+
private measureItemHeight;
|
|
49
59
|
protected getItemId(index: number): string;
|
|
50
60
|
protected isItemSelected(item: SdsItemStripItem<T>): boolean;
|
|
51
61
|
protected selectItem(item: SdsItemStripItem<T>): void;
|
|
62
|
+
/** Each item scrolls itself into view, deferring to the click when focused by the mouse. */
|
|
52
63
|
protected handleItemFocusIn(index: number): void;
|
|
53
64
|
/** Re-entering the strip with Tab lands on the selected item, not on the last one focused. */
|
|
54
65
|
protected handleTablistFocusOut(event: FocusEvent): void;
|
|
@@ -22,9 +22,14 @@ export declare class SdsItemStripItemComponent {
|
|
|
22
22
|
readonly controlsId: import("@angular/core").InputSignal<string | null>;
|
|
23
23
|
/** @internal Roving tabindex set by the parent: 0 for one item, -1 for the rest. */
|
|
24
24
|
readonly itemTabIndex: import("@angular/core").InputSignal<number>;
|
|
25
|
+
/** @internal Uniform width (px) set by the parent; `null` keeps the content's own width. */
|
|
26
|
+
readonly widthPx: import("@angular/core").InputSignal<number | null>;
|
|
27
|
+
/** @internal Uniform height (px) set by the parent; `null` keeps the content's own height. */
|
|
28
|
+
readonly heightPx: import("@angular/core").InputSignal<number | null>;
|
|
25
29
|
/** @internal Emitted on click or Enter/Space when not disabled; the parent handles selection. */
|
|
26
30
|
readonly activated: import("@angular/core").OutputEmitterRef<void>;
|
|
27
31
|
protected readonly isHovered: import("@angular/core").WritableSignal<boolean>;
|
|
32
|
+
private isPointerPressed;
|
|
28
33
|
protected readonly visualState: import("@angular/core").Signal<ItemStripItemVisualState>;
|
|
29
34
|
/**
|
|
30
35
|
* The selected stroke is an inset shadow, not a border: Figma draws it inside the item
|
|
@@ -75,12 +80,36 @@ export declare class SdsItemStripItemComponent {
|
|
|
75
80
|
*/
|
|
76
81
|
protected readonly iconClasses: import("@angular/core").Signal<string>;
|
|
77
82
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
83
|
+
* Keeps the browser's native focus on `mousedown`: a programmatic `focus()` after a cancelled
|
|
84
|
+
* mousedown inherits the previous `:focus-visible` state, so clicks would show the keyboard ring.
|
|
80
85
|
*/
|
|
81
86
|
protected handlePointerDown(event: MouseEvent): void;
|
|
87
|
+
/** A mouse press defers the scroll to `handleClick()`, so the item already shows as selected. */
|
|
88
|
+
protected handleFocus(): void;
|
|
89
|
+
protected handleBlur(): void;
|
|
82
90
|
protected handleClick(): void;
|
|
83
91
|
protected handleKeydown(event: KeyboardEvent): void;
|
|
92
|
+
/**
|
|
93
|
+
* @internal Width the item needs to show its content, ignoring `widthPx`.
|
|
94
|
+
*
|
|
95
|
+
* Does not use the container's `getBoundingClientRect()`: the intrinsic width of an
|
|
96
|
+
* `inline-flex flex-col` underestimates what the text needs. Instead it sums each child's
|
|
97
|
+
* `scrollWidth` and the computed padding. The selected stroke is an inset shadow, so it adds no
|
|
98
|
+
* width.
|
|
99
|
+
*
|
|
100
|
+
* Each child contributes `max(widest word, min(single-line width, cap))`: wrappable text is
|
|
101
|
+
* capped at `WRAPPABLE_CONTENT_MAX_WIDTH_PX`, but never below its widest word, which cannot
|
|
102
|
+
* be broken.
|
|
103
|
+
*/
|
|
104
|
+
getNaturalWidth(): number;
|
|
105
|
+
/**
|
|
106
|
+
* @internal Height the item needs to show its content, ignoring `heightPx`. Call only after
|
|
107
|
+
* `widthPx` settles, since wrapping depends on the final width. `getBoundingClientRect()` is
|
|
108
|
+
* reliable here because height is the main axis of the `flex-col`.
|
|
109
|
+
*/
|
|
110
|
+
getNaturalHeight(): number;
|
|
111
|
+
/** Width of the widest word in `element`'s text (0 if there is no text). */
|
|
112
|
+
private measureWidestWordWidth;
|
|
84
113
|
/** `FocusableOption.focus`, used by `FocusableItemAdapter` in the parent. */
|
|
85
114
|
focus(): void;
|
|
86
115
|
/**
|
|
@@ -89,6 +118,6 @@ export declare class SdsItemStripItemComponent {
|
|
|
89
118
|
*/
|
|
90
119
|
scrollIntoView(): void;
|
|
91
120
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsItemStripItemComponent, never>;
|
|
92
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdsItemStripItemComponent, "sds-item-strip-item", never, { "displayMode": { "alias": "displayMode"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "secondary": { "alias": "secondary"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "showNotification": { "alias": "showNotification"; "required": false; "isSignal": true; }; "notificationLabel": { "alias": "notificationLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "itemId": { "alias": "itemId"; "required": true; "isSignal": true; }; "controlsId": { "alias": "controlsId"; "required": false; "isSignal": true; }; "itemTabIndex": { "alias": "itemTabIndex"; "required": false; "isSignal": true; }; }, { "activated": "activated"; }, never, never, true, never>;
|
|
121
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsItemStripItemComponent, "sds-item-strip-item", never, { "displayMode": { "alias": "displayMode"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "secondary": { "alias": "secondary"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "showNotification": { "alias": "showNotification"; "required": false; "isSignal": true; }; "notificationLabel": { "alias": "notificationLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "itemId": { "alias": "itemId"; "required": true; "isSignal": true; }; "controlsId": { "alias": "controlsId"; "required": false; "isSignal": true; }; "itemTabIndex": { "alias": "itemTabIndex"; "required": false; "isSignal": true; }; "widthPx": { "alias": "widthPx"; "required": false; "isSignal": true; }; "heightPx": { "alias": "heightPx"; "required": false; "isSignal": true; }; }, { "activated": "activated"; }, never, never, true, never>;
|
|
93
122
|
}
|
|
94
123
|
export {};
|
package/list/README.md
CHANGED
|
@@ -79,6 +79,7 @@ A lista usa elementos nativos, para que leitores de tela e navegadores reconheç
|
|
|
79
79
|
- Não use a faixa de cor para comunicar status; ela categoriza. Status vai na tag, com texto.
|
|
80
80
|
- Não use Tomato e Orange na mesma lista: são cores vizinhas e difíceis de distinguir.
|
|
81
81
|
- Não use o chevron em linhas que não levam a outra tela.
|
|
82
|
+
- Não coloque no `tooltip` informação essencial: no toque a linha navega e o balão não chega a aparecer. O que o usuário precisa saber vai em `description`, `overline` ou na tag.
|
|
82
83
|
- Não deixe uma lista que pode ficar vazia sem um `<sds-empty-state>` projetado: sem ele, o usuário vê uma área em branco e não sabe por que não há nada ali.
|
|
83
84
|
- Não coloque a lista dentro de outra superfície com borda e sombra próprias sem necessidade — ela foi pensada para viver no corpo de um Panel, Drawer ou Card.
|
|
84
85
|
|
|
@@ -140,6 +141,18 @@ export class MyComponent {}
|
|
|
140
141
|
| `href` | `string` | ❌ | URL de destino quando não há `routerLink`; renderiza a linha como link. |
|
|
141
142
|
| `showChevron` | `boolean` | ❌ | Exibe o chevron, indicando que a linha leva a outra tela. |
|
|
142
143
|
| `disabled` | `boolean` | ❌ | Desabilita o item: sem hover, foco nem `itemClick`. |
|
|
144
|
+
| `tooltip` | `SdsListItemTooltip` | ❌ | Tooltip da linha (texto de ajuda), com as mesmas opções do `sdsTooltip`. Não aparece em item desabilitado. |
|
|
145
|
+
|
|
146
|
+
### `SdsListItemTooltip`
|
|
147
|
+
|
|
148
|
+
| Campo | Tipo | Obrigatório | Descrição |
|
|
149
|
+
| ----------- | -------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
150
|
+
| `content` | `string \| TemplateRef<unknown>` | ✅ | Texto do balão, ou um template renderizado com o item como `$implicit` (`let-item`) e o `context` como variáveis nomeadas. |
|
|
151
|
+
| `title` | `string` | ❌ | Ativa a variante rica (título + `content` como texto de apoio). |
|
|
152
|
+
| `position` | `SdsTooltipPosition` | ❌ | Posição do balão. Padrão: `'auto'`. |
|
|
153
|
+
| `showArrow` | `boolean` | ❌ | Exibe a seta. Padrão: `true`. |
|
|
154
|
+
| `openDelay` | `number` | ❌ | Atraso em ms antes de abrir no hover. Padrão: `150`. |
|
|
155
|
+
| `context` | `Record<string, unknown>` | ❌ | Variáveis extras para um `content` do tipo template. |
|
|
143
156
|
|
|
144
157
|
### `SdsListGroup<TId>`
|
|
145
158
|
|
|
@@ -293,6 +306,10 @@ O `<sds-empty-state>` projetado só aparece quando a lista não tem itens. A fra
|
|
|
293
306
|
|
|
294
307
|
#### Added
|
|
295
308
|
|
|
309
|
+
- Campo `tooltip` em `SdsListItem` (`SdsListItemTooltip`): texto de ajuda por item, com as opções do `sdsTooltip` (texto, título, posição, seta, atraso) e conteúdo por template, que recebe o item como `$implicit` e o `context` como variáveis nomeadas. O texto também é exposto ao leitor de tela na descrição da linha. Numa lista somente leitura, as linhas com tooltip passam a ser alcançáveis por Tab.
|
|
310
|
+
|
|
311
|
+
#### Added
|
|
312
|
+
|
|
296
313
|
- `highlightTerm`: negrita (`font-weight-semibold`) todo trecho do título de cada item que combina com o termo digitado, sem diferenciar maiúsculas/minúsculas nem acentos — usado no painel de busca da Topbar.
|
|
297
314
|
- Item desabilitado com todo o conteúdo na cor de desabilitado: o avatar e a etiqueta recebem o `disabled` do item (estados desabilitados do `sds-avatar-summary` e do `sds-display-tag`), e os ícones usam o `icon-disable` corrigido (mesmo tom do texto desabilitado).
|
|
298
315
|
- Estado vazio: a List exibe o `<sds-empty-state>` projetado quando não há itens (lista plana vazia ou todos os grupos vazios), em vez de uma área em branco.
|
package/list/public-api.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { SdsListComponent } from "./src/list/list.component";
|
|
2
|
-
export type { SdsListEntries, SdsListGroup, SdsListHeadingLevel, SdsListItem, SdsListItemColor, SdsListItemLeadingVisual, SdsListItemTag, } from "./src/list/list.models";
|
|
2
|
+
export type { SdsListEntries, SdsListGroup, SdsListHeadingLevel, SdsListItem, SdsListItemColor, SdsListItemLeadingVisual, SdsListItemTag, SdsListItemTooltip, } from "./src/list/list.models";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { TemplateRef } from "@angular/core";
|
|
1
2
|
import type { SdsDisplayTagColor } from "@seniorsistemas/scala-ng/display-tag";
|
|
3
|
+
import type { SdsTooltipPosition } from "@seniorsistemas/scala-ng/tooltip";
|
|
2
4
|
/** Visual that identifies the record on the left side of the row. */
|
|
3
5
|
export type SdsListItemLeadingVisual = "none" | "accent-bar" | "icon" | "icon-container" | "avatar";
|
|
4
6
|
/** Level of the group heading elements (`<h2>` to `<h6>`). */
|
|
@@ -16,6 +18,21 @@ export interface SdsListItemTag {
|
|
|
16
18
|
/** Defaults to "slate". */
|
|
17
19
|
readonly color?: SdsDisplayTagColor;
|
|
18
20
|
}
|
|
21
|
+
/** Tooltip shown on the item row, with the same options as `sdsTooltip`. */
|
|
22
|
+
export interface SdsListItemTooltip {
|
|
23
|
+
/** Plain text, or a template rendered with the item as `$implicit` and `context` as named variables. */
|
|
24
|
+
readonly content: string | TemplateRef<unknown>;
|
|
25
|
+
/** Enables the rich variant (title plus `content` as supporting text). */
|
|
26
|
+
readonly title?: string;
|
|
27
|
+
/** Bubble position; defaults to "auto". */
|
|
28
|
+
readonly position?: SdsTooltipPosition;
|
|
29
|
+
/** Shows the arrow; defaults to `true`. */
|
|
30
|
+
readonly showArrow?: boolean;
|
|
31
|
+
/** Delay in ms before opening on hover; defaults to 150. */
|
|
32
|
+
readonly openDelay?: number;
|
|
33
|
+
/** Extra named variables for a template `content`. */
|
|
34
|
+
readonly context?: Record<string, unknown>;
|
|
35
|
+
}
|
|
19
36
|
/** A record rendered as one list row. */
|
|
20
37
|
export interface SdsListItem<TId extends string | number = string | number> {
|
|
21
38
|
/** Stable identifier, unique across the whole list (groups included), used for rendering, selection and focus. */
|
|
@@ -46,6 +63,8 @@ export interface SdsListItem<TId extends string | number = string | number> {
|
|
|
46
63
|
readonly showChevron?: boolean;
|
|
47
64
|
/** Disables the item: no hover, focus or `itemClick`. */
|
|
48
65
|
readonly disabled?: boolean;
|
|
66
|
+
/** Help text shown in a tooltip on the row; never put essential information here. */
|
|
67
|
+
readonly tooltip?: SdsListItemTooltip;
|
|
49
68
|
}
|
|
50
69
|
/** List section: a heading ("Hoje · 2 eventos") and the items that belong to it. */
|
|
51
70
|
export interface SdsListGroup<TId extends string | number = string | number> {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TemplateRef } from "@angular/core";
|
|
2
|
+
import { SdsListItemColor, SdsListItemLeadingVisual, SdsListItemTooltip } from "../list/list.models";
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
type RowKind = "static" | "router-link" | "href" | "disabled-link" | "button";
|
|
4
5
|
/** @internal A single row, rendered by `SdsListComponent` from `items()`. */
|
|
@@ -35,6 +36,10 @@ export declare class SdsListItemComponent {
|
|
|
35
36
|
readonly interactive: import("@angular/core").InputSignal<boolean>;
|
|
36
37
|
/** Term to bold inside the title, case- and diacritic-insensitive; empty disables highlighting. */
|
|
37
38
|
readonly highlightTerm: import("@angular/core").InputSignal<string>;
|
|
39
|
+
/** Tooltip shown on the row. */
|
|
40
|
+
readonly tooltip: import("@angular/core").InputSignal<SdsListItemTooltip | undefined>;
|
|
41
|
+
/** @internal The record this row renders, passed to a tooltip template as `$implicit`. */
|
|
42
|
+
readonly record: import("@angular/core").InputSignal<unknown>;
|
|
38
43
|
/** Emits when the row is clicked or activated from the keyboard. */
|
|
39
44
|
readonly itemClick: import("@angular/core").OutputEmitterRef<void>;
|
|
40
45
|
private readonly row;
|
|
@@ -43,6 +48,14 @@ export declare class SdsListItemComponent {
|
|
|
43
48
|
protected readonly overlineId: string;
|
|
44
49
|
protected readonly descriptionId: string;
|
|
45
50
|
protected readonly trailingId: string;
|
|
51
|
+
protected readonly tooltipTextId: string;
|
|
52
|
+
/** Disabled rows have no interaction, so no tooltip either. */
|
|
53
|
+
protected readonly activeTooltip: import("@angular/core").Signal<SdsListItemTooltip | undefined>;
|
|
54
|
+
protected readonly tooltipTemplate: import("@angular/core").Signal<TemplateRef<unknown> | null>;
|
|
55
|
+
protected readonly tooltipText: import("@angular/core").Signal<string>;
|
|
56
|
+
protected readonly tooltipContext: import("@angular/core").Signal<{
|
|
57
|
+
$implicit: unknown;
|
|
58
|
+
}>;
|
|
46
59
|
protected readonly describedBy: import("@angular/core").Signal<string>;
|
|
47
60
|
protected readonly rowKind: import("@angular/core").Signal<RowKind>;
|
|
48
61
|
protected readonly isFocusable: import("@angular/core").Signal<boolean>;
|
|
@@ -70,6 +83,6 @@ export declare class SdsListItemComponent {
|
|
|
70
83
|
containsElement(element: Node): boolean;
|
|
71
84
|
protected handleClick(): void;
|
|
72
85
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsListItemComponent, never>;
|
|
73
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdsListItemComponent, "li[sdsListItem]", never, { "itemId": { "alias": "itemId"; "required": true; "isSignal": true; }; "heading": { "alias": "heading"; "required": true; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "overline": { "alias": "overline"; "required": false; "isSignal": true; }; "leadingVisual": { "alias": "leadingVisual"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "avatarName": { "alias": "avatarName"; "required": false; "isSignal": true; }; "avatarImageUrl": { "alias": "avatarImageUrl"; "required": false; "isSignal": true; }; "routerLink": { "alias": "routerLink"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "showChevron": { "alias": "showChevron"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "highlightTerm": { "alias": "highlightTerm"; "required": false; "isSignal": true; }; }, { "itemClick": "itemClick"; }, never, ["*"], true, never>;
|
|
86
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsListItemComponent, "li[sdsListItem]", never, { "itemId": { "alias": "itemId"; "required": true; "isSignal": true; }; "heading": { "alias": "heading"; "required": true; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "overline": { "alias": "overline"; "required": false; "isSignal": true; }; "leadingVisual": { "alias": "leadingVisual"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "avatarName": { "alias": "avatarName"; "required": false; "isSignal": true; }; "avatarImageUrl": { "alias": "avatarImageUrl"; "required": false; "isSignal": true; }; "routerLink": { "alias": "routerLink"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "showChevron": { "alias": "showChevron"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "highlightTerm": { "alias": "highlightTerm"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "record": { "alias": "record"; "required": false; "isSignal": true; }; }, { "itemClick": "itemClick"; }, never, ["*"], true, never>;
|
|
74
87
|
}
|
|
75
88
|
export {};
|
package/package.json
CHANGED
|
@@ -16,12 +16,6 @@
|
|
|
16
16
|
"esm2022": "./esm2022/autocomplete/seniorsistemas-scala-ng-autocomplete.mjs",
|
|
17
17
|
"types": "./autocomplete/index.d.ts"
|
|
18
18
|
},
|
|
19
|
-
"./avatar-profile": {
|
|
20
|
-
"default": "./fesm2022/seniorsistemas-scala-ng-avatar-profile.mjs",
|
|
21
|
-
"esm": "./esm2022/avatar-profile/seniorsistemas-scala-ng-avatar-profile.mjs",
|
|
22
|
-
"esm2022": "./esm2022/avatar-profile/seniorsistemas-scala-ng-avatar-profile.mjs",
|
|
23
|
-
"types": "./avatar-profile/index.d.ts"
|
|
24
|
-
},
|
|
25
19
|
"./avatar-summary": {
|
|
26
20
|
"default": "./fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs",
|
|
27
21
|
"esm": "./esm2022/avatar-summary/seniorsistemas-scala-ng-avatar-summary.mjs",
|
|
@@ -243,5 +237,5 @@
|
|
|
243
237
|
"schematics": "./schematics/collection.json",
|
|
244
238
|
"sideEffects": false,
|
|
245
239
|
"typings": "index.d.ts",
|
|
246
|
-
"version": "2.
|
|
240
|
+
"version": "2.2.0"
|
|
247
241
|
}
|