@kaizen/tailwind 1.3.12 → 1.3.14
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/types/tailwind-presets.d.ts +1 -1
- package/package.json +5 -5
- package/src/_docs/pages/backgrounds/background-color.stories.tsx +1 -1
- package/src/_docs/pages/borders/border-color.stories.tsx +1 -1
- package/src/_docs/pages/borders/border-radius.stories.tsx +1 -1
- package/src/_docs/pages/borders/border-spacing.stories.tsx +1 -1
- package/src/_docs/pages/borders/border-width.stories.tsx +1 -1
- package/src/_docs/pages/configuration.mdx +22 -15
- package/src/_docs/pages/effects/shadow.stories.tsx +1 -1
- package/src/_docs/pages/getting-started.mdx +5 -5
- package/src/_docs/pages/modifiers/media-queries.stories.tsx +1 -1
- package/src/_docs/pages/modifiers/pseudo-states.stories.tsx +1 -1
- package/src/_docs/pages/overview.mdx +0 -4
- package/src/_docs/pages/spacing/margin.stories.tsx +1 -1
- package/src/_docs/pages/spacing/padding.stories.tsx +1 -1
- package/src/_docs/pages/typography/font-family.stories.tsx +1 -1
- package/src/_docs/pages/typography/font-size.stories.tsx +1 -1
- package/src/_docs/pages/typography/font-weight.stories.tsx +1 -1
- package/src/_docs/pages/typography/line-height.stories.tsx +1 -1
- package/src/_docs/pages/typography/max-text-width.stories.tsx +2 -2
- package/src/_docs/pages/typography/text-color.stories.tsx +1 -1
- package/src/_docs/pages/working-with-tailwind.mdx +2 -2
- package/src/_docs/pages/working-with-tailwind.stories.tsx +2 -2
- package/src/_docs/utils/TailwindStoryTemplate/components/CardContent/CardContent.tsx +1 -1
- package/src/_docs/utils/TailwindStoryTemplate/components/CodeSnippet/CodeSnippet.tsx +1 -1
- package/src/tailwind-presets.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/tailwind",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.14",
|
|
4
4
|
"description": "Kaizen Tailwind presets",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"private": false,
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@kaizen/design-tokens": "10.8.
|
|
25
|
+
"@kaizen/design-tokens": "10.8.8"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"classnames": "^2.5.1",
|
|
29
|
-
"rollup": "^4.
|
|
30
|
-
"tailwindcss": "^3.4.
|
|
29
|
+
"rollup": "^4.35.0",
|
|
30
|
+
"tailwindcss": "^3.4.17",
|
|
31
31
|
"tslib": "^2.8.1",
|
|
32
|
-
"@kaizen/package-bundler": "2.0.
|
|
32
|
+
"@kaizen/package-bundler": "2.0.5"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"tailwindcss": ">=3.4.7"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
5
5
|
import { flattenEntries } from '~tailwind/_docs/utils/flattenEntries'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
5
5
|
import { flattenEntries } from '~tailwind/_docs/utils/flattenEntries'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
5
5
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
4
4
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
5
5
|
import { kaizenTailwindTheme } from '~tailwind/tailwind-presets'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
5
5
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta } from '@storybook/blocks'
|
|
1
|
+
import { Meta, Unstyled } from '@storybook/blocks'
|
|
2
2
|
import { InlineNotification } from '~components/Notification'
|
|
3
3
|
|
|
4
4
|
<Meta title="Guides/Tailwind/Configuration" />
|
|
@@ -58,17 +58,24 @@ If this is changed or you are not using the [Frontend Template](https://github.c
|
|
|
58
58
|
<div id="#root">{/* Application code */}</div>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
61
|
+
<Unstyled>
|
|
62
|
+
<InlineNotification persistent type="cautionary" style="inline" title="Changing the selector">
|
|
63
|
+
{
|
|
64
|
+
<>
|
|
65
|
+
We advise using an <code>id</code> with <code>"#root"</code> as the default
|
|
66
|
+
selector. Using different id's, classes or HTML elements like <code>body</code> as the
|
|
67
|
+
selector could result in:
|
|
68
|
+
<ul>
|
|
69
|
+
<li>
|
|
70
|
+
Utility classes not superseding Kaizen defaults when using{' '}
|
|
71
|
+
<code>classNameOverride</code>
|
|
72
|
+
</li>
|
|
73
|
+
<li>
|
|
74
|
+
Duplication of utillity classes in your CSS bundle caused by consuming components with
|
|
75
|
+
different <code>important</code> selectors
|
|
76
|
+
</li>
|
|
77
|
+
</ul>
|
|
78
|
+
</>
|
|
79
|
+
}
|
|
80
|
+
</InlineNotification>
|
|
81
|
+
</Unstyled>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
5
5
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
@@ -23,7 +23,7 @@ If your project was created from this template, you should only need to do [Step
|
|
|
23
23
|
## 1. Install the preset
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
26
|
+
pnpm add -D @kaizen/tailwind
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## 2. Implement the Preset
|
|
@@ -50,7 +50,7 @@ module.exports = {
|
|
|
50
50
|
}
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
For preset configuration options, see our [configuration docs](/story/systems-tailwind-configuration--page)
|
|
53
|
+
For preset configuration options, see our [configuration docs](/story/systems-tailwind-configuration--page).
|
|
54
54
|
|
|
55
55
|
## 3. Add the Tailwind Directives
|
|
56
56
|
|
|
@@ -71,11 +71,11 @@ For more information, see [here](https://tailwindcss.com/docs/functions-and-dire
|
|
|
71
71
|
|
|
72
72
|
Tailwind Play is an online code sandbox with Tailwind set up out of the box. The Kaizen Team has created an instance with the Kaizen Preset values [here](https://play.tailwindcss.com/OUogvUgXQR)
|
|
73
73
|
|
|
74
|
-
Use this playground to get familiar with our preset, test out new config extensions, create a quick proof of concept, or share code examples with other engineers. Feel free to hit
|
|
74
|
+
Use this playground to get familiar with our preset, test out new config extensions, create a quick proof of concept, or share code examples with other engineers. Feel free to hit 'Share' - it'll create a new url without overriding the one provided here.
|
|
75
75
|
|
|
76
76
|
<img src={TailwindPlay} alt="Tailwind Play" />
|
|
77
77
|
|
|
78
|
-
The playground also has a great “Generated CSS” feature that let
|
|
78
|
+
The playground also has a great “Generated CSS” feature that let's you see which css classes are generated by your preset when you implement tailwind utilities. It's a great way to see what Tailwind is doing under the hood.
|
|
79
79
|
|
|
80
80
|
<div className="flex justify-center">
|
|
81
81
|
<img src={CssGeneration} alt="CSS Generation" />
|
|
@@ -122,4 +122,4 @@ Check it out [here](https://marketplace.visualstudio.com/items?itemName=moalamri
|
|
|
122
122
|
### Prettier plugin
|
|
123
123
|
|
|
124
124
|
Tailwind now has prettier support! 🎉 This [prettier plugin](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) will order your classnames for you.
|
|
125
|
-
We
|
|
125
|
+
We'd highly recommend it for the sake of consistency. The Tailwind docs even have a guide [here](https://tailwindcss.com/blog/automatic-class-sorting-with-prettier).
|
|
@@ -7,10 +7,6 @@ import AnatomyDiagram from '../assets/tw-anatomy.png'
|
|
|
7
7
|
|
|
8
8
|
<br />
|
|
9
9
|
|
|
10
|
-
## Caveat before use
|
|
11
|
-
|
|
12
|
-
This is an early release of the Kaizen Tailwind Preset - the API may change and evolve as we receive feedback from our teams. We will endeavour to assist where possible if classes or utilities are updated in the future.
|
|
13
|
-
|
|
14
10
|
## What our package does
|
|
15
11
|
|
|
16
12
|
The `@kaizen/tailwind` package is essentially a custom Tailwind preset. For more information about Tailwind presets, see their docs [here](https://tailwindcss.com/docs/presets). This package does not change how Tailwind works; it only defines the suffixes that can be applied when constructing utility classes.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
5
5
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
5
5
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
4
4
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
5
5
|
import { kaizenTailwindTheme } from '~tailwind/tailwind-presets'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { StoryFn } from '@storybook/react'
|
|
2
|
+
import { type StoryFn } from '@storybook/react'
|
|
3
3
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
4
4
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
5
5
|
import { kaizenTailwindTheme } from '~tailwind/tailwind-presets'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
4
4
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
5
5
|
import { kaizenTailwindTheme } from '~tailwind/tailwind-presets'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
5
5
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import { type Meta, type StoryFn } from '@storybook/react'
|
|
3
3
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
4
4
|
import { utilityDescription } from '~tailwind/_docs/utils/utilityDescription'
|
|
5
5
|
import { kaizenTailwindTheme } from '~tailwind/tailwind-presets'
|
|
6
6
|
|
|
7
7
|
const prefix = 'max-w-'
|
|
8
|
-
const classEntries = Object.entries(kaizenTailwindTheme.extend.maxWidth
|
|
8
|
+
const classEntries = Object.entries(kaizenTailwindTheme.extend.maxWidth ?? []).map(
|
|
9
9
|
([suffix, cssPropertyArr]) => ({
|
|
10
10
|
utilityClassName: `${prefix}${suffix}`,
|
|
11
11
|
cssProperty: cssPropertyArr as string,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { StoryFn } from '@storybook/react'
|
|
2
|
+
import { type StoryFn } from '@storybook/react'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import { TailwindStoryTemplate } from '~tailwind/_docs/utils/TailwindStoryTemplate'
|
|
5
5
|
import { flattenEntries } from '~tailwind/_docs/utils/flattenEntries'
|
|
@@ -16,7 +16,7 @@ This page describes and demonstrates the main intended use cases for this packag
|
|
|
16
16
|
|
|
17
17
|
## Spacing and layouts
|
|
18
18
|
|
|
19
|
-
For information about Cultureamp's spacing and layout system in general, see [here](/story/systems-layout-and-spacing--page)
|
|
19
|
+
For information about Cultureamp's spacing and layout system in general, see [here](/story/systems-layout-and-spacing--page).
|
|
20
20
|
|
|
21
21
|
When building a page, ideally [Kaizen](https://github.com/cultureamp/kaizen-design-system) components should be used as much as possible, with the front-end engineer responsible for the spacing between them. In these cases, our Tailwind preset makes it easy by adding our spacing tokens to Tailwind's core spacing modules.
|
|
22
22
|
|
|
@@ -46,7 +46,7 @@ In this example, a Tailwind css rule is being applied to a Kaizen `<Heading />`
|
|
|
46
46
|
|
|
47
47
|
<Canvas of={Examples.TailwindExampleClassNameOverrideHeading} />
|
|
48
48
|
|
|
49
|
-
- first-letter:capitalize
|
|
49
|
+
- `first-letter:capitalize`: Adds text-transform: capitalize on the first-letter pseudo selector
|
|
50
50
|
|
|
51
51
|
<br />
|
|
52
52
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { StoryFn } from '@storybook/react'
|
|
2
|
+
import { type StoryFn } from '@storybook/react'
|
|
3
|
+
import { Button } from '~components/Button'
|
|
3
4
|
import { Card } from '~components/Card'
|
|
4
5
|
import { Heading } from '~components/Heading'
|
|
5
6
|
import { CustomSurvey, CustomUnattributedSurvey } from '~components/Illustration'
|
|
6
7
|
import { Skirt } from '~components/Skirt'
|
|
7
|
-
import { Button } from '~components/__actions__/v2'
|
|
8
8
|
import { TailwindStoryTemplate } from '../utils/TailwindStoryTemplate'
|
|
9
9
|
|
|
10
10
|
export default {
|
package/src/tailwind-presets.ts
CHANGED