elements-kit 0.20.0 → 0.22.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/README.md +20 -19
- package/dist/attributes.d.mts +1 -1
- package/dist/await.d.mts +6 -5
- package/dist/await.mjs +0 -36
- package/dist/{types-ncUK9rki.d.mts → children-s3nFjpLA.d.mts} +125 -227
- package/dist/custom-elements-CdpilMDu.d.mts +87 -0
- package/dist/custom-elements.d.mts +2 -2
- package/dist/{element-D3om9yA6.mjs → element-Di0PYFX1.mjs} +15 -38
- package/dist/for.d.mts +9 -4
- package/dist/for.mjs +1 -1
- package/dist/{fragment-ROPRBJQd.mjs → fragment-Bvs1sGu1.mjs} +3 -3
- package/dist/hydrate/index.mjs +1 -1
- package/dist/{hydrate-6Qx4n4Su.mjs → hydrate-CHomBRY9.mjs} +4 -4
- package/dist/integrations/astro-client.mjs +2 -2
- package/dist/integrations/astro-server.mjs +2 -2
- package/dist/integrations/astro-slots.d.mts +6 -5
- package/dist/integrations/astro-slots.mjs +9 -8
- package/dist/integrations/react.d.mts +1 -1
- package/dist/integrations/react.mjs +1 -1
- package/dist/jsx-runtime/index.d.mts +2 -2
- package/dist/jsx-runtime/index.mjs +2 -2
- package/dist/polyfill-BVNd6ogU.d.mts +9 -0
- package/dist/render.mjs +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/{server-iFSng50i.mjs → server-CTkyXTV6.mjs} +2 -2
- package/dist/signals/index.d.mts +1 -1
- package/dist/slot.d.mts +83 -2
- package/dist/slot.mjs +179 -2
- package/dist/ui/badge/badge.css +5 -5
- package/dist/ui/button/button.css +15 -15
- package/dist/ui/card/card.css +2 -2
- package/dist/ui/group/group.css +61 -0
- package/dist/ui/marketing/marketing.css +5 -3
- package/dist/ui/otp-input/index.d.mts +132 -0
- package/dist/ui/otp-input/index.mjs +328 -0
- package/dist/ui/otp-input/otp-input.css +157 -0
- package/dist/ui/overlay/index.css +52 -4
- package/dist/ui/overlay/index.d.mts +237 -63
- package/dist/ui/overlay/index.mjs +658 -66
- package/dist/ui/overlay/overlay.css +58 -2
- package/dist/ui/styles/index.css +664 -0
- package/dist/ui/styles/radius.css +7 -7
- package/dist/ui/styles/unset.css +212 -210
- package/dist/utilities/active-element.d.mts +1 -1
- package/dist/utilities/async.d.mts +1 -1
- package/dist/utilities/debounced.d.mts +1 -1
- package/dist/utilities/dom-lifecycle.bench.mjs +2 -2
- package/dist/utilities/element-rect.d.mts +1 -1
- package/dist/utilities/element-scroll.d.mts +1 -1
- package/dist/utilities/event-driven.d.mts +1 -1
- package/dist/utilities/event-listener.d.mts +1 -1
- package/dist/utilities/focus-within.d.mts +1 -1
- package/dist/utilities/hover.d.mts +1 -1
- package/dist/utilities/interval.d.mts +1 -1
- package/dist/utilities/location.d.mts +1 -1
- package/dist/utilities/media-devices.d.mts +1 -1
- package/dist/utilities/media-player.d.mts +1 -1
- package/dist/utilities/media-query.d.mts +1 -1
- package/dist/utilities/network.d.mts +1 -1
- package/dist/utilities/orientation.d.mts +1 -1
- package/dist/utilities/previous.d.mts +1 -1
- package/dist/utilities/promise.d.mts +1 -1
- package/dist/utilities/routing.d.mts +1 -1
- package/dist/utilities/search-params.d.mts +1 -1
- package/dist/utilities/storage.d.mts +1 -1
- package/dist/utilities/throttled.d.mts +1 -1
- package/dist/utilities/timeout.d.mts +1 -1
- package/dist/utilities/window-focus.d.mts +1 -1
- package/dist/utilities/window-size.d.mts +1 -1
- package/package.json +10 -1
- package/dist/custom-elements-DK5VUcWA.d.mts +0 -55
- package/dist/slot-BFWXeFRl.d.mts +0 -77
- package/dist/slot-Dvf30O0B.mjs +0 -138
- /package/dist/{attributes-3r7Diua4.d.mts → attributes-DILeh3-s.d.mts} +0 -0
- /package/dist/{scope-zbEG299F.mjs → scope-C1vELXqP.mjs} +0 -0
package/dist/slot.mjs
CHANGED
|
@@ -1,2 +1,179 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import "./polyfill-CdZVCxdo.mjs";
|
|
2
|
+
//#region src/slot.ts
|
|
3
|
+
/**
|
|
4
|
+
* A lightweight slot that reserves a region in the DOM using comment markers.
|
|
5
|
+
* Content between the markers can be replaced dynamically without wrapper elements.
|
|
6
|
+
*/
|
|
7
|
+
var Slot = class Slot {
|
|
8
|
+
#start;
|
|
9
|
+
#end;
|
|
10
|
+
#pending;
|
|
11
|
+
/**
|
|
12
|
+
* Bind a slot to an existing marker pair (server-rendered comments) instead
|
|
13
|
+
* of creating new ones. Used by the hydrate claim pass: content between the
|
|
14
|
+
* markers is adopted as the slot's current content.
|
|
15
|
+
*/
|
|
16
|
+
static claim(start, end) {
|
|
17
|
+
const slot = new Slot();
|
|
18
|
+
slot.#start = start;
|
|
19
|
+
slot.#end = end;
|
|
20
|
+
return slot;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Render the slot as a DocumentFragment.
|
|
24
|
+
* If not yet mounted, inserts the comment markers and any default content
|
|
25
|
+
* (`Node`s or strings — native `append()` semantics; strings become text
|
|
26
|
+
* nodes). If already mounted, extracts and returns the current content
|
|
27
|
+
* WITHOUT disposing it — the caller takes ownership of the returned nodes
|
|
28
|
+
* and is responsible for their disposal.
|
|
29
|
+
*/
|
|
30
|
+
get(...nodes) {
|
|
31
|
+
const fragment = document.createDocumentFragment();
|
|
32
|
+
if (this.isMounted()) {
|
|
33
|
+
const range = document.createRange();
|
|
34
|
+
range.setStartAfter(this.#start);
|
|
35
|
+
range.setEndBefore(this.#end);
|
|
36
|
+
fragment.appendChild(range.extractContents());
|
|
37
|
+
return fragment;
|
|
38
|
+
}
|
|
39
|
+
const start = this.#start ??= document.createComment("{");
|
|
40
|
+
const end = this.#end ??= document.createComment("}");
|
|
41
|
+
fragment.appendChild(start);
|
|
42
|
+
fragment.appendChild(end);
|
|
43
|
+
const initialContent = this.#pending ?? toContent(nodes);
|
|
44
|
+
if (initialContent) fragment.insertBefore(initialContent, end);
|
|
45
|
+
this.#pending = void 0;
|
|
46
|
+
return fragment;
|
|
47
|
+
}
|
|
48
|
+
/** Dispose reactive children and remove all content between the markers. */
|
|
49
|
+
clear() {
|
|
50
|
+
if (!this.#start || !this.#end) return;
|
|
51
|
+
let node = this.#start.nextSibling;
|
|
52
|
+
while (node && node !== this.#end) {
|
|
53
|
+
const next = node.nextSibling;
|
|
54
|
+
if (node instanceof Element) node[Symbol.dispose]?.();
|
|
55
|
+
node = next;
|
|
56
|
+
}
|
|
57
|
+
const range = document.createRange();
|
|
58
|
+
range.setStartAfter(this.#start);
|
|
59
|
+
range.setEndBefore(this.#end);
|
|
60
|
+
range.deleteContents();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Replace the slot's content with the given nodes/strings (native
|
|
64
|
+
* `append()` semantics; strings become text nodes). No args clears the
|
|
65
|
+
* slot. Buffers until mounted; no-op if the content is identical.
|
|
66
|
+
*/
|
|
67
|
+
set(...nodes) {
|
|
68
|
+
const content = toContent(nodes);
|
|
69
|
+
if (content == null) {
|
|
70
|
+
this.clear();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const parent = this.parent();
|
|
74
|
+
if (!parent) {
|
|
75
|
+
this.#pending = content;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (this.#isSame(content)) return;
|
|
79
|
+
this.clear();
|
|
80
|
+
parent.insertBefore(content, this.#end);
|
|
81
|
+
this.#pending = void 0;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Extract and return the current slot content as a DocumentFragment.
|
|
85
|
+
* Returns `null` if the slot is not mounted.
|
|
86
|
+
* Content is NOT disposed — the caller takes ownership and is responsible
|
|
87
|
+
* for disposal.
|
|
88
|
+
*/
|
|
89
|
+
current() {
|
|
90
|
+
if (!this.isMounted()) return null;
|
|
91
|
+
const range = document.createRange();
|
|
92
|
+
range.setStartAfter(this.#start);
|
|
93
|
+
range.setEndBefore(this.#end);
|
|
94
|
+
return range.extractContents();
|
|
95
|
+
}
|
|
96
|
+
/** Returns the parent node if the slot is mounted, otherwise `null`. */
|
|
97
|
+
parent() {
|
|
98
|
+
return this.isMounted() ? this.#start.parentNode : null;
|
|
99
|
+
}
|
|
100
|
+
/** Whether the slot's comment markers are attached to the DOM. */
|
|
101
|
+
isMounted() {
|
|
102
|
+
return !!this.#start && this.#start.parentNode !== null && this.#start.parentNode === this.#end.parentNode;
|
|
103
|
+
}
|
|
104
|
+
#isSame(element) {
|
|
105
|
+
return this.#start.nextSibling === element && this.#end === element.nextSibling;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
function toContent(nodes) {
|
|
109
|
+
if (nodes.length === 0) return void 0;
|
|
110
|
+
if (nodes.length === 1 && nodes[0] instanceof Node) return nodes[0];
|
|
111
|
+
const frag = document.createDocumentFragment();
|
|
112
|
+
frag.append(...nodes);
|
|
113
|
+
return frag;
|
|
114
|
+
}
|
|
115
|
+
function toArgs(value) {
|
|
116
|
+
return Array.isArray(value) ? value.flat(Infinity) : [value];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Field decorator declaring a slot as a plain property backed by a
|
|
120
|
+
* {@link Slot}. Reading returns the slot's region (`slot.get()` — a fragment
|
|
121
|
+
* to append into any template, elements-kit JSX or not); assigning fills it
|
|
122
|
+
* (`null` clears). Values follow native `append()` semantics — a `Node`, a
|
|
123
|
+
* string, or an array of them. Assignment buffers before mount, so consumers
|
|
124
|
+
* can set content before the element renders.
|
|
125
|
+
*
|
|
126
|
+
* The getter is EFFECTFUL: it mounts the markers on first read and extracts
|
|
127
|
+
* current content on later reads (the re-render semantic of
|
|
128
|
+
* {@link Slot.get}). Read it to PLACE the region, not to inspect it.
|
|
129
|
+
*
|
|
130
|
+
* Declare the field as {@link SlotContent} to accept the full native
|
|
131
|
+
* `append()` surface (`Node` | string | array); narrow it to `Node` when the
|
|
132
|
+
* slot only ever holds an element.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```tsx
|
|
136
|
+
* class Card extends HTMLElement {
|
|
137
|
+
* \@slot() header!: SlotContent;
|
|
138
|
+
*
|
|
139
|
+
* render() {
|
|
140
|
+
* return <header>{this.header}</header>; // or root.append(card.header)
|
|
141
|
+
* }
|
|
142
|
+
* }
|
|
143
|
+
*
|
|
144
|
+
* // consumers — any framework, or none:
|
|
145
|
+
* card.header = document.createElement("h1"); // Node
|
|
146
|
+
* card.header = "plain text"; // native append() content
|
|
147
|
+
* card.header = null; // clear
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
function slot() {
|
|
151
|
+
const store = /* @__PURE__ */ new WeakMap();
|
|
152
|
+
return function(_target, context) {
|
|
153
|
+
context.addInitializer(function() {
|
|
154
|
+
const s = store.get(this);
|
|
155
|
+
Object.defineProperty(this, context.name, {
|
|
156
|
+
get() {
|
|
157
|
+
return s.get();
|
|
158
|
+
},
|
|
159
|
+
set(value) {
|
|
160
|
+
if (value == null) {
|
|
161
|
+
s.clear();
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
s.set(...toArgs(value));
|
|
165
|
+
},
|
|
166
|
+
enumerable: true,
|
|
167
|
+
configurable: true
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
return function(initialValue) {
|
|
171
|
+
const s = new Slot();
|
|
172
|
+
store.set(this, s);
|
|
173
|
+
if (initialValue != null) s.set(...toArgs(initialValue));
|
|
174
|
+
return initialValue;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
export { Slot, slot };
|
package/dist/ui/badge/badge.css
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
border-radius: max(var(--radius-1), var(--radius-pill));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.x-badge:where([data-size="2"]) {
|
|
22
|
+
.x-badge:where([data-size="2"], :not([data-size])) {
|
|
23
23
|
font-size: var(--font-size-1);
|
|
24
24
|
line-height: var(--line-height-1);
|
|
25
25
|
letter-spacing: var(--letter-spacing-1);
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
border-radius: max(var(--radius-2), var(--radius-pill));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
.x-badge:where([data-variant="solid"]) {
|
|
40
|
+
.x-badge:where(:not([data-variant]), [data-variant="solid"]) {
|
|
41
41
|
background-color: var(--accent-9);
|
|
42
42
|
color: var(--accent-contrast);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.x-badge:where([data-variant="solid"])::selection {
|
|
45
|
+
.x-badge:where(:not([data-variant]), [data-variant="solid"])::selection {
|
|
46
46
|
background-color: var(--accent-7);
|
|
47
47
|
color: var(--accent-12);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.x-badge:where([data-variant="solid"]):where([data-high-contrast]) {
|
|
50
|
+
.x-badge:where(:not([data-variant]), [data-variant="solid"]):where([data-high-contrast]) {
|
|
51
51
|
background-color: var(--accent-12);
|
|
52
52
|
color: var(--accent-1);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.x-badge:where([data-variant="solid"]):where([data-high-contrast])::selection {
|
|
55
|
+
.x-badge:where(:not([data-variant]), [data-variant="solid"]):where([data-high-contrast])::selection {
|
|
56
56
|
background-color: var(--accent-a11);
|
|
57
57
|
color: var(--accent-1);
|
|
58
58
|
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
border-radius: max(var(--radius-1), var(--radius-pill));
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.x-button:where([data-size="2"]) {
|
|
36
|
+
.x-button:where([data-size="2"], :not([data-size])) {
|
|
37
37
|
--base-button-height: var(--space-6);
|
|
38
38
|
border-radius: max(var(--radius-2), var(--radius-pill));
|
|
39
39
|
}
|
|
@@ -64,61 +64,61 @@
|
|
|
64
64
|
saturate(1.2);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.x-button:where([data-variant="solid"]) {
|
|
67
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]) {
|
|
68
68
|
background-color: var(--accent-9);
|
|
69
69
|
color: var(--accent-contrast);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
@media (hover: hover) {
|
|
73
|
-
.x-button:where([data-variant="solid"]):where(:hover) {
|
|
73
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]):where(:hover) {
|
|
74
74
|
background-color: var(--accent-10);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
.x-button:where([data-variant="solid"]):where([data-state="open"]) {
|
|
78
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]):where([data-state="open"]) {
|
|
79
79
|
background-color: var(--accent-10);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
.x-button:where([data-variant="solid"]):where(:active:not([data-state="open"])) {
|
|
82
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]):where(:active:not([data-state="open"])) {
|
|
83
83
|
background-color: var(--accent-10);
|
|
84
84
|
filter: var(--base-button-solid-active-filter);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
@media (pointer: coarse) {
|
|
88
|
-
.x-button:where([data-variant="solid"]):where(:active:not([data-state="open"])) {
|
|
88
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]):where(:active:not([data-state="open"])) {
|
|
89
89
|
outline: .5em solid var(--accent-a4);
|
|
90
90
|
outline-offset: 0;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
.x-button:where([data-variant="solid"]):where(:focus-visible) {
|
|
94
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]):where(:focus-visible) {
|
|
95
95
|
outline: 2px solid var(--focus-8);
|
|
96
96
|
outline-offset: 2px;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
.x-button:where([data-variant="solid"]):where([data-high-contrast]) {
|
|
99
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]):where([data-high-contrast]) {
|
|
100
100
|
background-color: var(--accent-12);
|
|
101
101
|
color: var(--neutral-1);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
@media (hover: hover) {
|
|
105
|
-
.x-button:where([data-variant="solid"]):where([data-high-contrast]):where(:hover) {
|
|
105
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]):where([data-high-contrast]):where(:hover) {
|
|
106
106
|
background-color: var(--accent-12);
|
|
107
107
|
filter: var(--base-button-solid-high-contrast-hover-filter);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
.x-button:where([data-variant="solid"]):where([data-high-contrast]):where([data-state="open"]) {
|
|
111
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]):where([data-high-contrast]):where([data-state="open"]) {
|
|
112
112
|
background-color: var(--accent-12);
|
|
113
113
|
filter: var(--base-button-solid-high-contrast-hover-filter);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
.x-button:where([data-variant="solid"]):where([data-high-contrast]):where(:active:not([data-state="open"])) {
|
|
116
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]):where([data-high-contrast]):where(:active:not([data-state="open"])) {
|
|
117
117
|
background-color: var(--accent-12);
|
|
118
118
|
filter: var(--base-button-solid-high-contrast-active-filter);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
.x-button:where([data-variant="solid"]):where([data-disabled], :disabled) {
|
|
121
|
+
.x-button:where(:not([data-variant]), [data-variant="solid"]):where([data-disabled], :disabled) {
|
|
122
122
|
color: var(--neutral-a8);
|
|
123
123
|
background-color: var(--neutral-a3);
|
|
124
124
|
filter: none;
|
|
@@ -308,19 +308,19 @@
|
|
|
308
308
|
--button-text-padding-y: var(--space-1);
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
.x-button:where([data-size="2"]) {
|
|
311
|
+
.x-button:where([data-size="2"], :not([data-size])) {
|
|
312
312
|
gap: var(--space-2);
|
|
313
313
|
font-size: var(--font-size-2);
|
|
314
314
|
line-height: var(--line-height-2);
|
|
315
315
|
letter-spacing: var(--letter-spacing-2);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
.x-button:where([data-size="2"]):where(:not([data-variant="text"])) {
|
|
318
|
+
.x-button:where([data-size="2"], :not([data-size])):where(:not([data-variant="text"])) {
|
|
319
319
|
padding-left: var(--space-3);
|
|
320
320
|
padding-right: var(--space-3);
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
.x-button:where([data-size="2"]):where([data-variant="text"]) {
|
|
323
|
+
.x-button:where([data-size="2"], :not([data-size])):where([data-variant="text"]) {
|
|
324
324
|
gap: var(--space-1);
|
|
325
325
|
--button-text-padding-x: var(--space-2);
|
|
326
326
|
--button-text-padding-y: var(--space-1);
|
package/dist/ui/card/card.css
CHANGED
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
--card-border-radius: var(--radius-6);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
:where([data-neutral]) {
|
|
59
|
+
:where(:root), :where([data-neutral]) {
|
|
60
60
|
--card-surface-box-shadow: 0 0 0 1px var(--neutral-a5);
|
|
61
61
|
--card-surface-hover-box-shadow: 0 0 0 1px var(--neutral-a7);
|
|
62
62
|
--card-surface-active-box-shadow: 0 0 0 1px var(--neutral-a6);
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
@supports (color: color-mix(in oklab, white, black)) {
|
|
84
|
-
:where([data-neutral]) {
|
|
84
|
+
:where(:root), :where([data-neutral]) {
|
|
85
85
|
--card-surface-box-shadow: 0 0 0 1px
|
|
86
86
|
color-mix(in oklab, var(--neutral-a5), var(--neutral-5) 25%);
|
|
87
87
|
--card-surface-hover-box-shadow: 0 0 0 1px
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.x-group {
|
|
2
|
+
vertical-align: top;
|
|
3
|
+
isolation: isolate;
|
|
4
|
+
align-items: stretch;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.x-group > :is(.x-text-input, .x-select) {
|
|
9
|
+
flex: auto;
|
|
10
|
+
min-width: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.x-group > :is(.x-button, .x-text-input, .x-select, .x-toggle) {
|
|
14
|
+
z-index: 0;
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.x-group > :is(.x-button, .x-text-input, .x-select, .x-toggle):where(:hover, :focus-within) {
|
|
19
|
+
z-index: 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.x-group > :is(.x-button, .x-text-input, .x-select, .x-toggle):not(:first-child) {
|
|
23
|
+
margin-inline-start: -1px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.x-group > :is(.x-button, .x-text-input, .x-select, .x-toggle):not(:last-child) {
|
|
27
|
+
border-start-end-radius: 0;
|
|
28
|
+
border-end-end-radius: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.x-group > :is(.x-button, .x-text-input, .x-select, .x-toggle):not(:first-child) {
|
|
32
|
+
border-start-start-radius: 0;
|
|
33
|
+
border-end-start-radius: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.x-group > .x-text-input:not(:last-child) > input {
|
|
37
|
+
border-start-end-radius: 0;
|
|
38
|
+
border-end-end-radius: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.x-group > .x-text-input:not(:first-child) > input {
|
|
42
|
+
border-start-start-radius: 0;
|
|
43
|
+
border-end-start-radius: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.x-group > .x-button[data-variant="solid"] + .x-button[data-variant="solid"] {
|
|
47
|
+
box-shadow: inset 1px 0 0 0
|
|
48
|
+
color-mix(in srgb, var(--accent-contrast) 20%, transparent);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[dir="rtl"] .x-group > .x-button[data-variant="solid"] + .x-button[data-variant="solid"] {
|
|
52
|
+
box-shadow: inset -1px 0 0 0
|
|
53
|
+
color-mix(in srgb, var(--accent-contrast) 20%, transparent);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@media (forced-colors: active) {
|
|
57
|
+
.x-group > :is(.x-button, .x-text-input, .x-select, .x-toggle):not(:first-child) {
|
|
58
|
+
border-inline-start: 1px solid buttontext;
|
|
59
|
+
margin-inline-start: 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
@layer unset {
|
|
2
|
+
.hero :is(h1, h2, h3, h4, h5, h6, p), .section-header :is(h1, h2, h3, h4, h5, h6, p), .section-heading, .section-paragraph, .river-content :is(h1, h2, h3, h4, h5, h6, p), .pillar :is(h1, h2, h3, h4, h5, h6, p, [data-heading], [data-paragraph]), .cta-banner :is(h1, h2, h3, h4, h5, h6, p), .testimonial :is(blockquote, figcaption, cite, p), .statistic :is(p, [data-leading], [data-heading], [data-description]) {
|
|
3
|
+
margin: 0;
|
|
4
|
+
}
|
|
3
5
|
}
|
|
4
6
|
|
|
5
7
|
.hero {
|
|
@@ -32,7 +34,7 @@
|
|
|
32
34
|
@media (min-width: 64rem) {
|
|
33
35
|
.hero .section-paragraph {
|
|
34
36
|
font-size: var(--font-size-5);
|
|
35
|
-
line-height: var(--line-height-
|
|
37
|
+
line-height: var(--line-height-6);
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { n as AttrChangeHandler, t as ATTRIBUTES } from "../../attributes-DILeh3-s.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/ui/otp-input/otp-input.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* `<x-otp-input>` — segmented one-time-passcode / pin input.
|
|
6
|
+
*
|
|
7
|
+
* A single transparent `<input>` (rendered into the shadow root) overlays the
|
|
8
|
+
* author-composed cells and owns all keyboard / pointer / paste / mobile
|
|
9
|
+
* autofill behavior. The cells (`<x-otp-slot>`, projected through a `<slot>`)
|
|
10
|
+
* are a purely visual layer whose active cell + fake caret are mirrored from
|
|
11
|
+
* the input's selection. Because it is one field there is no roving tabindex
|
|
12
|
+
* and a screen reader perceives a single textbox.
|
|
13
|
+
*
|
|
14
|
+
* Form-associated: submits under the host `name`, participates in
|
|
15
|
+
* reset / restore / disabled, and reports `valueMissing` / `tooShort`.
|
|
16
|
+
*
|
|
17
|
+
* ```html
|
|
18
|
+
* <x-otp-input name="code" maxlength="6" pattern="[0-9]" aria-label="Code">
|
|
19
|
+
* <x-otp-group>
|
|
20
|
+
* <x-otp-slot index="0"></x-otp-slot>
|
|
21
|
+
* <x-otp-slot index="1"></x-otp-slot>
|
|
22
|
+
* <x-otp-slot index="2"></x-otp-slot>
|
|
23
|
+
* </x-otp-group>
|
|
24
|
+
* <x-otp-separator></x-otp-separator>
|
|
25
|
+
* <x-otp-group>
|
|
26
|
+
* <x-otp-slot index="3"></x-otp-slot>
|
|
27
|
+
* <x-otp-slot index="4"></x-otp-slot>
|
|
28
|
+
* <x-otp-slot index="5"></x-otp-slot>
|
|
29
|
+
* </x-otp-group>
|
|
30
|
+
* </x-otp-input>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare class XOtpInput extends HTMLElement {
|
|
34
|
+
#private;
|
|
35
|
+
static formAssociated: boolean;
|
|
36
|
+
static [ATTRIBUTES]: {
|
|
37
|
+
value(this: XOtpInput, value: string | null): void;
|
|
38
|
+
maxlength(this: XOtpInput, value: string | null): void;
|
|
39
|
+
disabled(this: XOtpInput, value: string | null): void;
|
|
40
|
+
required(this: XOtpInput, value: string | null): void;
|
|
41
|
+
pattern(this: XOtpInput, value: string | null): void;
|
|
42
|
+
inputmode(this: XOtpInput, value: string | null): void;
|
|
43
|
+
};
|
|
44
|
+
static observedAttributes: string[];
|
|
45
|
+
static events: {
|
|
46
|
+
complete: CustomEvent<string>;
|
|
47
|
+
};
|
|
48
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
49
|
+
get value(): string;
|
|
50
|
+
set value(v: string);
|
|
51
|
+
get maxLength(): number;
|
|
52
|
+
set maxLength(v: number);
|
|
53
|
+
get disabled(): boolean;
|
|
54
|
+
set disabled(v: boolean);
|
|
55
|
+
get required(): boolean;
|
|
56
|
+
set required(v: boolean);
|
|
57
|
+
get pattern(): string | null;
|
|
58
|
+
set pattern(v: string | null);
|
|
59
|
+
get name(): string;
|
|
60
|
+
set name(v: string);
|
|
61
|
+
/** Optional transform applied to pasted text before validation. */
|
|
62
|
+
pasteTransformer: ((text: string) => string) | null;
|
|
63
|
+
connectedCallback(): void;
|
|
64
|
+
disconnectedCallback(): void;
|
|
65
|
+
formResetCallback(): void;
|
|
66
|
+
formStateRestoreCallback(state: unknown): void;
|
|
67
|
+
formDisabledCallback(disabled: boolean): void;
|
|
68
|
+
get validity(): ValidityState | null;
|
|
69
|
+
}
|
|
70
|
+
declare global {
|
|
71
|
+
namespace ElementsKit {
|
|
72
|
+
interface CustomElementRegistry {
|
|
73
|
+
"x-otp-input": typeof XOtpInput;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/ui/otp-input/otp-slot.d.ts
|
|
79
|
+
/**
|
|
80
|
+
* `<x-otp-slot index="N">` — one visual cell of an `<x-otp-input>`. Purely
|
|
81
|
+
* presentational: `aria-hidden`, no focus, no value of its own. The parent
|
|
82
|
+
* `<x-otp-input>` paints its character and active / caret / disabled state by
|
|
83
|
+
* index; all styling lives in the companion CSS.
|
|
84
|
+
*/
|
|
85
|
+
declare class XOtpSlot extends HTMLElement {
|
|
86
|
+
static [ATTRIBUTES]: {
|
|
87
|
+
index: AttrChangeHandler<XOtpSlot>;
|
|
88
|
+
};
|
|
89
|
+
connectedCallback(): void;
|
|
90
|
+
}
|
|
91
|
+
declare global {
|
|
92
|
+
namespace ElementsKit {
|
|
93
|
+
interface CustomElementRegistry {
|
|
94
|
+
"x-otp-slot": typeof XOtpSlot;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/ui/otp-input/otp-group.d.ts
|
|
100
|
+
/**
|
|
101
|
+
* `<x-otp-group>` — presentational container that joins a run of
|
|
102
|
+
* `<x-otp-slot>`s into one attached group. All layout lives in CSS; this only
|
|
103
|
+
* applies a `group` role so the visual grouping is exposed to assistive tech.
|
|
104
|
+
*/
|
|
105
|
+
declare class XOtpGroup extends HTMLElement {
|
|
106
|
+
connectedCallback(): void;
|
|
107
|
+
}
|
|
108
|
+
declare global {
|
|
109
|
+
namespace ElementsKit {
|
|
110
|
+
interface CustomElementRegistry {
|
|
111
|
+
"x-otp-group": typeof XOtpGroup;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/ui/otp-input/otp-separator.d.ts
|
|
117
|
+
/**
|
|
118
|
+
* `<x-otp-separator>` — decorative divider authored between OTP groups (e.g. a
|
|
119
|
+
* dash between a 3-3 split). Purely visual: `aria-hidden`, glyph drawn in CSS.
|
|
120
|
+
*/
|
|
121
|
+
declare class XOtpSeparator extends HTMLElement {
|
|
122
|
+
connectedCallback(): void;
|
|
123
|
+
}
|
|
124
|
+
declare global {
|
|
125
|
+
namespace ElementsKit {
|
|
126
|
+
interface CustomElementRegistry {
|
|
127
|
+
"x-otp-separator": typeof XOtpSeparator;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
export { XOtpGroup, XOtpInput, XOtpSeparator, XOtpSlot };
|