@kaizen/tailwind 0.6.6 → 1.0.1
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/dist/tailwind-presets.d.ts.map +1 -1
- package/dist/tailwind-presets.js +1 -21
- package/dist/tailwind-presets.js.map +1 -1
- package/package.json +6 -10
- package/src/kz-spacing.spec.ts +19 -0
- package/src/tailwind-presets.ts +0 -20
- package/dist/kz-width.d.ts +0 -13
- package/dist/kz-width.d.ts.map +0 -1
- package/dist/kz-width.js +0 -16
- package/dist/kz-width.js.map +0 -1
- package/src/kz-width.ts +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-presets.d.ts","sourceRoot":"","sources":["../src/tailwind-presets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"tailwind-presets.d.ts","sourceRoot":"","sources":["../src/tailwind-presets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAItD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AACtD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,mBAAmB,CAAA;CAC3B;AAGD,eAAO,MAAM,mBAAmB,EAAE,mBA2FjC,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,oBAEpB,CAAA"}
|
package/dist/tailwind-presets.js
CHANGED
|
@@ -13,9 +13,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.Preset = exports.kaizenTailwindTheme = void 0;
|
|
15
15
|
var design_tokens_1 = require("@kaizen/design-tokens");
|
|
16
|
-
var kz_height_1 = require("./kz-height");
|
|
17
16
|
var kz_spacing_1 = require("./kz-spacing");
|
|
18
|
-
var kz_width_1 = require("./kz-width");
|
|
19
17
|
// Note: changing any token will require to to run build:ts from the root `design-tokens`
|
|
20
18
|
exports.kaizenTailwindTheme = {
|
|
21
19
|
colors: __assign(__assign({ transparent: "transparent", current: "currentColor", inherit: "inherit" }, design_tokens_1.defaultTheme.color), design_tokens_1.defaultTheme.dataViz),
|
|
@@ -92,28 +90,10 @@ exports.kaizenTailwindTheme = {
|
|
|
92
90
|
"letter-spacing-normal": "normal",
|
|
93
91
|
},
|
|
94
92
|
// A mix of layout styles
|
|
95
|
-
maxWidth: kz_width_1.kzWidth,
|
|
96
|
-
width: kz_width_1.kzWidth,
|
|
97
|
-
maxHeight: kz_height_1.kzHeight,
|
|
98
|
-
height: kz_height_1.kzHeight,
|
|
99
93
|
screens: {
|
|
100
94
|
md: design_tokens_1.defaultTheme.layout.breakpoints.medium,
|
|
101
|
-
lg: design_tokens_1.defaultTheme.layout.breakpoints.large,
|
|
102
|
-
"md-max": { max: design_tokens_1.defaultTheme.layout.breakpoints.medium },
|
|
103
|
-
"lg-max": { max: design_tokens_1.defaultTheme.layout.breakpoints.large }, // => @media (min-width: 1080px) { ... }
|
|
95
|
+
lg: design_tokens_1.defaultTheme.layout.breakpoints.large, // => @media (min-width: 1080px) { ... }
|
|
104
96
|
},
|
|
105
|
-
// TODO: These work in TW Play but not in our Storybook config.
|
|
106
|
-
// Add these when we get them working in Storybook.
|
|
107
|
-
// ringWidth: {
|
|
108
|
-
// "default-width": `${defaultTheme.border.focusRing.borderWidth}`,
|
|
109
|
-
// },
|
|
110
|
-
// ringOffsetWidth: {
|
|
111
|
-
// "default-width": "2px",
|
|
112
|
-
// },
|
|
113
|
-
// ringColor: {
|
|
114
|
-
// "default-color": `${defaultTheme.color.blue[500]}`,
|
|
115
|
-
// },
|
|
116
|
-
// ringOffsetColor: {},
|
|
117
97
|
};
|
|
118
98
|
exports.Preset = {
|
|
119
99
|
theme: exports.kaizenTailwindTheme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-presets.js","sourceRoot":"","sources":["../src/tailwind-presets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,uDAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"tailwind-presets.js","sourceRoot":"","sources":["../src/tailwind-presets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,uDAAoD;AACpD,2CAAwC;AAOxC,yFAAyF;AAC5E,QAAA,mBAAmB,GAAwB;IACtD,MAAM,sBACJ,WAAW,EAAE,aAAa,EAC1B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,SAAS,IACf,4BAAY,CAAC,KAAK,GAClB,4BAAY,CAAC,OAAO,CACxB;IACD,OAAO,EAAE,sBAAS;IAClB,SAAS,EAAE;QACT,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,4BAAY,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS;QACvC,EAAE,EAAE,4BAAY,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS;KACxC;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,KAAK;QACX,YAAY,EAAE,MAAM;QACpB,IAAI,EAAE,MAAM;KACb;IAED,WAAW,EAAE;QACX,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,KAAK;KACpB;IACD,WAAW,aACT,eAAe,EAAE,UAAG,4BAAY,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAE,EAC3D,WAAW,EAAE,UAAG,4BAAY,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAE,EAC5D,YAAY,EAAE,4BAAY,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IACvC,4BAAY,CAAC,KAAK,CACtB;IACD,UAAU,EAAE;QACV,kBAAkB,EAAE,CAAC,UAAG,4BAAY,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAAE,CAAC;QAC3E,gBAAgB,EAAE,CAAC,UAAG,4BAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAE,CAAC;QACpE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AAC,mBAAmB,CAAC,UAAU,CAAE;QAC3E,SAAS,EAAE,UAAG,4BAAY,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAE;QAC5D,SAAS,EAAE,UAAG,4BAAY,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAE;QAC7D,SAAS,EAAE,UAAG,4BAAY,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAE;QAC5D,eAAe,EAAE,UAAG,4BAAY,CAAC,UAAU,CAAC,cAAc,CAAC,UAAU,CAAE;QACvE,eAAe,EAAE,UAAG,4BAAY,CAAC,UAAU,CAAC,eAAe,CAAC,UAAU,CAAE;QACxE,eAAe,EAAE,UAAG,4BAAY,CAAC,UAAU,CAAC,cAAc,CAAC,UAAU,CAAE;KACxE;IACD,aAAa,EAAE;QACb,uBAAuB,EAAE,QAAQ;KAClC;IACD,yBAAyB;IACzB,OAAO,EAAE;QACP,EAAE,EAAE,4BAAY,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM;QAC1C,EAAE,EAAE,4BAAY,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,wCAAwC;KACpF;CACF,CAAA;AAEY,QAAA,MAAM,GAAyB;IAC1C,KAAK,EAAE,2BAAmB;CAC3B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/tailwind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Kaizen Tailwind presets",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "yarn
|
|
6
|
+
"build": "yarn prepublish",
|
|
7
7
|
"build:ts": "tsc --project tsconfig.dist.json",
|
|
8
|
-
"build:watch": "yarn clean && yarn prepublish --watch",
|
|
9
8
|
"prepublish": "tsc --project tsconfig.dist.json",
|
|
10
|
-
"clean": "rimraf '**/*.d.ts' '**/*.js' '**/*.map'"
|
|
9
|
+
"clean": "rimraf -g '**/*.d.ts' '**/*.js' '**/*.map'"
|
|
11
10
|
},
|
|
12
11
|
"repository": {
|
|
13
12
|
"type": "git",
|
|
@@ -19,21 +18,18 @@
|
|
|
19
18
|
},
|
|
20
19
|
"files": [
|
|
21
20
|
"src",
|
|
22
|
-
"dist"
|
|
23
|
-
"!**/*.spec.*",
|
|
24
|
-
"!docs"
|
|
21
|
+
"dist"
|
|
25
22
|
],
|
|
26
23
|
"main": "dist/index.js",
|
|
27
24
|
"author": "",
|
|
28
25
|
"private": false,
|
|
29
26
|
"license": "MIT",
|
|
30
27
|
"dependencies": {
|
|
31
|
-
"@kaizen/design-tokens": "^10.3.
|
|
28
|
+
"@kaizen/design-tokens": "^10.3.8",
|
|
32
29
|
"classnames": "^2.3.2"
|
|
33
30
|
},
|
|
34
31
|
"devDependencies": {
|
|
35
|
-
"@kaizen/draft-divider": "^2.2.
|
|
36
|
-
"rimraf": "^4.4.1",
|
|
32
|
+
"@kaizen/draft-divider": "^2.2.10",
|
|
37
33
|
"tailwindcss": "^3.3.2"
|
|
38
34
|
},
|
|
39
35
|
"peerDependencies": {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { filterOutNonPixelTokens } from "./kz-spacing"
|
|
2
|
+
|
|
3
|
+
describe("filterOutNonPixelTokens", () => {
|
|
4
|
+
it("Keeps all numeric keys", () => {
|
|
5
|
+
const result = filterOutNonPixelTokens({
|
|
6
|
+
0: "0",
|
|
7
|
+
xs: "0.375rem",
|
|
8
|
+
1: ".0625rem",
|
|
9
|
+
sm: "0.75rem",
|
|
10
|
+
2: ".125rem",
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
expect(result).toEqual({
|
|
14
|
+
0: "0",
|
|
15
|
+
1: ".0625rem",
|
|
16
|
+
2: ".125rem",
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
})
|
package/src/tailwind-presets.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ThemeConfig } from "tailwindcss/types/config"
|
|
2
2
|
import { defaultTheme } from "@kaizen/design-tokens"
|
|
3
|
-
import { kzHeight } from "./kz-height"
|
|
4
3
|
import { kzSpacing } from "./kz-spacing"
|
|
5
|
-
import { kzWidth } from "./kz-width"
|
|
6
4
|
|
|
7
5
|
export type KaizenTailwindTheme = Partial<ThemeConfig>
|
|
8
6
|
export interface KaizenTailwindPreset {
|
|
@@ -97,28 +95,10 @@ export const kaizenTailwindTheme: KaizenTailwindTheme = {
|
|
|
97
95
|
"letter-spacing-normal": "normal",
|
|
98
96
|
},
|
|
99
97
|
// A mix of layout styles
|
|
100
|
-
maxWidth: kzWidth,
|
|
101
|
-
width: kzWidth,
|
|
102
|
-
maxHeight: kzHeight,
|
|
103
|
-
height: kzHeight,
|
|
104
98
|
screens: {
|
|
105
99
|
md: defaultTheme.layout.breakpoints.medium, // => @media (min-width: 768px) { ... }
|
|
106
100
|
lg: defaultTheme.layout.breakpoints.large, // => @media (min-width: 1080px) { ... }
|
|
107
|
-
"md-max": { max: defaultTheme.layout.breakpoints.medium }, // => @media (max-width: 768px) { ... }
|
|
108
|
-
"lg-max": { max: defaultTheme.layout.breakpoints.large }, // => @media (min-width: 1080px) { ... }
|
|
109
101
|
},
|
|
110
|
-
// TODO: These work in TW Play but not in our Storybook config.
|
|
111
|
-
// Add these when we get them working in Storybook.
|
|
112
|
-
// ringWidth: {
|
|
113
|
-
// "default-width": `${defaultTheme.border.focusRing.borderWidth}`,
|
|
114
|
-
// },
|
|
115
|
-
// ringOffsetWidth: {
|
|
116
|
-
// "default-width": "2px",
|
|
117
|
-
// },
|
|
118
|
-
// ringColor: {
|
|
119
|
-
// "default-color": `${defaultTheme.color.blue[500]}`,
|
|
120
|
-
// },
|
|
121
|
-
// ringOffsetColor: {},
|
|
122
102
|
}
|
|
123
103
|
|
|
124
104
|
export const Preset: KaizenTailwindPreset = {
|
package/dist/kz-width.d.ts
DELETED
package/dist/kz-width.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kz-width.d.ts","sourceRoot":"","sources":["../src/kz-width.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;;;;CAWnB,CAAA"}
|
package/dist/kz-width.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.kzWidth = void 0;
|
|
4
|
-
exports.kzWidth = {
|
|
5
|
-
0: "0",
|
|
6
|
-
25: "25%",
|
|
7
|
-
33: "33.333333%",
|
|
8
|
-
50: "50%",
|
|
9
|
-
75: "75%",
|
|
10
|
-
100: "100%",
|
|
11
|
-
auto: "auto",
|
|
12
|
-
min: "min-content",
|
|
13
|
-
max: "max-content",
|
|
14
|
-
fit: "fit-content",
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=kz-width.js.map
|
package/dist/kz-width.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kz-width.js","sourceRoot":"","sources":["../src/kz-width.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG;IACrB,CAAC,EAAE,GAAG;IACN,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,aAAa;CACnB,CAAA"}
|