@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.
Files changed (41) hide show
  1. package/dist/{data-table-B3ahtFLP.js → data-table-AX0Mgu6K.js} +5 -0
  2. package/dist/{data-table-BgeS8KWP.d.ts → data-table-B5VqWPmw.d.ts} +3 -4
  3. package/dist/data-table.d.ts +1 -1
  4. package/dist/data-table.js +1 -1
  5. package/dist/globals.css +1 -1
  6. package/dist/index.d.ts +53 -16
  7. package/dist/index.js +113 -20
  8. package/package.json +2 -2
  9. package/skills/aircall-ds/migrate-audio-player/SKILL.md +14 -3
  10. package/skills/aircall-ds/migrate-icons/SKILL.md +45 -16
  11. package/skills/aircall-ds/migrate-tractor/SKILL.md +34 -31
  12. package/skills/aircall-ds/migrate-tractor/accordion/SKILL.md +25 -15
  13. package/skills/aircall-ds/migrate-tractor/alert/SKILL.md +107 -20
  14. package/skills/aircall-ds/migrate-tractor/avatar/SKILL.md +57 -26
  15. package/skills/aircall-ds/migrate-tractor/badge/SKILL.md +71 -25
  16. package/skills/aircall-ds/migrate-tractor/button/SKILL.md +68 -32
  17. package/skills/aircall-ds/migrate-tractor/card/SKILL.md +62 -42
  18. package/skills/aircall-ds/migrate-tractor/combobox/SKILL.md +233 -149
  19. package/skills/aircall-ds/migrate-tractor/data-table/SKILL.md +102 -108
  20. package/skills/aircall-ds/migrate-tractor/data-table/references/column-widths-and-pinning.md +50 -0
  21. package/skills/aircall-ds/migrate-tractor/data-table/references/infinite-scroll.md +51 -0
  22. package/skills/aircall-ds/migrate-tractor/data-table/references/row-actions.md +34 -0
  23. package/skills/aircall-ds/migrate-tractor/date-picker/SKILL.md +100 -47
  24. package/skills/aircall-ds/migrate-tractor/dialog/SKILL.md +115 -20
  25. package/skills/aircall-ds/migrate-tractor/dropdown-menu/SKILL.md +135 -57
  26. package/skills/aircall-ds/migrate-tractor/dropzone/SKILL.md +2 -0
  27. package/skills/aircall-ds/migrate-tractor/form-and-field/SKILL.md +111 -49
  28. package/skills/aircall-ds/migrate-tractor/gauge/SKILL.md +6 -4
  29. package/skills/aircall-ds/migrate-tractor/input/SKILL.md +165 -59
  30. package/skills/aircall-ds/migrate-tractor/item/SKILL.md +85 -63
  31. package/skills/aircall-ds/migrate-tractor/link/SKILL.md +85 -68
  32. package/skills/aircall-ds/migrate-tractor/popover/SKILL.md +115 -74
  33. package/skills/aircall-ds/migrate-tractor/select/SKILL.md +117 -64
  34. package/skills/aircall-ds/migrate-tractor/sheet-vs-drawer/SKILL.md +55 -32
  35. package/skills/aircall-ds/migrate-tractor/skeleton/SKILL.md +40 -11
  36. package/skills/aircall-ds/migrate-tractor/styling/SKILL.md +11 -7
  37. package/skills/aircall-ds/migrate-tractor/tabs/SKILL.md +62 -55
  38. package/skills/aircall-ds/migrate-tractor/toast/SKILL.md +58 -12
  39. package/skills/aircall-ds/migrate-tractor/tooltip/SKILL.md +65 -40
  40. package/skills/aircall-ds/migrate-tractor/tree/SKILL.md +23 -6
  41. package/skills/aircall-ds/setup/SKILL.md +53 -8
@@ -13,6 +13,8 @@ requires:
13
13
  - aircall-ds/migrate-tractor
14
14
  sources:
15
15
  - "aircall/hydra:docs/migration-guides/tractor-to-ds/recipes/card.md"
16
+ - "aircall/hydra:packages/ds/src/components/card.tsx"
17
+ - "aircall/hydra:packages/ds/src/stories/Card.stories.tsx"
16
18
  ---
