@ngrok/mantle 0.90.3 → 0.91.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.
- package/dist/accordion.d.ts +3 -5
- package/dist/agent.json +7 -7
- package/dist/{alert-CTAmHdLa.d.ts → alert-BV0VWU2o.d.ts} +5 -7
- package/dist/{alert-xJELJxL4.js → alert-BVQcPzmf.js} +1 -1
- package/dist/alert-center.d.ts +2 -4
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +5 -7
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor.d.ts +2 -6
- package/dist/app-layout.d.ts +3 -7
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +2 -4
- package/dist/area-chart.js +1 -1
- package/dist/{as-child-D23mGo4f.d.ts → as-child-DFxX3U2i.d.ts} +0 -2
- package/dist/avatar.d.ts +2 -4
- package/dist/badge.d.ts +3 -5
- package/dist/bar-chart.d.ts +2 -4
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +2 -6
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only.d.ts +0 -2
- package/dist/{button-BZT5f79d.d.ts → button-BFAvonp1.d.ts} +3 -7
- package/dist/{button-mzUR1U0Y.d.ts → button-BOCRKR5v.d.ts} +3 -7
- package/dist/button-CZ-q7fYv.js +1 -0
- package/dist/button-Cwrv2Mwv.js +1 -0
- package/dist/{button-BRjAW1ec.d.ts → button-Dt9LZMT5.d.ts} +5 -7
- package/dist/{button-BCoI4bhP.d.ts → button-L4exxu_L.d.ts} +0 -2
- package/dist/button.d.ts +4 -4
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +1 -3
- package/dist/card.d.ts +3 -5
- package/dist/centered-layout.d.ts +9 -32
- package/dist/chart-D2LtDZtV.js +2 -0
- package/dist/{chart-23KQ1ZNO.d.ts → chart-ynMysD16.d.ts} +40 -15
- package/dist/checkbox.d.ts +2 -4
- package/dist/{choice-BCiyqLgO.d.ts → choice-BLR0_MeB.d.ts} +3 -5
- package/dist/choice.d.ts +1 -1
- package/dist/{code-block-D5eDP379.d.ts → code-block-Bqw9VyK_.d.ts} +0 -22
- package/dist/code-block.d.ts +4 -12
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code.d.ts +2 -4
- package/dist/color.d.ts +1 -1
- package/dist/combobox.d.ts +4 -6
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +3 -13
- package/dist/command.js +1 -1
- package/dist/cx.d.ts +0 -6
- package/dist/{data-slot-CChfb_cv.d.ts → data-slot-B-LqAcBB.d.ts} +0 -2
- package/dist/data-table.d.ts +111 -21
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +3 -5
- package/dist/{dialog-C9QGvVNG.js → dialog-D333NTyf.js} +1 -1
- package/dist/{dialog-CgwSNHs1.d.ts → dialog-DedsCsnk.d.ts} +3 -5
- package/dist/{dialog-CZYD3xL-.d.ts → dialog-Dp0QGWwo.d.ts} +0 -2
- package/dist/dialog.d.ts +2 -2
- package/dist/dialog.js +1 -1
- package/dist/{direction-BjU0bPST.d.ts → direction-CpRzTtZh.d.ts} +0 -2
- package/dist/{dropdown-menu-Cef0Cz2B.d.ts → dropdown-menu-ByQQIsQE.d.ts} +2 -4
- package/dist/dropdown-menu.d.ts +1 -2
- package/dist/empty.d.ts +3 -5
- package/dist/{field-7QeiTFwl.d.ts → field-V_gnkcmN.d.ts} +0 -2
- package/dist/field.d.ts +7 -15
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +1 -5
- package/dist/hooks.d.ts +1 -37
- package/dist/hover-card.d.ts +1 -3
- package/dist/{icon-ucVgZeXn.d.ts → icon-ByLVhdYq.d.ts} +2 -4
- package/dist/{icon-D1RY5Tcj.d.ts → icon-CgNqu-fl.d.ts} +0 -2
- package/dist/{icon-r2NvfTWW.d.ts → icon-DXDyhy2N.d.ts} +2 -4
- package/dist/icon.d.ts +3 -3
- package/dist/icons-DykpsXNX.js +1 -0
- package/dist/icons.d.ts +3 -17
- package/dist/icons.js +1 -1
- package/dist/{in-view-Ch5vJtWo.d.ts → in-view-B3nMAzfE.d.ts} +0 -6
- package/dist/{index-DorCusfG.d.ts → index-BZhHLrBi.d.ts} +0 -2
- package/dist/{index-DA4ig3gj.d.ts → index-C6s5cGCr.d.ts} +2 -10
- package/dist/{input-eEKzP3cE.js → input-CpQ6jlpI.js} +1 -1
- package/dist/{input-bbB1tC0h.d.ts → input-Dx5owTCc.d.ts} +2 -6
- package/dist/input.d.ts +3 -7
- package/dist/input.js +1 -1
- package/dist/kbd.d.ts +1 -3
- package/dist/{label-C-KbNls8.d.ts → label-Dn5CPJUj.d.ts} +1 -3
- package/dist/label.d.ts +1 -1
- package/dist/layer-container.d.ts +0 -2
- package/dist/line-chart.d.ts +2 -4
- package/dist/line-chart.js +1 -1
- package/dist/list.d.ts +2 -8
- package/dist/live-region.d.ts +2 -4
- package/dist/llms.txt +4 -4
- package/dist/main.d.ts +1 -3
- package/dist/mantle-dark.css +2 -12
- package/dist/mantle.css +75 -13
- package/dist/media-object.d.ts +2 -4
- package/dist/migrations/0011-eliminate-high-contrast.yml +869 -0
- package/dist/multi-select.d.ts +4 -6
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +3 -5
- package/dist/pagination.d.ts +3 -7
- package/dist/pagination.js +1 -1
- package/dist/{popover-Dvls7-j4.d.ts → popover-BfB2I9G0.d.ts} +1 -3
- package/dist/popover.d.ts +1 -1
- package/dist/progress.d.ts +1 -7
- package/dist/qr-code.d.ts +2 -4
- package/dist/radio-group.d.ts +2 -4
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +5 -8
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click.d.ts +1 -3
- package/dist/scatter-plot.d.ts +2 -4
- package/dist/scatter-plot.js +1 -1
- package/dist/{select-DlohFa54.d.ts → select-CRp_ndSJ.d.ts} +3 -5
- package/dist/select-iMsy6TFv.js +1 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +3 -5
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-BWGjCIl7.d.ts → separator-DNovVsrx.d.ts} +3 -5
- package/dist/separator.d.ts +1 -1
- package/dist/{sheet-CAFS09pT.js → sheet-gMTepUM_.js} +1 -1
- package/dist/sheet.d.ts +3 -5
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +5 -9
- package/dist/sidebar.js +1 -1
- package/dist/{skeleton-zfqoDAxT.js → skeleton-DBpI-ko5.js} +1 -1
- package/dist/skeleton.d.ts +2 -4
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +1 -3
- package/dist/slider.d.ts +1 -3
- package/dist/{slot-Q996Hqk9.d.ts → slot-C0OCJjdJ.d.ts} +2 -4
- package/dist/slot.d.ts +1 -1
- package/dist/split-button.d.ts +5 -7
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +2 -4
- package/dist/switch.d.ts +2 -4
- package/dist/{table-BhzITa19.d.ts → table-vT6Okwfa.d.ts} +1 -3
- package/dist/table.d.ts +1 -1
- package/dist/tabs.d.ts +3 -5
- package/dist/text-area.d.ts +2 -4
- package/dist/text-area.js +1 -1
- package/dist/theme-BD0ly6jo.js +1 -0
- package/dist/theme-switcher.d.ts +67 -213
- package/dist/theme-switcher.js +1 -1
- package/dist/{theme-6OxNhf6l.d.ts → theme-w1CrMM-x.d.ts} +3 -5
- package/dist/theme.d.ts +78 -177
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +4 -6
- package/dist/toast.js +1 -1
- package/dist/{tooltip-CngH7Kl6.d.ts → tooltip-NcLIeBy5.d.ts} +1 -3
- package/dist/tooltip.d.ts +1 -1
- package/dist/truncated-text.d.ts +2 -4
- package/dist/types.d.ts +3 -3
- package/dist/utils.d.ts +2 -4
- package/dist/visually-hidden.d.ts +2 -4
- package/dist/well.d.ts +3 -5
- package/dist/{with-style-props-Dq5Vntqy.d.ts → with-style-props-CuT30s0W.d.ts} +0 -2
- package/package.json +2 -10
- package/dist/button-Bkl_QYpp.js +0 -1
- package/dist/button-b2HKEIE2.js +0 -1
- package/dist/chart-BfJ835dr.js +0 -2
- package/dist/dropdown-menu-DMA8dGxZ.d.ts +0 -1
- package/dist/icons-CW9lV9E1.js +0 -1
- package/dist/mantle-dark-high-contrast.css +0 -354
- package/dist/mantle-light-high-contrast.css +0 -353
- package/dist/select-Os5GVejP.js +0 -1
- package/dist/theme-Dzem-qRB.js +0 -1
package/dist/cx.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
//#region src/utils/cx/vendor/clsx.d.ts
|
|
2
1
|
interface ClassDictionary {
|
|
3
2
|
[className: string]: any;
|
|
4
3
|
}
|
|
5
4
|
type ClassValue = string | number | bigint | boolean | null | undefined | ClassValue[] | ClassDictionary;
|
|
6
5
|
declare const clsx$1: (...inputs: ClassValue[]) => string;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/utils/cx/clsx.d.ts
|
|
9
6
|
/**
|
|
10
7
|
* Conditionally join class names into a single space-separated string, with falsy
|
|
11
8
|
* values ignored — **without** Tailwind conflict resolution.
|
|
@@ -18,8 +15,6 @@ declare const clsx$1: (...inputs: ClassValue[]) => string;
|
|
|
18
15
|
* clsx("base", isActive && "active", { disabled: isDisabled }); // → "base active"
|
|
19
16
|
*/
|
|
20
17
|
export declare const clsx: typeof clsx$1;
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/utils/cx/cx.d.ts
|
|
23
18
|
/**
|
|
24
19
|
* The two ways `cx` can be called: as a normal variadic function, or as a tagged
|
|
25
20
|
* template literal.
|
|
@@ -56,5 +51,4 @@ type ClassNameFunction = {
|
|
|
56
51
|
* cx("text-red-500", "text-blue-500"); // → "text-blue-500"
|
|
57
52
|
*/
|
|
58
53
|
export declare const cx: ClassNameFunction;
|
|
59
|
-
//#endregion
|
|
60
54
|
export type { ClassValue };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/data-slot.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The incoming `data-slot` chain a part receives when an ancestor composes it
|
|
4
3
|
* via `asChild` — mantle's `Slot` forwards the ancestor chain so parts can
|
|
@@ -13,5 +12,4 @@ type WithDataSlot = {
|
|
|
13
12
|
*/
|
|
14
13
|
"data-slot"?: string;
|
|
15
14
|
};
|
|
16
|
-
//#endregion
|
|
17
15
|
export { WithDataSlot as t };
|
package/dist/data-table.d.ts
CHANGED
|
@@ -1,16 +1,47 @@
|
|
|
1
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
2
|
-
import { i as ButtonIntent, n as ButtonAppearance, t as Button } from "./button-
|
|
3
|
-
import { i as IconButtonIntent, r as IconButtonAppearance, t as IconButton } from "./button-
|
|
4
|
-
import { s as SortingMode } from "./direction-
|
|
5
|
-
import { t as Table$1 } from "./table-
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
2
|
+
import { i as ButtonIntent, n as ButtonAppearance, t as Button } from "./button-BOCRKR5v.js";
|
|
3
|
+
import { i as IconButtonIntent, r as IconButtonAppearance, t as IconButton } from "./button-BFAvonp1.js";
|
|
4
|
+
import { s as SortingMode } from "./direction-CpRzTtZh.js";
|
|
5
|
+
import { t as Table$1 } from "./table-vT6Okwfa.js";
|
|
6
6
|
import { ComponentProps, ReactNode } from "react";
|
|
7
7
|
import { CellData, Column, Column_RowSorting, Row, RowData, Row_RowExpanding, StockFeatures, Table, TableFeatures } from "@tanstack/react-table";
|
|
8
8
|
export * from "@tanstack/react-table";
|
|
9
|
-
//#region src/components/data-table/types.d.ts
|
|
10
9
|
declare const sortDirections: readonly ["asc", "desc", "unsorted"];
|
|
11
10
|
type SortDirection = (typeof sortDirections)[number];
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
/**
|
|
12
|
+
* How wide a `DataTable` column renders. `"fit"` makes the column only as wide
|
|
13
|
+
* as its widest content, on one line, and gives the spare width to the other
|
|
14
|
+
* columns.
|
|
15
|
+
*/
|
|
16
|
+
type ColumnWidth = "fit";
|
|
17
|
+
/**
|
|
18
|
+
* The column `meta` fields that `DataTable.Header` and `DataTable.Cell` read
|
|
19
|
+
* through their `column` prop. Tables with no `columnMeta` slot get these
|
|
20
|
+
* fields from the global `ColumnMeta` interface. A table with a `columnMeta`
|
|
21
|
+
* slot must add them to the slot type, because the slot replaces the global
|
|
22
|
+
* interface.
|
|
23
|
+
*
|
|
24
|
+
* @see https://mantle.ngrok.com/components/data-display/data-table#sizing-a-column-to-its-content
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* type PaymentsColumnMeta = DataTableColumnMeta & { align?: "start" | "end" };
|
|
29
|
+
*
|
|
30
|
+
* const features = tableFeatures({
|
|
31
|
+
* columnMeta: metaHelper<PaymentsColumnMeta>(),
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
type DataTableColumnMeta = {
|
|
36
|
+
/**
|
|
37
|
+
* How wide the column renders. When omitted, the browser shares the
|
|
38
|
+
* table's spare width across every column.
|
|
39
|
+
*/
|
|
40
|
+
width?: ColumnWidth;
|
|
41
|
+
};
|
|
42
|
+
declare module "@tanstack/react-table" {
|
|
43
|
+
interface ColumnMeta<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue extends CellData = CellData> extends DataTableColumnMeta {}
|
|
44
|
+
}
|
|
14
45
|
/**
|
|
15
46
|
* The table features a sortable column needs. `DataTable.HeaderSortButton`
|
|
16
47
|
* calls the column's sorting API, which exists only when the table registers
|
|
@@ -191,7 +222,8 @@ declare function HeaderSortButton<TFeatures extends SortableTableFeatures, TData
|
|
|
191
222
|
type DataTableHeaderProps<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData> = ComponentProps<typeof Table$1.Header> & {
|
|
192
223
|
/**
|
|
193
224
|
* The TanStack Table column this cell heads (`props.column` in `header`).
|
|
194
|
-
* When the column is sorted, the cell carries `aria-sort`.
|
|
225
|
+
* When the column is sorted, the cell carries `aria-sort`. When the
|
|
226
|
+
* column's `meta.width` is `"fit"`, the cell carries `data-column-width="fit"`.
|
|
195
227
|
*/
|
|
196
228
|
column?: Column<TFeatures, TData, TValue>;
|
|
197
229
|
} & WithDataSlot;
|
|
@@ -199,7 +231,15 @@ type DataTableHeaderProps<TFeatures extends TableFeatures, TData extends RowData
|
|
|
199
231
|
* A `<th>` optimized for header actions. Wrap each column's header content in
|
|
200
232
|
* this; for sortable columns, nest a `DataTable.HeaderSortButton` inside and
|
|
201
233
|
* pass the same `column` here, so the cell carries `aria-sort` while the column
|
|
202
|
-
* is sorted. Non-sortable columns can render plain text.
|
|
234
|
+
* is sorted. Non-sortable columns can render plain text. The `column` prop
|
|
235
|
+
* also applies the column's `meta.width`.
|
|
236
|
+
*
|
|
237
|
+
* **Data attributes:**
|
|
238
|
+
*
|
|
239
|
+
* | Data Attribute | Value | Description |
|
|
240
|
+
* | --- | --- | --- |
|
|
241
|
+
* | `data-slot` | `"data-table-header table-header"` | On the `<th>`, joined ahead of `Table.Header`'s own slot. |
|
|
242
|
+
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The header does not wrap its content, and the column shrinks to fit it. |
|
|
203
243
|
*
|
|
204
244
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableheader
|
|
205
245
|
*
|
|
@@ -219,6 +259,40 @@ type DataTableHeaderProps<TFeatures extends TableFeatures, TData extends RowData
|
|
|
219
259
|
* ```
|
|
220
260
|
*/
|
|
221
261
|
declare function Header<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData>({ "data-slot": dataSlot, children, className, column, ...props }: DataTableHeaderProps<TFeatures, TData, TValue>): import("react").JSX.Element;
|
|
262
|
+
type DataTableCellProps<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData> = ComponentProps<typeof Table$1.Cell> & {
|
|
263
|
+
/**
|
|
264
|
+
* The TanStack Table column this cell belongs to (`props.column` in `cell`).
|
|
265
|
+
* When the column's `meta.width` is `"fit"`, the cell carries
|
|
266
|
+
* `data-column-width="fit"`.
|
|
267
|
+
*/
|
|
268
|
+
column?: Column<TFeatures, TData, TValue>;
|
|
269
|
+
} & WithDataSlot;
|
|
270
|
+
/**
|
|
271
|
+
* A `<td>` for one data cell. Wrap the output of each column's `cell`
|
|
272
|
+
* function in this; a raw `<td>` skips mantle typography and padding. Pass
|
|
273
|
+
* `column` to apply the column's `meta.width`, and pass the same `column` to
|
|
274
|
+
* the column's `DataTable.Header`, so the header and every cell agree.
|
|
275
|
+
*
|
|
276
|
+
* **Data attributes:**
|
|
277
|
+
*
|
|
278
|
+
* | Data Attribute | Value | Description |
|
|
279
|
+
* | --- | --- | --- |
|
|
280
|
+
* | `data-slot` | `"data-table-cell table-cell"` | On the `<td>`, joined ahead of `Table.Cell`'s own slot. |
|
|
281
|
+
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The cell does not wrap its content, and the column shrinks to fit it. |
|
|
282
|
+
*
|
|
283
|
+
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablecell
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```tsx
|
|
287
|
+
* columnHelper.accessor("createdAt", {
|
|
288
|
+
* id: "createdAt",
|
|
289
|
+
* meta: { width: "fit" },
|
|
290
|
+
* header: (props) => <DataTable.Header column={props.column}>Created</DataTable.Header>,
|
|
291
|
+
* cell: (props) => <DataTable.Cell column={props.column}>{props.getValue()}</DataTable.Cell>,
|
|
292
|
+
* });
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
declare function Cell<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData>({ "data-slot": dataSlot, className, column, ...props }: DataTableCellProps<TFeatures, TData, TValue>): import("react").JSX.Element;
|
|
222
296
|
/**
|
|
223
297
|
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
224
298
|
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is no data.
|
|
@@ -1200,22 +1274,31 @@ declare const DataTable: {
|
|
|
1200
1274
|
*/
|
|
1201
1275
|
readonly ActionHeader: typeof ActionHeader;
|
|
1202
1276
|
/**
|
|
1203
|
-
* A `<td>` for
|
|
1204
|
-
*
|
|
1205
|
-
*
|
|
1277
|
+
* A `<td>` for one data cell. Wrap the output of each column's `cell`
|
|
1278
|
+
* function in this; a raw `<td>` skips mantle typography and padding. Pass
|
|
1279
|
+
* `column` to apply the column's `meta.width`, and pass the same `column` to
|
|
1280
|
+
* the column's `DataTable.Header`, so the header and every cell agree.
|
|
1281
|
+
*
|
|
1282
|
+
* **Data attributes:**
|
|
1283
|
+
*
|
|
1284
|
+
* | Data Attribute | Value | Description |
|
|
1285
|
+
* | --- | --- | --- |
|
|
1286
|
+
* | `data-slot` | `"data-table-cell table-cell"` | On the `<td>`, joined ahead of `Table.Cell`'s own slot. |
|
|
1287
|
+
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The cell does not wrap its content, and the column shrinks to fit it. |
|
|
1206
1288
|
*
|
|
1207
1289
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablecell
|
|
1208
1290
|
*
|
|
1209
1291
|
* @example
|
|
1210
1292
|
* ```tsx
|
|
1211
|
-
* columnHelper.accessor("
|
|
1212
|
-
* id: "
|
|
1213
|
-
*
|
|
1214
|
-
*
|
|
1293
|
+
* columnHelper.accessor("createdAt", {
|
|
1294
|
+
* id: "createdAt",
|
|
1295
|
+
* meta: { width: "fit" },
|
|
1296
|
+
* header: (props) => <DataTable.Header column={props.column}>Created</DataTable.Header>,
|
|
1297
|
+
* cell: (props) => <DataTable.Cell column={props.column}>{props.getValue()}</DataTable.Cell>,
|
|
1215
1298
|
* });
|
|
1216
1299
|
* ```
|
|
1217
1300
|
*/
|
|
1218
|
-
readonly Cell:
|
|
1301
|
+
readonly Cell: typeof Cell;
|
|
1219
1302
|
/**
|
|
1220
1303
|
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
1221
1304
|
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is
|
|
@@ -1280,7 +1363,15 @@ declare const DataTable: {
|
|
|
1280
1363
|
* A `<th>` optimized for header actions. Wrap each column's header content in
|
|
1281
1364
|
* this; for sortable columns, nest a `DataTable.HeaderSortButton` inside and
|
|
1282
1365
|
* pass the same `column` here, so the cell carries `aria-sort` while the column
|
|
1283
|
-
* is sorted. Non-sortable columns can render plain text.
|
|
1366
|
+
* is sorted. Non-sortable columns can render plain text. The `column` prop
|
|
1367
|
+
* also applies the column's `meta.width`.
|
|
1368
|
+
*
|
|
1369
|
+
* **Data attributes:**
|
|
1370
|
+
*
|
|
1371
|
+
* | Data Attribute | Value | Description |
|
|
1372
|
+
* | --- | --- | --- |
|
|
1373
|
+
* | `data-slot` | `"data-table-header table-header"` | On the `<th>`, joined ahead of `Table.Header`'s own slot. |
|
|
1374
|
+
* | `data-column-width` | `"fit"` | Present when the `column` prop's `meta.width` is `"fit"`. The header does not wrap its content, and the column shrinks to fit it. |
|
|
1284
1375
|
*
|
|
1285
1376
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableheader
|
|
1286
1377
|
*
|
|
@@ -1492,5 +1583,4 @@ declare const DataTable: {
|
|
|
1492
1583
|
*/
|
|
1493
1584
|
readonly ExpandedRow: typeof ExpandedRow;
|
|
1494
1585
|
};
|
|
1495
|
-
|
|
1496
|
-
export { DataTable, expandedRowId };
|
|
1586
|
+
export { DataTable, type DataTableColumnMeta, expandedRowId };
|
package/dist/data-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-b2HKEIE2.js";import{t as r}from"./button-Bkl_QYpp.js";import{t as i}from"./use-prefers-reduced-motion-DimzRx-M.js";import{t as a}from"./icons-CDLz5lpI.js";import{n as o}from"./sandboxed-on-click-C7pPu-2M.js";import{t as s}from"./table-DBbKqOVq.js";import{c}from"react/compiler-runtime";import{Fragment as l,createContext as u,useContext as d,useEffect as f,useRef as p,useState as m}from"react";import h from"tiny-invariant";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{Subscribe as y,callMemoOrStaticFn as b,flexRender as x}from"@tanstack/react-table";import{MinusIcon as S}from"@phosphor-icons/react/Minus";import{PlusIcon as C}from"@phosphor-icons/react/Plus";import{column_getIsSorted as w,row_getIsExpanded as T,row_getVisibleCells as E,table_getVisibleLeafColumns as D}from"@tanstack/react-table/static-functions";export*from"@tanstack/react-table";const O=[`unsorted`,`asc`,`desc`],k=[`unsorted`,`desc`,`asc`];function A(e,t){return j(t===`alphanumeric`?O:k,e)??`unsorted`}function j(e,t,n){if(e.length===0)return n;let r=e.findIndex(e=>e===t);if(r===-1)return n;let i=(r+1)%e.length;return e.at(i)??n}const M=u(null);function N(){return d(M)?.table.options}function P(){let e=d(M);return h(e,`useDataTableContext should only be used within a DataTable child component`),e}const F=u(null),I=/* @__PURE__ */ new Set;function L(e){return[...e.querySelectorAll(`:scope > tr`)]}function ee(e){let[,t=`0px`]=getComputedStyle(e).translate.split(` `);return e.offsetTop+(Number.parseFloat(t)||0)}function R(e,t,n){let r=/* @__PURE__ */ new Map,i=0,a=0;for(let o of L(e)){o.hasAttribute(`data-closing`)?a+=o.offsetHeight:(i+=a,a=0);let e=-i,s=t.get(o),c=s==null||Math.abs(s-o.offsetTop-e)<.5?e:s-o.offsetTop;r.set(o,o.offsetTop+e);let l=n.get(o);if(c!==e||(l?.to??0)!==e){if(n.delete(o),c!==e||e!==0){let t=o.animate([{translate:`0 ${c}px`},{translate:`0 ${e}px`}],{duration:c===e?0:200,easing:`cubic-bezier(0.23, 1, 0.32, 1)`,fill:e===0?`none`:`forwards`});n.set(o,{animation:t,to:e})}l?.animation.cancel()}}return r}function z(){let e=c(14),[t,n]=m(I),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=/* @__PURE__ */ new Map,e[0]=r):r=e[0];let a=p(r),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=/* @__PURE__ */ new Map,e[1]=o):o=e[1];let s=p(o),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=/* @__PURE__ */ new WeakMap,e[2]=l):l=e[2];let u=p(l),d,h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=a.current,t=s.current;return()=>{for(let{timer:t}of e.values())clearTimeout(t);for(let{observer:e}of t.values())e.disconnect()}},h=[],e[3]=d,e[4]=h):(d=e[3],h=e[4]),f(d,h);let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{n(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},e[5]=g):g=e[5];let _=g,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{let t=s.current.get(e);if(t!=null&&t.before==null){for(let t of a.current.values())if(t.body===e)return;t.observer.disconnect(),s.current.delete(e)}},e[6]=v):v=e[6];let y=v,b;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(e,t)=>{let n=s.current.get(e),r=t.filter(t=>t.type===`childList`?t.target===e:t.target.parentNode===e);if(n==null||r.length===0)return;let i=n.awaiting==null?null:a.current.get(n.awaiting);for(let e of r){let{target:t}=e;i!=null&&e.type===`attributes`&&t instanceof Element&&t.hasAttribute(`data-closing`)&&i.rows.add(t)}i!=null&&i.rows.size>0&&(n.awaiting=null);for(let[t,n]of a.current)n.body===e&&n.rows.size>0&&![...n.rows].some(te)&&(clearTimeout(n.timer),a.current.delete(t),_(t));let o=n.before??n.rest;n.before=null,n.rest=R(e,o,u.current),y(e)},e[7]=b):b=e[7];let x=b,S;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{let t=s.current.get(e);if(t==null){let n=new MutationObserver(t=>x(e,t));n.observe(e,{attributeFilter:[`data-closing`],childList:!0,subtree:!0}),t={observer:n,before:null,rest:/* @__PURE__ */ new Map,awaiting:null},s.current.set(e,t)}if(t.before==null){let n=new Map(L(e).map(B));t.before=n;let r=t;requestAnimationFrame(()=>{r.before===n&&(r.before=null,y(e))})}return t},e[8]=S):S=e[8];let C=S,w;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(e,t)=>{e!=null&&!i()&&C(e),t()},e[9]=w):w=e[9];let T=w,E;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{let t=a.current.get(e);t!=null&&(clearTimeout(t.timer),a.current.delete(e),C(t.body)),_(e)},e[10]=E):E=e[10];let D=E,O;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(O=(e,t,r)=>{t==null||i()?r():(D(e),C(t).awaiting=e,a.current.set(e,{body:t,rows:/* @__PURE__ */ new Set,timer:setTimeout(()=>{a.current.delete(e),C(t),_(e),r()},200)}),n(t=>new Set(t).add(e)))},e[11]=O):O=e[11];let k=O,A;return e[12]===t?A=e[13]:(A={closingRowIds:t,startExpand:T,startCollapse:k,cancelCollapse:D},e[12]=t,e[13]=A),A}function B(e){return[e,ee(e)]}function te(e){return e.isConnected}function ne(e){let n=c(21),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({"data-slot":i,children:r,table:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let l;n[5]===o?l=n[6]:(l={table:o},n[5]=o,n[6]=l);let u=l,d=z(),f;n[7]===i?f=n[8]:(f=t(i,`data-table`),n[7]=i,n[8]=f);let p;n[9]===r?p=n[10]:(p=/* @__PURE__ */ _(s.Element,{children:r}),n[9]=r,n[10]=p);let m;n[11]!==a||n[12]!==f||n[13]!==p?(m=/* @__PURE__ */ _(s.Root,{"data-slot":f,...a,children:p}),n[11]=a,n[12]=f,n[13]=p,n[14]=m):m=n[14];let h;n[15]!==d||n[16]!==m?(h=/* @__PURE__ */ _(F.Provider,{value:d,children:m}),n[15]=d,n[16]=m,n[17]=h):h=n[17];let g;return n[18]!==u||n[19]!==h?(g=/* @__PURE__ */ _(M.Provider,{value:u,children:h}),n[18]=u,n[19]=h,n[20]=g):g=n[20],g}function re(r){let i=c(33),a,o,s,l,u,d,f,p,m,h,g,v;i[0]===r?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],v=i[12]):({"data-slot":l,appearance:m,children:a,className:o,column:s,disableSorting:h,iconPlacement:g,intent:v,sortingMode:p,sortIcon:d,onClick:u,...f}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=p,i[9]=m,i[10]=h,i[11]=g,i[12]=v);let b=m===void 0?`ghost`:m,x=h!==void 0&&h,S=g===void 0?`end`:g,C=v===void 0?`neutral`:v,w;i[13]!==b||i[14]!==a||i[15]!==o||i[16]!==s||i[17]!==l||i[18]!==x||i[19]!==S||i[20]!==C||i[21]!==u||i[22]!==d||i[23]!==f||i[24]!==p?(w=()=>{let r=s.getIsSorted(),i=!x&&s.getCanSort(),c=i&&typeof r==`string`?r:`unsorted`;if(!i)return/* @__PURE__ */ _(`span`,{"data-slot":t(l,`data-table-header-sort-button`),"data-sort-direction":`unsorted`,className:e(`flex w-full items-center justify-start`,b===`ghost`&&C===`neutral`&&`text-muted`,o),...f,children:a});let m=d?.(c)??/* @__PURE__ */ _($,{mode:p,direction:c});return/* @__PURE__ */ _(n,{appearance:b,"data-slot":t(l,`data-table-header-sort-button`),className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none`,b===`ghost`&&C===`neutral`&&`text-muted`,o),"data-sort-direction":c,"data-table-header-action":!0,icon:m,iconPlacement:S,onClick:e=>{u?.(e),!e.defaultPrevented&&p!==void 0&&_e(s,p)},intent:C,type:`button`,...f,children:a})},i[13]=b,i[14]=a,i[15]=o,i[16]=s,i[17]=l,i[18]=x,i[19]=S,i[20]=C,i[21]=u,i[22]=d,i[23]=f,i[24]=p,i[25]=w):w=i[25];let T=w,E=N(),D;i[26]!==s||i[27]!==E?(D=()=>({sorted:s.getIsSorted(),options:E}),i[26]=s,i[27]=E,i[28]=D):D=i[28];let O;return i[29]!==s.table.store||i[30]!==T||i[31]!==D?(O=/* @__PURE__ */ _(y,{source:s.table.store,selector:D,children:T}),i[29]=s.table.store,i[30]=T,i[31]=D,i[32]=O):O=i[32],O}function V(e){if(e==null)return;let t=b(e,`getIsSorted`,w);if(t===`asc`)return`ascending`;if(t===`desc`)return`descending`}function H(n){let r=c(21),i,a,o,l,u;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4],u=r[5]):({"data-slot":l,children:i,className:a,column:o,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=u);let d;r[6]!==i||r[7]!==a||r[8]!==o||r[9]!==l||r[10]!==u?(d=()=>/* @__PURE__ */ _(s.Header,{"aria-sort":V(o),"data-slot":t(l,`data-table-header`),className:e(`has-data-table-header-action:px-0`,a),...u,children:i}),r[6]=i,r[7]=a,r[8]=o,r[9]=l,r[10]=u,r[11]=d):d=r[11];let f=d,p=N();if(o==null){let e;return r[12]===f?e=r[13]:(e=f(),r[12]=f,r[13]=e),e}let m;r[14]!==o||r[15]!==p?(m=()=>({ariaSort:V(o),options:p}),r[14]=o,r[15]=p,r[16]=m):m=r[16];let h;return r[17]!==o.table.store||r[18]!==f||r[19]!==m?(h=/* @__PURE__ */ _(y,{source:o.table.store,selector:m,children:f}),r[17]=o.table.store,r[18]=f,r[19]=m,r[20]=h):h=r[20],h}const U=e=>{let n=c(8),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(r,`data-table-body`),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=/* @__PURE__ */ _(s.Body,{"data-slot":a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o};function W(e){let n=c(11),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{table:a}=P(),o;n[3]===r?o=n[4]:(o=t(r,`data-table-head`),n[3]=r,n[4]=o);let l;n[5]===a?l=n[6]:(l=a.getHeaderGroups().map(G),n[5]=a,n[6]=l);let u;return n[7]!==i||n[8]!==o||n[9]!==l?(u=/* @__PURE__ */ _(s.Head,{"data-slot":o,...i,children:l}),n[7]=i,n[8]=o,n[9]=l,n[10]=u):u=n[10],u}function G(e){return/* @__PURE__ */ _(s.Row,{children:e.headers.map(K)},e.id)}function K(e){return/* @__PURE__ */ _(l,{children:e.isPlaceholder?/* @__PURE__ */ _(s.Header,{}):x(e.column.columnDef.header,e.getContext())},e.id)}const q=e(`starting:-translate-y-1 starting:opacity-0`,`motion-safe:transition-[opacity,translate] motion-safe:duration-200 motion-safe:ease-out-strong`,`data-closing:pointer-events-none data-closing:opacity-0 motion-safe:data-closing:duration-150`);function J(e,t){return t.size===0||e.depth===0?!1:e.getParentRows().some(e=>t.has(e.id))}const Y=u(!1);function ie(e){if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=e.currentTarget.ownerDocument.getSelection();return t==null||t.isCollapsed?!0:!e.currentTarget.contains(t.anchorNode)}function ae(n){let r=c(21),i,a,o,l,u,f;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4],u=r[5],f=r[6]):({"data-slot":a,className:i,onClick:o,renderExpanded:u,row:f,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=u,r[6]=f);let p=d(F)?.closingRowIds??I,m;r[7]!==i||r[8]!==p||r[9]!==a||r[10]!==o||r[11]!==l||r[12]!==u||r[13]!==f?(m=()=>{let n=J(f,p),r=b(f,`getIsExpanded`,T),c=b(f,`getVisibleCells`,E),d=/* @__PURE__ */ _(s.Row,{"data-slot":t(a,`data-table-row`),"data-expanded":r||void 0,"data-closing":n||void 0,inert:n||void 0,"data-clickable":o==null?void 0:``,className:e(f.depth>0&&q,o!=null&&`cursor-pointer`,i),onClick:o&&(e=>{ie(e)&&o(e)}),...l,children:/* @__PURE__ */ _(Y.Provider,{value:u!=null,children:c.map(oe)})});return u==null?d:/* @__PURE__ */ v(g,{children:[d,r&&/* @__PURE__ */ _(Q,{row:f,children:u(f)})]})},r[7]=i,r[8]=p,r[9]=a,r[10]=o,r[11]=l,r[12]=u,r[13]=f,r[14]=m):m=r[14];let h=m,x=N(),S;r[15]===x?S=r[16]:(S=e=>({state:e,options:x}),r[15]=x,r[16]=S);let C;return r[17]!==h||r[18]!==f.table.store||r[19]!==S?(C=/* @__PURE__ */ _(y,{source:f.table.store,selector:S,children:h}),r[17]=h,r[18]=f.table.store,r[19]=S,r[20]=C):C=r[20],C}function oe(e){return/* @__PURE__ */ _(l,{children:x(e.column.columnDef.cell,e.getContext())},e.id)}function se(e){let n=c(15),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({"data-slot":i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{table:o}=P(),l;n[4]===o?l=n[5]:(l=b(o,`getVisibleLeafColumns`,D),n[4]=o,n[5]=l);let u=l.length,d;n[6]===i?d=n[7]:(d=t(i,`data-table-empty-row`),n[6]=i,n[7]=d);let f;n[8]!==r||n[9]!==u?(f=/* @__PURE__ */ _(s.Cell,{colSpan:u,children:r}),n[8]=r,n[9]=u,n[10]=f):f=n[10];let p;return n[11]!==a||n[12]!==d||n[13]!==f?(p=/* @__PURE__ */ _(s.Row,{"data-slot":d,...a,children:f}),n[11]=a,n[12]=d,n[13]=f,n[14]=p):p=n[14],p}function X(){let t=c(1),n;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=/* @__PURE__ */ _(`span`,{"aria-hidden":!0,className:e(`pointer-events-none absolute -inset-y-px -left-1.5 w-1.5`,`opacity-0 transition-opacity group-data-sticky-active/table:opacity-100`,`shadow-[1px_0_0_0_var(--border-color-card-muted)]`,`bg-linear-to-l to-transparent`,`from-[color-mix(in_oklab,var(--shadow-color)_var(--shadow-second-opacity),transparent)]`)}),t[0]=n):n=t[0],n}function ce(n){let r=c(21),i,a,l,u,d;r[0]===n?(i=r[1],a=r[2],l=r[3],u=r[4],d=r[5]):({"data-slot":l,children:i,className:a,onClick:u,...d}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=l,r[4]=u,r[5]=d);let f;r[6]===u?f=r[7]:(f=o({allowClickEventDefault:!0,onClick:u}),r[6]=u,r[7]=f);let{onClick:p}=f,m;r[8]===l?m=r[9]:(m=t(l,`data-table-action-cell`),r[8]=l,r[9]=m);let h;r[10]===a?h=r[11]:(h=e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,a),r[10]=a,r[11]=h);let g;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=/* @__PURE__ */ _(X,{}),r[12]=g):g=r[12];let y;r[13]===i?y=r[14]:(y=/* @__PURE__ */ _(`span`,{"data-slot":`data-table-action-cell-label`,className:`contents`,children:i}),r[13]=i,r[14]=y);let b;return r[15]!==d||r[16]!==p||r[17]!==m||r[18]!==h||r[19]!==y?(b=/* @__PURE__ */ v(s.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":m,className:h,onClick:p,...d,children:[g,y]}),r[15]=d,r[16]=p,r[17]=m,r[18]=h,r[19]=y,r[20]=b):b=r[20],b}function le(n){let r=c(27),i,a,o,l;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4]):({"data-slot":o,children:i,className:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l);let{table:u}=P(),d;r[5]===u?d=r[6]:(d=u.getRowModel(),r[5]=u,r[6]=d);let f=d.rows.length>0,p;r[7]===f?p=r[8]:(p=f?{"data-mantle-table-sticky-right":!0}:{},r[7]=f,r[8]=p);let m;r[9]===o?m=r[10]:(m=t(o,`data-table-action-header`),r[9]=o,r[10]=m);let h=f&&`sticky z-10 right-0 bg-inherit`,g;r[11]!==a||r[12]!==h?(g=e(h,a),r[11]=a,r[12]=h,r[13]=g):g=r[13];let y;r[14]===i?y=r[15]:(y=i??/* @__PURE__ */ _(`span`,{className:`sr-only`,children:`Actions`}),r[14]=i,r[15]=y);let b;r[16]===y?b=r[17]:(b=/* @__PURE__ */ _(`span`,{"data-slot":`data-table-action-header-label`,className:`contents`,children:y}),r[16]=y,r[17]=b);let x;r[18]===f?x=r[19]:(x=f&&/* @__PURE__ */ _(X,{}),r[18]=f,r[19]=x);let S;return r[20]!==l||r[21]!==p||r[22]!==m||r[23]!==g||r[24]!==b||r[25]!==x?(S=/* @__PURE__ */ v(s.Header,{...p,"data-slot":m,className:g,...l,children:[b,x]}),r[20]=l,r[21]=p,r[22]=m,r[23]=g,r[24]=b,r[25]=x,r[26]=S):S=r[26],S}function ue(e){return e!=null&&`nodeType`in e}function de({"data-slot":n,children:r,className:i,onClick:a,...o}){let c=p(!1);return/* @__PURE__ */ _(s.Cell,{"data-slot":t(n,`data-table-control-cell`),className:e(`w-9 px-0 align-top has-[button:enabled,input:enabled]:cursor-pointer`,i),onClick:e=>{if(c.current){e.stopPropagation();return}a?.(e);let t=e.currentTarget.querySelector(`button:not(:disabled), input:not(:disabled)`);if(t!=null&&(e.stopPropagation(),!e.defaultPrevented&&ue(e.target)&&!t.contains(e.target))){t.focus({preventScroll:!0}),c.current=!0;try{t.click()}finally{c.current=!1}}},...o,children:/* @__PURE__ */ _(`span`,{"data-slot":`data-table-control-cell-label`,className:`flex h-lh items-center justify-center`,children:r})})}function Z(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function fe(n){let r=c(16),i,a,o,l;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4]):({"data-slot":o,children:i,className:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l);let u;r[5]===o?u=r[6]:(u=t(o,`data-table-expand-header`),r[5]=o,r[6]=u);let d;r[7]===a?d=r[8]:(d=e(`w-9 px-0 text-center`,a),r[7]=a,r[8]=d);let f;r[9]===i?f=r[10]:(f=i??/* @__PURE__ */ _(`span`,{className:`sr-only`,children:`Row details`}),r[9]=i,r[10]=f);let p;return r[11]!==l||r[12]!==u||r[13]!==d||r[14]!==f?(p=/* @__PURE__ */ _(s.Header,{"data-slot":u,className:d,...l,children:f}),r[11]=l,r[12]=u,r[13]=d,r[14]=f,r[15]=p):p=r[15],p}const pe=/* @__PURE__ */ _(C,{weight:`bold`,className:`size-3.5`}),me=/* @__PURE__ */ _(S,{weight:`bold`,className:`size-3.5`});function he(n){let i=c(21),a,o,s,l,u,f,p,m,h,g,v;i[0]===n?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],f=i[6],p=i[7],m=i[8],h=i[9],g=i[10],v=i[11]):({"data-slot":o,appearance:p,className:a,collapseIcon:m,expandIcon:h,intent:g,label:s,onClick:l,row:f,size:v,...u}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=f,i[7]=p,i[8]=m,i[9]=h,i[10]=g,i[11]=v);let b=p===void 0?`ghost`:p,x=m===void 0?me:m,S=h===void 0?pe:h,C=g===void 0?`neutral`:g,w=v===void 0?`sm`:v,T=()=>{if(!f.getCanExpand())return null;let n=f.getIsExpanded()&&!k,i=f.getToggleExpandedHandler(),c=f.subRows.length>0,d=D||!c;return/* @__PURE__ */ _(r,{type:`button`,"data-slot":t(o,`data-table-row-expand-button`),appearance:b,intent:C,size:w,className:e(`rounded`,a),"aria-expanded":n,"aria-controls":n&&d?Z(f):void 0,icon:n?x:S,label:c?`${n?`Collapse`:`Expand`} ${s}`:`${n?`Hide`:`Show`} details for ${s}`,onClick:e=>{if(e.stopPropagation(),l?.(e),e.defaultPrevented)return;let t=e.currentTarget.closest(`tbody`);O==null?i():k?O.cancelCollapse(f.id):n?O.startCollapse(f.id,t,()=>f.toggleExpanded(!1)):O.startExpand(t,i)},...u})},E=N(),D=d(Y),O=d(F),k=O?.closingRowIds.has(f.id)??!1,A;i[12]!==D||i[13]!==k||i[14]!==E||i[15]!==f?(A=()=>({isExpanded:f.getIsExpanded(),hasDetailPanel:D,isClosing:k,options:E}),i[12]=D,i[13]=k,i[14]=E,i[15]=f,i[16]=A):A=i[16];let j;return i[17]!==T||i[18]!==f.table.store||i[19]!==A?(j=/* @__PURE__ */ _(y,{source:f.table.store,selector:A,children:T}),i[17]=T,i[18]=f.table.store,i[19]=A,i[20]=j):j=i[20],j}function Q(n){let r=c(29),i,a,o,l,u,f;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4],u=r[5],f=r[6]):({"data-slot":l,children:i,className:a,colSpan:o,row:f,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=u,r[6]=f);let p;r[7]===f?p=r[8]:(p=()=>b(f,`getVisibleCells`,E).length,r[7]=f,r[8]=p);let m=p,h=d(F)?.closingRowIds??I,g;r[9]!==h||r[10]!==f?(g=h.has(f.id)||J(f,h),r[9]=h,r[10]=f,r[11]=g):g=r[11];let v=g,x;r[12]!==i||r[13]!==a||r[14]!==l||r[15]!==v||r[16]!==u||r[17]!==f?(x=n=>{let{numberOfColumns:r}=n;return/* @__PURE__ */ _(s.Row,{"data-slot":t(l,`data-table-expanded-row`),"data-expanded-content":!0,"data-closing":v||void 0,inert:v||void 0,className:e(`[&>td]:border-t-0`,q,a),...u,children:/* @__PURE__ */ _(s.Cell,{id:Z(f),colSpan:r,className:`bg-card font-sans text-body`,children:i})})},r[12]=i,r[13]=a,r[14]=l,r[15]=v,r[16]=u,r[17]=f,r[18]=x):x=r[18];let S=x,C=N();if(o!=null){let e;return r[19]!==o||r[20]!==S?(e=S({numberOfColumns:o}),r[19]=o,r[20]=S,r[21]=e):e=r[21],e}let w;r[22]!==m||r[23]!==C?(w=()=>({numberOfColumns:m(),options:C}),r[22]=m,r[23]=C,r[24]=w):w=r[24];let T;return r[25]!==S||r[26]!==f.table.store||r[27]!==w?(T=/* @__PURE__ */ _(y,{source:f.table.store,selector:w,children:S}),r[25]=S,r[26]=f.table.store,r[27]=w,r[28]=T):T=r[28],T}const ge={Root:ne,ActionCell:ce,ActionHeader:le,Cell:s.Cell,Body:U,EmptyRow:se,Head:W,Header:H,HeaderSortButton:re,Row:ae,ExpandHeader:fe,ControlCell:de,RowExpandButton:he,ExpandedRow:Q};function $(e){let t=c(10),n,r,i;if(t[0]===e?(n=t[1],r=t[2],i=t[3]):({direction:n,mode:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i),n===`unsorted`||!r||!n){let e;return t[4]===i?e=t[5]:(e=/* @__PURE__ */ _(`svg`,{"aria-hidden":!0,...i}),t[4]=i,t[5]=e),e}let o;return t[6]!==n||t[7]!==r||t[8]!==i?(o=/* @__PURE__ */ _(a,{mode:r,direction:n,...i}),t[6]=n,t[7]=r,t[8]=i,t[9]=o):o=t[9],o}function _e(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(A(typeof n==`string`?n:`unsorted`,t)){case`unsorted`:e.clearSorting();return;case`asc`:e.toggleSorting(!1);return;case`desc`:e.toggleSorting(!0);return;default:return}}export{ge as DataTable,Z as expandedRowId};
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-CZ-q7fYv.js";import{t as r}from"./button-Cwrv2Mwv.js";import{t as i}from"./use-prefers-reduced-motion-DimzRx-M.js";import{t as a}from"./icons-CDLz5lpI.js";import{n as o}from"./sandboxed-on-click-C7pPu-2M.js";import{t as s}from"./table-DBbKqOVq.js";import{c}from"react/compiler-runtime";import{Fragment as l,createContext as u,useContext as d,useEffect as f,useRef as p,useState as m}from"react";import h from"tiny-invariant";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{Subscribe as y,callMemoOrStaticFn as b,flexRender as x}from"@tanstack/react-table";import{MinusIcon as S}from"@phosphor-icons/react/Minus";import{PlusIcon as C}from"@phosphor-icons/react/Plus";import{column_getIsSorted as w,row_getIsExpanded as T,row_getVisibleCells as E,table_getVisibleLeafColumns as D}from"@tanstack/react-table/static-functions";export*from"@tanstack/react-table";const O=[`unsorted`,`asc`,`desc`],k=[`unsorted`,`desc`,`asc`];function A(e,t){return j(t===`alphanumeric`?O:k,e)??`unsorted`}function j(e,t,n){if(e.length===0)return n;let r=e.findIndex(e=>e===t);if(r===-1)return n;let i=(r+1)%e.length;return e.at(i)??n}function M(e){if(typeof e==`object`&&e&&`width`in e)return e.width===`fit`?`fit`:void 0}const N=u(null);function P(){return d(N)?.table.options}function F(){let e=d(N);return h(e,`useDataTableContext should only be used within a DataTable child component`),e}const I=u(null),L=/* @__PURE__ */ new Set;function R(e){return[...e.querySelectorAll(`:scope > tr`)]}function ee(e){let[,t=`0px`]=getComputedStyle(e).translate.split(` `);return e.offsetTop+(Number.parseFloat(t)||0)}function te(e,t,n){let r=/* @__PURE__ */ new Map,i=0,a=0;for(let o of R(e)){o.hasAttribute(`data-closing`)?a+=o.offsetHeight:(i+=a,a=0);let e=-i,s=t.get(o),c=s==null||Math.abs(s-o.offsetTop-e)<.5?e:s-o.offsetTop;r.set(o,o.offsetTop+e);let l=n.get(o);if(c!==e||(l?.to??0)!==e){if(n.delete(o),c!==e||e!==0){let t=o.animate([{translate:`0 ${c}px`},{translate:`0 ${e}px`}],{duration:c===e?0:200,easing:`cubic-bezier(0.23, 1, 0.32, 1)`,fill:e===0?`none`:`forwards`});n.set(o,{animation:t,to:e})}l?.animation.cancel()}}return r}function ne(){let e=c(14),[t,n]=m(L),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=/* @__PURE__ */ new Map,e[0]=r):r=e[0];let a=p(r),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=/* @__PURE__ */ new Map,e[1]=o):o=e[1];let s=p(o),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=/* @__PURE__ */ new WeakMap,e[2]=l):l=e[2];let u=p(l),d,h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=a.current,t=s.current;return()=>{for(let{timer:t}of e.values())clearTimeout(t);for(let{observer:e}of t.values())e.disconnect()}},h=[],e[3]=d,e[4]=h):(d=e[3],h=e[4]),f(d,h);let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{n(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},e[5]=g):g=e[5];let _=g,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{let t=s.current.get(e);if(t!=null&&t.before==null){for(let t of a.current.values())if(t.body===e)return;t.observer.disconnect(),s.current.delete(e)}},e[6]=v):v=e[6];let y=v,b;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(e,t)=>{let n=s.current.get(e),r=t.filter(t=>t.type===`childList`?t.target===e:t.target.parentNode===e);if(n==null||r.length===0)return;let i=n.awaiting==null?null:a.current.get(n.awaiting);for(let e of r){let{target:t}=e;i!=null&&e.type===`attributes`&&t instanceof Element&&t.hasAttribute(`data-closing`)&&i.rows.add(t)}i!=null&&i.rows.size>0&&(n.awaiting=null);for(let[t,n]of a.current)n.body===e&&n.rows.size>0&&![...n.rows].some(ie)&&(clearTimeout(n.timer),a.current.delete(t),_(t));let o=n.before??n.rest;n.before=null,n.rest=te(e,o,u.current),y(e)},e[7]=b):b=e[7];let x=b,S;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{let t=s.current.get(e);if(t==null){let n=new MutationObserver(t=>x(e,t));n.observe(e,{attributeFilter:[`data-closing`],childList:!0,subtree:!0}),t={observer:n,before:null,rest:/* @__PURE__ */ new Map,awaiting:null},s.current.set(e,t)}if(t.before==null){let n=new Map(R(e).map(re));t.before=n;let r=t;requestAnimationFrame(()=>{r.before===n&&(r.before=null,y(e))})}return t},e[8]=S):S=e[8];let C=S,w;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(e,t)=>{e!=null&&!i()&&C(e),t()},e[9]=w):w=e[9];let T=w,E;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{let t=a.current.get(e);t!=null&&(clearTimeout(t.timer),a.current.delete(e),C(t.body)),_(e)},e[10]=E):E=e[10];let D=E,O;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(O=(e,t,r)=>{t==null||i()?r():(D(e),C(t).awaiting=e,a.current.set(e,{body:t,rows:/* @__PURE__ */ new Set,timer:setTimeout(()=>{a.current.delete(e),C(t),_(e),r()},200)}),n(t=>new Set(t).add(e)))},e[11]=O):O=e[11];let k=O,A;return e[12]===t?A=e[13]:(A={closingRowIds:t,startExpand:T,startCollapse:k,cancelCollapse:D},e[12]=t,e[13]=A),A}function re(e){return[e,ee(e)]}function ie(e){return e.isConnected}function ae(e){let n=c(21),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({"data-slot":i,children:r,table:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let l;n[5]===o?l=n[6]:(l={table:o},n[5]=o,n[6]=l);let u=l,d=ne(),f;n[7]===i?f=n[8]:(f=t(i,`data-table`),n[7]=i,n[8]=f);let p;n[9]===r?p=n[10]:(p=/* @__PURE__ */ _(s.Element,{children:r}),n[9]=r,n[10]=p);let m;n[11]!==a||n[12]!==f||n[13]!==p?(m=/* @__PURE__ */ _(s.Root,{"data-slot":f,...a,children:p}),n[11]=a,n[12]=f,n[13]=p,n[14]=m):m=n[14];let h;n[15]!==d||n[16]!==m?(h=/* @__PURE__ */ _(I.Provider,{value:d,children:m}),n[15]=d,n[16]=m,n[17]=h):h=n[17];let g;return n[18]!==u||n[19]!==h?(g=/* @__PURE__ */ _(N.Provider,{value:u,children:h}),n[18]=u,n[19]=h,n[20]=g):g=n[20],g}function oe(r){let i=c(33),a,o,s,l,u,d,f,p,m,h,g,v;i[0]===r?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],v=i[12]):({"data-slot":l,appearance:m,children:a,className:o,column:s,disableSorting:h,iconPlacement:g,intent:v,sortingMode:p,sortIcon:d,onClick:u,...f}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=p,i[9]=m,i[10]=h,i[11]=g,i[12]=v);let b=m===void 0?`ghost`:m,x=h!==void 0&&h,S=g===void 0?`end`:g,C=v===void 0?`neutral`:v,w;i[13]!==b||i[14]!==a||i[15]!==o||i[16]!==s||i[17]!==l||i[18]!==x||i[19]!==S||i[20]!==C||i[21]!==u||i[22]!==d||i[23]!==f||i[24]!==p?(w=()=>{let r=s.getIsSorted(),i=!x&&s.getCanSort(),c=i&&typeof r==`string`?r:`unsorted`;if(!i)return/* @__PURE__ */ _(`span`,{"data-slot":t(l,`data-table-header-sort-button`),"data-sort-direction":`unsorted`,className:e(`flex w-full items-center justify-start`,b===`ghost`&&C===`neutral`&&`text-muted`,o),...f,children:a});let m=d?.(c)??/* @__PURE__ */ _(ye,{mode:p,direction:c});return/* @__PURE__ */ _(n,{appearance:b,"data-slot":t(l,`data-table-header-sort-button`),className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none`,b===`ghost`&&C===`neutral`&&`text-muted`,o),"data-sort-direction":c,"data-table-header-action":!0,icon:m,iconPlacement:S,onClick:e=>{u?.(e),!e.defaultPrevented&&p!==void 0&&be(s,p)},intent:C,type:`button`,...f,children:a})},i[13]=b,i[14]=a,i[15]=o,i[16]=s,i[17]=l,i[18]=x,i[19]=S,i[20]=C,i[21]=u,i[22]=d,i[23]=f,i[24]=p,i[25]=w):w=i[25];let T=w,E=P(),D;i[26]!==s||i[27]!==E?(D=()=>({sorted:s.getIsSorted(),options:E}),i[26]=s,i[27]=E,i[28]=D):D=i[28];let O;return i[29]!==s.table.store||i[30]!==T||i[31]!==D?(O=/* @__PURE__ */ _(y,{source:s.table.store,selector:D,children:T}),i[29]=s.table.store,i[30]=T,i[31]=D,i[32]=O):O=i[32],O}const z=`w-px whitespace-nowrap`;function B(e){if(e==null)return;let t=b(e,`getIsSorted`,w);if(t===`asc`)return`ascending`;if(t===`desc`)return`descending`}function V(n){let r=c(21),i,a,o,l,u;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4],u=r[5]):({"data-slot":l,children:i,className:a,column:o,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=u);let d;r[6]!==i||r[7]!==a||r[8]!==o||r[9]!==l||r[10]!==u?(d=()=>{let n=M(o?.columnDef.meta);return/* @__PURE__ */ _(s.Header,{"aria-sort":B(o),"data-column-width":n,"data-slot":t(l,`data-table-header`),className:e(`has-data-table-header-action:px-0`,n===`fit`&&z,a),...u,children:i})},r[6]=i,r[7]=a,r[8]=o,r[9]=l,r[10]=u,r[11]=d):d=r[11];let f=d,p=P();if(o==null){let e;return r[12]===f?e=r[13]:(e=f(),r[12]=f,r[13]=e),e}let m;r[14]!==o||r[15]!==p?(m=()=>({ariaSort:B(o),options:p}),r[14]=o,r[15]=p,r[16]=m):m=r[16];let h;return r[17]!==o.table.store||r[18]!==f||r[19]!==m?(h=/* @__PURE__ */ _(y,{source:o.table.store,selector:m,children:f}),r[17]=o.table.store,r[18]=f,r[19]=m,r[20]=h):h=r[20],h}function H(n){let r=c(17),i,a,o,l;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4]):({"data-slot":o,className:i,column:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l);let u=a?.columnDef.meta,d;r[5]===u?d=r[6]:(d=M(u),r[5]=u,r[6]=d);let f=d,p;r[7]===o?p=r[8]:(p=t(o,`data-table-cell`),r[7]=o,r[8]=p);let m=f===`fit`&&z,h;r[9]!==i||r[10]!==m?(h=e(m,i),r[9]=i,r[10]=m,r[11]=h):h=r[11];let g;return r[12]!==l||r[13]!==p||r[14]!==h||r[15]!==f?(g=/* @__PURE__ */ _(s.Cell,{"data-column-width":f,"data-slot":p,className:h,...l}),r[12]=l,r[13]=p,r[14]=h,r[15]=f,r[16]=g):g=r[16],g}const U=e=>{let n=c(8),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(r,`data-table-body`),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=/* @__PURE__ */ _(s.Body,{"data-slot":a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o};function W(e){let n=c(11),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{table:a}=F(),o;n[3]===r?o=n[4]:(o=t(r,`data-table-head`),n[3]=r,n[4]=o);let l;n[5]===a?l=n[6]:(l=a.getHeaderGroups().map(G),n[5]=a,n[6]=l);let u;return n[7]!==i||n[8]!==o||n[9]!==l?(u=/* @__PURE__ */ _(s.Head,{"data-slot":o,...i,children:l}),n[7]=i,n[8]=o,n[9]=l,n[10]=u):u=n[10],u}function G(e){return/* @__PURE__ */ _(s.Row,{children:e.headers.map(K)},e.id)}function K(e){return/* @__PURE__ */ _(l,{children:e.isPlaceholder?/* @__PURE__ */ _(s.Header,{}):x(e.column.columnDef.header,e.getContext())},e.id)}const q=e(`starting:-translate-y-1 starting:opacity-0`,`motion-safe:transition-[opacity,translate] motion-safe:duration-200 motion-safe:ease-out-strong`,`data-closing:pointer-events-none data-closing:opacity-0 motion-safe:data-closing:duration-150`);function J(e,t){return t.size===0||e.depth===0?!1:e.getParentRows().some(e=>t.has(e.id))}const Y=u(!1);function se(e){if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=e.currentTarget.ownerDocument.getSelection();return t==null||t.isCollapsed?!0:!e.currentTarget.contains(t.anchorNode)}function ce(n){let r=c(21),i,a,o,l,u,f;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4],u=r[5],f=r[6]):({"data-slot":a,className:i,onClick:o,renderExpanded:u,row:f,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=u,r[6]=f);let p=d(I)?.closingRowIds??L,m;r[7]!==i||r[8]!==p||r[9]!==a||r[10]!==o||r[11]!==l||r[12]!==u||r[13]!==f?(m=()=>{let n=J(f,p),r=b(f,`getIsExpanded`,T),c=b(f,`getVisibleCells`,E),d=/* @__PURE__ */ _(s.Row,{"data-slot":t(a,`data-table-row`),"data-expanded":r||void 0,"data-closing":n||void 0,inert:n||void 0,"data-clickable":o==null?void 0:``,className:e(f.depth>0&&q,o!=null&&`cursor-pointer`,i),onClick:o&&(e=>{se(e)&&o(e)}),...l,children:/* @__PURE__ */ _(Y.Provider,{value:u!=null,children:c.map(le)})});return u==null?d:/* @__PURE__ */ v(g,{children:[d,r&&/* @__PURE__ */ _($,{row:f,children:u(f)})]})},r[7]=i,r[8]=p,r[9]=a,r[10]=o,r[11]=l,r[12]=u,r[13]=f,r[14]=m):m=r[14];let h=m,x=P(),S;r[15]===x?S=r[16]:(S=e=>({state:e,options:x}),r[15]=x,r[16]=S);let C;return r[17]!==h||r[18]!==f.table.store||r[19]!==S?(C=/* @__PURE__ */ _(y,{source:f.table.store,selector:S,children:h}),r[17]=h,r[18]=f.table.store,r[19]=S,r[20]=C):C=r[20],C}function le(e){return/* @__PURE__ */ _(l,{children:x(e.column.columnDef.cell,e.getContext())},e.id)}function ue(e){let n=c(15),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({"data-slot":i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{table:o}=F(),l;n[4]===o?l=n[5]:(l=b(o,`getVisibleLeafColumns`,D),n[4]=o,n[5]=l);let u=l.length,d;n[6]===i?d=n[7]:(d=t(i,`data-table-empty-row`),n[6]=i,n[7]=d);let f;n[8]!==r||n[9]!==u?(f=/* @__PURE__ */ _(s.Cell,{colSpan:u,children:r}),n[8]=r,n[9]=u,n[10]=f):f=n[10];let p;return n[11]!==a||n[12]!==d||n[13]!==f?(p=/* @__PURE__ */ _(s.Row,{"data-slot":d,...a,children:f}),n[11]=a,n[12]=d,n[13]=f,n[14]=p):p=n[14],p}function X(){let t=c(1),n;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=/* @__PURE__ */ _(`span`,{"aria-hidden":!0,className:e(`pointer-events-none absolute -inset-y-px -left-1.5 w-1.5`,`opacity-0 transition-opacity group-data-sticky-active/table:opacity-100`,`shadow-[1px_0_0_0_var(--border-color-card-muted)]`,`bg-linear-to-l to-transparent`,`from-[color-mix(in_oklab,var(--shadow-color)_var(--shadow-second-opacity),transparent)]`)}),t[0]=n):n=t[0],n}function de(n){let r=c(21),i,a,l,u,d;r[0]===n?(i=r[1],a=r[2],l=r[3],u=r[4],d=r[5]):({"data-slot":l,children:i,className:a,onClick:u,...d}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=l,r[4]=u,r[5]=d);let f;r[6]===u?f=r[7]:(f=o({allowClickEventDefault:!0,onClick:u}),r[6]=u,r[7]=f);let{onClick:p}=f,m;r[8]===l?m=r[9]:(m=t(l,`data-table-action-cell`),r[8]=l,r[9]=m);let h;r[10]===a?h=r[11]:(h=e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,a),r[10]=a,r[11]=h);let g;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=/* @__PURE__ */ _(X,{}),r[12]=g):g=r[12];let y;r[13]===i?y=r[14]:(y=/* @__PURE__ */ _(`span`,{"data-slot":`data-table-action-cell-label`,className:`contents`,children:i}),r[13]=i,r[14]=y);let b;return r[15]!==d||r[16]!==p||r[17]!==m||r[18]!==h||r[19]!==y?(b=/* @__PURE__ */ v(s.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":m,className:h,onClick:p,...d,children:[g,y]}),r[15]=d,r[16]=p,r[17]=m,r[18]=h,r[19]=y,r[20]=b):b=r[20],b}function fe(n){let r=c(27),i,a,o,l;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4]):({"data-slot":o,children:i,className:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l);let{table:u}=F(),d;r[5]===u?d=r[6]:(d=u.getRowModel(),r[5]=u,r[6]=d);let f=d.rows.length>0,p;r[7]===f?p=r[8]:(p=f?{"data-mantle-table-sticky-right":!0}:{},r[7]=f,r[8]=p);let m;r[9]===o?m=r[10]:(m=t(o,`data-table-action-header`),r[9]=o,r[10]=m);let h=f&&`sticky z-10 right-0 bg-inherit`,g;r[11]!==a||r[12]!==h?(g=e(h,a),r[11]=a,r[12]=h,r[13]=g):g=r[13];let y;r[14]===i?y=r[15]:(y=i??/* @__PURE__ */ _(`span`,{className:`sr-only`,children:`Actions`}),r[14]=i,r[15]=y);let b;r[16]===y?b=r[17]:(b=/* @__PURE__ */ _(`span`,{"data-slot":`data-table-action-header-label`,className:`contents`,children:y}),r[16]=y,r[17]=b);let x;r[18]===f?x=r[19]:(x=f&&/* @__PURE__ */ _(X,{}),r[18]=f,r[19]=x);let S;return r[20]!==l||r[21]!==p||r[22]!==m||r[23]!==g||r[24]!==b||r[25]!==x?(S=/* @__PURE__ */ v(s.Header,{...p,"data-slot":m,className:g,...l,children:[b,x]}),r[20]=l,r[21]=p,r[22]=m,r[23]=g,r[24]=b,r[25]=x,r[26]=S):S=r[26],S}function pe(e){return e!=null&&`nodeType`in e}function me({"data-slot":n,children:r,className:i,onClick:a,...o}){let c=p(!1);return/* @__PURE__ */ _(s.Cell,{"data-slot":t(n,`data-table-control-cell`),className:e(`w-9 px-0 align-top has-[button:enabled,input:enabled]:cursor-pointer`,i),onClick:e=>{if(c.current){e.stopPropagation();return}a?.(e);let t=e.currentTarget.querySelector(`button:not(:disabled), input:not(:disabled)`);if(t!=null&&(e.stopPropagation(),!e.defaultPrevented&&pe(e.target)&&!t.contains(e.target))){t.focus({preventScroll:!0}),c.current=!0;try{t.click()}finally{c.current=!1}}},...o,children:/* @__PURE__ */ _(`span`,{"data-slot":`data-table-control-cell-label`,className:`flex h-lh items-center justify-center`,children:r})})}function Z(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function Q(n){let r=c(16),i,a,o,l;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4]):({"data-slot":o,children:i,className:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l);let u;r[5]===o?u=r[6]:(u=t(o,`data-table-expand-header`),r[5]=o,r[6]=u);let d;r[7]===a?d=r[8]:(d=e(`w-9 px-0 text-center`,a),r[7]=a,r[8]=d);let f;r[9]===i?f=r[10]:(f=i??/* @__PURE__ */ _(`span`,{className:`sr-only`,children:`Row details`}),r[9]=i,r[10]=f);let p;return r[11]!==l||r[12]!==u||r[13]!==d||r[14]!==f?(p=/* @__PURE__ */ _(s.Header,{"data-slot":u,className:d,...l,children:f}),r[11]=l,r[12]=u,r[13]=d,r[14]=f,r[15]=p):p=r[15],p}const he=/* @__PURE__ */ _(C,{weight:`bold`,className:`size-3.5`}),ge=/* @__PURE__ */ _(S,{weight:`bold`,className:`size-3.5`});function _e(n){let i=c(21),a,o,s,l,u,f,p,m,h,g,v;i[0]===n?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],f=i[6],p=i[7],m=i[8],h=i[9],g=i[10],v=i[11]):({"data-slot":o,appearance:p,className:a,collapseIcon:m,expandIcon:h,intent:g,label:s,onClick:l,row:f,size:v,...u}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=f,i[7]=p,i[8]=m,i[9]=h,i[10]=g,i[11]=v);let b=p===void 0?`ghost`:p,x=m===void 0?ge:m,S=h===void 0?he:h,C=g===void 0?`neutral`:g,w=v===void 0?`sm`:v,T=()=>{if(!f.getCanExpand())return null;let n=f.getIsExpanded()&&!k,i=f.getToggleExpandedHandler(),c=f.subRows.length>0,d=D||!c;return/* @__PURE__ */ _(r,{type:`button`,"data-slot":t(o,`data-table-row-expand-button`),appearance:b,intent:C,size:w,className:e(`rounded`,a),"aria-expanded":n,"aria-controls":n&&d?Z(f):void 0,icon:n?x:S,label:c?`${n?`Collapse`:`Expand`} ${s}`:`${n?`Hide`:`Show`} details for ${s}`,onClick:e=>{if(e.stopPropagation(),l?.(e),e.defaultPrevented)return;let t=e.currentTarget.closest(`tbody`);O==null?i():k?O.cancelCollapse(f.id):n?O.startCollapse(f.id,t,()=>f.toggleExpanded(!1)):O.startExpand(t,i)},...u})},E=P(),D=d(Y),O=d(I),k=O?.closingRowIds.has(f.id)??!1,A;i[12]!==D||i[13]!==k||i[14]!==E||i[15]!==f?(A=()=>({isExpanded:f.getIsExpanded(),hasDetailPanel:D,isClosing:k,options:E}),i[12]=D,i[13]=k,i[14]=E,i[15]=f,i[16]=A):A=i[16];let j;return i[17]!==T||i[18]!==f.table.store||i[19]!==A?(j=/* @__PURE__ */ _(y,{source:f.table.store,selector:A,children:T}),i[17]=T,i[18]=f.table.store,i[19]=A,i[20]=j):j=i[20],j}function $(n){let r=c(29),i,a,o,l,u,f;r[0]===n?(i=r[1],a=r[2],o=r[3],l=r[4],u=r[5],f=r[6]):({"data-slot":l,children:i,className:a,colSpan:o,row:f,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=u,r[6]=f);let p;r[7]===f?p=r[8]:(p=()=>b(f,`getVisibleCells`,E).length,r[7]=f,r[8]=p);let m=p,h=d(I)?.closingRowIds??L,g;r[9]!==h||r[10]!==f?(g=h.has(f.id)||J(f,h),r[9]=h,r[10]=f,r[11]=g):g=r[11];let v=g,x;r[12]!==i||r[13]!==a||r[14]!==l||r[15]!==v||r[16]!==u||r[17]!==f?(x=n=>{let{numberOfColumns:r}=n;return/* @__PURE__ */ _(s.Row,{"data-slot":t(l,`data-table-expanded-row`),"data-expanded-content":!0,"data-closing":v||void 0,inert:v||void 0,className:e(`[&>td]:border-t-0`,q,a),...u,children:/* @__PURE__ */ _(s.Cell,{id:Z(f),colSpan:r,className:`bg-card font-sans text-body`,children:i})})},r[12]=i,r[13]=a,r[14]=l,r[15]=v,r[16]=u,r[17]=f,r[18]=x):x=r[18];let S=x,C=P();if(o!=null){let e;return r[19]!==o||r[20]!==S?(e=S({numberOfColumns:o}),r[19]=o,r[20]=S,r[21]=e):e=r[21],e}let w;r[22]!==m||r[23]!==C?(w=()=>({numberOfColumns:m(),options:C}),r[22]=m,r[23]=C,r[24]=w):w=r[24];let T;return r[25]!==S||r[26]!==f.table.store||r[27]!==w?(T=/* @__PURE__ */ _(y,{source:f.table.store,selector:w,children:S}),r[25]=S,r[26]=f.table.store,r[27]=w,r[28]=T):T=r[28],T}const ve={Root:ae,ActionCell:de,ActionHeader:fe,Cell:H,Body:U,EmptyRow:ue,Head:W,Header:V,HeaderSortButton:oe,Row:ce,ExpandHeader:Q,ControlCell:me,RowExpandButton:_e,ExpandedRow:$};function ye(e){let t=c(10),n,r,i;if(t[0]===e?(n=t[1],r=t[2],i=t[3]):({direction:n,mode:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i),n===`unsorted`||!r||!n){let e;return t[4]===i?e=t[5]:(e=/* @__PURE__ */ _(`svg`,{"aria-hidden":!0,...i}),t[4]=i,t[5]=e),e}let o;return t[6]!==n||t[7]!==r||t[8]!==i?(o=/* @__PURE__ */ _(a,{mode:r,direction:n,...i}),t[6]=n,t[7]=r,t[8]=i,t[9]=o):o=t[9],o}function be(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(A(typeof n==`string`?n:`unsorted`,t)){case`unsorted`:e.clearSorting();return;case`asc`:e.toggleSorting(!1);return;case`desc`:e.toggleSorting(!0);return;default:return}}export{ve as DataTable,Z as expandedRowId};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { n as WithAsChild } from "./as-child-
|
|
2
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
3
|
-
import "./index-
|
|
1
|
+
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
3
|
+
import "./index-C6s5cGCr.js";
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
|
-
//#region src/components/description-list/description-list.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Props for `DescriptionList.Root`.
|
|
8
7
|
*/
|
|
@@ -219,5 +218,4 @@ declare const DescriptionList: {
|
|
|
219
218
|
*/
|
|
220
219
|
readonly Value: typeof Value;
|
|
221
220
|
};
|
|
222
|
-
//#endregion
|
|
223
221
|
export { DescriptionList, type DescriptionListItemProps, type DescriptionListLabelProps, type DescriptionListProps, type DescriptionListValueProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-Cwrv2Mwv.js";import{t as r}from"./layer-container-DLf-6eBz.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./primitive-AGoxSJBI.js";import{c as f}from"react/compiler-runtime";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{XIcon as h}from"@phosphor-icons/react/X";const g=c,_=e=>{let n=f(8),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=t(r,`dialog-trigger`),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==o?(s=/* @__PURE__ */ p(a,{"data-slot":o,...i}),n[5]=i,n[6]=o,n[7]=s):s=n[7],s},v=i,y=e=>{let n=f(8),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(r,`dialog-close`),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=/* @__PURE__ */ p(d,{"data-slot":a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o},b=n=>{let r=f(14),i,a,s,c;r[0]===n?(i=r[1],a=r[2],s=r[3],c=r[4]):({"data-slot":a,className:i,ref:c,...s}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=s,r[4]=c);let l;r[5]===a?l=r[6]:(l=t(a,`dialog-overlay`),r[5]=a,r[6]=l);let u;r[7]===i?u=r[8]:(u=e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-60 backdrop-blur-xs`,i),r[7]=i,r[8]=u);let d;return r[9]!==s||r[10]!==c||r[11]!==l||r[12]!==u?(d=/* @__PURE__ */ p(o,{ref:c,"data-slot":l,className:u,...s}),r[9]=s,r[10]=c,r[11]=l,r[12]=u,r[13]=d):d=r[13],d},x={centered:`inset-4`,"full-page":`inset-4`,"full-bleed":`inset-0`},S={centered:`border-dialog rounded-xl border`,"full-page":`border-dialog h-full max-w-none rounded-xl border`,"full-bleed":`h-full max-w-none`},C={Root:g,Body:n=>{let r=f(12),i,a,o;r[0]===n?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=t(a,`dialog-body`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ p(`div`,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Close:y,CloseIconButton:e=>{let r=f(19),i,a,o,s,c,l,u;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6],u=r[7]):({"data-slot":i,size:o,type:s,label:c,appearance:l,intent:u,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c,r[6]=l,r[7]=u);let m=o===void 0?`md`:o,g=s===void 0?`button`:s,_=c===void 0?`Close Dialog`:c,v=l===void 0?`ghost`:l,y=u===void 0?`neutral`:u,b;r[8]===i?b=r[9]:(b=t(i,`dialog-close-icon-button`),r[8]=i,r[9]=b);let x;r[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=/* @__PURE__ */ p(h,{}),r[10]=x):x=r[10];let S;return r[11]!==v||r[12]!==y||r[13]!==_||r[14]!==a||r[15]!==m||r[16]!==b||r[17]!==g?(S=/* @__PURE__ */ p(d,{asChild:!0,children:/* @__PURE__ */ p(n,{appearance:v,"data-slot":b,icon:x,intent:y,label:_,size:m,type:g,...a})}),r[11]=v,r[12]=y,r[13]=_,r[14]=a,r[15]=m,r[16]=b,r[17]=g,r[18]=S):S=r[18],S},Content:n=>{let i=f(27),a,o,c,l,u,d,h;i[0]===n?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5],d=i[6],h=i[7]):({"data-slot":c,appearance:h,children:a,className:o,preferredWidth:l,ref:d,...u}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u,i[6]=d,i[7]=h);let g=h===void 0?`centered`:h,_;i[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=/* @__PURE__ */ p(b,{}),i[8]=_):_=i[8];let y=x[g],C;i[9]===y?C=i[10]:(C=e(`fixed z-60 flex items-center justify-center`,y),i[9]=y,i[10]=C);let w;i[11]===c?w=i[12]:(w=t(c,`dialog-content`),i[11]=c,i[12]=w);let T=S[g],E=g===`centered`&&(l??`max-w-lg`),D;i[13]!==o||i[14]!==T||i[15]!==E?(D=e(`flex max-h-full w-full flex-1 flex-col`,`outline-hidden focus-within:outline-hidden`,`bg-dialog shadow-lg transition-transform duration-200`,`data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,T,E,o),i[13]=o,i[14]=T,i[15]=E,i[16]=D):D=i[16];let O;i[17]!==g||i[18]!==a||i[19]!==u||i[20]!==d||i[21]!==w||i[22]!==D?(O=/* @__PURE__ */ p(s,{"data-appearance":g,"data-mantle-modal-content":!0,"data-slot":w,className:D,ref:d,...u,children:a}),i[17]=g,i[18]=a,i[19]=u,i[20]=d,i[21]=w,i[22]=D,i[23]=O):O=i[23];let k;return i[24]!==C||i[25]!==O?(k=/* @__PURE__ */ m(v,{children:[_,/* @__PURE__ */ p(r,{"data-slot":`dialog-positioner`,className:C,children:O})]}),i[24]=C,i[25]=O,i[26]=k):k=i[26],k},Description:n=>{let r=f(14),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=t(a,`dialog-description`),r[5]=a,r[6]=c);let u;r[7]===i?u=r[8]:(u=e(`text-muted`,i),r[7]=i,r[8]=u);let d;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==u?(d=/* @__PURE__ */ p(l,{ref:s,"data-slot":c,className:u,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=u,r[13]=d):d=r[13],d},Footer:n=>{let r=f(12),i,a,o;r[0]===n?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=t(a,`dialog-footer`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-4`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ p(`div`,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Header:n=>{let r=f(14),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":o,className:a,children:i,...s}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===o?c=r[6]:(c=t(o,`dialog-header`),r[5]=o,r[6]=c);let l;r[7]===a?l=r[8]:(l=e(`border-dialog-muted text-strong relative flex shrink-0 flex-wrap items-center justify-between gap-2 border-b px-6 py-4`,`[&>[data-slot~=dialog-title]]:flex-1`,`[&>[data-slot~=dialog-description]]:order-last [&>[data-slot~=dialog-description]]:basis-full`,`has-[.icon-button]:pr-4`,a),r[7]=a,r[8]=l);let u;return r[9]!==i||r[10]!==s||r[11]!==c||r[12]!==l?(u=/* @__PURE__ */ p(`div`,{"data-slot":c,className:l,...s,children:i}),r[9]=i,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u},Overlay:b,Portal:v,Title:n=>{let r=f(14),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=t(a,`dialog-title`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=e(`text-strong truncate text-lg font-medium`,i),r[7]=i,r[8]=l);let d;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(d=/* @__PURE__ */ p(u,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=d):d=r[13],d},Trigger:_};export{C as t};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
2
|
-
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-
|
|
3
|
-
import { a as Portal, c as Trigger$1, i as Overlay$1, n as Content$1, r as Description$1, s as Title$1, t as Close$1 } from "./dialog-
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
2
|
+
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-BFAvonp1.js";
|
|
3
|
+
import { a as Portal, c as Trigger$1, i as Overlay$1, n as Content$1, r as Description$1, s as Title$1, t as Close$1 } from "./dialog-Dp0QGWwo.js";
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
|
-
//#region src/components/dialog/dialog.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* A button that opens the dialog.
|
|
8
7
|
*
|
|
@@ -914,5 +913,4 @@ declare const Dialog: {
|
|
|
914
913
|
*/
|
|
915
914
|
readonly Trigger: typeof Trigger;
|
|
916
915
|
};
|
|
917
|
-
//#endregion
|
|
918
916
|
export { Dialog as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, ComponentPropsWithoutRef, Ref } from "react";
|
|
2
2
|
import { Content, Description, Overlay, Portal } from "@radix-ui/react-dialog";
|
|
3
|
-
//#region src/components/dialog/primitive.d.ts
|
|
4
3
|
type DialogPrimitiveContentProps = ComponentProps<typeof Content>;
|
|
5
4
|
declare const Root$1: import("react").FC<import("@radix-ui/react-dialog").DialogProps>;
|
|
6
5
|
declare const Trigger$1: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -26,5 +25,4 @@ declare const Description$1: ({ asChild, children, ref, ...props }: ComponentPro
|
|
|
26
25
|
* Type guard to check if the event target is the overlay component
|
|
27
26
|
*/
|
|
28
27
|
declare function isDialogOverlayTarget(target: EventTarget | null): boolean;
|
|
29
|
-
//#endregion
|
|
30
28
|
export { Portal$1 as a, Trigger$1 as c, Overlay$1 as i, isDialogOverlayTarget as l, Content$1 as n, Root$1 as o, Description$1 as r, Title$1 as s, Close$1 as t };
|
package/dist/dialog.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { l as isDialogOverlayTarget } from "./dialog-
|
|
2
|
-
import { t as Dialog } from "./dialog-
|
|
1
|
+
import { l as isDialogOverlayTarget } from "./dialog-Dp0QGWwo.js";
|
|
2
|
+
import { t as Dialog } from "./dialog-DedsCsnk.js";
|
|
3
3
|
export { Dialog, isDialogOverlayTarget };
|
package/dist/dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e}from"./primitive-AGoxSJBI.js";import{t}from"./dialog-
|
|
1
|
+
import{d as e}from"./primitive-AGoxSJBI.js";import{t}from"./dialog-D333NTyf.js";export{t as Dialog,e as isDialogOverlayTarget};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/sorting/direction.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Sorting modes
|
|
4
3
|
* - alphanumeric: Sort by alphanumeric order (A-Z, 0-9, Z-A, 9-0)
|
|
@@ -140,5 +139,4 @@ declare function $timeSortingDirection<T extends TimeSortingDirection | SortingD
|
|
|
140
139
|
readonly asc: "oldest-to-newest";
|
|
141
140
|
readonly desc: "newest-to-oldest";
|
|
142
141
|
}[(T & "asc") | (T & "desc")] | (T & "newest-to-oldest") | (T & "oldest-to-newest");
|
|
143
|
-
//#endregion
|
|
144
142
|
export { timeSortingDirections as _, AlphanumericSortingDirection as a, TimeSortingDirection as c, isSortingDirection as d, isSortingMode as f, timeSortingByDirection as g, sortingModes as h, $timeSortingDirection as i, alphanumericSortingDirections as l, sortingDirections as m, $sortingDirection as n, SortingDirection as o, isTimeSortingDirection as p, $sortingMode as r, SortingMode as s, $alphanumericSortingDirection as t, isAlphanumericSortingDirection as u };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
2
|
-
import { n as Separator } from "./separator-
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
2
|
+
import { n as Separator } from "./separator-DNovVsrx.js";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
import { CheckboxItem, Content, Group, Item, Label, RadioGroup, RadioItem, SubContent, SubTrigger, Trigger } from "@radix-ui/react-dropdown-menu";
|
|
5
|
-
//#region src/components/dropdown-menu/dropdown-menu.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* The trigger button that opens the dropdown menu.
|
|
8
7
|
*
|
|
@@ -765,5 +764,4 @@ declare const DropdownMenu: {
|
|
|
765
764
|
*/
|
|
766
765
|
readonly Trigger: typeof Trigger$1;
|
|
767
766
|
};
|
|
768
|
-
//#endregion
|
|
769
767
|
export { DropdownMenu as t };
|
package/dist/dropdown-menu.d.ts
CHANGED
package/dist/empty.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { n as WithAsChild } from "./as-child-
|
|
2
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
3
|
-
import { t as SvgAttributes } from "./icon-
|
|
1
|
+
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
3
|
+
import { t as SvgAttributes } from "./icon-CgNqu-fl.js";
|
|
4
4
|
import { ComponentProps, ReactNode } from "react";
|
|
5
|
-
//#region src/components/empty/empty.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* The root container for an empty state. Centers content horizontally
|
|
8
7
|
* with consistent vertical padding and max-width.
|
|
@@ -252,5 +251,4 @@ declare const Empty: {
|
|
|
252
251
|
*/
|
|
253
252
|
readonly Actions: typeof Actions;
|
|
254
253
|
};
|
|
255
|
-
//#endregion
|
|
256
254
|
export { Empty };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AriaAttributes, ReactNode } from "react";
|
|
2
|
-
//#region src/components/field/validation.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The shared validation state vocabulary for Mantle form controls.
|
|
5
4
|
*
|
|
@@ -94,5 +93,4 @@ declare const resolveValidation: (validation: ValidationProp | undefined) => "er
|
|
|
94
93
|
* controls receive `aria-invalid=false` unless `defaultAriaInvalid` is false.
|
|
95
94
|
*/
|
|
96
95
|
declare const parseValidation: ({ "aria-invalid": ariaInvalid, defaultAriaInvalid, validation: validationProp }: ParseValidationOptions) => ParsedValidation;
|
|
97
|
-
//#endregion
|
|
98
96
|
export { ValidationState as a, parseValidation as c, ValidationProp as i, resolveValidation as l, ParsedValidation as n, WithValidation as o, Validation as r, isAriaInvalid as s, AriaInvalid as t };
|
package/dist/field.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { n as WithAsChild } from "./as-child-
|
|
2
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
3
|
-
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-
|
|
4
|
-
import { a as ValidationState, c as parseValidation, i as ValidationProp, l as resolveValidation, n as ParsedValidation, o as WithValidation, r as Validation, s as isAriaInvalid, t as AriaInvalid } from "./field-
|
|
5
|
-
import { t as Label } from "./label-
|
|
6
|
-
import { t as Slot } from "./slot-
|
|
7
|
-
import { t as Popover } from "./popover-
|
|
1
|
+
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
3
|
+
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-BFAvonp1.js";
|
|
4
|
+
import { a as ValidationState, c as parseValidation, i as ValidationProp, l as resolveValidation, n as ParsedValidation, o as WithValidation, r as Validation, s as isAriaInvalid, t as AriaInvalid } from "./field-V_gnkcmN.js";
|
|
5
|
+
import { t as Label } from "./label-Dn5CPJUj.js";
|
|
6
|
+
import { t as Slot } from "./slot-C0OCJjdJ.js";
|
|
7
|
+
import { t as Popover } from "./popover-BfB2I9G0.js";
|
|
8
8
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
9
|
-
//#region src/components/field/field-context.d.ts
|
|
10
9
|
/**
|
|
11
10
|
* ARIA and identity props that `Field.Control` applies to the field's
|
|
12
11
|
* focusable control. `id` and `name` come from the surrounding `Field.Item`
|
|
@@ -35,16 +34,12 @@ type FieldControlAriaProps = {
|
|
|
35
34
|
*/
|
|
36
35
|
name?: string;
|
|
37
36
|
};
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/components/field/error-helpers.d.ts
|
|
40
37
|
/**
|
|
41
38
|
* A validation message accepted by `Field.Errors`. Non-string absence values
|
|
42
39
|
* are allowed so consumers can pass mapped validator output directly while
|
|
43
40
|
* still rendering only real strings.
|
|
44
41
|
*/
|
|
45
42
|
type FieldErrorMessage = string | null | undefined | false;
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/components/field/field.d.ts
|
|
48
43
|
/**
|
|
49
44
|
* Renders a semantic `<fieldset>` for grouping related controls under a
|
|
50
45
|
* single accessible name. Resets the default browser fieldset chrome
|
|
@@ -1236,8 +1231,6 @@ declare const Field: {
|
|
|
1236
1231
|
*/
|
|
1237
1232
|
readonly ErrorItem: typeof FieldErrorItem;
|
|
1238
1233
|
};
|
|
1239
|
-
//#endregion
|
|
1240
|
-
//#region src/components/field/field-error-messages.d.ts
|
|
1241
1234
|
/**
|
|
1242
1235
|
* Shapes commonly found in `field.state.meta.errors` from TanStack React Form
|
|
1243
1236
|
* across its built-in validators (Standard Schema / Zod issues, raw strings,
|
|
@@ -1269,5 +1262,4 @@ type FieldError = {
|
|
|
1269
1262
|
* ```
|
|
1270
1263
|
*/
|
|
1271
1264
|
declare const toErrorMessages: (errors: readonly FieldError[] | null | undefined) => string[];
|
|
1272
|
-
//#endregion
|
|
1273
1265
|
export { type AriaInvalid, Field, type FieldError, type ParsedValidation, type Validation, type ValidationProp, type ValidationState, type WithValidation, isAriaInvalid, parseValidation, resolveValidation, toErrorMessages };
|
package/dist/field.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./button-Bkl_QYpp.js";import{i as a,n as o,r as s,t as c}from"./field-CPvjazWN.js";import{n as l,r as u,t as d}from"./field-Bihblt8U.js";import{t as f}from"./label-nHqqYS7e.js";import{t as p}from"./popover-oQDUvcZ2.js";import{c as m}from"react/compiler-runtime";import{Children as h,Fragment as g,cloneElement as _,isValidElement as v,useContext as y,useId as b,useState as x}from"react";import S from"tiny-invariant";import{jsx as C}from"react/jsx-runtime";import{QuestionIcon as w}from"@phosphor-icons/react/Question";const T=e=>{let t=[],n=/* @__PURE__ */ new Set;for(let r of e??[]){if(typeof r!=`string`)continue;let e=r.trim();e.length===0||n.has(e)||(n.add(e),t.push(e))}return t},E=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),D=({children:e,errorItemType:t})=>{let n=!1;return h.forEach(e,e=>{n||e==null||typeof e==`boolean`||(typeof e==`string`?e.trim().length>0&&(n=!0):n=v(e)?e.type===t?E(e.props.children):e.type!==g||D({children:e.props.children,errorItemType:t}):!0)}),n},O=e=>{let r=m(14),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=n(a,`field-set`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=t(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,i),r[7]=i,r[8]=l);let u;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(u=/* @__PURE__ */ C(`fieldset`,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u},k=e=>{let n=m(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`text-strong mb-1.5 text-sm font-medium font-sans`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=/* @__PURE__ */ C(`legend`,{ref:a,"data-slot":`field-legend`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},A=e=>{let t=m(7),n,r;t[0]===e?(n=t[1],r=t[2]):({ref:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=y(l)?.controlId,a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=/* @__PURE__ */ C(f,{ref:r,...n,htmlFor:i}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a},j=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`p`,d;i[6]===s?d=i[7]:(d=n(s,`field-label-text`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`text-strong text-sm font-medium font-sans`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},M=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===s?d=i[7]:(d=n(s,`field-label-row`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`flex items-center gap-1`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},N=p.Root,P=/* @__PURE__ */ C(w,{}),F=e=>{let n=m(22),r,a,o,s,c,l,u,d,f;n[0]===e?(r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],d=n[8],f=n[9]):({appearance:c,className:r,icon:l,intent:u,label:a,ref:s,size:d,type:f,...o}=e,n[0]=e,n[1]=r,n[2]=a,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=u,n[8]=d,n[9]=f);let h=c===void 0?`ghost`:c,g=l===void 0?P:l,_=u===void 0?`neutral`:u,v=d===void 0?`xs`:d,y=f===void 0?`button`:f,b;n[10]===r?b=n[11]:(b=t(`text-body -my-0.5`,r),n[10]=r,n[11]=b);let x;return n[12]!==h||n[13]!==g||n[14]!==_||n[15]!==a||n[16]!==o||n[17]!==s||n[18]!==v||n[19]!==b||n[20]!==y?(x=/* @__PURE__ */ C(p.Trigger,{asChild:!0,children:/* @__PURE__ */ C(i,{ref:s,appearance:h,className:b,icon:g,intent:_,label:a,size:v,type:y,...o})}),n[12]=h,n[13]=g,n[14]=_,n[15]=a,n[16]=o,n[17]=s,n[18]=v,n[19]=b,n[20]=y,n[21]=x):x=n[21],x},I=e=>{let t=m(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({"data-slot":r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o;t[4]===r?o=t[5]:(o=n(r,`field-help-content`),t[4]=r,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=/* @__PURE__ */ C(p.Content,{ref:a,"data-slot":o,...i}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s},L=e=>{let i=m(18),a,o,s,c,l,u;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"data-slot":c,asChild:a,children:o,className:s,ref:u,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?r:`span`,f;i[7]===c?f=i[8]:(f=n(c,`field-optional`),i[7]=c,i[8]=f);let p;i[9]===s?p=i[10]:(p=t(`text-muted text-sm font-normal font-sans`,s),i[9]=s,i[10]=p);let h=o??`(Optional)`,g;return i[11]!==d||i[12]!==l||i[13]!==u||i[14]!==f||i[15]!==p||i[16]!==h?(g=/* @__PURE__ */ C(d,{ref:u,"data-slot":f,className:p,...l,children:h}),i[11]=d,i[12]=l,i[13]=u,i[14]=f,i[15]=p,i[16]=h,i[17]=g):g=i[17],g},R=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===s?d=i[7]:(d=n(s,`field-group`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`flex w-full flex-col gap-4`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},z=e=>{let i=m(37),o,s,u,d,f,p,h,g,_;i[0]===e?(o=i[1],s=i[2],u=i[3],d=i[4],f=i[5],p=i[6],h=i[7],g=i[8],_=i[9]):({"data-slot":d,asChild:o,children:s,className:u,id:f,name:p,ref:g,validation:_,...h}=e,i[0]=e,i[1]=o,i[2]=s,i[3]=u,i[4]=d,i[5]=f,i[6]=p,i[7]=h,i[8]=g,i[9]=_);let v=o?r:`div`,y=b(),S=f??y,w=b(),T=b(),[E,D]=x(!1),O=_??(E?`error`:void 0),k;i[10]===O?k=i[11]:(k=a(O),i[10]=O,i[11]=k);let A=k,j;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>(D(!0),()=>{D(!1)}),i[12]=j):j=i[12];let M=j,N;i[13]!==S||i[14]!==w||i[15]!==T||i[16]!==p||i[17]!==A?(N={controlId:S,descriptionId:w,errorId:T,name:p,registerError:M,validation:A},i[13]=S,i[14]=w,i[15]=T,i[16]=p,i[17]=A,i[18]=N):N=i[18];let P=N,F;i[19]===d?F=i[20]:(F=n(d,`field-item`),i[19]=d,i[20]=F);let I;i[21]===u?I=i[22]:(I=t(`flex w-full flex-col gap-1.5`,u),i[21]=u,i[22]=I);let L;i[23]!==v||i[24]!==s||i[25]!==h||i[26]!==g||i[27]!==F||i[28]!==I||i[29]!==A?(L=/* @__PURE__ */ C(v,{ref:g,"data-slot":F,"data-validation":A,className:I,...h,children:s}),i[23]=v,i[24]=s,i[25]=h,i[26]=g,i[27]=F,i[28]=I,i[29]=A,i[30]=L):L=i[30];let R;i[31]!==L||i[32]!==A?(R=/* @__PURE__ */ C(c,{validation:A,children:L}),i[31]=L,i[32]=A,i[33]=R):R=i[33];let z;return i[34]!==P||i[35]!==R?(z=/* @__PURE__ */ C(l.Provider,{value:P,children:R}),i[34]=P,i[35]=R,i[36]=z):z=i[36],z},B=e=>{let t=m(30),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let o=y(l),s,f,p,h,g,b,x,w,T;if(t[4]!==n||t[5]!==o||t[6]!==i||t[7]!==a){T=Symbol.for(`react.early_return_sentinel`);bb0:{let e=u({context:o});if(typeof n==`function`){T=/* @__PURE__ */ C(c,{validation:e.validation,children:/* @__PURE__ */ C(d.Provider,{value:o?e.ariaProps:null,children:n(e.ariaProps)})});break bb0}S(v(n),`Field.Control expects a single React element child (or a render-prop function). Got a non-element value (string, array, fragment, null, or undefined). Wrap the control in a single element, or use the function child form: <Field.Control>{(props) => <YourControl {...props} />}</Field.Control>.`),p=c,w=e.validation,f=d.Provider,x=o?e.ariaProps:null,s=r,h=a,g=i,b=_(n,e.ariaProps)}t[4]=n,t[5]=o,t[6]=i,t[7]=a,t[8]=s,t[9]=f,t[10]=p,t[11]=h,t[12]=g,t[13]=b,t[14]=x,t[15]=w,t[16]=T}else s=t[8],f=t[9],p=t[10],h=t[11],g=t[12],b=t[13],x=t[14],w=t[15],T=t[16];if(T!==Symbol.for(`react.early_return_sentinel`))return T;let E;t[17]!==s||t[18]!==h||t[19]!==g||t[20]!==b?(E=/* @__PURE__ */ C(s,{ref:h,...g,children:b}),t[17]=s,t[18]=h,t[19]=g,t[20]=b,t[21]=E):E=t[21];let D;t[22]!==f||t[23]!==x||t[24]!==E?(D=/* @__PURE__ */ C(f,{value:x,children:E}),t[22]=f,t[23]=x,t[24]=E,t[25]=D):D=t[25];let O;return t[26]!==p||t[27]!==w||t[28]!==D?(O=/* @__PURE__ */ C(p,{validation:w,children:D}),t[26]=p,t[27]=w,t[28]=D,t[29]=O):O=t[29],O},V=e=>{let i=m(17),a,o,s,c,u;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({"data-slot":s,asChild:a,className:o,ref:u,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?r:`p`,f=y(l),p;i[6]===s?p=i[7]:(p=n(s,`field-description`),i[6]=s,i[7]=p);let h=f?.descriptionId,g;i[8]===o?g=i[9]:(g=t(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,o),i[8]=o,i[9]=g);let _;return i[10]!==d||i[11]!==c||i[12]!==u||i[13]!==p||i[14]!==h||i[15]!==g?(_=/* @__PURE__ */ C(d,{ref:u,"data-slot":p,id:h,className:g,...c}),i[10]=d,i[11]=c,i[12]=u,i[13]=p,i[14]=h,i[15]=g,i[16]=_):_=i[16],_},H=e=>{let r=m(16),i,a,o,s,c;if(r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({"data-slot":o,children:i,className:a,ref:c,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c),!E(i))return null;let l;r[6]===o?l=r[7]:(l=n(o,`field-error`),r[6]=o,r[7]=l);let u;r[8]===a?u=r[9]:(u=t(`text-danger-600 text-sm leading-4`,a),r[8]=a,r[9]=u);let d;return r[10]!==i||r[11]!==s||r[12]!==c||r[13]!==l||r[14]!==u?(d=/* @__PURE__ */ C(`li`,{ref:c,"data-slot":l,className:u,...s,children:i}),r[10]=i,r[11]=s,r[12]=c,r[13]=l,r[14]=u,r[15]=d):d=r[15],d},U=e=>{let t=m(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({messages:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=T(n).map(K),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=/* @__PURE__ */ C(W,{ref:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o},W=i=>{let a=m(25),o,s,c,u,d,f;a[0]===i?(o=a[1],s=a[2],c=a[3],u=a[4],d=a[5],f=a[6]):({"data-slot":u,asChild:o,children:s,className:c,ref:f,...d}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=u,a[5]=d,a[6]=f);let p;a[7]===s?p=a[8]:(p=D({children:s,errorItemType:H}),a[7]=s,a[8]=p);let h=p,g=y(l),_=g?.registerError,v,b;if(a[9]!==h||a[10]!==_?(v=()=>{if(h&&_!=null)return _()},b=[h,_],a[9]=h,a[10]=_,a[11]=v,a[12]=b):(v=a[11],b=a[12]),e(v,b),!h)return null;let x=o?r:`ul`,S;a[13]===u?S=a[14]:(S=n(u,`field-error-list`),a[13]=u,a[14]=S);let w=g?.errorId,T;a[15]===c?T=a[16]:(T=t(`m-0 flex w-full flex-col list-none p-0`,c),a[15]=c,a[16]=T);let E;return a[17]!==x||a[18]!==s||a[19]!==d||a[20]!==f||a[21]!==S||a[22]!==w||a[23]!==T?(E=/* @__PURE__ */ C(x,{ref:f,"data-slot":S,id:w,role:`list`,className:T,...d,children:s}),a[17]=x,a[18]=s,a[19]=d,a[20]=f,a[21]=S,a[22]=w,a[23]=T,a[24]=E):E=a[24],E},G={Item:z,Control:B,Group:R,Set:O,Legend:k,Label:A,LabelText:j,LabelRow:M,Help:N,HelpTrigger:F,HelpContent:I,Optional:L,Description:V,Errors:U,ErrorList:W,ErrorItem:H};function K(e){return/* @__PURE__ */ C(H,{children:e},e)}const q=e=>T(e?.map(e=>typeof e==`string`||!e?e:e.message));export{G as Field,o as isAriaInvalid,s as parseValidation,a as resolveValidation,q as toErrorMessages};
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./button-Cwrv2Mwv.js";import{i as a,n as o,r as s,t as c}from"./field-CPvjazWN.js";import{n as l,r as u,t as d}from"./field-Bihblt8U.js";import{t as f}from"./label-nHqqYS7e.js";import{t as p}from"./popover-oQDUvcZ2.js";import{c as m}from"react/compiler-runtime";import{Children as h,Fragment as g,cloneElement as _,isValidElement as v,useContext as y,useId as b,useState as x}from"react";import S from"tiny-invariant";import{jsx as C}from"react/jsx-runtime";import{QuestionIcon as w}from"@phosphor-icons/react/Question";const T=e=>{let t=[],n=/* @__PURE__ */ new Set;for(let r of e??[]){if(typeof r!=`string`)continue;let e=r.trim();e.length===0||n.has(e)||(n.add(e),t.push(e))}return t},E=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),D=({children:e,errorItemType:t})=>{let n=!1;return h.forEach(e,e=>{n||e==null||typeof e==`boolean`||(typeof e==`string`?e.trim().length>0&&(n=!0):n=v(e)?e.type===t?E(e.props.children):e.type!==g||D({children:e.props.children,errorItemType:t}):!0)}),n},O=e=>{let r=m(14),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=n(a,`field-set`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=t(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,i),r[7]=i,r[8]=l);let u;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(u=/* @__PURE__ */ C(`fieldset`,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u},k=e=>{let n=m(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`text-strong mb-1.5 text-sm font-medium font-sans`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=/* @__PURE__ */ C(`legend`,{ref:a,"data-slot":`field-legend`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},A=e=>{let t=m(7),n,r;t[0]===e?(n=t[1],r=t[2]):({ref:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=y(l)?.controlId,a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=/* @__PURE__ */ C(f,{ref:r,...n,htmlFor:i}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a},j=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`p`,d;i[6]===s?d=i[7]:(d=n(s,`field-label-text`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`text-strong text-sm font-medium font-sans`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},M=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===s?d=i[7]:(d=n(s,`field-label-row`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`flex items-center gap-1`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},N=p.Root,P=/* @__PURE__ */ C(w,{}),F=e=>{let n=m(22),r,a,o,s,c,l,u,d,f;n[0]===e?(r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],d=n[8],f=n[9]):({appearance:c,className:r,icon:l,intent:u,label:a,ref:s,size:d,type:f,...o}=e,n[0]=e,n[1]=r,n[2]=a,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=u,n[8]=d,n[9]=f);let h=c===void 0?`ghost`:c,g=l===void 0?P:l,_=u===void 0?`neutral`:u,v=d===void 0?`xs`:d,y=f===void 0?`button`:f,b;n[10]===r?b=n[11]:(b=t(`text-body -my-0.5`,r),n[10]=r,n[11]=b);let x;return n[12]!==h||n[13]!==g||n[14]!==_||n[15]!==a||n[16]!==o||n[17]!==s||n[18]!==v||n[19]!==b||n[20]!==y?(x=/* @__PURE__ */ C(p.Trigger,{asChild:!0,children:/* @__PURE__ */ C(i,{ref:s,appearance:h,className:b,icon:g,intent:_,label:a,size:v,type:y,...o})}),n[12]=h,n[13]=g,n[14]=_,n[15]=a,n[16]=o,n[17]=s,n[18]=v,n[19]=b,n[20]=y,n[21]=x):x=n[21],x},I=e=>{let t=m(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({"data-slot":r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o;t[4]===r?o=t[5]:(o=n(r,`field-help-content`),t[4]=r,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=/* @__PURE__ */ C(p.Content,{ref:a,"data-slot":o,...i}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s},L=e=>{let i=m(18),a,o,s,c,l,u;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"data-slot":c,asChild:a,children:o,className:s,ref:u,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?r:`span`,f;i[7]===c?f=i[8]:(f=n(c,`field-optional`),i[7]=c,i[8]=f);let p;i[9]===s?p=i[10]:(p=t(`text-muted text-sm font-normal font-sans`,s),i[9]=s,i[10]=p);let h=o??`(Optional)`,g;return i[11]!==d||i[12]!==l||i[13]!==u||i[14]!==f||i[15]!==p||i[16]!==h?(g=/* @__PURE__ */ C(d,{ref:u,"data-slot":f,className:p,...l,children:h}),i[11]=d,i[12]=l,i[13]=u,i[14]=f,i[15]=p,i[16]=h,i[17]=g):g=i[17],g},R=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===s?d=i[7]:(d=n(s,`field-group`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`flex w-full flex-col gap-4`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},z=e=>{let i=m(37),o,s,u,d,f,p,h,g,_;i[0]===e?(o=i[1],s=i[2],u=i[3],d=i[4],f=i[5],p=i[6],h=i[7],g=i[8],_=i[9]):({"data-slot":d,asChild:o,children:s,className:u,id:f,name:p,ref:g,validation:_,...h}=e,i[0]=e,i[1]=o,i[2]=s,i[3]=u,i[4]=d,i[5]=f,i[6]=p,i[7]=h,i[8]=g,i[9]=_);let v=o?r:`div`,y=b(),S=f??y,w=b(),T=b(),[E,D]=x(!1),O=_??(E?`error`:void 0),k;i[10]===O?k=i[11]:(k=a(O),i[10]=O,i[11]=k);let A=k,j;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>(D(!0),()=>{D(!1)}),i[12]=j):j=i[12];let M=j,N;i[13]!==S||i[14]!==w||i[15]!==T||i[16]!==p||i[17]!==A?(N={controlId:S,descriptionId:w,errorId:T,name:p,registerError:M,validation:A},i[13]=S,i[14]=w,i[15]=T,i[16]=p,i[17]=A,i[18]=N):N=i[18];let P=N,F;i[19]===d?F=i[20]:(F=n(d,`field-item`),i[19]=d,i[20]=F);let I;i[21]===u?I=i[22]:(I=t(`flex w-full flex-col gap-1.5`,u),i[21]=u,i[22]=I);let L;i[23]!==v||i[24]!==s||i[25]!==h||i[26]!==g||i[27]!==F||i[28]!==I||i[29]!==A?(L=/* @__PURE__ */ C(v,{ref:g,"data-slot":F,"data-validation":A,className:I,...h,children:s}),i[23]=v,i[24]=s,i[25]=h,i[26]=g,i[27]=F,i[28]=I,i[29]=A,i[30]=L):L=i[30];let R;i[31]!==L||i[32]!==A?(R=/* @__PURE__ */ C(c,{validation:A,children:L}),i[31]=L,i[32]=A,i[33]=R):R=i[33];let z;return i[34]!==P||i[35]!==R?(z=/* @__PURE__ */ C(l.Provider,{value:P,children:R}),i[34]=P,i[35]=R,i[36]=z):z=i[36],z},B=e=>{let t=m(30),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let o=y(l),s,f,p,h,g,b,x,w,T;if(t[4]!==n||t[5]!==o||t[6]!==i||t[7]!==a){T=Symbol.for(`react.early_return_sentinel`);bb0:{let e=u({context:o});if(typeof n==`function`){T=/* @__PURE__ */ C(c,{validation:e.validation,children:/* @__PURE__ */ C(d.Provider,{value:o?e.ariaProps:null,children:n(e.ariaProps)})});break bb0}S(v(n),`Field.Control expects a single React element child (or a render-prop function). Got a non-element value (string, array, fragment, null, or undefined). Wrap the control in a single element, or use the function child form: <Field.Control>{(props) => <YourControl {...props} />}</Field.Control>.`),p=c,w=e.validation,f=d.Provider,x=o?e.ariaProps:null,s=r,h=a,g=i,b=_(n,e.ariaProps)}t[4]=n,t[5]=o,t[6]=i,t[7]=a,t[8]=s,t[9]=f,t[10]=p,t[11]=h,t[12]=g,t[13]=b,t[14]=x,t[15]=w,t[16]=T}else s=t[8],f=t[9],p=t[10],h=t[11],g=t[12],b=t[13],x=t[14],w=t[15],T=t[16];if(T!==Symbol.for(`react.early_return_sentinel`))return T;let E;t[17]!==s||t[18]!==h||t[19]!==g||t[20]!==b?(E=/* @__PURE__ */ C(s,{ref:h,...g,children:b}),t[17]=s,t[18]=h,t[19]=g,t[20]=b,t[21]=E):E=t[21];let D;t[22]!==f||t[23]!==x||t[24]!==E?(D=/* @__PURE__ */ C(f,{value:x,children:E}),t[22]=f,t[23]=x,t[24]=E,t[25]=D):D=t[25];let O;return t[26]!==p||t[27]!==w||t[28]!==D?(O=/* @__PURE__ */ C(p,{validation:w,children:D}),t[26]=p,t[27]=w,t[28]=D,t[29]=O):O=t[29],O},V=e=>{let i=m(17),a,o,s,c,u;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({"data-slot":s,asChild:a,className:o,ref:u,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?r:`p`,f=y(l),p;i[6]===s?p=i[7]:(p=n(s,`field-description`),i[6]=s,i[7]=p);let h=f?.descriptionId,g;i[8]===o?g=i[9]:(g=t(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,o),i[8]=o,i[9]=g);let _;return i[10]!==d||i[11]!==c||i[12]!==u||i[13]!==p||i[14]!==h||i[15]!==g?(_=/* @__PURE__ */ C(d,{ref:u,"data-slot":p,id:h,className:g,...c}),i[10]=d,i[11]=c,i[12]=u,i[13]=p,i[14]=h,i[15]=g,i[16]=_):_=i[16],_},H=e=>{let r=m(16),i,a,o,s,c;if(r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({"data-slot":o,children:i,className:a,ref:c,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c),!E(i))return null;let l;r[6]===o?l=r[7]:(l=n(o,`field-error`),r[6]=o,r[7]=l);let u;r[8]===a?u=r[9]:(u=t(`text-danger-600 text-sm leading-4`,a),r[8]=a,r[9]=u);let d;return r[10]!==i||r[11]!==s||r[12]!==c||r[13]!==l||r[14]!==u?(d=/* @__PURE__ */ C(`li`,{ref:c,"data-slot":l,className:u,...s,children:i}),r[10]=i,r[11]=s,r[12]=c,r[13]=l,r[14]=u,r[15]=d):d=r[15],d},U=e=>{let t=m(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({messages:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=T(n).map(K),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=/* @__PURE__ */ C(W,{ref:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o},W=i=>{let a=m(25),o,s,c,u,d,f;a[0]===i?(o=a[1],s=a[2],c=a[3],u=a[4],d=a[5],f=a[6]):({"data-slot":u,asChild:o,children:s,className:c,ref:f,...d}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=u,a[5]=d,a[6]=f);let p;a[7]===s?p=a[8]:(p=D({children:s,errorItemType:H}),a[7]=s,a[8]=p);let h=p,g=y(l),_=g?.registerError,v,b;if(a[9]!==h||a[10]!==_?(v=()=>{if(h&&_!=null)return _()},b=[h,_],a[9]=h,a[10]=_,a[11]=v,a[12]=b):(v=a[11],b=a[12]),e(v,b),!h)return null;let x=o?r:`ul`,S;a[13]===u?S=a[14]:(S=n(u,`field-error-list`),a[13]=u,a[14]=S);let w=g?.errorId,T;a[15]===c?T=a[16]:(T=t(`m-0 flex w-full flex-col list-none p-0`,c),a[15]=c,a[16]=T);let E;return a[17]!==x||a[18]!==s||a[19]!==d||a[20]!==f||a[21]!==S||a[22]!==w||a[23]!==T?(E=/* @__PURE__ */ C(x,{ref:f,"data-slot":S,id:w,role:`list`,className:T,...d,children:s}),a[17]=x,a[18]=s,a[19]=d,a[20]=f,a[21]=S,a[22]=w,a[23]=T,a[24]=E):E=a[24],E},G={Item:z,Control:B,Group:R,Set:O,Legend:k,Label:A,LabelText:j,LabelRow:M,Help:N,HelpTrigger:F,HelpContent:I,Optional:L,Description:V,Errors:U,ErrorList:W,ErrorItem:H};function K(e){return/* @__PURE__ */ C(H,{children:e},e)}const q=e=>T(e?.map(e=>typeof e==`string`||!e?e:e.message));export{G as Field,o as isAriaInvalid,s as parseValidation,a as resolveValidation,q as toErrorMessages};
|
package/dist/flag.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
|
-
//#region src/components/flag/country-code.d.ts
|
|
4
3
|
/** All valid values for a flag
|
|
5
4
|
* @see https://www.flagpack.xyz/docs/flag-index
|
|
6
5
|
*/
|
|
@@ -18,8 +17,6 @@ type CountryCode = (typeof countryCodes)[number];
|
|
|
18
17
|
* ```
|
|
19
18
|
*/
|
|
20
19
|
declare function isCountryCode(value: unknown): value is CountryCode;
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/components/flag/flag.d.ts
|
|
23
20
|
declare const sizes: readonly ["s", "m", "l"];
|
|
24
21
|
type Size = (typeof sizes)[number];
|
|
25
22
|
type Props = Omit<ComponentProps<"div">, "children"> & {
|
|
@@ -84,5 +81,4 @@ type Props = Omit<ComponentProps<"div">, "children"> & {
|
|
|
84
81
|
* ```
|
|
85
82
|
*/
|
|
86
83
|
declare function Flag({ "data-slot": dataSlot, className, code, size, loading, ...props }: Props): import("react").JSX.Element;
|
|
87
|
-
//#endregion
|
|
88
84
|
export { type CountryCode, Flag, type Props as FlagProps, countryCodes, isCountryCode };
|