@kaizen/tailwind 1.3.10 → 1.3.12
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 +6 -6
- package/src/_docs/pages/backgrounds/background-color.mdx +2 -2
- package/src/_docs/pages/backgrounds/background-color.stories.tsx +13 -20
- package/src/_docs/pages/borders/border-color.mdx +2 -2
- package/src/_docs/pages/borders/border-color.stories.tsx +14 -20
- package/src/_docs/pages/borders/border-radius.mdx +2 -2
- package/src/_docs/pages/borders/border-radius.stories.tsx +18 -22
- package/src/_docs/pages/borders/border-spacing.mdx +2 -2
- package/src/_docs/pages/borders/border-spacing.stories.tsx +15 -19
- package/src/_docs/pages/borders/border-width.mdx +8 -9
- package/src/_docs/pages/borders/border-width.stories.tsx +18 -22
- package/src/_docs/pages/configuration.mdx +18 -22
- package/src/_docs/pages/contributing.mdx +2 -2
- package/src/_docs/pages/effects/shadow.mdx +2 -2
- package/src/_docs/pages/effects/shadow.stories.tsx +17 -19
- package/src/_docs/pages/getting-started.mdx +9 -9
- package/src/_docs/pages/modifiers/media-queries.mdx +2 -2
- package/src/_docs/pages/modifiers/media-queries.stories.tsx +14 -24
- package/src/_docs/pages/modifiers/pseudo-states.mdx +5 -5
- package/src/_docs/pages/modifiers/pseudo-states.stories.tsx +10 -16
- package/src/_docs/pages/overview.mdx +6 -5
- package/src/_docs/pages/spacing/margin.mdx +7 -7
- package/src/_docs/pages/spacing/margin.stories.tsx +17 -22
- package/src/_docs/pages/spacing/padding.mdx +7 -7
- package/src/_docs/pages/spacing/padding.stories.tsx +17 -24
- package/src/_docs/pages/typography/font-family.mdx +2 -2
- package/src/_docs/pages/typography/font-family.stories.tsx +15 -19
- package/src/_docs/pages/typography/font-size.mdx +2 -2
- package/src/_docs/pages/typography/font-size.stories.tsx +11 -12
- package/src/_docs/pages/typography/font-weight.mdx +2 -2
- package/src/_docs/pages/typography/font-weight.stories.tsx +15 -19
- package/src/_docs/pages/typography/line-height.mdx +2 -2
- package/src/_docs/pages/typography/line-height.stories.tsx +17 -23
- package/src/_docs/pages/typography/max-text-width.mdx +2 -2
- package/src/_docs/pages/typography/max-text-width.stories.tsx +25 -29
- package/src/_docs/pages/typography/text-color.mdx +2 -2
- package/src/_docs/pages/typography/text-color.stories.tsx +16 -17
- package/src/_docs/pages/utility-class-helpers-overview.mdx +24 -23
- package/src/_docs/pages/working-with-tailwind.mdx +11 -7
- 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,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,6 +1,6 @@
|
|
|
1
|
-
import { Description, Meta, Story, Unstyled } from
|
|
2
|
-
import { Card } from
|
|
3
|
-
import * as Examples from
|
|
1
|
+
import { Description, Meta, Story, Unstyled } from '@storybook/blocks'
|
|
2
|
+
import { Card } from '~components/Card'
|
|
3
|
+
import * as Examples from './padding.stories'
|
|
4
4
|
|
|
5
5
|
<Meta of={Examples} />
|
|
6
6
|
|
|
@@ -12,12 +12,12 @@ import * as Examples from "./padding.stories"
|
|
|
12
12
|
<Card variant="informative" classNameOverride="w-fit mb-24">
|
|
13
13
|
<div className="font-family-paragraph p-24">
|
|
14
14
|
<p>
|
|
15
|
-
The padding prefix 'p-' has been used in the examples in this
|
|
16
|
-
|
|
15
|
+
The padding prefix 'p-' has been used in the examples in this document, which
|
|
16
|
+
compiles to the `padding` property in CSS.
|
|
17
17
|
</p>
|
|
18
18
|
<p>
|
|
19
|
-
Note that there are other prefixes (such as `pl-` for `padding-left`)
|
|
20
|
-
|
|
19
|
+
Note that there are other prefixes (such as `pl-` for `padding-left`) that can be used
|
|
20
|
+
instead. Available padding prefixes can be referenced
|
|
21
21
|
<a href="https://tailwindcss.com/docs/padding#basic-usage">here</a>.
|
|
22
22
|
</p>
|
|
23
23
|
</div>
|
|
@@ -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
|
)
|
|
@@ -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 = 'leading-'
|
|
9
|
+
const classEntries: { utilityClassName: string; cssProperty: string }[] = Object.entries(
|
|
10
|
+
kaizenTailwindTheme.lineHeight ?? [],
|
|
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/Typography/Line Height',
|
|
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,17 +27,12 @@ export default {
|
|
|
28
27
|
},
|
|
29
28
|
} satisfies Meta
|
|
30
29
|
|
|
31
|
-
export const LineHeight: StoryFn
|
|
32
|
-
isReversed,
|
|
33
|
-
}) => (
|
|
30
|
+
export const LineHeight: StoryFn = () => (
|
|
34
31
|
<TailwindStoryTemplate
|
|
35
32
|
compiledCssPropertyName="line-height"
|
|
36
33
|
classKeyValues={classEntries}
|
|
37
34
|
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
38
|
-
<p className={classnames(
|
|
39
|
-
Tutant Meenage Neetle Teetles
|
|
40
|
-
</p>
|
|
35
|
+
<p className={classnames('w-0', utilityClass)}>Tutant Meenage Neetle Teetles</p>
|
|
41
36
|
)}
|
|
42
|
-
isReversed={isReversed}
|
|
43
37
|
/>
|
|
44
38
|
)
|
|
@@ -1,23 +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 = Object.entries(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const prefix = 'max-w-'
|
|
8
|
+
const classEntries = Object.entries(kaizenTailwindTheme.extend.maxWidth || []).map(
|
|
9
|
+
([suffix, cssPropertyArr]) => ({
|
|
10
|
+
utilityClassName: `${prefix}${suffix}`,
|
|
11
|
+
cssProperty: cssPropertyArr as string,
|
|
12
|
+
}),
|
|
13
|
+
)
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
|
-
title:
|
|
16
|
+
title: 'Guides/Tailwind/Utility Class References/Typography/Max Text Width',
|
|
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),
|
|
@@ -27,34 +27,30 @@ export default {
|
|
|
27
27
|
} satisfies Meta
|
|
28
28
|
|
|
29
29
|
const fontClasses = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
'max-w-paragraph-lede': 'text-paragraph-lede leading-paragraph-lede',
|
|
31
|
+
'max-w-paragraph': 'text-paragraph leading-paragraph',
|
|
32
|
+
'max-w-paragraph-sm': 'text-paragraph-sm leading-paragraph-sm',
|
|
33
|
+
'max-w-paragraph-xs': 'text-paragraph-xs leading-paragraph-xs',
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
const getFontClass = (utilityClass: string): string =>
|
|
37
|
-
fontClasses[utilityClass as keyof typeof fontClasses] ||
|
|
37
|
+
fontClasses[utilityClass as keyof typeof fontClasses] || ''
|
|
38
38
|
|
|
39
|
-
export const MaxTextWidth: StoryFn
|
|
40
|
-
isReversed,
|
|
41
|
-
}) => (
|
|
39
|
+
export const MaxTextWidth: StoryFn = () => (
|
|
42
40
|
<TailwindStoryTemplate
|
|
43
41
|
compiledCssPropertyName="max-width"
|
|
44
42
|
classKeyValues={classEntries}
|
|
45
43
|
renderExampleComponent={(utilityClass): React.ReactElement => (
|
|
46
44
|
<>
|
|
47
|
-
<p className={[utilityClass, getFontClass(utilityClass)].join(
|
|
48
|
-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto, optio
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{[utilityClass, getFontClass(utilityClass)].join(" ")})
|
|
45
|
+
<p className={[utilityClass, getFontClass(utilityClass)].join(' ')}>
|
|
46
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto, optio incidunt explicabo
|
|
47
|
+
facilis ipsam, porro magni vero libero itaque rerum deserunt quo molestiae expedita dolor?
|
|
48
|
+
Alias iusto ad maiores odit! ({[utilityClass, getFontClass(utilityClass)].join(' ')})
|
|
52
49
|
</p>
|
|
53
50
|
<code className="text-paragraph-sm bg-gray-300 py-4 px-8">
|
|
54
|
-
{[utilityClass, getFontClass(utilityClass)].join(
|
|
51
|
+
{[utilityClass, getFontClass(utilityClass)].join(' ')}
|
|
55
52
|
</code>
|
|
56
53
|
</>
|
|
57
54
|
)}
|
|
58
|
-
isReversed={isReversed}
|
|
59
55
|
/>
|
|
60
56
|
)
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { StoryFn } from
|
|
3
|
-
import classnames from
|
|
4
|
-
import { TailwindStoryTemplate } from
|
|
5
|
-
import { flattenEntries } from
|
|
6
|
-
import { utilityDescription } from
|
|
7
|
-
import { kaizenTailwindTheme } from
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { 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
8
|
|
|
9
|
-
const prefix =
|
|
10
|
-
const classEntries = flattenEntries(prefix, kaizenTailwindTheme.colors
|
|
9
|
+
const prefix = 'text-'
|
|
10
|
+
const classEntries = flattenEntries(prefix, kaizenTailwindTheme.colors ?? {})
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
|
-
title:
|
|
13
|
+
title: 'Guides/Tailwind/Utility Class References/Typography/Text Color',
|
|
14
14
|
parameters: {
|
|
15
15
|
a11y: { disable: true },
|
|
16
16
|
chromatic: { disable: false },
|
|
17
|
-
docsLayout:
|
|
17
|
+
docsLayout: 'fullPage',
|
|
18
18
|
docs: {
|
|
19
19
|
description: {
|
|
20
20
|
component: utilityDescription(prefix, classEntries[0].utilityClassName),
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
},
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export const TextColor: StoryFn
|
|
26
|
+
export const TextColor: StoryFn = () => (
|
|
27
27
|
<TailwindStoryTemplate
|
|
28
28
|
compiledCssPropertyName="color"
|
|
29
29
|
classKeyValues={classEntries}
|
|
@@ -31,22 +31,21 @@ export const TextColor: StoryFn<{ isReversed: boolean }> = ({ isReversed }) => (
|
|
|
31
31
|
<div className="flex items-center h-100">
|
|
32
32
|
<p
|
|
33
33
|
className={classnames(
|
|
34
|
-
|
|
35
|
-
utilityClass
|
|
34
|
+
'font-family-paragraph p-8 rounded font-weight-display text-heading-3 m-0 mr-16',
|
|
35
|
+
utilityClass,
|
|
36
36
|
)}
|
|
37
37
|
>
|
|
38
38
|
Light bg
|
|
39
39
|
</p>
|
|
40
40
|
<p
|
|
41
41
|
className={classnames(
|
|
42
|
-
|
|
43
|
-
utilityClass
|
|
42
|
+
'font-family-paragraph p-8 bg-[black] rounded font-weight-display text-heading-3 m-0',
|
|
43
|
+
utilityClass,
|
|
44
44
|
)}
|
|
45
45
|
>
|
|
46
46
|
Dark bg
|
|
47
47
|
</p>
|
|
48
48
|
</div>
|
|
49
49
|
)}
|
|
50
|
-
isReversed={isReversed}
|
|
51
50
|
/>
|
|
52
51
|
)
|