@carbon/type 10.40.0 → 10.42.0-rc.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 (51) hide show
  1. package/es/index.js +73 -2
  2. package/lib/index.js +169 -98
  3. package/package.json +5 -5
  4. package/scss/_inlined/_reset.scss +1 -1
  5. package/scss/_inlined/_scale.scss +1 -1
  6. package/scss/_inlined/_styles.import.scss +3 -3
  7. package/scss/_inlined/_styles.scss +1 -1
  8. package/scss/_styles.import.scss +3 -3
  9. package/scss/modules/_font-family.scss +13 -11
  10. package/scss/modules/_scale.scss +2 -1
  11. package/scss/modules/_styles.scss +9 -12
  12. package/scss/vendor/@carbon/grid/12.scss +41 -0
  13. package/scss/vendor/@carbon/grid/_inlined/12.scss +41 -0
  14. package/scss/vendor/@carbon/grid/_inlined/_mixins.import.scss +431 -0
  15. package/scss/vendor/@carbon/grid/_inlined/_mixins.scss +415 -0
  16. package/scss/vendor/@carbon/grid/_inlined/_prefix.scss +12 -0
  17. package/scss/vendor/@carbon/grid/_mixins.import.scss +431 -0
  18. package/scss/vendor/@carbon/grid/_mixins.scss +415 -0
  19. package/scss/vendor/@carbon/grid/_prefix.scss +12 -0
  20. package/scss/vendor/@carbon/grid/grid.scss +10 -0
  21. package/scss/vendor/@carbon/grid/index.scss +10 -0
  22. package/scss/vendor/@carbon/{layout → grid}/modules/_breakpoint.scss +36 -2
  23. package/scss/vendor/@carbon/grid/modules/_config.scss +18 -0
  24. package/scss/vendor/@carbon/grid/modules/_css-grid.scss +347 -0
  25. package/scss/vendor/@carbon/grid/modules/_flex-grid.scss +374 -0
  26. package/scss/vendor/@carbon/grid/modules/_mixins.scss +336 -0
  27. package/scss/vendor/@carbon/grid/vendor/@carbon/import-once/import-once.scss +27 -0
  28. package/scss/vendor/@carbon/grid/vendor/@carbon/import-once/index.scss +8 -0
  29. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/_breakpoint.scss +0 -0
  30. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/_convert.import.scss +0 -0
  31. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/_convert.scss +0 -0
  32. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/_key-height.import.scss +2 -2
  33. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/_key-height.scss +0 -0
  34. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/_mini-unit.scss +0 -0
  35. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/_spacing.scss +0 -0
  36. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/_utilities.scss +0 -0
  37. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/generated/_container.scss +0 -0
  38. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/generated/_fluid-spacing.scss +0 -0
  39. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/generated/_icon-size.scss +0 -0
  40. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/generated/_layout.scss +0 -0
  41. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/generated/_size.scss +0 -0
  42. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/generated/_spacing.scss +0 -0
  43. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/index.scss +0 -0
  44. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/layout.scss +0 -0
  45. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/modules/_convert.scss +0 -0
  46. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/modules/_spacing.scss +0 -0
  47. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/modules/_utilities.scss +3 -3
  48. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/modules/generated/_fluid-spacing.scss +0 -0
  49. package/scss/vendor/@carbon/{layout → grid/vendor/@carbon/layout}/modules/generated/_spacing.scss +0 -0
  50. package/scss/vendor/@carbon/import-once/import-once.scss +1 -1
  51. package/umd/index.js +173 -100
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/type",
3
3
  "description": "Typography for digital and software products using the Carbon Design System",
4
- "version": "10.40.0",
4
+ "version": "10.42.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -37,11 +37,11 @@
37
37
  "clean": "rimraf css es lib umd scss/_inlined scss/vendor"
38
38
  },
39
39
  "dependencies": {
40
- "@carbon/import-once": "^10.6.0",
41
- "@carbon/layout": "^10.35.0"
40
+ "@carbon/grid": "^10.42.0-rc.0",
41
+ "@carbon/import-once": "^10.7.0-rc.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@carbon/cli": "^10.32.0",
44
+ "@carbon/cli": "^10.34.0-rc.0",
45
45
  "@carbon/test-utils": "^10.21.0",
46
46
  "change-case": "^4.1.1",
47
47
  "rimraf": "^3.0.0"
@@ -52,5 +52,5 @@
52
52
  "sassDir": "scss",
53
53
  "needs": "^1.3.0"
54
54
  },
55
- "gitHead": "ac4b4bf03cf93cb8463916231619fbfdc72f0be5"
55
+ "gitHead": "e41618f5aaa9a10ce93edd844f1a280dc29eaf50"
56
56
  }
@@ -5,7 +5,7 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @import '../vendor/@carbon/layout/convert';
8
+ @import '@carbon/layout/scss/convert';
9
9
  @import 'font-family';
10
10
  @import 'styles';
11
11
 
@@ -5,7 +5,7 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @import '../vendor/@carbon/layout/convert';
8
+ @import '@carbon/layout/scss/convert';
9
9
 
10
10
  /// Compute the type size for the given type scale step
