@aircall/blocks 0.2.1

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.
@@ -0,0 +1,350 @@
1
+ import * as React from "react";
2
+ import { Badge, Button, CounterBadge, SidebarProvider, TabsList, useSidebar } from "@aircall/ds";
3
+ import * as react_jsx_runtime23 from "react/jsx-runtime";
4
+ import { useRender } from "@base-ui/react/use-render";
5
+
6
+ //#region src/components/copy-button.d.ts
7
+ type CopyButtonProps = Omit<React.ComponentProps<typeof Button>, 'onClick' | 'variant'> & {
8
+ value: string;
9
+ timeout?: number;
10
+ onCopied?: () => void; /** Visual style of the underlying Button. Limited to non-primary variants suitable for copy actions. */
11
+ variant?: 'outline' | 'ghost';
12
+ };
13
+ declare function CopyButton({
14
+ value,
15
+ timeout,
16
+ onCopied,
17
+ variant,
18
+ children,
19
+ ...buttonProps
20
+ }: CopyButtonProps): react_jsx_runtime23.JSX.Element;
21
+ interface CopyButtonIconProps {
22
+ className?: string;
23
+ }
24
+ declare function CopyButtonIcon({
25
+ className
26
+ }: CopyButtonIconProps): react_jsx_runtime23.JSX.Element;
27
+ interface CopyButtonLabelProps {
28
+ label?: string;
29
+ copiedLabel?: string;
30
+ className?: string;
31
+ }
32
+ declare function CopyButtonLabel({
33
+ label,
34
+ copiedLabel,
35
+ className
36
+ }: CopyButtonLabelProps): react_jsx_runtime23.JSX.Element;
37
+ //#endregion
38
+ //#region src/components/dashboard-page.d.ts
39
+ declare function DashboardPage({
40
+ className,
41
+ ...props
42
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
43
+ declare function DashboardPageBanner({
44
+ className,
45
+ ...props
46
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
47
+ declare function DashboardPageContent({
48
+ className,
49
+ ...props
50
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
51
+ declare function DashboardPageMain({
52
+ className,
53
+ ...props
54
+ }: React.ComponentProps<'main'>): react_jsx_runtime23.JSX.Element;
55
+ declare function DashboardPageTabs({
56
+ className,
57
+ ...props
58
+ }: React.ComponentProps<typeof TabsList>): react_jsx_runtime23.JSX.Element;
59
+ //#endregion
60
+ //#region src/components/dashboard-page-header.d.ts
61
+ declare function DashboardPageHeader({
62
+ className,
63
+ children,
64
+ ...props
65
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
66
+ declare function DashboardPageHeaderNav({
67
+ className,
68
+ children,
69
+ ...props
70
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
71
+ type DashboardPageHeaderNavBackProps = Omit<React.ComponentProps<typeof Button>, 'variant' | 'size'>;
72
+ declare function DashboardPageHeaderNavBack({
73
+ children,
74
+ ...props
75
+ }: DashboardPageHeaderNavBackProps): react_jsx_runtime23.JSX.Element;
76
+ declare function DashboardPageHeaderPrefix({
77
+ className,
78
+ children,
79
+ ...props
80
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
81
+ declare function DashboardPageHeaderTitleGroup({
82
+ className,
83
+ children,
84
+ ...props
85
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
86
+ type DashboardPageHeaderTitleProps = React.ComponentProps<'h1'> & {
87
+ size?: 'lg' | 'sm';
88
+ };
89
+ declare function DashboardPageHeaderTitle({
90
+ size,
91
+ className,
92
+ children,
93
+ ...props
94
+ }: DashboardPageHeaderTitleProps): react_jsx_runtime23.JSX.Element;
95
+ declare function DashboardPageHeaderSubtitle({
96
+ className,
97
+ children,
98
+ ...props
99
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
100
+ declare function DashboardPageHeaderDescription({
101
+ className,
102
+ children,
103
+ ...props
104
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
105
+ declare function DashboardPageHeaderActions({
106
+ className,
107
+ children,
108
+ ...props
109
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
110
+ type DashboardPageHeaderActionProps = Omit<React.ComponentProps<typeof Button>, 'size'> & {
111
+ size?: 'lg' | 'icon-lg';
112
+ };
113
+ declare const DashboardPageHeaderAction: React.ForwardRefExoticComponent<Omit<DashboardPageHeaderActionProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
114
+ //#endregion
115
+ //#region src/components/product-badges.d.ts
116
+ type BadgeBaseProps = Omit<React.ComponentProps<typeof Badge>, 'variant' | 'children'>;
117
+ /** Blue pill — feature in beta, not yet GA */
118
+ declare const BetaBadge: {
119
+ ({
120
+ className,
121
+ ...props
122
+ }: BadgeBaseProps): react_jsx_runtime23.JSX.Element;
123
+ displayName: string;
124
+ };
125
+ /** Green pill — recently launched feature */
126
+ declare const NewBadge: {
127
+ ({
128
+ className,
129
+ ...props
130
+ }: BadgeBaseProps): react_jsx_runtime23.JSX.Element;
131
+ displayName: string;
132
+ };
133
+ /** Amber pill — feature being phased out */
134
+ declare const DeprecatedBadge: {
135
+ ({
136
+ className,
137
+ ...props
138
+ }: BadgeBaseProps): react_jsx_runtime23.JSX.Element;
139
+ displayName: string;
140
+ };
141
+ /** Blue pill — user is in a trial period (same blue family as Beta) */
142
+ declare const TrialBadge: {
143
+ ({
144
+ className,
145
+ ...props
146
+ }: BadgeBaseProps): react_jsx_runtime23.JSX.Element;
147
+ displayName: string;
148
+ };
149
+ /** Green pill — Professional tier (no gradient; uses default Badge variant) */
150
+ declare function ProfessionalBadge({
151
+ className,
152
+ ...props
153
+ }: BadgeBaseProps): react_jsx_runtime23.JSX.Element;
154
+ type RoleBadgeRole = 'agent' | 'supervisor' | 'admin' | 'owner';
155
+ type RoleBadgeProps = BadgeBaseProps & {
156
+ /** The user's role within Aircall. */role: RoleBadgeRole;
157
+ };
158
+ declare function RoleBadge({
159
+ role,
160
+ className,
161
+ ...props
162
+ }: RoleBadgeProps): react_jsx_runtime23.JSX.Element;
163
+ //#endregion
164
+ //#region src/hooks/use-copy-to-clipboard.d.ts
165
+ interface UseCopyToClipboardOptions {
166
+ timeout?: number;
167
+ onCopied?: () => void;
168
+ }
169
+ declare function useCopyToClipboard(value: string, {
170
+ timeout,
171
+ onCopied
172
+ }?: UseCopyToClipboardOptions): {
173
+ copy: () => Promise<void>;
174
+ copied: boolean;
175
+ };
176
+ //#endregion
177
+ //#region src/components/dashboard-sidebar-nav.d.ts
178
+ type DashboardSidebarNavSubmenuSeparator = {
179
+ kind: 'separator';
180
+ };
181
+ /** Section heading inside a dropdown submenu. */
182
+ type DashboardSidebarNavSubmenuGroupLabel = {
183
+ kind: 'label';
184
+ label: string;
185
+ };
186
+ type DashboardSidebarNavSubmenuLink = {
187
+ kind?: 'link';
188
+ label: string;
189
+ href?: string;
190
+ isActive?: boolean; /** Trailing badge — rendered inside <DropdownMenuAddon>. */
191
+ badge?: React.ReactNode;
192
+ };
193
+ type DashboardSidebarNavSubmenuItem = DashboardSidebarNavSubmenuLink | DashboardSidebarNavSubmenuSeparator | DashboardSidebarNavSubmenuGroupLabel;
194
+ type DashboardSidebarNavItemBase = {
195
+ /** Stable key. */id: string;
196
+ label: string; /** Leading icon (required). */
197
+ icon: React.ReactNode;
198
+ isActive?: boolean;
199
+ /**
200
+ * Mutes the item visually (opacity, no hover) without removing interactivity.
201
+ * Use for upsell items that still need a tooltip or dropdown.
202
+ */
203
+ disabled?: boolean;
204
+ /**
205
+ * Trailing badge (<ProfessionalBadge />, <BetaBadge />, etc.).
206
+ * Rendered inside <DashboardSidebarMenuAddon>. Hidden when collapsed.
207
+ */
208
+ badge?: React.ReactNode;
209
+ /**
210
+ * Right-side action icon.
211
+ * - Active submenu items default to <ChevronRight />.
212
+ * - Disabled submenu items default to nothing — pass e.g. <LockKeyhole /> explicitly.
213
+ */
214
+ action?: React.ReactNode;
215
+ /**
216
+ * Tooltip shown on hover. When set, wraps the button in a Tooltip.
217
+ * Pairs naturally with disabled + a lock action icon.
218
+ * Requires <TooltipProvider> in the tree (the DashboardSidebar stories decorator provides one).
219
+ */
220
+ tooltip?: React.ReactNode;
221
+ };
222
+ /** Navigates on click. Renders as <a> (or custom element via `renderLink`). */
223
+ type DashboardSidebarNavItemLink = DashboardSidebarNavItemBase & {
224
+ kind: 'link';
225
+ href: string; /** Count rendered as <DashboardSidebarMenuBadge>. Repositions when collapsed. */
226
+ count?: number;
227
+ };
228
+ /** Opens a dropdown submenu (sidebar-06 pattern). */
229
+ type DashboardSidebarNavItemSubmenu = DashboardSidebarNavItemBase & {
230
+ kind: 'submenu';
231
+ items: DashboardSidebarNavSubmenuItem[];
232
+ };
233
+ /** Fires a callback — e.g. opens a modal or command palette. */
234
+ type DashboardSidebarNavItemAction = DashboardSidebarNavItemBase & {
235
+ kind: 'action';
236
+ onClick: () => void;
237
+ count?: number;
238
+ };
239
+ type DashboardSidebarNavItem = DashboardSidebarNavItemLink | DashboardSidebarNavItemSubmenu | DashboardSidebarNavItemAction;
240
+ type DashboardSidebarNavGroup = {
241
+ id: string;
242
+ label?: string;
243
+ items: DashboardSidebarNavItem[];
244
+ };
245
+ type DashboardSidebarNavProps = {
246
+ groups: DashboardSidebarNavGroup[];
247
+ /**
248
+ * Custom link renderer — integrates with React Router, Next.js, etc.
249
+ * The returned element is passed to DashboardSidebarMenuButton's `render` prop.
250
+ *
251
+ * @example
252
+ * renderLink={(href) => <Link to={href} />}
253
+ */
254
+ renderLink?: (href: string) => React.ReactElement;
255
+ };
256
+ declare function DashboardSidebarNav({
257
+ groups,
258
+ renderLink
259
+ }: DashboardSidebarNavProps): react_jsx_runtime23.JSX.Element;
260
+ //#endregion
261
+ //#region src/components/dashboard-sidebar.d.ts
262
+ type DashboardSidebarProviderProps = React.ComponentProps<typeof SidebarProvider>;
263
+ declare function DashboardSidebarProvider({
264
+ className,
265
+ style,
266
+ ...props
267
+ }: DashboardSidebarProviderProps): react_jsx_runtime23.JSX.Element;
268
+ declare function DashboardSidebar({
269
+ className,
270
+ children,
271
+ ...props
272
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
273
+ declare function DashboardSidebarHeader({
274
+ className,
275
+ children,
276
+ ...props
277
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
278
+ declare function DashboardSidebarTrigger({
279
+ className,
280
+ onClick,
281
+ ...props
282
+ }: React.ComponentProps<typeof Button>): react_jsx_runtime23.JSX.Element;
283
+ declare function DashboardSidebarContent({
284
+ className,
285
+ ...props
286
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
287
+ declare function DashboardSidebarFooter({
288
+ className,
289
+ ...props
290
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
291
+ declare function DashboardSidebarGroup({
292
+ className,
293
+ ...props
294
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
295
+ declare function DashboardSidebarGroupLabel({
296
+ className,
297
+ render,
298
+ ...props
299
+ }: useRender.ComponentProps<'div'> & React.ComponentProps<'div'>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
300
+ declare function DashboardSidebarMenu({
301
+ className,
302
+ ...props
303
+ }: React.ComponentProps<'ul'>): react_jsx_runtime23.JSX.Element;
304
+ declare function DashboardSidebarMenuItem({
305
+ className,
306
+ ...props
307
+ }: React.ComponentProps<'li'>): react_jsx_runtime23.JSX.Element;
308
+ type DashboardSidebarMenuButtonProps = useRender.ComponentProps<'button'> & React.ComponentProps<'button'> & {
309
+ isActive?: boolean;
310
+ /** Visual-only disabled state. The button remains clickable (e.g. to show an
311
+ * upgrade dialog). Does NOT forward to the HTML disabled attribute. */
312
+ disabled?: boolean;
313
+ icon?: React.ReactNode;
314
+ /**
315
+ * Trailing "addon" rendered after the label span — mirrors the InputGroup
316
+ * right-addon pattern. Typically a chevron, lock, or similar icon.
317
+ * Hidden automatically when the sidebar is collapsed.
318
+ *
319
+ * @example
320
+ * <DashboardSidebarMenuButton icon={<Bot />} action={<ChevronRight />}>
321
+ * AI Agents
322
+ * </DashboardSidebarMenuButton>
323
+ */
324
+ action?: React.ReactNode;
325
+ };
326
+ declare const DashboardSidebarMenuButton: React.ForwardRefExoticComponent<Omit<DashboardSidebarMenuButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
327
+ declare function DashboardSidebarMenuBadge({
328
+ className,
329
+ ...props
330
+ }: React.ComponentProps<typeof CounterBadge>): react_jsx_runtime23.JSX.Element;
331
+ declare function DashboardSidebarSubmenu({
332
+ className,
333
+ ...props
334
+ }: React.ComponentProps<'div'>): react_jsx_runtime23.JSX.Element;
335
+ type DashboardSidebarSubmenuItemProps = useRender.ComponentProps<'div'> & React.ComponentProps<'div'> & {
336
+ isActive?: boolean;
337
+ };
338
+ declare function DashboardSidebarSubmenuItem({
339
+ className,
340
+ render,
341
+ isActive,
342
+ ...props
343
+ }: DashboardSidebarSubmenuItemProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
344
+ declare function DashboardSidebarSubmenuSeparator({
345
+ className
346
+ }: {
347
+ className?: string;
348
+ }): react_jsx_runtime23.JSX.Element;
349
+ //#endregion
350
+ 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, type DashboardSidebarNavGroup, type DashboardSidebarNavItem, type DashboardSidebarNavItemAction, type DashboardSidebarNavItemLink, type DashboardSidebarNavItemSubmenu, type DashboardSidebarNavProps, type DashboardSidebarNavSubmenuItem, DashboardSidebarProvider, DashboardSidebarSubmenu, DashboardSidebarSubmenuItem, DashboardSidebarSubmenuSeparator, DashboardSidebarTrigger, DeprecatedBadge, NewBadge, ProfessionalBadge, RoleBadge, type RoleBadgeRole, TrialBadge, useCopyToClipboard, useSidebar as useDashboardSidebar };