@carbon/layout 10.37.1 → 10.37.3

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
@@ -50,3 +50,12 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md)! 👀
50
50
  ## 📝 License
51
51
 
52
52
  Licensed under the [Apache 2.0 License](/LICENSE).
53
+
54
+ ## <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
55
+
56
+ This package uses IBM Telemetry to collect metrics data. By installing this
57
+ package as a dependency you are agreeing to telemetry collection. To opt out,
58
+ see
59
+ [Opting out of IBM Telemetry data collection](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection).
60
+ For more information on the data being collected, please see the
61
+ [IBM Telemetry documentation](https://github.com/ibm-telemetry/telemetry-js/tree/main#ibm-telemetry-collection-basics).
package/docs/sass.md CHANGED
@@ -20,30 +20,30 @@ the following:
20
20
 
21
21
  ## API
22
22
 
23
- | Export | Description | !default |
24
- | :------------------ | :---------- | :------- |
25
- | `$spacing-01` | | ✅ |
26
- | `$spacing-02` | | ✅ |
27
- | `$spacing-03` | | ✅ |
28
- | `$spacing-04` | | ✅ |
29
- | `$spacing-05` | | ✅ |
30
- | `$spacing-06` | | ✅ |
31
- | `$spacing-07` | | ✅ |
32
- | `$spacing-08` | | ✅ |
33
- | `$spacing-09` | | ✅ |
34
- | `$spacing-10` | | ✅ |
35
- | `$spacing-11` | | ✅ |
36
- | `$spacing-12` | | ✅ |
37
- | `$spacing-13` | | ✅ |
38
- | `$spacing ` | | |
39
- | `$fluid-spacing-01` | | ✅ |
40
- | `$fluid-spacing-02` | | ✅ |
41
- | `$fluid-spacing-03` | | ✅ |
42
- | `$fluid-spacing-04` | | ✅ |
43
- | `$fluid-spacing ` | | |
44
- | `@function em` | | |
45
- | `@function rem` | | |
46
- | `$base-font-size` | | ✅ |
23
+ | Export | Description | !default |
24
+ | :---------------------- | :---------- | :------- |
25
+ | `$spacing-01` | | ✅ |
26
+ | `$spacing-02` | | ✅ |
27
+ | `$spacing-03` | | ✅ |
28
+ | `$spacing-04` | | ✅ |
29
+ | `$spacing-05` | | ✅ |
30
+ | `$spacing-06` | | ✅ |
31
+ | `$spacing-07` | | ✅ |
32
+ | `$spacing-08` | | ✅ |
33
+ | `$spacing-09` | | ✅ |
34
+ | `$spacing-10` | | ✅ |
35
+ | `$spacing-11` | | ✅ |
36
+ | `$spacing-12` | | ✅ |
37
+ | `$spacing-13` | | ✅ |
38
+ | `$spacing ` | | |
39
+ | `$fluid-spacing-01` | | ✅ |
40
+ | `$fluid-spacing-02` | | ✅ |
41
+ | `$fluid-spacing-03` | | ✅ |
42
+ | `$fluid-spacing-04` | | ✅ |
43
+ | `$fluid-spacing ` | | |
44
+ | `@function em` | | |
45
+ | `@function carbon--rem` | | |
46
+ | `$base-font-size` | | ✅ |
47
47
 
48
48
  ### Configuration
49
49
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/layout",
3
3
  "description": "Layout helpers for digital and software products using the Carbon Design System",
4
- "version": "10.37.1",
4
+ "version": "10.37.3",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -26,10 +26,11 @@
26
26
  },
27
27
  "scripts": {
28
28
  "build": "yarn clean && carbon-cli bundle src/index.js --name CarbonLayout && node tasks/build.js",
29
- "clean": "rimraf es lib umd scss/generated scss/modules/generated"
29
+ "clean": "rimraf es lib umd scss/generated scss/modules/generated",
30
+ "postinstall": "ibmtelemetry --config=telemetry.yml"
30
31
  },
31
32
  "devDependencies": {
32
- "@carbon/cli": "^10.34.0",
33
+ "@carbon/cli": "^10.34.3",
33
34
  "@carbon/cli-reporter": "^10.5.0",
34
35
  "@carbon/scss-generator": "^10.13.0",
35
36
  "@carbon/test-utils": "^10.21.1",
@@ -42,5 +43,8 @@
42
43
  "sassDir": "scss",
43
44
  "needs": "^1.3.0"
44
45
  },
45
- "gitHead": "9b11eecab91c41ae4ffda711c5e1f631f2fb33db"
46
+ "dependencies": {
47
+ "@ibm/telemetry-js": "^1.2.1"
48
+ },
49
+ "gitHead": "4e41819f51f1294d467e12995c217ed83f695249"
46
50
  }
@@ -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: bf462a00-a4ac-4660-8554-c59ce1f088e8
4
+ endpoint: https://collector-prod.1am6wm210aow.us-south.codeengine.appdomain.cloud/v1/metrics
5
+ collect:
6
+ npm:
7
+ dependencies: null