11
11
  /// @param {Number} $step
@@ -21,9 +21,9 @@
21
21
 
22
22
  @use "sass:meta";
23
23
  @use "sass:math";
24
- @import '../vendor/@carbon/layout/breakpoint'; /* stylelint-disable-line no-invalid-position-at-import-rule */
25
- @import 'font-family'; /* stylelint-disable-line no-invalid-position-at-import-rule */
26
- @import 'scale'; /* stylelint-disable-line no-invalid-position-at-import-rule */
24
+ @import '@carbon/layout/scss/breakpoint';
25
+ @import 'font-family';
26
+ @import 'scale';
27
27
 
28
28
  /// @type Map
29
29
  /// @access public
@@ -21,7 +21,7 @@
21
21
 
22
22
  // stylelint-disable number-max-precision
23
23
 
24
- @import '../vendor/@carbon/layout/breakpoint';
24
+ @import '@carbon/layout/scss/breakpoint';
25
25
  @import 'font-family';
26
26
  @import 'scale';
27
27
 
@@ -21,9 +21,9 @@
21
21
 
22
22
  @use "sass:meta";
23
23
  @use "sass:math";
24
- @import '@carbon/layout/scss/breakpoint'; /* stylelint-disable-line no-invalid-position-at-import-rule */
25
- @import 'font-family'; /* stylelint-disable-line no-invalid-position-at-import-rule */
26
- @import 'scale'; /* stylelint-disable-line no-invalid-position-at-import-rule */
24
+ @import '@carbon/layout/scss/breakpoint';
25
+ @import 'font-family';
26
+ @import 'scale';
27
27
 
28
28
  /// @type Map
29
29
  /// @access public
@@ -5,6 +5,8 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
+ @use 'sass:string';
9
+
8
10
  /// Font family fallbacks for: IBM Plex Mono, IBM Plex Sans, IBM Plex Sans
9
11
  /// Condensed, IBM Plex Sans Hebrew, and IBM Plex Serif
10
12
  /// @type Map
@@ -12,47 +14,47 @@
12
14
  /// @group @carbon/type
