@filip.mazev/blocks 1.4.13 → 1.4.15

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.
Files changed (32) hide show
  1. package/README.md +5 -5
  2. package/core/styles/_a11y.scss +1 -1
  3. package/core/styles/_index.scss +3 -9
  4. package/core/styles/_palettes.scss +54 -10
  5. package/core/styles/themes/_azure-ember-theme.scss +4 -0
  6. package/core/styles/themes/_brick-rose-cyan-theme.scss +4 -0
  7. package/core/styles/themes/_carbon-cobalt-theme.scss +4 -0
  8. package/effects/effects.css +120 -8
  9. package/fesm2022/filip.mazev-blocks-core.mjs +20 -31
  10. package/fesm2022/filip.mazev-blocks-core.mjs.map +1 -1
  11. package/fesm2022/filip.mazev-blocks-effects-runtime.mjs +167 -46
  12. package/fesm2022/filip.mazev-blocks-effects-runtime.mjs.map +1 -1
  13. package/fesm2022/filip.mazev-blocks-forms.mjs +12 -12
  14. package/fesm2022/filip.mazev-blocks-forms.mjs.map +1 -1
  15. package/fesm2022/filip.mazev-blocks.mjs +1 -1
  16. package/fesm2022/filip.mazev-blocks.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/schematics/ng-add/index.d.ts +1 -10
  19. package/schematics/ng-add/index.js +4 -13
  20. package/schematics/ng-add/schema.json +11 -17
  21. package/types/filip.mazev-blocks-core.d.ts +4 -13
  22. package/types/filip.mazev-blocks-effects-runtime.d.ts +2 -0
  23. package/types/filip.mazev-blocks.d.ts +1 -1
  24. package/core/styles/themes/_azure-coral-theme.scss +0 -4
  25. package/core/styles/themes/_blue-theme.scss +0 -5
  26. package/core/styles/themes/_graphite-sky-blue-theme.scss +0 -19
  27. package/core/styles/themes/_green-theme.scss +0 -5
  28. package/core/styles/themes/_orange-theme.scss +0 -5
  29. package/core/styles/themes/_purple-theme.scss +0 -5
  30. package/core/styles/themes/_red-theme.scss +0 -5
  31. package/core/styles/themes/_scarlet-cyan-theme.scss +0 -4
  32. package/core/styles/themes/_white-theme.scss +0 -5
package/README.md CHANGED
@@ -18,7 +18,7 @@ ng add @filip.mazev/blocks
18
18
 
19
19
  When you run the command above, the Angular CLI will execute our custom schematic to handle the boilerplate for you:
20
20
 
21
- * Palette selection: Graphite / Sky Blue is the CLI default. Azure / Coral, Violet / Teal, Tangerine / Indigo, Scarlet / Cyan, Lime / Violet, and Cyberpunk are also available. Use `--theme=azure-coral` to select Azure / Coral.
21
+ * Palette selection: Carbon / Cobalt is the CLI default. Azure / Ember, Violet / Teal, Tangerine / Indigo, Brick Rose / Cyan, Lime / Violet, and Cyberpunk are also available. Use `--theme=azure-ember` to select Azure / Ember.
22
22
  * Dependency Management: Automatically adds the latest versions of the Blocks ecosystem to your package.json and runs npm install.
23
23
  * SCSS Injection: Intelligently locates your project's global stylesheet (styles.scss or styles.sass) and injects the required @use statements, mixins, and both light/dark mode CSS variables based on your theme selection.
24
24
 
@@ -37,11 +37,11 @@ Then, manually configure your styles.scss:
37
37
 
38
38
  @layer base {
39
39
  :root {
40
- @include bx-theme($graphite-sky-blue-light-theme);
40
+ @include bx-theme($carbon-cobalt-light-theme);
41
41
  }
42
42
 
43
43
  [data-theme='dark'] {
44
- @include bx-theme($graphite-sky-blue-dark-theme);
44
+ @include bx-theme($carbon-cobalt-dark-theme);
45
45
  }
46
46
  }
