@carbon/type 10.45.2 → 10.45.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.
package/README.md CHANGED
@@ -266,3 +266,12 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md)! 👀
266
266
  ## 📝 License
267
267
 
268
268
  Licensed under the [Apache 2.0 License](/LICENSE).
269
+
270
+ ## <picture><source height="20" width="20" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-dark.svg"><source height="20" width="20" media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"><img height="20" width="20" alt="IBM Telemetry" src="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"></picture> IBM Telemetry
271
+
272
+ This package uses IBM Telemetry to collect metrics data. By installing this
273
+ package as a dependency you are agreeing to telemetry collection. To opt out,
274
+ see
275
+ [Opting out of IBM Telemetry data collection](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection).
276
+ For more information on the data being collected, please see the
277
+ [IBM Telemetry documentation](https://github.com/ibm-telemetry/telemetry-js/tree/main#ibm-telemetry-collection-basics).
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.45.2",
4
+ "version": "10.45.4",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -17,7 +17,8 @@
17
17
  "scss",
18
18
  "src",
19
19
  "umd",
20
- "index.scss"
20
+ "index.scss",
21
+ "telemetry.yml"
21
22
  ],
22
23
  "keywords": [
23
24
  "eyeglass-module",
@@ -34,15 +35,17 @@
34
35
  },
35
36
  "scripts": {
36
37
  "build": "yarn clean && carbon-cli bundle src/index.js --name CarbonType && carbon-cli inline && carbon-cli check \"scss/*.scss\"",
37
- "clean": "rimraf css es lib umd scss/_inlined scss/vendor"
38
+ "clean": "rimraf css es lib umd scss/_inlined scss/vendor",
39
+ "postinstall": "ibmtelemetry --config=telemetry.yml"
38
40
  },
39
41
  "dependencies": {
40
- "@carbon/grid": "^10.43.1",
41
- "@carbon/import-once": "^10.7.0"
42
+ "@carbon/grid": "^10.43.3",
43
+ "@carbon/import-once": "^10.7.1",
44
+ "@ibm/telemetry-js": "^1.2.1"
42
45
  },
43
46
  "devDependencies": {
44
- "@carbon/cli": "^10.34.1",
45
- "@carbon/test-utils": "^10.21.0",
47
+ "@carbon/cli": "^10.34.3",
48
+ "@carbon/test-utils": "^10.21.1",
46
49
  "change-case": "^4.1.1",
47
50
  "rimraf": "^3.0.0"
48
51
  },
@@ -52,5 +55,5 @@
52
55
  "sassDir": "scss",
53
56
  "needs": "^1.3.0"
54
57
  },
55
- "gitHead": "0898114f2e0a3f0ec55aadd8048eeec85c8ce8ed"
58
+ "gitHead": "4e41819f51f1294d467e12995c217ed83f695249"
56
59
  }
@@ -28,7 +28,7 @@ $carbon--type-scale: ();
28
28
  @for $i from 1 through 23 {
29
29
  $carbon--type-scale: append(
30
30
  $carbon--type-scale,
31
- carbon--rem(carbon--get-type-size($i))
31
+ to-rem(carbon--get-type-size($i))
32
32
  );
33
33
  }
34
34
 
package/scss/_scale.scss CHANGED
@@ -28,7 +28,7 @@ $carbon--type-scale: ();
28
28
  @for $i from 1 through 23 {
29
29
  $carbon--type-scale: append(
30
30
  $carbon--type-scale,
31
- carbon--rem(carbon--get-type-size($i))
31
+ to-rem(carbon--get-type-size($i))
32
32
  );
33
33
  }
34
34
 
@@ -27,7 +27,7 @@
27
27
  /// @group @carbon/type
28
28
  $type-scale: ();
29
29
  @for $i from 1 through 23 {
30
- $type-scale: list.append($type-scale, layout.rem(get-type-size($i)));
30
+ $type-scale: list.append($type-scale, layout.to-rem(get-type-size($i)));
31
31
  }
32
32
 
33
33
  /// Get the value of a specific step in the type scale
