@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.
Files changed (43) hide show
  1. package/CUSTOMIZATION.md +106 -112
  2. package/README.md +19 -39
  3. package/custom-elements.json +369 -0
  4. package/package.json +3 -2
  5. package/src/button-machine.js +54 -0
  6. package/src/component-config.js +7 -0
  7. package/src/component-recipes.js +2 -24
  8. package/src/copy-feedback.js +32 -0
  9. package/src/dialog-machine.js +104 -0
  10. package/src/dropdown-machine.js +253 -0
  11. package/src/generated-manifest.json +135 -87
  12. package/src/index.d.ts +7 -8
  13. package/src/index.js +7 -8
  14. package/src/input-machine.js +33 -0
  15. package/src/open-button.css +119 -108
  16. package/src/open-button.d.ts +34 -342
  17. package/src/open-button.generated.js +592 -0
  18. package/src/open-button.js +115 -1140
  19. package/src/open-code-block.css +24 -44
  20. package/src/open-code-block.d.ts +15 -175
  21. package/src/open-code-block.generated.js +293 -0
  22. package/src/open-code-block.js +112 -224
  23. package/src/open-dialog.css +114 -127
  24. package/src/open-dialog.d.ts +22 -261
  25. package/src/open-dialog.generated.js +501 -0
  26. package/src/open-dialog.js +137 -632
  27. package/src/open-dropdown.css +26 -26
  28. package/src/open-dropdown.d.ts +15 -218
  29. package/src/open-dropdown.generated.js +211 -0
  30. package/src/open-dropdown.js +74 -355
  31. package/src/open-input.css +69 -74
  32. package/src/open-input.d.ts +34 -461
  33. package/src/open-input.generated.js +685 -0
  34. package/src/open-input.js +161 -1802
  35. package/src/open-theme-toggle.css +37 -47
  36. package/src/open-theme-toggle.d.ts +19 -190
  37. package/src/open-theme-toggle.generated.js +564 -0
  38. package/src/open-theme-toggle.js +209 -509
  39. package/src/theme-contract.js +40 -0
  40. package/src/theme.css +26 -8
  41. package/src/control-recipe.css +0 -21
  42. package/src/register.d.ts +0 -4
  43. package/src/register.js +0 -22
@@ -1,53 +1,43 @@
1
- /* open-theme-toggle — authored component styles, ported verbatim from the pre-#1558
2
- * recipe() sheet (the alpha.9 design system). The #1558 migration had
3
- * replaced this with a placeholder shell under the false note that the
4
- * component "carried no authored styles"; it did — this is that sheet. */
5
- :host {
6
- display: inline-block;
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
- .theme-toggle {
10
- display: inline-flex;
11
- align-items: center;
12
- justify-content: center;
13
- width: 38px; height: 38px; padding: 0;
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
- .theme-toggle:focus-visible {
29
- outline: calc(var(--spacing) * 0.5) solid var(--color-ring);
30
- outline-offset: calc(var(--spacing) * 0.75);
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
- .theme-toggle svg {
34
- width: 16px;
35
- height: 16px;
36
- }
29
+ .theme-toggle .icon-sun {
30
+ display: block;
31
+ }
37
32
 
38
- .theme-toggle .icon-sun {
39
- display: block;
40
- }
33
+ .theme-toggle .icon-moon {
34
+ display: none;
35
+ }
41
36
 
42
- .theme-toggle .icon-moon {
43
- display: none;
44
- }
37
+ .theme-toggle[data-theme='light'] .icon-sun {
38
+ display: none;
39
+ }
45
40
 
46
- .theme-toggle[data-theme='light'] .icon-sun {
47
- display: none;
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
- declare const __partProgram: {
4
- version: number;
5
- tag: string;
6
- root: {
7
- id: string;
8
- kind: string;
9
- nodes: string[];
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
- name: string;
138
- attribute: string;
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
- export declare class OpenThemeToggle extends OpenElement {
177
- static __partProgram: typeof __partProgram;
178
- static __compiledProperties: typeof __compiledProperties;
179
- static __elementMetadata: typeof __elementMetadata;
180
- static props: typeof __compiledProps;
181
- static observedAttributes: typeof __observedAttributes;
182
- static delegatesFocus: boolean;
183
- static styles: StyleSheetLike[];
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 { __elementMetadata, __partProgram };
25
+ export { OpenThemeToggle as default };