@kaizen/tailwind 1.5.0 → 1.5.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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var designTokens = require('@kaizen/design-tokens');
3
+ var js = require('@kaizen/design-tokens/js');
4
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
5
  /**
6
6
  * checks if a key from design tokens should be filtered from tailwind
@@ -16,6 +16,6 @@ var filterDenyListValues = function (spacingTokensObject) {
16
16
  return isValidToken(key);
17
17
  }));
18
18
  };
19
- var kzSpacing = filterDenyListValues(designTokens.heartTheme.spacing);
19
+ var kzSpacing = filterDenyListValues(js.tokens.spacing);
20
20
  exports.filterDenyListValues = filterDenyListValues;
21
21
  exports.kzSpacing = kzSpacing;
@@ -1,4 +1,4 @@
1
- import { heartTheme } from '@kaizen/design-tokens';
1
+ import { tokens } from '@kaizen/design-tokens/js';
2
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
3
  /**
4
4
  * checks if a key from design tokens should be filtered from tailwind
@@ -14,5 +14,5 @@ var filterDenyListValues = function (spacingTokensObject) {
14
14
  return isValidToken(key);
15
15
  }));
16
16
  };
17
- var kzSpacing = filterDenyListValues(heartTheme.spacing);
17
+ var kzSpacing = filterDenyListValues(tokens.spacing);
18
18
  export { filterDenyListValues, kzSpacing };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/tailwind",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
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.10.0"
25
+ "@kaizen/design-tokens": "11.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@cultureamp/package-bundler": "^2.3.1",
28
+ "@cultureamp/package-bundler": "^2.3.2",
29
29
  "classnames": "^2.5.1",
30
- "rollup": "^4.40.2",
31
- "react": "^19.0.0",
32
- "react-dom": "^19.0.0",
30
+ "rollup": "^4.46.2",
31
+ "react": "^19.1.0",
32
+ "react-dom": "^19.1.0",
33
33
  "tailwindcss": "^3.4.17",
34
34
  "tslib": "^2.8.1"
35
35
  },
@@ -59,7 +59,7 @@ If this is changed or you are not using the [Frontend Template](https://github.c
59
59
  ```
60
60
 
61
61
  <Unstyled>
62
- <InlineNotification persistent type="cautionary" style="inline" title="Changing the selector">
62
+ <InlineNotification persistent variant="cautionary" style="inline" title="Changing the selector">
63
63
  {
64
64
  <>
65
65
  We advise using an <code>id</code> with <code>&quot;#root&quot;</code> as the default
@@ -19,7 +19,7 @@ You may also need to reload the window for these to be picked up with TW Intelli
19
19
 
20
20
  **Intellisense not working within the class attributes**
21
21
 
22
- For configuring IntelliSense refer to the [CONFIGURATION.md](/story/systems-tailwind-preset-configuration--page)
22
+ For configuring IntelliSense refer to the [Getting Started guide](/docs/guides-tailwind-getting-started--docs#tailwind-css-vscode-intellisense-plugin)
23
23
 
24
24
  Check the output in your terminal output for TailwindCSS IntelliSense.
25
25
 
@@ -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](/docs/guides-tailwind-configuration--docs).
54
54
 
55
55
  ## 3. Add the Tailwind Directives
56
56
 
@@ -10,7 +10,7 @@ import AnatomyDiagram from '../assets/tw-anatomy.png'
10
10
  ## What our package does
11
11
 
12
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.
13
- To see a list of utilities generated by our preset, see our [Utility Class Reference Docs](/story/systems-tailwind-utility-class-references-utility-class-references--page).
13
+ To see a list of utilities generated by our preset, see our [Utility Class Reference Docs](/docs/guides-tailwind-utility-class-references-overview--docs).
14
14
  The following diagram shows the construction of a utility class that adds a background of `blue-400` on hover. The modifier `hover:` and the prefix `bg-` are part of Tailwind by default. The suffix `gray-400` is defined by our preset, and represents one of our color design tokens.
15
15
 
16
16
  <img src={AnatomyDiagram} alt="Tailwind utility class anatomy" />
@@ -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](/docs/guides-layout-and-spacing--docs).
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
 
@@ -27,7 +27,7 @@ Here, Tailwind has been used to center a Kaizen button within a div.
27
27
  - `flex`: Adds `display: flex`
28
28
  - `justify-center`: Adds `justify-content: center`
29
29
  - `border-solid`: Adds `border-style: solid`
30
- - `p-16`: Adds `padding: 1rem` (`16px` = `1rem` - see the [layout and spacing docs](/story/systems-layout-and-spacing--page) for more on this)
30
+ - `p-16`: Adds `padding: 1rem` (`16px` = `1rem` - see the [layout and spacing docs](/docs/guides-layout-and-spacing--docs) for more on this)
31
31
 
32
32
  Here's a more complex example, where some `<Card>` components and text have been spaced and laid out with Tailwind:
33
33
 
@@ -1,10 +1,11 @@
1
1
  import React from 'react'
2
2
  import { type StoryFn } from '@storybook/react'
3
- import { Button } from '~components/Button'
3
+ import { Button } from '~components/ButtonV1'
4
4
  import { Card } from '~components/Card'
5
+ import { Container } from '~components/Container'
6
+ import { Content } from '~components/Content'
5
7
  import { Heading } from '~components/Heading'
6
8
  import { CustomSurvey, CustomUnattributedSurvey } from '~components/Illustration'
7
- import { Skirt } from '~components/Skirt'
8
9
  import { TailwindStoryTemplate } from '../utils/TailwindStoryTemplate'
9
10
 
10
11
  export default {
@@ -19,14 +20,16 @@ export const TailwindExampleSpacingAndLayouts: StoryFn = () => (
19
20
 
20
21
  export const TailwindExampleSpacingAndLayoutsComplex: StoryFn = () => (
21
22
  <>
22
- <Skirt>
23
- <Heading variant="heading-2" color="white" classNameOverride="pt-24">
24
- Laid out with Tailwind
25
- </Heading>
26
- <Card variant="informative" classNameOverride="mt-24">
27
- <div className="h-[300px]" />
28
- </Card>
29
- </Skirt>
23
+ <Container>
24
+ <Content>
25
+ <Heading variant="heading-2" color="dark" classNameOverride="pt-24">
26
+ Laid out with Tailwind
27
+ </Heading>
28
+ <Card color="blue" classNameOverride="mt-24">
29
+ <div className="h-[300px]" />
30
+ </Card>
31
+ </Content>
32
+ </Container>
30
33
  {/* Adds flex, makes the width 100% and centers content */}