@@ -24,13 +24,13 @@ $flex-grid-columns: 16 !default;
24
24
  /// @type Number
25
25
  /// @access public
26
26
  /// @group @carbon/layout
27
- $grid-gutter: convert.rem(32px) !default;
27
+ $grid-gutter: convert.to-rem(32px) !default;
28
28
 
29
29
  /// Carbon condensed gutter size in rem
30
30
  /// @type Number
31
31
  /// @access public
32
32
  /// @group @carbon/layout
33
- $grid-gutter-condensed: convert.rem(1px) !default;
33
+ $grid-gutter-condensed: convert.to-rem(1px) !default;
34
34
 
35
35
  // Initial map of our breakpoints and their values
36
36
  /// @type Map
@@ -40,27 +40,27 @@ $grid-breakpoints: (
40
40
  sm: (
41
41
  columns: 4,
42
42
  margin: 0,
43
- width: convert.rem(320px),
43
+ width: convert.to-rem(320px),
44
44
  ),
45
45
  md: (
46
46
  columns: 8,
47
- margin: convert.rem(16px),
48
- width: convert.rem(672px),
47
+ margin: convert.to-rem(16px),
48
+ width: convert.to-rem(672px),
49
49
  ),
50
50
  lg: (
51
51
  columns: 16,
52
- margin: convert.rem(16px),
53
- width: convert.rem(1056px),
52
+ margin: convert.to-rem(16px),
53
+ width: convert.to-rem(1056px),
54
54
  ),
55
55
  xlg: (
56
56
  columns: 16,
57
- margin: convert.rem(16px),
58
- width: convert.rem(1312px),
57
+ margin: convert.to-rem(16px),
58
+ width: convert.to-rem(1312px),
59
59
  ),
60
60
  max: (
61
61
  columns: 16,
62
- margin: convert.rem(24px),
63
- width: convert.rem(1584px),
62
+ margin: convert.to-rem(24px),
63
+ width: convert.to-rem(1584px),
64
64
  ),
65
65
  ) !default;
66
66
 
@@ -13,13 +13,13 @@
13
13
  /// @type Number
14
14
  /// @access public
15
15
  /// @group @carbon/layout
16
- $carbon--grid-gutter: carbon--rem(32px);
16
+ $carbon--grid-gutter: to-rem(32px);
17
17
 
18
18
  /// Carbon condensed gutter size in rem
19
19
  /// @type Number
20
20
  /// @access public
21
21
  /// @group @carbon/layout
22
- $carbon--grid-gutter--condensed: carbon--rem(1px);
22
+ $carbon--grid-gutter--condensed: to-rem(1px);
23
23
 
24
24
  // Initial map of our breakpoints and their values
25
25
  /// @type Map
@@ -29,27 +29,27 @@ $carbon--grid-breakpoints: (
29
29
  sm: (
30
30
  columns: 4,
31
31
  margin: 0,
32
- width: carbon--rem(320px),
32
+ width: to-rem(320px),
33
33
  ),
34
34
  md: (
35
35
  columns: 8,
36
- margin: carbon--rem(16px),
37
- width: carbon--rem(672px),
36
+ margin: to-rem(16px),
37
+ width: to-rem(672px),
38
38
  ),
39
39
  lg: (
40
40
  columns: 16,
41
- margin: carbon--rem(16px),
42
- width: carbon--rem(1056px),
41
+ margin: to-rem(16px),
42
+ width: to-rem(1056px),
43
43
  ),
44
44
  xlg: (
45
45
  columns: 16,
46
- margin: carbon--rem(16px),
47
- width: carbon--rem(1312px),
46
+ margin: to-rem(16px),
47
+ width: to-rem(1312px),
48
48
  ),
49
49
  max: (
50
50
  columns: 16,
51
- margin: carbon--rem(24px),
52
- width: carbon--rem(1584px),
51
+ margin: to-rem(24px),
52
+ width: to-rem(1584px),
53
53
  ),
54
54
  ) !default;
55
55
 
