@graphty/compact-mantine 0.9.3 → 0.9.4
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 +32 -25
- package/dist/index.cjs +274 -149
- package/dist/index.d.cts +164 -6
- package/dist/index.d.ts +164 -6
- package/dist/index.js +4488 -4142
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1083,6 +1083,14 @@ export declare interface CompactMantineLabels {
|
|
|
1083
1083
|
* @returns The announcement, such as "3 selected"
|
|
1084
1084
|
*/
|
|
1085
1085
|
rowsSelected: (count: string) => string;
|
|
1086
|
+
/**
|
|
1087
|
+
* Accessible name of the caret that opens a data table column's menu. Optional, so a full
|
|
1088
|
+
* set of labels written before it existed still type-checks; left out, the English default
|
|
1089
|
+
* is used.
|
|
1090
|
+
* @param header - The column's header text
|
|
1091
|
+
* @returns The name, such as "Options for Degree"
|
|
1092
|
+
*/
|
|
1093
|
+
columnMenu?: (header: string) => string;
|
|
1086
1094
|
/**
|
|
1087
1095
|
* How a cell holding true is written, when its column supplies no drawing
|
|
1088
1096
|
* of its own.
|
|
@@ -1673,6 +1681,7 @@ export declare interface ControlGroupProps {
|
|
|
1673
1681
|
* @param props.onAdd - Sets the section up, from the "+" an empty section carries
|
|
1674
1682
|
* @param props.info - An explanation, put behind a circled "i" and used as the section's accessible description
|
|
1675
1683
|
* @param props.actions - The section's own buttons, drawn at the end of the header
|
|
1684
|
+
* @param props.summary - One line saying what the section holds, shown after the name while it is collapsed
|
|
1676
1685
|
* @param props.children - The rows the section holds
|
|
1677
1686
|
* @param props.collapsible - Whether the section folds away behind a chevron, defaulting to true
|
|
1678
1687
|
* @returns The section, its header and its rows
|
|
@@ -1691,6 +1700,13 @@ export declare interface ControlGroupProps {
|
|
|
1691
1700
|
* </ControlSection>
|
|
1692
1701
|
* ```
|
|
1693
1702
|
* @example
|
|
1703
|
+
* A section that says what it holds while it is closed.
|
|
1704
|
+
* ```tsx
|
|
1705
|
+
* <ControlSection label="Sources" defaultOpened={false} summary={`${name} . ${nodeCount} nodes`}>
|
|
1706
|
+
* <SourceRows />
|
|
1707
|
+
* </ControlSection>
|
|
1708
|
+
* ```
|
|
1709
|
+
* @example
|
|
1694
1710
|
* A section for a subject that has not been set up yet.
|
|
1695
1711
|
* ```tsx
|
|
1696
1712
|
* <ControlSection label="Edge properties" empty onAdd={() => { addEdgeProperties(); }} />
|
|
@@ -1765,6 +1781,16 @@ export declare interface ControlSectionProps extends DisclosureProps {
|
|
|
1765
1781
|
* never as a replacement for them.
|
|
1766
1782
|
*/
|
|
1767
1783
|
actions?: default_2.ReactNode;
|
|
1784
|
+
/**
|
|
1785
|
+
* What the section holds, in one short line, shown only while the section is collapsed:
|
|
1786
|
+
* `"les miserables . 77 nodes"`, `"12 attributes"`.
|
|
1787
|
+
*
|
|
1788
|
+
* It is drawn after the name in the secondary ink, cut with an ellipsis before the name is,
|
|
1789
|
+
* and it becomes the expand button's accessible description, so a reader moving through
|
|
1790
|
+
* closed sections hears what each holds without opening it. An open section shows its rows
|
|
1791
|
+
* instead, so the summary is hidden there. Keep it to text.
|
|
1792
|
+
*/
|
|
1793
|
+
summary?: default_2.ReactNode;
|
|
1768
1794
|
/** The rows the section holds: the controls commonly adjusted for its subject. */
|
|
1769
1795
|
children?: default_2.ReactNode;
|
|
1770
1796
|
/**
|
|
@@ -2221,6 +2247,28 @@ export declare interface DataTableColumn<TRow extends object> {
|
|
|
2221
2247
|
filterable?: boolean;
|
|
2222
2248
|
/** Whether this column may be hidden. Defaults to `true`. */
|
|
2223
2249
|
hideable?: boolean;
|
|
2250
|
+
/**
|
|
2251
|
+
* Keeps the column at the start of the table while the other columns scroll sideways: the
|
|
2252
|
+
* key column, such as a node's id or an edge's From and To. Pinned columns are drawn first,
|
|
2253
|
+
* in their own order, whatever `columnOrder` says.
|
|
2254
|
+
*/
|
|
2255
|
+
pinned?: "start";
|
|
2256
|
+
/**
|
|
2257
|
+
* A small glyph drawn before the header's name, such as the column's data type. It is
|
|
2258
|
+
* decoration: the header is still named by `header` alone.
|
|
2259
|
+
*/
|
|
2260
|
+
icon?: default_2.ReactNode;
|
|
2261
|
+
/**
|
|
2262
|
+
* A tooltip on the header, shown on hover and on keyboard focus and linked to the header
|
|
2263
|
+
* as its description: the column's profile, such as "77 values, 1 to 36".
|
|
2264
|
+
*/
|
|
2265
|
+
headerTooltip?: default_2.ReactNode;
|
|
2266
|
+
/**
|
|
2267
|
+
* The column's menu: the `Menu.Item`s (and `Menu.Divider`s) of a Mantine `Menu`. The table
|
|
2268
|
+
* draws a caret at the end of the header, shown on hover and focus, that opens them; from
|
|
2269
|
+
* the keyboard, Alt+ArrowDown, Shift+F10 or the context-menu key on the header opens it.
|
|
2270
|
+
*/
|
|
2271
|
+
menu?: default_2.ReactNode;
|
|
2224
2272
|
}
|
|
2225
2273
|
|
|
2226
2274
|
/**
|
|
@@ -2273,7 +2321,7 @@ export declare interface DataTableHandle {
|
|
|
2273
2321
|
* functions, so a translation can order the pieces the way its own language
|
|
2274
2322
|
* needs, and numbers arrive already formatted for the active locale.
|
|
2275
2323
|
*/
|
|
2276
|
-
export declare type DataTableLabels = Pick<CompactMantineLabels, "clearSearch" | "dataTable" | "no" | "noMatchingRows" | "noRows" | "rowsSelected" | "rowsShown" | "search" | "searchPlaceholder" | "yes">;
|
|
2324
|
+
export declare type DataTableLabels = Pick<CompactMantineLabels, "clearSearch" | "columnMenu" | "dataTable" | "no" | "noMatchingRows" | "noRows" | "rowsSelected" | "rowsShown" | "search" | "searchPlaceholder" | "yes">;
|
|
2277
2325
|
|
|
2278
2326
|
/**
|
|
2279
2327
|
* Props for the DataTable component.
|
|
@@ -2554,7 +2602,7 @@ export declare const DEFAULT_GRADIENT_STOP_COLOR = "#888888";
|
|
|
2554
2602
|
* build a full set of your own, or pass only the entries you want to change to
|
|
2555
2603
|
* `LabelsProvider`.
|
|
2556
2604
|
*/
|
|
2557
|
-
export declare const defaultLabels: CompactMantineLabels
|
|
2605
|
+
export declare const defaultLabels: Required<CompactMantineLabels>;
|
|
2558
2606
|
|
|
2559
2607
|
/**
|
|
2560
2608
|
* Which way text runs: left to right, or right to left.
|
|
@@ -3534,7 +3582,9 @@ export declare type OpenChangeHandler = (opened: boolean, event?: default_2.Synt
|
|
|
3534
3582
|
/**
|
|
3535
3583
|
* A page list (design/figma-spec.md 10.2): Figma's own accessible model, a one-column grid with
|
|
3536
3584
|
* one Tab stop. ArrowUp / ArrowDown / Home / End move focus without switching; Enter, Space or a
|
|
3537
|
-
* click switches; F2 or a double-click renames when `onRename` is given.
|
|
3585
|
+
* click switches; F2 or a double-click renames when `onRename` is given. A row can carry a second
|
|
3586
|
+
* line, a trailing value and a row menu (see PageListItem); ArrowRight moves into the menu. The
|
|
3587
|
+
* menu's controls are taken out of the Tab order, so the list stays one Tab stop.
|
|
3538
3588
|
* @param props - Component props
|
|
3539
3589
|
* @param props.items - The items or pages
|
|
3540
3590
|
* @param props.current - The current page (controlled)
|
|
@@ -3545,6 +3595,22 @@ export declare type OpenChangeHandler = (opened: boolean, event?: default_2.Synt
|
|
|
3545
3595
|
* @param props.onRename - Called with a new name; turns renaming on
|
|
3546
3596
|
* @param props.renameLabel - The rename field's accessible name
|
|
3547
3597
|
* @returns The list
|
|
3598
|
+
* @example
|
|
3599
|
+
* A recent-files list: a size, a time, an error line and a row menu.
|
|
3600
|
+
* ```tsx
|
|
3601
|
+
* <PageList
|
|
3602
|
+
* label="Recent projects"
|
|
3603
|
+
* items={recent.map((file) => ({
|
|
3604
|
+
* id: file.id,
|
|
3605
|
+
* name: file.name,
|
|
3606
|
+
* value: `${file.nodes} nodes`,
|
|
3607
|
+
* description: file.missing ? "This file can no longer be read" : file.savedAt,
|
|
3608
|
+
* descriptionTone: file.missing ? "danger" : "default",
|
|
3609
|
+
* menu: <RecentMenu file={file} />,
|
|
3610
|
+
* }))}
|
|
3611
|
+
* onCurrentChange={(id) => open(id)}
|
|
3612
|
+
* />
|
|
3613
|
+
* ```
|
|
3548
3614
|
*/
|
|
3549
3615
|
export declare function PageList({ items, current, defaultCurrent, onCurrentChange, tone, label, onRename, renameLabel, }: PageListProps): default_2.JSX.Element;
|
|
3550
3616
|
|
|
@@ -3554,6 +3620,23 @@ export declare interface PageListItem {
|
|
|
3554
3620
|
name: string;
|
|
3555
3621
|
/** A divider row: drawn as a line, skipped by the arrow keys. */
|
|
3556
3622
|
divider?: boolean;
|
|
3623
|
+
/**
|
|
3624
|
+
* A second line under the name, in the secondary ink: a time, a hint, a status sentence
|
|
3625
|
+
* ("This file can no longer be read"). It is part of the row's accessible name, after the
|
|
3626
|
+
* name and the value, since the name is built from the row's visible text.
|
|
3627
|
+
*/
|
|
3628
|
+
description?: default_2.ReactNode;
|
|
3629
|
+
/** `"danger"` draws the second line in the danger ink, for an error. Default `"default"`. */
|
|
3630
|
+
descriptionTone?: "default" | "danger";
|
|
3631
|
+
/** A short value at the end of the name's line, in the secondary ink: a size, a count. */
|
|
3632
|
+
value?: default_2.ReactNode;
|
|
3633
|
+
/**
|
|
3634
|
+
* The row's own control -- usually a "More" button opening a Menu -- drawn after the row in
|
|
3635
|
+
* a cell of its own, so a click on it never switches to the page. Name the button after
|
|
3636
|
+
* the row ("More for Les Miserables"). ArrowRight on a row moves into it and ArrowLeft
|
|
3637
|
+
* moves back.
|
|
3638
|
+
*/
|
|
3639
|
+
menu?: default_2.ReactNode;
|
|
3557
3640
|
}
|
|
3558
3641
|
|
|
3559
3642
|
/**
|
|
@@ -3605,6 +3688,14 @@ export declare interface PageRowProps extends Omit<default_2.HTMLAttributes<HTML
|
|
|
3605
3688
|
nameSlot?: default_2.ReactNode;
|
|
3606
3689
|
/** The focusable cell's tab index (PageList manages it). Default 0. */
|
|
3607
3690
|
tabIndex?: number;
|
|
3691
|
+
/** A second line under the name. See PageListItem.description. */
|
|
3692
|
+
description?: default_2.ReactNode;
|
|
3693
|
+
/** `"danger"` draws the second line in the danger ink. Default `"default"`. */
|
|
3694
|
+
descriptionTone?: "default" | "danger";
|
|
3695
|
+
/** A short value at the end of the name's line. See PageListItem.value. */
|
|
3696
|
+
value?: default_2.ReactNode;
|
|
3697
|
+
/** The row's own control, in a cell after the row. See PageListItem.menu. */
|
|
3698
|
+
menu?: default_2.ReactNode;
|
|
3608
3699
|
}
|
|
3609
3700
|
|
|
3610
3701
|
/**
|
|
@@ -4901,6 +4992,13 @@ export declare interface QuickAction {
|
|
|
4901
4992
|
keywords?: readonly string[];
|
|
4902
4993
|
/** Shown, but cannot be run or highlighted. */
|
|
4903
4994
|
disabled?: boolean;
|
|
4995
|
+
/**
|
|
4996
|
+
* A second, dimmed line under the name: why a disabled action cannot be run ("Holds
|
|
4997
|
+
* groups, not amounts"), or what it does. It is the option's accessible description, so its
|
|
4998
|
+
* accessible name stays `label` alone, and it survives a search (which drops the section
|
|
4999
|
+
* headings).
|
|
5000
|
+
*/
|
|
5001
|
+
description?: string;
|
|
4904
5002
|
}
|
|
4905
5003
|
|
|
4906
5004
|
/**
|
|
@@ -4918,6 +5016,7 @@ export declare interface QuickAction {
|
|
|
4918
5016
|
* @param props.filter - Which actions match the search
|
|
4919
5017
|
* @param props.header - Rendered between the search field and the list
|
|
4920
5018
|
* @param props.searchAction - A trailing action at the right end of the search field
|
|
5019
|
+
* @param props.truncate - Cut a long name at the end or in the middle
|
|
4921
5020
|
* @param props.placeholder - Placeholder of the search field
|
|
4922
5021
|
* @param props.width - Panel width
|
|
4923
5022
|
* @param props.height - Panel height
|
|
@@ -4925,7 +5024,7 @@ export declare interface QuickAction {
|
|
|
4925
5024
|
* @param props.style - Extra style on the panel
|
|
4926
5025
|
* @returns The palette
|
|
4927
5026
|
*/
|
|
4928
|
-
export declare function QuickActions({ actions, onRun, onClose, query, onQueryChange, filter, header, searchAction, placeholder, width, height, className, style, ...others }: QuickActionsProps): default_2.JSX.Element;
|
|
5027
|
+
export declare function QuickActions({ actions, onRun, onClose, query, onQueryChange, filter, header, searchAction, truncate, placeholder, width, height, className, style, ...others }: QuickActionsProps): default_2.JSX.Element;
|
|
4929
5028
|
|
|
4930
5029
|
/**
|
|
4931
5030
|
* Props for the QuickActions component.
|
|
@@ -4959,6 +5058,12 @@ export declare interface QuickActionsProps {
|
|
|
4959
5058
|
"aria-label"?: string;
|
|
4960
5059
|
/** Placeholder of the search field. Defaults to the "Search actions" label. */
|
|
4961
5060
|
placeholder?: string;
|
|
5061
|
+
/**
|
|
5062
|
+
* How a name too long for its row is cut. `"end"` (the default) ends it with an ellipsis;
|
|
5063
|
+
* `"middle"` keeps its start and its end ("shared_ch...apters"), for names that differ at
|
|
5064
|
+
* the end. A middle-cut name carries the full name as its tooltip.
|
|
5065
|
+
*/
|
|
5066
|
+
truncate?: "end" | "middle";
|
|
4962
5067
|
/** Panel width. Default 529 (Figma's, the toolbar's width). */
|
|
4963
5068
|
width?: number;
|
|
4964
5069
|
/** Panel height. Default 354. */
|
|
@@ -6623,7 +6728,8 @@ export declare interface TrailingSlotProps {
|
|
|
6623
6728
|
* parent or moves to its first child; ArrowLeft closes an open parent or moves to the parent;
|
|
6624
6729
|
* Home / End; type-ahead; Enter or Space selects (Shift extends, Control / Command toggles); `*`
|
|
6625
6730
|
* opens every sibling; F2 renames; Alt+L closes everything; with `onMove`, Alt+ArrowUp /
|
|
6626
|
-
* Alt+ArrowDown move the focused item one place among its siblings.
|
|
6731
|
+
* Alt+ArrowDown move the focused item one place among its siblings. `onRowKeyDown` sees every
|
|
6732
|
+
* key first and can claim one with `preventDefault()`.
|
|
6627
6733
|
* Pointer: click selects (Shift range, Control / Command toggle); the caret opens one row;
|
|
6628
6734
|
* double-click renames; drag a row to move it.
|
|
6629
6735
|
* @param props - Component props
|
|
@@ -6641,9 +6747,23 @@ export declare interface TrailingSlotProps {
|
|
|
6641
6747
|
* @param props.stickyRoots - Pin expanded top-level rows while scrolling
|
|
6642
6748
|
* @param props.height - The scrolling height when virtualized
|
|
6643
6749
|
* @param props.renameLabel - The rename field's accessible name
|
|
6750
|
+
* @param props.onRowKeyDown - Called first for a key pressed on a focused row; preventDefault claims it
|
|
6644
6751
|
* @returns The tree
|
|
6752
|
+
* @example
|
|
6753
|
+
* A row with a swatch, a count, a running line and its state in words, and a row shortcut.
|
|
6754
|
+
* ```tsx
|
|
6755
|
+
* <Tree
|
|
6756
|
+
* items={[{ id: "pr", name: "PageRank", swatch: <Ramp />, count: 77, progress: 0.4, description: "Running" }]}
|
|
6757
|
+
* onRowKeyDown={(id, event) => {
|
|
6758
|
+
* if (event.key === "Delete") {
|
|
6759
|
+
* event.preventDefault();
|
|
6760
|
+
* remove(id);
|
|
6761
|
+
* }
|
|
6762
|
+
* }}
|
|
6763
|
+
* />
|
|
6764
|
+
* ```
|
|
6645
6765
|
*/
|
|
6646
|
-
export declare function Tree({ items, label, selected, defaultSelected, onSelect, expanded, defaultExpanded, onExpandedChange, multiselect, onRename, onMove, stickyRoots, height, renameLabel, }: TreeProps): default_2.JSX.Element;
|
|
6766
|
+
export declare function Tree({ items, label, selected, defaultSelected, onSelect, expanded, defaultExpanded, onExpandedChange, multiselect, onRename, onMove, stickyRoots, height, renameLabel, onRowKeyDown, }: TreeProps): default_2.JSX.Element;
|
|
6647
6767
|
|
|
6648
6768
|
/**
|
|
6649
6769
|
* One row of a layer tree, as Figma draws it (design/figma-spec.md 10.1): 32 tall, a 16px caret
|
|
@@ -6686,6 +6806,14 @@ export declare interface TreeItemProps extends Omit<default_2.HTMLAttributes<HTM
|
|
|
6686
6806
|
posInSet?: number;
|
|
6687
6807
|
/** How many siblings it has, for assistive technology. */
|
|
6688
6808
|
setSize?: number;
|
|
6809
|
+
/** A swatch drawn between the glyph and the name. See TreeNodeData.swatch. */
|
|
6810
|
+
swatch?: default_2.ReactNode;
|
|
6811
|
+
/** An always-visible count before the toggles. See TreeNodeData.count. */
|
|
6812
|
+
count?: default_2.ReactNode;
|
|
6813
|
+
/** A progress line along the bottom of the row. See TreeNodeData.progress. */
|
|
6814
|
+
progress?: number | "indeterminate";
|
|
6815
|
+
/** The row's state in words, read after its name. See TreeNodeData.description. */
|
|
6816
|
+
description?: string;
|
|
6689
6817
|
/** Drawn in place of the name, e.g. an InlineRename. */
|
|
6690
6818
|
nameSlot?: default_2.ReactNode;
|
|
6691
6819
|
/** Called when the caret is clicked. */
|
|
@@ -6733,6 +6861,29 @@ export declare interface TreeNodeData {
|
|
|
6733
6861
|
* or `data-pinned` stays visible.
|
|
6734
6862
|
*/
|
|
6735
6863
|
actions?: default_2.ReactNode;
|
|
6864
|
+
/**
|
|
6865
|
+
* A small swatch drawn between the glyph and the name: a color, a ramp. It is decoration;
|
|
6866
|
+
* say what it means in `description` if the reader needs to hear it.
|
|
6867
|
+
*/
|
|
6868
|
+
swatch?: default_2.ReactNode;
|
|
6869
|
+
/**
|
|
6870
|
+
* A count drawn before the toggles in the secondary ink, always visible (the toggles hide
|
|
6871
|
+
* until hover). It joins the row's accessible description, so it is heard as well as seen.
|
|
6872
|
+
*/
|
|
6873
|
+
count?: default_2.ReactNode;
|
|
6874
|
+
/**
|
|
6875
|
+
* A progress line along the bottom of the row, for an item whose work is running: a
|
|
6876
|
+
* fraction from 0 to 1, or `"indeterminate"` when the end is not known. Omit it once the
|
|
6877
|
+
* work is done. The line is a `progressbar` named by the row's name.
|
|
6878
|
+
*/
|
|
6879
|
+
progress?: number | "indeterminate";
|
|
6880
|
+
/**
|
|
6881
|
+
* The row's state in words -- "Running", "Failed: the graph has no edges" -- read by a
|
|
6882
|
+
* screen reader after the name (the row's `aria-describedby`) and never drawn. A row's
|
|
6883
|
+
* accessible name is only its `name`, so anything a glyph or a tooltip says belongs here
|
|
6884
|
+
* too.
|
|
6885
|
+
*/
|
|
6886
|
+
description?: string;
|
|
6736
6887
|
}
|
|
6737
6888
|
|
|
6738
6889
|
/**
|
|
@@ -6775,6 +6926,13 @@ export declare interface TreeProps {
|
|
|
6775
6926
|
height?: number | string;
|
|
6776
6927
|
/** The accessible name of the rename field. Defaults to "Layer name". */
|
|
6777
6928
|
renameLabel?: string;
|
|
6929
|
+
/**
|
|
6930
|
+
* Called with the row's id for every key pressed on a focused row (not on a control inside
|
|
6931
|
+
* it), before the tree's own keys. Call `event.preventDefault()` to claim the key: the tree
|
|
6932
|
+
* then does nothing with it. Use it for the row's own shortcuts -- Space to toggle the row's
|
|
6933
|
+
* eye, Delete to delete the row.
|
|
6934
|
+
*/
|
|
6935
|
+
onRowKeyDown?: (id: string, event: default_2.KeyboardEvent<HTMLDivElement>) => void;
|
|
6778
6936
|
}
|
|
6779
6937
|
|
|
6780
6938
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1083,6 +1083,14 @@ export declare interface CompactMantineLabels {
|
|
|
1083
1083
|
* @returns The announcement, such as "3 selected"
|
|
1084
1084
|
*/
|
|
1085
1085
|
rowsSelected: (count: string) => string;
|
|
1086
|
+
/**
|
|
1087
|
+
* Accessible name of the caret that opens a data table column's menu. Optional, so a full
|
|
1088
|
+
* set of labels written before it existed still type-checks; left out, the English default
|
|
1089
|
+
* is used.
|
|
1090
|
+
* @param header - The column's header text
|
|
1091
|
+
* @returns The name, such as "Options for Degree"
|
|
1092
|
+
*/
|
|
1093
|
+
columnMenu?: (header: string) => string;
|
|
1086
1094
|
/**
|
|
1087
1095
|
* How a cell holding true is written, when its column supplies no drawing
|
|
1088
1096
|
* of its own.
|
|
@@ -1673,6 +1681,7 @@ export declare interface ControlGroupProps {
|
|
|
1673
1681
|
* @param props.onAdd - Sets the section up, from the "+" an empty section carries
|
|
1674
1682
|
* @param props.info - An explanation, put behind a circled "i" and used as the section's accessible description
|
|
1675
1683
|
* @param props.actions - The section's own buttons, drawn at the end of the header
|
|
1684
|
+
* @param props.summary - One line saying what the section holds, shown after the name while it is collapsed
|
|
1676
1685
|
* @param props.children - The rows the section holds
|
|
1677
1686
|
* @param props.collapsible - Whether the section folds away behind a chevron, defaulting to true
|
|
1678
1687
|
* @returns The section, its header and its rows
|
|
@@ -1691,6 +1700,13 @@ export declare interface ControlGroupProps {
|
|
|
1691
1700
|
* </ControlSection>
|
|
1692
1701
|
* ```
|
|
1693
1702
|
* @example
|
|
1703
|
+
* A section that says what it holds while it is closed.
|
|
1704
|
+
* ```tsx
|
|
1705
|
+
* <ControlSection label="Sources" defaultOpened={false} summary={`${name} . ${nodeCount} nodes`}>
|
|
1706
|
+
* <SourceRows />
|
|
1707
|
+
* </ControlSection>
|
|
1708
|
+
* ```
|
|
1709
|
+
* @example
|
|
1694
1710
|
* A section for a subject that has not been set up yet.
|
|
1695
1711
|
* ```tsx
|
|
1696
1712
|
* <ControlSection label="Edge properties" empty onAdd={() => { addEdgeProperties(); }} />
|
|
@@ -1765,6 +1781,16 @@ export declare interface ControlSectionProps extends DisclosureProps {
|
|
|
1765
1781
|
* never as a replacement for them.
|
|
1766
1782
|
*/
|
|
1767
1783
|
actions?: default_2.ReactNode;
|
|
1784
|
+
/**
|
|
1785
|
+
* What the section holds, in one short line, shown only while the section is collapsed:
|
|
1786
|
+
* `"les miserables . 77 nodes"`, `"12 attributes"`.
|
|
1787
|
+
*
|
|
1788
|
+
* It is drawn after the name in the secondary ink, cut with an ellipsis before the name is,
|
|
1789
|
+
* and it becomes the expand button's accessible description, so a reader moving through
|
|
1790
|
+
* closed sections hears what each holds without opening it. An open section shows its rows
|
|
1791
|
+
* instead, so the summary is hidden there. Keep it to text.
|
|
1792
|
+
*/
|
|
1793
|
+
summary?: default_2.ReactNode;
|
|
1768
1794
|
/** The rows the section holds: the controls commonly adjusted for its subject. */
|
|
1769
1795
|
children?: default_2.ReactNode;
|
|
1770
1796
|
/**
|
|
@@ -2221,6 +2247,28 @@ export declare interface DataTableColumn<TRow extends object> {
|
|
|
2221
2247
|
filterable?: boolean;
|
|
2222
2248
|
/** Whether this column may be hidden. Defaults to `true`. */
|
|
2223
2249
|
hideable?: boolean;
|
|
2250
|
+
/**
|
|
2251
|
+
* Keeps the column at the start of the table while the other columns scroll sideways: the
|
|
2252
|
+
* key column, such as a node's id or an edge's From and To. Pinned columns are drawn first,
|
|
2253
|
+
* in their own order, whatever `columnOrder` says.
|
|
2254
|
+
*/
|
|
2255
|
+
pinned?: "start";
|
|
2256
|
+
/**
|
|
2257
|
+
* A small glyph drawn before the header's name, such as the column's data type. It is
|
|
2258
|
+
* decoration: the header is still named by `header` alone.
|
|
2259
|
+
*/
|
|
2260
|
+
icon?: default_2.ReactNode;
|
|
2261
|
+
/**
|
|
2262
|
+
* A tooltip on the header, shown on hover and on keyboard focus and linked to the header
|
|
2263
|
+
* as its description: the column's profile, such as "77 values, 1 to 36".
|
|
2264
|
+
*/
|
|
2265
|
+
headerTooltip?: default_2.ReactNode;
|
|
2266
|
+
/**
|
|
2267
|
+
* The column's menu: the `Menu.Item`s (and `Menu.Divider`s) of a Mantine `Menu`. The table
|
|
2268
|
+
* draws a caret at the end of the header, shown on hover and focus, that opens them; from
|
|
2269
|
+
* the keyboard, Alt+ArrowDown, Shift+F10 or the context-menu key on the header opens it.
|
|
2270
|
+
*/
|
|
2271
|
+
menu?: default_2.ReactNode;
|
|
2224
2272
|
}
|
|
2225
2273
|
|
|
2226
2274
|
/**
|
|
@@ -2273,7 +2321,7 @@ export declare interface DataTableHandle {
|
|
|
2273
2321
|
* functions, so a translation can order the pieces the way its own language
|
|
2274
2322
|
* needs, and numbers arrive already formatted for the active locale.
|
|
2275
2323
|
*/
|
|
2276
|
-
export declare type DataTableLabels = Pick<CompactMantineLabels, "clearSearch" | "dataTable" | "no" | "noMatchingRows" | "noRows" | "rowsSelected" | "rowsShown" | "search" | "searchPlaceholder" | "yes">;
|
|
2324
|
+
export declare type DataTableLabels = Pick<CompactMantineLabels, "clearSearch" | "columnMenu" | "dataTable" | "no" | "noMatchingRows" | "noRows" | "rowsSelected" | "rowsShown" | "search" | "searchPlaceholder" | "yes">;
|
|
2277
2325
|
|
|
2278
2326
|
/**
|
|
2279
2327
|
* Props for the DataTable component.
|
|
@@ -2554,7 +2602,7 @@ export declare const DEFAULT_GRADIENT_STOP_COLOR = "#888888";
|
|
|
2554
2602
|
* build a full set of your own, or pass only the entries you want to change to
|
|
2555
2603
|
* `LabelsProvider`.
|
|
2556
2604
|
*/
|
|
2557
|
-
export declare const defaultLabels: CompactMantineLabels
|
|
2605
|
+
export declare const defaultLabels: Required<CompactMantineLabels>;
|
|
2558
2606
|
|
|
2559
2607
|
/**
|
|
2560
2608
|
* Which way text runs: left to right, or right to left.
|
|
@@ -3534,7 +3582,9 @@ export declare type OpenChangeHandler = (opened: boolean, event?: default_2.Synt
|
|
|
3534
3582
|
/**
|
|
3535
3583
|
* A page list (design/figma-spec.md 10.2): Figma's own accessible model, a one-column grid with
|
|
3536
3584
|
* one Tab stop. ArrowUp / ArrowDown / Home / End move focus without switching; Enter, Space or a
|
|
3537
|
-
* click switches; F2 or a double-click renames when `onRename` is given.
|
|
3585
|
+
* click switches; F2 or a double-click renames when `onRename` is given. A row can carry a second
|
|
3586
|
+
* line, a trailing value and a row menu (see PageListItem); ArrowRight moves into the menu. The
|
|
3587
|
+
* menu's controls are taken out of the Tab order, so the list stays one Tab stop.
|
|
3538
3588
|
* @param props - Component props
|
|
3539
3589
|
* @param props.items - The items or pages
|
|
3540
3590
|
* @param props.current - The current page (controlled)
|
|
@@ -3545,6 +3595,22 @@ export declare type OpenChangeHandler = (opened: boolean, event?: default_2.Synt
|
|
|
3545
3595
|
* @param props.onRename - Called with a new name; turns renaming on
|
|
3546
3596
|
* @param props.renameLabel - The rename field's accessible name
|
|
3547
3597
|
* @returns The list
|
|
3598
|
+
* @example
|
|
3599
|
+
* A recent-files list: a size, a time, an error line and a row menu.
|
|
3600
|
+
* ```tsx
|
|
3601
|
+
* <PageList
|
|
3602
|
+
* label="Recent projects"
|
|
3603
|
+
* items={recent.map((file) => ({
|
|
3604
|
+
* id: file.id,
|
|
3605
|
+
* name: file.name,
|
|
3606
|
+
* value: `${file.nodes} nodes`,
|
|
3607
|
+
* description: file.missing ? "This file can no longer be read" : file.savedAt,
|
|
3608
|
+
* descriptionTone: file.missing ? "danger" : "default",
|
|
3609
|
+
* menu: <RecentMenu file={file} />,
|
|
3610
|
+
* }))}
|
|
3611
|
+
* onCurrentChange={(id) => open(id)}
|
|
3612
|
+
* />
|
|
3613
|
+
* ```
|
|
3548
3614
|
*/
|
|
3549
3615
|
export declare function PageList({ items, current, defaultCurrent, onCurrentChange, tone, label, onRename, renameLabel, }: PageListProps): default_2.JSX.Element;
|
|
3550
3616
|
|
|
@@ -3554,6 +3620,23 @@ export declare interface PageListItem {
|
|
|
3554
3620
|
name: string;
|
|
3555
3621
|
/** A divider row: drawn as a line, skipped by the arrow keys. */
|
|
3556
3622
|
divider?: boolean;
|
|
3623
|
+
/**
|
|
3624
|
+
* A second line under the name, in the secondary ink: a time, a hint, a status sentence
|
|
3625
|
+
* ("This file can no longer be read"). It is part of the row's accessible name, after the
|
|
3626
|
+
* name and the value, since the name is built from the row's visible text.
|
|
3627
|
+
*/
|
|
3628
|
+
description?: default_2.ReactNode;
|
|
3629
|
+
/** `"danger"` draws the second line in the danger ink, for an error. Default `"default"`. */
|
|
3630
|
+
descriptionTone?: "default" | "danger";
|
|
3631
|
+
/** A short value at the end of the name's line, in the secondary ink: a size, a count. */
|
|
3632
|
+
value?: default_2.ReactNode;
|
|
3633
|
+
/**
|
|
3634
|
+
* The row's own control -- usually a "More" button opening a Menu -- drawn after the row in
|
|
3635
|
+
* a cell of its own, so a click on it never switches to the page. Name the button after
|
|
3636
|
+
* the row ("More for Les Miserables"). ArrowRight on a row moves into it and ArrowLeft
|
|
3637
|
+
* moves back.
|
|
3638
|
+
*/
|
|
3639
|
+
menu?: default_2.ReactNode;
|
|
3557
3640
|
}
|
|
3558
3641
|
|
|
3559
3642
|
/**
|
|
@@ -3605,6 +3688,14 @@ export declare interface PageRowProps extends Omit<default_2.HTMLAttributes<HTML
|
|
|
3605
3688
|
nameSlot?: default_2.ReactNode;
|
|
3606
3689
|
/** The focusable cell's tab index (PageList manages it). Default 0. */
|
|
3607
3690
|
tabIndex?: number;
|
|
3691
|
+
/** A second line under the name. See PageListItem.description. */
|
|
3692
|
+
description?: default_2.ReactNode;
|
|
3693
|
+
/** `"danger"` draws the second line in the danger ink. Default `"default"`. */
|
|
3694
|
+
descriptionTone?: "default" | "danger";
|
|
3695
|
+
/** A short value at the end of the name's line. See PageListItem.value. */
|
|
3696
|
+
value?: default_2.ReactNode;
|
|
3697
|
+
/** The row's own control, in a cell after the row. See PageListItem.menu. */
|
|
3698
|
+
menu?: default_2.ReactNode;
|
|
3608
3699
|
}
|
|
3609
3700
|
|
|
3610
3701
|
/**
|
|
@@ -4901,6 +4992,13 @@ export declare interface QuickAction {
|
|
|
4901
4992
|
keywords?: readonly string[];
|
|
4902
4993
|
/** Shown, but cannot be run or highlighted. */
|
|
4903
4994
|
disabled?: boolean;
|
|
4995
|
+
/**
|
|
4996
|
+
* A second, dimmed line under the name: why a disabled action cannot be run ("Holds
|
|
4997
|
+
* groups, not amounts"), or what it does. It is the option's accessible description, so its
|
|
4998
|
+
* accessible name stays `label` alone, and it survives a search (which drops the section
|
|
4999
|
+
* headings).
|
|
5000
|
+
*/
|
|
5001
|
+
description?: string;
|
|
4904
5002
|
}
|
|
4905
5003
|
|
|
4906
5004
|
/**
|
|
@@ -4918,6 +5016,7 @@ export declare interface QuickAction {
|
|
|
4918
5016
|
* @param props.filter - Which actions match the search
|
|
4919
5017
|
* @param props.header - Rendered between the search field and the list
|
|
4920
5018
|
* @param props.searchAction - A trailing action at the right end of the search field
|
|
5019
|
+
* @param props.truncate - Cut a long name at the end or in the middle
|
|
4921
5020
|
* @param props.placeholder - Placeholder of the search field
|
|
4922
5021
|
* @param props.width - Panel width
|
|
4923
5022
|
* @param props.height - Panel height
|
|
@@ -4925,7 +5024,7 @@ export declare interface QuickAction {
|
|
|
4925
5024
|
* @param props.style - Extra style on the panel
|
|
4926
5025
|
* @returns The palette
|
|
4927
5026
|
*/
|
|
4928
|
-
export declare function QuickActions({ actions, onRun, onClose, query, onQueryChange, filter, header, searchAction, placeholder, width, height, className, style, ...others }: QuickActionsProps): default_2.JSX.Element;
|
|
5027
|
+
export declare function QuickActions({ actions, onRun, onClose, query, onQueryChange, filter, header, searchAction, truncate, placeholder, width, height, className, style, ...others }: QuickActionsProps): default_2.JSX.Element;
|
|
4929
5028
|
|
|
4930
5029
|
/**
|
|
4931
5030
|
* Props for the QuickActions component.
|
|
@@ -4959,6 +5058,12 @@ export declare interface QuickActionsProps {
|
|
|
4959
5058
|
"aria-label"?: string;
|
|
4960
5059
|
/** Placeholder of the search field. Defaults to the "Search actions" label. */
|
|
4961
5060
|
placeholder?: string;
|
|
5061
|
+
/**
|
|
5062
|
+
* How a name too long for its row is cut. `"end"` (the default) ends it with an ellipsis;
|
|
5063
|
+
* `"middle"` keeps its start and its end ("shared_ch...apters"), for names that differ at
|
|
5064
|
+
* the end. A middle-cut name carries the full name as its tooltip.
|
|
5065
|
+
*/
|
|
5066
|
+
truncate?: "end" | "middle";
|
|
4962
5067
|
/** Panel width. Default 529 (Figma's, the toolbar's width). */
|
|
4963
5068
|
width?: number;
|
|
4964
5069
|
/** Panel height. Default 354. */
|
|
@@ -6623,7 +6728,8 @@ export declare interface TrailingSlotProps {
|
|
|
6623
6728
|
* parent or moves to its first child; ArrowLeft closes an open parent or moves to the parent;
|
|
6624
6729
|
* Home / End; type-ahead; Enter or Space selects (Shift extends, Control / Command toggles); `*`
|
|
6625
6730
|
* opens every sibling; F2 renames; Alt+L closes everything; with `onMove`, Alt+ArrowUp /
|
|
6626
|
-
* Alt+ArrowDown move the focused item one place among its siblings.
|
|
6731
|
+
* Alt+ArrowDown move the focused item one place among its siblings. `onRowKeyDown` sees every
|
|
6732
|
+
* key first and can claim one with `preventDefault()`.
|
|
6627
6733
|
* Pointer: click selects (Shift range, Control / Command toggle); the caret opens one row;
|
|
6628
6734
|
* double-click renames; drag a row to move it.
|
|
6629
6735
|
* @param props - Component props
|
|
@@ -6641,9 +6747,23 @@ export declare interface TrailingSlotProps {
|
|
|
6641
6747
|
* @param props.stickyRoots - Pin expanded top-level rows while scrolling
|
|
6642
6748
|
* @param props.height - The scrolling height when virtualized
|
|
6643
6749
|
* @param props.renameLabel - The rename field's accessible name
|
|
6750
|
+
* @param props.onRowKeyDown - Called first for a key pressed on a focused row; preventDefault claims it
|
|
6644
6751
|
* @returns The tree
|
|
6752
|
+
* @example
|
|
6753
|
+
* A row with a swatch, a count, a running line and its state in words, and a row shortcut.
|
|
6754
|
+
* ```tsx
|
|
6755
|
+
* <Tree
|
|
6756
|
+
* items={[{ id: "pr", name: "PageRank", swatch: <Ramp />, count: 77, progress: 0.4, description: "Running" }]}
|
|
6757
|
+
* onRowKeyDown={(id, event) => {
|
|
6758
|
+
* if (event.key === "Delete") {
|
|
6759
|
+
* event.preventDefault();
|
|
6760
|
+
* remove(id);
|
|
6761
|
+
* }
|
|
6762
|
+
* }}
|
|
6763
|
+
* />
|
|
6764
|
+
* ```
|
|
6645
6765
|
*/
|
|
6646
|
-
export declare function Tree({ items, label, selected, defaultSelected, onSelect, expanded, defaultExpanded, onExpandedChange, multiselect, onRename, onMove, stickyRoots, height, renameLabel, }: TreeProps): default_2.JSX.Element;
|
|
6766
|
+
export declare function Tree({ items, label, selected, defaultSelected, onSelect, expanded, defaultExpanded, onExpandedChange, multiselect, onRename, onMove, stickyRoots, height, renameLabel, onRowKeyDown, }: TreeProps): default_2.JSX.Element;
|
|
6647
6767
|
|
|
6648
6768
|
/**
|
|
6649
6769
|
* One row of a layer tree, as Figma draws it (design/figma-spec.md 10.1): 32 tall, a 16px caret
|
|
@@ -6686,6 +6806,14 @@ export declare interface TreeItemProps extends Omit<default_2.HTMLAttributes<HTM
|
|
|
6686
6806
|
posInSet?: number;
|
|
6687
6807
|
/** How many siblings it has, for assistive technology. */
|
|
6688
6808
|
setSize?: number;
|
|
6809
|
+
/** A swatch drawn between the glyph and the name. See TreeNodeData.swatch. */
|
|
6810
|
+
swatch?: default_2.ReactNode;
|
|
6811
|
+
/** An always-visible count before the toggles. See TreeNodeData.count. */
|
|
6812
|
+
count?: default_2.ReactNode;
|
|
6813
|
+
/** A progress line along the bottom of the row. See TreeNodeData.progress. */
|
|
6814
|
+
progress?: number | "indeterminate";
|
|
6815
|
+
/** The row's state in words, read after its name. See TreeNodeData.description. */
|
|
6816
|
+
description?: string;
|
|
6689
6817
|
/** Drawn in place of the name, e.g. an InlineRename. */
|
|
6690
6818
|
nameSlot?: default_2.ReactNode;
|
|
6691
6819
|
/** Called when the caret is clicked. */
|
|
@@ -6733,6 +6861,29 @@ export declare interface TreeNodeData {
|
|
|
6733
6861
|
* or `data-pinned` stays visible.
|
|
6734
6862
|
*/
|
|
6735
6863
|
actions?: default_2.ReactNode;
|
|
6864
|
+
/**
|
|
6865
|
+
* A small swatch drawn between the glyph and the name: a color, a ramp. It is decoration;
|
|
6866
|
+
* say what it means in `description` if the reader needs to hear it.
|
|
6867
|
+
*/
|
|
6868
|
+
swatch?: default_2.ReactNode;
|
|
6869
|
+
/**
|
|
6870
|
+
* A count drawn before the toggles in the secondary ink, always visible (the toggles hide
|
|
6871
|
+
* until hover). It joins the row's accessible description, so it is heard as well as seen.
|
|
6872
|
+
*/
|
|
6873
|
+
count?: default_2.ReactNode;
|
|
6874
|
+
/**
|
|
6875
|
+
* A progress line along the bottom of the row, for an item whose work is running: a
|
|
6876
|
+
* fraction from 0 to 1, or `"indeterminate"` when the end is not known. Omit it once the
|
|
6877
|
+
* work is done. The line is a `progressbar` named by the row's name.
|
|
6878
|
+
*/
|
|
6879
|
+
progress?: number | "indeterminate";
|
|
6880
|
+
/**
|
|
6881
|
+
* The row's state in words -- "Running", "Failed: the graph has no edges" -- read by a
|
|
6882
|
+
* screen reader after the name (the row's `aria-describedby`) and never drawn. A row's
|
|
6883
|
+
* accessible name is only its `name`, so anything a glyph or a tooltip says belongs here
|
|
6884
|
+
* too.
|
|
6885
|
+
*/
|
|
6886
|
+
description?: string;
|
|
6736
6887
|
}
|
|
6737
6888
|
|
|
6738
6889
|
/**
|
|
@@ -6775,6 +6926,13 @@ export declare interface TreeProps {
|
|
|
6775
6926
|
height?: number | string;
|
|
6776
6927
|
/** The accessible name of the rename field. Defaults to "Layer name". */
|
|
6777
6928
|
renameLabel?: string;
|
|
6929
|
+
/**
|
|
6930
|
+
* Called with the row's id for every key pressed on a focused row (not on a control inside
|
|
6931
|
+
* it), before the tree's own keys. Call `event.preventDefault()` to claim the key: the tree
|
|
6932
|
+
* then does nothing with it. Use it for the row's own shortcuts -- Space to toggle the row's
|
|
6933
|
+
* eye, Delete to delete the row.
|
|
6934
|
+
*/
|
|
6935
|
+
onRowKeyDown?: (id: string, event: default_2.KeyboardEvent<HTMLDivElement>) => void;
|
|
6778
6936
|
}
|
|
6779
6937
|
|
|
6780
6938
|
/**
|