@ngrok/mantle 0.76.4 → 0.76.6
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/README.md +6 -6
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/{anchor-CcTY5SIz.js → anchor-BtgEJoPN.js} +1 -1
- package/dist/anchor.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button-BK8Thu3k.js +1 -0
- package/dist/{button-BAxneEMu.js → button-CERx95KE.js} +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/clsx-DUGZgXfJ.js +1 -0
- package/dist/clsx-Dj3RWZ2l.js +1 -0
- package/dist/code-block.d.ts +76 -1
- package/dist/code-block.js +7 -2
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.js +1 -1
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +6 -6
- package/dist/command.js +1 -1
- package/dist/cx-C1UYP5We.js +1 -0
- package/dist/cx.d.ts +55 -6
- package/dist/cx.js +1 -1
- package/dist/data-table.d.ts +318 -3
- package/dist/data-table.js +1 -1
- package/dist/description-list.js +1 -1
- package/dist/{dialog-ebkUwitP.js → dialog-2tNq-mRR.js} +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-BHyYWtrH.js → dropdown-menu-Dj8qPMRh.js} +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.js +1 -1
- package/dist/field.d.ts +1 -1
- package/dist/field.js +1 -1
- package/dist/flag.js +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/icon-SUx16Sl3.js +1 -0
- package/dist/{icon-button-D7hs6bX2.d.ts → icon-button-BPvRuor6.d.ts} +2 -2
- package/dist/{icon-button-DUNHVWpb.js → icon-button-CbqMI7q3.js} +1 -1
- package/dist/icon.js +1 -1
- package/dist/icons.js +1 -1
- package/dist/input.js +1 -1
- package/dist/{kbd-Bv6tefdB.js → kbd-D6k4Dnrf.js} +1 -1
- package/dist/kbd.js +1 -1
- package/dist/{label-DhIUmTN2.js → label-BLXfnQmn.js} +1 -1
- package/dist/label.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/main.js +1 -1
- package/dist/media-object.js +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/{popover-DponNBot.js → popover-Bq52EC7X.js} +1 -1
- package/dist/popover.js +1 -1
- package/dist/{primitive-Cn3h4DJg.js → primitive-BEuiJONo.js} +1 -1
- package/dist/progress.js +1 -1
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/resolve-pre-rendered-props-DwIF_M_K.js +12 -0
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/{select-g0E_TsXr.js → select-CvI6VKAL.js} +1 -1
- package/dist/select.js +1 -1
- package/dist/{separator-BXFUCWFa.js → separator-DtufgIHt.js} +1 -1
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +1 -1
- package/dist/sheet.js +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/{slot-CV5fmqFr.js → slot-DT_E5BQx.js} +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +1 -1
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-Cz1cby8y.js → svg-only-CSOaF1tL.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-DWy_oNta.js → table-DpEcAEq5.js} +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-area.js +1 -1
- package/dist/{theme-provider-MMwxHEfw.js → theme-provider-BNFS3Acf.js} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{toast-CR3MVChj.js → toast-Bwno5LUs.js} +1 -1
- package/dist/toast.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/well.js +1 -1
- package/package.json +1 -9
- package/dist/button-BfMn3PgP.js +0 -1
- package/dist/cx-CBSnSC36.js +0 -1
- package/dist/icon-C8bYBIHW.js +0 -1
- package/dist/resolve-pre-rendered-props-D9nlC6xE.js +0 -12
package/dist/cx.d.ts
CHANGED
|
@@ -1,11 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/utils/cx/vendor/clsx.d.ts
|
|
2
|
+
interface ClassDictionary {
|
|
3
|
+
[className: string]: any;
|
|
4
|
+
}
|
|
5
|
+
type ClassValue = string | number | bigint | boolean | null | undefined | ClassValue[] | ClassDictionary;
|
|
6
|
+
declare const clsx$1: (...inputs: ClassValue[]) => string;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/utils/cx/clsx.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Conditionally join class names into a single space-separated string, with falsy
|
|
11
|
+
* values ignored — **without** Tailwind conflict resolution.
|
|
12
|
+
*
|
|
13
|
+
* Vendored `clsx`. Prefer {@link cx} for composing a `className` (it also resolves
|
|
14
|
+
* Tailwind conflicts); reach for `clsx` only when you need a plain space-join that
|
|
15
|
+
* must not be run through the Tailwind merge engine (e.g. assembling a sentence).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* clsx("base", isActive && "active", { disabled: isDisabled }); // → "base active"
|
|
19
|
+
*/
|
|
20
|
+
declare const clsx: typeof clsx$1;
|
|
21
|
+
//#endregion
|
|
3
22
|
//#region src/utils/cx/cx.d.ts
|
|
4
23
|
/**
|
|
5
|
-
*
|
|
24
|
+
* The two ways `cx` can be called: as a normal variadic function, or as a tagged
|
|
25
|
+
* template literal.
|
|
26
|
+
*/
|
|
27
|
+
type ClassNameFunction = {
|
|
28
|
+
(strings: TemplateStringsArray, ...values: ClassValue[]): string;
|
|
29
|
+
(...inputs: ClassValue[]): string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Conditionally compose class names and resolve Tailwind CSS conflicts, so later
|
|
33
|
+
* classes override earlier ones (the same precedence model as inline styles).
|
|
34
|
+
*
|
|
35
|
+
* Accepts the same inputs as `clsx` — strings, numbers, arrays, and
|
|
36
|
+
* `{ [className]: boolean }` objects, with falsy values ignored — then resolves
|
|
37
|
+
* Tailwind utility conflicts so the rightmost class in each conflicting group wins.
|
|
38
|
+
* This makes `cx` safe for prop overrides: `cx("bg-blue-500", className)` lets a
|
|
39
|
+
* consumer's `className` win.
|
|
40
|
+
*
|
|
41
|
+
* Conflict resolution uses a vendored, byte-for-byte port of `tailwind-merge` (see
|
|
42
|
+
* `./vendor`) with mantle's overrides baked into the default config: the `em` spacing
|
|
43
|
+
* scale (`w-em`, `p-em`, …) and the `text-mono` / `text-size-inherit` font-size
|
|
44
|
+
* utilities are conflict-aware with no `extendTailwindMerge` call. Results are cached so
|
|
45
|
+
* repeated calls with the same arguments — the common case across re-renders — are cheap.
|
|
46
|
+
*
|
|
47
|
+
* Also callable as a tagged template, which caches by call-site identity for hot
|
|
48
|
+
* re-rendering paths: `` cx`px-2 px-4 ${active && "bg-blue-500"}` ``.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // Conditional + object syntax; later class wins on conflict
|
|
52
|
+
* cx("px-4 py-2", isActive && "bg-blue-500", { "text-red-500": hasError });
|
|
53
|
+
* // → "px-4 py-2 bg-blue-500 text-red-500" (when isActive && hasError)
|
|
6
54
|
*
|
|
7
|
-
*
|
|
55
|
+
* @example
|
|
56
|
+
* cx("text-red-500", "text-blue-500"); // → "text-blue-500"
|
|
8
57
|
*/
|
|
9
|
-
declare
|
|
58
|
+
declare const cx: ClassNameFunction;
|
|
10
59
|
//#endregion
|
|
11
|
-
export { cx };
|
|
60
|
+
export { type ClassValue, clsx, cx };
|
package/dist/cx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-C1UYP5We.js";import{t}from"./clsx-DUGZgXfJ.js";export{t as clsx,e as cx};
|
package/dist/data-table.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as Button } from "./button-mfYak6Rx.js";
|
|
2
|
+
import { t as IconButton } from "./icon-button-BPvRuor6.js";
|
|
2
3
|
import { s as SortingMode } from "./direction-CcTY0FmA.js";
|
|
3
4
|
import { t as Table$1 } from "./table-BWD9IlIN.js";
|
|
4
5
|
import { ComponentProps, ReactNode } from "react";
|
|
@@ -200,6 +201,18 @@ declare namespace Head {
|
|
|
200
201
|
}
|
|
201
202
|
type DataTableRowProps<TData> = Omit<ComponentProps<typeof Table$1.Row>, "children"> & {
|
|
202
203
|
row: Row<TData>;
|
|
204
|
+
/**
|
|
205
|
+
* Renders an inline detail panel beneath the row. Called only while the row is
|
|
206
|
+
* expanded (`row.getIsExpanded()`), so the panel — and any expensive work it
|
|
207
|
+
* does — stays lazy. Mantle wraps the returned content in a sibling
|
|
208
|
+
* `DataTable.ExpandedRow` spanning every visible column, so return just the
|
|
209
|
+
* panel content (not a `<tr>`). Requires the table to be configured for
|
|
210
|
+
* expansion (`getExpandedRowModel`, plus `getRowCanExpand` for detail panels);
|
|
211
|
+
* pair it with a `DataTable.RowExpandButton` toggle in a leading column. For
|
|
212
|
+
* full control over the detail row (custom `colSpan`, multiple panels), omit
|
|
213
|
+
* this and render `DataTable.ExpandedRow` yourself.
|
|
214
|
+
*/
|
|
215
|
+
renderExpanded?: (row: Row<TData>) => ReactNode;
|
|
203
216
|
};
|
|
204
217
|
/**
|
|
205
218
|
* A single data table body row rendered from a TanStack Table row instance.
|
|
@@ -210,9 +223,15 @@ type DataTableRowProps<TData> = Omit<ComponentProps<typeof Table$1.Row>, "childr
|
|
|
210
223
|
* `cursor-wait`) to override. For keyboard and screen-reader access, also
|
|
211
224
|
* render a `<Link>` inside the primary cell — a `<tr>` is not focusable.
|
|
212
225
|
*
|
|
226
|
+
* Pass `renderExpanded` to give the row an inline detail panel: when the row is
|
|
227
|
+
* expanded the row renders its data `<tr>` plus a sibling `DataTable.ExpandedRow`
|
|
228
|
+
* holding the returned content. Pair it with a `DataTable.RowExpandButton` toggle
|
|
229
|
+
* and configure the table for expansion (`getExpandedRowModel`, `getRowCanExpand`).
|
|
230
|
+
*
|
|
213
231
|
* @see https://mantle.ngrok.com/components/data-table#datatablerow
|
|
214
232
|
*
|
|
215
233
|
* @example
|
|
234
|
+
* Clickable row navigating to a detail page:
|
|
216
235
|
* ```tsx
|
|
217
236
|
* const navigate = useNavigate();
|
|
218
237
|
*
|
|
@@ -224,9 +243,31 @@ type DataTableRowProps<TData> = Omit<ComponentProps<typeof Table$1.Row>, "childr
|
|
|
224
243
|
* />
|
|
225
244
|
* ))}
|
|
226
245
|
* ```
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* Expandable row with an inline JSON detail panel (lazy — only built when open):
|
|
249
|
+
* ```tsx
|
|
250
|
+
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
251
|
+
*
|
|
252
|
+
* {rows.map((row) => (
|
|
253
|
+
* <DataTable.Row
|
|
254
|
+
* key={row.id}
|
|
255
|
+
* row={row}
|
|
256
|
+
* renderExpanded={(row) => (
|
|
257
|
+
* <CodeBlock.Root>
|
|
258
|
+
* <CodeBlock.Body>
|
|
259
|
+
* <CodeBlock.CopyButton />
|
|
260
|
+
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
261
|
+
* </CodeBlock.Body>
|
|
262
|
+
* </CodeBlock.Root>
|
|
263
|
+
* )}
|
|
264
|
+
* />
|
|
265
|
+
* ))}
|
|
266
|
+
* ```
|
|
227
267
|
*/
|
|
228
268
|
declare function Row$1<TData>({
|
|
229
269
|
className,
|
|
270
|
+
renderExpanded,
|
|
230
271
|
row,
|
|
231
272
|
...props
|
|
232
273
|
}: DataTableRowProps<TData>): import("react").JSX.Element;
|
|
@@ -355,6 +396,194 @@ declare function ActionHeader({
|
|
|
355
396
|
declare namespace ActionHeader {
|
|
356
397
|
var displayName: string;
|
|
357
398
|
}
|
|
399
|
+
/**
|
|
400
|
+
* Compute the stable DOM `id` for a row's expanded detail row. Shared by
|
|
401
|
+
* `DataTable.RowExpandButton` (as its `aria-controls` target) and
|
|
402
|
+
* `DataTable.ExpandedRow` (as its `id`) so the accessibility association is
|
|
403
|
+
* _derived_ from the row — never synchronized state — and stays correct whether
|
|
404
|
+
* or not the detail panel is currently rendered.
|
|
405
|
+
*
|
|
406
|
+
* REQUIRED: configure the table with a stable `getRowId` so `row.id` (and thus
|
|
407
|
+
* this id) is stable across sorting/filtering/pagination. Any `row.id` value is
|
|
408
|
+
* safe — it is URL-encoded into a valid, whitespace-free HTML id token (and thus
|
|
409
|
+
* a valid `aria-controls` IDREF), so display names with spaces, URLs, and emails
|
|
410
|
+
* all work; `getRowId` controls the value.
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* ```tsx
|
|
414
|
+
* <DataTable.RowExpandButton row={row} label={row.original.name} />
|
|
415
|
+
* // ...renders aria-controls={expandedRowId(row)} while expanded, and
|
|
416
|
+
* <DataTable.ExpandedRow row={row}>...</DataTable.ExpandedRow>
|
|
417
|
+
* // ...renders id={expandedRowId(row)} — the same value, so they stay associated.
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
420
|
+
declare function expandedRowId<TData>(row: Row<TData>): string;
|
|
421
|
+
type DataTableExpandHeaderProps = Omit<ComponentProps<typeof Table$1.Header>, "children"> & {
|
|
422
|
+
/**
|
|
423
|
+
* Optional header content — e.g. an "expand all" toggle wired to
|
|
424
|
+
* `table.getToggleAllRowsExpandedHandler()`. Defaults to a screen-reader-only
|
|
425
|
+
* label so the column is announced while staying visually empty.
|
|
426
|
+
*/
|
|
427
|
+
children?: ReactNode;
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* A narrow `<th>` for the leading expand-toggle column, mirroring
|
|
431
|
+
* `DataTable.ActionHeader`. Renders a screen-reader-only label by default so the
|
|
432
|
+
* column is announced to assistive tech while staying visually empty; pass
|
|
433
|
+
* `children` to render an "expand all" control instead.
|
|
434
|
+
*
|
|
435
|
+
* @see https://mantle.ngrok.com/components/data-table#datatableexpandheader
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* ```tsx
|
|
439
|
+
* columnHelper.display({
|
|
440
|
+
* id: "expander",
|
|
441
|
+
* header: () => <DataTable.ExpandHeader />,
|
|
442
|
+
* cell: (props) => (
|
|
443
|
+
* <DataTable.Cell className="w-9 px-0 text-center">
|
|
444
|
+
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
445
|
+
* </DataTable.Cell>
|
|
446
|
+
* ),
|
|
447
|
+
* });
|
|
448
|
+
* ```
|
|
449
|
+
*/
|
|
450
|
+
declare function ExpandHeader({
|
|
451
|
+
children,
|
|
452
|
+
className,
|
|
453
|
+
...props
|
|
454
|
+
}: DataTableExpandHeaderProps): import("react").JSX.Element;
|
|
455
|
+
declare namespace ExpandHeader {
|
|
456
|
+
var displayName: string;
|
|
457
|
+
}
|
|
458
|
+
type DataTableRowExpandButtonProps<TData> = Omit<ComponentProps<typeof IconButton>, "aria-controls" | "aria-expanded" | "icon" | "label"> & {
|
|
459
|
+
/**
|
|
460
|
+
* The TanStack Table row this button toggles. The table must be configured for
|
|
461
|
+
* expansion (`getExpandedRowModel`, plus `getRowCanExpand: () => true` for
|
|
462
|
+
* custom detail panels, which have no sub-rows).
|
|
463
|
+
*/
|
|
464
|
+
row: Row<TData>;
|
|
465
|
+
/**
|
|
466
|
+
* A human-readable name for the row, woven into the accessible label:
|
|
467
|
+
* `Show details for {label}` / `Hide details for {label}`.
|
|
468
|
+
*/
|
|
469
|
+
label: string;
|
|
470
|
+
/**
|
|
471
|
+
* Icon shown while the row is collapsed (activating it expands the row).
|
|
472
|
+
* @default <PlusIcon weight="bold" />
|
|
473
|
+
*/
|
|
474
|
+
expandIcon?: ReactNode;
|
|
475
|
+
/**
|
|
476
|
+
* Icon shown while the row is expanded (activating it collapses the row).
|
|
477
|
+
* @default <MinusIcon weight="bold" />
|
|
478
|
+
*/
|
|
479
|
+
collapseIcon?: ReactNode;
|
|
480
|
+
};
|
|
481
|
+
/**
|
|
482
|
+
* An accessible +/- toggle that expands or collapses a row's detail panel. Drop
|
|
483
|
+
* it inside a `DataTable.Cell` in a leading `columnHelper.display` column and
|
|
484
|
+
* pair it with `DataTable.ExpandedRow`.
|
|
485
|
+
*
|
|
486
|
+
* Renders a real `<button>` (keyboard operable) that sets `aria-expanded` and,
|
|
487
|
+
* while expanded, `aria-controls` pointing at the `DataTable.ExpandedRow`. It
|
|
488
|
+
* stops click propagation so it never triggers a row-level `onClick` (e.g. row
|
|
489
|
+
* navigation), and renders nothing when `row.getCanExpand()` is false so a
|
|
490
|
+
* `getRowCanExpand` predicate cleanly hides it. Forwards `IconButton` props, so
|
|
491
|
+
* pass `onClick` to run side effects before the toggle (call
|
|
492
|
+
* `event.preventDefault()` to veto it).
|
|
493
|
+
*
|
|
494
|
+
* @see https://mantle.ngrok.com/components/data-table#datatablerowexpandbutton
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* ```tsx
|
|
498
|
+
* columnHelper.display({
|
|
499
|
+
* id: "expander",
|
|
500
|
+
* header: () => <DataTable.ExpandHeader />,
|
|
501
|
+
* cell: (props) => (
|
|
502
|
+
* <DataTable.Cell className="w-9 px-0 text-center">
|
|
503
|
+
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
504
|
+
* </DataTable.Cell>
|
|
505
|
+
* ),
|
|
506
|
+
* });
|
|
507
|
+
* ```
|
|
508
|
+
*/
|
|
509
|
+
declare function RowExpandButton<TData>({
|
|
510
|
+
appearance,
|
|
511
|
+
className,
|
|
512
|
+
collapseIcon,
|
|
513
|
+
expandIcon,
|
|
514
|
+
label,
|
|
515
|
+
onClick,
|
|
516
|
+
row,
|
|
517
|
+
size,
|
|
518
|
+
...props
|
|
519
|
+
}: DataTableRowExpandButtonProps<TData>): import("react").JSX.Element | null;
|
|
520
|
+
declare namespace RowExpandButton {
|
|
521
|
+
var displayName: string;
|
|
522
|
+
}
|
|
523
|
+
type DataTableExpandedRowProps<TData> = Omit<ComponentProps<typeof Table$1.Row>, "children"> & {
|
|
524
|
+
/** The row whose detail panel this displays. */row: Row<TData>;
|
|
525
|
+
/**
|
|
526
|
+
* Override the cell's `colSpan`. Defaults to the row's visible-cell count so
|
|
527
|
+
* the panel spans every visible column (visibility- and pinning-aware).
|
|
528
|
+
*/
|
|
529
|
+
colSpan?: number; /** The detail content rendered inside the full-width panel. */
|
|
530
|
+
children: ReactNode;
|
|
531
|
+
};
|
|
532
|
+
/**
|
|
533
|
+
* The sibling `<tr>` that renders a row's expanded detail panel. For the common
|
|
534
|
+
* case, prefer `DataTable.Row`'s `renderExpanded` prop, which renders this for
|
|
535
|
+
* you. Reach for `ExpandedRow` directly when you need full control — a custom
|
|
536
|
+
* `colSpan`, multiple panels, or bespoke markup. Render it directly after the
|
|
537
|
+
* parent `DataTable.Row` — wrapped in a `Fragment`, never a DOM element (a node
|
|
538
|
+
* between `<tbody>` and `<tr>` is invalid HTML) — and only when
|
|
539
|
+
* `row.getIsExpanded()` is true.
|
|
540
|
+
*
|
|
541
|
+
* The single cell spans every visible column (override with `colSpan`), carries
|
|
542
|
+
* the `id` that `DataTable.RowExpandButton` targets via `aria-controls`, and
|
|
543
|
+
* sits on an opaque card surface so horizontally-scrolled content never shows
|
|
544
|
+
* through a sticky action column. Its top divider is suppressed so it reads as
|
|
545
|
+
* one block with its parent row; the panel itself does not change on hover (only
|
|
546
|
+
* the parent data row reacts to hover). Exposes `data-expanded-content` for
|
|
547
|
+
* styling hooks.
|
|
548
|
+
*
|
|
549
|
+
* @see https://mantle.ngrok.com/components/data-table#datatableexpandedrow
|
|
550
|
+
*
|
|
551
|
+
* @example
|
|
552
|
+
* Render the row's underlying object as JSON (a common detail-panel use case).
|
|
553
|
+
* `jsonCodeBlockValue` highlights the JSON entirely on the client — no Shiki
|
|
554
|
+
* runtime, no build-time plugin, no server roundtrip — so it works for runtime
|
|
555
|
+
* data and matches server/build-time highlighting:
|
|
556
|
+
* ```tsx
|
|
557
|
+
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
558
|
+
* import { Fragment } from "react";
|
|
559
|
+
*
|
|
560
|
+
* {table.getRowModel().rows.map((row) => (
|
|
561
|
+
* <Fragment key={row.id}>
|
|
562
|
+
* <DataTable.Row row={row} />
|
|
563
|
+
* {row.getIsExpanded() && (
|
|
564
|
+
* <DataTable.ExpandedRow row={row}>
|
|
565
|
+
* <CodeBlock.Root>
|
|
566
|
+
* <CodeBlock.Body>
|
|
567
|
+
* <CodeBlock.CopyButton />
|
|
568
|
+
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
569
|
+
* </CodeBlock.Body>
|
|
570
|
+
* </CodeBlock.Root>
|
|
571
|
+
* </DataTable.ExpandedRow>
|
|
572
|
+
* )}
|
|
573
|
+
* </Fragment>
|
|
574
|
+
* ))}
|
|
575
|
+
* ```
|
|
576
|
+
*/
|
|
577
|
+
declare function ExpandedRow<TData>({
|
|
578
|
+
children,
|
|
579
|
+
className,
|
|
580
|
+
colSpan,
|
|
581
|
+
row,
|
|
582
|
+
...props
|
|
583
|
+
}: DataTableExpandedRowProps<TData>): import("react").JSX.Element;
|
|
584
|
+
declare namespace ExpandedRow {
|
|
585
|
+
var displayName: string;
|
|
586
|
+
}
|
|
358
587
|
/**
|
|
359
588
|
* Use `DataTable` for INTERACTIVE tabular data — sorting, filtering, pagination,
|
|
360
589
|
* row selection, and server-side or client-side data. Built on TanStack Table;
|
|
@@ -376,13 +605,16 @@ declare namespace ActionHeader {
|
|
|
376
605
|
* DataTable.Root
|
|
377
606
|
* ├── DataTable.Head
|
|
378
607
|
* │ └── DataTable.Row
|
|
608
|
+
* │ ├── DataTable.ExpandHeader
|
|
379
609
|
* │ ├── DataTable.Header
|
|
380
610
|
* │ │ └── DataTable.HeaderSortButton
|
|
381
611
|
* │ └── DataTable.ActionHeader
|
|
382
612
|
* └── DataTable.Body
|
|
383
613
|
* ├── DataTable.Row
|
|
384
614
|
* │ ├── DataTable.Cell
|
|
615
|
+
* │ │ └── DataTable.RowExpandButton
|
|
385
616
|
* │ └── DataTable.ActionCell
|
|
617
|
+
* ├── DataTable.ExpandedRow
|
|
386
618
|
* └── DataTable.EmptyRow
|
|
387
619
|
* ```
|
|
388
620
|
*
|
|
@@ -871,22 +1103,105 @@ declare const DataTable: {
|
|
|
871
1103
|
* Pass a different `cursor-*` class via `className` to override. For keyboard
|
|
872
1104
|
* and screen-reader access, also render a `<Link>` inside the primary cell.
|
|
873
1105
|
*
|
|
1106
|
+
* Pass `renderExpanded` to give the row an inline detail panel — the row then
|
|
1107
|
+
* renders a sibling `DataTable.ExpandedRow` (only while expanded) holding the
|
|
1108
|
+
* returned content. Pair with `DataTable.RowExpandButton`.
|
|
1109
|
+
*
|
|
874
1110
|
* @see https://mantle.ngrok.com/components/data-table#datatablerow
|
|
875
1111
|
*
|
|
876
1112
|
* @example
|
|
877
1113
|
* ```tsx
|
|
878
|
-
*
|
|
1114
|
+
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
879
1115
|
*
|
|
880
1116
|
* {rows.map((row) => (
|
|
881
1117
|
* <DataTable.Row
|
|
882
1118
|
* key={row.id}
|
|
883
1119
|
* row={row}
|
|
884
|
-
*
|
|
1120
|
+
* renderExpanded={(row) => (
|
|
1121
|
+
* <CodeBlock.Root>
|
|
1122
|
+
* <CodeBlock.Body>
|
|
1123
|
+
* <CodeBlock.CopyButton />
|
|
1124
|
+
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
1125
|
+
* </CodeBlock.Body>
|
|
1126
|
+
* </CodeBlock.Root>
|
|
1127
|
+
* )}
|
|
885
1128
|
* />
|
|
886
1129
|
* ))}
|
|
887
1130
|
* ```
|
|
888
1131
|
*/
|
|
889
1132
|
readonly Row: typeof Row$1;
|
|
1133
|
+
/**
|
|
1134
|
+
* A narrow `<th>` for the leading expand-toggle column, mirroring
|
|
1135
|
+
* `DataTable.ActionHeader`. Renders a screen-reader-only label by default so
|
|
1136
|
+
* the column is announced while staying visually empty.
|
|
1137
|
+
*
|
|
1138
|
+
* @see https://mantle.ngrok.com/components/data-table#datatableexpandheader
|
|
1139
|
+
*
|
|
1140
|
+
* @example
|
|
1141
|
+
* ```tsx
|
|
1142
|
+
* columnHelper.display({
|
|
1143
|
+
* id: "expander",
|
|
1144
|
+
* header: () => <DataTable.ExpandHeader />,
|
|
1145
|
+
* cell: (props) => (
|
|
1146
|
+
* <DataTable.Cell className="w-9 px-0 text-center">
|
|
1147
|
+
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
1148
|
+
* </DataTable.Cell>
|
|
1149
|
+
* ),
|
|
1150
|
+
* });
|
|
1151
|
+
* ```
|
|
1152
|
+
*/
|
|
1153
|
+
readonly ExpandHeader: typeof ExpandHeader;
|
|
1154
|
+
/**
|
|
1155
|
+
* An accessible +/- toggle that expands or collapses a row's detail panel.
|
|
1156
|
+
* Place it inside a `DataTable.Cell` in a leading `columnHelper.display`
|
|
1157
|
+
* column and pair it with `DataTable.ExpandedRow`. Sets `aria-expanded` and
|
|
1158
|
+
* (while expanded) `aria-controls`, stops click propagation so it never fires
|
|
1159
|
+
* a row-level `onClick`, and renders nothing when `row.getCanExpand()` is
|
|
1160
|
+
* false.
|
|
1161
|
+
*
|
|
1162
|
+
* @see https://mantle.ngrok.com/components/data-table#datatablerowexpandbutton
|
|
1163
|
+
*
|
|
1164
|
+
* @example
|
|
1165
|
+
* ```tsx
|
|
1166
|
+
* <DataTable.Cell className="w-9 px-0 text-center">
|
|
1167
|
+
* <DataTable.RowExpandButton row={props.row} label={props.row.original.name} />
|
|
1168
|
+
* </DataTable.Cell>
|
|
1169
|
+
* ```
|
|
1170
|
+
*/
|
|
1171
|
+
readonly RowExpandButton: typeof RowExpandButton;
|
|
1172
|
+
/**
|
|
1173
|
+
* The sibling `<tr>` that renders a row's expanded detail panel. Render it
|
|
1174
|
+
* directly after the parent `DataTable.Row` (wrapped in a `Fragment`, never a
|
|
1175
|
+
* DOM element) and only when `row.getIsExpanded()` is true. Spans every
|
|
1176
|
+
* visible column, carries the `id` that `DataTable.RowExpandButton` targets,
|
|
1177
|
+
* and sits on an opaque card surface so it coexists with a sticky action
|
|
1178
|
+
* column.
|
|
1179
|
+
*
|
|
1180
|
+
* @see https://mantle.ngrok.com/components/data-table#datatableexpandedrow
|
|
1181
|
+
*
|
|
1182
|
+
* @example
|
|
1183
|
+
* ```tsx
|
|
1184
|
+
* import { CodeBlock, jsonCodeBlockValue } from "@ngrok/mantle/code-block";
|
|
1185
|
+
* import { Fragment } from "react";
|
|
1186
|
+
*
|
|
1187
|
+
* {table.getRowModel().rows.map((row) => (
|
|
1188
|
+
* <Fragment key={row.id}>
|
|
1189
|
+
* <DataTable.Row row={row} />
|
|
1190
|
+
* {row.getIsExpanded() && (
|
|
1191
|
+
* <DataTable.ExpandedRow row={row}>
|
|
1192
|
+
* <CodeBlock.Root>
|
|
1193
|
+
* <CodeBlock.Body>
|
|
1194
|
+
* <CodeBlock.CopyButton />
|
|
1195
|
+
* <CodeBlock.Code value={jsonCodeBlockValue(row.original)} />
|
|
1196
|
+
* </CodeBlock.Body>
|
|
1197
|
+
* </CodeBlock.Root>
|
|
1198
|
+
* </DataTable.ExpandedRow>
|
|
1199
|
+
* )}
|
|
1200
|
+
* </Fragment>
|
|
1201
|
+
* ))}
|
|
1202
|
+
* ```
|
|
1203
|
+
*/
|
|
1204
|
+
readonly ExpandedRow: typeof ExpandedRow;
|
|
890
1205
|
};
|
|
891
1206
|
//#endregion
|
|
892
|
-
export { DataTable };
|
|
1207
|
+
export { DataTable, expandedRowId };
|
package/dist/data-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-button-CbqMI7q3.js";import{t as n}from"./button-BK8Thu3k.js";import{i as r}from"./direction-Wa9W2F61.js";import{t as i}from"./sort-BPX2Fk9t.js";import{t as a}from"./table-DpEcAEq5.js";import{Fragment as o,createContext as s,forwardRef as c,useContext as l,useMemo as u}from"react";import d from"tiny-invariant";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{flexRender as h}from"@tanstack/react-table";import{MinusIcon as g}from"@phosphor-icons/react/Minus";import{PlusIcon as _}from"@phosphor-icons/react/Plus";export*from"@tanstack/react-table";const v=[`unsorted`,`asc`,`desc`],y=[`unsorted`,`desc`,`asc`];function b(e,t){return x(t===`alphanumeric`?v:y,e)??`unsorted`}function x(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 S=s(null);function C(){let e=l(S);return d(e,`useDataTableContext should only be used within a DataTable child component`),e}function w({children:e,table:t,...n}){let r=u(()=>({table:t}),[t]);return p(S.Provider,{value:r,children:p(a.Root,{"data-slot":`data-table`,...n,children:p(a.Element,{children:e})})})}function T({children:t,className:i,column:a,disableSorting:o=!1,iconPlacement:s=`end`,sortingMode:c,sortIcon:l,onClick:u,...d}){let f=a.getIsSorted(),h=!o&&a.getCanSort(),g=h&&typeof f==`string`?f:`unsorted`,_=l?.(g)??p(V,{mode:c,direction:g});return m(n,{appearance:`ghost`,"data-slot":`data-table-header-sort-button`,className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none text-muted`,i),"data-sort-direction":g,"data-table-header-action":!0,icon:_,iconPlacement:s,onClick:e=>{u?.(e),!e.defaultPrevented&&(!h||o||c===void 0||H(a,c))},priority:`neutral`,type:`button`,...d,children:[h&&g!==`unsorted`&&m(`span`,{className:`sr-only`,children:[`Column sorted in`,` `,c===`alphanumeric`?g===`asc`?`ascending`:`descending`:r(g),` `,`order`]}),t]})}function E({children:t,className:n,...r}){return p(a.Header,{"data-slot":`data-table-header`,className:e(`has-data-table-header-action:px-0`,n),...r,children:t})}const D=c((e,t)=>p(a.Body,{ref:t,"data-slot":`data-table-body`,...e}));D.displayName=`DataTableBody`;function O(e){let{table:t}=C();return p(a.Head,{"data-slot":`data-table-head`,...e,children:t.getHeaderGroups().map(e=>p(a.Row,{children:e.headers.map(e=>p(o,{children:e.isPlaceholder?p(a.Header,{},e.id):h(e.column.columnDef.header,e.getContext())},e.id))},e.id))})}function k({className:t,renderExpanded:n,row:r,...i}){let s=p(a.Row,{"data-slot":`data-table-row`,"data-expanded":r.getIsExpanded()||void 0,className:e(i.onClick&&`cursor-pointer`,t),...i,children:r.getVisibleCells().map(e=>p(o,{children:h(e.column.columnDef.cell,e.getContext())},e.id))});return n==null?s:m(f,{children:[s,r.getIsExpanded()&&p(z,{row:r,children:n(r)})]})}function A({children:e,...t}){let{table:n}=C(),r=n.getAllColumns().length;return p(a.Row,{"data-slot":`data-table-empty-row`,...t,children:p(a.Cell,{colSpan:r,children:e})})}function j(){return 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)]`)})}function M({children:t,className:n,...r}){return m(a.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":`data-table-action-cell`,className:e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,n),...r,children:[p(j,{}),t]})}function N({children:t,className:n,...r}){let{table:i}=C(),o=i.getRowModel().rows.length>0;return m(a.Header,{...o?{"data-mantle-table-sticky-right":!0}:{},"data-slot":`data-table-action-header`,className:e(o&&`sticky z-10 right-0 bg-inherit`,n),...r,children:[o&&p(j,{}),t]})}function P(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function F({children:t,className:n,...r}){return p(a.Header,{"data-slot":`data-table-expand-header`,className:e(`w-9 px-0 text-center`,n),...r,children:t??p(`span`,{className:`sr-only`,children:`Row details`})})}const I=p(_,{weight:`bold`,className:`size-3.5`}),L=p(g,{weight:`bold`,className:`size-3.5`});function R({appearance:n=`ghost`,className:r,collapseIcon:i=L,expandIcon:a=I,label:o,onClick:s,row:c,size:l=`sm`,...u}){if(!c.getCanExpand())return null;let d=c.getIsExpanded(),f=c.getToggleExpandedHandler();return p(t,{type:`button`,"data-slot":`data-table-row-expand-button`,appearance:n,size:l,className:e(`rounded`,r),"aria-expanded":d,"aria-controls":d?P(c):void 0,icon:d?i:a,label:`${d?`Hide`:`Show`} details for ${o}`,onClick:e=>{e.stopPropagation(),s?.(e),!e.defaultPrevented&&f()},...u})}function z({children:t,className:n,colSpan:r,row:i,...o}){return p(a.Row,{"data-slot":`data-table-expanded-row`,"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,n),...o,children:p(a.Cell,{id:P(i),colSpan:r??i.getVisibleCells().length,className:`bg-card font-sans text-body`,children:t})})}w.displayName=`DataTable`,M.displayName=`DataTableActionCell`,N.displayName=`DataTableActionHeader`,D.displayName=`DataTableBody`,A.displayName=`DataTableEmptyRow`,F.displayName=`DataTableExpandHeader`,z.displayName=`DataTableExpandedRow`,O.displayName=`DataTableHead`,E.displayName=`DataTableHeader`,T.displayName=`DataTableHeaderSortButton`,k.displayName=`DataTableRow`,R.displayName=`DataTableRowExpandButton`;const B={Root:w,ActionCell:M,ActionHeader:N,Cell:a.Cell,Body:D,EmptyRow:A,Head:O,Header:E,HeaderSortButton:T,Row:k,ExpandHeader:F,RowExpandButton:R,ExpandedRow:z};function V({direction:e,mode:t,...n}){return e===`unsorted`||!t||!e?p(`svg`,{"aria-hidden":!0,...n}):p(i,{mode:t,direction:e,...n})}function H(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(b(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{B as DataTable,P as expandedRowId};
|
package/dist/description-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-C1UYP5We.js";import{t}from"./slot-DT_E5BQx.js";import{forwardRef as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=n(({asChild:n=!1,className:i,children:a,...o},s)=>r(n?t:`dl`,{ref:s,"data-slot":`description-list`,className:e(`relative scrollbar overflow-x-auto overscroll-x-none rounded-lg border border-card grid grid-cols-[auto_1fr] gap-x-4 [&>*:nth-child(odd)]:bg-neutral-500/5 p-1`,i),...o,children:a}));i.displayName=`DescriptionList`;const a=n(({asChild:n=!1,className:i,children:a,...o},s)=>r(n?t:`div`,{ref:s,"data-slot":`description-list-item`,className:e(`rounded-sm col-span-full grid grid-cols-subgrid items-center`,i),...o,children:a}));a.displayName=`DescriptionListItem`;const o=n(({asChild:n=!1,className:i,children:a,...o},s)=>r(n?t:`dt`,{ref:s,"data-slot":`description-list-label`,className:e(`text-muted text-sm font-sans font-medium min-w-36 p-2`,i),...o,children:a}));o.displayName=`DescriptionListLabel`;const s=n(({asChild:n=!1,className:i,children:a,...o},s)=>r(n?t:`dd`,{ref:s,"data-slot":`description-list-value`,className:e(`text-body font-mono text-mono py-2 px-3`,i),...o,children:a}));s.displayName=`DescriptionListValue`;const c={Root:i,Item:a,Label:o,Value:s};export{c as DescriptionList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-button-CbqMI7q3.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./primitive-BEuiJONo.js";import{forwardRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{XIcon as p}from"@phosphor-icons/react/X";const m=o;m.displayName=`Dialog`;const h=u((e,t)=>d(r,{ref:t,"data-slot":`dialog-trigger`,...e}));h.displayName=`DialogTrigger`;const g=n;g.displayName=`DialogPortal`;const _=u((e,t)=>d(l,{ref:t,"data-slot":`dialog-close`,...e}));_.displayName=`DialogClose`;const v=u(({className:t,...n},r)=>d(i,{ref:r,"data-slot":`dialog-overlay`,className: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-50 backdrop-blur-xs`,t),...n}));v.displayName=`DialogOverlay`;const y=u(({children:t,className:n,preferredWidth:r=`max-w-lg`,...i},o)=>f(g,{children:[d(v,{}),d(`div`,{className:`fixed inset-4 z-50 flex items-center justify-center`,children:d(a,{"data-mantle-modal-content":!0,"data-slot":`dialog-content`,className:e(`flex max-h-full w-full flex-1 flex-col`,`outline-hidden focus-within:outline-hidden`,`border-dialog bg-dialog rounded-xl border 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`,r,n),ref:o,...i,children:t})})]}));y.displayName=`DialogContent`;const b=({className:t,children:n,...r})=>d(`div`,{"data-slot":`dialog-header`,className:e(`border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4`,`has-[.icon-button]:pr-4`,t),...r,children:n});b.displayName=`DialogHeader`;const x=({size:e=`md`,type:n=`button`,label:r=`Close Dialog`,appearance:i=`ghost`,...a})=>d(l,{asChild:!0,children:d(t,{appearance:i,"data-slot":`dialog-close-icon-button`,icon:d(p,{}),label:r,size:e,type:n,...a})});x.displayName=`DialogCloseIconButton`;const S=({className:t,...n})=>d(`div`,{"data-slot":`dialog-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n});S.displayName=`DialogBody`;const C=({className:t,...n})=>d(`div`,{"data-slot":`dialog-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-4`,t),...n});C.displayName=`DialogFooter`;const w=u(({className:t,...n},r)=>d(c,{ref:r,"data-slot":`dialog-title`,className:e(`text-strong truncate text-lg font-medium`,t),...n}));w.displayName=`DialogTitle`;const T=u(({className:t,...n},r)=>d(s,{ref:r,"data-slot":`dialog-description`,className:e(`text-muted`,t),...n}));T.displayName=`DialogDescription`;const E={Root:m,Body:S,Close:_,CloseIconButton:x,Content:y,Description:T,Footer:C,Header:b,Overlay:v,Portal:g,Title:w,Trigger:h};export{E as t};
|
package/dist/dialog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as isDialogOverlayTarget, t as Root } from "./primitive-FoWela9a.js";
|
|
2
|
-
import { n as IconButtonProps } from "./icon-button-
|
|
2
|
+
import { n as IconButtonProps } from "./icon-button-BPvRuor6.js";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/dialog/dialog.d.ts
|
package/dist/dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./primitive-
|
|
1
|
+
import{l as e}from"./primitive-BEuiJONo.js";import{t}from"./dialog-2tNq-mRR.js";export{t as Dialog,e as isDialogOverlayTarget};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{n}from"./separator-DtufgIHt.js";import{forwardRef as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{CaretRightIcon as o}from"@phosphor-icons/react/CaretRight";import{CheckIcon as s}from"@phosphor-icons/react/Check";import*as c from"@radix-ui/react-dropdown-menu";const l=c.Root;l.displayName=`DropdownMenu`;const u=r((e,t)=>i(c.Trigger,{ref:t,"data-slot":`dropdown-menu-trigger`,...e}));u.displayName=`DropdownMenuTrigger`;const d=r(({className:t,...n},r)=>i(c.Group,{ref:r,"data-slot":`dropdown-menu-group`,className:e(`space-y-px`,t),...n}));d.displayName=`DropdownMenuGroup`;const f=c.Portal;f.displayName=`DropdownMenuPortal`;const p=c.Sub;p.displayName=`DropdownMenuSub`;const m=r(({className:t,...n},r)=>i(c.RadioGroup,{ref:r,"data-slot":`dropdown-menu-radio-group`,className:e(`space-y-px`,t),...n}));m.displayName=`DropdownMenuRadioGroup`;const h=r(({className:n,inset:r,children:s,...l},u)=>a(c.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:e(`focus:bg-accent data-state-open:bg-accent relative flex select-none items-center rounded-md py-1.5 pl-2 pr-9 text-sm outline-hidden`,`data-highlighted:bg-active-menu-item data-state-open:bg-active-menu-item`,`[&>svg]:size-5 [&_svg]:shrink-0`,r&&`pl-8`,n),ref:u,...l,children:[s,i(`span`,{className:`absolute right-2 flex items-center`,children:i(t,{svg:i(o,{weight:`bold`}),className:`size-4`})})]}));h.displayName=`DropdownMenuSubTrigger`;const g=r(({className:t,loop:n=!0,...r},a)=>i(f,{children:i(c.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 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 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl space-y-px font-sans`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,t),loop:n,ref:a,...r})}));g.displayName=`DropdownMenuSubContent`;const _=r(({className:t,onClick:n,loop:r=!0,width:a,...o},s)=>i(f,{children:i(c.Content,{ref:s,"data-slot":`dropdown-menu-content`,className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl outline-hidden space-y-px font-sans`,`data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 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`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,a===`trigger`&&`w-(--radix-dropdown-menu-trigger-width)`,t),loop:r,onClick:e=>{e.stopPropagation(),n?.(e)},...o})}));_.displayName=`DropdownMenuContent`;const v=r(({className:t,inset:n,...r},a)=>i(c.Item,{ref:a,"data-slot":`dropdown-menu-item`,className:e(`relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 text-strong text-sm font-normal outline-hidden transition-colors`,`data-highlighted:bg-active-menu-item`,`focus:bg-accent focus:text-accent-foreground`,`data-disabled:cursor-default data-disabled:opacity-50`,`[&>svg]:size-5 [&_svg]:shrink-0`,n&&`pl-8`,t),...r}));v.displayName=`DropdownMenuItem`;const y=r(({className:n,children:r,checked:o,...l},u)=>a(c.CheckboxItem,{ref:u,"data-slot":`dropdown-menu-checkbox-item`,className:e(`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-9 text-sm font-normal outline-hidden`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),checked:o,...l,children:[i(`span`,{className:`absolute right-2 flex items-center`,children:i(c.ItemIndicator,{children:i(t,{svg:i(s,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}));y.displayName=`DropdownMenuCheckboxItem`;const b=r(({className:n,children:r,...o},l)=>a(c.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e(`group/dropdown-menu-radio-item`,`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 px-2 text-sm font-normal outline-none`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item aria-checked:pr-9`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),ref:l,...o,children:[i(`span`,{className:`absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex`,children:i(c.ItemIndicator,{children:i(t,{svg:i(s,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}));b.displayName=`DropdownMenuRadioItem`;const x=r(({className:t,inset:n,...r},a)=>i(c.Label,{ref:a,"data-slot":`dropdown-menu-label`,className:e(`px-2 py-1.5 text-sm font-medium`,n&&`pl-8`,t),...r}));x.displayName=`DropdownMenuLabel`;const S=r(({className:t,...r},a)=>i(n,{ref:a,"data-slot":`dropdown-menu-separator`,className:e(`-mx-1.25 my-1 w-auto`,t),...r}));S.displayName=`DropdownMenuSeparator`;const C=({className:t,...n})=>i(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-xs tracking-widest opacity-60`,t),...n});C.displayName=`DropdownMenuShortcut`;const w={Root:l,CheckboxItem:y,Content:_,Group:d,Item:v,Label:x,RadioGroup:m,RadioItem:b,Separator:S,Shortcut:C,Sub:p,SubContent:g,SubTrigger:h,Trigger:u};export{w as t};
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./dropdown-menu-
|
|
1
|
+
import{t as e}from"./dropdown-menu-Dj8qPMRh.js";export{e as DropdownMenu};
|
package/dist/empty.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-C1UYP5We.js";import{t}from"./svg-only-CSOaF1tL.js";import{t as n}from"./slot-DT_E5BQx.js";import{jsx as r}from"react/jsx-runtime";const i=({asChild:t,children:i,className:a,...o})=>r(t?n:`div`,{"data-slot":`empty`,className:e(`mx-auto flex max-w-lg flex-col items-center p-6 text-center`,a),...o,children:i});i.displayName=`Empty`;const a=({className:n,svg:i,...a})=>r(t,{"data-slot":`empty-icon`,className:e(`mb-1 size-10 text-neutral-400`,n),svg:i,...a});a.displayName=`EmptyIcon`;const o=({asChild:t,children:i,className:a,...o})=>r(t?n:`h3`,{"data-slot":`empty-title`,className:e(`text-strong text-sm font-medium font-sans`,a),...o,children:i});o.displayName=`EmptyTitle`;const s=({asChild:t,children:i,className:a,...o})=>r(t?n:`div`,{"data-slot":`empty-description`,className:e(`text-muted space-y-4 text-sm font-sans`,a),...o,children:i});s.displayName=`EmptyDescription`;const c=({asChild:t,children:i,className:a,...o})=>r(t?n:`div`,{"data-slot":`empty-actions`,className:e(`mt-4 flex items-center gap-2`,a),...o,children:i});c.displayName=`EmptyActions`;const l={Root:i,Icon:a,Title:o,Description:s,Actions:c};export{l as Empty};
|
package/dist/field.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as WithAsChild } from "./as-child-uN_018tj.js";
|
|
2
|
-
import { n as IconButtonProps } from "./icon-button-
|
|
2
|
+
import { n as IconButtonProps } from "./icon-button-BPvRuor6.js";
|
|
3
3
|
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 "./validation-xyX_6kph.js";
|
|
4
4
|
import { t as Slot } from "./index-CJbKEKr2.js";
|
|
5
5
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
package/dist/field.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-C1UYP5We.js";import{t}from"./slot-DT_E5BQx.js";import{t as n}from"./icon-button-CbqMI7q3.js";import{i as r,n as i,r as a,t as o}from"./validation-DCyx-ceH.js";import{t as s}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t as c}from"./label-BLXfnQmn.js";import{t as l}from"./popover-Bq52EC7X.js";import{n as u,r as d,t as f}from"./field-context-4k1kI7Bo.js";import{Children as p,Fragment as m,cloneElement as h,forwardRef as g,isValidElement as _,useCallback as v,useContext as y,useId as b,useMemo as x,useState as S}from"react";import C from"tiny-invariant";import{jsx as w}from"react/jsx-runtime";import{QuestionIcon as T}from"@phosphor-icons/react/Question";const E=e=>{let t=[],n=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},D=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),O=({children:e,errorItemType:t})=>{let n=!1;return p.forEach(e,e=>{if(!(n||e==null||typeof e==`boolean`)){if(typeof e==`string`){e.trim().length>0&&(n=!0);return}if(!_(e)){n=!0;return}if(e.type===t){n=D(e.props.children);return}if(e.type===m){n=O({children:e.props.children,errorItemType:t});return}n=!0}}),n},k=g(({className:t,...n},r)=>w(`fieldset`,{ref:r,"data-slot":`field-set`,className:e(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,t),...n}));k.displayName=`FieldSet`;const A=g(({className:t,...n},r)=>w(`legend`,{ref:r,"data-slot":`field-legend`,className:e(`text-strong mb-1.5 text-sm font-medium font-sans`,t),...n}));A.displayName=`FieldLegend`;const j=g(({htmlFor:e,...t},n)=>{let r=y(u);return w(c,{ref:n,htmlFor:e??r?.controlId,...t})});j.displayName=`FieldLabel`;const M=g(({asChild:n,className:r,...i},a)=>w(n?t:`p`,{ref:a,"data-slot":`field-label-text`,className:e(`text-strong text-sm font-medium font-sans`,r),...i}));M.displayName=`FieldLabelText`;const N=g(({asChild:n,className:r,...i},a)=>w(n?t:`div`,{ref:a,"data-slot":`field-label-row`,className:e(`flex items-center gap-1`,r),...i}));N.displayName=`FieldLabelRow`;const P=l.Root,F=w(T,{}),I=g(({appearance:t=`ghost`,className:r,icon:i=F,label:a,size:o=`xs`,type:s=`button`,...c},u)=>w(l.Trigger,{asChild:!0,children:w(n,{ref:u,appearance:t,className:e(`text-body -my-0.5`,r),icon:i,label:a,size:o,type:s,...c})}));I.displayName=`FieldHelpTrigger`;const L=g((e,t)=>w(l.Content,{ref:t,"data-slot":`field-help-content`,...e}));L.displayName=`FieldHelpContent`;const R=g(({asChild:n,children:r,className:i,...a},o)=>w(n?t:`span`,{ref:o,"data-slot":`field-optional`,className:e(`text-muted text-sm font-normal font-sans`,i),...a,children:r??`(Optional)`}));R.displayName=`FieldOptional`;const z=g(({asChild:n,className:r,...i},a)=>w(n?t:`div`,{ref:a,"data-slot":`field-group`,className:e(`flex w-full flex-col gap-4`,r),...i}));z.displayName=`FieldGroup`;const B=g(({asChild:n,children:i,className:a,name:s,validation:c,...l},d)=>{let f=n?t:`div`,p=b(),m=b(),h=b(),[g,_]=S(!1),y=r(c??(g?`error`:void 0)),C=v(()=>(_(!0),()=>{_(!1)}),[]),T=x(()=>({controlId:p,descriptionId:m,errorId:h,hasErrors:g,name:s,registerError:C,validation:y}),[p,m,h,g,s,C,y]);return w(u.Provider,{value:T,children:w(o,{validation:y,children:w(f,{ref:d,"data-slot":`field-item`,"data-validation":y,className:e(`flex w-full flex-col gap-1.5`,a),...l,children:i})})})});B.displayName=`FieldItem`;const V=g(({children:e,...n},r)=>{let i=y(u),a=d({context:i});return typeof e==`function`?w(o,{validation:a.validation,children:w(f.Provider,{value:i?a.ariaProps:null,children:e(a.ariaProps)})}):(C(_(e),`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>.`),w(o,{validation:a.validation,children:w(f.Provider,{value:i?a.ariaProps:null,children:w(t,{ref:r,...n,children:h(e,a.ariaProps)})})}))});V.displayName=`FieldControl`;const H=g(({asChild:n,className:r,...i},a)=>w(n?t:`p`,{ref:a,"data-slot":`field-description`,id:y(u)?.descriptionId,className:e(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,r),...i}));H.displayName=`FieldDescription`;const U=g(({children:t,className:n,...r},i)=>D(t)?w(`li`,{ref:i,"data-slot":`field-error`,className:e(`text-danger-600 text-sm leading-4`,n),...r,children:t}):null);U.displayName=`FieldErrorItem`;const W=g(({messages:e,...t},n)=>w(G,{ref:n,...t,children:E(e).map(e=>w(U,{children:e},e))}));W.displayName=`FieldErrors`;const G=g(({asChild:n,children:r,className:i,...a},o)=>{let c=O({children:r,errorItemType:U}),l=y(u),d=l?.registerError;return s(()=>{if(!(!c||d==null))return d()},[c,d]),c?w(n?t:`ul`,{ref:o,"data-slot":`field-error-list`,id:l?.errorId,role:`list`,className:e(`m-0 flex w-full flex-col list-none p-0`,i),...a,children:r}):null});G.displayName=`FieldErrorList`;const K={Item:B,Control:V,Group:z,Set:k,Legend:A,Label:j,LabelText:M,LabelRow:N,Help:P,HelpTrigger:I,HelpContent:L,Optional:R,Description:H,Errors:W,ErrorList:G,ErrorItem:U},q=e=>E(e?.map(e=>typeof e==`string`||!e?e:e.message));export{K as Field,i as isAriaInvalid,a as parseValidation,r as resolveValidation,q as toErrorMessages};
|
package/dist/flag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-C1UYP5We.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(``,{variants:{size:{s:`rounded-[0.0625rem]`,m:`rounded-[0.09375rem]`,l:`rounded-xs`}}}),a=r(``,{variants:{size:{s:`w-4 h-3`,m:`w-5 h-3.75`,l:`w-8 h-6`}}});function o({className:r,code:o,size:s=`l`,loading:c=`lazy`,...l}){let u=i({size:s});return n(`div`,{"data-slot":`flag`,className:e(`flag relative overflow-hidden`,u,a({size:s}),r),...l,children:[t(`div`,{"aria-hidden":!0,className:e(`absolute inset-0 border border-[#000]/10`,u)}),t(`img`,{className:`h-full w-full block object-cover`,src:`https://assets.ngrok.com/flags/${s}/${o}.svg`,alt:`flag for ${o}`,loading:c})]})}o.displayName=`Flag`;const s=`004.008.010.016.016.020.024.028.031.032.040.044.048.050.051.052.056.060.064.068.070.072.074.076.084.086.090.092.096.100.104.108.112.116.120.124.132.136.140.144.148.152.156.158.162.166.170.174.178.180.184.188.191.192.196.203.204.208.212.214.218.222.226.231.232.233.234.238.239.242.246.248.250.254.258.260.262.266.268.270.275.276.288.292.296.300.304.308.312.316.320.324.328.332.334.336.340.344.348.352.356.360.364.368.372.376.380.384.388.392.398.400.404.408.410.414.417.418.422.426.428.430.434.438.440.442.446.450.454.458.462.466.470.474.478.480.484.492.496.498.499.500.504.508.512.516.520.524.528.531.533.534.540.548.554.558.562.566.570.574.578.580.581.583.584.585.586.591.598.600.604.608.612.616.620.624.626.630.634.638.642.643.646.652.654.659.660.662.663.666.670.674.678.682.686.688.690.694.702.703.704.705.706.710.716.724.728.729.732.740.744.748.752.756.760.762.764.768.772.776.780.784.788.792.795.796.798.800.804.807.818.831.832.833.834.836.840.850.854.858.860.862.876.882.887.894.ABW.AD.AE.AF.AFG.AFRUN.AG.AGO.AI.AIA.AL.ALA.ALB.AM.AMS.AND.AO.AQ.AR.ARE.ARG.ARM.AS.ASM.AT.ATA.ATF.ATG.AU.AUS.AUT.AW.AX.AZ.AZE.BA.BB.BD.BDI.BE.BEL.BEN.BF.BFA.BG.BGD.BGR.BH.BHR.BHS.BI.BIH.BJ.BL.BLM.BLR.BLZ.BM.BMU.BN.BO.BOL.BQ-BO.BQ-SA.BQ-SE.BR.BRA.BRB.BRN.BS.BT.BTN.BV.BVT.BW.BWA.BY.BZ.CA.CAF.CAN.CC.CCK.CD.CF.CG.CH.CHE.CHL.CHN.CI.CIV.CK.CL.CM.CMR.CN.CO.COD.COG.COK.COL.COM.CPV.CR.CRI.CU.CUB.CUW.CV.CW.CX.CXR.CY.CYM.CYP.CZ.CZE.DE.DEU.DJ.DJI.DK.DM.DMA.DNK.DO.DOM.EC.ECU.EE.EG.EGY.EH.ER.ERI.ES.ESH.ESP.EST.ET.ETH.EU.FI.FIN.FJ.FJI.FK.FLK.FM.FO.FR.FRA.FRO.FSM.GA.GAB.GB-ENG.GB-NIR.GB-SCT.GB-UKM.GB-WLS.GB.GBR.GD.GE.GEO.GF.GG.GGY.GH.GHA.GI.GIB.GIN.GL.GLP.GM.GMB.GN.GNB.GNQ.GP.GQ.GR.GRC.GRD.GRL.GS.GT.GTM.GU.GUF.GUM.GUY.GW.GY.HK.HKG.HM.HMD.HN.HND.HR.HRV.HT.HTI.HU.HUN.ID.IDN.IE.IL.IM.IMN.IN.IND.IO.IOT.IQ.IR.IRL.IRN.IRQ.IS.ISL.ISR.IT.ITA.JAM.JE.JEY.JM.JO.JOR.JP.JPN.KAZ.KE.KEN.KG.KGZ.KH.KHM.KI.KIR.KM.KN-SK.KNA.KOR.KP.KR.KW.KWT.KY.KZ.LA.LAO.LB.LBN.LBR.LBY.LC.LCA.LI.LIE.LK.LKA.LR.LS.LSO.LT.LTU.LU.LUX.LV.LVA.LY.MA.MAC.MAF.MAR.MC.MCO.MD.MDA.MDG.MDV.ME.MEX.MF.MG.MH.MHL.MK.MKD.ML.MLI.MLT.MM.MMR.MN.MNE.MNG.MNP.MO.MOZ.MP.MQ.MR.MRT.MS.MSR.MT.MTQ.MU.MUS.MV.MW.MWI.MX.MY.MYS.MZ.NA.NAM.NC.NCL.NE.NER.NF.NFK.NG.NGA.NI.NIC.NIU.NL.NLD.NO.NOR.NP.NPL.NR.NRU.NU.NZ.NZL.OM.OMN.PA.PAK.PAN.PCN.PE.PER.PF.PG.PH.PHL.PK.PL.PLW.PM.PN.PNG.POL.PR.PRI.PRK.PRT.PRY.PS.PSE.PT.PW.PY.PYF.QA.QAT.RAINBOW.RE.REU.RO.ROU.RS.RU.RUS.RW.RWA.SA.SAU.SB.SC.SD.SDN.SE.SEN.SG.SGP.SGS.SH.SHN.SI.SJ.SJM.SK.SL.SLB.SLE.SLV.SM.SMR.SN.SO.SOM.SPM.SR.SRB.SS.SSD.ST.STP.SUR.SV.SVK.SVN.SWE.SWZ.SX.SXM.SY.SYC.SYR.SZ.TC.TCA.TCD.TD.TF.TG.TGO.TH.THA.TJ.TJK.TK.TKL.TKM.TL.TLS.TM.TN.TO.TON.TR.TT.TTO.TUN.TUR.TUV.TV.TW.TWN.TZ.TZA.UA.UG.UGA.UKR.UM.UMI.UNASUR.URY.US.USA.UY.UZ.UZB.VA.VAT.VC.VCT.VE.VEN.VG.VGB.VI.VIR.VN.VNM.VU.VUT.WF.WLF.WS.WSM.YE.YEM.ZA.ZAF.ZM.ZMB.ZW.ZWE`.split(`.`);function c(e){return s.includes(e)}export{o as Flag,s as countryCodes,c as isCountryCode};
|
package/dist/hover-card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-C1UYP5We.js";import{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";import*as r from"@radix-ui/react-hover-card";const i=({closeDelay:e=300,openDelay:t=100,...i})=>n(r.Root,{closeDelay:e,openDelay:t,...i});i.displayName=`HoverCard`;const a=t((e,t)=>n(r.Trigger,{ref:t,"data-slot":`hover-card-trigger`,...e}));a.displayName=`HoverCardTrigger`;const o=r.Portal;o.displayName=`HoverCardPortal`;const s=t(({className:t,onClick:i,align:a=`center`,sideOffset:s=4,...c},l)=>n(o,{children:n(r.Content,{ref:l,"data-slot":`hover-card-content`,align:a,sideOffset:s,className:e(`bg-popover border-popover z-50 w-64 rounded-md border p-4 shadow-md outline-hidden`,`data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 data-state-closed:zoom-out-95 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2`,t),onClick:e=>{e.stopPropagation(),i?.(e)},...c})}));s.displayName=r.Content.displayName;const c={Root:i,Content:s,Portal:o,Trigger:a};export{c as HoverCard};
|