@openelement/ui 1.0.0-alpha.1 → 1.0.0-alpha.10

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/src/open-card.js CHANGED
@@ -1,269 +1,200 @@
1
- // <auto-generated by open:compiled-element; v0.44.0-alpha.1 - do not edit>
2
- import { OpenElement } from '@openelement/element';
3
- import { recipe, surfaceRecipe } from './component-recipes.js';
1
+ import { recipe, surfaceRecipe } from "./component-recipes.js";
2
+ import { OpenElement } from "@openelement/element";
3
+ //#region src/open-card.tsx
4
4
  const __partProgram = {
5
- "version": 1,
6
- "tag": "open-card",
7
- "root": {
8
- "id": "root",
9
- "kind": "shadow-open",
10
- "nodes": [
11
- "e0"
12
- ]
13
- },
14
- "template": [
15
- {
16
- "k": "el",
17
- "id": "e0",
18
- "tag": "article",
19
- "attrs": [
20
- [
21
- "class",
22
- "surface"
23
- ],
24
- [
25
- "part",
26
- "container"
27
- ]
28
- ],
29
- "children": [
30
- {
31
- "k": "el",
32
- "id": "e1",
33
- "tag": "slot",
34
- "attrs": [
35
- [
36
- "name",
37
- "header"
38
- ]
39
- ],
40
- "children": []
41
- },
42
- {
43
- "k": "el",
44
- "id": "e2",
45
- "tag": "div",
46
- "attrs": [
47
- [
48
- "class",
49
- "card-body"
50
- ],
51
- [
52
- "part",
53
- "body"
54
- ]
55
- ],
56
- "children": [
57
- {
58
- "k": "el",
59
- "id": "e3",
60
- "tag": "slot",
61
- "attrs": [],
62
- "children": []
63
- }
64
- ]
65
- },
66
- {
67
- "k": "el",
68
- "id": "e4",
69
- "tag": "slot",
70
- "attrs": [
71
- [
72
- "name",
73
- "footer"
74
- ]
75
- ],
76
- "children": []
77
- }
78
- ]
79
- }
80
- ],
81
- "parts": [],
82
- "regions": [],
83
- "dependencies": [],
84
- "locations": [
85
- {
86
- "id": "e0",
87
- "kind": "element",
88
- "tag": "article",
89
- "path": [
90
- 0
91
- ]
92
- },
93
- {
94
- "id": "e1",
95
- "kind": "element",
96
- "tag": "slot",
97
- "path": [
98
- 0,
99
- 0
100
- ]
101
- },
102
- {
103
- "id": "e2",
104
- "kind": "element",
105
- "tag": "div",
106
- "path": [
107
- 0,
108
- 1
109
- ]
110
- },
111
- {
112
- "id": "e3",
113
- "kind": "element",
114
- "tag": "slot",
115
- "path": [
116
- 0,
117
- 1,
118
- 0
119
- ]
120
- },
121
- {
122
- "id": "e4",
123
- "kind": "element",
124
- "tag": "slot",
125
- "path": [
126
- 0,
127
- 2
128
- ]
129
- }
130
- ],
131
- "metadata": {
132
- "tag": "open-card",
133
- "className": "OpenCard",
134
- "sourceFile": "open-card.tsx",
135
- "properties": [
136
- {
137
- "name": "variant",
138
- "attribute": "variant",
139
- "type": "string",
140
- "converter": "string",
141
- "reflect": false,
142
- "default": ""
143
- }
144
- ],
145
- "observedAttributes": [
146
- "variant"
147
- ],
148
- "cem": {
149
- "tagName": "open-card",
150
- "className": "OpenCard",
151
- "declaration": {
152
- "name": "OpenCard",
153
- "module": "open-card.tsx"
154
- },
155
- "attributes": [
156
- {
157
- "name": "variant",
158
- "fieldName": "variant",
159
- "type": "string",
160
- "reflect": false
161
- }
162
- ],
163
- "members": [
164
- {
165
- "name": "variant",
166
- "fieldName": "variant",
167
- "type": "string",
168
- "attribute": "variant",
169
- "reflect": false
170
- }
171
- ]
172
- }
173
- }
5
+ "version": 1,
6
+ "tag": "open-card",
7
+ "root": {
8
+ "id": "root",
9
+ "kind": "shadow-open",
10
+ "nodes": ["e0"]
11
+ },
12
+ "template": [{
13
+ "k": "el",
14
+ "id": "e0",
15
+ "tag": "article",
16
+ "attrs": [["class", "surface"], ["part", "container"]],
17
+ "children": [
18
+ {
19
+ "k": "el",
20
+ "id": "e1",
21
+ "tag": "slot",
22
+ "attrs": [["name", "header"]],
23
+ "children": []
24
+ },
25
+ {
26
+ "k": "el",
27
+ "id": "e2",
28
+ "tag": "div",
29
+ "attrs": [["class", "card-body"], ["part", "body"]],
30
+ "children": [{
31
+ "k": "el",
32
+ "id": "e3",
33
+ "tag": "slot",
34
+ "attrs": [],
35
+ "children": []
36
+ }]
37
+ },
38
+ {
39
+ "k": "el",
40
+ "id": "e4",
41
+ "tag": "slot",
42
+ "attrs": [["name", "footer"]],
43
+ "children": []
44
+ }
45
+ ]
46
+ }],
47
+ "parts": [],
48
+ "regions": [],
49
+ "dependencies": [],
50
+ "locations": [
51
+ {
52
+ "id": "e0",
53
+ "kind": "element",
54
+ "tag": "article",
55
+ "path": [0]
56
+ },
57
+ {
58
+ "id": "e1",
59
+ "kind": "element",
60
+ "tag": "slot",
61
+ "path": [0, 0]
62
+ },
63
+ {
64
+ "id": "e2",
65
+ "kind": "element",
66
+ "tag": "div",
67
+ "path": [0, 1]
68
+ },
69
+ {
70
+ "id": "e3",
71
+ "kind": "element",
72
+ "tag": "slot",
73
+ "path": [
74
+ 0,
75
+ 1,
76
+ 0
77
+ ]
78
+ },
79
+ {
80
+ "id": "e4",
81
+ "kind": "element",
82
+ "tag": "slot",
83
+ "path": [0, 2]
84
+ }
85
+ ],
86
+ "metadata": {
87
+ "tag": "open-card",
88
+ "className": "OpenCard",
89
+ "sourceFile": "open-card.tsx",
90
+ "properties": [{
91
+ "name": "variant",
92
+ "attribute": "variant",
93
+ "type": "string",
94
+ "converter": "string",
95
+ "reflect": false,
96
+ "default": ""
97
+ }],
98
+ "observedAttributes": ["variant"],
99
+ "cem": {
100
+ "tagName": "open-card",
101
+ "className": "OpenCard",
102
+ "declaration": {
103
+ "name": "OpenCard",
104
+ "module": "open-card.tsx"
105
+ },
106
+ "attributes": [{
107
+ "name": "variant",
108
+ "fieldName": "variant",
109
+ "type": "string",
110
+ "reflect": false
111
+ }],
112
+ "members": [{
113
+ "name": "variant",
114
+ "fieldName": "variant",
115
+ "type": "string",
116
+ "attribute": "variant",
117
+ "reflect": false
118
+ }]
119
+ }
120
+ }
174
121
  };
