@aircall/ds 0.45.1 → 0.46.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.
|
@@ -204,6 +204,12 @@ interface DataTableProps<TData> {
|
|
|
204
204
|
*/
|
|
205
205
|
fixedLayout?: boolean;
|
|
206
206
|
className?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Test id applied to the root; the loading skeleton cells get
|
|
209
|
+
* `${dataTest}-loading-cell`.
|
|
210
|
+
* @default 'data-table'
|
|
211
|
+
*/
|
|
212
|
+
'data-test'?: string;
|
|
207
213
|
}
|
|
208
214
|
/**
|
|
209
215
|
* Data grid built on TanStack Table. Renders a `<div>` wrapper around a DS
|
|
@@ -1341,7 +1341,7 @@ function assertEveryColumnSized(table, columnSizing) {
|
|
|
1341
1341
|
*/
|
|
1342
1342
|
function DataTable(componentProps) {
|
|
1343
1343
|
var _columnPinning$left$l, _columnPinning$left, _columnPinning$right$, _columnPinning$right, _resolvedColumnPinnin, _resolvedColumnPinnin2, _resolvedColumnPinnin3, _resolvedColumnPinnin4, _componentProps$virtu;
|
|
1344
|
-
const { columns, data, getRowId, loadingState = "idle", skeletonCount = DEFAULT_SKELETON_COUNT, emptyState, sorting, onSortingChange, columnVisibility, columnPinning, selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, disabledKeys, disabledBehavior = "all", actionBar, onFetchMore, hasMore = false, enableColumnResizing = false, fillHeight = false, onRowClick, className } = componentProps;
|
|
1344
|
+
const { columns, data, getRowId, loadingState = "idle", skeletonCount = DEFAULT_SKELETON_COUNT, emptyState, sorting, onSortingChange, columnVisibility, columnPinning, selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, disabledKeys, disabledBehavior = "all", actionBar, onFetchMore, hasMore = false, enableColumnResizing = false, fillHeight = false, onRowClick, className, "data-test": dataTest = "data-table" } = componentProps;
|
|
1345
1345
|
const sortingEnabled = !!onSortingChange;
|
|
1346
1346
|
const selectionEnabled = selectionMode !== "none";
|
|
1347
1347
|
const multiSelect = selectionMode === "multiple";
|
|
@@ -1509,6 +1509,7 @@ function DataTable(componentProps) {
|
|
|
1509
1509
|
const sentinelRef = useFetchMoreSentinel(onFetchMore, (node) => fillHeight ? node.closest("[data-slot=\"table-container\"]") : null, data.length);
|
|
1510
1510
|
const leafColumnCount = Math.max(table.getVisibleLeafColumns().length, 1);
|
|
1511
1511
|
return /* @__PURE__ */ jsxs("div", {
|
|
1512
|
+
"data-test": dataTest,
|
|
1512
1513
|
className: cn("relative w-full", fillHeight && "flex min-h-0 flex-1 flex-col", className),
|
|
1513
1514
|
"aria-busy": isInitialLoading || isRefreshing || void 0,
|
|
1514
1515
|
children: [
|
|
@@ -1538,6 +1539,7 @@ function DataTable(componentProps) {
|
|
|
1538
1539
|
/* @__PURE__ */ jsx(TableBody, { children: isInitialLoading ? /* @__PURE__ */ jsx(SkeletonRows, {
|
|
1539
1540
|
columns: table.getVisibleLeafColumns(),
|
|
1540
1541
|
count: skeletonCount,
|
|
1542
|
+
dataTest,
|
|
1541
1543
|
getCellPinProps
|
|
1542
1544
|
}) : rows.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1543
1545
|
virtualItems ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1746,13 +1748,13 @@ function getPinnedCellProps(column, options) {
|
|
|
1746
1748
|
className: cn(variant === "footer" ? "bg-[color-mix(in_oklch,var(--muted)_50%,var(--background))]" : variant === "body" ? cn("bg-background", "group-hover/row:bg-[color-mix(in_oklch,var(--accent)_30%,var(--background))]", "group-data-[state=selected]/row:bg-[color-mix(in_oklch,var(--accent)_50%,var(--background))]", "group-data-[state=selected]/row:group-hover/row:bg-[color-mix(in_oklch,var(--accent)_50%,var(--background))]") : "bg-background")
|
|
1747
1749
|
};
|
|
1748
1750
|
}
|
|
1749
|
-
function SkeletonRows({ columns, count, getCellPinProps }) {
|
|
1751
|
+
function SkeletonRows({ columns, count, dataTest, getCellPinProps }) {
|
|
1750
1752
|
return /* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx(TableRow, {
|
|
1751
1753
|
className: "group/row",
|
|
1752
1754
|
children: columns.map((col) => {
|
|
1753
1755
|
const pinProps = getCellPinProps(col, "body");
|
|
1754
1756
|
return /* @__PURE__ */ jsx(TableCell, {
|
|
1755
|
-
"data-test":
|
|
1757
|
+
"data-test": `${dataTest}-loading-cell`,
|
|
1756
1758
|
style: pinProps.style,
|
|
1757
1759
|
className: pinProps.className,
|
|
1758
1760
|
children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full max-w-full" })
|
package/dist/data-table.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OnChangeFn, i as DataTableLoadingState, n as ColumnPinningState, o as SortingState, r as DataTable, s as VisibilityState, t as ColumnDef } from "./data-table-
|
|
1
|
+
import { a as OnChangeFn, i as DataTableLoadingState, n as ColumnPinningState, o as SortingState, r as DataTable, s as VisibilityState, t as ColumnDef } from "./data-table-BgeS8KWP.js";
|
|
2
2
|
export { type ColumnDef, type ColumnPinningState, DataTable, type DataTableLoadingState, type OnChangeFn, type SortingState, type VisibilityState };
|
package/dist/data-table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DataTable } from "./data-table-
|
|
1
|
+
import { t as DataTable } from "./data-table-Bwq4VuWA.js";
|
|
2
2
|
export { DataTable };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as OnChangeFn, i as DataTableLoadingState, n as ColumnPinningState, o as SortingState, r as DataTable, s as VisibilityState, t as ColumnDef } from "./data-table-
|
|
1
|
+
import { a as OnChangeFn, i as DataTableLoadingState, n as ColumnPinningState, o as SortingState, r as DataTable, s as VisibilityState, t as ColumnDef } from "./data-table-BgeS8KWP.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
4
4
|
import { ClassValue } from "clsx";
|
|
@@ -96,7 +96,7 @@ declare namespace AccordionContent {
|
|
|
96
96
|
//#region src/components/button.d.ts
|
|
97
97
|
/** `cva` variant definitions for {@link Button} — resolves `variant`, `size`, and `block` into class names. */
|
|
98
98
|
declare const buttonVariants: (props?: ({
|
|
99
|
-
variant?: "link" | "default" | "
|
|
99
|
+
variant?: "link" | "default" | "ghost" | "secondary" | "destructive" | "outline" | null | undefined;
|
|
100
100
|
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
101
101
|
block?: boolean | null | undefined;
|
|
102
102
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -658,7 +658,7 @@ declare namespace AlertDialogCancel {
|
|
|
658
658
|
* the icon level with the first line when the title wraps.
|
|
659
659
|
*/
|
|
660
660
|
declare const alertVariants: (props?: ({
|
|
661
|
-
variant?: "default" | "
|
|
661
|
+
variant?: "default" | "info" | "success" | "warning" | "error" | null | undefined;
|
|
662
662
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
663
663
|
/**
|
|
664
664
|
* Callout that draws attention to an important, contextual message.
|
|
@@ -742,7 +742,7 @@ declare namespace AlertAction {
|
|
|
742
742
|
*/
|
|
743
743
|
type AttachmentState = 'idle' | 'uploading' | 'processing' | 'error' | 'done';
|
|
744
744
|
declare const attachmentVariants: (props?: ({
|
|
745
|
-
size?: "default" | "
|
|
745
|
+
size?: "default" | "xs" | "sm" | null | undefined;
|
|
746
746
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
747
747
|
block?: boolean | null | undefined;
|
|
748
748
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -884,7 +884,7 @@ declare namespace AttachmentGroup {
|
|
|
884
884
|
* (`xs` | `sm` | `default` | `lg` | `xl`, default `default`) sets the avatar's diameter.
|
|
885
885
|
*/
|
|
886
886
|
declare const avatarVariants: (props?: ({
|
|
887
|
-
size?: "default" | "
|
|
887
|
+
size?: "default" | "xs" | "sm" | "lg" | "xl" | null | undefined;
|
|
888
888
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
889
889
|
/**
|
|
890
890
|
* Circular container that displays a user or entity image with a text/icon fallback.
|
|
@@ -967,7 +967,7 @@ declare namespace AvatarGroupCount {
|
|
|
967
967
|
* (`default` | `secondary` | `ghost`, default `default`) sets the colour scheme.
|
|
968
968
|
*/
|
|
969
969
|
declare const counterBadgeVariants: (props?: ({
|
|
970
|
-
variant?: "default" | "
|
|
970
|
+
variant?: "default" | "ghost" | "secondary" | null | undefined;
|
|
971
971
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
972
972
|
/**
|
|
973
973
|
* Small pill for surfacing a count or short status, e.g. an unread indicator.
|
|
@@ -1069,7 +1069,7 @@ declare namespace BadgeGroupCount {
|
|
|
1069
1069
|
* edge gets the accent border.
|
|
1070
1070
|
*/
|
|
1071
1071
|
declare const bannerVariants: (props?: ({
|
|
1072
|
-
variant?: "default" | "
|
|
1072
|
+
variant?: "default" | "info" | "success" | "warning" | "error" | null | undefined;
|
|
1073
1073
|
borderDirection?: "bottom" | "top" | null | undefined;
|
|
1074
1074
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
1075
1075
|
/**
|
|
@@ -2669,6 +2669,14 @@ interface DataComboboxProps<T> {
|
|
|
2669
2669
|
* for a wider menu.
|
|
2670
2670
|
*/
|
|
2671
2671
|
contentClassName?: string;
|
|
2672
|
+
/**
|
|
2673
|
+
* Test id for the visible field (the input, or the chips field); the popup gets
|
|
2674
|
+
* `${dataTest}-content` and the rows region's internal markers (the infinite-scroll
|
|
2675
|
+
* sentinel, loading skeleton rows) are prefixed from it too. With `trigger` set, the
|
|
2676
|
+
* consumer's own trigger carries its test id — this only names the popup and rows.
|
|
2677
|
+
* @default 'data-combobox'
|
|
2678
|
+
*/
|
|
2679
|
+
'data-test'?: string;
|
|
2672
2680
|
/**
|
|
2673
2681
|
* Accessible name for the visible FIELD — the inline input, or the chips field's
|
|
2674
2682
|
* input — and, unless {@link DataComboboxProps.listAriaLabel} overrides it, for the
|
|
@@ -2998,10 +3006,10 @@ interface DatePickerBaseProps extends Omit<React.ComponentProps<'div'>, 'onChang
|
|
|
2998
3006
|
*/
|
|
2999
3007
|
name?: string;
|
|
3000
3008
|
/**
|
|
3001
|
-
* data-
|
|
3009
|
+
* data-test for the segment group container.
|
|
3002
3010
|
* @default 'date-picker-input'
|
|
3003
3011
|
*/
|
|
3004
|
-
'data-
|
|
3012
|
+
'data-test'?: string;
|
|
3005
3013
|
}
|
|
3006
3014
|
/**
|
|
3007
3015
|
* Props for single-date mode (default).
|
|
@@ -3112,10 +3120,10 @@ interface DatePickerRangeProps extends DatePickerBaseProps {
|
|
|
3112
3120
|
/** Predefined range shortcuts shown in a left sidebar. */
|
|
3113
3121
|
predefinedRanges?: DatePickerPredefinedRange[];
|
|
3114
3122
|
/**
|
|
3115
|
-
* data-
|
|
3123
|
+
* data-test for the "to" segment group (range mode only).
|
|
3116
3124
|
* @default 'date-picker-input-to'
|
|
3117
3125
|
*/
|
|
3118
|
-
'data-
|
|
3126
|
+
'data-test-to'?: string;
|
|
3119
3127
|
/** Not applicable in range mode. */
|
|
3120
3128
|
onValueChange?: never;
|
|
3121
3129
|
}
|
|
@@ -5097,8 +5105,8 @@ declare namespace ItemSeparator {
|
|
|
5097
5105
|
type Props = ItemSeparatorProps;
|
|
5098
5106
|
}
|
|
5099
5107
|
declare const itemVariants: (props?: ({
|
|
5100
|
-
variant?: "default" | "
|
|
5101
|
-
size?: "default" | "
|
|
5108
|
+
variant?: "default" | "muted" | "outline" | null | undefined;
|
|
5109
|
+
size?: "default" | "xs" | "sm" | null | undefined;
|
|
5102
5110
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5103
5111
|
/**
|
|
5104
5112
|
* Flexible list-item container laying out media, content, and actions on one row. Renders a `<div>`
|
|
@@ -5650,9 +5658,19 @@ interface RichTextareaProps {
|
|
|
5650
5658
|
'aria-label'?: string;
|
|
5651
5659
|
/** Extra classes for the outer container. */
|
|
5652
5660
|
className?: string;
|
|
5661
|
+
/**
|
|
5662
|
+
* Test id applied to the outer container.
|
|
5663
|
+
* @default 'rich-textarea'
|
|
5664
|
+
*/
|
|
5665
|
+
'data-test'?: string;
|
|
5653
5666
|
}
|
|
5654
|
-
/**
|
|
5655
|
-
|
|
5667
|
+
/**
|
|
5668
|
+
* Props for {@link RichTextareaRoot} — the editor config plus composed children.
|
|
5669
|
+
*
|
|
5670
|
+
* Omits `data-test` along with `bare`/`className`: `RichTextareaRoot` renders no DOM of its own
|
|
5671
|
+
* to apply it to, so it would be silently dropped. Pass it to {@link RichTextareaContent} instead.
|
|
5672
|
+
*/
|
|
5673
|
+
interface RichTextareaRootProps extends Omit<RichTextareaProps, 'bare' | 'className' | 'data-test'> {
|
|
5656
5674
|
/** The composed layout (e.g. an `InputGroup` with a toolbar and `RichTextareaContent`). */
|
|
5657
5675
|
children: React.ReactNode;
|
|
5658
5676
|
}
|
|
@@ -5690,6 +5708,11 @@ interface RichTextareaContentProps {
|
|
|
5690
5708
|
'aria-label'?: string;
|
|
5691
5709
|
/** Extra classes for the editable container. */
|
|
5692
5710
|
className?: string;
|
|
5711
|
+
/**
|
|
5712
|
+
* Test id applied to the editable container.
|
|
5713
|
+
* @default 'rich-textarea'
|
|
5714
|
+
*/
|
|
5715
|
+
'data-test'?: string;
|
|
5693
5716
|
}
|
|
5694
5717
|
/**
|
|
5695
5718
|
* The editable surface of a composed RichTextarea. Must render inside a
|
|
@@ -5790,7 +5813,12 @@ interface ScrollAreaProps extends ScrollAreaPrimitive.Root.Props {
|
|
|
5790
5813
|
*/
|
|
5791
5814
|
scrollFade?: boolean;
|
|
5792
5815
|
/**
|
|
5793
|
-
*
|
|
5816
|
+
* Shrinks the viewport's content box (via padding-inline-end for vertical overflow,
|
|
5817
|
+
* padding-bottom for horizontal overflow) so the overlaid scrollbar has dedicated empty space
|
|
5818
|
+
* to sit in, instead of floating on top of the last row/column of content. The root's overall
|
|
5819
|
+
* size is unchanged - this trades a bit of the existing content area for the gutter, it does
|
|
5820
|
+
* not add space. Reach for this whenever a fixed-height/width `ScrollArea` (e.g. a 40px chip
|
|
5821
|
+
* row) would otherwise have its scrollbar overlapping content.
|
|
5794
5822
|
* @default false
|
|
5795
5823
|
*/
|
|
5796
5824
|
scrollbarGutter?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Button, D as _objectWithoutProperties, E as _objectSpread2, O as cn, S as registerI18nNamespace, T as linkStyle, _ as ActionBarHeight, a as TableFooter, b as detectInitialLanguage, c as TableRow, d as Checkbox, f as Spinner, g as ActionBarContext, h as ActionBarButton, i as TableCell, l as useFetchMoreSentinel, m as ActionBar, n as Table, o as TableHead, p as spinnerVariants, r as TableBody, s as TableHeader, t as DataTable, u as Skeleton, v as useDsTranslation, w as buttonVariants, x as dsI18n, y as SUPPORTED_LANGUAGES } from "./data-table-
|
|
1
|
+
import { C as Button, D as _objectWithoutProperties, E as _objectSpread2, O as cn, S as registerI18nNamespace, T as linkStyle, _ as ActionBarHeight, a as TableFooter, b as detectInitialLanguage, c as TableRow, d as Checkbox, f as Spinner, g as ActionBarContext, h as ActionBarButton, i as TableCell, l as useFetchMoreSentinel, m as ActionBar, n as Table, o as TableHead, p as spinnerVariants, r as TableBody, s as TableHeader, t as DataTable, u as Skeleton, v as useDsTranslation, w as buttonVariants, x as dsI18n, y as SUPPORTED_LANGUAGES } from "./data-table-Bwq4VuWA.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { createContext, useContext, useSyncExternalStore } from "react";
|
|
4
4
|
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
@@ -3137,7 +3137,7 @@ const _excluded$46 = [
|
|
|
3137
3137
|
"type",
|
|
3138
3138
|
"block"
|
|
3139
3139
|
];
|
|
3140
|
-
const inputVariants = cva("text-foreground file:text-foreground placeholder:text-muted-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-md border bg-background px-3 py-2 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 dark:disabled:bg-input/80
|
|
3140
|
+
const inputVariants = cva("text-foreground file:text-foreground placeholder:text-muted-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-md border bg-background px-3 py-2 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 dark:disabled:bg-input/80 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:border-destructive focus-visible:aria-invalid:ring-destructive/20 focus-visible:aria-invalid:ring-3 dark:focus-visible:aria-invalid:ring-destructive/40", { variants: { block: { true: "w-full" } } });
|
|
3141
3141
|
/**
|
|
3142
3142
|
* Single-line text field styled to the design system.
|
|
3143
3143
|
*
|
|
@@ -4233,7 +4233,7 @@ const Textarea = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4233
4233
|
return /* @__PURE__ */ jsx("textarea", _objectSpread2({
|
|
4234
4234
|
ref: forwardRef,
|
|
4235
4235
|
"data-slot": "textarea",
|
|
4236
|
-
className: cn("border-input text-foreground placeholder:text-muted-foreground hover:aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:border-destructive focus-visible:aria-invalid:ring-destructive/20 focus-visible:aria-invalid:ring-3 dark:focus-visible:aria-invalid:ring-destructive/40 dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-background px-3 py-2 text-
|
|
4236
|
+
className: cn("border-input text-foreground placeholder:text-muted-foreground hover:aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:border-destructive focus-visible:aria-invalid:ring-destructive/20 focus-visible:aria-invalid:ring-3 dark:focus-visible:aria-invalid:ring-destructive/40 dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 dark:disabled:bg-input/80", className)
|
|
4237
4237
|
}, props));
|
|
4238
4238
|
});
|
|
4239
4239
|
Textarea.displayName = "Textarea";
|
|
@@ -5067,7 +5067,7 @@ function useComboboxItemGroups(items, getGroupKey, getGroupLabel) {
|
|
|
5067
5067
|
*/
|
|
5068
5068
|
function ComboboxRows(componentProps) {
|
|
5069
5069
|
var _groups$at$items, _groups$at;
|
|
5070
|
-
const { items, groups, getItemValue, getItemLabel, renderItem, disabledKeys, loadingState = "idle", skeletonCount = DEFAULT_SKELETON_COUNT, onFetchMore, hasMore = false, emptyState, listClassName, listTabIndex, virtualizeRows = false, estimateRowHeight = DEFAULT_ROW_HEIGHT, scrollRowIntoViewRef, "aria-label": ariaLabel } = componentProps;
|
|
5070
|
+
const { items, groups, getItemValue, getItemLabel, renderItem, disabledKeys, loadingState = "idle", skeletonCount = DEFAULT_SKELETON_COUNT, onFetchMore, hasMore = false, emptyState, listClassName, listTabIndex, virtualizeRows = false, estimateRowHeight = DEFAULT_ROW_HEIGHT, scrollRowIntoViewRef, "aria-label": ariaLabel, dataTest = "combobox-rows" } = componentProps;
|
|
5071
5071
|
const isInitialLoading = loadingState === "loading";
|
|
5072
5072
|
const isFiltering = loadingState === "filtering";
|
|
5073
5073
|
const isLoadingMore = loadingState === "loadingMore";
|
|
@@ -5083,7 +5083,7 @@ function ComboboxRows(componentProps) {
|
|
|
5083
5083
|
value: item,
|
|
5084
5084
|
disabled: (_disabledKeys$has = disabledKeys === null || disabledKeys === void 0 ? void 0 : disabledKeys.has(key)) !== null && _disabledKeys$has !== void 0 ? _disabledKeys$has : false,
|
|
5085
5085
|
ref: attachSentinel ? sentinelRef : void 0,
|
|
5086
|
-
"data-test": attachSentinel ?
|
|
5086
|
+
"data-test": attachSentinel ? `${dataTest}-fetch-sentinel` : void 0,
|
|
5087
5087
|
children: renderItem ? renderItem(item) : getItemLabel(item)
|
|
5088
5088
|
}, key);
|
|
5089
5089
|
};
|
|
@@ -5096,7 +5096,8 @@ function ComboboxRows(componentProps) {
|
|
|
5096
5096
|
estimateRowHeight,
|
|
5097
5097
|
sentinelRef,
|
|
5098
5098
|
showFetchSentinel,
|
|
5099
|
-
scrollRowIntoViewRef
|
|
5099
|
+
scrollRowIntoViewRef,
|
|
5100
|
+
dataTest
|
|
5100
5101
|
}) : null;
|
|
5101
5102
|
return /* @__PURE__ */ jsxs("div", {
|
|
5102
5103
|
"data-slot": "combobox-rows",
|
|
@@ -5112,15 +5113,19 @@ function ComboboxRows(componentProps) {
|
|
|
5112
5113
|
emptyState,
|
|
5113
5114
|
listClassName,
|
|
5114
5115
|
listTabIndex,
|
|
5115
|
-
"aria-label": ariaLabel
|
|
5116
|
+
"aria-label": ariaLabel,
|
|
5117
|
+
dataTest
|
|
5116
5118
|
}), isFiltering ? /* @__PURE__ */ jsx(ComboboxFilteringOverlay, {}) : null]
|
|
5117
5119
|
});
|
|
5118
5120
|
}
|
|
5119
5121
|
/** The loaded rows region: the list itself, the empty state, and the load-more spinner row. */
|
|
5120
5122
|
function ComboboxLoadedRows(componentProps) {
|
|
5121
|
-
const { isInitialLoading, skeletonCount, groups, renderRow, virtualRows, isFiltering, isLoadingMore, emptyState, listClassName, listTabIndex, "aria-label": ariaLabel } = componentProps;
|
|
5123
|
+
const { isInitialLoading, skeletonCount, groups, renderRow, virtualRows, isFiltering, isLoadingMore, emptyState, listClassName, listTabIndex, "aria-label": ariaLabel, dataTest } = componentProps;
|
|
5122
5124
|
const t = useDsTranslation("ds");
|
|
5123
|
-
const listChildren = isInitialLoading ? /* @__PURE__ */ jsx(ComboboxSkeletonRows, {
|
|
5125
|
+
const listChildren = isInitialLoading ? /* @__PURE__ */ jsx(ComboboxSkeletonRows, {
|
|
5126
|
+
count: skeletonCount,
|
|
5127
|
+
dataTest
|
|
5128
|
+
}) : virtualRows !== null && virtualRows !== void 0 ? virtualRows : groups === null ? renderRow : renderGroupSection(renderRow);
|
|
5124
5129
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5125
5130
|
/* @__PURE__ */ jsx(ComboboxList, _objectSpread2(_objectSpread2({
|
|
5126
5131
|
"aria-label": ariaLabel,
|
|
@@ -5148,7 +5153,7 @@ function ComboboxLoadedRows(componentProps) {
|
|
|
5148
5153
|
function ComboboxVirtualRows(componentProps) {
|
|
5149
5154
|
"use no memo";
|
|
5150
5155
|
var _spacerElement$closes;
|
|
5151
|
-
const { getItemValue, getItemLabel, renderItem, disabledKeys, estimateRowHeight, sentinelRef, showFetchSentinel, scrollRowIntoViewRef } = componentProps;
|
|
5156
|
+
const { getItemValue, getItemLabel, renderItem, disabledKeys, estimateRowHeight, sentinelRef, showFetchSentinel, scrollRowIntoViewRef, dataTest } = componentProps;
|
|
5152
5157
|
const filteredItems = Combobox$1.useFilteredItems();
|
|
5153
5158
|
const [spacerElement, setSpacerElement] = React.useState(null);
|
|
5154
5159
|
const scrollElement = (_spacerElement$closes = spacerElement === null || spacerElement === void 0 ? void 0 : spacerElement.closest("[data-slot=\"combobox-list\"]")) !== null && _spacerElement$closes !== void 0 ? _spacerElement$closes : null;
|
|
@@ -5193,7 +5198,7 @@ function ComboboxVirtualRows(componentProps) {
|
|
|
5193
5198
|
}), showFetchSentinel && filteredItems.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
5194
5199
|
ref: sentinelRef,
|
|
5195
5200
|
"aria-hidden": true,
|
|
5196
|
-
"data-test":
|
|
5201
|
+
"data-test": `${dataTest}-fetch-sentinel`,
|
|
5197
5202
|
"data-slot": "combobox-fetch-sentinel",
|
|
5198
5203
|
className: "absolute bottom-0 h-px w-full"
|
|
5199
5204
|
}) : null]
|
|
@@ -5231,13 +5236,13 @@ function SpinnerRow() {
|
|
|
5231
5236
|
});
|
|
5232
5237
|
}
|
|
5233
5238
|
/** Skeleton rows, padded like the list, shown while the initial page loads. */
|
|
5234
|
-
function ComboboxSkeletonRows({ count }) {
|
|
5239
|
+
function ComboboxSkeletonRows({ count, dataTest }) {
|
|
5235
5240
|
return /* @__PURE__ */ jsx("div", {
|
|
5236
5241
|
"data-slot": "combobox-skeleton-rows",
|
|
5237
5242
|
className: "p-1",
|
|
5238
5243
|
children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx("div", {
|
|
5239
5244
|
"aria-hidden": true,
|
|
5240
|
-
"data-test":
|
|
5245
|
+
"data-test": `${dataTest}-loading-item`,
|
|
5241
5246
|
"data-slot": "combobox-skeleton-row",
|
|
5242
5247
|
className: "flex items-center gap-2 rounded-md p-2",
|
|
5243
5248
|
children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" })
|
|
@@ -5436,7 +5441,7 @@ function scrollHighlightedRowIntoView(scrollRowIntoViewRef, index, reason) {
|
|
|
5436
5441
|
*/
|
|
5437
5442
|
function DataCombobox(componentProps) {
|
|
5438
5443
|
var _selectedObjects$;
|
|
5439
|
-
const { items, getItemValue, getItemLabel, renderItem, renderChip, getGroupKey, getGroupLabel, selectionMode = "single", selectedKeys, defaultSelectedKeys, onSelectionChange, onOpenChange, open, selectedItems, disabledKeys, loadingState, skeletonCount, onSearch, onFetchMore, hasMore = false, emptyState, trigger, searchable = true, placeholder, disabled = false, className, contentClassName, anchor, "aria-label": ariaLabel, listAriaLabel, showClear = true, estimateRowHeight } = componentProps;
|
|
5444
|
+
const { items, getItemValue, getItemLabel, renderItem, renderChip, getGroupKey, getGroupLabel, selectionMode = "single", selectedKeys, defaultSelectedKeys, onSelectionChange, onOpenChange, open, selectedItems, disabledKeys, loadingState, skeletonCount, onSearch, onFetchMore, hasMore = false, emptyState, trigger, searchable = true, placeholder, disabled = false, className, contentClassName, anchor, "aria-label": ariaLabel, listAriaLabel, showClear = true, estimateRowHeight, "data-test": dataTest = "data-combobox" } = componentProps;
|
|
5440
5445
|
const multiple = selectionMode === "multiple";
|
|
5441
5446
|
const isSearchable = resolveSearchable(searchable, !!onSearch, items.length);
|
|
5442
5447
|
const clientFilter = !isSearchable || onSearch || onFetchMore && hasMore ? null : void 0;
|
|
@@ -5473,7 +5478,8 @@ function DataCombobox(componentProps) {
|
|
|
5473
5478
|
virtualizeRows,
|
|
5474
5479
|
estimateRowHeight,
|
|
5475
5480
|
scrollRowIntoViewRef,
|
|
5476
|
-
"aria-label": listAriaLabel !== null && listAriaLabel !== void 0 ? listAriaLabel : ariaLabel
|
|
5481
|
+
"aria-label": listAriaLabel !== null && listAriaLabel !== void 0 ? listAriaLabel : ariaLabel,
|
|
5482
|
+
dataTest
|
|
5477
5483
|
});
|
|
5478
5484
|
const chipsAnchor = useComboboxAnchor();
|
|
5479
5485
|
const overlayLayout = trigger ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Combobox$1.Trigger, {
|
|
@@ -5483,6 +5489,7 @@ function DataCombobox(componentProps) {
|
|
|
5483
5489
|
"aria-label": ariaLabel,
|
|
5484
5490
|
anchor,
|
|
5485
5491
|
className: cn("min-w-50", contentClassName),
|
|
5492
|
+
"data-test": `${dataTest}-content`,
|
|
5486
5493
|
children: [isSearchable ? /* @__PURE__ */ jsx(ComboboxInput, {
|
|
5487
5494
|
showTrigger: false,
|
|
5488
5495
|
placeholder
|
|
@@ -5507,6 +5514,7 @@ function DataCombobox(componentProps) {
|
|
|
5507
5514
|
children: trigger ? overlayLayout : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ComboboxChips, {
|
|
5508
5515
|
ref: chipsAnchor,
|
|
5509
5516
|
className,
|
|
5517
|
+
"data-test": dataTest,
|
|
5510
5518
|
children: /* @__PURE__ */ jsx(ComboboxValue, { children: (values) => /* @__PURE__ */ jsxs(Fragment, { children: [values.map((item) => renderChip ? /* @__PURE__ */ jsx(React.Fragment, { children: renderChip(item) }, getItemValue(item)) : /* @__PURE__ */ jsx(ComboboxChip, { children: getItemLabel(item) }, getItemValue(item))), /* @__PURE__ */ jsx(ComboboxChipsInput, {
|
|
5511
5519
|
"aria-label": ariaLabel,
|
|
5512
5520
|
placeholder: keys.size === 0 ? placeholder : "",
|
|
@@ -5515,6 +5523,7 @@ function DataCombobox(componentProps) {
|
|
|
5515
5523
|
}), /* @__PURE__ */ jsx(ComboboxContent, {
|
|
5516
5524
|
anchor: anchor !== null && anchor !== void 0 ? anchor : chipsAnchor,
|
|
5517
5525
|
className: cn("min-w-50", contentClassName),
|
|
5526
|
+
"data-test": `${dataTest}-content`,
|
|
5518
5527
|
children: popupRows
|
|
5519
5528
|
})] })
|
|
5520
5529
|
}, selectionMode);
|
|
@@ -5539,10 +5548,12 @@ function DataCombobox(componentProps) {
|
|
|
5539
5548
|
placeholder,
|
|
5540
5549
|
disabled,
|
|
5541
5550
|
showClear,
|
|
5542
|
-
readOnly: !isSearchable
|
|
5551
|
+
readOnly: !isSearchable,
|
|
5552
|
+
"data-test": dataTest
|
|
5543
5553
|
}), /* @__PURE__ */ jsx(ComboboxContent, {
|
|
5544
5554
|
anchor,
|
|
5545
5555
|
className: cn("min-w-50", contentClassName),
|
|
5556
|
+
"data-test": `${dataTest}-content`,
|
|
5546
5557
|
children: popupRows
|
|
5547
5558
|
})] })
|
|
5548
5559
|
}, selectionMode);
|
|
@@ -7450,7 +7461,7 @@ const _excluded2$21 = [
|
|
|
7450
7461
|
"triggerClassName",
|
|
7451
7462
|
"id",
|
|
7452
7463
|
"name",
|
|
7453
|
-
"data-
|
|
7464
|
+
"data-test",
|
|
7454
7465
|
"onValueChange",
|
|
7455
7466
|
"onRangeChange"
|
|
7456
7467
|
];
|
|
@@ -7458,7 +7469,7 @@ const _excluded3$16 = [
|
|
|
7458
7469
|
"value",
|
|
7459
7470
|
"defaultValue",
|
|
7460
7471
|
"predefinedRanges",
|
|
7461
|
-
"data-
|
|
7472
|
+
"data-test-to"
|
|
7462
7473
|
];
|
|
7463
7474
|
function DateInputSegment({ segmentProps, disabled, id }) {
|
|
7464
7475
|
const { ref, value, placeholder, style, type: _segmentType } = segmentProps, rest = _objectWithoutProperties(segmentProps, _excluded$31);
|
|
@@ -7485,10 +7496,10 @@ function DateInputSeparator({ char }) {
|
|
|
7485
7496
|
children: char
|
|
7486
7497
|
});
|
|
7487
7498
|
}
|
|
7488
|
-
function DateSegmentGroup({ segments, separators, groupRef, disabled, firstSegmentId, "data-
|
|
7499
|
+
function DateSegmentGroup({ segments, separators, groupRef, disabled, firstSegmentId, "data-test": dataTest, "data-slot": dataSlot, className }) {
|
|
7489
7500
|
return /* @__PURE__ */ jsx("div", {
|
|
7490
7501
|
ref: groupRef,
|
|
7491
|
-
"data-
|
|
7502
|
+
"data-test": dataTest,
|
|
7492
7503
|
"data-slot": dataSlot !== null && dataSlot !== void 0 ? dataSlot : "date-segment-group",
|
|
7493
7504
|
className: cn("flex items-center px-2.5", className),
|
|
7494
7505
|
children: segments.map((seg, i) => {
|
|
@@ -7714,8 +7725,8 @@ function formatDateForInput(date) {
|
|
|
7714
7725
|
const DatePicker = React.forwardRef((componentProps, forwardRef) => {
|
|
7715
7726
|
"use no memo";
|
|
7716
7727
|
var _locale$code, _fromSegmented$select, _toSegmented$selected, _singleSegmented$sele, _fromSegmented$select2, _toSegmented$selected2;
|
|
7717
|
-
const { className, mode = "single", locale, disabled = false, invalid = false, disabledDates, minDate: minDateProp, maxDate: maxDateProp, captionLayout, open: openProp, onOpenChange, footer, triggerClassName, id, name, "data-
|
|
7718
|
-
const _ref = _objectWithoutProperties(componentProps, _excluded2$21), { value: _v, defaultValue: _dv, predefinedRanges: _pr, "data-
|
|
7728
|
+
const { className, mode = "single", locale, disabled = false, invalid = false, disabledDates, minDate: minDateProp, maxDate: maxDateProp, captionLayout, open: openProp, onOpenChange, footer, triggerClassName, id, name, "data-test": dataTest = "date-picker-input", onValueChange, onRangeChange } = componentProps;
|
|
7729
|
+
const _ref = _objectWithoutProperties(componentProps, _excluded2$21), { value: _v, defaultValue: _dv, predefinedRanges: _pr, "data-test-to": dataTestTo = "date-picker-input-to" } = _ref, props = _objectWithoutProperties(_ref, _excluded3$16);
|
|
7719
7730
|
const dsLocale = useDsLocale();
|
|
7720
7731
|
const resolvedLocaleCode = resolveLocale((_locale$code = locale === null || locale === void 0 ? void 0 : locale.code) !== null && _locale$code !== void 0 ? _locale$code : void 0, dsLocale);
|
|
7721
7732
|
const mask = React.useMemo(() => deriveDateMask(resolvedLocaleCode), [resolvedLocaleCode]);
|
|
@@ -8081,7 +8092,7 @@ const DatePicker = React.forwardRef((componentProps, forwardRef) => {
|
|
|
8081
8092
|
groupRef: fromGroupRef,
|
|
8082
8093
|
disabled,
|
|
8083
8094
|
firstSegmentId: id,
|
|
8084
|
-
"data-
|
|
8095
|
+
"data-test": dataTest,
|
|
8085
8096
|
"data-slot": "date-picker-input"
|
|
8086
8097
|
}),
|
|
8087
8098
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -8094,7 +8105,7 @@ const DatePicker = React.forwardRef((componentProps, forwardRef) => {
|
|
|
8094
8105
|
segments: toSegmented.segments,
|
|
8095
8106
|
separators: toSegmented.separators,
|
|
8096
8107
|
disabled,
|
|
8097
|
-
"data-
|
|
8108
|
+
"data-test": dataTestTo,
|
|
8098
8109
|
"data-slot": "date-picker-input-to"
|
|
8099
8110
|
}),
|
|
8100
8111
|
/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
@@ -8166,7 +8177,7 @@ const DatePicker = React.forwardRef((componentProps, forwardRef) => {
|
|
|
8166
8177
|
groupRef: singleSegmented.groupRef,
|
|
8167
8178
|
disabled,
|
|
8168
8179
|
firstSegmentId: id,
|
|
8169
|
-
"data-
|
|
8180
|
+
"data-test": dataTest,
|
|
8170
8181
|
"data-slot": "date-picker-input"
|
|
8171
8182
|
}), /* @__PURE__ */ jsx(PopoverTrigger, {
|
|
8172
8183
|
ref: triggerRef,
|
|
@@ -10774,7 +10785,7 @@ const NumericInputControl = React.forwardRef((componentProps, forwardRef) => {
|
|
|
10774
10785
|
return /* @__PURE__ */ jsx(NumberField.Input, _objectSpread2({
|
|
10775
10786
|
ref: forwardRef,
|
|
10776
10787
|
"data-slot": "input-group-control",
|
|
10777
|
-
className: cn("text-foreground placeholder:text-muted-foreground min-w-0 flex-1 rounded-none border-0 bg-transparent px-3 py-2 text-
|
|
10788
|
+
className: cn("text-foreground placeholder:text-muted-foreground min-w-0 flex-1 rounded-none border-0 bg-transparent px-3 py-2 text-sm shadow-none outline-none disabled:opacity-100", className),
|
|
10778
10789
|
onChange: handleChange
|
|
10779
10790
|
}, props));
|
|
10780
10791
|
});
|
|
@@ -12084,7 +12095,8 @@ RichTextareaLinkToolbar.displayName = "RichTextareaLinkToolbar";
|
|
|
12084
12095
|
const _excluded$6 = [
|
|
12085
12096
|
"bare",
|
|
12086
12097
|
"className",
|
|
12087
|
-
"aria-label"
|
|
12098
|
+
"aria-label",
|
|
12099
|
+
"data-test"
|
|
12088
12100
|
];
|
|
12089
12101
|
const RichTextareaContext = React.createContext({
|
|
12090
12102
|
mentions: [],
|
|
@@ -12738,7 +12750,7 @@ RichTextareaRoot.displayName = "RichTextareaRoot";
|
|
|
12738
12750
|
* {@link RichTextareaRoot}. Use `bare` when placing it inside an `InputGroup`.
|
|
12739
12751
|
*/
|
|
12740
12752
|
const RichTextareaContent = React.forwardRef((componentProps, forwardRef) => {
|
|
12741
|
-
const { bare = false, className, "aria-label": ariaLabel } = componentProps;
|
|
12753
|
+
const { bare = false, className, "aria-label": ariaLabel, "data-test": dataTest = "rich-textarea" } = componentProps;
|
|
12742
12754
|
const { formatting, submitOnEnter, disabled, placeholder, onSubmit } = React.useContext(RichTextareaContext);
|
|
12743
12755
|
const editor = useEditorRef();
|
|
12744
12756
|
const handleKeyDown = (event) => {
|
|
@@ -12761,9 +12773,9 @@ const RichTextareaContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
12761
12773
|
};
|
|
12762
12774
|
return /* @__PURE__ */ jsx("div", {
|
|
12763
12775
|
"data-slot": "rich-textarea",
|
|
12764
|
-
"data-
|
|
12776
|
+
"data-test": dataTest,
|
|
12765
12777
|
"data-multiline": bare ? "true" : void 0,
|
|
12766
|
-
className: cn("flex max-h-60 min-h-20 w-full flex-col overflow-y-auto px-3 py-2 text-
|
|
12778
|
+
className: cn("flex max-h-60 min-h-20 w-full flex-col overflow-y-auto px-3 py-2 text-sm transition-[color,box-shadow]", bare ? "flex-1 border-0 bg-transparent shadow-none" : "border-input focus-within:border-ring focus-within:ring-ring/50 dark:bg-input/30 rounded-md border bg-background shadow-xs focus-within:ring-3", disabled && "cursor-not-allowed", disabled && !bare && "opacity-50 bg-input/50 dark:bg-input/80", className),
|
|
12767
12779
|
children: /* @__PURE__ */ jsx(PlateContent, {
|
|
12768
12780
|
ref: forwardRef,
|
|
12769
12781
|
"data-slot": bare ? "input-group-control" : void 0,
|
|
@@ -12796,12 +12808,13 @@ RichTextareaContent.displayName = "RichTextareaContent";
|
|
|
12796
12808
|
* ```
|
|
12797
12809
|
*/
|
|
12798
12810
|
const RichTextarea = React.forwardRef((componentProps, forwardRef) => {
|
|
12799
|
-
const { bare, className, "aria-label": ariaLabel } = componentProps, rootProps = _objectWithoutProperties(componentProps, _excluded$6);
|
|
12811
|
+
const { bare, className, "aria-label": ariaLabel, "data-test": dataTest } = componentProps, rootProps = _objectWithoutProperties(componentProps, _excluded$6);
|
|
12800
12812
|
return /* @__PURE__ */ jsx(RichTextareaRoot, _objectSpread2(_objectSpread2({}, rootProps), {}, { children: /* @__PURE__ */ jsx(RichTextareaContent, {
|
|
12801
12813
|
ref: forwardRef,
|
|
12802
12814
|
bare,
|
|
12803
12815
|
className,
|
|
12804
|
-
"aria-label": ariaLabel
|
|
12816
|
+
"aria-label": ariaLabel,
|
|
12817
|
+
"data-test": dataTest
|
|
12805
12818
|
}) }));
|
|
12806
12819
|
});
|
|
12807
12820
|
RichTextarea.displayName = "RichTextarea";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aircall/ds",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": [
|
|
@@ -99,18 +99,18 @@
|
|
|
99
99
|
"@tanstack/intent": "0.1.1",
|
|
100
100
|
"@turbo/gen": "2.4.2",
|
|
101
101
|
"@types/node": "24",
|
|
102
|
-
"@types/react": "19.
|
|
103
|
-
"@types/react-dom": "19.
|
|
102
|
+
"@types/react": "19.3.0",
|
|
103
|
+
"@types/react-dom": "19.3.0",
|
|
104
104
|
"@vitest/browser-playwright": "4.0.17",
|
|
105
105
|
"@vitest/coverage-v8": "4.0.17",
|
|
106
106
|
"chromatic": "18.5.0",
|
|
107
107
|
"date-fns": "4.1.0",
|
|
108
108
|
"i18next": "23.11.5",
|
|
109
109
|
"playwright": "1.57.0",
|
|
110
|
-
"react": "19.
|
|
110
|
+
"react": "19.3.0",
|
|
111
111
|
"react-compiler-runtime": "1.0.0",
|
|
112
112
|
"react-day-picker": "9.14.0",
|
|
113
|
-
"react-dom": "19.
|
|
113
|
+
"react-dom": "19.3.0",
|
|
114
114
|
"storybook": "10.3.3",
|
|
115
115
|
"storybook-addon-pseudo-states": "10.3.3",
|
|
116
116
|
"tailwindcss": "4.1.18",
|