@domphy/ui 0.20.2 → 0.20.6
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/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 +30 -40
- package/dist/index.d.ts +30 -40
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -23,7 +23,7 @@ declare function abbreviation(props?: {
|
|
|
23
23
|
*
|
|
24
24
|
* @param props.type - `"single"` (default) or `"multiple"`. Single mode auto-closes siblings.
|
|
25
25
|
* @param props.color - Theme color tone for borders and backgrounds. Defaults to `"neutral"`.
|
|
26
|
-
* @param props.accentColor - Accent color for focus
|
|
26
|
+
* @param props.accentColor - Accent color for focus rings on summary. Defaults to `"primary"`.
|
|
27
27
|
* @example
|
|
28
28
|
* { div: [
|
|
29
29
|
* { details: [{ summary: "Section A" }, { p: "Content A" }], $: [details()] },
|
|
@@ -125,8 +125,9 @@ type ButtonSize = keyof typeof BUTTON_SIZE_FONT;
|
|
|
125
125
|
|
|
126
126
|
type ButtonVariant = "solid" | "outline" | "ghost";
|
|
127
127
|
/**
|
|
128
|
-
* A themed button control with density-aware padding/radius and hover,
|
|
129
|
-
* `[disabled]`, and `[aria-busy=true]` states.
|
|
128
|
+
* A themed button control with density-aware padding/radius and hover, pressed
|
|
129
|
+
* (`:active` ±2), focus-visible, `[disabled]`, and `[aria-busy=true]` states.
|
|
130
|
+
* Apply to a `<button>` element.
|
|
130
131
|
*
|
|
131
132
|
* @hostTag button
|
|
132
133
|
* @param props.color - Button color tone. Optional `ValueOrState<ThemeColor>`, default "primary".
|
|
@@ -260,7 +261,7 @@ declare function commandSearch(props?: {
|
|
|
260
261
|
* used inside a `command()`.
|
|
261
262
|
*
|
|
262
263
|
* @param props.color - Base theme color tone. Defaults to "neutral".
|
|
263
|
-
* @param props.accentColor - Accent color used for the focus
|
|
264
|
+
* @param props.accentColor - Accent color used for the focus ring. Defaults to "primary".
|
|
264
265
|
* @example { button: "Open file", $: [commandItem({ color: "neutral" })] }
|
|
265
266
|
*/
|
|
266
267
|
declare function commandItem(props?: {
|
|
@@ -340,7 +341,7 @@ declare function descriptionList(props?: {
|
|
|
340
341
|
*
|
|
341
342
|
* @hostTag details
|
|
342
343
|
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the body/summary. Defaults to "neutral".
|
|
343
|
-
* @param props.accentColor - Accent color (`ValueOrState<ThemeColor>`) for the summary's focus
|
|
344
|
+
* @param props.accentColor - Accent color (`ValueOrState<ThemeColor>`) for the summary's focus ring. Defaults to "primary".
|
|
344
345
|
* @param props.duration - Open/close transition duration in milliseconds. Defaults to 240.
|
|
345
346
|
* @example { details: [{ summary: "More" }, { div: "Body" }], $: [details()] }
|
|
346
347
|
*/
|
|
@@ -571,7 +572,7 @@ declare function inputCheckbox(props?: {
|
|
|
571
572
|
* @param props.accentColor - Optional theme color tone (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
572
573
|
* @example { input: null, type: "color", $: [inputColor()] }
|
|
573
574
|
*/
|
|
574
|
-
declare function inputColor(
|
|
575
|
+
declare function inputColor(props?: {
|
|
575
576
|
color?: ValueOrState<ThemeColor>;
|
|
576
577
|
accentColor?: ValueOrState<ThemeColor>;
|
|
577
578
|
}): PartialElement;
|
|
@@ -624,6 +625,17 @@ declare function inputNumber(props?: {
|
|
|
624
625
|
accentColor?: ValueOrState<ThemeColor>;
|
|
625
626
|
}): PartialElement;
|
|
626
627
|
|
|
628
|
+
/**
|
|
629
|
+
* Lays out a one-time-password container as a horizontal row of inputs and
|
|
630
|
+
* wires keyboard navigation: auto-advance on input, backspace/arrow movement,
|
|
631
|
+
* and paste distribution across the child inputs. Apply to a container element
|
|
632
|
+
* (e.g. `<div>`) whose direct children are the OTP `<input>` boxes. Takes no
|
|
633
|
+
* props.
|
|
634
|
+
*
|
|
635
|
+
* @example { div: null, $: [inputOTP()], children: [{ input: null }, { input: null }] }
|
|
636
|
+
*/
|
|
637
|
+
declare function inputOTP(): PartialElement;
|
|
638
|
+
|
|
627
639
|
/**
|
|
628
640
|
* Password input wrapper: a styled `<div>` that inserts an `<input type="password">`
|
|
629
641
|
* and a show/hide toggle button. The outer div carries the focus-ring outline via
|
|
@@ -639,17 +651,6 @@ declare function inputPassword(props?: {
|
|
|
639
651
|
accentColor?: ValueOrState<ThemeColor>;
|
|
640
652
|
}): PartialElement;
|
|
641
653
|
|
|
642
|
-
/**
|
|
643
|
-
* Lays out a one-time-password container as a horizontal row of inputs and
|
|
644
|
-
* wires keyboard navigation: auto-advance on input, backspace/arrow movement,
|
|
645
|
-
* and paste distribution across the child inputs. Apply to a container element
|
|
646
|
-
* (e.g. `<div>`) whose direct children are the OTP `<input>` boxes. Takes no
|
|
647
|
-
* props.
|
|
648
|
-
*
|
|
649
|
-
* @example { div: null, $: [inputOTP()], children: [{ input: null }, { input: null }] }
|
|
650
|
-
*/
|
|
651
|
-
declare function inputOTP(): PartialElement;
|
|
652
|
-
|
|
653
654
|
/**
|
|
654
655
|
* Styles a custom radio button with a themed circular box, checked dot, hover,
|
|
655
656
|
* focus and disabled states. Apply to an `<input>` element of type `radio`
|
|
@@ -769,16 +770,21 @@ declare function link(props?: {
|
|
|
769
770
|
}): PartialElement;
|
|
770
771
|
|
|
771
772
|
/**
|
|
772
|
-
* An `<a>` element styled to look like a button — same visual
|
|
773
|
-
* `button()`
|
|
774
|
-
* Apply to an `<a>` element.
|
|
773
|
+
* An `<a>` element styled to look like a button — same visual system as
|
|
774
|
+
* `button()` (`variant` / `size` / color) while preserving link semantics
|
|
775
|
+
* (href, middle-click, right-click). Apply to an `<a>` element.
|
|
775
776
|
*
|
|
776
777
|
* @hostTag a
|
|
777
778
|
* @param props.color - Button color tone. Optional `ValueOrState<ThemeColor>`, default "primary".
|
|
779
|
+
* @param props.variant - `"outline"` (default) | `"solid"` | `"ghost"` — matches `button()`.
|
|
780
|
+
* @param props.size - `"small" | "medium" | "large"`, defaults to `"medium"`.
|
|
778
781
|
* @example { a: "Open app", href: "/app", $: [linkButton({ color: "primary" })] }
|
|
782
|
+
* @example { a: "Get started", href: "/start", $: [linkButton({ variant: "solid" })] }
|
|
779
783
|
*/
|
|
780
784
|
declare function linkButton(props?: {
|
|
781
785
|
color?: ValueOrState<ThemeColor>;
|
|
786
|
+
variant?: ButtonVariant;
|
|
787
|
+
size?: ButtonSize;
|
|
782
788
|
}): PartialElement;
|
|
783
789
|
|
|
784
790
|
/**
|
|
@@ -893,23 +899,6 @@ interface MotionProps {
|
|
|
893
899
|
iterations?: number;
|
|
894
900
|
};
|
|
895
901
|
}
|
|
896
|
-
/**
|
|
897
|
-
* Animation primitive driven by the Web Animations API. Runs an enter
|
|
898
|
-
* animation on mount (`initial` -> `animate`), re-animates whenever `animate`
|
|
899
|
-
* is a `State` that changes, and plays the `exit` keyframe before removal.
|
|
900
|
-
* Has no host-tag restriction; apply to any element you want to animate.
|
|
901
|
-
*
|
|
902
|
-
* @param props - Optional configuration (see {@link MotionProps}).
|
|
903
|
-
* @param props.initial - Starting keyframe applied before the enter animation.
|
|
904
|
-
* @param props.animate - Target keyframe, or a `State` to re-animate on change.
|
|
905
|
-
* @param props.exit - Keyframe animated to before the element is removed.
|
|
906
|
-
* @param props.transition - Timing options.
|
|
907
|
-
* @param props.transition.duration - Duration in ms. Defaults to `300`.
|
|
908
|
-
* @param props.transition.delay - Delay in ms. Defaults to `0`.
|
|
909
|
-
* @param props.transition.easing - CSS easing. Defaults to `"ease"`.
|
|
910
|
-
* @param props.transition.iterations - Number of iterations. Defaults to `1`.
|
|
911
|
-
* @example { div: "Hello", $: [motion({ initial: { opacity: 0 }, animate: { opacity: 1 } })] }
|
|
912
|
-
*/
|
|
913
902
|
declare function motion(props?: MotionProps): PartialElement;
|
|
914
903
|
|
|
915
904
|
/**
|
|
@@ -1268,9 +1257,10 @@ declare function selectList(props?: {
|
|
|
1268
1257
|
}): PartialElement;
|
|
1269
1258
|
|
|
1270
1259
|
/**
|
|
1271
|
-
* A loading placeholder block with a
|
|
1272
|
-
* background/foreground, fixed height, slight rounding.
|
|
1273
|
-
* to a block-level element such as a
|
|
1260
|
+
* A loading placeholder block with a left-to-right shimmer gradient. Marked
|
|
1261
|
+
* `aria-hidden`, themed background/foreground, fixed height, slight rounding.
|
|
1262
|
+
* No host-tag check; typically applied to a block-level element such as a
|
|
1263
|
+
* `div` or `span`.
|
|
1274
1264
|
*
|
|
1275
1265
|
* @param props.color - Theme color tone for the placeholder. Accepts a value or reactive state.
|
|
1276
1266
|
* Defaults to `"neutral"`.
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare function abbreviation(props?: {
|
|
|
23
23
|
*
|
|
24
24
|
* @param props.type - `"single"` (default) or `"multiple"`. Single mode auto-closes siblings.
|
|
25
25
|
* @param props.color - Theme color tone for borders and backgrounds. Defaults to `"neutral"`.
|
|
26
|
-
* @param props.accentColor - Accent color for focus
|
|
26
|
+
* @param props.accentColor - Accent color for focus rings on summary. Defaults to `"primary"`.
|
|
27
27
|
* @example
|
|
28
28
|
* { div: [
|
|
29
29
|
* { details: [{ summary: "Section A" }, { p: "Content A" }], $: [details()] },
|
|
@@ -125,8 +125,9 @@ type ButtonSize = keyof typeof BUTTON_SIZE_FONT;
|
|
|
125
125
|
|
|
126
126
|
type ButtonVariant = "solid" | "outline" | "ghost";
|
|
127
127
|
/**
|
|
128
|
-
* A themed button control with density-aware padding/radius and hover,
|
|
129
|
-
* `[disabled]`, and `[aria-busy=true]` states.
|
|
128
|
+
* A themed button control with density-aware padding/radius and hover, pressed
|
|
129
|
+
* (`:active` ±2), focus-visible, `[disabled]`, and `[aria-busy=true]` states.
|
|
130
|
+
* Apply to a `<button>` element.
|
|
130
131
|
*
|
|
131
132
|
* @hostTag button
|
|
132
133
|
* @param props.color - Button color tone. Optional `ValueOrState<ThemeColor>`, default "primary".
|
|
@@ -260,7 +261,7 @@ declare function commandSearch(props?: {
|
|
|
260
261
|
* used inside a `command()`.
|
|
261
262
|
*
|
|
262
263
|
* @param props.color - Base theme color tone. Defaults to "neutral".
|
|
263
|
-
* @param props.accentColor - Accent color used for the focus
|
|
264
|
+
* @param props.accentColor - Accent color used for the focus ring. Defaults to "primary".
|
|
264
265
|
* @example { button: "Open file", $: [commandItem({ color: "neutral" })] }
|
|
265
266
|
*/
|
|
266
267
|
declare function commandItem(props?: {
|
|
@@ -340,7 +341,7 @@ declare function descriptionList(props?: {
|
|
|
340
341
|
*
|
|
341
342
|
* @hostTag details
|
|
342
343
|
* @param props.color - Theme color tone (`ValueOrState<ThemeColor>`) for the body/summary. Defaults to "neutral".
|
|
343
|
-
* @param props.accentColor - Accent color (`ValueOrState<ThemeColor>`) for the summary's focus
|
|
344
|
+
* @param props.accentColor - Accent color (`ValueOrState<ThemeColor>`) for the summary's focus ring. Defaults to "primary".
|
|
344
345
|
* @param props.duration - Open/close transition duration in milliseconds. Defaults to 240.
|
|
345
346
|
* @example { details: [{ summary: "More" }, { div: "Body" }], $: [details()] }
|
|
346
347
|
*/
|
|
@@ -571,7 +572,7 @@ declare function inputCheckbox(props?: {
|
|
|
571
572
|
* @param props.accentColor - Optional theme color tone (`ValueOrState<ThemeColor>`). Defaults to `"primary"`.
|
|
572
573
|
* @example { input: null, type: "color", $: [inputColor()] }
|
|
573
574
|
*/
|
|
574
|
-
declare function inputColor(
|
|
575
|
+
declare function inputColor(props?: {
|
|
575
576
|
color?: ValueOrState<ThemeColor>;
|
|
576
577
|
accentColor?: ValueOrState<ThemeColor>;
|
|
577
578
|
}): PartialElement;
|
|
@@ -624,6 +625,17 @@ declare function inputNumber(props?: {
|
|
|
624
625
|
accentColor?: ValueOrState<ThemeColor>;
|
|
625
626
|
}): PartialElement;
|
|
626
627
|
|
|
628
|
+
/**
|
|
629
|
+
* Lays out a one-time-password container as a horizontal row of inputs and
|
|
630
|
+
* wires keyboard navigation: auto-advance on input, backspace/arrow movement,
|
|
631
|
+
* and paste distribution across the child inputs. Apply to a container element
|
|
632
|
+
* (e.g. `<div>`) whose direct children are the OTP `<input>` boxes. Takes no
|
|
633
|
+
* props.
|
|
634
|
+
*
|
|
635
|
+
* @example { div: null, $: [inputOTP()], children: [{ input: null }, { input: null }] }
|
|
636
|
+
*/
|
|
637
|
+
declare function inputOTP(): PartialElement;
|
|
638
|
+
|
|
627
639
|
/**
|
|
628
640
|
* Password input wrapper: a styled `<div>` that inserts an `<input type="password">`
|
|
629
641
|
* and a show/hide toggle button. The outer div carries the focus-ring outline via
|
|
@@ -639,17 +651,6 @@ declare function inputPassword(props?: {
|
|
|
639
651
|
accentColor?: ValueOrState<ThemeColor>;
|
|
640
652
|
}): PartialElement;
|
|
641
653
|
|
|
642
|
-
/**
|
|
643
|
-
* Lays out a one-time-password container as a horizontal row of inputs and
|
|
644
|
-
* wires keyboard navigation: auto-advance on input, backspace/arrow movement,
|
|
645
|
-
* and paste distribution across the child inputs. Apply to a container element
|
|
646
|
-
* (e.g. `<div>`) whose direct children are the OTP `<input>` boxes. Takes no
|
|
647
|
-
* props.
|
|
648
|
-
*
|
|
649
|
-
* @example { div: null, $: [inputOTP()], children: [{ input: null }, { input: null }] }
|
|
650
|
-
*/
|
|
651
|
-
declare function inputOTP(): PartialElement;
|
|
652
|
-
|
|
653
654
|
/**
|
|
654
655
|
* Styles a custom radio button with a themed circular box, checked dot, hover,
|
|
655
656
|
* focus and disabled states. Apply to an `<input>` element of type `radio`
|
|
@@ -769,16 +770,21 @@ declare function link(props?: {
|
|
|
769
770
|
}): PartialElement;
|
|
770
771
|
|
|
771
772
|
/**
|
|
772
|
-
* An `<a>` element styled to look like a button — same visual
|
|
773
|
-
* `button()`
|
|
774
|
-
* Apply to an `<a>` element.
|
|
773
|
+
* An `<a>` element styled to look like a button — same visual system as
|
|
774
|
+
* `button()` (`variant` / `size` / color) while preserving link semantics
|
|
775
|
+
* (href, middle-click, right-click). Apply to an `<a>` element.
|
|
775
776
|
*
|
|
776
777
|
* @hostTag a
|
|
777
778
|
* @param props.color - Button color tone. Optional `ValueOrState<ThemeColor>`, default "primary".
|
|
779
|
+
* @param props.variant - `"outline"` (default) | `"solid"` | `"ghost"` — matches `button()`.
|
|
780
|
+
* @param props.size - `"small" | "medium" | "large"`, defaults to `"medium"`.
|
|
778
781
|
* @example { a: "Open app", href: "/app", $: [linkButton({ color: "primary" })] }
|
|
782
|
+
* @example { a: "Get started", href: "/start", $: [linkButton({ variant: "solid" })] }
|
|
779
783
|
*/
|
|
780
784
|
declare function linkButton(props?: {
|
|
781
785
|
color?: ValueOrState<ThemeColor>;
|
|
786
|
+
variant?: ButtonVariant;
|
|
787
|
+
size?: ButtonSize;
|
|
782
788
|
}): PartialElement;
|
|
783
789
|
|
|
784
790
|
/**
|
|
@@ -893,23 +899,6 @@ interface MotionProps {
|
|
|
893
899
|
iterations?: number;
|
|
894
900
|
};
|
|
895
901
|
}
|
|
896
|
-
/**
|
|
897
|
-
* Animation primitive driven by the Web Animations API. Runs an enter
|
|
898
|
-
* animation on mount (`initial` -> `animate`), re-animates whenever `animate`
|
|
899
|
-
* is a `State` that changes, and plays the `exit` keyframe before removal.
|
|
900
|
-
* Has no host-tag restriction; apply to any element you want to animate.
|
|
901
|
-
*
|
|
902
|
-
* @param props - Optional configuration (see {@link MotionProps}).
|
|
903
|
-
* @param props.initial - Starting keyframe applied before the enter animation.
|
|
904
|
-
* @param props.animate - Target keyframe, or a `State` to re-animate on change.
|
|
905
|
-
* @param props.exit - Keyframe animated to before the element is removed.
|
|
906
|
-
* @param props.transition - Timing options.
|
|
907
|
-
* @param props.transition.duration - Duration in ms. Defaults to `300`.
|
|
908
|
-
* @param props.transition.delay - Delay in ms. Defaults to `0`.
|
|
909
|
-
* @param props.transition.easing - CSS easing. Defaults to `"ease"`.
|
|
910
|
-
* @param props.transition.iterations - Number of iterations. Defaults to `1`.
|
|
911
|
-
* @example { div: "Hello", $: [motion({ initial: { opacity: 0 }, animate: { opacity: 1 } })] }
|
|
912
|
-
*/
|
|
913
902
|
declare function motion(props?: MotionProps): PartialElement;
|
|
914
903
|
|
|
915
904
|
/**
|
|
@@ -1268,9 +1257,10 @@ declare function selectList(props?: {
|
|
|
1268
1257
|
}): PartialElement;
|
|
1269
1258
|
|
|
1270
1259
|
/**
|
|
1271
|
-
* A loading placeholder block with a
|
|
1272
|
-
* background/foreground, fixed height, slight rounding.
|
|
1273
|
-
* to a block-level element such as a
|
|
1260
|
+
* A loading placeholder block with a left-to-right shimmer gradient. Marked
|
|
1261
|
+
* `aria-hidden`, themed background/foreground, fixed height, slight rounding.
|
|
1262
|
+
* No host-tag check; typically applied to a block-level element such as a
|
|
1263
|
+
* `div` or `span`.
|
|
1274
1264
|
*
|
|
1275
1265
|
* @param props.color - Theme color tone for the placeholder. Accepts a value or reactive state.
|
|
1276
1266
|
* Defaults to `"neutral"`.
|