@bitrise/bitkit-v2 0.3.327 → 0.3.328
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/docs/v1-to-v2-migration-guide.md +24 -17
- package/package.json +1 -1
|
@@ -105,12 +105,14 @@ Chakra v2 → v3 prop changes on primitives:
|
|
|
105
105
|
|
|
106
106
|
| v1 | v2 |
|
|
107
107
|
|----|----|
|
|
108
|
-
| `Badge colorScheme="positive"` | `BitkitBadge
|
|
109
|
-
| `Badge colorScheme="negative"` | `BitkitBadge
|
|
110
|
-
| `Badge colorScheme="warning"` | `BitkitBadge
|
|
111
|
-
| `Badge colorScheme="progress"` | `BitkitBadge
|
|
108
|
+
| `Badge colorScheme="positive"` | `BitkitBadge colorVariant="green"` |
|
|
109
|
+
| `Badge colorScheme="negative"` | `BitkitBadge colorVariant="red"` |
|
|
110
|
+
| `Badge colorScheme="warning"` | `BitkitBadge colorVariant="yellow"` |
|
|
111
|
+
| `Badge colorScheme="progress"` | `BitkitBadge colorVariant="purple"` |
|
|
112
112
|
| `Tag` | `BitkitTag` |
|
|
113
113
|
|
|
114
|
+
The color prop is `colorVariant`, not Chakra's `colorPalette` — `BitkitBadge` deliberately omits `colorPalette` from its props. Available values: `neutral`, `purple`, `blue`, `green`, `yellow`, `red`, `orange`, `turquoise`, `ai-gradient`.
|
|
115
|
+
|
|
114
116
|
### Toast
|
|
115
117
|
|
|
116
118
|
```tsx
|
|
@@ -134,16 +136,20 @@ createBitkitToast({ variant: 'critical', titleText: 'Oops', messageText: 'Someth
|
|
|
134
136
|
</Dialog>
|
|
135
137
|
|
|
136
138
|
// v2
|
|
137
|
-
<BitkitDialog
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
</
|
|
139
|
+
<BitkitDialog
|
|
140
|
+
open={open}
|
|
141
|
+
onOpenChange={({ open }) => setOpen(open)}
|
|
142
|
+
title="Title"
|
|
143
|
+
footerButtons={<BitkitButton onClick={save}>Save</BitkitButton>}
|
|
144
|
+
>
|
|
145
|
+
...body...
|
|
142
146
|
</BitkitDialog>
|
|
143
147
|
```
|
|
144
148
|
|
|
145
149
|
Key changes: `isOpen` → `open`, `onClose` → `onOpenChange` (receives `{ open: boolean }`).
|
|
146
150
|
|
|
151
|
+
`BitkitDialog` is a flat component, not a compound one: the body is `children`, the header comes from the required `title`, and the footer is filled via `footerButtons` (the right-aligned button row) and/or `footerContent`. Its only sub-component is `BitkitDialog.ActionTrigger`.
|
|
152
|
+
|
|
147
153
|
Other prop mappings:
|
|
148
154
|
|
|
149
155
|
| v1 | v2 |
|
|
@@ -151,9 +157,7 @@ Other prop mappings:
|
|
|
151
157
|
| `isClosable={false}` | `closable={false}` |
|
|
152
158
|
| `onCloseComplete={fn}` | `onExitComplete={fn}` (fires when the close animation finishes) |
|
|
153
159
|
|
|
154
|
-
`closable={false}` matches v1: the header close button is **rendered but disabled** (kept in place so the header layout stays consistent)
|
|
155
|
-
|
|
156
|
-
If you're composing the lower-level primitives directly, you have to set the same controls explicitly: pass `closeOnEscape={false}` to `BitkitDialogRoot` and `closable={false}` to `BitkitDialogContent`.
|
|
160
|
+
`closable={false}` matches v1: the header close button is **rendered but disabled** (kept in place so the header layout stays consistent) and **ESC is blocked**. Overlay/outside clicks are ignored regardless of `closable` — the dialog always sets `closeOnInteractOutside={false}` internally. With `closable={false}` the only way to dismiss the dialog is through an explicit footer action.
|
|
157
161
|
|
|
158
162
|
```tsx
|
|
159
163
|
// Acknowledge-only dialog
|
|
@@ -226,12 +230,15 @@ For password fields with an eye-toggle: use `BitkitField` + Chakra v3 `InputGrou
|
|
|
226
230
|
|
|
227
231
|
| v1 | v2 |
|
|
228
232
|
|----|----|
|
|
229
|
-
| `Card` | `
|
|
233
|
+
| `Card` | `Card.Root` from `@chakra-ui/react/card` |
|
|
234
|
+
| `CardProps` | `CardRootProps` from `@chakra-ui/react/card` |
|
|
230
235
|
| `ExpandableCard` | `BitkitExpandableCard` |
|
|
231
236
|
|
|
232
|
-
|
|
237
|
+
There is no plain `BitkitCard` — it was removed in `0.3.239` ([#223](https://github.com/bitrise-io/bitkit-v2/pull/223)), since a closed component earned nothing over the Chakra primitive. A plain card is Chakra's compound `Card.Root` / `Card.Body`.
|
|
238
|
+
|
|
239
|
+
Common `BitkitExpandableCard` props: `title`, `subtitle`, `size`; use `defaultExpanded` for uncontrolled or `expanded`/`onChange` for controlled usage. It also supports `icon`, `suffix`, and other options — see the component API for the full list.
|
|
233
240
|
|
|
234
|
-
If your codebase has a local `card.tsx` wrapper around v1 Card (e.g. Shadcn-style `CardHeader`, `CardContent` etc.), remove the wrapper entirely and
|
|
241
|
+
If your codebase has a local `card.tsx` wrapper around v1 Card (e.g. Shadcn-style `CardHeader`, `CardContent` etc.), remove the wrapper entirely and use `Card.Root` directly — keeping the wrapper layer just adds indirection you'll need to unwind later.
|
|
235
242
|
|
|
236
243
|
### Notifications / Alert
|
|
237
244
|
|
|
@@ -281,9 +288,9 @@ Use `text/*` tokens on `<Text>` (and other text elements), and `icon/*` tokens o
|
|
|
281
288
|
|---|---|---|
|
|
282
289
|
| `text/secondary` | `icon/secondary` | ✓ |
|
|
283
290
|
| `text/tertiary` | `icon/tertiary` | ✓ |
|
|
284
|
-
| `text/link` | `icon/interactive` | ✓ (both → `
|
|
291
|
+
| `text/link` | `icon/interactive` | ✓ (both → `color/purple/base`) |
|
|
285
292
|
|
|
286
|
-
**Gotcha**: `icon/link` does **not** exist. Use `icon/interactive` instead — it resolves to the same `
|
|
293
|
+
**Gotcha**: `icon/link` does **not** exist. Use `icon/interactive` instead — it resolves to the same `color/purple/base` as `text/link`.
|
|
287
294
|
|
|
288
295
|
---
|
|
289
296
|
|