@carbon/elements 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.
Files changed (33) hide show
  1. package/package.json +10 -10
  2. package/scss/grid/_inlined/_mixins.import.scss +416 -0
  3. package/scss/grid/_inlined/_mixins.scss +14 -0
  4. package/scss/grid/_mixins.import.scss +416 -0
  5. package/scss/grid/_mixins.scss +14 -0
  6. package/scss/grid/vendor/@carbon/layout/_convert.import.scss +56 -0
  7. package/scss/grid/vendor/@carbon/layout/_convert.scss +14 -0
  8. package/scss/grid/vendor/@carbon/layout/_key-height.import.scss +112 -0
  9. package/scss/grid/vendor/@carbon/layout/_key-height.scss +14 -0
  10. package/scss/grid/vendor/@carbon/layout/modules/_convert.scss +4 -2
  11. package/scss/layout/_convert.import.scss +56 -0
  12. package/scss/layout/_convert.scss +14 -0
  13. package/scss/layout/_key-height.import.scss +112 -0
  14. package/scss/layout/_key-height.scss +14 -0
  15. package/scss/layout/modules/_convert.scss +4 -2
  16. package/scss/themes/generated/_mixins.scss +287 -0
  17. package/scss/themes/generated/_themes.scss +506 -20
  18. package/scss/themes/generated/_tokens.scss +578 -20
  19. package/scss/themes/modules/_theme.scss +60 -0
  20. package/scss/type/_inlined/_scale.scss +1 -1
  21. package/scss/type/_inlined/_styles.import.scss +761 -0
  22. package/scss/type/_inlined/_styles.scss +214 -36
  23. package/scss/type/_scale.scss +1 -1
  24. package/scss/type/_styles.import.scss +761 -0
  25. package/scss/type/_styles.scss +214 -36
  26. package/scss/type/modules/_scale.scss +1 -1
  27. package/scss/type/modules/_styles.scss +187 -26
  28. package/scss/type/vendor/@carbon/layout/_convert.import.scss +56 -0
  29. package/scss/type/vendor/@carbon/layout/_convert.scss +14 -0
  30. package/scss/type/vendor/@carbon/layout/_key-height.import.scss +112 -0
  31. package/scss/type/vendor/@carbon/layout/_key-height.scss +14 -0
  32. package/scss/type/vendor/@carbon/layout/modules/_convert.scss +4 -2
  33. package/src/__tests__/__snapshots__/PublicAPI-test.js.snap +24 -0
@@ -0,0 +1,56 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 2018
3
+ //
4
+ // This source code is licensed under the Apache-2.0 license found in the
5
+ // LICENSE file in the root directory of this source tree.
6
+ //
7
+ //-------------------------------------------
8
+ // Compatibility notes (*.import.scss)
9
+ // ------------------------------------------
10
+ //
11
+ // This file is intended to be consumed and processed with dart-sass.
12
+ // It is incompatible with node-sass/libsass as it contains sass language features
13
+ // or functions that are unavailable in node-sass/libsass, such as `math.div`.
14
+ //
15
+ // The non-`.import` suffixed version of this file eg. `_filename.scss`
16
+ // is intended to be compatible with node-sass/libsass.
17
+ //
18
+ // Styles authored within this file must be duplicated to the corresponding
19
+ // compatibility file to ensure we continue to support node-sass and dart-sass
20
+ // in v10.
21
+
22
+ @use 'sass:math';
23
+
24
+ /// Default font size
25
+ /// @type Number
26
+ /// @access public
27
+ /// @group @carbon/layout
28
+ $carbon--base-font-size: 16px !default;
29
+
30
+ /// Convert a given px unit to a rem unit
31
+ /// @param {Number} $px - Number with px unit
32
+ /// @return {Number} Number with rem unit
33
+ /// @access public
34
+ /// @group @carbon/layout
35
+ @function carbon--rem($px) {
36
+ @if unit($px) != 'px' {
37
+ // TODO: update to @error in v11
38
+ @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
39
+ }
40
+
41
+ @return math.div($px, $carbon--base-font-size) * 1rem;
42
+ }
43
+
44
+ /// Convert a given px unit to a em unit
45
+ /// @param {Number} $px - Number with px unit
46
+ /// @return {Number} Number with em unit
47
+ /// @access public
48
+ /// @group @carbon/layout
49
+ @function carbon--em($px) {
50
+ @if unit($px) != 'px' {
51
+ // TODO: update to @error in v11
52
+ @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
53
+ }
54
+
55
+ @return math.div($px, $carbon--base-font-size) * 1em;
56
+ }
@@ -4,6 +4,20 @@
4
4
  // This source code is licensed under the Apache-2.0 license found in the
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
+ //-------------------------------------------
8
+ // Compatibility notes
9
+ // ------------------------------------------
10
+ //
11
+ // This file is intended to be consumed and processed with node-sass/libsass.
12
+ // Sass language features only available in dart-sass, such as `math.div`,
13
+ // should not be used.
14
+ //
15
+ // The `.import` suffixed version of this file eg. `_filename.import.scss`
16
+ // is intended to be compatible with dart-sass.
17
+ //
18
+ // Styles authored within this file must be duplicated to the corresponding
19
+ // compatibility file to ensure we continue to support node-sass and dart-sass
20
+ // in v10.
7
21
 
