strata-react 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/components/compare.d.ts +42 -0
- package/dist/components/field.d.ts +13 -0
- package/dist/components/fullscreen-frame.d.ts +16 -0
- package/dist/components/value-controls.d.ts +72 -0
- package/dist/components/viewport.d.ts +41 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +872 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/number-input.d.ts +4 -0
- package/dist/lib/viewport.d.ts +29 -0
- package/dist/{query-BVh4zv7Y.js → query-gC6I6Cen.js} +19 -6
- package/dist/query-gC6I6Cen.js.map +1 -0
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/dist/query-BVh4zv7Y.js.map +0 -1
package/README.md
CHANGED
|
@@ -122,6 +122,7 @@ function KilnRoom() {
|
|
|
122
122
|
| Form | `Field`, `Input`, `Textarea`, `NativeSelect`, `ChoiceGroup`, `Checkbox` | `Field` wires label, hint, error, `aria-describedby`, `aria-invalid`, and `action` puts a one-field form's button on the control's row with the hint and error under both; `Checkbox` requires `label` and is one target with it, and has a mixed state |
|
|
123
123
|
| Status and figures | `Status`, `Metric`, `MetricStrip`, `Meter`, `crossedThreshold`, `CompositionBar` | A status is always a word; figures have no icons or sparklines; `Meter` is a `meter` named for what it measures, with its reading in words ("72% used"), threshold notches, and a `Status` word once a threshold is crossed (each threshold must name its state); `CompositionBar` is a stacked bar over a table naming every part, its amount and share, and names the remainder (`total` needs `restLabel`); a part that is there reads "<1%" and keeps a sliver, never "0%"; `JobStatus` is a long-running server job: a required word per state beside the app's sentence, a progress bar when the total is known, each failure named with its reason, announced only when the item changes or the job ends |
|
|
124
124
|
| Data | `DataView`, `Load<T>`, `Stale`, `StaleNotice`, `LoadError`, `EmptyState`, `Skeleton`, `Thumbnail`, `ThumbnailSkeleton`, `DataTable`, `TableSkeleton`, `VirtualList`, `InfiniteList`, `LoadMore`, `useInView`, `LineChart` | `DataView` requires skeleton and empty, keeps data on screen under a `StaleNotice` (why, how old, Try again) when a refresh fails, and takes an `error` renderer for an app's own look of a failed read (default `LoadError`, always inside an alert); `Thumbnail` is a remote image in a box of fixed `aspect`, with a skeleton while it loads, the required `missing` words (or a `fallback` drawing, such as an avatar's initial) when it fails or `src` is null, required `alt`, `children` overlaid in its corners, and a request only once it nears the screen (`eager` for the first few); tables and lists virtualise from 100 rows; a `DataTable` column with `value` sorts by type with missing values last both ways and draws a placeholder (`missing`, default an en dash); `InfiniteList` loads the next page on approach, with a skeleton for it, a Try again row when it fails and a Show more button for the keyboard, and `scroll="page"` draws a grid that scrolls with the page; `LoadMore` is that next-page row for any list or grid; charts label values directly |
|
|
125
|
+
| Compare | `Compare`, `ViewportFrame`, `useViewport`, `FullscreenFrame` | Two pictures judged together: side by side, swipe (a divider that moves from the keyboard), fade and blink (`x` flips), one zoom and pan for both sides (buttons, `+` `-` `0`, Ctrl-wheel or trackpad pinch, drag, arrow keys, double click, `1:1`), and full screen (the browser's Fullscreen API, a modal where there is none). `blind` is required: a blind comparison names pictures by `label` only and never writes the variant `id`, `note` or `alt`. A picture that fails shows the required `missing` words in its place; the keys come from one `Shortcut[]` shared with `KeysLegend`, and `keys={false}` leaves them to a surrounding screen. Pictures only so far: difference view, voting, text, audio and video are the next changes |
|
|
125
126
|
| Selection | `useSelection`, `BulkBar`, `SelectableGrid`, `DataTable`'s `selection` (`RowSelection<T>`) | Opt-in checkbox column with "Select all shown" that respects `isSelectable`; Shift-click or Shift+Space chooses or clears the run from the last row clicked, in the order shown; `initial` (keys or a test on the row) chooses a row the first time it appears, so it applies to data that loads later; the selection drops rows that are gone; `BulkBar` announces the count politely, and while it is up its one filled action is the view's only one (the screen's primary goes to `outline`); `SelectableGrid` is the same selection as a grid of pictures (`renderImage`), each tile one labelled target, virtualised from 100 tiles |
|
|
126
127
|
| Expansion | `Disclosure`, `useExpanded`, `DataTable`'s `expansion` (`RowExpansion<T>`) | Show more of one row in place. The toggle is a button with `aria-expanded`; the body is mounted only while open, so a request inside it runs on first open (unlike `<details>`, which mounts every closed body); `useExpanded({ param })` shares the open keys across a list or table and keeps them in the URL; a table's detail row spans the data columns and is measured when virtualised |
|
|
127
128
|
| Data loading | `StrataQueryProvider`, `createQueryClient`, `useLoad`, `useInfiniteLoad`, `useJob`, `toLoad`, `staleOf`, `fetchJson`, `HttpError`, `readErrorBody`, `fieldErrorsOf` | TanStack Query in, `Load<T>` out; a refetch that fails after a good read stays `ready` with `stale` set, never an error panel; `useInfiniteLoad` works out the cursor itself (after the last item held), merges pages by key and can `dismiss` an item at once; `useJob` polls a job's status only while it runs and invalidates the queries it changes once, when it ends; `fetchJson` reads an error response's body onto the `HttpError` (`body`, `reason`, `fieldErrors`, read by `readErrorBody` or the API's own `readError`) |
|
|
@@ -131,7 +132,8 @@ function KilnRoom() {
|
|
|
131
132
|
| 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 |
|
|
132
133
|
| 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 |
|
|
133
134
|
| 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 |
|
|
134
|
-
|
|
|
135
|
+
| Value controls | `NumberField`, `Slider`, `ColorField` | Set a number or colour precisely, inside `Field`. `NumberField` and `Slider` are React Aria's; the number field runs with `commitBehavior="validate"`, so a typed value outside `min`/`max` is kept on screen, explained in the `Field` ("Enter a value from 0% to 500%.") and never passed to `onChange`. A value that is not known is `null` and shows an en dash, never 0 or NaN. Digits and decimal mark follow `locale`. The unit sits inside the control, and in the slider's spoken value when `Intl` has it (%, °, ms, s, kB, MB, GB, kbps, Mbps). Arrows step, Home/End jump to the limits; `Slider editable` adds a number field. `ColorField`: platform picker, typed hex that is normalised, app suggestions, and a contrast note against `against`. No motion on value changes |
|
|
136
|
+
| Notices and progress | `Alert`, `toast`, `StrataToastRegion`, `useClientWork`, `JobStatus` | Three weights. A `toast` confirms finished work and goes by itself (5 s plus 40 ms a character, 8 s minimum with an action, paused under the pointer or focus, always dismissable); it has no danger tone, because an error a person must act on is an inline `Alert` with its recovery as `action` (`announce` makes it `role="alert"` only when it answers something the person just did). `StrataToastRegion` goes once at the app root. `useClientWork` runs browser work with progress, cancel (aborts its `signal`, ends `cancelled`, never `failed`) and a double-start guard; `JobStatus` shows it exactly as it shows a server job, with `onCancel`, `cancelled` and `onDismiss` |
|
|
135
137
|
| Feedback | `UndoBar`, `useUndoable`, `Done` | Undo before confirm; the hook owns which rows are out of view (`isRemoved`), a failed commit brings the row back with Try again in the same bar, and `flush()` commits before a dependent action; `Done` is the one celebration, and it must say what happens next |
|
|
136
138
|
| Helpers | `cn`, `format`, `createFormat`, `NBSP` | `cn` knows `type-*`; all numbers and dates through `Intl`; `format.integer(n)`, `.decimal(n)`, `.percent(n)` are callable and keep Intl's methods; `format.bytes(n, unit?)` writes sizes in decimal units (`byteUnit` shares one unit across figures); `format.date(at)` ("8 Nov 2026") and `format.dateTime(at)` ("8 Nov 2026, 06:05"), like `clock`, `day` and `shortDay`, take a Date, ISO string or epoch ms; `format.ago(at, now?)` ("3 weeks ago"), `format.compact(n)` ("1.2k", and `count(n, one, many, { compact: true })`), `format.runningTime(seconds)` ("1:02:09") and `format.share(n)` ("<1%" for a part that rounds to 0); every number and date formatter prints the placeholder (`format.missing`, an en dash) for `null` or `undefined`; `createFormat(locale, { timeZone, missing })` fixes the zone and the placeholder; units and counts join with a non-breaking space |
|
|
137
139
|
| Testing | `strata-react/testing`: `renderWithStrata`, `renderRoutes`, `createTestQueryClient`, `installLayoutShims`, `installFakeIntersectionObserver`, `filledButtons`, `expectOneFilledButton`, `asyncButtonPhase` | Router + query client around Testing Library's `render`; `renderRoutes(routes, { route, basename })` renders the app's own `RouteObject[]` in a memory data router, so layout routes, redirects, loaders and error elements run, and returns the `router` (where a redirect landed is `router.state.location`) and an act-wrapped `navigate`; a fixed box and ResizeObserver so measuring components render in jsdom; an IntersectionObserver the test fires with `scrollToEnd()` or `intersect(el)`; `filledButtons()` and `expectOneFilledButton()` check "one filled button per view" from `data-variant`, and `asyncButtonPhase(el)` reads an `AsyncButton`'s phase. Role names keep the non-breaking space from `format.count`, so match them with the same call or a `\s` regex |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** A picture to compare. */
|
|
3
|
+
export type ImageMedia = {
|
|
4
|
+
kind: "image";
|
|
5
|
+
src: string;
|
|
6
|
+
/** What it shows. Ignored when the comparison is `blind`: the label names it then. */
|
|
7
|
+
alt: string;
|
|
8
|
+
/** Its natural size in pixels, if known, so the frame has its shape and "1:1" is exact before the picture loads. */
|
|
9
|
+
size?: readonly [number, number];
|
|
10
|
+
};
|
|
11
|
+
/** One side of a comparison. */
|
|
12
|
+
export type Candidate<M = ImageMedia> = {
|
|
13
|
+
/** Who it is: a variant name, a model. Never put on the page when `blind`, and never needed by it. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** What the person sees it called: "Original", or "A" when blind. */
|
|
16
|
+
label: string;
|
|
17
|
+
media: M;
|
|
18
|
+
/** A line under the label ("auto2, 14 s"). Not shown when `blind`. */
|
|
19
|
+
note?: string;
|
|
20
|
+
};
|
|
21
|
+
/** How two pictures are laid out. */
|
|
22
|
+
export type CompareMode = "side" | "swipe" | "fade" | "blink";
|
|
23
|
+
/** Props for `Compare`. */
|
|
24
|
+
export type CompareProps = {
|
|
25
|
+
/** Names the comparison for screen readers: "Photo 1 of 12, two versions". Required. */
|
|
26
|
+
label: string;
|
|
27
|
+
a: Candidate;
|
|
28
|
+
b: Candidate;
|
|
29
|
+
/** Whether the person must not learn which variant is which. Required, no default. */
|
|
30
|
+
blind: boolean;
|
|
31
|
+
/** The words shown where a picture could not be loaded: "Picture not found". Required. */
|
|
32
|
+
missing: string;
|
|
33
|
+
mode: CompareMode;
|
|
34
|
+
onModeChange: (mode: CompareMode) => void;
|
|
35
|
+
/** Which views are offered. Default all four. Must include `mode`. */
|
|
36
|
+
modes?: readonly CompareMode[];
|
|
37
|
+
/** Bind the view, zoom and full-screen keys on the window. Default true; turn off when a surrounding screen binds the same keys. */
|
|
38
|
+
keys?: boolean;
|
|
39
|
+
className?: string;
|
|
40
|
+
};
|
|
41
|
+
/** Two pictures to judge, side by side or laid over each other, zoomed and panned together, and full screen. */
|
|
42
|
+
export declare function Compare({ label, a, b, blind, missing, mode, onModeChange, modes, keys, className }: CompareProps): React.JSX.Element;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
type FieldState = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
describedBy?: string;
|
|
6
|
+
invalid: boolean;
|
|
7
|
+
report: (message: string | undefined) => void;
|
|
8
|
+
};
|
|
9
|
+
/** @internal The surrounding Field, and where a control reports its own message. */
|
|
10
|
+
export declare function useFieldControl(): {
|
|
11
|
+
field: FieldState | null;
|
|
12
|
+
report: (message: string | undefined) => void;
|
|
13
|
+
};
|
|
2
14
|
export type FieldProps = {
|
|
3
15
|
label: string;
|
|
4
16
|
/** The control's id, when the page needs a known one (an anchor, a test). Generated otherwise. */
|
|
@@ -34,3 +46,4 @@ export declare function ChoiceGroup({ legend, name, choices, value, onChange, er
|
|
|
34
46
|
onChange: (value: string) => void;
|
|
35
47
|
error?: string;
|
|
36
48
|
}): React.JSX.Element;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Props for `FullscreenFrame`. */
|
|
3
|
+
export type FullscreenFrameProps = {
|
|
4
|
+
/** Names the full-screen view for screen readers: "Compare renderings". Required. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Whether the frame is full screen. The caller owns it so a button and a key can share it. */
|
|
7
|
+
active: boolean;
|
|
8
|
+
/** Called with `false` when the person leaves with Escape or the browser's own control. */
|
|
9
|
+
onActiveChange: (active: boolean) => void;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
/** Whether this browser can show an element full screen. False in jsdom and on iPhone, where the modal fallback is used. */
|
|
14
|
+
export declare function canFullscreen(): boolean;
|
|
15
|
+
/** Shows its children full screen while `active`: the browser's Fullscreen API where there is one, a window-filling modal where there is not. */
|
|
16
|
+
export declare function FullscreenFrame({ label, active, onActiveChange, children, className }: FullscreenFrameProps): React.JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Props shared by the number field and the slider. */
|
|
3
|
+
export type RangeProps = {
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
/** The size of one arrow-key step. Default 1. */
|
|
7
|
+
step?: number;
|
|
8
|
+
/** The unit shown with the value: "%", "°", "Mbps", "px". Spoken too when `Intl` has it (%, °, ms, s, kB, MB, GB, kbps, Mbps). */
|
|
9
|
+
unit?: string;
|
|
10
|
+
/** The locale for digits and the decimal mark. Default the app's `format` locale. */
|
|
11
|
+
locale?: string;
|
|
12
|
+
};
|
|
13
|
+
/** Props for `NumberField`. */
|
|
14
|
+
export type NumberFieldProps = RangeProps & {
|
|
15
|
+
/** The current value; `null` when it is not known (shown as an en dash, not 0). */
|
|
16
|
+
value: number | null;
|
|
17
|
+
/** Receives a number inside the limits, or `null` when the field is cleared. Never NaN, never out of range. */
|
|
18
|
+
onChange: (value: number | null) => void;
|
|
19
|
+
/** Decimal places to show and keep. Default the places in `step` (and `min`). */
|
|
20
|
+
places?: number;
|
|
21
|
+
/** An empty field is an error ("Enter a value.") rather than `null`. */
|
|
22
|
+
required?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** Names the control when it is used without a `Field`. */
|
|
25
|
+
"aria-label"?: string;
|
|
26
|
+
id?: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
/** 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;
|
|
32
|
+
/** Props for `Slider`. */
|
|
33
|
+
export type SliderProps = RangeProps & {
|
|
34
|
+
value: number;
|
|
35
|
+
onChange: (value: number) => void;
|
|
36
|
+
/** Both limits are required: a slider with no ends is not a slider. */
|
|
37
|
+
min: number;
|
|
38
|
+
max: number;
|
|
39
|
+
/** Replace the printed value with a `NumberField` beside the track, so an exact value can be typed. */
|
|
40
|
+
editable?: boolean;
|
|
41
|
+
/** Hide the printed value (when something else beside it already shows it). */
|
|
42
|
+
hideValue?: boolean;
|
|
43
|
+
/** Decimal places in the printed and spoken value. Default the places in `step`. */
|
|
44
|
+
places?: number;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
/** Names the slider when it is used without a `Field`. */
|
|
47
|
+
"aria-label"?: string;
|
|
48
|
+
className?: string;
|
|
49
|
+
};
|
|
50
|
+
/** A slider on React Aria with its current value always printed beside the track (and spoken with the unit when `Intl` knows it); `editable` adds a number field to type an exact value. */
|
|
51
|
+
export declare function Slider({ value, onChange, min, max, step, unit, locale, editable, hideValue, places, disabled, className, "aria-label": ariaLabel, }: SliderProps): React.JSX.Element;
|
|
52
|
+
/** Props for `ColorField`. */
|
|
53
|
+
export type ColorFieldProps = {
|
|
54
|
+
/** `#rrggbb`, or `null` when no colour is set. */
|
|
55
|
+
value: string | null;
|
|
56
|
+
/** Receives a valid `#rrggbb` (lower case) or `null` when cleared; never a half-typed value. */
|
|
57
|
+
onChange: (value: string | null) => void;
|
|
58
|
+
/** A short list the app suggests, as `#rrggbb`. Pressing one chooses it. */
|
|
59
|
+
suggestions?: readonly string[];
|
|
60
|
+
/** The colour this will be drawn on, `#rrggbb`: a note appears when the contrast would be low. */
|
|
61
|
+
against?: string;
|
|
62
|
+
/** What it is drawn on, in words: "the map". Completes the note. */
|
|
63
|
+
againstLabel?: string;
|
|
64
|
+
/** The lowest contrast ratio accepted before the note shows. Default 3, the WCAG minimum for graphics. */
|
|
65
|
+
minContrast?: number;
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
"aria-label"?: string;
|
|
68
|
+
id?: string;
|
|
69
|
+
className?: string;
|
|
70
|
+
};
|
|
71
|
+
/** Choose a colour with the platform picker, see and type its hex value, pick from the app's suggestions, and get a note when it would be hard to see on `against`. A half-typed value is never passed on. */
|
|
72
|
+
export declare function ColorField({ value, onChange, suggestions, against, againstLabel, minContrast, disabled, id: idProp, className, "aria-label": ariaLabel }: ColorFieldProps): React.JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Viewport } from '../lib/viewport';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** The caller's zoom and pan, and how to change them. */
|
|
4
|
+
export type ViewportState = {
|
|
5
|
+
viewport: Viewport;
|
|
6
|
+
setViewport: (next: Viewport) => void;
|
|
7
|
+
};
|
|
8
|
+
/** Zoom and pan held in React state, to give to every `ViewportFrame` that should move together. */
|
|
9
|
+
export declare function useViewport(initial?: Viewport): ViewportState;
|
|
10
|
+
/** Props for `ViewportFrame`. */
|
|
11
|
+
export type ViewportFrameProps = ViewportState & {
|
|
12
|
+
/** Names the frame for screen readers: "Picture A". Required. */
|
|
13
|
+
label: string;
|
|
14
|
+
/** Width over height of the frame before anything inside it has loaded. */
|
|
15
|
+
aspect: number;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
/** A second picture layer above `children`, zoomed and panned with them but cut at `shown` percent of the *frame's* width from the left, so a swipe divider in `overlay` stays where the cut is at any zoom. */
|
|
18
|
+
cover?: {
|
|
19
|
+
content: React.ReactNode;
|
|
20
|
+
shown: number;
|
|
21
|
+
};
|
|
22
|
+
/** Drawn over the frame, not zoomed with it: a divider to drag, a corner label. Its pointer, key and double-click events do not reach the frame, so using it never pans the picture. */
|
|
23
|
+
overlay?: React.ReactNode;
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
/** A clipped frame whose children zoom and pan together; the viewport is the caller's, so frames can share one. */
|
|
27
|
+
export declare const ViewportFrame: React.ForwardRefExoticComponent<ViewportState & {
|
|
28
|
+
/** Names the frame for screen readers: "Picture A". Required. */
|
|
29
|
+
label: string;
|
|
30
|
+
/** Width over height of the frame before anything inside it has loaded. */
|
|
31
|
+
aspect: number;
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
/** A second picture layer above `children`, zoomed and panned with them but cut at `shown` percent of the *frame's* width from the left, so a swipe divider in `overlay` stays where the cut is at any zoom. */
|
|
34
|
+
cover?: {
|
|
35
|
+
content: React.ReactNode;
|
|
36
|
+
shown: number;
|
|
37
|
+
};
|
|
38
|
+
/** Drawn over the frame, not zoomed with it: a divider to drag, a corner label. Its pointer, key and double-click events do not reach the frame, so using it never pans the picture. */
|
|
39
|
+
overlay?: React.ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { Meter, crossedThreshold, type MeterProps, type MeterThreshold } from '.
|
|
|
27
27
|
export { CompositionBar, type CompositionBarProps, type CompositionPart } from './components/composition';
|
|
28
28
|
export { LinkCard, LinkCardList, type LinkCardProps } from './components/link-card';
|
|
29
29
|
export { DataView, EmptyState, LoadError, Skeleton, StaleNotice, type Load, type LoadFailure, type Stale } from './components/data-view';
|
|
30
|
+
export { NumberField, Slider, ColorField, type NumberFieldProps, type SliderProps, type ColorFieldProps, type RangeProps } from './components/value-controls';
|
|
30
31
|
export { Alert, type AlertProps } from './components/alert';
|
|
31
32
|
export { toast, toastTimeout, StrataToastRegion, type ToastContentProps, type StrataToastRegionProps } from './components/toast';
|
|
32
33
|
export { useClientWork, type ClientWork, type WorkContext, type WorkPhase } from './lib/client-work';
|
|
@@ -49,3 +50,7 @@ export { useActiveItem, ActiveList, type ActiveItem } from './components/active-
|
|
|
49
50
|
export { ThemeProvider, useColorScheme, useSystemColorScheme, ColorSchemeChoice, colorSchemeScript, COLOR_SCHEME_STORAGE_KEY, type ColorScheme, type ColorSchemePreference, type ColorSchemeLabels, type ColorSchemeState, } from './components/theme';
|
|
50
51
|
export { StrataQueryProvider, createQueryClient, toLoad, staleOf, useLoad, useInfiniteLoad, useJob, fetchJson, HttpError, describeHttpError, readErrorBody, type DescribeError, type ErrorBody, type FetchJsonOptions, type InfiniteLoad, type InfiniteLoadOptions, type Job, type JobOptions, type More, } from './query';
|
|
51
52
|
export { describeActionError, fieldErrorsOf } from './lib/errors';
|
|
53
|
+
export { Compare, type CompareProps, type CompareMode, type Candidate, type ImageMedia } from './components/compare';
|
|
54
|
+
export { ViewportFrame, useViewport, type ViewportFrameProps, type ViewportState } from './components/viewport';
|
|
55
|
+
export { FullscreenFrame, canFullscreen, type FullscreenFrameProps } from './components/fullscreen-frame';
|
|
56
|
+
export { FIT, MIN_SCALE, MAX_SCALE, clampViewport, zoomAt, actualPixelsScale, type Viewport } from './lib/viewport';
|