@exponential-at/ui-solid 0.0.0-stage → 0.1.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 +201 -0
- package/NOTICE +54 -0
- package/README.md +135 -2
- package/dist/chunks/image-loading-status-DZOoj4RQ.js +1724 -0
- package/dist/chunks/image-loading-status-DZOoj4RQ.js.map +1 -0
- package/dist/exponential-ui-solid.css +2 -0
- package/dist/index.js +12305 -0
- package/dist/index.js.map +1 -0
- package/dist/primitives.js +8439 -0
- package/dist/primitives.js.map +1 -0
- package/dist/types/behaviors/bubble-input.d.ts +35 -0
- package/dist/types/behaviors/collapsible.d.ts +15 -0
- package/dist/types/behaviors/dialog.d.ts +116 -0
- package/dist/types/behaviors/dismissable-layer.d.ts +48 -0
- package/dist/types/behaviors/drag-to-dismiss.d.ts +10 -0
- package/dist/types/behaviors/element-size.d.ts +7 -0
- package/dist/types/behaviors/focus-guards.d.ts +4 -0
- package/dist/types/behaviors/focus-scope.d.ts +20 -0
- package/dist/types/behaviors/grace-area.d.ts +10 -0
- package/dist/types/behaviors/image-loading-status.d.ts +4 -0
- package/dist/types/behaviors/index.d.ts +23 -0
- package/dist/types/behaviors/listbox.d.ts +44 -0
- package/dist/types/behaviors/menu.d.ts +95 -0
- package/dist/types/behaviors/modal.d.ts +3 -0
- package/dist/types/behaviors/picker-popover.d.ts +22 -0
- package/dist/types/behaviors/popper.d.ts +49 -0
- package/dist/types/behaviors/portal.d.ts +11 -0
- package/dist/types/behaviors/presence.d.ts +7 -0
- package/dist/types/behaviors/roving-focus.d.ts +30 -0
- package/dist/types/behaviors/scroll-lock.d.ts +4 -0
- package/dist/types/behaviors/search-match.d.ts +6 -0
- package/dist/types/behaviors/slider.d.ts +8 -0
- package/dist/types/behaviors/style-writer.d.ts +8 -0
- package/dist/types/behaviors/typeahead.d.ts +11 -0
- package/dist/types/behaviors/visually-hidden.d.ts +6 -0
- package/dist/types/bind-attrs.d.ts +4 -0
- package/dist/types/context.d.ts +74 -0
- package/dist/types/create-surface.d.ts +58 -0
- package/dist/types/extensions.d.ts +25 -0
- package/dist/types/form.d.ts +63 -0
- package/dist/types/host-surface.d.ts +33 -0
- package/dist/types/host.d.ts +37 -0
- package/dist/types/icons.d.ts +56 -0
- package/dist/types/index.d.ts +39 -0
- package/dist/types/inputs.d.ts +27 -0
- package/dist/types/list.d.ts +33 -0
- package/dist/types/markdown.d.ts +10 -0
- package/dist/types/media.d.ts +16 -0
- package/dist/types/natives/actions.d.ts +13 -0
- package/dist/types/natives/bound.d.ts +3 -0
- package/dist/types/natives/chart.d.ts +4 -0
- package/dist/types/natives/chips.d.ts +7 -0
- package/dist/types/natives/choice-tiles.d.ts +4 -0
- package/dist/types/natives/code.d.ts +4 -0
- package/dist/types/natives/dates.d.ts +30 -0
- package/dist/types/natives/feedback.d.ts +19 -0
- package/dist/types/natives/index.d.ts +6 -0
- package/dist/types/natives/inputs.d.ts +20 -0
- package/dist/types/natives/layout.d.ts +12 -0
- package/dist/types/natives/media.d.ts +14 -0
- package/dist/types/natives/nav.d.ts +14 -0
- package/dist/types/natives/overlays.d.ts +19 -0
- package/dist/types/natives/owners.d.ts +2 -0
- package/dist/types/natives/pending.d.ts +3 -0
- package/dist/types/natives/resizable.d.ts +4 -0
- package/dist/types/natives/search.d.ts +45 -0
- package/dist/types/natives/select.d.ts +10 -0
- package/dist/types/natives/shared.d.ts +50 -0
- package/dist/types/natives/table.d.ts +7 -0
- package/dist/types/natives/text.d.ts +5 -0
- package/dist/types/node-view.d.ts +83 -0
- package/dist/types/platform.d.ts +12 -0
- package/dist/types/primitives/alert-dialog.d.ts +24 -0
- package/dist/types/primitives/alert.d.ts +6 -0
- package/dist/types/primitives/avatar-color.d.ts +1 -0
- package/dist/types/primitives/avatar.d.ts +12 -0
- package/dist/types/primitives/badge.d.ts +8 -0
- package/dist/types/primitives/breadcrumb.d.ts +12 -0
- package/dist/types/primitives/button.d.ts +12 -0
- package/dist/types/primitives/calendar.d.ts +188 -0
- package/dist/types/primitives/card.d.ts +9 -0
- package/dist/types/primitives/checkbox.d.ts +14 -0
- package/dist/types/primitives/choice-tiles.d.ts +59 -0
- package/dist/types/primitives/cn.d.ts +1 -0
- package/dist/types/primitives/code-block.d.ts +34 -0
- package/dist/types/primitives/collapsible.d.ts +15 -0
- package/dist/types/primitives/command.d.ts +51 -0
- package/dist/types/primitives/context-ring.d.ts +14 -0
- package/dist/types/primitives/dialog-arms.d.ts +2 -0
- package/dist/types/primitives/dialog.d.ts +34 -0
- package/dist/types/primitives/disclosure-header.d.ts +7 -0
- package/dist/types/primitives/dock-card.d.ts +41 -0
- package/dist/types/primitives/dropdown-menu.d.ts +73 -0
- package/dist/types/primitives/empty-state.d.ts +19 -0
- package/dist/types/primitives/glass-card.d.ts +3 -0
- package/dist/types/primitives/hover-card.d.ts +28 -0
- package/dist/types/primitives/icon-disc.d.ts +11 -0
- package/dist/types/primitives/index.d.ts +51 -0
- package/dist/types/primitives/input.d.ts +6 -0
- package/dist/types/primitives/kbd.d.ts +4 -0
- package/dist/types/primitives/label.d.ts +3 -0
- package/dist/types/primitives/menu-surface.d.ts +1 -0
- package/dist/types/primitives/meter.d.ts +8 -0
- package/dist/types/primitives/popover.d.ts +31 -0
- package/dist/types/primitives/progress-ring.d.ts +12 -0
- package/dist/types/primitives/progress.d.ts +9 -0
- package/dist/types/primitives/scroll-area.d.ts +19 -0
- package/dist/types/primitives/segmented-control.d.ts +23 -0
- package/dist/types/primitives/select.d.ts +51 -0
- package/dist/types/primitives/separator.d.ts +6 -0
- package/dist/types/primitives/sheet-chrome.d.ts +11 -0
- package/dist/types/primitives/sheet.d.ts +21 -0
- package/dist/types/primitives/skeleton.d.ts +3 -0
- package/dist/types/primitives/spinner.d.ts +9 -0
- package/dist/types/primitives/switch.d.ts +14 -0
- package/dist/types/primitives/table.d.ts +11 -0
- package/dist/types/primitives/tabs.d.ts +29 -0
- package/dist/types/primitives/textarea.d.ts +5 -0
- package/dist/types/primitives/toast.d.ts +16 -0
- package/dist/types/primitives/tooltip.d.ts +34 -0
- package/dist/types/primitives/truncate.d.ts +1 -0
- package/dist/types/primitives/use-media-query.d.ts +4 -0
- package/dist/types/primitives/use-mobile.d.ts +4 -0
- package/dist/types/primitives/use-sheet-drag.d.ts +20 -0
- package/dist/types/style.d.ts +6 -0
- package/dist/types/surface.d.ts +99 -0
- package/package.json +55 -4
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Component, type JSX } from "solid-js";
|
|
2
|
+
import { type NativeProps } from "../node-view.js";
|
|
3
|
+
/** Image (contract §3): `loading` lazy|eager, `focalX/focalY` (0..1 →
|
|
4
|
+
* `object-position`), and the `fallback` icon (default
|
|
5
|
+
* `builtinIcons["Image.fallback"]`) on error or without a src;
|
|
6
|
+
* `data-state` = loading | loaded | error | empty. */
|
|
7
|
+
export declare function ImageNative(props: NativeProps): JSX.Element;
|
|
8
|
+
export declare function VideoNative(props: NativeProps): JSX.Element;
|
|
9
|
+
export declare function AudioPlayerNative(props: NativeProps): JSX.Element;
|
|
10
|
+
/** A stable hue for a seed (two avatars of one person always match). */
|
|
11
|
+
export declare function seedHue(seed: string): number;
|
|
12
|
+
export declare function AvatarNative(props: NativeProps): JSX.Element;
|
|
13
|
+
export declare function CarouselNative(props: NativeProps): JSX.Element;
|
|
14
|
+
export declare const NATIVES_MEDIA: Record<string, Component<NativeProps>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Component, type JSX } from "solid-js";
|
|
2
|
+
import type { NativeProps } from "../node-view.js";
|
|
3
|
+
export declare function TabsNative(props: NativeProps): JSX.Element;
|
|
4
|
+
/** Segmented (round 3): ONE row of segments.
|
|
5
|
+
* `segmented` (default, the pill track) / `toggles` (bare) / `outline`
|
|
6
|
+
* (joined) = Radix's ToggleGroup DOM (radiogroup single, toolbar of
|
|
7
|
+
* toggle buttons multiple; roving tab stop, arrows wrap, Home/End). `bar`
|
|
8
|
+
* = the full-width bottom destinations: role navigation, each item a
|
|
9
|
+
* column button (icon above a caption label), the selected one
|
|
10
|
+
* `aria-current="page"`, the same roving keys. Parts: root, item, icon,
|
|
11
|
+
* label (the selected state rides every part of the selected item). */
|
|
12
|
+
export declare function SegmentedNative(props: NativeProps): JSX.Element;
|
|
13
|
+
export declare function AccordionNative(props: NativeProps): JSX.Element;
|
|
14
|
+
export declare const NATIVES_NAV: Record<string, Component<NativeProps>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Component, type JSX } from "solid-js";
|
|
2
|
+
import type { NativeProps } from "../node-view.js";
|
|
3
|
+
export declare function DialogNative(props: NativeProps): JSX.Element;
|
|
4
|
+
export declare function DrawerNative(props: NativeProps): JSX.Element;
|
|
5
|
+
export declare function PopoverNative(props: NativeProps): JSX.Element;
|
|
6
|
+
/** Tooltip: shows on hover AND keyboard focus (a11y.json), Escape hides. */
|
|
7
|
+
export declare function TooltipNative(props: NativeProps): JSX.Element;
|
|
8
|
+
/** Menu: `openOn: press` (default) = a dropdown menu, its ONE child the
|
|
9
|
+
* trigger (no child = the default outline Button from label/icon, no
|
|
10
|
+
* chevron), anchored bottom-start; `openOn: contextmenu` = a context menu
|
|
11
|
+
* over the child (right-click / long-press / Shift+F10 / the Menu key),
|
|
12
|
+
* opened at the pointer (the child's corner from the keyboard). */
|
|
13
|
+
export declare function MenuNative(props: NativeProps): JSX.Element;
|
|
14
|
+
/** Toast (contract §3): in the TOAST layer, newest nearest the edge, at most
|
|
15
|
+
* 3 visible (base CSS). The renderer runs `duration` (0 = sticky), PAUSED
|
|
16
|
+
* while hovered or focused, then writes `open: false` and fires `dismiss`
|
|
17
|
+
* + `change`. `error` is assertive, the rest polite; never takes focus. */
|
|
18
|
+
export declare function ToastNative(props: NativeProps): JSX.Element;
|
|
19
|
+
export declare const NATIVES_OVERLAYS: Record<string, Component<NativeProps>>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type Component, type JSX } from "solid-js";
|
|
2
|
+
import type { NativeProps } from "../node-view.js";
|
|
3
|
+
import { type Attrs, type PartFn } from "./shared.js";
|
|
4
|
+
export interface SearchItem {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
identifier?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** React's `SearchBodyProps` (live getters on Solid: never destructure). */
|
|
12
|
+
export interface SearchBodyProps {
|
|
13
|
+
part: PartFn;
|
|
14
|
+
/** Whose body this is (a SearchList, or a Menu's searchable submenu). */
|
|
15
|
+
owner: `SearchList` | `Menu`;
|
|
16
|
+
/** `""` for a SearchList, `.<i>` for submenu `i` (the core's suffix). */
|
|
17
|
+
suffix: string;
|
|
18
|
+
/** The rows ALREADY filtered, each with its index in the full list. */
|
|
19
|
+
rows: {
|
|
20
|
+
index: number;
|
|
21
|
+
item: SearchItem;
|
|
22
|
+
}[];
|
|
23
|
+
query: string;
|
|
24
|
+
onQuery: (query: string) => void;
|
|
25
|
+
placeholder: string;
|
|
26
|
+
emptyText: string;
|
|
27
|
+
maxRows: number;
|
|
28
|
+
showCount: boolean;
|
|
29
|
+
picked?: string;
|
|
30
|
+
onPick: (item: SearchItem) => void;
|
|
31
|
+
autoFocus?: boolean;
|
|
32
|
+
/** ← with the caret at the start leaves the field's key to the menu (a
|
|
33
|
+
* searchable submenu closes back to its row). */
|
|
34
|
+
leaveBubbles?: boolean;
|
|
35
|
+
/** The rows' recipe part (`item`) and the row id prefix. */
|
|
36
|
+
rowPart?: (item: SearchItem, index: number, active: boolean) => Attrs;
|
|
37
|
+
renderRow?: (item: SearchItem, index: number) => JSX.Element;
|
|
38
|
+
}
|
|
39
|
+
export declare function SearchBody(props: SearchBodyProps): JSX.Element;
|
|
40
|
+
/** SearchList: the field filters the rows locally (label or identifier)
|
|
41
|
+
* unless the host searches itself (`on.search`, its rows arrive through
|
|
42
|
+
* the bound `items`); `search {query}` fires 150 ms after the last
|
|
43
|
+
* keystroke; a pick writes the bound `value` and fires `select {value}`. */
|
|
44
|
+
export declare function SearchListNative(props: NativeProps): JSX.Element;
|
|
45
|
+
export declare const NATIVES_SEARCH: Record<string, Component<NativeProps>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { NativeProps } from "../node-view.js";
|
|
3
|
+
export interface SelectOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function SelectNative(props: NativeProps): JSX.Element;
|
|
10
|
+
export declare const NATIVES_SELECT: Record<string, (props: NativeProps) => JSX.Element>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { arr, bool, builtinIconName, failingCheck, failingChecks, formatFileSize, num, objects, phrase, str } from "@exponential-at/ui/web";
|
|
3
|
+
import type { UiNode } from "@exponential-at/ui";
|
|
4
|
+
export type Attrs = Record<string, unknown>;
|
|
5
|
+
export { str, num, bool, arr, objects, phrase, formatFileSize, failingChecks, failingCheck, builtinIconName };
|
|
6
|
+
export { css, px } from "../style.js";
|
|
7
|
+
export type { StyleInput, SolidStyle } from "../style.js";
|
|
8
|
+
type State = string | false | undefined | null;
|
|
9
|
+
export type PartFn = ((name: string, ...states: State[]) => Attrs) & {
|
|
10
|
+
/** The same with part-level recipe props (`{kind: "keyword"}`). */
|
|
11
|
+
with: (name: string, extra: Record<string, unknown>, ...states: State[]) => Attrs;
|
|
12
|
+
/** A PER-ITEM placed part: `data-xui-id="<id>.<part>.<item>"`. */
|
|
13
|
+
at: (name: string, item: string | number, ...states: State[]) => Attrs;
|
|
14
|
+
/** `at` with part-level recipe props. */
|
|
15
|
+
atWith: (name: string, item: string | number, extra: Record<string, unknown>, ...states: State[]) => Attrs;
|
|
16
|
+
/** The painted id of the node (`<id><instance suffix>`), live. */
|
|
17
|
+
readonly domId: string;
|
|
18
|
+
};
|
|
19
|
+
/** React's `useParts(node, props)` on Solid: `parts(props)` takes the
|
|
20
|
+
* painter's props object (`{node, props}` live getters) and returns
|
|
21
|
+
* `part(name, …states)` → the attribute bag of one part element, keys in
|
|
22
|
+
* React's order: `class` (`<scope> xui-<Component>-<part>`),
|
|
23
|
+
* `data-xui-part` (`<Component>/<part>`), `data-xui-id` (placed parts
|
|
24
|
+
* only), the native recipe props (`data-r-*`), the part's own extras,
|
|
25
|
+
* `data-xs`. Call `part(…)` INSIDE JSX (or a memo) so it follows the
|
|
26
|
+
* node, its props, the theme scope and the forced states. */
|
|
27
|
+
export declare function parts(source: {
|
|
28
|
+
readonly node: UiNode;
|
|
29
|
+
readonly props: Record<string, unknown>;
|
|
30
|
+
}): PartFn;
|
|
31
|
+
/** React's name, for a literal port. */
|
|
32
|
+
export declare const useParts: (node: UiNode, props: Record<string, unknown>) => PartFn;
|
|
33
|
+
/** A text part (React's `TextPart`): nothing when the text displays empty. */
|
|
34
|
+
export declare function TextPart(props: {
|
|
35
|
+
part: Attrs;
|
|
36
|
+
text: unknown;
|
|
37
|
+
as?: `span` | `label` | `div` | `p`;
|
|
38
|
+
id?: string;
|
|
39
|
+
htmlFor?: string;
|
|
40
|
+
}): JSX.Element;
|
|
41
|
+
export declare function Hidden(props: {
|
|
42
|
+
children: JSX.Element;
|
|
43
|
+
}): JSX.Element;
|
|
44
|
+
/** The glyph of an owned part (`CodeBlock.copy`, `Table.sortIcon.asc`),
|
|
45
|
+
* through the host's registry first, then the renderer's fallbacks. */
|
|
46
|
+
export declare function BuiltinIcon(props: {
|
|
47
|
+
slot: string;
|
|
48
|
+
class?: string;
|
|
49
|
+
size?: number;
|
|
50
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Component, type JSX } from "solid-js";
|
|
2
|
+
import { sortRows, type TableColumn } from "@exponential-at/ui/web";
|
|
3
|
+
import { type NativeProps } from "../node-view.js";
|
|
4
|
+
export { sortRows };
|
|
5
|
+
export type { TableColumn };
|
|
6
|
+
export declare function TableNative(props: NativeProps): JSX.Element;
|
|
7
|
+
export declare const NATIVES_TABLE: Record<string, Component<NativeProps>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import { type NativeProps } from "../node-view.js";
|
|
3
|
+
export declare function TextNative(props: NativeProps): JSX.Element;
|
|
4
|
+
export declare function MarkdownNative(props: NativeProps): JSX.Element;
|
|
5
|
+
export declare function IconNative(props: NativeProps): JSX.Element;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type Accessor, type JSX } from "solid-js";
|
|
2
|
+
import type { UiNode } from "@exponential-at/ui";
|
|
3
|
+
import { type SurfaceContextValue } from "./context.js";
|
|
4
|
+
import type { ExtensionComponentProps } from "./host.js";
|
|
5
|
+
import { type SolidStyle, type StyleInput } from "./style.js";
|
|
6
|
+
/** What a painter receives: React's `NativeProps` as a Solid props object.
|
|
7
|
+
* EVERY field is a live getter: never destructure it (`props.props.label`
|
|
8
|
+
* inside JSX or a memo follows the data), read `children` and each slot
|
|
9
|
+
* ONCE. */
|
|
10
|
+
export interface NativeProps extends ExtensionComponentProps {
|
|
11
|
+
/** The data scope (template item) this node renders under. */
|
|
12
|
+
readonly scope: string;
|
|
13
|
+
/** The node's id as painted (`data-xui-id`): its id + the template
|
|
14
|
+
* instance suffix. DOM ids derive from it (`<id>.error`). */
|
|
15
|
+
readonly domId: string;
|
|
16
|
+
}
|
|
17
|
+
/** The id a node's style rules are keyed by. */
|
|
18
|
+
export declare function styleIdOf(node: UiNode): string;
|
|
19
|
+
/** The attributes every painted root carries (React's `useRootProps`):
|
|
20
|
+
* `class` (`xui-el xui-n-<id> <scope> xui-<Component>-root [macro part]`),
|
|
21
|
+
* `data-xui-id`, `data-xui-c`, `data-xui-part`, the recipe props
|
|
22
|
+
* (`data-m-*` macro / `data-r-*` native), `data-xs`, the resolved
|
|
23
|
+
* accessibility, `style` (Solid form), `dir`. A live accessor. */
|
|
24
|
+
export declare function createRootProps(node: Accessor<UiNode>, props: Accessor<Record<string, unknown>>, domId?: Accessor<string>, recipeProps?: Accessor<Record<string, unknown> | undefined>, style?: Accessor<SolidStyle | undefined>): Accessor<Record<string, unknown>>;
|
|
25
|
+
/** `class` on top of the renderer's own. */
|
|
26
|
+
export declare function withClass(rootProps: Record<string, unknown>, ...extra: (string | false | undefined | null)[]): Record<string, unknown>;
|
|
27
|
+
/** A painter's own inline style (React form: camelCase, numbers = px)
|
|
28
|
+
* merged over the root's (the dynamic style variables live there and must
|
|
29
|
+
* survive), in Solid's form. */
|
|
30
|
+
export declare function mergeStyle(rootProps: Record<string, unknown>, style: StyleInput | undefined): SolidStyle | undefined;
|
|
31
|
+
/** Forced states on a part element (`data-xs`). */
|
|
32
|
+
export declare function forced(states: readonly string[], ...extra: (string | false | undefined)[]): string | undefined;
|
|
33
|
+
/** Run one of a node's actions (round-1 contract §1 `runAction`), exactly
|
|
34
|
+
* React's `runNodeAction`. */
|
|
35
|
+
export declare function runNodeAction(ctx: SurfaceContextValue, node: UiNode, domId: string, scope: string, event: string, payload?: Record<string, unknown>, own?: Record<string, unknown>): Promise<void> | void;
|
|
36
|
+
/** React's `useEmitter`: the node's emitter (reads the node, scope and id
|
|
37
|
+
* at call time). */
|
|
38
|
+
export declare function createEmitter(node: Accessor<UiNode>, scope: Accessor<string>, domId?: Accessor<string>): (event: string, payload?: Record<string, unknown>, own?: Record<string, unknown>) => Promise<void> | void;
|
|
39
|
+
/** A node's own style `direction` (round 2 §2), matching `@media` blocks
|
|
40
|
+
* included. */
|
|
41
|
+
export declare function ownDirection(node: UiNode, ctx?: Pick<SurfaceContextValue, `theme` | `xq`>): `ltr` | `rtl` | undefined;
|
|
42
|
+
/** A node, or nothing when its `visible` resolves falsy. `props.node` is
|
|
43
|
+
* followed live (a re-reduce re-binds in place). */
|
|
44
|
+
export declare function NodeView(props: {
|
|
45
|
+
node: UiNode;
|
|
46
|
+
}): JSX.Element;
|
|
47
|
+
/** Nodes painted in order, KEYED BY ID: a re-reduce hands new node objects
|
|
48
|
+
* for the same ids and each keeps its painted subtree. */
|
|
49
|
+
export declare function NodeList(props: {
|
|
50
|
+
nodes: readonly UiNode[];
|
|
51
|
+
}): JSX.Element;
|
|
52
|
+
/** The latest non-empty value of `fn` (what a `<Show>` child reads instead
|
|
53
|
+
* of Show's accessor: a child disposed after its condition went falsy
|
|
54
|
+
* never reads a stale accessor). */
|
|
55
|
+
export declare function latest<T>(fn: () => T | null | undefined | false): Accessor<T>;
|
|
56
|
+
export interface TemplateItem {
|
|
57
|
+
/** The item's instance key: the `template.key` value; the index when the
|
|
58
|
+
* template has no key; `#<index>` when missing / empty / a duplicate. */
|
|
59
|
+
key: string;
|
|
60
|
+
/** The item's data pointer (its scope). */
|
|
61
|
+
path: string;
|
|
62
|
+
index: number;
|
|
63
|
+
}
|
|
64
|
+
/** The items of a node's data template (React's `templateItems`). Reads
|
|
65
|
+
* the surface's getters: call it inside a memo. */
|
|
66
|
+
export declare function templateItems(ctx: SurfaceContextValue, node: UiNode, scope: string): {
|
|
67
|
+
items: TemplateItem[];
|
|
68
|
+
tpl: UiNode;
|
|
69
|
+
} | null;
|
|
70
|
+
/** A template item's instance suffix: the enclosing one + `.<key>`, the
|
|
71
|
+
* key escaped (`instanceSegment`). */
|
|
72
|
+
export declare const itemInstance: (instance: string, key: string) => string;
|
|
73
|
+
/** One template item: its scope + instance suffix around the node (both
|
|
74
|
+
* followed live: a moved item keeps its subtree and re-scopes). */
|
|
75
|
+
export declare function TemplateItemView(props: {
|
|
76
|
+
tpl: UiNode;
|
|
77
|
+
item: TemplateItem;
|
|
78
|
+
}): JSX.Element;
|
|
79
|
+
/** The template items of a list, keyed by `template.key`. */
|
|
80
|
+
export declare function TemplateItems(props: {
|
|
81
|
+
items: readonly TemplateItem[];
|
|
82
|
+
tpl: UiNode;
|
|
83
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
/** `matchMedia(query).matches`, live; `fallback` without `matchMedia`
|
|
3
|
+
* (SSR, jsdom). */
|
|
4
|
+
export declare function createMediaQuery(query: string, fallback?: boolean): Accessor<boolean>;
|
|
5
|
+
export interface BoxSize {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
/** False until the first measurement. */
|
|
9
|
+
measured: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** An element's border box, live (ResizeObserver, disconnected on cleanup). */
|
|
12
|
+
export declare function createElementSize(el: Accessor<HTMLElement | null | undefined>, initialWidth?: number): Accessor<BoxSize>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ComponentProps, type JSX } from "solid-js";
|
|
2
|
+
import { type AsProps, type DialogContentPartProps, type DialogRootProps } from "../behaviors/dialog.js";
|
|
3
|
+
declare function AlertDialog(props: Omit<DialogRootProps, `modal`>): JSX.Element;
|
|
4
|
+
declare function AlertDialogTrigger(props: AsProps): JSX.Element;
|
|
5
|
+
declare function AlertDialogPortal(props: {
|
|
6
|
+
container?: HTMLElement | null;
|
|
7
|
+
children?: JSX.Element;
|
|
8
|
+
}): JSX.Element;
|
|
9
|
+
declare function AlertDialogOverlay(props: ComponentProps<`div`> & Record<string, unknown>): JSX.Element;
|
|
10
|
+
declare function AlertDialogContent(props: DialogContentPartProps & {
|
|
11
|
+
class?: string;
|
|
12
|
+
container?: HTMLElement | null;
|
|
13
|
+
}): JSX.Element;
|
|
14
|
+
declare function AlertDialogHeader(props: ComponentProps<`div`>): JSX.Element;
|
|
15
|
+
declare function AlertDialogFooter(props: ComponentProps<`div`>): JSX.Element;
|
|
16
|
+
declare function AlertDialogTitle(props: ComponentProps<`h2`>): JSX.Element;
|
|
17
|
+
declare function AlertDialogDescription(props: ComponentProps<`p`>): JSX.Element;
|
|
18
|
+
declare function AlertDialogAction(props: AsProps & {
|
|
19
|
+
class?: string;
|
|
20
|
+
}): JSX.Element;
|
|
21
|
+
declare function AlertDialogCancel(props: AsProps & {
|
|
22
|
+
class?: string;
|
|
23
|
+
}): JSX.Element;
|
|
24
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ComponentProps } from "solid-js";
|
|
2
|
+
import { alertVariants, type AlertVariantProps } from "@exponential-at/ui/web/primitives";
|
|
3
|
+
declare function Alert(props: ComponentProps<`div`> & AlertVariantProps): import("solid-js").JSX.Element;
|
|
4
|
+
declare function AlertTitle(props: ComponentProps<`div`>): import("solid-js").JSX.Element;
|
|
5
|
+
declare function AlertDescription(props: ComponentProps<`div`>): import("solid-js").JSX.Element;
|
|
6
|
+
export { Alert, AlertTitle, AlertDescription, alertVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AVATAR_HUE_COUNT, avatarHueIndex } from "@exponential-at/ui/web/primitives";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentProps, type JSX } from "solid-js";
|
|
2
|
+
import { type LoadingStatus } from "../behaviors/index.js";
|
|
3
|
+
declare function Avatar(props: ComponentProps<`span`>): JSX.Element;
|
|
4
|
+
declare function AvatarImage(props: ComponentProps<`img`> & {
|
|
5
|
+
onLoadingStatusChange?: (status: LoadingStatus) => void;
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
declare function AvatarFallback(props: Omit<ComponentProps<`span`>, `style`> & {
|
|
8
|
+
userId?: string | null;
|
|
9
|
+
delayMs?: number;
|
|
10
|
+
style?: JSX.CSSProperties;
|
|
11
|
+
}): JSX.Element;
|
|
12
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentProps } from "solid-js";
|
|
2
|
+
import { type BadgeTone } from "@exponential-at/ui/web/primitives";
|
|
3
|
+
export declare function Badge(props: Omit<ComponentProps<`span`>, `children`> & {
|
|
4
|
+
count: number;
|
|
5
|
+
/** Past this the badge reads `${max}+`. */
|
|
6
|
+
max?: number;
|
|
7
|
+
tone?: BadgeTone;
|
|
8
|
+
}): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentProps, type ValidComponent } from "solid-js";
|
|
2
|
+
declare function Breadcrumb(props: ComponentProps<`nav`>): import("solid-js").JSX.Element;
|
|
3
|
+
declare function BreadcrumbList(props: ComponentProps<`ol`>): import("solid-js").JSX.Element;
|
|
4
|
+
declare function BreadcrumbItem(props: ComponentProps<`li`>): import("solid-js").JSX.Element;
|
|
5
|
+
/** React's `asChild` is `as` (a tag or a component). */
|
|
6
|
+
declare function BreadcrumbLink(props: ComponentProps<`a`> & {
|
|
7
|
+
as?: ValidComponent;
|
|
8
|
+
}): import("solid-js").JSX.Element;
|
|
9
|
+
declare function BreadcrumbPage(props: ComponentProps<`span`>): import("solid-js").JSX.Element;
|
|
10
|
+
declare function BreadcrumbSeparator(props: ComponentProps<`li`>): import("solid-js").JSX.Element;
|
|
11
|
+
declare function BreadcrumbEllipsis(props: ComponentProps<`span`>): import("solid-js").JSX.Element;
|
|
12
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentProps, type ValidComponent } from "solid-js";
|
|
2
|
+
import { buttonVariants, type ButtonVariantProps } from "@exponential-at/ui/web/primitives";
|
|
3
|
+
export type ButtonProps = ComponentProps<`button`> & ButtonVariantProps & {
|
|
4
|
+
/** React's `asChild`: the element (a tag or a component) the button
|
|
5
|
+
* paints as, wearing exactly what Radix's Slot merges onto the child. */
|
|
6
|
+
as?: ValidComponent;
|
|
7
|
+
href?: string;
|
|
8
|
+
target?: string;
|
|
9
|
+
rel?: string;
|
|
10
|
+
};
|
|
11
|
+
declare function Button(props: ButtonProps): import("solid-js").JSX.Element;
|
|
12
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { type Component, type JSX } from "solid-js";
|
|
2
|
+
import { type ButtonVariantProps } from "@exponential-at/ui/web/primitives";
|
|
3
|
+
type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
/** A date-fns `Locale` (structurally): its `code` and week options. */
|
|
5
|
+
export interface CalendarLocale {
|
|
6
|
+
code?: string;
|
|
7
|
+
options?: {
|
|
8
|
+
weekStartsOn?: WeekDay;
|
|
9
|
+
firstWeekContainsDate?: number;
|
|
10
|
+
};
|
|
11
|
+
/** DayPicker's per-locale labels (react-day-picker's locales carry them). */
|
|
12
|
+
labels?: Partial<Record<keyof CalendarLabels, string | ((...args: never[]) => string)>>;
|
|
13
|
+
}
|
|
14
|
+
/** DayPicker's `CalendarDay`: a date shown in a display month. */
|
|
15
|
+
export declare class CalendarDay {
|
|
16
|
+
readonly date: Date;
|
|
17
|
+
readonly displayMonth: Date;
|
|
18
|
+
readonly outside: boolean;
|
|
19
|
+
readonly isoDate: string;
|
|
20
|
+
readonly displayMonthId: string;
|
|
21
|
+
readonly dateMonthId: string;
|
|
22
|
+
constructor(date: Date, displayMonth: Date);
|
|
23
|
+
isEqualTo(day: CalendarDay): boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface CalendarWeek {
|
|
26
|
+
weekNumber: number;
|
|
27
|
+
days: CalendarDay[];
|
|
28
|
+
}
|
|
29
|
+
export interface CalendarMonth {
|
|
30
|
+
date: Date;
|
|
31
|
+
weeks: CalendarWeek[];
|
|
32
|
+
}
|
|
33
|
+
export interface DateRange {
|
|
34
|
+
from: Date | undefined;
|
|
35
|
+
to?: Date | undefined;
|
|
36
|
+
}
|
|
37
|
+
export interface DateBefore {
|
|
38
|
+
before: Date;
|
|
39
|
+
}
|
|
40
|
+
export interface DateAfter {
|
|
41
|
+
after: Date;
|
|
42
|
+
}
|
|
43
|
+
export interface DateInterval {
|
|
44
|
+
before: Date;
|
|
45
|
+
after: Date;
|
|
46
|
+
}
|
|
47
|
+
export interface DayOfWeek {
|
|
48
|
+
dayOfWeek: number | number[];
|
|
49
|
+
}
|
|
50
|
+
/** DayPicker's `Matcher`. */
|
|
51
|
+
export type Matcher = boolean | ((date: Date) => boolean) | Date | Date[] | DateRange | DateBefore | DateAfter | DateInterval | DayOfWeek;
|
|
52
|
+
/** A day's modifiers, in DayPicker's key order. */
|
|
53
|
+
export type Modifiers = Record<string, boolean | undefined>;
|
|
54
|
+
/** DayPicker's `dateMatchModifiers`. */
|
|
55
|
+
export declare function dateMatchModifiers(date: Date, matchers: Matcher | Matcher[]): boolean;
|
|
56
|
+
export interface CalendarFormatters {
|
|
57
|
+
formatCaption: (month: Date) => string;
|
|
58
|
+
formatDay: (date: Date) => string;
|
|
59
|
+
formatMonthDropdown: (month: Date) => string;
|
|
60
|
+
formatYearDropdown: (year: Date) => string;
|
|
61
|
+
formatWeekdayName: (weekday: Date) => string;
|
|
62
|
+
formatWeekNumber: (weekNumber: number) => string;
|
|
63
|
+
formatWeekNumberHeader: () => string;
|
|
64
|
+
}
|
|
65
|
+
export interface CalendarLabels {
|
|
66
|
+
labelDayButton: (date: Date, modifiers: Modifiers) => string;
|
|
67
|
+
labelGridcell: (date: Date, modifiers?: Modifiers) => string;
|
|
68
|
+
labelGrid: (month: Date) => string;
|
|
69
|
+
labelNav: () => string;
|
|
70
|
+
labelNext: (month: Date | undefined) => string;
|
|
71
|
+
labelPrevious: (month: Date | undefined) => string;
|
|
72
|
+
labelWeekday: (weekday: Date) => string;
|
|
73
|
+
labelWeekNumber: (weekNumber: number) => string;
|
|
74
|
+
labelWeekNumberHeader: () => string;
|
|
75
|
+
labelMonthDropdown: () => string;
|
|
76
|
+
labelYearDropdown: () => string;
|
|
77
|
+
}
|
|
78
|
+
export interface CalendarDayButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
79
|
+
day: CalendarDay;
|
|
80
|
+
modifiers: Modifiers;
|
|
81
|
+
[data: `data-${string}`]: string | undefined;
|
|
82
|
+
}
|
|
83
|
+
export interface CalendarChevronProps {
|
|
84
|
+
class?: string;
|
|
85
|
+
orientation?: `up` | `down` | `left` | `right`;
|
|
86
|
+
disabled?: boolean;
|
|
87
|
+
size?: number;
|
|
88
|
+
}
|
|
89
|
+
type SelectHandler<T> = (selected: T, triggerDate: Date, modifiers: Modifiers, e: MouseEvent) => void;
|
|
90
|
+
interface ModeNone {
|
|
91
|
+
mode?: undefined;
|
|
92
|
+
selected?: undefined;
|
|
93
|
+
onSelect?: undefined;
|
|
94
|
+
required?: undefined;
|
|
95
|
+
}
|
|
96
|
+
interface ModeSingle {
|
|
97
|
+
mode: `single`;
|
|
98
|
+
selected?: Date | undefined;
|
|
99
|
+
onSelect?: SelectHandler<Date | undefined>;
|
|
100
|
+
required?: boolean;
|
|
101
|
+
}
|
|
102
|
+
interface ModeMultiple {
|
|
103
|
+
mode: `multiple`;
|
|
104
|
+
selected?: Date[] | undefined;
|
|
105
|
+
onSelect?: SelectHandler<Date[] | undefined>;
|
|
106
|
+
required?: boolean;
|
|
107
|
+
min?: number;
|
|
108
|
+
max?: number;
|
|
109
|
+
}
|
|
110
|
+
interface ModeRange {
|
|
111
|
+
mode: `range`;
|
|
112
|
+
selected?: DateRange | undefined;
|
|
113
|
+
onSelect?: SelectHandler<DateRange | undefined>;
|
|
114
|
+
required?: boolean;
|
|
115
|
+
min?: number;
|
|
116
|
+
max?: number;
|
|
117
|
+
resetOnSelect?: boolean;
|
|
118
|
+
}
|
|
119
|
+
export type CalendarProps = (ModeNone | ModeSingle | ModeMultiple | ModeRange) & {
|
|
120
|
+
class?: string;
|
|
121
|
+
/** DayPicker's part map (its keys: `root`, `day`, `day_button`, `today`…), merged over shadcn's. */
|
|
122
|
+
classNames?: Partial<Record<string, string>>;
|
|
123
|
+
style?: JSX.CSSProperties | string;
|
|
124
|
+
showOutsideDays?: boolean;
|
|
125
|
+
captionLayout?: `label` | `dropdown` | `dropdown-months` | `dropdown-years`;
|
|
126
|
+
buttonVariant?: ButtonVariantProps[`variant`];
|
|
127
|
+
formatters?: Partial<CalendarFormatters>;
|
|
128
|
+
labels?: Partial<CalendarLabels>;
|
|
129
|
+
components?: {
|
|
130
|
+
DayButton?: Component<CalendarDayButtonProps>;
|
|
131
|
+
Chevron?: Component<CalendarChevronProps>;
|
|
132
|
+
};
|
|
133
|
+
defaultMonth?: Date;
|
|
134
|
+
month?: Date;
|
|
135
|
+
onMonthChange?: (month: Date) => void;
|
|
136
|
+
onPrevClick?: (month: Date) => void;
|
|
137
|
+
onNextClick?: (month: Date) => void;
|
|
138
|
+
numberOfMonths?: number;
|
|
139
|
+
pagedNavigation?: boolean;
|
|
140
|
+
reverseMonths?: boolean;
|
|
141
|
+
fromYear?: number;
|
|
142
|
+
toYear?: number;
|
|
143
|
+
fromMonth?: Date;
|
|
144
|
+
toMonth?: Date;
|
|
145
|
+
startMonth?: Date;
|
|
146
|
+
endMonth?: Date;
|
|
147
|
+
disabled?: Matcher | Matcher[];
|
|
148
|
+
hidden?: Matcher | Matcher[];
|
|
149
|
+
modifiers?: Record<string, Matcher | Matcher[] | undefined>;
|
|
150
|
+
modifiersClassNames?: Record<string, string>;
|
|
151
|
+
today?: Date;
|
|
152
|
+
showWeekNumber?: boolean;
|
|
153
|
+
ISOWeek?: boolean;
|
|
154
|
+
fixedWeeks?: boolean;
|
|
155
|
+
weekStartsOn?: WeekDay;
|
|
156
|
+
firstWeekContainsDate?: 1 | 4;
|
|
157
|
+
locale?: CalendarLocale;
|
|
158
|
+
dir?: `ltr` | `rtl` | `auto`;
|
|
159
|
+
lang?: string;
|
|
160
|
+
id?: string;
|
|
161
|
+
title?: string;
|
|
162
|
+
role?: JSX.HTMLAttributes<HTMLDivElement>[`role`];
|
|
163
|
+
nonce?: string;
|
|
164
|
+
"aria-label"?: string;
|
|
165
|
+
"aria-labelledby"?: string;
|
|
166
|
+
autoFocus?: boolean;
|
|
167
|
+
hideNavigation?: boolean;
|
|
168
|
+
disableNavigation?: boolean;
|
|
169
|
+
hideWeekdays?: boolean;
|
|
170
|
+
reverseYears?: boolean;
|
|
171
|
+
footer?: JSX.Element;
|
|
172
|
+
onDayClick?: (date: Date, modifiers: Modifiers, e: MouseEvent) => void;
|
|
173
|
+
onDayFocus?: (date: Date, modifiers: Modifiers, e: FocusEvent) => void;
|
|
174
|
+
onDayBlur?: (date: Date, modifiers: Modifiers, e: FocusEvent) => void;
|
|
175
|
+
onDayKeyDown?: (date: Date, modifiers: Modifiers, e: KeyboardEvent) => void;
|
|
176
|
+
onDayMouseEnter?: (date: Date, modifiers: Modifiers, e: MouseEvent) => void;
|
|
177
|
+
onDayMouseLeave?: (date: Date, modifiers: Modifiers, e: MouseEvent) => void;
|
|
178
|
+
[data: `data-${string}`]: string | undefined;
|
|
179
|
+
};
|
|
180
|
+
/** react-day-picker's `getDefaultClassNames()`: `rdp-<key>`. */
|
|
181
|
+
export declare const getDefaultClassNames: () => Record<string, string>;
|
|
182
|
+
declare function Calendar(input: CalendarProps): JSX.Element;
|
|
183
|
+
/** shadcn's Chevron: the Lucide chevrons at `size-4` (lucide-react's attributes; `disabled` and `size` land on the <svg> as React spreads them). */
|
|
184
|
+
declare function CalendarChevron(props: CalendarChevronProps): JSX.Element;
|
|
185
|
+
/** shadcn's CalendarDayButton: the ghost icon Button with the day's data
|
|
186
|
+
* attributes; focuses itself when its day takes the focus. */
|
|
187
|
+
declare function CalendarDayButton(props: CalendarDayButtonProps): JSX.Element;
|
|
188
|
+
export { Calendar, CalendarDayButton, CalendarChevron };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentProps } from "solid-js";
|
|
2
|
+
declare const Card: (props: ComponentProps<`div`>) => import("solid-js").JSX.Element;
|
|
3
|
+
declare const CardHeader: (props: ComponentProps<`div`>) => import("solid-js").JSX.Element;
|
|
4
|
+
declare const CardTitle: (props: ComponentProps<`div`>) => import("solid-js").JSX.Element;
|
|
5
|
+
declare const CardDescription: (props: ComponentProps<`div`>) => import("solid-js").JSX.Element;
|
|
6
|
+
declare const CardAction: (props: ComponentProps<`div`>) => import("solid-js").JSX.Element;
|
|
7
|
+
declare const CardContent: (props: ComponentProps<`div`>) => import("solid-js").JSX.Element;
|
|
8
|
+
declare const CardFooter: (props: ComponentProps<`div`>) => import("solid-js").JSX.Element;
|
|
9
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ComponentProps, type JSX } from "solid-js";
|
|
2
|
+
export type CheckedState = boolean | `indeterminate`;
|
|
3
|
+
export type CheckboxProps = Omit<ComponentProps<`button`>, `value` | `onChange`> & {
|
|
4
|
+
checked?: CheckedState;
|
|
5
|
+
defaultChecked?: CheckedState;
|
|
6
|
+
onCheckedChange?: (checked: CheckedState) => void;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
name?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
form?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare function Checkbox(props: CheckboxProps): JSX.Element;
|
|
14
|
+
export { Checkbox };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type ChoiceTileOption, type TileState } from "@exponential-at/ui/web/primitives";
|
|
3
|
+
export { choiceColumns, choiceToggle, choiceValues } from "@exponential-at/ui/web/primitives";
|
|
4
|
+
export type { ChoiceTileOption, TileState } from "@exponential-at/ui/web/primitives";
|
|
5
|
+
type Attrs = Record<string, unknown>;
|
|
6
|
+
export interface ChoiceTilesFrameProps {
|
|
7
|
+
options: readonly ChoiceTileOption[];
|
|
8
|
+
/** The picked values. */
|
|
9
|
+
picked: readonly string[];
|
|
10
|
+
multiple: boolean;
|
|
11
|
+
columns: number;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
invalid?: boolean;
|
|
14
|
+
dir?: `ltr` | `rtl`;
|
|
15
|
+
/** A pick (already toggled for `multiple`): the next picked values. */
|
|
16
|
+
onPick: (next: string[], value: string) => void;
|
|
17
|
+
/** The root's attributes; `style` is a React-form object (camelCase). */
|
|
18
|
+
rootProps?: Attrs;
|
|
19
|
+
tileProps: (state: TileState) => Attrs;
|
|
20
|
+
pictureProps: (state: TileState) => Attrs;
|
|
21
|
+
labelProps: (state: TileState) => Attrs;
|
|
22
|
+
descriptionProps: (state: TileState) => Attrs;
|
|
23
|
+
/** The picture's content (the frame keeps the box; a missing picture gets
|
|
24
|
+
* the placeholder). */
|
|
25
|
+
renderPicture: (src: string | null, state: TileState) => JSX.Element;
|
|
26
|
+
/** Under the tiles (the field's errors), spanning every column. */
|
|
27
|
+
after?: JSX.Element;
|
|
28
|
+
rootRef?: (el: HTMLDivElement) => void;
|
|
29
|
+
}
|
|
30
|
+
/** The headless tiles: a `radiogroup` of `radio` buttons (single) or a
|
|
31
|
+
* `group` of `checkbox` buttons (multiple). The picked tile (else the
|
|
32
|
+
* first enabled one) is the tab stop; arrows move focus with wrap (a single
|
|
33
|
+
* pick follows focus); Space/Enter toggle (the button's own click). Every
|
|
34
|
+
* tile has a picture box once ANY option has an image, so a row keeps one
|
|
35
|
+
* height. */
|
|
36
|
+
export declare function ChoiceTilesFrame(props: ChoiceTilesFrameProps): JSX.Element;
|
|
37
|
+
export interface ChoiceTilesProps {
|
|
38
|
+
options: readonly ChoiceTileOption[];
|
|
39
|
+
/** The pick: a string (single) or the picked values (multiple). */
|
|
40
|
+
value: string | readonly string[] | null | undefined;
|
|
41
|
+
multiple?: boolean;
|
|
42
|
+
/** Tiles per row, 1–4 (default 2). */
|
|
43
|
+
columns?: number;
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** Paints the destructive border (a required answer missing). */
|
|
46
|
+
invalid?: boolean;
|
|
47
|
+
/** The next value: a string for a single pick, the values for `multiple`. */
|
|
48
|
+
onChange?: (value: string | string[]) => void;
|
|
49
|
+
/** The picture element; default a plain lazy <img>. */
|
|
50
|
+
renderImage?: (src: string, alt: string) => JSX.Element;
|
|
51
|
+
class?: string;
|
|
52
|
+
"aria-label"?: string;
|
|
53
|
+
"aria-labelledby"?: string;
|
|
54
|
+
"data-testid"?: string;
|
|
55
|
+
dir?: `ltr` | `rtl`;
|
|
56
|
+
}
|
|
57
|
+
/** THE picture choice (EXP-1280) at the eUI `ChoiceTiles` look. */
|
|
58
|
+
declare function ChoiceTiles(props: ChoiceTilesProps): JSX.Element;
|
|
59
|
+
export { ChoiceTiles };
|