@domphy/ui 0.14.0 → 0.15.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 +21 -21
- package/dist/core-theme-ui.global.js +4 -4
- package/dist/core-theme-ui.global.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +973 -196
- package/dist/index.d.ts +973 -196
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -3,69 +3,164 @@ import { ThemeColor } from '@domphy/theme';
|
|
|
3
3
|
import { Placement as Placement$1 } from '@domphy/floating';
|
|
4
4
|
export { Placement } from '@domphy/floating';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Styles an abbreviation/acronym with a dotted underline and a "help" cursor,
|
|
8
|
+
* shifting to the accent color on hover. Apply to an `<abbr>` element.
|
|
9
|
+
*
|
|
10
|
+
* @hostTag abbr
|
|
11
|
+
* @param props.color - Base text/decoration color tone. Optional `ValueOrState<ThemeColor>`, default "neutral".
|
|
12
|
+
* @param props.accentColor - Hover color tone. Optional `ValueOrState<ThemeColor>`, default "primary".
|
|
13
|
+
* @example { abbr: "HTML", title: "HyperText Markup Language", $: [abbreviation({ accentColor: "primary" })] }
|
|
14
|
+
*/
|
|
6
15
|
declare function abbreviation(props?: {
|
|
7
16
|
color?: ValueOrState<ThemeColor>;
|
|
8
17
|
accentColor?: ValueOrState<ThemeColor>;
|
|
9
18
|
}): PartialElement;
|
|
10
19
|
|
|
11
|
-
|
|
20
|
+
/**
|
|
21
|
+
* A semantic alert surface block with a colored inset bar, padding, and
|
|
22
|
+
* `role="alert"`. Typically applied to a `<div>` (any block container).
|
|
23
|
+
*
|
|
24
|
+
* @param props.color - Surface/accent color tone. Optional `ValueOrState<ThemeColor>`, default "primary".
|
|
25
|
+
* @example { div: "Saved successfully", $: [alert({ color: "success" })] }
|
|
26
|
+
*/
|
|
27
|
+
declare function alert(props?: {
|
|
12
28
|
color?: ValueOrState<ThemeColor>;
|
|
13
29
|
}): PartialElement;
|
|
14
30
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
31
|
+
/**
|
|
32
|
+
* A circular avatar container that centers initials/text and cover-fits any
|
|
33
|
+
* child `<img>`. Typically applied to an inline-flex container such as a `<span>`.
|
|
34
|
+
*
|
|
35
|
+
* @param props.color - Background/foreground color tone. Optional `ValueOrState<ThemeColor>`, default "primary".
|
|
36
|
+
* @example { span: "JD", $: [avatar({ color: "primary" })] }
|
|
37
|
+
*/
|
|
38
|
+
declare function avatar(props?: {
|
|
39
|
+
color?: ValueOrState<ThemeColor>;
|
|
20
40
|
}): PartialElement;
|
|
21
|
-
declare function splitterPanel(): PartialElement;
|
|
22
|
-
declare function splitterHandle(): PartialElement;
|
|
23
41
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Renders a small count/label bubble pinned to the top-right corner of its host
|
|
44
|
+
* (via a `::after` pseudo-element). Typically applied to an inline container such
|
|
45
|
+
* as a `<span>` wrapping an icon or element.
|
|
46
|
+
*
|
|
47
|
+
* @param props.color - Badge color tone. Optional `ValueOrState<ThemeColor>`, default "danger".
|
|
48
|
+
* @param props.label - Text/number shown in the badge. Optional `ValueOrState<string | number>`, default 999.
|
|
49
|
+
* @example { span: "🔔", $: [badge({ label: 3, color: "danger" })] }
|
|
50
|
+
*/
|
|
51
|
+
declare function badge(props?: {
|
|
52
|
+
color?: ValueOrState<ThemeColor>;
|
|
53
|
+
label?: ValueOrState<string | number>;
|
|
32
54
|
}): PartialElement;
|
|
33
55
|
|
|
34
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Styles a quotation block with a colored inset side bar, padded surface, and
|
|
58
|
+
* shifted tone. Apply to a `<blockquote>` element.
|
|
59
|
+
*
|
|
60
|
+
* @hostTag blockquote
|
|
61
|
+
* @param props.color - Surface/bar color tone. Optional `ValueOrState<ThemeColor>`, default "inherit".
|
|
62
|
+
* @example { blockquote: "Design is how it works.", $: [blockquote({ color: "primary" })] }
|
|
63
|
+
*/
|
|
64
|
+
declare function blockquote(props?: {
|
|
35
65
|
color?: ValueOrState<ThemeColor>;
|
|
36
|
-
accentColor?: ValueOrState<ThemeColor>;
|
|
37
66
|
}): PartialElement;
|
|
38
67
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
68
|
+
/**
|
|
69
|
+
* A horizontal breadcrumb navigation that lays out its children with a
|
|
70
|
+
* separator between items and highlights the `[aria-current=page]` item.
|
|
71
|
+
* Apply to a `<nav>` element.
|
|
72
|
+
*
|
|
73
|
+
* @hostTag nav
|
|
74
|
+
* @param props.color - Color tone for links/separators. Optional `ValueOrState<ThemeColor>`, default "neutral".
|
|
75
|
+
* @param props.separator - String inserted between items via `::after`. Optional `string`, default "/".
|
|
76
|
+
* @example { nav: null, $: [breadcrumb({ separator: "›" })] }
|
|
77
|
+
*/
|
|
78
|
+
declare function breadcrumb(props?: {
|
|
79
|
+
color?: ValueOrState<ThemeColor>;
|
|
80
|
+
separator?: string;
|
|
43
81
|
}): PartialElement;
|
|
44
82
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
83
|
+
/**
|
|
84
|
+
* An ellipsis trigger button for collapsed breadcrumb items, with hover and
|
|
85
|
+
* focus-visible states. Apply to a `<button>` element.
|
|
86
|
+
*
|
|
87
|
+
* @hostTag button
|
|
88
|
+
* @param props.color - Color tone for the trigger. Optional `ValueOrState<ThemeColor>`, default "neutral".
|
|
89
|
+
* @example { button: "…", $: [breadcrumbEllipsis({ color: "neutral" })] }
|
|
90
|
+
*/
|
|
91
|
+
declare function breadcrumbEllipsis(props?: {
|
|
48
92
|
color?: ValueOrState<ThemeColor>;
|
|
49
93
|
}): PartialElement;
|
|
50
94
|
|
|
51
|
-
|
|
95
|
+
/**
|
|
96
|
+
* A themed button control with density-aware padding/radius and hover, focus-visible,
|
|
97
|
+
* `[disabled]`, and `[aria-busy=true]` states. Apply to a `<button>` element.
|
|
98
|
+
*
|
|
99
|
+
* @hostTag button
|
|
100
|
+
* @param props.color - Button color tone. Optional `ValueOrState<ThemeColor>`, default "primary".
|
|
101
|
+
* @example { button: "Save", $: [button({ color: "primary" })] }
|
|
102
|
+
*/
|
|
103
|
+
declare function button(props?: {
|
|
52
104
|
color?: ValueOrState<ThemeColor>;
|
|
53
105
|
}): PartialElement;
|
|
54
106
|
|
|
55
|
-
|
|
107
|
+
/**
|
|
108
|
+
* A pill-shaped toggle switch with `role="switch"`; clicking flips the bound
|
|
109
|
+
* `checked` state and slides the thumb. Apply to a `<button>` element.
|
|
110
|
+
*
|
|
111
|
+
* @hostTag button
|
|
112
|
+
* @param props.checked - Toggle state. Optional `ValueOrState<boolean>`, default false.
|
|
113
|
+
* @param props.accentColor - Color tone when checked (on). Optional `ValueOrState<ThemeColor>`, default "primary".
|
|
114
|
+
* @param props.color - Color tone when unchecked (off track). Optional `ValueOrState<ThemeColor>`, default "neutral".
|
|
115
|
+
* @example { button: { span: null }, $: [buttonSwitch({ checked: true })] }
|
|
116
|
+
*/
|
|
117
|
+
declare function buttonSwitch(props?: {
|
|
118
|
+
checked?: ValueOrState<boolean>;
|
|
119
|
+
accentColor?: ValueOrState<ThemeColor>;
|
|
56
120
|
color?: ValueOrState<ThemeColor>;
|
|
57
|
-
label?: ValueOrState<string | number>;
|
|
58
121
|
}): PartialElement;
|
|
59
122
|
|
|
60
|
-
|
|
123
|
+
/**
|
|
124
|
+
* A grid-based card surface that auto-places known child elements into named
|
|
125
|
+
* regions: `<img>` (image), headings (title), `<p>` (description), `<aside>`
|
|
126
|
+
* (aside), `<div>` (content), and `<footer>` (footer). Typically applied to a
|
|
127
|
+
* `<div>` (any block container).
|
|
128
|
+
*
|
|
129
|
+
* @param props.color - Surface/border color tone. Optional `ValueOrState<ThemeColor>`, default "neutral".
|
|
130
|
+
* @example { div: { h3: "Title", p: "Body" }, $: [card({ color: "neutral" })] }
|
|
131
|
+
*/
|
|
132
|
+
declare function card(props?: {
|
|
61
133
|
color?: ValueOrState<ThemeColor>;
|
|
62
|
-
separator?: string;
|
|
63
134
|
}): PartialElement;
|
|
64
135
|
|
|
65
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Styles an inline code snippet with a subtle surface background, rounded corners,
|
|
138
|
+
* and shifted tone. Apply to a `<code>` element.
|
|
139
|
+
*
|
|
140
|
+
* @hostTag code
|
|
141
|
+
* @param props.color - Surface/text color tone. Optional `ValueOrState<ThemeColor>`, default "neutral".
|
|
142
|
+
* @example { code: "npm install", $: [code({ color: "neutral" })] }
|
|
143
|
+
*/
|
|
144
|
+
declare function code(props?: {
|
|
66
145
|
color?: ValueOrState<ThemeColor>;
|
|
67
146
|
}): PartialElement;
|
|
68
147
|
|
|
148
|
+
/**
|
|
149
|
+
* A combobox/multi-select control: renders selected options as removable tags
|
|
150
|
+
* plus an input, and shows a floating popover (`content`) anchored to the host.
|
|
151
|
+
* Apply to a `<div>` element.
|
|
152
|
+
*
|
|
153
|
+
* @hostTag div
|
|
154
|
+
* @param props.multiple - Allow selecting multiple values (popover stays open on click). Optional `boolean`, default false.
|
|
155
|
+
* @param props.value - Selected value(s). Optional `ValueOrState<Array<number | string | null | undefined> | number | string | null | undefined>`, no default.
|
|
156
|
+
* @param props.options - Available `{ label, value }` options used to render selected tags. Optional `Array<{ label: string; value: string }>`, default `[]`.
|
|
157
|
+
* @param props.placement - Floating popover placement. Optional `ValueOrState<Placement>`, default "bottom".
|
|
158
|
+
* @param props.content - The floating popover content element. Required `DomphyElement`.
|
|
159
|
+
* @param props.color - Color tone for the control. Optional `ThemeColor`, default "neutral".
|
|
160
|
+
* @param props.open - Whether the popover is open. Optional `ValueOrState<boolean>`, default false.
|
|
161
|
+
* @param props.input - Custom input element; when omitted a default `<input>` is created. Optional `DomphyElement`.
|
|
162
|
+
* @example { div: null, $: [combobox({ options: [{ label: "A", value: "a" }], content: { div: null } })] }
|
|
163
|
+
*/
|
|
69
164
|
declare function combobox(props: {
|
|
70
165
|
multiple?: boolean;
|
|
71
166
|
value?: ValueOrState<Array<number | string | null | undefined> | number | string | null | undefined>;
|
|
@@ -80,210 +175,715 @@ declare function combobox(props: {
|
|
|
80
175
|
input?: DomphyElement;
|
|
81
176
|
}): PartialElement;
|
|
82
177
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
178
|
+
/**
|
|
179
|
+
* Command-palette container patch. Sets up a vertical flex column and provides a
|
|
180
|
+
* shared `command` context (a query State) consumed by `commandSearch` and
|
|
181
|
+
* `commandItem` descendants to filter the list. Typically applied to a `<div>`.
|
|
182
|
+
*
|
|
183
|
+
* @example { div: [...], $: [command()] }
|
|
184
|
+
*/
|
|
185
|
+
declare function command(): PartialElement;
|
|
186
|
+
/**
|
|
187
|
+
* Search input for a command palette. Wires the input's value into the parent
|
|
188
|
+
* `command` context's query State so descendant `commandItem`s filter live.
|
|
189
|
+
* Apply to an `<input>` element used inside a `command()`.
|
|
190
|
+
*
|
|
191
|
+
* @hostTag input
|
|
192
|
+
* @param props.color - Base theme color tone. Defaults to "neutral".
|
|
193
|
+
* @param props.accentColor - Accent color used for the focus border. Defaults to "primary".
|
|
194
|
+
* @example { input: "", $: [commandSearch({ accentColor: "primary" })] }
|
|
195
|
+
*/
|
|
196
|
+
declare function commandSearch(props?: {
|
|
86
197
|
color?: ThemeColor;
|
|
87
|
-
|
|
88
|
-
}): PartialElement;
|
|
89
|
-
|
|
90
|
-
declare function blockquote(props?: {
|
|
91
|
-
color?: ValueOrState<ThemeColor>;
|
|
198
|
+
accentColor?: ThemeColor;
|
|
92
199
|
}): PartialElement;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
200
|
+
/**
|
|
201
|
+
* Selectable item (`role="option"`) in a command palette. Subscribes to the
|
|
202
|
+
* parent `command` context's query State and hides itself when its text content
|
|
203
|
+
* does not match the current query. Typically applied to a `<button>` (or any
|
|
204
|
+
* clickable element) used inside a `command()`.
|
|
205
|
+
*
|
|
206
|
+
* @param props.color - Base theme color tone. Defaults to "neutral".
|
|
207
|
+
* @param props.accentColor - Accent color used for the focus outline. Defaults to "primary".
|
|
208
|
+
* @example { button: "Open file", $: [commandItem({ color: "neutral" })] }
|
|
209
|
+
*/
|
|
210
|
+
declare function commandItem(props?: {
|
|
211
|
+
color?: ThemeColor;
|
|
212
|
+
accentColor?: ThemeColor;
|
|
96
213
|
}): PartialElement;
|
|
97
214
|
|
|
98
|
-
|
|
99
|
-
|
|
215
|
+
/** A single date selection, or a `[start, end]` tuple in range mode. */
|
|
216
|
+
type DatePickerValue = Date | null | [Date | null, Date | null];
|
|
217
|
+
interface DatePickerProps {
|
|
218
|
+
/** Controlled value: a `Date` in single mode, a `[start, end]` tuple in range mode. */
|
|
219
|
+
value?: ValueOrState<DatePickerValue>;
|
|
220
|
+
/** Selection mode. */
|
|
221
|
+
mode?: "single" | "range";
|
|
222
|
+
/** Also pick hour + minute. The chosen time applies to the selected date(s). */
|
|
223
|
+
time?: boolean;
|
|
224
|
+
/** Earliest selectable day (inclusive). */
|
|
225
|
+
min?: Date;
|
|
226
|
+
/** Latest selectable day (inclusive). */
|
|
227
|
+
max?: Date;
|
|
228
|
+
/** Disable arbitrary days. */
|
|
229
|
+
disabledDate?: (date: Date) => boolean;
|
|
230
|
+
/** BCP-47 locale for month/weekday names, first-day-of-week, and formatting. */
|
|
231
|
+
locale?: string;
|
|
232
|
+
/** Override the first day of the week (0 = Sunday … 6 = Saturday). */
|
|
233
|
+
weekStartsOn?: number;
|
|
234
|
+
/** Override the input display string. */
|
|
235
|
+
format?: (value: DatePickerValue) => string;
|
|
236
|
+
/** Called whenever the selection changes. */
|
|
237
|
+
onChange?: (value: DatePickerValue) => void;
|
|
238
|
+
/** Accent color for the selected/active days. */
|
|
100
239
|
accentColor?: ValueOrState<ThemeColor>;
|
|
101
|
-
|
|
240
|
+
/** Popover placement relative to the input. */
|
|
241
|
+
placement?: ValueOrState<Placement$1>;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* A native, themeable date picker patch for an `<input>`. Opens a calendar
|
|
245
|
+
* popover (rendered with Domphy elements, positioned via `@domphy/floating`)
|
|
246
|
+
* supporting single/range selection, optional time, min/max + disabled days,
|
|
247
|
+
* localized names, and keyboard navigation. The input is read-only and shows the
|
|
248
|
+
* formatted selection; compose with `inputText()` for the input's look.
|
|
249
|
+
*
|
|
250
|
+
* @hostTag input
|
|
251
|
+
* @param props.value - Controlled value (`ValueOrState<DatePickerValue>`): a `Date`/`null` in single mode, a `[start, end]` tuple in range mode.
|
|
252
|
+
* @param props.mode - Selection mode, "single" | "range". Defaults to "single".
|
|
253
|
+
* @param props.time - When true, also pick hour + minute (applied to the selected date(s)). Defaults to false.
|
|
254
|
+
* @param props.min - Earliest selectable day (inclusive), a `Date`.
|
|
255
|
+
* @param props.max - Latest selectable day (inclusive), a `Date`.
|
|
256
|
+
* @param props.disabledDate - Predicate `(date: Date) => boolean` to disable arbitrary days.
|
|
257
|
+
* @param props.locale - BCP-47 locale for names/first-day-of-week/formatting. Defaults to `navigator.language` (or "en-US" in non-browser).
|
|
258
|
+
* @param props.weekStartsOn - Override first day of week (0 = Sunday … 6 = Saturday). Defaults to the locale's first day.
|
|
259
|
+
* @param props.format - Override the input display string, `(value: DatePickerValue) => string`.
|
|
260
|
+
* @param props.onChange - Called with the new value whenever the selection changes, `(value: DatePickerValue) => void`.
|
|
261
|
+
* @param props.accentColor - Accent color (`ValueOrState<ThemeColor>`) for selected/active days. Defaults to "primary".
|
|
262
|
+
* @param props.placement - Popover placement (`ValueOrState<Placement>`) relative to the input. Defaults to "bottom-start".
|
|
263
|
+
* @example { input: "", $: [inputText(), datePicker({ mode: "range" })] }
|
|
264
|
+
*/
|
|
265
|
+
declare function datePicker(props?: DatePickerProps): PartialElement;
|
|
102
266
|
|
|
103
|
-
|
|
267
|
+
/**
|
|
268
|
+
* Styles a description list as a two-column grid (terms in the first column,
|
|
269
|
+
* descriptions in the second), theming the nested `<dt>`/`<dd>` elements.
|
|
270
|
+
* Apply to a `<dl>` element.
|
|
271
|
+
*
|
|
272
|
+
* @hostTag dl
|
|
273
|
+
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the term/description text. Defaults to "neutral".
|
|
274
|
+
* @example { dl: [{ dt: "Name" }, { dd: "Domphy" }], $: [descriptionList()] }
|
|
275
|
+
*/
|
|
276
|
+
declare function descriptionList(props?: {
|
|
104
277
|
color?: ValueOrState<ThemeColor>;
|
|
105
278
|
}): PartialElement;
|
|
106
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Styles a native disclosure widget: a themed `<summary>` header with an
|
|
282
|
+
* animated rotating chevron and an expand/collapse transition on the body
|
|
283
|
+
* content. Apply to a `<details>` element.
|
|
284
|
+
*
|
|
285
|
+
* @hostTag details
|
|
286
|
+
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the body/summary. Defaults to "neutral".
|
|
287
|
+
* @param props.accentColor - Accent color (`ValueOrState<ThemeColor>`) for the summary's focus outline. Defaults to "primary".
|
|
288
|
+
* @param props.duration - Open/close transition duration in milliseconds. Defaults to 240.
|
|
289
|
+
* @example { details: [{ summary: "More" }, { div: "Body" }], $: [details()] }
|
|
290
|
+
*/
|
|
107
291
|
declare function details(props?: {
|
|
108
292
|
color?: ValueOrState<ThemeColor>;
|
|
109
293
|
accentColor?: ValueOrState<ThemeColor>;
|
|
110
294
|
duration?: number;
|
|
111
295
|
}): PartialElement;
|
|
112
296
|
|
|
113
|
-
|
|
297
|
+
/**
|
|
298
|
+
* Modal dialog patch driven by an `open` State. Calls `showModal()`/`close()`,
|
|
299
|
+
* fades via opacity, locks page scroll while open, focuses the first focusable
|
|
300
|
+
* child, and closes on outside (backdrop) click. Apply to a `<dialog>` element.
|
|
301
|
+
*
|
|
302
|
+
* @hostTag dialog
|
|
303
|
+
* @param props.color - Theme color tone for the dialog surface. Defaults to "neutral".
|
|
304
|
+
* @param props.open - Open state (`ValueOrState<boolean>`); set it to true/false to show/hide. Defaults to false.
|
|
305
|
+
* @example { dialog: [...], $: [dialog({ open })] }
|
|
306
|
+
*/
|
|
307
|
+
declare function dialog(props?: {
|
|
308
|
+
color?: ThemeColor;
|
|
309
|
+
open?: ValueOrState<boolean>;
|
|
310
|
+
}): PartialElement;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* A horizontal separator (`role="separator"`) with a line on each side of its
|
|
314
|
+
* content, suitable for labelled dividers ("or"). Apply to a `<div>` element.
|
|
315
|
+
*
|
|
316
|
+
* @hostTag div
|
|
317
|
+
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the label text and rules. Defaults to "neutral".
|
|
318
|
+
* @example { div: "or", $: [divider()] }
|
|
319
|
+
*/
|
|
320
|
+
declare function divider(props?: {
|
|
114
321
|
color?: ValueOrState<ThemeColor>;
|
|
115
322
|
}): PartialElement;
|
|
116
323
|
|
|
117
|
-
|
|
324
|
+
type Placement = "left" | "right" | "top" | "bottom";
|
|
325
|
+
/**
|
|
326
|
+
* Edge-anchored modal drawer driven by an `open` State. Slides in/out from a
|
|
327
|
+
* chosen edge via a transform transition, calls `showModal()`/`close()`, locks
|
|
328
|
+
* page scroll while open, and closes on backdrop click. Apply to a `<dialog>`
|
|
329
|
+
* element.
|
|
330
|
+
*
|
|
331
|
+
* @hostTag dialog
|
|
332
|
+
* @param props.color - Theme color tone for the drawer surface. Defaults to "neutral".
|
|
333
|
+
* @param props.open - Open state (`ValueOrState<boolean>`); set true/false to show/hide. Defaults to false.
|
|
334
|
+
* @param props.placement - Edge to anchor to, "left" | "right" | "top" | "bottom". Defaults to "right".
|
|
335
|
+
* @param props.size - CSS length for the drawer's width (left/right) or height (top/bottom). Defaults to themeSpacing(80) for left/right, themeSpacing(64) for top/bottom.
|
|
336
|
+
* @example { dialog: [...], $: [drawer({ open, placement: "left" })] }
|
|
337
|
+
*/
|
|
338
|
+
declare function drawer(props?: {
|
|
118
339
|
color?: ThemeColor;
|
|
119
340
|
open?: ValueOrState<boolean>;
|
|
341
|
+
placement?: Placement;
|
|
342
|
+
size?: string;
|
|
120
343
|
}): PartialElement;
|
|
121
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Italic emphasized inline text. Apply to an `<em>` element.
|
|
347
|
+
*
|
|
348
|
+
* @hostTag em
|
|
349
|
+
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the text. Defaults to "neutral".
|
|
350
|
+
* @example { em: "important", $: [emphasis()] }
|
|
351
|
+
*/
|
|
122
352
|
declare function emphasis(props?: {
|
|
123
353
|
color?: ValueOrState<ThemeColor>;
|
|
124
354
|
}): PartialElement;
|
|
125
355
|
|
|
356
|
+
/**
|
|
357
|
+
* Lays out a figure as a column with block-level media (img/svg/video/canvas)
|
|
358
|
+
* and a themed `<figcaption>`. Apply to a `<figure>` element.
|
|
359
|
+
*
|
|
360
|
+
* @hostTag figure
|
|
361
|
+
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the figure/caption text. Defaults to "neutral".
|
|
362
|
+
* @example { figure: [{ img: "", src }, { figcaption: "A caption" }], $: [figure()] }
|
|
363
|
+
*/
|
|
126
364
|
declare function figure(props?: {
|
|
127
365
|
color?: ValueOrState<ThemeColor>;
|
|
128
366
|
}): PartialElement;
|
|
129
367
|
|
|
368
|
+
/**
|
|
369
|
+
* Layout patch for a group of form fields. Arranges a `<legend>`, `<label>`s,
|
|
370
|
+
* controls, and helper `<p>`s in a grid — labels beside controls (horizontal)
|
|
371
|
+
* or stacked above them (vertical). Apply to a `<fieldset>` element.
|
|
372
|
+
*
|
|
373
|
+
* @hostTag fieldset
|
|
374
|
+
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for legend/text/surface. Defaults to "neutral".
|
|
375
|
+
* @param props.layout - Field arrangement, "horizontal" (label beside control) | "vertical" (label above). Defaults to "horizontal".
|
|
376
|
+
* @example { fieldset: [{ legend: "Profile" }, { label: "Name" }, { input: "" }], $: [formGroup({ layout: "vertical" })] }
|
|
377
|
+
*/
|
|
130
378
|
declare function formGroup(props?: {
|
|
131
379
|
color?: ValueOrState<ThemeColor>;
|
|
132
380
|
layout?: "horizontal" | "vertical";
|
|
133
381
|
}): PartialElement;
|
|
134
382
|
|
|
383
|
+
/**
|
|
384
|
+
* Styles a heading, scaling its font size by level (h1 largest … h6 smallest)
|
|
385
|
+
* relative to the theme base size. Apply to a heading element `<h1>`–`<h6>`.
|
|
386
|
+
*
|
|
387
|
+
* @hostTag h1
|
|
388
|
+
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the heading text. Defaults to "neutral".
|
|
389
|
+
* @example { h2: "Section title", $: [heading()] }
|
|
390
|
+
*/
|
|
135
391
|
declare function heading(props?: {
|
|
136
392
|
color?: ValueOrState<ThemeColor>;
|
|
137
393
|
}): PartialElement;
|
|
138
394
|
|
|
395
|
+
/**
|
|
396
|
+
* A thematic break rendered as a thin 1px themed line with vertical margin.
|
|
397
|
+
* Apply to an `<hr>` element.
|
|
398
|
+
*
|
|
399
|
+
* @hostTag hr
|
|
400
|
+
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the rule. Defaults to "neutral".
|
|
401
|
+
* @example { hr: "", $: [horizontalRule()] }
|
|
402
|
+
*/
|
|
139
403
|
declare function horizontalRule(props?: {
|
|
140
404
|
color?: ValueOrState<ThemeColor>;
|
|
141
405
|
}): PartialElement;
|
|
142
406
|
|
|
407
|
+
/**
|
|
408
|
+
* Styles an inline icon container: square box that centers its content and
|
|
409
|
+
* applies the themed icon color. Apply to a `<span>` element.
|
|
410
|
+
*
|
|
411
|
+
* @hostTag span
|
|
412
|
+
* @param props.color - Optional theme color tone for the icon (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
413
|
+
* @example { span: null, $: [icon()] }
|
|
414
|
+
*/
|
|
415
|
+
declare function icon(props?: {
|
|
416
|
+
color?: ValueOrState<ThemeColor>;
|
|
417
|
+
}): PartialElement;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Styles a responsive image: full-width, cover-fit, rounded corners with a
|
|
421
|
+
* themed placeholder background. Apply to an `<img>` element.
|
|
422
|
+
*
|
|
423
|
+
* @hostTag img
|
|
424
|
+
* @param props.color - Optional theme color tone for the placeholder background (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
425
|
+
* @example { img: null, src: "photo.jpg", alt: "Photo", $: [image()] }
|
|
426
|
+
*/
|
|
143
427
|
declare function image(props?: {
|
|
144
428
|
color?: ValueOrState<ThemeColor>;
|
|
145
429
|
}): PartialElement;
|
|
146
430
|
|
|
147
|
-
|
|
431
|
+
/**
|
|
432
|
+
* Styles a custom checkbox with themed box, check mark, indeterminate state,
|
|
433
|
+
* hover, focus and disabled styling. Apply to an `<input>` element of
|
|
434
|
+
* type `checkbox` (the patch sets `type: "checkbox"`).
|
|
435
|
+
*
|
|
436
|
+
* @hostTag input
|
|
437
|
+
* @param props.color - Optional theme color tone for the box/border (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
438
|
+
* @param props.accentColor - Optional theme color tone for the checked/indeterminate fill and focus ring (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
439
|
+
* @example { input: null, type: "checkbox", $: [inputCheckbox()] }
|
|
440
|
+
*/
|
|
441
|
+
declare function inputCheckbox(props?: {
|
|
148
442
|
color?: ValueOrState<ThemeColor>;
|
|
443
|
+
accentColor?: ValueOrState<ThemeColor>;
|
|
149
444
|
}): PartialElement;
|
|
150
445
|
|
|
446
|
+
/**
|
|
447
|
+
* Styles a native color picker swatch with themed padding, rounded swatch and
|
|
448
|
+
* disabled styling. Apply to an `<input>` element of type `color` (the patch
|
|
449
|
+
* sets `type: "color"`).
|
|
450
|
+
*
|
|
451
|
+
* @hostTag input
|
|
452
|
+
* @param props.color - Optional theme color tone used for the disabled state (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
453
|
+
* @param props.accentColor - Optional theme color tone (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
454
|
+
* @example { input: null, type: "color", $: [inputColor()] }
|
|
455
|
+
*/
|
|
151
456
|
declare function inputColor(props?: {
|
|
152
457
|
color?: ValueOrState<ThemeColor>;
|
|
153
458
|
accentColor?: ValueOrState<ThemeColor>;
|
|
154
459
|
}): PartialElement;
|
|
155
460
|
|
|
156
461
|
type InputDateTimeMode = "date" | "time" | "week" | "month" | "datetime-local";
|
|
462
|
+
/**
|
|
463
|
+
* Styles a native date/time input with themed border, padding, hover, focus,
|
|
464
|
+
* invalid and disabled states. The `mode` selects the input `type`. Apply to
|
|
465
|
+
* an `<input>` element (the patch sets `type` to the chosen `mode`).
|
|
466
|
+
*
|
|
467
|
+
* @hostTag input
|
|
468
|
+
* @param props.mode - Input mode selecting the host `type`: `"date" | "time" | "week" | "month" | "datetime-local"`. Defaults to `"datetime-local"`.
|
|
469
|
+
* @param props.color - Optional theme color tone for text/border (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
470
|
+
* @param props.accentColor - Optional theme color tone for the hover/focus ring (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
471
|
+
* @example { input: null, type: "datetime-local", $: [inputDateTime()] }
|
|
472
|
+
*/
|
|
157
473
|
declare function inputDateTime(props?: {
|
|
158
474
|
mode?: InputDateTimeMode;
|
|
159
475
|
color?: ValueOrState<ThemeColor>;
|
|
160
476
|
accentColor?: ValueOrState<ThemeColor>;
|
|
161
477
|
}): PartialElement;
|
|
162
478
|
|
|
163
|
-
/** A single date selection, or a `[start, end]` tuple in range mode. */
|
|
164
|
-
type DatePickerValue = Date | null | [Date | null, Date | null];
|
|
165
|
-
interface DatePickerProps {
|
|
166
|
-
/** Controlled value: a `Date` in single mode, a `[start, end]` tuple in range mode. */
|
|
167
|
-
value?: ValueOrState<DatePickerValue>;
|
|
168
|
-
/** Selection mode. */
|
|
169
|
-
mode?: "single" | "range";
|
|
170
|
-
/** Also pick hour + minute. The chosen time applies to the selected date(s). */
|
|
171
|
-
time?: boolean;
|
|
172
|
-
/** Earliest selectable day (inclusive). */
|
|
173
|
-
min?: Date;
|
|
174
|
-
/** Latest selectable day (inclusive). */
|
|
175
|
-
max?: Date;
|
|
176
|
-
/** Disable arbitrary days. */
|
|
177
|
-
disabledDate?: (date: Date) => boolean;
|
|
178
|
-
/** BCP-47 locale for month/weekday names, first-day-of-week, and formatting. */
|
|
179
|
-
locale?: string;
|
|
180
|
-
/** Override the first day of the week (0 = Sunday … 6 = Saturday). */
|
|
181
|
-
weekStartsOn?: number;
|
|
182
|
-
/** Override the input display string. */
|
|
183
|
-
format?: (value: DatePickerValue) => string;
|
|
184
|
-
/** Called whenever the selection changes. */
|
|
185
|
-
onChange?: (value: DatePickerValue) => void;
|
|
186
|
-
/** Accent color for the selected/active days. */
|
|
187
|
-
accentColor?: ValueOrState<ThemeColor>;
|
|
188
|
-
/** Popover placement relative to the input. */
|
|
189
|
-
placement?: ValueOrState<Placement$1>;
|
|
190
|
-
}
|
|
191
479
|
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
480
|
+
* Styles a native file input with a themed upload button, border, hover, focus
|
|
481
|
+
* and disabled states. Apply to an `<input>` element of type `file` (the patch
|
|
482
|
+
* sets `type: "file"`).
|
|
483
|
+
*
|
|
484
|
+
* @hostTag input
|
|
485
|
+
* @param props.color - Optional theme color tone for text/border and the upload button (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
486
|
+
* @param props.accentColor - Optional theme color tone for the hover/focus ring (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
487
|
+
* @example { input: null, type: "file", $: [inputFile()] }
|
|
197
488
|
*/
|
|
198
|
-
declare function datePicker(props?: DatePickerProps): PartialElement;
|
|
199
|
-
|
|
200
489
|
declare function inputFile(props?: {
|
|
201
490
|
color?: ValueOrState<ThemeColor>;
|
|
202
491
|
accentColor?: ValueOrState<ThemeColor>;
|
|
203
492
|
}): PartialElement;
|
|
204
493
|
|
|
205
|
-
|
|
494
|
+
/**
|
|
495
|
+
* Styles a native number input with themed border, padding, visible spin
|
|
496
|
+
* buttons, hover, focus and disabled states. Apply to an `<input>` element of
|
|
497
|
+
* type `number` (the patch sets `type: "number"`).
|
|
498
|
+
*
|
|
499
|
+
* @hostTag input
|
|
500
|
+
* @param props.color - Optional theme color tone for text/border (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
501
|
+
* @param props.accentColor - Optional theme color tone for the hover/focus ring (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
502
|
+
* @example { input: null, type: "number", $: [inputNumber()] }
|
|
503
|
+
*/
|
|
504
|
+
declare function inputNumber(props?: {
|
|
206
505
|
color?: ValueOrState<ThemeColor>;
|
|
207
506
|
accentColor?: ValueOrState<ThemeColor>;
|
|
208
507
|
}): PartialElement;
|
|
209
508
|
|
|
210
|
-
|
|
509
|
+
/**
|
|
510
|
+
* Lays out a one-time-password container as a horizontal row of inputs and
|
|
511
|
+
* wires keyboard navigation: auto-advance on input, backspace/arrow movement,
|
|
512
|
+
* and paste distribution across the child inputs. Apply to a container element
|
|
513
|
+
* (e.g. `<div>`) whose direct children are the OTP `<input>` boxes. Takes no
|
|
514
|
+
* props.
|
|
515
|
+
*
|
|
516
|
+
* @example { div: null, $: [inputOTP()], children: [{ input: null }, { input: null }] }
|
|
517
|
+
*/
|
|
518
|
+
declare function inputOTP(): PartialElement;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Styles a custom radio button with a themed circular box, checked dot, hover,
|
|
522
|
+
* focus and disabled states. Apply to an `<input>` element of type `radio`
|
|
523
|
+
* (the patch sets `type: "radio"`).
|
|
524
|
+
*
|
|
525
|
+
* @hostTag input
|
|
526
|
+
* @param props.color - Optional theme color tone for the box/border (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
527
|
+
* @param props.accentColor - Optional theme color tone for the checked dot and focus ring (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
528
|
+
* @example { input: null, type: "radio", $: [inputRadio()] }
|
|
529
|
+
*/
|
|
530
|
+
declare function inputRadio(props?: {
|
|
211
531
|
color?: ValueOrState<ThemeColor>;
|
|
212
532
|
accentColor?: ValueOrState<ThemeColor>;
|
|
213
533
|
}): PartialElement;
|
|
214
534
|
|
|
535
|
+
/**
|
|
536
|
+
* Styles a range slider with a themed track and thumb, hover, focus and
|
|
537
|
+
* disabled states. Apply to an `<input>` element of type `range` (the patch
|
|
538
|
+
* sets `type: "range"`).
|
|
539
|
+
*
|
|
540
|
+
* @hostTag input
|
|
541
|
+
* @param props.color - Optional theme color tone for the slider track (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
542
|
+
* @param props.accentColor - Optional theme color tone for the thumb and focus ring (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
543
|
+
* @example { input: null, type: "range", $: [inputRange()] }
|
|
544
|
+
*/
|
|
215
545
|
declare function inputRange(props?: {
|
|
216
546
|
color?: ValueOrState<ThemeColor>;
|
|
217
547
|
accentColor?: ValueOrState<ThemeColor>;
|
|
218
548
|
}): PartialElement;
|
|
219
549
|
|
|
220
|
-
|
|
550
|
+
/**
|
|
551
|
+
* Styles a search input with themed border, padding, placeholder color, native
|
|
552
|
+
* search decorations, hover, focus and disabled states. Apply to an `<input>`
|
|
553
|
+
* element of type `search` (the patch sets `type: "search"`).
|
|
554
|
+
*
|
|
555
|
+
* @hostTag input
|
|
556
|
+
* @param props.color - Optional theme color tone for text/border/placeholder (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
557
|
+
* @param props.accentColor - Optional theme color tone for the hover/focus ring (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
558
|
+
* @example { input: null, type: "search", $: [inputSearch()] }
|
|
559
|
+
*/
|
|
560
|
+
declare function inputSearch(props?: {
|
|
561
|
+
color?: ValueOrState<ThemeColor>;
|
|
562
|
+
accentColor?: ValueOrState<ThemeColor>;
|
|
563
|
+
}): PartialElement;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Styles a checkbox as a toggle switch: themed track and sliding knob that
|
|
567
|
+
* animates and recolors on checked, plus a disabled state. Apply to an
|
|
568
|
+
* `<input>` element of type `checkbox` (the patch sets `type: "checkbox"`).
|
|
569
|
+
*
|
|
570
|
+
* @hostTag input
|
|
571
|
+
* @param props.accentColor - Optional theme color tone for the checked track (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
572
|
+
* @example { input: null, type: "checkbox", $: [inputSwitch()] }
|
|
573
|
+
*/
|
|
574
|
+
declare function inputSwitch(props?: {
|
|
575
|
+
accentColor?: ValueOrState<ThemeColor>;
|
|
576
|
+
}): PartialElement;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Themed single-line text input primitive. Sets `type="text"` and styles the
|
|
580
|
+
* field with themed border, focus ring, placeholder, disabled and validation
|
|
581
|
+
* (`data-status`) states. Apply to an `<input>` element.
|
|
582
|
+
*
|
|
583
|
+
* @hostTag input
|
|
584
|
+
* @param props - Optional configuration.
|
|
585
|
+
* @param props.color - Base color tone for text/border/background. Defaults to `"neutral"`.
|
|
586
|
+
* @param props.accentColor - Accent color tone for the hover/focus outline. Defaults to `"primary"`.
|
|
587
|
+
* @example { input: "", type: "text", placeholder: "Name", $: [inputText()] }
|
|
588
|
+
*/
|
|
589
|
+
declare function inputText(props?: {
|
|
221
590
|
color?: ValueOrState<ThemeColor>;
|
|
222
591
|
accentColor?: ValueOrState<ThemeColor>;
|
|
223
592
|
}): PartialElement;
|
|
224
593
|
|
|
594
|
+
/**
|
|
595
|
+
* Renders keyboard-key styling (themed background, border and padding) for a
|
|
596
|
+
* keystroke hint. Apply to a `<kbd>` element.
|
|
597
|
+
*
|
|
598
|
+
* @hostTag kbd
|
|
599
|
+
* @param props - Optional configuration.
|
|
600
|
+
* @param props.color - Color tone for text/background/border. Defaults to `"neutral"`.
|
|
601
|
+
* @example { kbd: "Ctrl", $: [keyboard()] }
|
|
602
|
+
*/
|
|
225
603
|
declare function keyboard(props?: {
|
|
226
604
|
color?: ValueOrState<ThemeColor>;
|
|
227
605
|
}): PartialElement;
|
|
228
606
|
|
|
607
|
+
/**
|
|
608
|
+
* Themed form-label primitive: inline-flex layout with gap, themed text color,
|
|
609
|
+
* focus-within highlighting and a disabled (`aria-disabled`) state. Apply to a
|
|
610
|
+
* `<label>` element.
|
|
611
|
+
*
|
|
612
|
+
* @hostTag label
|
|
613
|
+
* @param props - Optional configuration.
|
|
614
|
+
* @param props.color - Base color tone for the label text. Defaults to `"neutral"`.
|
|
615
|
+
* @param props.accentColor - Accent color tone applied on focus-within. Defaults to `"primary"`.
|
|
616
|
+
* @example { label: "Email", htmlFor: "email", $: [label()] }
|
|
617
|
+
*/
|
|
229
618
|
declare function label(props?: {
|
|
230
619
|
color?: ValueOrState<ThemeColor>;
|
|
231
620
|
accentColor?: ValueOrState<ThemeColor>;
|
|
232
621
|
}): PartialElement;
|
|
233
622
|
|
|
623
|
+
/**
|
|
624
|
+
* Themed hyperlink primitive: styles text color, hover underline, visited,
|
|
625
|
+
* focus ring and a disabled state. Apply to an `<a>` element.
|
|
626
|
+
*
|
|
627
|
+
* @hostTag a
|
|
628
|
+
* @param props - Optional configuration.
|
|
629
|
+
* @param props.color - Base color tone for the link text. Defaults to `"primary"`.
|
|
630
|
+
* @param props.accentColor - Accent color tone for visited/focus states. Defaults to `"secondary"`.
|
|
631
|
+
* @example { a: "Home", href: "/", $: [link()] }
|
|
632
|
+
*/
|
|
234
633
|
declare function link(props?: {
|
|
235
634
|
color?: ValueOrState<ThemeColor>;
|
|
236
635
|
accentColor?: ValueOrState<ThemeColor>;
|
|
237
636
|
}): PartialElement;
|
|
238
637
|
|
|
638
|
+
/**
|
|
639
|
+
* Themed highlight primitive: gives marked/highlighted inline text a tinted
|
|
640
|
+
* background, rounded corners and padding. Apply to a `<mark>` element.
|
|
641
|
+
*
|
|
642
|
+
* @hostTag mark
|
|
643
|
+
* @param props - Optional configuration.
|
|
644
|
+
* @param props.accentColor - Accent color tone for the highlight fill and text. Defaults to `"highlight"`.
|
|
645
|
+
* @example { mark: "important", $: [mark()] }
|
|
646
|
+
*/
|
|
239
647
|
declare function mark(props?: {
|
|
240
648
|
accentColor?: ValueOrState<ThemeColor>;
|
|
241
649
|
}): PartialElement;
|
|
242
650
|
|
|
243
|
-
|
|
244
|
-
|
|
651
|
+
/**
|
|
652
|
+
* Themed menu container that provides selection context (`activeKey`,
|
|
653
|
+
* `selectable`) to child `menuItem` patches and lays them out vertically.
|
|
654
|
+
* Sets `role="menu"`. Typically applied to a container element such as a
|
|
655
|
+
* `<div>` or `<ul>`.
|
|
656
|
+
*
|
|
657
|
+
* @param props - Optional configuration.
|
|
658
|
+
* @param props.activeKey - Currently selected item key, accepts a value or `State`. Defaults to `null`.
|
|
659
|
+
* @param props.selectable - Whether items track and update the active selection. Defaults to `true`.
|
|
660
|
+
* @param props.color - Background color tone for the menu. Defaults to `"neutral"`.
|
|
661
|
+
* @example { div: "", $: [menu({ activeKey: 0 })] }
|
|
662
|
+
*/
|
|
663
|
+
declare function menu(props?: {
|
|
664
|
+
activeKey?: ValueOrState<number | string>;
|
|
665
|
+
selectable?: boolean;
|
|
666
|
+
color?: ThemeColor;
|
|
245
667
|
}): PartialElement;
|
|
246
668
|
|
|
247
|
-
|
|
248
|
-
|
|
669
|
+
/**
|
|
670
|
+
* Themed menu entry for use inside a `menu`. Sets `role="menuitem"`, wires
|
|
671
|
+
* click/keyboard selection (Enter/Space activate; Arrow/Home/End move focus),
|
|
672
|
+
* and reflects the active item via `aria-current`. Apply to a `<button>`
|
|
673
|
+
* element placed within a `menu`.
|
|
674
|
+
*
|
|
675
|
+
* @hostTag button
|
|
676
|
+
* @param props - Optional configuration.
|
|
677
|
+
* @param props.accentColor - Accent color tone for the active/focus indicator. Defaults to `"primary"`.
|
|
678
|
+
* @param props.color - Base color tone for the item. Defaults to `"neutral"`.
|
|
679
|
+
* @example { button: "Profile", $: [menuItem()] }
|
|
680
|
+
*/
|
|
681
|
+
declare function menuItem(props?: {
|
|
682
|
+
accentColor?: ThemeColor;
|
|
683
|
+
color?: ThemeColor;
|
|
249
684
|
}): PartialElement;
|
|
250
685
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
686
|
+
/**
|
|
687
|
+
* One keyframe. Shorthands `x`/`y` (px), `scale`, `rotate` (deg) compose into a
|
|
688
|
+
* single `transform`; any other key is a raw CSS property (e.g. `opacity`,
|
|
689
|
+
* `backgroundColor`).
|
|
690
|
+
*/
|
|
691
|
+
type MotionKeyframe = {
|
|
692
|
+
x?: number | string;
|
|
693
|
+
y?: number | string;
|
|
694
|
+
scale?: number | string;
|
|
695
|
+
rotate?: number | string;
|
|
696
|
+
} & Record<string, string | number>;
|
|
697
|
+
interface MotionProps {
|
|
698
|
+
/** Starting keyframe applied before the enter animation. */
|
|
699
|
+
initial?: MotionKeyframe;
|
|
700
|
+
/** Target keyframe. Pass a `State` to re-animate whenever it changes. */
|
|
701
|
+
animate?: MotionKeyframe | State<MotionKeyframe>;
|
|
702
|
+
/** Keyframe animated to before the element is removed. */
|
|
703
|
+
exit?: MotionKeyframe;
|
|
704
|
+
transition?: {
|
|
705
|
+
/** ms, default 300. */
|
|
706
|
+
duration?: number;
|
|
707
|
+
/** ms, default 0. */
|
|
708
|
+
delay?: number;
|
|
709
|
+
/** CSS easing, default "ease". */
|
|
710
|
+
easing?: string;
|
|
711
|
+
iterations?: number;
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Animation primitive driven by the Web Animations API. Runs an enter
|
|
716
|
+
* animation on mount (`initial` -> `animate`), re-animates whenever `animate`
|
|
717
|
+
* is a `State` that changes, and plays the `exit` keyframe before removal.
|
|
718
|
+
* Has no host-tag restriction; apply to any element you want to animate.
|
|
719
|
+
*
|
|
720
|
+
* @param props - Optional configuration (see {@link MotionProps}).
|
|
721
|
+
* @param props.initial - Starting keyframe applied before the enter animation.
|
|
722
|
+
* @param props.animate - Target keyframe, or a `State` to re-animate on change.
|
|
723
|
+
* @param props.exit - Keyframe animated to before the element is removed.
|
|
724
|
+
* @param props.transition - Timing options.
|
|
725
|
+
* @param props.transition.duration - Duration in ms. Defaults to `300`.
|
|
726
|
+
* @param props.transition.delay - Delay in ms. Defaults to `0`.
|
|
727
|
+
* @param props.transition.easing - CSS easing. Defaults to `"ease"`.
|
|
728
|
+
* @param props.transition.iterations - Number of iterations. Defaults to `1`.
|
|
729
|
+
* @example { div: "Hello", $: [motion({ initial: { opacity: 0 }, animate: { opacity: 1 } })] }
|
|
730
|
+
*/
|
|
731
|
+
declare function motion(props?: MotionProps): PartialElement;
|
|
255
732
|
|
|
256
|
-
|
|
733
|
+
/**
|
|
734
|
+
* Themed ordered-list primitive: decimal markers positioned outside, reset
|
|
735
|
+
* margins and themed text color. Apply to an `<ol>` element.
|
|
736
|
+
*
|
|
737
|
+
* @hostTag ol
|
|
738
|
+
* @param props - Optional configuration.
|
|
739
|
+
* @param props.color - Color tone for the list text. Defaults to `"neutral"`.
|
|
740
|
+
* @example { ol: "", $: [orderedList()], children: [{ li: "First" }] }
|
|
741
|
+
*/
|
|
742
|
+
declare function orderedList(props?: {
|
|
257
743
|
color?: ValueOrState<ThemeColor>;
|
|
258
|
-
accentColor?: ValueOrState<ThemeColor>;
|
|
259
744
|
}): PartialElement;
|
|
260
745
|
|
|
261
|
-
|
|
746
|
+
/**
|
|
747
|
+
* Themed pagination control. Renders previous/next buttons plus truncated page
|
|
748
|
+
* numbers (with ellipses), tracks the current page in a `State`, and updates it
|
|
749
|
+
* on click. Apply to a `<div>` element.
|
|
750
|
+
*
|
|
751
|
+
* @hostTag div
|
|
752
|
+
* @param props - Configuration.
|
|
753
|
+
* @param props.total - Required. Total number of pages.
|
|
754
|
+
* @param props.value - Current page, accepts a value or `State`. Defaults to `1`.
|
|
755
|
+
* @param props.color - Base color tone for the page buttons. Defaults to `"neutral"`.
|
|
756
|
+
* @param props.accentColor - Accent color tone for the active page. Defaults to `"primary"`.
|
|
757
|
+
* @example { div: "", $: [pagination({ total: 10, value: 1 })] }
|
|
758
|
+
*/
|
|
759
|
+
declare function pagination(props: {
|
|
760
|
+
value?: ValueOrState<number>;
|
|
761
|
+
total: number;
|
|
262
762
|
color?: ThemeColor;
|
|
263
763
|
accentColor?: ThemeColor;
|
|
264
764
|
}): PartialElement;
|
|
265
765
|
|
|
266
|
-
|
|
766
|
+
/**
|
|
767
|
+
* Themed paragraph primitive: comfortable line-height, reset margins and themed
|
|
768
|
+
* text color. Apply to a `<p>` element.
|
|
769
|
+
*
|
|
770
|
+
* @hostTag p
|
|
771
|
+
* @param props - Optional configuration.
|
|
772
|
+
* @param props.color - Color tone for the paragraph text. Defaults to `"neutral"`.
|
|
773
|
+
* @example { p: "Hello world", $: [paragraph()] }
|
|
774
|
+
*/
|
|
775
|
+
declare function paragraph(props?: {
|
|
267
776
|
color?: ValueOrState<ThemeColor>;
|
|
268
777
|
}): PartialElement;
|
|
269
778
|
|
|
270
|
-
|
|
271
|
-
|
|
779
|
+
/**
|
|
780
|
+
* Floating popover primitive. Attaches to its host as the anchor/trigger and
|
|
781
|
+
* shows a floating `content` element (with `role="dialog"`) on click or hover,
|
|
782
|
+
* positioned via `@domphy/floating`. Returns the anchor partial, which merges
|
|
783
|
+
* trigger wiring (haspopup/expanded, focus/blur dismissal). Apply to the
|
|
784
|
+
* trigger element you want the popover anchored to.
|
|
785
|
+
*
|
|
786
|
+
* @param props - Configuration.
|
|
787
|
+
* @param props.openOn - Interaction that opens the popover: `"click"` or `"hover"`. Defaults to `"click"`.
|
|
788
|
+
* @param props.open - Open state, accepts a value or `State`. Defaults to `false`.
|
|
789
|
+
* @param props.placement - Floating placement (e.g. `"bottom"`, `"top-start"`), value or `State`. Defaults to `"bottom"`.
|
|
790
|
+
* @param props.content - The floating content element to display.
|
|
791
|
+
* @example { button: "Open", $: [popover({ openOn: "click", content: { div: "Hi" } })] }
|
|
792
|
+
*/
|
|
793
|
+
declare function popover(props: {
|
|
794
|
+
openOn: "click" | "hover";
|
|
795
|
+
open?: ValueOrState<boolean>;
|
|
796
|
+
placement?: ValueOrState<Placement$1>;
|
|
797
|
+
content: DomphyElement;
|
|
272
798
|
}): PartialElement;
|
|
273
799
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
800
|
+
/**
|
|
801
|
+
* Renders a small rotated arrow (via a `::after` pseudo-element) that points from a
|
|
802
|
+
* popover/tooltip toward its anchor, positioned and oriented based on the floating placement.
|
|
803
|
+
* The arrow direction is computed by flipping the given placement. No host-tag check is
|
|
804
|
+
* performed; apply it to the popover container element.
|
|
805
|
+
*
|
|
806
|
+
* @param props.placement - Floating placement the popover sits at; the arrow is drawn on the
|
|
807
|
+
* opposite (flipped) side. Accepts a value or reactive state. Defaults to `"bottom-end"`.
|
|
808
|
+
* One of: `top` | `bottom` | `left` | `right` | `top-start` | `top-end` | `bottom-start` |
|
|
809
|
+
* `bottom-end` | `left-start` | `left-end` | `right-start` | `right-end`.
|
|
810
|
+
* @param props.sideOffset - CSS length used to offset the arrow toward the start/end edge.
|
|
811
|
+
* Defaults to `themeSpacing(6)`.
|
|
812
|
+
* @param props.color - Theme color tone for the arrow fill and border. Defaults to `"neutral"`.
|
|
813
|
+
* @param props.bordered - Whether the arrow draws a 1px border (set to `0px` when false).
|
|
814
|
+
* Defaults to `true`.
|
|
815
|
+
* @example { div: [...], $: [popoverArrow({ placement: "top" })] }
|
|
816
|
+
*/
|
|
817
|
+
declare function popoverArrow(props?: {
|
|
818
|
+
placement?: ValueOrState<Placement$1>;
|
|
819
|
+
sideOffset?: string;
|
|
277
820
|
color?: ThemeColor;
|
|
278
|
-
|
|
821
|
+
bordered?: boolean;
|
|
279
822
|
}): PartialElement;
|
|
280
823
|
|
|
281
|
-
|
|
282
|
-
|
|
824
|
+
/**
|
|
825
|
+
* Styles a preformatted text block: inherited font size, themed foreground/background,
|
|
826
|
+
* no border, density-scaled padding and rounded corners.
|
|
827
|
+
*
|
|
828
|
+
* @hostTag pre
|
|
829
|
+
* @param props.color - Theme color tone for text and background. Accepts a value or reactive
|
|
830
|
+
* state. Defaults to `"neutral"`.
|
|
831
|
+
* @example { pre: "const x = 1", $: [preformated()] }
|
|
832
|
+
*/
|
|
833
|
+
declare function preformated(props?: {
|
|
834
|
+
color?: ValueOrState<ThemeColor>;
|
|
835
|
+
}): PartialElement;
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Styles a native progress bar: full-width, pill-shaped track with a themed fill,
|
|
839
|
+
* including the WebKit progress-bar/value pseudo-elements and a width transition.
|
|
840
|
+
*
|
|
841
|
+
* @hostTag progress
|
|
842
|
+
* @param props.color - Theme color tone for the track/background. Accepts a value or reactive
|
|
843
|
+
* state. Defaults to `"neutral"`.
|
|
844
|
+
* @param props.accentColor - Theme color tone for the filled value. Accepts a value or reactive
|
|
845
|
+
* state. Defaults to `"primary"`.
|
|
846
|
+
* @example { progress: null, value: 40, max: 100, $: [progress()] }
|
|
847
|
+
*/
|
|
848
|
+
declare function progress(props?: {
|
|
849
|
+
color?: ValueOrState<ThemeColor>;
|
|
850
|
+
accentColor?: ValueOrState<ThemeColor>;
|
|
851
|
+
}): PartialElement;
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Styles a native `<select>` control: removes the default appearance, applies themed
|
|
855
|
+
* colors, outline, density-scaled padding/radius, a custom chevron background icon, and
|
|
856
|
+
* hover/focus/disabled/optgroup/option states.
|
|
857
|
+
*
|
|
858
|
+
* @hostTag select
|
|
859
|
+
* @param props.color - Theme color tone for text, background and outline. Defaults to `"neutral"`.
|
|
860
|
+
* @param props.accentColor - Theme color tone for hover/focus outlines. Defaults to `"primary"`.
|
|
861
|
+
* @example { select: [{ option: "A" }], $: [select()] }
|
|
862
|
+
*/
|
|
863
|
+
declare function select(props?: {
|
|
283
864
|
color?: ThemeColor;
|
|
284
|
-
|
|
865
|
+
accentColor?: ThemeColor;
|
|
285
866
|
}): PartialElement;
|
|
286
867
|
|
|
868
|
+
/**
|
|
869
|
+
* A clickable select trigger box that renders the currently selected option(s) as removable
|
|
870
|
+
* tags and toggles a floating popover (the dropdown content) anchored to itself. Selected
|
|
871
|
+
* labels are derived from `options` matching the bound `value`; removing a tag updates the value.
|
|
872
|
+
*
|
|
873
|
+
* @hostTag div
|
|
874
|
+
* @param props.multiple - Whether multiple selection is allowed (renders removable tags and
|
|
875
|
+
* keeps the popover open on click). Defaults to `false`.
|
|
876
|
+
* @param props.value - Bound selection value(s). Accepts a value or reactive state of an array of
|
|
877
|
+
* `number | string | null | undefined`, or a single `number | string | null | undefined`.
|
|
878
|
+
* @param props.options - List of `{ label, value }` options used to resolve selected labels.
|
|
879
|
+
* Defaults to `[]`.
|
|
880
|
+
* @param props.placement - Floating placement of the dropdown popover. Accepts a value or
|
|
881
|
+
* reactive state. Defaults to `"bottom"`.
|
|
882
|
+
* @param props.content - Required. The popover/dropdown content element shown when open.
|
|
883
|
+
* @param props.color - Theme color tone for the box text/background. Defaults to `"neutral"`.
|
|
884
|
+
* @param props.open - Whether the popover is open. Accepts a value or reactive state. Defaults to `false`.
|
|
885
|
+
* @example { div: null, $: [selectBox({ content: { div: [...] }, options: [{ label: "A", value: "a" }] })] }
|
|
886
|
+
*/
|
|
287
887
|
declare function selectBox(props: {
|
|
288
888
|
multiple?: boolean;
|
|
289
889
|
value?: ValueOrState<Array<number | string | null | undefined> | number | string | null | undefined>;
|
|
@@ -297,148 +897,325 @@ declare function selectBox(props: {
|
|
|
297
897
|
open?: ValueOrState<boolean>;
|
|
298
898
|
}): PartialElement;
|
|
299
899
|
|
|
300
|
-
|
|
301
|
-
|
|
900
|
+
/**
|
|
901
|
+
* A single selectable option row (`role="option"`) for use inside a `selectList`. Reads the
|
|
902
|
+
* `select` context to reflect/toggle selection: it sets `aria-selected` from the bound value and
|
|
903
|
+
* toggles the value (single or multiple) on click. Styles hover/selected/focus states.
|
|
904
|
+
*
|
|
905
|
+
* @hostTag div
|
|
906
|
+
* @param props.accentColor - Theme color tone for the selected/focus state. Defaults to `"primary"`.
|
|
907
|
+
* @param props.color - Theme color tone for text/background. Defaults to `"neutral"`.
|
|
908
|
+
* @param props.value - The option value compared against and written to the select state.
|
|
909
|
+
* Defaults to `null`.
|
|
910
|
+
* @example { div: "Option A", $: [selectItem({ value: "a" })] }
|
|
911
|
+
*/
|
|
912
|
+
declare function selectItem(props?: {
|
|
913
|
+
accentColor?: ThemeColor;
|
|
914
|
+
color?: ThemeColor;
|
|
915
|
+
value?: number | string;
|
|
302
916
|
}): PartialElement;
|
|
303
917
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
918
|
+
/**
|
|
919
|
+
* Container for a list of `selectItem`s that owns the selection state. It exposes a `select`
|
|
920
|
+
* context (`{ value, multiple }`) consumed by child items, and injects hidden `<input>`(s)
|
|
921
|
+
* carrying the selected value(s) under `name` for form submission.
|
|
922
|
+
*
|
|
923
|
+
* @hostTag div
|
|
924
|
+
* @param props.multiple - Whether multiple selection is allowed; also sets the default empty
|
|
925
|
+
* value (`[]` vs `null`). Defaults to `false`.
|
|
926
|
+
* @param props.value - Bound selection value(s). Accepts a value or reactive state of an array of
|
|
927
|
+
* `number | string | null`, or a single `number | string | null`. Defaults to `[]` when
|
|
928
|
+
* `multiple`, otherwise `null`.
|
|
929
|
+
* @param props.color - Theme color tone for the background. Defaults to `"neutral"`.
|
|
930
|
+
* @param props.name - Name attribute for the hidden inputs (form field name).
|
|
931
|
+
* @example { div: [{ div: "A", $: [selectItem({ value: "a" })] }], $: [selectList({ name: "pick" })] }
|
|
932
|
+
*/
|
|
933
|
+
declare function selectList(props?: {
|
|
934
|
+
multiple?: boolean;
|
|
935
|
+
value?: ValueOrState<Array<number | string | null> | number | string | null>;
|
|
936
|
+
color?: ThemeColor;
|
|
937
|
+
name?: string;
|
|
938
|
+
}): PartialElement;
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* A loading placeholder block with a pulsing opacity animation. Marked `aria-hidden`, themed
|
|
942
|
+
* background/foreground, fixed height, slight rounding. No host-tag check; typically applied
|
|
943
|
+
* to a block-level element such as a `div` or `span`.
|
|
944
|
+
*
|
|
945
|
+
* @param props.color - Theme color tone for the placeholder. Accepts a value or reactive state.
|
|
946
|
+
* Defaults to `"neutral"`.
|
|
947
|
+
* @example { div: null, $: [skeleton()] }
|
|
948
|
+
*/
|
|
949
|
+
declare function skeleton(props?: {
|
|
307
950
|
color?: ValueOrState<ThemeColor>;
|
|
308
951
|
}): PartialElement;
|
|
309
952
|
|
|
953
|
+
/**
|
|
954
|
+
* Styles small/secondary text: one step smaller font size (`data-size="decrease-1"`) with a
|
|
955
|
+
* themed foreground color.
|
|
956
|
+
*
|
|
957
|
+
* @hostTag small
|
|
958
|
+
* @param props.color - Theme color tone for the text. Accepts a value or reactive state.
|
|
959
|
+
* Defaults to `"neutral"`.
|
|
960
|
+
* @example { small: "fine print", $: [small()] }
|
|
961
|
+
*/
|
|
310
962
|
declare function small(props?: {
|
|
311
963
|
color?: ValueOrState<ThemeColor>;
|
|
312
964
|
}): PartialElement;
|
|
313
965
|
|
|
966
|
+
/**
|
|
967
|
+
* A circular loading spinner: a themed ring with a contrasting top border that rotates
|
|
968
|
+
* continuously. Marked `role="status"` with `aria-label="loading"`.
|
|
969
|
+
*
|
|
970
|
+
* @hostTag span
|
|
971
|
+
* @param props.color - Theme color tone for the ring/highlight. Accepts a value or reactive
|
|
972
|
+
* state. Defaults to `"neutral"`.
|
|
973
|
+
* @example { span: null, $: [spinner()] }
|
|
974
|
+
*/
|
|
975
|
+
declare function spinner(props?: {
|
|
976
|
+
color?: ValueOrState<ThemeColor>;
|
|
977
|
+
}): PartialElement;
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Root of a resizable split layout. Lays out children as a flex row (horizontal) or column
|
|
981
|
+
* (vertical) and provides a `splitter` context (`{ direction, size, min, max }`) consumed by
|
|
982
|
+
* `splitterPanel` and `splitterHandle`. `size` is a reactive state holding the first panel's
|
|
983
|
+
* percentage. No host-tag check; typically applied to a `div`.
|
|
984
|
+
*
|
|
985
|
+
* @param props.direction - Split orientation, `"horizontal"` | `"vertical"`. Defaults to `"horizontal"`.
|
|
986
|
+
* @param props.defaultSize - Initial size (percentage) of the resizable panel. Defaults to `50`.
|
|
987
|
+
* @param props.min - Minimum panel size (percentage). Defaults to `10`.
|
|
988
|
+
* @param props.max - Maximum panel size (percentage). Defaults to `90`.
|
|
989
|
+
* @example { div: [...], $: [splitter({ direction: "vertical" })] }
|
|
990
|
+
*/
|
|
991
|
+
declare function splitter(props?: {
|
|
992
|
+
direction?: "horizontal" | "vertical";
|
|
993
|
+
defaultSize?: number;
|
|
994
|
+
min?: number;
|
|
995
|
+
max?: number;
|
|
996
|
+
}): PartialElement;
|
|
997
|
+
/**
|
|
998
|
+
* The resizable panel inside a `splitter`. Reads the `splitter` context and binds its
|
|
999
|
+
* width (horizontal) or height (vertical) to the context `size` state, updating reactively as
|
|
1000
|
+
* the handle is dragged. Warns if used outside a `splitter`. Takes no props.
|
|
1001
|
+
*
|
|
1002
|
+
* @example { div: [...], $: [splitterPanel()] }
|
|
1003
|
+
*/
|
|
1004
|
+
declare function splitterPanel(): PartialElement;
|
|
1005
|
+
/**
|
|
1006
|
+
* The draggable divider inside a `splitter`. Reads the `splitter` context, shows the
|
|
1007
|
+
* appropriate resize cursor, and on mouse drag updates the context `size` state (clamped to
|
|
1008
|
+
* `min`/`max`). Warns if used outside a `splitter`. Takes no props.
|
|
1009
|
+
*
|
|
1010
|
+
* @example { div: null, $: [splitterHandle()] }
|
|
1011
|
+
*/
|
|
1012
|
+
declare function splitterHandle(): PartialElement;
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* Styles strongly emphasized (bold) text: inherited font size, `font-weight: 700`, and a
|
|
1016
|
+
* themed foreground color.
|
|
1017
|
+
*
|
|
1018
|
+
* @hostTag strong
|
|
1019
|
+
* @param props.color - Theme color tone for the text. Accepts a value or reactive state.
|
|
1020
|
+
* Defaults to `"neutral"`.
|
|
1021
|
+
* @example { strong: "important", $: [strong()] }
|
|
1022
|
+
*/
|
|
314
1023
|
declare function strong(props?: {
|
|
315
1024
|
color?: ValueOrState<ThemeColor>;
|
|
316
1025
|
}): PartialElement;
|
|
317
1026
|
|
|
1027
|
+
/**
|
|
1028
|
+
* Renders subscript text (shrunk, baseline-lowered) for the host `<sub>` element.
|
|
1029
|
+
*
|
|
1030
|
+
* @hostTag sub
|
|
1031
|
+
* @param props.color - Theme color for the text. Optional, accepts a value or state. Defaults to `"neutral"`.
|
|
1032
|
+
* @example { sub: "2", $: [subscript()] }
|
|
1033
|
+
*/
|
|
318
1034
|
declare function subscript(props?: {
|
|
319
1035
|
color?: ValueOrState<ThemeColor>;
|
|
320
1036
|
}): PartialElement;
|
|
321
1037
|
|
|
1038
|
+
/**
|
|
1039
|
+
* Renders superscript text (shrunk, baseline-raised) for the host `<sup>` element.
|
|
1040
|
+
*
|
|
1041
|
+
* @hostTag sup
|
|
1042
|
+
* @param props.color - Theme color for the text. Optional, accepts a value or state. Defaults to `"neutral"`.
|
|
1043
|
+
* @example { sup: "2", $: [superscript()] }
|
|
1044
|
+
*/
|
|
322
1045
|
declare function superscript(props?: {
|
|
323
1046
|
color?: ValueOrState<ThemeColor>;
|
|
324
1047
|
}): PartialElement;
|
|
325
1048
|
|
|
326
|
-
|
|
327
|
-
|
|
1049
|
+
/**
|
|
1050
|
+
* Styles a single tab trigger inside a `tabs` tablist on the host `<button>` element.
|
|
1051
|
+
* Wires up the tab's id/aria-controls/aria-selected, click selection, and
|
|
1052
|
+
* arrow/Home/End keyboard navigation via the surrounding `tabs` context.
|
|
1053
|
+
* Must be used inside a `tabs` patch.
|
|
1054
|
+
*
|
|
1055
|
+
* @hostTag button
|
|
1056
|
+
* @param props.accentColor - Theme color for the active/focus underline. Optional. Defaults to `"primary"`.
|
|
1057
|
+
* @param props.color - Theme color for the resting/hover underline and text. Optional. Defaults to `"neutral"`.
|
|
1058
|
+
* @example { button: "Tab 1", $: [tab()] }
|
|
1059
|
+
*/
|
|
1060
|
+
declare function tab(props?: {
|
|
1061
|
+
accentColor?: ThemeColor;
|
|
1062
|
+
color?: ThemeColor;
|
|
328
1063
|
}): PartialElement;
|
|
329
1064
|
|
|
330
|
-
|
|
1065
|
+
/**
|
|
1066
|
+
* Styles a data table (header/body/footer cells, caption, row hover, borders)
|
|
1067
|
+
* on the host `<table>` element.
|
|
1068
|
+
*
|
|
1069
|
+
* @hostTag table
|
|
1070
|
+
* @param props.color - Theme color applied across cells and text. Optional, accepts a value or state. Defaults to `"neutral"`.
|
|
1071
|
+
* @example { table: null, $: [table()] }
|
|
1072
|
+
*/
|
|
1073
|
+
declare function table(props?: {
|
|
331
1074
|
color?: ValueOrState<ThemeColor>;
|
|
332
|
-
accentColor?: ValueOrState<ThemeColor>;
|
|
333
|
-
autoResize?: boolean;
|
|
334
1075
|
}): PartialElement;
|
|
335
1076
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
1077
|
+
/**
|
|
1078
|
+
* Styles a tab panel inside a `tabs` tablist. Wires up the panel's
|
|
1079
|
+
* id/aria-labelledby and toggles `hidden` based on the surrounding `tabs`
|
|
1080
|
+
* context's active key. Must be used inside a `tabs` patch. Takes no props.
|
|
1081
|
+
*
|
|
1082
|
+
* @hostTag div
|
|
1083
|
+
* @example { div: "Panel content", $: [tabPanel()] }
|
|
1084
|
+
*/
|
|
1085
|
+
declare function tabPanel(): PartialElement;
|
|
339
1086
|
|
|
340
|
-
|
|
341
|
-
|
|
1087
|
+
/**
|
|
1088
|
+
* Container patch that establishes a `tabs` context (with a shared `activeKey`
|
|
1089
|
+
* state) and the `tablist` role for child `tab`/`tabPanel` patches. No host tag
|
|
1090
|
+
* check; typically applied to a wrapper element.
|
|
1091
|
+
*
|
|
1092
|
+
* @param props.activeKey - Initially active tab key. Optional, accepts a value or state of `number | string`. Defaults to `0`.
|
|
1093
|
+
* @example { div: null, $: [tabs({ activeKey: 0 })] }
|
|
1094
|
+
*/
|
|
1095
|
+
declare function tabs(props?: {
|
|
1096
|
+
activeKey?: ValueOrState<number | string>;
|
|
342
1097
|
}): PartialElement;
|
|
343
1098
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
1099
|
+
/**
|
|
1100
|
+
* Styles an inline chip/tag (rounded, bordered, optional remove button).
|
|
1101
|
+
* No host tag check; typically applied to a `<span>`. When `removable` is true,
|
|
1102
|
+
* a close button is inserted that removes the host node on click.
|
|
1103
|
+
*
|
|
1104
|
+
* @hostTag span
|
|
1105
|
+
* @param props.color - Theme color for the chip background/border/text. Optional, accepts a value or state. Defaults to `"neutral"`.
|
|
1106
|
+
* @param props.removable - When true, renders a remove (x) button that removes the tag on click. Optional. Defaults to `false`.
|
|
1107
|
+
* @example { span: "Label", $: [tag({ removable: true })] }
|
|
1108
|
+
*/
|
|
1109
|
+
declare function tag(props?: {
|
|
1110
|
+
color?: ValueOrState<ThemeColor>;
|
|
1111
|
+
removable?: boolean;
|
|
349
1112
|
}): PartialElement;
|
|
350
1113
|
|
|
351
|
-
|
|
1114
|
+
/**
|
|
1115
|
+
* Styles a multi-line text input (border, focus/hover/invalid/disabled states)
|
|
1116
|
+
* on the host `<textarea>` element, with optional auto-resize to content.
|
|
1117
|
+
*
|
|
1118
|
+
* @hostTag textarea
|
|
1119
|
+
* @param props.color - Theme color for the border and text. Optional, accepts a value or state. Defaults to `"neutral"`.
|
|
1120
|
+
* @param props.accentColor - Theme color for hover/focus outline. Optional, accepts a value or state. Defaults to `"primary"`.
|
|
1121
|
+
* @param props.autoResize - When true, grows the textarea height to fit its content on input. Optional. Defaults to `false`.
|
|
1122
|
+
* @example { textarea: null, $: [textarea({ autoResize: true })] }
|
|
1123
|
+
*/
|
|
1124
|
+
declare function textarea(props?: {
|
|
352
1125
|
color?: ValueOrState<ThemeColor>;
|
|
1126
|
+
accentColor?: ValueOrState<ThemeColor>;
|
|
1127
|
+
autoResize?: boolean;
|
|
353
1128
|
}): PartialElement;
|
|
354
1129
|
|
|
355
|
-
type
|
|
356
|
-
|
|
1130
|
+
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
1131
|
+
/**
|
|
1132
|
+
* Renders a transient notification surface as a fixed-position overlay (portaled
|
|
1133
|
+
* into a corner stack), animating in on mount and out before removal. No host
|
|
1134
|
+
* tag check; typically applied to a `<div>`.
|
|
1135
|
+
*
|
|
1136
|
+
* @param props.position - Corner of the screen for the toast stack. Optional, one of `"top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right"`. Defaults to `"top-center"`.
|
|
1137
|
+
* @param props.color - Theme color for the toast surface. Optional. Defaults to `"neutral"`.
|
|
1138
|
+
* @example { div: "Saved!", $: [toast({ position: "top-right" })] }
|
|
1139
|
+
*/
|
|
1140
|
+
declare function toast(props?: {
|
|
1141
|
+
position?: ToastPosition;
|
|
357
1142
|
color?: ThemeColor;
|
|
358
|
-
open?: ValueOrState<boolean>;
|
|
359
|
-
placement?: Placement;
|
|
360
|
-
size?: string;
|
|
361
1143
|
}): PartialElement;
|
|
362
1144
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
1145
|
+
/**
|
|
1146
|
+
* Styles a single toggle button inside a `toggleGroup` on the host `<button>`
|
|
1147
|
+
* element. Wires up `aria-pressed` and click-to-toggle against the surrounding
|
|
1148
|
+
* `toggleGroup` context (single- or multi-select). Must be used inside a
|
|
1149
|
+
* `toggleGroup` patch.
|
|
1150
|
+
*
|
|
1151
|
+
* @hostTag button
|
|
1152
|
+
* @param props.color - Theme color for the resting/hover background and text. Optional, accepts a value or state. Defaults to `"neutral"`.
|
|
1153
|
+
* @param props.accentColor - Theme color for the pressed/focus state. Optional, accepts a value or state. Defaults to `"primary"`.
|
|
1154
|
+
* @example { button: "Bold", $: [toggle()] }
|
|
1155
|
+
*/
|
|
1156
|
+
declare function toggle(props?: {
|
|
1157
|
+
color?: ValueOrState<ThemeColor>;
|
|
1158
|
+
accentColor?: ValueOrState<ThemeColor>;
|
|
368
1159
|
}): PartialElement;
|
|
369
1160
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
1161
|
+
/**
|
|
1162
|
+
* Container patch that establishes a `toggleGroup` context (shared selection
|
|
1163
|
+
* `value` + `multiple` flag) and `group` role for child `toggle` patches, with
|
|
1164
|
+
* a bordered segmented-control style. No host tag check; typically applied to a
|
|
1165
|
+
* wrapper element.
|
|
1166
|
+
*
|
|
1167
|
+
* @param props.value - Selected toggle key(s). Optional, accepts a value or state of `string | string[]`. Defaults to `[]` when `multiple`, otherwise `""`.
|
|
1168
|
+
* @param props.multiple - When true, allows multiple toggles selected at once. Optional. Defaults to `false`.
|
|
1169
|
+
* @param props.color - Theme color for the group background/border. Optional. Defaults to `"neutral"`.
|
|
1170
|
+
* @example { div: null, $: [toggleGroup({ multiple: true })] }
|
|
1171
|
+
*/
|
|
1172
|
+
declare function toggleGroup(props?: {
|
|
1173
|
+
value?: ValueOrState<string | string[]>;
|
|
1174
|
+
multiple?: boolean;
|
|
373
1175
|
color?: ThemeColor;
|
|
374
1176
|
}): PartialElement;
|
|
375
1177
|
|
|
1178
|
+
/**
|
|
1179
|
+
* Attaches a floating tooltip to the host element, shown on hover/focus and
|
|
1180
|
+
* hidden on leave/blur/Escape. Returns the anchor (trigger) partial; the tooltip
|
|
1181
|
+
* surface is positioned via the floating utility and linked with
|
|
1182
|
+
* `aria-describedby`. No host tag check; applied to the trigger element.
|
|
1183
|
+
*
|
|
1184
|
+
* @param props.open - Controlled open state. Optional, accepts a value or state. Defaults to `false`.
|
|
1185
|
+
* @param props.placement - Floating placement relative to the trigger. Optional, accepts a value or state (`Placement`). Defaults to `"top"`.
|
|
1186
|
+
* @param props.content - Tooltip text content. Optional, accepts a value or state (string only). Defaults to `"Tooltip Content"`.
|
|
1187
|
+
* @example { button: "Hover me", $: [tooltip({ content: "Help text" })] }
|
|
1188
|
+
*/
|
|
376
1189
|
declare function tooltip(props?: {
|
|
377
1190
|
open?: ValueOrState<boolean>;
|
|
378
1191
|
placement?: ValueOrState<Placement$1>;
|
|
379
1192
|
content?: ValueOrState<string>;
|
|
380
1193
|
}): PartialElement;
|
|
381
1194
|
|
|
1195
|
+
/**
|
|
1196
|
+
* Animates child reordering using the FLIP technique: records each child's
|
|
1197
|
+
* position before an update and smoothly transitions it from its old to new
|
|
1198
|
+
* position afterward. No host tag check; applied to the list container.
|
|
1199
|
+
*
|
|
1200
|
+
* @param props.duration - Transition duration in milliseconds. Optional. Defaults to `300`.
|
|
1201
|
+
* @param props.delay - Transition delay in milliseconds. Optional. Defaults to `0`.
|
|
1202
|
+
* @example { ul: null, $: [transitionGroup({ duration: 300 })] }
|
|
1203
|
+
*/
|
|
382
1204
|
declare function transitionGroup(props?: {
|
|
383
1205
|
duration?: number;
|
|
384
1206
|
delay?: number;
|
|
385
1207
|
}): PartialElement;
|
|
386
1208
|
|
|
387
|
-
declare function tabs(props?: {
|
|
388
|
-
activeKey?: ValueOrState<number | string>;
|
|
389
|
-
}): PartialElement;
|
|
390
|
-
|
|
391
|
-
declare function tab(props?: {
|
|
392
|
-
accentColor?: ThemeColor;
|
|
393
|
-
color?: ThemeColor;
|
|
394
|
-
}): PartialElement;
|
|
395
|
-
|
|
396
|
-
declare function tabPanel(): PartialElement;
|
|
397
|
-
|
|
398
|
-
declare function tag(props?: {
|
|
399
|
-
color?: ValueOrState<ThemeColor>;
|
|
400
|
-
removable?: boolean;
|
|
401
|
-
}): PartialElement;
|
|
402
|
-
|
|
403
|
-
declare function menu(props?: {
|
|
404
|
-
activeKey?: ValueOrState<number | string>;
|
|
405
|
-
selectable?: boolean;
|
|
406
|
-
color?: ThemeColor;
|
|
407
|
-
}): PartialElement;
|
|
408
|
-
|
|
409
|
-
declare function menuItem(props?: {
|
|
410
|
-
accentColor?: ThemeColor;
|
|
411
|
-
color?: ThemeColor;
|
|
412
|
-
}): PartialElement;
|
|
413
|
-
|
|
414
1209
|
/**
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
1210
|
+
* Styles a bulleted list (disc markers, reset margins, themed text) on the host
|
|
1211
|
+
* `<ul>` element.
|
|
1212
|
+
*
|
|
1213
|
+
* @hostTag ul
|
|
1214
|
+
* @param props.color - Theme color for the list text. Optional, accepts a value or state. Defaults to `"neutral"`.
|
|
1215
|
+
* @example { ul: null, $: [unorderedList()] }
|
|
418
1216
|
*/
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
scale?: number | string;
|
|
423
|
-
rotate?: number | string;
|
|
424
|
-
} & Record<string, string | number>;
|
|
425
|
-
interface MotionProps {
|
|
426
|
-
/** Starting keyframe applied before the enter animation. */
|
|
427
|
-
initial?: MotionKeyframe;
|
|
428
|
-
/** Target keyframe. Pass a `State` to re-animate whenever it changes. */
|
|
429
|
-
animate?: MotionKeyframe | State<MotionKeyframe>;
|
|
430
|
-
/** Keyframe animated to before the element is removed. */
|
|
431
|
-
exit?: MotionKeyframe;
|
|
432
|
-
transition?: {
|
|
433
|
-
/** ms, default 300. */
|
|
434
|
-
duration?: number;
|
|
435
|
-
/** ms, default 0. */
|
|
436
|
-
delay?: number;
|
|
437
|
-
/** CSS easing, default "ease". */
|
|
438
|
-
easing?: string;
|
|
439
|
-
iterations?: number;
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
declare function motion(props?: MotionProps): PartialElement;
|
|
1217
|
+
declare function unorderedList(props?: {
|
|
1218
|
+
color?: ValueOrState<ThemeColor>;
|
|
1219
|
+
}): PartialElement;
|
|
443
1220
|
|
|
444
1221
|
export { type DatePickerProps, type DatePickerValue, type MotionKeyframe, type MotionProps, abbreviation, alert, avatar, badge, blockquote, breadcrumb, breadcrumbEllipsis, button, buttonSwitch, card, code, combobox, command, commandItem, commandSearch, datePicker, descriptionList, details, dialog, divider, drawer, emphasis, figure, formGroup, heading, horizontalRule, icon, image, inputCheckbox, inputColor, inputDateTime, inputFile, inputNumber, inputOTP, inputRadio, inputRange, inputSearch, inputSwitch, inputText, keyboard, label, link, mark, menu, menuItem, motion, orderedList, pagination, paragraph, popover, popoverArrow, preformated, progress, select, selectBox, selectItem, selectList, skeleton, small, spinner, splitter, splitterHandle, splitterPanel, strong, subscript, superscript, tab, tabPanel, table, tabs, tag, textarea, toast, toggle, toggleGroup, tooltip, transitionGroup, unorderedList };
|