@kaizen/tailwind 1.3.9 → 1.3.11
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/kz-spacing.cjs +2 -2
- package/dist/cjs/tailwind-presets.cjs +65 -65
- package/dist/esm/kz-spacing.mjs +2 -2
- package/dist/esm/tailwind-presets.mjs +65 -65
- package/dist/types/index.d.ts +1 -1
- package/dist/types/tailwind-presets.d.ts +1 -1
- package/package.json +5 -5
- package/src/_docs/pages/backgrounds/background-color.stories.tsx +13 -20
- package/src/_docs/pages/borders/border-color.stories.tsx +14 -20
- package/src/_docs/pages/borders/border-radius.stories.tsx +18 -22
- package/src/_docs/pages/borders/border-spacing.stories.tsx +15 -19
- package/src/_docs/pages/borders/border-width.stories.tsx +18 -22
- package/src/_docs/pages/effects/shadow.stories.tsx +17 -19
- package/src/_docs/pages/modifiers/media-queries.stories.tsx +14 -24
- package/src/_docs/pages/modifiers/pseudo-states.stories.tsx +10 -16
- package/src/_docs/pages/spacing/margin.stories.tsx +17 -22
- package/src/_docs/pages/spacing/padding.stories.tsx +17 -24
- package/src/_docs/pages/typography/font-family.stories.tsx +15 -19
- package/src/_docs/pages/typography/font-size.stories.tsx +11 -12
- package/src/_docs/pages/typography/font-weight.stories.tsx +15 -19
- package/src/_docs/pages/typography/line-height.stories.tsx +17 -23
- package/src/_docs/pages/typography/max-text-width.stories.tsx +25 -29
- package/src/_docs/pages/typography/text-color.stories.tsx +16 -17
- package/src/_docs/pages/working-with-tailwind.stories.tsx +12 -21
- package/src/_docs/utils/TailwindStoryTemplate/TailwindStoryTemplate.tsx +52 -42
- package/src/_docs/utils/TailwindStoryTemplate/components/CardContent/CardContent.tsx +5 -8
- package/src/_docs/utils/TailwindStoryTemplate/components/CardContent/index.ts +1 -1
- package/src/_docs/utils/TailwindStoryTemplate/components/CodeSnippet/CodeSnippet.tsx +3 -3
- package/src/_docs/utils/TailwindStoryTemplate/components/CodeSnippet/index.ts +1 -1
- package/src/_docs/utils/TailwindStoryTemplate/index.ts +1 -1
- package/src/_docs/utils/flattenEntries.ts +12 -13
- package/src/_docs/utils/utilityDescription.ts +1 -4
- package/src/index.ts +1 -1
- package/src/kz-height.ts +10 -10
- package/src/kz-spacing.spec.ts +24 -24
- package/src/kz-spacing.ts +21 -22
- package/src/tailwind-presets.ts +68 -68
package/src/kz-spacing.ts
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import { heartTheme } from
|
|
1
|
+
import { heartTheme } from '@kaizen/design-tokens'
|
|
2
2
|
|
|
3
3
|
const tokenDenyList: string[] = [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
'xs',
|
|
5
|
+
'sm',
|
|
6
|
+
'md',
|
|
7
|
+
'lg',
|
|
8
|
+
'xl',
|
|
9
|
+
'xxl',
|
|
10
|
+
'xxxl',
|
|
11
|
+
'xxxxl',
|
|
12
|
+
'xxxxxl',
|
|
13
|
+
'xs-id',
|
|
14
|
+
'sm-id',
|
|
15
|
+
'md-id',
|
|
16
|
+
'lg-id',
|
|
17
|
+
'xl-id',
|
|
18
|
+
'xxl-id',
|
|
19
|
+
'xxxl-id',
|
|
20
|
+
'xxxxl-id',
|
|
21
|
+
'xxxxxl-id',
|
|
22
22
|
]
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* checks if a key from design tokens should be filtered from tailwind
|
|
26
26
|
*/
|
|
27
|
-
const isValidToken = (key: string | number): boolean =>
|
|
28
|
-
tokenDenyList.indexOf(`${key}`) < 0
|
|
27
|
+
const isValidToken = (key: string | number): boolean => !tokenDenyList.includes(`${key}`)
|
|
29
28
|
|
|
30
29
|
// Filters out non-pixel-based spacing tokens, such as shirt sizes
|
|
31
30
|
export const filterDenyListValues = (
|
|
32
|
-
spacingTokensObject: Record<string, string
|
|
31
|
+
spacingTokensObject: Record<string, string>,
|
|
33
32
|
): Record<string, string> => {
|
|
34
33
|
const keyValuePairs = Object.entries(spacingTokensObject)
|
|
35
34
|
|
package/src/tailwind-presets.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CustomThemeConfig } from
|
|
2
|
-
import { tokens } from
|
|
3
|
-
import { kzSpacing } from
|
|
1
|
+
import { CustomThemeConfig } from 'tailwindcss/types/config'
|
|
2
|
+
import { tokens } from '@kaizen/design-tokens/js'
|
|
3
|
+
import { kzSpacing } from './kz-spacing'
|
|
4
4
|
|
|
5
5
|
export type KaizenTailwindTheme = Partial<CustomThemeConfig>
|
|
6
6
|
export type KaizenTailwindPreset = {
|
|
@@ -11,98 +11,98 @@ export type KaizenTailwindPreset = {
|
|
|
11
11
|
export const kaizenTailwindTheme: KaizenTailwindTheme = {
|
|
12
12
|
extend: {
|
|
13
13
|
maxWidth: {
|
|
14
|
-
paragraph: `${tokens.typography.paragraphBody.maxWidth}`,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
'paragraph': `${tokens.typography.paragraphBody.maxWidth}`,
|
|
15
|
+
'paragraph-lede': `${tokens.typography.paragraphIntroLede.maxWidth}`,
|
|
16
|
+
'paragraph-sm': `${tokens.typography.paragraphSmall.maxWidth}`,
|
|
17
|
+
'paragraph-xs': `${tokens.typography.paragraphExtraSmall.maxWidth}`,
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
colors: {
|
|
21
|
-
transparent:
|
|
22
|
-
current:
|
|
23
|
-
inherit:
|
|
21
|
+
transparent: 'transparent',
|
|
22
|
+
current: 'currentColor',
|
|
23
|
+
inherit: 'inherit',
|
|
24
24
|
...tokens.color,
|
|
25
25
|
...tokens.dataViz,
|
|
26
26
|
},
|
|
27
27
|
spacing: kzSpacing,
|
|
28
28
|
boxShadow: {
|
|
29
|
-
none:
|
|
29
|
+
none: 'none',
|
|
30
30
|
sm: tokens.shadow.small.boxShadow,
|
|
31
31
|
lg: tokens.shadow.large.boxShadow,
|
|
32
32
|
},
|
|
33
33
|
borderRadius: {
|
|
34
|
-
DEFAULT:
|
|
35
|
-
default:
|
|
36
|
-
none:
|
|
37
|
-
|
|
38
|
-
full:
|
|
34
|
+
'DEFAULT': '7px',
|
|
35
|
+
'default': '7px',
|
|
36
|
+
'none': '0px',
|
|
37
|
+
'focus-ring': '10px',
|
|
38
|
+
'full': '100%',
|
|
39
39
|
},
|
|
40
40
|
borderWidth: {
|
|
41
|
-
DEFAULT:
|
|
42
|
-
default:
|
|
43
|
-
none:
|
|
44
|
-
1:
|
|
45
|
-
|
|
41
|
+
'DEFAULT': '2px',
|
|
42
|
+
'default': '2px',
|
|
43
|
+
'none': '0px',
|
|
44
|
+
1: '1px',
|
|
45
|
+
'focus-ring': '2px',
|
|
46
46
|
},
|
|
47
47
|
borderColor: {
|
|
48
|
-
|
|
49
|
-
transparent: `${tokens.border.borderless.borderColor}`,
|
|
50
|
-
|
|
48
|
+
'default-color': `${tokens.border.solid.borderColor}`,
|
|
49
|
+
'transparent': `${tokens.border.borderless.borderColor}`,
|
|
50
|
+
'focus-ring': tokens.color.blue[600],
|
|
51
51
|
...tokens.color,
|
|
52
52
|
},
|
|
53
53
|
fontFamily: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
'family-paragraph': [`${tokens.typography.paragraphBody.fontFamily}`],
|
|
55
|
+
'family-heading': [`${tokens.typography.heading1.fontFamily}`],
|
|
56
|
+
'family-data': [`${tokens.typography.dataLarge.fontFamily}`],
|
|
57
|
+
'family-display': [`${tokens.typography.display0.fontFamily}`],
|
|
58
58
|
},
|
|
59
59
|
fontSize: {
|
|
60
|
-
display: `${tokens.typography.display0.fontSize}`,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
paragraph: `${tokens.typography.paragraphBody.fontSize}`,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
'display': `${tokens.typography.display0.fontSize}`,
|
|
61
|
+
'heading-1': `${tokens.typography.heading1.fontSize}`,
|
|
62
|
+
'heading-2': `${tokens.typography.heading2.fontSize}`,
|
|
63
|
+
'heading-3': `${tokens.typography.heading3.fontSize}`,
|
|
64
|
+
'heading-4': `${tokens.typography.heading4.fontSize}`,
|
|
65
|
+
'heading-5': `${tokens.typography.heading5.fontSize}`,
|
|
66
|
+
'heading-6': `${tokens.typography.heading6.fontSize}`,
|
|
67
|
+
'paragraph': `${tokens.typography.paragraphBody.fontSize}`,
|
|
68
|
+
'paragraph-lede': `${tokens.typography.paragraphIntroLede.fontSize}`,
|
|
69
|
+
'paragraph-sm': `${tokens.typography.paragraphSmall.fontSize}`,
|
|
70
|
+
'paragraph-xs': `${tokens.typography.paragraphExtraSmall.fontSize}`,
|
|
71
|
+
'data-lg': `${tokens.typography.dataLarge.fontSize}`,
|
|
72
|
+
'data-md': `${tokens.typography.dataMedium.fontSize}`,
|
|
73
|
+
'data-sm': `${tokens.typography.dataSmall.fontSize}`,
|
|
74
|
+
'data-units-lg': `${tokens.typography.dataLargeUnits.fontSize}`,
|
|
75
|
+
'data-units-md': `${tokens.typography.dataMediumUnits.fontSize}`,
|
|
76
|
+
'data-units-sm': `${tokens.typography.dataSmallUnits.fontSize}`,
|
|
77
77
|
},
|
|
78
78
|
fontWeight: {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
'weight-paragraph': '400',
|
|
80
|
+
'weight-paragraph-bold': '600',
|
|
81
|
+
'weight-data': '700',
|
|
82
|
+
'weight-heading': '700',
|
|
83
|
+
'weight-display': '800',
|
|
84
84
|
},
|
|
85
85
|
lineHeight: {
|
|
86
|
-
display: `${tokens.typography.display0.lineHeight}`,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
paragraph: `${tokens.typography.paragraphBody.lineHeight}`,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
86
|
+
'display': `${tokens.typography.display0.lineHeight}`,
|
|
87
|
+
'heading-1': `${tokens.typography.heading1.lineHeight}`,
|
|
88
|
+
'heading-2': `${tokens.typography.heading2.lineHeight}`,
|
|
89
|
+
'heading-3': `${tokens.typography.heading3.lineHeight}`,
|
|
90
|
+
'heading-4': `${tokens.typography.heading4.lineHeight}`,
|
|
91
|
+
'heading-5': `${tokens.typography.heading5.lineHeight}`,
|
|
92
|
+
'heading-6': `${tokens.typography.heading6.lineHeight}`,
|
|
93
|
+
'paragraph': `${tokens.typography.paragraphBody.lineHeight}`,
|
|
94
|
+
'paragraph-lede': `${tokens.typography.paragraphIntroLede.lineHeight}`,
|
|
95
|
+
'paragraph-sm': `${tokens.typography.paragraphSmall.lineHeight}`,
|
|
96
|
+
'paragraph-xs': `${tokens.typography.paragraphExtraSmall.lineHeight}`,
|
|
97
|
+
'data-lg': `${tokens.typography.dataLarge.lineHeight}`,
|
|
98
|
+
'data-md': `${tokens.typography.dataMedium.lineHeight}`,
|
|
99
|
+
'data-sm': `${tokens.typography.dataSmall.lineHeight}`,
|
|
100
|
+
'data-units-lg': `${tokens.typography.dataLargeUnits.lineHeight}`,
|
|
101
|
+
'data-units-md': `${tokens.typography.dataMediumUnits.lineHeight}`,
|
|
102
|
+
'data-units-sm': `${tokens.typography.dataSmallUnits.lineHeight}`,
|
|
103
103
|
},
|
|
104
104
|
letterSpacing: {
|
|
105
|
-
|
|
105
|
+
'letter-spacing-normal': 'normal',
|
|
106
106
|
},
|
|
107
107
|
// A mix of layout styles
|
|
108
108
|
screens: {
|