@aircall/ds 0.45.1 → 0.46.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.
|
@@ -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";
|
|
@@ -990,8 +990,8 @@ declare namespace CounterBadge {
|
|
|
990
990
|
/** `cva` recipe for the Badge/Chip container — drives the `size`, `color`, and `tone` classes. */
|
|
991
991
|
declare const badgeVariants: (props?: ({
|
|
992
992
|
size?: "default" | "lg" | null | undefined;
|
|
993
|
-
color?: "
|
|
994
|
-
tone?: "dark" | "
|
|
993
|
+
color?: "charcoal" | "red" | "green" | "blue" | "purple" | "yellow" | "pink" | null | undefined;
|
|
994
|
+
tone?: "dark" | "medium-dark" | "medium-light" | "light" | null | undefined;
|
|
995
995
|
overflowMode?: "none" | "truncate" | null | undefined;
|
|
996
996
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
997
997
|
type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
@@ -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
|
}
|
|
@@ -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
|
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";
|
|
@@ -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,
|
|
@@ -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,7 +12773,7 @@ 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
12778
|
className: cn("flex max-h-60 min-h-20 w-full flex-col overflow-y-auto px-3 py-2 text-base transition-[color,box-shadow] md:text-sm", 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, {
|
|
@@ -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";
|