8
22
  /// Default font size
9
23
  /// @type Number
@@ -0,0 +1,112 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 2018
3
+ //
4
+ // This source code is licensed under the Apache-2.0 license found in the
5
+ // LICENSE file in the root directory of this source tree.
6
+ //
7
+ //-------------------------------------------
8
+ // Compatibility notes (*.import.scss)
9
+ // ------------------------------------------
10
+ //
11
+ // This file is intended to be consumed and processed with dart-sass.
12
+ // It is incompatible with node-sass/libsass as it contains sass language features
13
+ // or functions that are unavailable in node-sass/libsass, such as `math.div`.
14
+ //
15
+ // The non-`.import` suffixed version of this file eg. `_filename.scss`
16
+ // is intended to be compatible with node-sass/libsass.
17
+ //
18
+ // Styles authored within this file must be duplicated to the corresponding
19
+ // compatibility file to ensure we continue to support node-sass and dart-sass
20
+ // in v10.
21
+
22
+ @use "sass:math";
23
+ @import 'breakpoint'; /* stylelint-disable-line no-invalid-position-at-import-rule */
24
+ @import 'utilities'; /* stylelint-disable-line no-invalid-position-at-import-rule */
25
+
26
+ /// Get the column width for a given breakpoint
27
+ /// @param {String} $breakpoint
28
+ /// @param {Map} $breakpoints [$carbon--grid-breakpoints]
29
+ /// @return {Number} In rem
30
+ /// @access public
31
+ /// @group @carbon/layout
32
+ @function carbon--get-column-width(
33
+ $breakpoint,
34
+ $breakpoints: $carbon--grid-breakpoints
35
+ ) {
36
+ @if map-has-key($breakpoints, $breakpoint) {
37
+ $values: map-get($breakpoints, $breakpoint);
38
+ $width: map-get($values, width);
39
+ $margin: map-get($values, margin);
40
+ $columns: map-get($values, columns);
41
+
42
+ @return math.div($width - (2 * $margin), $columns);
43
+ } @else {
44
+ @warn 'Breakpoint: `#{$breakpoint}` is not a valid breakpoint.';
45
+ }
46
+ }
47
+
48
+ /// @type Map
49
+ /// @access public
50
+ /// @group @carbon/layout
51
+ $carbon--key-height-scales: (
52
+ sm: (
53
+ carbon--get-column-width(sm),
54
+ carbon--get-column-width(sm) * 2,
55
+ carbon--get-column-width(sm) * 3,
56
+ carbon--get-column-width(sm) * 4,
57
+ carbon--get-column-width(sm) * 5,
58
+ carbon--get-column-width(sm) * 6,
59
+ ),
60
+ md: (
61
+ carbon--get-column-width(md),
62
+ carbon--get-column-width(md) * 2,
63
+ carbon--get-column-width(md) * 3,
64
+ carbon--get-column-width(md) * 4,
65
+ carbon--get-column-width(md) * 5,
66
+ carbon--get-column-width(md) * 6,
67
+ ),
68
+ lg: (
69
+ carbon--get-column-width(lg),
70
+ carbon--get-column-width(lg) * 2,
71
+ carbon--get-column-width(lg) * 3,
72
+ carbon--get-column-width(lg) * 4,
73
+ carbon--get-column-width(lg) * 5,
74
+ carbon--get-column-width(lg) * 6,
75
+ carbon--get-column-width(lg) * 7,
76
+ carbon--get-column-width(lg) * 8,
77
+ ),
78
+ xlg: (
79
+ carbon--get-column-width(xlg),
80
+ carbon--get-column-width(xlg) * 2,
81
+ carbon--get-column-width(xlg) * 3,
82
+ carbon--get-column-width(xlg) * 4,
83
+ carbon--get-column-width(xlg) * 5,
84
+ carbon--get-column-width(xlg) * 6,
85
+ carbon--get-column-width(xlg) * 7,
86
+ carbon--get-column-width(xlg) * 8,
87
+ ),
88
+ max: (
89
+ carbon--get-column-width(max),
90
+ carbon--get-column-width(max) * 2,
91
+ carbon--get-column-width(max) * 3,
92
+ carbon--get-column-width(max) * 4,
93
+ carbon--get-column-width(max) * 5,
94
+ carbon--get-column-width(max) * 6,
95
+ carbon--get-column-width(max) * 7,
96
+ carbon--get-column-width(max) * 8,
97
+ ),
98
+ );
99
+
100
+ /// Get the value of a key height step at a given breakpoint
101
+ /// @param {String} $breakpoint
102
+ /// @param {Number} $step
103
+ /// @return {Number} In rem
104
+ /// @access public
105
+ /// @group @carbon/layout
106
+ @function carbon--key-height($breakpoint, $step) {
107
+ @if map-has-key($carbon--key-height-scales, $breakpoint) {
108
+ @return nth(map-get($carbon--key-height-scales, $breakpoint), $step);
109
+ } @else {
110
+ @warn 'Breakpoint: `#{$breakpoint}` is not a valid breakpoint.';
111
+ }
112
+ }
@@ -4,6 +4,20 @@
4
4
  // This source code is licensed under the Apache-2.0 license found in the
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
+ //-------------------------------------------
8
+ // Compatibility notes
9
+ // ------------------------------------------
10
+ //
11
+ // This file is intended to be consumed and processed with node-sass/libsass.
12
+ // Sass language features only available in dart-sass, such as `math.div`,
13
+ // should not be used.
14
+ //
15
+ // The `.import` suffixed version of this file eg. `_filename.import.scss`
16
+ // is intended to be compatible with dart-sass.
17
+ //
18
+ // Styles authored within this file must be duplicated to the corresponding
19
+ // compatibility file to ensure we continue to support node-sass and dart-sass
20
+ // in v10.
7
21
 
