Skip to content

Commit

Permalink
refactor: rename inverted codemod to be more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
Martí Malek committed Oct 31, 2023
1 parent 91335e5 commit 5f47bc9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions docs/migrating.storybook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ npx jscodeshift -t node_modules/@freenow/wave/lib/cjs/codemods/deprecated-icons.
### Inverted property deprecation

With the introduction of our new dark theme in Wave we've removed the `inverted` property that several components had. In case you want a specific component to have
the styling of the opposite theme you need to wrap it with the `FlipTheme` component.
the styling of the opposite theme you need to wrap it with the `InvertedColorScheme` component.

The components that supported the `inverted` prop are: `Input`, `Password`, `Textarea`, `Button`, `Select`, `SelectList`, `PhoneInput`, `Datepicker`, `Tooltip` and `Text`.
The components that supported the `inverted` prop are: `Input`, `Password`, `Textarea`, `Button`, `Select`, `SelectList`, `PhoneInput`, `Datepicker`, `Tooltip`, `Text` and `Breadcrumbs`.

```bash
npx jscodeshift -t node_modules/@freenow/wave/lib/cjs/codemods/inverted-to-flip-theme.js path/to/src
npx jscodeshift -t node_modules/@freenow/wave/lib/cjs/codemods/inverted-to-wrapper.js path/to/src
```

Disclaimer: This codemod wraps every Wave component that is using the `inverted` property with `FlipTheme`, this could lead to a decline in performance in case the
Disclaimer: This codemod wraps every Wave component that is using the `inverted` property with `InvertedColorScheme`, this could lead to a decline in performance in case the
DOM gets too deep. Ideally when you have Wave components using the `inverted` prop with a common parent you wrap the parent instead of each individual component.

### Text weak property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const { defineTest } = require('jscodeshift/dist/testUtils');

const tests = ['local-rename', 'explicit-boolean-false', 'explicit-boolean-true', 'styled-rename'];

describe('inverted-to-flip-theme', () => {
describe('inverted-to-wrapper', () => {
tests.forEach(test =>
defineTest(__dirname, 'inverted-to-flip-theme', { quote: 'single' }, `inverted-to-flip-theme/${test}`, {
defineTest(__dirname, 'inverted-to-wrapper', { quote: 'single' }, `inverted-to-wrapper/${test}`, {
parser: 'tsx'
})
);
Expand Down
File renamed without changes.

0 comments on commit 5f47bc9

Please sign in to comment.