spell-ui 0.8.7 → 0.8.9

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/dist/jsx.d.ts CHANGED
@@ -11330,15 +11330,15 @@ export interface UIHeaderAttributes {
11330
11330
  */
11331
11331
  "prop:sub"?: boolean | "";
11332
11332
  /**
11333
- * Icon header: a large slotted icon centred above the text.
11334
- * - takes: flag (present / absent)
11333
+ * Its icon, by name, drawn before the text. Bare, it's an icon header: a large slotted icon centred above the text.
11334
+ * - takes: icon name
11335
11335
  */
11336
- icon?: boolean | "";
11336
+ icon?: string;
11337
11337
  /**
11338
11338
  * `icon`, as the DOM element's property.
11339
11339
  * @deprecated write `icon` -- `prop:` stays only for compiled spell
11340
11340
  */
11341
- "prop:icon"?: boolean | "";
11341
+ "prop:icon"?: string;
11342
11342
  /**
11343
11343
  * A rule below it.
11344
11344
  * - takes: flag (present / absent)
package/dist/ui-parts.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import "./rolldown-runtime-CYGlBXrH.js";
2
- import { Bt as e, Ht as t, Lt as n, PartComponent as r, Rt as i, Ut as a, proto as o, protoMerged as ee, q as te, zt as s } from "./core.js";
3
- import { Show as ne } from "solid-js";
4
- import { Dynamic as re, createComponent as ie, effect as ae, getOwner as oe, memo as se, setAttribute as c, template as l } from "@solidjs/web";
2
+ import { Bt as e, Ht as t, IconGlyph as n, Lt as r, PartComponent as i, Rt as a, Ut as o, j as ee, proto as s, protoMerged as te, q as ne, zt as c } from "./core.js";
3
+ import { Show as re } from "solid-js";
4
+ import { Dynamic as ie, className as ae, createComponent as l, effect as oe, getOwner as se, insert as ce, memo as le, readShallow as ue, setAttribute as u, template as d } from "@solidjs/web";
5
5
  //#region src/components/ui-parts/UIContent.en.ts
6
- var ce = {
6
+ var de = {
7
7
  tag: "ui-content",
8
8
  icon: "align left",
9
9
  topics: [
@@ -116,13 +116,13 @@ var ce = {
116
116
  }
117
117
  ],
118
118
  texts: []
119
- }, u, d, f, p = class _UIContent extends (d = r, u = [o], d) {
119
+ }, fe, f, p, m = class _UIContent extends (f = i, fe = [s], f) {
120
120
  get rootTabIndex() {
121
121
  return this.scrolling ? 0 : void 0;
122
122
  }
123
123
  };
124
- f = s(d), n(f, 13, "vocabulary", u, p), i(f, p), e(p, "UIContent"), t(p, "vocabulary", a(f, 8, p, ce)), a(f, 11, p);
125
- var le = p, ue = {
124
+ p = c(f), r(p, 13, "vocabulary", fe, m), a(p, m), e(m, "UIContent"), t(m, "vocabulary", o(p, 8, m, de)), o(p, 11, m);
125
+ var h = m, pe = {
126
126
  tag: "ui-header",
127
127
  icon: "heading",
128
128
  topics: [
@@ -161,7 +161,7 @@ var le = p, ue = {
161
161
  name: "size",
162
162
  group: "appearance",
163
163
  kind: "size",
164
- values: te,
164
+ values: ne,
165
165
  description: "Content header size relative to the surrounding text, `mini` ... `massive`; `medium` is the default. `poster` is bigger still, for a page's title: it grows with the window, from 2.4 to 4 times the text."
166
166
  },
167
167
  {
@@ -179,8 +179,8 @@ var le = p, ue = {
179
179
  {
180
180
  name: "icon",
181
181
  group: "content",
182
- kind: "keyOnly",
183
- description: "Icon header: a large slotted icon centred above the text."
182
+ kind: "icon",
183
+ description: "Its icon, by name, drawn before the text. Bare, it's an icon header: a large slotted icon centred above the text."
184
184
  },
185
185
  {
186
186
  name: "dividing",
@@ -268,6 +268,9 @@ var le = p, ue = {
268
268
  parts: [{
269
269
  name: "header",
270
270
  description: "The header box (`<div>`, `<h1>` ... `<h6>`, or `<a>`)."
271
+ }, {
272
+ name: "icon",
273
+ description: "The box of the `icon` attribute's glyph."
271
274
  }],
272
275
  states: [
273
276
  {
@@ -313,10 +316,16 @@ var le = p, ue = {
313
316
  ],
314
317
  texts: [],
315
318
  ownsParts: ["header", "content"]
316
- }, de = /* @__PURE__ */ l("<slot>"), m, fe, h, g, _ = class _UIHeader extends (h = r, fe = [o], m = [ee], h) {
319
+ }, me = /* @__PURE__ */ d("<span>"), he = /* @__PURE__ */ d("<slot>"), ge, _e, g, _, v = class _UIHeader extends (g = i, _e = [s], ge = [te], g) {
320
+ constructor() {
321
+ super(...arguments), t(this, "iconGlyph", new n({
322
+ owner: this,
323
+ name: /* @__PURE__ */ e(() => this.icon, "name")
324
+ }));
325
+ }
317
326
  render() {
318
327
  let e = this;
319
- return ie(re, {
328
+ return l(ie, {
320
329
  get component() {
321
330
  return e.rootTag;
322
331
  },
@@ -336,11 +345,26 @@ var le = p, ue = {
336
345
  return e.link && e.level ? "heading" : void 0;
337
346
  },
338
347
  get "aria-level"() {
339
- return se(() => !!e.link)() ? e.level : void 0;
348
+ return le(() => !!e.link)() ? e.level : void 0;
340
349
  },
341
350
  get children() {
342
- var e = de();
343
- return e._$owner = oe(), e;
351
+ return [l(re, {
352
+ get when() {
353
+ return e.icon;
354
+ },
355
+ get children() {
356
+ var t = me();
357
+ return ce(t, () => e.iconGlyph.svg), oe(() => ({
358
+ e: ue(ee),
359
+ t: e.partForName("icon")
360
+ }), ({ e, t: n }, r) => {
361
+ ae(t, e, r?.e), n !== r?.t && u(t, "part", n);
362
+ }), t;
363
+ }
364
+ }), (() => {
365
+ var e = he();
366
+ return e._$owner = se(), e;
367
+ })()];
344
368
  }
345
369
  });
346
370
  }
@@ -349,12 +373,15 @@ var le = p, ue = {
349
373
  let e = this.level ? Number(this.level) : void 0;
350
374
  return e ? `h${e}` : "div";
351
375
  }
376
+ get extraClass() {
377
+ return this.icon === "" ? ee : void 0;
378
+ }
352
379
  get rootClass() {
353
380
  return this.context.ownerNoun ? this.vocabulary.noun : super.rootClass;
354
381
  }
355
382
  };
356
- g = s(h), n(g, 13, "vocabulary", fe, _), n(g, 13, "elementSetup", m, _), i(g, _), e(_, "UIHeader"), t(_, "vocabulary", a(g, 8, _, ue)), a(g, 11, _), t(_, "elementSetup", a(g, 12, _, { disabled: "its own" })), a(g, 15, _);
357
- var pe = _, me = {
383
+ _ = c(g), r(_, 13, "vocabulary", _e, v), r(_, 13, "elementSetup", ge, v), a(_, v), e(v, "UIHeader"), t(v, "vocabulary", o(_, 8, v, pe)), o(_, 11, v), t(v, "elementSetup", o(_, 12, v, { disabled: "its own" })), o(_, 15, v);
384
+ var ve = v, ye = {
358
385
  tag: "ui-description",
359
386
  icon: "align left",
360
387
  topics: ["content parts", "text"],
@@ -411,9 +438,9 @@ var pe = _, me = {
411
438
  }
412
439
  ],
413
440
  texts: []
414
- }, he, v, y, b = class _UIDescription extends (v = r, he = [o], v) {};
415
- y = s(v), n(y, 13, "vocabulary", he, b), i(y, b), e(b, "UIDescription"), t(b, "vocabulary", a(y, 8, b, me)), a(y, 11, b);
416
- var ge = b, _e = {
441
+ }, be, y, b, x = class _UIDescription extends (y = i, be = [s], y) {};
442
+ b = c(y), r(b, 13, "vocabulary", be, x), a(b, x), e(x, "UIDescription"), t(x, "vocabulary", o(b, 8, x, ye)), o(b, 11, x);
443
+ var xe = x, Se = {
417
444
  tag: "ui-meta",
418
445
  icon: "info",
419
446
  topics: ["content parts", "text"],
@@ -455,9 +482,9 @@ var ge = b, _e = {
455
482
  }
456
483
  ],
457
484
  texts: []
458
- }, ve, x, S, C = class _UIMeta extends (x = r, ve = [o], x) {};
459
- S = s(x), n(S, 13, "vocabulary", ve, C), i(S, C), e(C, "UIMeta"), t(C, "vocabulary", a(S, 8, C, _e)), a(S, 11, C);
460
- var ye = C, be = {
485
+ }, Ce, S, C, w = class _UIMeta extends (S = i, Ce = [s], S) {};
486
+ C = c(S), r(C, 13, "vocabulary", Ce, w), a(C, w), e(w, "UIMeta"), t(w, "vocabulary", o(C, 8, w, Se)), o(C, 11, w);
487
+ var we = w, Te = {
461
488
  tag: "ui-extra",
462
489
  icon: "ellipsis horizontal",
463
490
  topics: ["content parts", "cards"],
@@ -499,9 +526,9 @@ var ye = C, be = {
499
526
  }
500
527
  ],
501
528
  texts: []
502
- }, xe, w, T, E = class _UIExtra extends (w = r, xe = [o], w) {};
503
- T = s(w), n(T, 13, "vocabulary", xe, E), i(T, E), e(E, "UIExtra"), t(E, "vocabulary", a(T, 8, E, be)), a(T, 11, E);
504
- var Se = E, Ce = {
529
+ }, Ee, T, E, D = class _UIExtra extends (T = i, Ee = [s], T) {};
530
+ E = c(T), r(E, 13, "vocabulary", Ee, D), a(E, D), e(D, "UIExtra"), t(D, "vocabulary", o(E, 8, D, Te)), o(E, 11, D);
531
+ var O = D, De = {
505
532
  tag: "ui-actions",
506
533
  icon: "hand point up outline",
507
534
  topics: [
@@ -546,9 +573,9 @@ var Se = E, Ce = {
546
573
  }
547
574
  ],
548
575
  texts: []
549
- }, D, O, k, A = class _UIActions extends (O = r, D = [o], O) {};
550
- k = s(O), n(k, 13, "vocabulary", D, A), i(k, A), e(A, "UIActions"), t(A, "vocabulary", a(k, 8, A, Ce)), a(k, 11, A);
551
- var j = A, we = {
576
+ }, Oe, k, A, j = class _UIActions extends (k = i, Oe = [s], k) {};
577
+ A = c(k), r(A, 13, "vocabulary", Oe, j), a(A, j), e(j, "UIActions"), t(j, "vocabulary", o(A, 8, j, De)), o(A, 11, j);
578
+ var ke = j, Ae = {
552
579
  tag: "ui-title",
553
580
  icon: "heading",
554
581
  topics: [
@@ -595,13 +622,13 @@ var j = A, we = {
595
622
  }
596
623
  ],
597
624
  texts: []
598
- }, M, N, P, F = class _UITitle extends (N = r, M = [o], N) {
625
+ }, je, M, N, P = class _UITitle extends (M = i, je = [s], M) {
599
626
  get rootTag() {
600
627
  return this.link ? "a" : "div";
601
628
  }
602
629
  };
603
- P = s(N), n(P, 13, "vocabulary", M, F), i(P, F), e(F, "UITitle"), t(F, "vocabulary", a(P, 8, F, we)), a(P, 11, F);
604
- var Te = F, Ee = {
630
+ N = c(M), r(N, 13, "vocabulary", je, P), a(N, P), e(P, "UITitle"), t(P, "vocabulary", o(N, 8, P, Ae)), o(N, 11, P);
631
+ var F = P, Me = {
605
632
  tag: "ui-summary",
606
633
  icon: "align justify",
607
634
  topics: ["content parts", "social"],
@@ -624,9 +651,9 @@ var Te = F, Ee = {
624
651
  description: "Owned by a feed."
625
652
  }],
626
653
  texts: []
627
- }, De, I, L, R = class _UISummary extends (I = r, De = [o], I) {};
628
- L = s(I), n(L, 13, "vocabulary", De, R), i(L, R), e(R, "UISummary"), t(R, "vocabulary", a(L, 8, R, Ee)), a(L, 11, R);
629
- var Oe = R, ke = {
654
+ }, Ne, I, L, R = class _UISummary extends (I = i, Ne = [s], I) {};
655
+ L = c(I), r(L, 13, "vocabulary", Ne, R), a(L, R), e(R, "UISummary"), t(R, "vocabulary", o(L, 8, R, Me)), o(L, 11, R);
656
+ var Pe = R, Fe = {
630
657
  tag: "ui-date",
631
658
  icon: "calendar outline",
632
659
  topics: [
@@ -663,7 +690,7 @@ var Oe = R, ke = {
663
690
  description: "Owned by a feed."
664
691
  }],
665
692
  texts: []
666
- }, Ae, z, B, V = class _UIDate extends (z = r, Ae = [o], z) {
693
+ }, Ie, z, B, V = class _UIDate extends (z = i, Ie = [s], z) {
667
694
  get rootTag() {
668
695
  return "time";
669
696
  }
@@ -671,8 +698,8 @@ var Oe = R, ke = {
671
698
  return this.datetime;
672
699
  }
673
700
  };
674
- B = s(z), n(B, 13, "vocabulary", Ae, V), i(B, V), e(V, "UIDate"), t(V, "vocabulary", a(B, 8, V, ke)), a(B, 11, V);
675
- var je = V, Me = {
701
+ B = c(z), r(B, 13, "vocabulary", Ie, V), a(B, V), e(V, "UIDate"), t(V, "vocabulary", o(B, 8, V, Fe)), o(B, 11, V);
702
+ var Le = V, Re = {
676
703
  tag: "ui-author",
677
704
  icon: "user",
678
705
  topics: ["content parts", "social"],
@@ -713,13 +740,13 @@ var je = V, Me = {
713
740
  description: "Owned by a feed."
714
741
  }],
715
742
  texts: []
716
- }, Ne, H, U, W = class _UIAuthor extends (H = r, Ne = [o], H) {
743
+ }, ze, H, U, W = class _UIAuthor extends (H = i, ze = [s], H) {
717
744
  get rootTag() {
718
745
  return this.link ? "a" : "span";
719
746
  }
720
747
  };
721
- U = s(H), n(U, 13, "vocabulary", Ne, W), i(U, W), e(W, "UIAuthor"), t(W, "vocabulary", a(U, 8, W, Me)), a(U, 11, W);
722
- var Pe = W, Fe = {
748
+ U = c(H), r(U, 13, "vocabulary", ze, W), a(U, W), e(W, "UIAuthor"), t(W, "vocabulary", o(U, 8, W, Re)), o(U, 11, W);
749
+ var Be = W, Ve = {
723
750
  tag: "ui-avatar",
724
751
  icon: "user circle",
725
752
  topics: [
@@ -774,36 +801,36 @@ var Pe = W, Fe = {
774
801
  }
775
802
  ],
776
803
  texts: []
777
- }, Ie = /* @__PURE__ */ l("<img>"), Le = /* @__PURE__ */ l("<slot>"), Re, G, K, q = class _UIAvatar extends (G = r, Re = [o], G) {
804
+ }, He = /* @__PURE__ */ d("<img>"), Ue = /* @__PURE__ */ d("<slot>"), We, G, K, q = class _UIAvatar extends (G = i, We = [s], G) {
778
805
  get rootTag() {
779
806
  return "span";
780
807
  }
781
808
  content() {
782
809
  let e = this;
783
- return ie(ne, {
810
+ return l(re, {
784
811
  get when() {
785
812
  return e.src;
786
813
  },
787
814
  get fallback() {
788
- var e = Le();
789
- return e._$owner = oe(), e;
815
+ var e = Ue();
816
+ return e._$owner = se(), e;
790
817
  },
791
818
  get children() {
792
- var t = Ie();
793
- return ae(() => ({
819
+ var t = He();
820
+ return oe(() => ({
794
821
  e: e.src,
795
822
  t: e.tooltip ?? "",
796
823
  a: e.tooltip,
797
824
  o: e.partForName("image")
798
825
  }), ({ e, t: n, a: r, o: i }, a) => {
799
- e !== a?.e && c(t, "src", e), n !== a?.t && c(t, "alt", n), r !== a?.a && c(t, "title", r), i !== a?.o && c(t, "part", i);
826
+ e !== a?.e && u(t, "src", e), n !== a?.t && u(t, "alt", n), r !== a?.a && u(t, "title", r), i !== a?.o && u(t, "part", i);
800
827
  }), t;
801
828
  }
802
829
  });
803
830
  }
804
831
  };
805
- K = s(G), n(K, 13, "vocabulary", Re, q), i(K, q), e(q, "UIAvatar"), t(q, "vocabulary", a(K, 8, q, Fe)), a(K, 11, q);
806
- var ze = q, Be = {
832
+ K = c(G), r(K, 13, "vocabulary", We, q), a(K, q), e(q, "UIAvatar"), t(q, "vocabulary", o(K, 8, q, Ve)), o(K, 11, q);
833
+ var Ge = q, Ke = {
807
834
  tag: "ui-detail",
808
835
  icon: "info circle",
809
836
  topics: ["content parts", "text"],
@@ -832,13 +859,13 @@ var ze = q, Be = {
832
859
  description: "Owned by a label."
833
860
  }],
834
861
  texts: []
835
- }, Ve, J, Y, X = class _UIDetail extends (J = r, Ve = [o], J) {
862
+ }, qe, J, Y, X = class _UIDetail extends (J = i, qe = [s], J) {
836
863
  get rootTag() {
837
864
  return this.link ? "a" : "span";
838
865
  }
839
866
  };
840
- Y = s(J), n(Y, 13, "vocabulary", Ve, X), i(Y, X), e(X, "UIDetail"), t(X, "vocabulary", a(Y, 8, X, Be)), a(Y, 11, X);
841
- var He = X, Ue = {
867
+ Y = c(J), r(Y, 13, "vocabulary", qe, X), a(Y, X), e(X, "UIDetail"), t(X, "vocabulary", o(Y, 8, X, Ke)), o(Y, 11, X);
868
+ var Je = X, Ye = {
842
869
  tag: "ui-value",
843
870
  icon: "hashtag",
844
871
  topics: ["content parts", "data display"],
@@ -873,11 +900,11 @@ var He = X, Ue = {
873
900
  description: "Owned by a search."
874
901
  }],
875
902
  texts: []
876
- }, We, Z, Q, $ = class _UIValue extends (Z = r, We = [o], Z) {};
877
- Q = s(Z), n(Q, 13, "vocabulary", We, $), i(Q, $), e($, "UIValue"), t($, "vocabulary", a(Q, 8, $, Ue)), a(Q, 11, $);
878
- var Ge = $;
879
- le.define(), pe.define(), ge.define(), ye.define(), Se.define(), j.define(), Te.define(), Oe.define(), je.define(), Pe.define(), ze.define(), He.define(), Ge.define();
903
+ }, Xe, Z, Q, $ = class _UIValue extends (Z = i, Xe = [s], Z) {};
904
+ Q = c(Z), r(Q, 13, "vocabulary", Xe, $), a(Q, $), e($, "UIValue"), t($, "vocabulary", o(Q, 8, $, Ye)), o(Q, 11, $);
905
+ var Ze = $;
906
+ h.define(), ve.define(), xe.define(), we.define(), O.define(), ke.define(), F.define(), Pe.define(), Le.define(), Be.define(), Ge.define(), Je.define(), Ze.define();
880
907
  //#endregion
881
- export { j as UIActions, Pe as UIAuthor, ze as UIAvatar, le as UIContent, je as UIDate, ge as UIDescription, He as UIDetail, Se as UIExtra, pe as UIHeader, ye as UIMeta, Oe as UISummary, Te as UITitle, Ge as UIValue };
908
+ export { ke as UIActions, Be as UIAuthor, Ge as UIAvatar, h as UIContent, Le as UIDate, xe as UIDescription, Je as UIDetail, O as UIExtra, ve as UIHeader, we as UIMeta, Pe as UISummary, F as UITitle, Ze as UIValue };
882
909
 
883
910
  //# sourceMappingURL=ui-parts.js.map