@filip.mazev/blocks 1.4.3 → 1.4.4

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 (52) hide show
  1. package/README.md +1 -1
  2. package/_index.scss +1 -1
  3. package/core/styles/_field-state.scss +16 -4
  4. package/core/styles/_index.scss +0 -1
  5. package/core/styles/_mixins.scss +2 -2
  6. package/core/styles/_motion.scss +1 -1
  7. package/core/styles/_palettes.scss +127 -132
  8. package/core/styles/_slider.scss +158 -40
  9. package/core/styles/_theme-engine.scss +43 -63
  10. package/core/styles/_utilities.scss +3 -4
  11. package/core/styles/_validation.scss +6 -1
  12. package/core/styles/_variables.scss +24 -14
  13. package/core/styles/themes/_cyberpunk-theme.scss +1 -1
  14. package/core/styles/themes/_green-theme.scss +1 -1
  15. package/core/styles/themes/_high-contrast-theme.scss +152 -133
  16. package/core/styles/themes/_orange-theme.scss +1 -1
  17. package/core/styles/themes/_purple-theme.scss +1 -1
  18. package/core/styles/themes/_red-theme.scss +1 -1
  19. package/core/styles/themes/_white-theme.scss +26 -20
  20. package/effects/README.md +5 -9
  21. package/effects/effects.css +200 -121
  22. package/effects/runtime/README.md +19 -11
  23. package/fesm2022/filip.mazev-blocks-core.mjs +27 -22
  24. package/fesm2022/filip.mazev-blocks-core.mjs.map +1 -1
  25. package/fesm2022/filip.mazev-blocks-effects-runtime.mjs +887 -67
  26. package/fesm2022/filip.mazev-blocks-effects-runtime.mjs.map +1 -1
  27. package/fesm2022/filip.mazev-blocks-effects.mjs +8 -48
  28. package/fesm2022/filip.mazev-blocks-effects.mjs.map +1 -1
  29. package/fesm2022/filip.mazev-blocks-forms.mjs +65 -61
  30. package/fesm2022/filip.mazev-blocks-forms.mjs.map +1 -1
  31. package/fesm2022/filip.mazev-blocks-modal.mjs +29 -32
  32. package/fesm2022/filip.mazev-blocks-modal.mjs.map +1 -1
  33. package/fesm2022/filip.mazev-blocks-navigation.mjs +35 -1
  34. package/fesm2022/filip.mazev-blocks-navigation.mjs.map +1 -1
  35. package/fesm2022/filip.mazev-blocks-primitives.mjs +106 -32
  36. package/fesm2022/filip.mazev-blocks-primitives.mjs.map +1 -1
  37. package/fesm2022/filip.mazev-blocks-toastr.mjs +5 -7
  38. package/fesm2022/filip.mazev-blocks-toastr.mjs.map +1 -1
  39. package/fesm2022/filip.mazev-blocks.mjs +1 -1
  40. package/fesm2022/filip.mazev-blocks.mjs.map +1 -1
  41. package/navigation/README.md +44 -0
  42. package/package.json +1 -1
  43. package/schematics/ng-add/index.js +4 -1
  44. package/types/filip.mazev-blocks-core.d.ts +3 -4
  45. package/types/filip.mazev-blocks-effects-runtime.d.ts +10 -8
  46. package/types/filip.mazev-blocks-effects.d.ts +5 -17
  47. package/types/filip.mazev-blocks-forms.d.ts +13 -11
  48. package/types/filip.mazev-blocks-modal.d.ts +1 -0
  49. package/types/filip.mazev-blocks-navigation.d.ts +21 -5
  50. package/types/filip.mazev-blocks-primitives.d.ts +10 -0
  51. package/types/filip.mazev-blocks-toastr.d.ts +4 -4
  52. package/types/filip.mazev-blocks.d.ts +1 -1
