Skip to content

Commit

Permalink
feat(badge): add possibility to add component from react-intl on chil…
Browse files Browse the repository at this point in the history
…dren (#2602)
  • Loading branch information
theo-mesnil authored Nov 7, 2024
1 parent fbbfedd commit 1451b4c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/Badge/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CreateWuiProps, forwardRef } from '@welcome-ui/system'
import * as S from './styles'

export type BadgeOptions = {
children: string | number
children: React.ReactElement | string | number
disabled?: boolean
size?: 'sm' | 'md'
variant?: 'default' | 'primary'
Expand Down
3 changes: 2 additions & 1 deletion scripts/upgrade-v6.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ const removePrefix = content => {
}

const replaceErrorVariant = content => {
const regex = /<(Tag|Label|Hint|Alert|Table.Tr)\b([^>]*?)\bvariant\s*=\s*["']error["']/g
const regex =
/<(Tag|Label|Hint|Alert|Table.Tr|Toast.Growl|Toast.Snackbar)\b([^>]*?)\bvariant\s*=\s*["']error["']/g

if (regex.test(content)) {
const newContent = content.replaceAll(regex, '<$1$2variant="danger"')
Expand Down
2 changes: 1 addition & 1 deletion website/build-app/pages/foundations/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $1"6.0.0"
We reworked our theme's colors and variants name. Use the migration script to migrate easily to V6 on a welcome-ui project.
```bash
yarn migrate "../yourProject/src/**/**.**(tsx|ts|js)"
yarn migrate "../yourProject/src/**/**.{tsx,ts,js,mdx}"
```
### 3. Remove `welcomeTheme` & `welcomeDarkTheme`
Expand Down

0 comments on commit 1451b4c

Please sign in to comment.