@kaizen/tailwind 1.2.14 → 1.3.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.
Files changed (77) hide show
  1. package/dist/cjs/index.cjs +5 -0
  2. package/dist/cjs/kz-spacing.cjs +21 -0
  3. package/dist/cjs/tailwind-presets.cjs +112 -0
  4. package/dist/esm/index.mjs +1 -0
  5. package/dist/esm/kz-spacing.mjs +18 -0
  6. package/dist/esm/tailwind-presets.mjs +109 -0
  7. package/dist/{index.d.ts → types/index.d.ts} +0 -1
  8. package/dist/{kz-height.d.ts → types/kz-height.d.ts} +0 -1
  9. package/dist/{kz-spacing.d.ts → types/kz-spacing.d.ts} +0 -1
  10. package/dist/{tailwind-presets.d.ts → types/tailwind-presets.d.ts} +0 -1
  11. package/package.json +17 -6
  12. package/src/_docs/assets/copy-utility-class.gif +0 -0
  13. package/src/_docs/assets/css-generation.png +0 -0
  14. package/src/_docs/assets/inline-fold.gif +0 -0
  15. package/src/_docs/assets/tailwind-play.gif +0 -0
  16. package/src/_docs/assets/tw-anatomy.png +0 -0
  17. package/src/_docs/assets/utility-search-result.png +0 -0
  18. package/src/_docs/pages/backgrounds/background-color.mdx +10 -0
  19. package/src/_docs/pages/backgrounds/background-color.stories.tsx +43 -0
  20. package/src/_docs/pages/borders/border-color.mdx +10 -0
  21. package/src/_docs/pages/borders/border-color.stories.tsx +45 -0
  22. package/src/_docs/pages/borders/border-radius.mdx +10 -0
  23. package/src/_docs/pages/borders/border-radius.stories.tsx +47 -0
  24. package/src/_docs/pages/borders/border-spacing.mdx +10 -0
  25. package/src/_docs/pages/borders/border-spacing.stories.tsx +52 -0
  26. package/src/_docs/pages/borders/border-width.mdx +28 -0
  27. package/src/_docs/pages/borders/border-width.stories.tsx +47 -0
  28. package/src/_docs/pages/configuration.mdx +78 -0
  29. package/src/_docs/pages/contributing.mdx +38 -0
  30. package/src/_docs/pages/effects/shadow.mdx +10 -0
  31. package/src/_docs/pages/effects/shadow.stories.tsx +40 -0
  32. package/src/_docs/pages/getting-started.mdx +125 -0
  33. package/src/_docs/pages/modifiers/media-queries.mdx +16 -0
  34. package/src/_docs/pages/modifiers/media-queries.stories.tsx +81 -0
  35. package/src/_docs/pages/modifiers/pseudo-states.mdx +26 -0
  36. package/src/_docs/pages/modifiers/pseudo-states.stories.tsx +49 -0
  37. package/src/_docs/pages/overview.mdx +26 -0
  38. package/src/_docs/pages/spacing/margin.mdx +27 -0
  39. package/src/_docs/pages/spacing/margin.stories.tsx +49 -0
  40. package/src/_docs/pages/spacing/padding.mdx +27 -0
  41. package/src/_docs/pages/spacing/padding.stories.tsx +47 -0
  42. package/src/_docs/pages/typography/font-family.mdx +10 -0
  43. package/src/_docs/pages/typography/font-family.stories.tsx +41 -0
  44. package/src/_docs/pages/typography/font-size.mdx +10 -0
  45. package/src/_docs/pages/typography/font-size.stories.tsx +38 -0
  46. package/src/_docs/pages/typography/font-weight.mdx +10 -0
  47. package/src/_docs/pages/typography/font-weight.stories.tsx +41 -0
  48. package/src/_docs/pages/typography/line-height.mdx +10 -0
  49. package/src/_docs/pages/typography/line-height.stories.tsx +44 -0
  50. package/src/_docs/pages/typography/max-text-width.mdx +12 -0
  51. package/src/_docs/pages/typography/max-text-width.stories.tsx +60 -0
  52. package/src/_docs/pages/typography/text-color.mdx +10 -0
  53. package/src/_docs/pages/typography/text-color.stories.tsx +52 -0
  54. package/src/_docs/pages/utility-class-helpers-overview.mdx +95 -0
  55. package/src/_docs/pages/working-with-tailwind.mdx +85 -0
  56. package/src/_docs/pages/working-with-tailwind.stories.tsx +100 -0
  57. package/src/_docs/utils/TailwindStoryTemplate/TailwindStoryTemplate.tsx +81 -0
  58. package/src/_docs/utils/TailwindStoryTemplate/components/CardContent/CardContent.tsx +26 -0
  59. package/src/_docs/utils/TailwindStoryTemplate/components/CardContent/index.ts +1 -0
  60. package/src/_docs/utils/TailwindStoryTemplate/components/CodeSnippet/CodeSnippet.tsx +36 -0
  61. package/src/_docs/utils/TailwindStoryTemplate/components/CodeSnippet/index.ts +1 -0
  62. package/src/_docs/utils/TailwindStoryTemplate/index.ts +1 -0
  63. package/src/_docs/utils/flattenEntries.ts +37 -0
  64. package/src/_docs/utils/utilityDescription.ts +5 -0
  65. package/src/tailwind-presets.ts +53 -53
  66. package/dist/index.d.ts.map +0 -1
  67. package/dist/index.js +0 -18
  68. package/dist/index.js.map +0 -1
  69. package/dist/kz-height.d.ts.map +0 -1
  70. package/dist/kz-height.js +0 -16
  71. package/dist/kz-height.js.map +0 -1
  72. package/dist/kz-spacing.d.ts.map +0 -1
  73. package/dist/kz-spacing.js +0 -41
  74. package/dist/kz-spacing.js.map +0 -1
  75. package/dist/tailwind-presets.d.ts.map +0 -1
  76. package/dist/tailwind-presets.js +0 -112
  77. package/dist/tailwind-presets.js.map +0 -1
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var tailwindPresets = require('./tailwind-presets.cjs');
4
+ exports.Preset = tailwindPresets.Preset;
5
+ exports.kaizenTailwindTheme = tailwindPresets.kaizenTailwindTheme;
@@ -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 };
@@ -1,2 +1 @@
1
1
  export * from "./tailwind-presets";
