@threadlabs/looma 0.52.4 → 0.52.6

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.
@@ -3,11 +3,14 @@ import { attachGeneratedController, buildTemplate, clearRegion, NONCONFORMING, r
3
3
  import * as controller from "../components/ui-editor-link-card/ui-editor-link-card.js";
4
4
  import "../styles/ui-editor-link-card.css";
5
5
 
6
- const T0 = ["",[],"\n ",["ui-card",["variant","elevated","padding","xs","size","sm"],["ui-cluster",["gap","xs","wrap","nowrap","role","group","aria-label","Link actions"],["ui-icon",[]],"\n ",["ui-stack",["gap","none","fill",""],["ui-text",["as","strong","size","sm","weight","medium","font","sans","truncate",""],0],"\n ",1],"\n ",1,"\n ",["ui-icon-button",["label","Edit link","variant","ghost","size","sm","data-link-action","edit"],["ui-icon",["name","pencil"]]],"\n ",["ui-tooltip",[],"Edit link"],"\n ",["ui-icon-button",["label","Remove link","variant","ghost","size","sm","data-link-action","remove"],["ui-icon",["name","unlink"]]],"\n ",["ui-tooltip",[],"Remove link"]]],"\n "];
7
- const T1 = ["ui-text",["as","small","size","xs","tone","secondary","font","sans","truncate",""],0];
8
- const T2 = ["",[],"\n ",["ui-button",["variant","ghost","tone","neutral","size","sm","target","_blank","rel","noopener noreferrer","aria-label","Open link"],["ui-icon",["name","external-link"]]],"\n ",["ui-tooltip",[],"Open link"],"\n "];
9
- let P0, P1, P2;
10
- const S = { n: ["base","resolved","shown"], t: ["s","?","?"], f: import.meta.url, g: "ui-editor-link-card", k: 1, d: { "edit": [detailCheck(checkRecord(checkUnknown)), true, true, false], "remove": [detailCheck(checkRecord(checkUnknown)), true, true, false] }, x: dispatchDeclared, r: readonlyView, a: (host, I) => C(host, I), b: generatedInputs, i: ["ui-editor-link-card"] };
6
+ const T0 = ["",[],"\n ",["ui-card",["variant","elevated","padding","xs","size","sm"],["ui-cluster",["gap","xs","wrap","nowrap","role","group","aria-label","Link actions"],["ui-stack",["fill","","gap","none"],1,"\n ",1],"\n ",1,"\n ",["ui-icon-button",["label","Edit link","variant","ghost","size","sm","data-link-action","edit"],["ui-icon",["name","pencil"]]],"\n ",["ui-tooltip",[],"Edit link"],"\n ",["ui-icon-button",["label","Remove link","variant","ghost","size","sm","data-link-action","remove"],["ui-icon",["name","unlink"]]],"\n ",["ui-tooltip",[],"Remove link"]]],"\n "];
7
+ const T1 = ["ui-button",["variant","link","tone","neutral","stretch","","align","start","rel","noopener noreferrer"],["ui-cluster",["gap","xs","wrap","nowrap"],["ui-icon",[]],"\n ",["ui-stack",["gap","none","fill",""],["ui-text",["as","strong","size","sm","weight","medium","font","sans","truncate",""],0],"\n ",1]]];
8
+ const T2 = ["ui-text",["as","small","size","xs","tone","secondary","font","sans","truncate",""],0];
9
+ const T3 = ["ui-cluster",["gap","xs","wrap","nowrap"],["ui-icon",[]],"\n ",["ui-stack",["gap","none","fill",""],["ui-text",["as","strong","size","sm","weight","medium","font","sans","truncate",""],0],"\n ",1]];
10
+ const T4 = ["ui-text",["as","small","size","xs","tone","secondary","font","sans","truncate",""],0];
11
+ const T5 = ["",[],"\n ",["ui-button",["variant","ghost","tone","neutral","size","sm","rel","noopener noreferrer","aria-label","Open link"],["ui-icon",["name","external-link"]]],"\n ",["ui-tooltip",[],"Open link"],"\n "];
12
+ let P0, P1, P2, P3, P4, P5;
13
+ const S = { n: ["openTarget","base","resolved","shown"], t: ["s","s","?","?"], f: import.meta.url, g: "ui-editor-link-card", k: 2, d: { "edit": [detailCheck(checkRecord(checkUnknown)), true, true, false], "remove": [detailCheck(checkRecord(checkUnknown)), true, true, false] }, x: dispatchDeclared, r: readonlyView, a: (host, I) => C(host, I), b: generatedInputs, i: ["_blank", "ui-editor-link-card"] };
11
14
  const D = { g: "ui-editor-link-card", props: { "detail": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "href": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "label": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "openHref": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "targetLabel": { "required":false,"default":"Item", c: checkString, t: "string", j: 0, m: "s" } } };
12
15
  const C = (host) => activateModule(controller, host);
13
16
 
@@ -20,15 +23,15 @@ export function createUiEditorLinkCard(options = {}, html) {
20
23
  }
21
24
  element.setAttribute("component", "ui-editor-link-card");
22
25
  element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
23
- const v = ["ui-editor-link-card", undefined, undefined, null, null, null, null, null];
26
+ const v = ["_blank", "ui-editor-link-card", undefined, undefined, null, null, null, null, null];
24
27
  const B = acceptProps(element, D, S.n, v, componentProps, [], html);
25
28
  const CS = [];
26
- const inputStatus = (j) => { if (j >= 1 && j < 3) { g(j); return CS[j] ?? UNRESOLVED_INPUT; } if (j === 3) return awaitInput(B, "detail", true); if (j === 4) return awaitInput(B, "href", true); if (j === 5) return awaitInput(B, "label", true); if (j === 6) return awaitInput(B, "openHref", true); if (j === 7) return awaitInput(B, "targetLabel", true); return v[j] === undefined ? UNRESOLVED_INPUT : READY_INPUT; };
29
+ const inputStatus = (j) => { if (j >= 2 && j < 4) { g(j); return CS[j] ?? UNRESOLVED_INPUT; } if (j === 4) return awaitInput(B, "detail", true); if (j === 5) return awaitInput(B, "href", true); if (j === 6) return awaitInput(B, "label", true); if (j === 7) return awaitInput(B, "openHref", true); if (j === 8) return awaitInput(B, "targetLabel", true); return v[j] === undefined ? UNRESOLVED_INPUT : READY_INPUT; };
27
30
  const X = { e: 0, g: (j) => g(j), w: new Set(), a: CS, i: inputStatus };
28
31
  const ke = [];
29
- const K = [() => (inputRead(v[5], inputStatus(5)) !== ""), () => readIndex({ "true": inputRead(v[5], inputStatus(5)), "false": inputRead(v[4], inputStatus(4)) }, textCall("concat", [inputRead(g(1), inputStatus(1))]))];
32
+ const K = [() => (inputRead(v[6], inputStatus(6)) !== ""), () => readIndex({ "true": inputRead(v[6], inputStatus(6)), "false": inputRead(v[5], inputStatus(5)) }, textCall("concat", [inputRead(g(2), inputStatus(2))]))];
30
33
  const g = (j) => {
31
- const i = j - 1;
34
+ const i = j - 2;
32
35
  if (ke[i] === X.e) return v[j];
33
36
  if (ke[i] === -1) computedCycle();
34
37
  ke[i] = -1;
@@ -42,111 +45,203 @@ export function createUiEditorLinkCard(options = {}, html) {
42
45
  const m1 = (d) => {
43
46
  const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
44
47
  const t0 = n.firstChild;
45
- const r = { n, a0: t0, v0: "" };
48
+ const t1 = t0.firstChild;
49
+ const t2 = t1.nextSibling.nextSibling;
50
+ const t3 = t2.firstChild;
51
+ const t4 = t3.firstChild;
52
+ const t5 = t3.nextSibling.nextSibling;
53
+ const r = { n, a1: t1, a2: t4, v0: null, v1: null, v2: null, v3: null, v4: null, v5: "", a3: t5, e0: t5.nextSibling, b0: undefined };
46
54
  p1(r, -1, d);
47
55
  return r;
48
56
  };
49
57
  const p1 = (r, c, d) => {
50
- if (c & 8) {
51
- const x0 = v[3];
52
- const s0 = toText(x0);
53
- if (s0 !== r.v0) r.a0.data = r.v0 = s0;
58
+ if (c & 128) {
59
+ const x0 = v[7];
60
+ const s0 = toAttribute(x0, "href");
61
+ if (s0 !== r.v0) writeUrlAttribute(r.n, "href", r.v0 = s0);
62
+ }
63
+ if (c & 1) {
64
+ const x1 = v[0];
65
+ const s1 = toAttribute(x1, "target");
66
+ if (s1 !== r.v1) writeAttribute(r.n, "target", r.v1 = s1);
54
67
  }
68
+ if (c & 32) {
69
+ const x2 = v[5];
70
+ const s2 = toAttribute(x2, "title");
71
+ if (s2 !== r.v2) writeAttribute(r.n, "title", r.v2 = s2);
72
+ }
73
+ if (c & 1073742176) {
74
+ const x3 = textCall("concat", [readIndex({ "true": v[8], "false": "URL" }, textCall("concat", [g(2)])), ": ", g(3)]);
75
+ if (x3 !== NONCONFORMING) {
76
+ const s3 = toAttribute(x3, "aria-label");
77
+ if (s3 !== r.v3) writeAttribute(r.n, "aria-label", r.v3 = s3);
78
+ }
79
+ }
80
+ if (c & 1073741888) {
81
+ const x4 = readIndex({ "true": "file-text", "false": "link" }, textCall("concat", [g(2)]));
82
+ if (x4 !== NONCONFORMING) {
83
+ const s4 = toAttribute(x4, "name");
84
+ if (s4 !== r.v4) writeAttribute(r.a1, "name", r.v4 = s4);
85
+ }
86
+ }
87
+ if (c & 1073741920) {
88
+ const x5 = g(3);
89
+ if (x5 !== NONCONFORMING) {
90
+ const s5 = toText(x5);
91
+ if (s5 !== r.v5) r.a2.data = r.v5 = s5;
92
+ }
93
+ }
94
+ if (c & 16 && !((v[4] !== "")) !== !r.b0) {
95
+ if (r.b0) { r.b0 = undefined; clearRegion(r.a3, r.e0); }
96
+ else { r.b0 = m2(d); r.e0.before(r.b0.n); }
97
+ } else if (r.b0 !== undefined) p2(r.b0, c, d);
55
98
  };
56
99
  const m2 = (d) => {
57
100
  const n = (P2 ??= buildTemplate(T2)).cloneNode(true);
58
- const t0 = n.firstChild.nextSibling;
59
- const t1 = t0.nextSibling.nextSibling;
60
- const r = { n, a0: t0, a1: t1, v0: null, v1: null, v2: null };
101
+ const t0 = n.firstChild;
102
+ const r = { n, a0: t0, v0: "" };
61
103
  p2(r, -1, d);
62
104
  return r;
63
105
  };
64
106
  const p2 = (r, c, d) => {
65
- if (c & 1) {
66
- const x0 = textCall("concat", [v[0], "-open"]);
67
- if (x0 !== NONCONFORMING) {
68
- const s0 = toAttribute(x0, "id");
69
- if (s0 !== r.v0) writeAttribute(r.a0, "id", r.v0 = s0);
70
- }
71
- if (x0 !== NONCONFORMING) {
72
- const s2 = toAttribute(x0, "for");
73
- if (s2 !== r.v2) writeAttribute(r.a1, "for", r.v2 = s2);
74
- }
75
- }
76
- if (c & 64) {
77
- const x1 = v[6];
78
- const s1 = toAttribute(x1, "href");
79
- if (s1 !== r.v1) writeUrlAttribute(r.a0, "href", r.v1 = s1);
107
+ if (c & 16) {
108
+ const x0 = v[4];
109
+ const s0 = toText(x0);
110
+ if (s0 !== r.v0) r.a0.data = r.v0 = s0;
80
111
  }
81
112
  };
82
- const p0 = (r, c, d) => {
83
- if (c & 1073741856) {
84
- const x0 = readIndex({ "true": "file-text", "false": "link" }, textCall("concat", [g(1)]));
113
+ const m3 = (d) => {
114
+ const n = (P3 ??= buildTemplate(T3)).cloneNode(true);
115
+ const t0 = n.firstChild;
116
+ const t1 = t0.nextSibling.nextSibling;
117
+ const t2 = t1.firstChild;
118
+ const t3 = t2.firstChild;
119
+ const t4 = t2.nextSibling.nextSibling;
120
+ const r = { n, a0: t0, a1: t1, a2: t3, v0: null, v1: null, v2: null, v3: "", a3: t4, e0: t4.nextSibling, b0: undefined };
121
+ p3(r, -1, d);
122
+ return r;
123
+ };
124
+ const p3 = (r, c, d) => {
125
+ if (c & 1073741888) {
126
+ const x0 = readIndex({ "true": "file-text", "false": "link" }, textCall("concat", [g(2)]));
85
127
  if (x0 !== NONCONFORMING) {
86
128
  const s0 = toAttribute(x0, "name");
87
129
  if (s0 !== r.v0) writeAttribute(r.a0, "name", r.v0 = s0);
88
130
  }
89
131
  }
90
- if (c & 16) {
91
- const x1 = v[4];
132
+ if (c & 32) {
133
+ const x1 = v[5];
92
134
  const s1 = toAttribute(x1, "title");
93
135
  if (s1 !== r.v1) writeAttribute(r.a1, "title", r.v1 = s1);
94
136
  }
95
- if (c & 1073742000) {
96
- const x2 = textCall("concat", [readIndex({ "true": v[7], "false": "URL" }, textCall("concat", [g(1)])), ": ", g(2)]);
137
+ if (c & 1073742176) {
138
+ const x2 = textCall("concat", [readIndex({ "true": v[8], "false": "URL" }, textCall("concat", [g(2)])), ": ", g(3)]);
97
139
  if (x2 !== NONCONFORMING) {
98
140
  const s2 = toAttribute(x2, "aria-label");
99
141
  if (s2 !== r.v2) writeAttribute(r.a1, "aria-label", r.v2 = s2);
100
142
  }
101
143
  }
102
- if (c & 1073741872) {
103
- const x3 = g(2);
144
+ if (c & 1073741920) {
145
+ const x3 = g(3);
104
146
  if (x3 !== NONCONFORMING) {
105
147
  const s3 = toText(x3);
106
148
  if (s3 !== r.v3) r.a2.data = r.v3 = s3;
107
149
  }
108
150
  }
151
+ if (c & 16 && !((v[4] !== "")) !== !r.b0) {
152
+ if (r.b0) { r.b0 = undefined; clearRegion(r.a3, r.e0); }
153
+ else { r.b0 = m4(d); r.e0.before(r.b0.n); }
154
+ } else if (r.b0 !== undefined) p4(r.b0, c, d);
155
+ };
156
+ const m4 = (d) => {
157
+ const n = (P4 ??= buildTemplate(T4)).cloneNode(true);
158
+ const t0 = n.firstChild;
159
+ const r = { n, a0: t0, v0: "" };
160
+ p4(r, -1, d);
161
+ return r;
162
+ };
163
+ const p4 = (r, c, d) => {
164
+ if (c & 16) {
165
+ const x0 = v[4];
166
+ const s0 = toText(x0);
167
+ if (s0 !== r.v0) r.a0.data = r.v0 = s0;
168
+ }
169
+ };
170
+ const m5 = (d) => {
171
+ const n = (P5 ??= buildTemplate(T5)).cloneNode(true);
172
+ const t0 = n.firstChild.nextSibling;
173
+ const t1 = t0.nextSibling.nextSibling;
174
+ const r = { n, a0: t0, a1: t1, v0: null, v1: null, v2: null, v3: null };
175
+ p5(r, -1, d);
176
+ return r;
177
+ };
178
+ const p5 = (r, c, d) => {
179
+ if (c & 2) {
180
+ const x0 = textCall("concat", [v[1], "-open"]);
181
+ if (x0 !== NONCONFORMING) {
182
+ const s0 = toAttribute(x0, "id");
183
+ if (s0 !== r.v0) writeAttribute(r.a0, "id", r.v0 = s0);
184
+ }
185
+ if (x0 !== NONCONFORMING) {
186
+ const s3 = toAttribute(x0, "for");
187
+ if (s3 !== r.v3) writeAttribute(r.a1, "for", r.v3 = s3);
188
+ }
189
+ }
190
+ if (c & 128) {
191
+ const x1 = v[7];
192
+ const s1 = toAttribute(x1, "href");
193
+ if (s1 !== r.v1) writeUrlAttribute(r.a0, "href", r.v1 = s1);
194
+ }
109
195
  if (c & 1) {
110
- const x4 = textCall("concat", [v[0], "-edit"]);
111
- if (x4 !== NONCONFORMING) {
112
- const s4 = toAttribute(x4, "id");
113
- if (s4 !== r.v4) writeAttribute(r.a5, "id", r.v4 = s4);
196
+ const x2 = v[0];
197
+ const s2 = toAttribute(x2, "target");
198
+ if (s2 !== r.v2) writeAttribute(r.a0, "target", r.v2 = s2);
199
+ }
200
+ };
201
+ const p0 = (r, c, d) => {
202
+ if (c & 2) {
203
+ const x0 = textCall("concat", [v[1], "-edit"]);
204
+ if (x0 !== NONCONFORMING) {
205
+ const s0 = toAttribute(x0, "id");
206
+ if (s0 !== r.v0) writeAttribute(r.a3, "id", r.v0 = s0);
114
207
  }
115
- if (x4 !== NONCONFORMING) {
116
- const s5 = toAttribute(x4, "for");
117
- if (s5 !== r.v5) writeAttribute(r.a6, "for", r.v5 = s5);
208
+ if (x0 !== NONCONFORMING) {
209
+ const s1 = toAttribute(x0, "for");
210
+ if (s1 !== r.v1) writeAttribute(r.a4, "for", r.v1 = s1);
118
211
  }
119
- const x5 = textCall("concat", [v[0], "-remove"]);
120
- if (x5 !== NONCONFORMING) {
121
- const s6 = toAttribute(x5, "id");
122
- if (s6 !== r.v6) writeAttribute(r.a7, "id", r.v6 = s6);
212
+ const x1 = textCall("concat", [v[1], "-remove"]);
213
+ if (x1 !== NONCONFORMING) {
214
+ const s2 = toAttribute(x1, "id");
215
+ if (s2 !== r.v2) writeAttribute(r.a5, "id", r.v2 = s2);
123
216
  }
124
- if (x5 !== NONCONFORMING) {
125
- const s7 = toAttribute(x5, "for");
126
- if (s7 !== r.v7) writeAttribute(r.a8, "for", r.v7 = s7);
217
+ if (x1 !== NONCONFORMING) {
218
+ const s3 = toAttribute(x1, "for");
219
+ if (s3 !== r.v3) writeAttribute(r.a6, "for", r.v3 = s3);
127
220
  }
128
221
  }
129
- if (c & 8 && !((v[3] !== "")) !== !r.b0) {
130
- if (r.b0) { r.b0 = undefined; clearRegion(r.a3, r.e0); }
222
+ if (c & 128 && !((v[7] !== "")) !== !r.b0) {
223
+ if (r.b0) { r.b0 = undefined; clearRegion(r.a0, r.e0); }
131
224
  else { r.b0 = m1(d); r.e0.before(r.b0.n); }
132
225
  } else if (r.b0 !== undefined) p1(r.b0, c, d);
133
- if (c & 64 && !((v[6] !== "")) !== !r.b1) {
134
- if (r.b1) { r.b1 = undefined; clearRegion(r.a4, r.e1); }
135
- else { r.b1 = m2(d); r.e1.before(r.b1.n); }
136
- } else if (r.b1 !== undefined) p2(r.b1, c, d);
226
+ if (c & 128 && !((v[7] === "")) !== !r.b1) {
227
+ if (r.b1) { r.b1 = undefined; clearRegion(r.a1, r.e1); }
228
+ else { r.b1 = m3(d); r.e1.before(r.b1.n); }
229
+ } else if (r.b1 !== undefined) p3(r.b1, c, d);
230
+ if (c & 128 && !((v[7] !== "")) !== !r.b2) {
231
+ if (r.b2) { r.b2 = undefined; clearRegion(r.a2, r.e2); }
232
+ else { r.b2 = m5(d); r.e2.before(r.b2.n); }
233
+ } else if (r.b2 !== undefined) p5(r.b2, c, d);
137
234
  };
138
235
  const t0 = element.firstChild.nextSibling.firstChild;
139
236
  const t1 = t0.firstChild;
140
- const t2 = t1.nextSibling.nextSibling;
141
- const t3 = t2.firstChild;
142
- const t4 = t3.firstChild;
143
- const t5 = t3.nextSibling.nextSibling;
144
- const t6 = t2.nextSibling.nextSibling;
145
- const t7 = t6.nextSibling.nextSibling.nextSibling;
237
+ const t2 = t1.firstChild;
238
+ const t3 = t2.nextSibling.nextSibling.nextSibling;
239
+ const t4 = t1.nextSibling.nextSibling;
240
+ const t5 = t4.nextSibling.nextSibling.nextSibling;
241
+ const t6 = t5.nextSibling.nextSibling;
242
+ const t7 = t6.nextSibling.nextSibling;
146
243
  const t8 = t7.nextSibling.nextSibling;
147
- const t9 = t8.nextSibling.nextSibling;
148
- const t10 = t9.nextSibling.nextSibling;
149
- const R = { a0: t1, a1: t2, a2: t4, a5: t7, a6: t8, a7: t9, a8: t10, v0: null, v1: null, v2: null, v3: "", v4: null, v5: null, v6: null, v7: null, a3: t5, e0: t5.nextSibling, b0: undefined, a4: t6, e1: t6.nextSibling, b1: undefined };
244
+ const R = { a3: t5, a4: t6, a5: t7, a6: t8, v0: null, v1: null, v2: null, v3: null, a0: t2, e0: t2.nextSibling, b0: undefined, a1: t3, e1: t3.nextSibling, b1: undefined, a2: t4, e2: t4.nextSibling, b2: undefined };
150
245
  const I = { B };
151
246
  I.R = new Set();
152
247
  attachGeneratedController(element, S, v, (c, d) => { ((c, d) => p0(R, c, d))(c, d); for (const f of I.R) f(c, d); }, undefined, X, I);
@@ -0,0 +1,26 @@
1
+ // Generated by HTML Next 1.0.0-alpha.84 for Vanilla DOM. Do not edit.
2
+ export interface UiNoticeStripeEventMap {
3
+ dismiss: CustomEvent<{ readonly reason: "action"; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
4
+ }
5
+ export interface UiNoticeStripeElement extends HTMLDivElement {
6
+ addEventListener<K extends keyof UiNoticeStripeEventMap>(type: K, listener: (this: UiNoticeStripeElement, event: UiNoticeStripeEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
7
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UiNoticeStripeElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
8
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
9
+ removeEventListener<K extends keyof UiNoticeStripeEventMap>(type: K, listener: (this: UiNoticeStripeElement, event: UiNoticeStripeEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
10
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UiNoticeStripeElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
11
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
12
+ }
13
+ export interface UiNoticeStripeProps {
14
+ dismissLabel?: string | null;
15
+ dismissible?: boolean | null;
16
+ tone?: "neutral" | "info" | "success" | "warning" | "danger" | null;
17
+ attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
18
+ children?: readonly (string | Node)[];
19
+ slots?: Readonly<Record<string, readonly (string | Node)[]>>;
20
+ }
21
+ export declare function createUiNoticeStripe(props?: UiNoticeStripeProps): UiNoticeStripeElement;
22
+ declare global {
23
+ interface ComponentTagMap {
24
+ "ui-notice-stripe": { element: UiNoticeStripeElement; props: Omit<UiNoticeStripeProps, "attributes" | "children" | "slots"> };
25
+ }
26
+ }
@@ -0,0 +1,89 @@
1
+ // Generated by HTML Next 1.0.0-alpha.84 for Vanilla DOM. Do not edit.
2
+ import { attachGeneratedController, buildTemplate, clearRegion, readIndex, toAttribute, truthy, writeAttribute, dispatchDeclared, detailCheck, dispose, formatOf, keywordFormat, hostState, acceptProps, manageProps, generatedInputs, project, fillSlot, checkBoolean, checkConstrained, checkFormat, checkObject, checkString, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
3
+ import * as controller from "../components/ui-notice-stripe/ui-notice-stripe.js";
4
+ import "../styles/ui-notice-stripe.css";
5
+
6
+ const T0 = ["",[],"\n ",["div",["class","content"],"\n ",["div",["class","message"],4],"\n ",["div",["class","actions"],4],"\n "],"\n ",1,"\n "];
7
+ const T1 = ["",[]];
8
+ const T2 = ["",[]];
9
+ const T3 = ["ui-icon-button",["class","dismiss","size","sm","variant","ghost"],["ui-icon",["name","x"]]];
10
+ let P0, P1, P2, P3;
11
+ const S = { n: [], t: [], f: import.meta.url, g: "ui-notice-stripe", d: { "dismiss": [detailCheck(checkObject([["reason", checkConstrained(checkFormat("keyword", keywordFormat), "keyword", {"values":["action"]}), false], ["trigger", checkConstrained(checkFormat("keyword", keywordFormat), "keyword", {"values":["keyboard","pointer","programmatic"]}), false]], false)), true, true, false] }, x: dispatchDeclared, a: (host, I) => C(host, I), b: generatedInputs };
12
+ const D = { g: "ui-notice-stripe", props: { "dismissLabel": { "required":false,"default":"Dismiss notification", c: checkString, t: "string", j: 0, m: "s" }, "dismissible": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "tone": { "required":false,"values":["neutral","info","success","warning","danger"],"default":"info", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
13
+ const C = (host) => activateModule(controller, host);
14
+
15
+ export function createUiNoticeStripe(options = {}, html) {
16
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
17
+ const element = document.createElement("div");
18
+ for (const [name, value] of Object.entries(attributes)) {
19
+ if (value === null || value === undefined || value === false) continue;
20
+ element.setAttribute(name, value === true ? "" : String(value));
21
+ }
22
+ element.setAttribute("component", "ui-notice-stripe");
23
+ element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
24
+ const v = [null, null, null];
25
+ const B = acceptProps(element, D, S.n, v, componentProps, [], html);
26
+ const m1 = (d) => {
27
+ const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
28
+ const r = { n };
29
+ p1(r, -1, d);
30
+ return r;
31
+ };
32
+ const p1 = (r, c, d) => {
33
+ };
34
+ const m2 = (d) => {
35
+ const n = (P2 ??= buildTemplate(T2)).cloneNode(true);
36
+ const r = { n };
37
+ p2(r, -1, d);
38
+ return r;
39
+ };
40
+ const p2 = (r, c, d) => {
41
+ };
42
+ const m3 = (d) => {
43
+ const n = (P3 ??= buildTemplate(T3)).cloneNode(true);
44
+ const r = { n, v0: null };
45
+ p3(r, -1, d);
46
+ return r;
47
+ };
48
+ const p3 = (r, c, d) => {
49
+ if (c & 1) {
50
+ const x0 = v[0];
51
+ const s0 = toAttribute(x0, "label");
52
+ if (s0 !== r.v0) writeAttribute(r.n, "label", r.v0 = s0);
53
+ }
54
+ };
55
+ const p0 = (r, c, d) => {
56
+ if (c & 1073741828) {
57
+ const x0 = readIndex({ "neutral": "status", "info": "status", "success": "status", "warning": "status", "danger": "alert" }, v[2]);
58
+ const s0 = toAttribute(x0, "role");
59
+ if (s0 !== r.v0) writeAttribute(r.n, "role", r.v0 = s0);
60
+ }
61
+ if (c & 4) {
62
+ const x1 = hostState(["tone"], [v[2]]);
63
+ const s1 = x1;
64
+ if (s1 !== r.v1) writeAttribute(r.n, "data-ui-notice-stripe-state", (r.v1 = s1) === "" ? null : s1);
65
+ }
66
+ if (c & 2 && !(truthy(v[1])) !== !r.b2) {
67
+ if (r.b2) { r.b2 = undefined; clearRegion(r.a3, r.e2); }
68
+ else { r.b2 = m3(d); r.e2.before(r.b2.n); }
69
+ } else if (r.b2 !== undefined) p3(r.b2, c, d);
70
+ if (r.f0 === undefined) { r.f0 = 1; const at = fillSlot(r.a1, r.e0, "", J, false, undefined, d);
71
+ if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b0 = m1(d); at.before(r.b0.n); } }
72
+ else if (r.b0 !== undefined) p1(r.b0, c, d);
73
+ if (r.f1 === undefined) { r.f1 = 1; const at = fillSlot(r.a2, r.e1, "actions", J, false, undefined, d);
74
+ if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b1 = m2(d); at.before(r.b1.n); } }
75
+ else if (r.b1 !== undefined) p2(r.b1, c, d);
76
+ };
77
+ const t0 = element.firstChild.nextSibling;
78
+ const t1 = t0.firstChild.nextSibling;
79
+ const t2 = t1.firstChild;
80
+ const t3 = t1.nextSibling.nextSibling.firstChild;
81
+ const t4 = t0.nextSibling.nextSibling;
82
+ const R = { n: element, v0: undefined, v1: undefined, a1: t2, e0: t2.nextSibling, b0: undefined, f0: undefined, a2: t3, e1: t3.nextSibling, b1: undefined, f1: undefined, a3: t4, e2: t4.nextSibling, b2: undefined };
83
+ const I = { B };
84
+ const J = project(I, children, slots);
85
+ attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), undefined, undefined, I);
86
+ manageProps(I);
87
+ return element;
88
+ }
89
+ defineComponent("ui-notice-stripe", createUiNoticeStripe, ["dismissLabel","dismissible","tone"]);
package/vanilla/index.js CHANGED
@@ -69,6 +69,7 @@ export * from "./UiMenuGroup.js";
69
69
  export * from "./UiMenuItem.js";
70
70
  export * from "./UiMeter.js";
71
71
  export * from "./UiNavItem.js";
72
+ export * from "./UiNoticeStripe.js";
72
73
  export * from "./UiNumberInput.js";
73
74
  export * from "./UiPageHeader.js";
74
75
  export * from "./UiPagination.js";