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

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.
@@ -1,502 +0,0 @@
1
- import { CALLOUT_TYPE_ICONS, recipe } from "./component-recipes.js";
2
- import { OpenElement, computed } from "@openelement/element";
3
- //#region src/open-callout.tsx
4
- const __partProgram = {
5
- "version": 1,
6
- "tag": "open-callout",
7
- "root": {
8
- "id": "root",
9
- "kind": "shadow-open",
10
- "nodes": ["e0"]
11
- },
12
- "template": [{
13
- "k": "el",
14
- "id": "e0",
15
- "tag": "div",
16
- "attrs": [["class", "callout"], ["part", "container"]],
17
- "children": [{
18
- "k": "el",
19
- "id": "e1",
20
- "tag": "div",
21
- "attrs": [["class", "callout-header"]],
22
- "children": [{
23
- "k": "el",
24
- "id": "e2",
25
- "tag": "span",
26
- "attrs": [["class", "callout-icon"], ["part", "icon"]],
27
- "children": [{
28
- "k": "part",
29
- "id": "p1",
30
- "index": 1
31
- }]
32
- }, {
33
- "k": "el",
34
- "id": "e3",
35
- "tag": "span",
36
- "attrs": [["class", "callout-title"]],
37
- "children": [{
38
- "k": "part",
39
- "id": "p2",
40
- "index": 2
41
- }]
42
- }]
43
- }, {
44
- "k": "el",
45
- "id": "e4",
46
- "tag": "div",
47
- "attrs": [["class", "callout-body"], ["part", "content"]],
48
- "children": [{
49
- "k": "el",
50
- "id": "e5",
51
- "tag": "slot",
52
- "attrs": [],
53
- "children": []
54
- }]
55
- }]
56
- }],
57
- "parts": [
58
- {
59
- "k": "bool",
60
- "signal": "headerHidden",
61
- "name": "hidden",
62
- "path": [0, 0],
63
- "index": 0,
64
- "location": {
65
- "id": "p0",
66
- "kind": "sink",
67
- "path": [0, 0],
68
- "node": "e1"
69
- }
70
- },
71
- {
72
- "k": "text",
73
- "signal": "icon",
74
- "index": 1,
75
- "location": {
76
- "id": "p1",
77
- "kind": "anchor",
78
- "path": [
79
- 0,
80
- 0,
81
- 0,
82
- 0
83
- ]
84
- }
85
- },
86
- {
87
- "k": "text",
88
- "signal": "label",
89
- "index": 2,
90
- "location": {
91
- "id": "p2",
92
- "kind": "anchor",
93
- "path": [
94
- 0,
95
- 0,
96
- 1,
97
- 0
98
- ]
99
- }
100
- }
101
- ],
102
- "regions": [],
103
- "dependencies": [
104
- {
105
- "signal": "headerHidden",
106
- "owner": {
107
- "kind": "part",
108
- "index": 0
109
- },
110
- "location": "p0"
111
- },
112
- {
113
- "signal": "icon",
114
- "owner": {
115
- "kind": "part",
116
- "index": 1
117
- },
118
- "location": "p1"
119
- },
120
- {
121
- "signal": "label",
122
- "owner": {
123
- "kind": "part",
124
- "index": 2
125
- },
126
- "location": "p2"
127
- }
128
- ],
129
- "locations": [
130
- {
131
- "id": "e0",
132
- "kind": "element",
133
- "tag": "div",
134
- "path": [0]
135
- },
136
- {
137
- "id": "e1",
138
- "kind": "element",
139
- "tag": "div",
140
- "path": [0, 0]
141
- },
142
- {
143
- "id": "p0",
144
- "kind": "sink",
145
- "part": 0,
146
- "node": "e1",
147
- "path": [0, 0]
148
- },
149
- {
150
- "id": "e2",
151
- "kind": "element",
152
- "tag": "span",
153
- "path": [
154
- 0,
155
- 0,
156
- 0
157
- ]
158
- },
159
- {
160
- "id": "p1",
161
- "kind": "anchor",
162
- "part": 1,
163
- "path": [
164
- 0,
165
- 0,
166
- 0,
167
- 0
168
- ]
169
- },
170
- {
171
- "id": "e3",
172
- "kind": "element",
173
- "tag": "span",
174
- "path": [
175
- 0,
176
- 0,
177
- 1
178
- ]
179
- },
180
- {
181
- "id": "p2",
182
- "kind": "anchor",
183
- "part": 2,
184
- "path": [
185
- 0,
186
- 0,
187
- 1,
188
- 0
189
- ]
190
- },
191
- {
192
- "id": "e4",
193
- "kind": "element",
194
- "tag": "div",
195
- "path": [0, 1]
196
- },
197
- {
198
- "id": "e5",
199
- "kind": "element",
200
- "tag": "slot",
201
- "path": [
202
- 0,
203
- 1,
204
- 0
205
- ]
206
- }
207
- ],
208
- "metadata": {
209
- "tag": "open-callout",
210
- "className": "OpenCallout",
211
- "sourceFile": "open-callout.tsx",
212
- "properties": [
213
- {
214
- "name": "type",
215
- "attribute": "type",
216
- "type": "string",
217
- "converter": "string",
218
- "reflect": true,
219
- "default": "info"
220
- },
221
- {
222
- "name": "label",
223
- "attribute": "label",
224
- "type": "string",
225
- "converter": "string",
226
- "reflect": false,
227
- "default": ""
228
- },
229
- {
230
- "name": "icon",
231
- "attribute": null,
232
- "type": "string",
233
- "converter": "string",
234
- "reflect": false,
235
- "default": null,
236
- "computed": true,
237
- "deps": ["type"]
238
- },
239
- {
240
- "name": "headerHidden",
241
- "attribute": null,
242
- "type": "boolean",
243
- "converter": "boolean",
244
- "reflect": false,
245
- "default": null,
246
- "computed": true,
247
- "deps": ["label"]
248
- }
249
- ],
250
- "observedAttributes": ["type", "label"],
251
- "cem": {
252
- "tagName": "open-callout",
253
- "className": "OpenCallout",
254
- "declaration": {
255
- "name": "OpenCallout",
256
- "module": "open-callout.tsx"
257
- },
258
- "attributes": [{
259
- "name": "type",
260
- "fieldName": "type",
261
- "type": "string",
262
- "reflect": true
263
- }, {
264
- "name": "label",
265
- "fieldName": "label",
266
- "type": "string",
267
- "reflect": false
268
- }],
269
- "members": [
270
- {
271
- "name": "type",
272
- "fieldName": "type",
273
- "type": "string",
274
- "attribute": "type",
275
- "reflect": true
276
- },
277
- {
278
- "name": "label",
279
- "fieldName": "label",
280
- "type": "string",
281
- "attribute": "label",
282
- "reflect": false
283
- },
284
- {
285
- "name": "icon",
286
- "fieldName": "icon",
287
- "type": "string",
288
- "attribute": null,
289
- "reflect": false
290
- },
291
- {
292
- "name": "headerHidden",
293
- "fieldName": "headerHidden",
294
- "type": "boolean",
295
- "attribute": null,
296
- "reflect": false
297
- }
298
- ]
299
- }
300
- }
301
- };
302
- const __compiledProperties = [
303
- {
304
- "name": "type",
305
- "attribute": "type",
306
- "type": "string",
307
- "converter": "string",
308
- "reflect": true,
309
- "default": "info"
310
- },
311
- {
312
- "name": "label",
313
- "attribute": "label",
314
- "type": "string",
315
- "converter": "string",
316
- "reflect": false,
317
- "default": ""
318
- },
319
- {
320
- "name": "icon",
321
- "attribute": null,
322
- "type": "string",
323
- "converter": "string",
324
- "reflect": false,
325
- "default": null,
326
- "computed": true,
327
- "deps": ["type"]
328
- },
329
- {
330
- "name": "headerHidden",
331
- "attribute": null,
332
- "type": "boolean",
333
- "converter": "boolean",
334
- "reflect": false,
335
- "default": null,
336
- "computed": true,
337
- "deps": ["label"]
338
- }
339
- ];
340
- const __elementMetadata = {
341
- "tag": "open-callout",
342
- "className": "OpenCallout",
343
- "sourceFile": "open-callout.tsx",
344
- "properties": [
345
- {
346
- "name": "type",
347
- "attribute": "type",
348
- "type": "string",
349
- "converter": "string",
350
- "reflect": true,
351
- "default": "info"
352
- },
353
- {
354
- "name": "label",
355
- "attribute": "label",
356
- "type": "string",
357
- "converter": "string",
358
- "reflect": false,
359
- "default": ""
360
- },
361
- {
362
- "name": "icon",
363
- "attribute": null,
364
- "type": "string",
365
- "converter": "string",
366
- "reflect": false,
367
- "default": null,
368
- "computed": true,
369
- "deps": ["type"]
370
- },
371
- {
372
- "name": "headerHidden",
373
- "attribute": null,
374
- "type": "boolean",
375
- "converter": "boolean",
376
- "reflect": false,
377
- "default": null,
378
- "computed": true,
379
- "deps": ["label"]
380
- }
381
- ],
382
- "observedAttributes": ["type", "label"],
383
- "cem": {
384
- "tagName": "open-callout",
385
- "className": "OpenCallout",
386
- "declaration": {
387
- "name": "OpenCallout",
388
- "module": "open-callout.tsx"
389
- },
390
- "attributes": [{
391
- "name": "type",
392
- "fieldName": "type",
393
- "type": "string",
394
- "reflect": true
395
- }, {
396
- "name": "label",
397
- "fieldName": "label",
398
- "type": "string",
399
- "reflect": false
400
- }],
401
- "members": [
402
- {
403
- "name": "type",
404
- "fieldName": "type",
405
- "type": "string",
406
- "attribute": "type",
407
- "reflect": true
408
- },
409
- {
410
- "name": "label",
411
- "fieldName": "label",
412
- "type": "string",
413
- "attribute": "label",
414
- "reflect": false
415
- },
416
- {
417
- "name": "icon",
418
- "fieldName": "icon",
419
- "type": "string",
420
- "attribute": null,
421
- "reflect": false
422
- },
423
- {
424
- "name": "headerHidden",
425
- "fieldName": "headerHidden",
426
- "type": "boolean",
427
- "attribute": null,
428
- "reflect": false
429
- }
430
- ]
431
- }
432
- };
433
- const __observedAttributes = ["type", "label"];
434
- const __compiledProps = {
435
- type: {
436
- type: String,
437
- default: "info",
438
- reflect: true,
439
- attribute: "type"
440
- },
441
- label: {
442
- type: String,
443
- default: "",
444
- reflect: false,
445
- attribute: "label"
446
- },
447
- icon: {
448
- type: Object,
449
- default: void 0,
450
- reflect: false,
451
- attribute: false
452
- },
453
- headerHidden: {
454
- type: Object,
455
- default: void 0,
456
- reflect: false,
457
- attribute: false
458
- }
459
- };
460
- var OpenCallout = class extends OpenElement {
461
- static __partProgram = __partProgram;
462
- static __compiledProperties = __compiledProperties;
463
- static __elementMetadata = __elementMetadata;
464
- static props = __compiledProps;
465
- static observedAttributes = __observedAttributes;
466
- static __computedFields = {
467
- icon: (__s) => computed(() => CALLOUT_TYPE_ICONS[__s.type.value] ?? CALLOUT_TYPE_ICONS.info),
468
- headerHidden: (__s) => computed(() => __s.label.value === "")
469
- };
470
- static styles = [recipe(`
471
- :host { display: block; }
472
- .callout {
473
- padding: calc(var(--spacing) * 3) calc(var(--spacing) * 4);
474
- margin: calc(var(--spacing) * 3) 0;
475
- border-left: calc(var(--spacing) * 0.5) solid var(--color-primary);
476
- background: color-mix(in srgb, var(--color-primary) 14%, transparent);
477
- border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
478
- }
479
- :host([type='warning']) .callout { border-left-color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 10%, transparent); }
480
- :host([type='danger']) .callout { border-left-color: var(--color-destructive); background: color-mix(in srgb, var(--color-destructive) 10%, transparent); }
481
- :host([type='tip']) .callout { border-left-color: var(--color-success); background: color-mix(in srgb, var(--color-success) 10%, transparent); }
482
- .callout-header {
483
- display: flex; align-items: center; gap: calc(var(--spacing) * 1); margin-bottom: calc(var(--spacing) * 1);
484
- }
485
- .callout-header[hidden] { display: none; }
486
- .callout-icon { font-size: var(--text-sm); line-height: 1; flex-shrink: 0; }
487
- .callout-title {
488
- font-size: var(--text-sm); font-weight: var(--font-weight-semibold); color: var(--color-foreground);
489
- }
490
- .callout-body {
491
- font-size: var(--text-base); line-height: var(--leading-relaxed); color: var(--color-muted-foreground);
492
- }
493
- .callout-body ::slotted(p) { margin: 0; }
494
- `)];
495
- type = "info";
496
- label = "";
497
- render() {
498
- throw new Error("[open:compiled-element] open-callout is compiled to a Part Program; the runtime JSX render path is not available.");
499
- }
500
- };
501
- //#endregion
502
- export { OpenCallout, __elementMetadata, __partProgram };
@@ -1,138 +0,0 @@
1
- import { OpenElement, StyleSheetLike } from "@openelement/element";
2
- //#region src/open-card.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: never[];
26
- children: never[];
27
- }[];
28
- }[];
29
- }[];
30
- parts: never[];
31
- regions: never[];
32
- dependencies: never[];
33
- locations: {
34
- id: string;
35
- kind: string;
36
- tag: string;
37
- path: number[];
38
- }[];
39
- metadata: {
40
- tag: string;
41
- className: string;
42
- sourceFile: string;
43
- properties: {
44
- name: string;
45
- attribute: string;
46
- type: string;
47
- converter: string;
48
- reflect: boolean;
49
- default: string;
50
- }[];
51
- observedAttributes: string[];
52
- cem: {
53
- tagName: string;
54
- className: string;
55
- declaration: {
56
- name: string;
57
- module: string;
58
- };
59
- attributes: {
60
- name: string;
61
- fieldName: string;
62
- type: string;
63
- reflect: boolean;
64
- }[];
65
- members: {
66
- name: string;
67
- fieldName: string;
68
- type: string;
69
- attribute: string;
70
- reflect: boolean;
71
- }[];
72
- };
73
- };
74
- };
75
- declare const __compiledProperties: {
76
- name: string;
77
- attribute: string;
78
- type: string;
79
- converter: string;
80
- reflect: boolean;
81
- default: string;
82
- }[];
83
- declare const __elementMetadata: {
84
- tag: string;
85
- className: string;
86
- sourceFile: string;
87
- properties: {
88
- name: string;
89
- attribute: string;
90
- type: string;
91
- converter: string;
92
- reflect: boolean;
93
- default: string;
94
- }[];
95
- observedAttributes: string[];
96
- cem: {
97
- tagName: string;
98
- className: string;
99
- declaration: {
100
- name: string;
101
- module: string;
102
- };
103
- attributes: {
104
- name: string;
105
- fieldName: string;
106
- type: string;
107
- reflect: boolean;
108
- }[];
109
- members: {
110
- name: string;
111
- fieldName: string;
112
- type: string;
113
- attribute: string;
114
- reflect: boolean;
115
- }[];
116
- };
117
- };
118
- declare const __observedAttributes: string[];
119
- declare const __compiledProps: {
120
- variant: {
121
- type: StringConstructor;
122
- default: string;
123
- reflect: boolean;
124
- attribute: string;
125
- };
126
- };
127
- export declare class OpenCard extends OpenElement {
128
- static __partProgram: typeof __partProgram;
129
- static __compiledProperties: typeof __compiledProperties;
130
- static __elementMetadata: typeof __elementMetadata;
131
- static props: typeof __compiledProps;
132
- static observedAttributes: typeof __observedAttributes;
133
- static styles: StyleSheetLike[];
134
- variant: string;
135
- render(): never;
136
- }
137
- //#endregion
138
- export { __elementMetadata, __partProgram };