175
- const __compiledProperties = [
176
- {
177
- "name": "variant",
178
- "attribute": "variant",
179
- "type": "string",
180
- "converter": "string",
181
- "reflect": false,
182
- "default": ""
183
- }
184
- ];
122
+ const __compiledProperties = [{
123
+ "name": "variant",
124
+ "attribute": "variant",
125
+ "type": "string",
126
+ "converter": "string",
127
+ "reflect": false,
128
+ "default": ""
129
+ }];
185
130
  const __elementMetadata = {
186
- "tag": "open-card",
187
- "className": "OpenCard",
188
- "sourceFile": "open-card.tsx",
189
- "properties": [
190
- {
191
- "name": "variant",
192
- "attribute": "variant",
193
- "type": "string",
194
- "converter": "string",
195
- "reflect": false,
196
- "default": ""
197
- }
198
- ],
199
- "observedAttributes": [
200
- "variant"
201
- ],
202
- "cem": {
203
- "tagName": "open-card",
204
- "className": "OpenCard",
205
- "declaration": {
206
- "name": "OpenCard",
207
- "module": "open-card.tsx"
208
- },
209
- "attributes": [
210
- {
211
- "name": "variant",
212
- "fieldName": "variant",
213
- "type": "string",
214
- "reflect": false
215
- }
216
- ],
217
- "members": [
218
- {
219
- "name": "variant",
220
- "fieldName": "variant",
221
- "type": "string",
222
- "attribute": "variant",
223
- "reflect": false
224
- }
225
- ]
226
- }
227
- };
228
- const __observedAttributes = [
229
- "variant"
230
- ];
231
- const __compiledProps = {
232
- variant: {
233
- type: String,
234
- default: '',
235
- reflect: false,
236
- attribute: "variant"
237
- }
131
+ "tag": "open-card",
132
+ "className": "OpenCard",
133
+ "sourceFile": "open-card.tsx",
134
+ "properties": [{
135
+ "name": "variant",
136
+ "attribute": "variant",
137
+ "type": "string",
138
+ "converter": "string",
139
+ "reflect": false,
140
+ "default": ""
141
+ }],
142
+ "observedAttributes": ["variant"],
143
+ "cem": {
144
+ "tagName": "open-card",
145
+ "className": "OpenCard",
146
+ "declaration": {
147
+ "name": "OpenCard",
148
+ "module": "open-card.tsx"
149
+ },
150
+ "attributes": [{
151
+ "name": "variant",
152
+ "fieldName": "variant",
153
+ "type": "string",
154
+ "reflect": false
155
+ }],
156
+ "members": [{
157
+ "name": "variant",
158
+ "fieldName": "variant",
159
+ "type": "string",
160
+ "attribute": "variant",
161
+ "reflect": false
162
+ }]
163
+ }
238
164
  };
