@kaizen/components 1.70.7 → 1.70.9
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/codemods/upgradeIconV1/getNewIconPropsFromOldIconName.ts +1 -1
- package/dist/styles.css +4 -2
- package/package.json +3 -3
- package/src/Content/Content.module.scss +2 -2
- package/src/Tile/TileGrid/TileGrid.module.scss +2 -0
- package/src/__rc__/Icon/_docs/Icon--migration-guide.mdx +28 -0
- package/src/__rc__/Icon/_docs/Icon.docs.stories.tsx +38 -0
|
@@ -5,7 +5,7 @@ import { type StringSuggestions } from '~components/types/StringSuggestions'
|
|
|
5
5
|
// `undefined` means the icon has no usage, thus is not available in the new icon set
|
|
6
6
|
type NewIconProps = { name: IconNames; isFilled?: boolean } | undefined
|
|
7
7
|
|
|
8
|
-
const iconMap = new Map<keyof typeof OLD_ICONS, NewIconProps>([
|
|
8
|
+
export const iconMap = new Map<keyof typeof OLD_ICONS, NewIconProps>([
|
|
9
9
|
['AcademyIcon', { name: 'school' }],
|
|
10
10
|
['ActionOffIcon', undefined],
|
|
11
11
|
['ActionOffWhiteIcon', undefined],
|
package/dist/styles.css
CHANGED
|
@@ -2358,12 +2358,12 @@
|
|
|
2358
2358
|
/** THIS IS AN AUTOGENERATED FILE **/
|
|
2359
2359
|
.Content-module_content__ZeTRs {
|
|
2360
2360
|
max-width: 1392px;
|
|
2361
|
-
|
|
2361
|
+
padding: 0 72px;
|
|
2362
2362
|
width: 100%;
|
|
2363
2363
|
}
|
|
2364
2364
|
@media (max-width: calc(1080px - 1px)) {
|
|
2365
2365
|
.Content-module_content__ZeTRs {
|
|
2366
|
-
|
|
2366
|
+
padding: 0 12px;
|
|
2367
2367
|
}
|
|
2368
2368
|
}
|
|
2369
2369
|
/** THIS IS AN AUTOGENERATED FILE **/
|
|
@@ -10198,6 +10198,8 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
|
|
|
10198
10198
|
/** THIS IS AN AUTOGENERATED FILE **/
|
|
10199
10199
|
.TileGrid-module_grid__1WCNc {
|
|
10200
10200
|
list-style-type: none;
|
|
10201
|
+
padding-inline-start: 0;
|
|
10202
|
+
margin-block: 0;
|
|
10201
10203
|
display: grid;
|
|
10202
10204
|
grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
|
|
10203
10205
|
grid-gap: var(--spacing-md, 1.5rem);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "1.70.
|
|
3
|
+
"version": "1.70.9",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"svgo": "^3.3.2",
|
|
118
118
|
"tslib": "^2.8.1",
|
|
119
119
|
"tsx": "^4.19.2",
|
|
120
|
-
"@kaizen/
|
|
121
|
-
"@kaizen/
|
|
120
|
+
"@kaizen/design-tokens": "10.8.6",
|
|
121
|
+
"@kaizen/package-bundler": "2.0.3"
|
|
122
122
|
},
|
|
123
123
|
"devDependenciesComments": {
|
|
124
124
|
"sass": "Prevent deprecation warnings introduced in 1.80 as we plan to move away from sass",
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
.content {
|
|
5
5
|
max-width: $layout-content-max-width;
|
|
6
|
-
|
|
6
|
+
padding: 0 $layout-content-side-margin;
|
|
7
7
|
width: 100%;
|
|
8
8
|
|
|
9
9
|
@media (max-width: calc(#{$layout-breakpoints-large} - 1px)) {
|
|
10
|
-
|
|
10
|
+
padding: 0 $content-margin-width-on-medium-and-small;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Canvas, Meta, Controls, Story } from '@storybook/blocks'
|
|
2
|
+
import { ResourceLinks, KAIOInstallation, LinkTo } from '~storybook/components'
|
|
3
|
+
import * as IconStories from './Icon.docs.stories'
|
|
4
|
+
|
|
5
|
+
<Meta title="Components/Icon/Icon (Future)/Migration Guide" />
|
|
6
|
+
|
|
7
|
+
# Icon Migration Guide
|
|
8
|
+
|
|
9
|
+
This is a short guide to assist in migration from the old to new Icon component.
|
|
10
|
+
|
|
11
|
+
## Codemod
|
|
12
|
+
|
|
13
|
+
To assist in migration we have created the `upgradeiconv1` codemod. This will loop through the given directory and update all instances of Icon to the latest implementation. You can refer to this [README](https://github.com/cultureamp/kaizen-design-system/blob/main/packages/components/codemods/README.md#upgradeiconv1) on how to run this within your repository.
|
|
14
|
+
|
|
15
|
+
For more information on the changes to the API, we recommend referring the <LinkTo pageId="components-icon-icon-future-api-specification--docs">API Specification</LinkTo>.
|
|
16
|
+
|
|
17
|
+
## Changes to Icon exportNames
|
|
18
|
+
|
|
19
|
+
The following table outlines the changes to the Icons names and whether the new `isFilled` prop is required. This can be used if you are manually migrating components.
|
|
20
|
+
|
|
21
|
+
Where `N/A` is shown, this indicates that an equivalent icon does not exist or has been made redundant by the new API, ie:
|
|
22
|
+
|
|
23
|
+
- `ActionOffIcon` is not needed as the new `ActionOnIcon` (`flash_on`) can be used with the `isFilled` to handle the toggled states.
|
|
24
|
+
- `ActionOffIconActionOffWhiteIcon` is not needed as the API allows for color to be set via `className` or inherited via it's parent element.
|
|
25
|
+
|
|
26
|
+
You will need to discuss alternative with your design team or reach out in the #help_design_system channel if an equivalent icon does not exist.
|
|
27
|
+
|
|
28
|
+
<Story of={IconStories.IconTableComparison} />
|
|
@@ -15,6 +15,7 @@ import { ToggleSwitchField } from '~components/ToggleSwitch'
|
|
|
15
15
|
import { Button } from '~components/__rc__/Button'
|
|
16
16
|
import { Tag } from '~components/__rc__/Tag'
|
|
17
17
|
import { StickerSheet } from '~storybook/components/StickerSheet'
|
|
18
|
+
import { iconMap } from '../../../../codemods/upgradeIconV1/getNewIconPropsFromOldIconName'
|
|
18
19
|
import { iconDefaultSet } from '../constants'
|
|
19
20
|
import { Icon } from '../index'
|
|
20
21
|
import imgInterfaceDont from './assets/interface-dont.png'
|
|
@@ -476,3 +477,40 @@ export const TooltipDont: Story = {
|
|
|
476
477
|
/>
|
|
477
478
|
),
|
|
478
479
|
}
|
|
480
|
+
|
|
481
|
+
export const IconTableComparison: Story = {
|
|
482
|
+
render: () => {
|
|
483
|
+
return (
|
|
484
|
+
<TableContainer>
|
|
485
|
+
<TableHeader>
|
|
486
|
+
<TableRow>
|
|
487
|
+
<TableHeaderRowCell width={4 / 12} labelText="Old name" />
|
|
488
|
+
<TableHeaderRowCell width={4 / 12} labelText="New name" />
|
|
489
|
+
<TableHeaderRowCell width={4 / 12} labelText="isFilled" />
|
|
490
|
+
</TableRow>
|
|
491
|
+
</TableHeader>
|
|
492
|
+
{Array.from(iconMap).map(([key, value]) => (
|
|
493
|
+
<TableCard key={key}>
|
|
494
|
+
<TableRow>
|
|
495
|
+
<TableRowCell width={4 / 12}>
|
|
496
|
+
<Text tag="div" variant="body">
|
|
497
|
+
{key}
|
|
498
|
+
</Text>
|
|
499
|
+
</TableRowCell>
|
|
500
|
+
<TableRowCell width={4 / 12}>
|
|
501
|
+
<Text tag="div" variant="body">
|
|
502
|
+
{value?.name ?? 'N/A'}
|
|
503
|
+
</Text>
|
|
504
|
+
</TableRowCell>
|
|
505
|
+
<TableRowCell width={4 / 12}>
|
|
506
|
+
<Text tag="div" variant="body">
|
|
507
|
+
{value?.isFilled ? 'true' : value?.name ? 'false' : 'N/A'}
|
|
508
|
+
</Text>
|
|
509
|
+
</TableRowCell>
|
|
510
|
+
</TableRow>
|
|
511
|
+
</TableCard>
|
|
512
|
+
))}
|
|
513
|
+
</TableContainer>
|
|
514
|
+
)
|
|
515
|
+
},
|
|
516
|
+
}
|