@kaizen/components 0.0.0-canary-button-codemod-canary-20250212054517 → 0.0.0-canary-stacking-context-fix-20250225001220
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/bin/codemod.sh +0 -2
- package/codemods/README.md +0 -45
- package/codemods/utils/createProp.spec.ts +19 -75
- package/codemods/utils/createProp.ts +1 -8
- package/codemods/utils/getKaioTagName.ts +5 -13
- package/codemods/utils/index.ts +0 -1
- package/dist/cjs/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.cjs +1 -0
- package/dist/cjs/Filter/FilterMultiSelect/subcomponents/Trigger/FilterTriggerButton/FilterTriggerButton.cjs +1 -0
- package/dist/cjs/Filter/FilterMultiSelect/subcomponents/Trigger/RemovableFilterTrigger/RemovableFilterTrigger.cjs +1 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/esm/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.mjs +1 -0
- package/dist/esm/Filter/FilterMultiSelect/subcomponents/Trigger/FilterTriggerButton/FilterTriggerButton.mjs +1 -0
- package/dist/esm/Filter/FilterMultiSelect/subcomponents/Trigger/RemovableFilterTrigger/RemovableFilterTrigger.mjs +1 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/styles.css +8647 -8640
- package/dist/types/Filter/FilterBar/subcomponents/FilterBarButton/FilterBarButton.d.ts +1 -1
- package/dist/types/Filter/FilterButton/index.d.ts +1 -0
- package/dist/types/Filter/FilterMultiSelect/types.d.ts +2 -1
- package/dist/types/RichTextEditor/utils/commands/fixtures/helpers.d.ts +0 -1
- package/dist/types/RichTextEditor/utils/commands/fixtures/index.d.ts +2 -0
- package/dist/types/RichTextEditor/utils/commands/fixtures/mockRangeForBoundingRect.d.ts +1 -0
- package/dist/types/__rc__/Icon/constants.d.ts +1 -1
- package/package.json +6 -1
- package/src/Filter/FilterButton/index.ts +1 -0
- package/src/Filter/FilterMultiSelect/types.ts +3 -1
- package/src/RichTextEditor/utils/commands/addMark.spec.ts +1 -5
- package/src/RichTextEditor/utils/commands/fixtures/helpers.ts +0 -31
- package/src/RichTextEditor/utils/commands/fixtures/index.ts +2 -0
- package/src/RichTextEditor/utils/commands/fixtures/mockRangeForBoundingRect.ts +32 -0
- package/src/TitleBlockZen/TitleBlockZen.module.scss +1 -6
- package/src/__rc__/Button/_docs/Button--usage-guidelines.mdx +170 -1
- package/src/__rc__/Button/_docs/Button.docs.stories.tsx +264 -9
- package/src/__rc__/Button/_docs/assets/button_anatomy.png +0 -0
- package/src/__rc__/Button/_docs/assets/button_icon_only_spec.png +0 -0
- package/src/__rc__/Button/_docs/assets/button_icon_spec.png +0 -0
- package/src/__rc__/Button/_docs/assets/button_spec.png +0 -0
- package/src/__rc__/Icon/constants.ts +1 -0
- package/src/__rc__/Tabs/subcomponents/Tab/Tab.module.css +5 -2
- package/src/__rc__/Tabs/subcomponents/TabList/TabList.module.css +11 -4
- package/codemods/upgradeV1Buttons/index.ts +0 -19
- package/codemods/upgradeV1Buttons/transformV1ButtonAttributes.spec.ts +0 -202
- package/codemods/upgradeV1Buttons/transformV1ButtonAttributes.ts +0 -132
- package/codemods/upgradeV1Buttons/upgradeV1Buttons.spec.ts +0 -658
- package/codemods/upgradeV1Buttons/upgradeV1Buttons.ts +0 -93
- package/codemods/utils/createJsxElementWithChildren.spec.ts +0 -119
- package/codemods/utils/createJsxElementWithChildren.ts +0 -55
- package/src/__rc__/Button/_docs/Button--migration-guide.mdx +0 -58
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import ts from 'typescript'
|
|
2
|
-
import {
|
|
3
|
-
createJsxElementWithChildren,
|
|
4
|
-
getKaioTagName,
|
|
5
|
-
setImportToAdd,
|
|
6
|
-
setImportToRemove,
|
|
7
|
-
updateKaioImports,
|
|
8
|
-
type TagImportAttributesMap,
|
|
9
|
-
type UpdateKaioImportsArgs,
|
|
10
|
-
} from '../utils'
|
|
11
|
-
import { transformV1ButtonAttributes } from './transformV1ButtonAttributes'
|
|
12
|
-
|
|
13
|
-
const V1_BUTTONS = ['Button', 'IconButton']
|
|
14
|
-
const V1_BUTTONS_IMPORT_SOURCE = [
|
|
15
|
-
'@kaizen/components',
|
|
16
|
-
'@kaizen/components/v1/actions',
|
|
17
|
-
'@kaizen/components/v2/actions',
|
|
18
|
-
]
|
|
19
|
-
const BUTTON_IMPORT_DESTINATION = '@kaizen/components/v3/actions'
|
|
20
|
-
const LINKBUTTON_IMPORT_DESTINATION = '@kaizen/components'
|
|
21
|
-
|
|
22
|
-
export const upgradeV1Buttons =
|
|
23
|
-
(tagsMap: TagImportAttributesMap): ts.TransformerFactory<ts.SourceFile> =>
|
|
24
|
-
(context) =>
|
|
25
|
-
(rootNode) => {
|
|
26
|
-
const importsToRemove: UpdateKaioImportsArgs['importsToRemove'] = new Map()
|
|
27
|
-
const importsToAdd: UpdateKaioImportsArgs['importsToAdd'] = new Map()
|
|
28
|
-
|
|
29
|
-
const importedTargetButtonTagName = getKaioTagName(
|
|
30
|
-
rootNode,
|
|
31
|
-
'Button',
|
|
32
|
-
BUTTON_IMPORT_DESTINATION,
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
const importedTargetLinkButtonTagName = getKaioTagName(
|
|
36
|
-
rootNode,
|
|
37
|
-
'LinkButton',
|
|
38
|
-
LINKBUTTON_IMPORT_DESTINATION,
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
const visit = (node: ts.Node): ts.Node => {
|
|
42
|
-
if (ts.isJsxSelfClosingElement(node)) {
|
|
43
|
-
const tagName = node.tagName.getText()
|
|
44
|
-
const tagImportAttributes = tagsMap.get(tagName)
|
|
45
|
-
|
|
46
|
-
if (!tagImportAttributes) return node
|
|
47
|
-
|
|
48
|
-
if (!V1_BUTTONS.includes(tagImportAttributes.originalName)) return node
|
|
49
|
-
if (!V1_BUTTONS_IMPORT_SOURCE.includes(tagImportAttributes.importModuleName)) return node
|
|
50
|
-
|
|
51
|
-
const { targetComponentName, newAttributes, childrenValue } = transformV1ButtonAttributes(
|
|
52
|
-
node,
|
|
53
|
-
tagImportAttributes.originalName,
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
const targetTagName =
|
|
57
|
-
targetComponentName === 'Button'
|
|
58
|
-
? (importedTargetButtonTagName ?? 'Button')
|
|
59
|
-
: (importedTargetLinkButtonTagName ?? 'LinkButton')
|
|
60
|
-
|
|
61
|
-
setImportToRemove(
|
|
62
|
-
importsToRemove,
|
|
63
|
-
tagImportAttributes.importModuleName,
|
|
64
|
-
tagImportAttributes.originalName,
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
if (targetComponentName === 'Button' && !importedTargetButtonTagName) {
|
|
68
|
-
setImportToAdd(importsToAdd, BUTTON_IMPORT_DESTINATION, {
|
|
69
|
-
componentName: 'Button',
|
|
70
|
-
alias:
|
|
71
|
-
importedTargetButtonTagName !== 'Button' ? importedTargetButtonTagName : undefined,
|
|
72
|
-
})
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (targetComponentName === 'LinkButton' && !importedTargetLinkButtonTagName) {
|
|
76
|
-
setImportToAdd(importsToAdd, LINKBUTTON_IMPORT_DESTINATION, {
|
|
77
|
-
componentName: 'LinkButton',
|
|
78
|
-
alias:
|
|
79
|
-
importedTargetLinkButtonTagName !== 'LinkButton'
|
|
80
|
-
? importedTargetLinkButtonTagName
|
|
81
|
-
: undefined,
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return createJsxElementWithChildren(targetTagName, newAttributes, childrenValue)
|
|
86
|
-
}
|
|
87
|
-
return ts.visitEachChild(node, visit, context)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const node = ts.visitNode(rootNode, visit)
|
|
91
|
-
|
|
92
|
-
return updateKaioImports({ importsToRemove, importsToAdd })(context)(node as ts.SourceFile)
|
|
93
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import ts from 'typescript'
|
|
2
|
-
import { parseJsx } from '../__tests__/utils'
|
|
3
|
-
import { createJsxElementWithChildren } from './createJsxElementWithChildren'
|
|
4
|
-
import { printAst } from './printAst'
|
|
5
|
-
import { transformSource, type TransformSourceArgs } from './transformSource'
|
|
6
|
-
|
|
7
|
-
export const mockedTransformer: ts.TransformerFactory<ts.SourceFile> = (context) => (rootNode) => {
|
|
8
|
-
const visit = (node: ts.Node): ts.Node => {
|
|
9
|
-
let childrenValue: ts.JsxAttributeValue | undefined
|
|
10
|
-
|
|
11
|
-
if (ts.isJsxSelfClosingElement(node)) {
|
|
12
|
-
const tagName = node.tagName.getText()
|
|
13
|
-
const attributes = node.attributes.properties.reduce<ts.JsxAttributeLike[]>((acc, attr) => {
|
|
14
|
-
if (ts.isJsxAttribute(attr) && attr.name.getText() === 'toChildren') {
|
|
15
|
-
childrenValue = attr.initializer
|
|
16
|
-
return acc
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
acc.push(attr)
|
|
20
|
-
return acc
|
|
21
|
-
}, [])
|
|
22
|
-
|
|
23
|
-
return createJsxElementWithChildren(tagName, attributes, childrenValue)
|
|
24
|
-
}
|
|
25
|
-
return ts.visitEachChild(node, visit, context)
|
|
26
|
-
}
|
|
27
|
-
return ts.visitNode(rootNode, visit) as ts.SourceFile
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const testCreateJsxElementWithChildren = (sourceFile: TransformSourceArgs['sourceFile']): string =>
|
|
31
|
-
transformSource({ sourceFile, transformers: [mockedTransformer] })
|
|
32
|
-
|
|
33
|
-
describe('createJsxElementWithChildren()', () => {
|
|
34
|
-
it('transforms a string value', () => {
|
|
35
|
-
const inputAst = parseJsx('<Button toChildren="Hello" variant="primary" />')
|
|
36
|
-
const outputAst = parseJsx('<Button variant="primary">Hello</Button>')
|
|
37
|
-
expect(testCreateJsxElementWithChildren(inputAst)).toEqual(printAst(outputAst))
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
it('transforms a string in brackets', () => {
|
|
41
|
-
const inputAst = parseJsx(`
|
|
42
|
-
<>
|
|
43
|
-
<Button toChildren={"Double quotes"} variant="primary" />
|
|
44
|
-
<Button toChildren={'Single quotes'} variant="primary" />
|
|
45
|
-
</>
|
|
46
|
-
`)
|
|
47
|
-
const outputAst = parseJsx(`
|
|
48
|
-
<>
|
|
49
|
-
<Button variant="primary">Double quotes</Button>
|
|
50
|
-
<Button variant="primary">Single quotes</Button>
|
|
51
|
-
</>
|
|
52
|
-
`)
|
|
53
|
-
// const outputAst = parseJsx('<Button variant="primary">Hello</Button>')
|
|
54
|
-
expect(testCreateJsxElementWithChildren(inputAst)).toEqual(printAst(outputAst))
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
it('transforms a string with comments in brackets', () => {
|
|
58
|
-
const inputAst = parseJsx(`<Button
|
|
59
|
-
toChildren={
|
|
60
|
-
"Hello" // comment
|
|
61
|
-
}
|
|
62
|
-
variant="primary" />
|
|
63
|
-
`)
|
|
64
|
-
const outputAst = parseJsx(`<Button variant="primary">{
|
|
65
|
-
"Hello" // comment
|
|
66
|
-
}</Button>`)
|
|
67
|
-
expect(testCreateJsxElementWithChildren(inputAst)).toEqual(printAst(outputAst))
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
it('transforms a template literal with variables', () => {
|
|
71
|
-
/* eslint-disable no-template-curly-in-string */
|
|
72
|
-
const inputAst = parseJsx('<Button toChildren={`Hello ${name}`} variant="primary" />')
|
|
73
|
-
const outputAst = parseJsx('<Button variant="primary">{`Hello ${name}`}</Button>')
|
|
74
|
-
/* eslint-enable no-template-curly-in-string */
|
|
75
|
-
expect(testCreateJsxElementWithChildren(inputAst)).toEqual(printAst(outputAst))
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
it('transforms a variable', () => {
|
|
79
|
-
const inputAst = parseJsx('<Button toChildren={childrenVar} variant="primary" />')
|
|
80
|
-
const outputAst = parseJsx('<Button variant="primary">{childrenVar}</Button>')
|
|
81
|
-
expect(testCreateJsxElementWithChildren(inputAst)).toEqual(printAst(outputAst))
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
it('transforms a ternary', () => {
|
|
85
|
-
const inputAst = parseJsx(
|
|
86
|
-
'<Button toChildren={isPancake ? "Pancake" : "Waffle"} variant="primary" />',
|
|
87
|
-
)
|
|
88
|
-
const outputAst = parseJsx(
|
|
89
|
-
'<Button variant="primary">{isPancake ? "Pancake" : "Waffle"}</Button>',
|
|
90
|
-
)
|
|
91
|
-
expect(testCreateJsxElementWithChildren(inputAst)).toEqual(printAst(outputAst))
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
it('transforms a JSX element', () => {
|
|
95
|
-
const inputAst = parseJsx('<Button toChildren={<span>Hello</span>} variant="primary" />')
|
|
96
|
-
const outputAst = parseJsx('<Button variant="primary"><span>Hello</span></Button>')
|
|
97
|
-
expect(testCreateJsxElementWithChildren(inputAst)).toEqual(printAst(outputAst))
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
it('transforms a JSX self-closing element', () => {
|
|
101
|
-
const inputAst = parseJsx('<Button toChildren={<Icon />} variant="primary" />')
|
|
102
|
-
const outputAst = parseJsx('<Button variant="primary"><Icon /></Button>')
|
|
103
|
-
expect(testCreateJsxElementWithChildren(inputAst)).toEqual(printAst(outputAst))
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
it('transforms a JSX fragment', () => {
|
|
107
|
-
const inputAst = parseJsx('<Button toChildren={<>Hello</>} variant="primary" />')
|
|
108
|
-
const outputAst = parseJsx('<Button variant="primary"><>Hello</></Button>')
|
|
109
|
-
expect(testCreateJsxElementWithChildren(inputAst)).toEqual(printAst(outputAst))
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
it('adds a comment if no value for children has been passed in', () => {
|
|
113
|
-
const inputAst = parseJsx('<Button variant="primary" />')
|
|
114
|
-
const outputAst = parseJsx(`<Button variant="primary">
|
|
115
|
-
/* @todo Children required but a value was not found during the codemod */
|
|
116
|
-
</Button>`)
|
|
117
|
-
expect(testCreateJsxElementWithChildren(inputAst)).toEqual(printAst(outputAst))
|
|
118
|
-
})
|
|
119
|
-
})
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import ts from 'typescript'
|
|
2
|
-
|
|
3
|
-
const createJsxChildren = (childrenValue: ts.JsxAttributeValue): ts.JsxChild => {
|
|
4
|
-
if (ts.isStringLiteral(childrenValue)) {
|
|
5
|
-
return ts.factory.createJsxText(childrenValue.text)
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if (ts.isJsxExpression(childrenValue)) {
|
|
9
|
-
const value = childrenValue.expression
|
|
10
|
-
|
|
11
|
-
if (value) {
|
|
12
|
-
if (ts.isStringLiteral(value)) {
|
|
13
|
-
// Tests for {"string"}, {'string'}
|
|
14
|
-
const regexExpContainsOnlyQuotedString = new RegExp(/^\{(["']).*(\1)\}$/g)
|
|
15
|
-
|
|
16
|
-
if (regexExpContainsOnlyQuotedString.test(childrenValue.getFullText())) {
|
|
17
|
-
return ts.factory.createJsxText(value.text)
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (ts.isJsxElement(value) || ts.isJsxSelfClosingElement(value) || ts.isJsxFragment(value)) {
|
|
22
|
-
return value
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return childrenValue
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return childrenValue
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Use this to replace a self-closing JSX element to a JSX element with children
|
|
34
|
-
*/
|
|
35
|
-
export const createJsxElementWithChildren = (
|
|
36
|
-
tagName: string,
|
|
37
|
-
attributes: ts.JsxAttributeLike[],
|
|
38
|
-
childrenValue: ts.JsxAttributeValue | undefined,
|
|
39
|
-
): ts.JsxElement => {
|
|
40
|
-
const tagNameId = ts.factory.createIdentifier(tagName)
|
|
41
|
-
const fallbackChildren = [
|
|
42
|
-
ts.factory.createJsxText('\n'),
|
|
43
|
-
ts.factory.createJsxText(
|
|
44
|
-
'/* @todo Children required but a value was not found during the codemod */',
|
|
45
|
-
),
|
|
46
|
-
ts.factory.createJsxText('\n'),
|
|
47
|
-
]
|
|
48
|
-
const children = childrenValue ? [createJsxChildren(childrenValue)] : fallbackChildren
|
|
49
|
-
|
|
50
|
-
return ts.factory.createJsxElement(
|
|
51
|
-
ts.factory.createJsxOpeningElement(tagNameId, [], ts.factory.createJsxAttributes(attributes)),
|
|
52
|
-
children,
|
|
53
|
-
ts.factory.createJsxClosingElement(tagNameId),
|
|
54
|
-
)
|
|
55
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Canvas, Meta, Controls, Story } from '@storybook/blocks'
|
|
2
|
-
import { ResourceLinks, KAIOInstallation } from '~storybook/components'
|
|
3
|
-
|
|
4
|
-
<Meta title="Components/Button/Button (v3)/Migration Guide" />
|
|
5
|
-
|
|
6
|
-
# Button Migration Guide
|
|
7
|
-
|
|
8
|
-
This is a short guide to assist in migration from the old to new `Button` and `LinkButton` component.
|
|
9
|
-
|
|
10
|
-
## Key API differences
|
|
11
|
-
|
|
12
|
-
Below is a list of notable changes when migrating to the new `Button` and `LinkButton` component:
|
|
13
|
-
|
|
14
|
-
- `label` is now handled as `Children` and does not have a specific prop.
|
|
15
|
-
- Variants, such as `primary` and `secondary`, are now controlled as by the single `variant` prop.
|
|
16
|
-
- `onClick` and other event handlers now reflect the RAC event ecosystems, ie: `onPress`.
|
|
17
|
-
- You can see more about the RAC event ecosystem [here](https://react-spectrum.adobe.com/react-aria/Button.html#events).
|
|
18
|
-
- `Button` and `LinkButton` now exist as separate components.
|
|
19
|
-
- The intent is to more closely align to the semantic roles of an anchor or button and should be used accordingly.
|
|
20
|
-
- `LinkButton` handles native navigation via `href` out of the box but additional config can be used to allow for client side routing - [see here](/docs/components-linkbutton-api-specification--docs#client-side-routing).
|
|
21
|
-
- `onPress` can still be used in place of `onClick` for pushing to routers.
|
|
22
|
-
- `IconButton` has been superseded by icon props and the [icon-only pattern](/docs/components-button-button-v3-api-specification--docs#icon-only-button-and-hashiddenlabel).
|
|
23
|
-
- `working` props has been updated to `pending` to better reflect the state of the button.
|
|
24
|
-
- `badge` prop has been removed and should be handled within the `Children` where required.
|
|
25
|
-
- `size` props have been adjusted to include `small`, `medium` and `large`.
|
|
26
|
-
- Styles have been consolidate to align with modern designs and variants like `destructive` have been removed.
|
|
27
|
-
- The codemod will remap these to the relative variants.
|
|
28
|
-
- Reversed styles should be handled by the `ReversedColors` Provider but for ease of migration can use the `isReversed` prop.
|
|
29
|
-
|
|
30
|
-
## Codemod
|
|
31
|
-
|
|
32
|
-
To assist in migration we have created the `upgradeV1Buttons` codemod.
|
|
33
|
-
|
|
34
|
-
This will loop through the given directory and update all instances of Button to the latest implementation. You can refer to this [README](https://github.com/cultureamp/kaizen-design-system/blob/main/packages/components/codemods/README.md#kaizen-codemods) on how to run kaizen codemods using the CLI within your repository, ie:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
pnpm kaizen-codemod src upgradeV1Buttons
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Pre-requisites
|
|
41
|
-
|
|
42
|
-
It is also recommended that the `upgradeIconV1` codemod is run before `upgradeV1Buttons` to ensure that all icons are updated to the new `Icon` component that uses the Material icons CDN. Seem more about this [here](/docs/components-icon-icon-future-api-specification--docs#set-up).
|
|
43
|
-
|
|
44
|
-
### Potential gotchas
|
|
45
|
-
|
|
46
|
-
If you're facing any issues not captured below, reach out to the [#help_design_system](https://cultureamp.slack.com/archives/C0189KBPM4Y) channel on Slack.
|
|
47
|
-
|
|
48
|
-
### `icon` props and sizing
|
|
49
|
-
|
|
50
|
-
While the `icon` prop supports any `JSX` element, only the latest [Icon component](/docs/components-icon-icon-future-api-specification--docs) will be able to handle relative sizing and spacing automatically within the Button. We recommend running the `upgradeIconV1` codemod before this to convert all icons to the latest implementation. See the guidance here on using the [Material Icons CDN](/docs/guides-app-starter--docs#5-link-to-google-material-symbols-cdn).
|
|
51
|
-
|
|
52
|
-
### `component` render props and intentional type errors
|
|
53
|
-
|
|
54
|
-
Based off Metabase queries, `component` render props is used in consuming repositories to wrap Button content with a routing solution, such as NextJS's `Link` component. To ensure a safe migration, the codemod will update any usages to a `LinkButton` with the `component` prop still passed in. This will cause an intentional type error to provide feedback and make it easier to find in the codebase for a manual update. This should be able to be converted to use client side routing by following the [LinkButton API docs](https://cultureamp.design/?path=/docs/components-linkbutton-api-specification--docs).
|
|
55
|
-
|
|
56
|
-
## More information
|
|
57
|
-
|
|
58
|
-
For more information on the about each of the new API's, we recommend referring the [Button](/docs/components-button-button-v3-api-specification--docs) or [LinkButton](/docs/components-linkbutton-api-specification--docs) API specifications.
|