239
- export class OpenCard extends OpenElement {
240
- static __partProgram = __partProgram;
241
- static __compiledProperties = __compiledProperties;
242
- static __elementMetadata = __elementMetadata;
243
- static props = __compiledProps;
244
- static observedAttributes = __observedAttributes;
245
- static styles = [
246
- surfaceRecipe,
247
- recipe(`
165
+ const __observedAttributes = ["variant"];
166
+ const __compiledProps = { variant: {
167
+ type: String,
168
+ default: "",
169
+ reflect: false,
170
+ attribute: "variant"
171
+ } };
172
+ var OpenCard = class extends OpenElement {
173
+ static __partProgram = __partProgram;
174
+ static __compiledProperties = __compiledProperties;
175
+ static __elementMetadata = __elementMetadata;
176
+ static props = __compiledProps;
177
+ static observedAttributes = __observedAttributes;
178
+ static styles = [surfaceRecipe, recipe(`
248
179
  :host {
249
180
  display: block;
250
181
  background:
251
- linear-gradient(135deg, color-mix(in srgb, var(--violet-1) 14%, transparent), transparent 48%),
252
- var(--bg-card);
253
- color: var(--text-primary);
254
- border: var(--border-size-1) solid var(--border);
255
- border-radius: var(--card-radius);
182
+ linear-gradient(135deg, color-mix(in srgb, var(--color-secondary) 14%, transparent), transparent 48%),
183
+ var(--color-card);
184
+ color: var(--color-foreground);
185
+ border: calc(var(--spacing) * 0.25) solid var(--color-border);
186
+ border-radius: var(--radius-md);
256
187
  overflow: hidden;
257
- transition: border-color var(--ease-3) var(--duration-2), background var(--ease-3) var(--duration-2), box-shadow var(--ease-3) var(--duration-2);
188
+ transition: border-color var(--ease-out) var(--default-transition-duration), background var(--ease-out) var(--default-transition-duration), box-shadow var(--ease-out) var(--default-transition-duration);
258
189
  }
259
190
 
260
191
  :host([variant='elevated']) {
261
- box-shadow: 0 var(--size-2) var(--size-8) color-mix(in srgb, var(--brand) 8%, transparent);
262
- border-color: var(--border);
192
+ box-shadow: 0 calc(var(--spacing) * 2) calc(var(--spacing) * 8) color-mix(in srgb, var(--color-primary) 8%, transparent);
193
+ border-color: var(--color-border);
263
194
  }
264
195
 
265
196
  :host([variant='elevated']:hover) {
266
- border-color: var(--brand);
197
+ border-color: var(--color-primary);
267
198
  }
268
199
 
269
200
  :host([variant='borderless']) {
@@ -271,40 +202,43 @@ export class OpenCard extends OpenElement {
271
202
  }
272
203
 
273
204
  :host([variant='muted']) {
274
- background: var(--bg-surface);
205
+ background: var(--color-muted);
275
206
  }
276
207
 
208
+ /* Artifact: a permanently-dark code panel in BOTH themes (the same static
209
+ zinc surface open-code-block paints), so ink/border are static ramp
210
+ steps — theme-flipping inks would invert against the fixed surface. */
277
211
  :host([variant='artifact']) {
278
- background: var(--bg-code, var(--gray-11));
279
- color: var(--gray-2);
280
- border-color: var(--code-border, var(--gray-8));
212
+ background: var(--color-zinc-950);
213
+ color: var(--color-zinc-200);
214
+ border-color: var(--color-zinc-700);
281
215
  }
282
216
 
283
217
  ::slotted([slot='header']) {
284
- padding: var(--size-4) var(--size-5);
285
- border-bottom: var(--border-size-1) solid var(--border);
286
- font-size: var(--font-size-2);
287
- font-weight: var(--font-weight-6);
288
- color: var(--text-primary);
218
+ padding: calc(var(--spacing) * 4) calc(var(--spacing) * 5);
219
+ border-bottom: calc(var(--spacing) * 0.25) solid var(--color-border);
220
+ font-size: var(--text-xl);
221
+ font-weight: var(--font-weight-semibold);
222
+ color: var(--color-foreground);
289
223
  margin: 0;
290
224
  }
291
225
 
292
226
  .card-body {
293
- padding: var(--size-5);
227
+ padding: calc(var(--spacing) * 5);
294
228
  }
295
229
 
296
230
  ::slotted([slot='footer']) {
297
- padding: var(--size-3) var(--size-5);
298
- border-top: var(--border-size-1) solid var(--border);
299
- font-size: var(--font-size-0);
300
- color: var(--text-muted);
231
+ padding: calc(var(--spacing) * 3) calc(var(--spacing) * 5);
232
+ border-top: calc(var(--spacing) * 0.25) solid var(--color-border);
233
+ font-size: var(--text-sm);
234
+ color: var(--color-muted-foreground);
301
235
  margin: 0;
302
236
  }
303
- `)
304
- ];
305
- variant = '';
306
- render() {
307
- throw new Error('[open:compiled-element] open-card is compiled to a Part Program; the runtime JSX render path is not available in 0.44.');
308
- }
309
- }
310
- export { __partProgram, __elementMetadata };
237
+ `)];
238
+ variant = "";
239
+ render() {
240
+ throw new Error("[open:compiled-element] open-card is compiled to a Part Program; the runtime JSX render path is not available.");
241
+ }
242
+ };
243
+ //#endregion
244
+ export { OpenCard, __elementMetadata, __partProgram };