31
34
  <div className="flex w-full justify-center">
32
35
  {/* Adds margins, width, and max width */}
@@ -45,7 +48,7 @@ export const TailwindExampleSpacingAndLayoutsComplex: StoryFn = () => (
45
48
  {/* Adds margin-top, flex, and a height of 200px */}
46
49
  <div className="mt-64 flex h-[200px]">
47
50
  {[0, 1, 2, 3].map((index) => (
48
- <Card key={index} variant="informative" classNameOverride="mr-24 last:mr-0 w-full">
51
+ <Card key={index} color="blue" classNameOverride="mr-24 last:mr-0 w-full">
49
52
  {/* Adds height and width of 100% */}
50
53
  <div className="w-full h-100" />
51
54
  </Card>
@@ -70,7 +70,7 @@ export const TailwindStoryTemplate = ({
70
70
  <div className="fixed top-[10px] left-[10px]">
71
71
  {copiedText && (
72
72
  <InlineNotification
73
- type="positive"
73
+ variant="success"
74
74
  hideCloseIcon
75
75
  onHide={(): void => setCopiedText(null)}
76
76
  headingProps={{
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Button } from '~components/Button'
2
+ import { Button } from '~components/ButtonV1'
3
3
  import { Heading } from '~components/Heading'
4
4
 
5
5
  type CardContentProps = {
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { Icon } from '~components/__next__'
2
+ import { Icon } from '~components/Icon'
3
3
 
4
4
  type Props = {
5
5
  text: string
package/src/kz-spacing.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { heartTheme } from '@kaizen/design-tokens'
1
+ import { tokens } from '@kaizen/design-tokens/js'
2
2
 
3
3
  const tokenDenyList: string[] = [
4
4
  'xs',
@@ -35,4 +35,4 @@ export const filterDenyListValues = (
35
35
  return Object.fromEntries(keyValuePairs.filter(([key]) => isValidToken(key)))
36
36
  }
37
37
 
38
- export const kzSpacing = filterDenyListValues(heartTheme.spacing)
38
+ export const kzSpacing = filterDenyListValues(tokens.spacing)