2
- //# sourceMappingURL=index.d.ts.map
@@ -10,4 +10,3 @@ export declare const kzHeight: {
10
10
  max: string;
11
11
  fit: string;
12
12
  };
13
- //# sourceMappingURL=kz-height.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export declare const filterDenyListValues: (spacingTokensObject: Record<string, string>) => Record<string, string>;
2
2
  export declare const kzSpacing: Record<string, string>;
3
- //# sourceMappingURL=kz-spacing.d.ts.map
@@ -5,4 +5,3 @@ export type KaizenTailwindPreset = {
5
5
  };
6
6
  export declare const kaizenTailwindTheme: KaizenTailwindTheme;
7
7
  export declare const Preset: KaizenTailwindPreset;
8
- //# sourceMappingURL=tailwind-presets.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/tailwind",
3
- "version": "1.2.14",
3
+ "version": "1.3.1",
4
4
  "description": "Kaizen Tailwind presets",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,21 +12,32 @@
12
12
  },
13
13
  "files": [
14
14
  "src",
15
- "dist"
15
+ "dist",
16
+ "js"
16
17
  ],
17
- "main": "dist/index.js",
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.5.3"
25
+ "@kaizen/design-tokens": "10.6.0"
26
+ },
27
+ "devDependencies": {
28
+ "classnames": "^2.5.1",
29
+ "rollup": "^4.20.0",
30
+ "tailwindcss": "^3.4.10",
31
+ "tslib": "^2.6.3",
32
+ "@kaizen/components": "1.60.3",
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 clean && tsc --project tsconfig.dist.json",
29
- "clean": "rimraf -g '**/*.d.ts' '**/*.js' '**/*.map'",
39
+ "build": "pnpm package-bundler build",
40
+ "clean": "rimraf 'dist' 'node_modules' '.turbo'",
30
41
  "lint:ts": "tsc --noEmit"
31
42
  }
32
43
  }
Binary file
Binary file
@@ -0,0 +1,10 @@
1
+ import { Description, Meta, Story } from "@storybook/blocks"
2
+ import * as Examples from "./background-color.stories"
3
+
4
+ <Meta of={Examples} />
5
+
6
+ # Background Color
7
+
8
+ <Description />
9
+
10
+ <Story of={Examples.BackgroundColor} />
@@ -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,10 @@
1
+ import { Description, Meta, Story } from "@storybook/blocks"
2
+ import * as Examples from "./border-color.stories"
3
+
4
+ <Meta of={Examples} />
5
+
6
+ # Border Color
7
+
8
+ <Description />
9
+
10
+ <Story of={Examples.BorderColor} />
@@ -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,10 @@
1
+ import { Description, Meta, Story } from "@storybook/blocks"
2
+ import * as Examples from "./border-radius.stories"
3
+
4
+ <Meta of={Examples} />
5
+
6
+ # Border Radius
7
+
8
+ <Description />
9
+
10
+ <Story of={Examples.BorderRadius} />
@@ -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,10 @@
1
+ import { Description, Meta, Story } from "@storybook/blocks"
2
+ import * as Examples from "./border-spacing.stories"
3
+
4
+ <Meta of={Examples} />
5
+
6
+ # Border Spacing
7
+
8
+ <Description />
9
+
10
+ <Story of={Examples.BorderSpacing} />
@@ -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
+ &apos;border-&apos; 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} />