@graphty/compact-mantine 0.8.19 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +523 -201
- package/dist/fonts/LICENSE-Inter.txt +93 -0
- package/dist/index.cjs +4044 -1
- package/dist/index.d.cts +2282 -957
- package/dist/index.d.ts +2282 -957
- package/dist/index.js +12161 -5021
- package/package.json +4 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import { ActionIconProps } from '@mantine/core';
|
|
2
|
+
import { BoxProps } from '@mantine/core';
|
|
2
3
|
import { ComboboxData } from '@mantine/core';
|
|
4
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
3
5
|
import { default as default_2 } from 'react';
|
|
4
6
|
import { ElementProps } from '@mantine/core';
|
|
5
7
|
import { ForwardRefExoticComponent } from 'react';
|
|
6
8
|
import { JSX } from 'react';
|
|
9
|
+
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
7
10
|
import { MantineColorShade } from '@mantine/core';
|
|
8
11
|
import { MantineColorsTuple } from '@mantine/core';
|
|
9
12
|
import { MantineRadius } from '@mantine/core';
|
|
10
13
|
import { MantineTheme } from '@mantine/core';
|
|
14
|
+
import { MantineThemeOverride } from '@mantine/core';
|
|
15
|
+
import { MenuItemProps } from '@mantine/core';
|
|
16
|
+
import { MenuProps } from '@mantine/core';
|
|
17
|
+
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
18
|
+
import { MouseEventHandler } from 'react';
|
|
19
|
+
import { NotificationProps } from '@mantine/core';
|
|
20
|
+
import { ReactElement } from 'react';
|
|
11
21
|
import { ReactNode } from 'react';
|
|
12
22
|
import { ReactPortal } from 'react';
|
|
13
23
|
import { RefAttributes } from 'react';
|
|
14
24
|
import { RefObject } from 'react';
|
|
15
25
|
import { SegmentedControl as SegmentedControl_2 } from '@mantine/core';
|
|
16
26
|
import { SyntheticEvent } from 'react';
|
|
27
|
+
import { TextInputProps } from '@mantine/core';
|
|
28
|
+
import { TooltipProps } from '@mantine/core';
|
|
29
|
+
import { UnstyledButtonProps } from '@mantine/core';
|
|
17
30
|
import { VariantColorsResolver } from '@mantine/core';
|
|
18
31
|
|
|
19
32
|
/**
|
|
@@ -21,16 +34,15 @@ import { VariantColorsResolver } from '@mantine/core';
|
|
|
21
34
|
* doing something about it: a reading at the leading edge, a cluster of
|
|
22
35
|
* controls at the trailing edge.
|
|
23
36
|
*
|
|
24
|
-
* **
|
|
25
|
-
* Recompute, Copy, a button that opens the advanced settings
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
37
|
+
* **Actions and resident actions.** `actions` are controls that *act* -- Run,
|
|
38
|
+
* Recompute, Copy, a button that opens the advanced settings. The resident
|
|
39
|
+
* ones *report a state* and are never hidden. On a property row Figma draws both
|
|
40
|
+
* always, which is the default here. `reveal="hover"` gives the layer-row
|
|
41
|
+
* behavior instead: the acting controls fade in (100ms) when the row is
|
|
42
|
+
* reached, while a state -- a crossed-out eye on a hidden layer -- stays
|
|
43
|
+
* visible with no hover at all.
|
|
31
44
|
*
|
|
32
|
-
*
|
|
33
|
-
* why this is a component instead of a CSS rule:
|
|
45
|
+
* When the actions are revealed on hover, three things keep that usable:
|
|
34
46
|
*
|
|
35
47
|
* - **A touch screen has no hover**, so where the pointer cannot hover every
|
|
36
48
|
* hidden control is drawn.
|
|
@@ -43,11 +55,12 @@ import { VariantColorsResolver } from '@mantine/core';
|
|
|
43
55
|
* destructive, anything ending in "anyway". Everything else is a 24px glyph
|
|
44
56
|
* carrying its word as its tooltip and its accessible name.
|
|
45
57
|
* @param props - Component props
|
|
46
|
-
* @param props.state - What the row reports, drawn at the leading edge in the secondary text
|
|
58
|
+
* @param props.state - What the row reports, drawn at the leading edge in the secondary text color
|
|
47
59
|
* @param props.stateTitle - The complete reading, for when `state` is markup or an abbreviation of what the row means
|
|
48
60
|
* @param props.busy - Whether the reading is still being worked out by something that finishes later
|
|
49
61
|
* @param props.live - How urgently a screen reader announces the reading when it changes on its own
|
|
50
|
-
* @param props.actions - Controls that act
|
|
62
|
+
* @param props.actions - Controls that act: always drawn by default, or revealed on hover and focus with `reveal="hover"`
|
|
63
|
+
* @param props.reveal - When the actions are drawn: "always" (the default) or "hover"
|
|
51
64
|
* @param props.residentActions - Controls that report a state, which are never hidden
|
|
52
65
|
* @param props.actionsVisible - Forces the hidden controls shown or hidden instead of letting hover and focus decide
|
|
53
66
|
* @param props.disabled - Whether the row cannot act, which draws its reading at the disabled ink and announces it as unavailable
|
|
@@ -75,7 +88,7 @@ export declare interface ActionRowProps {
|
|
|
75
88
|
/**
|
|
76
89
|
* What the row reports: a count, a status, a record of the last run.
|
|
77
90
|
*
|
|
78
|
-
* Always drawn, at the leading edge, in the secondary text
|
|
91
|
+
* Always drawn, at the leading edge, in the secondary text color, and
|
|
79
92
|
* truncated with an ellipsis rather than wrapped -- the row is 32px and
|
|
80
93
|
* stays 32px. Only the drawing is truncated: the text itself is complete in
|
|
81
94
|
* the document, so a screen reader reads all of it however little of it
|
|
@@ -127,12 +140,21 @@ export declare interface ActionRowProps {
|
|
|
127
140
|
* Controls that act: Run, Recompute, Copy, a button that opens the advanced
|
|
128
141
|
* settings.
|
|
129
142
|
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
143
|
+
* Always drawn by default, as Figma draws the actions of a property row.
|
|
144
|
+
* With `reveal="hover"` they are hidden until the row is hovered or
|
|
145
|
+
* something inside it is focused, and always drawn where the pointer cannot
|
|
146
|
+
* hover. Hidden means faded out over 100ms, not unmounted: they keep their
|
|
147
|
+
* accessible names and their place in the tab order, and any one of them
|
|
148
|
+
* reveals the whole cluster by taking focus.
|
|
134
149
|
*/
|
|
135
150
|
actions?: default_2.ReactNode;
|
|
151
|
+
/**
|
|
152
|
+
* When `actions` are drawn: `"always"` (Figma's property rows) or `"hover"`
|
|
153
|
+
* (Figma's layer rows: shown while the row is hovered or focused).
|
|
154
|
+
* `actionsVisible` overrides either.
|
|
155
|
+
* @default "always"
|
|
156
|
+
*/
|
|
157
|
+
reveal?: "always" | "hover";
|
|
136
158
|
/**
|
|
137
159
|
* Controls that report a state as well as changing it: the crossed-out eye
|
|
138
160
|
* on a hidden item, the pin on a pinned reading.
|
|
@@ -149,7 +171,7 @@ export declare interface ActionRowProps {
|
|
|
149
171
|
* rows below are "dimmed and disabled instead of tagged individually". The reading
|
|
150
172
|
* then takes the disabled ink -- a different token from the ordinary muted one --
|
|
151
173
|
* and the row is announced as unavailable, so nothing about the state depends on
|
|
152
|
-
* telling two
|
|
174
|
+
* telling two grays apart.
|
|
153
175
|
* @default false
|
|
154
176
|
*/
|
|
155
177
|
disabled?: boolean;
|
|
@@ -157,7 +179,7 @@ export declare interface ActionRowProps {
|
|
|
157
179
|
* Forces `actions` to be drawn, or forces them hidden, instead of letting
|
|
158
180
|
* the row decide from hover and focus.
|
|
159
181
|
*
|
|
160
|
-
* Leave it out for the usual
|
|
182
|
+
* Leave it out for the usual behavior. Set it to `true` while a menu or a
|
|
161
183
|
* pop-out opened from this row is still open, so that the control which
|
|
162
184
|
* opened it does not vanish the moment the pointer moves onto the thing it
|
|
163
185
|
* opened.
|
|
@@ -225,7 +247,7 @@ export declare type ActivationHandler = (event: ActivationEvent) => void;
|
|
|
225
247
|
* Called when a control is activated, with the activation source stated
|
|
226
248
|
* separately.
|
|
227
249
|
*
|
|
228
|
-
* Use this in place of {@link ActivationHandler} only where the
|
|
250
|
+
* Use this in place of {@link ActivationHandler} only where the behavior
|
|
229
251
|
* genuinely differs between a pointer and a key -- selectable list rows, where a
|
|
230
252
|
* click extends a selection and Enter does not. Everywhere else the plain event
|
|
231
253
|
* is enough, and a second parameter is noise.
|
|
@@ -299,7 +321,7 @@ export declare interface AdvancedButtonProps extends Omit<default_2.ButtonHTMLAt
|
|
|
299
321
|
* Names the settings the button opens, such as `"Image export options"`.
|
|
300
322
|
*
|
|
301
323
|
* It becomes both the button's tooltip and the name a screen reader
|
|
302
|
-
* announces, so write it as a phrase a person would
|
|
324
|
+
* announces, so write it as a phrase a person would recognize rather than
|
|
303
325
|
* as the word "settings". When `changed` is true the name also states that,
|
|
304
326
|
* so there is no need to spell the change into this string yourself.
|
|
305
327
|
*/
|
|
@@ -312,15 +334,15 @@ export declare interface AdvancedButtonProps extends Omit<default_2.ButtonHTMLAt
|
|
|
312
334
|
* state the panel behind the button edits; a button that forgets it tells
|
|
313
335
|
* the reader that a changed setting is unchanged.
|
|
314
336
|
*
|
|
315
|
-
* A changed button draws in the
|
|
316
|
-
*
|
|
317
|
-
* survives for a reader who cannot see the difference in
|
|
337
|
+
* A changed button draws its glyph in the brand ink instead of the
|
|
338
|
+
* ordinary icon ink, and says so in its accessible name as well, so the
|
|
339
|
+
* signal survives for a reader who cannot see the difference in color.
|
|
318
340
|
* @default false
|
|
319
341
|
*/
|
|
320
342
|
changed?: boolean;
|
|
321
343
|
/**
|
|
322
344
|
* The glyph drawn on the button.
|
|
323
|
-
* @default
|
|
345
|
+
* @default the settings glyph
|
|
324
346
|
*/
|
|
325
347
|
icon?: default_2.ReactNode;
|
|
326
348
|
/**
|
|
@@ -335,7 +357,7 @@ export declare interface AdvancedButtonProps extends Omit<default_2.ButtonHTMLAt
|
|
|
335
357
|
/**
|
|
336
358
|
* Whether the button cannot be used.
|
|
337
359
|
*
|
|
338
|
-
* A disabled button is drawn in the same dimmed
|
|
360
|
+
* A disabled button is drawn in the same dimmed color as any other
|
|
339
361
|
* disabled control, refuses activation, and is skipped by the Tab key.
|
|
340
362
|
* @default false
|
|
341
363
|
*/
|
|
@@ -351,6 +373,58 @@ export declare interface AdvancedButtonProps extends Omit<default_2.ButtonHTMLAt
|
|
|
351
373
|
loading?: boolean;
|
|
352
374
|
}
|
|
353
375
|
|
|
376
|
+
/** Every value, in reading order. */
|
|
377
|
+
export declare const ALIGNMENT_MATRIX_VALUES: readonly AlignmentMatrixValue[];
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* The 3 x 3 alignment picker of an auto layout frame: nine radios drawn as dots, with the chosen
|
|
381
|
+
* one drawn as the three bars of the alignment it sets.
|
|
382
|
+
* @param props - Component props
|
|
383
|
+
* @param props.value - The chosen cell, to drive the matrix from your own state
|
|
384
|
+
* @param props.defaultValue - The cell chosen before anything is picked
|
|
385
|
+
* @param props.onChange - Called with the newly chosen cell and the event
|
|
386
|
+
* @param props.direction - Which way the children run, and so how the bars are drawn
|
|
387
|
+
* @param props.label - The group's accessible name
|
|
388
|
+
* @param props.cellLabels - The name and tooltip of each cell
|
|
389
|
+
* @param props.disabled - Whether the matrix cannot be used
|
|
390
|
+
* @param props.name - The shared name of the radio inputs
|
|
391
|
+
* @returns the matrix
|
|
392
|
+
* @example
|
|
393
|
+
* ```tsx
|
|
394
|
+
* <AlignmentMatrix value={align} onChange={setAlign} direction="horizontal" />
|
|
395
|
+
* ```
|
|
396
|
+
*/
|
|
397
|
+
export declare function AlignmentMatrix({ value, defaultValue, onChange, direction, label, cellLabels, disabled, name, }: AlignmentMatrixProps): default_2.JSX.Element;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Props for the AlignmentMatrix.
|
|
401
|
+
*/
|
|
402
|
+
export declare interface AlignmentMatrixProps {
|
|
403
|
+
/** The chosen cell. Supply it to drive the matrix from your own state. */
|
|
404
|
+
value?: AlignmentMatrixValue;
|
|
405
|
+
/** The cell chosen before anything is picked, when the matrix keeps its own state. @default "top-left" */
|
|
406
|
+
defaultValue?: AlignmentMatrixValue;
|
|
407
|
+
/** Called with the newly chosen cell and the event that chose it. */
|
|
408
|
+
onChange?: ChangeHandler<AlignmentMatrixValue>;
|
|
409
|
+
/**
|
|
410
|
+
* Which way the children run, which is how the bars are drawn: `"vertical"` stacks three
|
|
411
|
+
* horizontal bars, `"horizontal"` stands three vertical bars side by side.
|
|
412
|
+
* @default "vertical"
|
|
413
|
+
*/
|
|
414
|
+
direction?: "horizontal" | "vertical";
|
|
415
|
+
/** The group's accessible name. @default "Alignment" */
|
|
416
|
+
label?: string;
|
|
417
|
+
/** The name (and tooltip) of each cell, when the English defaults will not do. */
|
|
418
|
+
cellLabels?: Partial<Record<AlignmentMatrixValue, string>>;
|
|
419
|
+
/** Whether the matrix cannot be used. @default false */
|
|
420
|
+
disabled?: boolean;
|
|
421
|
+
/** The shared name of the radio inputs. One is generated when left out. */
|
|
422
|
+
name?: string;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/** One cell of the matrix: `"top-left"` .. `"bottom-right"`. */
|
|
426
|
+
export declare type AlignmentMatrixValue = `${(typeof ROWS)[number]}-${(typeof COLUMNS)[number]}`;
|
|
427
|
+
|
|
354
428
|
/**
|
|
355
429
|
* Called when a component's value changes.
|
|
356
430
|
*
|
|
@@ -368,8 +442,104 @@ export declare interface AdvancedButtonProps extends Omit<default_2.ButtonHTMLAt
|
|
|
368
442
|
*/
|
|
369
443
|
export declare type ChangeHandler<T> = (value: T, event?: default_2.SyntheticEvent) => void;
|
|
370
444
|
|
|
445
|
+
/** The value formats the format select offers. */
|
|
446
|
+
export declare type ColorPickerFormat = "hex" | "rgb" | "hsl" | "hsb";
|
|
447
|
+
|
|
448
|
+
/** The paint types the paint-type bar can offer. */
|
|
449
|
+
export declare type ColorPickerPaintType = "solid" | "gradient";
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Figma's color picker body (design/figma-spec.md 7.3), for a 240-wide light popover: an
|
|
453
|
+
* optional paint-type bar, a 208 x 208 saturation / brightness field with a keyboard-operable
|
|
454
|
+
* reticle, the eyedropper (where the browser has one) beside the hue and opacity sliders, a
|
|
455
|
+
* format select and a joined value / opacity field, and the swatch set under a divider.
|
|
456
|
+
*
|
|
457
|
+
* It holds the color in HSV so that dragging through gray keeps its hue. Put it inside a
|
|
458
|
+
* `Popout.Panel` (CompactColorInput does), which supplies the header, the close button, Escape
|
|
459
|
+
* and one-popover-at-a-time.
|
|
460
|
+
* @param props - Component props
|
|
461
|
+
* @param props.value - the value
|
|
462
|
+
* @param props.onChange - called on every change
|
|
463
|
+
* @param props.onChangeEnd - called when a drag or step settles
|
|
464
|
+
* @param props.withAlpha - offer opacity
|
|
465
|
+
* @param props.swatches - the swatch set
|
|
466
|
+
* @param props.defaultFormat - the value row's first format
|
|
467
|
+
* @param props.gradient - gradient content for the paint-type bar
|
|
468
|
+
* @param props.paintType - the selected paint type
|
|
469
|
+
* @param props.onPaintTypeChange - called when the reader picks a paint type
|
|
470
|
+
* @param props.labels - English string overrides
|
|
471
|
+
* @returns the picker body
|
|
472
|
+
* @example
|
|
473
|
+
* ```tsx
|
|
474
|
+
* <Popout.Panel width={240} header={{ variant: "title", title: "Fill" }}>
|
|
475
|
+
* <ColorPickerPanel value={fill} onChange={setFill} swatches={SWATCH_COLORS_HEXA} />
|
|
476
|
+
* </Popout.Panel>
|
|
477
|
+
* ```
|
|
478
|
+
*/
|
|
479
|
+
export declare function ColorPickerPanel({ value, onChange, onChangeEnd, withAlpha, swatches, defaultFormat, gradient, paintType, onPaintTypeChange, labels: labelOverrides, }: ColorPickerPanelProps): default_2.JSX.Element;
|
|
480
|
+
|
|
481
|
+
/** Every string ColorPickerPanel draws or announces, in English by default. */
|
|
482
|
+
export declare interface ColorPickerPanelLabels {
|
|
483
|
+
/** Name of the saturation and brightness field. */
|
|
484
|
+
saturation: string;
|
|
485
|
+
/** Name of the hue slider. */
|
|
486
|
+
hue: string;
|
|
487
|
+
/** Name of the opacity slider and the opacity box. */
|
|
488
|
+
opacity: string;
|
|
489
|
+
/** Name of the eyedropper button. */
|
|
490
|
+
eyedropper: string;
|
|
491
|
+
/** Name of the format select. */
|
|
492
|
+
format: string;
|
|
493
|
+
/** Name of the color value box (hex, or three numbers). */
|
|
494
|
+
value: string;
|
|
495
|
+
/** Name of the paint-type group. */
|
|
496
|
+
paintType: string;
|
|
497
|
+
/** The solid paint type. */
|
|
498
|
+
solid: string;
|
|
499
|
+
/** The gradient paint type. */
|
|
500
|
+
gradient: string;
|
|
501
|
+
/** Name of the swatch list. */
|
|
502
|
+
swatches: string;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/** Props for ColorPickerPanel. */
|
|
506
|
+
export declare interface ColorPickerPanelProps {
|
|
507
|
+
/** The color, `#RRGGBB` or `#RRGGBBAA`. */
|
|
508
|
+
value: string;
|
|
509
|
+
/**
|
|
510
|
+
* Called on every change: live while dragging, once per typed commit, arrow key or swatch.
|
|
511
|
+
* Reports `#RRGGBBAA` (upper case) when `withAlpha`, `#RRGGBB` otherwise.
|
|
512
|
+
*/
|
|
513
|
+
onChange: (value: string) => void;
|
|
514
|
+
/** Called once when a drag in the field or a slider settles, with the settled color. */
|
|
515
|
+
onChangeEnd?: (value: string) => void;
|
|
516
|
+
/**
|
|
517
|
+
* Offer opacity: the opacity slider and box.
|
|
518
|
+
* @default true
|
|
519
|
+
*/
|
|
520
|
+
withAlpha?: boolean;
|
|
521
|
+
/** The swatch set under the divider, as hex or hexa strings. Each is named by its string. */
|
|
522
|
+
swatches?: readonly string[];
|
|
523
|
+
/**
|
|
524
|
+
* The format the value row starts in.
|
|
525
|
+
* @default "hex"
|
|
526
|
+
*/
|
|
527
|
+
defaultFormat?: ColorPickerFormat;
|
|
528
|
+
/**
|
|
529
|
+
* Gradient content (for instance a GradientEditor). When given, a paint-type bar offers
|
|
530
|
+
* Solid and Gradient, and this is shown instead of the solid controls while Gradient is on.
|
|
531
|
+
*/
|
|
532
|
+
gradient?: ReactNode;
|
|
533
|
+
/** The selected paint type, when you drive the bar. */
|
|
534
|
+
paintType?: ColorPickerPaintType;
|
|
535
|
+
/** Called when the reader picks a paint type. */
|
|
536
|
+
onPaintTypeChange?: (paintType: ColorPickerPaintType) => void;
|
|
537
|
+
/** Replace any of the English strings. */
|
|
538
|
+
labels?: Partial<ColorPickerPanelLabels>;
|
|
539
|
+
}
|
|
540
|
+
|
|
371
541
|
/**
|
|
372
|
-
* One stop of a gradient: a
|
|
542
|
+
* One stop of a gradient: a color, and where along the ramp it sits.
|
|
373
543
|
*
|
|
374
544
|
* Build these with `createColorStop` rather than writing the object by hand, so
|
|
375
545
|
* that the identifier is unique. The identifier is what React keys the stop by
|
|
@@ -381,10 +551,98 @@ export declare interface ColorStop {
|
|
|
381
551
|
id: string;
|
|
382
552
|
/** Where the stop sits along the ramp, from 0 at the start to 1 at the end. */
|
|
383
553
|
offset: number;
|
|
384
|
-
/** The stop's
|
|
554
|
+
/** The stop's color, as a hex string such as `#6366f1`. */
|
|
385
555
|
color: string;
|
|
386
556
|
}
|
|
387
557
|
|
|
558
|
+
declare const COLUMNS: readonly ["left", "center", "right"];
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* A combo field (design/figma-spec.md 6.3): a value you can type, with a chevron that opens a list
|
|
562
|
+
* of presets over the field, the current value sitting exactly on top of the field. Figma uses it
|
|
563
|
+
* for font size, auto-layout width and height ("Hug"), gap and export scale.
|
|
564
|
+
*
|
|
565
|
+
* Keyboard: typing edits the value and commits on Enter, Tab or blur; Control+ArrowDown (or
|
|
566
|
+
* Alt+ArrowDown) opens the list with the current value highlighted; ArrowUp / ArrowDown move,
|
|
567
|
+
* Home / End jump, Enter picks, Escape closes without a change and leaves focus in the field.
|
|
568
|
+
* With the list closed, ArrowUp / ArrowDown step a numeric value.
|
|
569
|
+
* @example
|
|
570
|
+
* ```tsx
|
|
571
|
+
* <ComboInput
|
|
572
|
+
* label="Font size"
|
|
573
|
+
* numeric
|
|
574
|
+
* value={size}
|
|
575
|
+
* onChange={(next) => { setSize(Number(next)); }}
|
|
576
|
+
* options={[10, 11, 12, 13, 14, 16, 24].map((n) => ({ value: String(n) }))}
|
|
577
|
+
* />
|
|
578
|
+
* ```
|
|
579
|
+
*/
|
|
580
|
+
export declare const ComboInput: default_2.ForwardRefExoticComponent<ComboInputProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
581
|
+
|
|
582
|
+
/** An entry in a ComboInput's list. */
|
|
583
|
+
export declare type ComboInputItem = ComboInputOption | ComboInputSeparator;
|
|
584
|
+
|
|
585
|
+
/** One choice in a ComboInput's list. */
|
|
586
|
+
export declare interface ComboInputOption {
|
|
587
|
+
/** What is committed when the choice is picked. */
|
|
588
|
+
value: string;
|
|
589
|
+
/** What the list shows; the value when absent. */
|
|
590
|
+
label?: string;
|
|
591
|
+
/** Shown but not selectable. */
|
|
592
|
+
disabled?: boolean;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/** Props for ComboInput. */
|
|
596
|
+
export declare interface ComboInputProps {
|
|
597
|
+
/** The field's accessible name ("Font size"). */
|
|
598
|
+
label: string;
|
|
599
|
+
/** The value, when you drive the field from your own state. */
|
|
600
|
+
value?: string | number;
|
|
601
|
+
/** The value the field starts with when it keeps its own state. */
|
|
602
|
+
defaultValue?: string | number;
|
|
603
|
+
/**
|
|
604
|
+
* Called once per commit: a choice from the list, Enter, Tab or blur after typing, an arrow
|
|
605
|
+
* step or the end of a scrub. A numeric field reports a number, a text field a string.
|
|
606
|
+
*/
|
|
607
|
+
onChange?: ChangeHandler<string | number>;
|
|
608
|
+
/** The list's entries: choices and separators. */
|
|
609
|
+
options: ComboInputItem[];
|
|
610
|
+
/**
|
|
611
|
+
* Whether the value is a number: typing evaluates arithmetic (`12*2`), ArrowUp / ArrowDown
|
|
612
|
+
* step it while the list is closed (Shift: ten steps), and a `glyph` slot scrubs it.
|
|
613
|
+
*/
|
|
614
|
+
numeric?: boolean;
|
|
615
|
+
/** The smallest number a numeric field accepts. */
|
|
616
|
+
min?: number;
|
|
617
|
+
/** The largest number a numeric field accepts. */
|
|
618
|
+
max?: number;
|
|
619
|
+
/** One arrow step of a numeric field. @default 1 */
|
|
620
|
+
step?: number;
|
|
621
|
+
/** A mode word shown right-aligned before the chevron, in the secondary ink ("Hug"). */
|
|
622
|
+
suffix?: string;
|
|
623
|
+
/** A 24px leading slot: a glyph or a letter. On a numeric field it is the scrub handle. */
|
|
624
|
+
glyph?: default_2.ReactNode;
|
|
625
|
+
/** Draws the chevron slot 25 wide with a 1px divider in the panel color (the font-size field). */
|
|
626
|
+
divided?: boolean;
|
|
627
|
+
/** The field's width. @default 88 (PANEL_GRID.FIELD) */
|
|
628
|
+
width?: number | string;
|
|
629
|
+
/** The field cannot be used. */
|
|
630
|
+
disabled?: boolean;
|
|
631
|
+
/** Text shown in an empty field. */
|
|
632
|
+
placeholder?: string;
|
|
633
|
+
/** The chevron button's accessible name. @default "Open list" */
|
|
634
|
+
openLabel?: string;
|
|
635
|
+
/** Extra class on the field's outer element. */
|
|
636
|
+
className?: string;
|
|
637
|
+
/** Extra style on the field's outer element. */
|
|
638
|
+
style?: default_2.CSSProperties;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/** A line between groups of choices. */
|
|
642
|
+
export declare interface ComboInputSeparator {
|
|
643
|
+
separator: true;
|
|
644
|
+
}
|
|
645
|
+
|
|
388
646
|
/**
|
|
389
647
|
* Compact theme sizing constants.
|
|
390
648
|
* These values represent the standard sizing used throughout the compact theme
|
|
@@ -413,66 +671,65 @@ export declare const COMPACT_SIZING: {
|
|
|
413
671
|
};
|
|
414
672
|
|
|
415
673
|
/**
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
*
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
674
|
+
* The accent palette, the theme's `primaryColor` (spec 3.3). Mantine reads shade 6 filled and
|
|
675
|
+
* 7 hover in light (#0d99ff / #007be5), 8 / 9 in dark (#0c8ce9 / #0a6dc2), and shade 4 as the
|
|
676
|
+
* dark-scheme anchor color (#7cc4f8, Figma's dark brand text).
|
|
677
|
+
*/
|
|
678
|
+
export declare const compactBrandColors: MantineColorsTuple;
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* A color in one paint field: the chit, the hex value and the opacity.
|
|
422
682
|
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
* either can be the reader's while the other is still the default.
|
|
683
|
+
* Pressing the chit opens the color picker in a pop-out (one at a time, docked to the start
|
|
684
|
+
* side of the panel); the hex box takes `RRGGBB` (or `RGB`) and commits on blur or Enter, and
|
|
685
|
+
* reverts on Escape; the opacity box commits on blur or Enter, steps with ArrowUp / ArrowDown
|
|
686
|
+
* (Shift for 10) and scrubs by dragging its "%".
|
|
428
687
|
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
*
|
|
688
|
+
* As in the other controls of this family, `undefined` means "the reader has chosen nothing
|
|
689
|
+
* here": the control shows the default in italics and offers no reset until something of the
|
|
690
|
+
* reader's own is set, and pressing the reset reports `undefined` again. Color and opacity are
|
|
691
|
+
* tracked separately, so either can be the reader's while the other is still the default.
|
|
692
|
+
* Typed opacity is read in the reader's own locale.
|
|
433
693
|
* @param props - Component props
|
|
434
|
-
* @param props.color - The
|
|
435
|
-
* @param props.defaultColor - The
|
|
694
|
+
* @param props.color - The color, when you drive the control from your own state
|
|
695
|
+
* @param props.defaultColor - The color shown while the reader has chosen none of their own
|
|
436
696
|
* @param props.opacity - The opacity as a percentage, when you drive the control from your own state
|
|
437
697
|
* @param props.defaultOpacity - The opacity shown while the reader has set none of their own
|
|
438
|
-
* @param props.onColorChange - Called with the new
|
|
698
|
+
* @param props.onColorChange - Called with the new color, or with `undefined` when the control is reset
|
|
439
699
|
* @param props.onOpacityChange - Called with the new opacity, or with `undefined` when the control is reset
|
|
440
|
-
* @param props.onChange - Called once per gesture with both halves of the
|
|
700
|
+
* @param props.onChange - Called once per gesture with both halves of the color, whichever of them moved
|
|
441
701
|
* @param props.label - The field's name, drawn above the control and used to name the group
|
|
442
|
-
* @param props.showOpacity - Whether to offer
|
|
702
|
+
* @param props.showOpacity - Whether to offer the opacity box
|
|
443
703
|
* @param props.disabled - Whether the control cannot be used at all
|
|
444
704
|
* @param props.disabledReason - One sentence saying why the control is off, drawn only while it is off
|
|
445
705
|
* @param props.onFocus - Called when the hex box or the opacity box takes focus
|
|
446
706
|
* @param props.onBlur - Called when the hex box or the opacity box loses focus
|
|
447
|
-
* @
|
|
707
|
+
* @param props.width - The field's width
|
|
708
|
+
* @param props.showReset - Whether to offer the reset button
|
|
709
|
+
* @returns The paint field, and its reset button when something has been set
|
|
448
710
|
* @example
|
|
449
711
|
* ```tsx
|
|
450
712
|
* const [fill, setFill] = useState<string | undefined>(undefined);
|
|
451
713
|
*
|
|
452
714
|
* <PopoutManager>
|
|
453
|
-
* <CompactColorInput
|
|
454
|
-
* label="Fill"
|
|
455
|
-
* color={fill}
|
|
456
|
-
* defaultColor="#5B8FF9"
|
|
457
|
-
* onColorChange={setFill}
|
|
458
|
-
* />
|
|
715
|
+
* <CompactColorInput label="Fill" color={fill} defaultColor="#5B8FF9" onColorChange={setFill} />
|
|
459
716
|
* </PopoutManager>
|
|
460
717
|
* ```
|
|
461
718
|
*/
|
|
462
|
-
export declare function CompactColorInput({ color, defaultColor, opacity, defaultOpacity, onColorChange, onOpacityChange, onChange, label, showOpacity, disabled, disabledReason, onFocus, onBlur, }: CompactColorInputProps): default_2.JSX.Element;
|
|
719
|
+
export declare function CompactColorInput({ color, defaultColor, opacity, defaultOpacity, onColorChange, onOpacityChange, onChange, label, showOpacity, disabled, disabledReason, onFocus, onBlur, width, showReset, }: CompactColorInputProps): default_2.JSX.Element;
|
|
463
720
|
|
|
464
721
|
/**
|
|
465
722
|
* Props for the CompactColorInput component.
|
|
466
723
|
*/
|
|
467
724
|
export declare interface CompactColorInputProps {
|
|
468
725
|
/**
|
|
469
|
-
* The
|
|
726
|
+
* The color, as `#RRGGBB`, when you drive the control from your own state.
|
|
470
727
|
*
|
|
471
|
-
* `undefined` does not mean "no
|
|
728
|
+
* `undefined` does not mean "no color" here: it means the reader has
|
|
472
729
|
* chosen none and the control is showing `defaultColor`.
|
|
473
730
|
*/
|
|
474
731
|
color?: string | undefined;
|
|
475
|
-
/** The
|
|
732
|
+
/** The color shown, in italics, while the reader has chosen none of their own. */
|
|
476
733
|
defaultColor: string;
|
|
477
734
|
/**
|
|
478
735
|
* The opacity as a percentage from 0 to 100, when you drive the control
|
|
@@ -487,10 +744,10 @@ export declare interface CompactColorInputProps {
|
|
|
487
744
|
*/
|
|
488
745
|
defaultOpacity?: number;
|
|
489
746
|
/**
|
|
490
|
-
* Called when the
|
|
747
|
+
* Called when the color changes, and with `undefined` when the control is
|
|
491
748
|
* reset to its default.
|
|
492
749
|
*
|
|
493
|
-
* The
|
|
750
|
+
* The color comes first, as `#RRGGBB` in upper case; the event that caused
|
|
494
751
|
* the change is second and is absent for a change made from the picker,
|
|
495
752
|
* which reports none.
|
|
496
753
|
*
|
|
@@ -507,7 +764,7 @@ export declare interface CompactColorInputProps {
|
|
|
507
764
|
*/
|
|
508
765
|
onOpacityChange?: ChangeHandler<number | undefined>;
|
|
509
766
|
/**
|
|
510
|
-
* Called once per gesture with BOTH halves of the
|
|
767
|
+
* Called once per gesture with BOTH halves of the color, whichever of them
|
|
511
768
|
* moved.
|
|
512
769
|
*
|
|
513
770
|
* Reach for this one, alone, whenever you drive the control from your own
|
|
@@ -515,17 +772,10 @@ export declare interface CompactColorInputProps {
|
|
|
515
772
|
* already use them, but they cannot carry a gesture that moves both halves
|
|
516
773
|
* at once.
|
|
517
774
|
*
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
* snapshot it has -- and both callbacks run against the SAME pre-gesture
|
|
523
|
-
* snapshot, so the second one writes a state rebuilt from a colour the
|
|
524
|
-
* first one had already replaced. A test in this package
|
|
525
|
-
* (tests/components/CompactColorInput.test.tsx, "the two separate callbacks
|
|
526
|
-
* cannot carry one gesture") drives a picker swatch and watches the second
|
|
527
|
-
* write arrive as `{opacity: 50}` with the new colour gone. The application
|
|
528
|
-
* had already forked this whole component to escape it.
|
|
775
|
+
* Why: a picker gesture can move the color and the opacity at once. With
|
|
776
|
+
* the two separate callbacks, both run against the same props, so a
|
|
777
|
+
* controlled consumer that rebuilds its state from those props in each one
|
|
778
|
+
* loses the color when the opacity write lands second.
|
|
529
779
|
*
|
|
530
780
|
* Both halves are always passed, so a consumer never has to remember which
|
|
531
781
|
* one moved -- the same shape `GradientEditor` already uses for its stops
|
|
@@ -551,12 +801,12 @@ export declare interface CompactColorInputProps {
|
|
|
551
801
|
* The field's name, drawn above the control and used to name the group the
|
|
552
802
|
* three controls sit in.
|
|
553
803
|
*
|
|
554
|
-
* Leave it out for a
|
|
804
|
+
* Leave it out for a color that is already named by what surrounds it,
|
|
555
805
|
* such as one stop of a gradient.
|
|
556
806
|
*/
|
|
557
807
|
label?: string;
|
|
558
808
|
/**
|
|
559
|
-
* Whether to offer an opacity box beside the
|
|
809
|
+
* Whether to offer an opacity box beside the color.
|
|
560
810
|
* @default true
|
|
561
811
|
*/
|
|
562
812
|
showOpacity?: boolean;
|
|
@@ -575,15 +825,13 @@ export declare interface CompactColorInputProps {
|
|
|
575
825
|
* is true.
|
|
576
826
|
*
|
|
577
827
|
* It is appended to the control's own name after a full stop and drawn as
|
|
578
|
-
* the tooltip -- "Glow
|
|
828
|
+
* the tooltip -- "Glow color. Glow is not drawn yet" -- and it also joins
|
|
579
829
|
* the accessible description of the swatch, the hex box and the opacity
|
|
580
830
|
* box, so the reason reaches a pointer user and a screen reader user alike.
|
|
581
831
|
* With no `label` to append to, the sentence stands on its own.
|
|
582
832
|
*
|
|
583
|
-
*
|
|
584
|
-
*
|
|
585
|
-
* learning why -- spec:6641 asks for the one reason to travel with the
|
|
586
|
-
* disabled ink, and until now this component had nowhere to put it.
|
|
833
|
+
* Write it as a whole sentence naming what would make the control usable
|
|
834
|
+
* again.
|
|
587
835
|
*/
|
|
588
836
|
disabledReason?: string;
|
|
589
837
|
/** Called when the hex box or the opacity box takes focus. Forwarded unchanged. */
|
|
@@ -595,14 +843,27 @@ export declare interface CompactColorInputProps {
|
|
|
595
843
|
* keep for this control inside the handler sees the new value.
|
|
596
844
|
*/
|
|
597
845
|
onBlur?: default_2.FocusEventHandler<HTMLInputElement>;
|
|
846
|
+
/**
|
|
847
|
+
* The field's width. Figma's paint field is 156 beside a row's eye and minus buttons and
|
|
848
|
+
* 184 on its own, which is the default here (the reset button sits in the trailing slot).
|
|
849
|
+
* Pass `"100%"` to fill a flex slot, as the gradient editor's stop rows do.
|
|
850
|
+
* @default 184
|
|
851
|
+
*/
|
|
852
|
+
width?: number | string;
|
|
853
|
+
/**
|
|
854
|
+
* Whether to offer the reset button once something is chosen.
|
|
855
|
+
* @default true
|
|
856
|
+
*/
|
|
857
|
+
showReset?: boolean;
|
|
598
858
|
}
|
|
599
859
|
|
|
600
860
|
/**
|
|
601
|
-
* Color configuration for the compact theme
|
|
602
|
-
*
|
|
861
|
+
* Color configuration for the compact theme: every Mantine color, the neutral `dark` ramp and
|
|
862
|
+
* the `brand` accent.
|
|
603
863
|
*/
|
|
604
864
|
export declare const compactColors: {
|
|
605
865
|
dark: MantineColorsTuple;
|
|
866
|
+
brand: MantineColorsTuple;
|
|
606
867
|
gray: MantineColorsTuple;
|
|
607
868
|
red: MantineColorsTuple;
|
|
608
869
|
pink: MantineColorsTuple;
|
|
@@ -619,16 +880,25 @@ export declare const compactColors: {
|
|
|
619
880
|
};
|
|
620
881
|
|
|
621
882
|
/**
|
|
622
|
-
*
|
|
883
|
+
* Mantine's `dark` ramp, re-pointed at Figma's neutral grays (spec 3.3), so an unthemed Mantine
|
|
884
|
+
* surface in the dark scheme matches the panels around it.
|
|
623
885
|
*
|
|
624
|
-
*
|
|
625
|
-
* -
|
|
626
|
-
* -
|
|
627
|
-
* -
|
|
628
|
-
* - 8
|
|
886
|
+
* - 0: text (#fff)
|
|
887
|
+
* - 5: hover (#444)
|
|
888
|
+
* - 6: default field (#383838)
|
|
889
|
+
* - 7: body / panel (#2c2c2c)
|
|
890
|
+
* - 8: menus and tooltips (#1e1e1e)
|
|
629
891
|
*/
|
|
630
892
|
export declare const compactDarkColors: MantineColorsTuple;
|
|
631
893
|
|
|
894
|
+
/**
|
|
895
|
+
* The whole stylesheet, for SSR or a shadow root. With `highContrast` the AA tokens are also
|
|
896
|
+
* applied unconditionally, so the result needs no `data-cm-contrast` attribute.
|
|
897
|
+
* @param options - the theme options
|
|
898
|
+
* @returns the CSS text
|
|
899
|
+
*/
|
|
900
|
+
export declare function compactGlobalCss(options?: CompactThemeOptions): string;
|
|
901
|
+
|
|
632
902
|
/**
|
|
633
903
|
* Every user-visible or assistive-technology-visible string this library
|
|
634
904
|
* produces.
|
|
@@ -738,13 +1008,13 @@ export declare interface CompactMantineLabels {
|
|
|
738
1008
|
* @returns The button's accessible name
|
|
739
1009
|
*/
|
|
740
1010
|
resetToDefault: (label: string) => string;
|
|
741
|
-
/** Accessible name of the swatch button that opens the
|
|
1011
|
+
/** Accessible name of the swatch button that opens the color picker. */
|
|
742
1012
|
colorSwatch: string;
|
|
743
|
-
/** Accessible name of the text box holding the
|
|
1013
|
+
/** Accessible name of the text box holding the color's hex value. */
|
|
744
1014
|
colorHexValue: string;
|
|
745
|
-
/** Accessible name of the number box holding the
|
|
1015
|
+
/** Accessible name of the number box holding the color's opacity percentage. */
|
|
746
1016
|
opacity: string;
|
|
747
|
-
/** Title of the
|
|
1017
|
+
/** Title of the color picker pop-out when the caller supplied no label. */
|
|
748
1018
|
colorPanelTitle: string;
|
|
749
1019
|
/**
|
|
750
1020
|
* Stands in for a missing control name inside a reset button's accessible
|
|
@@ -827,6 +1097,22 @@ export declare interface CompactMantineLabels {
|
|
|
827
1097
|
closePanel: string;
|
|
828
1098
|
/** Accessible name of a tabbed pop-out panel when its first tab has no label. */
|
|
829
1099
|
settings: string;
|
|
1100
|
+
/** Default accessible name of a `Toolbar` when the caller gives none. */
|
|
1101
|
+
toolbar: string;
|
|
1102
|
+
/** Default accessible name of a `NavRail`, the vertical navigation toolbar. */
|
|
1103
|
+
navigation: string;
|
|
1104
|
+
/** Accessible name and tooltip of the round `HelpButton`. */
|
|
1105
|
+
help: string;
|
|
1106
|
+
/** Accessible name of the `ShortcutSheet` and of its tab list. */
|
|
1107
|
+
keyboardShortcuts: string;
|
|
1108
|
+
/** Accessible name of the close button in the `ShortcutSheet`'s tab strip. */
|
|
1109
|
+
close: string;
|
|
1110
|
+
/** Accessible name of the `QuickActions` dialog. */
|
|
1111
|
+
quickActions: string;
|
|
1112
|
+
/** Placeholder and accessible name of the `QuickActions` search field. */
|
|
1113
|
+
searchActions: string;
|
|
1114
|
+
/** Shown in `QuickActions` when nothing matches the search. */
|
|
1115
|
+
noResults: string;
|
|
830
1116
|
/**
|
|
831
1117
|
* Accessible name of the eye button inside a password field that shows or
|
|
832
1118
|
* hides what was typed. One name in both states: the button reports whether
|
|
@@ -850,25 +1136,9 @@ export declare interface CompactMantineLabels {
|
|
|
850
1136
|
}
|
|
851
1137
|
|
|
852
1138
|
/**
|
|
853
|
-
*
|
|
854
|
-
*
|
|
855
|
-
* This is a complete theme merged with DEFAULT_THEME, suitable for:
|
|
856
|
-
* - Direct use with MantineProvider
|
|
857
|
-
* - Merging with other themes using mergeMantineTheme()
|
|
858
|
-
*
|
|
859
|
-
* All components default to size="sm" automatically with compact styling:
|
|
860
|
-
* - Input height: 24px
|
|
861
|
-
* - Font size: 11px
|
|
862
|
-
* - Borderless at rest, with a visible focus indicator on keyboard focus
|
|
863
|
-
* - Semantic color backgrounds
|
|
864
|
-
*
|
|
865
|
-
* Global token overrides:
|
|
866
|
-
* - fontSizes: Smaller font sizes (xs: 10px, sm: 11px, md: 13px, lg: 14px, xl: 16px)
|
|
867
|
-
* - spacing: Tighter spacing (xs: 4px, sm: 6px, md: 8px, lg: 12px, xl: 16px)
|
|
868
|
-
* - radius: Compact corner radii (xs: 2px, sm: 4px, md: 6px, lg: 8px, xl: 12px)
|
|
1139
|
+
* The full Mantine theme at Figma defaults, merged with DEFAULT_THEME.
|
|
869
1140
|
* @example
|
|
870
1141
|
* ```tsx
|
|
871
|
-
* // Simple usage - direct with MantineProvider
|
|
872
1142
|
* import { MantineProvider } from '@mantine/core';
|
|
873
1143
|
* import { compactTheme } from '@graphty/compact-mantine';
|
|
874
1144
|
*
|
|
@@ -876,33 +1146,25 @@ export declare interface CompactMantineLabels {
|
|
|
876
1146
|
* <App />
|
|
877
1147
|
* </MantineProvider>
|
|
878
1148
|
* ```
|
|
879
|
-
* @example
|
|
880
|
-
* ```tsx
|
|
881
|
-
* // Extending the theme with mergeMantineTheme
|
|
882
|
-
* import { mergeMantineTheme, createTheme } from '@mantine/core';
|
|
883
|
-
* import { compactTheme } from '@graphty/compact-mantine';
|
|
884
|
-
*
|
|
885
|
-
* const myTheme = mergeMantineTheme(compactTheme, createTheme({
|
|
886
|
-
* primaryColor: 'teal',
|
|
887
|
-
* }));
|
|
888
|
-
*
|
|
889
|
-
* <MantineProvider theme={myTheme}>
|
|
890
|
-
* <App />
|
|
891
|
-
* </MantineProvider>
|
|
892
|
-
* ```
|
|
893
1149
|
*/
|
|
894
1150
|
export declare const compactTheme: MantineTheme;
|
|
895
1151
|
|
|
1152
|
+
/** The options the theme and its stylesheet take. */
|
|
1153
|
+
export declare interface CompactThemeOptions {
|
|
1154
|
+
/**
|
|
1155
|
+
* Apply the WCAG 2.2 AA token set (spec 2.9). Default false: exact Figma.
|
|
1156
|
+
*/
|
|
1157
|
+
highContrast?: boolean;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
896
1160
|
/**
|
|
897
|
-
*
|
|
898
|
-
*
|
|
899
|
-
* This is the raw theme override created with createTheme().
|
|
900
|
-
* Use this if you need to merge with other theme overrides using mergeThemeOverrides().
|
|
1161
|
+
* The compact theme override at Figma defaults: `createCompactTheme()`.
|
|
901
1162
|
*
|
|
902
|
-
*
|
|
1163
|
+
* Use this to merge with other overrides (`mergeThemeOverrides`); for most uses pass
|
|
1164
|
+
* `compactTheme` to `MantineProvider` instead.
|
|
903
1165
|
*/
|
|
904
1166
|
export declare const compactThemeOverride: {
|
|
905
|
-
focusRing?: "
|
|
1167
|
+
focusRing?: "never" | "auto" | "always" | undefined;
|
|
906
1168
|
scale?: number | undefined;
|
|
907
1169
|
fontSmoothing?: boolean | undefined;
|
|
908
1170
|
white?: string | undefined;
|
|
@@ -973,8 +1235,8 @@ export declare const compactThemeOverride: {
|
|
|
973
1235
|
} | undefined;
|
|
974
1236
|
radius?: {
|
|
975
1237
|
[x: string & {}]: string | undefined;
|
|
976
|
-
sm?: string | undefined;
|
|
977
1238
|
xs?: string | undefined;
|
|
1239
|
+
sm?: string | undefined;
|
|
978
1240
|
md?: string | undefined;
|
|
979
1241
|
lg?: string | undefined;
|
|
980
1242
|
xl?: string | undefined;
|
|
@@ -983,40 +1245,40 @@ export declare const compactThemeOverride: {
|
|
|
983
1245
|
spacing?: {
|
|
984
1246
|
[x: number]: string | undefined;
|
|
985
1247
|
[x: string & {}]: string | undefined;
|
|
986
|
-
sm?: string | undefined;
|
|
987
1248
|
xs?: string | undefined;
|
|
1249
|
+
sm?: string | undefined;
|
|
988
1250
|
md?: string | undefined;
|
|
989
1251
|
lg?: string | undefined;
|
|
990
1252
|
xl?: string | undefined;
|
|
991
1253
|
} | undefined;
|
|
992
1254
|
fontSizes?: {
|
|
993
1255
|
[x: string & {}]: string | undefined;
|
|
994
|
-
sm?: string | undefined;
|
|
995
1256
|
xs?: string | undefined;
|
|
1257
|
+
sm?: string | undefined;
|
|
996
1258
|
md?: string | undefined;
|
|
997
1259
|
lg?: string | undefined;
|
|
998
1260
|
xl?: string | undefined;
|
|
999
1261
|
} | undefined;
|
|
1000
1262
|
lineHeights?: {
|
|
1001
1263
|
[x: string & {}]: string | undefined;
|
|
1002
|
-
sm?: string | undefined;
|
|
1003
1264
|
xs?: string | undefined;
|
|
1265
|
+
sm?: string | undefined;
|
|
1004
1266
|
md?: string | undefined;
|
|
1005
1267
|
lg?: string | undefined;
|
|
1006
1268
|
xl?: string | undefined;
|
|
1007
1269
|
} | undefined;
|
|
1008
1270
|
breakpoints?: {
|
|
1009
1271
|
[x: string & {}]: string | undefined;
|
|
1010
|
-
sm?: string | undefined;
|
|
1011
1272
|
xs?: string | undefined;
|
|
1273
|
+
sm?: string | undefined;
|
|
1012
1274
|
md?: string | undefined;
|
|
1013
1275
|
lg?: string | undefined;
|
|
1014
1276
|
xl?: string | undefined;
|
|
1015
1277
|
} | undefined;
|
|
1016
1278
|
shadows?: {
|
|
1017
1279
|
[x: string & {}]: string | undefined;
|
|
1018
|
-
sm?: string | undefined;
|
|
1019
1280
|
xs?: string | undefined;
|
|
1281
|
+
sm?: string | undefined;
|
|
1020
1282
|
md?: string | undefined;
|
|
1021
1283
|
lg?: string | undefined;
|
|
1022
1284
|
xl?: string | undefined;
|
|
@@ -1041,30 +1303,38 @@ export declare const compactThemeOverride: {
|
|
|
1041
1303
|
other?: {
|
|
1042
1304
|
[x: string]: any;
|
|
1043
1305
|
panelGrid?: {
|
|
1044
|
-
readonly WIDTH?:
|
|
1306
|
+
readonly WIDTH?: 240 | undefined;
|
|
1045
1307
|
readonly PAD_LEFT?: 16 | undefined;
|
|
1046
1308
|
readonly PAD_RIGHT?: 8 | undefined;
|
|
1047
|
-
readonly CONTENT?:
|
|
1048
|
-
readonly BODY?:
|
|
1049
|
-
readonly FIELD?:
|
|
1309
|
+
readonly CONTENT?: 216 | undefined;
|
|
1310
|
+
readonly BODY?: 184 | undefined;
|
|
1311
|
+
readonly FIELD?: 88 | undefined;
|
|
1050
1312
|
readonly GUTTER?: 8 | undefined;
|
|
1051
1313
|
readonly TRAIL_GAP?: 8 | undefined;
|
|
1052
1314
|
readonly TRAIL?: 24 | undefined;
|
|
1053
|
-
readonly TRIPLE?:
|
|
1054
|
-
readonly TRIPLE_GAP?:
|
|
1315
|
+
readonly TRIPLE?: number | undefined;
|
|
1316
|
+
readonly TRIPLE_GAP?: 0 | undefined;
|
|
1055
1317
|
readonly CONTROL_HEIGHT?: 24 | undefined;
|
|
1056
1318
|
readonly ROW_PITCH?: 32 | undefined;
|
|
1057
|
-
readonly TOGGLE_PITCH?:
|
|
1058
|
-
readonly DATA_PITCH?:
|
|
1059
|
-
readonly SECTION_HEADER?:
|
|
1060
|
-
readonly SECTION_PAD_BOTTOM?:
|
|
1061
|
-
readonly GLYPH_SLOT?:
|
|
1062
|
-
readonly GLYPH?:
|
|
1063
|
-
readonly CHEVRON?:
|
|
1319
|
+
readonly TOGGLE_PITCH?: 32 | undefined;
|
|
1320
|
+
readonly DATA_PITCH?: 32 | undefined;
|
|
1321
|
+
readonly SECTION_HEADER?: 40 | undefined;
|
|
1322
|
+
readonly SECTION_PAD_BOTTOM?: 12 | undefined;
|
|
1323
|
+
readonly GLYPH_SLOT?: 24 | undefined;
|
|
1324
|
+
readonly GLYPH?: 12 | undefined;
|
|
1325
|
+
readonly CHEVRON?: 10 | undefined;
|
|
1064
1326
|
readonly VALUE_INSET?: 24 | undefined;
|
|
1065
1327
|
readonly SPARKLINE_HEIGHT?: 32 | undefined;
|
|
1066
1328
|
readonly HISTOGRAM_HEIGHT?: 64 | undefined;
|
|
1067
|
-
readonly LABEL_COLUMN?:
|
|
1329
|
+
readonly LABEL_COLUMN?: 72 | undefined;
|
|
1330
|
+
readonly FIELD_ROW?: 48 | undefined;
|
|
1331
|
+
readonly CAPTION_ROW?: 50 | undefined;
|
|
1332
|
+
readonly LEGEND?: 16 | undefined;
|
|
1333
|
+
readonly POPOVER_WIDTH?: 240 | undefined;
|
|
1334
|
+
readonly POPOVER_HEADER?: 40 | undefined;
|
|
1335
|
+
} | undefined;
|
|
1336
|
+
compact?: {
|
|
1337
|
+
highContrast?: boolean | undefined;
|
|
1068
1338
|
} | undefined;
|
|
1069
1339
|
} | undefined;
|
|
1070
1340
|
};
|
|
@@ -1073,14 +1343,14 @@ export declare const compactThemeOverride: {
|
|
|
1073
1343
|
* Two or three values that belong to one thing, in a single box divided by
|
|
1074
1344
|
* hairlines.
|
|
1075
1345
|
*
|
|
1076
|
-
* A
|
|
1077
|
-
* settings. Drawing them in one box, split by a one-pixel divider in the
|
|
1346
|
+
* A color and its opacity are one setting seen two ways rather than two
|
|
1347
|
+
* settings. Drawing them in one box, split by a one-pixel divider in the color
|
|
1078
1348
|
* of the panel behind it, says exactly that; drawing them in two boxes with a
|
|
1079
1349
|
* gap between them says the opposite. The divider is a hairline and not a
|
|
1080
1350
|
* gutter on purpose, because a gutter reads as two separate controls.
|
|
1081
1351
|
*
|
|
1082
1352
|
* **The rule people break.** Never put two unrelated values in one box. The
|
|
1083
|
-
* test is whether the box has one honest name: "Node
|
|
1353
|
+
* test is whether the box has one honest name: "Node color and opacity" is one
|
|
1084
1354
|
* thing seen two ways, so it belongs here; "Node size and edge width" is two
|
|
1085
1355
|
* things that happen to be adjacent, so it belongs in a `FieldRow` pair -- two
|
|
1086
1356
|
* fields, two boxes, two glyphs. A compound row is a claim about the data, and
|
|
@@ -1110,11 +1380,11 @@ export declare const compactThemeOverride: {
|
|
|
1110
1380
|
* When the "show labels on controls" preference is on -- see
|
|
1111
1381
|
* `PanelLabelsProvider` -- the row's one name moves out to a column of its own
|
|
1112
1382
|
* beside the box, and the box fills the rest of the row. The segments are never
|
|
1113
|
-
*
|
|
1383
|
+
* labeled individually, because they are not individually named things.
|
|
1114
1384
|
* @param props - Component props
|
|
1115
1385
|
* @param props.label - Names the one thing the segments belong to; becomes the box's tooltip and part of its accessible name
|
|
1116
1386
|
* @param props.segments - Two or three values that belong to one thing
|
|
1117
|
-
* @param props.width - The width of the box in pixels:
|
|
1387
|
+
* @param props.width - The width of the box in pixels: 184 to fill the row, 88 for half of one
|
|
1118
1388
|
* @param props.trailing - The 24px trailing control: an advanced settings button, a reset, or nothing
|
|
1119
1389
|
* @param props.busy - Whether the row's values are still being worked out by something that finishes later
|
|
1120
1390
|
* @param props.live - How urgently a screen reader announces the row when it changes on its own
|
|
@@ -1125,9 +1395,9 @@ export declare const compactThemeOverride: {
|
|
|
1125
1395
|
* @example
|
|
1126
1396
|
* ```tsx
|
|
1127
1397
|
* <CompoundRow
|
|
1128
|
-
* label="Node
|
|
1398
|
+
* label="Node color and opacity"
|
|
1129
1399
|
* segments={[
|
|
1130
|
-
* {glyph: <Swatch
|
|
1400
|
+
* {glyph: <Swatch color="#4a7ee8" />, value: "4A7EE8", mono: true, grow: true},
|
|
1131
1401
|
* {value: percentFormatter.format(1), unit: "%"},
|
|
1132
1402
|
* ]}
|
|
1133
1403
|
* onClick={() => { setEditorOpen(true); }}
|
|
@@ -1147,8 +1417,8 @@ export declare interface CompoundRowProps {
|
|
|
1147
1417
|
/**
|
|
1148
1418
|
* The width of the box in pixels.
|
|
1149
1419
|
*
|
|
1150
|
-
* `PANEL_GRID.BODY` (
|
|
1151
|
-
* trailing control; `PANEL_GRID.FIELD` (
|
|
1420
|
+
* `PANEL_GRID.BODY` (184) fills the row and still leaves room for the
|
|
1421
|
+
* trailing control; `PANEL_GRID.FIELD` (88) is half a row, for a box that
|
|
1152
1422
|
* sits beside another control. Ignored while the "show labels on controls"
|
|
1153
1423
|
* preference is on, when the box fills whatever the label column leaves.
|
|
1154
1424
|
*/
|
|
@@ -1196,9 +1466,9 @@ export declare interface CompoundRowProps {
|
|
|
1196
1466
|
* @example
|
|
1197
1467
|
* ```tsx
|
|
1198
1468
|
* <CompoundRow
|
|
1199
|
-
* label="Node
|
|
1469
|
+
* label="Node color and opacity"
|
|
1200
1470
|
* segments={segments}
|
|
1201
|
-
* onClick={(event) => {
|
|
1471
|
+
* onClick={(event) => { openColorEditor({addToSelection: event.shiftKey}); }}
|
|
1202
1472
|
* />
|
|
1203
1473
|
* ```
|
|
1204
1474
|
*/
|
|
@@ -1214,8 +1484,8 @@ export declare interface CompoundRowProps {
|
|
|
1214
1484
|
*/
|
|
1215
1485
|
export declare interface CompoundSegment {
|
|
1216
1486
|
/**
|
|
1217
|
-
* A glyph name, a single capital letter, or your own node -- a
|
|
1218
|
-
* swatch, say -- drawn in this segment's leading
|
|
1487
|
+
* A glyph name, a single capital letter, or your own node -- a color
|
|
1488
|
+
* swatch, say -- drawn in this segment's leading 24px slot.
|
|
1219
1489
|
*
|
|
1220
1490
|
* A plain string is deliberately not accepted: a loose word in the slot
|
|
1221
1491
|
* would be a label smuggled into a space meant for a drawing. A segment
|
|
@@ -1248,48 +1518,86 @@ export declare interface CompoundSegment {
|
|
|
1248
1518
|
fullValue?: string;
|
|
1249
1519
|
/** Dimmed suffix drawn immediately after the value, inside the same segment, such as a percent sign. */
|
|
1250
1520
|
unit?: string;
|
|
1251
|
-
/** Draw the value in the monospace face. For hex
|
|
1521
|
+
/** Draw the value in the monospace face. For hex colors, identifiers and anything read character by character. */
|
|
1252
1522
|
mono?: boolean;
|
|
1253
1523
|
/** This segment takes the box's remaining width. Exactly one segment should set it, and it should be the main value. */
|
|
1254
1524
|
grow?: boolean;
|
|
1255
1525
|
}
|
|
1256
1526
|
|
|
1257
1527
|
/**
|
|
1258
|
-
* A
|
|
1528
|
+
* A dark menu opened at the pointer by a right-click (design/figma-spec.md 8.2):
|
|
1529
|
+
* its top-left corner 3px right of and 5px above the pointer, flipping and
|
|
1530
|
+
* shifting to stay on screen, with the first enabled row highlighted so Enter
|
|
1531
|
+
* acts on it at once. It also opens from the keyboard (Shift+F10, the
|
|
1532
|
+
* ContextMenu key) at the focused element. Escape, a click outside or choosing a
|
|
1533
|
+
* row closes it and returns focus to where it was.
|
|
1534
|
+
* @param props - Component props
|
|
1535
|
+
* @param props.target - The element that opens the menu
|
|
1536
|
+
* @param props.children - The menu's rows
|
|
1537
|
+
* @param props.onChange - Called when the menu opens or closes
|
|
1538
|
+
* @returns The target, with the menu attached
|
|
1539
|
+
* @example
|
|
1540
|
+
* ```tsx
|
|
1541
|
+
* <ContextMenu target={<div className="canvas" tabIndex={0} />}>
|
|
1542
|
+
* <Menu.Item rightSection="Ctrl+C">Copy</Menu.Item>
|
|
1543
|
+
* <Menu.Item rightSection="Ctrl+V">Paste here</Menu.Item>
|
|
1544
|
+
* <Menu.Divider />
|
|
1545
|
+
* <Menu.Item color="red">Delete</Menu.Item>
|
|
1546
|
+
* </ContextMenu>
|
|
1547
|
+
* ```
|
|
1548
|
+
*/
|
|
1549
|
+
export declare function ContextMenu({ target, children, onChange, ...menuProps }: ContextMenuProps): JSX.Element;
|
|
1550
|
+
|
|
1551
|
+
/**
|
|
1552
|
+
* Props for ContextMenu: the target, the rows, and any Mantine `Menu` prop
|
|
1553
|
+
* except those that place and open it, which the context menu owns.
|
|
1554
|
+
*/
|
|
1555
|
+
export declare interface ContextMenuProps extends Omit<MenuProps, "children" | "opened" | "defaultOpened" | "position" | "offset" | "trigger"> {
|
|
1556
|
+
/**
|
|
1557
|
+
* The element that opens the menu when it is right-clicked, or when it (or
|
|
1558
|
+
* something inside it) has focus and Shift+F10 or the ContextMenu key is
|
|
1559
|
+
* pressed. One element that accepts `onContextMenu` and `onKeyDown`.
|
|
1560
|
+
*/
|
|
1561
|
+
target: ReactElement<{
|
|
1562
|
+
onContextMenu?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
1563
|
+
onKeyDown?: (event: KeyboardEvent_2<HTMLElement>) => void;
|
|
1564
|
+
}>;
|
|
1565
|
+
/** The menu's rows: `Menu.Item`, `Menu.Label`, `Menu.Divider`, `Menu.Sub`, `MenuCheckItem`. */
|
|
1566
|
+
children: ReactNode;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
/**
|
|
1570
|
+
* A labeled group of controls: a 16px legend band carrying the group's name
|
|
1571
|
+
* as a small caption, then the rows.
|
|
1259
1572
|
*
|
|
1260
|
-
* The group is always open
|
|
1261
|
-
*
|
|
1262
|
-
* the whole difference between this and `ControlSection`, and it is the
|
|
1263
|
-
* question to ask when choosing between them:
|
|
1573
|
+
* The group is always open. That is the whole difference between this and
|
|
1574
|
+
* `ControlSection`, and it is the question to ask when choosing between them:
|
|
1264
1575
|
*
|
|
1265
|
-
* - Reach for `ControlSection`
|
|
1266
|
-
*
|
|
1267
|
-
*
|
|
1268
|
-
*
|
|
1269
|
-
* - Reach for `ControlGroup` when the controls must stay visible, or when the
|
|
1270
|
-
* group is nested inside a container that already supplies its own padding.
|
|
1271
|
-
* `bleed` exists for exactly that case and `ControlSection` has no
|
|
1272
|
-
* equivalent.
|
|
1576
|
+
* - Reach for `ControlSection` for a subject of the panel, with a 40px header,
|
|
1577
|
+
* a rule below and, where it collapses, a chevron.
|
|
1578
|
+
* - Reach for `ControlGroup` for a named cluster of rows inside a section --
|
|
1579
|
+
* Figma's "Alignment" or "Position" legends -- or inside a pop-out.
|
|
1273
1580
|
*
|
|
1274
|
-
*
|
|
1275
|
-
*
|
|
1276
|
-
*
|
|
1277
|
-
*
|
|
1581
|
+
* A field row under a legend comes out at Figma's 48px: the 16px band, then the
|
|
1582
|
+
* 32px row with its 24px control centered. The legend shortens with an ellipsis
|
|
1583
|
+
* when the container is narrow, header buttons stay pinned to its end, and
|
|
1584
|
+
* everything is laid out in inline terms so the group mirrors right to left.
|
|
1278
1585
|
* @param props - Component props
|
|
1279
1586
|
* @param props.label - The group's name, which is also its accessible name
|
|
1280
|
-
* @param props.actions - Buttons drawn at the end of the
|
|
1587
|
+
* @param props.actions - Buttons drawn at the end of the legend band
|
|
1281
1588
|
* @param props.children - The controls the group holds
|
|
1282
|
-
* @param props.bleed - Run the rule out to the edges of a padded container
|
|
1283
1589
|
* @returns The control group
|
|
1284
1590
|
* @example
|
|
1285
1591
|
* ```tsx
|
|
1286
|
-
* <ControlGroup label="
|
|
1287
|
-
* <
|
|
1288
|
-
*
|
|
1592
|
+
* <ControlGroup label="Position">
|
|
1593
|
+
* <FieldRow>
|
|
1594
|
+
* <PanelField label="X" glyph="X" value="100" />
|
|
1595
|
+
* <PanelField label="Y" glyph="Y" value="40" />
|
|
1596
|
+
* </FieldRow>
|
|
1289
1597
|
* </ControlGroup>
|
|
1290
1598
|
* ```
|
|
1291
1599
|
*/
|
|
1292
|
-
export declare function ControlGroup({ label, actions, children
|
|
1600
|
+
export declare function ControlGroup({ label, actions, children }: ControlGroupProps): default_2.JSX.Element;
|
|
1293
1601
|
|
|
1294
1602
|
/**
|
|
1295
1603
|
* Props for the ControlGroup component.
|
|
@@ -1312,14 +1620,10 @@ export declare interface ControlGroupProps {
|
|
|
1312
1620
|
/** The controls the group holds, stacked in the order you write them. */
|
|
1313
1621
|
children: default_2.ReactNode;
|
|
1314
1622
|
/**
|
|
1315
|
-
*
|
|
1316
|
-
*
|
|
1317
|
-
*
|
|
1318
|
-
*
|
|
1319
|
-
* padding -- a pop-out panel, or a sidebar -- and you want the rule to read
|
|
1320
|
-
* as a divider across the whole panel rather than as a line floating
|
|
1321
|
-
* inside it. It is drawn with a negative inline margin, so it follows the
|
|
1322
|
-
* text direction with no further work.
|
|
1623
|
+
* Kept so existing callers compile. The group no longer draws a rule (Figma
|
|
1624
|
+
* does not divide groups inside a section), so there is nothing to bleed and
|
|
1625
|
+
* the prop has no effect.
|
|
1626
|
+
* @deprecated no effect since the Figma restyle
|
|
1323
1627
|
*/
|
|
1324
1628
|
bleed?: boolean;
|
|
1325
1629
|
}
|
|
@@ -1327,33 +1631,35 @@ export declare interface ControlGroupProps {
|
|
|
1327
1631
|
/**
|
|
1328
1632
|
* A named, collapsible group of controls for a dense property panel.
|
|
1329
1633
|
*
|
|
1330
|
-
* A section is drawn as a
|
|
1331
|
-
*
|
|
1634
|
+
* A section is drawn as a 40px header carrying the section's name, the rows it
|
|
1635
|
+
* holds, 12px of padding beneath them, and a 1px rule below. Naming the group once in
|
|
1332
1636
|
* the header is what lets the rows inside it spend their width on values rather
|
|
1333
1637
|
* than on labels and buttons of their own.
|
|
1334
1638
|
*
|
|
1335
1639
|
* **A section always expands**, and three rules follow from that:
|
|
1336
1640
|
*
|
|
1337
1641
|
* 1. The chevron is drawn only when there is something to expand. An `empty`
|
|
1338
|
-
* section has no chevron at all
|
|
1339
|
-
*
|
|
1642
|
+
* section has no chevron at all and its trailing slot carries one "+".
|
|
1643
|
+
* Hovering its header brings the name, and the "+", up to the primary
|
|
1644
|
+
* ink; clicking the name adds, like the "+".
|
|
1340
1645
|
* 2. In development it warns when it is given neither children nor `empty`,
|
|
1341
1646
|
* because a header that opens onto nothing is a dead end for the reader.
|
|
1342
1647
|
* 3. There is no way to put the section's own content behind a pop-out. An
|
|
1343
1648
|
* advanced settings button belongs in `actions`, beside the rows rather than
|
|
1344
1649
|
* instead of them.
|
|
1345
1650
|
*
|
|
1346
|
-
* The name is drawn in the primary text
|
|
1347
|
-
* something and in the secondary
|
|
1651
|
+
* The name is drawn in the primary text color when the section holds
|
|
1652
|
+
* something and in the secondary color when it is `empty`. That dimming is the
|
|
1348
1653
|
* whole empty state -- no "Not set", no "None", no sentence -- so a column of
|
|
1349
1654
|
* dim section names reads as an inventory of what has not been set up yet. It
|
|
1350
1655
|
* is never the only signal: an empty section also loses its chevron and gains a
|
|
1351
|
-
* "+", so nothing about the state depends on telling two
|
|
1656
|
+
* "+", so nothing about the state depends on telling two grays apart.
|
|
1352
1657
|
*
|
|
1353
1658
|
* The section draws the panel's own horizontal padding, 16px at the leading
|
|
1354
|
-
* edge and 8px at the trailing edge, so a section dropped straight into a
|
|
1659
|
+
* edge and 8px at the trailing edge, so a section dropped straight into a 240px
|
|
1355
1660
|
* panel lands its header and its rows on the same grid the rows expect. The
|
|
1356
|
-
*
|
|
1661
|
+
* chevron sits in the 16px gutter before the name. The padding follows the
|
|
1662
|
+
* text direction, and so does the chevron -- a collapsed
|
|
1357
1663
|
* section points towards the left in a right-to-left interface -- so the
|
|
1358
1664
|
* section is correct in either direction with nothing to configure.
|
|
1359
1665
|
* @param props - Component props
|
|
@@ -1368,6 +1674,7 @@ export declare interface ControlGroupProps {
|
|
|
1368
1674
|
* @param props.info - An explanation, put behind a circled "i" and used as the section's accessible description
|
|
1369
1675
|
* @param props.actions - The section's own buttons, drawn at the end of the header
|
|
1370
1676
|
* @param props.children - The rows the section holds
|
|
1677
|
+
* @param props.collapsible - Whether the section folds away behind a chevron, defaulting to true
|
|
1371
1678
|
* @returns The section, its header and its rows
|
|
1372
1679
|
* @example
|
|
1373
1680
|
* ```tsx
|
|
@@ -1417,12 +1724,12 @@ export declare interface ControlSectionProps extends DisclosureProps {
|
|
|
1417
1724
|
* Whether the section is set up at all.
|
|
1418
1725
|
*
|
|
1419
1726
|
* An empty section is drawn as one 32px row: the name in the secondary text
|
|
1420
|
-
*
|
|
1727
|
+
* color, no chevron, and a single "+" in the trailing slot. It shows no
|
|
1421
1728
|
* content and no empty-state sentence, and its children are not rendered.
|
|
1422
1729
|
*
|
|
1423
1730
|
* The dimmed name is never the only thing that says so. The chevron is
|
|
1424
1731
|
* gone, the "+" is there, and the group holds nothing, so the state still
|
|
1425
|
-
* reads for someone who cannot tell the two text
|
|
1732
|
+
* reads for someone who cannot tell the two text colors apart. Give
|
|
1426
1733
|
* `onAdd` whenever a section can be empty: its "Add ..." button is what
|
|
1427
1734
|
* states the section is waiting to be set up, in words, to a screen reader.
|
|
1428
1735
|
*/
|
|
@@ -1460,23 +1767,30 @@ export declare interface ControlSectionProps extends DisclosureProps {
|
|
|
1460
1767
|
actions?: default_2.ReactNode;
|
|
1461
1768
|
/** The rows the section holds: the controls commonly adjusted for its subject. */
|
|
1462
1769
|
children?: default_2.ReactNode;
|
|
1770
|
+
/**
|
|
1771
|
+
* Whether the section folds away behind a chevron in the left gutter.
|
|
1772
|
+
*
|
|
1773
|
+
* Figma collapses only a few sections (Export, Styles); most are shown or hidden as a whole
|
|
1774
|
+
* by the app. Set it to false for a section that is always open: no chevron, no toggle
|
|
1775
|
+
* button, and its rows are always on screen.
|
|
1776
|
+
* @default true
|
|
1777
|
+
*/
|
|
1778
|
+
collapsible?: boolean;
|
|
1463
1779
|
}
|
|
1464
1780
|
|
|
1465
1781
|
/**
|
|
1466
1782
|
* A collapsible sub-group of controls, lighter than a section.
|
|
1467
1783
|
*
|
|
1468
|
-
*
|
|
1469
|
-
*
|
|
1470
|
-
*
|
|
1471
|
-
*
|
|
1472
|
-
*
|
|
1473
|
-
*
|
|
1784
|
+
* Prefer an `AdvancedButton` that opens a pop-out: that is how Figma keeps rare
|
|
1785
|
+
* settings off the panel. Where a fold inside the section is still wanted, this
|
|
1786
|
+
* draws it the Figma way: a 32px row whose chevron hangs in the 16px gutter to
|
|
1787
|
+
* the left of the section's content edge, and a label in the secondary text
|
|
1788
|
+
* color that comes up to the primary one under the pointer. The content opens
|
|
1789
|
+
* in one frame, on the same grid as the rows around it.
|
|
1474
1790
|
*
|
|
1475
1791
|
* The header is one button carrying the open state, and the controls it reveals
|
|
1476
|
-
* are a
|
|
1477
|
-
*
|
|
1478
|
-
* while it is closed and animates open, and nothing inside a closed sub-group
|
|
1479
|
-
* can be reached by Tab.
|
|
1792
|
+
* are a labeled region that the button points at. Nothing inside a closed
|
|
1793
|
+
* sub-group can be reached by Tab.
|
|
1480
1794
|
*
|
|
1481
1795
|
* Drive it from your own state with `opened` and `onOpenChange`, or leave both
|
|
1482
1796
|
* out and let it remember its own with `defaultOpened`.
|
|
@@ -1527,6 +1841,23 @@ export declare interface ControlSubGroupProps extends DisclosureProps {
|
|
|
1527
1841
|
*/
|
|
1528
1842
|
export declare function createColorStop(offset: number, color: string): ColorStop;
|
|
1529
1843
|
|
|
1844
|
+
/**
|
|
1845
|
+
* Create the compact theme: Figma's editor look in both color schemes, or with
|
|
1846
|
+
* `highContrast: true` the WCAG 2.2 AA token set (design/figma-spec.md 2.9).
|
|
1847
|
+
*
|
|
1848
|
+
* Light and dark are Mantine's own color scheme (`defaultColorScheme`, `forceColorScheme`,
|
|
1849
|
+
* `useMantineColorScheme`); one theme object serves both.
|
|
1850
|
+
* @param options - `highContrast` switches on the AA tokens
|
|
1851
|
+
* @returns a theme override for `MantineProvider`
|
|
1852
|
+
* @example
|
|
1853
|
+
* ```tsx
|
|
1854
|
+
* <MantineProvider theme={createCompactTheme({ highContrast: true })}>
|
|
1855
|
+
* <App />
|
|
1856
|
+
* </MantineProvider>
|
|
1857
|
+
* ```
|
|
1858
|
+
*/
|
|
1859
|
+
export declare function createCompactTheme(options?: CompactThemeOptions): MantineThemeOverride;
|
|
1860
|
+
|
|
1530
1861
|
/**
|
|
1531
1862
|
* Creates default gradient stops for a new gradient configuration.
|
|
1532
1863
|
* @returns An array of two ColorStops (start and end)
|
|
@@ -1541,30 +1872,26 @@ export declare function createDefaultGradientStops(): ColorStop[];
|
|
|
1541
1872
|
* value, and the reason is worth stating because every other row type exists to
|
|
1542
1873
|
* replace that label with a glyph. An identifier, a node label, an attribute
|
|
1543
1874
|
* name or a filename is *data*, and data cannot be drawn: there is no picture of
|
|
1544
|
-
* `Mr_Whiskers`. So the string stays, at
|
|
1875
|
+
* `Mr_Whiskers`. So the string stays, at 11px in the primary text color, and
|
|
1545
1876
|
* the number that describes it rides at the trailing edge in the smaller
|
|
1546
|
-
* secondary
|
|
1877
|
+
* secondary color.
|
|
1547
1878
|
*
|
|
1548
1879
|
* The number is bare. A run of rows that all measure the same thing carries its
|
|
1549
1880
|
* unit word once, on a `DataRowHeader` above the column, rather than repeating
|
|
1550
1881
|
* it on every row -- "links" above the column and `4` on the rows. A rank is a
|
|
1551
1882
|
* `RankChip` reading `#6`, not the sentence "Rank 6 of 318".
|
|
1552
1883
|
*
|
|
1553
|
-
*
|
|
1554
|
-
*
|
|
1555
|
-
*
|
|
1556
|
-
* is
|
|
1557
|
-
* a single selected row or, inside a listbox, as `aria-selected`.
|
|
1884
|
+
* A row is a reading, not an object in a list. Give it `onClick` to open what
|
|
1885
|
+
* the reading is about, and `selected` to mark the current row of a ranking
|
|
1886
|
+
* (reported as `aria-current`). A list the reader selects, renames or reorders
|
|
1887
|
+
* is a `Tree` (nested) or a `PageList` (flat); a find result is a `ResultRow`.
|
|
1558
1888
|
* @param props - Component props
|
|
1559
1889
|
* @param props.name - The reader's own string
|
|
1560
|
-
* @param props.value - The trailing value, bare and in the secondary text
|
|
1890
|
+
* @param props.value - The trailing value, bare and in the secondary text color; a number is formatted for the locale
|
|
1891
|
+
* @param props.stat - Draws the row as a stat: the name as the label, the value emphasized, the pair one group
|
|
1561
1892
|
* @param props.icon - A 16px leading icon, worth drawing only when the rows differ in type
|
|
1562
|
-
* @param props.selected - Whether this row is the
|
|
1563
|
-
* @param props.role - How the row reports being selected: `"button"` for one selected row, `"option"` inside a listbox
|
|
1564
|
-
* @param props.tabIndex - The row's position in the tab order, for a list that manages focus itself
|
|
1893
|
+
* @param props.selected - Whether this row is the current one, reported as `aria-current`
|
|
1565
1894
|
* @param props.onClick - Called when the row is activated, with the event and the activation source
|
|
1566
|
-
* @param props.onDoubleClick - Called when the row is double-clicked, anywhere along it
|
|
1567
|
-
* @param props.onContextMenu - Called when a context menu is asked for on the row, by pointer or from the keyboard
|
|
1568
1895
|
* @param props.onFocus - Called when the row's body takes focus
|
|
1569
1896
|
* @param props.onBlur - Called when the row's body loses focus
|
|
1570
1897
|
* @param props.trailing - The row's occasional control, in the 24px slot at its trailing edge
|
|
@@ -1576,17 +1903,17 @@ export declare function createDefaultGradientStops(): ColorStop[];
|
|
|
1576
1903
|
* <DataRow
|
|
1577
1904
|
* key={node.id}
|
|
1578
1905
|
* name={node.id}
|
|
1579
|
-
* value={
|
|
1906
|
+
* value={node.degree}
|
|
1580
1907
|
* selected={node.id === current}
|
|
1581
1908
|
* onClick={() => { setCurrent(node.id); }}
|
|
1582
1909
|
* />
|
|
1583
1910
|
* ))}
|
|
1584
1911
|
* ```
|
|
1585
1912
|
*/
|
|
1586
|
-
export declare function DataRow({ name, value, icon, selected,
|
|
1913
|
+
export declare function DataRow({ name, value, stat, icon, selected, onClick, onFocus, onBlur, trailing, }: DataRowProps): default_2.JSX.Element;
|
|
1587
1914
|
|
|
1588
1915
|
/**
|
|
1589
|
-
* The
|
|
1916
|
+
* The 32px caption above a run of data rows (11/16 at 550), optionally sortable.
|
|
1590
1917
|
*
|
|
1591
1918
|
* It exists to carry the one word the rows below must not repeat. Three or more
|
|
1592
1919
|
* rows measuring the same thing put their unit here once -- "links" above the
|
|
@@ -1594,9 +1921,9 @@ export declare function DataRow({ name, value, icon, selected, role, tabIndex, o
|
|
|
1594
1921
|
* trailing edge becomes a number a reader can compare down rather than a ragged
|
|
1595
1922
|
* phrase they have to re-read.
|
|
1596
1923
|
*
|
|
1597
|
-
* Both halves are drawn small in the secondary text
|
|
1924
|
+
* Both halves are drawn small in the secondary text color, because a caption is
|
|
1598
1925
|
* chrome rather than content. The name of the sorted column is drawn in the
|
|
1599
|
-
* primary
|
|
1926
|
+
* primary color instead, which is how a reader sees at a glance which column
|
|
1600
1927
|
* the list is in the order of.
|
|
1601
1928
|
*
|
|
1602
1929
|
* Give it `onSortChange` and the caption becomes a button that cycles between
|
|
@@ -1688,43 +2015,41 @@ export declare interface DataRowProps {
|
|
|
1688
2015
|
/** The reader's own string: an identifier, a node label, an attribute name, a filename. */
|
|
1689
2016
|
name: string;
|
|
1690
2017
|
/**
|
|
1691
|
-
* The trailing value, drawn small in the secondary text
|
|
2018
|
+
* The trailing value, drawn small in the secondary text color. Bare: the
|
|
1692
2019
|
* repeated unit word belongs on `DataRowHeader`.
|
|
1693
2020
|
*
|
|
1694
|
-
*
|
|
1695
|
-
*
|
|
1696
|
-
*
|
|
1697
|
-
*
|
|
2021
|
+
* Pass a number raw: the row formats it for the reader's locale, `1,284`
|
|
2022
|
+
* in en-US and `1.284` in de-DE, keeping every fraction digit it is given.
|
|
2023
|
+
* Anything else is drawn exactly as given, so pass a string when you have
|
|
2024
|
+
* rounded or formatted the value yourself.
|
|
1698
2025
|
*/
|
|
1699
2026
|
value?: default_2.ReactNode;
|
|
1700
|
-
/** A 16px leading icon, worth drawing only when the rows differ in type. */
|
|
1701
|
-
icon?: default_2.ReactNode;
|
|
1702
|
-
/** Whether this row is the selected one. Draws the accent tint and reports the selection to a screen reader. */
|
|
1703
|
-
selected?: boolean;
|
|
1704
2027
|
/**
|
|
1705
|
-
*
|
|
2028
|
+
* Draws the row as a stat: a label and its reading, such as "Nodes 1,000,000".
|
|
1706
2029
|
*
|
|
1707
|
-
*
|
|
1708
|
-
*
|
|
1709
|
-
*
|
|
2030
|
+
* The name is drawn in the secondary text color at weight 400 and the value
|
|
2031
|
+
* in the primary color at weight 500, because the reading is the half the
|
|
2032
|
+
* reader came for. The pair is exposed as one `role="group"` named by the
|
|
2033
|
+
* name, so a screen reader reads "Nodes, 1,000,000" as one unit (WCAG 1.3.1).
|
|
2034
|
+
*
|
|
2035
|
+
* Leave it off for a list of the reader's own strings -- datasets, files,
|
|
2036
|
+
* nodes -- where the name is the thing being read.
|
|
1710
2037
|
*/
|
|
1711
|
-
|
|
2038
|
+
stat?: boolean;
|
|
2039
|
+
/** A 16px leading icon, worth drawing only when the rows differ in type. */
|
|
2040
|
+
icon?: default_2.ReactNode;
|
|
1712
2041
|
/**
|
|
1713
|
-
*
|
|
1714
|
-
*
|
|
1715
|
-
*
|
|
1716
|
-
* one when you are managing focus yourself, as a listbox does when the arrow
|
|
1717
|
-
* keys move between rows and Tab enters and leaves the list.
|
|
2042
|
+
* Whether this row is the current one: the item on screen, or the current
|
|
2043
|
+
* entry of a ranking. Draws the accent tint and reports it to a screen
|
|
2044
|
+
* reader as `aria-current`.
|
|
1718
2045
|
*/
|
|
1719
|
-
|
|
2046
|
+
selected?: boolean;
|
|
1720
2047
|
/**
|
|
1721
2048
|
* Called when the row is activated, by a click or by Enter or Space.
|
|
1722
2049
|
*
|
|
1723
|
-
*
|
|
1724
|
-
*
|
|
1725
|
-
*
|
|
1726
|
-
* keyboard, which is worth branching on because a keyboard activation
|
|
1727
|
-
* carries no click count and no modifiers to extend a range with.
|
|
2050
|
+
* Open what the reading is about: the node a ranking names, the file a
|
|
2051
|
+
* recent-files row names. The second argument says whether the row was
|
|
2052
|
+
* activated with a pointer or from the keyboard.
|
|
1728
2053
|
*
|
|
1729
2054
|
* Giving a row this handler makes its name and value a real button, so the
|
|
1730
2055
|
* row is reachable by Tab and answers Enter and Space. A row without one is
|
|
@@ -1733,46 +2058,18 @@ export declare interface DataRowProps {
|
|
|
1733
2058
|
* ```tsx
|
|
1734
2059
|
* <DataRow
|
|
1735
2060
|
* name={node.id}
|
|
1736
|
-
*
|
|
1737
|
-
*
|
|
1738
|
-
*
|
|
1739
|
-
* extendSelectionTo(node.id);
|
|
1740
|
-
* } else if (event.metaKey || event.ctrlKey) {
|
|
1741
|
-
* toggleSelection(node.id);
|
|
1742
|
-
* } else {
|
|
1743
|
-
* replaceSelectionWith(node.id);
|
|
1744
|
-
* }
|
|
1745
|
-
* }}
|
|
2061
|
+
* value={node.degree}
|
|
2062
|
+
* selected={node.id === current}
|
|
2063
|
+
* onClick={() => { setCurrent(node.id); }}
|
|
1746
2064
|
* />
|
|
1747
2065
|
* ```
|
|
1748
2066
|
*/
|
|
1749
2067
|
onClick?: ActivationHandlerWithMeta;
|
|
1750
|
-
/**
|
|
1751
|
-
* Called when the row is double-clicked, anywhere along it.
|
|
1752
|
-
*
|
|
1753
|
-
* Open the thing the row names, or start renaming it. The browser delivers
|
|
1754
|
-
* two `onClick` activations before this, which is how a double click is
|
|
1755
|
-
* defined rather than something this component adds; `event.detail` on
|
|
1756
|
-
* those clicks counts them, so a consumer that must act on a single click
|
|
1757
|
-
* alone can wait for the count to settle.
|
|
1758
|
-
*/
|
|
1759
|
-
onDoubleClick?: (event: default_2.MouseEvent) => void;
|
|
1760
|
-
/**
|
|
1761
|
-
* Called when a context menu is asked for on the row, anywhere along it.
|
|
1762
|
-
*
|
|
1763
|
-
* Call `preventDefault` on the event to replace the browser's own menu with
|
|
1764
|
-
* yours. The keyboard's context-menu key and Shift+F10 raise it as well as a
|
|
1765
|
-
* right click, so a menu opened from here is reachable without a pointer --
|
|
1766
|
-
* as long as the row can hold focus, which it can as soon as it has an
|
|
1767
|
-
* `onClick`, or when you give it a `tabIndex` of its own.
|
|
1768
|
-
*/
|
|
1769
|
-
onContextMenu?: (event: default_2.MouseEvent) => void;
|
|
1770
2068
|
/**
|
|
1771
2069
|
* Called when the row's body takes focus.
|
|
1772
2070
|
*
|
|
1773
|
-
* The
|
|
1774
|
-
* `<button
|
|
1775
|
-
* cannot.
|
|
2071
|
+
* The body takes focus only when the row has an `onClick`, which makes it a
|
|
2072
|
+
* `<button>`.
|
|
1776
2073
|
*/
|
|
1777
2074
|
onFocus?: default_2.FocusEventHandler<HTMLElement>;
|
|
1778
2075
|
/** Called when the row's body loses focus. */
|
|
@@ -1781,17 +2078,6 @@ export declare interface DataRowProps {
|
|
|
1781
2078
|
trailing?: default_2.ReactNode;
|
|
1782
2079
|
}
|
|
1783
2080
|
|
|
1784
|
-
/**
|
|
1785
|
-
* How a row reports being selected to a screen reader.
|
|
1786
|
-
*
|
|
1787
|
-
* - `"button"` marks the row `aria-current`, which is what a list with one
|
|
1788
|
-
* selected item means: this row is the one on screen.
|
|
1789
|
-
* - `"option"` gives the row the `option` role and `aria-selected`. Use it only
|
|
1790
|
-
* when the rows sit inside an element you have given `role="listbox"`, adding
|
|
1791
|
-
* `aria-multiselectable` there when more than one row can be selected at once.
|
|
1792
|
-
*/
|
|
1793
|
-
export declare type DataRowRole = "button" | "option";
|
|
1794
|
-
|
|
1795
2081
|
/**
|
|
1796
2082
|
* Which way a sorted column is ordered, in the spelling ARIA uses.
|
|
1797
2083
|
*
|
|
@@ -2075,9 +2361,9 @@ export declare interface DataTableProps<TRow extends object> {
|
|
|
2075
2361
|
* the thing virtualization exists to avoid.
|
|
2076
2362
|
*/
|
|
2077
2363
|
height?: number | string;
|
|
2078
|
-
/** How tall each row is drawn, in pixels. Defaults to
|
|
2364
|
+
/** How tall each row is drawn, in pixels. Defaults to 32, Figma's list row pitch (`PANEL_GRID.ROW_PITCH`). */
|
|
2079
2365
|
rowHeight?: number;
|
|
2080
|
-
/** How tall the header row is drawn, in pixels. Defaults to
|
|
2366
|
+
/** How tall the header row is drawn, in pixels. Defaults to 32, like a row. */
|
|
2081
2367
|
headerHeight?: number;
|
|
2082
2368
|
/**
|
|
2083
2369
|
* How many rows to draw beyond the ones on screen, above and below.
|
|
@@ -2292,6 +2578,17 @@ export declare interface DisclosureProps {
|
|
|
2292
2578
|
onOpenChange?: OpenChangeHandler;
|
|
2293
2579
|
}
|
|
2294
2580
|
|
|
2581
|
+
/**
|
|
2582
|
+
* Inject the stylesheet into `document.head` (once) and set `data-cm-contrast` on `<html>` to
|
|
2583
|
+
* `"high"` or `"figma"`. Does nothing without a DOM.
|
|
2584
|
+
*
|
|
2585
|
+
* ponytail: one contrast attribute per document, so the last theme rendered wins; two providers
|
|
2586
|
+
* with different `highContrast` on one page are not supported. Scope the attribute to the
|
|
2587
|
+
* provider's root if that is ever needed.
|
|
2588
|
+
* @param options - the theme options
|
|
2589
|
+
*/
|
|
2590
|
+
export declare function ensureCompactStyles(options?: CompactThemeOptions): void;
|
|
2591
|
+
|
|
2295
2592
|
/**
|
|
2296
2593
|
* Every glyph name in the closed field register, in register order.
|
|
2297
2594
|
*/
|
|
@@ -2303,21 +2600,21 @@ export declare const FIELD_GLYPH_NAMES: readonly FieldGlyphName[];
|
|
|
2303
2600
|
export declare const FIELD_LETTERS: readonly FieldLetter[];
|
|
2304
2601
|
|
|
2305
2602
|
/**
|
|
2306
|
-
* A glyph from the closed register, drawn in a field's
|
|
2603
|
+
* A glyph from the closed register, drawn in a field's 24px slot.
|
|
2307
2604
|
*
|
|
2308
2605
|
* The glyph is the field's label: it replaces the word that a label-above-field
|
|
2309
2606
|
* stack used to spend a line on. It is decorative to assistive technology --
|
|
2310
2607
|
* the field itself carries the word as its title and accessible name.
|
|
2311
2608
|
* @param props - Component props
|
|
2312
2609
|
* @param props.name - Which glyph of the closed field register to draw
|
|
2313
|
-
* @param props.filled - Draw the bound form: the glyph's closed shapes fill with the current
|
|
2314
|
-
* @param props.size - Drawn size in pixels, defaulting to the
|
|
2610
|
+
* @param props.filled - Draw the bound form: the glyph's closed shapes fill with the current color, which is how a field says its value comes from a data attribute rather than from a fixed literal
|
|
2611
|
+
* @param props.size - Drawn size in pixels, defaulting to the 12px nominal glyph size
|
|
2315
2612
|
* @returns The field glyph SVG
|
|
2316
2613
|
*/
|
|
2317
2614
|
export declare function FieldGlyph({ name, filled, size }: FieldGlyphProps): default_2.JSX.Element;
|
|
2318
2615
|
|
|
2319
2616
|
/**
|
|
2320
|
-
* The closed register of drawings allowed in a field's
|
|
2617
|
+
* The closed register of drawings allowed in a field's 24px slot.
|
|
2321
2618
|
*
|
|
2322
2619
|
* Nothing outside this list may be drawn there. The premise of the field is
|
|
2323
2620
|
* that a small drawing can replace a word, which only works if the drawings are
|
|
@@ -2334,7 +2631,7 @@ export declare interface FieldGlyphProps {
|
|
|
2334
2631
|
name: FieldGlyphName;
|
|
2335
2632
|
/** a bound glyph draws filled; a fixed literal draws hollow */
|
|
2336
2633
|
filled?: boolean;
|
|
2337
|
-
/** Drawn size in pixels. Defaults to the
|
|
2634
|
+
/** Drawn size in pixels. Defaults to the 12px nominal glyph size of the 24px slot. */
|
|
2338
2635
|
size?: number;
|
|
2339
2636
|
}
|
|
2340
2637
|
|
|
@@ -2347,40 +2644,34 @@ export declare type FieldLetter = "N" | "E" | "W" | "D" | "K";
|
|
|
2347
2644
|
/**
|
|
2348
2645
|
* A panel row holding one or two compact fields and a fixed trailing slot.
|
|
2349
2646
|
*
|
|
2350
|
-
* This is the row a dense property panel is mostly made of
|
|
2351
|
-
*
|
|
2352
|
-
*
|
|
2353
|
-
* out around half its usual height.
|
|
2647
|
+
* This is the row a dense property panel is mostly made of: 32px tall, a 24px
|
|
2648
|
+
* control centered in it. Each field carries a glyph inside its own box instead
|
|
2649
|
+
* of a caption above it.
|
|
2354
2650
|
*
|
|
2355
2651
|
* The row owns the widths and the gaps; each field owns everything inside its
|
|
2356
|
-
* own box. Three arrangements, all of them filling the same
|
|
2357
|
-
*
|
|
2652
|
+
* own box. Three arrangements, all of them filling the same 216px band of a
|
|
2653
|
+
* 240px panel:
|
|
2358
2654
|
*
|
|
2359
|
-
* - two fields side by side -- `
|
|
2360
|
-
* - one field beside a trailing control -- `
|
|
2361
|
-
* - one field alone -- `
|
|
2655
|
+
* - two fields side by side -- `88 + 8 + 88 + 8 + 24`
|
|
2656
|
+
* - one field beside a trailing control -- `184 + 8 + 24`
|
|
2657
|
+
* - one field alone -- `192 + 24`; with no control to be held apart from, the
|
|
2362
2658
|
* field takes the 8px gap for itself
|
|
2363
2659
|
*
|
|
2364
|
-
* The trailing slot is drawn whether or not it holds anything,
|
|
2365
|
-
*
|
|
2366
|
-
*
|
|
2367
|
-
* settings button that opens a pop-out, or a small reset. A select's chevron is
|
|
2368
|
-
* not one of those: it belongs inside the field's own box.
|
|
2660
|
+
* The trailing slot is drawn whether or not it holds anything, so every row in
|
|
2661
|
+
* a panel ends at the same place. Put the row's one rare control there -- an
|
|
2662
|
+
* advanced settings button that opens a pop-out, or a small reset.
|
|
2369
2663
|
*
|
|
2370
2664
|
* **Right-to-left.** All of the row's spacing is written in CSS logical
|
|
2371
2665
|
* properties, so the row lays itself out correctly under `dir="rtl"` with
|
|
2372
|
-
* nothing to configure
|
|
2373
|
-
* slot stays at the end of the row rather than jumping to its start, and the
|
|
2374
|
-
* three arrangements above still spend exactly 256px. The row writes the same
|
|
2375
|
-
* style in both directions; only the browser resolves it differently.
|
|
2666
|
+
* nothing to configure.
|
|
2376
2667
|
*
|
|
2377
2668
|
* **When control labels are switched on.** `PanelLabelsProvider` turns on a
|
|
2378
|
-
* preference that writes each control's word
|
|
2379
|
-
*
|
|
2380
|
-
*
|
|
2381
|
-
*
|
|
2382
|
-
*
|
|
2383
|
-
*
|
|
2669
|
+
* preference that writes each control's word. By default the row becomes
|
|
2670
|
+
* Figma's labeled row: a 9px caption in the secondary ink above each column
|
|
2671
|
+
* (4 above, 14 caption, 4 gap, 24 control, 4 below = 50px). With
|
|
2672
|
+
* `labelPosition="inline"` a pair instead splits into two rows, each with its
|
|
2673
|
+
* word in a 72px column beside the field. Either way the word is printed once:
|
|
2674
|
+
* the fields are handed a labels-off context so that they do not repeat it.
|
|
2384
2675
|
* @example
|
|
2385
2676
|
* ```tsx
|
|
2386
2677
|
* <FieldRow
|
|
@@ -2424,6 +2715,32 @@ export declare interface FieldRowProps extends Omit<default_2.ComponentPropsWith
|
|
|
2424
2715
|
* on the page, such as in the section header above the row.
|
|
2425
2716
|
*/
|
|
2426
2717
|
groupLabel?: string;
|
|
2718
|
+
/**
|
|
2719
|
+
* Where each field's label word goes while the "show labels on controls"
|
|
2720
|
+
* preference is on (see `PanelLabelsProvider`).
|
|
2721
|
+
*
|
|
2722
|
+
* - `"above"` (default): Figma's labeled two-column row. A 9px caption sits
|
|
2723
|
+
* above each column, and the row grows from 32px to 50px.
|
|
2724
|
+
* - `"inline"`: the earlier layout. A pair splits into two rows of one field
|
|
2725
|
+
* each, with the word in a 72px column beside the field.
|
|
2726
|
+
*
|
|
2727
|
+
* With the preference off the row draws no words and this has no effect.
|
|
2728
|
+
* @default "above"
|
|
2729
|
+
*/
|
|
2730
|
+
labelPosition?: "above" | "inline";
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
/** One visible row. */
|
|
2734
|
+
export declare interface FlatTreeRow {
|
|
2735
|
+
node: TreeNodeData;
|
|
2736
|
+
/** 1 for a top-level row. */
|
|
2737
|
+
level: number;
|
|
2738
|
+
parentId: string | null;
|
|
2739
|
+
/** 1-based position among its siblings. */
|
|
2740
|
+
posInSet: number;
|
|
2741
|
+
setSize: number;
|
|
2742
|
+
hasChildren: boolean;
|
|
2743
|
+
expanded: boolean;
|
|
2427
2744
|
}
|
|
2428
2745
|
|
|
2429
2746
|
/**
|
|
@@ -2437,7 +2754,7 @@ export declare type GestureChangeHandler<T = number> = (value: T, event: default
|
|
|
2437
2754
|
|
|
2438
2755
|
/**
|
|
2439
2756
|
* Called once when a continuous gesture finishes, including when it is
|
|
2440
|
-
*
|
|
2757
|
+
* canceled.
|
|
2441
2758
|
*/
|
|
2442
2759
|
export declare type GestureEndHandler = (event: default_2.PointerEvent) => void;
|
|
2443
2760
|
|
|
@@ -2462,7 +2779,7 @@ export declare interface GestureHandlers<T = number> {
|
|
|
2462
2779
|
onGestureStart?: GestureStartHandler;
|
|
2463
2780
|
/** Called repeatedly while the gesture is in progress. */
|
|
2464
2781
|
onGestureChange?: GestureChangeHandler<T>;
|
|
2465
|
-
/** Called when the gesture finishes or is
|
|
2782
|
+
/** Called when the gesture finishes or is canceled. Commit the undo transaction here. */
|
|
2466
2783
|
onGestureEnd?: GestureEndHandler;
|
|
2467
2784
|
}
|
|
2468
2785
|
|
|
@@ -2475,9 +2792,9 @@ export declare type GestureStartHandler = (event: default_2.PointerEvent) => voi
|
|
|
2475
2792
|
/**
|
|
2476
2793
|
* Works out whether an activation came from a pointer or from the keyboard.
|
|
2477
2794
|
*
|
|
2478
|
-
* A keyboard activation is
|
|
2795
|
+
* A keyboard activation is recognized three ways: the event is a keyboard event;
|
|
2479
2796
|
* or it is a pointer event with no pointer type; or it is a mouse event with a
|
|
2480
|
-
* click count of zero, which is how a browser reports the click it
|
|
2797
|
+
* click count of zero, which is how a browser reports the click it synthesizes
|
|
2481
2798
|
* from Enter or Space on a button.
|
|
2482
2799
|
* @param event - The event that activated the control
|
|
2483
2800
|
* @returns The activation source, ready to hand to an {@link ActivationHandlerWithMeta}
|
|
@@ -2485,39 +2802,38 @@ export declare type GestureStartHandler = (event: default_2.PointerEvent) => voi
|
|
|
2485
2802
|
export declare function getActivationMeta(event: ActivationEvent): ActivationMeta;
|
|
2486
2803
|
|
|
2487
2804
|
/**
|
|
2488
|
-
* An editor for a multi-stop linear gradient
|
|
2805
|
+
* An editor for a multi-stop linear gradient, laid out as Figma's: square stop handles over a
|
|
2806
|
+
* gradient bar, a color picker (ColorPickerPanel, without opacity) for the selected stop, a
|
|
2807
|
+
* "Stops" list of rows (position, chit and hex, remove), and an optional direction row (the
|
|
2808
|
+
* angle, flip and rotate).
|
|
2489
2809
|
*
|
|
2490
|
-
*
|
|
2491
|
-
*
|
|
2492
|
-
* adds a stop halfway between the last one and the end, and an optional slider
|
|
2493
|
-
* below sets the angle the gradient runs at.
|
|
2810
|
+
* One stop is selected at a time: its handle, its row's chit, or focus entering its row selects
|
|
2811
|
+
* it, and the picker edits its color. The row's hex box edits it too. Nothing opens a pop-out.
|
|
2494
2812
|
*
|
|
2495
|
-
*
|
|
2496
|
-
*
|
|
2497
|
-
*
|
|
2498
|
-
*
|
|
2499
|
-
* silently doing nothing.
|
|
2813
|
+
* Drag a handle to move its stop, click the bar to add a stop there (its color mixed from its
|
|
2814
|
+
* neighbors), and use the arrow keys on a focused handle to nudge it (Shift for 10%), Home /
|
|
2815
|
+
* End to send it to an end, and Delete or Backspace to remove it. The list is bounded by
|
|
2816
|
+
* `minStops` and `maxStops`; at either bound the button that would cross it is disabled.
|
|
2500
2817
|
*
|
|
2501
|
-
*
|
|
2502
|
-
*
|
|
2503
|
-
*
|
|
2504
|
-
* into one undo entry rather than one per pixel moved.
|
|
2818
|
+
* A drag -- of a handle, or in the picker -- reports `onChangeStart` once, `onChange` on every
|
|
2819
|
+
* step and `onChangeEnd` once, so a consumer can wrap the whole drag in one undo entry. A
|
|
2820
|
+
* keyboard step or a typed commit is one complete gesture of its own.
|
|
2505
2821
|
*
|
|
2506
|
-
* Every stop carries an `id`, which
|
|
2507
|
-
*
|
|
2508
|
-
* `createColorStop` rather than writing the object by hand, so the id is unique.
|
|
2822
|
+
* Every stop carries an `id`, which keeps the right controls attached to the right stop as stops
|
|
2823
|
+
* are added, removed and reordered. Build stops with `createColorStop`.
|
|
2509
2824
|
* @param props - Component props
|
|
2510
|
-
* @param props.stops - The gradient's
|
|
2825
|
+
* @param props.stops - The gradient's color stops, when you drive the editor from your own state
|
|
2511
2826
|
* @param props.defaultStops - The stops the editor starts with when it keeps its own state
|
|
2512
2827
|
* @param props.direction - The angle the gradient runs at, when you drive the editor from your own state
|
|
2513
2828
|
* @param props.defaultDirection - The angle the editor starts at when it keeps its own state
|
|
2514
|
-
* @param props.showDirection - Whether to offer the direction
|
|
2829
|
+
* @param props.showDirection - Whether to offer the direction row
|
|
2515
2830
|
* @param props.onChange - Called whenever the gradient changes, with both halves of it
|
|
2516
2831
|
* @param props.onChangeStart - Called once when a change to a position or to the direction begins
|
|
2517
2832
|
* @param props.onChangeEnd - Called once when such a change settles, with the gradient it settled on
|
|
2518
2833
|
* @param props.minStops - The fewest stops the reader can reduce the gradient to
|
|
2519
2834
|
* @param props.maxStops - The most stops the reader can build up to
|
|
2520
|
-
* @
|
|
2835
|
+
* @param props.labels - English names for the flip and rotate buttons
|
|
2836
|
+
* @returns The gradient editor
|
|
2521
2837
|
* @example
|
|
2522
2838
|
* ```tsx
|
|
2523
2839
|
* const [stops, setStops] = useState([createColorStop(0, "#6366F1"), createColorStop(1, "#06B6D4")]);
|
|
@@ -2530,19 +2846,25 @@ export declare function getActivationMeta(event: ActivationEvent): ActivationMet
|
|
|
2530
2846
|
* setStops(nextStops);
|
|
2531
2847
|
* setAngle(nextAngle);
|
|
2532
2848
|
* }}
|
|
2533
|
-
* onChangeStart={() => history.begin()}
|
|
2534
|
-
* onChangeEnd={() => history.commit()}
|
|
2535
2849
|
* />
|
|
2536
2850
|
* ```
|
|
2537
2851
|
*/
|
|
2538
|
-
export declare function GradientEditor({ stops, defaultStops, direction, defaultDirection, showDirection, onChange, onChangeStart, onChangeEnd, minStops, maxStops, }: GradientEditorProps): default_2.JSX.Element;
|
|
2852
|
+
export declare function GradientEditor({ stops, defaultStops, direction, defaultDirection, showDirection, onChange, onChangeStart, onChangeEnd, minStops, maxStops, labels: labelOverrides, }: GradientEditorProps): default_2.JSX.Element;
|
|
2853
|
+
|
|
2854
|
+
/** The English names of the buttons Figma adds; every other string comes from the labels. */
|
|
2855
|
+
export declare interface GradientEditorLabels {
|
|
2856
|
+
/** The button that reverses the stops. */
|
|
2857
|
+
flip: string;
|
|
2858
|
+
/** The button that turns the gradient 90 degrees. */
|
|
2859
|
+
rotate: string;
|
|
2860
|
+
}
|
|
2539
2861
|
|
|
2540
2862
|
/**
|
|
2541
2863
|
* Props for the GradientEditor component.
|
|
2542
2864
|
*/
|
|
2543
2865
|
export declare interface GradientEditorProps {
|
|
2544
2866
|
/**
|
|
2545
|
-
* The gradient's
|
|
2867
|
+
* The gradient's color stops, when you drive the editor from your own
|
|
2546
2868
|
* state. Order them by `offset`; the editor keeps them in order as it
|
|
2547
2869
|
* works.
|
|
2548
2870
|
*/
|
|
@@ -2563,19 +2885,19 @@ export declare interface GradientEditorProps {
|
|
|
2563
2885
|
*/
|
|
2564
2886
|
defaultDirection?: number;
|
|
2565
2887
|
/**
|
|
2566
|
-
* Whether to offer the direction
|
|
2888
|
+
* Whether to offer the direction row: the angle field, flip and rotate.
|
|
2567
2889
|
* @default true
|
|
2568
2890
|
*/
|
|
2569
2891
|
showDirection?: boolean;
|
|
2570
2892
|
/**
|
|
2571
|
-
* Called whenever the gradient changes: a
|
|
2893
|
+
* Called whenever the gradient changes: a color, a position, a stop added
|
|
2572
2894
|
* or a stop removed.
|
|
2573
2895
|
*
|
|
2574
2896
|
* Both halves of the gradient are passed on every change, so a consumer
|
|
2575
2897
|
* never has to remember which one moved. The event that caused the change
|
|
2576
|
-
* is third and optional -- a drag and the
|
|
2898
|
+
* is third and optional -- a drag and the color picker report none.
|
|
2577
2899
|
*
|
|
2578
|
-
* While a
|
|
2900
|
+
* While a stop handle is being dragged this is called on every step. Use
|
|
2579
2901
|
* `onChangeEnd` if you want the settled value only.
|
|
2580
2902
|
*/
|
|
2581
2903
|
onChange?: (stops: ColorStop[], direction: number, event?: default_2.SyntheticEvent) => void;
|
|
@@ -2612,6 +2934,33 @@ export declare interface GradientEditorProps {
|
|
|
2612
2934
|
* @default 5
|
|
2613
2935
|
*/
|
|
2614
2936
|
maxStops?: number;
|
|
2937
|
+
/** Replace the English names of the flip and rotate buttons. */
|
|
2938
|
+
labels?: Partial<GradientEditorLabels>;
|
|
2939
|
+
}
|
|
2940
|
+
|
|
2941
|
+
/**
|
|
2942
|
+
* Figma's floating help button: a 32 x 32 circle on `--cm-bg` with the 200 elevation and no hover
|
|
2943
|
+
* change. Its tooltip shows and hides at once outside a Tooltip.Group; its focus ring (1px at -2px) fades in over 200ms.
|
|
2944
|
+
* It opens a dark menu of the caller's items, 4px above and end-aligned.
|
|
2945
|
+
* @param props - Component props
|
|
2946
|
+
* @param props.label - Accessible name and tooltip
|
|
2947
|
+
* @param props.children - The menu's items
|
|
2948
|
+
* @param props.menuProps - Extra props for the Mantine `Menu`
|
|
2949
|
+
* @param props.className - Extra class on the root
|
|
2950
|
+
* @returns The help button
|
|
2951
|
+
*/
|
|
2952
|
+
export declare function HelpButton({ label, children, menuProps, className, ...others }: HelpButtonProps): default_2.JSX.Element;
|
|
2953
|
+
|
|
2954
|
+
/**
|
|
2955
|
+
* Props for the HelpButton component.
|
|
2956
|
+
*/
|
|
2957
|
+
export declare interface HelpButtonProps extends Omit<UnstyledButtonProps, "children">, Omit<ElementProps<"button">, "children"> {
|
|
2958
|
+
/** Accessible name and tooltip. Defaults to the "Help" label. */
|
|
2959
|
+
label?: string;
|
|
2960
|
+
/** The menu's items (`Menu.Item`, `Menu.Divider`, ...). Without any, the button opens nothing. */
|
|
2961
|
+
children?: default_2.ReactNode;
|
|
2962
|
+
/** Extra props for the Mantine `Menu` (its `opened`, `onChange`, ...). */
|
|
2963
|
+
menuProps?: Omit<MenuProps, "children">;
|
|
2615
2964
|
}
|
|
2616
2965
|
|
|
2617
2966
|
/**
|
|
@@ -2628,12 +2977,12 @@ export declare interface HistogramBin {
|
|
|
2628
2977
|
label: string;
|
|
2629
2978
|
/** How many things fell in this bin. The bar's height is this over the tallest bin's. */
|
|
2630
2979
|
count: number;
|
|
2631
|
-
/** Draws this bar in the accent
|
|
2980
|
+
/** Draws this bar in the accent color, for the bin the reader has selected or the one being explained. */
|
|
2632
2981
|
highlighted?: boolean;
|
|
2633
2982
|
}
|
|
2634
2983
|
|
|
2635
2984
|
/**
|
|
2636
|
-
* A distribution drawn instead of the four numbers that
|
|
2985
|
+
* A distribution drawn instead of the four numbers that summarize it.
|
|
2637
2986
|
*
|
|
2638
2987
|
* `min 2, median 3, max 4, standard deviation 0.62` is four numbers standing in
|
|
2639
2988
|
* for a shape. A histogram draws the shape in the same space, and answers what
|
|
@@ -2729,252 +3078,90 @@ export declare interface HistogramRowProps {
|
|
|
2729
3078
|
}
|
|
2730
3079
|
|
|
2731
3080
|
/**
|
|
2732
|
-
*
|
|
2733
|
-
*
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
* A 14px inline SVG that takes its colour from its parent, so the drawing
|
|
2750
|
-
* changes colour with the selection. Mark it `aria-hidden` -- the word
|
|
2751
|
-
* beside it is what names the option.
|
|
2752
|
-
*/
|
|
2753
|
-
icon: default_2.ReactNode;
|
|
2754
|
-
/**
|
|
2755
|
-
* Whether this option cannot be chosen.
|
|
2756
|
-
*
|
|
2757
|
-
* A disabled option is drawn dimmer, is skipped by the arrow keys and is
|
|
2758
|
-
* announced as unavailable.
|
|
2759
|
-
* @default false
|
|
2760
|
-
*/
|
|
2761
|
-
disabled?: boolean;
|
|
2762
|
-
}
|
|
2763
|
-
|
|
2764
|
-
/**
|
|
2765
|
-
* A row of two to six mutually exclusive options drawn as pictures, in one
|
|
2766
|
-
* segmented track.
|
|
2767
|
-
*
|
|
2768
|
-
* Reach for it in place of a select whose whole option list is short and can be
|
|
2769
|
-
* drawn: node shapes, edge routing, layouts, scale curves. It costs the same
|
|
2770
|
-
* single row as the select and spends it better, because every alternative is
|
|
2771
|
-
* visible at rest instead of hidden behind a chevron.
|
|
2772
|
-
*
|
|
2773
|
-
* Stay inside the range. One option is a statement rather than a choice and
|
|
2774
|
-
* belongs in a field; more than six stop reading as a set of drawings. So does
|
|
2775
|
-
* any set whose options differ conceptually rather than visually, however few
|
|
2776
|
-
* of them there are -- those belong in a select, and a legible checkbox is
|
|
2777
|
-
* never worth converting into a pair of pictures. Outside two to six the row
|
|
2778
|
-
* still renders, and says so once in the console during development.
|
|
2779
|
-
*
|
|
2780
|
-
* Every option carries the word it would have been called. The word is not
|
|
2781
|
-
* drawn unless you ask for it, but it is always the option's accessible name
|
|
2782
|
-
* and its tooltip, so the row is operable by someone who cannot see the
|
|
2783
|
-
* drawings. Two things ask for it to be drawn as well: `hybrid`, which names
|
|
2784
|
-
* the selected option only, and `PanelLabelsProvider`, the application-wide
|
|
2785
|
-
* preference that puts a word beside every control in the panel.
|
|
2786
|
-
*
|
|
2787
|
-
* The group is a set of radio buttons, so Tab reaches it in one stop and lands
|
|
2788
|
-
* on the current choice, the arrow keys move the selection and the focus
|
|
2789
|
-
* together and follow the direction the text runs, Home and End jump to the
|
|
2790
|
-
* ends, and Space selects.
|
|
3081
|
+
* A circled "i" that reveals an explanation on hover, on focus or on tap.
|
|
3082
|
+
*
|
|
3083
|
+
* Use it where an explanation would otherwise become a sentence of its own on a
|
|
3084
|
+
* dense panel: put it immediately after the name of the thing it explains. Give
|
|
3085
|
+
* `label` that name -- the button is announced as "About " and the name, and
|
|
3086
|
+
* the explanation becomes the button's accessible description, so a screen
|
|
3087
|
+
* reader reads the two together.
|
|
3088
|
+
*
|
|
3089
|
+
* The bubble closes when the pointer leaves, when focus moves away, on Escape,
|
|
3090
|
+
* on a second tap, and when something else on the page is clicked. It shares
|
|
3091
|
+
* the page's floating layer with every other pop-out (Escape closes the
|
|
3092
|
+
* innermost open thing), but as a hover bubble it neither closes an open panel
|
|
3093
|
+
* nor is closed by one opening; when there is no `PopoutManager` above it, it
|
|
3094
|
+
* supplies its own and works standalone.
|
|
3095
|
+
*
|
|
3096
|
+
* Leave `opened` out and the bubble keeps its own state. Supply it, with
|
|
3097
|
+
* `onOpenChange`, to drive it from yours.
|
|
2791
3098
|
* @param props - Component props
|
|
2792
|
-
* @param props.
|
|
2793
|
-
* @param props.
|
|
2794
|
-
* @param props.
|
|
2795
|
-
* @param props.
|
|
2796
|
-
* @param props.
|
|
2797
|
-
* @
|
|
2798
|
-
* @param props.name - The name shared by the group's radio inputs
|
|
2799
|
-
* @param props.disabled - Whether the whole group cannot be used
|
|
2800
|
-
* @param props.disabledReason - One sentence saying why the group is off, drawn only while it is off
|
|
2801
|
-
* @param props.hybrid - Draw the word beside the drawing on the selected option only
|
|
2802
|
-
* @param props.width - How wide the track is drawn, or `"fill"` to take the rest of the row
|
|
2803
|
-
* @param props.trailing - The row's 24px trailing slot
|
|
2804
|
-
* @param props.onFocus - Called when the focus enters the group
|
|
2805
|
-
* @param props.onBlur - Called when the focus leaves the group
|
|
2806
|
-
* @returns The icon group row
|
|
3099
|
+
* @param props.children - The explanation, which becomes the button's accessible description
|
|
3100
|
+
* @param props.label - Names what is being explained, for the accessible name of the button
|
|
3101
|
+
* @param props.opened - Whether the bubble is open, when driven from your own state
|
|
3102
|
+
* @param props.defaultOpened - Whether the bubble starts open, when it keeps its own state
|
|
3103
|
+
* @param props.onOpenChange - Called when the bubble opens or closes, with the new state first
|
|
3104
|
+
* @returns The info circle and its bubble
|
|
2807
3105
|
* @example
|
|
2808
3106
|
* ```tsx
|
|
2809
|
-
* <
|
|
2810
|
-
*
|
|
2811
|
-
*
|
|
2812
|
-
*
|
|
2813
|
-
*
|
|
2814
|
-
*
|
|
2815
|
-
* ]}
|
|
2816
|
-
* value={shape}
|
|
2817
|
-
* onChange={(next) => { setShape(next); }}
|
|
2818
|
-
* />
|
|
3107
|
+
* <Group gap={4}>
|
|
3108
|
+
* <Text>Resolution</Text>
|
|
3109
|
+
* <InfoCircle label="Resolution">
|
|
3110
|
+
* Higher resolution finds more, smaller communities.
|
|
3111
|
+
* </InfoCircle>
|
|
3112
|
+
* </Group>
|
|
2819
3113
|
* ```
|
|
2820
3114
|
*/
|
|
2821
|
-
export declare function
|
|
3115
|
+
export declare function InfoCircle({ children, label, opened, defaultOpened, onOpenChange, }: InfoCircleProps): default_2.JSX.Element;
|
|
2822
3116
|
|
|
2823
3117
|
/**
|
|
2824
|
-
* Props for the
|
|
3118
|
+
* Props for the InfoCircle component.
|
|
2825
3119
|
*/
|
|
2826
|
-
export declare interface
|
|
2827
|
-
/**
|
|
2828
|
-
|
|
2829
|
-
/**
|
|
2830
|
-
|
|
2831
|
-
/**
|
|
2832
|
-
* The value selected before anything is chosen, when the row keeps its own
|
|
2833
|
-
* state. Defaults to the first option.
|
|
2834
|
-
*/
|
|
2835
|
-
defaultValue?: string;
|
|
2836
|
-
/**
|
|
2837
|
-
* Called with the newly selected value, and with the event that selected it
|
|
2838
|
-
* when a person did the selecting.
|
|
2839
|
-
*
|
|
2840
|
-
* The event is second and optional so that a change made in code is
|
|
2841
|
-
* expressible as `onChange(next)`.
|
|
2842
|
-
*/
|
|
2843
|
-
onChange?: ChangeHandler<string>;
|
|
2844
|
-
/**
|
|
2845
|
-
* What the whole group is for, such as `"Node shape"`.
|
|
2846
|
-
*
|
|
2847
|
-
* A group of radio buttons needs a name of its own: without one a screen
|
|
2848
|
-
* reader announces the options but never says what is being chosen. The
|
|
2849
|
-
* word is not drawn on the row -- give it here when nothing else on the
|
|
2850
|
-
* screen names the group, or use `labelledBy` when something does.
|
|
2851
|
-
*/
|
|
2852
|
-
label?: string;
|
|
2853
|
-
/**
|
|
2854
|
-
* The `id` of the element that names the group, such as the heading of the
|
|
2855
|
-
* section it sits in.
|
|
2856
|
-
*
|
|
2857
|
-
* Prefer this to `label` whenever the name is already on the screen, so
|
|
2858
|
-
* that the drawn name and the announced one cannot drift apart. When both
|
|
2859
|
-
* are given, this one wins.
|
|
2860
|
-
*/
|
|
2861
|
-
labelledBy?: string;
|
|
2862
|
-
/**
|
|
2863
|
-
* The name shared by the group's radio inputs, as an HTML form would use.
|
|
2864
|
-
*
|
|
2865
|
-
* One is generated when you leave it out. Set it to submit the choice with
|
|
2866
|
-
* a form, or to keep it stable between renders in a test.
|
|
2867
|
-
*/
|
|
2868
|
-
name?: string;
|
|
2869
|
-
/**
|
|
2870
|
-
* Whether the whole group cannot be used.
|
|
2871
|
-
*
|
|
2872
|
-
* Every option is drawn dimmer, none can be chosen, and the group is
|
|
2873
|
-
* skipped by the Tab key. To disable one option rather than all of them,
|
|
2874
|
-
* set `disabled` on that option.
|
|
2875
|
-
* @default false
|
|
2876
|
-
*/
|
|
2877
|
-
disabled?: boolean;
|
|
2878
|
-
/**
|
|
2879
|
-
* One sentence saying why the whole group is off, shown only while
|
|
2880
|
-
* `disabled` is true.
|
|
2881
|
-
*
|
|
2882
|
-
* It is appended to the group's own name after a full stop and drawn as the
|
|
2883
|
-
* row's tooltip -- "Node shape. Load data first" -- and it joins the
|
|
2884
|
-
* group's accessible description, so the reason reaches a pointer user and
|
|
2885
|
-
* a screen reader user alike. With no `label` to append to, the sentence
|
|
2886
|
-
* stands on its own.
|
|
2887
|
-
*
|
|
2888
|
-
* It says nothing about one option: a single unavailable choice is
|
|
2889
|
-
* `disabled` on that option, and its own word still names it. THE DEFECT
|
|
2890
|
-
* THIS REPAIRS: a whole group drawn dimmed with no explanation reads as a
|
|
2891
|
-
* broken control, which is what spec:6641 forbids -- and until now this row
|
|
2892
|
-
* had nowhere to put the one reason.
|
|
2893
|
-
*/
|
|
2894
|
-
disabledReason?: string;
|
|
2895
|
-
/**
|
|
2896
|
-
* Draw the word beside the drawing on the selected option only.
|
|
2897
|
-
*
|
|
2898
|
-
* Some option sets have names the panel cannot afford to hide -- layout
|
|
2899
|
-
* names, scale names, method names -- and drawing every word costs a row
|
|
2900
|
-
* the panel does not have. This names the current choice, leaves the
|
|
2901
|
-
* alternatives to be learned by trying them, and still fits one row. It
|
|
2902
|
-
* wants the 224px track: on the 108px one the words squeeze the drawings
|
|
2903
|
-
* down to nothing.
|
|
2904
|
-
* @default false
|
|
2905
|
-
*/
|
|
2906
|
-
hybrid?: boolean;
|
|
2907
|
-
/**
|
|
2908
|
-
* How wide the track is drawn, in pixels, or `"fill"` to take whatever the
|
|
2909
|
-
* row has left over.
|
|
2910
|
-
*
|
|
2911
|
-
* Defaults to the width the option count asks for: 108px for up to three
|
|
2912
|
-
* options and 224px for four to six. Use `"fill"` inside a container that
|
|
2913
|
-
* is not the 280px panel this library measures for.
|
|
2914
|
-
*/
|
|
2915
|
-
width?: number | "fill";
|
|
2916
|
-
/**
|
|
2917
|
-
* The row's 24px trailing slot: an advanced settings button, a control that
|
|
2918
|
-
* resets the row, or nothing.
|
|
2919
|
-
*/
|
|
2920
|
-
trailing?: default_2.ReactNode;
|
|
2921
|
-
/** Called when the focus enters the group, with the option that took it. */
|
|
2922
|
-
onFocus?: default_2.FocusEventHandler<HTMLDivElement>;
|
|
2923
|
-
/** Called when the focus leaves the group. */
|
|
2924
|
-
onBlur?: default_2.FocusEventHandler<HTMLDivElement>;
|
|
3120
|
+
export declare interface InfoCircleProps extends DisclosureProps {
|
|
3121
|
+
/** The explanation. Becomes the accessible description of the info button. */
|
|
3122
|
+
children: default_2.ReactNode;
|
|
3123
|
+
/** Names what is being explained, for the accessible name of the button. */
|
|
3124
|
+
label: string;
|
|
2925
3125
|
}
|
|
2926
3126
|
|
|
2927
3127
|
/**
|
|
2928
|
-
* A
|
|
2929
|
-
*
|
|
2930
|
-
* Use it where an explanation would otherwise become a sentence of its own on a
|
|
2931
|
-
* dense panel: put it immediately after the name of the thing it explains. Give
|
|
2932
|
-
* `label` that name -- the button is announced as "About " and the name, and
|
|
2933
|
-
* the explanation becomes the button's accessible description, so a screen
|
|
2934
|
-
* reader reads the two together.
|
|
3128
|
+
* A name edited in place: the 24px outlined field that replaces a layer, page or collection
|
|
3129
|
+
* name while it is renamed (design/figma-spec.md 10.3).
|
|
2935
3130
|
*
|
|
2936
|
-
*
|
|
2937
|
-
*
|
|
2938
|
-
* the
|
|
2939
|
-
* whatever else was open at the same level; when there is no `PopoutManager`
|
|
2940
|
-
* above it, it supplies its own and works standalone.
|
|
2941
|
-
*
|
|
2942
|
-
* Leave `opened` out and the bubble keeps its own state. Supply it, with
|
|
2943
|
-
* `onOpenChange`, to drive it from yours.
|
|
3131
|
+
* It opens focused with the whole name selected. Enter commits and Escape cancels, and both
|
|
3132
|
+
* hand focus back to whatever held it before the field opened -- the row it came from. Leaving
|
|
3133
|
+
* the field any other way (a click elsewhere, Tab) commits and lets focus go where it was sent.
|
|
2944
3134
|
* @param props - Component props
|
|
2945
|
-
* @param props.
|
|
2946
|
-
* @param props.
|
|
2947
|
-
* @param props.
|
|
2948
|
-
* @param props.
|
|
2949
|
-
* @param props.
|
|
2950
|
-
* @returns The
|
|
2951
|
-
* @example
|
|
2952
|
-
* ```tsx
|
|
2953
|
-
* <Group gap={4}>
|
|
2954
|
-
* <Text>Resolution</Text>
|
|
2955
|
-
* <InfoCircle label="Resolution">
|
|
2956
|
-
* Higher resolution finds more, smaller communities.
|
|
2957
|
-
* </InfoCircle>
|
|
2958
|
-
* </Group>
|
|
2959
|
-
* ```
|
|
3135
|
+
* @param props.value - The current name
|
|
3136
|
+
* @param props.onCommit - Called once with the new name
|
|
3137
|
+
* @param props.onCancel - Called when Escape abandons the edit
|
|
3138
|
+
* @param props.label - The field's accessible name
|
|
3139
|
+
* @param props.width - The field's width
|
|
3140
|
+
* @returns The rename field
|
|
2960
3141
|
*/
|
|
2961
|
-
export declare function
|
|
3142
|
+
export declare function InlineRename({ value, onCommit, onCancel, label, width, }: InlineRenameProps): default_2.JSX.Element;
|
|
2962
3143
|
|
|
2963
3144
|
/**
|
|
2964
|
-
* Props for the
|
|
3145
|
+
* Props for the InlineRename component.
|
|
2965
3146
|
*/
|
|
2966
|
-
export declare interface
|
|
2967
|
-
/** The
|
|
2968
|
-
|
|
2969
|
-
/**
|
|
2970
|
-
|
|
3147
|
+
export declare interface InlineRenameProps {
|
|
3148
|
+
/** The current name. The field opens holding it, wholly selected. */
|
|
3149
|
+
value: string;
|
|
3150
|
+
/** Called once with the new name, on Enter or when the field loses focus. */
|
|
3151
|
+
onCommit: (name: string) => void;
|
|
3152
|
+
/** Called when Escape abandons the edit. */
|
|
3153
|
+
onCancel?: () => void;
|
|
3154
|
+
/** The field's accessible name. Defaults to "Name". */
|
|
3155
|
+
label?: string;
|
|
3156
|
+
/** The field's width: a number of pixels or any CSS length. Defaults to filling its slot. */
|
|
3157
|
+
width?: number | string;
|
|
2971
3158
|
}
|
|
2972
3159
|
|
|
2973
3160
|
/**
|
|
2974
3161
|
* Whether a value names a glyph in the closed field register.
|
|
2975
3162
|
*
|
|
2976
3163
|
* A field's `glyph` prop takes a register name, one of the five capital
|
|
2977
|
-
* letters, or an arbitrary node such as a
|
|
3164
|
+
* letters, or an arbitrary node such as a color swatch; this is how a row type
|
|
2978
3165
|
* tells the first case from the third.
|
|
2979
3166
|
* @param value - The candidate glyph
|
|
2980
3167
|
* @returns True when the value is a name in the closed field register
|
|
@@ -2984,13 +3171,21 @@ export declare function isFieldGlyphName(value: unknown): value is FieldGlyphNam
|
|
|
2984
3171
|
/**
|
|
2985
3172
|
* Whether a value is one of the five capital letters allowed in a field slot.
|
|
2986
3173
|
*
|
|
2987
|
-
* A letter draws as an 11px capital in the secondary text
|
|
3174
|
+
* A letter draws as an 11px capital in the secondary text color instead of an
|
|
2988
3175
|
* SVG, for a concept no drawing stands for.
|
|
2989
3176
|
* @param value - The candidate glyph
|
|
2990
3177
|
* @returns True when the value is one of `N`, `E`, `W`, `D` or `K`
|
|
2991
3178
|
*/
|
|
2992
3179
|
export declare function isFieldLetter(value: unknown): value is FieldLetter;
|
|
2993
3180
|
|
|
3181
|
+
/**
|
|
3182
|
+
* Whether a color is light enough to need the swatch ring Figma draws on
|
|
3183
|
+
* near-white colors (every channel at or above 0xE0).
|
|
3184
|
+
* @param color - a hex color
|
|
3185
|
+
* @returns true for near-white colors
|
|
3186
|
+
*/
|
|
3187
|
+
export declare function isLightColor(color: string): boolean;
|
|
3188
|
+
|
|
2994
3189
|
/**
|
|
2995
3190
|
* Whether text runs right to left.
|
|
2996
3191
|
* @param direction - The text direction in force
|
|
@@ -3076,6 +3271,36 @@ export declare const MAX_ALPHA_HEX = 255;
|
|
|
3076
3271
|
/** Maximum opacity percentage value */
|
|
3077
3272
|
export declare const MAX_OPACITY_PERCENT = 100;
|
|
3078
3273
|
|
|
3274
|
+
/**
|
|
3275
|
+
* A menu row with Figma's 16 x 16 check column (design/figma-spec.md 8.1): the
|
|
3276
|
+
* white 9 x 8.5 check shows when `checked` and is invisible (but keeps its
|
|
3277
|
+
* space) when not, so the labels of a menu's rows stay aligned 32px from its
|
|
3278
|
+
* edge. Use it inside a Mantine `Menu.Dropdown` beside ordinary items.
|
|
3279
|
+
* @param props - Component props
|
|
3280
|
+
* @param props.checked - Whether the row is checked
|
|
3281
|
+
* @param props.radio - Whether the row is one of a set of radio rows
|
|
3282
|
+
* @returns The menu row
|
|
3283
|
+
* @example
|
|
3284
|
+
* ```tsx
|
|
3285
|
+
* <Menu.Dropdown>
|
|
3286
|
+
* <MenuCheckItem checked={rulers} onClick={toggleRulers}>Rulers</MenuCheckItem>
|
|
3287
|
+
* <MenuCheckItem checked={grid} onClick={toggleGrid}>Pixel grid</MenuCheckItem>
|
|
3288
|
+
* </Menu.Dropdown>
|
|
3289
|
+
* ```
|
|
3290
|
+
*/
|
|
3291
|
+
export declare function MenuCheckItem({ checked, radio, ...props }: MenuCheckItemProps): JSX.Element;
|
|
3292
|
+
|
|
3293
|
+
/**
|
|
3294
|
+
* Props for MenuCheckItem: every `Menu.Item` prop except the leading section,
|
|
3295
|
+
* which is the check column, plus the checked state.
|
|
3296
|
+
*/
|
|
3297
|
+
export declare interface MenuCheckItemProps extends Omit<MenuItemProps, "leftSection">, Omit<ComponentPropsWithoutRef<"button">, keyof MenuItemProps | "role"> {
|
|
3298
|
+
/** Whether the row is checked: the white check shows in the 16px column. */
|
|
3299
|
+
checked: boolean;
|
|
3300
|
+
/** Render a `menuitemradio` (one of a set) instead of a `menuitemcheckbox`. */
|
|
3301
|
+
radio?: boolean;
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3079
3304
|
/**
|
|
3080
3305
|
* One reading, with a bar for where it falls in its distribution and a chip for
|
|
3081
3306
|
* its rank.
|
|
@@ -3117,7 +3342,7 @@ export declare function MetricRow({ name, percentile, value, rank, busy, live, o
|
|
|
3117
3342
|
* Props for the MetricRow component.
|
|
3118
3343
|
*/
|
|
3119
3344
|
export declare interface MetricRowProps {
|
|
3120
|
-
/** The metric's own name. Shown at
|
|
3345
|
+
/** The metric's own name. Shown at 11px, and shortened with an ellipsis when the row is too narrow for it. */
|
|
3121
3346
|
name: string;
|
|
3122
3347
|
/** Where the value falls in its distribution, from 0 to 100. Values outside that range are clamped rather than drawn off the end of the bar. */
|
|
3123
3348
|
percentile: number;
|
|
@@ -3164,7 +3389,7 @@ export declare interface MetricRowProps {
|
|
|
3164
3389
|
* The event comes first, so you can read modifier keys for a multiple
|
|
3165
3390
|
* selection and call `preventDefault`. The second argument states whether
|
|
3166
3391
|
* the activation came from a pointer or from the keyboard, which is the
|
|
3167
|
-
* distinction selection
|
|
3392
|
+
* distinction selection behavior usually turns on.
|
|
3168
3393
|
*
|
|
3169
3394
|
* Supplying it makes the row a real button: focusable, with a pointer
|
|
3170
3395
|
* cursor, and answering Enter and Space.
|
|
@@ -3191,6 +3416,102 @@ export declare interface MetricRowProps {
|
|
|
3191
3416
|
onBlur?: default_2.FocusEventHandler<HTMLDivElement>;
|
|
3192
3417
|
}
|
|
3193
3418
|
|
|
3419
|
+
/**
|
|
3420
|
+
* The color a fraction of the way between two hex colors, channel by channel.
|
|
3421
|
+
* Used when a click on a gradient bar adds a stop between two others.
|
|
3422
|
+
* @param from - the color at 0
|
|
3423
|
+
* @param to - the color at 1
|
|
3424
|
+
* @param t - how far along, 0 to 1
|
|
3425
|
+
* @returns `#RRGGBB`, upper case
|
|
3426
|
+
*/
|
|
3427
|
+
export declare function mixHex(from: string, to: string, t: number): string;
|
|
3428
|
+
|
|
3429
|
+
/**
|
|
3430
|
+
* The button bar at the bottom of a Modal (design/figma-spec.md 8.5): 40 tall
|
|
3431
|
+
* across the modal's full width, a 1px divider above it, padding 0 8 0 16, its
|
|
3432
|
+
* buttons end-aligned 8px apart. Put it last inside the Modal's children, with
|
|
3433
|
+
* the secondary action (Cancel) first and the primary or danger action last.
|
|
3434
|
+
* @param props - Box props and div attributes
|
|
3435
|
+
* @param props.className - Extra classes, merged with the footer's own
|
|
3436
|
+
* @returns The footer
|
|
3437
|
+
* @example
|
|
3438
|
+
* ```tsx
|
|
3439
|
+
* <Modal opened={opened} onClose={close} title="Save to version history">
|
|
3440
|
+
* <TextInput data-autofocus aria-label="Title" />
|
|
3441
|
+
* <ModalFooter>
|
|
3442
|
+
* <Button variant="default" onClick={close}>Cancel</Button>
|
|
3443
|
+
* <Button disabled={!valid}>Save</Button>
|
|
3444
|
+
* </ModalFooter>
|
|
3445
|
+
* </Modal>
|
|
3446
|
+
* ```
|
|
3447
|
+
*/
|
|
3448
|
+
export declare function ModalFooter({ className, ...props }: ModalFooterProps): JSX.Element;
|
|
3449
|
+
|
|
3450
|
+
/**
|
|
3451
|
+
* Props for ModalFooter: a Box and any div attribute.
|
|
3452
|
+
*/
|
|
3453
|
+
export declare interface ModalFooterProps extends BoxProps, Omit<ComponentPropsWithoutRef<"div">, keyof BoxProps> {
|
|
3454
|
+
}
|
|
3455
|
+
|
|
3456
|
+
/**
|
|
3457
|
+
* Apply a move that `Tree`'s `onMove` reported: take the item out of the list and insert it at
|
|
3458
|
+
* `index` among `parentId`'s children (the top level when `parentId` is null). Works on your own
|
|
3459
|
+
* item type, so every other field comes through untouched. Returns a new list; an unknown id
|
|
3460
|
+
* returns a copy of the list unchanged.
|
|
3461
|
+
* @param items - the tree, top level first
|
|
3462
|
+
* @param move - the move `onMove` reported
|
|
3463
|
+
* @returns the moved tree
|
|
3464
|
+
* @example
|
|
3465
|
+
* ```tsx
|
|
3466
|
+
* <Tree items={items} label="Layers" onMove={(move) => setItems(moveTreeItem(items, move))} />
|
|
3467
|
+
* ```
|
|
3468
|
+
*/
|
|
3469
|
+
export declare function moveTreeItem<T extends TreeLike<T>>(items: readonly T[], move: TreeMove): T[];
|
|
3470
|
+
|
|
3471
|
+
/** The navigation rail, with `NavRail.Separator`. */
|
|
3472
|
+
export declare const NavRail: typeof NavRailRoot & {
|
|
3473
|
+
Separator: typeof NavRailSeparator;
|
|
3474
|
+
};
|
|
3475
|
+
|
|
3476
|
+
/**
|
|
3477
|
+
* Props for the NavRail component.
|
|
3478
|
+
*/
|
|
3479
|
+
export declare interface NavRailProps extends BoxProps, ElementProps<"div"> {
|
|
3480
|
+
/** Accessible name of the rail. Defaults to the "Navigation" label. */
|
|
3481
|
+
"aria-label"?: string;
|
|
3482
|
+
/** Buttons pinned to the rail's foot, 8px apart (a 32 icon button with a notification dot). */
|
|
3483
|
+
footer?: default_2.ReactNode;
|
|
3484
|
+
/** Rail buttons and separators, top to bottom. */
|
|
3485
|
+
children?: default_2.ReactNode;
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3488
|
+
/**
|
|
3489
|
+
* The vertical navigation rail at the window's start edge (Figma's navigation bar): 56 wide plus
|
|
3490
|
+
* a 1px end border, padding 8 top and 16 bottom, full height. One Tab stop; ArrowUp / ArrowDown /
|
|
3491
|
+
* Home / End move between its buttons, Enter or Space activates.
|
|
3492
|
+
* @param props - Component props
|
|
3493
|
+
* @param props.footer - Buttons pinned to the rail's foot
|
|
3494
|
+
* @param props.children - Rail buttons and separators
|
|
3495
|
+
* @param props.className - Extra class on the root
|
|
3496
|
+
* @param props.onKeyDown - Called before the roving-focus key handling
|
|
3497
|
+
* @param props.onFocus - Called before the roving-focus bookkeeping
|
|
3498
|
+
* @returns The rail
|
|
3499
|
+
*/
|
|
3500
|
+
declare function NavRailRoot({ footer, children, className, onKeyDown, onFocus, ...others }: NavRailProps): default_2.JSX.Element;
|
|
3501
|
+
|
|
3502
|
+
/**
|
|
3503
|
+
* The rail's 16 x 1 separator (8px above, 7px below).
|
|
3504
|
+
* @returns The separator
|
|
3505
|
+
*/
|
|
3506
|
+
declare function NavRailSeparator(): default_2.JSX.Element;
|
|
3507
|
+
|
|
3508
|
+
/**
|
|
3509
|
+
* Expand a 3-, 4-, 6- or 8-digit hex color into `#RRGGBBAA`, upper case.
|
|
3510
|
+
* @param color - a hex color, with or without `#`
|
|
3511
|
+
* @returns the 8-digit form, or `undefined` when the text is not a hex color
|
|
3512
|
+
*/
|
|
3513
|
+
export declare function normalizeHexa(color: string): string | undefined;
|
|
3514
|
+
|
|
3194
3515
|
/**
|
|
3195
3516
|
* Converts an opacity percentage (0-100) to a hex alpha string (00-ff).
|
|
3196
3517
|
* @param opacity - Opacity as a percentage from 0 to 100
|
|
@@ -3210,244 +3531,222 @@ export declare function opacityToAlphaHex(opacity: number): string;
|
|
|
3210
3531
|
*/
|
|
3211
3532
|
export declare type OpenChangeHandler = (opened: boolean, event?: default_2.SyntheticEvent) => void;
|
|
3212
3533
|
|
|
3534
|
+
/**
|
|
3535
|
+
* A page list (design/figma-spec.md 10.2): Figma's own accessible model, a one-column grid with
|
|
3536
|
+
* 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.
|
|
3538
|
+
* @param props - Component props
|
|
3539
|
+
* @param props.items - The items or pages
|
|
3540
|
+
* @param props.current - The current page (controlled)
|
|
3541
|
+
* @param props.defaultCurrent - The current page to start with
|
|
3542
|
+
* @param props.onCurrentChange - Called when a page is switched to
|
|
3543
|
+
* @param props.tone - Page or group look
|
|
3544
|
+
* @param props.label - The accessible name
|
|
3545
|
+
* @param props.onRename - Called with a new name; turns renaming on
|
|
3546
|
+
* @param props.renameLabel - The rename field's accessible name
|
|
3547
|
+
* @returns The list
|
|
3548
|
+
*/
|
|
3549
|
+
export declare function PageList({ items, current, defaultCurrent, onCurrentChange, tone, label, onRename, renameLabel, }: PageListProps): default_2.JSX.Element;
|
|
3550
|
+
|
|
3551
|
+
/** One entry of a PageList. */
|
|
3552
|
+
export declare interface PageListItem {
|
|
3553
|
+
id: string;
|
|
3554
|
+
name: string;
|
|
3555
|
+
/** A divider row: drawn as a line, skipped by the arrow keys. */
|
|
3556
|
+
divider?: boolean;
|
|
3557
|
+
}
|
|
3558
|
+
|
|
3559
|
+
/**
|
|
3560
|
+
* Props for the PageList component.
|
|
3561
|
+
*/
|
|
3562
|
+
export declare interface PageListProps {
|
|
3563
|
+
/** The pages, in order. */
|
|
3564
|
+
items: readonly PageListItem[];
|
|
3565
|
+
/** The current page (controlled). */
|
|
3566
|
+
current?: string;
|
|
3567
|
+
/** The current page to start with (uncontrolled). */
|
|
3568
|
+
defaultCurrent?: string;
|
|
3569
|
+
/** Called when a page is switched to, by click, Enter or Space. */
|
|
3570
|
+
onCurrentChange?: (id: string, event?: default_2.SyntheticEvent) => void;
|
|
3571
|
+
/** `"group"` draws the collection-group look (selected blue, weight 600). Default `"page"`. */
|
|
3572
|
+
tone?: "page" | "group";
|
|
3573
|
+
/** The list's accessible name. Defaults to "Pages". */
|
|
3574
|
+
label?: string;
|
|
3575
|
+
/** Called with a new name. Giving it turns on renaming (F2 or a double-click). */
|
|
3576
|
+
onRename?: (id: string, name: string) => void;
|
|
3577
|
+
/** The accessible name of the rename field. Defaults to "Page name". */
|
|
3578
|
+
renameLabel?: string;
|
|
3579
|
+
}
|
|
3580
|
+
|
|
3581
|
+
/**
|
|
3582
|
+
* One row of a page list (design/figma-spec.md 10.2): a 240 x 32 grid cell (padding 4 8) around
|
|
3583
|
+
* a 224 x 24 pill, text 16px in at 11/24. Hover fills the pill; the current page is gray and
|
|
3584
|
+
* weight 550. The cell carries the focus ring (1px, radius 5, offset 0).
|
|
3585
|
+
* @param props - Component props
|
|
3586
|
+
* @returns The row
|
|
3587
|
+
*/
|
|
3588
|
+
export declare const PageRow: default_2.ForwardRefExoticComponent<PageRowProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
3589
|
+
|
|
3590
|
+
/**
|
|
3591
|
+
* Props for the PageRow component.
|
|
3592
|
+
*/
|
|
3593
|
+
export declare interface PageRowProps extends Omit<default_2.HTMLAttributes<HTMLDivElement>, "children" | "onSelect"> {
|
|
3594
|
+
/** The page's name. Ignored by a divider row. */
|
|
3595
|
+
name: string;
|
|
3596
|
+
/** This is the page on screen (gray fill, weight 550; `aria-current="page"`). */
|
|
3597
|
+
current?: boolean;
|
|
3598
|
+
/** `"group"`: a selectable group in a collection list (selected blue, weight 600). */
|
|
3599
|
+
tone?: "page" | "group";
|
|
3600
|
+
/** For `tone="group"`: whether the group is selected. */
|
|
3601
|
+
selected?: boolean;
|
|
3602
|
+
/** Draw a divider line instead of a name. */
|
|
3603
|
+
divider?: boolean;
|
|
3604
|
+
/** Drawn in place of the name, e.g. an InlineRename. */
|
|
3605
|
+
nameSlot?: default_2.ReactNode;
|
|
3606
|
+
/** The focusable cell's tab index (PageList manages it). Default 0. */
|
|
3607
|
+
tabIndex?: number;
|
|
3608
|
+
}
|
|
3609
|
+
|
|
3213
3610
|
/**
|
|
3214
3611
|
* The pixel grid every panel row is measured against.
|
|
3215
3612
|
*
|
|
3216
|
-
* All members are pixels. Import them; a literal `24`, `
|
|
3217
|
-
*
|
|
3218
|
-
*
|
|
3613
|
+
* All members are pixels. Import them; a literal `24`, `88` or `32` written into a component is
|
|
3614
|
+
* a bug, because it hides the fact that the number is part of one identity that has to keep
|
|
3615
|
+
* adding up to 240.
|
|
3219
3616
|
*/
|
|
3220
3617
|
export declare const PANEL_GRID: {
|
|
3221
|
-
/** the width of the panel column every row is laid out in */
|
|
3222
|
-
readonly WIDTH:
|
|
3618
|
+
/** the width of the panel column every row is laid out in (241 with its 1px edge) */
|
|
3619
|
+
readonly WIDTH: 240;
|
|
3223
3620
|
/** left panel padding: where the content band begins */
|
|
3224
3621
|
readonly PAD_LEFT: 16;
|
|
3225
|
-
/** right panel padding
|
|
3622
|
+
/** right panel padding */
|
|
3226
3623
|
readonly PAD_RIGHT: 8;
|
|
3227
|
-
/** x 16 to x
|
|
3228
|
-
readonly CONTENT:
|
|
3229
|
-
/** a control that
|
|
3230
|
-
readonly BODY:
|
|
3624
|
+
/** x 16 to x 232 */
|
|
3625
|
+
readonly CONTENT: 216;
|
|
3626
|
+
/** a control that spans both fields and still leaves a trailing slot */
|
|
3627
|
+
readonly BODY: 184;
|
|
3231
3628
|
/** one of a pair */
|
|
3232
|
-
readonly FIELD:
|
|
3629
|
+
readonly FIELD: 88;
|
|
3233
3630
|
/** between the two fields of a pair */
|
|
3234
3631
|
readonly GUTTER: 8;
|
|
3235
3632
|
/** between the body and the trailing slot */
|
|
3236
3633
|
readonly TRAIL_GAP: 8;
|
|
3237
|
-
/** the fixed trailing slot at x
|
|
3634
|
+
/** the fixed trailing slot at x 208..232: an advanced settings button, a reset control, or nothing */
|
|
3238
3635
|
readonly TRAIL: 24;
|
|
3239
|
-
/** one of three
|
|
3240
|
-
readonly TRIPLE:
|
|
3241
|
-
/** between two
|
|
3242
|
-
readonly TRIPLE_GAP:
|
|
3636
|
+
/** one of three segments: the body shared three ways, no gaps */
|
|
3637
|
+
readonly TRIPLE: number;
|
|
3638
|
+
/** between two segments: joined */
|
|
3639
|
+
readonly TRIPLE_GAP: 0;
|
|
3243
3640
|
/** every field, button and icon button in a panel row */
|
|
3244
3641
|
readonly CONTROL_HEIGHT: 24;
|
|
3245
|
-
/** 24px control
|
|
3642
|
+
/** a single row: a 24px control in a 32px row */
|
|
3246
3643
|
readonly ROW_PITCH: 32;
|
|
3247
|
-
/**
|
|
3248
|
-
readonly TOGGLE_PITCH:
|
|
3249
|
-
/** a
|
|
3250
|
-
readonly DATA_PITCH:
|
|
3251
|
-
/** the section header row
|
|
3252
|
-
readonly SECTION_HEADER:
|
|
3644
|
+
/** a checkbox row in a panel (24 in dialogs) */
|
|
3645
|
+
readonly TOGGLE_PITCH: 32;
|
|
3646
|
+
/** list and tree rows: a 24 pill in a 32 row */
|
|
3647
|
+
readonly DATA_PITCH: 32;
|
|
3648
|
+
/** the section header row */
|
|
3649
|
+
readonly SECTION_HEADER: 40;
|
|
3253
3650
|
/** the pad below a section's last content row */
|
|
3254
|
-
readonly SECTION_PAD_BOTTOM:
|
|
3255
|
-
/**
|
|
3256
|
-
readonly GLYPH_SLOT:
|
|
3257
|
-
/** the drawn size of a glyph inside its slot */
|
|
3258
|
-
readonly GLYPH:
|
|
3259
|
-
/** the
|
|
3260
|
-
readonly CHEVRON:
|
|
3651
|
+
readonly SECTION_PAD_BOTTOM: 12;
|
|
3652
|
+
/** a field's leading slot, and the scrub handle */
|
|
3653
|
+
readonly GLYPH_SLOT: 24;
|
|
3654
|
+
/** the nominal drawn size of a glyph inside its slot (10-14 allowed) */
|
|
3655
|
+
readonly GLYPH: 12;
|
|
3656
|
+
/** the box of a chevron, an X and a reset; carets are drawn 5 x 3 inside it */
|
|
3657
|
+
readonly CHEVRON: 10;
|
|
3261
3658
|
/** the value text begins here, measured from the field's leading edge */
|
|
3262
3659
|
readonly VALUE_INSET: 24;
|
|
3263
3660
|
/** one row pitch of chart */
|
|
3264
3661
|
readonly SPARKLINE_HEIGHT: 32;
|
|
3265
3662
|
/** two row pitches of chart */
|
|
3266
3663
|
readonly HISTOGRAM_HEIGHT: 64;
|
|
3267
|
-
/** the label column
|
|
3268
|
-
readonly LABEL_COLUMN:
|
|
3664
|
+
/** the label column of a popover row (64-72) */
|
|
3665
|
+
readonly LABEL_COLUMN: 72;
|
|
3666
|
+
/** a field row with a legend: 16 legend + 4 + 24 control + 4 */
|
|
3667
|
+
readonly FIELD_ROW: 48;
|
|
3668
|
+
/** a 9/14 caption above each column + 3 + 24 */
|
|
3669
|
+
readonly CAPTION_ROW: 50;
|
|
3670
|
+
/** the legend band */
|
|
3671
|
+
readonly LEGEND: 16;
|
|
3672
|
+
/** a light popover's default width */
|
|
3673
|
+
readonly POPOVER_WIDTH: 240;
|
|
3674
|
+
/** a popover or modal header */
|
|
3675
|
+
readonly POPOVER_HEADER: 40;
|
|
3269
3676
|
};
|
|
3270
3677
|
|
|
3271
3678
|
/**
|
|
3272
|
-
* The panel ink map: one
|
|
3273
|
-
* paints.
|
|
3679
|
+
* The panel ink map: one `--cm-*` token per color role a panel row paints (spec 2.2).
|
|
3274
3680
|
*
|
|
3275
|
-
* Every
|
|
3276
|
-
* correctly in
|
|
3277
|
-
*
|
|
3278
|
-
* in only one of the two schemes.
|
|
3279
|
-
*
|
|
3280
|
-
* A hex in the notes below is the value the token resolves to in the dark
|
|
3281
|
-
* scheme, quoted so the intended shade is recognisable. Contrast ratios are
|
|
3282
|
-
* WCAG 2.x ratios measured from this library's own theme, in the scheme named
|
|
3283
|
-
* beside them.
|
|
3681
|
+
* Every value resolves per element from its `color-scheme`, so the same component reads
|
|
3682
|
+
* correctly in light, in dark, inside a dark-scoped menu, and in the AA mode. Light / dark hex
|
|
3683
|
+
* values are quoted in the notes.
|
|
3284
3684
|
*/
|
|
3285
3685
|
export declare const PANEL_INK: {
|
|
3286
|
-
/** primary text:
|
|
3287
|
-
readonly VALUE: "var(--
|
|
3288
|
-
/**
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
readonly
|
|
3298
|
-
/**
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
readonly
|
|
3318
|
-
/**
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
* token move.
|
|
3351
|
-
*/
|
|
3352
|
-
readonly SURFACE: "light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-6))";
|
|
3353
|
-
/** the panel itself, and therefore the hairline that divides a compound row (#1f2428) */
|
|
3354
|
-
readonly PANEL: "var(--mantine-color-body)";
|
|
3355
|
-
/**
|
|
3356
|
-
* the raised surface: the ground under a small chip's label, and the track
|
|
3357
|
-
* a bar's fill runs along (#374047).
|
|
3358
|
-
*
|
|
3359
|
-
* One step further from the panel than `SURFACE`, in the same direction.
|
|
3360
|
-
* Like `SURFACE` it flips between the schemes, which
|
|
3361
|
-
* `--mantine-color-default-hover` does not -- in the light scheme that
|
|
3362
|
-
* token is #f8f9fa and would be indistinguishable from the surface under
|
|
3363
|
-
* it.
|
|
3364
|
-
*
|
|
3365
|
-
* This is not the ground of a selected item; that is `SELECTED`. The two
|
|
3366
|
-
* pull in opposite directions and cannot be one value. A raised ground has
|
|
3367
|
-
* things drawn *on* it -- a chip's label, a bar's coloured fill -- so in
|
|
3368
|
-
* the dark scheme it has to stay dark enough for those to stay legible. A
|
|
3369
|
-
* selected item is the other way round: it has to separate from the track
|
|
3370
|
-
* around it, which in the dark scheme means going lighter. Lifting this
|
|
3371
|
-
* token to serve a selected item is what made a chip's label and a bar's
|
|
3372
|
-
* fill unreadable, so the two roles are two tokens.
|
|
3373
|
-
*
|
|
3374
|
-
* One pairing on this token is still short of WCAG AA, and it cannot be
|
|
3375
|
-
* fixed by moving it. A chip labelled in the secondary text colour
|
|
3376
|
-
* measures 4.43:1 in the dark scheme against the 4.5:1 for text; the same
|
|
3377
|
-
* chip labelled in the primary text colour measures 7.33:1, which is what
|
|
3378
|
-
* the row draws. An accent fill on this track measures 3.53:1 (dark) and
|
|
3379
|
-
* 3.86:1 (light), past the 3:1 for a shape that carries meaning.
|
|
3380
|
-
*/
|
|
3381
|
-
readonly RAISED: "light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5))";
|
|
3382
|
-
/**
|
|
3383
|
-
* the ground of the selected item in a group: the checked segment of a
|
|
3384
|
-
* segmented control, the current tile of an icon group, the active choice
|
|
3385
|
-
* in a set of buttons.
|
|
3386
|
-
*
|
|
3387
|
-
* It inverts -- light in the dark scheme, dark in the light scheme -- so a
|
|
3388
|
-
* selected item reads as a solid patch against its track rather than as a
|
|
3389
|
-
* slightly different shade of it. Against `SURFACE`, which is what a track
|
|
3390
|
-
* is painted with, it measures 5.59:1 in the dark scheme and 7.35:1 in the
|
|
3391
|
-
* light one, past the 3:1 that WCAG 2.2 (1.4.11) asks of the visual
|
|
3392
|
-
* boundary that distinguishes a control's state. Against the panel it
|
|
3393
|
-
* measures 6.56:1 and 8.18:1, so it also survives a selected item that
|
|
3394
|
-
* sits directly on the panel.
|
|
3395
|
-
*
|
|
3396
|
-
* Label it with `ON_SELECTED` rather than `VALUE`: a ground bright enough
|
|
3397
|
-
* to satisfy 1.4.11 against its track is too bright to carry the primary
|
|
3398
|
-
* text colour, which measures only 1.66:1 on it in the dark scheme.
|
|
3399
|
-
*
|
|
3400
|
-
* See `RAISED` for why the selected state and the raised surface are not
|
|
3401
|
-
* one token.
|
|
3402
|
-
*/
|
|
3403
|
-
readonly SELECTED: "light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))";
|
|
3404
|
-
/**
|
|
3405
|
-
* the text and glyphs drawn on `SELECTED`.
|
|
3406
|
-
*
|
|
3407
|
-
* The panel's own colour, so the label of a selected item reads as a shape
|
|
3408
|
-
* punched out of a solid patch. It measures 6.56:1 against `SELECTED` in
|
|
3409
|
-
* the dark scheme and 8.18:1 in the light one, past the 4.5:1 WCAG AA
|
|
3410
|
-
* (1.4.3) requirement for text.
|
|
3411
|
-
*/
|
|
3412
|
-
readonly ON_SELECTED: "var(--mantine-color-body)";
|
|
3413
|
-
/**
|
|
3414
|
-
* borders, chart bars and the chart baseline.
|
|
3415
|
-
*
|
|
3416
|
-
* Lifted from the #48525c of the original palette, which measured 1.97:1
|
|
3417
|
-
* on the panel against the 3:1 WCAG AA requirement for meaningful non-text
|
|
3418
|
-
* such as a chart bar. This is the dimmest step of the palette that meets
|
|
3419
|
-
* 3:1 on the panel in both colour schemes.
|
|
3420
|
-
*/
|
|
3421
|
-
readonly BORDER: "light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))";
|
|
3422
|
-
/** the 1px rule above a section header, at the weight of `BORDER` */
|
|
3423
|
-
readonly DIVIDER: "light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))";
|
|
3424
|
-
/**
|
|
3425
|
-
* accent: a checked box, the highlighted bin, a filled micro-bar, the Run
|
|
3426
|
-
* button (#1971c2, blue-8, in the light scheme; #339af0, blue-5, in the
|
|
3427
|
-
* dark one).
|
|
3428
|
-
*
|
|
3429
|
-
* The theme sets `primaryShade` so the fill stands at least 3:1 off the
|
|
3430
|
-
* panel, a field and the raised surface in both schemes (WCAG 1.4.11):
|
|
3431
|
-
* 3.86:1 or more in the light scheme, 3.53:1 or more in the dark one.
|
|
3432
|
-
*
|
|
3433
|
-
* This token and `ON_ACCENT` follow a consumer's own `primaryColor`;
|
|
3434
|
-
* `WARNING`, `SUCCESS` and `DANGER` are stock Mantine yellow, green and
|
|
3435
|
-
* red. The theme sets no `primaryColor`, so a consumer who sets one gets
|
|
3436
|
-
* it throughout.
|
|
3437
|
-
*/
|
|
3438
|
-
readonly ACCENT: "var(--mantine-primary-color-filled)";
|
|
3439
|
-
/**
|
|
3440
|
-
* text and glyphs drawn on the accent: white in the light scheme (5.02:1)
|
|
3441
|
-
* and black in the dark one (7.02:1), chosen by the theme's `autoContrast`
|
|
3442
|
-
* from the fill's luminance, so both pass WCAG 1.4.3's 4.5:1.
|
|
3443
|
-
*/
|
|
3444
|
-
readonly ON_ACCENT: "var(--mantine-primary-color-contrast)";
|
|
3445
|
-
/** the warning glyph on a departure line (#fab005) */
|
|
3446
|
-
readonly WARNING: "var(--mantine-color-yellow-6)";
|
|
3447
|
-
/** success (#40c057) */
|
|
3448
|
-
readonly SUCCESS: "var(--mantine-color-green-6)";
|
|
3449
|
-
/** danger (#fa5252) */
|
|
3450
|
-
readonly DANGER: "var(--mantine-color-red-6)";
|
|
3686
|
+
/** primary text: a field's value, a row's name (#000000e5 / #fff) */
|
|
3687
|
+
readonly VALUE: "var(--cm-text)";
|
|
3688
|
+
/** secondary text: glyph labels, unit suffixes, legends (#00000080 / #ffffffb2) */
|
|
3689
|
+
readonly CHROME: "var(--cm-text-secondary)";
|
|
3690
|
+
/** reading prose (secondary text) */
|
|
3691
|
+
readonly PROSE: "var(--cm-text-secondary)";
|
|
3692
|
+
/** placeholder text (#0000004d / #ffffff66; darker in the AA mode) */
|
|
3693
|
+
readonly PLACEHOLDER: "var(--cm-text-tertiary)";
|
|
3694
|
+
/** the text and glyphs of a control that cannot be operated (exempt from contrast minimums) */
|
|
3695
|
+
readonly DISABLED: "var(--cm-text-disabled)";
|
|
3696
|
+
/** a field's fill, a segmented track (#f5f5f5 / #383838) */
|
|
3697
|
+
readonly SURFACE: "var(--cm-bg-secondary)";
|
|
3698
|
+
/** the panel itself (#fff / #2c2c2c) */
|
|
3699
|
+
readonly PANEL: "var(--cm-bg)";
|
|
3700
|
+
/** a raised or pressed ground: a chip's label ground, a bar's track (#e6e6e6 / #444) */
|
|
3701
|
+
readonly RAISED: "var(--cm-bg-pressed)";
|
|
3702
|
+
/** a selected item's ground (#e5f4ff / #394360) */
|
|
3703
|
+
readonly SELECTED: "var(--cm-bg-selected)";
|
|
3704
|
+
/** the glyph on a selected item (#007be5 / #7cc4f8) */
|
|
3705
|
+
readonly ON_SELECTED: "var(--cm-icon-brand)";
|
|
3706
|
+
/** borders, chart bars, the chart baseline (#e6e6e6 / #444) */
|
|
3707
|
+
readonly BORDER: "var(--cm-border)";
|
|
3708
|
+
/** the 1px divider (#e6e6e6 / #444) */
|
|
3709
|
+
readonly DIVIDER: "var(--cm-border)";
|
|
3710
|
+
/** a filled accent surface: primary button, checked box (#0d99ff / #0c8ce9) */
|
|
3711
|
+
readonly ACCENT: "var(--cm-bg-brand)";
|
|
3712
|
+
/** text and glyphs on the accent (#fff) */
|
|
3713
|
+
readonly ON_ACCENT: "var(--cm-text-onbrand)";
|
|
3714
|
+
/** warning (#ffcd29 / #f3c11b) */
|
|
3715
|
+
readonly WARNING: "var(--cm-bg-warning)";
|
|
3716
|
+
/** success (#14ae5c / #198f51) */
|
|
3717
|
+
readonly SUCCESS: "var(--cm-bg-success)";
|
|
3718
|
+
/** danger (#f24822 / #e03e1a) */
|
|
3719
|
+
readonly DANGER: "var(--cm-bg-danger)";
|
|
3720
|
+
/** a row, tab or tool under the pointer (#f5f5f5 / #383838) */
|
|
3721
|
+
readonly HOVER: "var(--cm-bg-hover)";
|
|
3722
|
+
/** pressed (#e6e6e6 / #444) */
|
|
3723
|
+
readonly PRESSED: "var(--cm-bg-pressed)";
|
|
3724
|
+
/** translucent hover over any ground (#0000000d / #ffffff0d) */
|
|
3725
|
+
readonly TRANSPARENT_HOVER: "var(--cm-bg-transparent-hover)";
|
|
3726
|
+
/** translucent pressed over any ground (#0000001a / #ffffff1a) */
|
|
3727
|
+
readonly TRANSPARENT_PRESSED: "var(--cm-bg-transparent-pressed)";
|
|
3728
|
+
/** a selected item under the pointer (#bde3ff / #4a5878) */
|
|
3729
|
+
readonly SELECTED_HOVER: "var(--cm-bg-selected-hover)";
|
|
3730
|
+
/** the children of a selected item (#f2f9ff / #32394d) */
|
|
3731
|
+
readonly SELECTED_SECONDARY: "var(--cm-bg-selected-secondary)";
|
|
3732
|
+
/** links and brand text (#007be5 / #7cc4f8) */
|
|
3733
|
+
readonly BRAND_TEXT: "var(--cm-text-brand)";
|
|
3734
|
+
/** tertiary glyphs (#0000004d / #ffffff66) */
|
|
3735
|
+
readonly TERTIARY: "var(--cm-icon-tertiary)";
|
|
3736
|
+
/** the focus ring (#0d99ff / #0c8ce9) */
|
|
3737
|
+
readonly FOCUS: "var(--cm-border-selected)";
|
|
3738
|
+
/** a translucent hairline: secondary button, panel edge (#0000001a / #ffffff1a) */
|
|
3739
|
+
readonly TRANSLUCENT: "var(--cm-border-translucent)";
|
|
3740
|
+
/** a stronger translucent edge: checkbox, switch track (#00000033 / #ffffff33) */
|
|
3741
|
+
readonly TRANSLUCENT_STRONG: "var(--cm-border-translucent-strong)";
|
|
3742
|
+
/** the dark menu surface, the same in both schemes (#1e1e1e) */
|
|
3743
|
+
readonly MENU: "var(--cm-bg-menu)";
|
|
3744
|
+
/** text on the menu (#fff) */
|
|
3745
|
+
readonly ON_MENU: "var(--cm-text-menu)";
|
|
3746
|
+
/** secondary text on the menu: shortcuts (#ffffffb2) */
|
|
3747
|
+
readonly ON_MENU_SECONDARY: "var(--cm-text-menu-secondary)";
|
|
3748
|
+
/** component (purple) text (#8638e5 / #d1a8ff) */
|
|
3749
|
+
readonly COMPONENT: "var(--cm-text-component)";
|
|
3451
3750
|
};
|
|
3452
3751
|
|
|
3453
3752
|
/**
|
|
@@ -3470,11 +3769,13 @@ export declare const PANEL_INK: {
|
|
|
3470
3769
|
* (`placeholder`), offer a list of choices (`kind="select"`), or have been set
|
|
3471
3770
|
* without taking effect yet (`pending`).
|
|
3472
3771
|
*
|
|
3473
|
-
* The glyph slot is also a drag handle.
|
|
3474
|
-
*
|
|
3475
|
-
*
|
|
3476
|
-
*
|
|
3477
|
-
*
|
|
3772
|
+
* The glyph slot is also a drag handle. A number field scrubs itself: dragging
|
|
3773
|
+
* the glyph sideways moves the value half a unit per pixel, with the page
|
|
3774
|
+
* cursor held at `ew-resize`, and commits once on release. Give any field
|
|
3775
|
+
* `onScrubStart`, `onScrub` and `onScrubEnd` and the drag reports how far the
|
|
3776
|
+
* pointer moved instead, with the start and end marking one interaction so a
|
|
3777
|
+
* drag becomes a single undo entry. Dragging is a shortcut, not the only way
|
|
3778
|
+
* in: the same value can always be typed.
|
|
3478
3779
|
* @example
|
|
3479
3780
|
* ```tsx
|
|
3480
3781
|
* const [size, setSize] = useState("1.0");
|
|
@@ -3497,12 +3798,17 @@ export declare const PanelField: default_2.ForwardRefExoticComponent<PanelFieldP
|
|
|
3497
3798
|
* What a field holds, and therefore which control it draws.
|
|
3498
3799
|
*
|
|
3499
3800
|
* - `"text"` -- a text box. The default.
|
|
3500
|
-
* - `"number"` --
|
|
3501
|
-
*
|
|
3502
|
-
*
|
|
3503
|
-
*
|
|
3504
|
-
*
|
|
3505
|
-
*
|
|
3801
|
+
* - `"number"` -- Figma's scrubbable number box. Typing applies nothing until
|
|
3802
|
+
* Enter, Tab or blur, and may be arithmetic (`40*2`); anything that does not
|
|
3803
|
+
* evaluate reverts. Up and down arrows step the value at once (Shift: ten
|
|
3804
|
+
* steps). Dragging the glyph slot scrubs the value at half a unit per pixel
|
|
3805
|
+
* and commits once on release. Digits and the decimal separator follow the
|
|
3806
|
+
* reader's locale.
|
|
3807
|
+
* - `"select"` -- a drop-down, drawn as Figma's outlined select trigger. Pass
|
|
3808
|
+
* `data` with the choices to get a real drop-down list, which opens over the
|
|
3809
|
+
* field with the current choice on top of it; with no `data` the field draws
|
|
3810
|
+
* the caret but opens nothing of its own, which is what you want when
|
|
3811
|
+
* `onClick` opens a panel you have built yourself.
|
|
3506
3812
|
*/
|
|
3507
3813
|
export declare type PanelFieldKind = "text" | "number" | "select";
|
|
3508
3814
|
|
|
@@ -3529,7 +3835,7 @@ export declare interface PanelFieldProps extends Omit<default_2.ComponentPropsWi
|
|
|
3529
3835
|
*
|
|
3530
3836
|
* Pass the name of one of the built-in field glyphs, one of the five
|
|
3531
3837
|
* capital letters `N`, `E`, `W`, `D` or `K`, or your own node such as a
|
|
3532
|
-
*
|
|
3838
|
+
* color swatch. A bare string is deliberately not accepted: the slot holds
|
|
3533
3839
|
* a drawing, not a word.
|
|
3534
3840
|
*/
|
|
3535
3841
|
glyph?: FieldGlyphName | FieldLetter | Exclude<default_2.ReactNode, string>;
|
|
@@ -3553,9 +3859,9 @@ export declare interface PanelFieldProps extends Omit<default_2.ComponentPropsWi
|
|
|
3553
3859
|
* Called when the value changes, with the new value first and the event that
|
|
3554
3860
|
* caused it second where there is one.
|
|
3555
3861
|
*
|
|
3556
|
-
* A text field and a drop-down
|
|
3557
|
-
*
|
|
3558
|
-
*
|
|
3862
|
+
* A text field reports every keystroke and a drop-down each choice, as a
|
|
3863
|
+
* string. A number field reports a number once per commit: Enter, Tab or
|
|
3864
|
+
* blur after typing, each arrow step, and the release of a scrub.
|
|
3559
3865
|
*/
|
|
3560
3866
|
onChange?: ChangeHandler<string | number>;
|
|
3561
3867
|
/**
|
|
@@ -3567,12 +3873,12 @@ export declare interface PanelFieldProps extends Omit<default_2.ComponentPropsWi
|
|
|
3567
3873
|
*/
|
|
3568
3874
|
data?: ComboboxData;
|
|
3569
3875
|
/**
|
|
3570
|
-
* A short unit shown after the value, in the secondary text
|
|
3876
|
+
* A short unit shown after the value, in the secondary text color, at the
|
|
3571
3877
|
* end of the same box -- "%", "px" per second, a count of links.
|
|
3572
3878
|
*/
|
|
3573
3879
|
unit?: string;
|
|
3574
3880
|
/**
|
|
3575
|
-
* How wide the field is:
|
|
3881
|
+
* How wide the field is: 88 for one of a pair, 184 for a field that spans
|
|
3576
3882
|
* the body of a row, or `"fill"` to take whatever width its container gives
|
|
3577
3883
|
* it.
|
|
3578
3884
|
*/
|
|
@@ -3595,7 +3901,7 @@ export declare interface PanelFieldProps extends Omit<default_2.ComponentPropsWi
|
|
|
3595
3901
|
*/
|
|
3596
3902
|
mixed?: boolean;
|
|
3597
3903
|
/**
|
|
3598
|
-
* The text shown in an empty field, in the placeholder
|
|
3904
|
+
* The text shown in an empty field, in the placeholder color.
|
|
3599
3905
|
*
|
|
3600
3906
|
* Passing `true` instead of a string is the older spelling: it moves
|
|
3601
3907
|
* whatever is in `value` into the placeholder, which is what a field
|
|
@@ -3614,8 +3920,14 @@ export declare interface PanelFieldProps extends Omit<default_2.ComponentPropsWi
|
|
|
3614
3920
|
min?: number;
|
|
3615
3921
|
/** The largest value a number field accepts. */
|
|
3616
3922
|
max?: number;
|
|
3617
|
-
/** How much one press of an arrow key changes a number field. */
|
|
3923
|
+
/** How much one press of an arrow key changes a number field. Shift moves ten. */
|
|
3618
3924
|
step?: number;
|
|
3925
|
+
/**
|
|
3926
|
+
* What a number field says about its arrow keys, after its name and value,
|
|
3927
|
+
* as its `aria-description`. Pass an empty string to say nothing.
|
|
3928
|
+
* @default "Use arrow keys to change the value"
|
|
3929
|
+
*/
|
|
3930
|
+
stepHint?: string;
|
|
3619
3931
|
/**
|
|
3620
3932
|
* Called once when a drag of the glyph slot begins, on the first movement
|
|
3621
3933
|
* rather than on the press.
|
|
@@ -3632,9 +3944,13 @@ export declare interface PanelFieldProps extends Omit<default_2.ComponentPropsWi
|
|
|
3632
3944
|
* The distance is positive when the pointer moves in the direction the text
|
|
3633
3945
|
* runs -- to the right in English, to the left in Arabic or Hebrew -- so
|
|
3634
3946
|
* dragging forwards always raises the value.
|
|
3947
|
+
*
|
|
3948
|
+
* A number field scrubs on its own (half a unit per pixel, one `onChange`
|
|
3949
|
+
* on release). Pass `onScrub` to take the value over yourself: the field
|
|
3950
|
+
* then reports the distances and changes nothing.
|
|
3635
3951
|
*/
|
|
3636
3952
|
onScrub?: GestureChangeHandler;
|
|
3637
|
-
/** Called once when a drag of the glyph slot finishes or is
|
|
3953
|
+
/** Called once when a drag of the glyph slot finishes or is canceled. Close the undo transaction here. */
|
|
3638
3954
|
onScrubEnd?: GestureEndHandler;
|
|
3639
3955
|
/**
|
|
3640
3956
|
* Called when the field is activated by a click or by pressing Enter.
|
|
@@ -3749,17 +4065,19 @@ export declare const Popout: typeof PopoutRoot & {
|
|
|
3749
4065
|
|
|
3750
4066
|
/**
|
|
3751
4067
|
* Gap in pixels between trigger and panel for root-level popouts.
|
|
4068
|
+
*
|
|
4069
|
+
* Zero: Figma docks a light popover flush against the panel it opened from (its end edge on the
|
|
4070
|
+
* panel's start border), design/figma-spec.md 8.4.
|
|
3752
4071
|
*/
|
|
3753
|
-
export declare const POPOUT_GAP =
|
|
4072
|
+
export declare const POPOUT_GAP = 0;
|
|
3754
4073
|
|
|
3755
4074
|
/**
|
|
3756
4075
|
* Gap in pixels between a pop-out panel and the panel it opened from.
|
|
3757
4076
|
*
|
|
3758
|
-
*
|
|
3759
|
-
*
|
|
3760
|
-
* reads as a stack rather than as several panels that happen to overlap.
|
|
4077
|
+
* Zero: a child popout docks flush to the start of its parent, as Figma's create-style dialog
|
|
4078
|
+
* docks against the color picker (design/figma-spec.md 8.4).
|
|
3761
4079
|
*/
|
|
3762
|
-
export declare const POPOUT_NESTED_GAP =
|
|
4080
|
+
export declare const POPOUT_NESTED_GAP = 0;
|
|
3763
4081
|
|
|
3764
4082
|
/**
|
|
3765
4083
|
* Z-index base value for popout panels.
|
|
@@ -3772,7 +4090,7 @@ export declare const POPOUT_Z_INDEX_BASE = 1000;
|
|
|
3772
4090
|
*
|
|
3773
4091
|
* For a panel placed to the left or right, this is the vertical axis:
|
|
3774
4092
|
* - "start": the panel's top edge meets the top of what it aligns to
|
|
3775
|
-
* - "center": the panel is
|
|
4093
|
+
* - "center": the panel is centered on it
|
|
3776
4094
|
* - "end": the panel's bottom edge meets its bottom
|
|
3777
4095
|
*
|
|
3778
4096
|
* For a panel placed above or below, this is the horizontal axis, and "start"
|
|
@@ -3836,16 +4154,19 @@ export declare interface PopoutAnchorProps {
|
|
|
3836
4154
|
export declare type PopoutAnchorTarget = RefObject<HTMLElement | null> | "parent" | "panel" | "trigger";
|
|
3837
4155
|
|
|
3838
4156
|
/**
|
|
3839
|
-
* An icon button that opens a pop-out and
|
|
4157
|
+
* An icon button that opens a pop-out and shows that it is open.
|
|
3840
4158
|
*
|
|
3841
|
-
* It
|
|
3842
|
-
*
|
|
3843
|
-
*
|
|
4159
|
+
* It is Figma's 24px ghost icon button (design/figma-spec.md 4.3): transparent
|
|
4160
|
+
* at rest, and while its panel is up it takes the "open" look -- the selected
|
|
4161
|
+
* ground (#e5f4ff / #394360) with a brand-colored glyph -- which the theme
|
|
4162
|
+
* draws from the `aria-expanded="true"` that `Popout.Trigger` sets. A column of
|
|
4163
|
+
* them therefore says at a glance which panel is on screen. Give it an
|
|
4164
|
+
* `aria-label`: an icon on its own has no accessible name.
|
|
3844
4165
|
*
|
|
3845
|
-
* Use it inside `Popout.Trigger`, which supplies the open state
|
|
4166
|
+
* Use it inside `Popout.Trigger`, which supplies the open state.
|
|
3846
4167
|
* @param props - Component props
|
|
3847
4168
|
* @param props.icon - The drawing on the button
|
|
3848
|
-
* @param props.size - How big the button is, defaulting to
|
|
4169
|
+
* @param props.size - How big the button is, defaulting to Figma's 24px `"sm"`
|
|
3849
4170
|
* @returns The trigger button
|
|
3850
4171
|
* @example
|
|
3851
4172
|
* ```tsx
|
|
@@ -3853,7 +4174,7 @@ export declare type PopoutAnchorTarget = RefObject<HTMLElement | null> | "parent
|
|
|
3853
4174
|
* <Popout.Trigger>
|
|
3854
4175
|
* <PopoutButton icon={<UiGlyph name="gear" />} aria-label="Open settings" />
|
|
3855
4176
|
* </Popout.Trigger>
|
|
3856
|
-
* <Popout.Panel width={
|
|
4177
|
+
* <Popout.Panel width={240} header={{variant: "title", title: "Settings"}}>
|
|
3857
4178
|
* <Popout.Content>Content here</Popout.Content>
|
|
3858
4179
|
* </Popout.Panel>
|
|
3859
4180
|
* </Popout>
|
|
@@ -3867,7 +4188,7 @@ export declare const PopoutButton: ForwardRefExoticComponent<PopoutButtonProps &
|
|
|
3867
4188
|
* Every `ActionIcon` prop but `variant` and `children` is accepted as well and
|
|
3868
4189
|
* is forwarded to the underlying button, so `size`, `color`, `disabled`,
|
|
3869
4190
|
* `aria-label` and a `data-` attribute all work. The variant is the button's
|
|
3870
|
-
* own:
|
|
4191
|
+
* own: the ghost (`subtle`) button, whose open state the theme draws.
|
|
3871
4192
|
*/
|
|
3872
4193
|
export declare interface PopoutButtonProps extends Omit<ActionIconProps, "variant" | "children">, ElementProps<"button", "color" | keyof ActionIconProps> {
|
|
3873
4194
|
/**
|
|
@@ -3884,7 +4205,11 @@ export declare interface PopoutButtonProps extends Omit<ActionIconProps, "varian
|
|
|
3884
4205
|
*
|
|
3885
4206
|
* Wrap a panel's content in it for the padding every pop-out shares, or leave
|
|
3886
4207
|
* it out and lay the panel out yourself when the content has to reach the
|
|
3887
|
-
* panel's own edges -- a
|
|
4208
|
+
* panel's own edges -- a color picker, a list that scrolls.
|
|
4209
|
+
*
|
|
4210
|
+
* The padding is Figma's popover body (design/figma-spec.md 8.4): 16px at each
|
|
4211
|
+
* side and 12px above and below, so the 24px control of a first 32px row sits
|
|
4212
|
+
* 16px under the header's divider, and the last one 16px above the bottom.
|
|
3888
4213
|
* @param props - Component props
|
|
3889
4214
|
* @param props.children - What the panel shows, laid out inside the panel's own padding
|
|
3890
4215
|
* @returns The panel's padded content area
|
|
@@ -3933,12 +4258,17 @@ export declare interface PopoutContextValue {
|
|
|
3933
4258
|
/**
|
|
3934
4259
|
* The region this pop-out was opened in, or null when it sits in no region.
|
|
3935
4260
|
*
|
|
3936
|
-
*
|
|
3937
|
-
*
|
|
3938
|
-
* two opened in the same panel cannot. It is the opener's region, not the
|
|
3939
|
-
* panel's screen position.
|
|
4261
|
+
* Recorded for consumers that read it. It no longer separates pop-outs:
|
|
4262
|
+
* one root pop-out is open at a time across the whole page, as in Figma.
|
|
3940
4263
|
*/
|
|
3941
4264
|
region: string | null;
|
|
4265
|
+
/**
|
|
4266
|
+
* Whether opening this pop-out closes the other open root pop-out (and is
|
|
4267
|
+
* closed by the next one). False only for a hover bubble such as
|
|
4268
|
+
* `InfoCircle`, which explains a control without replacing the panel the
|
|
4269
|
+
* person is working in.
|
|
4270
|
+
*/
|
|
4271
|
+
exclusive?: boolean;
|
|
3942
4272
|
}
|
|
3943
4273
|
|
|
3944
4274
|
/**
|
|
@@ -3954,7 +4284,7 @@ declare interface PopoutHeaderAction {
|
|
|
3954
4284
|
*
|
|
3955
4285
|
* The button is icon-only, so this is its accessible name and there is no
|
|
3956
4286
|
* other text to fall back on. Write it as a phrase a person would
|
|
3957
|
-
*
|
|
4287
|
+
* recognize.
|
|
3958
4288
|
*/
|
|
3959
4289
|
label: string;
|
|
3960
4290
|
/**
|
|
@@ -4008,6 +4338,11 @@ export declare interface PopoutHeaderProps {
|
|
|
4008
4338
|
* `aria-labelledby` at.
|
|
4009
4339
|
*/
|
|
4010
4340
|
titleId?: string;
|
|
4341
|
+
/**
|
|
4342
|
+
* The base id of the tab strip, from which Mantine's Tabs derives each tab's
|
|
4343
|
+
* id and aria-controls. The panel gives its tab panel the matching id.
|
|
4344
|
+
*/
|
|
4345
|
+
tabsId?: string;
|
|
4011
4346
|
}
|
|
4012
4347
|
|
|
4013
4348
|
/**
|
|
@@ -4016,8 +4351,10 @@ export declare interface PopoutHeaderProps {
|
|
|
4016
4351
|
* Put one high in the tree, around anything that contains a pop-out. It owns
|
|
4017
4352
|
* the stacking order, the portal the panels render into, and the dismissal
|
|
4018
4353
|
* rules they all obey: Escape closes the innermost open panel, a click outside
|
|
4019
|
-
* closes them all, opening one panel closes the
|
|
4020
|
-
*
|
|
4354
|
+
* closes them all, opening one panel closes the one already open at its level
|
|
4355
|
+
* (one root pop-out on the whole page at a time, as in Figma; a panel opened
|
|
4356
|
+
* from inside an open one is its child and stays), and closing a panel closes
|
|
4357
|
+
* everything opened from it.
|
|
4021
4358
|
* @param props - Component props
|
|
4022
4359
|
* @param props.children - The part of the tree that may contain pop-outs
|
|
4023
4360
|
* @returns The provider that pop-outs inside it coordinate through
|
|
@@ -4037,7 +4374,7 @@ export declare interface PopoutManagerContextValue {
|
|
|
4037
4374
|
* Adds a pop-out to the layer, with the callback that closes it, the pop-out
|
|
4038
4375
|
* it was opened from, and the region it was opened in.
|
|
4039
4376
|
*/
|
|
4040
|
-
register: (id: string, closeCallback: () => void, parentId?: string | null, region?: string | null) => void;
|
|
4377
|
+
register: (id: string, closeCallback: () => void, parentId?: string | null, region?: string | null, exclusive?: boolean) => void;
|
|
4041
4378
|
/** Takes a pop-out out of the layer, when it leaves the page. */
|
|
4042
4379
|
unregister: (id: string) => void;
|
|
4043
4380
|
/** The stacking order a pop-out currently draws at. */
|
|
@@ -4187,9 +4524,8 @@ export declare interface PopoutPanelProps {
|
|
|
4187
4524
|
* Gap between the panel and the anchor, in pixels. Negative values overlap
|
|
4188
4525
|
* the two so their borders meet exactly.
|
|
4189
4526
|
*
|
|
4190
|
-
* Defaults to 0
|
|
4191
|
-
*
|
|
4192
|
-
* consistent step.
|
|
4527
|
+
* Defaults to 0: a panel docks flush against what it opened from, and a
|
|
4528
|
+
* nested panel flush against its parent (POPOUT_GAP, POPOUT_NESTED_GAP).
|
|
4193
4529
|
*/
|
|
4194
4530
|
gap?: number;
|
|
4195
4531
|
/**
|
|
@@ -4203,6 +4539,10 @@ export declare interface PopoutPanelProps {
|
|
|
4203
4539
|
* Whether opening the panel moves keyboard focus into it, and closing it
|
|
4204
4540
|
* returns focus to the trigger.
|
|
4205
4541
|
*
|
|
4542
|
+
* Focus lands on the panel itself, or on the first element inside it marked
|
|
4543
|
+
* `data-autofocus` (Mantine's convention) when there is one -- mark the
|
|
4544
|
+
* field a settings panel should start in.
|
|
4545
|
+
*
|
|
4206
4546
|
* Turn this off for a panel that opens on hover, where taking focus away
|
|
4207
4547
|
* from what the person is doing would be an interruption.
|
|
4208
4548
|
* @default true
|
|
@@ -4259,25 +4599,15 @@ export declare interface PopoutProps extends DisclosureProps {
|
|
|
4259
4599
|
* Which region the pop-outs beneath this point belong to.
|
|
4260
4600
|
*
|
|
4261
4601
|
* A shell is divided into regions -- a properties panel, an inspector, the
|
|
4262
|
-
* surface between them
|
|
4263
|
-
*
|
|
4264
|
-
*
|
|
4265
|
-
* region
|
|
4266
|
-
*
|
|
4267
|
-
*
|
|
4268
|
-
*
|
|
4269
|
-
*
|
|
4270
|
-
*
|
|
4271
|
-
* it is why the default -- no region at all -- keeps the older whole-page rule:
|
|
4272
|
-
* an application that never mentions regions is unaffected.
|
|
4273
|
-
*
|
|
4274
|
-
* The region is the OPENER's, not the surface's screen position. Wrap the
|
|
4275
|
-
* region's own markup, and a pop-out that slides out over neighbouring space
|
|
4276
|
-
* still counts against the region whose control opened it.
|
|
4277
|
-
*
|
|
4278
|
-
* Nesting is unaffected either way. A pop-out opened from another pop-out is
|
|
4279
|
-
* grouped by its parent, as it always was, and inherits this region only for
|
|
4280
|
-
* the benefit of anything it opens in turn.
|
|
4602
|
+
* surface between them -- and each pop-out records the region its trigger sits
|
|
4603
|
+
* in, readable through `usePopoutRegion`.
|
|
4604
|
+
*
|
|
4605
|
+
* The region no longer decides which pop-outs may be open together. Figma
|
|
4606
|
+
* keeps ONE light popover open at a time: opening another replaces it, in any
|
|
4607
|
+
* region (design/figma-spec.md 8.4). Before the Figma restyle a reader could
|
|
4608
|
+
* hold one pop-out open per region; that rule is gone, and this component is
|
|
4609
|
+
* kept so existing markup and `usePopoutRegion` keep working. A pop-out opened
|
|
4610
|
+
* from inside an open one is its child and stays allowed.
|
|
4281
4611
|
* @param props - Component props
|
|
4282
4612
|
* @param props.id - What to call this region
|
|
4283
4613
|
* @param props.children - The part of the tree whose pop-outs belong to it
|
|
@@ -4410,7 +4740,7 @@ declare interface PopoutTitleHeaderConfig {
|
|
|
4410
4740
|
* @param props - Component props
|
|
4411
4741
|
* @param props.children - The trigger element (typically a button or icon button)
|
|
4412
4742
|
* @param props.action - What activating the trigger does: toggle the panel, or only open it
|
|
4413
|
-
* @returns The trigger element with the pop-out's
|
|
4743
|
+
* @returns The trigger element with the pop-out's behavior attached
|
|
4414
4744
|
*/
|
|
4415
4745
|
declare function PopoutTrigger({ children, action }: PopoutTriggerProps): JSX.Element;
|
|
4416
4746
|
|
|
@@ -4555,6 +4885,118 @@ export declare interface ProseBlockProps {
|
|
|
4555
4885
|
live?: LiveSetting;
|
|
4556
4886
|
}
|
|
4557
4887
|
|
|
4888
|
+
/** One action of the palette. */
|
|
4889
|
+
export declare interface QuickAction {
|
|
4890
|
+
/** The action's identifier, handed to `onRun`. */
|
|
4891
|
+
value: string;
|
|
4892
|
+
/** The action's name. */
|
|
4893
|
+
label: string;
|
|
4894
|
+
/** A 24px glyph before the name. */
|
|
4895
|
+
icon?: default_2.ReactNode;
|
|
4896
|
+
/** The keyboard shortcut, shown right-aligned. */
|
|
4897
|
+
shortcut?: string;
|
|
4898
|
+
/** The section heading the action is listed under ("Recents", "Design tools"). */
|
|
4899
|
+
section?: string;
|
|
4900
|
+
/** Extra words the default filter matches. */
|
|
4901
|
+
keywords?: readonly string[];
|
|
4902
|
+
/** Shown, but cannot be run or highlighted. */
|
|
4903
|
+
disabled?: boolean;
|
|
4904
|
+
}
|
|
4905
|
+
|
|
4906
|
+
/**
|
|
4907
|
+
* Figma's quick actions palette: a 529 x 354 panel (the caller positions it; Figma puts it 8px
|
|
4908
|
+
* above the toolbar) with a 32 tall search field, section headings and 32 tall rows. Typing
|
|
4909
|
+
* filters live, and the results are listed flat (no headings); ArrowUp / ArrowDown move the highlight while focus stays in the field (a
|
|
4910
|
+
* combobox with `aria-activedescendant` on a listbox); Enter runs; Escape closes. The first row
|
|
4911
|
+
* is highlighted on open and after every change of the search.
|
|
4912
|
+
* @param props - Component props
|
|
4913
|
+
* @param props.actions - Every action
|
|
4914
|
+
* @param props.onRun - Called with an action's value when it is run
|
|
4915
|
+
* @param props.onClose - Called by Escape
|
|
4916
|
+
* @param props.query - The search text (controlled)
|
|
4917
|
+
* @param props.onQueryChange - Called as the search text changes
|
|
4918
|
+
* @param props.filter - Which actions match the search
|
|
4919
|
+
* @param props.header - Rendered between the search field and the list
|
|
4920
|
+
* @param props.searchAction - A trailing action at the right end of the search field
|
|
4921
|
+
* @param props.placeholder - Placeholder of the search field
|
|
4922
|
+
* @param props.width - Panel width
|
|
4923
|
+
* @param props.height - Panel height
|
|
4924
|
+
* @param props.className - Extra class on the panel
|
|
4925
|
+
* @param props.style - Extra style on the panel
|
|
4926
|
+
* @returns The palette
|
|
4927
|
+
*/
|
|
4928
|
+
export declare function QuickActions({ actions, onRun, onClose, query, onQueryChange, filter, header, searchAction, placeholder, width, height, className, style, ...others }: QuickActionsProps): default_2.JSX.Element;
|
|
4929
|
+
|
|
4930
|
+
/**
|
|
4931
|
+
* Props for the QuickActions component.
|
|
4932
|
+
*/
|
|
4933
|
+
export declare interface QuickActionsProps {
|
|
4934
|
+
/** Every action. Sections appear in the order their first action does. */
|
|
4935
|
+
actions: readonly QuickAction[];
|
|
4936
|
+
/** Called with an action's value when it is run (Enter, or a click). */
|
|
4937
|
+
onRun: (value: string) => void;
|
|
4938
|
+
/** Called by Escape. */
|
|
4939
|
+
onClose?: () => void;
|
|
4940
|
+
/** The search text (controlled). */
|
|
4941
|
+
query?: string;
|
|
4942
|
+
/** Called as the search text changes. */
|
|
4943
|
+
onQueryChange?: (query: string) => void;
|
|
4944
|
+
/** Which actions match the search. Defaults to a case-insensitive substring of the name or a keyword. */
|
|
4945
|
+
filter?: (action: QuickAction, query: string) => boolean;
|
|
4946
|
+
/**
|
|
4947
|
+
* Rendered in a 32 tall row between the search field and the list, 8px in from the panel
|
|
4948
|
+
* edge: Figma's scope tabs (`<Tabs>` with the theme's pill tabs), for example.
|
|
4949
|
+
*/
|
|
4950
|
+
header?: default_2.ReactNode;
|
|
4951
|
+
/**
|
|
4952
|
+
* A trailing action at the right end of the search field, 6px in from its edge and 16px
|
|
4953
|
+
* after the text: pass an `<ActionIcon aria-label="...">` (the theme's 24px ghost icon
|
|
4954
|
+
* button), as Figma's visual-search button. While there is search text the palette shows its
|
|
4955
|
+
* own clear button in this place instead, as Figma does.
|
|
4956
|
+
*/
|
|
4957
|
+
searchAction?: default_2.ReactNode;
|
|
4958
|
+
/** Accessible name of the dialog. Defaults to the "Quick actions" label. */
|
|
4959
|
+
"aria-label"?: string;
|
|
4960
|
+
/** Placeholder of the search field. Defaults to the "Search actions" label. */
|
|
4961
|
+
placeholder?: string;
|
|
4962
|
+
/** Panel width. Default 529 (Figma's, the toolbar's width). */
|
|
4963
|
+
width?: number;
|
|
4964
|
+
/** Panel height. Default 354. */
|
|
4965
|
+
height?: number;
|
|
4966
|
+
className?: string;
|
|
4967
|
+
style?: default_2.CSSProperties;
|
|
4968
|
+
}
|
|
4969
|
+
|
|
4970
|
+
/**
|
|
4971
|
+
* A 56 x 56 rail button: a 32 x 32 pill (24 glyph) above a 9/14 caption. The pill turns
|
|
4972
|
+
* `--cm-bg-hover` under the pointer and `--cm-bg-selected` with a brand glyph when active; the
|
|
4973
|
+
* caption never changes. Tooltip to the end side after 500ms, none on the active button.
|
|
4974
|
+
* @param props - Component props
|
|
4975
|
+
* @param props.icon - The destination's glyph
|
|
4976
|
+
* @param props.label - The caption, accessible name and tooltip
|
|
4977
|
+
* @param props.shortcut - The keyboard shortcut shown in the tooltip
|
|
4978
|
+
* @param props.active - Whether the destination is open
|
|
4979
|
+
* @returns The rail button
|
|
4980
|
+
*/
|
|
4981
|
+
export declare const RailButton: default_2.ForwardRefExoticComponent<RailButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
4982
|
+
|
|
4983
|
+
/**
|
|
4984
|
+
* Props for the RailButton component.
|
|
4985
|
+
*/
|
|
4986
|
+
export declare interface RailButtonProps extends Omit<UnstyledButtonProps, "children">, Omit<ElementProps<"button">, "children"> {
|
|
4987
|
+
/** The destination's glyph, drawn in the 32 x 32 pill. */
|
|
4988
|
+
icon: default_2.ReactNode;
|
|
4989
|
+
/** The 9px caption under the pill, also the accessible name and the tooltip. */
|
|
4990
|
+
label: string;
|
|
4991
|
+
/** The keyboard shortcut shown in the tooltip. */
|
|
4992
|
+
shortcut?: string;
|
|
4993
|
+
/**
|
|
4994
|
+
* Whether the destination is open. `aria-expanded="true"` means the same thing, so a button
|
|
4995
|
+
* that opens a panel only needs that.
|
|
4996
|
+
*/
|
|
4997
|
+
active?: boolean;
|
|
4998
|
+
}
|
|
4999
|
+
|
|
4558
5000
|
/**
|
|
4559
5001
|
* A row that draws a range: two values with the mapping between them drawn
|
|
4560
5002
|
* in-line, and no sentence anywhere.
|
|
@@ -4588,8 +5030,8 @@ export declare interface ProseBlockProps {
|
|
|
4588
5030
|
* @param props.min - The value at the low end of the range
|
|
4589
5031
|
* @param props.max - The value at the high end of the range
|
|
4590
5032
|
* @param props.label - Names what the ramp maps; never drawn, and read first in the drawing's accessible name
|
|
4591
|
-
* @param props.variant - Which drawing the row makes of its range: a growing wedge or a
|
|
4592
|
-
* @param props.gradient - A CSS gradient for the
|
|
5033
|
+
* @param props.variant - Which drawing the row makes of its range: a growing wedge or a color bar
|
|
5034
|
+
* @param props.gradient - A CSS gradient for the color form, written as though text ran left to right
|
|
4593
5035
|
* @param props.scale - The transform between the two values, drawn as a small curve at the end of the row
|
|
4594
5036
|
* @param props.busy - Whether the values are still being worked out by something that finishes later
|
|
4595
5037
|
* @param props.live - How urgently a screen reader announces the drawing when it changes on its own
|
|
@@ -4601,7 +5043,7 @@ export declare interface ProseBlockProps {
|
|
|
4601
5043
|
* <RampRow label="Node size by age" min="45" max="68" scale="sqrt" />
|
|
4602
5044
|
* ```
|
|
4603
5045
|
* @example
|
|
4604
|
-
* A
|
|
5046
|
+
* A color ramp filled in by a background run, whose curve opens a chooser.
|
|
4605
5047
|
* ```tsx
|
|
4606
5048
|
* const format = useNumberFormatter({maximumFractionDigits: 2});
|
|
4607
5049
|
*
|
|
@@ -4658,7 +5100,7 @@ export declare interface RampRowProps {
|
|
|
4658
5100
|
* Which drawing the row makes of its range.
|
|
4659
5101
|
*
|
|
4660
5102
|
* - `"size"` -- a wedge that grows from the low value to the high one,
|
|
4661
|
-
* drawn in the secondary text
|
|
5103
|
+
* drawn in the secondary text color. Its two ends are the smallest and
|
|
4662
5104
|
* the largest size the mapping produces.
|
|
4663
5105
|
* - `"color"` -- a bar painted with `gradient`, so the ramp on the panel is
|
|
4664
5106
|
* the ramp on the picture it describes.
|
|
@@ -4666,7 +5108,7 @@ export declare interface RampRowProps {
|
|
|
4666
5108
|
*/
|
|
4667
5109
|
variant?: "size" | "color";
|
|
4668
5110
|
/**
|
|
4669
|
-
* A CSS gradient for the
|
|
5111
|
+
* A CSS gradient for the color form, such as
|
|
4670
5112
|
* `"linear-gradient(to right, #123, #abc)"`.
|
|
4671
5113
|
*
|
|
4672
5114
|
* Write it as though text ran left to right; the drawing is mirrored for
|
|
@@ -4755,11 +5197,9 @@ declare type RampScale = "sqrt" | "linear" | "log";
|
|
|
4755
5197
|
*
|
|
4756
5198
|
* The denominator is not information the reader is missing -- the panel above it
|
|
4757
5199
|
* already says how many nodes there are -- so the chip keeps the number that
|
|
4758
|
-
* changes and drops the words that do not. It
|
|
4759
|
-
*
|
|
4760
|
-
*
|
|
4761
|
-
* annotation of the row rather than as a second value competing with the row's
|
|
4762
|
-
* own.
|
|
5200
|
+
* changes and drops the words that do not. It draws Figma's "Beta" badge look
|
|
5201
|
+
* (design/figma-spec.md 9.8): 16 tall, radius 5, a 1px border-color outline drawn
|
|
5202
|
+
* inside, transparent, 11/16 in the primary text color (bottom-toolbar/mode-metronome-full #296).
|
|
4763
5203
|
* @param props - Component props
|
|
4764
5204
|
* @param props.children - The rank, already spelled the short way
|
|
4765
5205
|
* @returns The rank chip
|
|
@@ -4774,6 +5214,226 @@ export declare interface RankChipProps {
|
|
|
4774
5214
|
children: default_2.ReactNode;
|
|
4775
5215
|
}
|
|
4776
5216
|
|
|
5217
|
+
/**
|
|
5218
|
+
* Apply a rename that `Tree`'s `onRename` reported. Returns a new list.
|
|
5219
|
+
* @param items - the tree, top level first
|
|
5220
|
+
* @param id - the renamed item
|
|
5221
|
+
* @param name - its new name
|
|
5222
|
+
* @returns the renamed tree
|
|
5223
|
+
*/
|
|
5224
|
+
export declare function renameTreeItem<T extends TreeLike<T> & {
|
|
5225
|
+
name: string;
|
|
5226
|
+
}>(items: readonly T[], id: string, name: string): T[];
|
|
5227
|
+
|
|
5228
|
+
/**
|
|
5229
|
+
* A handle that resizes a panel by dragging, by the arrow keys, or back to its default size by
|
|
5230
|
+
* a double-click.
|
|
5231
|
+
*
|
|
5232
|
+
* Put it inside the panel it resizes, which must be `position: relative`; it places itself
|
|
5233
|
+
* across the named edge. It draws nothing until it has keyboard focus, like Figma's.
|
|
5234
|
+
*
|
|
5235
|
+
* - Drag: the size follows the pointer live (`onChange`) and settles on release (`onChangeEnd`).
|
|
5236
|
+
* - Keys: the arrows along the handle's axis change the size by 1px, in the direction the
|
|
5237
|
+
* edge moves (ArrowRight grows a leading-side panel); Shift moves 10px; Home and End jump to
|
|
5238
|
+
* `min` and `max`.
|
|
5239
|
+
* - Double-click resets to `defaultValue`.
|
|
5240
|
+
*
|
|
5241
|
+
* The cursor says which ways the edge can still move: `e-resize` or `w-resize` at the ends of
|
|
5242
|
+
* the range and `ew-resize` between them; `ns-resize` on a split.
|
|
5243
|
+
* @param props - Component props
|
|
5244
|
+
* @param props.edge - Which panel edge the handle straddles
|
|
5245
|
+
* @param props.value - The panel's size, when controlled
|
|
5246
|
+
* @param props.defaultValue - The starting size when uncontrolled, and the double-click reset size
|
|
5247
|
+
* @param props.min - The smallest size
|
|
5248
|
+
* @param props.max - The largest size
|
|
5249
|
+
* @param props.onChange - Called with every new size
|
|
5250
|
+
* @param props.onChangeEnd - Called once a size settles
|
|
5251
|
+
* @param props.label - The accessible name
|
|
5252
|
+
* @param props.valueText - How the size is read out
|
|
5253
|
+
* @returns The resize handle
|
|
5254
|
+
* @example
|
|
5255
|
+
* ```tsx
|
|
5256
|
+
* <Box pos="relative" w={width}>
|
|
5257
|
+
* <ResizeHandle edge="end" value={width} min={240} max={500} defaultValue={240} onChange={setWidth} />
|
|
5258
|
+
* </Box>
|
|
5259
|
+
* ```
|
|
5260
|
+
*/
|
|
5261
|
+
export declare const ResizeHandle: default_2.ForwardRefExoticComponent<ResizeHandleProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
5262
|
+
|
|
5263
|
+
/** The size range, handed to `valueText`. */
|
|
5264
|
+
export declare interface ResizeHandleBounds {
|
|
5265
|
+
min: number;
|
|
5266
|
+
max: number;
|
|
5267
|
+
}
|
|
5268
|
+
|
|
5269
|
+
/** Which edge of its panel the handle sits on. The panel must be positioned (relative). */
|
|
5270
|
+
export declare type ResizeHandleEdge = "start" | "end" | "top" | "bottom";
|
|
5271
|
+
|
|
5272
|
+
/**
|
|
5273
|
+
* Props for the ResizeHandle component. Every other `div` prop is forwarded.
|
|
5274
|
+
*/
|
|
5275
|
+
export declare interface ResizeHandleProps extends Omit<default_2.ComponentPropsWithoutRef<"div">, "onChange" | "defaultValue" | "children"> {
|
|
5276
|
+
/**
|
|
5277
|
+
* The panel edge the handle straddles: `"end"` for a panel on the leading side of the
|
|
5278
|
+
* window (its trailing edge is dragged), `"start"` for a panel on the trailing side, `"top"`
|
|
5279
|
+
* or `"bottom"` for a vertical split. Start and end follow the text direction.
|
|
5280
|
+
* @default "end"
|
|
5281
|
+
*/
|
|
5282
|
+
edge?: ResizeHandleEdge;
|
|
5283
|
+
/** The panel's size in pixels, when you drive it from your own state. */
|
|
5284
|
+
value?: number;
|
|
5285
|
+
/**
|
|
5286
|
+
* The size it starts at when it keeps its own state, and the size a double-click resets
|
|
5287
|
+
* to. Defaults to `min`.
|
|
5288
|
+
*/
|
|
5289
|
+
defaultValue?: number;
|
|
5290
|
+
/** The smallest size, in pixels. */
|
|
5291
|
+
min: number;
|
|
5292
|
+
/** The largest size, in pixels. */
|
|
5293
|
+
max: number;
|
|
5294
|
+
/** Called with every new size, live while dragging and on each key press. */
|
|
5295
|
+
onChange?: (value: number) => void;
|
|
5296
|
+
/** Called once the size settles: on pointer release, after a key press, after a reset. */
|
|
5297
|
+
onChangeEnd?: (value: number) => void;
|
|
5298
|
+
/**
|
|
5299
|
+
* The handle's accessible name.
|
|
5300
|
+
* @default "Resize panel"
|
|
5301
|
+
*/
|
|
5302
|
+
label?: string;
|
|
5303
|
+
/**
|
|
5304
|
+
* How the size is read out. Defaults to `"240 pixels"`, with `" (min)"` or `" (max)"` at
|
|
5305
|
+
* the ends of the range.
|
|
5306
|
+
*/
|
|
5307
|
+
valueText?: (value: number, bounds: ResizeHandleBounds) => string;
|
|
5308
|
+
}
|
|
5309
|
+
|
|
5310
|
+
/**
|
|
5311
|
+
* A find result (design/figma-spec.md 10.4): 240 x 52 with a path line, 34 without, padding
|
|
5312
|
+
* 8 8 8 16, a 16px glyph, the name at 11/16 with the match at 600 and the path at 10/16 in the
|
|
5313
|
+
* secondary color. The current result is blue; hover is gray.
|
|
5314
|
+
*
|
|
5315
|
+
* It is an `option`: put the rows in an element with `role="listbox"` and drive them from the
|
|
5316
|
+
* search field with `aria-activedescendant` (give each row an `id`), so focus stays in the
|
|
5317
|
+
* field. Pressing a row does not take focus from the field.
|
|
5318
|
+
* @param props - Component props
|
|
5319
|
+
* @returns The row
|
|
5320
|
+
*/
|
|
5321
|
+
export declare const ResultRow: default_2.ForwardRefExoticComponent<ResultRowProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
5322
|
+
|
|
5323
|
+
/**
|
|
5324
|
+
* Props for the ResultRow component.
|
|
5325
|
+
*/
|
|
5326
|
+
export declare interface ResultRowProps extends Omit<default_2.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
5327
|
+
/** The result's name. */
|
|
5328
|
+
name: string;
|
|
5329
|
+
/** The search text: its first case-insensitive occurrence in the name is drawn at 600. */
|
|
5330
|
+
match?: string;
|
|
5331
|
+
/** The second line: where the result lives (a page, a parent path). */
|
|
5332
|
+
path?: default_2.ReactNode;
|
|
5333
|
+
/** The 16 x 16 type glyph. */
|
|
5334
|
+
icon?: default_2.ReactNode;
|
|
5335
|
+
/** The current result (blue fill; `aria-selected`). */
|
|
5336
|
+
current?: boolean;
|
|
5337
|
+
/** `"component"`: both lines and the glyph in the component (purple) color. */
|
|
5338
|
+
tone?: "default" | "component";
|
|
5339
|
+
}
|
|
5340
|
+
|
|
5341
|
+
/** The rows and columns of the matrix, top to bottom and left to right. */
|
|
5342
|
+
declare const ROWS: readonly ["top", "middle", "bottom"];
|
|
5343
|
+
|
|
5344
|
+
/**
|
|
5345
|
+
* A search field (design/figma-spec.md 6.2): a filled 24px field with a leading magnifier, a clear
|
|
5346
|
+
* button once there is text, and a focus ring drawn flush with the field that lingers 100ms after
|
|
5347
|
+
* focus leaves.
|
|
5348
|
+
*
|
|
5349
|
+
* Escape clears the text; with nothing to clear it is left to bubble, so an enclosing popover
|
|
5350
|
+
* can close. `autoFocus` is off by default: Figma focuses its search fields when their panel
|
|
5351
|
+
* opens, and whether that is right is the caller's decision.
|
|
5352
|
+
* @example
|
|
5353
|
+
* ```tsx
|
|
5354
|
+
* const [query, setQuery] = useState("");
|
|
5355
|
+
* <SearchInput value={query} onChange={setQuery} placeholder="Search layers" />
|
|
5356
|
+
* ```
|
|
5357
|
+
*/
|
|
5358
|
+
export declare const SearchInput: default_2.ForwardRefExoticComponent<SearchInputProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
5359
|
+
|
|
5360
|
+
/** Props for SearchInput. Every other TextInput prop is passed through. */
|
|
5361
|
+
export declare interface SearchInputProps extends Omit<TextInputProps, "value" | "defaultValue" | "onChange" | "size" | "leftSection" | "rightSection"> {
|
|
5362
|
+
/** The search text, when you drive the field from your own state. */
|
|
5363
|
+
value?: string;
|
|
5364
|
+
/** The text the field starts with when it keeps its own state. */
|
|
5365
|
+
defaultValue?: string;
|
|
5366
|
+
/** Called with the new text on every keystroke and on clear; the event is second when there is one. */
|
|
5367
|
+
onChange?: ChangeHandler<string>;
|
|
5368
|
+
/**
|
|
5369
|
+
* `"sm"`: the 24px panel field (default). `"lg"`: the 32px quick-actions field with 13/24 text.
|
|
5370
|
+
* @default "sm"
|
|
5371
|
+
*/
|
|
5372
|
+
size?: "sm" | "lg";
|
|
5373
|
+
/**
|
|
5374
|
+
* A 24 x 24 control joined to the field's end (Figma's Variables table filter button): the
|
|
5375
|
+
* field takes the `5px 0 0 5px` corners and the control `0 5px 5px 0`, 1px apart.
|
|
5376
|
+
*/
|
|
5377
|
+
rightSection?: default_2.ReactNode;
|
|
5378
|
+
/** The accessible name of the clear button. Defaults to the `clearSearch` label ("Clear search"). */
|
|
5379
|
+
clearLabel?: string;
|
|
5380
|
+
}
|
|
5381
|
+
|
|
5382
|
+
/** The contextual secondary bar, with `SecondaryToolbar.Button` and `SecondaryToolbar.Divider`. */
|
|
5383
|
+
export declare const SecondaryToolbar: typeof SecondaryToolbarRoot & {
|
|
5384
|
+
Button: default_2.ForwardRefExoticComponent<SecondaryToolbarButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
5385
|
+
Divider: typeof SecondaryToolbarDivider;
|
|
5386
|
+
};
|
|
5387
|
+
|
|
5388
|
+
/**
|
|
5389
|
+
* Props for SecondaryToolbar.Button.
|
|
5390
|
+
*/
|
|
5391
|
+
export declare interface SecondaryToolbarButtonProps extends UnstyledButtonProps, ElementProps<"button"> {
|
|
5392
|
+
/** A 24px glyph before the label. */
|
|
5393
|
+
icon?: default_2.ReactNode;
|
|
5394
|
+
/** Whether this is the current mode (`aria-pressed`): brand fill, white content. */
|
|
5395
|
+
selected?: boolean;
|
|
5396
|
+
/**
|
|
5397
|
+
* The button opens a dropdown (Figma's "More"): a 16px chevron trails the label with 4px end
|
|
5398
|
+
* padding. Wrap the button in `Menu.Target` so `aria-expanded` draws the open state.
|
|
5399
|
+
*/
|
|
5400
|
+
dropdown?: boolean;
|
|
5401
|
+
/** The visible label. Without one the button is a 24 x 24 icon button and needs an `aria-label`. */
|
|
5402
|
+
children?: default_2.ReactNode;
|
|
5403
|
+
}
|
|
5404
|
+
|
|
5405
|
+
/**
|
|
5406
|
+
* The divider between groups of the secondary bar, full height.
|
|
5407
|
+
* @returns The divider
|
|
5408
|
+
*/
|
|
5409
|
+
declare function SecondaryToolbarDivider(): default_2.JSX.Element;
|
|
5410
|
+
|
|
5411
|
+
/**
|
|
5412
|
+
* Props for the SecondaryToolbar component.
|
|
5413
|
+
*/
|
|
5414
|
+
export declare interface SecondaryToolbarProps extends BoxProps, ElementProps<"div"> {
|
|
5415
|
+
/** Accessible name of the bar, such as "Vector editing". */
|
|
5416
|
+
"aria-label": string;
|
|
5417
|
+
/** Drop the 8px padding, for a crop-style bar whose items sit on its edges. */
|
|
5418
|
+
flush?: boolean;
|
|
5419
|
+
/** The bar's buttons and dividers. */
|
|
5420
|
+
children?: default_2.ReactNode;
|
|
5421
|
+
}
|
|
5422
|
+
|
|
5423
|
+
/**
|
|
5424
|
+
* The contextual bar that appears 8px above the main toolbar while a mode is active (Figma's
|
|
5425
|
+
* vector-edit and image bars): 40 tall, 13px corners, the 200 elevation, 1 x 40 dividers.
|
|
5426
|
+
* One Tab stop, ArrowLeft / ArrowRight between its items. The caller positions it.
|
|
5427
|
+
* @param props - Component props
|
|
5428
|
+
* @param props.flush - Drop the 8px padding
|
|
5429
|
+
* @param props.children - The bar's buttons and dividers
|
|
5430
|
+
* @param props.className - Extra class on the root
|
|
5431
|
+
* @param props.onKeyDown - Called before the roving-focus key handling
|
|
5432
|
+
* @param props.onFocus - Called before the roving-focus bookkeeping
|
|
5433
|
+
* @returns The bar
|
|
5434
|
+
*/
|
|
5435
|
+
declare function SecondaryToolbarRoot({ flush, children, className, onKeyDown, onFocus, ...others }: SecondaryToolbarProps): default_2.JSX.Element;
|
|
5436
|
+
|
|
4777
5437
|
/**
|
|
4778
5438
|
* Mantine's SegmentedControl, named by the `Input.Wrapper` around it.
|
|
4779
5439
|
*
|
|
@@ -4801,6 +5461,84 @@ export declare interface RankChipProps {
|
|
|
4801
5461
|
*/
|
|
4802
5462
|
export declare function SegmentedControl(props: default_2.ComponentProps<typeof SegmentedControl_2>): default_2.JSX.Element;
|
|
4803
5463
|
|
|
5464
|
+
/** One shortcut: what it does and the keys that do it. */
|
|
5465
|
+
export declare interface ShortcutEntry {
|
|
5466
|
+
/** What the shortcut does, such as "Frame tool". */
|
|
5467
|
+
label: default_2.ReactNode;
|
|
5468
|
+
/** The key caps, in order, such as `["Shift", "P"]`. */
|
|
5469
|
+
keys: readonly string[];
|
|
5470
|
+
/** A glyph before the label. */
|
|
5471
|
+
icon?: default_2.ReactNode;
|
|
5472
|
+
/** A 12/16 line under the label saying when to use it (the "essential" tab's rows). */
|
|
5473
|
+
description?: default_2.ReactNode;
|
|
5474
|
+
/** Draw the entry lit (#80caff): the shortcut the reader just pressed. */
|
|
5475
|
+
highlighted?: boolean;
|
|
5476
|
+
}
|
|
5477
|
+
|
|
5478
|
+
/** A column of shortcuts. */
|
|
5479
|
+
export declare interface ShortcutGroup {
|
|
5480
|
+
/** The column's heading. */
|
|
5481
|
+
title?: default_2.ReactNode;
|
|
5482
|
+
/** The column's rows. */
|
|
5483
|
+
shortcuts: readonly ShortcutEntry[];
|
|
5484
|
+
}
|
|
5485
|
+
|
|
5486
|
+
/**
|
|
5487
|
+
* Figma's keyboard shortcuts sheet: docked full width at the window's foot (the caller positions
|
|
5488
|
+
* it), #1e1e1e in both themes, a 38px folder-tab strip and columns of shortcuts with dark key caps.
|
|
5489
|
+
* Focus is not moved into it on open; ArrowLeft / ArrowRight / Home / End move between tabs and
|
|
5490
|
+
* open them (automatic activation); Escape closes it (Figma's does not).
|
|
5491
|
+
* @param props - Component props
|
|
5492
|
+
* @param props.tabs - The tabs, left to right
|
|
5493
|
+
* @param props.value - The open tab (controlled)
|
|
5494
|
+
* @param props.defaultValue - The tab open at first
|
|
5495
|
+
* @param props.onChange - Called with a tab's value when it opens
|
|
5496
|
+
* @param props.onClose - Called by the close button and by Escape
|
|
5497
|
+
* @param props.className - Extra class on the sheet
|
|
5498
|
+
* @param props.style - Extra style on the sheet
|
|
5499
|
+
* @returns The sheet
|
|
5500
|
+
*/
|
|
5501
|
+
export declare function ShortcutSheet({ tabs, value, defaultValue, onChange, onClose, className, style, ...others }: ShortcutSheetProps): default_2.JSX.Element;
|
|
5502
|
+
|
|
5503
|
+
/**
|
|
5504
|
+
* Props for the ShortcutSheet component.
|
|
5505
|
+
*/
|
|
5506
|
+
export declare interface ShortcutSheetProps {
|
|
5507
|
+
/** The tabs, left to right. */
|
|
5508
|
+
tabs: readonly ShortcutSheetTab[];
|
|
5509
|
+
/** The open tab (controlled). */
|
|
5510
|
+
value?: string;
|
|
5511
|
+
/** The tab open at first (uncontrolled). Defaults to the first. */
|
|
5512
|
+
defaultValue?: string;
|
|
5513
|
+
/** Called with a tab's value when it opens. */
|
|
5514
|
+
onChange?: (value: string) => void;
|
|
5515
|
+
/** Called by the close button and by Escape. Without it the sheet has no close button. */
|
|
5516
|
+
onClose?: () => void;
|
|
5517
|
+
/** Accessible name of the sheet. Defaults to the "Keyboard shortcuts" label. */
|
|
5518
|
+
"aria-label"?: string;
|
|
5519
|
+
className?: string;
|
|
5520
|
+
style?: default_2.CSSProperties;
|
|
5521
|
+
}
|
|
5522
|
+
|
|
5523
|
+
/** One tab of the sheet. */
|
|
5524
|
+
export declare interface ShortcutSheetTab {
|
|
5525
|
+
/** The tab's identifier. */
|
|
5526
|
+
value: string;
|
|
5527
|
+
/** The tab's text. */
|
|
5528
|
+
label: string;
|
|
5529
|
+
/** The tab's columns, laid out side by side and centered. */
|
|
5530
|
+
groups: readonly ShortcutGroup[];
|
|
5531
|
+
/**
|
|
5532
|
+
* `"list"` (the default) draws rows of 12px labels and small key caps. `"essential"` draws
|
|
5533
|
+
* Figma's first tab (ma/keyboard-shortcuts-essential): a caption above the columns, each
|
|
5534
|
+
* column numbered, 68px rows of 14/24 labels with their description under them, and the
|
|
5535
|
+
* 31-tall 14px key caps.
|
|
5536
|
+
*/
|
|
5537
|
+
variant?: "list" | "essential";
|
|
5538
|
+
/** The 14/24 line above the columns, such as "Essential keyboard shortcuts". */
|
|
5539
|
+
caption?: default_2.ReactNode;
|
|
5540
|
+
}
|
|
5541
|
+
|
|
4804
5542
|
/**
|
|
4805
5543
|
* The same chart at half the height, for a series rather than a distribution.
|
|
4806
5544
|
*
|
|
@@ -4810,7 +5548,7 @@ export declare function SegmentedControl(props: default_2.ComponentProps<typeof
|
|
|
4810
5548
|
* row pitch has no second line to put them on. They are still always drawn: a
|
|
4811
5549
|
* sparkline with no ends is a squiggle.
|
|
4812
5550
|
*
|
|
4813
|
-
* The series is
|
|
5551
|
+
* The series is normalized over its own extremes, so the line reports shape and
|
|
4814
5552
|
* the labels report magnitude. No legend, no title, no summary line.
|
|
4815
5553
|
*
|
|
4816
5554
|
* The line is drawn from the start of the axis to its end, following the text
|
|
@@ -4883,20 +5621,68 @@ export declare interface SparklineRowProps {
|
|
|
4883
5621
|
trailing?: default_2.ReactNode;
|
|
4884
5622
|
}
|
|
4885
5623
|
|
|
5624
|
+
/**
|
|
5625
|
+
* Two icon buttons joined into one control (design/figma-spec.md 4.5): a main action and a
|
|
5626
|
+
* chevron that opens a menu of related choices. Hovering either half lights both; the pressed half
|
|
5627
|
+
* darkens; the chevron shows the selected ground and a brand caret while its menu is open.
|
|
5628
|
+
* @param props - Component props
|
|
5629
|
+
* @param props.icon - The main half's glyph
|
|
5630
|
+
* @param props.label - The main half's accessible name and tooltip, and the group's name
|
|
5631
|
+
* @param props.onClick - Called when the main half is activated
|
|
5632
|
+
* @param props.menuLabel - The chevron's accessible name and tooltip
|
|
5633
|
+
* @param props.children - The menu the chevron opens
|
|
5634
|
+
* @param props.size - md (32 tall, the default) or sm (24 tall)
|
|
5635
|
+
* @param props.disabled - Disable both halves
|
|
5636
|
+
* @param props.menuProps - Passed to the Mantine Menu
|
|
5637
|
+
* @param props.className - Added to the group
|
|
5638
|
+
* @returns The split button
|
|
5639
|
+
* @example
|
|
5640
|
+
* ```tsx
|
|
5641
|
+
* <SplitButton icon={<PlayGlyph />} label="Present" menuLabel="Prototype view" onClick={present}>
|
|
5642
|
+
* <Menu.Item>Present</Menu.Item>
|
|
5643
|
+
* <Menu.Item>Preview</Menu.Item>
|
|
5644
|
+
* </SplitButton>
|
|
5645
|
+
* ```
|
|
5646
|
+
*/
|
|
5647
|
+
export declare function SplitButton({ icon, label, onClick, menuLabel, children, size, disabled, menuProps, className, ...rest }: SplitButtonProps): React.JSX.Element;
|
|
5648
|
+
|
|
5649
|
+
/** Props for SplitButton. */
|
|
5650
|
+
export declare interface SplitButtonProps extends BoxProps, ElementProps<"div", "onClick"> {
|
|
5651
|
+
/** The main half's glyph. */
|
|
5652
|
+
icon: ReactNode;
|
|
5653
|
+
/** The main half's accessible name and tooltip ("Present"). */
|
|
5654
|
+
label: string;
|
|
5655
|
+
/** Called when the main half is activated. */
|
|
5656
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
5657
|
+
/** The chevron half's accessible name and tooltip ("Prototype view"). */
|
|
5658
|
+
menuLabel: string;
|
|
5659
|
+
/** The menu the chevron opens: `Menu.Item`, `Menu.Label`, `Menu.Divider` ... */
|
|
5660
|
+
children: ReactNode;
|
|
5661
|
+
/** `md` (Figma's header size): a 32 x 32 main half and a 16 x 32 chevron. `sm`: 24 tall. @default "md" */
|
|
5662
|
+
size?: "sm" | "md";
|
|
5663
|
+
/** Disable both halves. */
|
|
5664
|
+
disabled?: boolean;
|
|
5665
|
+
/** Passed to the Mantine Menu (position, offset, opened / onChange ...). */
|
|
5666
|
+
menuProps?: Omit<MenuProps, "children">;
|
|
5667
|
+
}
|
|
5668
|
+
|
|
4886
5669
|
/**
|
|
4887
5670
|
* A number box that says whether the reader typed its value or inherited it.
|
|
4888
5671
|
*
|
|
4889
5672
|
* It is a Mantine `NumberInput` with one idea added: `undefined` means "nothing
|
|
4890
|
-
* has been entered here", so the control shows `defaultValue`
|
|
4891
|
-
*
|
|
4892
|
-
*
|
|
5673
|
+
* has been entered here", so the control shows `defaultValue` and offers no
|
|
5674
|
+
* reset. As soon as the reader commits a number of their own a reset button
|
|
5675
|
+
* appears beside it, and pressing that reset
|
|
4893
5676
|
* reports `undefined` again. A panel built from these reads at a glance as a
|
|
4894
|
-
* list of what has been
|
|
5677
|
+
* list of what has been customized and what has not.
|
|
4895
5678
|
*
|
|
4896
|
-
* The number is committed
|
|
4897
|
-
*
|
|
4898
|
-
* control never takes the caret away mid-word.
|
|
4899
|
-
*
|
|
5679
|
+
* The number is committed on Enter, Tab or blur, not on every keystroke, so
|
|
5680
|
+
* what the reader is part-way through typing is never sent anywhere and the
|
|
5681
|
+
* control never takes the caret away mid-word. What is typed may be arithmetic
|
|
5682
|
+
* (`40*2` commits 80); text that is not a number reverts. On commit the number
|
|
5683
|
+
* is pulled into `min`..`max` and the box is redrawn showing what was actually
|
|
5684
|
+
* kept. ArrowUp and ArrowDown step it at once (Shift: ten steps), Escape
|
|
5685
|
+
* abandons what was typed.
|
|
4900
5686
|
*
|
|
4901
5687
|
* What the reader types is read in their own locale, so `3,14` is 3.14 wherever
|
|
4902
5688
|
* the comma is the decimal separator, and the locale's own digits are numbers
|
|
@@ -4913,10 +5699,9 @@ export declare interface SparklineRowProps {
|
|
|
4913
5699
|
* @param props.onChange - Called with the committed number, or with `undefined` when the control is reset
|
|
4914
5700
|
* @param props.min - The smallest number accepted
|
|
4915
5701
|
* @param props.max - The largest number accepted
|
|
4916
|
-
* @param props.step - How far the
|
|
5702
|
+
* @param props.step - How far the arrow keys move the number
|
|
4917
5703
|
* @param props.decimalScale - How many digits after the decimal separator to keep
|
|
4918
5704
|
* @param props.suffix - A unit written after the number
|
|
4919
|
-
* @param props.hideControls - Whether to leave out the up and down steppers, which are left out by default
|
|
4920
5705
|
* @param props.disabled - Whether the control cannot be used at all
|
|
4921
5706
|
* @param props.disabledReason - One sentence saying why the control is off, drawn only while it is off
|
|
4922
5707
|
* @param props.onFocus - Called when the control takes focus
|
|
@@ -4937,7 +5722,7 @@ export declare interface SparklineRowProps {
|
|
|
4937
5722
|
* />
|
|
4938
5723
|
* ```
|
|
4939
5724
|
*/
|
|
4940
|
-
export declare function StyleNumberInput({ label, value, defaultValue, onChange, min, max, step, decimalScale, suffix,
|
|
5725
|
+
export declare function StyleNumberInput({ label, value, defaultValue, onChange, min, max, step, decimalScale, suffix, disabled, disabledReason, onFocus, onBlur, }: StyleNumberInputProps): default_2.JSX.Element;
|
|
4941
5726
|
|
|
4942
5727
|
/**
|
|
4943
5728
|
* Props for the StyleNumberInput component.
|
|
@@ -4952,7 +5737,7 @@ export declare interface StyleNumberInputProps {
|
|
|
4952
5737
|
* nothing and the control is showing `defaultValue`.
|
|
4953
5738
|
*/
|
|
4954
5739
|
value?: number | undefined;
|
|
4955
|
-
/** What is shown
|
|
5740
|
+
/** What is shown while the reader has entered nothing of their own. */
|
|
4956
5741
|
defaultValue: number;
|
|
4957
5742
|
/**
|
|
4958
5743
|
* Called when the reader commits a number, and with `undefined` when they
|
|
@@ -4967,18 +5752,18 @@ export declare interface StyleNumberInputProps {
|
|
|
4967
5752
|
min?: number;
|
|
4968
5753
|
/** The largest number accepted. Anything higher is pulled down to it on commit. */
|
|
4969
5754
|
max?: number;
|
|
4970
|
-
/** How far the
|
|
5755
|
+
/** How far the arrow keys move the number each time. Shift moves ten. */
|
|
4971
5756
|
step?: number;
|
|
4972
5757
|
/** How many digits after the decimal separator to keep. */
|
|
4973
5758
|
decimalScale?: number;
|
|
4974
5759
|
/** A unit written after the number, such as `"%"` or `"px"`. */
|
|
4975
5760
|
suffix?: string;
|
|
4976
5761
|
/**
|
|
4977
|
-
*
|
|
5762
|
+
* Kept so existing callers still compile; it no longer changes anything.
|
|
4978
5763
|
*
|
|
4979
|
-
*
|
|
4980
|
-
*
|
|
4981
|
-
* @
|
|
5764
|
+
* Figma's number fields never draw up and down steppers, so neither does
|
|
5765
|
+
* this one; the arrow keys step the number instead.
|
|
5766
|
+
* @deprecated The steppers are gone at either value.
|
|
4982
5767
|
*/
|
|
4983
5768
|
hideControls?: boolean;
|
|
4984
5769
|
/**
|
|
@@ -5001,10 +5786,7 @@ export declare interface StyleNumberInputProps {
|
|
|
5001
5786
|
* instead of announcing an unexplained unavailable control.
|
|
5002
5787
|
*
|
|
5003
5788
|
* Write it as a whole sentence naming what would make the control usable
|
|
5004
|
-
* again.
|
|
5005
|
-
* and silent, so a reader who could not type into it had no route at all to
|
|
5006
|
-
* learning why -- spec:6641 asks for the reason to travel with the ink, and
|
|
5007
|
-
* until now this component had nowhere to put it.
|
|
5789
|
+
* again.
|
|
5008
5790
|
*/
|
|
5009
5791
|
disabledReason?: string;
|
|
5010
5792
|
/** Called when the control takes focus. Forwarded unchanged. */
|
|
@@ -5021,12 +5803,15 @@ export declare interface StyleNumberInputProps {
|
|
|
5021
5803
|
/**
|
|
5022
5804
|
* A dropdown that says whether the reader chose its value or inherited it.
|
|
5023
5805
|
*
|
|
5806
|
+
* It is drawn as Figma's outlined select trigger (the theme's Select), and its
|
|
5807
|
+
* list is the dark listbox, opening over the trigger with the current choice
|
|
5808
|
+
* on top of it (design/figma-spec.md 6.4, 6.5).
|
|
5809
|
+
*
|
|
5024
5810
|
* It is a Mantine `Select` with one idea added: `undefined` means "nothing has
|
|
5025
|
-
* been chosen here", so the control shows `defaultValue`
|
|
5026
|
-
*
|
|
5027
|
-
* reset button appears beside it, and pressing that reset reports `undefined`
|
|
5811
|
+
* been chosen here", so the control shows `defaultValue` and offers no reset.
|
|
5812
|
+
* As soon as the reader picks something a reset button appears beside it, and pressing that reset reports `undefined`
|
|
5028
5813
|
* again. A panel built from these reads at a glance as a list of what has been
|
|
5029
|
-
*
|
|
5814
|
+
* customized and what has not.
|
|
5030
5815
|
*
|
|
5031
5816
|
* Reach for Mantine's own `Select` for an ordinary form. Reach for this one
|
|
5032
5817
|
* where a value has a sensible default that the reader is overriding rather
|
|
@@ -5083,7 +5868,7 @@ export declare interface StyleSelectProps {
|
|
|
5083
5868
|
* chosen anything and the control is showing `defaultValue`.
|
|
5084
5869
|
*/
|
|
5085
5870
|
value?: string | undefined;
|
|
5086
|
-
/** What is shown
|
|
5871
|
+
/** What is shown while the reader has chosen nothing of their own. */
|
|
5087
5872
|
defaultValue: string;
|
|
5088
5873
|
/** The choices offered, in the order they should be listed. */
|
|
5089
5874
|
options: StyleSelectOption[];
|
|
@@ -5115,11 +5900,7 @@ export declare interface StyleSelectProps {
|
|
|
5115
5900
|
* of announcing an unexplained unavailable control.
|
|
5116
5901
|
*
|
|
5117
5902
|
* Write it as a whole sentence naming what would make the control usable
|
|
5118
|
-
* again, not as a restatement that it is off.
|
|
5119
|
-
* disabled control here used to be dimmed and silent, so a reader who could
|
|
5120
|
-
* not press it had no route at all to learning why -- spec:6641 asks for
|
|
5121
|
-
* the reason to travel with the ink, and until now this component had
|
|
5122
|
-
* nowhere to put it.
|
|
5903
|
+
* again, not as a restatement that it is off.
|
|
5123
5904
|
*/
|
|
5124
5905
|
disabledReason?: string;
|
|
5125
5906
|
/** Called when the control takes focus. Forwarded unchanged. */
|
|
@@ -5135,6 +5916,147 @@ export declare interface StyleSelectProps {
|
|
|
5135
5916
|
*/
|
|
5136
5917
|
export declare const SWATCH_COLORS_HEXA: readonly ["#5B8FF9FF", "#FF6B6BFF", "#61D095FF", "#F7B731FF", "#9B59B6FF", "#5B8FF980", "#FF6B6B80", "#61D09580", "#F7B73180", "#9B59B680"];
|
|
5137
5918
|
|
|
5919
|
+
/**
|
|
5920
|
+
* One toast: Figma's pill notification (design/figma-spec.md 8.6). Render it
|
|
5921
|
+
* yourself where it should sit, or let `ToastProvider` and `useToast` place,
|
|
5922
|
+
* time and replace it.
|
|
5923
|
+
* @param props - Component props
|
|
5924
|
+
* @param props.message - The message
|
|
5925
|
+
* @param props.icon - An optional 16px glyph before the message
|
|
5926
|
+
* @param props.action - An optional action button
|
|
5927
|
+
* @param props.withCloseButton - Show the dismiss X
|
|
5928
|
+
* @param props.onClose - Called when the dismiss X is pressed
|
|
5929
|
+
* @param props.closeLabel - The dismiss button's accessible name
|
|
5930
|
+
* @returns The toast
|
|
5931
|
+
*/
|
|
5932
|
+
export declare const Toast: ForwardRefExoticComponent<ToastProps & RefAttributes<HTMLDivElement>>;
|
|
5933
|
+
|
|
5934
|
+
/** A button in the toast that acts on what the message is about. */
|
|
5935
|
+
export declare interface ToastAction {
|
|
5936
|
+
/** The button's text, such as "Copy to clipboard". */
|
|
5937
|
+
label: string;
|
|
5938
|
+
/** What the button does. The toast stays up until it is dismissed. */
|
|
5939
|
+
onClick: (event: MouseEvent_2<HTMLButtonElement>) => void;
|
|
5940
|
+
}
|
|
5941
|
+
|
|
5942
|
+
/** The toast controls `useToast` returns. */
|
|
5943
|
+
export declare interface ToastApi {
|
|
5944
|
+
/** Show a toast, replacing the one on screen and restarting the timer. */
|
|
5945
|
+
show: (toast: ReactNode | ToastOptions) => void;
|
|
5946
|
+
/** Take the toast down. */
|
|
5947
|
+
hide: () => void;
|
|
5948
|
+
}
|
|
5949
|
+
|
|
5950
|
+
/** What `useToast().show` takes: a message, or a message with its extras. */
|
|
5951
|
+
export declare interface ToastOptions extends Omit<ToastProps, "onClose" | "message"> {
|
|
5952
|
+
/** The message. */
|
|
5953
|
+
message: ReactNode;
|
|
5954
|
+
/**
|
|
5955
|
+
* How long it stays, in ms; `null` keeps it until it is dismissed or
|
|
5956
|
+
* replaced. Defaults to Figma's rule: about 3 s for a message under 20
|
|
5957
|
+
* characters, about 6 s for a longer one, and never for a toast with an
|
|
5958
|
+
* action.
|
|
5959
|
+
*/
|
|
5960
|
+
duration?: number | null;
|
|
5961
|
+
}
|
|
5962
|
+
|
|
5963
|
+
/**
|
|
5964
|
+
* Props for Toast: the message and its extras, plus any Mantine `Notification`
|
|
5965
|
+
* prop except the ones the toast owns.
|
|
5966
|
+
*/
|
|
5967
|
+
export declare interface ToastProps extends Omit<NotificationProps, "children" | "title" | "icon" | "onClose" | "withCloseButton" | "role"> {
|
|
5968
|
+
/** The message, such as "Zoom to selection". */
|
|
5969
|
+
message: ReactNode;
|
|
5970
|
+
/** An optional 16px glyph before the message. */
|
|
5971
|
+
icon?: ReactNode;
|
|
5972
|
+
/** An optional action button after the message. */
|
|
5973
|
+
action?: ToastAction;
|
|
5974
|
+
/** Show the dismiss X at the end. @default false */
|
|
5975
|
+
withCloseButton?: boolean;
|
|
5976
|
+
/** Called when the dismiss X is pressed. */
|
|
5977
|
+
onClose?: () => void;
|
|
5978
|
+
/** The dismiss button's accessible name. @default "Dismiss" */
|
|
5979
|
+
closeLabel?: string;
|
|
5980
|
+
}
|
|
5981
|
+
|
|
5982
|
+
/**
|
|
5983
|
+
* The one toast the page shows (design/figma-spec.md 8.6): centered
|
|
5984
|
+
* horizontally near the bottom of the window. Only one exists; a new one
|
|
5985
|
+
* replaces the text and restarts the timer. It appears and goes in one frame,
|
|
5986
|
+
* and hovering it does not pause the timer. Wrap the application once and call
|
|
5987
|
+
* `useToast()` anywhere inside.
|
|
5988
|
+
* @param props - Component props
|
|
5989
|
+
* @param props.children - The part of the tree that may show toasts
|
|
5990
|
+
* @param props.bottom - The distance from the window's bottom edge, in px
|
|
5991
|
+
* @param props.zIndex - The layer the toast draws at
|
|
5992
|
+
* @returns The provider and, while a toast is up, the toast
|
|
5993
|
+
* @example
|
|
5994
|
+
* ```tsx
|
|
5995
|
+
* <ToastProvider>
|
|
5996
|
+
* <App />
|
|
5997
|
+
* </ToastProvider>
|
|
5998
|
+
* // anywhere inside:
|
|
5999
|
+
* const toast = useToast();
|
|
6000
|
+
* toast.show("Zoom to selection");
|
|
6001
|
+
* ```
|
|
6002
|
+
*/
|
|
6003
|
+
export declare function ToastProvider({ children, bottom, zIndex }: ToastProviderProps): JSX.Element;
|
|
6004
|
+
|
|
6005
|
+
/** Props for ToastProvider. */
|
|
6006
|
+
export declare interface ToastProviderProps {
|
|
6007
|
+
/** The part of the tree that may show toasts. Usually the whole application. */
|
|
6008
|
+
children: ReactNode;
|
|
6009
|
+
/**
|
|
6010
|
+
* The distance from the window's bottom edge to the toast's, in px. Figma
|
|
6011
|
+
* keeps the toast 16px above its bottom toolbar; the default clears a
|
|
6012
|
+
* 60px toolbar the same way.
|
|
6013
|
+
* @default 76
|
|
6014
|
+
*/
|
|
6015
|
+
bottom?: number;
|
|
6016
|
+
/** The layer the toast draws at. @default 1300 */
|
|
6017
|
+
zIndex?: number;
|
|
6018
|
+
}
|
|
6019
|
+
|
|
6020
|
+
/**
|
|
6021
|
+
* A 24 x 24 icon toggle (design/figma-spec.md 4.4): lock aspect ratio, use as mask, visibility.
|
|
6022
|
+
* @param props - Component props
|
|
6023
|
+
* @returns The toggle
|
|
6024
|
+
* @example
|
|
6025
|
+
* ```tsx
|
|
6026
|
+
* <ToggleIconButton label="Lock aspect ratio" icon={<UiGlyph name="unlock" />} checkedIcon={<UiGlyph name="lock" />} />
|
|
6027
|
+
* ```
|
|
6028
|
+
*/
|
|
6029
|
+
export declare const ToggleIconButton: ForwardRefExoticComponent<ToggleIconButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
6030
|
+
|
|
6031
|
+
/**
|
|
6032
|
+
* Props for ToggleIconButton.
|
|
6033
|
+
*
|
|
6034
|
+
* Every ActionIcon prop but `variant`, `children` and `onChange` is accepted and reaches the
|
|
6035
|
+
* button (`size`, `disabled`, `className`, a `data-` attribute ...).
|
|
6036
|
+
*/
|
|
6037
|
+
export declare interface ToggleIconButtonProps extends Omit<ActionIconProps, "variant" | "children">, ElementProps<"button", "color" | "onChange" | keyof ActionIconProps> {
|
|
6038
|
+
/** Whether the toggle is on (controlled). */
|
|
6039
|
+
checked?: boolean;
|
|
6040
|
+
/** Whether the toggle starts on (uncontrolled). @default false */
|
|
6041
|
+
defaultChecked?: boolean;
|
|
6042
|
+
/** Called with the new state when the toggle flips. */
|
|
6043
|
+
onChange?: (checked: boolean) => void;
|
|
6044
|
+
/** The accessible name, and the tooltip text. */
|
|
6045
|
+
label: string;
|
|
6046
|
+
/** The glyph. */
|
|
6047
|
+
icon: ReactNode;
|
|
6048
|
+
/** The glyph drawn while on, for a `swap` toggle (eye / eye closed). */
|
|
6049
|
+
checkedIcon?: ReactNode;
|
|
6050
|
+
/**
|
|
6051
|
+
* `fill` (default): on is the selected ground with a brand glyph (lock aspect ratio, use as
|
|
6052
|
+
* mask). `swap`: never filled, on swaps the glyph (the visibility eye).
|
|
6053
|
+
* @default "fill"
|
|
6054
|
+
*/
|
|
6055
|
+
variant?: "fill" | "swap";
|
|
6056
|
+
/** Show the tooltip. @default true */
|
|
6057
|
+
withTooltip?: boolean;
|
|
6058
|
+
}
|
|
6059
|
+
|
|
5138
6060
|
/**
|
|
5139
6061
|
* A single boolean on a row of its own, packed tighter than every other row
|
|
5140
6062
|
* type.
|
|
@@ -5146,12 +6068,13 @@ export declare const SWATCH_COLORS_HEXA: readonly ["#5B8FF9FF", "#FF6B6BFF", "#6
|
|
|
5146
6068
|
* 1. **The label is the only word on the row, and the verb is deleted from
|
|
5147
6069
|
* it.** `Show labels` is `Labels`; `Animate transitions` is `Transitions`.
|
|
5148
6070
|
* The checkbox already says "show", so the word is spent on what is shown.
|
|
5149
|
-
* 2. **
|
|
5150
|
-
* the
|
|
5151
|
-
*
|
|
6071
|
+
* 2. **It is Figma's checkbox row**: 32px tall like every other property row,
|
|
6072
|
+
* the neutral (panel) checkbox that stays gray when checked, and the word
|
|
6073
|
+
* 8px after the box (design/figma-spec.md 5.10).
|
|
5152
6074
|
*
|
|
5153
|
-
* The control is a Mantine `Checkbox` at 16px, or a
|
|
5154
|
-
* when the boolean is a live mode rather than an
|
|
6075
|
+
* The control is a Mantine `Checkbox` at 16px (`variant="neutral"`), or a
|
|
6076
|
+
* Mantine `Switch` at 32x16 when the boolean is a live mode rather than an
|
|
6077
|
+
* option. Both are real inputs,
|
|
5155
6078
|
* so Tab reaches them, Space toggles them, and a screen reader reads the state
|
|
5156
6079
|
* out; clicking the word works as well as clicking the box.
|
|
5157
6080
|
*
|
|
@@ -5162,7 +6085,7 @@ export declare const SWATCH_COLORS_HEXA: readonly ["#5B8FF9FF", "#FF6B6BFF", "#6
|
|
|
5162
6085
|
* @param props.checked - Whether the toggle is on, when driven from your own state
|
|
5163
6086
|
* @param props.defaultChecked - Whether the toggle starts on, when the row keeps its own state
|
|
5164
6087
|
* @param props.onChange - Called with the new state first and the event that caused it second
|
|
5165
|
-
* @param props.control - Which control to draw: a 16px checkbox, or a
|
|
6088
|
+
* @param props.control - Which control to draw: a 16px checkbox, or a 32x16 switch for a live mode
|
|
5166
6089
|
* @param props.trailing - What to put in the fixed 24px slot at the end of the row
|
|
5167
6090
|
* @param props.disabled - Whether the toggle can be changed
|
|
5168
6091
|
* @param props.disabledReason - One sentence saying why the toggle is off, drawn only while it is off
|
|
@@ -5194,8 +6117,8 @@ export declare function ToggleRow({ label, checked, defaultChecked, onChange, co
|
|
|
5194
6117
|
* That is a rule about the design rather than about the runtime, so the group
|
|
5195
6118
|
* holds the line where the design is edited: it warns on the console in a
|
|
5196
6119
|
* development build when it is given fewer than two children, and renders them
|
|
5197
|
-
* anyway. The pitch needs no gap -- each row is exactly
|
|
5198
|
-
* column is already the
|
|
6120
|
+
* anyway. The pitch needs no gap -- each row is exactly 32px tall, so a plain
|
|
6121
|
+
* column is already the row pitch.
|
|
5199
6122
|
*
|
|
5200
6123
|
* The rows are wrapped in a group so a screen reader announces them as one set
|
|
5201
6124
|
* rather than as loose checkboxes. Name it: point `labelledBy` at the heading
|
|
@@ -5304,7 +6227,7 @@ export declare interface ToggleRowProps {
|
|
|
5304
6227
|
* Whether the toggle can be changed.
|
|
5305
6228
|
*
|
|
5306
6229
|
* A disabled row keeps its place and its word, drops to the dimmed text
|
|
5307
|
-
*
|
|
6230
|
+
* color that Mantine's own disabled controls use, and is announced as
|
|
5308
6231
|
* unavailable rather than merely looking it.
|
|
5309
6232
|
*/
|
|
5310
6233
|
disabled?: boolean;
|
|
@@ -5317,12 +6240,9 @@ export declare interface ToggleRowProps {
|
|
|
5317
6240
|
* control's accessible description, so the reason reaches a pointer user
|
|
5318
6241
|
* and a screen reader user alike.
|
|
5319
6242
|
*
|
|
5320
|
-
*
|
|
5321
|
-
*
|
|
5322
|
-
*
|
|
5323
|
-
* therefore dimmed and permanently unexplained, which is what spec:6641
|
|
5324
|
-
* forbids. The caller supplies the sentence; the library never invents one,
|
|
5325
|
-
* because only the call site knows what would turn the control back on.
|
|
6243
|
+
* Write it as a whole sentence naming what would make the toggle usable.
|
|
6244
|
+
* The library never invents one: only the caller knows what would turn the
|
|
6245
|
+
* control back on.
|
|
5326
6246
|
*/
|
|
5327
6247
|
disabledReason?: string;
|
|
5328
6248
|
/**
|
|
@@ -5332,10 +6252,7 @@ export declare interface ToggleRowProps {
|
|
|
5332
6252
|
* The row draws a filled attribute glyph beside its word -- the same filled
|
|
5333
6253
|
* glyph `PanelField` uses to say the same thing -- so a panel can say "this
|
|
5334
6254
|
* follows the data" without spending a row on a fixed-or-by-attribute
|
|
5335
|
-
* switch.
|
|
5336
|
-
* until now `PanelField` was the only control in the library able to say
|
|
5337
|
-
* so, which is why a bound boolean had to be drawn as a number field or not
|
|
5338
|
-
* drawn at all.
|
|
6255
|
+
* switch.
|
|
5339
6256
|
* @default false
|
|
5340
6257
|
*/
|
|
5341
6258
|
bound?: boolean;
|
|
@@ -5361,7 +6278,7 @@ export declare interface ToggleRowProps {
|
|
|
5361
6278
|
* it.
|
|
5362
6279
|
*
|
|
5363
6280
|
* Reach for it when a setting is a yes or no that brings its own settings with
|
|
5364
|
-
* it -- a glow with a radius and a
|
|
6281
|
+
* it -- a glow with a radius and a color, an outline with a width, a legend
|
|
5365
6282
|
* with a position. Turning the feature off takes its controls off the screen,
|
|
5366
6283
|
* so a panel shows only what is currently in play.
|
|
5367
6284
|
*
|
|
@@ -5437,7 +6354,7 @@ export declare interface ToggleWithContentProps {
|
|
|
5437
6354
|
* Whether the toggle can be changed.
|
|
5438
6355
|
*
|
|
5439
6356
|
* A disabled toggle keeps its place and its word, drops to the dimmed text
|
|
5440
|
-
*
|
|
6357
|
+
* color Mantine's own disabled controls use, and is announced as
|
|
5441
6358
|
* unavailable rather than merely looking it. Controls already revealed stay
|
|
5442
6359
|
* revealed; disable them yourself if they should not be touched either.
|
|
5443
6360
|
*/
|
|
@@ -5451,12 +6368,9 @@ export declare interface ToggleWithContentProps {
|
|
|
5451
6368
|
* accessible description, so the reason reaches a pointer user and a screen
|
|
5452
6369
|
* reader user alike.
|
|
5453
6370
|
*
|
|
5454
|
-
*
|
|
5455
|
-
*
|
|
5456
|
-
*
|
|
5457
|
-
* for the one reason to travel with the disabled ink; until now this
|
|
5458
|
-
* component had nowhere to put it. The caller supplies the sentence -- only
|
|
5459
|
-
* the call site knows what would turn the feature back on.
|
|
6371
|
+
* Write it as a whole sentence naming what would make the toggle usable.
|
|
6372
|
+
* The library never invents one: only the caller knows what would turn the
|
|
6373
|
+
* feature back on.
|
|
5460
6374
|
*/
|
|
5461
6375
|
disabledReason?: string;
|
|
5462
6376
|
/**
|
|
@@ -5466,9 +6380,7 @@ export declare interface ToggleWithContentProps {
|
|
|
5466
6380
|
* The toggle draws a filled attribute glyph beside its word -- the same
|
|
5467
6381
|
* filled glyph `PanelField` uses to say the same thing -- so a panel can
|
|
5468
6382
|
* say "this follows the data" without spending a row on a
|
|
5469
|
-
* fixed-or-by-attribute switch.
|
|
5470
|
-
* numeric one can, and until now `PanelField` was the only control in the
|
|
5471
|
-
* library able to say so.
|
|
6383
|
+
* fixed-or-by-attribute switch.
|
|
5472
6384
|
* @default false
|
|
5473
6385
|
*/
|
|
5474
6386
|
bound?: boolean;
|
|
@@ -5505,6 +6417,166 @@ export declare interface ToggleWithContentProps {
|
|
|
5505
6417
|
*/
|
|
5506
6418
|
export declare function toHexaColor(hex: string, opacity: number): string;
|
|
5507
6419
|
|
|
6420
|
+
/** The floating editor toolbar, with `Toolbar.Divider`. */
|
|
6421
|
+
export declare const Toolbar: typeof ToolbarRoot & {
|
|
6422
|
+
Divider: typeof ToolbarDivider;
|
|
6423
|
+
};
|
|
6424
|
+
|
|
6425
|
+
/**
|
|
6426
|
+
* The toolbar's 1px divider, full height (48).
|
|
6427
|
+
* @returns The divider
|
|
6428
|
+
*/
|
|
6429
|
+
declare function ToolbarDivider(): default_2.JSX.Element;
|
|
6430
|
+
|
|
6431
|
+
/**
|
|
6432
|
+
* Props for the Toolbar component.
|
|
6433
|
+
*/
|
|
6434
|
+
export declare interface ToolbarProps extends BoxProps, ElementProps<"div"> {
|
|
6435
|
+
/** Accessible name of the toolbar. Defaults to the "Tools" label. */
|
|
6436
|
+
"aria-label"?: string;
|
|
6437
|
+
/**
|
|
6438
|
+
* Pin the toolbar to the bottom center of the window, 12px up (Figma's position). Leave it off
|
|
6439
|
+
* to position the toolbar yourself.
|
|
6440
|
+
*/
|
|
6441
|
+
floating?: boolean;
|
|
6442
|
+
/** Tool groups, tool buttons, dividers and a mode switch. */
|
|
6443
|
+
children?: default_2.ReactNode;
|
|
6444
|
+
}
|
|
6445
|
+
|
|
6446
|
+
/**
|
|
6447
|
+
* The floating editor toolbar: a white (dark #2c2c2c) bar 48 tall with 13px corners and the
|
|
6448
|
+
* 200 elevation, holding tool buttons, tool groups with flyouts, dividers and a
|
|
6449
|
+
* `SegmentedControl variant="toolbar"` mode switch.
|
|
6450
|
+
*
|
|
6451
|
+
* It is one Tab stop: focus lands on the selected tool, and ArrowLeft / ArrowRight / Home / End
|
|
6452
|
+
* move between tools, chevrons and the mode radios.
|
|
6453
|
+
* @param props - Component props
|
|
6454
|
+
* @param props.floating - Pin the toolbar to the bottom center of the window
|
|
6455
|
+
* @param props.children - Tool groups, tool buttons, dividers and a mode switch
|
|
6456
|
+
* @param props.className - Extra class on the root
|
|
6457
|
+
* @param props.onKeyDown - Called before the roving-focus key handling
|
|
6458
|
+
* @param props.onFocus - Called before the roving-focus bookkeeping
|
|
6459
|
+
* @returns The toolbar
|
|
6460
|
+
* @example
|
|
6461
|
+
* ```tsx
|
|
6462
|
+
* <Toolbar aria-label="Editor" floating>
|
|
6463
|
+
* <ToolGroup label="Shape tools" tools={shapes} activeTool={tool} onToolChange={setTool} />
|
|
6464
|
+
* <Toolbar.Divider />
|
|
6465
|
+
* <SegmentedControl variant="toolbar" data={modes} />
|
|
6466
|
+
* </Toolbar>
|
|
6467
|
+
* ```
|
|
6468
|
+
*/
|
|
6469
|
+
declare function ToolbarRoot({ floating, children, className, onKeyDown, onFocus, ...others }: ToolbarProps): default_2.JSX.Element;
|
|
6470
|
+
|
|
6471
|
+
/**
|
|
6472
|
+
* A 32 x 32 toolbar tool (Figma's toolbelt button): transparent at rest, `--cm-bg-hover` under the
|
|
6473
|
+
* pointer, the brand fill when selected, a 1px inside focus ring (a double ring when selected).
|
|
6474
|
+
* The tooltip opens above with the shortcut after the name.
|
|
6475
|
+
* @param props - Component props
|
|
6476
|
+
* @param props.label - The tool's name
|
|
6477
|
+
* @param props.icon - The tool's glyph
|
|
6478
|
+
* @param props.shortcut - The keyboard shortcut shown in the tooltip
|
|
6479
|
+
* @param props.selected - Whether this is the current tool
|
|
6480
|
+
* @param props.tooltipPosition - Where the tooltip opens
|
|
6481
|
+
* @returns The tool button
|
|
6482
|
+
*/
|
|
6483
|
+
export declare const ToolButton: default_2.ForwardRefExoticComponent<ToolButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
6484
|
+
|
|
6485
|
+
/**
|
|
6486
|
+
* Props for the ToolButton component.
|
|
6487
|
+
*/
|
|
6488
|
+
export declare interface ToolButtonProps extends Omit<UnstyledButtonProps, "children">, Omit<ElementProps<"button">, "children"> {
|
|
6489
|
+
/** The tool's name: its accessible name and its tooltip. */
|
|
6490
|
+
label: string;
|
|
6491
|
+
/** The tool's glyph, drawn in a 24px box. */
|
|
6492
|
+
icon: default_2.ReactNode;
|
|
6493
|
+
/** The keyboard shortcut shown in the tooltip, such as `"F"`. */
|
|
6494
|
+
shortcut?: string;
|
|
6495
|
+
/**
|
|
6496
|
+
* Whether this is the current tool (`aria-pressed`): a brand fill with a white glyph. Leave it
|
|
6497
|
+
* undefined for a button that runs an action rather than picking a tool.
|
|
6498
|
+
*/
|
|
6499
|
+
selected?: boolean;
|
|
6500
|
+
/** Where the tooltip opens. Defaults to above, as on Figma's bottom toolbar. */
|
|
6501
|
+
tooltipPosition?: TooltipProps["position"];
|
|
6502
|
+
}
|
|
6503
|
+
|
|
6504
|
+
/**
|
|
6505
|
+
* A tool and its flyout (Figma's tool group): the face is the LAST tool picked from the flyout,
|
|
6506
|
+
* and a 16 x 32 chevron 1px after it opens a dark menu 4px above, start-aligned to the chevron,
|
|
6507
|
+
* whose rows are radios with a check on the current face. Picking a row selects the tool, makes
|
|
6508
|
+
* it the face and closes the menu.
|
|
6509
|
+
* @param props - Component props
|
|
6510
|
+
* @param props.label - The chevron's name, such as "Shape tools"
|
|
6511
|
+
* @param props.tools - The tools of the group
|
|
6512
|
+
* @param props.activeTool - The toolbar's current tool
|
|
6513
|
+
* @param props.onToolChange - Called with a tool's value when it is picked
|
|
6514
|
+
* @param props.defaultFace - The tool the face shows until one is picked
|
|
6515
|
+
* @param props.chevronProps - Extra attributes for the chevron button
|
|
6516
|
+
* @returns The tool group
|
|
6517
|
+
*/
|
|
6518
|
+
export declare function ToolGroup({ label, tools, activeTool, onToolChange, defaultFace, chevronProps, }: ToolGroupProps): default_2.JSX.Element;
|
|
6519
|
+
|
|
6520
|
+
/**
|
|
6521
|
+
* Props for the ToolGroup component.
|
|
6522
|
+
*/
|
|
6523
|
+
export declare interface ToolGroupProps {
|
|
6524
|
+
/** The chevron's accessible name and tooltip, and the flyout's name, such as "Shape tools". */
|
|
6525
|
+
label: string;
|
|
6526
|
+
/** The tools of the group, in flyout order. */
|
|
6527
|
+
tools: readonly ToolItem[];
|
|
6528
|
+
/** The toolbar's current tool. When it is one of this group's tools, the face shows it selected. */
|
|
6529
|
+
activeTool?: string | null;
|
|
6530
|
+
/** Called with a tool's value when the face is clicked or a flyout row is picked. */
|
|
6531
|
+
onToolChange?: (value: string) => void;
|
|
6532
|
+
/** The tool the face shows until one is picked. Defaults to the first tool. */
|
|
6533
|
+
defaultFace?: string;
|
|
6534
|
+
/** Extra attributes for the chevron button, such as a `data-testid` or a forced `data-state`. */
|
|
6535
|
+
chevronProps?: default_2.ComponentPropsWithoutRef<"button"> & {
|
|
6536
|
+
[data: `data-${string}`]: string | undefined;
|
|
6537
|
+
};
|
|
6538
|
+
}
|
|
6539
|
+
|
|
6540
|
+
/** One tool of a group: what the face and the flyout row show. */
|
|
6541
|
+
export declare interface ToolItem {
|
|
6542
|
+
/** The tool's identifier, handed to `onToolChange`. */
|
|
6543
|
+
value: string;
|
|
6544
|
+
/** The tool's name. */
|
|
6545
|
+
label: string;
|
|
6546
|
+
/** The tool's glyph (drawn in a 24px box). */
|
|
6547
|
+
icon: default_2.ReactNode;
|
|
6548
|
+
/** The keyboard shortcut shown in the tooltip and the flyout, such as `"R"`. */
|
|
6549
|
+
shortcut?: string;
|
|
6550
|
+
}
|
|
6551
|
+
|
|
6552
|
+
/**
|
|
6553
|
+
* A tooltip label with its keyboard shortcut on the same line (design/figma-spec.md
|
|
6554
|
+
* 8.3): the shortcut sits 12px after the label in the tooltip's secondary text
|
|
6555
|
+
* color, as Figma's "Align left Alt+A". Pass it as a Tooltip's `label`. The
|
|
6556
|
+
* tooltip's `aria-describedby` reads both.
|
|
6557
|
+
* @param props - Component props
|
|
6558
|
+
* @param props.label - What the control does
|
|
6559
|
+
* @param props.shortcut - Its keyboard shortcut
|
|
6560
|
+
* @returns The label and shortcut
|
|
6561
|
+
* @example
|
|
6562
|
+
* ```tsx
|
|
6563
|
+
* <Tooltip label={<TooltipShortcut label="Align left" shortcut="Alt+A" />}>
|
|
6564
|
+
* <ActionIcon aria-label="Align left">...</ActionIcon>
|
|
6565
|
+
* </Tooltip>
|
|
6566
|
+
* ```
|
|
6567
|
+
*/
|
|
6568
|
+
export declare function TooltipShortcut({ label, shortcut }: TooltipShortcutProps): JSX.Element;
|
|
6569
|
+
|
|
6570
|
+
/**
|
|
6571
|
+
* Props for TooltipShortcut.
|
|
6572
|
+
*/
|
|
6573
|
+
export declare interface TooltipShortcutProps {
|
|
6574
|
+
/** What the control does, such as "Align left". */
|
|
6575
|
+
label: ReactNode;
|
|
6576
|
+
/** Its keyboard shortcut, such as "Alt+A". */
|
|
6577
|
+
shortcut: ReactNode;
|
|
6578
|
+
}
|
|
6579
|
+
|
|
5508
6580
|
/**
|
|
5509
6581
|
* The fixed 24px slot every panel row ends with.
|
|
5510
6582
|
*
|
|
@@ -5513,8 +6585,8 @@ export declare function toHexaColor(hex: string, opacity: number): string;
|
|
|
5513
6585
|
* and common: it is what makes a row with no extra control end level with a row
|
|
5514
6586
|
* that has one.
|
|
5515
6587
|
*
|
|
5516
|
-
* The panel this library lays out is
|
|
5517
|
-
* `16 +
|
|
6588
|
+
* The panel this library lays out is 240px wide and spends it as
|
|
6589
|
+
* `16 + 88 + 8 + 88 + 8 + 24 + 8`: leading padding, two fields with a gutter
|
|
5518
6590
|
* between them, a gap, this slot, and trailing padding. Dropping the slot when
|
|
5519
6591
|
* it is empty is what breaks that.
|
|
5520
6592
|
* @param props - Component props
|
|
@@ -5540,6 +6612,181 @@ export declare interface TrailingSlotProps {
|
|
|
5540
6612
|
children?: default_2.ReactNode;
|
|
5541
6613
|
}
|
|
5542
6614
|
|
|
6615
|
+
/**
|
|
6616
|
+
* A layer tree with Figma's rows and the WAI-ARIA tree-view keyboard model
|
|
6617
|
+
* (design/figma-spec.md 10.1).
|
|
6618
|
+
*
|
|
6619
|
+
* The tree renders; the caller owns the data. Selection and expansion are controlled or
|
|
6620
|
+
* uncontrolled; renaming and moving are reported through `onRename` and `onMove`.
|
|
6621
|
+
*
|
|
6622
|
+
* Keyboard (one Tab stop, roving focus): ArrowUp / ArrowDown move; ArrowRight opens a closed
|
|
6623
|
+
* parent or moves to its first child; ArrowLeft closes an open parent or moves to the parent;
|
|
6624
|
+
* Home / End; type-ahead; Enter or Space selects (Shift extends, Control / Command toggles); `*`
|
|
6625
|
+
* 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.
|
|
6627
|
+
* Pointer: click selects (Shift range, Control / Command toggle); the caret opens one row;
|
|
6628
|
+
* double-click renames; drag a row to move it.
|
|
6629
|
+
* @param props - Component props
|
|
6630
|
+
* @param props.items - The items or pages
|
|
6631
|
+
* @param props.label - The accessible name
|
|
6632
|
+
* @param props.selected - Selected ids (controlled)
|
|
6633
|
+
* @param props.defaultSelected - Selected ids to start with
|
|
6634
|
+
* @param props.onSelect - Called with the new selection
|
|
6635
|
+
* @param props.expanded - Expanded ids (controlled)
|
|
6636
|
+
* @param props.defaultExpanded - Expanded ids to start with
|
|
6637
|
+
* @param props.onExpandedChange - Called with the expanded ids
|
|
6638
|
+
* @param props.multiselect - Allow several selected rows
|
|
6639
|
+
* @param props.onRename - Called with a new name; turns renaming on
|
|
6640
|
+
* @param props.onMove - Called when a row is dropped somewhere new or moved from the keyboard
|
|
6641
|
+
* @param props.stickyRoots - Pin expanded top-level rows while scrolling
|
|
6642
|
+
* @param props.height - The scrolling height when virtualized
|
|
6643
|
+
* @param props.renameLabel - The rename field's accessible name
|
|
6644
|
+
* @returns The tree
|
|
6645
|
+
*/
|
|
6646
|
+
export declare function Tree({ items, label, selected, defaultSelected, onSelect, expanded, defaultExpanded, onExpandedChange, multiselect, onRename, onMove, stickyRoots, height, renameLabel, }: TreeProps): default_2.JSX.Element;
|
|
6647
|
+
|
|
6648
|
+
/**
|
|
6649
|
+
* One row of a layer tree, as Figma draws it (design/figma-spec.md 10.1): 32 tall, a 16px caret
|
|
6650
|
+
* slot and a 16px type glyph indented 24px per level, the name at 11/32, and the trailing
|
|
6651
|
+
* toggles. Hover, selection and the selected-parent band are pseudo-element fills behind the
|
|
6652
|
+
* content. It is a `treeitem`; `Tree` renders it with the keyboard model, but it can be drawn on
|
|
6653
|
+
* its own (a static preview, a story).
|
|
6654
|
+
* @param props - Component props
|
|
6655
|
+
* @returns The row
|
|
6656
|
+
*/
|
|
6657
|
+
export declare const TreeItem: default_2.ForwardRefExoticComponent<TreeItemProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
6658
|
+
|
|
6659
|
+
/**
|
|
6660
|
+
* Props for the TreeItem component: one row of a layer tree.
|
|
6661
|
+
*/
|
|
6662
|
+
export declare interface TreeItemProps extends Omit<default_2.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
6663
|
+
/** The visible name. */
|
|
6664
|
+
name: string;
|
|
6665
|
+
/** The 16 x 16 type glyph. */
|
|
6666
|
+
icon?: default_2.ReactNode;
|
|
6667
|
+
/** Depth, 1 for a top-level row. Each level indents 24px. */
|
|
6668
|
+
level?: number;
|
|
6669
|
+
/** Whether the row has children (draws the caret). */
|
|
6670
|
+
hasChildren?: boolean;
|
|
6671
|
+
/** Whether its children are shown. */
|
|
6672
|
+
expanded?: boolean;
|
|
6673
|
+
/** Whether the row is selected. */
|
|
6674
|
+
selected?: boolean;
|
|
6675
|
+
/** The fill it draws; see Tree. Defaults to `selected` or `none`. */
|
|
6676
|
+
tint?: TreeRowTint;
|
|
6677
|
+
/** `"component"`: purple name and glyph. */
|
|
6678
|
+
tone?: "default" | "component";
|
|
6679
|
+
/** A hidden layer: tertiary name and glyph. */
|
|
6680
|
+
dimmed?: boolean;
|
|
6681
|
+
/** Weight 600 and a primary glyph. Defaults to true for a top-level row with children. */
|
|
6682
|
+
strong?: boolean;
|
|
6683
|
+
/** The trailing toggles, revealed on hover or focus. */
|
|
6684
|
+
actions?: default_2.ReactNode;
|
|
6685
|
+
/** 1-based position among its siblings, for assistive technology. */
|
|
6686
|
+
posInSet?: number;
|
|
6687
|
+
/** How many siblings it has, for assistive technology. */
|
|
6688
|
+
setSize?: number;
|
|
6689
|
+
/** Drawn in place of the name, e.g. an InlineRename. */
|
|
6690
|
+
nameSlot?: default_2.ReactNode;
|
|
6691
|
+
/** Called when the caret is clicked. */
|
|
6692
|
+
onExpandToggle?: (event: default_2.MouseEvent) => void;
|
|
6693
|
+
}
|
|
6694
|
+
|
|
6695
|
+
/** Anything a tree can hold: an id, and optionally children of the same shape. */
|
|
6696
|
+
declare interface TreeLike<T> {
|
|
6697
|
+
id: string;
|
|
6698
|
+
children?: readonly T[];
|
|
6699
|
+
}
|
|
6700
|
+
|
|
6701
|
+
/** Where a drop lands. `index` counts the parent's children with the moved item already removed. */
|
|
6702
|
+
export declare interface TreeMove {
|
|
6703
|
+
id: string;
|
|
6704
|
+
parentId: string | null;
|
|
6705
|
+
index: number;
|
|
6706
|
+
}
|
|
6707
|
+
|
|
6708
|
+
/** One item of a Tree. Nest items through `children`. */
|
|
6709
|
+
export declare interface TreeNodeData {
|
|
6710
|
+
/** Stable, unique across the whole tree. */
|
|
6711
|
+
id: string;
|
|
6712
|
+
/** The visible name; also the item's accessible name and its type-ahead key. */
|
|
6713
|
+
name: string;
|
|
6714
|
+
/** The 16 x 16 type glyph drawn before the name. */
|
|
6715
|
+
icon?: default_2.ReactNode;
|
|
6716
|
+
/**
|
|
6717
|
+
* The item's children. An item with a `children` array (even an empty one) is a container
|
|
6718
|
+
* that other items can be dropped into; one without is a leaf.
|
|
6719
|
+
*/
|
|
6720
|
+
children?: readonly TreeNodeData[];
|
|
6721
|
+
/** `"component"` draws the name and glyph in the component (purple) color. */
|
|
6722
|
+
tone?: "default" | "component";
|
|
6723
|
+
/** A hidden layer: the name and glyph draw in the tertiary color. */
|
|
6724
|
+
dimmed?: boolean;
|
|
6725
|
+
/**
|
|
6726
|
+
* Draw the name at weight 600 with a primary-color glyph. Defaults to true for a top-level
|
|
6727
|
+
* item with a `children` array, even an empty one (Figma's top-level frames), false otherwise.
|
|
6728
|
+
*/
|
|
6729
|
+
strong?: boolean;
|
|
6730
|
+
/**
|
|
6731
|
+
* The row's trailing toggles (lock, eye): the caller's own controls. They stay hidden until
|
|
6732
|
+
* the row is hovered or focused; a control with `aria-pressed="true"`, `aria-checked="true"`
|
|
6733
|
+
* or `data-pinned` stays visible.
|
|
6734
|
+
*/
|
|
6735
|
+
actions?: default_2.ReactNode;
|
|
6736
|
+
}
|
|
6737
|
+
|
|
6738
|
+
/**
|
|
6739
|
+
* Props for the Tree component.
|
|
6740
|
+
*/
|
|
6741
|
+
export declare interface TreeProps {
|
|
6742
|
+
/** The items, nested through `children`. */
|
|
6743
|
+
items: readonly TreeNodeData[];
|
|
6744
|
+
/** The tree's accessible name. Defaults to "Layers". */
|
|
6745
|
+
label?: string;
|
|
6746
|
+
/** Selected ids (controlled). */
|
|
6747
|
+
selected?: readonly string[];
|
|
6748
|
+
/** Selected ids to start with (uncontrolled). */
|
|
6749
|
+
defaultSelected?: readonly string[];
|
|
6750
|
+
/** Called with the new selection. */
|
|
6751
|
+
onSelect?: (ids: string[], event?: default_2.SyntheticEvent) => void;
|
|
6752
|
+
/** Expanded ids (controlled). */
|
|
6753
|
+
expanded?: readonly string[];
|
|
6754
|
+
/** Expanded ids to start with (uncontrolled). */
|
|
6755
|
+
defaultExpanded?: readonly string[];
|
|
6756
|
+
/** Called with the new set of expanded ids. */
|
|
6757
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
6758
|
+
/** Allow several selected rows (Shift and Control/Command). Default true. */
|
|
6759
|
+
multiselect?: boolean;
|
|
6760
|
+
/**
|
|
6761
|
+
* Called with a new name. Giving it turns on renaming: F2 or a double-click opens an
|
|
6762
|
+
* InlineRename in place of the name.
|
|
6763
|
+
*/
|
|
6764
|
+
onRename?: (id: string, name: string) => void;
|
|
6765
|
+
/**
|
|
6766
|
+
* Called when a row is dropped somewhere new, or moved one place among its siblings with
|
|
6767
|
+
* Alt+ArrowUp / Alt+ArrowDown. `index` counts the new parent's children with the moved item
|
|
6768
|
+
* already removed. Giving it makes rows draggable and turns on the keyboard move; the tree
|
|
6769
|
+
* never moves data itself, and focus stays on the moved item once the caller has moved it.
|
|
6770
|
+
*/
|
|
6771
|
+
onMove?: (move: TreeMove) => void;
|
|
6772
|
+
/** Keep an expanded top-level row pinned while its children scroll (not while virtualized). */
|
|
6773
|
+
stickyRoots?: boolean;
|
|
6774
|
+
/** The scrolling height. Needed for virtualization (over 200 visible rows); default 480. */
|
|
6775
|
+
height?: number | string;
|
|
6776
|
+
/** The accessible name of the rename field. Defaults to "Layer name". */
|
|
6777
|
+
renameLabel?: string;
|
|
6778
|
+
}
|
|
6779
|
+
|
|
6780
|
+
/**
|
|
6781
|
+
* The fill a row draws (design/figma-spec.md 10.1):
|
|
6782
|
+
* - `selected`: a lone selected row;
|
|
6783
|
+
* - `first` / `middle` / `last`: a run of adjacent selected rows, drawn as one block;
|
|
6784
|
+
* - `parent`: a selected, expanded parent (its pill runs into the band below);
|
|
6785
|
+
* - `child` / `child-last`: the band behind a selected parent's visible descendants;
|
|
6786
|
+
* - `none`.
|
|
6787
|
+
*/
|
|
6788
|
+
export declare type TreeRowTint = "none" | "selected" | "first" | "middle" | "last" | "parent" | "child" | "child-last";
|
|
6789
|
+
|
|
5543
6790
|
/**
|
|
5544
6791
|
* Every shared UI glyph name.
|
|
5545
6792
|
*/
|
|
@@ -5552,7 +6799,7 @@ export declare const UI_GLYPH_NAMES: readonly UiGlyphName[];
|
|
|
5552
6799
|
* title and the accessible name.
|
|
5553
6800
|
* @param props - Component props
|
|
5554
6801
|
* @param props.name - Which shared UI glyph to draw
|
|
5555
|
-
* @param props.size - Drawn size in pixels, defaulting to the
|
|
6802
|
+
* @param props.size - Drawn size in pixels, defaulting to the 12px nominal glyph size
|
|
5556
6803
|
* @returns The UI glyph SVG
|
|
5557
6804
|
*/
|
|
5558
6805
|
export declare function UiGlyph({ name, size }: UiGlyphProps): default_2.JSX.Element;
|
|
@@ -5561,7 +6808,7 @@ export declare function UiGlyph({ name, size }: UiGlyphProps): default_2.JSX.Ele
|
|
|
5561
6808
|
* Shared UI glyphs: the chevrons, the doors and the status marks the row types
|
|
5562
6809
|
* draw outside a field's slot.
|
|
5563
6810
|
*/
|
|
5564
|
-
export declare type UiGlyphName = "chevronDown" | "chevronRight" | "chevronLeft" | "close" | "plus" | "minus" | "gear" | "warning" | "check" | "eye" | "refresh" | "copy" | "pin" | "keepOpen" | "info" | "reset";
|
|
6811
|
+
export declare type UiGlyphName = "chevronDown" | "chevronRight" | "chevronLeft" | "close" | "plus" | "minus" | "gear" | "warning" | "check" | "eye" | "refresh" | "copy" | "pin" | "keepOpen" | "info" | "reset" | "caretDown" | "caretRight" | "dash" | "eyeClosed" | "lock" | "unlock" | "search" | "settings" | "link" | "unlink" | "eyedropper" | "rotate" | "flipHorizontal" | "flipVertical" | "alignLeft" | "alignCenterH" | "alignRight" | "alignTop" | "alignCenterV" | "alignBottom" | "more" | "help" | "frame" | "rectangle" | "ellipse" | "text" | "component" | "group";
|
|
5565
6812
|
|
|
5566
6813
|
/**
|
|
5567
6814
|
* Props for the UiGlyph component.
|
|
@@ -5569,7 +6816,7 @@ export declare type UiGlyphName = "chevronDown" | "chevronRight" | "chevronLeft"
|
|
|
5569
6816
|
export declare interface UiGlyphProps {
|
|
5570
6817
|
/** Which shared UI glyph to draw. */
|
|
5571
6818
|
name: UiGlyphName;
|
|
5572
|
-
/** Drawn size in pixels. Defaults to the
|
|
6819
|
+
/** Drawn size in pixels. Defaults to the 12px nominal glyph size. */
|
|
5573
6820
|
size?: number;
|
|
5574
6821
|
}
|
|
5575
6822
|
|
|
@@ -5595,7 +6842,7 @@ export declare function useActualColorScheme(fallback?: "light" | "dark"): "ligh
|
|
|
5595
6842
|
* after every unaccented one and sorts "item 10" before "item 9". A collator
|
|
5596
6843
|
* sorts the way a reader of that language expects.
|
|
5597
6844
|
* @param options - Collation options, passed straight to `Intl.Collator`; `{numeric: true}` is usually what a column of values wants
|
|
5598
|
-
* @returns A
|
|
6845
|
+
* @returns A memoized `Intl.Collator` for the active locale
|
|
5599
6846
|
* @example
|
|
5600
6847
|
* ```tsx
|
|
5601
6848
|
* const collator = useCollator({numeric: true});
|
|
@@ -5641,7 +6888,7 @@ export declare function useLocale(): string;
|
|
|
5641
6888
|
* there is none. The formatter is rebuilt only when the locale or the options
|
|
5642
6889
|
* change, so it is safe to call on every row of a long list.
|
|
5643
6890
|
* @param options - Formatting options, passed straight to `Intl.NumberFormat`
|
|
5644
|
-
* @returns A
|
|
6891
|
+
* @returns A memoized `Intl.NumberFormat` for the active locale
|
|
5645
6892
|
* @example
|
|
5646
6893
|
* ```tsx
|
|
5647
6894
|
* const formatter = useNumberFormatter({maximumFractionDigits: 2});
|
|
@@ -5715,6 +6962,78 @@ export declare function usePopoutManager(): Pick<PopoutManagerContextValue, "clo
|
|
|
5715
6962
|
*/
|
|
5716
6963
|
export declare function usePopoutRegion(): string | null;
|
|
5717
6964
|
|
|
6965
|
+
/**
|
|
6966
|
+
* The page's toast: `show` a message (it replaces any toast on screen) or
|
|
6967
|
+
* `hide` it. Call it inside a `ToastProvider`.
|
|
6968
|
+
* @returns The toast controls
|
|
6969
|
+
*/
|
|
6970
|
+
export declare function useToast(): ToastApi;
|
|
6971
|
+
|
|
6972
|
+
/**
|
|
6973
|
+
* A value bound to a design variable (design/figma-spec.md 6.6).
|
|
6974
|
+
*
|
|
6975
|
+
* In a number field the value becomes a 20px pill (`--cm-bg`, 1px `--cm-border`, radius 5) after
|
|
6976
|
+
* the field's 24px glyph slot; hovering the pill shows the variable's name and value, and
|
|
6977
|
+
* hovering the field shows a 16px Detach button at its end. With `swatch` it is the bound fill
|
|
6978
|
+
* row: one 156 x 24 button with a 14px chit and the name, which gains a 24px Detach button on
|
|
6979
|
+
* hover. `kind="property"` draws the component-property chip.
|
|
6980
|
+
*
|
|
6981
|
+
* With `onValueCommit` the rest of a bound number field is an input: typing a literal there and
|
|
6982
|
+
* pressing Enter reports it, so the caller can detach and apply it.
|
|
6983
|
+
* @param props - the variable, its handlers and the form to draw
|
|
6984
|
+
* @returns the bound field, fill row or property chip
|
|
6985
|
+
* @example
|
|
6986
|
+
* ```tsx
|
|
6987
|
+
* <VariablePill glyph="R" name="rsu/radius-sm" value="4" onDetach={detach} onClick={openPicker} />
|
|
6988
|
+
* <VariablePill swatch="#0d99ff" name="rsu/brand" onDetach={detach} onClick={openPicker} />
|
|
6989
|
+
* ```
|
|
6990
|
+
*/
|
|
6991
|
+
export declare function VariablePill(props: VariablePillProps): default_2.JSX.Element;
|
|
6992
|
+
|
|
6993
|
+
/** Props for VariablePill. */
|
|
6994
|
+
export declare interface VariablePillProps {
|
|
6995
|
+
/** The variable's name ("rsu/radius-sm"). */
|
|
6996
|
+
name: string;
|
|
6997
|
+
/** The variable's resolved value, shown in the pill and in its tooltip ("4"). */
|
|
6998
|
+
value?: string;
|
|
6999
|
+
/**
|
|
7000
|
+
* Called by the Detach (broken link) button, which appears while the field is hovered or
|
|
7001
|
+
* focused. Without it there is no Detach button.
|
|
7002
|
+
*/
|
|
7003
|
+
onDetach?: ActivationHandler;
|
|
7004
|
+
/** Called when the pill (or the fill row) is clicked: reopen the variable picker here. */
|
|
7005
|
+
onClick?: ActivationHandler;
|
|
7006
|
+
/**
|
|
7007
|
+
* A color: draws the bound FILL row instead of a number field -- one 156 x 24 button with
|
|
7008
|
+
* a 14px chit and the variable's name.
|
|
7009
|
+
*/
|
|
7010
|
+
swatch?: string;
|
|
7011
|
+
/**
|
|
7012
|
+
* `"variable"` (default) or `"property"`: a layer property bound to a component property,
|
|
7013
|
+
* drawn as a chip on the component tint.
|
|
7014
|
+
*/
|
|
7015
|
+
kind?: "variable" | "property";
|
|
7016
|
+
/** A 24px leading slot for the bound number field: the field's glyph or letter. */
|
|
7017
|
+
glyph?: default_2.ReactNode;
|
|
7018
|
+
/** The field's width. @default 88 for a number field, 156 for a fill row */
|
|
7019
|
+
width?: number | string;
|
|
7020
|
+
/** The Detach button's accessible name. @default "Detach variable" */
|
|
7021
|
+
detachLabel?: string;
|
|
7022
|
+
/**
|
|
7023
|
+
* Makes the rest of a bound number field editable, as in Figma: typing after the pill and
|
|
7024
|
+
* pressing Enter (or leaving the field) reports the text, and the caller replaces the binding
|
|
7025
|
+
* with that literal (detach, then apply). Escape abandons the text. Without it the field after
|
|
7026
|
+
* the pill is empty space.
|
|
7027
|
+
*/
|
|
7028
|
+
onValueCommit?: ChangeHandler<string>;
|
|
7029
|
+
/** The accessible name of the input after the pill. @default "Value" */
|
|
7030
|
+
valueLabel?: string;
|
|
7031
|
+
/** Extra class on the outer element. */
|
|
7032
|
+
className?: string;
|
|
7033
|
+
/** Extra style on the outer element. */
|
|
7034
|
+
style?: default_2.CSSProperties;
|
|
7035
|
+
}
|
|
7036
|
+
|
|
5718
7037
|
export { }
|
|
5719
7038
|
|
|
5720
7039
|
|
|
@@ -5723,17 +7042,20 @@ declare module "@mantine/core" {
|
|
|
5723
7042
|
* The values this package puts on `theme.other`.
|
|
5724
7043
|
*
|
|
5725
7044
|
* Everything here is optional: a consumer who writes their own
|
|
5726
|
-
* `createTheme({ other: {...} })` is not required to carry
|
|
5727
|
-
*
|
|
7045
|
+
* `createTheme({ other: {...} })` is not required to carry them, and reading
|
|
7046
|
+
* them is therefore a narrowed read.
|
|
5728
7047
|
*/
|
|
5729
7048
|
interface MantineThemeOther {
|
|
5730
7049
|
/**
|
|
5731
|
-
* The pixel grid every panel row is measured against,
|
|
5732
|
-
*
|
|
5733
|
-
*
|
|
5734
|
-
* theme instead of retyping it.
|
|
7050
|
+
* The pixel grid every panel row is measured against (the 240px panel, the 88px
|
|
7051
|
+
* field, the 24px trailing slot), published so a consumer reads the geometry from
|
|
7052
|
+
* the theme instead of retyping it.
|
|
5735
7053
|
*/
|
|
5736
7054
|
panelGrid?: typeof PANEL_GRID;
|
|
7055
|
+
/** The options this theme was created with, resolved. */
|
|
7056
|
+
compact?: {
|
|
7057
|
+
highContrast: boolean;
|
|
7058
|
+
};
|
|
5737
7059
|
}
|
|
5738
7060
|
}
|
|
5739
7061
|
|
|
@@ -5743,16 +7065,19 @@ declare module "@mantine/core" {
|
|
|
5743
7065
|
* The values this package puts on `theme.other`.
|
|
5744
7066
|
*
|
|
5745
7067
|
* Everything here is optional: a consumer who writes their own
|
|
5746
|
-
* `createTheme({ other: {...} })` is not required to carry
|
|
5747
|
-
*
|
|
7068
|
+
* `createTheme({ other: {...} })` is not required to carry them, and reading
|
|
7069
|
+
* them is therefore a narrowed read.
|
|
5748
7070
|
*/
|
|
5749
7071
|
interface MantineThemeOther {
|
|
5750
7072
|
/**
|
|
5751
|
-
* The pixel grid every panel row is measured against,
|
|
5752
|
-
*
|
|
5753
|
-
*
|
|
5754
|
-
* theme instead of retyping it.
|
|
7073
|
+
* The pixel grid every panel row is measured against (the 240px panel, the 88px
|
|
7074
|
+
* field, the 24px trailing slot), published so a consumer reads the geometry from
|
|
7075
|
+
* the theme instead of retyping it.
|
|
5755
7076
|
*/
|
|
5756
7077
|
panelGrid?: typeof PANEL_GRID;
|
|
7078
|
+
/** The options this theme was created with, resolved. */
|
|
7079
|
+
compact?: {
|
|
7080
|
+
highContrast: boolean;
|
|
7081
|
+
};
|
|
5757
7082
|
}
|
|
5758
7083
|
}
|