13
15
  $font-families: (
14
16
  'mono':
15
- unquote(
17
+ string.unquote(
16
18
  "'IBM Plex Mono', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', monospace"
17
19
  ),
18
20
  'sans':
19
- unquote(
21
+ string.unquote(
20
22
  "'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
21
23
  ),
22
24
  'sans-condensed':
23
- unquote(
25
+ string.unquote(
24
26
  "'IBM Plex Sans Condensed', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
25
27
  ),
26
28
  'sans-arabic':
27
- unquote(
29
+ string.unquote(
28
30
  "'IBM Plex Sans Arabic', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
29
31
  ),
30
32
  'sans-devanagari':
31
- unquote(
33
+ string.unquote(
32
34
  "'IBM Plex Sans Devanagari', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
33
35
  ),
34
36
  'sans-hebrew':
35
- unquote(
37
+ string.unquote(
36
38
  "'IBM Plex Sans Hebrew', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
37
39
  ),
38
40
  'sans-jp':
39
- unquote(
41
+ string.unquote(
40
42
  "'IBM Plex Sans JP', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
41
43
  ),
42
44
  'sans-kr':
43
- unquote(
45
+ string.unquote(
44
46
  "'IBM Plex Sans KR', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
45
47
  ),
46
48
  'sans-thai-looped':
47
- unquote(
49
+ string.unquote(
48
50
  "'IBM Plex Sans Thai Looped', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
49
51
  ),
50
52
  'sans-thai':
51
- unquote(
53
+ string.unquote(
52
54
  "'IBM Plex Sans Thai', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
53
55
  ),
54
56
  'serif':
55
- unquote(
57
+ string.unquote(
56
58
  "'IBM Plex Serif', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', serif"
57
59
  ),
58
60
  ) !default;
@@ -6,6 +6,7 @@
6
6
  //
7
7
 
8
8
  @use '@carbon/layout';
9
+ @use 'sass:list';
9
10
 
10
11
  /// Compute the type size for the given type scale step
11
12
  /// @param {Number} $step
@@ -26,7 +27,7 @@
26
27
  /// @group @carbon/type
27
28
  $type-scale: ();
28
29
  @for $i from 1 through 23 {
29
- $type-scale: append($type-scale, layout.rem(get-type-size($i)));
30
+ $type-scale: list.append($type-scale, layout.rem(get-type-size($i)));
30
31
  }
31
32
 
32
33
  /// Get the value of a specific step in the type scale
@@ -8,7 +8,8 @@
8
8
  // stylelint-disable number-max-precision
9
9
 
10
10
  @use 'sass:map';
11
- @use '@carbon/layout';
11
+ @use 'sass:math';
12
+ @use '@carbon/grid/scss/modules/breakpoint' as grid;
12
13
  @use 'font-family';
13
14
  @use 'scale';
14
15
 
@@ -696,7 +697,7 @@ $tokens: (
696
697
  /// @access public
697
698
  /// @group @carbon/type
698
699
  @function strip-unit($value) {
699
- @return $value / ($value * 0 + 1);
700
+ @return math.div($value, $value * 0 + 1);
700
701
  }
701
702
 
702
703
  /// This helper includes fluid type styles for the given token value. Fluid type
@@ -715,7 +716,7 @@ $tokens: (
715
716
  /// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use
716
717
  /// @access public
717
718
  /// @group @carbon/type
718
- @mixin fluid-type($type-styles, $breakpoints: layout.$grid-breakpoints) {
719
+ @mixin fluid-type($type-styles, $breakpoints: grid.$grid-breakpoints) {
719
720
  // Include the initial styles for the given token by default without any
720
721
  // media query guard. This includes `font-size` as a fallback in the case
721
722
  // that a browser does not support `calc()`
@@ -728,7 +729,7 @@ $tokens: (
728
729
  // token and apply the properties and fluid type size for that given
729
730
  // breakpoint
730
731
  @each $name, $values in map.get($type-styles, breakpoints) {
731
- @include layout.breakpoint($name) {
732
+ @include grid.breakpoint($name) {
732
733
  @include properties($values);
733
734
  @include fluid-type-size($type-styles, $name, $breakpoints);
734
735
  }
@@ -744,7 +745,7 @@ $tokens: (
744
745
  @mixin fluid-type-size(
745
746
  $type-styles,
746
747
  $name,
747
- $breakpoints: layout.$grid-breakpoints
748
+ $breakpoints: grid.$grid-breakpoints
748
749
  ) {
749
750
  // Get the information about the breakpoint we're currently working in. Useful
750
751
  // for getting initial width information
@@ -775,7 +776,7 @@ $tokens: (
775
776
 
776
777
  // We can use `breakpoint-next` to see if there is another breakpoint we can
777
778
  // use to update `max-font-size` and `max-vw` with larger values
778
- $next-breakpoint-available: layout.breakpoint-next($name, $breakpoints);
779
+ $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);
779
780
  $next-fluid-breakpoint-name: null;
780
781
 
781
782
  // We need to figure out what the next available fluid breakpoint is for our
@@ -787,7 +788,7 @@ $tokens: (
787
788
  $next-fluid-breakpoint-name: $next-breakpoint-available;
788
789
  $next-breakpoint-available: null;
789
790
  } @else {
790
- $next-breakpoint-available: layout.breakpoint-next(
791
+ $next-breakpoint-available: grid.breakpoint-next(
791
792
  $next-breakpoint-available,
792
793
  $breakpoints
793
794
  );
@@ -845,11 +846,7 @@ $custom-property-prefix: 'cds' !default;
845
846
  /// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use
846
847
  /// @access public
847
848
  /// @group @carbon/type
848
- @mixin type-style(
849
- $name,
850
- $fluid: false,
851
- $breakpoints: layout.$grid-breakpoints
852
- ) {
849
+ @mixin type-style($name, $fluid: false, $breakpoints: grid.$grid-breakpoints) {
853
850
  @if not map.has-key($tokens, $name) {
854
851
  @error 'Unable to find a token with the name: `#{$name}`';
855
852
  }
@@ -0,0 +1,41 @@
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
+ @import 'mixins';
9
+
10
+ /// Overrides `$carbon--grid-breakpoints` to use a 12 column grid instead of the default 16
11
+ /// @type Map
12
+ /// @access public
13
+ /// @group @carbon/grid
14
+ $carbon--12-column-grid: map-merge(
15
+ $carbon--grid-breakpoints,
16
+ (
17
+ lg:
18
+ map-merge(
19
+ map-get($carbon--grid-breakpoints, lg),
20
+ (
21
+ columns: 12,
22
+ )
23
+ ),
24
+ xlg:
25
+ map-merge(
26
+ map-get($carbon--grid-breakpoints, xlg),
27
+ (
28
+ columns: 12,
29
+ )
30
+ ),
31
+ max:
32
+ map-merge(
33
+ map-get($carbon--grid-breakpoints, max),
34
+ (
35
+ columns: 12,
36
+ )
37
+ ),
38
+ )
39
+ );
40
+
41
+ @include carbon--grid($breakpoints: $carbon--12-column-grid);
@@ -0,0 +1,41 @@
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
+ @import 'mixins';
9
+
10
+ /// Overrides `$carbon--grid-breakpoints` to use a 12 column grid instead of the default 16
11
+ /// @type Map
12
+ /// @access public
13
+ /// @group @carbon/grid
14
+ $carbon--12-column-grid: map-merge(
15
+ $carbon--grid-breakpoints,
16
+ (
17
+ lg:
18
+ map-merge(
19
+ map-get($carbon--grid-breakpoints, lg),
20
+ (
21
+ columns: 12,
22
+ )
23
+ ),
24
+ xlg:
25
+ map-merge(
26
+ map-get($carbon--grid-breakpoints, xlg),
27
+ (
28
+ columns: 12,
29
+ )
30
+ ),
31
+ max:
32
+ map-merge(
33
+ map-get($carbon--grid-breakpoints, max),
34
+ (
35
+ columns: 12,
36
+ )
37
+ ),
38
+ )
39
+ );
40
+
41
+ @include carbon--grid($breakpoints: $carbon--12-column-grid);