17
19
 
18
20
  This skill builds on aircall-ds/migrate-tractor.
@@ -34,7 +36,7 @@ Tractor had no `Card` component. Apps grew bespoke card implementations — `<di
34
36
  ## 2. Verified DS exports (`packages/ds/src/index.ts`)
35
37
 
36
38
  ```
37
- Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle
39
+ Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants
38
40
  ```
39
41
 
40
42
  ## 3. Imports
@@ -57,12 +59,13 @@ Never import icons from `lucide-react` directly — always use `@aircall/react-i
57
59
 
58
60
  ## 4. Size prop
59
61
 
60
- `Card` accepts a `size` prop (`"default" | "sm"`). Setting it on the root propagates via `data-size` + Tailwind group selectors to **all** sub-components — padding, gap, and title font size all scale together. Never add per-part `p-*` overrides to achieve a compact variant; use `size="sm"` instead.
62
+ `Card` accepts a `size` prop (`"sm" | "default" | "lg"`, default `"default"`). Setting it on the root sets the root's vertical padding and gap and propagates via `data-size` + Tailwind group selectors to **all** sub-components — horizontal padding and title style scale together. Never add per-part `p-*` overrides to achieve a compact variant; use `size="sm"` instead.
61
63
 
62
- | DS `size` | Padding | Gap | Title size |
64
+ | DS `size` | Root padding / gap | Header, content, footer padding | Title |
63
65
  | --- | --- | --- | --- |
64
- | `"default"` (omit prop) | `py-4` / `px-4` | `gap-4` | `text-base` |
65
- | `"sm"` | `py-3` / `px-3` | `gap-3` | `text-sm` |
66
+ | `"sm"` | `py-3` / `gap-3` | `px-3` (footer `p-3`) | `text-sm font-medium` |
67
+ | `"default"` (omit prop) | `py-4` / `gap-4` | `px-4` (footer `p-4`) | `text-base font-medium` |
68
+ | `"lg"` | `py-6` / `gap-6` | `px-6` (footer `p-6`) | `text-lg font-bold` |
66
69
 
67
70
  ## 5. Before / After
68
71
 
@@ -70,27 +73,28 @@ Never import icons from `lucide-react` directly — always use `@aircall/react-i
70
73
 
71
74
  **Before (Tractor-era bespoke component):**
72
75
  ```tsx
73
- import { Box, Typography } from '@aircall/tractor';
76
+ import { Button, Flex, Typography } from '@aircall/tractor';
74
77
 
75
- <Box
76
- className="rounded-xl border border-neutral-200 bg-white p-4 shadow-sm"
77
- display="flex"
78
+ <Flex
78
79
  flexDirection="column"
79
- gap="space-16"
80
+ gap="s"
81
+ p="s"
82
+ border="1px solid"
83
+ borderColor="neutral-200"
84
+ borderRadius="sm"
85
+ backgroundColor="white"
80
86
  >
81
- <Box display="flex" flexDirection="column" gap="space-4">
82
- <Typography variant="headingSmall">Card title</Typography>
83
- <Typography variant="bodySmall" color="neutral.600">
87
+ <Flex flexDirection="column" gap="xxxs">
88
+ <Typography variant="headingBoldXS">Card title</Typography>
89
+ <Typography variant="bodyRegularS" color="text-secondary">
84
90
  A short supporting description.
85
91
  </Typography>
86
- </Box>
87
- <Box>
88
- <p>Card body content goes here.</p>
89
- </Box>
90
- <Box display="flex" justifyContent="flex-end">
92
+ </Flex>
93
+ <Typography variant="bodyRegularS">Card body content goes here.</Typography>
94
+ <Flex justifyContent="flex-end">
91
95
  <Button variant="primary" size="small">Action</Button>