@@ -13,13 +13,11 @@ $required-theme-keys: (
13
13
  'bg-neutral',
14
14
  'bg-neutral-hover',
15
15
  'bg-neutral-active',
16
-
17
16
  'primary',
18
17
  'primary-hover',
19
18
  'primary-active',
20
19
  'primary-subtle',
21
20
  'on-primary',
22
-
23
21
  'text-heading',
24
22
  'text-primary',
25
23
  'text-secondary',
@@ -29,7 +27,6 @@ $required-theme-keys: (
29
27
  'text-warn',
30
28
  'text-success',
31
29
  'text-danger',
32
-
33
30
  'border-subtle',
34
31
  'border-default',
35
32
  'border-strong',
@@ -38,35 +35,29 @@ $required-theme-keys: (
38
35
  'border-success',
39
36
  'border-warn',
40
37
  'border-danger',
41
-
42
38
  'bg-info',
43
39
  'bg-info-hover',
44
40
  'bg-info-active',
45
41
  'bg-info-disabled',
46
42
  'bg-info-subtle',
47
-
48
43
  'bg-success',
49
44
  'bg-success-hover',
50
45
  'bg-success-active',
51
46
  'bg-success-disabled',
52
47
  'bg-success-subtle',
53
-
54
48
  'bg-warn',
55
49
  'bg-warn-hover',
56
50
  'bg-warn-active',
57
51
  'bg-warn-disabled',
58
52
  'bg-warn-subtle',
59
-
60
53
  'bg-danger',
61
54
  'bg-danger-hover',
62
55
  'bg-danger-active',
63
56
  'bg-danger-disabled',
64
57
  'bg-danger-subtle',
65
-
66
58
  'scroll-bg',
67
59
  'scroll-thumb',
68
60
  'scroll-thumb-hover',
69
-
70
61
  'meta-brand-palette'
71
62
  );
72
63
 
@@ -78,7 +69,7 @@ $required-theme-keys: (
78
69
  }
79
70
 
80
71
  @each $key, $value in $theme {
81
- @if string.index($key, 'meta-') !=1 {
72
+ @if string.index($key, 'meta-') != 1 {
82
73
  @if not list.index($required-theme-keys, $key) {
83
74
  @error "Strict Theme Error: '#{$theme-name}' contains an invalid key '#{$key}'. Remove or rename it.";
84
75
  }
@@ -99,13 +90,11 @@ $required-theme-keys: (
99
90
  'bg-neutral': get-color-from-palette('neutral', 100),
100
91
  'bg-neutral-hover': get-color-from-palette('neutral', 50),
101
92
  'bg-neutral-active': get-color-from-palette('neutral', 200),
102
-
103
93
  'primary': get-color-from-palette($accent, 500),
104
94
  'primary-hover': get-color-from-palette($accent, 600),
105
95
  'primary-active': get-color-from-palette($accent, 700),
106
96
  'primary-subtle': rgba(get-color-from-palette($accent, 300), 0.6),
107
97
  'on-primary': get-color-from-palette('neutral', 100),
108
-
109
98
  'text-heading': get-color-from-palette('neutral', 900),
110
99
  'text-primary': get-color-from-palette('neutral', 700),
111
100
  'text-secondary': get-color-from-palette('neutral', 500),
@@ -115,7 +104,6 @@ $required-theme-keys: (
115
104
  'text-warn': get-color-from-palette('warn', 700),
116
105
  'text-success': get-color-from-palette('success', 700),
117
106
  'text-danger': get-color-from-palette('danger', 700),
118
-
119
107
  'border-subtle': get-color-from-palette('neutral', 200),
120
108
  'border-default': get-color-from-palette('neutral', 300),
121
109
  'border-strong': get-color-from-palette('neutral', 400),
@@ -124,41 +112,42 @@ $required-theme-keys: (
124
112
  'border-success': get-color-from-palette('success', 400),
125
113
  'border-warn': get-color-from-palette('warn', 400),
126
114
  'border-danger': get-color-from-palette('danger', 400),
127
-
128
115
  'bg-info': get-color-from-palette('information', 100),
129
116
  'bg-info-hover': get-color-from-palette('information', 200),
130
117
  'bg-info-active': get-color-from-palette('information', 300),
131
118
  'bg-info-disabled': get-color-from-palette('information', 50),
132
- 'bg-info-subtle': rgba(get-color-from-palette('information', 50), 0.95),
133
-
119
+ 'bg-info-subtle': rgb(get-color-from-palette('information', 50), 0.95),
134
120
  'bg-success': get-color-from-palette('success', 100),
135
121
  'bg-success-hover': get-color-from-palette('success', 200),
136
122
  'bg-success-active': get-color-from-palette('success', 300),
137
123
  'bg-success-disabled': get-color-from-palette('success', 50),
138
- 'bg-success-subtle': rgba(get-color-from-palette('success', 50), 0.95),
139
-
124
+ 'bg-success-subtle': rgb(get-color-from-palette('success', 50), 0.95),
140
125
  'bg-warn': get-color-from-palette('warn', 100),
141
126
  'bg-warn-hover': get-color-from-palette('warn', 200),
142
127
  'bg-warn-active': get-color-from-palette('warn', 300),
143
128
  'bg-warn-disabled': get-color-from-palette('warn', 50),
144
- 'bg-warn-subtle': rgba(get-color-from-palette('warn', 50), 0.95),
145
-
129
+ 'bg-warn-subtle': rgb(get-color-from-palette('warn', 50), 0.95),
146
130
  'bg-danger': get-color-from-palette('danger', 100),
147
131
  'bg-danger-hover': get-color-from-palette('danger', 200),
148
132
  'bg-danger-active': get-color-from-palette('danger', 300),
149
133
  'bg-danger-disabled': get-color-from-palette('danger', 50),
150
- 'bg-danger-subtle': rgba(get-color-from-palette('danger', 50), 0.95),
151
-
134
+ 'bg-danger-subtle': rgb(get-color-from-palette('danger', 50), 0.95),
152
135
  'scroll-bg': get-color-from-palette($surface-brand, 100),
153
- 'scroll-thumb': linear-gradient(278deg, get-color-from-palette($accent, 300) -10.44%, get-color-from-palette($accent, 400) 100%),
154
- 'scroll-thumb-hover': linear-gradient(278deg, get-color-from-palette($accent, 400) -10.44%, get-color-from-palette($accent, 700) 100%),
155
-
156
- 'meta-brand-palette': $accent
136
+ 'scroll-thumb': linear-gradient(
137
+ 278deg,
138
+ get-color-from-palette($accent, 300) -10.44%,
139
+ get-color-from-palette($accent, 400) 100%
140
+ ),
141
+ 'scroll-thumb-hover': linear-gradient(
142
+ 278deg,
143
+ get-color-from-palette($accent, 400) -10.44%,
144
+ get-color-from-palette($accent, 700) 100%
145
+ ),
146
+ 'meta-brand-palette': $accent,
157
147
  );
148
+ $merged-theme: map.merge($base, $overrides);
158
149
 
159
- $merged-theme: map.merge($base, $overrides);
160
-
161
- @return validate-theme($merged-theme, '#{$surface-brand}-#{$accent}-light');
150
+ @return validate-theme($merged-theme, '#{$surface-brand}-#{$accent}-light');
162
151
  }
163
152
 
164
153
  @function make-dark-theme($surface-brand, $accent: $surface-brand, $overrides: ()) {
@@ -172,7 +161,6 @@ $merged-theme: map.merge($base, $overrides);
172
161
  'bg-neutral': get-color-from-palette('neutral', 900),
173
162
  'bg-neutral-hover': get-color-from-palette('neutral', 800),
174
163
  'bg-neutral-active': get-color-from-palette('neutral', 600),
175
-
176
164
  'primary': get-color-from-palette($accent, 500),
177
165
  'primary-hover': get-color-from-palette($accent, 400),
178
166
  'primary-active': get-color-from-palette($accent, 300),
@@ -188,7 +176,6 @@ $merged-theme: map.merge($base, $overrides);
188
176
  'text-success': get-color-from-palette('success', 400),
189
177
  'text-warn': get-color-from-palette('warn', 400),
190
178
  'text-danger': get-color-from-palette('danger', 400),
191
-
192
179
  'border-subtle': get-color-from-palette('neutral', 900),
193
180
  'border-default': get-color-from-palette('neutral', 800),
194
181
  'border-strong': get-color-from-palette('neutral', 700),
@@ -197,41 +184,42 @@ $merged-theme: map.merge($base, $overrides);
197
184
  'border-success': get-color-from-palette('success', 400),
198
185
  'border-warn': get-color-from-palette('warn', 400),
199
186
  'border-danger': get-color-from-palette('danger', 400),
200
-
201
187
  'bg-info': get-color-from-palette('information', 900),
202
188
  'bg-info-hover': get-color-from-palette('information', 800),
203
189
  'bg-info-active': get-color-from-palette('information', 700),
204
190
  'bg-info-disabled': get-color-from-palette('information', 1000),
205
- 'bg-info-subtle': rgba(get-color-from-palette('information', 1000), 0.95),
206
-
191
+ 'bg-info-subtle': rgb(get-color-from-palette('information', 1000), 0.95),
207
192
  'bg-success': get-color-from-palette('success', 900),
208
193
  'bg-success-hover': get-color-from-palette('success', 800),
209
194
  'bg-success-active': get-color-from-palette('success', 700),
210
195
  'bg-success-disabled': get-color-from-palette('success', 1000),
211
- 'bg-success-subtle': rgba(get-color-from-palette('success', 1000), 0.95),
212
-
196
+ 'bg-success-subtle': rgb(get-color-from-palette('success', 1000), 0.95),
213
197
  'bg-warn': get-color-from-palette('warn', 900),
214
198
  'bg-warn-hover': get-color-from-palette('warn', 800),
215
199
  'bg-warn-active': get-color-from-palette('warn', 700),
216
200
  'bg-warn-disabled': get-color-from-palette('warn', 1000),
217
- 'bg-warn-subtle': rgba(get-color-from-palette('warn', 1000), 0.95),
218
-
201
+ 'bg-warn-subtle': rgb(get-color-from-palette('warn', 1000), 0.95),
219
202
  'bg-danger': get-color-from-palette('danger', 900),
220
203
  'bg-danger-hover': get-color-from-palette('danger', 800),
221
204
  'bg-danger-active': get-color-from-palette('danger', 700),
222
205
  'bg-danger-disabled': get-color-from-palette('danger', 1000),
223
- 'bg-danger-subtle': rgba(get-color-from-palette('danger', 1000), 0.95),
224
-
206
+ 'bg-danger-subtle': rgb(get-color-from-palette('danger', 1000), 0.95),
225
207
  'scroll-bg': get-color-from-palette($surface-brand, 900),
226
- 'scroll-thumb': linear-gradient(278deg, get-color-from-palette($accent, 700) -10.44%, get-color-from-palette($accent, 500) 100%),
227
- 'scroll-thumb-hover': linear-gradient(278deg, get-color-from-palette($accent, 500) -10.44%, get-color-from-palette($accent, 400) 100%),
228
-
229
- 'meta-brand-palette': $accent
208
+ 'scroll-thumb': linear-gradient(
209
+ 278deg,
210
+ get-color-from-palette($accent, 700) -10.44%,
211
+ get-color-from-palette($accent, 500) 100%
212
+ ),
213
+ 'scroll-thumb-hover': linear-gradient(
214
+ 278deg,
215
+ get-color-from-palette($accent, 500) -10.44%,
216
+ get-color-from-palette($accent, 400) 100%
217
+ ),
218
+ 'meta-brand-palette': $accent,
230
219
  );
220
+ $merged-theme: map.merge($base, $overrides);
231
221
 
232
- $merged-theme: map.merge($base, $overrides);
233
-
234
- @return validate-theme($merged-theme, '#{$surface-brand}-#{$accent}-dark');
222
+ @return validate-theme($merged-theme, '#{$surface-brand}-#{$accent}-dark');
235
223
  }
236
224
 
237
225
  @mixin bx-theme($config) {
@@ -240,12 +228,13 @@ $merged-theme: map.merge($base, $overrides);
240
228
  --bx-glass-text: var(--bx-text-primary);
241
229
  --bx-glass-edge: var(--bx-border-default);
242
230
  --bx-glass-accent: var(--bx-primary);
231
+
243
232
  @each $key, $value in $config {
244
- @if $key !='meta-brand-palette' {
233
+ @if $key != 'meta-brand-palette' {
245
234
  --bx-#{$key}: #{$value};
246
235
  }
247
236
 
248
- @if $key =='meta-brand-palette' {
237
+ @if $key == 'meta-brand-palette' {
249
238
  $brand-palette: get-palette($value);
250
239
 
251
240
  @each $shade, $color in $brand-palette {
@@ -256,31 +245,22 @@ $merged-theme: map.merge($base, $overrides);
256
245
  }
257
246
 
258
247
  @each $key in $required-theme-keys {
259
-
260
- @if string.index($key, 'bg-')==1 {
248
+ @if string.index($key, 'bg-') == 1 {
261
249
  .bx-#{$key} {
262
250
  background-color: var(--bx-#{$key});
263
251
  transition: background-color 0.2s ease-in-out;
264
252
  }
265
- }
266
-
267
- @else if string.index($key, 'text-')==1 {
253
+ } @else if string.index($key, 'text-') == 1 {
268
254
  .bx-#{$key} {
269
255
  color: var(--bx-#{$key});
270
256
  transition: color 0.2s ease-in-out;
271
257
  }
272
- }
273
-
274
- @else if string.index($key, 'border-')==1 {
258
+ } @else if string.index($key, 'border-') == 1 {
275
259
  .bx-#{$key} {
276
260
  border-color: var(--bx-#{$key});
277
261
  transition: border-color 0.2s ease-in-out;
278
262
  }
279
- }
280
-
281
- @else if string.index($key, 'scroll-')==1 {}
282
-
283
- @else {
263
+ } @else if not string.index($key, 'scroll-') {
284
264
  .bx-bg-#{$key} {
285
265
  background-color: var(--bx-#{$key});
286
266
  transition: background-color 0.2s ease-in-out;
@@ -296,4 +276,4 @@ $merged-theme: map.merge($base, $overrides);
296
276
  transition: border-color 0.2s ease-in-out;
297
277
  }
298
278
  }
299
- }
279
+ }
@@ -3,7 +3,6 @@
3
3
  @use 'variables' as *;
4
4
  @use 'palettes' as *;
5
5
 
6
-
7
6
  @each $key, $val in $spacing {
8
7
  .bx-p-#{$key} {
9
8
  padding: #{$val};
@@ -105,7 +104,7 @@
105
104
  }
106
105
 
107
106
  @each $palette-name, $shades in $all-palettes {
108
- @if meta.type-of($shades)=='map' {
107
+ @if meta.type-of($shades) == 'map' {
109
108
  @each $shade, $color in $shades {
110
109
  .bx-bg-#{$palette-name}-#{$shade} {
111
110
  background-color: var(--bx-color-#{$palette-name}-#{$shade});
@@ -140,7 +139,7 @@
140
139
  }
141
140
 
142
141
  @each $palette-name, $shades in $all-palettes {
143
- @if meta.type-of($shades)=='map' {
142
+ @if meta.type-of($shades) == 'map' {
144
143
  @each $shade, $color in $shades {
145
144
  --bx-color-#{$palette-name}-#{$shade}: #{$color};
146
145
  }
@@ -154,4 +153,4 @@
154
153
  .bx-icon-pos-end {
155
154
  margin-left: 0.5rem;
156
155
  }
157
- }
156
+ }
@@ -1,16 +1,21 @@
1
1
  @use 'field-state' as *;
2
+
2
3
  // A projected surface inside a form field receives the complete field material,
3
4
  // including its valid focus state, without application-specific effects CSS.
4
5
  .bx-field-control > :where([data-bx-surface]:not(button[bx-button], a[bx-button], bx-button)) {
5
6
  @include glass-field;
6
7
  }
8
+
7
9
  // Projected native controls receive the same error treatment as Blocks controls.
8
10
  .bx-field-wrapper.is-invalid > .bx-field-control > [data-bx-surface] {
9
11
  @include invalid-glass-field;
10
12
  }
13
+
11
14
  @media (forced-colors: active) {
12
- .bx-field-wrapper.is-invalid > .bx-field-control > [data-bx-surface], [data-bx-surface].is-invalid {
15
+ .bx-field-wrapper.is-invalid > .bx-field-control > [data-bx-surface],
16
+ [data-bx-surface].is-invalid {
13
17
  --bx-glass-shadow: none;
18
+
14
19
  border-color: Mark;
15
20
  outline-color: Mark;
16
21
  }
@@ -11,8 +11,7 @@ $spacing: (
11
11
  8: 2rem,
12
12
  10: 2.5rem,
13
13
  12: 3rem,
14
- ) !default;
15
-
14
+ ) !default;
16
15
  $radiuses: (
17
16
  none: 0,
18
17
  sm: 0.25rem,
@@ -22,16 +21,27 @@ $radiuses: (
22
21
  2xl: 1.5rem,
23
22
  3xl: 1.875rem,
24
23
  pill: 9999px,
25
- ) !default;
26
-
24
+ ) !default;
27
25
  $shadows: (
28
- sm: (0 2px 4px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)),
29
- md: (0 4px 8px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -2px rgba(0, 0, 0, 0.12)),
30
- lg: (0 12px 20px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1)),
31
- xl: (0 24px 32px -5px rgba(0, 0, 0, 0.25), 0 10px 12px -5px rgba(0, 0, 0, 0.15)),
32
- modal: 0 8px 20px rgba(0, 0, 0, 0.12),
33
- toast: 0 4px 12px rgba(0, 0, 0, 0.15)) !default;
34
-
26
+ sm: (
27
+ 0 2px 4px 0 rgb(0 0 0 / 10%),
28
+ 0 1px 2px -1px rgb(0 0 0 / 10%),
29
+ ),
30
+ md: (
31
+ 0 4px 8px -1px rgb(0 0 0 / 15%),
32
+ 0 2px 4px -2px rgb(0 0 0 / 12%),
33
+ ),
34
+ lg: (
35
+ 0 12px 20px -3px rgb(0 0 0 / 20%),
36
+ 0 4px 6px -2px rgb(0 0 0 / 10%),
37
+ ),
38
+ xl: (
39
+ 0 24px 32px -5px rgb(0 0 0 / 25%),
40
+ 0 10px 12px -5px rgb(0 0 0 / 15%),
41
+ ),
42
+ modal: 0 8px 20px rgb(0 0 0 / 12%),
43
+ toast: 0 4px 12px rgb(0 0 0 / 15%),
44
+ ) !default;
35
45
  $z-index: (
36
46
  base: 1,
37
47
  dropdown: 100,
@@ -41,8 +51,7 @@ $z-index: (
41
51
  popover: 500,
42
52
  tooltip: 600,
43
53
  toast: 9999,
44
- ) !default;
45
-
54
+ ) !default;
46
55
  $breakpoints: (
47
56
  xs: 360px,
48
57
 
@@ -54,4 +63,5 @@ $breakpoints: (
54
63
 
55
64
  2xl: 1536px,
56
65
  3xl: 1920px,
57
- 4xl: 2560px) !default;
66
+ 4xl: 2560px,
67
+ ) !default;
@@ -1,4 +1,4 @@
1
1
  @use '../theme-engine' as *;
2
2
 
3
3
  $cyberpunk-light-theme: make-light-theme('cyber-slate', 'cyber-yellow');
4
- $cyberpunk-dark-theme: make-dark-theme('cyber-slate', 'cyber-yellow');
4
+ $cyberpunk-dark-theme: make-dark-theme('cyber-slate', 'cyber-yellow');
@@ -1,4 +1,4 @@
1
1
  @use '../theme-engine' as *;
2
2
 
3
3
  $green-light-theme: make-light-theme('green');
4
- $green-dark-theme: make-dark-theme('green');
4
+ $green-dark-theme: make-dark-theme('green');