@ngxsmk/theme 1.0.0 → 1.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/esm2022/lib/color.mjs +115 -0
- package/esm2022/lib/css.mjs +238 -0
- package/esm2022/lib/define-config.mjs +44 -0
- package/esm2022/lib/presets.mjs +76 -0
- package/esm2022/lib/theme.service.mjs +80 -0
- package/esm2022/lib/tokens.mjs +137 -0
- package/esm2022/lib/types.mjs +9 -0
- package/esm2022/ngxsmk-theme.mjs +5 -0
- package/esm2022/public-api.mjs +11 -0
- package/fesm2022/ngxsmk-theme.mjs +44 -19
- package/fesm2022/ngxsmk-theme.mjs.map +1 -1
- package/index.d.ts +6 -0
- package/lib/color.d.ts +22 -0
- package/lib/color.d.ts.map +1 -0
- package/lib/css.d.ts +8 -0
- package/lib/css.d.ts.map +1 -0
- package/lib/define-config.d.ts +13 -0
- package/lib/define-config.d.ts.map +1 -0
- package/lib/presets.d.ts +15 -0
- package/lib/presets.d.ts.map +1 -0
- package/lib/theme.service.d.ts +34 -0
- package/lib/theme.service.d.ts.map +1 -0
- package/lib/tokens.d.ts +39 -0
- package/lib/tokens.d.ts.map +1 -0
- package/lib/types.d.ts +117 -0
- package/lib/types.d.ts.map +1 -0
- package/ngxsmk-theme.d.ts.map +1 -0
- package/package.json +6 -5
- package/public-api.d.ts +8 -0
- package/public-api.d.ts.map +1 -0
- package/styles/ngx.css +88 -86
- package/styles/ngxsmk.astryx.css +132 -87
- package/styles/ngxsmk.css +132 -87
- package/styles/ngxsmk.emerald.css +130 -85
- package/styles/ngxsmk.neutral.css +131 -86
- package/styles/ngxsmk.rose.css +133 -88
- package/styles/ngxsmk.violet.css +134 -89
- package/types/ngxsmk-theme.d.ts +0 -238
package/styles/ngxsmk.violet.css
CHANGED
|
@@ -1,31 +1,44 @@
|
|
|
1
1
|
/* Generated by @ngxsmk/theme — do not edit by hand. */
|
|
2
2
|
:root {
|
|
3
|
-
--ngxsmk-color-brand-50: #
|
|
4
|
-
--ngxsmk-color-brand-100: #
|
|
5
|
-
--ngxsmk-color-brand-200: #
|
|
6
|
-
--ngxsmk-color-brand-300: #
|
|
7
|
-
--ngxsmk-color-brand-400: #
|
|
8
|
-
--ngxsmk-color-brand-500: #
|
|
9
|
-
--ngxsmk-color-brand-600: #
|
|
10
|
-
--ngxsmk-color-brand-700: #
|
|
11
|
-
--ngxsmk-color-brand-800: #
|
|
12
|
-
--ngxsmk-color-brand-900: #
|
|
13
|
-
--ngxsmk-color-brand-950: #
|
|
14
|
-
--ngxsmk-color-
|
|
15
|
-
--ngxsmk-color-
|
|
16
|
-
--ngxsmk-color-
|
|
17
|
-
--ngxsmk-color-
|
|
3
|
+
--ngxsmk-color-brand-50: #f6f1fe;
|
|
4
|
+
--ngxsmk-color-brand-100: #ece3fc;
|
|
5
|
+
--ngxsmk-color-brand-200: #d7c2f9;
|
|
6
|
+
--ngxsmk-color-brand-300: #bb98f6;
|
|
7
|
+
--ngxsmk-color-brand-400: #9560f0;
|
|
8
|
+
--ngxsmk-color-brand-500: #7c3aed;
|
|
9
|
+
--ngxsmk-color-brand-600: #6014e0;
|
|
10
|
+
--ngxsmk-color-brand-700: #5011bb;
|
|
11
|
+
--ngxsmk-color-brand-800: #400e96;
|
|
12
|
+
--ngxsmk-color-brand-900: #320b75;
|
|
13
|
+
--ngxsmk-color-brand-950: #20074b;
|
|
14
|
+
--ngxsmk-color-secondary-50: #fef1f9;
|
|
15
|
+
--ngxsmk-color-secondary-100: #fce3f3;
|
|
16
|
+
--ngxsmk-color-secondary-200: #f9c2e5;
|
|
17
|
+
--ngxsmk-color-secondary-300: #f698d3;
|
|
18
|
+
--ngxsmk-color-secondary-400: #f060bb;
|
|
19
|
+
--ngxsmk-color-secondary-500: #ed3aab;
|
|
20
|
+
--ngxsmk-color-secondary-600: #e01495;
|
|
21
|
+
--ngxsmk-color-secondary-700: #bb117c;
|
|
22
|
+
--ngxsmk-color-secondary-800: #960e63;
|
|
23
|
+
--ngxsmk-color-secondary-900: #750b4e;
|
|
24
|
+
--ngxsmk-color-secondary-950: #4b0732;
|
|
25
|
+
--ngxsmk-color-neutral-50: #f1f4f7;
|
|
26
|
+
--ngxsmk-color-neutral-100: #e4e9ee;
|
|
27
|
+
--ngxsmk-color-neutral-200: #ccd3db;
|
|
28
|
+
--ngxsmk-color-neutral-300: #a4b0bc;
|
|
18
29
|
--ngxsmk-color-neutral-400: #778593;
|
|
19
|
-
--ngxsmk-color-neutral-500: #
|
|
20
|
-
--ngxsmk-color-neutral-600: #
|
|
21
|
-
--ngxsmk-color-neutral-700: #
|
|
22
|
-
--ngxsmk-color-neutral-800: #
|
|
23
|
-
--ngxsmk-color-neutral-900: #
|
|
30
|
+
--ngxsmk-color-neutral-500: #4e606f;
|
|
31
|
+
--ngxsmk-color-neutral-600: #3a4650;
|
|
32
|
+
--ngxsmk-color-neutral-700: #2a333b;
|
|
33
|
+
--ngxsmk-color-neutral-800: #1f1f22;
|
|
34
|
+
--ngxsmk-color-neutral-900: #18181a;
|
|
24
35
|
--ngxsmk-color-neutral-950: #111112;
|
|
25
36
|
--ngxsmk-font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
26
37
|
--ngxsmk-font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
|
|
27
38
|
--ngxsmk-radius-base: 0.5rem;
|
|
28
39
|
--ngxsmk-control-height: 2.5rem;
|
|
40
|
+
--ngxsmk-motion-duration: var(--ngxsmk-duration-normal);
|
|
41
|
+
--ngxsmk-motion-ease: var(--ngxsmk-ease-in-out);
|
|
29
42
|
--ngxsmk-button-bg: var(--ngxsmk-color-primary);
|
|
30
43
|
--ngxsmk-button-color: var(--ngxsmk-color-on-primary);
|
|
31
44
|
--ngxsmk-button-font-family: var(--ngxsmk-font-sans);
|
|
@@ -146,90 +159,122 @@
|
|
|
146
159
|
--ngxsmk-text-body-xs-line: 1rem;
|
|
147
160
|
--ngxsmk-text-body-xs-weight: 400;
|
|
148
161
|
color-scheme: light;
|
|
149
|
-
--ngxsmk-color-primary: #
|
|
150
|
-
--ngxsmk-color-on-primary: #
|
|
151
|
-
--ngxsmk-color-primary-hover: #
|
|
152
|
-
--ngxsmk-color-primary-active: #
|
|
153
|
-
--ngxsmk-color-primary-container: #
|
|
154
|
-
--ngxsmk-color-on-primary-container: #
|
|
155
|
-
--ngxsmk-color-
|
|
156
|
-
--ngxsmk-color-on-
|
|
157
|
-
--ngxsmk-color-
|
|
158
|
-
--ngxsmk-color-
|
|
159
|
-
--ngxsmk-color-
|
|
160
|
-
--ngxsmk-color-on-
|
|
162
|
+
--ngxsmk-color-primary: #7c3aed;
|
|
163
|
+
--ngxsmk-color-on-primary: #ffffff;
|
|
164
|
+
--ngxsmk-color-primary-hover: #6315e9;
|
|
165
|
+
--ngxsmk-color-primary-active: #5713cd;
|
|
166
|
+
--ngxsmk-color-primary-container: #ece3fc;
|
|
167
|
+
--ngxsmk-color-on-primary-container: #320b75;
|
|
168
|
+
--ngxsmk-color-secondary: #ed3aab;
|
|
169
|
+
--ngxsmk-color-on-secondary: #ffffff;
|
|
170
|
+
--ngxsmk-color-secondary-hover: #e9159b;
|
|
171
|
+
--ngxsmk-color-secondary-active: #cd1388;
|
|
172
|
+
--ngxsmk-color-secondary-container: #fce3f3;
|
|
173
|
+
--ngxsmk-color-on-secondary-container: #750b4e;
|
|
174
|
+
--ngxsmk-color-background: #f1f4f7;
|
|
175
|
+
--ngxsmk-color-on-background: #0a1317;
|
|
176
|
+
--ngxsmk-color-surface: #ffffff;
|
|
177
|
+
--ngxsmk-color-on-surface: #0a1317;
|
|
178
|
+
--ngxsmk-color-surface-variant: #e4e9ee;
|
|
179
|
+
--ngxsmk-color-on-surface-variant: #4e606f;
|
|
161
180
|
--ngxsmk-color-surface-hover: rgb(5 54 89 / 0.05);
|
|
162
181
|
--ngxsmk-color-surface-active: rgb(5 54 89 / 0.1);
|
|
163
|
-
--ngxsmk-color-surface-container: #
|
|
182
|
+
--ngxsmk-color-surface-container: #ffffff;
|
|
164
183
|
--ngxsmk-color-outline: rgb(5 54 89 / 0.1);
|
|
165
|
-
--ngxsmk-color-outline-strong: #
|
|
184
|
+
--ngxsmk-color-outline-strong: #ccd3db;
|
|
166
185
|
--ngxsmk-color-outline-variant: rgb(5 54 89 / 0.06);
|
|
167
|
-
--ngxsmk-color-
|
|
186
|
+
--ngxsmk-color-surface-1: #ffffff;
|
|
187
|
+
--ngxsmk-color-surface-2: #f1f4f7;
|
|
188
|
+
--ngxsmk-color-surface-3: #e4e9ee;
|
|
189
|
+
--ngxsmk-color-surface-4: #ccd3db;
|
|
190
|
+
--ngxsmk-color-surface-5: #a4b0bc;
|
|
191
|
+
--ngxsmk-color-ring: #7c3aed;
|
|
168
192
|
--ngxsmk-color-backdrop: rgb(1 18 40 / 0.4);
|
|
169
|
-
--ngxsmk-shadow-focus: 0 0 0 2px #
|
|
170
|
-
--ngxsmk-color-tertiary: #
|
|
171
|
-
--ngxsmk-color-on-tertiary: #
|
|
172
|
-
--ngxsmk-color-tertiary-container: #
|
|
173
|
-
--ngxsmk-color-on-tertiary-container: #
|
|
174
|
-
--ngxsmk-color-success: #
|
|
175
|
-
--ngxsmk-color-on-success: #
|
|
176
|
-
--ngxsmk-color-success-container: #
|
|
177
|
-
--ngxsmk-color-on-success-container: #
|
|
178
|
-
--ngxsmk-color-warning: #
|
|
179
|
-
--ngxsmk-color-on-warning: #
|
|
180
|
-
--ngxsmk-color-warning-container: #
|
|
181
|
-
--ngxsmk-color-on-warning-container: #
|
|
182
|
-
--ngxsmk-color-error: #
|
|
183
|
-
--ngxsmk-color-on-error: #
|
|
184
|
-
--ngxsmk-color-error-container: #
|
|
193
|
+
--ngxsmk-shadow-focus: 0 0 0 2px #ece3fc, 0 0 0 4px color-mix(in srgb, #7c3aed 45%, transparent);
|
|
194
|
+
--ngxsmk-color-tertiary: #ed3a9f;
|
|
195
|
+
--ngxsmk-color-on-tertiary: #ffffff;
|
|
196
|
+
--ngxsmk-color-tertiary-container: #fce3f1;
|
|
197
|
+
--ngxsmk-color-on-tertiary-container: #750b47;
|
|
198
|
+
--ngxsmk-color-success: #0d8626;
|
|
199
|
+
--ngxsmk-color-on-success: #ffffff;
|
|
200
|
+
--ngxsmk-color-success-container: #e3fce8;
|
|
201
|
+
--ngxsmk-color-on-success-container: #0d8626;
|
|
202
|
+
--ngxsmk-color-warning: #e9af08;
|
|
203
|
+
--ngxsmk-color-on-warning: #ffffff;
|
|
204
|
+
--ngxsmk-color-warning-container: #fef7e1;
|
|
205
|
+
--ngxsmk-color-on-warning-container: #9e7705;
|
|
206
|
+
--ngxsmk-color-error: #e3193b;
|
|
207
|
+
--ngxsmk-color-on-error: #ffffff;
|
|
208
|
+
--ngxsmk-color-error-container: #fce3e8;
|
|
185
209
|
--ngxsmk-color-on-error-container: #931026;
|
|
186
|
-
--ngxsmk-color-info: #
|
|
187
|
-
--ngxsmk-color-on-info: #
|
|
188
|
-
--ngxsmk-color-info-container: #
|
|
189
|
-
--ngxsmk-color-on-info-container: #
|
|
210
|
+
--ngxsmk-color-info: #0064e0;
|
|
211
|
+
--ngxsmk-color-on-info: #ffffff;
|
|
212
|
+
--ngxsmk-color-info-container: #e0eeff;
|
|
213
|
+
--ngxsmk-color-on-info-container: #0049a3;
|
|
190
214
|
}
|
|
191
215
|
|
|
192
|
-
:root.dark,
|
|
216
|
+
:root.dark,
|
|
217
|
+
:root.dark body,
|
|
218
|
+
.dark {
|
|
193
219
|
color-scheme: dark;
|
|
194
|
-
--ngxsmk-color-primary: #
|
|
195
|
-
--ngxsmk-color-on-primary: #
|
|
196
|
-
--ngxsmk-color-primary-hover: #
|
|
197
|
-
--ngxsmk-color-primary-active: #
|
|
198
|
-
--ngxsmk-color-primary-container: #
|
|
199
|
-
--ngxsmk-color-on-primary-container: #
|
|
220
|
+
--ngxsmk-color-primary: #9560f0;
|
|
221
|
+
--ngxsmk-color-on-primary: #ffffff;
|
|
222
|
+
--ngxsmk-color-primary-hover: #bb98f6;
|
|
223
|
+
--ngxsmk-color-primary-active: #d7c2f9;
|
|
224
|
+
--ngxsmk-color-primary-container: #320b75;
|
|
225
|
+
--ngxsmk-color-on-primary-container: #ece3fc;
|
|
226
|
+
--ngxsmk-color-secondary: #f060bb;
|
|
227
|
+
--ngxsmk-color-on-secondary: #ffffff;
|
|
228
|
+
--ngxsmk-color-secondary-hover: #f698d3;
|
|
229
|
+
--ngxsmk-color-secondary-active: #f9c2e5;
|
|
230
|
+
--ngxsmk-color-secondary-container: #750b4e;
|
|
231
|
+
--ngxsmk-color-on-secondary-container: #fce3f3;
|
|
200
232
|
--ngxsmk-color-background: #111112;
|
|
201
|
-
--ngxsmk-color-on-background: #
|
|
202
|
-
--ngxsmk-color-surface: #
|
|
203
|
-
--ngxsmk-color-on-surface: #
|
|
204
|
-
--ngxsmk-color-surface-variant: #
|
|
205
|
-
--ngxsmk-color-on-surface-variant: #
|
|
233
|
+
--ngxsmk-color-on-background: #dfe2e5;
|
|
234
|
+
--ngxsmk-color-surface: #1f1f22;
|
|
235
|
+
--ngxsmk-color-on-surface: #dfe2e5;
|
|
236
|
+
--ngxsmk-color-surface-variant: #28292c;
|
|
237
|
+
--ngxsmk-color-on-surface-variant: #aaafb5;
|
|
206
238
|
--ngxsmk-color-surface-hover: rgb(255 255 255 / 0.05);
|
|
207
239
|
--ngxsmk-color-surface-active: rgb(255 255 255 / 0.1);
|
|
208
|
-
--ngxsmk-color-surface-container: #
|
|
240
|
+
--ngxsmk-color-surface-container: #28292c;
|
|
209
241
|
--ngxsmk-color-outline: rgb(242 244 246 / 0.1);
|
|
210
|
-
--ngxsmk-color-outline-strong: #
|
|
242
|
+
--ngxsmk-color-outline-strong: #494d53;
|
|
211
243
|
--ngxsmk-color-outline-variant: rgb(242 244 246 / 0.06);
|
|
212
|
-
--ngxsmk-color-
|
|
244
|
+
--ngxsmk-color-surface-1: #1f1f22;
|
|
245
|
+
--ngxsmk-color-surface-2: #2a333b;
|
|
246
|
+
--ngxsmk-color-surface-3: #3a4650;
|
|
247
|
+
--ngxsmk-color-surface-4: #4e606f;
|
|
248
|
+
--ngxsmk-color-surface-5: #778593;
|
|
249
|
+
--ngxsmk-color-ring: #9560f0;
|
|
213
250
|
--ngxsmk-color-backdrop: rgb(17 17 18 / 0.6);
|
|
214
|
-
--ngxsmk-shadow-focus:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
--ngxsmk-color-tertiary
|
|
218
|
-
--ngxsmk-color-on-tertiary
|
|
219
|
-
--ngxsmk-color-
|
|
220
|
-
--ngxsmk-color-on-
|
|
221
|
-
--ngxsmk-color-success
|
|
222
|
-
--ngxsmk-color-on-success
|
|
223
|
-
--ngxsmk-color-
|
|
224
|
-
--ngxsmk-color-on-
|
|
225
|
-
--ngxsmk-color-warning
|
|
226
|
-
--ngxsmk-color-on-warning
|
|
227
|
-
--ngxsmk-color-
|
|
228
|
-
--ngxsmk-color-on-
|
|
229
|
-
--ngxsmk-color-error
|
|
230
|
-
--ngxsmk-color-on-error
|
|
231
|
-
--ngxsmk-color-
|
|
251
|
+
--ngxsmk-shadow-focus:
|
|
252
|
+
0 0 0 2px color-mix(in srgb, #9560f0 25%, transparent),
|
|
253
|
+
0 0 0 4px color-mix(in srgb, #9560f0 45%, transparent);
|
|
254
|
+
--ngxsmk-color-tertiary: #f060b2;
|
|
255
|
+
--ngxsmk-color-on-tertiary: #4b072d;
|
|
256
|
+
--ngxsmk-color-tertiary-container: #750b47;
|
|
257
|
+
--ngxsmk-color-on-tertiary-container: #fce3f1;
|
|
258
|
+
--ngxsmk-color-success: #61f07e;
|
|
259
|
+
--ngxsmk-color-on-success: #074a15;
|
|
260
|
+
--ngxsmk-color-success-container: #074a15;
|
|
261
|
+
--ngxsmk-color-on-success-container: #99f5ac;
|
|
262
|
+
--ngxsmk-color-warning: #f9d057;
|
|
263
|
+
--ngxsmk-color-on-warning: #4f3b03;
|
|
264
|
+
--ngxsmk-color-warning-container: #4f3b03;
|
|
265
|
+
--ngxsmk-color-on-warning-container: #fbe093;
|
|
266
|
+
--ngxsmk-color-error: #ee637a;
|
|
267
|
+
--ngxsmk-color-on-error: #4a0813;
|
|
268
|
+
--ngxsmk-color-error-container: #4a0813;
|
|
269
|
+
--ngxsmk-color-on-error-container: #f49aa9;
|
|
270
|
+
--ngxsmk-color-info: #529fff;
|
|
232
271
|
--ngxsmk-color-on-info: #002452;
|
|
233
272
|
--ngxsmk-color-info-container: #002452;
|
|
234
|
-
--ngxsmk-color-on-info-container: #
|
|
273
|
+
--ngxsmk-color-on-info-container: #8fc1ff;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@media (prefers-reduced-motion: reduce) {
|
|
277
|
+
:root {
|
|
278
|
+
--ngxsmk-motion-duration: 0ms;
|
|
279
|
+
}
|
|
235
280
|
}
|
package/types/ngxsmk-theme.d.ts
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Design token model for the NGXSMK universal theme engine.
|
|
5
|
-
*
|
|
6
|
-
* A `ThemeConfig` is the single source of truth for a theme. The token
|
|
7
|
-
* engine transforms it into platform outputs (CSS custom properties today;
|
|
8
|
-
* SCSS/Tailwind/JSON exporters build on the same model).
|
|
9
|
-
*/
|
|
10
|
-
/** An 11-step color scale, 50 (lightest) to 950 (darkest). */
|
|
11
|
-
interface ColorScale {
|
|
12
|
-
50: string;
|
|
13
|
-
100: string;
|
|
14
|
-
200: string;
|
|
15
|
-
300: string;
|
|
16
|
-
400: string;
|
|
17
|
-
500: string;
|
|
18
|
-
600: string;
|
|
19
|
-
700: string;
|
|
20
|
-
800: string;
|
|
21
|
-
900: string;
|
|
22
|
-
950: string;
|
|
23
|
-
}
|
|
24
|
-
type ColorScaleStep = keyof ColorScale;
|
|
25
|
-
/** Status colors used by alerts, badges, form validation, toasts. */
|
|
26
|
-
interface SemanticColors {
|
|
27
|
-
success: string;
|
|
28
|
-
warning: string;
|
|
29
|
-
error: string;
|
|
30
|
-
info: string;
|
|
31
|
-
}
|
|
32
|
-
interface FontFamilies {
|
|
33
|
-
sans: string;
|
|
34
|
-
mono: string;
|
|
35
|
-
}
|
|
36
|
-
/** A single typographic role (size + line height + weight). */
|
|
37
|
-
interface TypeStyle {
|
|
38
|
-
size: string;
|
|
39
|
-
lineHeight: string;
|
|
40
|
-
weight: string;
|
|
41
|
-
}
|
|
42
|
-
type TypeRoleSize = 'large' | 'medium' | 'small';
|
|
43
|
-
/** Material-inspired type roles: display, headline, title, body, label. */
|
|
44
|
-
interface TypographyScale {
|
|
45
|
-
display: Record<TypeRoleSize, TypeStyle>;
|
|
46
|
-
headline: Record<TypeRoleSize, TypeStyle>;
|
|
47
|
-
title: Record<TypeRoleSize, TypeStyle>;
|
|
48
|
-
body: Record<TypeRoleSize, TypeStyle>;
|
|
49
|
-
label: Record<TypeRoleSize, TypeStyle>;
|
|
50
|
-
}
|
|
51
|
-
type DarkModeStrategy = 'class' | 'media' | 'system';
|
|
52
|
-
type RadiusPreset = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
53
|
-
/** User-facing theme configuration. Everything except `brand` is optional. */
|
|
54
|
-
interface ThemeConfig {
|
|
55
|
-
/** Identifier used when registering multiple themes. */
|
|
56
|
-
name?: string;
|
|
57
|
-
brand: {
|
|
58
|
-
/** Brand color as hex (e.g. `#7C3AED`). A full 50–950 scale is derived. */
|
|
59
|
-
primary: string;
|
|
60
|
-
/** Optional pre-built scale; overrides derivation from `primary`. */
|
|
61
|
-
primaryScale?: ColorScale;
|
|
62
|
-
};
|
|
63
|
-
/** Neutral (gray) scale. Defaults to a balanced zinc-like scale. */
|
|
64
|
-
neutral?: ColorScale;
|
|
65
|
-
semantic?: Partial<SemanticColors>;
|
|
66
|
-
typography?: {
|
|
67
|
-
fontFamily?: Partial<FontFamilies>;
|
|
68
|
-
};
|
|
69
|
-
/** Global corner rounding character of the theme. Default `md`. */
|
|
70
|
-
borderRadius?: RadiusPreset;
|
|
71
|
-
/** How dark mode is activated. Default: `class` (a `.dark` class on `<html>`). */
|
|
72
|
-
darkMode?: {
|
|
73
|
-
strategy?: DarkModeStrategy;
|
|
74
|
-
/** Class name used by the `class` strategy. Default `dark`. */
|
|
75
|
-
className?: string;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Raw semantic-role token overrides merged into the generated output,
|
|
79
|
-
* e.g. `{ dark: { '--ngxsmk-color-primary': '#FAFAFA' } }`.
|
|
80
|
-
*/
|
|
81
|
-
overrides?: {
|
|
82
|
-
light?: Record<string, string>;
|
|
83
|
-
dark?: Record<string, string>;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
/** A fully resolved theme: config merged with defaults, scales derived. */
|
|
87
|
-
interface ResolvedTheme {
|
|
88
|
-
name: string;
|
|
89
|
-
/** The exact brand color from the config — light-mode primary. */
|
|
90
|
-
brandBase: string;
|
|
91
|
-
brand: ColorScale;
|
|
92
|
-
neutral: ColorScale;
|
|
93
|
-
semantic: SemanticColors;
|
|
94
|
-
fontFamily: FontFamilies;
|
|
95
|
-
typography: TypographyScale;
|
|
96
|
-
spacing: Record<string, string>;
|
|
97
|
-
radius: Record<string, string>;
|
|
98
|
-
radiusBase: RadiusPreset;
|
|
99
|
-
shadow: Record<string, string>;
|
|
100
|
-
duration: Record<string, string>;
|
|
101
|
-
easing: Record<string, string>;
|
|
102
|
-
/** Stacking layers emitted as `--ngxsmk-z-*`; overlays must share this ladder. */
|
|
103
|
-
zIndex: Record<string, string>;
|
|
104
|
-
darkMode: {
|
|
105
|
-
strategy: DarkModeStrategy;
|
|
106
|
-
className: string;
|
|
107
|
-
};
|
|
108
|
-
overrides: {
|
|
109
|
-
light: Record<string, string>;
|
|
110
|
-
dark: Record<string, string>;
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/** HSL triple: h in [0,360), s and l in [0,100]. */
|
|
115
|
-
interface Hsl {
|
|
116
|
-
h: number;
|
|
117
|
-
s: number;
|
|
118
|
-
l: number;
|
|
119
|
-
}
|
|
120
|
-
declare function hexToHsl(hex: string): Hsl;
|
|
121
|
-
declare function hslToHex({ h, s, l }: Hsl): string;
|
|
122
|
-
/** Shift a color's lightness by `delta` percentage points (clamped 0–100). */
|
|
123
|
-
declare function shiftLightness(hex: string, delta: number): string;
|
|
124
|
-
/** Rotate a color's hue by `degrees`, keeping saturation and lightness. */
|
|
125
|
-
declare function rotateHue(hex: string, degrees: number): string;
|
|
126
|
-
/**
|
|
127
|
-
* Derive a full 50–950 color scale from a single brand hex.
|
|
128
|
-
*
|
|
129
|
-
* The input color keeps its exact value at the step whose lightness stop is
|
|
130
|
-
* nearest to the input's own lightness, so `scale[step]` round-trips brand
|
|
131
|
-
* colors instead of shifting them.
|
|
132
|
-
*/
|
|
133
|
-
declare function deriveScale(baseHex: string): ColorScale;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Cool blue-grey neutral scale matching the Astryx (Meta) design language.
|
|
137
|
-
* Light steps carry a subtle blue tint; the darkest steps flatten toward
|
|
138
|
-
* a near-neutral charcoal so dark-mode surfaces read like Astryx's
|
|
139
|
-
* (#111112 body / #1F1F22 card) rather than a saturated navy.
|
|
140
|
-
*/
|
|
141
|
-
declare const DEFAULT_NEUTRAL: ColorScale;
|
|
142
|
-
declare const DEFAULT_SEMANTIC: SemanticColors;
|
|
143
|
-
declare const DEFAULT_FONT_FAMILY: FontFamilies;
|
|
144
|
-
declare const DEFAULT_TYPOGRAPHY: TypographyScale;
|
|
145
|
-
/**
|
|
146
|
-
* Standard height for single-line text controls (input, select, number-input,
|
|
147
|
-
* combobox, input-group, power-search, multi-select). All controls in the
|
|
148
|
-
* family use this so they read as one consistent size.
|
|
149
|
-
*/
|
|
150
|
-
declare const CONTROL_HEIGHT = "2.5rem";
|
|
151
|
-
declare const SPACING: Record<string, string>;
|
|
152
|
-
/**
|
|
153
|
-
* Astryx radius scale: inner 4px, element 8px (buttons/inputs, the base),
|
|
154
|
-
* container 12px (cards), then progressively larger through 28px "page"
|
|
155
|
-
* rounding. Deliberately generous — Astryx reads soft and rounded.
|
|
156
|
-
*/
|
|
157
|
-
declare const RADIUS: Record<string, string>;
|
|
158
|
-
/**
|
|
159
|
-
* Soft, diffuse, layered shadows in the Astryx style (two stacked blurs,
|
|
160
|
-
* low alpha). Overlay CSS resolves these to slightly stronger values in
|
|
161
|
-
* dark mode via the elevation tokens on each surface.
|
|
162
|
-
*/
|
|
163
|
-
declare const SHADOW: Record<string, string>;
|
|
164
|
-
/**
|
|
165
|
-
* Stacking ladder for overlay components. Anchored popups sit lowest;
|
|
166
|
-
* tooltips always win. Components must use these instead of ad-hoc values
|
|
167
|
-
* so overlays never fight each other.
|
|
168
|
-
*/
|
|
169
|
-
declare const Z_INDEX: Record<string, string>;
|
|
170
|
-
declare const DURATION: Record<string, string>;
|
|
171
|
-
declare const EASING: Record<string, string>;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Identity helper that gives `ngxsmk.config.ts` files full type inference:
|
|
175
|
-
*
|
|
176
|
-
* ```ts
|
|
177
|
-
* import { defineConfig } from '@ngxsmk/theme';
|
|
178
|
-
* export default defineConfig({ brand: { primary: '#7C3AED' } });
|
|
179
|
-
* ```
|
|
180
|
-
*/
|
|
181
|
-
declare function defineConfig(config: ThemeConfig): ThemeConfig;
|
|
182
|
-
/** Merge a user config with defaults and derive all color scales. */
|
|
183
|
-
declare function resolveTheme(config: ThemeConfig): ResolvedTheme;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Transform a theme config into a CSS stylesheet of `--ngxsmk-*` custom
|
|
187
|
-
* properties. Emits static tokens plus light-mode roles on `:root`, and
|
|
188
|
-
* dark-mode roles according to the configured dark-mode strategy.
|
|
189
|
-
*/
|
|
190
|
-
declare function buildThemeCss(config: ThemeConfig | ResolvedTheme): string;
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Default preset: Astryx (Meta) blue. Light-mode primary is the exact
|
|
194
|
-
* Astryx accent (#0064E0); dark mode brightens it to #2694FE via the
|
|
195
|
-
* scale, matching astryx.atmeta.com.
|
|
196
|
-
*/
|
|
197
|
-
declare const astryxPreset: ThemeConfig;
|
|
198
|
-
/** Retained alias so existing violet-themed demos keep working. */
|
|
199
|
-
declare const violetPreset: ThemeConfig;
|
|
200
|
-
/** Monochrome preset in the spirit of shadcn/ui's default look. */
|
|
201
|
-
declare const neutralPreset: ThemeConfig;
|
|
202
|
-
declare const emeraldPreset: ThemeConfig;
|
|
203
|
-
declare const rosePreset: ThemeConfig;
|
|
204
|
-
declare const presets: Record<string, ThemeConfig>;
|
|
205
|
-
|
|
206
|
-
type ThemeMode = 'light' | 'dark' | 'system';
|
|
207
|
-
/**
|
|
208
|
-
* Runtime theme control: dark-mode switching (class strategy) and dynamic
|
|
209
|
-
* theme application by injecting generated token CSS into the document.
|
|
210
|
-
*
|
|
211
|
-
* SSR-safe: all DOM access goes through the injected document and degrades
|
|
212
|
-
* gracefully when `window`/`matchMedia` are unavailable.
|
|
213
|
-
*/
|
|
214
|
-
declare class NgxsmkThemeService {
|
|
215
|
-
private readonly document;
|
|
216
|
-
/** User preference: explicit light/dark or follow the OS. */
|
|
217
|
-
readonly mode: _angular_core.WritableSignal<ThemeMode>;
|
|
218
|
-
private readonly systemDark;
|
|
219
|
-
/** Effective darkness after resolving `system` against the OS setting. */
|
|
220
|
-
readonly isDark: _angular_core.Signal<boolean>;
|
|
221
|
-
constructor();
|
|
222
|
-
setMode(mode: ThemeMode): void;
|
|
223
|
-
toggle(): void;
|
|
224
|
-
/**
|
|
225
|
-
* Apply a theme at runtime. Generates token CSS from the config and swaps
|
|
226
|
-
* it into a dedicated `<style>` element, overriding the build-time theme.
|
|
227
|
-
*/
|
|
228
|
-
applyTheme(config: ThemeConfig): void;
|
|
229
|
-
/** Remove a runtime-applied theme, falling back to the build-time CSS. */
|
|
230
|
-
clearTheme(): void;
|
|
231
|
-
private restoreMode;
|
|
232
|
-
private matchSystemDark;
|
|
233
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxsmkThemeService, never>;
|
|
234
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NgxsmkThemeService>;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export { CONTROL_HEIGHT, DEFAULT_FONT_FAMILY, DEFAULT_NEUTRAL, DEFAULT_SEMANTIC, DEFAULT_TYPOGRAPHY, DURATION, EASING, NgxsmkThemeService, RADIUS, SHADOW, SPACING, Z_INDEX, astryxPreset, buildThemeCss, defineConfig, deriveScale, emeraldPreset, hexToHsl, hslToHex, neutralPreset, presets, resolveTheme, rosePreset, rotateHue, shiftLightness, violetPreset };
|
|
238
|
-
export type { ColorScale, ColorScaleStep, DarkModeStrategy, FontFamilies, Hsl, RadiusPreset, ResolvedTheme, SemanticColors, ThemeConfig, ThemeMode, TypeRoleSize, TypeStyle, TypographyScale };
|