92
- </Box>
93
- </Box>
96
+ </Flex>
97
+ </Flex>
94
98
  ```
95
99
 
96
100
  **After (DS):**
@@ -105,7 +109,7 @@ import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle,
105
109
  <CardContent>
106
110
  <p className="text-sm">Card body content goes here.</p>
107
111
  </CardContent>
108
- <CardFooter>
112
+ <CardFooter className="justify-end">
109
113
  <Button variant="default" size="lg">Action</Button>
110
114
  </CardFooter>
111
115
  </Card>
@@ -115,18 +119,27 @@ Key changes:
115
119
  - Delete all hand-rolled surface styles (border, shadow, radius, bg, padding) — `Card` owns all of it.
116
120
  - Map title/subtitle to `CardTitle` + `CardDescription` inside `CardHeader`.
117
121
  - Map body to `CardContent`; actions to `CardFooter`.
118
- - `CardFooter` renders with `border-t bg-muted/50` by default (distinct action bar). For a plain footer add `className="bg-transparent border-none"`.
122
+ - `CardFooter` renders `flex items-center border-t bg-muted/50 p-4` by default (a distinct action bar) and does not justify its children, so they sit at the start. Add `className="justify-end"` to right-align a Tractor-style action row, or `className="flex justify-between"` for Cancel left / Save right. For a plain footer add `className="bg-transparent border-none"`.
123
+ - A form save/discard bar is not a `CardFooter`: drop `CardSaveBar` from `@aircall/blocks` in as a direct child of `Card` instead (see `@aircall/blocks#aircall-blocks/migrate-dashboard/card`).
119
124
 
120
125
  ### 5b. Compact card using `size="sm"`
121
126
 
122
127
  **Before:**
123
128
  ```tsx
124
- import { Box, Typography } from '@aircall/tractor';
129
+ import { Flex, Typography } from '@aircall/tractor';
125
130
 
126
- <Box className="rounded-xl border border-neutral-200 bg-white p-3 shadow-sm flex flex-col gap-3">
127
- <Typography variant="headingXSmall">Compact card</Typography>
128
- <p className="text-xs">Body content.</p>
129
- </Box>
131
+ <Flex
132
+ flexDirection="column"
133
+ gap="xs"
134
+ p="xs"
135
+ border="1px solid"
136
+ borderColor="neutral-200"
137
+ borderRadius="sm"
138
+ backgroundColor="white"
139
+ >
140
+ <Typography variant="headingBoldXS">Compact card</Typography>
141
+ <Typography variant="supportingRegularS">Body content.</Typography>
142
+ </Flex>
130
143
  ```
131
144
 
132
145
  **After:**
@@ -149,16 +162,21 @@ Setting `size="sm"` on `Card` scales all sub-components — no per-part padding
149
162
 
150
163
  **Before:**
151
164
  ```tsx
152
- import { Box, Typography } from '@aircall/tractor';
153
- import { IconButton } from '@aircall/tractor';
154
- import { MoreVertical } from '@aircall/react-icons';
155
-
156
- <Box className="rounded-xl border bg-white p-4 relative">
157
- <Box display="flex" justifyContent="space-between" alignItems="flex-start">
158
- <Typography variant="headingSmall">With action</Typography>
159
- <IconButton component={MoreVertical} aria-label="Open menu" />
160
- </Box>
161
- </Box>
165
+ import { Flex, IconButton, Typography } from '@aircall/tractor';
166
+ import { MenuVerticalFilled } from '@aircall/icons';
167
+
168
+ <Flex
169
+ p="s"
170
+ border="1px solid"
171
+ borderColor="neutral-200"
172
+ borderRadius="sm"
173
+ backgroundColor="white"
174
+ justifyContent="space-between"
175
+ alignItems="flex-start"
176
+ >
177
+ <Typography variant="headingBoldXS">With action</Typography>
178
+ <IconButton component={MenuVerticalFilled} aria-label="Open menu" />
179
+ </Flex>
162
180
  ```
163
181
 
164
182
  **After:**
@@ -178,7 +196,7 @@ import { MoreVertical } from '@aircall/react-icons';
178
196
  </Card>