47
47
  ```
@@ -52,10 +52,10 @@ Then, manually configure your styles.scss:
52
52
  Use paired palette IDs consistently in the CLI and `ThemingService.setPalette()`. For example:
53
53
 
54
54
  ```sh
55
- ng add @filip.mazev/blocks --theme=azure-coral
55
+ ng add @filip.mazev/blocks --theme=azure-ember
56
56
  ```
57
57
 
58
- The Sass exports use the same names: `$azure-coral-light-theme` and `$azure-coral-dark-theme`. Graphite / Sky Blue is the installer default; the playground starts with Graphite / Sky Blue. Previous IDs and Sass names remain aliases.
58
+ The Sass exports use the same names: `$azure-ember-light-theme` and `$azure-ember-dark-theme`. Carbon / Cobalt is the installer default; the playground starts with Carbon / Cobalt. Only the current palette IDs and Sass names are supported.
59
59
 
60
60
  Buttons and tabs accept `color="accent"` for the second tone. Icons and custom components can use semantic tokens such as `text-accent`, `accent-subtle`, `on-accent`, and `border-accent`. Canvas backgrounds stay neutral; status roles keep their meaning. See [the palette reference](../../documentation/appearance/README.md#palettes) for all seven pairs.
61
61
 
@@ -16,7 +16,7 @@
16
16
  *::after {
17
17
  animation-duration: 0.01ms !important;
18
18
  animation-iteration-count: 1 !important;
19
- transition-duration: 0.01ms !important;
19
+ transition-duration: 0s !important;
20
20
  scroll-behavior: auto !important;
21
21
  }
22
22
  }
@@ -4,18 +4,12 @@
4
4
  @forward 'palettes';
5
5
  @forward 'theme-engine';
6
6
  @forward 'a11y';
7
- @forward 'themes/graphite-sky-blue-theme';
8
- @forward 'themes/azure-coral-theme';
7
+ @forward 'themes/carbon-cobalt-theme';
8
+ @forward 'themes/azure-ember-theme';
9
+ @forward 'themes/brick-rose-cyan-theme';
9
10
  @forward 'themes/violet-teal-theme';
10
11
  @forward 'themes/tangerine-indigo-theme';
11
- @forward 'themes/scarlet-cyan-theme';
12
12
  @forward 'themes/lime-violet-theme';
13
- @forward 'themes/white-theme';
14
- @forward 'themes/blue-theme';
15
- @forward 'themes/purple-theme';
16
- @forward 'themes/orange-theme';
17
- @forward 'themes/red-theme';
18
- @forward 'themes/green-theme';
19
13
  @forward 'themes/cyberpunk-theme';
20
14
  @forward 'themes/high-contrast-theme';
21
15
  @forward 'slider';
@@ -180,28 +180,72 @@ $hc-yellow: #e4d500;
180
180
  $hc-cyan: #00f3f3;
181
181
  $hc-red: #ff0000;
182
182
  $hc-green: #00ff00;
183
- $graphite-palette: _tonal-palette(#525252) !default;
184
- $sky-blue-palette: _tonal-palette(#38bdf8) !default;
185
- $azure-palette: $blue-palette !default;
186
- $coral-palette: _tonal-palette(#f87763) !default;
183
+
184
+ // Tune the upper tones explicitly so dark actions retain their color character.
185
+ $carbon-palette: map.merge(
186
+ _tonal-palette(#292a2d),
187
+ (
188
+ 50: #fdfdfc,
189
+ 100: #f7f7f5,
190
+ 200: #efefed,
191
+ 300: #e2e2e0,
192
+ 400: #77797d,
193
+ )
194
+ ) !default;
195
+ $cobalt-palette: map.merge(
196
+ _tonal-palette(#356fe8),
197
+ (
198
+ 200: #abc5ff,
199
+ 300: #6d9aff,
200
+ 400: #4c82f2,
201
+ )
202
+ ) !default;
203
+ $ember-palette: map.merge(
204
+ _tonal-palette(#d85a1a),
205
+ (
206
+ 200: #f5a365,
207
+ 300: #f27b35,
208
+ 400: #e96926,
209
+ )
210
+ ) !default;
211
+ $brick-rose-palette: map.merge(
212
+ _tonal-palette(#b64a50),
213
+ (
214
+ 200: #e69ba4,
215
+ 300: #d36b77,
216
+ 400: #c55964,
217
+ )
218
+ ) !default;
219
+ $azure-palette: map.merge(
220
+ $blue-palette,
221
+ (
222
+ 300: #72a7ff,
223
+ )
224
+ ) !default;
187
225
  $violet-palette: $purple-palette !default;
188
226
  $teal-palette: _tonal-palette(#0d9488) !default;
189
227
  $tangerine-palette: $orange-palette !default;
190
228
  $indigo-palette: _tonal-palette(#4f78f5) !default;
191
- $scarlet-palette: $red-palette !default;
192
- $cyan-palette: _tonal-palette(#0891b2) !default;
229
+ $cyan-palette: map.merge(
230
+ _tonal-palette(#0891b2),
231
+ (
232
+ 200: #78d8e6,
233
+ 300: #22b8d0,
234
+ 400: #12a4bf,
235
+ )
236
+ ) !default;
193
237
  $lime-palette: _tonal-palette(#c4f53d) !default;
194
238
  $cool-violet-palette: _tonal-palette(#6842a6) !default;
195
239
  $all-palettes: (
196
- 'graphite': $graphite-palette,
197
- 'sky-blue': $sky-blue-palette,
240
+ 'carbon': $carbon-palette,
241
+ 'cobalt': $cobalt-palette,
242
+ 'ember': $ember-palette,
243
+ 'brick-rose': $brick-rose-palette,
198
244
  'azure': $azure-palette,
199
- 'coral': $coral-palette,
200
245
  'violet': $violet-palette,
201
246
  'teal': $teal-palette,
202
247
  'tangerine': $tangerine-palette,
203
248
  'indigo': $indigo-palette,
204
- 'scarlet': $scarlet-palette,
205
249
  'cyan': $cyan-palette,
206
250
  'lime': $lime-palette,
207
251
  'cool-violet': $cool-violet-palette,
@@ -0,0 +1,4 @@
1
+ @use '../theme-engine' as *;
2
+
3
+ $azure-ember-light-theme: make-light-theme('azure', 'ember');
4
+ $azure-ember-dark-theme: make-dark-theme('azure', 'ember');
@@ -0,0 +1,4 @@
1
+ @use '../theme-engine' as *;
2
+
3
+ $brick-rose-cyan-light-theme: make-light-theme('brick-rose', 'cyan');
4
+ $brick-rose-cyan-dark-theme: make-dark-theme('brick-rose', 'cyan');
@@ -0,0 +1,4 @@
1
+ @use '../theme-engine' as *;
2
+
3
+ $carbon-cobalt-light-theme: make-light-theme('carbon', 'cobalt');
4
+ $carbon-cobalt-dark-theme: make-dark-theme('carbon', 'cobalt');
@@ -76,6 +76,126 @@
76
76
  pointer-events: none;
77
77
  }
78
78
 
79
+ @property --bx-glass-environment-color-0 {
80
+ syntax: '<color>';
81
+ inherits: false;
82
+ initial-value: transparent;
83
+ }
84
+
85
+ @property --bx-glass-environment-color-1 {
86
+ syntax: '<color>';
87
+ inherits: false;
88
+ initial-value: transparent;
89
+ }
90
+
91
+ @property --bx-glass-environment-color-2 {
92
+ syntax: '<color>';
93
+ inherits: false;
94
+ initial-value: transparent;
95
+ }
96
+
97
+ @property --bx-glass-environment-color-3 {
98
+ syntax: '<color>';
99
+ inherits: false;
100
+ initial-value: transparent;
101
+ }
102
+
103
+ @property --bx-glass-environment-color-4 {
104
+ syntax: '<color>';
105
+ inherits: false;
106
+ initial-value: transparent;
107
+ }
108
+
109
+ @property --bx-glass-environment-color-5 {
110
+ syntax: '<color>';
111
+ inherits: false;
112
+ initial-value: transparent;
113
+ }
114
+
115
+ @property --bx-glass-environment-color-6 {
116
+ syntax: '<color>';
117
+ inherits: false;
118
+ initial-value: transparent;
119
+ }
120
+
121
+ @property --bx-glass-environment-color-7 {
122
+ syntax: '<color>';
123
+ inherits: false;
124
+ initial-value: transparent;
125
+ }
126
+
127
+ @property --bx-glass-environment-color-8 {
128
+ syntax: '<color>';
129
+ inherits: false;
130
+ initial-value: transparent;
131
+ }
132
+
133
+ @property --bx-glass-environment-color-9 {
134
+ syntax: '<color>';
135
+ inherits: false;
136
+ initial-value: transparent;
137
+ }
138
+
139
+ @property --bx-glass-environment-color-10 {
140
+ syntax: '<color>';
141
+ inherits: false;
142
+ initial-value: transparent;
143
+ }
144
+
145
+ @property --bx-glass-environment-color-11 {
146
+ syntax: '<color>';
147
+ inherits: false;
148
+ initial-value: transparent;
149
+ }
150
+
151
+ @property --bx-glass-environment-color-12 {
152
+ syntax: '<color>';
153
+ inherits: false;
154
+ initial-value: transparent;
155
+ }
156
+
157
+ @property --bx-glass-environment-color-13 {
158
+ syntax: '<color>';
159
+ inherits: false;
160
+ initial-value: transparent;
161
+ }
162
+
163
+ @property --bx-glass-environment-color-14 {
164
+ syntax: '<color>';
165
+ inherits: false;
166
+ initial-value: transparent;
167
+ }
168
+
169
+ @property --bx-glass-environment-color-15 {
170
+ syntax: '<color>';
171
+ inherits: false;
172
+ initial-value: transparent;
173
+ }
174
+
175
+ .bx-glass-environment {
176
+ transition:
177
+ --bx-glass-environment-color-0 64ms linear,
178
+ --bx-glass-environment-color-1 64ms linear,
179
+ --bx-glass-environment-color-2 64ms linear,
180
+ --bx-glass-environment-color-3 64ms linear,
181
+ --bx-glass-environment-color-4 64ms linear,
182
+ --bx-glass-environment-color-5 64ms linear,
183
+ --bx-glass-environment-color-6 64ms linear,
184
+ --bx-glass-environment-color-7 64ms linear,
185
+ --bx-glass-environment-color-8 64ms linear,
186
+ --bx-glass-environment-color-9 64ms linear,
187
+ --bx-glass-environment-color-10 64ms linear,
188
+ --bx-glass-environment-color-11 64ms linear,
189
+ --bx-glass-environment-color-12 64ms linear,
190
+ --bx-glass-environment-color-13 64ms linear,
191
+ --bx-glass-environment-color-14 64ms linear,
192
+ --bx-glass-environment-color-15 64ms linear;
193
+ }
194
+
195
+ [data-bx-reduced-motion="true"] > .bx-glass-rim > .bx-glass-environment {
196
+ transition: none;
197
+ }
198
+
79
199
  .bx-glass-rim {
80
200
  position: absolute;
81
201
  /* The runtime aligns this box with the host's border, including asymmetric borders. */
@@ -89,14 +209,6 @@
89
209
  opacity: var(--bx-glass-rim-visibility, 1);
90
210
  }
91
211
 
92
- .bx-glass-environment {
93
- transition: opacity 180ms ease-out;
94
- }
95
-
96
- [data-bx-reduced-motion="true"] > .bx-glass-rim > .bx-glass-environment {
97
- transition: none;
98
- }
99
-
100
212
  @supports (-webkit-mask-composite: xor) {
101
213
  .bx-glass-rim {
102
214
  display: block;
@@ -348,26 +348,18 @@ const DEFAULT_APPEARANCE_CONFIG = Object.freeze({
348
348
  quality: "auto",
349
349
  reducedTransparency: false
350
350
  });
351
- const LEGACY_THEME_IDS = {
352
- white: "graphite-sky-blue",
353
- blue: "azure-coral",
354
- purple: "violet-teal",
355
- orange: "tangerine-indigo",
356
- red: "scarlet-cyan",
357
- green: "lime-violet"
358
- };
359
351
  const THEME_PALETTES = [
360
352
  {
361
- id: "graphite-sky-blue",
362
- label: "Graphite / Sky Blue",
363
- className: "theme-graphite-sky-blue",
364
- colors: ["#525252", "#38bdf8"]
353
+ id: "carbon-cobalt",
354
+ label: "Carbon / Cobalt",
355
+ className: "theme-carbon-cobalt",
356
+ colors: ["#292a2d", "#356fe8"]
365
357
  },
366
358
  {
367
- id: "azure-coral",
368
- label: "Azure / Coral",
369
- className: "theme-azure-coral",
370
- colors: ["#217eff", "#f87763"]
359
+ id: "azure-ember",
360
+ label: "Azure / Ember",
361
+ className: "theme-azure-ember",
362
+ colors: ["#217eff", "#d85a1a"]
371
363
  },
372
364
  {
373
365
  id: "violet-teal",
@@ -382,10 +374,10 @@ const THEME_PALETTES = [
382
374
  colors: ["#ff6900", "#4f78f5"]
383
375
  },
384
376
  {
385
- id: "scarlet-cyan",
386
- label: "Scarlet / Cyan",
387
- className: "theme-scarlet-cyan",
388
- colors: ["#e3241b", "#0891b2"]
377
+ id: "brick-rose-cyan",
378
+ label: "Brick Rose / Cyan",
379
+ className: "theme-brick-rose-cyan",
380
+ colors: ["#b64a50", "#0891b2"]
389
381
  },
390
382
  {
391
383
  id: "lime-violet",
@@ -401,9 +393,7 @@ const THEME_PALETTES = [
401
393
  }
402
394
  ];
403
395
  function resolveThemeId(value) {
404
- const palette = THEME_PALETTES.find((item) => item.id === value);
405
- if (palette) return palette.id;
406
- if (value && Object.prototype.hasOwnProperty.call(LEGACY_THEME_IDS, value)) return LEGACY_THEME_IDS[value];
396
+ return THEME_PALETTES.find((item) => item.id === value)?.id;
407
397
  }
408
398
  var BxA11yService = class BxA11yService {
409
399
  document = inject(DOCUMENT$1);
@@ -477,7 +467,7 @@ var ThemingService = class ThemingService {
477
467
  _appearance = signal({ ...DEFAULT_APPEARANCE_CONFIG }, ...ngDevMode ? [{ debugName: "_appearance" }] : /* istanbul ignore next */ []);
478
468
  appearance = this._appearance.asReadonly();
479
469
  palettes = THEME_PALETTES;
480
- _palette = signal("graphite-sky-blue", ...ngDevMode ? [{ debugName: "_palette" }] : /* istanbul ignore next */ []);
470
+ _palette = signal("carbon-cobalt", ...ngDevMode ? [{ debugName: "_palette" }] : /* istanbul ignore next */ []);
481
471
  palette = this._palette.asReadonly();
482
472
  paletteLabel = computed(() => this.palettes.find((item) => item.id === this.palette())?.label ?? this.palettes[0].label, ...ngDevMode ? [{ debugName: "paletteLabel" }] : /* istanbul ignore next */ []);
483
473
  _highContrast = signal(false, ...ngDevMode ? [{ debugName: "_highContrast" }] : /* istanbul ignore next */ []);
@@ -505,7 +495,7 @@ var ThemingService = class ThemingService {
505
495
  this.restoreAppearance();
506
496
  const palette = this.readStored("theme-palette");
507
497
  const storedHighContrast = this.readStored("theme-high-contrast");
508
- this.setPalette(resolveThemeId(palette) ?? "graphite-sky-blue");
498
+ this.setPalette(resolveThemeId(palette) ?? "carbon-cobalt");
509
499
  this.setHighContrast(storedHighContrast === null ? palette === "high-contrast" : storedHighContrast === "true");
510
500
  this.appearanceController = configureAppearance(this.document.documentElement, {
511
501
  ...this.appearance(),
@@ -527,7 +517,6 @@ var ThemingService = class ThemingService {
527
517
  const id = resolveThemeId(palette);
528
518
  if (!id) return;
529
519
  this._palette.set(id);
530
- for (const legacy of Object.keys(LEGACY_THEME_IDS)) this.document.documentElement.classList.remove(`theme-${legacy}`);
531
520
  for (const item of this.palettes) this.document.documentElement.classList.toggle(item.className, item.id === id);
532
521
  if (this.isBrowser) this.writeStored("theme-palette", id);
533
522
  }
@@ -999,15 +988,15 @@ const SCROLL_LOCK_INSTANCE_IDENTIFIER = "scroll_lock_instance_";
999
988
  const PALETTE_NAMES = [
1000
989
  "primary",
1001
990
  "accent",
1002
- "graphite",
1003
- "sky-blue",
991
+ "carbon",
992
+ "cobalt",
993
+ "ember",
994
+ "brick-rose",
1004
995
  "azure",
1005
- "coral",
1006
996
  "violet",
1007
997
  "teal",
1008
998
  "tangerine",
1009
999
  "indigo",
1010
- "scarlet",
1011
1000
  "cyan",
1012
1001
  "lime",
1013
1002
  "cool-violet",
@@ -1282,6 +1271,6 @@ function trackOverlayOrigin(overlay, origin) {
1282
1271
  host.classList.remove("bx-overlay-tracked");
1283
1272
  };
1284
1273
  }
1285
- export { BREAKPOINTS, BX_I18N, BxA11yService, BxBaseControl, BxOverlayPositionService, BxShortcutService, DEFAULT_APPEARANCE_CONFIG, DEFAULT_DEBOUNCE_TIME, DesktopOS, DeviceTypeService, FALLBACK_COLOR, LEGACY_THEME_IDS, MobileOS, PALETTE_NAMES, SCROLL_LOCK_INSTANCE_IDENTIFIER, SEMANTIC_PAIRS, SHADE_NUMBERS, ScrollLockService, THEME_PALETTES, TOKEN_COLOR_DELIMITER, TOKEN_DELIMITER, TOKEN_PREFIX, ThemingService, WindowDimensionsService, getComplementaryToken, inheritOverlayTheme, invertPaletteToken, isOSShortcut, isPaletteToken, isTextWithKey, isThemedColor, resolveThemeId, resolveTokenToCssVar, trackOverlayOrigin, uuidv4 };
1274
+ export { BREAKPOINTS, BX_I18N, BxA11yService, BxBaseControl, BxOverlayPositionService, BxShortcutService, DEFAULT_APPEARANCE_CONFIG, DEFAULT_DEBOUNCE_TIME, DesktopOS, DeviceTypeService, FALLBACK_COLOR, MobileOS, PALETTE_NAMES, SCROLL_LOCK_INSTANCE_IDENTIFIER, SEMANTIC_PAIRS, SHADE_NUMBERS, ScrollLockService, THEME_PALETTES, TOKEN_COLOR_DELIMITER, TOKEN_DELIMITER, TOKEN_PREFIX, ThemingService, WindowDimensionsService, getComplementaryToken, inheritOverlayTheme, invertPaletteToken, isOSShortcut, isPaletteToken, isTextWithKey, isThemedColor, resolveThemeId, resolveTokenToCssVar, trackOverlayOrigin, uuidv4 };
1286
1275
 
1287
1276
  //# sourceMappingURL=filip.mazev-blocks-core.mjs.map