strata-react 1.0.12 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/UPGRADING.md +2 -0
- package/dist/components/button.d.ts +6 -3
- package/dist/components/density.d.ts +16 -0
- package/dist/components/field.d.ts +9 -4
- package/dist/components/history.d.ts +61 -0
- package/dist/components/save.d.ts +46 -0
- package/dist/components/theme.d.ts +7 -1
- package/dist/components/value-controls.d.ts +4 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +408 -25
- package/dist/index.js.map +1 -1
- package/dist/lib/control.d.ts +4 -0
- package/dist/{query-CXlmWmrY.js → query-CIh1Dpgn.js} +43 -11
- package/dist/query-CIh1Dpgn.js.map +1 -0
- package/dist/strata.css +7 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/dist/query-CXlmWmrY.js.map +0 -1
package/README.md
CHANGED
|
@@ -114,6 +114,10 @@ function KilnRoom() {
|
|
|
114
114
|
}
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
+
### Testing with Vitest, or with Jest
|
|
118
|
+
|
|
119
|
+
strata-react is ESM-only (`exports` has only `import`), as is its peer `react-router`. **Vitest is the supported runner**: it needs no configuration beyond the `strata-react/testing` helpers. An app on Jest has to do the work itself (strata-vid's `jest.base.config.js` is a working example): transform `.mjs` along with `.js`; leave `strata-react`, `react-router`, `@remix-run`, `cookie-es`, `@tanstack` and `pixelmatch` out of `transformIgnorePatterns` so Babel compiles them; and replace `import.meta` for CommonJS with a small Babel plugin (react-router reads it). Strata's own suite runs on Vitest only, so a Jest setup is the app's to keep working.
|
|
120
|
+
|
|
117
121
|
## Components
|
|
118
122
|
|
|
119
123
|
| Group | Exports | Notes |
|
|
@@ -129,6 +133,8 @@ function KilnRoom() {
|
|
|
129
133
|
| Page and navigation | `AppShell`, `SideNav`, `Breadcrumb`, `Tabs`, `PageHeader`, `LinkCard`, `LinkCardList` | React Router; tab and sort state in the URL; a `LinkCard` is one link named by its title, described by its text and `Status` marks, with the whole card as the target (`to` a route, `href` elsewhere, marked with an arrow) |
|
|
130
134
|
| Keyboard | `useHotkeys`, `KeysLegend`, `Shortcut`, `useActiveItem`, `ActiveList`, `isTypingTarget` | For queues worked from the keyboard; one shortcut list drives the handler and the legend; keys never fire while typing; answering moves focus to the next item |
|
|
131
135
|
| Theme | `ThemeProvider`, `useColorScheme`, `useSystemColorScheme`, `ColorSchemeChoice`, `colorSchemeScript` | System, light or dark; sets `.dark`, persists in localStorage when it can; `ColorSchemeChoice` is a radio list for a settings page, or `compact` icon segments named "Appearance" for an app with no settings page |
|
|
136
|
+
| Density | `Density`, `DensityName`, `ThemeProvider`'s `density`, `ControlSize` (`size="sm"` on `Input`, `NativeSelect`, `NumberField`, `IconButton`) | Control height is two variables, `--control-h` and `--control-h-sm`. `<ThemeProvider density="compact">` or `<Density page value="compact">` sets them app-wide, including dialogs and menus, which portal out of the app's root; `<Density value="compact">` is one region (a toolbar, a dense panel) and does not reach its overlays. A coarse pointer (touch) always gets 44px targets, whatever the density |
|
|
137
|
+
| History and save state | `useHistory`, `useHistoryState`, `History`, `useAutoSave`, `SaveStatus`, `SaveState`, `useLeaveGuard` | Undo and redo for a document edited over a session: a step is a name and an `undo`/`redo` pair, `begin(label)` groups a drag into one step, a `key` merges a slider's pushes, a `limit` drops the oldest. `history.commands` are Undo and Redo as `Command`s ("Undo move clip", Mod+Z, Mod+Shift+Z or Mod+Y) for `useCommands` and `Menu`. `useAutoSave` debounces and never overlaps saves; `SaveStatus` is the fixed-width sign ("Saved 10:42", "Saving…", "Unsaved changes", "Not saved" with the reason and "Try again"), quiet except for a failure and its recovery. For one removal that commits after a few seconds, use `useUndoable` |
|
|
132
138
|
| Toolbar and toggles | `Toolbar`, `ToolbarSeparator`, `Toggle`, `ToggleGroup`, `Switch` | A toolbar is one tab stop with arrows, Home and End inside; needs a `label`. `Toggle` (`aria-pressed`) and `ToggleGroup` (one of 2 to 7, always one chosen) show chosen as an ink border on a tint, never the filled primary, so they do not break the one-filled-button rule; an icon-only toggle still needs its `label` (shown as a tooltip). `Switch` is only for a setting that applies at once, label and control one target |
|
|
133
139
|
| Commands | `Command`, `useCommands`, `Menu`, `ContextMenu`, `CommandMenu`, `CommandLegend`, `formatChord`, `matchesChord` | A command is declared once (label or label function, chords, `disabled` with a reason, `destructive`, `checked`) and drives the key handler, dropdown and menu-bar menus, the context menu, the searchable command menu (Mod+K) and the legend, so they cannot disagree. Chords are written once ("Mod+Shift+Z") and shown per platform (⇧⌘Z, Ctrl+Shift+Z); they never fire while typing or during IME composition, and a chord the browser keeps (Ctrl+S) needs `claim: true`. `useHotkeys` is unchanged for single keys |
|
|
134
140
|
| Overlays | `Dialog`, `DialogProps`, `AlertDialog`, `Popover`, `Tooltip` | React Aria underneath. A dialog always has a title and, via `actions`'s close render prop, a way out; `closable={false}` while work cannot stop; `placement="end"` is a sheet. `AlertDialog` is the only confirm: required verb on the confirm button, Cancel focused first, no outside dismiss, stays open with the reason when an async confirm fails. `Popover` needs a `label`. `Tooltip` opens on hover and focus and `IconButton` uses it. All portal onto the `layer-*` stacking utilities |
|
package/UPGRADING.md
CHANGED
|
@@ -16,6 +16,8 @@ Every PR that changes what an app sees adds a line here (see `CLAUDE.md`, "Chang
|
|
|
16
16
|
React Aria Components is now the primitives layer (`react-aria-components`, installed with the
|
|
17
17
|
package). `@radix-ui/react-slot` is gone.
|
|
18
18
|
|
|
19
|
+
- **`Input` and `NativeSelect` take `size="default" | "sm"`**, not the native numeric `size` attribute (it is no longer passed through). Their height comes from `--control-h` / `--control-h-sm`, so a root `data-density` changes them, as it does `Button`. `NumberField`'s box lost its fixed height for the same reason; its visual baselines may move by a pixel.
|
|
20
|
+
- **A `ColorField` inside a `Field` has its picker named after the field** ("Route colour, picker"), not "Colour picker"; query it by that name. A `Dialog` or `AlertDialog` with `open` and no `trigger` no longer renders a `DialogTrigger`.
|
|
19
21
|
- **`DataTable` is a `grid`**, not a `table`: query `getByRole("grid", { name: caption })`, cells as `gridcell` and the first column's cells as `rowheader` (React Aria requires a row header; it is the first column). A sortable header is the `columnheader` itself, with no inner `button`: click it, and `aria-sort` is `"none"` until sorted. The `region` that wrapped a table is gone, and a toggle has no `aria-controls`. A click on a cell no longer touches the selection: only the checkbox or Space chooses a row. A part-chosen "Select all shown" still clears. Virtualised tables (100+ rows) size columns evenly rather than to their content. In a jsdom test of a virtualised table with `expansion`, or of a `SelectableGrid` of 100+ tiles, set `Element.prototype.scrollHeight` (the Virtualizer measures rows by it).
|
|
20
22
|
- **`SelectableGrid` is a `grid` of `row`s** (was a `list` of `listitem`s, a `region` once virtualised): query `getByRole("grid", { name: label })`; a press anywhere on a tile toggles it as before, and Shift-click, Shift+Space and "Select all shown" still extend and clear. Virtualised tiles keep a margin of one gap around the box.
|
|
21
23
|
- **`@tanstack/react-virtual` is no longer a dependency.** Strata does not need it; if an app imported it through Strata, add it itself.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { PressEvent } from 'react-aria-components';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { IconComponent } from '../lib/icon';
|
|
4
|
+
import { ControlSize } from '../lib/control';
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
export declare const buttonVariants: (props?: ({
|
|
6
7
|
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
7
|
-
size?: "default" | "sm" | "icon" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | "icon" | "icon-sm" | null | undefined;
|
|
8
9
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
10
|
export type ButtonProps = Omit<React.ComponentProps<"button">, "className" | "style"> & VariantProps<typeof buttonVariants> & {
|
|
10
11
|
className?: string;
|
|
@@ -17,15 +18,17 @@ export type ButtonProps = Omit<React.ComponentProps<"button">, "className" | "st
|
|
|
17
18
|
* `outline`; ask for the filled accent (`variant="default"`) once per view. `type` defaults to `button`.
|
|
18
19
|
* `onClick` and `disabled` are the DOM names and keep working; `onPress` is also accepted.
|
|
19
20
|
*/
|
|
20
|
-
export declare function Button({ className, variant, size, type, disabled, ...props }: ButtonProps): React.JSX.Element;
|
|
21
|
+
export declare function Button({ className, variant, size, type, disabled, children, ...props }: ButtonProps): React.JSX.Element;
|
|
21
22
|
export type IconButtonProps = Omit<ButtonProps, "size" | "children" | "aria-label"> & {
|
|
23
|
+
/** `sm` is --control-h-sm, the height of a small `Toggle` or `Button`, for a toolbar or property row. Default --control-h. */
|
|
24
|
+
size?: ControlSize;
|
|
22
25
|
icon: IconComponent;
|
|
23
26
|
label: string;
|
|
24
27
|
/** Shown after the label in its tooltip, muted: "Ctrl+Z". */
|
|
25
28
|
hint?: React.ReactNode;
|
|
26
29
|
};
|
|
27
30
|
/** An icon-only button. `label` is required and becomes the accessible name and the tooltip (hover and keyboard focus); `hint` adds a muted aside to it, such as a shortcut. */
|
|
28
|
-
export declare function IconButton({ icon: Icon, label, hint, variant, ...props }: IconButtonProps): React.JSX.Element;
|
|
31
|
+
export declare function IconButton({ icon: Icon, label, hint, variant, size, ...props }: IconButtonProps): React.JSX.Element;
|
|
29
32
|
export type RowActionProps = Omit<ButtonProps, "children" | "aria-label"> & {
|
|
30
33
|
/** The visible verb, sentence case: "Withdraw", "Remove". */
|
|
31
34
|
label: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** How much a screen packs in: `default`, or `compact` for a tool screen. */
|
|
3
|
+
export type DensityName = "default" | "compact";
|
|
4
|
+
/** The density attribute's page-level setter, shared by `ThemeProvider`. @internal */
|
|
5
|
+
export declare function useDensityOn(value: DensityName | undefined, target?: HTMLElement | null): void;
|
|
6
|
+
/** Props for `Density`. */
|
|
7
|
+
export type DensityProps = {
|
|
8
|
+
value: DensityName;
|
|
9
|
+
/** Set it on the document's root element for the whole page, overlays included, instead of wrapping a region. Renders only its children. */
|
|
10
|
+
page?: boolean;
|
|
11
|
+
/** For the wrapper of a region: layout classes (the wrapper is a plain `div`; `contents` takes it out of layout). */
|
|
12
|
+
className?: string;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/** Sets the density of a region (a wrapper `div`), or of the whole page with `page`, where overlays are reached too. */
|
|
16
|
+
export declare function Density({ value, page, className, children }: DensityProps): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ControlSize } from '../lib/control';
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
type FieldState = {
|
|
3
4
|
id: string;
|
|
@@ -26,12 +27,16 @@ export type FieldProps = {
|
|
|
26
27
|
};
|
|
27
28
|
/** A labelled form field: wires the label, hint, error, `aria-describedby` and `aria-invalid` into the one control it wraps. */
|
|
28
29
|
export declare function Field({ label, id: idProp, hint, error, action, children, className }: FieldProps): React.JSX.Element;
|
|
29
|
-
/** A text input that picks up its id and descriptions from the surrounding `Field`. */
|
|
30
|
-
export declare function Input({ className, id, ...props }: React.ComponentProps<"input">
|
|
30
|
+
/** A text input that picks up its id and descriptions from the surrounding `Field`. `size="sm"` is --control-h-sm; the native `size` (a width in characters) is not passed on. */
|
|
31
|
+
export declare function Input({ className, id, size, ...props }: Omit<React.ComponentProps<"input">, "size"> & {
|
|
32
|
+
size?: ControlSize;
|
|
33
|
+
}): React.JSX.Element;
|
|
31
34
|
/** A multi-line input that picks up its id and descriptions from the surrounding `Field`. */
|
|
32
35
|
export declare function Textarea({ className, id, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
|
|
33
|
-
/** The platform select, styled. The default for short lists, especially on touch screens. */
|
|
34
|
-
export declare function NativeSelect({ className, id, ...props }: React.ComponentProps<"select">
|
|
36
|
+
/** The platform select, styled. The default for short lists, especially on touch screens. `size="sm"` is --control-h-sm. */
|
|
37
|
+
export declare function NativeSelect({ className, id, size, ...props }: Omit<React.ComponentProps<"select">, "size"> & {
|
|
38
|
+
size?: ControlSize;
|
|
39
|
+
}): React.JSX.Element;
|
|
35
40
|
export type Choice = {
|
|
36
41
|
value: string;
|
|
37
42
|
label: string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Command } from './commands';
|
|
2
|
+
/** One undoable step. `label` is the phrase after the verb ("move clip"); `undo` and `redo` must be inverses. */
|
|
3
|
+
export type HistoryStep = {
|
|
4
|
+
label: string;
|
|
5
|
+
undo: () => void;
|
|
6
|
+
redo: () => void;
|
|
7
|
+
/** Consecutive pushes with the same key merge into one step (a slider, a text drag). */
|
|
8
|
+
key?: string;
|
|
9
|
+
};
|
|
10
|
+
/** Options for `useHistory`. */
|
|
11
|
+
export type HistoryOptions = {
|
|
12
|
+
/** The most steps kept; the oldest is dropped past it. Default 100. */
|
|
13
|
+
limit?: number;
|
|
14
|
+
};
|
|
15
|
+
/** What `useHistory` returns. */
|
|
16
|
+
export type History = {
|
|
17
|
+
/** Records a step the app has just done. Clears what could have been redone. Inside `begin`/`end` it joins the group. */
|
|
18
|
+
push: (step: HistoryStep) => void;
|
|
19
|
+
/** Starts a group named `label`; every push until the returned `end()` is one step. Nested groups join the outer one. An empty group records nothing. */
|
|
20
|
+
begin: (label: string) => () => void;
|
|
21
|
+
/** `begin`, run a function, `end`. */
|
|
22
|
+
group: <T>(label: string, run: () => T) => T;
|
|
23
|
+
undo: () => void;
|
|
24
|
+
redo: () => void;
|
|
25
|
+
canUndo: boolean;
|
|
26
|
+
canRedo: boolean;
|
|
27
|
+
/** The name of the step Undo would take back, or undefined. */
|
|
28
|
+
undoLabel: string | undefined;
|
|
29
|
+
/** The name of the step Redo would repeat, or undefined. */
|
|
30
|
+
redoLabel: string | undefined;
|
|
31
|
+
/** Names of the steps that can be undone, oldest first. */
|
|
32
|
+
past: string[];
|
|
33
|
+
/** Names of the steps that can be redone, next first. */
|
|
34
|
+
future: string[];
|
|
35
|
+
/** The history holds `limit` steps, so the next push drops the oldest. */
|
|
36
|
+
atLimit: boolean;
|
|
37
|
+
/** Forgets every step (a document was opened or saved to a new place). */
|
|
38
|
+
clear: () => void;
|
|
39
|
+
/** Undo then Redo as commands: "Undo move clip", disabled with "Nothing to undo". Pass to `useCommands` and a `Menu`. */
|
|
40
|
+
commands: [undo: Command, redo: Command];
|
|
41
|
+
};
|
|
42
|
+
/** A history of named, undoable steps with grouping, a limit, and Undo and Redo as commands. */
|
|
43
|
+
export declare function useHistory({ limit }?: HistoryOptions): History;
|
|
44
|
+
/** Options for `useHistoryState`. */
|
|
45
|
+
export type HistoryStateOptions = HistoryOptions;
|
|
46
|
+
/** What `setValue` takes besides the new value. */
|
|
47
|
+
export type SetOptions = {
|
|
48
|
+
/** Merges consecutive changes with this key into one step (a slider, a drag). */
|
|
49
|
+
key?: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* React state with a history: `set(next, "move clip")` changes the value and records the step; Undo
|
|
53
|
+
* and Redo put the old and new values back. For an app whose document is a plain value. An app on its
|
|
54
|
+
* own store uses `useHistory` and pushes steps from its actions.
|
|
55
|
+
*/
|
|
56
|
+
export declare function useHistoryState<S>(initial: S | (() => S), options?: HistoryStateOptions): {
|
|
57
|
+
value: S;
|
|
58
|
+
set: (next: S | ((previous: S) => S), label: string, { key }?: SetOptions) => void;
|
|
59
|
+
reset: (next: S) => void;
|
|
60
|
+
history: History;
|
|
61
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** The state of a document's saving. */
|
|
3
|
+
export type SaveState = {
|
|
4
|
+
status: "saved"; /** When it last saved here; null for a document just opened. */
|
|
5
|
+
at: Date | null;
|
|
6
|
+
} | {
|
|
7
|
+
status: "dirty";
|
|
8
|
+
} | {
|
|
9
|
+
status: "saving";
|
|
10
|
+
} | {
|
|
11
|
+
status: "failed"; /** What happened, in the product's words. */
|
|
12
|
+
reason?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Options for `useAutoSave`. */
|
|
15
|
+
export type AutoSaveOptions<V> = {
|
|
16
|
+
/** The document's current value. Compared with what was last saved by `equals`. */
|
|
17
|
+
value: V;
|
|
18
|
+
/** Saves a value. Throw (or reject) to fail. */
|
|
19
|
+
save: (value: V) => void | Promise<unknown>;
|
|
20
|
+
/** Wait this long after the last change before saving. `null`: never on its own, only `saveNow()`. Default 1500. */
|
|
21
|
+
delayMs?: number | null;
|
|
22
|
+
/** Whether two values are the same document. Default `Object.is`. */
|
|
23
|
+
equals?: (a: V, b: V) => boolean;
|
|
24
|
+
/** Turns a thrown error into the sentence shown. Default `describeActionError`. */
|
|
25
|
+
describeError?: (error: unknown) => string | undefined;
|
|
26
|
+
};
|
|
27
|
+
/** What `useAutoSave` returns. */
|
|
28
|
+
export type AutoSave = {
|
|
29
|
+
state: SaveState;
|
|
30
|
+
/** Saves now (and is "Try again" after a failure). Resolves when the save has finished, failed or not. */
|
|
31
|
+
saveNow: () => Promise<void>;
|
|
32
|
+
};
|
|
33
|
+
/** Saves `value` after changes settle, never two at once, and says where it stands. The document's first `value` counts as saved. */
|
|
34
|
+
export declare function useAutoSave<V>({ value, save, delayMs, equals, describeError }: AutoSaveOptions<V>): AutoSave;
|
|
35
|
+
/** Asks the browser to confirm before the page is closed or reloaded, while `active`. Off when there is nothing to lose. */
|
|
36
|
+
export declare function useLeaveGuard(active: boolean): void;
|
|
37
|
+
/**
|
|
38
|
+
* The sign of whether the work is safe: "Saved 10:42", "Saving…", "Unsaved changes", or "Not saved"
|
|
39
|
+
* with the reason and "Try again". Fixed width, so it never moves what is beside it. Announces a
|
|
40
|
+
* failure, and the recovery from one, politely; a routine save is silent.
|
|
41
|
+
*/
|
|
42
|
+
export declare function SaveStatus({ state, onRetry, className }: {
|
|
43
|
+
state: SaveState;
|
|
44
|
+
onRetry: () => void;
|
|
45
|
+
className?: string;
|
|
46
|
+
}): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DensityName } from './density';
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
/** What a person chose: follow the operating system, or a fixed light or dark theme. */
|
|
3
4
|
export type ColorSchemePreference = "system" | "light" | "dark";
|
|
@@ -14,7 +15,7 @@ export type ColorSchemeState = {
|
|
|
14
15
|
setPreference: (preference: ColorSchemePreference) => void;
|
|
15
16
|
};
|
|
16
17
|
/** Sets the `.dark` class strata.css keys on, from a system, light or dark preference that persists in localStorage when it can. */
|
|
17
|
-
export declare function ThemeProvider({ children, defaultPreference, storageKey, target, }: {
|
|
18
|
+
export declare function ThemeProvider({ children, defaultPreference, storageKey, target, density, }: {
|
|
18
19
|
children: React.ReactNode;
|
|
19
20
|
/** The preference before a person has chosen one. */
|
|
20
21
|
defaultPreference?: ColorSchemePreference;
|
|
@@ -28,6 +29,11 @@ export declare function ThemeProvider({ children, defaultPreference, storageKey,
|
|
|
28
29
|
* means it has not mounted yet, and nothing is set until it has.
|
|
29
30
|
*/
|
|
30
31
|
target?: HTMLElement | null;
|
|
32
|
+
/**
|
|
33
|
+
* How much the screen packs in, set on the same element as the colour scheme (the root, so
|
|
34
|
+
* overlays are reached): `compact` for a tool screen. See `Density`. Left out, nothing is set.
|
|
35
|
+
*/
|
|
36
|
+
density?: DensityName;
|
|
31
37
|
}): React.JSX.Element;
|
|
32
38
|
/** The person's colour-scheme preference, the scheme in effect, and a setter that persists it. Must be inside `ThemeProvider`. */
|
|
33
39
|
export declare function useColorScheme(): ColorSchemeState;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ControlSize } from '../lib/control';
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
/** Props shared by the number field and the slider. */
|
|
3
4
|
export type RangeProps = {
|
|
@@ -25,10 +26,12 @@ export type NumberFieldProps = RangeProps & {
|
|
|
25
26
|
"aria-label"?: string;
|
|
26
27
|
id?: string;
|
|
27
28
|
name?: string;
|
|
29
|
+
/** `sm` is --control-h-sm, the height of a small `Toggle` or `IconButton` beside it. Default --control-h. */
|
|
30
|
+
size?: ControlSize;
|
|
28
31
|
className?: string;
|
|
29
32
|
};
|
|
30
33
|
/** A number with a unit on React Aria's number field: typed input is validated, not clamped, so an out-of-range value is explained in the surrounding `Field` and never passed on; empty stays `null`. */
|
|
31
|
-
export declare function NumberField({ value, onChange, min, max, step, places, unit, locale, required, disabled, id: idProp, name, className, "aria-label": ariaLabel, }: NumberFieldProps): React.JSX.Element;
|
|
34
|
+
export declare function NumberField({ value, onChange, min, max, step, places, unit, locale, required, disabled, id: idProp, name, size, className, "aria-label": ariaLabel, }: NumberFieldProps): React.JSX.Element;
|
|
32
35
|
/** Props for `Slider`. */
|
|
33
36
|
export type SliderProps = RangeProps & {
|
|
34
37
|
value: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,8 @@ export { UndoBar, useUndoable, type PendingRemoval, type FailedRemoval, type Und
|
|
|
52
52
|
export { Done } from './components/done';
|
|
53
53
|
export { AppShell, SideNav, Breadcrumb, type NavItem } from './components/app-shell';
|
|
54
54
|
export { Tabs, type TabItem } from './components/tabs';
|
|
55
|
+
export { Density, type DensityName, type DensityProps } from './components/density';
|
|
56
|
+
export type { ControlSize } from './lib/control';
|
|
55
57
|
export { useHotkeys, KeysLegend, isTypingTarget, type Shortcut } from './components/hotkeys';
|
|
56
58
|
export { useActiveItem, ActiveList, type ActiveItem } from './components/active-list';
|
|
57
59
|
export { ThemeProvider, useColorScheme, useSystemColorScheme, ColorSchemeChoice, colorSchemeScript, COLOR_SCHEME_STORAGE_KEY, type ColorScheme, type ColorSchemePreference, type ColorSchemeLabels, type ColorSchemeState, } from './components/theme';
|
|
@@ -64,3 +66,5 @@ export { FIT, MIN_SCALE, MAX_SCALE, clampViewport, zoomAt, actualPixelsScale, ty
|
|
|
64
66
|
export { CompareGrid, type CompareGridProps } from './components/compare-grid';
|
|
65
67
|
export { useDifference, type DifferenceState, type ReadPixels } from './components/difference';
|
|
66
68
|
export { differences, readPixels, resample, MAX_SIDE, DEFAULT_TOLERANCE, type Difference, type Pixels } from './lib/image-diff';
|
|
69
|
+
export { useHistory, useHistoryState, type History, type HistoryOptions, type HistoryStep, type HistoryStateOptions, type SetOptions, } from './components/history';
|
|
70
|
+
export { useAutoSave, useLeaveGuard, SaveStatus, type AutoSave, type AutoSaveOptions, type SaveState } from './components/save';
|