@carbon/themes 10.41.0-rc.0 → 10.43.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.
@@ -20,6 +20,9 @@ $fallback: themes.$white !default;
20
20
  $theme: () !default;
21
21
  $theme: map.merge($fallback, $theme);
22
22
 
23
+ /// Local component tokens that can be updated with `@mixin add-component-tokens`.
24
+ $-component-tokens: ();
25
+
23
26
  /// Include the CSS Custom Properties for the active theme or a given theme on
24
27
  /// a selector
25
28
  @mixin theme($active-theme: $theme, $component-tokens...) {
@@ -32,6 +35,13 @@ $theme: map.merge($fallback, $theme);
32
35
  @include -custom-property($token, $value);
33
36
  }
34
37
  }
38
+
39
+ @each $token, $value in $-component-tokens {
40
+ @include -custom-property(
41
+ $token,
42
+ -resolve-token-value($active-theme, $value)
43
+ );
44
+ }
35
45
  }
36
46
 
37
47
  /// Retrieve the value for the given $token from the current $theme
@@ -43,6 +53,56 @@ $theme: map.merge($fallback, $theme);
43
53
  @error "Unable to find token: #{$token} in current $theme";
44
54
  }
45
55
 
56
+ /// Compare two themes to see if the second theme is a superset of the first
57
+ /// theme. In other words, this function will return true if every token in the
58
+ /// first theme is available in the second theme and has the same value. The
59
+ /// second theme is allowed to have additional values and it will still match.
60
+ /// @param {Map} $a
61
+ /// @param {Map} $b
62
+ /// @returns {Boolean}
63
+ @function matches($a, $b) {
64
+ @each $key, $value in $a {
65
+ @if map.has-key($b, $key) == false {
66
+ @return false;
67
+ }
68
+
69
+ @if map.get($b, $key) != $value {
70
+ @return false;
71
+ }
72
+ }
73
+
74
+ @return true;
75
+ }
76
+
77
+ /// Add component tokens which will be included any time the theme mixin is
78
+ /// called
79
+ @mixin add-component-tokens($token-map) {
80
+ $-component-tokens: map.merge($-component-tokens, $token-map) !global;
81
+ }
82
+
83
+ /// Determine the value from a component token that matches the given theme.
84
+ /// This is helpful when a component token may change depending on what theme the
85
+ /// component is being rendered in.
86
+ @function -resolve-token-value($active-theme: $theme, $token-value) {
87
+ @if meta.type-of($token-value) == map and map.has-key($token-value, values) {
88
+ $fallback: map.get($token-value, fallback);
89
+ $theme-values: map.get($token-value, values);
90
+
91
+ @each $theme-value in $theme-values {
92
+ $theme-to-match: map.get($theme-value, theme);
93
+ $value: map.get($theme-value, value);
94
+
95
+ @if matches($theme-to-match, $active-theme) {
96
+ @return $value;
97
+ }
98
+ }
99
+
100
+ @return $fallback;
101
+ }
102
+
103
+ @return $token-value;
104
+ }
105
+
46
106
  /// @access private
47
107
  /// @group @carbon/themes
