@kaizen/tailwind 0.4.2 → 0.5.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.5.0](https://github.com/cultureamp/kaizen-design-system/compare/@kaizen/tailwind@0.4.2...@kaizen/tailwind@0.5.0) (2023-02-20)
7
+
8
+
9
+ ### Features
10
+
11
+ * Backport new pixel-based spacing tokens to design tokens ([#3279](https://github.com/cultureamp/kaizen-design-system/issues/3279)) ([a13da27](https://github.com/cultureamp/kaizen-design-system/commit/a13da271af79daafa93a144109b60d00c9f6111a))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.4.2](https://github.com/cultureamp/kaizen-design-system/compare/@kaizen/tailwind@0.4.1...@kaizen/tailwind@0.4.2) (2023-02-17)
7
18
 
8
19
  **Note:** Version bump only for package @kaizen/tailwind
@@ -1,27 +1,3 @@
1
- export declare const kzSpacing: {
2
- 0: string;
3
- 1: string;
4
- 2: string;
5
- 4: string;
6
- 6: string;
7
- 8: string;
8
- 12: string;
9
- 16: string;
10
- 24: string;
11
- 32: string;
12
- 40: string;
13
- 48: string;
14
- 56: string;
15
- 64: string;
16
- 72: string;
17
- 80: string;
18
- 96: string;
19
- 112: string;
20
- 128: string;
21
- 160: string;
22
- 200: string;
23
- 240: string;
24
- 280: string;
25
- 320: string;
26
- };
1
+ export declare const filterOutNonPixelTokens: (spacingTokensObject: Record<string, string>) => Record<string, string>;
2
+ export declare const kzSpacing: Record<string, string>;
27
3
  //# sourceMappingURL=kz-spacing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kz-spacing.d.ts","sourceRoot":"","sources":["../src/kz-spacing.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;CAyBrB,CAAA"}
1
+ {"version":3,"file":"kz-spacing.d.ts","sourceRoot":"","sources":["../src/kz-spacing.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,wBACb,OAAO,MAAM,EAAE,MAAM,CAAC,KAC1C,OAAO,MAAM,EAAE,MAAM,CAMvB,CAAA;AAED,eAAO,MAAM,SAAS,wBAA8C,CAAA"}
@@ -1,30 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.kzSpacing = void 0;
4
- exports.kzSpacing = {
5
- 0: "0",
6
- 1: ".0625rem",
7
- 2: ".125rem",
8
- 4: ".25rem",
9
- 6: ".375rem",
10
- 8: ".5rem",
11
- 12: ".75rem",
12
- 16: "1rem",
13
- 24: "1.5rem",
14
- 32: "2rem",
15
- 40: "2.5rem",
16
- 48: "3rem",
17
- 56: "3.5rem",
18
- 64: "4rem",
19
- 72: "4.5rem",
20
- 80: "5rem",
21
- 96: "6rem",
22
- 112: "7rem",
23
- 128: "8rem",
24
- 160: "10rem",
25
- 200: "12.5rem",
26
- 240: "15rem",
27
- 280: "17.5rem",
28
- 320: "20rem",
3
+ exports.kzSpacing = exports.filterOutNonPixelTokens = void 0;
4
+ var design_tokens_1 = require("@kaizen/design-tokens");
5
+ // Filters out non-pixel-based spacing tokens, such as shirt sizes
6
+ var filterOutNonPixelTokens = function (spacingTokensObject) {
7
+ var keyValuePairs = Object.entries(spacingTokensObject);
8
+ return Object.fromEntries(keyValuePairs.filter(function (_a) {
9
+ var key = _a[0], value = _a[1];
10
+ return !Number.isNaN(Number(key));
11
+ }));
29
12
  };
13
+ exports.filterOutNonPixelTokens = filterOutNonPixelTokens;
14
+ exports.kzSpacing = (0, exports.filterOutNonPixelTokens)(design_tokens_1.heartTheme.spacing);
30
15
  //# sourceMappingURL=kz-spacing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kz-spacing.js","sourceRoot":"","sources":["../src/kz-spacing.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAG;IACvB,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,OAAO;IACV,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,OAAO;CACb,CAAA"}
1
+ {"version":3,"file":"kz-spacing.js","sourceRoot":"","sources":["../src/kz-spacing.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAElD,kEAAkE;AAC3D,IAAM,uBAAuB,GAAG,UACrC,mBAA2C;IAE3C,IAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAEzD,OAAO,MAAM,CAAC,WAAW,CACvB,aAAa,CAAC,MAAM,CAAC,UAAC,EAAY;YAAX,GAAG,QAAA,EAAE,KAAK,QAAA;QAAM,OAAA,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAA1B,CAA0B,CAAC,CACnE,CAAA;AACH,CAAC,CAAA;AARY,QAAA,uBAAuB,2BAQnC;AAEY,QAAA,SAAS,GAAG,IAAA,+BAAuB,EAAC,0BAAU,CAAC,OAAO,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/tailwind",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "Kaizen Tailwind presets",
5
5
  "scripts": {
6
6
  "build": "yarn clean && yarn prepublish",
@@ -28,7 +28,7 @@
28
28
  "private": false,
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "@kaizen/design-tokens": "^10.2.2",
31
+ "@kaizen/design-tokens": "^10.3.0",
32
32
  "classnames": "^2.3.2"
33
33
  },
34
34
  "devDependencies": {
@@ -39,5 +39,5 @@
39
39
  "peerDependencies": {
40
40
  "react": "^16.14.0 || ^17.0.0 || ^18.0.0"
41
41
  },
42
- "gitHead": "318416ce6c1c6d21bb279bcd9ad5156fab14a824"
42
+ "gitHead": "b5810f16259b2104e1e8567f53961e1c6eaa22dd"
43
43
  }
package/src/kz-spacing.ts CHANGED
@@ -1,28 +1,14 @@
1
- import { defaultTheme } from "@kaizen/design-tokens"
1
+ import { heartTheme } from "@kaizen/design-tokens"
2
2
 
3
- export const kzSpacing = {
4
- 0: "0",
5
- 1: ".0625rem",
6
- 2: ".125rem",
7
- 4: ".25rem",
8
- 6: ".375rem",
9
- 8: ".5rem",
10
- 12: ".75rem",
11
- 16: "1rem",
12
- 24: "1.5rem",
13
- 32: "2rem",
14
- 40: "2.5rem",
15
- 48: "3rem",
16
- 56: "3.5rem",
17
- 64: "4rem",
18
- 72: "4.5rem",
19
- 80: "5rem",
20
- 96: "6rem",
21
- 112: "7rem",
22
- 128: "8rem",
23
- 160: "10rem",
24
- 200: "12.5rem",
25
- 240: "15rem",
26
- 280: "17.5rem",
27
- 320: "20rem",
3
+ // Filters out non-pixel-based spacing tokens, such as shirt sizes
4
+ export const filterOutNonPixelTokens = (
5
+ spacingTokensObject: Record<string, string>
6
+ ): Record<string, string> => {
7
+ const keyValuePairs = Object.entries(spacingTokensObject)
8
+
9
+ return Object.fromEntries(
10
+ keyValuePairs.filter(([key, value]) => !Number.isNaN(Number(key)))
11
+ )
28
12
  }
13
+
14
+ export const kzSpacing = filterOutNonPixelTokens(heartTheme.spacing)