@aircall/ds 0.17.0 → 0.17.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.
- package/dist/globals.css +1 -1
- package/dist/index.d.ts +38 -36
- package/dist/index.js +17 -21
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ import { Switch as Switch$1 } from "@base-ui/react/switch";
|
|
|
40
40
|
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
41
41
|
import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
|
|
42
42
|
import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
|
|
43
|
-
import * as
|
|
43
|
+
import * as class_variance_authority_types3 from "class-variance-authority/types";
|
|
44
44
|
import { CountryCode } from "@aircall/numbers";
|
|
45
45
|
|
|
46
46
|
//#region src/components/accordion.d.ts
|
|
@@ -70,7 +70,7 @@ declare const buttonVariants: (props?: ({
|
|
|
70
70
|
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
71
71
|
size?: "default" | "icon" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
|
|
72
72
|
block?: boolean | null | undefined;
|
|
73
|
-
} &
|
|
73
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
74
74
|
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
75
75
|
interface ButtonProps extends Button$1.Props, VariantProps<typeof buttonVariants> {
|
|
76
76
|
children?: React.ReactNode;
|
|
@@ -192,7 +192,7 @@ declare namespace AlertDialogCancel {
|
|
|
192
192
|
//#region src/components/alert.d.ts
|
|
193
193
|
declare const alertVariants: (props?: ({
|
|
194
194
|
variant?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
|
|
195
|
-
} &
|
|
195
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
196
196
|
declare const Alert: React.ForwardRefExoticComponent<Omit<AlertProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
197
197
|
interface AlertProps extends React.ComponentProps<'div'>, VariantProps<typeof alertVariants> {}
|
|
198
198
|
declare namespace Alert {
|
|
@@ -251,7 +251,7 @@ declare namespace AvatarGroupCount {
|
|
|
251
251
|
//#region src/components/counter-badge.d.ts
|
|
252
252
|
declare const counterBadgeVariants: (props?: ({
|
|
253
253
|
variant?: "default" | "secondary" | "ghost" | null | undefined;
|
|
254
|
-
} &
|
|
254
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
255
255
|
declare const CounterBadge: React.ForwardRefExoticComponent<Omit<CounterBadgeProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
256
256
|
type CounterBadgeProps = useRender.ComponentProps<'span'> & VariantProps<typeof counterBadgeVariants>;
|
|
257
257
|
declare namespace CounterBadge {
|
|
@@ -263,7 +263,7 @@ declare const badgeVariants: (props?: ({
|
|
|
263
263
|
size?: "default" | "lg" | null | undefined;
|
|
264
264
|
color?: "blue" | "green" | "pink" | "purple" | "red" | "yellow" | "charcoal" | null | undefined;
|
|
265
265
|
tone?: "dark" | "light" | "medium-dark" | "medium-light" | null | undefined;
|
|
266
|
-
} &
|
|
266
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
267
267
|
type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
268
268
|
type BadgeColor = NonNullable<BadgeVariants['color']>;
|
|
269
269
|
type BadgeTone = NonNullable<BadgeVariants['tone']>;
|
|
@@ -295,7 +295,7 @@ declare namespace BadgeGroup {
|
|
|
295
295
|
}
|
|
296
296
|
declare const badgeGroupCountVariants: (props?: ({
|
|
297
297
|
size?: "default" | "lg" | null | undefined;
|
|
298
|
-
} &
|
|
298
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
299
299
|
declare const BadgeGroupCount: React.ForwardRefExoticComponent<Omit<BadgeGroupCount.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
300
300
|
declare namespace BadgeGroupCount {
|
|
301
301
|
type Props = Omit<React.ComponentProps<typeof CounterBadge>, 'variant'> & VariantProps<typeof badgeGroupCountVariants>;
|
|
@@ -305,7 +305,7 @@ declare namespace BadgeGroupCount {
|
|
|
305
305
|
declare const bannerVariants: (props?: ({
|
|
306
306
|
variant?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
|
|
307
307
|
borderDirection?: "bottom" | "top" | null | undefined;
|
|
308
|
-
} &
|
|
308
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
309
309
|
declare const Banner: React.ForwardRefExoticComponent<Omit<BannerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
310
310
|
interface BannerProps extends React.ComponentProps<'div'>, VariantProps<typeof bannerVariants> {}
|
|
311
311
|
declare namespace Banner {
|
|
@@ -386,7 +386,7 @@ declare namespace Separator {
|
|
|
386
386
|
//#region src/components/button-group.d.ts
|
|
387
387
|
declare const buttonGroupVariants: (props?: ({
|
|
388
388
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
389
|
-
} &
|
|
389
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
390
390
|
declare const ButtonGroup: React.ForwardRefExoticComponent<Omit<ButtonGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
391
391
|
interface ButtonGroupProps extends React.ComponentProps<'div'>, VariantProps<typeof buttonGroupVariants> {}
|
|
392
392
|
declare namespace ButtonGroup {
|
|
@@ -1178,7 +1178,7 @@ declare namespace EmptyHeader {
|
|
|
1178
1178
|
}
|
|
1179
1179
|
declare const emptyMediaVariants: (props?: ({
|
|
1180
1180
|
variant?: "default" | "icon" | null | undefined;
|
|
1181
|
-
} &
|
|
1181
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
1182
1182
|
declare const EmptyMedia: React.ForwardRefExoticComponent<Omit<EmptyMediaProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1183
1183
|
interface EmptyMediaProps extends React.ComponentProps<'div'>, VariantProps<typeof emptyMediaVariants> {}
|
|
1184
1184
|
declare namespace EmptyMedia {
|
|
@@ -1372,7 +1372,7 @@ declare namespace EmojiPickerContent {
|
|
|
1372
1372
|
declare const fabVariants: (props?: ({
|
|
1373
1373
|
variant?: "default" | "outline" | null | undefined;
|
|
1374
1374
|
size?: "lg" | "icon-lg" | null | undefined;
|
|
1375
|
-
} &
|
|
1375
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
1376
1376
|
declare const FAB: React.ForwardRefExoticComponent<Omit<FABProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
1377
1377
|
interface FABProps extends Button$1.Props, VariantProps<typeof fabVariants> {}
|
|
1378
1378
|
declare namespace FAB {
|
|
@@ -1406,7 +1406,7 @@ declare namespace FieldGroup {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
declare const fieldVariants: (props?: ({
|
|
1408
1408
|
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
1409
|
-
} &
|
|
1409
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
1410
1410
|
declare const Field: React.ForwardRefExoticComponent<Omit<FieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1411
1411
|
interface FieldProps extends React.ComponentProps<'div'>, VariantProps<typeof fieldVariants> {}
|
|
1412
1412
|
declare namespace Field {
|
|
@@ -1418,33 +1418,35 @@ declare namespace FieldContent {
|
|
|
1418
1418
|
type Props = FieldContentProps;
|
|
1419
1419
|
}
|
|
1420
1420
|
/**
|
|
1421
|
-
* Label for a field. Renders an `@aircall/ds` Label with field-layout styling,
|
|
1422
|
-
* necessity
|
|
1421
|
+
* Label for a field. Renders an `@aircall/ds` Label with field-layout styling, plus an optional
|
|
1422
|
+
* necessity marker — `(required)` or `(optional)` text — after the label content.
|
|
1423
1423
|
*
|
|
1424
|
-
*
|
|
1425
|
-
*
|
|
1426
|
-
*
|
|
1424
|
+
* Per Aircall form conventions, **mark the exceptions, not the rule**: in a mostly-mandatory form
|
|
1425
|
+
* tag the few optional fields with `necessityIndicator="optional"`; in a mostly-optional form tag
|
|
1426
|
+
* the few mandatory fields with `necessityIndicator="required"`. Leave it unset when every field
|
|
1427
|
+
* shares the same necessity (the common case). Never mix the two markers in one form. The marker
|
|
1428
|
+
* is readable text — the asterisk (`*`) is intentionally **not** a necessity marker.
|
|
1429
|
+
*
|
|
1430
|
+
* The marker is presentational — set the control's own `required`/`aria-required` for semantics.
|
|
1427
1431
|
*
|
|
1428
1432
|
* @example
|
|
1429
1433
|
* ```tsx
|
|
1430
|
-
* <FieldLabel
|
|
1431
|
-
* <FieldLabel
|
|
1434
|
+
* <FieldLabel>Name</FieldLabel>
|
|
1435
|
+
* <FieldLabel necessityIndicator="optional">Nickname</FieldLabel>
|
|
1432
1436
|
* ```
|
|
1433
1437
|
*/
|
|
1434
1438
|
declare const FieldLabel: React.ForwardRefExoticComponent<Omit<FieldLabelProps, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
1435
1439
|
interface FieldLabelProps extends React.ComponentProps<typeof Label> {
|
|
1436
1440
|
/**
|
|
1437
|
-
*
|
|
1438
|
-
* `(
|
|
1439
|
-
*
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
*
|
|
1444
|
-
* `label` renders `(required)` or `(optional)` text on every field.
|
|
1445
|
-
* @default 'icon'
|
|
1441
|
+
* Necessity marker shown after the label: `'required'` renders `(required)`, `'optional'`
|
|
1442
|
+
* renders `(optional)`. Omit for no marker (the default, and the common case).
|
|
1443
|
+
*
|
|
1444
|
+
* Follow "mark the exceptions": tag only the minority necessity in a form (e.g. the lone
|
|
1445
|
+
* optional field in an otherwise-mandatory form), and never mix `'required'` and `'optional'`
|
|
1446
|
+
* in the same form. Presentational only — set the control's own `required`/`aria-required`.
|
|
1447
|
+
* @default undefined
|
|
1446
1448
|
*/
|
|
1447
|
-
necessityIndicator?: '
|
|
1449
|
+
necessityIndicator?: 'required' | 'optional';
|
|
1448
1450
|
}
|
|
1449
1451
|
declare namespace FieldLabel {
|
|
1450
1452
|
type Props = FieldLabelProps;
|
|
@@ -1581,7 +1583,7 @@ declare namespace HoverCardContent {
|
|
|
1581
1583
|
//#region src/components/input.d.ts
|
|
1582
1584
|
declare const inputVariants: (props?: ({
|
|
1583
1585
|
block?: boolean | null | undefined;
|
|
1584
|
-
} &
|
|
1586
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
1585
1587
|
declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
1586
1588
|
interface InputProps extends React.ComponentProps<'input'>, VariantProps<typeof inputVariants> {}
|
|
1587
1589
|
declare namespace Input {
|
|
@@ -1596,7 +1598,7 @@ declare namespace InputGroup {
|
|
|
1596
1598
|
}
|
|
1597
1599
|
declare const inputGroupAddonVariants: (props?: ({
|
|
1598
1600
|
align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
|
|
1599
|
-
} &
|
|
1601
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
1600
1602
|
declare const InputGroupAddon: React.ForwardRefExoticComponent<Omit<InputGroupAddonProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1601
1603
|
interface InputGroupAddonProps extends React.ComponentProps<'div'>, VariantProps<typeof inputGroupAddonVariants> {}
|
|
1602
1604
|
declare namespace InputGroupAddon {
|
|
@@ -1781,7 +1783,7 @@ declare namespace ItemSeparator {
|
|
|
1781
1783
|
declare const itemVariants: (props?: ({
|
|
1782
1784
|
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
1783
1785
|
size?: "default" | "sm" | "xs" | null | undefined;
|
|
1784
|
-
} &
|
|
1786
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
1785
1787
|
declare const Item: React.ForwardRefExoticComponent<Omit<ItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1786
1788
|
interface ItemProps extends useRender.ComponentProps<'div'>, VariantProps<typeof itemVariants> {}
|
|
1787
1789
|
declare namespace Item {
|
|
@@ -1789,7 +1791,7 @@ declare namespace Item {
|
|
|
1789
1791
|
}
|
|
1790
1792
|
declare const itemMediaVariants: (props?: ({
|
|
1791
1793
|
variant?: "image" | "default" | "icon" | null | undefined;
|
|
1792
|
-
} &
|
|
1794
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
1793
1795
|
declare const ItemMedia: React.ForwardRefExoticComponent<Omit<ItemMediaProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1794
1796
|
interface ItemMediaProps extends React.ComponentProps<'div'>, VariantProps<typeof itemMediaVariants> {}
|
|
1795
1797
|
declare namespace ItemMedia {
|
|
@@ -1978,7 +1980,7 @@ declare namespace ScrollBar {
|
|
|
1978
1980
|
//#region src/components/select.d.ts
|
|
1979
1981
|
declare const selectTriggerVariants: (props?: ({
|
|
1980
1982
|
size?: "default" | "sm" | null | undefined;
|
|
1981
|
-
} &
|
|
1983
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
1982
1984
|
declare const Select: typeof Select$1.Root;
|
|
1983
1985
|
declare const SelectGroup: React.ForwardRefExoticComponent<Omit<SelectGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1984
1986
|
interface SelectGroupProps extends Select$1.Group.Props {}
|
|
@@ -2203,7 +2205,7 @@ declare namespace SidebarMenuItem {
|
|
|
2203
2205
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
2204
2206
|
variant?: "default" | "outline" | null | undefined;
|
|
2205
2207
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
2206
|
-
} &
|
|
2208
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
2207
2209
|
declare const SidebarMenuButton: React.ForwardRefExoticComponent<Omit<SidebarMenuButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
2208
2210
|
type SidebarMenuButtonProps = useRender.ComponentProps<'button'> & React.ComponentProps<'button'> & VariantProps<typeof sidebarMenuButtonVariants> & {
|
|
2209
2211
|
isActive?: boolean;
|
|
@@ -2275,7 +2277,7 @@ declare namespace Toaster {
|
|
|
2275
2277
|
//#region src/components/spinner.d.ts
|
|
2276
2278
|
declare const spinnerVariants: (props?: ({
|
|
2277
2279
|
size?: "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
2278
|
-
} &
|
|
2280
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
2279
2281
|
declare const Spinner: React.ForwardRefExoticComponent<Omit<SpinnerProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
2280
2282
|
interface SpinnerProps extends React.ComponentProps<'svg'>, VariantProps<typeof spinnerVariants> {}
|
|
2281
2283
|
declare namespace Spinner {
|
|
@@ -2419,7 +2421,7 @@ declare namespace ThemeProvider {
|
|
|
2419
2421
|
declare const toggleVariants: (props?: ({
|
|
2420
2422
|
variant?: "default" | "outline" | null | undefined;
|
|
2421
2423
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
2422
|
-
} &
|
|
2424
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
2423
2425
|
declare const Toggle: React.ForwardRefExoticComponent<Omit<ToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
2424
2426
|
interface ToggleProps extends Toggle$1.Props, VariantProps<typeof toggleVariants> {}
|
|
2425
2427
|
declare namespace Toggle {
|
package/dist/index.js
CHANGED
|
@@ -4156,7 +4156,7 @@ const FieldGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4156
4156
|
});
|
|
4157
4157
|
});
|
|
4158
4158
|
FieldGroup.displayName = "FieldGroup";
|
|
4159
|
-
const fieldVariants = cva("group/field flex w-full gap-2
|
|
4159
|
+
const fieldVariants = cva("group/field flex w-full gap-2", {
|
|
4160
4160
|
variants: { orientation: {
|
|
4161
4161
|
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
4162
4162
|
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
@@ -4187,41 +4187,37 @@ const FieldContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4187
4187
|
});
|
|
4188
4188
|
FieldContent.displayName = "FieldContent";
|
|
4189
4189
|
/**
|
|
4190
|
-
* Label for a field. Renders an `@aircall/ds` Label with field-layout styling,
|
|
4191
|
-
* necessity
|
|
4190
|
+
* Label for a field. Renders an `@aircall/ds` Label with field-layout styling, plus an optional
|
|
4191
|
+
* necessity marker — `(required)` or `(optional)` text — after the label content.
|
|
4192
4192
|
*
|
|
4193
|
-
*
|
|
4194
|
-
*
|
|
4195
|
-
*
|
|
4193
|
+
* Per Aircall form conventions, **mark the exceptions, not the rule**: in a mostly-mandatory form
|
|
4194
|
+
* tag the few optional fields with `necessityIndicator="optional"`; in a mostly-optional form tag
|
|
4195
|
+
* the few mandatory fields with `necessityIndicator="required"`. Leave it unset when every field
|
|
4196
|
+
* shares the same necessity (the common case). Never mix the two markers in one form. The marker
|
|
4197
|
+
* is readable text — the asterisk (`*`) is intentionally **not** a necessity marker.
|
|
4198
|
+
*
|
|
4199
|
+
* The marker is presentational — set the control's own `required`/`aria-required` for semantics.
|
|
4196
4200
|
*
|
|
4197
4201
|
* @example
|
|
4198
4202
|
* ```tsx
|
|
4199
|
-
* <FieldLabel
|
|
4200
|
-
* <FieldLabel
|
|
4203
|
+
* <FieldLabel>Name</FieldLabel>
|
|
4204
|
+
* <FieldLabel necessityIndicator="optional">Nickname</FieldLabel>
|
|
4201
4205
|
* ```
|
|
4202
4206
|
*/
|
|
4203
4207
|
const FieldLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
4204
|
-
const { className, children,
|
|
4208
|
+
const { className, children, necessityIndicator, ...props } = componentProps;
|
|
4205
4209
|
const t = useDsTranslation("ds");
|
|
4206
4210
|
return /* @__PURE__ */ jsxs(Label, {
|
|
4207
4211
|
ref: forwardRef,
|
|
4208
4212
|
"data-slot": "field-label",
|
|
4209
|
-
"data-
|
|
4213
|
+
"data-necessity": necessityIndicator,
|
|
4210
4214
|
className: cn("group/field-label peer/field-label flex w-fit gap-1 leading-normal group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-4 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
|
|
4211
4215
|
...props,
|
|
4212
|
-
children: [children, necessityIndicator
|
|
4216
|
+
children: [children, necessityIndicator && /* @__PURE__ */ jsx("span", {
|
|
4213
4217
|
"data-slot": "field-necessity",
|
|
4214
4218
|
className: "font-normal text-muted-foreground",
|
|
4215
|
-
children: required ? t("fieldLabel.required") : t("fieldLabel.optional")
|
|
4216
|
-
})
|
|
4217
|
-
"data-slot": "field-necessity",
|
|
4218
|
-
"aria-hidden": "true",
|
|
4219
|
-
className: "text-muted-foreground",
|
|
4220
|
-
children: "*"
|
|
4221
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
4222
|
-
className: "sr-only",
|
|
4223
|
-
children: t("fieldLabel.required")
|
|
4224
|
-
})] })]
|
|
4219
|
+
children: necessityIndicator === "required" ? t("fieldLabel.required") : t("fieldLabel.optional")
|
|
4220
|
+
})]
|
|
4225
4221
|
});
|
|
4226
4222
|
});
|
|
4227
4223
|
FieldLabel.displayName = "FieldLabel";
|