@domphy/ui 0.21.6 → 0.22.1
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/CHANGELOG.md +31 -0
- package/dist/core-theme-ui.global.js +9 -6
- 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 +138 -36
- package/dist/index.d.ts +138 -36
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/dist/index.d.cts
CHANGED
|
@@ -86,13 +86,23 @@ declare function blockquote(props?: {
|
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* A horizontal breadcrumb navigation that lays out its children with a
|
|
89
|
-
* separator between items and
|
|
90
|
-
* Apply to a `<nav>` element.
|
|
89
|
+
* separator between items and marks the `[aria-current=page]` item
|
|
90
|
+
* non-interactive. Apply to a `<nav>` element.
|
|
91
|
+
*
|
|
92
|
+
* Does not paint `color` on any crumb — each composed child (`link()` for
|
|
93
|
+
* non-current items, `strong()` for the current one, or any other patch) owns
|
|
94
|
+
* its own color; wrap the current crumb in `strong()` for the usual "reads
|
|
95
|
+
* stronger" emphasis rather than relying on breadcrumb to repaint it.
|
|
91
96
|
*
|
|
92
97
|
* @hostTag nav
|
|
93
|
-
* @param props.color - Color tone for
|
|
98
|
+
* @param props.color - Color tone for the nav's own background/inherited text
|
|
99
|
+
* color and the separator glyphs. Optional `ValueOrState<ThemeColor>`, default "neutral".
|
|
94
100
|
* @param props.separator - String inserted between items via `::after`. Optional `string`, default "/".
|
|
95
|
-
* @example
|
|
101
|
+
* @example
|
|
102
|
+
* { nav: [
|
|
103
|
+
* { a: "Home", href: "#", $: [link()] },
|
|
104
|
+
* { strong: "Settings", ariaCurrent: "page", $: [strong()] },
|
|
105
|
+
* ], $: [breadcrumb({ separator: "›" })] }
|
|
96
106
|
*/
|
|
97
107
|
declare function breadcrumb(props?: {
|
|
98
108
|
color?: ValueOrState<ThemeColor>;
|
|
@@ -153,7 +163,7 @@ declare function button(props?: {
|
|
|
153
163
|
* @param props.color - Text color tone. Optional `ValueOrState<ThemeColor>`, defaults to `"neutral"`.
|
|
154
164
|
* @param props.size - Button size preset. Optional `"small" | "medium" | "large"`, defaults to `"medium"`.
|
|
155
165
|
* @example { button: "×", $: [buttonGhost()] }
|
|
156
|
-
* @example { button: { span:
|
|
166
|
+
* @example { button: [{ span: "🗑", $: [icon()] }], $: [buttonGhost({ color: "error" })] }
|
|
157
167
|
*/
|
|
158
168
|
declare function buttonGhost(props?: {
|
|
159
169
|
color?: ValueOrState<ThemeColor>;
|
|
@@ -168,7 +178,7 @@ declare function buttonGhost(props?: {
|
|
|
168
178
|
* @param props.checked - Toggle state. Optional `ValueOrState<boolean>`, default false.
|
|
169
179
|
* @param props.accentColor - Color tone when checked (on). Optional `ValueOrState<ThemeColor>`, default "primary".
|
|
170
180
|
* @param props.color - Color tone when unchecked (off track). Optional `ValueOrState<ThemeColor>`, default "neutral".
|
|
171
|
-
* @example { button: { span: null }, $: [buttonSwitch({ checked: true })] }
|
|
181
|
+
* @example { button: [{ span: null }], $: [buttonSwitch({ checked: true })] }
|
|
172
182
|
*/
|
|
173
183
|
declare function buttonSwitch(props?: {
|
|
174
184
|
checked?: ValueOrState<boolean>;
|
|
@@ -183,15 +193,15 @@ declare function buttonSwitch(props?: {
|
|
|
183
193
|
* `<div>` (any block container).
|
|
184
194
|
*
|
|
185
195
|
* @param props.color - Surface/border color tone. Optional `ValueOrState<ThemeColor>`, default "neutral".
|
|
186
|
-
* @example { div: { h3: "Title", p: "Body" }, $: [card({ color: "neutral" })] }
|
|
196
|
+
* @example { div: [{ h3: "Title", $: [heading()] }, { p: "Body", $: [paragraph()] }], $: [card({ color: "neutral" })] }
|
|
187
197
|
*/
|
|
188
198
|
declare function card(props?: {
|
|
189
199
|
color?: ValueOrState<ThemeColor>;
|
|
190
200
|
}): PartialElement;
|
|
191
201
|
|
|
192
202
|
/**
|
|
193
|
-
* Styles an inline code snippet
|
|
194
|
-
* and shifted tone. Apply to a `<code>` element.
|
|
203
|
+
* Styles an inline code snippet in the theme's monospace stack, with a subtle
|
|
204
|
+
* surface background, rounded corners, and shifted tone. Apply to a `<code>` element.
|
|
195
205
|
*
|
|
196
206
|
* @hostTag code
|
|
197
207
|
* @param props.color - Surface/text color tone. Optional `ValueOrState<ThemeColor>`, default "neutral".
|
|
@@ -249,7 +259,7 @@ declare function command(): PartialElement;
|
|
|
249
259
|
* @hostTag input
|
|
250
260
|
* @param props.color - Base theme color tone. Defaults to "neutral".
|
|
251
261
|
* @param props.accentColor - Accent color used for the focus border. Defaults to "primary".
|
|
252
|
-
* @example { input:
|
|
262
|
+
* @example { input: null, $: [commandSearch({ accentColor: "primary" })] }
|
|
253
263
|
*/
|
|
254
264
|
declare function commandSearch(props?: {
|
|
255
265
|
color?: ThemeColor;
|
|
@@ -259,10 +269,11 @@ declare function commandSearch(props?: {
|
|
|
259
269
|
* Selectable item in a command palette. On mount, immediately hides itself if
|
|
260
270
|
* the current query doesn't match its text content, and subscribes to future
|
|
261
271
|
* query changes — so items added dynamically after a search is typed are
|
|
262
|
-
* correctly filtered.
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
272
|
+
* correctly filtered. Apply to a `<button>` inside a `command()`. Uses native
|
|
273
|
+
* button semantics (not `role=option`) so the search input may sit as a
|
|
274
|
+
* sibling without a listbox parent requirement. A non-focusable host (a bare
|
|
275
|
+
* `<div>`) still filters, but the container's arrow-key walk calls `focus()`
|
|
276
|
+
* on it and that is a no-op — give such a host a `tabindex` of its own.
|
|
266
277
|
*
|
|
267
278
|
* @param props.color - Base theme color tone. Defaults to "neutral".
|
|
268
279
|
* @param props.accentColor - Accent color used for the focus ring. Defaults to "primary".
|
|
@@ -321,7 +332,7 @@ interface DatePickerProps {
|
|
|
321
332
|
* @param props.onChange - Called with the new value whenever the selection changes, `(value: DatePickerValue) => void`.
|
|
322
333
|
* @param props.accentColor - Accent color (`ValueOrState<ThemeColor>`) for selected/active days. Defaults to "primary".
|
|
323
334
|
* @param props.placement - Popover placement (`ValueOrState<Placement>`) relative to the input. Defaults to "bottom-start".
|
|
324
|
-
* @example { input:
|
|
335
|
+
* @example { input: null, $: [inputText(), datePicker({ mode: "range" })] }
|
|
325
336
|
*/
|
|
326
337
|
declare function datePicker(props?: DatePickerProps): PartialElement;
|
|
327
338
|
|
|
@@ -501,7 +512,7 @@ declare function fab(props?: {
|
|
|
501
512
|
*
|
|
502
513
|
* @hostTag figure
|
|
503
514
|
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the figure/caption text. Defaults to "neutral".
|
|
504
|
-
* @example { figure: [{ img: "",
|
|
515
|
+
* @example { figure: [{ img: null, src: "chart.png", alt: "Quarterly revenue" }, { figcaption: "A caption" }], $: [figure()] }
|
|
505
516
|
*/
|
|
506
517
|
declare function figure(props?: {
|
|
507
518
|
color?: ValueOrState<ThemeColor>;
|
|
@@ -515,7 +526,7 @@ declare function figure(props?: {
|
|
|
515
526
|
* @hostTag fieldset
|
|
516
527
|
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for legend/text/surface. Defaults to "neutral".
|
|
517
528
|
* @param props.layout - Field arrangement, "horizontal" (label beside control) | "vertical" (label above). Defaults to "horizontal".
|
|
518
|
-
* @example { fieldset: [{ legend: "Profile" }, { label: "Name" }, { input:
|
|
529
|
+
* @example { fieldset: [{ legend: "Profile" }, { label: "Name" }, { input: null }], $: [formGroup({ layout: "vertical" })] }
|
|
519
530
|
*/
|
|
520
531
|
declare function formGroup(props?: {
|
|
521
532
|
color?: ValueOrState<ThemeColor>;
|
|
@@ -575,7 +586,7 @@ declare function grid(props?: {
|
|
|
575
586
|
* Styles a heading, scaling its font size by level (h1 largest … h6 smallest)
|
|
576
587
|
* relative to the theme base size. Apply to a heading element `<h1>`–`<h6>`.
|
|
577
588
|
*
|
|
578
|
-
* @hostTag h1
|
|
589
|
+
* @hostTag h1-h6
|
|
579
590
|
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the heading text. Defaults to "neutral".
|
|
580
591
|
* @param props.size - Optional `ElementSize` (`"inherit"` | `"increase-N"` | `"decrease-N"`, N ≤ 7). When set, font size is `themeSize(listener, size)` including `"inherit"` (no tag bump). When omitted, follows the host tag (`h1` increase-4 … `h6` decrease-1).
|
|
581
592
|
* @example { h2: "Section title", $: [heading()] }
|
|
@@ -592,7 +603,7 @@ declare function heading(props?: {
|
|
|
592
603
|
*
|
|
593
604
|
* @hostTag hr
|
|
594
605
|
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the rule. Defaults to "neutral".
|
|
595
|
-
* @example { hr:
|
|
606
|
+
* @example { hr: null, $: [horizontalRule()] }
|
|
596
607
|
*/
|
|
597
608
|
declare function horizontalRule(props?: {
|
|
598
609
|
color?: ValueOrState<ThemeColor>;
|
|
@@ -610,17 +621,34 @@ declare function icon(props?: {
|
|
|
610
621
|
color?: ValueOrState<ThemeColor>;
|
|
611
622
|
}): PartialElement;
|
|
612
623
|
|
|
624
|
+
type ImageProps = {
|
|
625
|
+
color?: ValueOrState<ThemeColor>;
|
|
626
|
+
} & ({
|
|
627
|
+
alt: string;
|
|
628
|
+
decorative?: false;
|
|
629
|
+
} | {
|
|
630
|
+
decorative: true;
|
|
631
|
+
alt?: undefined;
|
|
632
|
+
});
|
|
613
633
|
/**
|
|
614
634
|
* Styles a responsive image: full-width, cover-fit, rounded corners with a
|
|
615
635
|
* themed placeholder background. Apply to an `<img>` element.
|
|
616
636
|
*
|
|
637
|
+
* `alt` is a required prop (WCAG 1.1.1) forwarded onto the host as the native
|
|
638
|
+
* `alt` attribute, not left for the call site to declare separately — a
|
|
639
|
+
* native `alt` on the host element still wins over this if both are given
|
|
640
|
+
* (Domphy's usual native-over-patch merge), but every call site must now
|
|
641
|
+
* make an explicit choice. Pass `decorative: true` for `alt=""` (purely
|
|
642
|
+
* decorative images the caller does not want announced).
|
|
643
|
+
*
|
|
617
644
|
* @hostTag img
|
|
645
|
+
* @param props.alt - Accessible text alternative. Required unless `decorative: true`.
|
|
646
|
+
* @param props.decorative - Marks the image as pure decoration — renders `alt=""` so assistive tech skips it. Optional.
|
|
618
647
|
* @param props.color - Optional theme color tone for the placeholder background (`ValueOrState<ThemeColor>`). Defaults to `"neutral"`.
|
|
619
|
-
* @example { img: null, src: "photo.jpg", alt: "
|
|
648
|
+
* @example { img: null, src: "photo.jpg", $: [image({ alt: "A scenic mountain photo" })] }
|
|
649
|
+
* @example { img: null, src: "divider.svg", $: [image({ decorative: true })] }
|
|
620
650
|
*/
|
|
621
|
-
declare function image(props
|
|
622
|
-
color?: ValueOrState<ThemeColor>;
|
|
623
|
-
}): PartialElement;
|
|
651
|
+
declare function image(props: ImageProps): PartialElement;
|
|
624
652
|
|
|
625
653
|
/**
|
|
626
654
|
* Styles a custom checkbox with themed box, check mark, indeterminate state,
|
|
@@ -707,7 +735,7 @@ declare function inputNumber(props?: {
|
|
|
707
735
|
* (e.g. `<div>`) whose direct children are the OTP `<input>` boxes. Takes no
|
|
708
736
|
* props.
|
|
709
737
|
*
|
|
710
|
-
* @example { div:
|
|
738
|
+
* @example { div: [{ input: null }, { input: null }], $: [inputOTP()] }
|
|
711
739
|
*/
|
|
712
740
|
declare function inputOTP(): PartialElement;
|
|
713
741
|
|
|
@@ -810,7 +838,7 @@ declare function inputSwitch(props?: {
|
|
|
810
838
|
* @param props.type - The input's `type` attribute (e.g. `"email"`, `"url"`, `"tel"`). Defaults to `"text"`.
|
|
811
839
|
* @param props.color - Base color tone for text/border/background. Defaults to `"neutral"`.
|
|
812
840
|
* @param props.accentColor - Accent color tone for the hover/focus outline. Defaults to `"primary"`.
|
|
813
|
-
* @example { input:
|
|
841
|
+
* @example { input: null, type: "text", placeholder: "Name", $: [inputText()] }
|
|
814
842
|
*/
|
|
815
843
|
declare function inputText(props?: {
|
|
816
844
|
type?: string;
|
|
@@ -819,8 +847,8 @@ declare function inputText(props?: {
|
|
|
819
847
|
}): PartialElement;
|
|
820
848
|
|
|
821
849
|
/**
|
|
822
|
-
* Renders keyboard-key styling (
|
|
823
|
-
* keystroke hint. Apply to a `<kbd>` element.
|
|
850
|
+
* Renders keyboard-key styling (the theme's monospace stack, themed background,
|
|
851
|
+
* border and padding) for a keystroke hint. Apply to a `<kbd>` element.
|
|
824
852
|
*
|
|
825
853
|
* @hostTag kbd
|
|
826
854
|
* @param props - Optional configuration.
|
|
@@ -992,6 +1020,27 @@ interface MotionProps {
|
|
|
992
1020
|
iterations?: number;
|
|
993
1021
|
};
|
|
994
1022
|
}
|
|
1023
|
+
/**
|
|
1024
|
+
* Animation primitive driven by the Web Animations API. Runs an enter
|
|
1025
|
+
* animation on mount (`initial` -> `animate`), re-animates whenever `animate`
|
|
1026
|
+
* is a `State` that changes, and plays the `exit` keyframe before removal.
|
|
1027
|
+
* Has no host-tag restriction; apply to any element you want to animate.
|
|
1028
|
+
*
|
|
1029
|
+
* Later generations route a fresh `animate`/`exit`/`transition` into the same
|
|
1030
|
+
* `behavior()` instance via `update()`, so a reused node is not stuck on
|
|
1031
|
+
* generation-1 keyframes.
|
|
1032
|
+
*
|
|
1033
|
+
* @param props - Optional configuration (see {@link MotionProps}).
|
|
1034
|
+
* @param props.initial - Starting keyframe applied before the enter animation.
|
|
1035
|
+
* @param props.animate - Target keyframe, or a `State` to re-animate on change.
|
|
1036
|
+
* @param props.exit - Keyframe animated to before the element is removed.
|
|
1037
|
+
* @param props.transition - Timing options.
|
|
1038
|
+
* @param props.transition.duration - Duration in ms. Defaults to `300`.
|
|
1039
|
+
* @param props.transition.delay - Delay in ms. Defaults to `0`.
|
|
1040
|
+
* @param props.transition.easing - CSS easing. Defaults to `"ease"`.
|
|
1041
|
+
* @param props.transition.iterations - Number of iterations. Defaults to `1`.
|
|
1042
|
+
* @example { div: "Hello", $: [motion({ initial: { opacity: 0 }, animate: { opacity: 1 } })] }
|
|
1043
|
+
*/
|
|
995
1044
|
declare function motion(props?: MotionProps): PartialElement;
|
|
996
1045
|
|
|
997
1046
|
/**
|
|
@@ -1001,7 +1050,7 @@ declare function motion(props?: MotionProps): PartialElement;
|
|
|
1001
1050
|
* @hostTag ol
|
|
1002
1051
|
* @param props - Optional configuration.
|
|
1003
1052
|
* @param props.color - Color tone for the list text. Defaults to `"neutral"`.
|
|
1004
|
-
* @example { ol: ""
|
|
1053
|
+
* @example { ol: [{ li: "First" }, { li: "Second" }], $: [orderedList()] }
|
|
1005
1054
|
*/
|
|
1006
1055
|
declare function orderedList(props?: {
|
|
1007
1056
|
color?: ValueOrState<ThemeColor>;
|
|
@@ -1018,7 +1067,7 @@ declare function orderedList(props?: {
|
|
|
1018
1067
|
* @param props.value - Current page, accepts a value or `State`. Defaults to `1`.
|
|
1019
1068
|
* @param props.color - Base color tone for the page buttons. Defaults to `"neutral"`.
|
|
1020
1069
|
* @param props.accentColor - Accent color tone for the active page. Defaults to `"primary"`.
|
|
1021
|
-
* @example { div:
|
|
1070
|
+
* @example { div: null, $: [pagination({ total: 10, value: 1 })] }
|
|
1022
1071
|
*/
|
|
1023
1072
|
declare function pagination(props: {
|
|
1024
1073
|
value?: ValueOrState<number>;
|
|
@@ -1111,7 +1160,8 @@ declare function popoverArrow(props?: {
|
|
|
1111
1160
|
}): PartialElement;
|
|
1112
1161
|
|
|
1113
1162
|
/**
|
|
1114
|
-
* Styles a preformatted text block: inherited font size,
|
|
1163
|
+
* Styles a preformatted text block: inherited font size, the theme's monospace
|
|
1164
|
+
* stack, themed foreground/background,
|
|
1115
1165
|
* no border, density-scaled padding and rounded corners.
|
|
1116
1166
|
*
|
|
1117
1167
|
* @hostTag pre
|
|
@@ -1223,12 +1273,27 @@ declare function row(props?: {
|
|
|
1223
1273
|
* and Firefox via `scrollbar-width`/`scrollbar-color`. Sets `overflow: auto`.
|
|
1224
1274
|
* No host-tag check; apply to any block element.
|
|
1225
1275
|
*
|
|
1276
|
+
* Pass `label` when the scrollable content is NOT itself keyboard-reachable —
|
|
1277
|
+
* a wide table, a code block, a diagram. Such a region can only be scrolled
|
|
1278
|
+
* with a pointer, which fails WCAG 2.1.1 (axe `scrollable-region-focusable`),
|
|
1279
|
+
* so `label` makes the host a named, tabbable region: `role="region"` +
|
|
1280
|
+
* `aria-label` + `tabindex="0"`, the wrapper pattern GOV.UK and shadcn use
|
|
1281
|
+
* around overflowing tables. Leave it off when the content already holds
|
|
1282
|
+
* focusable elements (a nav list, a form) — those are reachable by Tab
|
|
1283
|
+
* already, and a region tab stop in front of them is one keystroke of noise
|
|
1284
|
+
* per list.
|
|
1285
|
+
*
|
|
1226
1286
|
* @param props.color - Theme color for the scrollbar thumb. Accepts a value or
|
|
1227
1287
|
* reactive state. Defaults to `"neutral"`.
|
|
1288
|
+
* @param props.label - Accessible name for the scroll region. Setting it makes
|
|
1289
|
+
* the host a tabbable `role="region"`. Optional; a host-declared
|
|
1290
|
+
* `role`/`ariaLabel`/`tabIndex` still wins (native over patch).
|
|
1228
1291
|
* @example { div: [...], style: { maxHeight: "300px" }, $: [scrollArea()] }
|
|
1292
|
+
* @example { div: [wideTable], $: [scrollArea({ label: "Quarterly revenue" })] }
|
|
1229
1293
|
*/
|
|
1230
1294
|
declare function scrollArea(props?: {
|
|
1231
1295
|
color?: ValueOrState<ThemeColor>;
|
|
1296
|
+
label?: string;
|
|
1232
1297
|
}): PartialElement;
|
|
1233
1298
|
|
|
1234
1299
|
/** One item inside a segmented control. */
|
|
@@ -1279,8 +1344,9 @@ declare function select(props?: {
|
|
|
1279
1344
|
* A clickable select trigger box that renders the currently selected option(s) as removable
|
|
1280
1345
|
* tags and toggles a floating popover (the dropdown content) anchored to itself. Selected
|
|
1281
1346
|
* labels are derived from `options` matching the bound `value`; removing a tag updates the value.
|
|
1282
|
-
* Keyboard: Enter/Space toggle, ArrowDown
|
|
1283
|
-
*
|
|
1347
|
+
* Keyboard: Enter/Space toggle, ArrowDown/ArrowUp/Home/End open the listbox and move focus to
|
|
1348
|
+
* the first/last option (and move between options while open), Escape closes, and printable
|
|
1349
|
+
* characters typeahead-search options (closed: selects the match; open: focuses the matching
|
|
1284
1350
|
* `[role=option]` in the panel; a repeated character cycles matches).
|
|
1285
1351
|
*
|
|
1286
1352
|
* @hostTag div
|
|
@@ -1370,6 +1436,26 @@ declare function skeleton(props?: {
|
|
|
1370
1436
|
* Styles small/secondary text: one step smaller font size (`data-size="decrease-1"`) with a
|
|
1371
1437
|
* themed foreground color.
|
|
1372
1438
|
*
|
|
1439
|
+
* The tone is `shift-10`, one step ABOVE the `"text"` floor, because this text renders below
|
|
1440
|
+
* the WCAG large-text threshold and so must always clear 4.5:1. Measured in Chromium on the
|
|
1441
|
+
* built bundle: 6.01–7.73:1 (light) and 6.33–7.73:1 (dark) on every edge-anchored surface.
|
|
1442
|
+
* Three things at the CALL SITE forfeit that guarantee, all measured in Chromium:
|
|
1443
|
+
* 1. A host-declared `style.color` wins over the patch (native beats patch) — `"text"` /
|
|
1444
|
+
* `shift-9` on a `shift-1` surface is 4.23:1. Pass `color` for a different family
|
|
1445
|
+
* instead of restyling.
|
|
1446
|
+
* 2. An ancestor's scoped `"& small": { color: … }` also wins: that descendant selector is
|
|
1447
|
+
* specificity (0,1,1) and this patch's own generated class is only (0,1,0). Measured
|
|
1448
|
+
* inside a correctly tone-anchored `dataTone: "shift-1"` card, with no inline style on
|
|
1449
|
+
* the `<small>` at all: `& small { color: themeColor(l, "shift-8") }` resolves to
|
|
1450
|
+
* `var(--neutral-9)` = #707070 on the card's #ededed = 4.23:1 (6.27:1 once the `color`
|
|
1451
|
+
* line is dropped). The specificity is deliberately NOT escalated here — a patch that
|
|
1452
|
+
* outranked descendant rules would leave an author no way to restyle short of
|
|
1453
|
+
* `!important`. Scope layout there (`display: block`) and leave the colour to the patch.
|
|
1454
|
+
* 3. A surface tinted with a fixed `themeColor(l, "shift-N")` background and no `dataTone`:
|
|
1455
|
+
* every child still resolves against the page root, and even `shift-10` drops to 4.34:1
|
|
1456
|
+
* (shift-2 tint) and 3.67:1 (shift-3). Shift the surface with `dataTone` + `"inherit"`
|
|
1457
|
+
* instead — `@domphy/doctor`'s `tone-background-inherit` rule flags exactly this.
|
|
1458
|
+
*
|
|
1373
1459
|
* @hostTag small
|
|
1374
1460
|
* @param props.color - Theme color tone for the text. Accepts a value or reactive state.
|
|
1375
1461
|
* Defaults to `"neutral"`.
|
|
@@ -1416,11 +1502,18 @@ declare function splitterPanel(): PartialElement;
|
|
|
1416
1502
|
* appropriate resize cursor, and updates the context `size` state (clamped to `min`/`max`)
|
|
1417
1503
|
* via mouse drag or keyboard: Arrow keys move by 1%, Home/End jump to min/max, hold Shift
|
|
1418
1504
|
* for 10× step. Sets `role="separator"`, `tabindex="0"`, and `aria-value*` attributes.
|
|
1419
|
-
* Warns if used outside a `splitter`.
|
|
1505
|
+
* Warns if used outside a `splitter`. Drag works with mouse, pen and touch
|
|
1506
|
+
* (Pointer Events).
|
|
1420
1507
|
*
|
|
1508
|
+
* @param props.label - Accessible name for the separator (WCAG 4.1.2 — a
|
|
1509
|
+
* focusable `role="separator"` with `aria-value*` is a widget and needs a
|
|
1510
|
+
* name). Defaults to `"Resize"`. A native `ariaLabel`/`ariaLabelledby` on
|
|
1511
|
+
* the host element wins.
|
|
1421
1512
|
* @example { div: null, $: [splitterHandle()] }
|
|
1422
1513
|
*/
|
|
1423
|
-
declare function splitterHandle(
|
|
1514
|
+
declare function splitterHandle(props?: {
|
|
1515
|
+
label?: string;
|
|
1516
|
+
}): PartialElement;
|
|
1424
1517
|
|
|
1425
1518
|
/** One step entry. */
|
|
1426
1519
|
type StepItem = {
|
|
@@ -1454,7 +1547,7 @@ declare function steps(props?: {
|
|
|
1454
1547
|
}): PartialElement;
|
|
1455
1548
|
|
|
1456
1549
|
/**
|
|
1457
|
-
* Styles strongly emphasized (bold) text: inherited font size, `
|
|
1550
|
+
* Styles strongly emphasized (bold) text: inherited font size, the theme's `bold` weight, and a
|
|
1458
1551
|
* themed foreground color.
|
|
1459
1552
|
*
|
|
1460
1553
|
* @hostTag strong
|
|
@@ -1592,16 +1685,21 @@ declare function timelineItem(props?: {
|
|
|
1592
1685
|
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
1593
1686
|
/**
|
|
1594
1687
|
* Renders a transient notification surface as a fixed-position overlay (portaled
|
|
1595
|
-
* into a corner stack), animating in on mount and out before removal.
|
|
1688
|
+
* into a corner stack), animating in on mount and out before removal. Auto-dismisses
|
|
1689
|
+
* after `duration` (Radix/Sonner semantics), paused while hovered or focused. No host
|
|
1596
1690
|
* tag check; typically applied to a `<div>`.
|
|
1597
1691
|
*
|
|
1598
1692
|
* @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"`.
|
|
1599
1693
|
* @param props.color - Theme color for the toast surface. Optional. Defaults to `"neutral"`.
|
|
1694
|
+
* @param props.duration - Milliseconds before the toast dismisses itself (calls `onDismiss` then removes itself). Pass `Infinity` or `0` to disable. Optional. Defaults to `5000`.
|
|
1695
|
+
* @param props.onDismiss - Called once, right before the toast removes itself, when `duration` elapses without the pointer/focus inside it. Optional — a caller tracking its own toast list should use this to drop the entry from state.
|
|
1600
1696
|
* @example { div: "Saved!", $: [toast({ position: "top-right" })] }
|
|
1601
1697
|
*/
|
|
1602
1698
|
declare function toast(props?: {
|
|
1603
1699
|
position?: ToastPosition;
|
|
1604
1700
|
color?: ThemeColor;
|
|
1701
|
+
duration?: number;
|
|
1702
|
+
onDismiss?: () => void;
|
|
1605
1703
|
}): PartialElement;
|
|
1606
1704
|
|
|
1607
1705
|
/** One item inside a toggle group. */
|
|
@@ -1677,6 +1775,8 @@ declare function toolbarSpacer(): DomphyElement;
|
|
|
1677
1775
|
* @param props.onDismiss - Called when the tooltip requests close. Optional. Required to close when `open` is a read-only `Computed`/`ReadableState`.
|
|
1678
1776
|
* @param props.placement - Floating placement relative to the trigger. Optional, accepts a value or state (`Placement`). Defaults to `"top"`.
|
|
1679
1777
|
* @param props.content - Tooltip text content. Optional, accepts a value or state (string only). Defaults to `"Tooltip Content"`.
|
|
1778
|
+
* @param props.openDelay - Hover/focus-intent delay before showing, in ms (Radix `delayDuration` parity). Optional. Defaults to 100.
|
|
1779
|
+
* @param props.closeDelay - Delay before hiding after leave/blur, in ms. Optional. Defaults to 100.
|
|
1680
1780
|
* @example { button: "Hover me", $: [tooltip({ content: "Help text" })] }
|
|
1681
1781
|
*/
|
|
1682
1782
|
declare function tooltip(props?: {
|
|
@@ -1684,6 +1784,8 @@ declare function tooltip(props?: {
|
|
|
1684
1784
|
onDismiss?: () => void;
|
|
1685
1785
|
placement?: ValueOrState<Placement$1>;
|
|
1686
1786
|
content?: ValueOrState<string>;
|
|
1787
|
+
openDelay?: number;
|
|
1788
|
+
closeDelay?: number;
|
|
1687
1789
|
}): PartialElement;
|
|
1688
1790
|
|
|
1689
1791
|
/**
|