@domphy/ui 0.20.12 → 0.21.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 +4 -0
- package/dist/core-theme-ui.global.js +5 -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 +93 -23
- package/dist/index.d.ts +93 -23
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValueOrState, PartialElement, DomphyElement, State } from '@domphy/core';
|
|
1
|
+
import { ValueOrState, PartialElement, DomphyElement, State, Listener } from '@domphy/core';
|
|
2
2
|
import { ThemeColor } from '@domphy/theme';
|
|
3
3
|
import { Placement as Placement$1 } from '@domphy/floating';
|
|
4
4
|
export { Placement } from '@domphy/floating';
|
|
@@ -359,14 +359,23 @@ declare function details(props?: {
|
|
|
359
359
|
* dialog, restores focus to the previously focused element on close, sets
|
|
360
360
|
* `aria-modal`, and closes on outside (backdrop) click. Apply to a `<dialog>`.
|
|
361
361
|
*
|
|
362
|
+
* Accessible name/description: pass `labelledBy`/`describedBy` the `id` of a
|
|
363
|
+
* heading/paragraph inside the dialog (Radix Title/Description parity). The
|
|
364
|
+
* native `ariaLabelledby`/`ariaDescribedby` attributes on the host element
|
|
365
|
+
* remain an equivalent escape hatch (the native element always wins).
|
|
366
|
+
*
|
|
362
367
|
* @hostTag dialog
|
|
363
368
|
* @param props.color - Theme color tone for the dialog surface. Defaults to "neutral".
|
|
364
369
|
* @param props.open - Open state (`ValueOrState<boolean>`); set it to true/false to show/hide. Defaults to false.
|
|
365
|
-
* @
|
|
370
|
+
* @param props.labelledBy - `id` of the element labeling the dialog (wired to `aria-labelledby`). Optional.
|
|
371
|
+
* @param props.describedBy - `id` of the element describing the dialog (wired to `aria-describedby`). Optional.
|
|
372
|
+
* @example { dialog: [{ h2: "Confirm", id: "dlg-title" }], $: [dialog({ open, labelledBy: "dlg-title" })] }
|
|
366
373
|
*/
|
|
367
374
|
declare function dialog(props?: {
|
|
368
375
|
color?: ThemeColor;
|
|
369
376
|
open?: ValueOrState<boolean>;
|
|
377
|
+
labelledBy?: string;
|
|
378
|
+
describedBy?: string;
|
|
370
379
|
}): PartialElement;
|
|
371
380
|
|
|
372
381
|
/**
|
|
@@ -501,6 +510,43 @@ declare function formGroup(props?: {
|
|
|
501
510
|
layout?: "horizontal" | "vertical";
|
|
502
511
|
}): PartialElement;
|
|
503
512
|
|
|
513
|
+
type FlexAlign = "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
|
|
514
|
+
/**
|
|
515
|
+
* A vertical flex column with spacing between children. The general-purpose
|
|
516
|
+
* primitive for stacking blocks — form sections, panel content, card bodies —
|
|
517
|
+
* instead of hand-rolling `display: flex; flexDirection: column; gap: ...`.
|
|
518
|
+
* Styles the host only; apply to any block element.
|
|
519
|
+
*
|
|
520
|
+
* @param props.gap - Spacing multiplier for gap between children (default 3 = 0.75em at density 1).
|
|
521
|
+
* @param props.align - Cross-axis alignment (`alignItems`). Unset by default (flex default, stretch).
|
|
522
|
+
* @example { div: [{ h3: "Title" }, { p: "Body" }], $: [stack()] }
|
|
523
|
+
* @example { div: [...], $: [stack({ gap: 2, align: "center" })] }
|
|
524
|
+
*/
|
|
525
|
+
declare function stack(props?: {
|
|
526
|
+
gap?: number;
|
|
527
|
+
align?: FlexAlign;
|
|
528
|
+
}): PartialElement;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* A CSS grid with a column template and spacing between cells — the
|
|
532
|
+
* general-purpose primitive for card/property/stat grids instead of
|
|
533
|
+
* hand-rolling `display: "grid"; gridTemplateColumns: ...; gap: ...`.
|
|
534
|
+
* Mirrors `row()`'s contract. Styles the host only; apply to any block
|
|
535
|
+
* element.
|
|
536
|
+
*
|
|
537
|
+
* @param props.columns - Column count (expanded to `repeat(N, minmax(0, 1fr))`)
|
|
538
|
+
* or a raw `grid-template-columns` value. Defaults to `1`.
|
|
539
|
+
* @param props.gap - Spacing multiplier for gap between cells (default 4 = 1em at density 1).
|
|
540
|
+
* @param props.align - Block-axis alignment of items (`alignItems`). Unset by default.
|
|
541
|
+
* @example { div: [{ div: "A" }, { div: "B" }], $: [grid({ columns: 2 })] }
|
|
542
|
+
* @example { div: [...], $: [grid({ columns: "repeat(auto-fill, minmax(12em, 1fr))", gap: 6 })] }
|
|
543
|
+
*/
|
|
544
|
+
declare function grid(props?: {
|
|
545
|
+
columns?: number | string;
|
|
546
|
+
gap?: number;
|
|
547
|
+
align?: FlexAlign;
|
|
548
|
+
}): PartialElement;
|
|
549
|
+
|
|
504
550
|
/**
|
|
505
551
|
* Styles a heading, scaling its font size by level (h1 largest … h6 smallest)
|
|
506
552
|
* relative to the theme base size. Apply to a heading element `<h1>`–`<h6>`.
|
|
@@ -712,17 +758,19 @@ declare function inputSwitch(props?: {
|
|
|
712
758
|
}): PartialElement;
|
|
713
759
|
|
|
714
760
|
/**
|
|
715
|
-
* Themed single-line text input primitive. Sets `type
|
|
716
|
-
* field with themed border, focus ring, placeholder, disabled and
|
|
717
|
-
* (`data-status`) states. Apply to an `<input>` element.
|
|
761
|
+
* Themed single-line text input primitive. Sets `type` (default `"text"`) and
|
|
762
|
+
* styles the field with themed border, focus ring, placeholder, disabled and
|
|
763
|
+
* validation (`data-status`) states. Apply to an `<input>` element.
|
|
718
764
|
*
|
|
719
765
|
* @hostTag input
|
|
720
766
|
* @param props - Optional configuration.
|
|
767
|
+
* @param props.type - The input's `type` attribute (e.g. `"email"`, `"url"`, `"tel"`). Defaults to `"text"`.
|
|
721
768
|
* @param props.color - Base color tone for text/border/background. Defaults to `"neutral"`.
|
|
722
769
|
* @param props.accentColor - Accent color tone for the hover/focus outline. Defaults to `"primary"`.
|
|
723
770
|
* @example { input: "", type: "text", placeholder: "Name", $: [inputText()] }
|
|
724
771
|
*/
|
|
725
772
|
declare function inputText(props?: {
|
|
773
|
+
type?: string;
|
|
726
774
|
color?: ValueOrState<ThemeColor>;
|
|
727
775
|
accentColor?: ValueOrState<ThemeColor>;
|
|
728
776
|
}): PartialElement;
|
|
@@ -1089,23 +1137,6 @@ declare function ringProgress(props?: {
|
|
|
1089
1137
|
thickness?: number;
|
|
1090
1138
|
}): PartialElement;
|
|
1091
1139
|
|
|
1092
|
-
type FlexAlign = "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
|
|
1093
|
-
/**
|
|
1094
|
-
* A vertical flex column with spacing between children. The general-purpose
|
|
1095
|
-
* primitive for stacking blocks — form sections, panel content, card bodies —
|
|
1096
|
-
* instead of hand-rolling `display: flex; flexDirection: column; gap: ...`.
|
|
1097
|
-
* Styles the host only; apply to any block element.
|
|
1098
|
-
*
|
|
1099
|
-
* @param props.gap - Spacing multiplier for gap between children (default 3 = 0.75em at density 1).
|
|
1100
|
-
* @param props.align - Cross-axis alignment (`alignItems`). Unset by default (flex default, stretch).
|
|
1101
|
-
* @example { div: [{ h3: "Title" }, { p: "Body" }], $: [stack()] }
|
|
1102
|
-
* @example { div: [...], $: [stack({ gap: 2, align: "center" })] }
|
|
1103
|
-
*/
|
|
1104
|
-
declare function stack(props?: {
|
|
1105
|
-
gap?: number;
|
|
1106
|
-
align?: FlexAlign;
|
|
1107
|
-
}): PartialElement;
|
|
1108
|
-
|
|
1109
1140
|
type FlexJustify = "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly";
|
|
1110
1141
|
/**
|
|
1111
1142
|
* A horizontal flex row with spacing between children, vertically centered by
|
|
@@ -1190,6 +1221,9 @@ declare function select(props?: {
|
|
|
1190
1221
|
* A clickable select trigger box that renders the currently selected option(s) as removable
|
|
1191
1222
|
* tags and toggles a floating popover (the dropdown content) anchored to itself. Selected
|
|
1192
1223
|
* labels are derived from `options` matching the bound `value`; removing a tag updates the value.
|
|
1224
|
+
* Keyboard: Enter/Space toggle, ArrowDown opens, Escape closes, and printable characters
|
|
1225
|
+
* typeahead-search options (closed: selects the match; open: focuses the matching
|
|
1226
|
+
* `[role=option]` in the panel; a repeated character cycles matches).
|
|
1193
1227
|
*
|
|
1194
1228
|
* @hostTag div
|
|
1195
1229
|
* @param props.multiple - Whether multiple selection is allowed (renders removable tags and
|
|
@@ -1615,4 +1649,40 @@ declare function unorderedList(props?: {
|
|
|
1615
1649
|
color?: ValueOrState<ThemeColor>;
|
|
1616
1650
|
}): PartialElement;
|
|
1617
1651
|
|
|
1618
|
-
|
|
1652
|
+
/**
|
|
1653
|
+
* Visually hides an element while keeping it in the accessibility tree — the
|
|
1654
|
+
* classic "sr-only" recipe for screen-reader-only labels, live-region text,
|
|
1655
|
+
* and skip links (before focus). Styles the host only; apply to any element.
|
|
1656
|
+
*
|
|
1657
|
+
* @example { span: "Opens in a new tab", $: [visuallyHidden()] }
|
|
1658
|
+
*/
|
|
1659
|
+
declare function visuallyHidden(): PartialElement;
|
|
1660
|
+
|
|
1661
|
+
/** Named elevation levels for floating/raised surfaces. */
|
|
1662
|
+
type ElevationLevel = "low" | "medium" | "high";
|
|
1663
|
+
/**
|
|
1664
|
+
* Shared box-shadow value for a named elevation level. Used by floating/raised
|
|
1665
|
+
* surface patches (popover, menu, dialog, drawer, toast, tooltip, combobox/
|
|
1666
|
+
* selectBox dropdown, datePicker popup, fab) so elevation reads consistently
|
|
1667
|
+
* across the library instead of each patch picking its own shadow.
|
|
1668
|
+
*/
|
|
1669
|
+
declare function elevation(level: ElevationLevel): string;
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* Shared `:focus-visible` ring — ring-offset pattern used by Radix / shadcn /
|
|
1673
|
+
* Vercel / Linear:
|
|
1674
|
+
*
|
|
1675
|
+
* 1. 2px "gap" in the surface tone (reads as space between control + ring)
|
|
1676
|
+
* 2. 2px accent halo outside that gap
|
|
1677
|
+
*
|
|
1678
|
+
* Implemented as a layered `box-shadow` so it composes with a control's own
|
|
1679
|
+
* resting outline / elevation instead of replacing them. Prefer this over a
|
|
1680
|
+
* flush `0 0 0 2px` ring (looks like a thick pastel border glued to the edge)
|
|
1681
|
+
* and over the browser default outline.
|
|
1682
|
+
*
|
|
1683
|
+
* Accent at `shift-9` stays legible on both light and dark surfaces; the
|
|
1684
|
+
* washed `shift-6` flush ring is what made focus look broken in product UIs.
|
|
1685
|
+
*/
|
|
1686
|
+
declare function focusRing(listener: Listener, color?: ThemeColor): string;
|
|
1687
|
+
|
|
1688
|
+
export { type ButtonVariant, type DatePickerProps, type DatePickerValue, type ElevationLevel, type FlexAlign, type FlexJustify, type MenuItem, type MotionKeyframe, type MotionProps, type SegmentedItem, type StepItem, type TabItem, type ToggleItem, abbreviation, accordion, alert, avatar, badge, blockquote, breadcrumb, breadcrumbEllipsis, button, buttonGhost, buttonSwitch, card, code, combobox, command, commandItem, commandSearch, datePicker, descriptionList, details, dialog, divider, drawer, elevation, emphasis, empty, errorBoundary, fab, figure, focusRing, formGroup, grid, heading, horizontalRule, icon, image, inputCheckbox, inputColor, inputDateTime, inputFile, inputNumber, inputOTP, inputPassword, inputRadio, inputRange, inputSearch, inputSwitch, inputText, keyboard, label, link, linkButton, list, listItem, listItemButton, mark, menu, motion, orderedList, pagination, panelSection, paragraph, popover, popoverArrow, preformated, progress, rating, ringProgress, row, scrollArea, segmented, select, selectBox, selectItem, selectList, skeleton, small, spinner, splitter, splitterHandle, splitterPanel, stack, steps, strong, subscript, superscript, table, tabs, tag, textarea, timeline, timelineItem, toast, toggleGroup, toolbar, toolbarSpacer, tooltip, transitionGroup, unorderedList, visuallyHidden };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValueOrState, PartialElement, DomphyElement, State } from '@domphy/core';
|
|
1
|
+
import { ValueOrState, PartialElement, DomphyElement, State, Listener } from '@domphy/core';
|
|
2
2
|
import { ThemeColor } from '@domphy/theme';
|
|
3
3
|
import { Placement as Placement$1 } from '@domphy/floating';
|
|
4
4
|
export { Placement } from '@domphy/floating';
|
|
@@ -359,14 +359,23 @@ declare function details(props?: {
|
|
|
359
359
|
* dialog, restores focus to the previously focused element on close, sets
|
|
360
360
|
* `aria-modal`, and closes on outside (backdrop) click. Apply to a `<dialog>`.
|
|
361
361
|
*
|
|
362
|
+
* Accessible name/description: pass `labelledBy`/`describedBy` the `id` of a
|
|
363
|
+
* heading/paragraph inside the dialog (Radix Title/Description parity). The
|
|
364
|
+
* native `ariaLabelledby`/`ariaDescribedby` attributes on the host element
|
|
365
|
+
* remain an equivalent escape hatch (the native element always wins).
|
|
366
|
+
*
|
|
362
367
|
* @hostTag dialog
|
|
363
368
|
* @param props.color - Theme color tone for the dialog surface. Defaults to "neutral".
|
|
364
369
|
* @param props.open - Open state (`ValueOrState<boolean>`); set it to true/false to show/hide. Defaults to false.
|
|
365
|
-
* @
|
|
370
|
+
* @param props.labelledBy - `id` of the element labeling the dialog (wired to `aria-labelledby`). Optional.
|
|
371
|
+
* @param props.describedBy - `id` of the element describing the dialog (wired to `aria-describedby`). Optional.
|
|
372
|
+
* @example { dialog: [{ h2: "Confirm", id: "dlg-title" }], $: [dialog({ open, labelledBy: "dlg-title" })] }
|
|
366
373
|
*/
|
|
367
374
|
declare function dialog(props?: {
|
|
368
375
|
color?: ThemeColor;
|
|
369
376
|
open?: ValueOrState<boolean>;
|
|
377
|
+
labelledBy?: string;
|
|
378
|
+
describedBy?: string;
|
|
370
379
|
}): PartialElement;
|
|
371
380
|
|
|
372
381
|
/**
|
|
@@ -501,6 +510,43 @@ declare function formGroup(props?: {
|
|
|
501
510
|
layout?: "horizontal" | "vertical";
|
|
502
511
|
}): PartialElement;
|
|
503
512
|
|
|
513
|
+
type FlexAlign = "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
|
|
514
|
+
/**
|
|
515
|
+
* A vertical flex column with spacing between children. The general-purpose
|
|
516
|
+
* primitive for stacking blocks — form sections, panel content, card bodies —
|
|
517
|
+
* instead of hand-rolling `display: flex; flexDirection: column; gap: ...`.
|
|
518
|
+
* Styles the host only; apply to any block element.
|
|
519
|
+
*
|
|
520
|
+
* @param props.gap - Spacing multiplier for gap between children (default 3 = 0.75em at density 1).
|
|
521
|
+
* @param props.align - Cross-axis alignment (`alignItems`). Unset by default (flex default, stretch).
|
|
522
|
+
* @example { div: [{ h3: "Title" }, { p: "Body" }], $: [stack()] }
|
|
523
|
+
* @example { div: [...], $: [stack({ gap: 2, align: "center" })] }
|
|
524
|
+
*/
|
|
525
|
+
declare function stack(props?: {
|
|
526
|
+
gap?: number;
|
|
527
|
+
align?: FlexAlign;
|
|
528
|
+
}): PartialElement;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* A CSS grid with a column template and spacing between cells — the
|
|
532
|
+
* general-purpose primitive for card/property/stat grids instead of
|
|
533
|
+
* hand-rolling `display: "grid"; gridTemplateColumns: ...; gap: ...`.
|
|
534
|
+
* Mirrors `row()`'s contract. Styles the host only; apply to any block
|
|
535
|
+
* element.
|
|
536
|
+
*
|
|
537
|
+
* @param props.columns - Column count (expanded to `repeat(N, minmax(0, 1fr))`)
|
|
538
|
+
* or a raw `grid-template-columns` value. Defaults to `1`.
|
|
539
|
+
* @param props.gap - Spacing multiplier for gap between cells (default 4 = 1em at density 1).
|
|
540
|
+
* @param props.align - Block-axis alignment of items (`alignItems`). Unset by default.
|
|
541
|
+
* @example { div: [{ div: "A" }, { div: "B" }], $: [grid({ columns: 2 })] }
|
|
542
|
+
* @example { div: [...], $: [grid({ columns: "repeat(auto-fill, minmax(12em, 1fr))", gap: 6 })] }
|
|
543
|
+
*/
|
|
544
|
+
declare function grid(props?: {
|
|
545
|
+
columns?: number | string;
|
|
546
|
+
gap?: number;
|
|
547
|
+
align?: FlexAlign;
|
|
548
|
+
}): PartialElement;
|
|
549
|
+
|
|
504
550
|
/**
|
|
505
551
|
* Styles a heading, scaling its font size by level (h1 largest … h6 smallest)
|
|
506
552
|
* relative to the theme base size. Apply to a heading element `<h1>`–`<h6>`.
|
|
@@ -712,17 +758,19 @@ declare function inputSwitch(props?: {
|
|
|
712
758
|
}): PartialElement;
|
|
713
759
|
|
|
714
760
|
/**
|
|
715
|
-
* Themed single-line text input primitive. Sets `type
|
|
716
|
-
* field with themed border, focus ring, placeholder, disabled and
|
|
717
|
-
* (`data-status`) states. Apply to an `<input>` element.
|
|
761
|
+
* Themed single-line text input primitive. Sets `type` (default `"text"`) and
|
|
762
|
+
* styles the field with themed border, focus ring, placeholder, disabled and
|
|
763
|
+
* validation (`data-status`) states. Apply to an `<input>` element.
|
|
718
764
|
*
|
|
719
765
|
* @hostTag input
|
|
720
766
|
* @param props - Optional configuration.
|
|
767
|
+
* @param props.type - The input's `type` attribute (e.g. `"email"`, `"url"`, `"tel"`). Defaults to `"text"`.
|
|
721
768
|
* @param props.color - Base color tone for text/border/background. Defaults to `"neutral"`.
|
|
722
769
|
* @param props.accentColor - Accent color tone for the hover/focus outline. Defaults to `"primary"`.
|
|
723
770
|
* @example { input: "", type: "text", placeholder: "Name", $: [inputText()] }
|
|
724
771
|
*/
|
|
725
772
|
declare function inputText(props?: {
|
|
773
|
+
type?: string;
|
|
726
774
|
color?: ValueOrState<ThemeColor>;
|
|
727
775
|
accentColor?: ValueOrState<ThemeColor>;
|
|
728
776
|
}): PartialElement;
|
|
@@ -1089,23 +1137,6 @@ declare function ringProgress(props?: {
|
|
|
1089
1137
|
thickness?: number;
|
|
1090
1138
|
}): PartialElement;
|
|
1091
1139
|
|
|
1092
|
-
type FlexAlign = "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
|
|
1093
|
-
/**
|
|
1094
|
-
* A vertical flex column with spacing between children. The general-purpose
|
|
1095
|
-
* primitive for stacking blocks — form sections, panel content, card bodies —
|
|
1096
|
-
* instead of hand-rolling `display: flex; flexDirection: column; gap: ...`.
|
|
1097
|
-
* Styles the host only; apply to any block element.
|
|
1098
|
-
*
|
|
1099
|
-
* @param props.gap - Spacing multiplier for gap between children (default 3 = 0.75em at density 1).
|
|
1100
|
-
* @param props.align - Cross-axis alignment (`alignItems`). Unset by default (flex default, stretch).
|
|
1101
|
-
* @example { div: [{ h3: "Title" }, { p: "Body" }], $: [stack()] }
|
|
1102
|
-
* @example { div: [...], $: [stack({ gap: 2, align: "center" })] }
|
|
1103
|
-
*/
|
|
1104
|
-
declare function stack(props?: {
|
|
1105
|
-
gap?: number;
|
|
1106
|
-
align?: FlexAlign;
|
|
1107
|
-
}): PartialElement;
|
|
1108
|
-
|
|
1109
1140
|
type FlexJustify = "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly";
|
|
1110
1141
|
/**
|
|
1111
1142
|
* A horizontal flex row with spacing between children, vertically centered by
|
|
@@ -1190,6 +1221,9 @@ declare function select(props?: {
|
|
|
1190
1221
|
* A clickable select trigger box that renders the currently selected option(s) as removable
|
|
1191
1222
|
* tags and toggles a floating popover (the dropdown content) anchored to itself. Selected
|
|
1192
1223
|
* labels are derived from `options` matching the bound `value`; removing a tag updates the value.
|
|
1224
|
+
* Keyboard: Enter/Space toggle, ArrowDown opens, Escape closes, and printable characters
|
|
1225
|
+
* typeahead-search options (closed: selects the match; open: focuses the matching
|
|
1226
|
+
* `[role=option]` in the panel; a repeated character cycles matches).
|
|
1193
1227
|
*
|
|
1194
1228
|
* @hostTag div
|
|
1195
1229
|
* @param props.multiple - Whether multiple selection is allowed (renders removable tags and
|
|
@@ -1615,4 +1649,40 @@ declare function unorderedList(props?: {
|
|
|
1615
1649
|
color?: ValueOrState<ThemeColor>;
|
|
1616
1650
|
}): PartialElement;
|
|
1617
1651
|
|
|
1618
|
-
|
|
1652
|
+
/**
|
|
1653
|
+
* Visually hides an element while keeping it in the accessibility tree — the
|
|
1654
|
+
* classic "sr-only" recipe for screen-reader-only labels, live-region text,
|
|
1655
|
+
* and skip links (before focus). Styles the host only; apply to any element.
|
|
1656
|
+
*
|
|
1657
|
+
* @example { span: "Opens in a new tab", $: [visuallyHidden()] }
|
|
1658
|
+
*/
|
|
1659
|
+
declare function visuallyHidden(): PartialElement;
|
|
1660
|
+
|
|
1661
|
+
/** Named elevation levels for floating/raised surfaces. */
|
|
1662
|
+
type ElevationLevel = "low" | "medium" | "high";
|
|
1663
|
+
/**
|
|
1664
|
+
* Shared box-shadow value for a named elevation level. Used by floating/raised
|
|
1665
|
+
* surface patches (popover, menu, dialog, drawer, toast, tooltip, combobox/
|
|
1666
|
+
* selectBox dropdown, datePicker popup, fab) so elevation reads consistently
|
|
1667
|
+
* across the library instead of each patch picking its own shadow.
|
|
1668
|
+
*/
|
|
1669
|
+
declare function elevation(level: ElevationLevel): string;
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* Shared `:focus-visible` ring — ring-offset pattern used by Radix / shadcn /
|
|
1673
|
+
* Vercel / Linear:
|
|
1674
|
+
*
|
|
1675
|
+
* 1. 2px "gap" in the surface tone (reads as space between control + ring)
|
|
1676
|
+
* 2. 2px accent halo outside that gap
|
|
1677
|
+
*
|
|
1678
|
+
* Implemented as a layered `box-shadow` so it composes with a control's own
|
|
1679
|
+
* resting outline / elevation instead of replacing them. Prefer this over a
|
|
1680
|
+
* flush `0 0 0 2px` ring (looks like a thick pastel border glued to the edge)
|
|
1681
|
+
* and over the browser default outline.
|
|
1682
|
+
*
|
|
1683
|
+
* Accent at `shift-9` stays legible on both light and dark surfaces; the
|
|
1684
|
+
* washed `shift-6` flush ring is what made focus look broken in product UIs.
|
|
1685
|
+
*/
|
|
1686
|
+
declare function focusRing(listener: Listener, color?: ThemeColor): string;
|
|
1687
|
+
|
|
1688
|
+
export { type ButtonVariant, type DatePickerProps, type DatePickerValue, type ElevationLevel, type FlexAlign, type FlexJustify, type MenuItem, type MotionKeyframe, type MotionProps, type SegmentedItem, type StepItem, type TabItem, type ToggleItem, abbreviation, accordion, alert, avatar, badge, blockquote, breadcrumb, breadcrumbEllipsis, button, buttonGhost, buttonSwitch, card, code, combobox, command, commandItem, commandSearch, datePicker, descriptionList, details, dialog, divider, drawer, elevation, emphasis, empty, errorBoundary, fab, figure, focusRing, formGroup, grid, heading, horizontalRule, icon, image, inputCheckbox, inputColor, inputDateTime, inputFile, inputNumber, inputOTP, inputPassword, inputRadio, inputRange, inputSearch, inputSwitch, inputText, keyboard, label, link, linkButton, list, listItem, listItemButton, mark, menu, motion, orderedList, pagination, panelSection, paragraph, popover, popoverArrow, preformated, progress, rating, ringProgress, row, scrollArea, segmented, select, selectBox, selectItem, selectList, skeleton, small, spinner, splitter, splitterHandle, splitterPanel, stack, steps, strong, subscript, superscript, table, tabs, tag, textarea, timeline, timelineItem, toast, toggleGroup, toolbar, toolbarSpacer, tooltip, transitionGroup, unorderedList, visuallyHidden };
|