@aircall/ds 0.49.0 → 0.50.2
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/dist/{data-table-B3ahtFLP.js → data-table-AX0Mgu6K.js} +5 -0
- package/dist/{data-table-BgeS8KWP.d.ts → data-table-B5VqWPmw.d.ts} +3 -4
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +1 -1
- package/dist/globals.css +1 -1
- package/dist/index.d.ts +53 -16
- package/dist/index.js +113 -20
- package/package.json +2 -2
- package/skills/aircall-ds/migrate-audio-player/SKILL.md +14 -3
- package/skills/aircall-ds/migrate-icons/SKILL.md +45 -16
- package/skills/aircall-ds/migrate-tractor/SKILL.md +34 -31
- package/skills/aircall-ds/migrate-tractor/accordion/SKILL.md +25 -15
- package/skills/aircall-ds/migrate-tractor/alert/SKILL.md +107 -20
- package/skills/aircall-ds/migrate-tractor/avatar/SKILL.md +57 -26
- package/skills/aircall-ds/migrate-tractor/badge/SKILL.md +71 -25
- package/skills/aircall-ds/migrate-tractor/button/SKILL.md +68 -32
- package/skills/aircall-ds/migrate-tractor/card/SKILL.md +62 -42
- package/skills/aircall-ds/migrate-tractor/combobox/SKILL.md +233 -149
- package/skills/aircall-ds/migrate-tractor/data-table/SKILL.md +102 -108
- package/skills/aircall-ds/migrate-tractor/data-table/references/column-widths-and-pinning.md +50 -0
- package/skills/aircall-ds/migrate-tractor/data-table/references/infinite-scroll.md +51 -0
- package/skills/aircall-ds/migrate-tractor/data-table/references/row-actions.md +34 -0
- package/skills/aircall-ds/migrate-tractor/date-picker/SKILL.md +100 -47
- package/skills/aircall-ds/migrate-tractor/dialog/SKILL.md +115 -20
- package/skills/aircall-ds/migrate-tractor/dropdown-menu/SKILL.md +135 -57
- package/skills/aircall-ds/migrate-tractor/dropzone/SKILL.md +2 -0
- package/skills/aircall-ds/migrate-tractor/form-and-field/SKILL.md +111 -49
- package/skills/aircall-ds/migrate-tractor/gauge/SKILL.md +6 -4
- package/skills/aircall-ds/migrate-tractor/input/SKILL.md +165 -59
- package/skills/aircall-ds/migrate-tractor/item/SKILL.md +85 -63
- package/skills/aircall-ds/migrate-tractor/link/SKILL.md +85 -68
- package/skills/aircall-ds/migrate-tractor/popover/SKILL.md +115 -74
- package/skills/aircall-ds/migrate-tractor/select/SKILL.md +117 -64
- package/skills/aircall-ds/migrate-tractor/sheet-vs-drawer/SKILL.md +55 -32
- package/skills/aircall-ds/migrate-tractor/skeleton/SKILL.md +40 -11
- package/skills/aircall-ds/migrate-tractor/styling/SKILL.md +11 -7
- package/skills/aircall-ds/migrate-tractor/tabs/SKILL.md +62 -55
- package/skills/aircall-ds/migrate-tractor/toast/SKILL.md +58 -12
- package/skills/aircall-ds/migrate-tractor/tooltip/SKILL.md +65 -40
- package/skills/aircall-ds/migrate-tractor/tree/SKILL.md +23 -6
- package/skills/aircall-ds/setup/SKILL.md +53 -8
|
@@ -11,6 +11,9 @@ requires:
|
|
|
11
11
|
- aircall-ds/setup
|
|
12
12
|
sources:
|
|
13
13
|
- "aircall/hydra:docs/migration-guides/tractor-to-ds/06-react-icons.md"
|
|
14
|
+
- "aircall/hydra:packages/react-icons/src/index.ts"
|
|
15
|
+
- "aircall/hydra:packages/react-icons/src/generated/custom/index.ts"
|
|
16
|
+
- "aircall/hydra:packages/react-icons/src/generated/colored/index.ts"
|
|
14
17
|
---
|
|
15
18
|
|
|
16
19
|
Migrate icons from `@aircall/icons` to `@aircall/react-icons`. This is **independent of
|
|
@@ -55,6 +58,11 @@ wrapper; when it was wrapped in Tractor's `<Icon>`, also remove that wrapper (se
|
|
|
55
58
|
| `20` | `size-5` | 20px |
|
|
56
59
|
| `24` | `size-6` | 24px |
|
|
57
60
|
|
|
61
|
+
Prefer the Tailwind class (`size-4`, `size-5`, `size-6`). The icons also accept a numeric `size`
|
|
62
|
+
prop (lucide's API: `size?: string | number`, applied as `width`/`height`), so `<Mic size={24} />`
|
|
63
|
+
still works — but inside DS components keep your hands off size: `Button`, `Badge`, `Attachment`,
|
|
64
|
+
etc. already size their `svg` children, and an explicit class or `size` prop overrides that.
|
|
65
|
+
|
|
58
66
|
## 4. Icon name mapping (complete)
|
|
59
67
|
|
|
60
68
|
Many old `*Filled` / `*Outlined` variants collapse into one new name — this is intentional consolidation. Rows marked ⚠️ need visual validation before the consumer migration is locked.
|
|
@@ -370,7 +378,11 @@ Many old `*Filled` / `*Outlined` variants collapse into one new name — this is
|
|
|
370
378
|
|
|
371
379
|
### Flags
|
|
372
380
|
|
|
373
|
-
Colored country flags ship as `Flag*` exports
|
|
381
|
+
Colored country flags ship as `Flag*` exports named by ISO 3166-1 **alpha-2** code — `FlagFr`,
|
|
382
|
+
`FlagUs`, `FlagGbEng`, … (the alpha-3 names from `@aircall/icons`, e.g. `FlagFra`/`FlagDeu`, were
|
|
383
|
+
dropped). A slug-keyed `FLAGS` map (`{ fr: FlagFr, 'gb-eng': FlagGbEng, … }`) is exported for
|
|
384
|
+
dynamic lookup — use it instead of `import * as Icons`, which would pull every lucide icon into
|
|
385
|
+
the bundle.
|
|
374
386
|
|
|
375
387
|
## 5. Icons with no equivalent
|
|
376
388
|
|
|
@@ -387,15 +399,25 @@ Pairs where the placeholder mapping doesn't convincingly match the old icon. Con
|
|
|
387
399
|
|
|
388
400
|
_None open — `IntegrationsOutlined` / `Integrations1Outlined` resolved to `Unplug` (lucide)._
|
|
389
401
|
|
|
390
|
-
## 6. Brand / platform icons
|
|
402
|
+
## 6. Brand / platform icons
|
|
403
|
+
|
|
404
|
+
Some brands moved into `@aircall/react-icons` as Aircall custom or colored exports; the rest stay
|
|
405
|
+
as separate inline SVGs or local wrappers.
|
|
406
|
+
|
|
407
|
+
**Shipped by the package — import them, don't hand-roll:**
|
|
408
|
+
|
|
409
|
+
- **Aircall brand**: `AircallLogo` (badge-with-mark) and `AircallMark` (bare "A" glyph, for the
|
|
410
|
+
chatbot empty state / a coloured surface). Older brand variants (`AircallIcon`,
|
|
411
|
+
`AircallLogoFull`, `LogoMarkMono`, `LogoMarkColor`, …) have no equivalent.
|
|
412
|
+
- **Social / platform logos**: the colored `Social<Name>Neutral` / `Social<Name>Original` pairs —
|
|
413
|
+
e.g. `SocialAppleOriginal`, `SocialAndroidOriginal`, `SocialWhatsappOriginal`,
|
|
414
|
+
`SocialMicrosoftteamsOriginal`. `Original` keeps the brand colors, `Neutral` is the monochrome
|
|
415
|
+
cut.
|
|
391
416
|
|
|
392
|
-
|
|
417
|
+
**Still not in the package — keep as separate assets:**
|
|
393
418
|
|
|
394
|
-
- **
|
|
395
|
-
- **
|
|
396
|
-
- **Browsers**: `ChromeFilled`, `EdgeFilled`, `FirefoxFilled`
|
|
397
|
-
- **Messaging**: `WhatsappFilled`, `WhatsappOutlined` — use the existing `WhatsAppIcon.tsx` in `packages/aw-ui`
|
|
398
|
-
- **Text badges**: `BetaOutlined` — keep as a custom SVG or badge component
|
|
419
|
+
- **Browsers**: `ChromeFilled`, `EdgeFilled`, `FirefoxFilled` — no colored-logo equivalent.
|
|
420
|
+
- **Text badges**: `BetaOutlined` — keep as a custom SVG or badge component.
|
|
399
421
|
|
|
400
422
|
## 7. Before / After examples
|
|
401
423
|
|
|
@@ -518,23 +540,30 @@ Source: `@aircall/react-icons` re-exports lucide + Aircall icons; custom icons l
|
|
|
518
540
|
|
|
519
541
|
---
|
|
520
542
|
|
|
521
|
-
### Mistake 3:
|
|
543
|
+
### Mistake 3: Passing a Tractor token to the `color` prop
|
|
522
544
|
|
|
523
545
|
```tsx
|
|
524
|
-
// WRONG —
|
|
546
|
+
// WRONG — "primary.500" is a Tractor token, not a CSS colour; the SVG ignores it
|
|
525
547
|
import { Mic } from '@aircall/react-icons';
|
|
526
548
|
|
|
527
|
-
<Mic
|
|
528
|
-
|
|
529
|
-
// CORRECT — use Tailwind utility classes
|
|
530
|
-
import { Mic } from '@aircall/react-icons';
|
|
549
|
+
<Mic color="primary.500" />
|
|
531
550
|
|
|
551
|
+
// CORRECT — use the Tailwind text-* class (or a real CSS colour / currentColor)
|
|
532
552
|
<Mic className="size-6 text-primary" />
|
|
533
553
|
```
|
|
534
554
|
|
|
535
|
-
**Mechanism:**
|
|
555
|
+
**Mechanism:** the icon's `color` prop is a plain SVG attribute, so it only accepts a valid CSS
|
|
556
|
+
colour — a Tractor token like `"primary.500"` is an invalid value the browser ignores, and the icon
|
|
557
|
+
inherits its surrounding colour instead of the intended one. The Tailwind `text-*` class is the
|
|
558
|
+
authoritative colour system in `@aircall/ds`.
|
|
559
|
+
|
|
560
|
+
Note the `size` prop is **different**: it is a real lucide prop (`size?: string | number`) and works.
|
|
561
|
+
Prefer `className="size-6"` only for consistency with the rest of the DS — and omit both inside a DS
|
|
562
|
+
`Button`, which sizes its own icons.
|
|
536
563
|
|
|
537
|
-
Source: `@aircall/react-icons` re-exports lucide
|
|
564
|
+
Source: `@aircall/react-icons` re-exports lucide icon components (`LucideProps` has `size`; `color`
|
|
565
|
+
is standard `SVGAttributes`); Tailwind design tokens (`text-primary`, `text-destructive`, …) are the
|
|
566
|
+
authoritative colour system in `@aircall/ds`.
|
|
538
567
|
|
|
539
568
|
---
|
|
540
569
|
|
|
@@ -103,7 +103,8 @@ Affected: Trigger/Close on Dialog, Sheet, Popover, Tooltip, DropdownMenu, Collap
|
|
|
103
103
|
Drawer, plus `Button`, `Badge`, `Item`, `PaginationLink`, and Sidebar subcomponents.
|
|
104
104
|
|
|
105
105
|
Drawer is Base UI (via Coss UI) - same `render` rule applies. Its body wrapper is
|
|
106
|
-
`DrawerPopup` (not `DrawerContent`)
|
|
106
|
+
`DrawerPopup` (not `DrawerContent`). For a desktop side panel use `Sheet` instead (see
|
|
107
|
+
`sheet-vs-drawer`).
|
|
107
108
|
|
|
108
109
|
## 5. Labels live inside Groups
|
|
109
110
|
|
|
@@ -200,12 +201,13 @@ import { AddOutlined, Icon } from '@aircall/tractor';
|
|
|
200
201
|
<Icon component={AddOutlined} mr={2} />
|
|
201
202
|
|
|
202
203
|
// After
|
|
203
|
-
import {
|
|
204
|
-
<
|
|
204
|
+
import { Plus } from '@aircall/react-icons';
|
|
205
|
+
<Plus className="mr-2 size-4" />
|
|
205
206
|
```
|
|
206
207
|
|
|
207
|
-
Some names differ significantly (e.g. `InfoCircleFilled` -> `
|
|
208
|
-
`PlayFilled` -> `
|
|
208
|
+
Some names differ significantly (e.g. `InfoCircleFilled` -> `Info`,
|
|
209
|
+
`PlayFilled` -> `Play`). `@aircall/react-icons` is lucide plus Aircall custom icons; check
|
|
210
|
+
`@aircall/ds#aircall-ds/migrate-icons` before guessing a name.
|
|
209
211
|
|
|
210
212
|
## 10. Forms & validation
|
|
211
213
|
|
|
@@ -237,20 +239,20 @@ Then load the listed recipe skill (if `available`) for the detailed swap.
|
|
|
237
239
|
| `Audio` / `AudioPlayer` / `AudioManager` / `useAudio` | `Audio` + `AudioPlayerRow` + `AudioPlayerButton` + `AudioPlayerBar` + `AudioPlayerTime` + `AudioPlayerSpeed` + `AudioPlayerSkip` + `AudioPlayerManager` | `@aircall/ds#aircall-ds/migrate-audio-player` | available |
|
|
238
240
|
| `Avatar` (+ `QuickAvatar`) | `Avatar` + `AvatarImage` + `AvatarFallback` | `@aircall/ds#aircall-ds/migrate-tractor/avatar` | available |
|
|
239
241
|
| `Badge` | `AvatarBadge` (status dot on avatar); `Badge` (label/tag style) | `@aircall/ds#aircall-ds/migrate-tractor/badge` | available |
|
|
240
|
-
| `Banner` (+ `BannerHeading`/`BannerIcon`/`BannerSuffix`) | `Alert` (
|
|
242
|
+
| `Banner` (+ `BannerHeading`/`BannerIcon`/`BannerSuffix`), `BannerManager`/`useBanner`/`banners.showBanner` | `Alert` (`inline` / in-content) / `Banner` (full-width); programmatic banners -> `NotificationQueueProvider` + `NotificationSlot` + `useNotification`/`useNotificationQueue` | `@aircall/ds#aircall-ds/migrate-tractor/alert` | available |
|
|
241
243
|
| `BannerButton` | `Button` inside `BannerAction` | `@aircall/ds#aircall-ds/migrate-tractor/alert` | available |
|
|
242
244
|
| `Box` | native `<div>` + Tailwind classes | `@aircall/ds#aircall-ds/migrate-tractor/styling` | available |
|
|
243
245
|
| `Button` | `Button` | `@aircall/ds#aircall-ds/migrate-tractor/button` | available |
|
|
244
246
|
| hand-rolled card (`div`/`Box` with border + shadow + padding) | `Card` + `CardHeader` + `CardTitle` + `CardDescription` + `CardAction` + `CardContent` + `CardFooter` | `@aircall/ds#aircall-ds/migrate-tractor/card` | available |
|
|
245
247
|
| `Checkbox` | `Checkbox` + `<Label>` | - | not-yet |
|
|
246
|
-
| `ComboBox` | `Combobox` (compound) | `@aircall/ds#aircall-ds/migrate-tractor/combobox` | available |
|
|
248
|
+
| `ComboBox` | `Combobox` (compound) / `DataCombobox` (data-driven) | `@aircall/ds#aircall-ds/migrate-tractor/combobox` | available |
|
|
247
249
|
| `CounterBadge` | `CounterBadge` | `@aircall/ds#aircall-ds/migrate-tractor/badge` | available |
|
|
248
|
-
| `DatePicker` | `DatePicker` (
|
|
249
|
-
| `DateSelect` (
|
|
250
|
+
| `DatePicker` (Tractor, inline `{ startDate, endDate }` calendar) | `Calendar` (inline) or `DatePicker` (field; defaults to `mode="single"`, so set `mode="range"` explicitly) | `@aircall/ds#aircall-ds/migrate-tractor/date-picker` | available |
|
|
251
|
+
| `DateSelect` (`@dashboard/library`) | `DatePicker` (single, or `mode="range"` + `predefinedRanges` + `onRangeChange`); dashboard filter chips -> `DateRangeCalendar` (@aircall/blocks) | `@aircall/ds#aircall-ds/migrate-tractor/date-picker` | available |
|
|
250
252
|
| `Divider` | `Separator` | `@aircall/ds#aircall-ds/migrate-tractor/divider` | available |
|
|
251
253
|
| `DragAndDrop` / `ConversationDragAndDrop` / react-dropzone (`useDropzone`) + project wrappers (`Dropzone`/`DropzoneV2`) | `Dropzone` | `@aircall/ds#aircall-ds/migrate-tractor/dropzone` | available |
|
|
252
|
-
| `Drawer` | `Drawer`
|
|
253
|
-
| `Dropdown` | `DropdownMenu` (compound) | `@aircall/ds#aircall-ds/migrate-tractor/dropdown-menu` | available |
|
|
254
|
+
| `Drawer` | `Sheet` + `SheetContent side` for a desktop side panel; `Drawer` + `DrawerPopup` only for swipe-to-dismiss | `@aircall/ds#aircall-ds/migrate-tractor/sheet-vs-drawer` | available |
|
|
255
|
+
| `Dropdown` | `DropdownMenu` (compound); non-menu content -> `Popover` | `@aircall/ds#aircall-ds/migrate-tractor/dropdown-menu` | available |
|
|
254
256
|
| `Flex` | native `<div className="flex ...">` + Tailwind | `@aircall/ds#aircall-ds/migrate-tractor/styling` | available |
|
|
255
257
|
| `FlagIcon` | `CountryFlag` (prop: `countryIsoCode`) | - | not-yet |
|
|
256
258
|
| `Form` | native `<form>` + `Field` per row | `@aircall/ds#aircall-ds/migrate-tractor/form-and-field` | available |
|
|
@@ -259,36 +261,37 @@ Then load the listed recipe skill (if `available`) for the detailed swap.
|
|
|
259
261
|
| `Grid` | native `<div className="grid ...">` + Tailwind | `@aircall/ds#aircall-ds/migrate-tractor/styling` | available |
|
|
260
262
|
| `Icon` | direct icon import from `@aircall/react-icons` | `@aircall/ds#aircall-ds/migrate-icons` | available |
|
|
261
263
|
| `IconButton` | `Button` with `size` `icon` / `icon-sm` / `icon-lg` | `@aircall/ds#aircall-ds/migrate-tractor/button` | available |
|
|
262
|
-
| `Link` | `
|
|
263
|
-
| `List` (+ `ListItem`) | `ItemGroup` + `Item` + `
|
|
264
|
-
| `Menu` (+ `MenuItem`) | standalone list -> `ItemGroup` + `Item
|
|
265
|
-
| `Modal` | `Dialog` (compound) | `@aircall/ds#aircall-ds/migrate-tractor/dialog` | available |
|
|
264
|
+
| `Link` | `Anchor` (navigation) / `Button variant="ghost"` (click-only action) | `@aircall/ds#aircall-ds/migrate-tractor/link` | available |
|
|
265
|
+
| `List` (+ `ListItem`, `ListView`, `ListFooter`) | `ItemGroup` + `Item` + `ItemContent`/`ItemActions` (+ `ItemMedia variant="icon"` for icons; a DS `Avatar` directly in `Item` for people; `ScrollArea` for `ListView maxH`; `ItemSeparator` for dividers) | `@aircall/ds#aircall-ds/migrate-tractor/item` | available |
|
|
266
|
+
| `Menu` (+ `MenuItem`) | standalone list -> `ItemGroup` + `Item` (no selection state: selectable menus use `DropdownMenu` checkbox/radio items); **inside a `Dropdown`/`ActionMenu`** -> `DropdownMenuContent` + `DropdownMenuItem` | `@aircall/ds#aircall-ds/migrate-tractor/item` (standalone) or `@aircall/ds#aircall-ds/migrate-tractor/dropdown-menu` (in a Dropdown) | available |
|
|
267
|
+
| `Modal` / `ModalDialog` | `Dialog` (compound); confirm prompts -> `AlertDialog` | `@aircall/ds#aircall-ds/migrate-tractor/dialog` | available |
|
|
268
|
+
| `NumberInput` (`@dashboard/library`) | `NumericInput` (`suffix`/`prefix`, `onValueChange(number \| null)`) | `@aircall/ds#aircall-ds/migrate-tractor/input` | available |
|
|
266
269
|
| `PasswordInput` | `InputGroup` recipe | `@aircall/ds#aircall-ds/migrate-tractor/input` | available |
|
|
267
270
|
| `Popover` | `Popover` + `PopoverTrigger` + `PopoverContent` | `@aircall/ds#aircall-ds/migrate-tractor/popover` | available |
|
|
268
271
|
| `Progress` | `Progress` (compound: `ProgressTrack` + `ProgressIndicator`) | - | not-yet |
|
|
269
272
|
| `QuickAvatar` | `Avatar` (same as Avatar row) | `@aircall/ds#aircall-ds/migrate-tractor/avatar` | available |
|
|
270
273
|
| `Radio` + `RadioGroup` | `RadioGroup` + `RadioGroupItem` | - | not-yet |
|
|
271
274
|
| `SegmentedControl` | `Tabs` (with panel) or `ToggleGroup` (visual only) | `@aircall/ds#aircall-ds/migrate-tractor/tabs` | available |
|
|
272
|
-
| `Select`
|
|
275
|
+
| `Select` (options-array API; no `SelectOption` component) | `Select` compound: `items` + `SelectTrigger` + `SelectValue` + `SelectContent` + `SelectItem` (+ `SelectGroup`/`SelectLabel`/`SelectSeparator`) | `@aircall/ds#aircall-ds/migrate-tractor/select` | available |
|
|
273
276
|
| `SidenavDropdown` | `Sidebar` + `Collapsible` (compose) | - | not-yet |
|
|
274
277
|
| `SidenavItem` | `Sidebar*` family | - | not-yet |
|
|
275
278
|
| `Skeleton` | `Skeleton` - size via Tailwind (`className="h-4 w-32"`) | `@aircall/ds#aircall-ds/migrate-tractor/skeleton` | available |
|
|
276
279
|
| `Slider` | `Slider` (`onValueChange`, value is `number[]`, no `size`) | - | not-yet |
|
|
277
280
|
| `Spacer` | `<div className="flex flex-col gap-*">` or `FieldGroup` | `@aircall/ds#aircall-ds/migrate-tractor/styling` | available |
|
|
278
|
-
| `SpinnerOutlined` | `Spinner` (
|
|
279
|
-
| `Tab` (+ `Tab.
|
|
280
|
-
| `Table` (+ `ActionBar`) | `DataTable` (data-driven) or `Table` primitive (static) | `@aircall/ds#aircall-ds/migrate-tractor/data-table` | available |
|
|
281
|
-
| `Tag` | `Badge` (`color` + `tone`
|
|
281
|
+
| `SpinnerOutlined` | `Spinner` (`sm`/`default`/`lg`/`xl`, always animated) | `@aircall/blocks#aircall-blocks/migrate-dashboard/loading` | available |
|
|
282
|
+
| `Tab` (+ `TabContainer`/`TabMenu`/`TabMenuItem`/`TabItem`/`TabContent`, and the @dashboard/library `Tab.Container`/`Tab.Menu`/`Tab.MenuItem`/`Tab.Item` compound) | `Tabs` + `TabsList` + `TabsTrigger` + `TabsContent` | `@aircall/ds#aircall-ds/migrate-tractor/tabs` | available |
|
|
283
|
+
| `Table` (+ `ActionBar`) | `DataTable` (data-driven; pinning via `columnPinning`, ActionBar via the `actionBar` prop) or `Table` primitive (static) | `@aircall/ds#aircall-ds/migrate-tractor/data-table` | available |
|
|
284
|
+
| `Tag` | `Badge` (`color` + `tone`; `customColor` for an arbitrary hex; `legacyColor` is deprecated); removable `Tag` -> `Chip` + `ChipRemove` | `@aircall/ds#aircall-ds/migrate-tractor/badge` | available |
|
|
282
285
|
| `Textarea` | `Textarea` (no `size`, use `aria-invalid`) | - | not-yet |
|
|
283
|
-
| `TextFieldInput` | `Input` (no `
|
|
286
|
+
| `TextInput` (older `@aircall/tractor` 1.x: `TextFieldInput`) | `Input` (no `size`, 40px fixed, use `aria-invalid`; icon/suffix/`onClear` -> `InputGroup`) | `@aircall/ds#aircall-ds/migrate-tractor/input` | available |
|
|
284
287
|
| `Toggle` | `Switch` (`onCheckedChange`, no `size`) | - | not-yet |
|
|
285
|
-
| `ToggleGroup` / `TabToggle` | `ToggleGroup` (`multiple` boolean; value always `string[]`) | - |
|
|
286
|
-
| Day-of-week toggle row (custom) | `DaysPicker`
|
|
287
|
-
| `Tooltip` | `Tooltip` (compound)
|
|
288
|
+
| `ToggleGroup` / `TabToggle` | `ToggleGroup` (`multiple` boolean; value always `string[]`) | `@aircall/ds#aircall-ds/migrate-tractor/tabs` | available |
|
|
289
|
+
| Day-of-week toggle row (custom) | `DaysPicker` from `@aircall/blocks` (`value: DayOfWeek[]`, `onValueChange`, `labelFormat`; no `labels` prop) | `@aircall/ds#aircall-ds/migrate-tractor/date-picker` | available |
|
|
290
|
+
| `Tooltip` | `Tooltip` (compound); `TooltipProvider` at app root is optional (shared delay) | `@aircall/ds#aircall-ds/migrate-tractor/tooltip` | available |
|
|
288
291
|
| `Tree` | `DataTree` (data-driven) or `Tree` primitive | `@aircall/ds#aircall-ds/migrate-tractor/tree` | available |
|
|
289
292
|
| `TreeSelect` | no turn-key equivalent - `DataTree` inside a `Popover` | `@aircall/ds#aircall-ds/migrate-tractor/tree` | available |
|
|
290
293
|
| `Typography` | native HTML + Tailwind text classes | `@aircall/ds#aircall-ds/migrate-tractor/styling` | available |
|
|
291
|
-
| `useToast` | `toast` from `
|
|
294
|
+
| `useToast` / `toasts` / `ToastManager` | `toast` from `@aircall/ds` + `<Toaster />` at app root | `@aircall/ds#aircall-ds/migrate-tractor/toast` | available |
|
|
292
295
|
| `WhatsAppTemplatePreview` | - (no DS equivalent) | - | not-yet |
|
|
293
296
|
|
|
294
297
|
---
|
|
@@ -304,14 +307,14 @@ These APIs do not exist in DS. Do not propose them.
|
|
|
304
307
|
- `<RadioGroup size="..." />` - no size prop.
|
|
305
308
|
- `<Slider size="..." />` - no size prop.
|
|
306
309
|
- `<Tabs size="..." />` / `<TabsList variant="..." />` - no such props.
|
|
307
|
-
- `<Badge variant="destructive" | "success" | "warning" | "info" />` - Badge has
|
|
308
|
-
`
|
|
309
|
-
|
|
310
|
+
- `<Badge variant="destructive" | "success" | "warning" | "info" />` - Badge has no
|
|
311
|
+
`variant`; colour is `color` + `tone` (+ `customColor` for a stored hex). For alerts
|
|
312
|
+
use `Alert`.
|
|
310
313
|
- `<Alert variant="destructive" />` - Alert's error variant is `error`, not
|
|
311
314
|
`destructive`. Full set: `default` / `info` / `success` / `warning` / `error`.
|
|
312
|
-
- `<CounterBadge count={...}
|
|
313
|
-
capped value as children. Variants: `default` / `secondary` / `ghost`.
|
|
315
|
+
- `<CounterBadge count={...} maxCount={...} />` - those were Tractor props. Pass the
|
|
316
|
+
already-capped value as children. Variants: `default` / `secondary` / `ghost`.
|
|
314
317
|
- `<TooltipProvider delayDuration={...} />` - Base UI prop is `delay`, default `0`.
|
|
315
|
-
`delayDuration` is
|
|
318
|
+
`delayDuration` is not a prop (type error).
|
|
316
319
|
- Subpath imports like `@aircall/ds/components/<name>` - never propose. Always use
|
|
317
320
|
`import { X } from '@aircall/ds'`.
|
|
@@ -11,6 +11,8 @@ requires:
|
|
|
11
11
|
- aircall-ds/migrate-tractor
|
|
12
12
|
sources:
|
|
13
13
|
- "aircall/hydra:docs/migration-guides/tractor-to-ds/recipes/accordion.md"
|
|
14
|
+
- "aircall/hydra:packages/ds/src/components/accordion.tsx"
|
|
15
|
+
- "aircall/hydra:packages/ds/src/stories/Accordion.stories.tsx"
|
|
14
16
|
---
|
|
15
17
|
|
|
16
18
|
This skill builds on aircall-ds/migrate-tractor. Apply all cross-cutting rules from that skill (prop renames, `render` prop, data attributes) before the accordion-specific steps below.
|
|
@@ -51,7 +53,7 @@ import {
|
|
|
51
53
|
| --- | --- | --- |
|
|
52
54
|
| _(implicit — one open at a time)_ | default (no extra prop needed) | Single-open is the DS default |
|
|
53
55
|
| _(allowMultiple or equivalent)_ | `multiple` on `<Accordion>` | Boolean — allows multiple items open simultaneously |
|
|
54
|
-
| _(section key)_ | `value` on `<AccordionItem>` |
|
|
56
|
+
| _(section key)_ | `value` on `<AccordionItem>` | `number` or `string`; the array index works for static lists. Base UI auto-generates an id when omitted, but an explicit `value` is what lets the item match `defaultValue` / `value` on the root |
|
|
55
57
|
| _(section disabled)_ | `disabled` on `<AccordionItem>` | Disables the trigger and keeps the panel closed |
|
|
56
58
|
| `defaultExpanded` / open sections | `defaultValue` on `<Accordion>` | Always an array, even in single-open mode: `defaultValue={[0]}` |
|
|
57
59
|
| controlled open | `value` + `onValueChange` on `<Accordion>` | `value` is an array; `onValueChange` receives `(number \| string)[]` |
|
|
@@ -234,25 +236,33 @@ Source: `packages/ds/src/components/accordion.tsx`
|
|
|
234
236
|
|
|
235
237
|
---
|
|
236
238
|
|
|
237
|
-
### Mistake 3 — Omitting the `value` prop on `AccordionItem`
|
|
239
|
+
### Mistake 3 — Omitting the `value` prop on `AccordionItem` (uncontrolled panel never matches)
|
|
238
240
|
|
|
239
241
|
```tsx
|
|
240
|
-
// Wrong —
|
|
241
|
-
<
|
|
242
|
-
<
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
242
|
+
// Wrong — no value: the item cannot be matched against the root's defaultValue/value
|
|
243
|
+
<Accordion defaultValue={[0]}>
|
|
244
|
+
<AccordionItem>
|
|
245
|
+
<AccordionTrigger>General</AccordionTrigger>
|
|
246
|
+
<AccordionContent>General settings content.</AccordionContent>
|
|
247
|
+
</AccordionItem>
|
|
248
|
+
</Accordion>
|
|
249
|
+
|
|
250
|
+
// Correct — every AccordionItem needs a value that matches the root state
|
|
251
|
+
<Accordion defaultValue={[0]}>
|
|
252
|
+
<AccordionItem value={0}>
|
|
253
|
+
<AccordionTrigger>General</AccordionTrigger>
|
|
254
|
+
<AccordionContent>General settings content.</AccordionContent>
|
|
255
|
+
</AccordionItem>
|
|
256
|
+
</Accordion>
|
|
251
257
|
```
|
|
252
258
|
|
|
253
|
-
|
|
259
|
+
Base UI's `Accordion.Item` types `value` as optional and generates a unique id when it is
|
|
260
|
+
absent, so the item still toggles on its own — but that generated id can never appear in the
|
|
261
|
+
root's `defaultValue` / `value` array, so an explicitly-opened panel (and any controlled
|
|
262
|
+
`value`/`onValueChange` state) never lines up with it. Always pass an explicit `value` so the
|
|
263
|
+
item and the root speak the same identity.
|
|
254
264
|
|
|
255
|
-
Source: `packages/ds/src/components/accordion.tsx`
|
|
265
|
+
Source: `packages/ds/src/components/accordion.tsx` — `AccordionItemProps extends AccordionPrimitive.Item.Props`.
|
|
256
266
|
|
|
257
267
|
---
|
|
258
268
|
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
name: aircall-ds/migrate-tractor/alert
|
|
3
3
|
description: >
|
|
4
4
|
Migrate Tractor Banner (Banner, BannerHeading, BannerIcon, BannerParagraph) to
|
|
5
|
-
@aircall/ds Alert (rounded) vs Banner (inline)
|
|
6
|
-
|
|
5
|
+
@aircall/ds Alert (rounded) vs Banner (inline), and the Tractor BannerManager /
|
|
6
|
+
useBanner / banners.showBanner API to the NotificationQueue. Load when a file
|
|
7
|
+
imports Banner*, BannerManager or useBanner from @aircall/tractor.
|
|
7
8
|
type: sub-skill
|
|
8
9
|
library: aircall-ds
|
|
9
10
|
requires:
|
|
@@ -11,6 +12,12 @@ requires:
|
|
|
11
12
|
- aircall-ds/migrate-tractor
|
|
12
13
|
sources:
|
|
13
14
|
- "aircall/hydra:docs/migration-guides/tractor-to-ds/recipes/alert-and-banner.md"
|
|
15
|
+
- "aircall/hydra:packages/ds/src/components/alert.tsx"
|
|
16
|
+
- "aircall/hydra:packages/ds/src/components/banner.tsx"
|
|
17
|
+
- "aircall/hydra:packages/ds/src/components/notification-queue.tsx"
|
|
18
|
+
- "aircall/hydra:packages/ds/src/stories/Alert.stories.tsx"
|
|
19
|
+
- "aircall/hydra:packages/ds/src/stories/Banner.stories.tsx"
|
|
20
|
+
- "aircall/hydra:packages/ds/src/stories/NotificationQueue.stories.tsx"
|
|
14
21
|
---
|
|
15
22
|
|
|
16
23
|
This skill builds on aircall-ds/migrate-tractor. Apply all cross-cutting rules from that skill (prop renames, `render` prop, data attributes) before the alert-specific steps below.
|
|
@@ -21,8 +28,10 @@ Tractor `Banner` maps to **two** DS components. Choose based on visual shape:
|
|
|
21
28
|
|
|
22
29
|
| If the Tractor `Banner` looks like… | Use DS component |
|
|
23
30
|
| --- | --- |
|
|
24
|
-
|
|
|
25
|
-
| Full-width
|
|
31
|
+
| `<Banner inline …>` or any rounded callout placed inside page/card content (`rounded-3xl`, full border) | `Alert` |
|
|
32
|
+
| Full-width strip without `inline` (square corners), e.g. at the top of a page or screen (border on one side) | `Banner` |
|
|
33
|
+
|
|
34
|
+
Tractor `Banner` is square-cornered by default and only gets a rounded corner with `inline`. Banners shown through `BannerManager` / `useBanner().showBanner` / `banners.showBanner` are the full-width kind; see section 8 for how they migrate.
|
|
26
35
|
|
|
27
36
|
`Banner` re-exports the `Alert*` sub-parts under `Banner*` aliases — the children grammar is identical. Pick the container; the parts follow.
|
|
28
37
|
|
|
@@ -36,6 +45,8 @@ Tractor `Banner` maps to **two** DS components. Choose based on visual shape:
|
|
|
36
45
|
| `BannerParagraph` (body text) | `AlertDescription` | `BannerDescription` |
|
|
37
46
|
|
|
38
47
|
> **Icon is a direct child, not a part.** `Alert`/`Banner` detect a leading icon via `has-[>svg]` CSS. Render the icon as the **first child** — never wrap it. There is no `AlertIcon` or `BannerIcon` component in DS.
|
|
48
|
+
>
|
|
49
|
+
> **No automatic icon.** Tractor `BannerIcon` rendered a default icon per variant (or the node passed as its `icon` prop; `icon={false}` hid it). DS renders only the icon you give it, so pick one per variant. The stories use `InfoIcon` (info), `CircleCheck` (success), `AlertTriangle` (warning), `CircleX` (error) and `LightbulbIcon` (default), all from `@aircall/react-icons`. `AlertDescription` is optional: a title on its own is a valid `Alert`/`Banner`.
|
|
39
50
|
|
|
40
51
|
## 3. Verified DS exports (`packages/ds/src/index.ts`)
|
|
41
52
|
|
|
@@ -65,16 +76,16 @@ import { Info, AlertTriangle, X } from '@aircall/react-icons';
|
|
|
65
76
|
import { Banner, BannerHeading, BannerIcon, BannerParagraph, BannerSuffix } from '@aircall/tractor';
|
|
66
77
|
|
|
67
78
|
// Rounded callout
|
|
68
|
-
<Banner variant="
|
|
69
|
-
<BannerIcon
|
|
79
|
+
<Banner inline variant="info">
|
|
80
|
+
<BannerIcon />
|
|
70
81
|
<BannerHeading>Heads up</BannerHeading>
|
|
71
82
|
<BannerParagraph>Your trial ends in 3 days.</BannerParagraph>
|
|
72
83
|
<BannerSuffix><button onClick={onDismiss}>✕</button></BannerSuffix>
|
|
73
84
|
</Banner>
|
|
74
85
|
|
|
75
|
-
// Full-width
|
|
86
|
+
// Full-width strip
|
|
76
87
|
<Banner variant="critical">
|
|
77
|
-
<BannerIcon
|
|
88
|
+
<BannerIcon />
|
|
78
89
|
<BannerHeading>Limited connectivity</BannerHeading>
|
|
79
90
|
<BannerParagraph>Some calls may not connect.</BannerParagraph>
|
|
80
91
|
<BannerSuffix><button onClick={onRetry}>Retry</button></BannerSuffix>
|
|
@@ -93,7 +104,7 @@ import { Info, AlertTriangle, X } from '@aircall/react-icons';
|
|
|
93
104
|
|
|
94
105
|
// Rounded callout → Alert
|
|
95
106
|
<Alert variant="info">
|
|
96
|
-
<Info /> {/* BannerIcon → first <svg> child, no wrapper */}
|
|
107
|
+
<Info /> {/* BannerIcon (default icon per variant) → first <svg> child, no wrapper */}
|
|
97
108
|
<AlertTitle>Heads up</AlertTitle>
|
|
98
109
|
<AlertDescription>Your trial ends in 3 days.</AlertDescription>
|
|
99
110
|
<AlertAction>
|
|
@@ -101,8 +112,8 @@ import { Info, AlertTriangle, X } from '@aircall/react-icons';
|
|
|
101
112
|
</AlertAction>
|
|
102
113
|
</Alert>
|
|
103
114
|
|
|
104
|
-
// Full-width
|
|
105
|
-
<Banner variant="error" borderDirection="
|
|
115
|
+
// Full-width strip → Banner
|
|
116
|
+
<Banner variant="error" borderDirection="bottom">
|
|
106
117
|
<AlertTriangle />
|
|
107
118
|
<BannerTitle>Limited connectivity</BannerTitle>
|
|
108
119
|
<BannerDescription>Some calls may not connect.</BannerDescription>
|
|
@@ -114,21 +125,97 @@ import { Info, AlertTriangle, X } from '@aircall/react-icons';
|
|
|
114
125
|
|
|
115
126
|
## 6. Variant mapping
|
|
116
127
|
|
|
117
|
-
| Tractor variant | DS variant |
|
|
128
|
+
| Tractor `Banner` variant (`success` / `info` / `warning` / `critical`) | DS variant |
|
|
118
129
|
| --- | --- |
|
|
119
|
-
| `
|
|
130
|
+
| `info` | `info` |
|
|
120
131
|
| `critical` | `error` |
|
|
121
132
|
| `warning` | `warning` |
|
|
122
|
-
| `
|
|
123
|
-
| (
|
|
133
|
+
| `success` | `success` |
|
|
134
|
+
| (no neutral variant in Tractor) | `default` |
|
|
124
135
|
|
|
125
136
|
Both `Alert` and `Banner` share the same set: `default` / `info` / `success` / `warning` / `error`.
|
|
126
137
|
|
|
127
138
|
## 7. `Banner`-only prop: `borderDirection`
|
|
128
139
|
|
|
129
|
-
`Banner` accepts `borderDirection="top" | "bottom"` to place the accent border. `Alert` has no border-side prop — it is fully bordered and rounded.
|
|
140
|
+
`Banner` accepts `borderDirection="top" | "bottom"` to place the accent border (no default: without it the strip has no border). `Alert` has no border-side prop — it is fully bordered and rounded.
|
|
141
|
+
|
|
142
|
+
## 8. Programmatic banners (`BannerManager`, `useBanner`, `banners.showBanner`) → `NotificationQueue`
|
|
143
|
+
|
|
144
|
+
Tractor can also show banners from code: `BannerManager` (mounted once, portals a `BannerList` into `document.body`), `useBanner()` returning `{ banners, showBanner, removeBanner }`, and the `banners.showBanner` / `banners.removeBanner` pub-sub helpers for code outside React. A `BannerItem` is `{ id?, variant, heading, paragraph?, actions?, icon? }` where each action is `{ children, variant?, mode?, onClick(dismiss) }`.
|
|
145
|
+
|
|
146
|
+
DS has no manager component. It has a priority queue, `NotificationQueueProvider` + `NotificationSlot` + `useNotification` / `useNotificationQueue` (see `aircall-ds/setup` for the provider and the slot). You render the `Banner` yourself inside the `render` function.
|
|
147
|
+
|
|
148
|
+
| Tractor | DS |
|
|
149
|
+
| --- | --- |
|
|
150
|
+
| `<BannerManager>` | `<NotificationQueueProvider>` once at the root, plus `<NotificationSlot slot="page" />` where the banner should appear (top of the page) |
|
|
151
|
+
| `showBanner(item)` from a React event handler | `useNotificationQueue().push({ id, slot, priority, render })`, called from a component under the provider |
|
|
152
|
+
| `banners.showBanner(item)` from code outside React (services, sockets, plain modules) | no direct equivalent: `useNotificationQueue` is a hook. Have the service emit an event and a small component under the provider subscribe to it and call `push` (see below) |
|
|
153
|
+
| A banner shown for as long as a condition holds | `useNotification({ id, slot, priority, render })` in a small component you mount while the condition is true |
|
|
154
|
+
| The cleanup function returned by `showBanner`, `removeBanner(id)` | the `{ dismiss }` handle returned by `push` / `useNotification`, or `dismiss(id, slot)` from `useNotificationQueue()` |
|
|
155
|
+
| `variant` `success` / `info` / `warning` / `critical` | `priority` `success` / `info` / `warning` / `error`, and the same value as the `Banner` `variant` |
|
|
156
|
+
| `heading` / `paragraph` / `icon` | `BannerTitle` / `BannerDescription` / leading icon, inside `render` |
|
|
157
|
+
| `actions[].onClick(dismiss)` | `BannerAction` > `Button onClick={dismiss}`, where `dismiss` comes from `render({ dismiss })` |
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
import {
|
|
161
|
+
Banner, BannerAction, BannerDescription, BannerTitle, Button,
|
|
162
|
+
NotificationQueueProvider, NotificationSlot, useNotificationQueue,
|
|
163
|
+
} from '@aircall/ds';
|
|
164
|
+
import { AlertTriangle } from '@aircall/react-icons';
|
|
165
|
+
import { useEffect } from 'react';
|
|
166
|
+
|
|
167
|
+
// Once, at the root:
|
|
168
|
+
<NotificationQueueProvider>
|
|
169
|
+
<NotificationSlot slot="page" />
|
|
170
|
+
<App />
|
|
171
|
+
</NotificationQueueProvider>
|
|
172
|
+
|
|
173
|
+
// Event-driven (was showBanner / banners.showBanner). `connectivity` stands for whatever
|
|
174
|
+
// non-React service used to call banners.showBanner: it now only emits, and this component,
|
|
175
|
+
// mounted once under the provider, turns the event into a push.
|
|
176
|
+
function ConnectivityBanner() {
|
|
177
|
+
const { push } = useNotificationQueue();
|
|
178
|
+
|
|
179
|
+
useEffect(
|
|
180
|
+
() =>
|
|
181
|
+
connectivity.onLost(() => {
|
|
182
|
+
push({
|
|
183
|
+
id: 'connectivity',
|
|
184
|
+
slot: 'page',
|
|
185
|
+
priority: 'warning',
|
|
186
|
+
render: ({ dismiss }) => (
|
|
187
|
+
<Banner variant="warning" borderDirection="bottom">
|
|
188
|
+
<AlertTriangle />
|
|
189
|
+
<BannerTitle>Limited connectivity</BannerTitle>
|
|
190
|
+
<BannerDescription>Some calls may not connect.</BannerDescription>
|
|
191
|
+
<BannerAction>
|
|
192
|
+
<Button variant="outline" size="sm" onClick={dismiss}>Dismiss</Button>
|
|
193
|
+
</BannerAction>
|
|
194
|
+
</Banner>
|
|
195
|
+
)
|
|
196
|
+
});
|
|
197
|
+
}), // onLost returns its unsubscribe, which is the effect cleanup
|
|
198
|
+
[push]
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// From a React event handler, call push directly: onClick={() => push({ ... })}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Behavioural differences to account for:
|
|
208
|
+
|
|
209
|
+
- A slot shows **one** notification at a time, the highest-priority one (`error` > `warning` > `success` > `info` > `promotional`, then the most recently pushed). Tractor stacked every banner. The others wait and show once the top one is dismissed.
|
|
210
|
+
- `push` evaluates `render` once, when it is called. For content that must follow state, use `useNotification` (it keeps the latest `render`).
|
|
211
|
+
- `useNotification` unregisters on unmount, and a remount shows the notice again even if the user dismissed it. Keep "dismissed for the session" in your own storage and skip mounting the component.
|
|
212
|
+
- Re-pushing the same `id` + `slot` updates the existing notification instead of adding a second one.
|
|
213
|
+
- `error` notices have no special behaviour in the API: `dismiss` always works. "Not dismissible by users" means you do not render a dismiss button for them.
|
|
214
|
+
- The slot is presentation-agnostic: the same queue with a `NotificationSlot` inside a card and an `Alert` in `render` gives an inline alert.
|
|
215
|
+
|
|
216
|
+
Source: `packages/ds/src/components/notification-queue.tsx`, `packages/ds/src/stories/NotificationQueue.stories.tsx`
|
|
130
217
|
|
|
131
|
-
##
|
|
218
|
+
## 9. Common Mistakes
|
|
132
219
|
|
|
133
220
|
### Mistake 1 — Wrapping the icon in a part component
|
|
134
221
|
|
|
@@ -161,7 +248,7 @@ Source: `packages/ds/src/components/alert.tsx`
|
|
|
161
248
|
<Alert variant="error">...</Alert> {/* maps Tractor critical */}
|
|
162
249
|
```
|
|
163
250
|
|
|
164
|
-
`destructive` is a `Button` variant. `Alert`/`Banner` only accept `default | info | success | warning | error`.
|
|
251
|
+
`destructive` is a `Button` variant. `Alert`/`Banner` only accept `default | info | success | warning | error`. An unknown variant is a type error and gets none of the variant classes (no background, border or icon colour).
|
|
165
252
|
Source: `packages/ds/src/components/alert.tsx`
|
|
166
253
|
|
|
167
254
|
---
|
|
@@ -215,10 +302,10 @@ Source: `packages/ds/src/components/alert.tsx`
|
|
|
215
302
|
<Alert variant="warning" borderDirection="top">...</Alert> {/* prop not supported on Alert */}
|
|
216
303
|
|
|
217
304
|
// Correct
|
|
218
|
-
<Banner variant="warning" borderDirection="top"> {/* Banner is the
|
|
305
|
+
<Banner variant="warning" borderDirection="top"> {/* Banner is the full-width strip */}
|
|
219
306
|
...
|
|
220
307
|
</Banner>
|
|
221
308
|
```
|
|
222
309
|
|
|
223
|
-
`borderDirection` is a `Banner`-only prop (
|
|
310
|
+
`borderDirection` is a `Banner`-only prop (full-width strip component). `Alert` is always fully bordered and rounded; it has no border-side prop. On `Alert` it is a type error and the value is spread onto the `<div>` as an unknown DOM attribute.
|
|
224
311
|
Source: `packages/ds/src/components/banner.tsx`
|