@ngrok/mantle 0.88.0 → 0.90.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 +10 -9
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1530 -1
- package/dist/{alert-DCVfviBx.d.ts → alert-BzPDUaU7.d.ts} +16 -15
- package/dist/alert-DO00UiQe.js +1 -0
- package/dist/alert-ZaUBtgno.js +1 -0
- package/dist/alert-center.d.ts +7 -7
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +17 -16
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-CgcbWEUs.js +1 -0
- package/dist/anchor.js +1 -1
- package/dist/app-layout.d.ts +1183 -45
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +41 -18
- package/dist/area-chart.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +3 -2
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +37 -13
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only.js +1 -1
- package/dist/button-69InNC_m.js +1 -0
- package/dist/button-BMfUxs_j.js +1 -0
- package/dist/{button-DO53OA70.d.ts → button-CHoYpOzx.d.ts} +5 -4
- package/dist/{button-B52_vczK.js → button-D8rr-1AB.js} +1 -1
- package/dist/{button-crUf0hbR.d.ts → button-DL7V4bzW.d.ts} +5 -4
- package/dist/button-b2HKEIE2.js +1 -0
- package/dist/{button-B5i9n7Qp.d.ts → button-mzUR1U0Y.d.ts} +5 -4
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +3 -2
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +15 -7
- package/dist/card.js +1 -1
- package/dist/centered-layout.js +1 -1
- package/dist/{chart-DgaWVBqi.d.ts → chart-23KQ1ZNO.d.ts} +128 -62
- package/dist/chart-BRkJfptA.js +2 -0
- package/dist/checkbox-C3N2afhB.js +1 -0
- package/dist/checkbox.d.ts +3 -2
- package/dist/checkbox.js +1 -1
- package/dist/{choice-PESu-9s8.d.ts → choice-BCiyqLgO.d.ts} +12 -11
- package/dist/choice-DQmecLfy.js +1 -0
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +1 -1
- package/dist/code-block-4Esx_gV-.js +12 -0
- package/dist/code-block.d.ts +17 -16
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +2 -1
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +15 -14
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +13 -13
- package/dist/command.js +1 -1
- package/dist/cx-CK7o_rVv.js +1 -0
- package/dist/cx.js +1 -1
- package/dist/data-table.d.ts +32 -31
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +6 -6
- package/dist/description-list.js +1 -1
- package/dist/dialog-CaGJD02w.js +1 -0
- package/dist/{dialog-DXpqpdJj.d.ts → dialog-DQdeqvq-.d.ts} +28 -15
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-BloQKE_y.d.ts → dropdown-menu-Cef0Cz2B.d.ts} +17 -17
- package/dist/dropdown-menu-CutWQ0bl.js +1 -0
- package/dist/dropdown-menu-DMA8dGxZ.d.ts +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +14 -6
- package/dist/empty.js +1 -1
- package/dist/field.d.ts +16 -15
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +4 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +251 -1
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +5 -4
- package/dist/hover-card.js +1 -1
- package/dist/icon-BudQMD2S.js +1 -0
- package/dist/icon-kK0c-POG.js +1 -0
- package/dist/{icon-w0HUe7tr.d.ts → icon-r2NvfTWW.d.ts} +3 -2
- package/dist/{icon-BmJ57Tgh.d.ts → icon-ucVgZeXn.d.ts} +3 -2
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/icons-CAtjMNti.js +1 -0
- package/dist/{icons-Bu-2boul.js → icons-CH3tD_wq.js} +1 -1
- package/dist/icons-CSwTVV2m.js +1 -0
- package/dist/icons.js +1 -1
- package/dist/in-view-Dxv_GrUU.js +1 -0
- package/dist/input-D_DjD9lT.js +1 -0
- package/dist/{input-DpnC3Xgj.d.ts → input-bbB1tC0h.d.ts} +3 -2
- package/dist/input.d.ts +5 -4
- package/dist/input.js +1 -1
- package/dist/kbd-CLHsJ99p.js +1 -0
- package/dist/kbd.d.ts +2 -1
- package/dist/kbd.js +1 -1
- package/dist/label-5T8i7I4X.js +1 -0
- package/dist/{label-Bnfe9YJ6.d.ts → label-C-KbNls8.d.ts} +3 -2
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/{layer-container-R7aux3n8.js → layer-container-DLf-6eBz.js} +1 -1
- package/dist/layer-container.js +1 -1
- package/dist/line-chart.d.ts +40 -15
- package/dist/line-chart.js +1 -1
- package/dist/list-DOVZoz9t.js +1 -0
- package/dist/list.d.ts +3 -2
- package/dist/list.js +1 -1
- package/dist/live-region-DQ1QLv3L.js +1 -0
- package/dist/live-region.d.ts +3 -2
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +118 -2
- package/dist/{main-Dv2zuT_b.js → main-CC1L9IsH.js} +1 -1
- package/dist/main.js +1 -1
- package/dist/mantle.css +12 -0
- package/dist/media-object.js +1 -1
- package/dist/migrations/0002-data-table-action-header.yml +526 -0
- package/dist/migrations/0003-dialog-footer-dom-order.yml +271 -0
- package/dist/migrations/0004-priority-to-intent.yml +1728 -0
- package/dist/migrations/0005-field-item-owns-control-id.yml +234 -0
- package/dist/migrations/0006-data-table-tanstack-v9.yml +423 -0
- package/dist/migrations/0008-tabs-separator.yml +1212 -0
- package/dist/migrations/0009-chart-root-mode.yml +871 -0
- package/dist/multi-select.d.ts +23 -22
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +9 -8
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +9 -8
- package/dist/pagination.js +1 -1
- package/dist/{popover-Cco1nw8I.d.ts → popover-Dvls7-j4.d.ts} +5 -4
- package/dist/popover-oQDUvcZ2.js +1 -0
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +1 -1
- package/dist/primitive-AGoxSJBI.js +1 -0
- package/dist/progress.d.ts +9 -8
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +9 -8
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +19 -18
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +7 -7
- package/dist/sandbar.js +1 -1
- package/dist/{sandboxed-on-click-BLvvSqOP.js → sandboxed-on-click-C7pPu-2M.js} +1 -1
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.d.ts +39 -14
- package/dist/scatter-plot.js +1 -1
- package/dist/select-DcL0-duV.js +1 -0
- package/dist/{select-BITJP7I5.d.ts → select-DlohFa54.d.ts} +3 -3
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +16 -15
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-Bo4nY_3M.d.ts → separator-BWGjCIl7.d.ts} +11 -3
- package/dist/separator-DvPe27fH.js +1 -0
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/sheet-H8zvhSuA.js +1 -0
- package/dist/sheet.d.ts +13 -12
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +163 -102
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-zfqoDAxT.js +1 -0
- package/dist/skeleton.d.ts +3 -2
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +3 -2
- package/dist/slider.js +1 -1
- package/dist/{slot-BsvE2ntj.js → slot-DdYN1L1C.js} +1 -1
- package/dist/{slot-DdgxmuI5.d.ts → slot-Q996Hqk9.d.ts} +1 -1
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +6 -5
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +544 -0
- package/dist/strata.js +1 -0
- package/dist/switch.d.ts +3 -2
- package/dist/switch.js +1 -1
- package/dist/{table-DEI-qvSC.d.ts → table-BhzITa19.d.ts} +10 -9
- package/dist/table-DBbKqOVq.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +2 -2
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +3 -2
- package/dist/text-area.js +1 -1
- package/dist/theme-6Q65C1Rx.js +1 -0
- package/dist/theme-switcher.d.ts +3 -3
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +10 -9
- package/dist/toast.js +1 -1
- package/dist/{tooltip-nuUCoqq8.d.ts → tooltip-CngH7Kl6.d.ts} +7 -6
- package/dist/tooltip-NhYXqStK.js +1 -0
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text.d.ts +138 -0
- package/dist/truncated-text.js +1 -0
- package/dist/types.js +1 -1
- package/dist/use-breakpoint--mo7kr9d.js +1 -0
- package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +1 -0
- package/dist/use-prefers-reduced-motion-DimzRx-M.js +1 -0
- package/dist/use-swipe-to-dismiss-Cj-AayFd.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +2 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.d.ts +10 -2
- package/dist/well.js +1 -1
- package/package.json +17 -15
- package/dist/alert-OP_-aGJD.js +0 -1
- package/dist/anchor-BnMhJYS4.js +0 -1
- package/dist/button-BFpCB99R.js +0 -1
- package/dist/button-Dij5vCQG.js +0 -1
- package/dist/button-pwkdtR3U.js +0 -1
- package/dist/chart-aZLMj4xx.js +0 -2
- package/dist/checkbox-DbJSqSNN.js +0 -1
- package/dist/choice-SRyLguqU.js +0 -1
- package/dist/code-block-BE3Q0iAo.js +0 -12
- package/dist/cx-0HCjnNv1.js +0 -1
- package/dist/dialog-HIdb5d3I.js +0 -1
- package/dist/dropdown-menu-BR_AQNMj.js +0 -1
- package/dist/dropdown-menu-Dlpb7600.d.ts +0 -1
- package/dist/icon-BT8FnkkJ.js +0 -1
- package/dist/icon-U24NfYv7.js +0 -1
- package/dist/icons-BQRcOU6J.js +0 -1
- package/dist/icons-C3rVfpx9.js +0 -1
- package/dist/in-view-T_AAYaaF.js +0 -1
- package/dist/input-yq0jLE4e.js +0 -1
- package/dist/kbd-CJ8hNZfS.js +0 -1
- package/dist/label-BAy0Mg59.js +0 -1
- package/dist/list-BleZ-43e.js +0 -1
- package/dist/live-region-B2vJRvPH.js +0 -1
- package/dist/popover-BJ5XNwzD.js +0 -1
- package/dist/primitive-w3wFk2La.js +0 -1
- package/dist/select-CUWLEeuf.js +0 -1
- package/dist/separator-D98be0gY.js +0 -1
- package/dist/sheet-B5x8EO9Y.js +0 -1
- package/dist/skeleton-bVDP8BzY.js +0 -1
- package/dist/table-D2jh52KA.js +0 -1
- package/dist/theme-C1kFFdIk.js +0 -1
- package/dist/tooltip-H03l7E4Y.js +0 -1
- package/dist/use-is-hydrated-after-paint-Drj0lNi4.js +0 -1
- package/dist/use-prefers-reduced-motion-Cj9tJ181.js +0 -1
- /package/dist/{types-D85fCNV3.js → css-properties-D85fCNV3.js} +0 -0
package/dist/data-table.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
2
|
+
import { i as ButtonIntent, n as ButtonAppearance, t as Button } from "./button-mzUR1U0Y.js";
|
|
3
|
+
import { i as IconButtonIntent, r as IconButtonAppearance, t as IconButton } from "./button-DL7V4bzW.js";
|
|
3
4
|
import { s as SortingMode } from "./direction-BjU0bPST.js";
|
|
4
|
-
import { t as Table$1 } from "./table-
|
|
5
|
+
import { t as Table$1 } from "./table-BhzITa19.js";
|
|
5
6
|
import { ComponentProps, ReactNode } from "react";
|
|
6
7
|
import { CellData, Column, Column_RowSorting, Row, RowData, Row_RowExpanding, StockFeatures, Table, TableFeatures } from "@tanstack/react-table";
|
|
7
8
|
export * from "@tanstack/react-table";
|
|
@@ -32,7 +33,7 @@ type DataTableProps<TFeatures extends TableFeatures, TData extends RowData> = Co
|
|
|
32
33
|
* reads it through context.
|
|
33
34
|
*/
|
|
34
35
|
table: Table<TFeatures, TData>;
|
|
35
|
-
};
|
|
36
|
+
} & WithDataSlot;
|
|
36
37
|
/**
|
|
37
38
|
* The root container for a data table. Wraps all other `DataTable`
|
|
38
39
|
* sub-components and provides the table context to its descendants.
|
|
@@ -82,7 +83,7 @@ type DataTableProps<TFeatures extends TableFeatures, TData extends RowData> = Co
|
|
|
82
83
|
* }
|
|
83
84
|
* ```
|
|
84
85
|
*/
|
|
85
|
-
declare function Root<TFeatures extends TableFeatures, TData extends RowData>({ children, table, ...props }: DataTableProps<TFeatures, TData>): import("react").JSX.Element;
|
|
86
|
+
declare function Root<TFeatures extends TableFeatures, TData extends RowData>({ "data-slot": dataSlot, children, table, ...props }: DataTableProps<TFeatures, TData>): import("react").JSX.Element;
|
|
86
87
|
type DataTableHeaderSortButtonProps<TFeatures extends SortableTableFeatures, TData extends RowData, TValue extends CellData> = Omit<ComponentProps<typeof Button>, "appearance" | "icon" | "intent"> & {
|
|
87
88
|
/**
|
|
88
89
|
* The TanStack Table column this button sorts (`props.column` in `header`).
|
|
@@ -128,7 +129,7 @@ type DataTableHeaderSortButtonProps<TFeatures extends SortableTableFeatures, TDa
|
|
|
128
129
|
* The sorting mode of the column, whether it is alphanumeric or time based.
|
|
129
130
|
*/
|
|
130
131
|
sortingMode: SortingMode;
|
|
131
|
-
});
|
|
132
|
+
}) & WithDataSlot;
|
|
132
133
|
/**
|
|
133
134
|
* A sortable button toggle for a column header in a data table. Renders a sort
|
|
134
135
|
* icon that reflects the current direction and cycles through sort states on
|
|
@@ -186,14 +187,14 @@ type DataTableHeaderSortButtonProps<TFeatures extends SortableTableFeatures, TDa
|
|
|
186
187
|
* });
|
|
187
188
|
* ```
|
|
188
189
|
*/
|
|
189
|
-
declare function HeaderSortButton<TFeatures extends SortableTableFeatures, TData extends RowData, TValue extends CellData>({ appearance, children, className, column, disableSorting, iconPlacement, intent, sortingMode, sortIcon: propSortIcon, onClick, ...props }: DataTableHeaderSortButtonProps<TFeatures, TData, TValue>): import("react").JSX.Element;
|
|
190
|
+
declare function HeaderSortButton<TFeatures extends SortableTableFeatures, TData extends RowData, TValue extends CellData>({ "data-slot": dataSlot, appearance, children, className, column, disableSorting, iconPlacement, intent, sortingMode, sortIcon: propSortIcon, onClick, ...props }: DataTableHeaderSortButtonProps<TFeatures, TData, TValue>): import("react").JSX.Element;
|
|
190
191
|
type DataTableHeaderProps<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData> = ComponentProps<typeof Table$1.Header> & {
|
|
191
192
|
/**
|
|
192
193
|
* The TanStack Table column this cell heads (`props.column` in `header`).
|
|
193
194
|
* When the column is sorted, the cell carries `aria-sort`.
|
|
194
195
|
*/
|
|
195
196
|
column?: Column<TFeatures, TData, TValue>;
|
|
196
|
-
};
|
|
197
|
+
} & WithDataSlot;
|
|
197
198
|
/**
|
|
198
199
|
* A `<th>` optimized for header actions. Wrap each column's header content in
|
|
199
200
|
* this; for sortable columns, nest a `DataTable.HeaderSortButton` inside and
|
|
@@ -217,7 +218,7 @@ type DataTableHeaderProps<TFeatures extends TableFeatures, TData extends RowData
|
|
|
217
218
|
* });
|
|
218
219
|
* ```
|
|
219
220
|
*/
|
|
220
|
-
declare function Header<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData>({ children, className, column, ...props }: DataTableHeaderProps<TFeatures, TData, TValue>): import("react").JSX.Element;
|
|
221
|
+
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;
|
|
221
222
|
/**
|
|
222
223
|
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
223
224
|
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is no data.
|
|
@@ -239,8 +240,8 @@ declare function Header<TFeatures extends TableFeatures, TData extends RowData,
|
|
|
239
240
|
* </DataTable.Root>
|
|
240
241
|
* ```
|
|
241
242
|
*/
|
|
242
|
-
declare const Body: (props: ComponentProps<typeof Table$1.Body>) => import("react").JSX.Element;
|
|
243
|
-
type DataTableHeadProps = Omit<ComponentProps<typeof Table$1.Head>, "children"
|
|
243
|
+
declare const Body: ({ "data-slot": dataSlot, ...props }: ComponentProps<typeof Table$1.Body> & WithDataSlot) => import("react").JSX.Element;
|
|
244
|
+
type DataTableHeadProps = Omit<ComponentProps<typeof Table$1.Head>, "children"> & WithDataSlot;
|
|
244
245
|
/**
|
|
245
246
|
* The `<thead>` container that renders column headers automatically from
|
|
246
247
|
* `table.getHeaderGroups()`. Does not accept children — headers come from each
|
|
@@ -263,7 +264,7 @@ type DataTableHeadProps = Omit<ComponentProps<typeof Table$1.Head>, "children">;
|
|
|
263
264
|
* </DataTable.Root>
|
|
264
265
|
* ```
|
|
265
266
|
*/
|
|
266
|
-
declare function Head(props: DataTableHeadProps): import("react").JSX.Element;
|
|
267
|
+
declare function Head({ "data-slot": dataSlot, ...props }: DataTableHeadProps): import("react").JSX.Element;
|
|
267
268
|
type DataTableRowProps<TFeatures extends TableFeatures, TData extends RowData> = Omit<ComponentProps<typeof Table$1.Row>, "children"> & {
|
|
268
269
|
/** The TanStack Table row instance to render. */
|
|
269
270
|
row: Row<TFeatures, TData>;
|
|
@@ -280,7 +281,7 @@ type DataTableRowProps<TFeatures extends TableFeatures, TData extends RowData> =
|
|
|
280
281
|
* multiple panels), omit this and render `DataTable.ExpandedRow` yourself.
|
|
281
282
|
*/
|
|
282
283
|
renderExpanded?: (row: Row<TFeatures, TData>) => ReactNode;
|
|
283
|
-
};
|
|
284
|
+
} & WithDataSlot;
|
|
284
285
|
/**
|
|
285
286
|
* A single data table body row rendered from a TanStack Table row instance.
|
|
286
287
|
* Does not accept children — cells come from each column's `cell` definition.
|
|
@@ -357,8 +358,8 @@ type DataTableRowProps<TFeatures extends TableFeatures, TData extends RowData> =
|
|
|
357
358
|
* ))}
|
|
358
359
|
* ```
|
|
359
360
|
*/
|
|
360
|
-
declare function Row$1<TFeatures extends TableFeatures, TData extends RowData>({ className, onClick, renderExpanded, row, ...props }: DataTableRowProps<TFeatures, TData>): import("react").JSX.Element;
|
|
361
|
-
type DataTableEmptyRowProps = ComponentProps<typeof Table$1.Row
|
|
361
|
+
declare function Row$1<TFeatures extends TableFeatures, TData extends RowData>({ "data-slot": dataSlot, className, onClick, renderExpanded, row, ...props }: DataTableRowProps<TFeatures, TData>): import("react").JSX.Element;
|
|
362
|
+
type DataTableEmptyRowProps = ComponentProps<typeof Table$1.Row> & WithDataSlot;
|
|
362
363
|
/**
|
|
363
364
|
* An empty-state row that spans every column. Render this as the `else` branch
|
|
364
365
|
* when `rows.length === 0` to keep the table's frame intact instead of
|
|
@@ -416,8 +417,8 @@ type DataTableEmptyRowProps = ComponentProps<typeof Table$1.Row>;
|
|
|
416
417
|
* </DataTable.Body>
|
|
417
418
|
* ```
|
|
418
419
|
*/
|
|
419
|
-
declare function EmptyRow({ children, ...props }: DataTableEmptyRowProps): import("react").JSX.Element;
|
|
420
|
-
type DataTableActionCellProps = ComponentProps<typeof Table$1.Cell
|
|
420
|
+
declare function EmptyRow({ "data-slot": dataSlot, children, ...props }: DataTableEmptyRowProps): import("react").JSX.Element;
|
|
421
|
+
type DataTableActionCellProps = ComponentProps<typeof Table$1.Cell> & WithDataSlot;
|
|
421
422
|
/**
|
|
422
423
|
* A sticky-right `<td>` for per-row action buttons (typically an `IconButton`
|
|
423
424
|
* that opens a `DropdownMenu`). Pair with `DataTable.ActionHeader`.
|
|
@@ -438,7 +439,7 @@ type DataTableActionCellProps = ComponentProps<typeof Table$1.Cell>;
|
|
|
438
439
|
*
|
|
439
440
|
* | Data Attribute | Value | Description |
|
|
440
441
|
* | --- | --- | --- |
|
|
441
|
-
* | `data-slot` | `"data-table-action-cell"` | On the cell element. |
|
|
442
|
+
* | `data-slot` | `"data-table-action-cell table-cell"` | On the cell element, joined ahead of `Table.Cell`'s own slot. |
|
|
442
443
|
* | `data-slot` | `"data-table-action-cell-label"` | On the `<span>` wrapping `children`. |
|
|
443
444
|
*
|
|
444
445
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableactioncell
|
|
@@ -456,8 +457,8 @@ type DataTableActionCellProps = ComponentProps<typeof Table$1.Cell>;
|
|
|
456
457
|
* });
|
|
457
458
|
* ```
|
|
458
459
|
*/
|
|
459
|
-
declare function ActionCell({ children, className, onClick, ...props }: DataTableActionCellProps): import("react").JSX.Element;
|
|
460
|
-
type DataTableActionHeaderProps = ComponentProps<typeof Table$1.Header
|
|
460
|
+
declare function ActionCell({ "data-slot": dataSlot, children, className, onClick, ...props }: DataTableActionCellProps): import("react").JSX.Element;
|
|
461
|
+
type DataTableActionHeaderProps = ComponentProps<typeof Table$1.Header> & WithDataSlot;
|
|
461
462
|
/**
|
|
462
463
|
* A sticky header cell that pairs with `DataTable.ActionCell`. Use this as the
|
|
463
464
|
* header for the action column so the pinned column visually aligns across the
|
|
@@ -476,7 +477,7 @@ type DataTableActionHeaderProps = ComponentProps<typeof Table$1.Header>;
|
|
|
476
477
|
*
|
|
477
478
|
* | Data Attribute | Value | Description |
|
|
478
479
|
* | --- | --- | --- |
|
|
479
|
-
* | `data-slot` | `"data-table-action-header"` | On the cell element. |
|
|
480
|
+
* | `data-slot` | `"data-table-action-header table-header"` | On the cell element, joined ahead of `Table.Header`'s own slot. |
|
|
480
481
|
* | `data-slot` | `"data-table-action-header-label"` | On the `<span>` wrapping `children`. |
|
|
481
482
|
*
|
|
482
483
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableactionheader
|
|
@@ -490,7 +491,7 @@ type DataTableActionHeaderProps = ComponentProps<typeof Table$1.Header>;
|
|
|
490
491
|
* })
|
|
491
492
|
* ```
|
|
492
493
|
*/
|
|
493
|
-
declare function ActionHeader({ children, className, ...props }: DataTableActionHeaderProps): import("react").JSX.Element;
|
|
494
|
+
declare function ActionHeader({ "data-slot": dataSlot, children, className, ...props }: DataTableActionHeaderProps): import("react").JSX.Element;
|
|
494
495
|
/**
|
|
495
496
|
* Compute the stable DOM `id` for a row's expanded detail row. Shared by
|
|
496
497
|
* `DataTable.RowExpandButton` (as its `aria-controls` target) and
|
|
@@ -520,7 +521,7 @@ type DataTableExpandHeaderProps = Omit<ComponentProps<typeof Table$1.Header>, "c
|
|
|
520
521
|
* label so the column is announced while staying visually empty.
|
|
521
522
|
*/
|
|
522
523
|
children?: ReactNode;
|
|
523
|
-
};
|
|
524
|
+
} & WithDataSlot;
|
|
524
525
|
/**
|
|
525
526
|
* A narrow `<th>` for the leading expand-toggle column, mirroring
|
|
526
527
|
* `DataTable.ActionHeader`. Renders a screen-reader-only label by default so the
|
|
@@ -542,7 +543,7 @@ type DataTableExpandHeaderProps = Omit<ComponentProps<typeof Table$1.Header>, "c
|
|
|
542
543
|
* });
|
|
543
544
|
* ```
|
|
544
545
|
*/
|
|
545
|
-
declare function ExpandHeader({ children, className, ...props }: DataTableExpandHeaderProps): import("react").JSX.Element;
|
|
546
|
+
declare function ExpandHeader({ "data-slot": dataSlot, children, className, ...props }: DataTableExpandHeaderProps): import("react").JSX.Element;
|
|
546
547
|
type DataTableRowExpandButtonProps<TFeatures extends ExpandableTableFeatures, TData extends RowData> = Omit<ComponentProps<typeof IconButton>, "appearance" | "aria-controls" | "aria-expanded" | "icon" | "intent" | "label"> & {
|
|
547
548
|
/**
|
|
548
549
|
* The visual style of the expand toggle. Optional — the row expand button's
|
|
@@ -578,7 +579,7 @@ type DataTableRowExpandButtonProps<TFeatures extends ExpandableTableFeatures, TD
|
|
|
578
579
|
* @default <MinusIcon weight="bold" />
|
|
579
580
|
*/
|
|
580
581
|
collapseIcon?: ReactNode;
|
|
581
|
-
};
|
|
582
|
+
} & WithDataSlot;
|
|
582
583
|
/**
|
|
583
584
|
* An accessible +/- toggle that expands or collapses a row's detail panel. Drop
|
|
584
585
|
* it inside a `DataTable.Cell` in a leading `columnHelper.display` column and
|
|
@@ -617,7 +618,7 @@ type DataTableRowExpandButtonProps<TFeatures extends ExpandableTableFeatures, TD
|
|
|
617
618
|
* });
|
|
618
619
|
* ```
|
|
619
620
|
*/
|
|
620
|
-
declare function RowExpandButton<TFeatures extends ExpandableTableFeatures, TData extends RowData>({ appearance, className, collapseIcon, expandIcon, intent, label, onClick, row, size, ...props }: DataTableRowExpandButtonProps<TFeatures, TData>): import("react").JSX.Element;
|
|
621
|
+
declare function RowExpandButton<TFeatures extends ExpandableTableFeatures, TData extends RowData>({ "data-slot": dataSlot, appearance, className, collapseIcon, expandIcon, intent, label, onClick, row, size, ...props }: DataTableRowExpandButtonProps<TFeatures, TData>): import("react").JSX.Element;
|
|
621
622
|
type DataTableExpandedRowProps<TFeatures extends TableFeatures, TData extends RowData> = Omit<ComponentProps<typeof Table$1.Row>, "children"> & {
|
|
622
623
|
/** The row whose detail panel this displays. */
|
|
623
624
|
row: Row<TFeatures, TData>;
|
|
@@ -628,7 +629,7 @@ type DataTableExpandedRowProps<TFeatures extends TableFeatures, TData extends Ro
|
|
|
628
629
|
colSpan?: number;
|
|
629
630
|
/** The detail content rendered inside the full-width panel. */
|
|
630
631
|
children: ReactNode;
|
|
631
|
-
};
|
|
632
|
+
} & WithDataSlot;
|
|
632
633
|
/**
|
|
633
634
|
* The sibling `<tr>` that renders a row's expanded detail panel. For the common
|
|
634
635
|
* case, prefer `DataTable.Row`'s `renderExpanded` prop, which renders this for
|
|
@@ -674,7 +675,7 @@ type DataTableExpandedRowProps<TFeatures extends TableFeatures, TData extends Ro
|
|
|
674
675
|
* ))}
|
|
675
676
|
* ```
|
|
676
677
|
*/
|
|
677
|
-
declare function ExpandedRow<TFeatures extends TableFeatures, TData extends RowData>({ children, className, colSpan, row, ...props }: DataTableExpandedRowProps<TFeatures, TData>): import("react").JSX.Element;
|
|
678
|
+
declare function ExpandedRow<TFeatures extends TableFeatures, TData extends RowData>({ "data-slot": dataSlot, children, className, colSpan, row, ...props }: DataTableExpandedRowProps<TFeatures, TData>): import("react").JSX.Element;
|
|
678
679
|
/**
|
|
679
680
|
* Use `DataTable` for INTERACTIVE tabular data — sorting, filtering, pagination,
|
|
680
681
|
* row selection, and server-side or client-side data. Built on TanStack Table;
|
|
@@ -1078,7 +1079,7 @@ declare const DataTable: {
|
|
|
1078
1079
|
*
|
|
1079
1080
|
* | Data Attribute | Value | Description |
|
|
1080
1081
|
* | --- | --- | --- |
|
|
1081
|
-
* | `data-slot` | `"data-table-action-cell"` | On the cell element. |
|
|
1082
|
+
* | `data-slot` | `"data-table-action-cell table-cell"` | On the cell element, joined ahead of `Table.Cell`'s own slot. |
|
|
1082
1083
|
* | `data-slot` | `"data-table-action-cell-label"` | On the `<span>` wrapping `children`. |
|
|
1083
1084
|
*
|
|
1084
1085
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableactioncell
|
|
@@ -1115,7 +1116,7 @@ declare const DataTable: {
|
|
|
1115
1116
|
*
|
|
1116
1117
|
* | Data Attribute | Value | Description |
|
|
1117
1118
|
* | --- | --- | --- |
|
|
1118
|
-
* | `data-slot` | `"data-table-action-header"` | On the cell element. |
|
|
1119
|
+
* | `data-slot` | `"data-table-action-header table-header"` | On the cell element, joined ahead of `Table.Header`'s own slot. |
|
|
1119
1120
|
* | `data-slot` | `"data-table-action-header-label"` | On the `<span>` wrapping `children`. |
|
|
1120
1121
|
*
|
|
1121
1122
|
* @see https://mantle.ngrok.com/components/data-display/data-table#datatableactionheader
|
|
@@ -1150,7 +1151,7 @@ declare const DataTable: {
|
|
|
1150
1151
|
* });
|
|
1151
1152
|
* ```
|
|
1152
1153
|
*/
|
|
1153
|
-
readonly Cell: ({ children, className, ref, ...props }: ComponentProps<"td">) => import("react").JSX.Element;
|
|
1154
|
+
readonly Cell: ({ "data-slot": dataSlot, children, className, ref, ...props }: ComponentProps<"td"> & WithDataSlot) => import("react").JSX.Element;
|
|
1154
1155
|
/**
|
|
1155
1156
|
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
1156
1157
|
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is
|
package/dist/data-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./button-Dij5vCQG.js";import{t as n}from"./button-pwkdtR3U.js";import{t as r}from"./icons-Bu-2boul.js";import{n as i}from"./sandboxed-on-click-BLvvSqOP.js";import{t as a}from"./table-D2jh52KA.js";import{c as o}from"react/compiler-runtime";import{Fragment as s,createContext as c,useContext as l}from"react";import u from"tiny-invariant";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{Subscribe as m,callMemoOrStaticFn as h,flexRender as g}from"@tanstack/react-table";import{MinusIcon as _}from"@phosphor-icons/react/Minus";import{PlusIcon as v}from"@phosphor-icons/react/Plus";import{column_getIsSorted as y,row_getIsExpanded as b,row_getVisibleCells as x,table_getVisibleLeafColumns as S}from"@tanstack/react-table/static-functions";export*from"@tanstack/react-table";const C=[`unsorted`,`asc`,`desc`],w=[`unsorted`,`desc`,`asc`];function T(e,t){return E(t===`alphanumeric`?C:w,e)??`unsorted`}function E(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 D=c(null);function O(){return l(D)?.table.options}function k(){let e=l(D);return u(e,`useDataTableContext should only be used within a DataTable child component`),e}function A(e){let t=o(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,table:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let s;t[4]===i?s=t[5]:(s={table:i},t[4]=i,t[5]=s);let c=s,l;t[6]===n?l=t[7]:(l=f(a.Element,{children:n}),t[6]=n,t[7]=l);let u;t[8]!==r||t[9]!==l?(u=f(a.Root,{"data-slot":`data-table`,...r,children:l}),t[8]=r,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==c||t[12]!==u?(d=f(D.Provider,{value:c,children:u}),t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function j(n){let r=o(31),i,a,s,c,l,u,d,p,h,g,_;r[0]===n?(i=r[1],a=r[2],s=r[3],c=r[4],l=r[5],u=r[6],d=r[7],p=r[8],h=r[9],g=r[10],_=r[11]):({appearance:p,children:i,className:a,column:s,disableSorting:h,iconPlacement:g,intent:_,sortingMode:d,sortIcon:l,onClick:c,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=s,r[4]=c,r[5]=l,r[6]=u,r[7]=d,r[8]=p,r[9]=h,r[10]=g,r[11]=_);let v=p===void 0?`ghost`:p,y=h!==void 0&&h,b=g===void 0?`end`:g,x=_===void 0?`neutral`:_,S;r[12]!==v||r[13]!==i||r[14]!==a||r[15]!==s||r[16]!==y||r[17]!==b||r[18]!==x||r[19]!==c||r[20]!==l||r[21]!==u||r[22]!==d?(S=()=>{let n=s.getIsSorted(),r=!y&&s.getCanSort(),o=r&&typeof n==`string`?n:`unsorted`;if(!r)return f(`span`,{"data-slot":`data-table-header-sort-button`,"data-sort-direction":`unsorted`,className:e(`flex w-full items-center justify-start`,v===`ghost`&&x===`neutral`&&`text-muted`,a),...u,children:i});let p=l?.(o)??f(Q,{mode:d,direction:o});return f(t,{appearance:v,"data-slot":`data-table-header-sort-button`,className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none`,v===`ghost`&&x===`neutral`&&`text-muted`,a),"data-sort-direction":o,"data-table-header-action":!0,icon:p,iconPlacement:b,onClick:e=>{c?.(e),!e.defaultPrevented&&d!==void 0&&$(s,d)},intent:x,type:`button`,...u,children:i})},r[12]=v,r[13]=i,r[14]=a,r[15]=s,r[16]=y,r[17]=b,r[18]=x,r[19]=c,r[20]=l,r[21]=u,r[22]=d,r[23]=S):S=r[23];let C=S,w=O(),T;r[24]!==s||r[25]!==w?(T=()=>({sorted:s.getIsSorted(),options:w}),r[24]=s,r[25]=w,r[26]=T):T=r[26];let E;return r[27]!==s.table.store||r[28]!==C||r[29]!==T?(E=f(m,{source:s.table.store,selector:T,children:C}),r[27]=s.table.store,r[28]=C,r[29]=T,r[30]=E):E=r[30],E}function M(e){if(e==null)return;let t=h(e,`getIsSorted`,y);if(t===`asc`)return`ascending`;if(t===`desc`)return`descending`}function N(t){let n=o(19),r,i,s,c;n[0]===t?(r=n[1],i=n[2],s=n[3],c=n[4]):({children:r,className:i,column:s,...c}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=c);let l;n[5]!==r||n[6]!==i||n[7]!==s||n[8]!==c?(l=()=>f(a.Header,{"aria-sort":M(s),"data-slot":`data-table-header`,className:e(`has-data-table-header-action:px-0`,i),...c,children:r}),n[5]=r,n[6]=i,n[7]=s,n[8]=c,n[9]=l):l=n[9];let u=l,d=O();if(s==null){let e;return n[10]===u?e=n[11]:(e=u(),n[10]=u,n[11]=e),e}let p;n[12]!==s||n[13]!==d?(p=()=>({ariaSort:M(s),options:d}),n[12]=s,n[13]=d,n[14]=p):p=n[14];let h;return n[15]!==s.table.store||n[16]!==u||n[17]!==p?(h=f(m,{source:s.table.store,selector:p,children:u}),n[15]=s.table.store,n[16]=u,n[17]=p,n[18]=h):h=n[18],h}const P=e=>{let t=o(2),n;return t[0]===e?n=t[1]:(n=f(a.Body,{"data-slot":`data-table-body`,...e}),t[0]=e,t[1]=n),n};function F(e){let t=o(5),{table:n}=k(),r;t[0]===n?r=t[1]:(r=n.getHeaderGroups().map(I),t[0]=n,t[1]=r);let i;return t[2]!==e||t[3]!==r?(i=f(a.Head,{"data-slot":`data-table-head`,...e,children:r}),t[2]=e,t[3]=r,t[4]=i):i=t[4],i}function I(e){return f(a.Row,{children:e.headers.map(L)},e.id)}function L(e){return f(s,{children:e.isPlaceholder?f(a.Header,{}):g(e.column.columnDef.header,e.getContext())},e.id)}function R(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 z(t){let n=o(9),r,i;if(n[0]!==t){let{className:o,onClick:s,renderExpanded:c,row:l,...u}=t;r=l,i=()=>{let t=h(r,`getIsExpanded`,b),n=h(r,`getVisibleCells`,x),i=f(a.Row,{"data-slot":`data-table-row`,"data-expanded":t||void 0,"data-clickable":s==null?void 0:``,className:e(s!=null&&`cursor-pointer`,o),onClick:s&&(e=>{R(e)&&s(e)}),...u,children:n.map(B)});return c==null?i:p(d,{children:[i,t&&f(X,{row:r,children:c(r)})]})},n[0]=t,n[1]=r,n[2]=i}else r=n[1],i=n[2];let s=i,c=O(),l;n[3]===c?l=n[4]:(l=e=>({state:e,options:c}),n[3]=c,n[4]=l);let u;return n[5]!==s||n[6]!==r.table.store||n[7]!==l?(u=f(m,{source:r.table.store,selector:l,children:s}),n[5]=s,n[6]=r.table.store,n[7]=l,n[8]=u):u=n[8],u}function B(e){return f(s,{children:g(e.column.columnDef.cell,e.getContext())},e.id)}function V(e){let t=o(11),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{table:i}=k(),s;t[3]===i?s=t[4]:(s=h(i,`getVisibleLeafColumns`,S),t[3]=i,t[4]=s);let c=s.length,l;t[5]!==n||t[6]!==c?(l=f(a.Cell,{colSpan:c,children:n}),t[5]=n,t[6]=c,t[7]=l):l=t[7];let u;return t[8]!==r||t[9]!==l?(u=f(a.Row,{"data-slot":`data-table-empty-row`,...r,children:l}),t[8]=r,t[9]=l,t[10]=u):u=t[10],u}function H(){let t=o(1),n;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=f(`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 U(t){let n=o(17),r,s,c,l;n[0]===t?(r=n[1],s=n[2],c=n[3],l=n[4]):({children:r,className:s,onClick:c,...l}=t,n[0]=t,n[1]=r,n[2]=s,n[3]=c,n[4]=l);let u;n[5]===c?u=n[6]:(u=i({allowClickEventDefault:!0,onClick:c}),n[5]=c,n[6]=u);let{onClick:d}=u,m;n[7]===s?m=n[8]:(m=e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,s),n[7]=s,n[8]=m);let h;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=f(H,{}),n[9]=h):h=n[9];let g;n[10]===r?g=n[11]:(g=f(`span`,{"data-slot":`data-table-action-cell-label`,className:`contents`,children:r}),n[10]=r,n[11]=g);let _;return n[12]!==l||n[13]!==d||n[14]!==m||n[15]!==g?(_=p(a.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":`data-table-action-cell`,className:m,onClick:d,...l,children:[h,g]}),n[12]=l,n[13]=d,n[14]=m,n[15]=g,n[16]=_):_=n[16],_}function W(t){let n=o(23),r,i,s;n[0]===t?(r=n[1],i=n[2],s=n[3]):({children:r,className:i,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s);let{table:c}=k(),l;n[4]===c?l=n[5]:(l=c.getRowModel(),n[4]=c,n[5]=l);let u=l.rows.length>0,d;n[6]===u?d=n[7]:(d=u?{"data-mantle-table-sticky-right":!0}:{},n[6]=u,n[7]=d);let m=u&&`sticky z-10 right-0 bg-inherit`,h;n[8]!==i||n[9]!==m?(h=e(m,i),n[8]=i,n[9]=m,n[10]=h):h=n[10];let g;n[11]===r?g=n[12]:(g=r??f(`span`,{className:`sr-only`,children:`Actions`}),n[11]=r,n[12]=g);let _;n[13]===g?_=n[14]:(_=f(`span`,{"data-slot":`data-table-action-header-label`,className:`contents`,children:g}),n[13]=g,n[14]=_);let v;n[15]===u?v=n[16]:(v=u&&f(H,{}),n[15]=u,n[16]=v);let y;return n[17]!==s||n[18]!==d||n[19]!==h||n[20]!==_||n[21]!==v?(y=p(a.Header,{...d,"data-slot":`data-table-action-header`,className:h,...s,children:[_,v]}),n[17]=s,n[18]=d,n[19]=h,n[20]=_,n[21]=v,n[22]=y):y=n[22],y}function G(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function K(t){let n=o(12),r,i,s;n[0]===t?(r=n[1],i=n[2],s=n[3]):({children:r,className:i,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s);let c;n[4]===i?c=n[5]:(c=e(`w-9 px-0 text-center`,i),n[4]=i,n[5]=c);let l;n[6]===r?l=n[7]:(l=r??f(`span`,{className:`sr-only`,children:`Row details`}),n[6]=r,n[7]=l);let u;return n[8]!==s||n[9]!==c||n[10]!==l?(u=f(a.Header,{"data-slot":`data-table-expand-header`,className:c,...s,children:l}),n[8]=s,n[9]=c,n[10]=l,n[11]=u):u=n[11],u}const q=f(v,{weight:`bold`,className:`size-3.5`}),J=f(_,{weight:`bold`,className:`size-3.5`});function Y(t){let r=o(29),i,a,s,c,l,u,d,p,h,g;r[0]===t?(i=r[1],a=r[2],s=r[3],c=r[4],l=r[5],u=r[6],d=r[7],p=r[8],h=r[9],g=r[10]):({appearance:u,className:i,collapseIcon:d,expandIcon:p,intent:h,label:a,onClick:s,row:l,size:g,...c}=t,r[0]=t,r[1]=i,r[2]=a,r[3]=s,r[4]=c,r[5]=l,r[6]=u,r[7]=d,r[8]=p,r[9]=h,r[10]=g);let _=u===void 0?`ghost`:u,v=d===void 0?J:d,y=p===void 0?q:p,b=h===void 0?`neutral`:h,x=g===void 0?`sm`:g,S;r[11]!==_||r[12]!==i||r[13]!==v||r[14]!==y||r[15]!==b||r[16]!==a||r[17]!==s||r[18]!==c||r[19]!==l||r[20]!==x?(S=()=>{if(!l.getCanExpand())return null;let t=l.getIsExpanded(),r=l.getToggleExpandedHandler();return f(n,{type:`button`,"data-slot":`data-table-row-expand-button`,appearance:_,intent:b,size:x,className:e(`rounded`,i),"aria-expanded":t,"aria-controls":t?G(l):void 0,icon:t?v:y,label:`${t?`Hide`:`Show`} details for ${a}`,onClick:e=>{e.stopPropagation(),s?.(e),!e.defaultPrevented&&r()},...c})},r[11]=_,r[12]=i,r[13]=v,r[14]=y,r[15]=b,r[16]=a,r[17]=s,r[18]=c,r[19]=l,r[20]=x,r[21]=S):S=r[21];let C=S,w=O(),T;r[22]!==w||r[23]!==l?(T=()=>({isExpanded:l.getIsExpanded(),options:w}),r[22]=w,r[23]=l,r[24]=T):T=r[24];let E;return r[25]!==C||r[26]!==l.table.store||r[27]!==T?(E=f(m,{source:l.table.store,selector:T,children:C}),r[25]=C,r[26]=l.table.store,r[27]=T,r[28]=E):E=r[28],E}function X(t){let n=o(23),r,i,s,c,l;n[0]===t?(r=n[1],i=n[2],s=n[3],c=n[4],l=n[5]):({children:r,className:i,colSpan:s,row:l,...c}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=c,n[5]=l);let u;n[6]===l?u=n[7]:(u=()=>h(l,`getVisibleCells`,x).length,n[6]=l,n[7]=u);let d=u,p;n[8]!==r||n[9]!==i||n[10]!==c||n[11]!==l?(p=t=>{let{numberOfColumns:n}=t;return f(a.Row,{"data-slot":`data-table-expanded-row`,"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,i),...c,children:f(a.Cell,{id:G(l),colSpan:n,className:`bg-card font-sans text-body`,children:r})})},n[8]=r,n[9]=i,n[10]=c,n[11]=l,n[12]=p):p=n[12];let g=p,_=O();if(s!=null){let e;return n[13]!==s||n[14]!==g?(e=g({numberOfColumns:s}),n[13]=s,n[14]=g,n[15]=e):e=n[15],e}let v;n[16]!==d||n[17]!==_?(v=()=>({numberOfColumns:d(),options:_}),n[16]=d,n[17]=_,n[18]=v):v=n[18];let y;return n[19]!==g||n[20]!==l.table.store||n[21]!==v?(y=f(m,{source:l.table.store,selector:v,children:g}),n[19]=g,n[20]=l.table.store,n[21]=v,n[22]=y):y=n[22],y}const Z={Root:A,ActionCell:U,ActionHeader:W,Cell:a.Cell,Body:P,EmptyRow:V,Head:F,Header:N,HeaderSortButton:j,Row:z,ExpandHeader:K,RowExpandButton:Y,ExpandedRow:X};function Q(e){let t=o(10),n,i,a;if(t[0]===e?(n=t[1],i=t[2],a=t[3]):({direction:n,mode:i,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a),n===`unsorted`||!i||!n){let e;return t[4]===a?e=t[5]:(e=f(`svg`,{"aria-hidden":!0,...a}),t[4]=a,t[5]=e),e}let s;return t[6]!==n||t[7]!==i||t[8]!==a?(s=f(r,{mode:i,direction:n,...a}),t[6]=n,t[7]=i,t[8]=a,t[9]=s):s=t[9],s}function $(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(T(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{Z as DataTable,G 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-b2HKEIE2.js";import{t as r}from"./button-BMfUxs_j.js";import{t as i}from"./icons-CH3tD_wq.js";import{n as a}from"./sandboxed-on-click-C7pPu-2M.js";import{t as o}from"./table-DBbKqOVq.js";import{c as s}from"react/compiler-runtime";import{Fragment as c,createContext as l,useContext as u}from"react";import d from"tiny-invariant";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{Subscribe as h,callMemoOrStaticFn as g,flexRender as _}from"@tanstack/react-table";import{MinusIcon as v}from"@phosphor-icons/react/Minus";import{PlusIcon as y}from"@phosphor-icons/react/Plus";import{column_getIsSorted as b,row_getIsExpanded as x,row_getVisibleCells as S,table_getVisibleLeafColumns as C}from"@tanstack/react-table/static-functions";export*from"@tanstack/react-table";const w=[`unsorted`,`asc`,`desc`],T=[`unsorted`,`desc`,`asc`];function E(e,t){return D(t===`alphanumeric`?w:T,e)??`unsorted`}function D(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 O=l(null);function k(){return u(O)?.table.options}function A(){let e=u(O);return d(e,`useDataTableContext should only be used within a DataTable child component`),e}function j(e){let n=s(18),r,i,a,c;n[0]===e?(r=n[1],i=n[2],a=n[3],c=n[4]):({"data-slot":i,children:r,table:c,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=c);let l;n[5]===c?l=n[6]:(l={table:c},n[5]=c,n[6]=l);let u=l,d;n[7]===i?d=n[8]:(d=t(i,`data-table`),n[7]=i,n[8]=d);let f;n[9]===r?f=n[10]:(f=/* @__PURE__ */ p(o.Element,{children:r}),n[9]=r,n[10]=f);let m;n[11]!==a||n[12]!==d||n[13]!==f?(m=/* @__PURE__ */ p(o.Root,{"data-slot":d,...a,children:f}),n[11]=a,n[12]=d,n[13]=f,n[14]=m):m=n[14];let h;return n[15]!==u||n[16]!==m?(h=/* @__PURE__ */ p(O.Provider,{value:u,children:m}),n[15]=u,n[16]=m,n[17]=h):h=n[17],h}function M(r){let i=s(33),a,o,c,l,u,d,f,m,g,_,v,y;i[0]===r?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],m=i[8],g=i[9],_=i[10],v=i[11],y=i[12]):({"data-slot":l,appearance:g,children:a,className:o,column:c,disableSorting:_,iconPlacement:v,intent:y,sortingMode:m,sortIcon:d,onClick:u,...f}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=m,i[9]=g,i[10]=_,i[11]=v,i[12]=y);let b=g===void 0?`ghost`:g,x=_!==void 0&&_,S=v===void 0?`end`:v,C=y===void 0?`neutral`:y,w;i[13]!==b||i[14]!==a||i[15]!==o||i[16]!==c||i[17]!==l||i[18]!==x||i[19]!==S||i[20]!==C||i[21]!==u||i[22]!==d||i[23]!==f||i[24]!==m?(w=()=>{let r=c.getIsSorted(),i=!x&&c.getCanSort(),s=i&&typeof r==`string`?r:`unsorted`;if(!i)return/* @__PURE__ */ p(`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 h=d?.(s)??/* @__PURE__ */ p($,{mode:m,direction:s});return/* @__PURE__ */ p(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":s,"data-table-header-action":!0,icon:h,iconPlacement:S,onClick:e=>{u?.(e),!e.defaultPrevented&&m!==void 0&&ee(c,m)},intent:C,type:`button`,...f,children:a})},i[13]=b,i[14]=a,i[15]=o,i[16]=c,i[17]=l,i[18]=x,i[19]=S,i[20]=C,i[21]=u,i[22]=d,i[23]=f,i[24]=m,i[25]=w):w=i[25];let T=w,E=k(),D;i[26]!==c||i[27]!==E?(D=()=>({sorted:c.getIsSorted(),options:E}),i[26]=c,i[27]=E,i[28]=D):D=i[28];let O;return i[29]!==c.table.store||i[30]!==T||i[31]!==D?(O=/* @__PURE__ */ p(h,{source:c.table.store,selector:D,children:T}),i[29]=c.table.store,i[30]=T,i[31]=D,i[32]=O):O=i[32],O}function N(e){if(e==null)return;let t=g(e,`getIsSorted`,b);if(t===`asc`)return`ascending`;if(t===`desc`)return`descending`}function P(n){let r=s(21),i,a,c,l,u;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4],u=r[5]):({"data-slot":l,children:i,className:a,column:c,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l,r[5]=u);let d;r[6]!==i||r[7]!==a||r[8]!==c||r[9]!==l||r[10]!==u?(d=()=>/* @__PURE__ */ p(o.Header,{"aria-sort":N(c),"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]=c,r[9]=l,r[10]=u,r[11]=d):d=r[11];let f=d,m=k();if(c==null){let e;return r[12]===f?e=r[13]:(e=f(),r[12]=f,r[13]=e),e}let g;r[14]!==c||r[15]!==m?(g=()=>({ariaSort:N(c),options:m}),r[14]=c,r[15]=m,r[16]=g):g=r[16];let _;return r[17]!==c.table.store||r[18]!==f||r[19]!==g?(_=/* @__PURE__ */ p(h,{source:c.table.store,selector:g,children:f}),r[17]=c.table.store,r[18]=f,r[19]=g,r[20]=_):_=r[20],_}const F=e=>{let n=s(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 c;return n[5]!==i||n[6]!==a?(c=/* @__PURE__ */ p(o.Body,{"data-slot":a,...i}),n[5]=i,n[6]=a,n[7]=c):c=n[7],c};function I(e){let n=s(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}=A(),c;n[3]===r?c=n[4]:(c=t(r,`data-table-head`),n[3]=r,n[4]=c);let l;n[5]===a?l=n[6]:(l=a.getHeaderGroups().map(L),n[5]=a,n[6]=l);let u;return n[7]!==i||n[8]!==c||n[9]!==l?(u=/* @__PURE__ */ p(o.Head,{"data-slot":c,...i,children:l}),n[7]=i,n[8]=c,n[9]=l,n[10]=u):u=n[10],u}function L(e){return/* @__PURE__ */ p(o.Row,{children:e.headers.map(R)},e.id)}function R(e){return/* @__PURE__ */ p(c,{children:e.isPlaceholder?/* @__PURE__ */ p(o.Header,{}):_(e.column.columnDef.header,e.getContext())},e.id)}function z(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 B(n){let r=s(9),i,a;if(r[0]!==n){let{"data-slot":s,className:c,onClick:l,renderExpanded:u,row:d,...h}=n;i=d,a=()=>{let n=g(i,`getIsExpanded`,x),r=g(i,`getVisibleCells`,S),a=/* @__PURE__ */ p(o.Row,{"data-slot":t(s,`data-table-row`),"data-expanded":n||void 0,"data-clickable":l==null?void 0:``,className:e(l!=null&&`cursor-pointer`,c),onClick:l&&(e=>{z(e)&&l(e)}),...h,children:r.map(V)});return u==null?a:/* @__PURE__ */ m(f,{children:[a,n&&/* @__PURE__ */ p(Z,{row:i,children:u(i)})]})},r[0]=n,r[1]=i,r[2]=a}else i=r[1],a=r[2];let c=a,l=k(),u;r[3]===l?u=r[4]:(u=e=>({state:e,options:l}),r[3]=l,r[4]=u);let d;return r[5]!==c||r[6]!==i.table.store||r[7]!==u?(d=/* @__PURE__ */ p(h,{source:i.table.store,selector:u,children:c}),r[5]=c,r[6]=i.table.store,r[7]=u,r[8]=d):d=r[8],d}function V(e){return/* @__PURE__ */ p(c,{children:_(e.column.columnDef.cell,e.getContext())},e.id)}function H(e){let n=s(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:c}=A(),l;n[4]===c?l=n[5]:(l=g(c,`getVisibleLeafColumns`,C),n[4]=c,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__ */ p(o.Cell,{colSpan:u,children:r}),n[8]=r,n[9]=u,n[10]=f):f=n[10];let m;return n[11]!==a||n[12]!==d||n[13]!==f?(m=/* @__PURE__ */ p(o.Row,{"data-slot":d,...a,children:f}),n[11]=a,n[12]=d,n[13]=f,n[14]=m):m=n[14],m}function U(){let t=s(1),n;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=/* @__PURE__ */ p(`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 W(n){let r=s(21),i,c,l,u,d;r[0]===n?(i=r[1],c=r[2],l=r[3],u=r[4],d=r[5]):({"data-slot":l,children:i,className:c,onClick:u,...d}=n,r[0]=n,r[1]=i,r[2]=c,r[3]=l,r[4]=u,r[5]=d);let f;r[6]===u?f=r[7]:(f=a({allowClickEventDefault:!0,onClick:u}),r[6]=u,r[7]=f);let{onClick:h}=f,g;r[8]===l?g=r[9]:(g=t(l,`data-table-action-cell`),r[8]=l,r[9]=g);let _;r[10]===c?_=r[11]:(_=e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,c),r[10]=c,r[11]=_);let v;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=/* @__PURE__ */ p(U,{}),r[12]=v):v=r[12];let y;r[13]===i?y=r[14]:(y=/* @__PURE__ */ p(`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]!==h||r[17]!==g||r[18]!==_||r[19]!==y?(b=/* @__PURE__ */ m(o.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":g,className:_,onClick:h,...d,children:[v,y]}),r[15]=d,r[16]=h,r[17]=g,r[18]=_,r[19]=y,r[20]=b):b=r[20],b}function G(n){let r=s(27),i,a,c,l;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4]):({"data-slot":c,children:i,className:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l);let{table:u}=A(),d;r[5]===u?d=r[6]:(d=u.getRowModel(),r[5]=u,r[6]=d);let f=d.rows.length>0,h;r[7]===f?h=r[8]:(h=f?{"data-mantle-table-sticky-right":!0}:{},r[7]=f,r[8]=h);let g;r[9]===c?g=r[10]:(g=t(c,`data-table-action-header`),r[9]=c,r[10]=g);let _=f&&`sticky z-10 right-0 bg-inherit`,v;r[11]!==a||r[12]!==_?(v=e(_,a),r[11]=a,r[12]=_,r[13]=v):v=r[13];let y;r[14]===i?y=r[15]:(y=i??/* @__PURE__ */ p(`span`,{className:`sr-only`,children:`Actions`}),r[14]=i,r[15]=y);let b;r[16]===y?b=r[17]:(b=/* @__PURE__ */ p(`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__ */ p(U,{}),r[18]=f,r[19]=x);let S;return r[20]!==l||r[21]!==h||r[22]!==g||r[23]!==v||r[24]!==b||r[25]!==x?(S=/* @__PURE__ */ m(o.Header,{...h,"data-slot":g,className:v,...l,children:[b,x]}),r[20]=l,r[21]=h,r[22]=g,r[23]=v,r[24]=b,r[25]=x,r[26]=S):S=r[26],S}function K(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function q(n){let r=s(16),i,a,c,l;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4]):({"data-slot":c,children:i,className:a,...l}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l);let u;r[5]===c?u=r[6]:(u=t(c,`data-table-expand-header`),r[5]=c,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__ */ p(`span`,{className:`sr-only`,children:`Row details`}),r[9]=i,r[10]=f);let m;return r[11]!==l||r[12]!==u||r[13]!==d||r[14]!==f?(m=/* @__PURE__ */ p(o.Header,{"data-slot":u,className:d,...l,children:f}),r[11]=l,r[12]=u,r[13]=d,r[14]=f,r[15]=m):m=r[15],m}const J=/* @__PURE__ */ p(y,{weight:`bold`,className:`size-3.5`}),Y=/* @__PURE__ */ p(v,{weight:`bold`,className:`size-3.5`});function X(n){let i=s(31),a,o,c,l,u,d,f,m,g,_,v;i[0]===n?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],m=i[8],g=i[9],_=i[10],v=i[11]):({"data-slot":o,appearance:f,className:a,collapseIcon:m,expandIcon:g,intent:_,label:c,onClick:l,row:d,size:v,...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]=f,i[8]=m,i[9]=g,i[10]=_,i[11]=v);let y=f===void 0?`ghost`:f,b=m===void 0?Y:m,x=g===void 0?J:g,S=_===void 0?`neutral`:_,C=v===void 0?`sm`:v,w;i[12]!==y||i[13]!==a||i[14]!==b||i[15]!==o||i[16]!==x||i[17]!==S||i[18]!==c||i[19]!==l||i[20]!==u||i[21]!==d||i[22]!==C?(w=()=>{if(!d.getCanExpand())return null;let n=d.getIsExpanded(),i=d.getToggleExpandedHandler();return/* @__PURE__ */ p(r,{type:`button`,"data-slot":t(o,`data-table-row-expand-button`),appearance:y,intent:S,size:C,className:e(`rounded`,a),"aria-expanded":n,"aria-controls":n?K(d):void 0,icon:n?b:x,label:`${n?`Hide`:`Show`} details for ${c}`,onClick:e=>{e.stopPropagation(),l?.(e),!e.defaultPrevented&&i()},...u})},i[12]=y,i[13]=a,i[14]=b,i[15]=o,i[16]=x,i[17]=S,i[18]=c,i[19]=l,i[20]=u,i[21]=d,i[22]=C,i[23]=w):w=i[23];let T=w,E=k(),D;i[24]!==E||i[25]!==d?(D=()=>({isExpanded:d.getIsExpanded(),options:E}),i[24]=E,i[25]=d,i[26]=D):D=i[26];let O;return i[27]!==T||i[28]!==d.table.store||i[29]!==D?(O=/* @__PURE__ */ p(h,{source:d.table.store,selector:D,children:T}),i[27]=T,i[28]=d.table.store,i[29]=D,i[30]=O):O=i[30],O}function Z(n){let r=s(25),i,a,c,l,u,d;r[0]===n?(i=r[1],a=r[2],c=r[3],l=r[4],u=r[5],d=r[6]):({"data-slot":l,children:i,className:a,colSpan:c,row:d,...u}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=c,r[4]=l,r[5]=u,r[6]=d);let f;r[7]===d?f=r[8]:(f=()=>g(d,`getVisibleCells`,S).length,r[7]=d,r[8]=f);let m=f,_;r[9]!==i||r[10]!==a||r[11]!==l||r[12]!==u||r[13]!==d?(_=n=>{let{numberOfColumns:r}=n;return/* @__PURE__ */ p(o.Row,{"data-slot":t(l,`data-table-expanded-row`),"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,a),...u,children:/* @__PURE__ */ p(o.Cell,{id:K(d),colSpan:r,className:`bg-card font-sans text-body`,children:i})})},r[9]=i,r[10]=a,r[11]=l,r[12]=u,r[13]=d,r[14]=_):_=r[14];let v=_,y=k();if(c!=null){let e;return r[15]!==c||r[16]!==v?(e=v({numberOfColumns:c}),r[15]=c,r[16]=v,r[17]=e):e=r[17],e}let b;r[18]!==m||r[19]!==y?(b=()=>({numberOfColumns:m(),options:y}),r[18]=m,r[19]=y,r[20]=b):b=r[20];let x;return r[21]!==v||r[22]!==d.table.store||r[23]!==b?(x=/* @__PURE__ */ p(h,{source:d.table.store,selector:b,children:v}),r[21]=v,r[22]=d.table.store,r[23]=b,r[24]=x):x=r[24],x}const Q={Root:j,ActionCell:W,ActionHeader:G,Cell:o.Cell,Body:F,EmptyRow:H,Head:I,Header:P,HeaderSortButton:M,Row:B,ExpandHeader:q,RowExpandButton:X,ExpandedRow:Z};function $(e){let t=s(10),n,r,a;if(t[0]===e?(n=t[1],r=t[2],a=t[3]):({direction:n,mode:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a),n===`unsorted`||!r||!n){let e;return t[4]===a?e=t[5]:(e=/* @__PURE__ */ p(`svg`,{"aria-hidden":!0,...a}),t[4]=a,t[5]=e),e}let o;return t[6]!==n||t[7]!==r||t[8]!==a?(o=/* @__PURE__ */ p(i,{mode:r,direction:n,...a}),t[6]=n,t[7]=r,t[8]=a,t[9]=o):o=t[9],o}function ee(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(E(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{Q as DataTable,K as expandedRowId};
|
|
@@ -35,7 +35,7 @@ declare const Root: ({ asChild, className, children, "data-slot": dataSlot, ref,
|
|
|
35
35
|
/**
|
|
36
36
|
* Props for `DescriptionList.Item`.
|
|
37
37
|
*/
|
|
38
|
-
type DescriptionListItemProps = ComponentProps<"div"> & WithAsChild;
|
|
38
|
+
type DescriptionListItemProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
|
|
39
39
|
/**
|
|
40
40
|
* A wrapper that groups a `DescriptionList.Label` and `DescriptionList.Value`
|
|
41
41
|
* pair. Renders as a `<div>` inside the `<dl>` with a subgrid layout that
|
|
@@ -57,11 +57,11 @@ type DescriptionListItemProps = ComponentProps<"div"> & WithAsChild;
|
|
|
57
57
|
* </DescriptionList.Root>
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
-
declare const Item: ({ asChild, className, children, ref, ...rest }: DescriptionListItemProps) => import("react").JSX.Element;
|
|
60
|
+
declare const Item: ({ "data-slot": dataSlot, asChild, className, children, ref, ...rest }: DescriptionListItemProps) => import("react").JSX.Element;
|
|
61
61
|
/**
|
|
62
62
|
* Props for `DescriptionList.Label`.
|
|
63
63
|
*/
|
|
64
|
-
type DescriptionListLabelProps = ComponentProps<"dt"> & WithAsChild;
|
|
64
|
+
type DescriptionListLabelProps = ComponentProps<"dt"> & WithAsChild & WithDataSlot;
|
|
65
65
|
/**
|
|
66
66
|
* The label for a description list item. Renders as a `<dt>` element.
|
|
67
67
|
*
|
|
@@ -81,11 +81,11 @@ type DescriptionListLabelProps = ComponentProps<"dt"> & WithAsChild;
|
|
|
81
81
|
* </DescriptionList.Root>
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
|
-
declare const Label: ({ asChild, className, children, ref, ...rest }: DescriptionListLabelProps) => import("react").JSX.Element;
|
|
84
|
+
declare const Label: ({ "data-slot": dataSlot, asChild, className, children, ref, ...rest }: DescriptionListLabelProps) => import("react").JSX.Element;
|
|
85
85
|
/**
|
|
86
86
|
* Props for `DescriptionList.Value`.
|
|
87
87
|
*/
|
|
88
|
-
type DescriptionListValueProps = ComponentProps<"dd"> & WithAsChild;
|
|
88
|
+
type DescriptionListValueProps = ComponentProps<"dd"> & WithAsChild & WithDataSlot;
|
|
89
89
|
/**
|
|
90
90
|
* The value for a description list item. Renders as a `<dd>` element.
|
|
91
91
|
* Compose any content inside: the component is intentionally "dumb" and
|
|
@@ -107,7 +107,7 @@ type DescriptionListValueProps = ComponentProps<"dd"> & WithAsChild;
|
|
|
107
107
|
* </DescriptionList.Root>
|
|
108
108
|
* ```
|
|
109
109
|
*/
|
|
110
|
-
declare const Value: ({ asChild, className, children, ref, ...rest }: DescriptionListValueProps) => import("react").JSX.Element;
|
|
110
|
+
declare const Value: ({ "data-slot": dataSlot, asChild, className, children, ref, ...rest }: DescriptionListValueProps) => import("react").JSX.Element;
|
|
111
111
|
/**
|
|
112
112
|
* A semantically correct description list built on the HTML `<dl>` element.
|
|
113
113
|
* Renders a list of label/value pairs with alternating row backgrounds,
|
package/dist/description-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DdYN1L1C.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({asChild:f,className:c,children:s,"data-slot":l,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`dl`,m;o[7]===l?m=o[8]:(m=t(l,`description-list`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`relative scrollbar overflow-x-auto overscroll-x-none rounded-lg border border-card grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 [&>*:nth-child(odd)]:bg-neutral-500/5 p-1`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Item:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`div`,m;o[7]===l?m=o[8]:(m=t(l,`description-list-item`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`rounded-sm col-span-full grid grid-cols-subgrid items-center`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Label:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`dt`,m;o[7]===l?m=o[8]:(m=t(l,`description-list-label`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`text-muted text-sm font-sans font-medium min-w-36 p-2`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Value:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`dd`,m;o[7]===l?m=o[8]:(m=t(l,`description-list-value`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`text-body font-mono text-mono py-2 px-3`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g}};export{a as DescriptionList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-BMfUxs_j.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,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
2
|
+
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-DL7V4bzW.js";
|
|
2
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-CZYD3xL-.js";
|
|
3
4
|
import { ComponentProps } from "react";
|
|
4
5
|
//#region src/components/dialog/dialog.d.ts
|
|
@@ -32,7 +33,7 @@ import { ComponentProps } from "react";
|
|
|
32
33
|
* </Dialog.Root>
|
|
33
34
|
* ```
|
|
34
35
|
*/
|
|
35
|
-
declare const Trigger: (props: ComponentProps<typeof Trigger$1>) => import("react").JSX.Element;
|
|
36
|
+
declare const Trigger: ({ "data-slot": dataSlot, ...props }: ComponentProps<typeof Trigger$1> & WithDataSlot) => import("react").JSX.Element;
|
|
36
37
|
/**
|
|
37
38
|
* A button that closes the dialog when clicked. Wrap an interactive element
|
|
38
39
|
* with `asChild` to delegate the close behavior to your own button.
|
|
@@ -64,7 +65,7 @@ declare const Trigger: (props: ComponentProps<typeof Trigger$1>) => import("reac
|
|
|
64
65
|
* </Dialog.Root>
|
|
65
66
|
* ```
|
|
66
67
|
*/
|
|
67
|
-
declare const Close: (props: ComponentProps<typeof Close$1>) => import("react").JSX.Element;
|
|
68
|
+
declare const Close: ({ "data-slot": dataSlot, ...props }: ComponentProps<typeof Close$1> & WithDataSlot) => import("react").JSX.Element;
|
|
68
69
|
/**
|
|
69
70
|
* The backdrop overlay for the dialog. Sits between the page and the dialog
|
|
70
71
|
* content and applies a blur and dim effect.
|
|
@@ -103,7 +104,7 @@ declare const Close: (props: ComponentProps<typeof Close$1>) => import("react").
|
|
|
103
104
|
* </Dialog.Root>
|
|
104
105
|
* ```
|
|
105
106
|
*/
|
|
106
|
-
declare const Overlay: ({ className, ref, ...props }: ComponentProps<typeof Overlay$1>) => import("react").JSX.Element;
|
|
107
|
+
declare const Overlay: ({ "data-slot": dataSlot, className, ref, ...props }: ComponentProps<typeof Overlay$1> & WithDataSlot) => import("react").JSX.Element;
|
|
107
108
|
type ContentProps = ComponentProps<typeof Content$1> & ({
|
|
108
109
|
/**
|
|
109
110
|
* How much of the viewport the dialog claims. `"centered"` is a card
|
|
@@ -137,7 +138,7 @@ type ContentProps = ComponentProps<typeof Content$1> & ({
|
|
|
137
138
|
* so it has no width to cap — pass `appearance="centered"` to cap it.
|
|
138
139
|
*/
|
|
139
140
|
preferredWidth?: never;
|
|
140
|
-
});
|
|
141
|
+
}) & WithDataSlot;
|
|
141
142
|
/**
|
|
142
143
|
* The container for the dialog content.
|
|
143
144
|
* Renders on top of the overlay and is centered in the viewport.
|
|
@@ -208,9 +209,15 @@ type ContentProps = ComponentProps<typeof Content$1> & ({
|
|
|
208
209
|
* </Dialog.Root>
|
|
209
210
|
* ```
|
|
210
211
|
*/
|
|
211
|
-
declare const Content: ({ appearance, children, className, preferredWidth, ref, ...props }: ContentProps) => import("react").JSX.Element;
|
|
212
|
+
declare const Content: ({ "data-slot": dataSlot, appearance, children, className, preferredWidth, ref, ...props }: ContentProps) => import("react").JSX.Element;
|
|
212
213
|
/**
|
|
213
|
-
* Contains the
|
|
214
|
+
* Contains the title, the description, and the close button of the dialog.
|
|
215
|
+
* `Dialog.Title` and `Dialog.Description` stack in a column. Every other child
|
|
216
|
+
* shares the title's row, so a long title truncates beside
|
|
217
|
+
* `Dialog.CloseIconButton`.
|
|
218
|
+
*
|
|
219
|
+
* The stack keys on the `data-slot` of each direct child. If a wrapper holds
|
|
220
|
+
* the title and the description, the wrapper owns their layout.
|
|
214
221
|
*
|
|
215
222
|
* @see https://mantle.ngrok.com/components/overlays/dialog#dialogheader
|
|
216
223
|
*
|
|
@@ -239,7 +246,7 @@ declare const Content: ({ appearance, children, className, preferredWidth, ref,
|
|
|
239
246
|
* </Dialog.Root>
|
|
240
247
|
* ```
|
|
241
248
|
*/
|
|
242
|
-
declare const Header: ({ className, children, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
249
|
+
declare const Header: ({ "data-slot": dataSlot, className, children, ...props }: ComponentProps<"div"> & WithDataSlot) => import("react").JSX.Element;
|
|
243
250
|
type CloseIconButtonProps = Partial<Omit<IconButtonProps, "appearance" | "icon" | "intent">> & {
|
|
244
251
|
/**
|
|
245
252
|
* The visual style of the close icon button. Optional here —
|
|
@@ -258,7 +265,7 @@ type CloseIconButtonProps = Partial<Omit<IconButtonProps, "appearance" | "icon"
|
|
|
258
265
|
* @default "neutral"
|
|
259
266
|
*/
|
|
260
267
|
intent?: IconButtonIntent;
|
|
261
|
-
};
|
|
268
|
+
} & WithDataSlot;
|
|
262
269
|
/**
|
|
263
270
|
* An icon button that closes the dialog when clicked.
|
|
264
271
|
*
|
|
@@ -289,7 +296,7 @@ type CloseIconButtonProps = Partial<Omit<IconButtonProps, "appearance" | "icon"
|
|
|
289
296
|
* </Dialog.Root>
|
|
290
297
|
* ```
|
|
291
298
|
*/
|
|
292
|
-
declare const CloseIconButton: ({ size, type, label, appearance, intent, ...props }: CloseIconButtonProps) => import("react").JSX.Element;
|
|
299
|
+
declare const CloseIconButton: ({ "data-slot": dataSlot, size, type, label, appearance, intent, ...props }: CloseIconButtonProps) => import("react").JSX.Element;
|
|
293
300
|
/**
|
|
294
301
|
* Contains the main content of the dialog.
|
|
295
302
|
*
|
|
@@ -320,7 +327,7 @@ declare const CloseIconButton: ({ size, type, label, appearance, intent, ...prop
|
|
|
320
327
|
* </Dialog.Root>
|
|
321
328
|
* ```
|
|
322
329
|
*/
|
|
323
|
-
declare const Body: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
330
|
+
declare const Body: ({ "data-slot": dataSlot, className, ...props }: ComponentProps<"div"> & WithDataSlot) => import("react").JSX.Element;
|
|
324
331
|
/**
|
|
325
332
|
* Contains the footer content of the dialog, including action buttons.
|
|
326
333
|
*
|
|
@@ -351,7 +358,7 @@ declare const Body: ({ className, ...props }: ComponentProps<"div">) => import("
|
|
|
351
358
|
* </Dialog.Root>
|
|
352
359
|
* ```
|
|
353
360
|
*/
|
|
354
|
-
declare const Footer: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
361
|
+
declare const Footer: ({ "data-slot": dataSlot, className, ...props }: ComponentProps<"div"> & WithDataSlot) => import("react").JSX.Element;
|
|
355
362
|
/**
|
|
356
363
|
* An accessible name to be announced when the dialog is opened.
|
|
357
364
|
*
|
|
@@ -382,7 +389,7 @@ declare const Footer: ({ className, ...props }: ComponentProps<"div">) => import
|
|
|
382
389
|
* </Dialog.Root>
|
|
383
390
|
* ```
|
|
384
391
|
*/
|
|
385
|
-
declare const Title: ({ className, ref, ...props }: ComponentProps<typeof Title$1>) => import("react").JSX.Element;
|
|
392
|
+
declare const Title: ({ "data-slot": dataSlot, className, ref, ...props }: ComponentProps<typeof Title$1> & WithDataSlot) => import("react").JSX.Element;
|
|
386
393
|
/**
|
|
387
394
|
* An accessible description to be announced when the dialog is opened.
|
|
388
395
|
* Renders as a `div` by default, but can be changed to any other element using
|
|
@@ -415,7 +422,7 @@ declare const Title: ({ className, ref, ...props }: ComponentProps<typeof Title$
|
|
|
415
422
|
* </Dialog.Root>
|
|
416
423
|
* ```
|
|
417
424
|
*/
|
|
418
|
-
declare const Description: ({ className, ref, ...props }: ComponentProps<typeof Description$1>) => import("react").JSX.Element;
|
|
425
|
+
declare const Description: ({ "data-slot": dataSlot, className, ref, ...props }: ComponentProps<typeof Description$1> & WithDataSlot) => import("react").JSX.Element;
|
|
419
426
|
/**
|
|
420
427
|
* A window overlaid on either the primary window or another dialog window. Use
|
|
421
428
|
* Dialog for a focused modal that interrupts the user to gather input or
|
|
@@ -740,7 +747,13 @@ declare const Dialog: {
|
|
|
740
747
|
*/
|
|
741
748
|
readonly Footer: typeof Footer;
|
|
742
749
|
/**
|
|
743
|
-
* Contains the
|
|
750
|
+
* Contains the title, the description, and the close button of the dialog.
|
|
751
|
+
* `Dialog.Title` and `Dialog.Description` stack in a column. Every other child
|
|
752
|
+
* shares the title's row, so a long title truncates beside
|
|
753
|
+
* `Dialog.CloseIconButton`.
|
|
754
|
+
*
|
|
755
|
+
* The stack keys on the `data-slot` of each direct child. If a wrapper holds
|
|
756
|
+
* the title and the description, the wrapper owns their layout.
|
|
744
757
|
*
|
|
745
758
|
* @see https://mantle.ngrok.com/components/overlays/dialog#dialogheader
|
|
746
759
|
*
|
package/dist/dialog.d.ts
CHANGED
package/dist/dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as e}from"./primitive-AGoxSJBI.js";import{t}from"./dialog-CaGJD02w.js";export{t as Dialog,e as isDialogOverlayTarget};
|