@aircall/ds 0.2.3 → 0.2.4
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 +213 -231
- package/dist/index.js +53 -80
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -22,9 +22,10 @@ import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
|
22
22
|
import { ThemeProvider as ThemeProvider$1, useTheme, useTheme as useTheme$1 } from "next-themes";
|
|
23
23
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
24
24
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
25
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
|
26
|
+
import { CircleIcon, Loader2Icon, MinusIcon, OctagonXIcon, PanelLeftIcon, TriangleAlertIcon } from "lucide-react";
|
|
25
27
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
26
28
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
27
|
-
import { CircleIcon, Loader2Icon, OctagonXIcon, PanelLeftIcon, TriangleAlertIcon } from "lucide-react";
|
|
28
29
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
29
30
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
30
31
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
@@ -635,66 +636,6 @@ function capitalizeFirstLetter(val) {
|
|
|
635
636
|
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
|
|
636
637
|
}
|
|
637
638
|
|
|
638
|
-
//#endregion
|
|
639
|
-
//#region src/components/dock.tsx
|
|
640
|
-
const Dock = React$1.forwardRef(({ items, activeItem, onItemClick, variant = "default", size = "md", orientation = "horizontal", className, ...props }, ref) => {
|
|
641
|
-
const isHorizontal = orientation === "horizontal";
|
|
642
|
-
const dockVariants = {
|
|
643
|
-
default: "bg-background/70 backdrop-blur-xl border border-border/20 shadow-2xl",
|
|
644
|
-
floating: "bg-background/80 backdrop-blur-xl border border-border/10 shadow-2xl rounded-xl",
|
|
645
|
-
minimal: "bg-transparent"
|
|
646
|
-
};
|
|
647
|
-
const sizeClasses = {
|
|
648
|
-
sm: isHorizontal ? "h-14 px-3" : "w-14 py-3",
|
|
649
|
-
md: isHorizontal ? "h-16 px-4" : "w-16 py-4",
|
|
650
|
-
lg: isHorizontal ? "h-18 px-5" : "w-18 py-5"
|
|
651
|
-
};
|
|
652
|
-
const itemSizeClasses = {
|
|
653
|
-
sm: "p-2.5 min-w-[48px] min-h-[48px]",
|
|
654
|
-
md: "p-3 min-w-[56px] min-h-[56px]",
|
|
655
|
-
lg: "p-4 min-w-[64px] min-h-[64px]"
|
|
656
|
-
};
|
|
657
|
-
const handleItemClick = (item) => {
|
|
658
|
-
if (item.disabled) return;
|
|
659
|
-
if (item.onClick) item.onClick();
|
|
660
|
-
if (onItemClick) onItemClick(item.id, item);
|
|
661
|
-
};
|
|
662
|
-
return /* @__PURE__ */ jsx("div", {
|
|
663
|
-
ref,
|
|
664
|
-
className: cn("flex items-center justify-center", dockVariants[variant], sizeClasses[size], isHorizontal ? "flex-row gap-1.5" : "flex-col gap-1.5", className),
|
|
665
|
-
...props,
|
|
666
|
-
children: items.map((item) => {
|
|
667
|
-
const isActive = activeItem === item.id || item.isActive;
|
|
668
|
-
return /* @__PURE__ */ jsxs("button", {
|
|
669
|
-
onClick: () => handleItemClick(item),
|
|
670
|
-
disabled: item.disabled,
|
|
671
|
-
className: cn("relative flex flex-col items-center justify-center", "transition-all duration-300 ease-out", "rounded-lg group", itemSizeClasses[size], "hover:bg-accent/60 hover:text-accent-foreground", "focus:outline-none focus:ring-2 focus:ring-ring/50 focus:ring-offset-1", "disabled:opacity-40 disabled:cursor-not-allowed", "active:scale-95", isActive && [
|
|
672
|
-
"bg-primary/90 text-primary-foreground",
|
|
673
|
-
"hover:bg-primary hover:text-primary-foreground",
|
|
674
|
-
"shadow-lg scale-105"
|
|
675
|
-
], !isActive && ["text-muted-foreground/80", "hover:text-foreground hover:scale-105"]),
|
|
676
|
-
title: item.label,
|
|
677
|
-
children: [
|
|
678
|
-
item.icon && /* @__PURE__ */ jsx("div", {
|
|
679
|
-
className: cn("transition-all duration-300 ease-out", "group-hover:scale-110 group-hover:-translate-y-0.5", isActive && "scale-110 -translate-y-0.5", size === "sm" ? "mb-1" : "mb-1.5"),
|
|
680
|
-
children: item.icon
|
|
681
|
-
}),
|
|
682
|
-
/* @__PURE__ */ jsx("span", {
|
|
683
|
-
className: cn("font-medium transition-all duration-300 ease-out", "group-hover:opacity-100", size === "sm" ? "text-xs" : size === "md" ? "text-xs" : "text-sm", isHorizontal && size === "sm" && "sr-only", isActive ? "opacity-100" : "opacity-80"),
|
|
684
|
-
children: item.label
|
|
685
|
-
}),
|
|
686
|
-
item.badge !== void 0 && item.badge > 0 && /* @__PURE__ */ jsx("div", {
|
|
687
|
-
className: cn("absolute -top-1.5 -right-1.5", "flex items-center justify-center", "min-w-5 h-5 px-1.5", "bg-destructive text-destructive-foreground text-xs font-semibold", "rounded-full border-2 border-background/80 backdrop-blur-sm", "shadow-lg animate-pulse", "transition-transform duration-200 ease-out", "group-hover:scale-110"),
|
|
688
|
-
children: item.badge > 99 ? "99+" : item.badge
|
|
689
|
-
}),
|
|
690
|
-
isActive && /* @__PURE__ */ jsx("div", { className: cn("absolute", isHorizontal ? "-bottom-2 left-1/2 -translate-x-1/2 w-8 h-1" : "-right-2 top-1/2 -translate-y-1/2 h-8 w-1", "bg-primary rounded-full shadow-sm", "animate-in fade-in-0 slide-in-from-bottom-2 duration-300") })
|
|
691
|
-
]
|
|
692
|
-
}, item.id);
|
|
693
|
-
})
|
|
694
|
-
});
|
|
695
|
-
});
|
|
696
|
-
Dock.displayName = "Dock";
|
|
697
|
-
|
|
698
639
|
//#endregion
|
|
699
640
|
//#region src/components/drawer.tsx
|
|
700
641
|
function Drawer({ ...props }) {
|
|
@@ -1314,6 +1255,45 @@ function InputGroupTextarea({ className, ...props }) {
|
|
|
1314
1255
|
});
|
|
1315
1256
|
}
|
|
1316
1257
|
|
|
1258
|
+
//#endregion
|
|
1259
|
+
//#region src/components/input-otp.tsx
|
|
1260
|
+
function InputOTP({ className, containerClassName, ...props }) {
|
|
1261
|
+
return /* @__PURE__ */ jsx(OTPInput, {
|
|
1262
|
+
"data-slot": "input-otp",
|
|
1263
|
+
containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
|
|
1264
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
1265
|
+
...props
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
function InputOTPGroup({ className, ...props }) {
|
|
1269
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1270
|
+
"data-slot": "input-otp-group",
|
|
1271
|
+
className: cn("flex items-center", className),
|
|
1272
|
+
...props
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
function InputOTPSlot({ index, className, ...props }) {
|
|
1276
|
+
const { char, hasFakeCaret, isActive } = React$1.useContext(OTPInputContext)?.slots[index] ?? {};
|
|
1277
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1278
|
+
"data-slot": "input-otp-slot",
|
|
1279
|
+
"data-active": isActive,
|
|
1280
|
+
className: cn("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", className),
|
|
1281
|
+
...props,
|
|
1282
|
+
children: [char, hasFakeCaret && /* @__PURE__ */ jsx("div", {
|
|
1283
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
1284
|
+
children: /* @__PURE__ */ jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" })
|
|
1285
|
+
})]
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
function InputOTPSeparator({ ...props }) {
|
|
1289
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1290
|
+
"data-slot": "input-otp-separator",
|
|
1291
|
+
role: "separator",
|
|
1292
|
+
...props,
|
|
1293
|
+
children: /* @__PURE__ */ jsx(MinusIcon, {})
|
|
1294
|
+
});
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1317
1297
|
//#endregion
|
|
1318
1298
|
//#region src/components/item.tsx
|
|
1319
1299
|
const ItemGroup = React$1.forwardRef(({ className, stackedItems = false, ...props }, ref) => {
|
|
@@ -2010,10 +1990,11 @@ const sidebarMenuButtonVariants = cva("peer/menu-button flex w-full items-center
|
|
|
2010
1990
|
size: "default"
|
|
2011
1991
|
}
|
|
2012
1992
|
});
|
|
2013
|
-
|
|
1993
|
+
const SidebarMenuButton = React$1.forwardRef(({ asChild = false, isActive = false, variant = "default", size = "default", tooltip, className, ...props }, ref) => {
|
|
2014
1994
|
const Comp = asChild ? Slot$1 : "button";
|
|
2015
1995
|
const { isMobile, state } = useSidebar();
|
|
2016
1996
|
const button = /* @__PURE__ */ jsx(Comp, {
|
|
1997
|
+
ref,
|
|
2017
1998
|
"data-slot": "sidebar-menu-button",
|
|
2018
1999
|
"data-sidebar": "menu-button",
|
|
2019
2000
|
"data-size": size,
|
|
@@ -2025,7 +2006,8 @@ function SidebarMenuButton({ asChild = false, isActive = false, variant = "defau
|
|
|
2025
2006
|
...props
|
|
2026
2007
|
});
|
|
2027
2008
|
if (!tooltip) return button;
|
|
2028
|
-
|
|
2009
|
+
let tooltipProps = tooltip;
|
|
2010
|
+
if (typeof tooltipProps === "string") tooltipProps = { children: tooltipProps };
|
|
2029
2011
|
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
2030
2012
|
asChild: true,
|
|
2031
2013
|
children: button
|
|
@@ -2033,19 +2015,22 @@ function SidebarMenuButton({ asChild = false, isActive = false, variant = "defau
|
|
|
2033
2015
|
side: "right",
|
|
2034
2016
|
align: "center",
|
|
2035
2017
|
hidden: state !== "collapsed" || isMobile,
|
|
2036
|
-
...
|
|
2018
|
+
...tooltipProps
|
|
2037
2019
|
})] });
|
|
2038
|
-
}
|
|
2039
|
-
|
|
2020
|
+
});
|
|
2021
|
+
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
2022
|
+
const SidebarMenuAction = React$1.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
2040
2023
|
const Comp = asChild ? Slot$1 : "button";
|
|
2041
2024
|
const { isMobile } = useSidebar();
|
|
2042
2025
|
return /* @__PURE__ */ jsx(Comp, {
|
|
2026
|
+
ref,
|
|
2043
2027
|
"data-slot": "sidebar-menu-action",
|
|
2044
2028
|
"data-sidebar": "menu-action",
|
|
2045
2029
|
className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "after:absolute after:-inset-2", isMobile && "md:after:hidden", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", showOnHover && cn("peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100", isMobile ? "md:opacity-0" : "opacity-0"), className),
|
|
2046
2030
|
...props
|
|
2047
2031
|
});
|
|
2048
|
-
}
|
|
2032
|
+
});
|
|
2033
|
+
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
2049
2034
|
function SidebarMenuBadge({ className, ...props }) {
|
|
2050
2035
|
return /* @__PURE__ */ jsx("div", {
|
|
2051
2036
|
"data-slot": "sidebar-menu-badge",
|
|
@@ -2188,18 +2173,6 @@ function Spinner({ className, size, ...props }) {
|
|
|
2188
2173
|
});
|
|
2189
2174
|
}
|
|
2190
2175
|
|
|
2191
|
-
//#endregion
|
|
2192
|
-
//#region src/components/split-button.tsx
|
|
2193
|
-
const SplitButton = React$1.forwardRef(({ children, className }, ref) => {
|
|
2194
|
-
return /* @__PURE__ */ jsx("div", {
|
|
2195
|
-
ref,
|
|
2196
|
-
className: cn("inline-flex", "[&>*:first-child]:rounded-r-none", "[&>*:not(:first-child):not(:last-child)]:rounded-none", "[&>*:last-child]:rounded-l-none", "[&>*:not(:last-child)]:border-r [&>*:not(:last-child)]:border-r-border", className),
|
|
2197
|
-
role: "group",
|
|
2198
|
-
children
|
|
2199
|
-
});
|
|
2200
|
-
});
|
|
2201
|
-
SplitButton.displayName = "SplitButton";
|
|
2202
|
-
|
|
2203
2176
|
//#endregion
|
|
2204
2177
|
//#region src/components/switch.tsx
|
|
2205
2178
|
function Switch({ className, ...props }) {
|
|
@@ -2335,4 +2308,4 @@ function ToggleGroupItem({ className, children, variant, size, ...props }) {
|
|
|
2335
2308
|
}
|
|
2336
2309
|
|
|
2337
2310
|
//#endregion
|
|
2338
|
-
export { Alert, AlertAction, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CountryFlag, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger,
|
|
2311
|
+
export { Alert, AlertAction, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CountryFlag, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmojiPicker, EmojiPickerCategories, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Label, List, ListCol, ListRow, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Slot, Spinner, Switch, TabBar, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonGroupVariants, buttonVariants, cn, spinnerVariants, toast, toggleVariants, useSidebar, useTheme };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aircall/ds",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": [
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"cmdk": "1.1.1",
|
|
58
58
|
"embla-carousel-react": "8.6.0",
|
|
59
59
|
"emoji-picker-react": "4.4.9",
|
|
60
|
+
"input-otp": "1.4.2",
|
|
60
61
|
"lucide-react": "0.562.0",
|
|
61
62
|
"next-themes": "0.4.6",
|
|
62
63
|
"sonner": "2.0.3",
|
|
@@ -83,8 +84,8 @@
|
|
|
83
84
|
"@types/node": "24",
|
|
84
85
|
"@types/react": "19",
|
|
85
86
|
"@types/react-dom": "19",
|
|
86
|
-
"@vitest/browser-playwright": "4.0.
|
|
87
|
-
"@vitest/coverage-v8": "4.0.
|
|
87
|
+
"@vitest/browser-playwright": "4.0.17",
|
|
88
|
+
"@vitest/coverage-v8": "4.0.17",
|
|
88
89
|
"chromatic": "13.3.4",
|
|
89
90
|
"playwright": "1.57.0",
|
|
90
91
|
"react": "19.2.3",
|
|
@@ -95,8 +96,8 @@
|
|
|
95
96
|
"tailwindcss": "4.1.18",
|
|
96
97
|
"tsdown": "0.20.0-beta.3",
|
|
97
98
|
"typescript": "5.9.3",
|
|
98
|
-
"vite": "
|
|
99
|
-
"vitest": "4.0.
|
|
99
|
+
"vite": "7.3.1",
|
|
100
|
+
"vitest": "4.0.17"
|
|
100
101
|
},
|
|
101
102
|
"scripts": {
|
|
102
103
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|