179
197
  ```
180
198
 
181
- `CardAction` must live **inside** `CardHeader` — the header is a CSS grid that auto-places it in the top-right (`col-start-2 row-span-2`). Rendered elsewhere it loses positioning entirely.
199
+ `CardAction` must live **inside** `CardHeader` — the header is a CSS grid (`has-data-[slot=card-action]:grid-cols-[1fr_auto]`) and `CardAction` places itself in column 2, row 1, pinned top-right (`col-start-2 row-start-1 justify-self-end`). With a `CardDescription` it also reaches down to row 2 so title and description share the height. Rendered outside `CardHeader` it loses that positioning entirely.
182
200
 
183
201
  ---
184
202
 
@@ -187,7 +205,7 @@ import { MoreVertical } from '@aircall/react-icons';
187
205
  ### Mistake 1 — Keeping hand-rolled surface styles on the root element
188
206
 
189
207
  ```tsx
190
- // ❌ Wrong — double-styles the surface; shadow and border clash with Card's ring
208
+ // ❌ Wrong — double-styles the surface; border, radius, shadow and padding are already owned by Card
191
209
  <Card className="border border-neutral-200 rounded-xl shadow-sm bg-white p-4">
192
210
  <CardContent>Content</CardContent>
193
211
  </Card>
@@ -198,7 +216,7 @@ import { MoreVertical } from '@aircall/react-icons';
198
216
  </Card>
199
217
  ```
200
218
 
201
- `Card` already applies `rounded-xl border bg-card py-4` (plus ring, text color, and overflow). Adding these again creates double borders and mismatched shadows that diverge from the design token.
219
+ `Card` already applies `rounded-xl border bg-card text-card-foreground shadow-xs` plus `overflow-hidden`, `flex flex-col`, and size-driven padding/gap (`py-4 gap-4` by default). Adding these again creates double borders and mismatched shadows that diverge from the design token.
202
220
 
203
221
  Source: `packages/ds/src/components/card.tsx`
204
222
 
@@ -228,7 +246,7 @@ Source: `packages/ds/src/components/card.tsx`
228
246
  </Card>
229
247
  ```
230
248
 
231
- `CardHeader` uses `grid auto-rows-min has-data-[slot=card-action]:grid-cols-[1fr_auto]`. `CardAction` carries `data-slot="card-action"` and is placed via `col-start-2 row-span-2`. Outside `CardHeader`, no grid parent exists and the action renders in normal flow.
249
+ `CardHeader` uses `grid auto-rows-min has-data-[slot=card-action]:grid-cols-[1fr_auto]`. `CardAction` carries `data-slot="card-action"` and is placed via `col-start-2 row-start-1` (plus `row-end-3` when the header has a description). Outside `CardHeader`, no grid parent exists and the action renders in normal flow.
232
250
 
233
251
  Source: `packages/ds/src/components/card.tsx`
234
252
 
@@ -252,7 +270,7 @@ Source: `packages/ds/src/components/card.tsx`
252
270
  </Card>
253
271
  ```
254
272
 
255
- `Card` propagates `data-size="sm"` to sub-components via the `group/card` modifier. Each part responds with `group-data-[size=sm]/card:px-3`, `group-data-[size=sm]/card:py-3`, and `group-data-[size=sm]/card:text-sm`. Overriding padding individually bypasses this mechanism and produces inconsistent spacing.
273
+ `Card` propagates `data-size="sm"` to sub-components via the `group/card` modifier. The root sets `py-3 gap-3`, and each part responds with `group-data-[size=sm]/card:px-3` (footer `p-3`) and the title with `group-data-[size=sm]/card:text-sm`. Overriding padding individually bypasses this mechanism and produces inconsistent spacing.
256
274
 
257
275
  Source: `packages/ds/src/components/card.tsx`
258
276
 
@@ -274,4 +292,6 @@ Source: `packages/ds/src/components/card.tsx`
274
292
 
275
293
  `Card` uses `has-data-[slot=card-footer]:pb-0` to remove its own bottom padding when a `CardFooter` is present, so the footer's rounded corners (`rounded-b-xl`) flush with the card edge. Forcing `pb-4` overrides this and leaves a visible gap.
276
294
 
295
+ The same mechanism lets `CardSaveBar` (`@aircall/blocks`) sit flush: it carries `data-slot="card-footer"` itself, so it goes directly inside `Card` with no `CardFooter` wrapper.
296
+
277
297
  Source: `packages/ds/src/components/card.tsx`