@@ -33,7 +33,26 @@ $carbon--base-font-size: 16px !default;
33
33
  /// @return {Number} Number with rem unit
34
34
  /// @access public
35
35
  /// @group @carbon/layout
36
- @function carbon--rem($px) {
36
+ @function to-rem($px) {
37
+ @if unit($px) != 'px' {
38
+ // TODO: update to @error in v11
39
+ @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
40
+ }
41
+
42
+ @if meta.function-exists('div', 'math') {
43
+ @return math.div($px, $carbon--base-font-size) * 1rem;
44
+ } @else {
45
+ @return ($px / $carbon--base-font-size) * 1rem;
46
+ }
47
+ }
48
+
49
+ /// This function causes an error when using sass > 1.65.0
50
+ /// Replaced with `to-rem` function
51
+ /// @param {Number} $px - Number with px unit
52
+ /// @return {Number} Number with rem unit
53
+ /// @access public
54
+ /// @group @carbon/layout
55
+ @function rem($px) {
37
56
  @if unit($px) != 'px' {
38
57
  // TODO: update to @error in v11
39
58
  @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
@@ -30,7 +30,23 @@ $carbon--base-font-size: 16px !default;
30
30
  /// @return {Number} Number with rem unit
31
31
  /// @access public
32
32
  /// @group @carbon/layout
33
- @function carbon--rem($px) {
33
+ @function to-rem($px) {
34
+ @if unit($px) != 'px' {
35
+ // TODO: update to @error in v11
36
+ @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
37
+ }
38
+
39
+ @return ($px / $carbon--base-font-size) * 1rem;
40
+ }
41
+
42
+ /// This function causes an error when using sass > 1.65.0
43
+ /// Replaced with `to-rem` function
44
+ /// @param {Number} $px - Number with px unit
45
+ /// @return {Number} Number with rem unit
46
+ /// @access public
47
+ /// @group @carbon/layout
48
+ /// @deprecated Use `to-rem()`
49
+ @function rem($px) {
34
50
  @if unit($px) != 'px' {
35
51
  // TODO: update to @error in v11
36
52
  @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
@@ -19,5 +19,5 @@ $carbon--mini-unit-size: 8px !default;
19
19
  /// @access public
20
20
  /// @group @carbon/layout
21
21
  @function carbon--mini-units($count) {
22
- @return carbon--rem($carbon--mini-unit-size * $count);
22
+ @return to-rem($carbon--mini-unit-size * $count);
23
23
  }
@@ -19,6 +19,26 @@ $base-font-size: 16px !default;
19
19
  /// @return {Number} Number with rem unit
20
20
  /// @access public
21
21
  /// @group @carbon/layout
22
+ @function to-rem($px) {
23
+ @if unit($px) != 'px' {
24
+ // TODO: update to @error in v11
25
+ @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
26
+ }
27
+
28
+ @if meta.function-exists('div', 'math') {
29
+ @return math.div($px, $base-font-size) * 1rem;
30
+ } @else {
31
+ @return ($px / $base-font-size) * 1rem;
32
+ }
33
+ }
34
+
35
+ /// This function causes an error when using sass > 1.65.0
36
+ /// Replaced with `to-rem` function
37
+ /// @param {Number} $px - Number with px unit
38
+ /// @return {Number} Number with rem unit
39
+ /// @access public
40
+ /// @group @carbon/layout
41
+ /// @deprecated Use `to-rem()`
22
42
  @function rem($px) {
23
43
  @if unit($px) != 'px' {
24
44
  // TODO: update to @error in v11
package/telemetry.yml ADDED
@@ -0,0 +1,7 @@
1
+ # yaml-language-server: $schema=https://unpkg.com/@ibm/telemetry-config-schema@v1/dist/config.schema.json
2
+ version: 1
3
+ projectId: 43a17f29-6354-4c01-b4ec-920a1248f0f7
4
+ endpoint: https://collector-prod.1am6wm210aow.us-south.codeengine.appdomain.cloud/v1/metrics
5
+ collect:
6
+ npm:
7
+ dependencies: null