8
22
  @import 'breakpoint';
9
23
  @import 'utilities';
@@ -5,6 +5,8 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
+ @use 'sass:math';
9
+
8
10
  /// Default font size
9
11
  /// @type Number
10
12
  /// @access public
@@ -22,7 +24,7 @@ $base-font-size: 16px !default;
22
24
  @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
23
25
  }
24
26
 
25
- @return ($px / $base-font-size) * 1rem;
27
+ @return math.div($px, $base-font-size) * 1rem;
26
28
  }
27
29
 
28
30
  /// Convert a given px unit to a em unit
@@ -36,5 +38,5 @@ $base-font-size: 16px !default;
36
38
  @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
37
39
  }
38
40
 
39
- @return ($px / $base-font-size) * 1em;
41
+ @return math.div($px, $base-font-size) * 1em;
40
42
  }
@@ -226,6 +226,30 @@
226
226
  $display-02: map-get($theme, 'display-02') !global;
227
227
  $display-03: map-get($theme, 'display-03') !global;
228
228
  $display-04: map-get($theme, 'display-04') !global;
229
+ $legal-01: map-get($theme, 'legal-01') !global;
230
+ $legal-02: map-get($theme, 'legal-02') !global;
231
+ $body-compact-01: map-get($theme, 'body-compact-01') !global;
232
+ $body-compact-02: map-get($theme, 'body-compact-02') !global;
233
+ $body-01: map-get($theme, 'body-01') !global;
234
+ $body-02: map-get($theme, 'body-02') !global;
235
+ $heading-compact-01: map-get($theme, 'heading-compact-01') !global;
236
+ $heading-compact-02: map-get($theme, 'heading-compact-02') !global;
237
+ $heading-03: map-get($theme, 'heading-03') !global;
238
+ $heading-04: map-get($theme, 'heading-04') !global;
239
+ $heading-05: map-get($theme, 'heading-05') !global;
240
+ $heading-06: map-get($theme, 'heading-06') !global;
241
+ $heading-07: map-get($theme, 'heading-07') !global;
242
+ $fluid-heading-03: map-get($theme, 'fluid-heading-03') !global;
243
+ $fluid-heading-04: map-get($theme, 'fluid-heading-04') !global;
244
+ $fluid-heading-05: map-get($theme, 'fluid-heading-05') !global;
245
+ $fluid-heading-06: map-get($theme, 'fluid-heading-06') !global;
246
+ $fluid-paragraph-01: map-get($theme, 'fluid-paragraph-01') !global;
247
+ $fluid-quotation-01: map-get($theme, 'fluid-quotation-01') !global;
248
+ $fluid-quotation-02: map-get($theme, 'fluid-quotation-02') !global;
249
+ $fluid-display-01: map-get($theme, 'fluid-display-01') !global;
250
+ $fluid-display-02: map-get($theme, 'fluid-display-02') !global;
251
+ $fluid-display-03: map-get($theme, 'fluid-display-03') !global;
252
+ $fluid-display-04: map-get($theme, 'fluid-display-04') !global;
229
253
  $spacing-01: map-get($theme, 'spacing-01') !global;
