@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
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Meta, StoryFn } from
|
|
3
|
-
import { TailwindStoryTemplate } from
|
|
4
|
-
import { utilityDescription } from
|
|
5
|
-
import { kaizenTailwindTheme } from
|
|
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
6
|
|
|
7
|
-
const prefix =
|
|
8
|
-
const classEntries:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
)
|
|
7
|
+
const prefix = 'border-spacing-'
|
|
8
|
+
const classEntries: { utilityClassName: string; cssProperty: string }[] = Object.entries(
|
|
9
|
+
kaizenTailwindTheme.spacing ?? [],
|
|
10
|
+
).map(([suffix, cssProperty]) => ({
|
|
11
|
+
utilityClassName: `${prefix}${suffix}`,
|
|
12
|
+
cssProperty,
|
|
13
|
+
}))
|
|
15
14
|
|
|
16
15
|
export default {
|
|
17
|
-
title:
|
|
16
|
+
title: 'Guides/Tailwind/Utility Class References/Borders/Border Spacing',
|
|
18
17
|
parameters: {
|
|
19
18
|
a11y: { disable: true },
|
|
20
19
|
chromatic: { disable: false },
|
|
21
|
-
docsLayout:
|
|
20
|
+
docsLayout: 'fullPage',
|
|
22
21
|
docs: {
|
|
23
22
|
description: {
|
|
24
23
|
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
@@ -27,9 +26,7 @@ export default {
|
|
|
27
26
|
},
|
|
28
27
|
} satisfies Meta
|
|
29
28
|
|
|
30
|
-
export const BorderSpacing: StoryFn
|
|
31
|
-
isReversed,
|
|
32
|
-
}) => (
|
|
29
|
+
export const BorderSpacing: StoryFn = () => (
|
|
33
30
|
<TailwindStoryTemplate
|
|
34
31
|
compiledCssPropertyName="border-spacing"
|
|
35
32
|
classKeyValues={classEntries}
|
|
@@ -47,6 +44,5 @@ export const BorderSpacing: StoryFn<{ isReversed: boolean }> = ({
|
|
|
47
44
|
</tbody>
|
|
48
45
|
</table>
|
|
49
46
|
)}
|
|
50
|
-
isReversed={isReversed}
|
|
51
47
|
/>
|
|
52
48
|
)
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Meta, StoryFn } from
|
|
3
|
-
import classnames from
|
|
4
|
-
import { TailwindStoryTemplate } from
|
|
5
|
-
import { utilityDescription } from
|
|
6
|
-
import { kaizenTailwindTheme } from
|
|
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
7
|
|
|
8
|
-
const prefix =
|
|
9
|
-
const classEntries:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
8
|
+
const prefix = 'border-'
|
|
9
|
+
const classEntries: { utilityClassName: string; cssProperty: string }[] = Object.entries(
|
|
10
|
+
kaizenTailwindTheme.borderWidth ?? [],
|
|
11
|
+
).map(([suffix, cssProperty]) => ({
|
|
12
|
+
utilityClassName: `${prefix}${suffix}`,
|
|
13
|
+
cssProperty,
|
|
14
|
+
}))
|
|
16
15
|
|
|
17
16
|
export default {
|
|
18
|
-
title:
|
|
17
|
+
title: 'Guides/Tailwind/Utility Class References/Borders/Border Width',
|
|
19
18
|
parameters: {
|
|
20
19
|
a11y: { disable: true },
|
|
21
20
|
chromatic: { disable: false },
|
|
22
|
-
docsLayout:
|
|
21
|
+
docsLayout: 'fullPage',
|
|
23
22
|
docs: {
|
|
24
23
|
description: {
|
|
25
24
|
component: utilityDescription(prefix, classEntries[1].utilityClassName),
|
|
@@ -28,20 +27,17 @@ export default {
|
|
|
28
27
|
},
|
|
29
28
|
} satisfies Meta
|
|
30
29
|
|
|
31
|
-
export const BorderWidth: StoryFn
|
|
32
|
-
isReversed,
|
|
33
|
-
}) => (
|
|
30
|
+
export const BorderWidth: StoryFn = () => (
|
|
34
31
|
<TailwindStoryTemplate
|
|
35
32
|
compiledCssPropertyName="border-width"
|
|
36
33
|
classKeyValues={classEntries}
|
|
37
34
|
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
38
35
|
<div
|
|
39
36
|
className={classnames(
|
|
40
|
-
|
|
41
|
-
!utilityClass.includes(
|
|
37
|
+
'w-[100px] h-[100px] border rounded',
|
|
38
|
+
!utilityClass.includes('-DEFAULT') && utilityClass,
|
|
42
39
|
)}
|
|
43
40
|
/>
|
|
44
41
|
)}
|
|
45
|
-
isReversed={isReversed}
|
|
46
42
|
/>
|
|
47
43
|
)
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Meta, StoryFn } from
|
|
3
|
-
import classnames from
|
|
4
|
-
import { TailwindStoryTemplate } from
|
|
5
|
-
import { utilityDescription } from
|
|
6
|
-
import { kaizenTailwindTheme } from
|
|
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
7
|
|
|
8
|
-
const prefix =
|
|
9
|
-
const classEntries:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
8
|
+
const prefix = 'shadow-'
|
|
9
|
+
const classEntries: { utilityClassName: string; cssProperty: string }[] = Object.entries(
|
|
10
|
+
kaizenTailwindTheme.boxShadow ?? [],
|
|
11
|
+
).map(([suffix, cssProperty]) => ({
|
|
12
|
+
utilityClassName: `${prefix}${suffix}`,
|
|
13
|
+
cssProperty,
|
|
14
|
+
}))
|
|
16
15
|
|
|
17
16
|
export default {
|
|
18
|
-
title:
|
|
17
|
+
title: 'Guides/Tailwind/Utility Class References/Effects/Box Shadow',
|
|
19
18
|
parameters: {
|
|
20
19
|
a11y: { disable: true },
|
|
21
20
|
chromatic: { disable: false },
|
|
22
|
-
docsLayout:
|
|
21
|
+
docsLayout: 'fullPage',
|
|
23
22
|
docs: {
|
|
24
23
|
description: {
|
|
25
24
|
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
@@ -28,13 +27,12 @@ export default {
|
|
|
28
27
|
},
|
|
29
28
|
} satisfies Meta
|
|
30
29
|
|
|
31
|
-
export const BoxShadow: StoryFn
|
|
30
|
+
export const BoxShadow: StoryFn = () => (
|
|
32
31
|
<TailwindStoryTemplate
|
|
33
32
|
compiledCssPropertyName="box-shadow"
|
|
34
33
|
classKeyValues={classEntries}
|
|
35
34
|
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
36
|
-
<div className={classnames(
|
|
35
|
+
<div className={classnames('w-[100px] h-[100px]', utilityClass)} />
|
|
37
36
|
)}
|
|
38
|
-
isReversed={isReversed}
|
|
39
37
|
/>
|
|
40
38
|
)
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Meta, StoryFn } from
|
|
3
|
-
import { Heading } from
|
|
4
|
-
import { Text } from
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react'
|
|
3
|
+
import { Heading } from '~components/Heading'
|
|
4
|
+
import { Text } from '~components/Text'
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
title:
|
|
7
|
+
title: 'Guides/Tailwind/Utility Class References/Modifiers/Media Queries',
|
|
8
8
|
parameters: {
|
|
9
|
-
docsLayout:
|
|
9
|
+
docsLayout: 'fullPage',
|
|
10
10
|
docs: {
|
|
11
11
|
a11y: { disable: true },
|
|
12
12
|
description: {
|
|
13
|
-
component:
|
|
14
|
-
"Require @kaizen/tailwind and add it into your tailwind config",
|
|
13
|
+
component: 'Require @kaizen/tailwind and add it into your tailwind config',
|
|
15
14
|
},
|
|
16
15
|
},
|
|
17
16
|
},
|
|
@@ -22,11 +21,7 @@ type QueryInfoProps = {
|
|
|
22
21
|
selectorValue: string
|
|
23
22
|
children: React.ReactElement
|
|
24
23
|
}
|
|
25
|
-
const QueryInfo = ({
|
|
26
|
-
selector,
|
|
27
|
-
selectorValue,
|
|
28
|
-
children,
|
|
29
|
-
}: QueryInfoProps): React.ReactElement => (
|
|
24
|
+
const QueryInfo = ({ selector, selectorValue, children }: QueryInfoProps): React.ReactElement => (
|
|
30
25
|
<div className="my-12">
|
|
31
26
|
<Text variant="intro-lede">Pseudo selector: {selector}</Text>
|
|
32
27
|
<Text variant="body">Breakpoint: {selectorValue}</Text>
|
|
@@ -39,8 +34,8 @@ const QueryInfo = ({
|
|
|
39
34
|
export const MediaQueries: StoryFn = () => (
|
|
40
35
|
<div className="py-32">
|
|
41
36
|
<Heading tag="p" variant="heading-4" classNameOverride="text-center">
|
|
42
|
-
These breakpoints activate <em>over</em> a certain screen width. Meaning
|
|
43
|
-
|
|
37
|
+
These breakpoints activate <em>over</em> a certain screen width. Meaning that bg-blue-400 will
|
|
38
|
+
be applied when the screen gets <em>wider</em>.
|
|
44
39
|
</Heading>
|
|
45
40
|
<QueryInfo selector="md" selectorValue="768px">
|
|
46
41
|
<div className="border-solid md:bg-blue-400 h-[50px] w-full rounded" />
|
|
@@ -54,26 +49,21 @@ export const MediaQueries: StoryFn = () => (
|
|
|
54
49
|
export const ArbitraryMediaQueries: StoryFn = () => (
|
|
55
50
|
<div className="py-32">
|
|
56
51
|
<Heading tag="p" variant="heading-4" classNameOverride="text-center">
|
|
57
|
-
Bespoke, one-off media queries can be created with arbitrary values. See
|
|
58
|
-
|
|
59
|
-
<a href="https://tailwindcss.com/docs/responsive-design#arbitrary-values">
|
|
60
|
-
Tailwind docs
|
|
61
|
-
</a>{" "}
|
|
52
|
+
Bespoke, one-off media queries can be created with arbitrary values. See the{' '}
|
|
53
|
+
<a href="https://tailwindcss.com/docs/responsive-design#arbitrary-values">Tailwind docs</a>{' '}
|
|
62
54
|
for more info.
|
|
63
55
|
</Heading>
|
|
64
56
|
|
|
65
57
|
<div className="py-32">
|
|
66
58
|
<Text variant="body">
|
|
67
|
-
<strong>Min-width breakpoint</strong> (applied when the screen gets
|
|
68
|
-
<em>wider</em>)
|
|
59
|
+
<strong>Min-width breakpoint</strong> (applied when the screen gets <em>wider</em>)
|
|
69
60
|
</Text>
|
|
70
61
|
<Text variant="body">In this example: min-[500px]:bg-blue-400</Text>
|
|
71
62
|
<div className="border-solid min-[500px]:bg-blue-400 h-[50px] w-full rounded-default" />
|
|
72
63
|
</div>
|
|
73
64
|
|
|
74
65
|
<Text variant="body">
|
|
75
|
-
<strong>Max-width breakpoint</strong> (applied when the screen gets
|
|
76
|
-
<em>slimmer</em>)
|
|
66
|
+
<strong>Max-width breakpoint</strong> (applied when the screen gets <em>slimmer</em>)
|
|
77
67
|
</Text>
|
|
78
68
|
<Text variant="body">In this example: max-[500px]:bg-blue-400</Text>
|
|
79
69
|
<div className="border-solid max-[500px]:bg-blue-400 h-[50px] w-full rounded-default" />
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { StickerSheet } from "~storybook/components/StickerSheet"
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react'
|
|
3
|
+
import { StickerSheet } from '~storybook/components/StickerSheet'
|
|
5
4
|
|
|
6
5
|
export default {
|
|
7
|
-
title:
|
|
6
|
+
title: 'Guides/Tailwind/Utility Class References/Modifiers/Pseudo Selectors',
|
|
8
7
|
parameters: {
|
|
9
8
|
a11y: { disable: true },
|
|
10
|
-
docsLayout:
|
|
9
|
+
docsLayout: 'fullPage',
|
|
11
10
|
docs: {
|
|
12
11
|
description: {
|
|
13
12
|
component:
|
|
14
|
-
|
|
13
|
+
'Add a modifier before a standard tailwind utility class to have it apply in certain states. For example, hover:text-blue-500 will set the font color to blue-500 on hover.',
|
|
15
14
|
},
|
|
16
15
|
},
|
|
17
16
|
},
|
|
18
17
|
} satisfies Meta
|
|
19
18
|
|
|
20
|
-
export const PseudoSelectors: StoryFn
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<StickerSheet isReversed={isReversed}>
|
|
24
|
-
<StickerSheet.Header
|
|
25
|
-
headings={["Utility Class", "Compiled CSS", "Example"]}
|
|
26
|
-
/>
|
|
27
|
-
<StickerSheet.Row rowTitle="hover">
|
|
19
|
+
export const PseudoSelectors: StoryFn = () => (
|
|
20
|
+
<StickerSheet headers={['Utility Class', 'Compiled CSS', 'Example']}>
|
|
21
|
+
<StickerSheet.Row header="hover">
|
|
28
22
|
<p className="font-family-paragraph">hover:bg-blue-200</p>
|
|
29
23
|
<p className="font-family-paragraph">background-color: #bde2f5</p>
|
|
30
24
|
<button
|
|
@@ -34,7 +28,7 @@ export const PseudoSelectors: StoryFn<{ isReversed: boolean }> = ({
|
|
|
34
28
|
Hover me
|
|
35
29
|
</button>
|
|
36
30
|
</StickerSheet.Row>
|
|
37
|
-
<StickerSheet.Row
|
|
31
|
+
<StickerSheet.Row header="focus">
|
|
38
32
|
<p className="font-family-paragraph">focus:bg-blue-200</p>
|
|
39
33
|
<p className="font-family-paragraph">background-color: #bde2f5</p>
|
|
40
34
|
<button
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Meta, StoryFn } from
|
|
3
|
-
import classnames from
|
|
4
|
-
import { TailwindStoryTemplate } from
|
|
5
|
-
import { utilityDescription } from
|
|
6
|
-
import { kaizenTailwindTheme } from
|
|
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
7
|
|
|
8
|
-
const prefix =
|
|
9
|
-
const classEntries:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
8
|
+
const prefix = 'm-'
|
|
9
|
+
const classEntries: { utilityClassName: string; cssProperty: string }[] = Object.entries(
|
|
10
|
+
kaizenTailwindTheme.spacing ?? [],
|
|
11
|
+
).map(([suffix, cssProperty]) => ({
|
|
12
|
+
utilityClassName: `${prefix}${suffix}`,
|
|
13
|
+
cssProperty,
|
|
14
|
+
}))
|
|
16
15
|
|
|
17
16
|
export default {
|
|
18
|
-
title:
|
|
17
|
+
title: 'Guides/Tailwind/Utility Class References/Spacing/Margin',
|
|
19
18
|
parameters: {
|
|
20
19
|
a11y: { disable: true },
|
|
21
20
|
chromatic: { disable: false },
|
|
22
|
-
docsLayout:
|
|
21
|
+
docsLayout: 'fullPage',
|
|
23
22
|
docs: {
|
|
24
23
|
description: {
|
|
25
24
|
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
@@ -28,22 +27,18 @@ export default {
|
|
|
28
27
|
},
|
|
29
28
|
} satisfies Meta
|
|
30
29
|
|
|
31
|
-
export const Margin: StoryFn
|
|
30
|
+
export const Margin: StoryFn = () => (
|
|
32
31
|
<TailwindStoryTemplate
|
|
33
32
|
compiledCssPropertyName="margin"
|
|
34
33
|
classKeyValues={classEntries}
|
|
35
34
|
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
36
35
|
<div className="w-min border rounded">
|
|
37
36
|
<p
|
|
38
|
-
className={classnames(
|
|
39
|
-
"p-4 border border-dashed w-min rounded bg-blue-100",
|
|
40
|
-
utilityClass
|
|
41
|
-
)}
|
|
37
|
+
className={classnames('p-4 border border-dashed w-min rounded bg-blue-100', utilityClass)}
|
|
42
38
|
>
|
|
43
39
|
Margin
|
|
44
40
|
</p>
|
|
45
41
|
</div>
|
|
46
42
|
)}
|
|
47
|
-
isReversed={isReversed}
|
|
48
43
|
/>
|
|
49
44
|
)
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Meta, StoryFn } from
|
|
3
|
-
import classnames from
|
|
4
|
-
import { TailwindStoryTemplate } from
|
|
5
|
-
import { utilityDescription } from
|
|
6
|
-
import { kaizenTailwindTheme } from
|
|
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
7
|
|
|
8
|
-
const prefix =
|
|
9
|
-
const classEntries:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
8
|
+
const prefix = 'p-'
|
|
9
|
+
const classEntries: { utilityClassName: string; cssProperty: string }[] = Object.entries(
|
|
10
|
+
kaizenTailwindTheme.spacing ?? [],
|
|
11
|
+
).map(([suffix, cssProperty]) => ({
|
|
12
|
+
utilityClassName: `${prefix}${suffix}`,
|
|
13
|
+
cssProperty,
|
|
14
|
+
}))
|
|
16
15
|
|
|
17
16
|
export default {
|
|
18
|
-
title:
|
|
17
|
+
title: 'Guides/Tailwind/Utility Class References/Spacing/Padding',
|
|
19
18
|
parameters: {
|
|
20
19
|
a11y: { disable: true },
|
|
21
20
|
chromatic: { disable: false },
|
|
22
|
-
docsLayout:
|
|
21
|
+
docsLayout: 'fullPage',
|
|
23
22
|
docs: {
|
|
24
23
|
description: {
|
|
25
24
|
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
@@ -28,20 +27,14 @@ export default {
|
|
|
28
27
|
},
|
|
29
28
|
} satisfies Meta
|
|
30
29
|
|
|
31
|
-
export const Padding: StoryFn
|
|
30
|
+
export const Padding: StoryFn = () => (
|
|
32
31
|
<TailwindStoryTemplate
|
|
33
32
|
compiledCssPropertyName="padding"
|
|
34
33
|
classKeyValues={classEntries}
|
|
35
34
|
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
36
|
-
<p
|
|
37
|
-
className={classnames(
|
|
38
|
-
"border border-purple-100 w-min rounded bg-blue-100",
|
|
39
|
-
utilityClass
|
|
40
|
-
)}
|
|
41
|
-
>
|
|
35
|
+
<p className={classnames('border border-purple-100 w-min rounded bg-blue-100', utilityClass)}>
|
|
42
36
|
Padding
|
|
43
37
|
</p>
|
|
44
38
|
)}
|
|
45
|
-
isReversed={isReversed}
|
|
46
39
|
/>
|
|
47
40
|
)
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Meta, StoryFn } from
|
|
3
|
-
import { TailwindStoryTemplate } from
|
|
4
|
-
import { utilityDescription } from
|
|
5
|
-
import { kaizenTailwindTheme } from
|
|
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
6
|
|
|
7
|
-
const prefix =
|
|
8
|
-
const classEntries:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
)
|
|
7
|
+
const prefix = 'font-'
|
|
8
|
+
const classEntries: { utilityClassName: string; cssProperty: string }[] = Object.entries(
|
|
9
|
+
kaizenTailwindTheme.fontFamily ?? [],
|
|
10
|
+
).map(([suffix, cssPropertyArr]) => ({
|
|
11
|
+
utilityClassName: `${prefix}${suffix}`,
|
|
12
|
+
cssProperty: cssPropertyArr[0],
|
|
13
|
+
}))
|
|
15
14
|
|
|
16
15
|
export default {
|
|
17
|
-
title:
|
|
16
|
+
title: 'Guides/Tailwind/Utility Class References/Typography/Font Family',
|
|
18
17
|
parameters: {
|
|
19
18
|
a11y: { disable: true },
|
|
20
19
|
chromatic: { disable: false },
|
|
21
|
-
docsLayout:
|
|
20
|
+
docsLayout: 'fullPage',
|
|
22
21
|
docs: {
|
|
23
22
|
description: {
|
|
24
23
|
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
@@ -27,15 +26,12 @@ export default {
|
|
|
27
26
|
},
|
|
28
27
|
} satisfies Meta
|
|
29
28
|
|
|
30
|
-
export const FontFamily: StoryFn
|
|
31
|
-
isReversed,
|
|
32
|
-
}) => (
|
|
29
|
+
export const FontFamily: StoryFn = () => (
|
|
33
30
|
<TailwindStoryTemplate
|
|
34
31
|
compiledCssPropertyName="font-family"
|
|
35
32
|
classKeyValues={classEntries}
|
|
36
33
|
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
37
34
|
<p className={utilityClass}>Aa</p>
|
|
38
35
|
)}
|
|
39
|
-
isReversed={isReversed}
|
|
40
36
|
/>
|
|
41
37
|
)
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { StoryFn } from
|
|
3
|
-
import { TailwindStoryTemplate } from
|
|
4
|
-
import { utilityDescription } from
|
|
5
|
-
import { kaizenTailwindTheme } from
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { 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
6
|
|
|
7
|
-
const prefix =
|
|
8
|
-
const classEntries = Object.entries(kaizenTailwindTheme.fontSize
|
|
7
|
+
const prefix = 'text-'
|
|
8
|
+
const classEntries = Object.entries(kaizenTailwindTheme.fontSize ?? []).map(
|
|
9
9
|
([suffix, cssProperty]) => ({
|
|
10
10
|
utilityClassName: `${prefix}${suffix}`,
|
|
11
11
|
cssProperty,
|
|
12
|
-
})
|
|
12
|
+
}),
|
|
13
13
|
)
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
|
-
title:
|
|
16
|
+
title: 'Guides/Tailwind/Utility Class References/Typography/Font Size',
|
|
17
17
|
parameters: {
|
|
18
18
|
a11y: { disable: true },
|
|
19
19
|
chromatic: { disable: false },
|
|
20
|
-
docsLayout:
|
|
20
|
+
docsLayout: 'fullPage',
|
|
21
21
|
docs: {
|
|
22
22
|
description: {
|
|
23
23
|
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
@@ -26,13 +26,12 @@ export default {
|
|
|
26
26
|
},
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export const FontSize: StoryFn
|
|
29
|
+
export const FontSize: StoryFn = () => (
|
|
30
30
|
<TailwindStoryTemplate
|
|
31
31
|
compiledCssPropertyName="font-size"
|
|
32
32
|
classKeyValues={classEntries}
|
|
33
33
|
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
34
34
|
<p className={utilityClass}>Aa</p>
|
|
35
35
|
)}
|
|
36
|
-
isReversed={isReversed}
|
|
37
36
|
/>
|
|
38
37
|
)
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Meta, StoryFn } from
|
|
3
|
-
import { TailwindStoryTemplate } from
|
|
4
|
-
import { utilityDescription } from
|
|
5
|
-
import { kaizenTailwindTheme } from
|
|
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
6
|
|
|
7
|
-
const prefix =
|
|
8
|
-
const classEntries:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
)
|
|
7
|
+
const prefix = 'font-'
|
|
8
|
+
const classEntries: { utilityClassName: string; cssProperty: string }[] = Object.entries(
|
|
9
|
+
kaizenTailwindTheme.fontWeight ?? [],
|
|
10
|
+
).map(([suffix, cssProperty]) => ({
|
|
11
|
+
utilityClassName: `${prefix}${suffix}`,
|
|
12
|
+
cssProperty,
|
|
13
|
+
}))
|
|
15
14
|
|
|
16
15
|
export default {
|
|
17
|
-
title:
|
|
16
|
+
title: 'Guides/Tailwind/Utility Class References/Typography/Font Weight',
|
|
18
17
|
parameters: {
|
|
19
18
|
a11y: { disable: true },
|
|
20
19
|
chromatic: { disable: false },
|
|
21
|
-
docsLayout:
|
|
20
|
+
docsLayout: 'fullPage',
|
|
22
21
|
docs: {
|
|
23
22
|
description: {
|
|
24
23
|
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
@@ -27,15 +26,12 @@ export default {
|
|
|
27
26
|
},
|
|
28
27
|
} satisfies Meta
|
|
29
28
|
|
|
30
|
-
export const FontWeight: StoryFn
|
|
31
|
-
isReversed,
|
|
32
|
-
}) => (
|
|
29
|
+
export const FontWeight: StoryFn = () => (
|
|
33
30
|
<TailwindStoryTemplate
|
|
34
31
|
compiledCssPropertyName="font-weight"
|
|
35
32
|
classKeyValues={classEntries}
|
|
36
33
|
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
37
34
|
<p className={utilityClass}>Aa</p>
|
|
38
35
|
)}
|
|
39
|
-
isReversed={isReversed}
|
|
40
36
|
/>
|
|
41
37
|
)
|