48
108
  @mixin -custom-property($name, $value) {
package/src/g10.js CHANGED
@@ -268,6 +268,31 @@ export {
268
268
  display02,
269
269
  display03,
270
270
  display04,
271
+ // V11 Tokens
272
+ legal01,
273
+ legal02,
274
+ bodyCompact01,
275
+ bodyCompact02,
276
+ body01,
277
+ body02,
278
+ headingCompact01,
279
+ headingCompact02,
280
+ heading03,
281
+ heading04,
282
+ heading05,
283
+ heading06,
284
+ heading07,
285
+ fluidHeading03,
286
+ fluidHeading04,
287
+ fluidHeading05,
288
+ fluidHeading06,
289
+ fluidParagraph01,
290
+ fluidQuotation01,
291
+ fluidQuotation02,
292
+ fluidDisplay01,
293
+ fluidDisplay02,
294
+ fluidDisplay03,
295
+ fluidDisplay04,
271
296
  // Layout
272
297
  // Spacing
273
298
  spacing01,
package/src/g100.js CHANGED
@@ -267,6 +267,31 @@ export {
267
267
  display02,
268
268
  display03,
269
269
  display04,
270
+ // V11 Tokens
271
+ legal01,
272
+ legal02,
273
+ bodyCompact01,
274
+ bodyCompact02,
275
+ body01,
276
+ body02,
277
+ headingCompact01,
278
+ headingCompact02,
279
+ heading03,
280
+ heading04,
281
+ heading05,
282
+ heading06,
283
+ heading07,
284
+ fluidHeading03,
285
+ fluidHeading04,
286
+ fluidHeading05,
287
+ fluidHeading06,
288
+ fluidParagraph01,
289
+ fluidQuotation01,
290
+ fluidQuotation02,
291
+ fluidDisplay01,
292
+ fluidDisplay02,
293
+ fluidDisplay03,
294
+ fluidDisplay04,
270
295
  // Layout
271
296
  // Spacing
272
297
  spacing01,
package/src/g80.js CHANGED
@@ -271,6 +271,31 @@ export {
271
271
  display02,
272
272
  display03,
273
273
  display04,
274
+ // V11 Tokens
275
+ legal01,
276
+ legal02,
277
+ bodyCompact01,
278
+ bodyCompact02,
279
+ body01,
280
+ body02,
281
+ headingCompact01,
282
+ headingCompact02,
283
+ heading03,
284
+ heading04,
285
+ heading05,
286
+ heading06,
287
+ heading07,
288
+ fluidHeading03,
289
+ fluidHeading04,
290
+ fluidHeading05,
291
+ fluidHeading06,
292
+ fluidParagraph01,
293
+ fluidQuotation01,
294
+ fluidQuotation02,
295
+ fluidDisplay01,
296
+ fluidDisplay02,
297
+ fluidDisplay03,
298
+ fluidDisplay04,
274
299
  // Layout
275
300
  // Spacing
276
301
  spacing01,
package/src/g90.js CHANGED
@@ -269,6 +269,31 @@ export {
269
269
  display02,
270
270
  display03,
271
271
  display04,
272
+ // V11 Tokens
273
+ legal01,
274
+ legal02,
275
+ bodyCompact01,
276
+ bodyCompact02,
277
+ body01,
278
+ body02,
279
+ headingCompact01,
280
+ headingCompact02,
281
+ heading03,
282
+ heading04,
283
+ heading05,
284
+ heading06,
285
+ heading07,
286
+ fluidHeading03,
287
+ fluidHeading04,
288
+ fluidHeading05,
289
+ fluidHeading06,
290
+ fluidParagraph01,
291
+ fluidQuotation01,
292
+ fluidQuotation02,
293
+ fluidDisplay01,
294
+ fluidDisplay02,
295
+ fluidDisplay03,
296
+ fluidDisplay04,
272
297
  // Layout
273
298
  // Spacing
274
299
  spacing01,
package/src/v9.js CHANGED
@@ -233,6 +233,31 @@ export {
233
233
  display02,
234
234
  display03,
235
235
  display04,
236
+ // V11 Tokens
237
+ legal01,
238
+ legal02,
239
+ bodyCompact01,
240
+ bodyCompact02,
241
+ body01,
242
+ body02,
243
+ headingCompact01,
244
+ headingCompact02,
245
+ heading03,
246
+ heading04,
247
+ heading05,
248
+ heading06,
249
+ heading07,
250
+ fluidHeading03,
251
+ fluidHeading04,
252
+ fluidHeading05,
253
+ fluidHeading06,
254
+ fluidParagraph01,
255
+ fluidQuotation01,
256
+ fluidQuotation02,
257
+ fluidDisplay01,
258
+ fluidDisplay02,
259
+ fluidDisplay03,
260
+ fluidDisplay04,
236
261
  // Layout
237
262
  // Spacing
238
263
  spacing01,
package/src/white.js CHANGED
@@ -268,6 +268,31 @@ export {
268
268
  display02,
269
269
  display03,
270
270
  display04,
271
+ // V11 Tokens
272
+ legal01,
273
+ legal02,
274
+ bodyCompact01,
275
+ bodyCompact02,
276
+ body01,
277
+ body02,
278
+ headingCompact01,
279
+ headingCompact02,
280
+ heading03,
281
+ heading04,
282
+ heading05,
283
+ heading06,
284
+ heading07,
285
+ fluidHeading03,
286
+ fluidHeading04,
287
+ fluidHeading05,
288
+ fluidHeading06,
289
+ fluidParagraph01,
290
+ fluidQuotation01,
291
+ fluidQuotation02,
292
+ fluidDisplay01,
293
+ fluidDisplay02,
294
+ fluidDisplay03,
295
+ fluidDisplay04,
271
296
  } from '@carbon/type';
272
297
 
273
298
  // Layout
package/umd/index.js CHANGED
@@ -421,6 +421,30 @@
421
421
  display02: type.display02,
422
422
  display03: type.display03,
423
423
  display04: type.display04,
424
+ legal01: type.legal01,
425
+ legal02: type.legal02,
426
+ bodyCompact01: type.bodyCompact01,
427
+ bodyCompact02: type.bodyCompact02,
428
+ body01: type.body01,
429
+ body02: type.body02,
430
+ headingCompact01: type.headingCompact01,
431
+ headingCompact02: type.headingCompact02,
432
+ heading03: type.heading03,
433
+ heading04: type.heading04,
434
+ heading05: type.heading05,
435
+ heading06: type.heading06,
436
+ heading07: type.heading07,
437
+ fluidHeading03: type.fluidHeading03,
438
+ fluidHeading04: type.fluidHeading04,
439
+ fluidHeading05: type.fluidHeading05,
440
+ fluidHeading06: type.fluidHeading06,
441
+ fluidParagraph01: type.fluidParagraph01,
442
+ fluidQuotation01: type.fluidQuotation01,
443
+ fluidQuotation02: type.fluidQuotation02,
444
+ fluidDisplay01: type.fluidDisplay01,
445
+ fluidDisplay02: type.fluidDisplay02,
446
+ fluidDisplay03: type.fluidDisplay03,
447
+ fluidDisplay04: type.fluidDisplay04,
424
448
  spacing01: layout.spacing01,
425
449
  spacing02: layout.spacing02,
426
450
  spacing03: layout.spacing03,
@@ -803,6 +827,30 @@
803
827
  display02: type.display02,
804
828
  display03: type.display03,
805
829
  display04: type.display04,
830
+ legal01: type.legal01,
831
+ legal02: type.legal02,
832
+ bodyCompact01: type.bodyCompact01,
833
+ bodyCompact02: type.bodyCompact02,
834
+ body01: type.body01,
835
+ body02: type.body02,
836
+ headingCompact01: type.headingCompact01,
837
+ headingCompact02: type.headingCompact02,
838
+ heading03: type.heading03,
839
+ heading04: type.heading04,
840
+ heading05: type.heading05,
841
+ heading06: type.heading06,
842
+ heading07: type.heading07,
843
+ fluidHeading03: type.fluidHeading03,
844
+ fluidHeading04: type.fluidHeading04,
845
+ fluidHeading05: type.fluidHeading05,
846
+ fluidHeading06: type.fluidHeading06,
847
+ fluidParagraph01: type.fluidParagraph01,
848
+ fluidQuotation01: type.fluidQuotation01,
849
+ fluidQuotation02: type.fluidQuotation02,
850
+ fluidDisplay01: type.fluidDisplay01,
851
+ fluidDisplay02: type.fluidDisplay02,
852
+ fluidDisplay03: type.fluidDisplay03,
853
+ fluidDisplay04: type.fluidDisplay04,
806
854
  spacing01: layout.spacing01,
807
855
  spacing02: layout.spacing02,
808
856
  spacing03: layout.spacing03,
@@ -1185,6 +1233,30 @@
1185
1233
  display02: type.display02,
1186
1234
  display03: type.display03,
1187
1235
  display04: type.display04,
1236
+ legal01: type.legal01,
1237
+ legal02: type.legal02,
1238
+ bodyCompact01: type.bodyCompact01,
1239
+ bodyCompact02: type.bodyCompact02,
1240
+ body01: type.body01,
1241
+ body02: type.body02,
1242
+ headingCompact01: type.headingCompact01,
1243
+ headingCompact02: type.headingCompact02,
1244
+ heading03: type.heading03,
1245
+ heading04: type.heading04,
1246
+ heading05: type.heading05,
1247
+ heading06: type.heading06,
1248
+ heading07: type.heading07,
1249
+ fluidHeading03: type.fluidHeading03,
1250
+ fluidHeading04: type.fluidHeading04,
1251
+ fluidHeading05: type.fluidHeading05,
1252
+ fluidHeading06: type.fluidHeading06,
1253
+ fluidParagraph01: type.fluidParagraph01,
1254
+ fluidQuotation01: type.fluidQuotation01,
1255
+ fluidQuotation02: type.fluidQuotation02,
1256
+ fluidDisplay01: type.fluidDisplay01,
1257
+ fluidDisplay02: type.fluidDisplay02,
1258
+ fluidDisplay03: type.fluidDisplay03,
1259
+ fluidDisplay04: type.fluidDisplay04,
1188
1260
  spacing01: layout.spacing01,
1189
1261
  spacing02: layout.spacing02,
1190
1262
  spacing03: layout.spacing03,
@@ -1570,6 +1642,30 @@
1570
1642
  display02: type.display02,
1571
1643
  display03: type.display03,
1572
1644
  display04: type.display04,
1645
+ legal01: type.legal01,
1646
+ legal02: type.legal02,
1647
+ bodyCompact01: type.bodyCompact01,
1648
+ bodyCompact02: type.bodyCompact02,
1649
+ body01: type.body01,
1650
+ body02: type.body02,
1651
+ headingCompact01: type.headingCompact01,
1652
+ headingCompact02: type.headingCompact02,
1653
+ heading03: type.heading03,
1654
+ heading04: type.heading04,
1655
+ heading05: type.heading05,
1656
+ heading06: type.heading06,
1657
+ heading07: type.heading07,
1658
+ fluidHeading03: type.fluidHeading03,
1659
+ fluidHeading04: type.fluidHeading04,
1660
+ fluidHeading05: type.fluidHeading05,
1661
+ fluidHeading06: type.fluidHeading06,
1662
+ fluidParagraph01: type.fluidParagraph01,
1663
+ fluidQuotation01: type.fluidQuotation01,
1664
+ fluidQuotation02: type.fluidQuotation02,
1665
+ fluidDisplay01: type.fluidDisplay01,
1666
+ fluidDisplay02: type.fluidDisplay02,
1667
+ fluidDisplay03: type.fluidDisplay03,
1668
+ fluidDisplay04: type.fluidDisplay04,
1573
1669
  spacing01: layout.spacing01,
1574
1670
  spacing02: layout.spacing02,
1575
1671
  spacing03: layout.spacing03,
@@ -1952,6 +2048,30 @@
1952
2048
  display02: type.display02,
1953
2049
  display03: type.display03,
1954
2050
  display04: type.display04,
2051
+ legal01: type.legal01,
2052
+ legal02: type.legal02,
2053
+ bodyCompact01: type.bodyCompact01,
2054
+ bodyCompact02: type.bodyCompact02,
2055
+ body01: type.body01,
2056
+ body02: type.body02,
2057
+ headingCompact01: type.headingCompact01,
2058
+ headingCompact02: type.headingCompact02,
2059
+ heading03: type.heading03,
2060
+ heading04: type.heading04,
2061
+ heading05: type.heading05,
2062
+ heading06: type.heading06,
2063
+ heading07: type.heading07,
2064
+ fluidHeading03: type.fluidHeading03,
2065
+ fluidHeading04: type.fluidHeading04,
2066
+ fluidHeading05: type.fluidHeading05,
2067
+ fluidHeading06: type.fluidHeading06,
2068
+ fluidParagraph01: type.fluidParagraph01,
2069
+ fluidQuotation01: type.fluidQuotation01,
2070
+ fluidQuotation02: type.fluidQuotation02,
2071
+ fluidDisplay01: type.fluidDisplay01,
2072
+ fluidDisplay02: type.fluidDisplay02,
2073
+ fluidDisplay03: type.fluidDisplay03,
2074
+ fluidDisplay04: type.fluidDisplay04,
1955
2075
  spacing01: layout.spacing01,
1956
2076
  spacing02: layout.spacing02,
1957
2077
  spacing03: layout.spacing03,
@@ -2334,6 +2454,30 @@
2334
2454
  display02: type.display02,
2335
2455
  display03: type.display03,
2336
2456
  display04: type.display04,
2457
+ legal01: type.legal01,
2458
+ legal02: type.legal02,
2459
+ bodyCompact01: type.bodyCompact01,
2460
+ bodyCompact02: type.bodyCompact02,
2461
+ body01: type.body01,
2462
+ body02: type.body02,
2463
+ headingCompact01: type.headingCompact01,
2464
+ headingCompact02: type.headingCompact02,
2465
+ heading03: type.heading03,
2466
+ heading04: type.heading04,
2467
+ heading05: type.heading05,
2468
+ heading06: type.heading06,
2469
+ heading07: type.heading07,
2470
+ fluidHeading03: type.fluidHeading03,
2471
+ fluidHeading04: type.fluidHeading04,
2472
+ fluidHeading05: type.fluidHeading05,
2473
+ fluidHeading06: type.fluidHeading06,
2474
+ fluidParagraph01: type.fluidParagraph01,
2475
+ fluidQuotation01: type.fluidQuotation01,
2476
+ fluidQuotation02: type.fluidQuotation02,
2477
+ fluidDisplay01: type.fluidDisplay01,
2478
+ fluidDisplay02: type.fluidDisplay02,
2479
+ fluidDisplay03: type.fluidDisplay03,
2480
+ fluidDisplay04: type.fluidDisplay04,
2337
2481
  spacing01: layout.spacing01,
2338
2482
  spacing02: layout.spacing02,
2339
2483
  spacing03: layout.spacing03,
@@ -2459,6 +2603,30 @@
2459
2603
  v9: v9
2460
2604
  };
2461
2605
 
2606
+ Object.defineProperty(exports, 'body01', {
2607
+ enumerable: true,
2608
+ get: function () {
2609
+ return type.body01;
2610
+ }
2611
+ });
2612
+ Object.defineProperty(exports, 'body02', {
2613
+ enumerable: true,
2614
+ get: function () {
2615
+ return type.body02;
2616
+ }
2617
+ });
2618
+ Object.defineProperty(exports, 'bodyCompact01', {
2619
+ enumerable: true,
2620
+ get: function () {
2621
+ return type.bodyCompact01;
2622
+ }
2623
+ });
2624
+ Object.defineProperty(exports, 'bodyCompact02', {
2625
+ enumerable: true,
2626
+ get: function () {
2627
+ return type.bodyCompact02;
2628
+ }
2629
+ });
2462
2630
  Object.defineProperty(exports, 'bodyLong01', {
2463
2631
  enumerable: true,
2464
2632
  get: function () {
@@ -2573,6 +2741,72 @@
2573
2741
  return type.expressiveParagraph01;
2574
2742
  }
2575
2743
  });
2744
+ Object.defineProperty(exports, 'fluidDisplay01', {
2745
+ enumerable: true,
2746
+ get: function () {
2747
+ return type.fluidDisplay01;
2748
+ }
2749
+ });
2750
+ Object.defineProperty(exports, 'fluidDisplay02', {
2751
+ enumerable: true,
2752
+ get: function () {
2753
+ return type.fluidDisplay02;
2754
+ }
2755
+ });
2756
+ Object.defineProperty(exports, 'fluidDisplay03', {
2757
+ enumerable: true,
2758
+ get: function () {
2759
+ return type.fluidDisplay03;
2760
+ }
2761
+ });
2762
+ Object.defineProperty(exports, 'fluidDisplay04', {
2763
+ enumerable: true,
2764
+ get: function () {
2765
+ return type.fluidDisplay04;
2766
+ }
2767
+ });
2768
+ Object.defineProperty(exports, 'fluidHeading03', {
2769
+ enumerable: true,
2770
+ get: function () {
2771
+ return type.fluidHeading03;
2772
+ }
2773
+ });
2774
+ Object.defineProperty(exports, 'fluidHeading04', {
2775
+ enumerable: true,
2776
+ get: function () {
2777
+ return type.fluidHeading04;
2778
+ }
2779
+ });
2780
+ Object.defineProperty(exports, 'fluidHeading05', {
2781
+ enumerable: true,
2782
+ get: function () {
2783
+ return type.fluidHeading05;
2784
+ }
2785
+ });
2786
+ Object.defineProperty(exports, 'fluidHeading06', {
2787
+ enumerable: true,
2788
+ get: function () {
2789
+ return type.fluidHeading06;
2790
+ }
2791
+ });
2792
+ Object.defineProperty(exports, 'fluidParagraph01', {
2793
+ enumerable: true,
2794
+ get: function () {
2795
+ return type.fluidParagraph01;
2796
+ }
2797
+ });
2798
+ Object.defineProperty(exports, 'fluidQuotation01', {
2799
+ enumerable: true,
2800
+ get: function () {
2801
+ return type.fluidQuotation01;
2802
+ }
2803
+ });
2804
+ Object.defineProperty(exports, 'fluidQuotation02', {
2805
+ enumerable: true,
2806
+ get: function () {
2807
+ return type.fluidQuotation02;
2808
+ }
2809
+ });
2576
2810
  Object.defineProperty(exports, 'heading01', {
2577
2811
  enumerable: true,
2578
2812
  get: function () {
@@ -2585,6 +2819,48 @@
2585
2819
  return type.heading02;
2586
2820
  }
2587
2821
  });
2822
+ Object.defineProperty(exports, 'heading03', {
2823
+ enumerable: true,
2824
+ get: function () {
2825
+ return type.heading03;
2826
+ }
2827
+ });
2828
+ Object.defineProperty(exports, 'heading04', {
2829
+ enumerable: true,
2830
+ get: function () {
2831
+ return type.heading04;
2832
+ }
2833
+ });
2834
+ Object.defineProperty(exports, 'heading05', {
2835
+ enumerable: true,
2836
+ get: function () {
2837
+ return type.heading05;
2838
+ }
2839
+ });
2840
+ Object.defineProperty(exports, 'heading06', {
2841
+ enumerable: true,
2842
+ get: function () {
2843
+ return type.heading06;
2844
+ }
2845
+ });
2846
+ Object.defineProperty(exports, 'heading07', {
2847
+ enumerable: true,
2848
+ get: function () {
2849
+ return type.heading07;
2850
+ }
2851
+ });
2852
+ Object.defineProperty(exports, 'headingCompact01', {
2853
+ enumerable: true,
2854
+ get: function () {
2855
+ return type.headingCompact01;
2856
+ }
2857
+ });
2858
+ Object.defineProperty(exports, 'headingCompact02', {
2859
+ enumerable: true,
2860
+ get: function () {
2861
+ return type.headingCompact02;
2862
+ }
2863
+ });
2588
2864
  Object.defineProperty(exports, 'helperText01', {
2589
2865
  enumerable: true,
2590
2866
  get: function () {
@@ -2609,6 +2885,18 @@
2609
2885
  return type.label02;
2610
2886
  }
2611
2887
  });
2888
+ Object.defineProperty(exports, 'legal01', {
2889
+ enumerable: true,
2890
+ get: function () {
2891
+ return type.legal01;
2892
+ }
2893
+ });
2894
+ Object.defineProperty(exports, 'legal02', {
2895
+ enumerable: true,
2896
+ get: function () {
2897
+ return type.legal02;
2898
+ }
2899
+ });
2612
2900
  Object.defineProperty(exports, 'productiveHeading01', {
2613
2901
  enumerable: true,
2614
2902
  get: function () {