230
254
  $spacing-02: map-get($theme, 'spacing-02') !global;
231
255
  $spacing-03: map-get($theme, 'spacing-03') !global;
@@ -3005,6 +3029,269 @@
3005
3029
  @include custom-property('display-04', map-get($theme, 'display-04'));
3006
3030
  }
3007
3031
 
3032
+ @if should-emit($theme, $parent-carbon-theme, 'legal-01', $emit-difference)
3033
+ {
3034
+ @include custom-property('legal-01', map-get($theme, 'legal-01'));
3035
+ }
3036
+
3037
+ @if should-emit($theme, $parent-carbon-theme, 'legal-02', $emit-difference)
3038
+ {
3039
+ @include custom-property('legal-02', map-get($theme, 'legal-02'));
3040
+ }
3041
+
3042
+ @if should-emit(
3043
+ $theme,
3044
+ $parent-carbon-theme,
3045
+ 'body-compact-01',
3046
+ $emit-difference
3047
+ )
3048
+ {
3049
+ @include custom-property(
3050
+ 'body-compact-01',
3051
+ map-get($theme, 'body-compact-01')
3052
+ );
3053
+ }
3054
+
3055
+ @if should-emit(
3056
+ $theme,
3057
+ $parent-carbon-theme,
3058
+ 'body-compact-02',
3059
+ $emit-difference
3060
+ )
3061
+ {
3062
+ @include custom-property(
3063
+ 'body-compact-02',
3064
+ map-get($theme, 'body-compact-02')
3065
+ );
3066
+ }
3067
+
3068
+ @if should-emit($theme, $parent-carbon-theme, 'body-01', $emit-difference) {
3069
+ @include custom-property('body-01', map-get($theme, 'body-01'));
3070
+ }
3071
+
3072
+ @if should-emit($theme, $parent-carbon-theme, 'body-02', $emit-difference) {
3073
+ @include custom-property('body-02', map-get($theme, 'body-02'));
3074
+ }
3075
+
3076
+ @if should-emit(
3077
+ $theme,
3078
+ $parent-carbon-theme,
3079
+ 'heading-compact-01',
3080
+ $emit-difference
3081
+ )
3082
+ {
3083
+ @include custom-property(
3084
+ 'heading-compact-01',
3085
+ map-get($theme, 'heading-compact-01')
3086
+ );
3087
+ }
3088
+
3089
+ @if should-emit(
3090
+ $theme,
3091
+ $parent-carbon-theme,
3092
+ 'heading-compact-02',
3093
+ $emit-difference
3094
+ )
3095
+ {
3096
+ @include custom-property(
3097
+ 'heading-compact-02',
3098
+ map-get($theme, 'heading-compact-02')
3099
+ );
3100
+ }
3101
+
3102
+ @if should-emit(
3103
+ $theme,
3104
+ $parent-carbon-theme,
3105
+ 'heading-03',
3106
+ $emit-difference
3107
+ )
3108
+ {
3109
+ @include custom-property('heading-03', map-get($theme, 'heading-03'));
3110
+ }
3111
+
3112
+ @if should-emit(
3113
+ $theme,
3114
+ $parent-carbon-theme,
3115
+ 'heading-04',
3116
+ $emit-difference
3117
+ )
3118
+ {
3119
+ @include custom-property('heading-04', map-get($theme, 'heading-04'));
3120
+ }
3121
+
3122
+ @if should-emit(
3123
+ $theme,
3124
+ $parent-carbon-theme,
3125
+ 'heading-05',
3126
+ $emit-difference
3127
+ )
3128
+ {
3129
+ @include custom-property('heading-05', map-get($theme, 'heading-05'));
3130
+ }
3131
+
3132
+ @if should-emit(
3133
+ $theme,
3134
+ $parent-carbon-theme,
3135
+ 'heading-06',
3136
+ $emit-difference
3137
+ )
3138
+ {
3139
+ @include custom-property('heading-06', map-get($theme, 'heading-06'));
3140
+ }
3141
+
3142
+ @if should-emit(
3143
+ $theme,
3144
+ $parent-carbon-theme,
3145
+ 'heading-07',
3146
+ $emit-difference
3147
+ )
3148
+ {
3149
+ @include custom-property('heading-07', map-get($theme, 'heading-07'));
3150
+ }
3151
+
3152
+ @if should-emit(
3153
+ $theme,
3154
+ $parent-carbon-theme,
3155
+ 'fluid-heading-03',
3156
+ $emit-difference
3157
+ )
3158
+ {
3159
+ @include custom-property(
3160
+ 'fluid-heading-03',
3161
+ map-get($theme, 'fluid-heading-03')
3162
+ );
3163
+ }
3164
+
3165
+ @if should-emit(
3166
+ $theme,
3167
+ $parent-carbon-theme,
3168
+ 'fluid-heading-04',
3169
+ $emit-difference
3170
+ )
3171
+ {
3172
+ @include custom-property(
3173
+ 'fluid-heading-04',
3174
+ map-get($theme, 'fluid-heading-04')
3175
+ );
3176
+ }
3177
+
3178
+ @if should-emit(
3179
+ $theme,
3180
+ $parent-carbon-theme,
3181
+ 'fluid-heading-05',
3182
+ $emit-difference
3183
+ )
3184
+ {
3185
+ @include custom-property(
3186
+ 'fluid-heading-05',
3187
+ map-get($theme, 'fluid-heading-05')
3188
+ );
3189
+ }
3190
+
3191
+ @if should-emit(
3192
+ $theme,
3193
+ $parent-carbon-theme,
3194
+ 'fluid-heading-06',
3195
+ $emit-difference
3196
+ )
3197
+ {
3198
+ @include custom-property(
3199
+ 'fluid-heading-06',
3200
+ map-get($theme, 'fluid-heading-06')
3201
+ );
3202
+ }
3203
+
3204
+ @if should-emit(
3205
+ $theme,
3206
+ $parent-carbon-theme,
3207
+ 'fluid-paragraph-01',
3208
+ $emit-difference
3209
+ )
3210
+ {
3211
+ @include custom-property(
3212
+ 'fluid-paragraph-01',
3213
+ map-get($theme, 'fluid-paragraph-01')
3214
+ );
3215
+ }
3216
+
3217
+ @if should-emit(
3218
+ $theme,
3219
+ $parent-carbon-theme,
3220
+ 'fluid-quotation-01',
3221
+ $emit-difference
3222
+ )
3223
+ {
3224
+ @include custom-property(
3225
+ 'fluid-quotation-01',
3226
+ map-get($theme, 'fluid-quotation-01')
3227
+ );
3228
+ }
3229
+
3230
+ @if should-emit(
3231
+ $theme,
3232
+ $parent-carbon-theme,
3233
+ 'fluid-quotation-02',
3234
+ $emit-difference
3235
+ )
3236
+ {
3237
+ @include custom-property(
3238
+ 'fluid-quotation-02',
3239
+ map-get($theme, 'fluid-quotation-02')
3240
+ );
3241
+ }
3242
+
3243
+ @if should-emit(
3244
+ $theme,
3245
+ $parent-carbon-theme,
3246
+ 'fluid-display-01',
3247
+ $emit-difference
3248
+ )
3249
+ {
3250
+ @include custom-property(
3251
+ 'fluid-display-01',
3252
+ map-get($theme, 'fluid-display-01')
3253
+ );
3254
+ }
3255
+
3256
+ @if should-emit(
3257
+ $theme,
3258
+ $parent-carbon-theme,
3259
+ 'fluid-display-02',
3260
+ $emit-difference
3261
+ )
3262
+ {
3263
+ @include custom-property(
3264
+ 'fluid-display-02',
3265
+ map-get($theme, 'fluid-display-02')
3266
+ );
3267
+ }
3268
+
3269
+ @if should-emit(
3270
+ $theme,
3271
+ $parent-carbon-theme,
3272
+ 'fluid-display-03',
3273
+ $emit-difference
3274
+ )
3275
+ {
3276
+ @include custom-property(
3277
+ 'fluid-display-03',
3278
+ map-get($theme, 'fluid-display-03')
3279
+ );
3280
+ }
3281
+
3282
+ @if should-emit(
3283
+ $theme,
3284
+ $parent-carbon-theme,
3285
+ 'fluid-display-04',
3286
+ $emit-difference
3287
+ )
3288
+ {
3289
+ @include custom-property(
3290
+ 'fluid-display-04',
3291
+ map-get($theme, 'fluid-display-04')
3292
+ );
3293
+ }
3294
+
3008
3295
  @if should-emit(
3009
3296
  $theme,
3010
3297
  $parent-carbon-theme,