@aircall/blocks 0.2.2 → 0.3.0
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/globals.css +1 -1
- package/dist/index.d.ts +44 -79
- package/dist/index.js +48 -364
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { createContext, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { Badge, Button, CounterBadge, DropdownMenu, DropdownMenuAddon, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, SidebarProvider, TabsList, Tooltip, TooltipContent, TooltipTrigger, cn, useSidebar } from "@aircall/ds";
|
|
4
|
-
import { Check, ChevronLeft, ChevronRight, Copy, PanelLeftClose, PanelLeftOpen
|
|
4
|
+
import { Check, ChevronLeft, ChevronRight, Copy, PanelLeftClose, PanelLeftOpen } from "@aircall/react-icons";
|
|
5
5
|
import { useCallbackRef, useIsMounted, useUnmount } from "@aircall/hooks";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { cva } from "class-variance-authority";
|
|
@@ -104,7 +104,7 @@ function DashboardPageContent({ className, ...props }) {
|
|
|
104
104
|
function DashboardPageMain({ className, ...props }) {
|
|
105
105
|
return /* @__PURE__ */ jsx("main", {
|
|
106
106
|
"data-slot": "dashboard-page-main",
|
|
107
|
-
className: cn("flex-1 min-h-0 overflow-auto", className),
|
|
107
|
+
className: cn("flex-1 min-h-0 overflow-auto py-4 px-6", className),
|
|
108
108
|
...props
|
|
109
109
|
});
|
|
110
110
|
}
|
|
@@ -112,7 +112,7 @@ function DashboardPageTabs({ className, ...props }) {
|
|
|
112
112
|
return /* @__PURE__ */ jsx(TabsList, {
|
|
113
113
|
...props,
|
|
114
114
|
"data-slot": "dph-tabs",
|
|
115
|
-
className: cn("flex w-full justify-start gap-0 px-
|
|
115
|
+
className: cn("flex w-full justify-start gap-0 px-6 border-b border-border rounded-none bg-transparent", "[&>[data-slot=tabs-trigger]]:flex-none", "[&>[data-slot=tabs-trigger]]:rounded-none", "[&>[data-slot=tabs-trigger]]:after:hidden", "[&>[data-slot=tabs-trigger]]:border-b-2", "[&>[data-slot=tabs-trigger]]:border-b-transparent", "[&>[data-slot=tabs-trigger]]:-mb-px", "[&>[data-slot=tabs-trigger][data-active]]:border-b-foreground", className)
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -150,7 +150,7 @@ function DashboardPageHeaderNavBack({ children, ...props }) {
|
|
|
150
150
|
function DashboardPageHeaderPrefix({ className, children, ...props }) {
|
|
151
151
|
return /* @__PURE__ */ jsx("div", {
|
|
152
152
|
"data-slot": "dph-prefix",
|
|
153
|
-
className: cn("[grid-area:prefix] flex shrink-0
|
|
153
|
+
className: cn("[grid-area:prefix] flex shrink-0 px-2 pt-2 items-center justify-center self-start", className),
|
|
154
154
|
...props,
|
|
155
155
|
children
|
|
156
156
|
});
|
|
@@ -158,7 +158,7 @@ function DashboardPageHeaderPrefix({ className, children, ...props }) {
|
|
|
158
158
|
function DashboardPageHeaderTitleGroup({ className, children, ...props }) {
|
|
159
159
|
return /* @__PURE__ */ jsx("div", {
|
|
160
160
|
"data-slot": "dph-title-group",
|
|
161
|
-
className: cn("[grid-area:info] flex min-w-0 flex-col self-center
|
|
161
|
+
className: cn("[grid-area:info] flex min-w-0 flex-col self-center pl-2", "group-has-[[data-slot=dph-prefix]]/dph:pl-0", className),
|
|
162
162
|
...props,
|
|
163
163
|
children
|
|
164
164
|
});
|
|
@@ -166,7 +166,7 @@ function DashboardPageHeaderTitleGroup({ className, children, ...props }) {
|
|
|
166
166
|
function DashboardPageHeaderTitle({ size = "lg", className, children, ...props }) {
|
|
167
167
|
return /* @__PURE__ */ jsx("h1", {
|
|
168
168
|
"data-slot": "dph-title",
|
|
169
|
-
className: cn("[grid-area:info] self-center
|
|
169
|
+
className: cn("[grid-area:info] self-center pl-2 group-has-[[data-slot=dph-prefix]]/dph:pl-0", "[[data-slot=dph-title-group]_&]:p-0", "[[data-slot=dph-title-group]_&]:self-auto", "truncate text-foreground", size === "lg" ? "text-3xl font-bold" : "text-xl font-bold", "leading-10", className),
|
|
170
170
|
...props,
|
|
171
171
|
children
|
|
172
172
|
});
|
|
@@ -204,385 +204,69 @@ DashboardPageHeaderAction.displayName = "DashboardPageHeaderAction";
|
|
|
204
204
|
|
|
205
205
|
//#endregion
|
|
206
206
|
//#region src/components/product-badges.tsx
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
const GRADIENT_BASE = cn("border-transparent text-foreground", "bg-[image:linear-gradient(90deg,var(--badge-overlay),var(--badge-overlay)),linear-gradient(90deg,var(--badge-accent),var(--badge-accent))]");
|
|
208
|
+
const productBadgeVariants = cva(GRADIENT_BASE, { variants: { type: {
|
|
209
|
+
beta: "[--badge-accent:var(--color-blue-300)]",
|
|
210
|
+
new: "[--badge-accent:var(--color-green-300)]",
|
|
211
|
+
deprecated: "[--badge-accent:var(--color-yellow-300)]",
|
|
212
|
+
trial: "[--badge-accent:var(--color-blue-300)]"
|
|
213
|
+
} } });
|
|
214
|
+
const PRODUCT_BADGE_LABEL = {
|
|
215
|
+
beta: "Beta",
|
|
216
|
+
new: "New",
|
|
217
|
+
deprecated: "Deprecated",
|
|
218
|
+
trial: "Trial"
|
|
219
|
+
};
|
|
220
|
+
function createProductBadge(type) {
|
|
221
|
+
const label = PRODUCT_BADGE_LABEL[type];
|
|
222
|
+
function ProductBadge({ className, ...props }) {
|
|
212
223
|
return /* @__PURE__ */ jsx(Badge, {
|
|
213
|
-
"data-slot":
|
|
214
|
-
className: cn(
|
|
215
|
-
style: badgeBg(color),
|
|
224
|
+
"data-slot": `badge-${type}`,
|
|
225
|
+
className: cn(productBadgeVariants({ type }), className),
|
|
216
226
|
...props,
|
|
217
227
|
children: label
|
|
218
228
|
});
|
|
219
229
|
}
|
|
220
|
-
|
|
221
|
-
return
|
|
230
|
+
ProductBadge.displayName = label.replace(/\s+/g, "") + "Badge";
|
|
231
|
+
return ProductBadge;
|
|
222
232
|
}
|
|
223
233
|
/** Blue pill — feature in beta, not yet GA */
|
|
224
|
-
const BetaBadge =
|
|
234
|
+
const BetaBadge = createProductBadge("beta");
|
|
225
235
|
/** Green pill — recently launched feature */
|
|
226
|
-
const NewBadge =
|
|
236
|
+
const NewBadge = createProductBadge("new");
|
|
227
237
|
/** Amber pill — feature being phased out */
|
|
228
|
-
const DeprecatedBadge =
|
|
238
|
+
const DeprecatedBadge = createProductBadge("deprecated");
|
|
229
239
|
/** Blue pill — user is in a trial period (same blue family as Beta) */
|
|
230
|
-
const TrialBadge =
|
|
231
|
-
/**
|
|
240
|
+
const TrialBadge = createProductBadge("trial");
|
|
241
|
+
/** Charcoal pill — Professional tier (no gradient; solid secondary Badge) */
|
|
232
242
|
function ProfessionalBadge({ className, ...props }) {
|
|
233
243
|
return /* @__PURE__ */ jsx(Badge, {
|
|
234
244
|
"data-slot": "badge-professional",
|
|
235
|
-
|
|
236
|
-
|
|
245
|
+
tone: "dark",
|
|
246
|
+
color: "charcoal",
|
|
237
247
|
...props,
|
|
238
248
|
children: "Professional"
|
|
239
249
|
});
|
|
240
250
|
}
|
|
241
|
-
const
|
|
242
|
-
agent:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
admin:
|
|
251
|
-
|
|
252
|
-
label: "Admin"
|
|
253
|
-
},
|
|
254
|
-
owner: {
|
|
255
|
-
color: "var(--color-green-400)",
|
|
256
|
-
label: "Owner"
|
|
257
|
-
}
|
|
251
|
+
const roleBadgeVariants = cva(GRADIENT_BASE, { variants: { role: {
|
|
252
|
+
agent: "[--badge-accent:var(--color-yellow-400)]",
|
|
253
|
+
supervisor: "[--badge-accent:var(--color-blue-500)]",
|
|
254
|
+
admin: "[--badge-accent:var(--color-purple-500)]",
|
|
255
|
+
owner: "[--badge-accent:var(--color-green-400)]"
|
|
256
|
+
} } });
|
|
257
|
+
const ROLE_BADGE_LABEL = {
|
|
258
|
+
agent: "Agent",
|
|
259
|
+
supervisor: "Supervisor",
|
|
260
|
+
admin: "Admin",
|
|
261
|
+
owner: "Owner"
|
|
258
262
|
};
|
|
259
263
|
function RoleBadge({ role, className, ...props }) {
|
|
260
|
-
const { color, label } = ROLE_CONFIG[role];
|
|
261
264
|
return /* @__PURE__ */ jsx(Badge, {
|
|
262
265
|
"data-slot": `badge-${role}`,
|
|
263
|
-
className: cn(
|
|
264
|
-
style: badgeBg(color),
|
|
265
|
-
...props,
|
|
266
|
-
children: label
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
//#endregion
|
|
271
|
-
//#region src/components/colorful-badge.tsx
|
|
272
|
-
const colorfulBadgeVariants = cva("h-[26px] gap-1 rounded-full border-transparent bg-[linear-gradient(0deg,var(--colorful-badge-overlay)_0%,var(--colorful-badge-overlay)_100%)]", {
|
|
273
|
-
variants: {
|
|
274
|
-
color: {
|
|
275
|
-
charcoal: "",
|
|
276
|
-
red: "",
|
|
277
|
-
green: "",
|
|
278
|
-
blue: "",
|
|
279
|
-
purple: "",
|
|
280
|
-
yellow: "",
|
|
281
|
-
pink: ""
|
|
282
|
-
},
|
|
283
|
-
tone: {
|
|
284
|
-
dark: "",
|
|
285
|
-
"medium-dark": "",
|
|
286
|
-
"medium-light": "",
|
|
287
|
-
light: ""
|
|
288
|
-
},
|
|
289
|
-
glow: {
|
|
290
|
-
true: "",
|
|
291
|
-
false: ""
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
compoundVariants: [
|
|
295
|
-
{
|
|
296
|
-
color: "charcoal",
|
|
297
|
-
tone: "dark",
|
|
298
|
-
class: "bg-charcoal-900 text-charcoal-50"
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
color: "charcoal",
|
|
302
|
-
tone: "medium-dark",
|
|
303
|
-
class: "bg-charcoal-600 text-white"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
color: "charcoal",
|
|
307
|
-
tone: "medium-light",
|
|
308
|
-
class: "bg-charcoal-300 text-charcoal-950"
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
color: "charcoal",
|
|
312
|
-
tone: "light",
|
|
313
|
-
class: "bg-charcoal-200 text-charcoal-950"
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
color: "red",
|
|
317
|
-
tone: "dark",
|
|
318
|
-
class: "bg-red-700 text-red-50"
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
color: "red",
|
|
322
|
-
tone: "medium-dark",
|
|
323
|
-
class: "bg-red-400 text-red-950"
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
color: "red",
|
|
327
|
-
tone: "medium-light",
|
|
328
|
-
class: "bg-red-300 text-red-950"
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
color: "red",
|
|
332
|
-
tone: "light",
|
|
333
|
-
class: "bg-red-200 text-red-800"
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
color: "green",
|
|
337
|
-
tone: "dark",
|
|
338
|
-
class: "bg-green-800 text-green-50"
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
color: "green",
|
|
342
|
-
tone: "medium-dark",
|
|
343
|
-
class: "bg-green-600 text-white"
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
color: "green",
|
|
347
|
-
tone: "medium-light",
|
|
348
|
-
class: "bg-green-300 text-green-950"
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
color: "green",
|
|
352
|
-
tone: "light",
|
|
353
|
-
class: "bg-green-200 text-green-950"
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
color: "blue",
|
|
357
|
-
tone: "dark",
|
|
358
|
-
class: "bg-blue-800 text-blue-50"
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
color: "blue",
|
|
362
|
-
tone: "medium-dark",
|
|
363
|
-
class: "bg-blue-600 text-white"
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
color: "blue",
|
|
367
|
-
tone: "medium-light",
|
|
368
|
-
class: "bg-blue-300 text-blue-950"
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
color: "blue",
|
|
372
|
-
tone: "light",
|
|
373
|
-
class: "bg-blue-200 text-blue-900"
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
color: "purple",
|
|
377
|
-
tone: "dark",
|
|
378
|
-
class: "bg-purple-800 text-purple-50"
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
color: "purple",
|
|
382
|
-
tone: "medium-dark",
|
|
383
|
-
class: "bg-purple-600 text-white"
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
color: "purple",
|
|
387
|
-
tone: "medium-light",
|
|
388
|
-
class: "bg-purple-300 text-purple-950"
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
color: "purple",
|
|
392
|
-
tone: "light",
|
|
393
|
-
class: "bg-purple-200 text-purple-900"
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
color: "yellow",
|
|
397
|
-
tone: "dark",
|
|
398
|
-
class: "bg-yellow-500 text-yellow-950"
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
color: "yellow",
|
|
402
|
-
tone: "medium-dark",
|
|
403
|
-
class: "bg-yellow-400 text-yellow-950"
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
color: "yellow",
|
|
407
|
-
tone: "medium-light",
|
|
408
|
-
class: "bg-yellow-300 text-black"
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
color: "yellow",
|
|
412
|
-
tone: "light",
|
|
413
|
-
class: "bg-yellow-200 text-yellow-900"
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
color: "pink",
|
|
417
|
-
tone: "dark",
|
|
418
|
-
class: "bg-pink-700 text-pink-50"
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
color: "pink",
|
|
422
|
-
tone: "medium-dark",
|
|
423
|
-
class: "bg-pink-500 text-pink-950"
|
|
424
|
-
},
|
|
425
|
-
{
|
|
426
|
-
color: "pink",
|
|
427
|
-
tone: "medium-light",
|
|
428
|
-
class: "bg-pink-300 text-pink-950"
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
color: "pink",
|
|
432
|
-
tone: "light",
|
|
433
|
-
class: "bg-pink-200 text-pink-900"
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
glow: true,
|
|
437
|
-
class: "drop-shadow-[0px_0px_3px_var(--cb-glow)] animate-colorful-badge-glow motion-reduce:animate-none"
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
color: "charcoal",
|
|
441
|
-
glow: true,
|
|
442
|
-
class: "border-charcoal-600 [--cb-glow:var(--color-charcoal-600)]"
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
color: "red",
|
|
446
|
-
glow: true,
|
|
447
|
-
class: "border-red-500 [--cb-glow:var(--color-red-500)]"
|
|
448
|
-
},
|
|
449
|
-
{
|
|
450
|
-
color: "green",
|
|
451
|
-
glow: true,
|
|
452
|
-
class: "border-green-600 [--cb-glow:var(--color-green-600)]"
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
color: "blue",
|
|
456
|
-
glow: true,
|
|
457
|
-
class: "border-blue-600 [--cb-glow:var(--color-blue-600)]"
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
color: "purple",
|
|
461
|
-
glow: true,
|
|
462
|
-
class: "border-purple-600 [--cb-glow:var(--color-purple-600)]"
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
color: "yellow",
|
|
466
|
-
glow: true,
|
|
467
|
-
class: "border-yellow-400 [--cb-glow:var(--color-yellow-400)]"
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
color: "pink",
|
|
471
|
-
glow: true,
|
|
472
|
-
class: "border-pink-600 [--cb-glow:var(--color-pink-600)]"
|
|
473
|
-
}
|
|
474
|
-
],
|
|
475
|
-
defaultVariants: {
|
|
476
|
-
color: "charcoal",
|
|
477
|
-
tone: "dark",
|
|
478
|
-
glow: false
|
|
479
|
-
}
|
|
480
|
-
});
|
|
481
|
-
/**
|
|
482
|
-
* A color-customizable badge. Pick a `color` and `tone`; optionally enable the
|
|
483
|
-
* AI `glow`. To render an existing tag, pass its stored hex via `legacyColor`.
|
|
484
|
-
* Icons (e.g. a leading `<Sparkles />` or a trailing close `<X />`) are composed
|
|
485
|
-
* as children, exactly like `Badge`.
|
|
486
|
-
*/
|
|
487
|
-
const ColorfulBadge = React.forwardRef(({ color, tone, glow, legacyColor, className, ...props }, ref) => {
|
|
488
|
-
const resolved = legacyColor ? resolveTagColor(legacyColor) : {
|
|
489
|
-
color,
|
|
490
|
-
tone
|
|
491
|
-
};
|
|
492
|
-
return /* @__PURE__ */ jsx(Badge, {
|
|
493
|
-
ref,
|
|
494
|
-
"data-slot": "colorful-badge",
|
|
495
|
-
size: "lg",
|
|
496
|
-
className: cn(colorfulBadgeVariants({
|
|
497
|
-
color: resolved.color,
|
|
498
|
-
tone: resolved.tone,
|
|
499
|
-
glow
|
|
500
|
-
}), className),
|
|
501
|
-
...props
|
|
502
|
-
});
|
|
503
|
-
});
|
|
504
|
-
ColorfulBadge.displayName = "ColorfulBadge";
|
|
505
|
-
/**
|
|
506
|
-
* Trailing remove affordance for a removable `ColorfulBadge`. Inspired by the
|
|
507
|
-
* ds `ComboboxChip` remove button: a ghost icon button that inherits the
|
|
508
|
-
* badge's text color and brightens on hover. Pass an `aria-label` and an
|
|
509
|
-
* `onClick`. Compose it as the last child of a `ColorfulBadge`.
|
|
510
|
-
*/
|
|
511
|
-
const ColorfulBadgeRemove = React.forwardRef(({ className, ...props }, ref) => {
|
|
512
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
513
|
-
ref,
|
|
514
|
-
type: "button",
|
|
515
|
-
variant: "ghost",
|
|
516
|
-
size: "icon-sm",
|
|
517
|
-
"data-slot": "colorful-badge-remove",
|
|
518
|
-
className: cn("-mr-1.5 size-5 rounded-full text-inherit opacity-70 hover:bg-transparent! hover:text-inherit! hover:opacity-100!", className),
|
|
266
|
+
className: cn(roleBadgeVariants({ role }), className),
|
|
519
267
|
...props,
|
|
520
|
-
children:
|
|
268
|
+
children: ROLE_BADGE_LABEL[role]
|
|
521
269
|
});
|
|
522
|
-
});
|
|
523
|
-
ColorfulBadgeRemove.displayName = "ColorfulBadgeRemove";
|
|
524
|
-
const LEGACY_TAG_COLOR_MAP = {
|
|
525
|
-
"#003d4b": {
|
|
526
|
-
color: "charcoal",
|
|
527
|
-
tone: "dark"
|
|
528
|
-
},
|
|
529
|
-
"#bb2001": {
|
|
530
|
-
color: "red",
|
|
531
|
-
tone: "dark"
|
|
532
|
-
},
|
|
533
|
-
"#f92c00": {
|
|
534
|
-
color: "red",
|
|
535
|
-
tone: "medium-dark"
|
|
536
|
-
},
|
|
537
|
-
"#0761b5": {
|
|
538
|
-
color: "blue",
|
|
539
|
-
tone: "dark"
|
|
540
|
-
},
|
|
541
|
-
"#008f6c": {
|
|
542
|
-
color: "green",
|
|
543
|
-
tone: "medium-dark"
|
|
544
|
-
},
|
|
545
|
-
"#b285d1": {
|
|
546
|
-
color: "purple",
|
|
547
|
-
tone: "medium-light"
|
|
548
|
-
},
|
|
549
|
-
"#fcbb26": {
|
|
550
|
-
color: "yellow",
|
|
551
|
-
tone: "medium-light"
|
|
552
|
-
},
|
|
553
|
-
"#fe9d88": {
|
|
554
|
-
color: "red",
|
|
555
|
-
tone: "light"
|
|
556
|
-
},
|
|
557
|
-
"#ff844c": {
|
|
558
|
-
color: "red",
|
|
559
|
-
tone: "medium-light"
|
|
560
|
-
},
|
|
561
|
-
"#abccf2": {
|
|
562
|
-
color: "blue",
|
|
563
|
-
tone: "light"
|
|
564
|
-
},
|
|
565
|
-
"#49a0ff": {
|
|
566
|
-
color: "blue",
|
|
567
|
-
tone: "medium-light"
|
|
568
|
-
},
|
|
569
|
-
"#66d188": {
|
|
570
|
-
color: "green",
|
|
571
|
-
tone: "medium-light"
|
|
572
|
-
},
|
|
573
|
-
"#2ac8ff": {
|
|
574
|
-
color: "blue",
|
|
575
|
-
tone: "medium-dark"
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
/** Charcoal/dark — used when a stored hex is outside the known legacy palette. */
|
|
579
|
-
const FALLBACK_TAG_COLOR = {
|
|
580
|
-
color: "charcoal",
|
|
581
|
-
tone: "dark"
|
|
582
|
-
};
|
|
583
|
-
/** Resolve a legacy hard-coded tag hex to `color` + `tone`; unknown → charcoal/dark. */
|
|
584
|
-
function resolveTagColor(hex) {
|
|
585
|
-
return LEGACY_TAG_COLOR_MAP[hex.trim().toLowerCase()] ?? FALLBACK_TAG_COLOR;
|
|
586
270
|
}
|
|
587
271
|
|
|
588
272
|
//#endregion
|
|
@@ -679,7 +363,7 @@ function DashboardSidebarMenuItem({ className, ...props }) {
|
|
|
679
363
|
const DashboardSidebarMenuButton = React.forwardRef(function DashboardSidebarMenuButton({ className, render, isActive = false, disabled = false, icon, action, children, ...props }, ref) {
|
|
680
364
|
const buttonContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
681
365
|
icon && /* @__PURE__ */ jsx("span", {
|
|
682
|
-
className: cn("size-6 rounded-full bg-
|
|
366
|
+
className: cn("size-6 rounded-full bg-background text-foreground flex items-center justify-center shrink-0 overflow-hidden", "[&>svg]:size-4 [&>svg]:shrink-0"),
|
|
683
367
|
children: icon
|
|
684
368
|
}),
|
|
685
369
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -841,4 +525,4 @@ function DashboardSidebarNav({ groups, renderLink }) {
|
|
|
841
525
|
}
|
|
842
526
|
|
|
843
527
|
//#endregion
|
|
844
|
-
export { BetaBadge,
|
|
528
|
+
export { BetaBadge, CopyButton, CopyButtonIcon, CopyButtonLabel, DashboardPage, DashboardPageBanner, DashboardPageContent, DashboardPageHeader, DashboardPageHeaderAction, DashboardPageHeaderActions, DashboardPageHeaderDescription, DashboardPageHeaderNav, DashboardPageHeaderNavBack, DashboardPageHeaderPrefix, DashboardPageHeaderSubtitle, DashboardPageHeaderTitle, DashboardPageHeaderTitleGroup, DashboardPageMain, DashboardPageTabs, DashboardSidebar, DashboardSidebarContent, DashboardSidebarFooter, DashboardSidebarGroup, DashboardSidebarGroupLabel, DashboardSidebarHeader, DashboardSidebarMenu, DashboardSidebarMenuBadge, DashboardSidebarMenuButton, DashboardSidebarMenuItem, DashboardSidebarNav, DashboardSidebarProvider, DashboardSidebarSubmenu, DashboardSidebarSubmenuItem, DashboardSidebarSubmenuSeparator, DashboardSidebarTrigger, DeprecatedBadge, NewBadge, ProfessionalBadge, RoleBadge, TrialBadge, useCopyToClipboard, useSidebar as useDashboardSidebar };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aircall/blocks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": [
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"typescript": "5.9.3",
|
|
68
68
|
"vite": "7.3.1",
|
|
69
69
|
"vitest": "4.0.17",
|
|
70
|
-
"@aircall/ds": "0.
|
|
70
|
+
"@aircall/ds": "0.10.0",
|
|
71
71
|
"@aircall/hooks": "0.5.1"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|