@openelement/ui 1.0.0-alpha.14 → 1.0.0-alpha.16
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/CUSTOMIZATION.md +106 -112
- package/README.md +19 -39
- package/custom-elements.json +369 -0
- package/package.json +3 -2
- package/src/button-machine.js +54 -0
- package/src/component-config.js +7 -0
- package/src/component-recipes.js +2 -24
- package/src/copy-feedback.js +32 -0
- package/src/dialog-machine.js +104 -0
- package/src/dropdown-machine.js +253 -0
- package/src/generated-manifest.json +135 -87
- package/src/index.d.ts +7 -8
- package/src/index.js +7 -8
- package/src/input-machine.js +33 -0
- package/src/open-button.css +119 -108
- package/src/open-button.d.ts +34 -342
- package/src/open-button.generated.js +592 -0
- package/src/open-button.js +115 -1140
- package/src/open-code-block.css +24 -44
- package/src/open-code-block.d.ts +15 -175
- package/src/open-code-block.generated.js +293 -0
- package/src/open-code-block.js +112 -224
- package/src/open-dialog.css +114 -127
- package/src/open-dialog.d.ts +22 -261
- package/src/open-dialog.generated.js +501 -0
- package/src/open-dialog.js +137 -632
- package/src/open-dropdown.css +26 -26
- package/src/open-dropdown.d.ts +15 -218
- package/src/open-dropdown.generated.js +211 -0
- package/src/open-dropdown.js +74 -355
- package/src/open-input.css +69 -74
- package/src/open-input.d.ts +34 -461
- package/src/open-input.generated.js +685 -0
- package/src/open-input.js +161 -1802
- package/src/open-theme-toggle.css +37 -47
- package/src/open-theme-toggle.d.ts +19 -190
- package/src/open-theme-toggle.generated.js +564 -0
- package/src/open-theme-toggle.js +209 -509
- package/src/theme-contract.js +40 -0
- package/src/theme.css +26 -8
- package/src/control-recipe.css +0 -21
- package/src/register.d.ts +0 -4
- package/src/register.js +0 -22
|
@@ -1,53 +1,43 @@
|
|
|
1
|
-
/* open-theme-toggle —
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/* open-theme-toggle — the irreducible authored rules (alpha15 S lane).
|
|
2
|
+
*
|
|
3
|
+
* The button's element-level presentation (flex box, size, radius, cursor,
|
|
4
|
+
* ink, hover ink, focus ring, transition) is authored as Tailwind utilities on
|
|
5
|
+
* the button in open-theme-toggle.tsx. What stays here, and why
|
|
6
|
+
* (CUSTOMIZATION.md -> "Why the residue is CSS"):
|
|
7
|
+
* - the two-colour derived border/background/inset-shadow (the house
|
|
8
|
+
* surface recipe): one owned formula over role pairs,
|
|
9
|
+
* - the icon display swap, whose `display` is driven by the BUTTON's
|
|
10
|
+
* `[data-theme]` attribute — one descendant-scoped pair of rules that owns
|
|
11
|
+
* `display` for both icons exclusively,
|
|
12
|
+
* - the host box.
|
|
13
|
+
* One owner per property: nothing here is also authored as a utility. */
|
|
14
|
+
:host {
|
|
15
|
+
display: inline-block;
|
|
16
|
+
}
|
|
8
17
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
border: calc(var(--spacing) * 0.25) solid color-mix(in srgb, var(--color-border) 72%, var(--color-primary));
|
|
15
|
-
border-radius: calc(infinity * 1px);
|
|
16
|
-
background: color-mix(in srgb, var(--color-popover) 76%, transparent);
|
|
17
|
-
color: var(--color-muted-foreground);
|
|
18
|
-
box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-background) 70%, transparent);
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
transition: all var(--ease-in-out) var(--default-transition-duration);
|
|
21
|
-
}
|
|
22
|
-
.theme-toggle:hover {
|
|
23
|
-
color: var(--color-foreground);
|
|
24
|
-
border-color: var(--color-violet-400);
|
|
25
|
-
background: color-mix(in srgb, color-mix(in srgb, var(--color-primary) 16%, transparent) 42%, var(--color-popover));
|
|
26
|
-
}
|
|
18
|
+
.theme-toggle {
|
|
19
|
+
border: calc(var(--spacing) * 0.25) solid color-mix(in srgb, var(--color-border) 72%, var(--color-primary));
|
|
20
|
+
background: color-mix(in srgb, var(--color-popover) 76%, transparent);
|
|
21
|
+
box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-background) 70%, transparent);
|
|
22
|
+
}
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
.theme-toggle:hover {
|
|
25
|
+
border-color: var(--color-violet-400);
|
|
26
|
+
background: color-mix(in srgb, color-mix(in srgb, var(--color-primary) 16%, transparent) 42%, var(--color-popover));
|
|
27
|
+
}
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
29
|
+
.theme-toggle .icon-sun {
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
.theme-toggle .icon-moon {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
41
36
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
.theme-toggle[data-theme='light'] .icon-sun {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
45
40
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
.theme-toggle[data-theme='light'] .icon-moon {
|
|
51
|
-
display: block;
|
|
52
|
-
}
|
|
53
|
-
|
|
41
|
+
.theme-toggle[data-theme='light'] .icon-moon {
|
|
42
|
+
display: block;
|
|
43
|
+
}
|
|
@@ -1,196 +1,25 @@
|
|
|
1
|
-
import { OpenElement, StyleSheetLike } from "@openelement/element";
|
|
2
1
|
//#region src/open-theme-toggle.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
template: {
|
|
12
|
-
k: string;
|
|
13
|
-
id: string;
|
|
14
|
-
tag: string;
|
|
15
|
-
attrs: string[][];
|
|
16
|
-
children: {
|
|
17
|
-
k: string;
|
|
18
|
-
id: string;
|
|
19
|
-
tag: string;
|
|
20
|
-
attrs: string[][];
|
|
21
|
-
children: {
|
|
22
|
-
k: string;
|
|
23
|
-
id: string;
|
|
24
|
-
tag: string;
|
|
25
|
-
attrs: string[][];
|
|
26
|
-
children: never[];
|
|
27
|
-
}[];
|
|
28
|
-
}[];
|
|
29
|
-
}[];
|
|
30
|
-
parts: ({
|
|
31
|
-
k: string;
|
|
32
|
-
signal: string;
|
|
33
|
-
name: string;
|
|
34
|
-
path: number[];
|
|
35
|
-
index: number;
|
|
36
|
-
location: {
|
|
37
|
-
id: string;
|
|
38
|
-
kind: string;
|
|
39
|
-
path: number[];
|
|
40
|
-
node: string;
|
|
41
|
-
};
|
|
42
|
-
event?: undefined;
|
|
43
|
-
handler?: undefined;
|
|
44
|
-
action?: undefined;
|
|
45
|
-
} | {
|
|
46
|
-
k: string;
|
|
47
|
-
event: string;
|
|
48
|
-
handler: string;
|
|
49
|
-
action: {
|
|
50
|
-
kind: string;
|
|
51
|
-
name: string;
|
|
52
|
-
};
|
|
53
|
-
path: number[];
|
|
54
|
-
index: number;
|
|
55
|
-
location: {
|
|
56
|
-
id: string;
|
|
57
|
-
kind: string;
|
|
58
|
-
path: number[];
|
|
59
|
-
node: string;
|
|
60
|
-
};
|
|
61
|
-
signal?: undefined;
|
|
62
|
-
name?: undefined;
|
|
63
|
-
})[];
|
|
64
|
-
regions: never[];
|
|
65
|
-
dependencies: {
|
|
66
|
-
signal: string;
|
|
67
|
-
owner: {
|
|
68
|
-
kind: string;
|
|
69
|
-
index: number;
|
|
70
|
-
};
|
|
71
|
-
location: string;
|
|
72
|
-
}[];
|
|
73
|
-
locations: ({
|
|
74
|
-
id: string;
|
|
75
|
-
kind: string;
|
|
76
|
-
tag: string;
|
|
77
|
-
path: number[];
|
|
78
|
-
part?: undefined;
|
|
79
|
-
node?: undefined;
|
|
80
|
-
} | {
|
|
81
|
-
id: string;
|
|
82
|
-
kind: string;
|
|
83
|
-
part: number;
|
|
84
|
-
node: string;
|
|
85
|
-
path: number[];
|
|
86
|
-
tag?: undefined;
|
|
87
|
-
})[];
|
|
88
|
-
metadata: {
|
|
89
|
-
tag: string;
|
|
90
|
-
className: string;
|
|
91
|
-
sourceFile: string;
|
|
92
|
-
properties: {
|
|
93
|
-
name: string;
|
|
94
|
-
attribute: string;
|
|
95
|
-
type: string;
|
|
96
|
-
converter: string;
|
|
97
|
-
reflect: boolean;
|
|
98
|
-
default: string;
|
|
99
|
-
}[];
|
|
100
|
-
observedAttributes: string[];
|
|
101
|
-
cem: {
|
|
102
|
-
tagName: string;
|
|
103
|
-
className: string;
|
|
104
|
-
declaration: {
|
|
105
|
-
name: string;
|
|
106
|
-
module: string;
|
|
107
|
-
};
|
|
108
|
-
attributes: {
|
|
109
|
-
name: string;
|
|
110
|
-
fieldName: string;
|
|
111
|
-
type: string;
|
|
112
|
-
reflect: boolean;
|
|
113
|
-
}[];
|
|
114
|
-
members: {
|
|
115
|
-
name: string;
|
|
116
|
-
fieldName: string;
|
|
117
|
-
type: string;
|
|
118
|
-
attribute: string;
|
|
119
|
-
reflect: boolean;
|
|
120
|
-
}[];
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
declare const __compiledProperties: {
|
|
125
|
-
name: string;
|
|
126
|
-
attribute: string;
|
|
127
|
-
type: string;
|
|
128
|
-
converter: string;
|
|
129
|
-
reflect: boolean;
|
|
130
|
-
default: string;
|
|
131
|
-
}[];
|
|
132
|
-
declare const __elementMetadata: {
|
|
133
|
-
tag: string;
|
|
134
|
-
className: string;
|
|
135
|
-
sourceFile: string;
|
|
2
|
+
/**
|
|
3
|
+
* Platform facts for the generated element: shadow root with delegated focus,
|
|
4
|
+
* the authored component stylesheet, and the declared `theme` property.
|
|
5
|
+
*/
|
|
6
|
+
export declare const openElement: {
|
|
7
|
+
root: "shadow";
|
|
8
|
+
delegatesFocus: true;
|
|
9
|
+
styles: string[];
|
|
136
10
|
properties: {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
type: string;
|
|
140
|
-
converter: string;
|
|
141
|
-
reflect: boolean;
|
|
142
|
-
default: string;
|
|
143
|
-
}[];
|
|
144
|
-
observedAttributes: string[];
|
|
145
|
-
cem: {
|
|
146
|
-
tagName: string;
|
|
147
|
-
className: string;
|
|
148
|
-
declaration: {
|
|
149
|
-
name: string;
|
|
150
|
-
module: string;
|
|
11
|
+
theme: {
|
|
12
|
+
default: string;
|
|
151
13
|
};
|
|
152
|
-
attributes: {
|
|
153
|
-
name: string;
|
|
154
|
-
fieldName: string;
|
|
155
|
-
type: string;
|
|
156
|
-
reflect: boolean;
|
|
157
|
-
}[];
|
|
158
|
-
members: {
|
|
159
|
-
name: string;
|
|
160
|
-
fieldName: string;
|
|
161
|
-
type: string;
|
|
162
|
-
attribute: string;
|
|
163
|
-
reflect: boolean;
|
|
164
|
-
}[];
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
declare const __observedAttributes: string[];
|
|
168
|
-
declare const __compiledProps: {
|
|
169
|
-
theme: {
|
|
170
|
-
type: StringConstructor;
|
|
171
|
-
default: string;
|
|
172
|
-
reflect: boolean;
|
|
173
|
-
attribute: string;
|
|
174
14
|
};
|
|
175
15
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
theme: 'dark' | 'light';
|
|
185
|
-
connectedCallback(): void;
|
|
186
|
-
onDsdHydrated(): void;
|
|
187
|
-
private initTheme;
|
|
188
|
-
private applyTheme;
|
|
189
|
-
private persistTheme;
|
|
190
|
-
private handleToggle;
|
|
191
|
-
private dispatchThemeChange;
|
|
192
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
193
|
-
render(): never;
|
|
194
|
-
}
|
|
16
|
+
/**
|
|
17
|
+
* Theme toggle button for dark/light mode: reads and flips the document's
|
|
18
|
+
* `data-theme` (with an initialization priority chain) and persists the
|
|
19
|
+
* choice; icon visibility follows the current theme attribute.
|
|
20
|
+
*/
|
|
21
|
+
declare function OpenThemeToggle(props: {
|
|
22
|
+
theme: string;
|
|
23
|
+
}): any;
|
|
195
24
|
//#endregion
|
|
196
|
-
export {
|
|
25
|
+
export { OpenThemeToggle as default };
|