@kaizen/tailwind 1.2.13 → 1.3.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/dist/cjs/index.cjs +5 -0
- package/dist/cjs/kz-spacing.cjs +21 -0
- package/dist/cjs/tailwind-presets.cjs +112 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/kz-spacing.mjs +18 -0
- package/dist/esm/tailwind-presets.mjs +109 -0
- package/dist/{index.d.ts → types/index.d.ts} +0 -1
- package/dist/{kz-height.d.ts → types/kz-height.d.ts} +0 -1
- package/dist/{kz-spacing.d.ts → types/kz-spacing.d.ts} +0 -1
- package/dist/{tailwind-presets.d.ts → types/tailwind-presets.d.ts} +0 -1
- package/package.json +16 -5
- package/src/_docs/assets/copy-utility-class.gif +0 -0
- package/src/_docs/assets/css-generation.png +0 -0
- package/src/_docs/assets/inline-fold.gif +0 -0
- package/src/_docs/assets/tailwind-play.gif +0 -0
- package/src/_docs/assets/tw-anatomy.png +0 -0
- package/src/_docs/assets/utility-search-result.png +0 -0
- package/src/_docs/pages/backgrounds/background-color.mdx +10 -0
- package/src/_docs/pages/backgrounds/background-color.stories.tsx +43 -0
- package/src/_docs/pages/borders/border-color.mdx +10 -0
- package/src/_docs/pages/borders/border-color.stories.tsx +45 -0
- package/src/_docs/pages/borders/border-radius.mdx +10 -0
- package/src/_docs/pages/borders/border-radius.stories.tsx +47 -0
- package/src/_docs/pages/borders/border-spacing.mdx +10 -0
- package/src/_docs/pages/borders/border-spacing.stories.tsx +52 -0
- package/src/_docs/pages/borders/border-width.mdx +28 -0
- package/src/_docs/pages/borders/border-width.stories.tsx +47 -0
- package/src/_docs/pages/configuration.mdx +78 -0
- package/src/_docs/pages/contributing.mdx +38 -0
- package/src/_docs/pages/effects/shadow.mdx +10 -0
- package/src/_docs/pages/effects/shadow.stories.tsx +40 -0
- package/src/_docs/pages/getting-started.mdx +125 -0
- package/src/_docs/pages/modifiers/media-queries.mdx +16 -0
- package/src/_docs/pages/modifiers/media-queries.stories.tsx +81 -0
- package/src/_docs/pages/modifiers/pseudo-states.mdx +26 -0
- package/src/_docs/pages/modifiers/pseudo-states.stories.tsx +49 -0
- package/src/_docs/pages/overview.mdx +26 -0
- package/src/_docs/pages/spacing/margin.mdx +27 -0
- package/src/_docs/pages/spacing/margin.stories.tsx +49 -0
- package/src/_docs/pages/spacing/padding.mdx +27 -0
- package/src/_docs/pages/spacing/padding.stories.tsx +47 -0
- package/src/_docs/pages/typography/font-family.mdx +10 -0
- package/src/_docs/pages/typography/font-family.stories.tsx +41 -0
- package/src/_docs/pages/typography/font-size.mdx +10 -0
- package/src/_docs/pages/typography/font-size.stories.tsx +38 -0
- package/src/_docs/pages/typography/font-weight.mdx +10 -0
- package/src/_docs/pages/typography/font-weight.stories.tsx +41 -0
- package/src/_docs/pages/typography/line-height.mdx +10 -0
- package/src/_docs/pages/typography/line-height.stories.tsx +44 -0
- package/src/_docs/pages/typography/max-text-width.mdx +12 -0
- package/src/_docs/pages/typography/max-text-width.stories.tsx +60 -0
- package/src/_docs/pages/typography/text-color.mdx +10 -0
- package/src/_docs/pages/typography/text-color.stories.tsx +52 -0
- package/src/_docs/pages/utility-class-helpers-overview.mdx +95 -0
- package/src/_docs/pages/working-with-tailwind.mdx +85 -0
- package/src/_docs/pages/working-with-tailwind.stories.tsx +100 -0
- package/src/_docs/utils/TailwindStoryTemplate/TailwindStoryTemplate.tsx +81 -0
- package/src/_docs/utils/TailwindStoryTemplate/components/CardContent/CardContent.tsx +26 -0
- package/src/_docs/utils/TailwindStoryTemplate/components/CardContent/index.ts +1 -0
- package/src/_docs/utils/TailwindStoryTemplate/components/CodeSnippet/CodeSnippet.tsx +36 -0
- package/src/_docs/utils/TailwindStoryTemplate/components/CodeSnippet/index.ts +1 -0
- package/src/_docs/utils/TailwindStoryTemplate/index.ts +1 -0
- package/src/_docs/utils/flattenEntries.ts +37 -0
- package/src/_docs/utils/utilityDescription.ts +5 -0
- package/src/tailwind-presets.ts +53 -53
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -18
- package/dist/index.js.map +0 -1
- package/dist/kz-height.d.ts.map +0 -1
- package/dist/kz-height.js +0 -16
- package/dist/kz-height.js.map +0 -1
- package/dist/kz-spacing.d.ts.map +0 -1
- package/dist/kz-spacing.js +0 -41
- package/dist/kz-spacing.js.map +0 -1
- package/dist/tailwind-presets.d.ts.map +0 -1
- package/dist/tailwind-presets.js +0 -112
- package/dist/tailwind-presets.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var designTokens = require('@kaizen/design-tokens');
|
|
4
|
+
var tokenDenyList = ["xs", "sm", "md", "lg", "xl", "xxl", "xxxl", "xxxxl", "xxxxxl", "xs-id", "sm-id", "md-id", "lg-id", "xl-id", "xxl-id", "xxxl-id", "xxxxl-id", "xxxxxl-id"];
|
|
5
|
+
/**
|
|
6
|
+
* checks if a key from design tokens should be filtered from tailwind
|
|
7
|
+
*/
|
|
8
|
+
var isValidToken = function (key) {
|
|
9
|
+
return tokenDenyList.indexOf("".concat(key)) < 0;
|
|
10
|
+
};
|
|
11
|
+
// Filters out non-pixel-based spacing tokens, such as shirt sizes
|
|
12
|
+
var filterDenyListValues = function (spacingTokensObject) {
|
|
13
|
+
var keyValuePairs = Object.entries(spacingTokensObject);
|
|
14
|
+
return Object.fromEntries(keyValuePairs.filter(function (_a) {
|
|
15
|
+
var key = _a[0];
|
|
16
|
+
return isValidToken(key);
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
var kzSpacing = filterDenyListValues(designTokens.heartTheme.spacing);
|
|
20
|
+
exports.filterDenyListValues = filterDenyListValues;
|
|
21
|
+
exports.kzSpacing = kzSpacing;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var js = require('@kaizen/design-tokens/js');
|
|
5
|
+
var kzSpacing = require('./kz-spacing.cjs');
|
|
6
|
+
|
|
7
|
+
// Note: changing any token will require to to run `pnpm build` from the root
|
|
8
|
+
var kaizenTailwindTheme = {
|
|
9
|
+
extend: {
|
|
10
|
+
maxWidth: {
|
|
11
|
+
paragraph: "".concat(js.tokens.typography.paragraphBody.maxWidth),
|
|
12
|
+
"paragraph-lede": "".concat(js.tokens.typography.paragraphIntroLede.maxWidth),
|
|
13
|
+
"paragraph-sm": "".concat(js.tokens.typography.paragraphSmall.maxWidth),
|
|
14
|
+
"paragraph-xs": "".concat(js.tokens.typography.paragraphExtraSmall.maxWidth)
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
colors: tslib.__assign(tslib.__assign({
|
|
18
|
+
transparent: "transparent",
|
|
19
|
+
current: "currentColor",
|
|
20
|
+
inherit: "inherit"
|
|
21
|
+
}, js.tokens.color), js.tokens.dataViz),
|
|
22
|
+
spacing: kzSpacing.kzSpacing,
|
|
23
|
+
boxShadow: {
|
|
24
|
+
none: "none",
|
|
25
|
+
sm: js.tokens.shadow.small.boxShadow,
|
|
26
|
+
lg: js.tokens.shadow.large.boxShadow
|
|
27
|
+
},
|
|
28
|
+
borderRadius: {
|
|
29
|
+
DEFAULT: "7px",
|
|
30
|
+
default: "7px",
|
|
31
|
+
none: "0px",
|
|
32
|
+
"focus-ring": "10px",
|
|
33
|
+
full: "100%"
|
|
34
|
+
},
|
|
35
|
+
borderWidth: {
|
|
36
|
+
DEFAULT: "2px",
|
|
37
|
+
default: "2px",
|
|
38
|
+
none: "0px",
|
|
39
|
+
1: "1px",
|
|
40
|
+
"focus-ring": "2px"
|
|
41
|
+
},
|
|
42
|
+
borderColor: tslib.__assign({
|
|
43
|
+
"default-color": "".concat(js.tokens.border.solid.borderColor),
|
|
44
|
+
transparent: "".concat(js.tokens.border.borderless.borderColor),
|
|
45
|
+
"focus-ring": js.tokens.color.blue[600]
|
|
46
|
+
}, js.tokens.color),
|
|
47
|
+
fontFamily: {
|
|
48
|
+
"family-paragraph": ["".concat(js.tokens.typography.paragraphBody.fontFamily)],
|
|
49
|
+
"family-heading": ["".concat(js.tokens.typography.heading1.fontFamily)],
|
|
50
|
+
"family-data": ["".concat(js.tokens.typography.dataLarge.fontFamily)],
|
|
51
|
+
"family-display": ["".concat(js.tokens.typography.display0.fontFamily)]
|
|
52
|
+
},
|
|
53
|
+
fontSize: {
|
|
54
|
+
display: "".concat(js.tokens.typography.display0.fontSize),
|
|
55
|
+
"heading-1": "".concat(js.tokens.typography.heading1.fontSize),
|
|
56
|
+
"heading-2": "".concat(js.tokens.typography.heading2.fontSize),
|
|
57
|
+
"heading-3": "".concat(js.tokens.typography.heading3.fontSize),
|
|
58
|
+
"heading-4": "".concat(js.tokens.typography.heading4.fontSize),
|
|
59
|
+
"heading-5": "".concat(js.tokens.typography.heading5.fontSize),
|
|
60
|
+
"heading-6": "".concat(js.tokens.typography.heading6.fontSize),
|
|
61
|
+
paragraph: "".concat(js.tokens.typography.paragraphBody.fontSize),
|
|
62
|
+
"paragraph-lede": "".concat(js.tokens.typography.paragraphIntroLede.fontSize),
|
|
63
|
+
"paragraph-sm": "".concat(js.tokens.typography.paragraphSmall.fontSize),
|
|
64
|
+
"paragraph-xs": "".concat(js.tokens.typography.paragraphExtraSmall.fontSize),
|
|
65
|
+
"data-lg": "".concat(js.tokens.typography.dataLarge.fontSize),
|
|
66
|
+
"data-md": "".concat(js.tokens.typography.dataMedium.fontSize),
|
|
67
|
+
"data-sm": "".concat(js.tokens.typography.dataSmall.fontSize),
|
|
68
|
+
"data-units-lg": "".concat(js.tokens.typography.dataLargeUnits.fontSize),
|
|
69
|
+
"data-units-md": "".concat(js.tokens.typography.dataMediumUnits.fontSize),
|
|
70
|
+
"data-units-sm": "".concat(js.tokens.typography.dataSmallUnits.fontSize)
|
|
71
|
+
},
|
|
72
|
+
fontWeight: {
|
|
73
|
+
"weight-paragraph": "400",
|
|
74
|
+
"weight-paragraph-bold": "600",
|
|
75
|
+
"weight-data": "700",
|
|
76
|
+
"weight-heading": "700",
|
|
77
|
+
"weight-display": "800"
|
|
78
|
+
},
|
|
79
|
+
lineHeight: {
|
|
80
|
+
display: "".concat(js.tokens.typography.display0.lineHeight),
|
|
81
|
+
"heading-1": "".concat(js.tokens.typography.heading1.lineHeight),
|
|
82
|
+
"heading-2": "".concat(js.tokens.typography.heading2.lineHeight),
|
|
83
|
+
"heading-3": "".concat(js.tokens.typography.heading3.lineHeight),
|
|
84
|
+
"heading-4": "".concat(js.tokens.typography.heading4.lineHeight),
|
|
85
|
+
"heading-5": "".concat(js.tokens.typography.heading5.lineHeight),
|
|
86
|
+
"heading-6": "".concat(js.tokens.typography.heading6.lineHeight),
|
|
87
|
+
paragraph: "".concat(js.tokens.typography.paragraphBody.lineHeight),
|
|
88
|
+
"paragraph-lede": "".concat(js.tokens.typography.paragraphIntroLede.lineHeight),
|
|
89
|
+
"paragraph-sm": "".concat(js.tokens.typography.paragraphSmall.lineHeight),
|
|
90
|
+
"paragraph-xs": "".concat(js.tokens.typography.paragraphExtraSmall.lineHeight),
|
|
91
|
+
"data-lg": "".concat(js.tokens.typography.dataLarge.lineHeight),
|
|
92
|
+
"data-md": "".concat(js.tokens.typography.dataMedium.lineHeight),
|
|
93
|
+
"data-sm": "".concat(js.tokens.typography.dataSmall.lineHeight),
|
|
94
|
+
"data-units-lg": "".concat(js.tokens.typography.dataLargeUnits.lineHeight),
|
|
95
|
+
"data-units-md": "".concat(js.tokens.typography.dataMediumUnits.lineHeight),
|
|
96
|
+
"data-units-sm": "".concat(js.tokens.typography.dataSmallUnits.lineHeight)
|
|
97
|
+
},
|
|
98
|
+
letterSpacing: {
|
|
99
|
+
"letter-spacing-normal": "normal"
|
|
100
|
+
},
|
|
101
|
+
// A mix of layout styles
|
|
102
|
+
screens: {
|
|
103
|
+
md: js.tokens.layout.breakpoints.medium,
|
|
104
|
+
// => @media (min-width: 768px) { ... }
|
|
105
|
+
lg: js.tokens.layout.breakpoints.large // => @media (min-width: 1080px) { ... }
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
var Preset = {
|
|
109
|
+
theme: kaizenTailwindTheme
|
|
110
|
+
};
|
|
111
|
+
exports.Preset = Preset;
|
|
112
|
+
exports.kaizenTailwindTheme = kaizenTailwindTheme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Preset, kaizenTailwindTheme } from './tailwind-presets.mjs';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { heartTheme } from '@kaizen/design-tokens';
|
|
2
|
+
var tokenDenyList = ["xs", "sm", "md", "lg", "xl", "xxl", "xxxl", "xxxxl", "xxxxxl", "xs-id", "sm-id", "md-id", "lg-id", "xl-id", "xxl-id", "xxxl-id", "xxxxl-id", "xxxxxl-id"];
|
|
3
|
+
/**
|
|
4
|
+
* checks if a key from design tokens should be filtered from tailwind
|
|
5
|
+
*/
|
|
6
|
+
var isValidToken = function (key) {
|
|
7
|
+
return tokenDenyList.indexOf("".concat(key)) < 0;
|
|
8
|
+
};
|
|
9
|
+
// Filters out non-pixel-based spacing tokens, such as shirt sizes
|
|
10
|
+
var filterDenyListValues = function (spacingTokensObject) {
|
|
11
|
+
var keyValuePairs = Object.entries(spacingTokensObject);
|
|
12
|
+
return Object.fromEntries(keyValuePairs.filter(function (_a) {
|
|
13
|
+
var key = _a[0];
|
|
14
|
+
return isValidToken(key);
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
var kzSpacing = filterDenyListValues(heartTheme.spacing);
|
|
18
|
+
export { filterDenyListValues, kzSpacing };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { __assign } from 'tslib';
|
|
2
|
+
import { tokens } from '@kaizen/design-tokens/js';
|
|
3
|
+
import { kzSpacing } from './kz-spacing.mjs';
|
|
4
|
+
|
|
5
|
+
// Note: changing any token will require to to run `pnpm build` from the root
|
|
6
|
+
var kaizenTailwindTheme = {
|
|
7
|
+
extend: {
|
|
8
|
+
maxWidth: {
|
|
9
|
+
paragraph: "".concat(tokens.typography.paragraphBody.maxWidth),
|
|
10
|
+
"paragraph-lede": "".concat(tokens.typography.paragraphIntroLede.maxWidth),
|
|
11
|
+
"paragraph-sm": "".concat(tokens.typography.paragraphSmall.maxWidth),
|
|
12
|
+
"paragraph-xs": "".concat(tokens.typography.paragraphExtraSmall.maxWidth)
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
colors: __assign(__assign({
|
|
16
|
+
transparent: "transparent",
|
|
17
|
+
current: "currentColor",
|
|
18
|
+
inherit: "inherit"
|
|
19
|
+
}, tokens.color), tokens.dataViz),
|
|
20
|
+
spacing: kzSpacing,
|
|
21
|
+
boxShadow: {
|
|
22
|
+
none: "none",
|
|
23
|
+
sm: tokens.shadow.small.boxShadow,
|
|
24
|
+
lg: tokens.shadow.large.boxShadow
|
|
25
|
+
},
|
|
26
|
+
borderRadius: {
|
|
27
|
+
DEFAULT: "7px",
|
|
28
|
+
default: "7px",
|
|
29
|
+
none: "0px",
|
|
30
|
+
"focus-ring": "10px",
|
|
31
|
+
full: "100%"
|
|
32
|
+
},
|
|
33
|
+
borderWidth: {
|
|
34
|
+
DEFAULT: "2px",
|
|
35
|
+
default: "2px",
|
|
36
|
+
none: "0px",
|
|
37
|
+
1: "1px",
|
|
38
|
+
"focus-ring": "2px"
|
|
39
|
+
},
|
|
40
|
+
borderColor: __assign({
|
|
41
|
+
"default-color": "".concat(tokens.border.solid.borderColor),
|
|
42
|
+
transparent: "".concat(tokens.border.borderless.borderColor),
|
|
43
|
+
"focus-ring": tokens.color.blue[600]
|
|
44
|
+
}, tokens.color),
|
|
45
|
+
fontFamily: {
|
|
46
|
+
"family-paragraph": ["".concat(tokens.typography.paragraphBody.fontFamily)],
|
|
47
|
+
"family-heading": ["".concat(tokens.typography.heading1.fontFamily)],
|
|
48
|
+
"family-data": ["".concat(tokens.typography.dataLarge.fontFamily)],
|
|
49
|
+
"family-display": ["".concat(tokens.typography.display0.fontFamily)]
|
|
50
|
+
},
|
|
51
|
+
fontSize: {
|
|
52
|
+
display: "".concat(tokens.typography.display0.fontSize),
|
|
53
|
+
"heading-1": "".concat(tokens.typography.heading1.fontSize),
|
|
54
|
+
"heading-2": "".concat(tokens.typography.heading2.fontSize),
|
|
55
|
+
"heading-3": "".concat(tokens.typography.heading3.fontSize),
|
|
56
|
+
"heading-4": "".concat(tokens.typography.heading4.fontSize),
|
|
57
|
+
"heading-5": "".concat(tokens.typography.heading5.fontSize),
|
|
58
|
+
"heading-6": "".concat(tokens.typography.heading6.fontSize),
|
|
59
|
+
paragraph: "".concat(tokens.typography.paragraphBody.fontSize),
|
|
60
|
+
"paragraph-lede": "".concat(tokens.typography.paragraphIntroLede.fontSize),
|
|
61
|
+
"paragraph-sm": "".concat(tokens.typography.paragraphSmall.fontSize),
|
|
62
|
+
"paragraph-xs": "".concat(tokens.typography.paragraphExtraSmall.fontSize),
|
|
63
|
+
"data-lg": "".concat(tokens.typography.dataLarge.fontSize),
|
|
64
|
+
"data-md": "".concat(tokens.typography.dataMedium.fontSize),
|
|
65
|
+
"data-sm": "".concat(tokens.typography.dataSmall.fontSize),
|
|
66
|
+
"data-units-lg": "".concat(tokens.typography.dataLargeUnits.fontSize),
|
|
67
|
+
"data-units-md": "".concat(tokens.typography.dataMediumUnits.fontSize),
|
|
68
|
+
"data-units-sm": "".concat(tokens.typography.dataSmallUnits.fontSize)
|
|
69
|
+
},
|
|
70
|
+
fontWeight: {
|
|
71
|
+
"weight-paragraph": "400",
|
|
72
|
+
"weight-paragraph-bold": "600",
|
|
73
|
+
"weight-data": "700",
|
|
74
|
+
"weight-heading": "700",
|
|
75
|
+
"weight-display": "800"
|
|
76
|
+
},
|
|
77
|
+
lineHeight: {
|
|
78
|
+
display: "".concat(tokens.typography.display0.lineHeight),
|
|
79
|
+
"heading-1": "".concat(tokens.typography.heading1.lineHeight),
|
|
80
|
+
"heading-2": "".concat(tokens.typography.heading2.lineHeight),
|
|
81
|
+
"heading-3": "".concat(tokens.typography.heading3.lineHeight),
|
|
82
|
+
"heading-4": "".concat(tokens.typography.heading4.lineHeight),
|
|
83
|
+
"heading-5": "".concat(tokens.typography.heading5.lineHeight),
|
|
84
|
+
"heading-6": "".concat(tokens.typography.heading6.lineHeight),
|
|
85
|
+
paragraph: "".concat(tokens.typography.paragraphBody.lineHeight),
|
|
86
|
+
"paragraph-lede": "".concat(tokens.typography.paragraphIntroLede.lineHeight),
|
|
87
|
+
"paragraph-sm": "".concat(tokens.typography.paragraphSmall.lineHeight),
|
|
88
|
+
"paragraph-xs": "".concat(tokens.typography.paragraphExtraSmall.lineHeight),
|
|
89
|
+
"data-lg": "".concat(tokens.typography.dataLarge.lineHeight),
|
|
90
|
+
"data-md": "".concat(tokens.typography.dataMedium.lineHeight),
|
|
91
|
+
"data-sm": "".concat(tokens.typography.dataSmall.lineHeight),
|
|
92
|
+
"data-units-lg": "".concat(tokens.typography.dataLargeUnits.lineHeight),
|
|
93
|
+
"data-units-md": "".concat(tokens.typography.dataMediumUnits.lineHeight),
|
|
94
|
+
"data-units-sm": "".concat(tokens.typography.dataSmallUnits.lineHeight)
|
|
95
|
+
},
|
|
96
|
+
letterSpacing: {
|
|
97
|
+
"letter-spacing-normal": "normal"
|
|
98
|
+
},
|
|
99
|
+
// A mix of layout styles
|
|
100
|
+
screens: {
|
|
101
|
+
md: tokens.layout.breakpoints.medium,
|
|
102
|
+
// => @media (min-width: 768px) { ... }
|
|
103
|
+
lg: tokens.layout.breakpoints.large // => @media (min-width: 1080px) { ... }
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var Preset = {
|
|
107
|
+
theme: kaizenTailwindTheme
|
|
108
|
+
};
|
|
109
|
+
export { Preset, kaizenTailwindTheme };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/tailwind",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Kaizen Tailwind presets",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,20 +12,31 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"src",
|
|
15
|
-
"dist"
|
|
15
|
+
"dist",
|
|
16
|
+
"js"
|
|
16
17
|
],
|
|
17
|
-
"main": "dist/index.
|
|
18
|
+
"main": "dist/cjs/index.cjs",
|
|
19
|
+
"module": "dist/esm/index.mjs",
|
|
20
|
+
"types": "dist/types/index.d.ts",
|
|
18
21
|
"author": "",
|
|
19
22
|
"private": false,
|
|
20
23
|
"license": "MIT",
|
|
21
24
|
"dependencies": {
|
|
22
|
-
"@kaizen/design-tokens": "10.
|
|
25
|
+
"@kaizen/design-tokens": "10.6.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"classnames": "^2.5.1",
|
|
29
|
+
"rollup": "^4.20.0",
|
|
30
|
+
"tailwindcss": "^3.4.9",
|
|
31
|
+
"tslib": "^2.6.3",
|
|
32
|
+
"@kaizen/components": "1.60.0",
|
|
33
|
+
"@kaizen/package-bundler": "1.1.4"
|
|
23
34
|
},
|
|
24
35
|
"peerDependencies": {
|
|
25
36
|
"tailwindcss": ">=3.4.7"
|
|
26
37
|
},
|
|
27
38
|
"scripts": {
|
|
28
|
-
"build": "pnpm
|
|
39
|
+
"build": "pnpm package-bundler build",
|
|
29
40
|
"clean": "rimraf -g '**/*.d.ts' '**/*.js' '**/*.map'",
|
|
30
41
|
"lint:ts": "tsc --noEmit"
|
|
31
42
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react"
|
|
3
|
+
import classnames from "classnames"
|
|
4
|
+
import { TailwindStoryTemplate } from "~tailwind/_docs/utils/TailwindStoryTemplate"
|
|
5
|
+
import { flattenEntries } from "~tailwind/_docs/utils/flattenEntries"
|
|
6
|
+
import { utilityDescription } from "~tailwind/_docs/utils/utilityDescription"
|
|
7
|
+
import { kaizenTailwindTheme } from "~tailwind/tailwind-presets"
|
|
8
|
+
|
|
9
|
+
const prefix = "bg-"
|
|
10
|
+
const classEntries = flattenEntries(prefix, kaizenTailwindTheme.colors || {})
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title:
|
|
14
|
+
"Guides/Tailwind/Utility Class References/Backgrounds/Background Color",
|
|
15
|
+
parameters: {
|
|
16
|
+
a11y: { disable: true },
|
|
17
|
+
chromatic: { disable: false },
|
|
18
|
+
docsLayout: "fullPage",
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
} satisfies Meta
|
|
26
|
+
|
|
27
|
+
export const BackgroundColor: StoryFn<{ isReversed: boolean }> = ({
|
|
28
|
+
isReversed,
|
|
29
|
+
}) => (
|
|
30
|
+
<TailwindStoryTemplate
|
|
31
|
+
compiledCssPropertyName="background-color"
|
|
32
|
+
classKeyValues={classEntries}
|
|
33
|
+
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
34
|
+
<div
|
|
35
|
+
className={classnames(
|
|
36
|
+
"w-[100px] h-[100px] border border-purple-100 rounded",
|
|
37
|
+
utilityClass
|
|
38
|
+
)}
|
|
39
|
+
/>
|
|
40
|
+
)}
|
|
41
|
+
isReversed={isReversed}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react"
|
|
3
|
+
import classnames from "classnames"
|
|
4
|
+
import { TailwindStoryTemplate } from "~tailwind/_docs/utils/TailwindStoryTemplate"
|
|
5
|
+
import { flattenEntries } from "~tailwind/_docs/utils/flattenEntries"
|
|
6
|
+
import { utilityDescription } from "~tailwind/_docs/utils/utilityDescription"
|
|
7
|
+
import { kaizenTailwindTheme } from "~tailwind/tailwind-presets"
|
|
8
|
+
|
|
9
|
+
const prefix = "border-"
|
|
10
|
+
const classEntries = flattenEntries(
|
|
11
|
+
prefix,
|
|
12
|
+
kaizenTailwindTheme.borderColor || {}
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: "Guides/Tailwind/Utility Class References/Borders/Border Color",
|
|
17
|
+
parameters: {
|
|
18
|
+
a11y: { disable: true },
|
|
19
|
+
chromatic: { disable: false },
|
|
20
|
+
docsLayout: "fullPage",
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
} satisfies Meta
|
|
28
|
+
|
|
29
|
+
export const BorderColor: StoryFn<{ isReversed: boolean }> = ({
|
|
30
|
+
isReversed,
|
|
31
|
+
}) => (
|
|
32
|
+
<TailwindStoryTemplate
|
|
33
|
+
compiledCssPropertyName="border-color"
|
|
34
|
+
classKeyValues={classEntries}
|
|
35
|
+
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
36
|
+
<div
|
|
37
|
+
className={classnames(
|
|
38
|
+
"rounded w-[100px] h-[100px] border",
|
|
39
|
+
utilityClass.replace("-DEFAULT", "")
|
|
40
|
+
)}
|
|
41
|
+
/>
|
|
42
|
+
)}
|
|
43
|
+
isReversed={isReversed}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react"
|
|
3
|
+
import classnames from "classnames"
|
|
4
|
+
import { TailwindStoryTemplate } from "~tailwind/_docs/utils/TailwindStoryTemplate"
|
|
5
|
+
import { utilityDescription } from "~tailwind/_docs/utils/utilityDescription"
|
|
6
|
+
import { kaizenTailwindTheme } from "~tailwind/tailwind-presets"
|
|
7
|
+
|
|
8
|
+
const prefix = "rounded-"
|
|
9
|
+
const classEntries: Array<{ utilityClassName: string; cssProperty: string }> =
|
|
10
|
+
Object.entries(kaizenTailwindTheme.borderRadius || []).map(
|
|
11
|
+
([suffix, cssProperty]) => ({
|
|
12
|
+
utilityClassName: `${prefix}${suffix}`,
|
|
13
|
+
cssProperty,
|
|
14
|
+
})
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
title: "Guides/Tailwind/Utility Class References/Borders/Border Radius",
|
|
19
|
+
parameters: {
|
|
20
|
+
a11y: { disable: true },
|
|
21
|
+
chromatic: { disable: false },
|
|
22
|
+
docsLayout: "fullPage",
|
|
23
|
+
docs: {
|
|
24
|
+
description: {
|
|
25
|
+
component: utilityDescription(prefix, classEntries[3].utilityClassName),
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
} satisfies Meta
|
|
30
|
+
|
|
31
|
+
export const BorderRadius: StoryFn<{ isReversed: boolean }> = ({
|
|
32
|
+
isReversed,
|
|
33
|
+
}) => (
|
|
34
|
+
<TailwindStoryTemplate
|
|
35
|
+
compiledCssPropertyName="border-radius"
|
|
36
|
+
classKeyValues={classEntries}
|
|
37
|
+
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
38
|
+
<div
|
|
39
|
+
className={classnames(
|
|
40
|
+
"w-[100px] h-[100px] border border-purple-500",
|
|
41
|
+
utilityClass.replace("-DEFAULT", "")
|
|
42
|
+
)}
|
|
43
|
+
/>
|
|
44
|
+
)}
|
|
45
|
+
isReversed={isReversed}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react"
|
|
3
|
+
import { TailwindStoryTemplate } from "~tailwind/_docs/utils/TailwindStoryTemplate"
|
|
4
|
+
import { utilityDescription } from "~tailwind/_docs/utils/utilityDescription"
|
|
5
|
+
import { kaizenTailwindTheme } from "~tailwind/tailwind-presets"
|
|
6
|
+
|
|
7
|
+
const prefix = "border-spacing-"
|
|
8
|
+
const classEntries: Array<{ utilityClassName: string; cssProperty: string }> =
|
|
9
|
+
Object.entries(kaizenTailwindTheme.spacing || []).map(
|
|
10
|
+
([suffix, cssProperty]) => ({
|
|
11
|
+
utilityClassName: `${prefix}${suffix}`,
|
|
12
|
+
cssProperty,
|
|
13
|
+
})
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: "Guides/Tailwind/Utility Class References/Borders/Border Spacing",
|
|
18
|
+
parameters: {
|
|
19
|
+
a11y: { disable: true },
|
|
20
|
+
chromatic: { disable: false },
|
|
21
|
+
docsLayout: "fullPage",
|
|
22
|
+
docs: {
|
|
23
|
+
description: {
|
|
24
|
+
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
} satisfies Meta
|
|
29
|
+
|
|
30
|
+
export const BorderSpacing: StoryFn<{ isReversed: boolean }> = ({
|
|
31
|
+
isReversed,
|
|
32
|
+
}) => (
|
|
33
|
+
<TailwindStoryTemplate
|
|
34
|
+
compiledCssPropertyName="border-spacing"
|
|
35
|
+
classKeyValues={classEntries}
|
|
36
|
+
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
37
|
+
<table className={utilityClass}>
|
|
38
|
+
<tbody>
|
|
39
|
+
<tr>
|
|
40
|
+
<td className="outline-[black] outline-1 outline">Tutant</td>
|
|
41
|
+
<td className="outline-[black] outline-1 outline">Meenage</td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td className="outline-[black] outline-1 outline">Neetle</td>
|
|
45
|
+
<td className="outline-[black] outline-1 outline">Teetles</td>
|
|
46
|
+
</tr>
|
|
47
|
+
</tbody>
|
|
48
|
+
</table>
|
|
49
|
+
)}
|
|
50
|
+
isReversed={isReversed}
|
|
51
|
+
/>
|
|
52
|
+
)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Description, Meta, Story, Unstyled } from "@storybook/blocks"
|
|
2
|
+
import { Card } from "~components/Card"
|
|
3
|
+
import * as Examples from "./border-width.stories"
|
|
4
|
+
|
|
5
|
+
<Meta of={Examples} />
|
|
6
|
+
|
|
7
|
+
# Border Width
|
|
8
|
+
|
|
9
|
+
<Description />
|
|
10
|
+
|
|
11
|
+
<Unstyled>
|
|
12
|
+
<Card variant="informative" classNameOverride="w-fit mb-24">
|
|
13
|
+
<div className="p-24 font-family-paragraph">
|
|
14
|
+
<p>
|
|
15
|
+
This document demonstrates the list of border-width suffixes available
|
|
16
|
+
from the Kaizen preset, by showing what they look like on the
|
|
17
|
+
'border-' prefix.
|
|
18
|
+
</p>
|
|
19
|
+
<p>
|
|
20
|
+
Note that there are other border-width prefixes (such as `border-l-`
|
|
21
|
+
for `border-left-width`) that can be used instead. Available
|
|
22
|
+
border-width prefixes can be referenced <a href="https://tailwindcss.com/docs/border-width">here</a>.
|
|
23
|
+
</p>
|
|
24
|
+
</div>
|
|
25
|
+
</Card>
|
|
26
|
+
</Unstyled>
|
|
27
|
+
|
|
28
|
+
<Story of={Examples.BorderWidth} />
|