@nonoun/native-ui 0.2.10 → 0.4.0

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 (79) hide show
  1. package/dist/components-lean.css +20 -941
  2. package/dist/components.css +20 -948
  3. package/dist/components.js +66 -498
  4. package/dist/core.js +121 -38
  5. package/dist/custom-elements.json +3971 -6744
  6. package/dist/foundation.css +5 -6
  7. package/dist/index.d.ts +0 -8
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/kernel.js +208 -208
  10. package/dist/native-ui-lean.css +25 -947
  11. package/dist/native-ui.css +25 -954
  12. package/dist/native-ui.js +4 -4
  13. package/dist/register-all.js +4 -4
  14. package/dist/traits/drag-controller.d.ts.map +1 -1
  15. package/dist/traits.js +3 -3
  16. package/dist/ui-icon.js +1 -1
  17. package/package.json +6 -9
  18. package/dist/components/ui-nav/index.d.ts +0 -6
  19. package/dist/components/ui-nav/index.d.ts.map +0 -1
  20. package/dist/components/ui-nav/ui-nav-element.d.ts +0 -20
  21. package/dist/components/ui-nav/ui-nav-element.d.ts.map +0 -1
  22. package/dist/components/ui-nav/ui-nav-group-element.d.ts +0 -24
  23. package/dist/components/ui-nav/ui-nav-group-element.d.ts.map +0 -1
  24. package/dist/components/ui-nav/ui-nav-group-header-element.d.ts +0 -7
  25. package/dist/components/ui-nav/ui-nav-group-header-element.d.ts.map +0 -1
  26. package/dist/components/ui-nav/ui-nav-item-element.d.ts +0 -23
  27. package/dist/components/ui-nav/ui-nav-item-element.d.ts.map +0 -1
  28. package/dist/components/ui-nav/ui-nav.d.ts +0 -2
  29. package/dist/components/ui-nav/ui-nav.d.ts.map +0 -1
  30. package/dist/containers/ui-layout-chat/index.d.ts +0 -3
  31. package/dist/containers/ui-layout-chat/index.d.ts.map +0 -1
  32. package/dist/containers/ui-layout-chat/ui-layout-chat-element.d.ts +0 -14
  33. package/dist/containers/ui-layout-chat/ui-layout-chat-element.d.ts.map +0 -1
  34. package/dist/containers/ui-layout-chat/ui-layout-chat.d.ts +0 -3
  35. package/dist/containers/ui-layout-chat/ui-layout-chat.d.ts.map +0 -1
  36. package/dist/containers/ui-layout-inspector/index.d.ts +0 -3
  37. package/dist/containers/ui-layout-inspector/index.d.ts.map +0 -1
  38. package/dist/containers/ui-layout-inspector/ui-layout-inspector-element.d.ts +0 -14
  39. package/dist/containers/ui-layout-inspector/ui-layout-inspector-element.d.ts.map +0 -1
  40. package/dist/containers/ui-layout-inspector/ui-layout-inspector.d.ts +0 -3
  41. package/dist/containers/ui-layout-inspector/ui-layout-inspector.d.ts.map +0 -1
  42. package/dist/containers/ui-layout-sidebar/index.d.ts +0 -4
  43. package/dist/containers/ui-layout-sidebar/index.d.ts.map +0 -1
  44. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-element.d.ts +0 -11
  45. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-element.d.ts.map +0 -1
  46. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-item-element.d.ts +0 -10
  47. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-item-element.d.ts.map +0 -1
  48. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-item.d.ts +0 -3
  49. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-item.d.ts.map +0 -1
  50. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar.d.ts +0 -4
  51. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar.d.ts.map +0 -1
  52. package/dist/inspector/build-inspector.d.ts +0 -8
  53. package/dist/inspector/build-inspector.d.ts.map +0 -1
  54. package/dist/inspector/index.d.ts +0 -10
  55. package/dist/inspector/index.d.ts.map +0 -1
  56. package/dist/inspector/native-tokens-color-swatch-element.d.ts +0 -15
  57. package/dist/inspector/native-tokens-color-swatch-element.d.ts.map +0 -1
  58. package/dist/inspector/native-tokens-color-swatch.d.ts +0 -3
  59. package/dist/inspector/native-tokens-color-swatch.d.ts.map +0 -1
  60. package/dist/inspector/native-tokens-colors-element.d.ts +0 -14
  61. package/dist/inspector/native-tokens-colors-element.d.ts.map +0 -1
  62. package/dist/inspector/native-tokens-colors.d.ts +0 -4
  63. package/dist/inspector/native-tokens-colors.d.ts.map +0 -1
  64. package/dist/inspector/native-tokens-inspector-element.d.ts +0 -15
  65. package/dist/inspector/native-tokens-inspector-element.d.ts.map +0 -1
  66. package/dist/inspector/native-tokens-inspector.d.ts +0 -3
  67. package/dist/inspector/native-tokens-inspector.d.ts.map +0 -1
  68. package/dist/inspector/native-tokens-themes-element.d.ts +0 -13
  69. package/dist/inspector/native-tokens-themes-element.d.ts.map +0 -1
  70. package/dist/inspector/native-tokens-themes.d.ts +0 -4
  71. package/dist/inspector/native-tokens-themes.d.ts.map +0 -1
  72. package/dist/inspector/native-tokens-variable-element.d.ts +0 -19
  73. package/dist/inspector/native-tokens-variable-element.d.ts.map +0 -1
  74. package/dist/inspector/native-tokens-variable.d.ts +0 -4
  75. package/dist/inspector/native-tokens-variable.d.ts.map +0 -1
  76. package/dist/inspector.css +0 -231
  77. package/dist/inspector.d.ts +0 -12
  78. package/dist/inspector.d.ts.map +0 -1
  79. package/dist/inspector.js +0 -609
package/dist/core.js CHANGED
@@ -1,16 +1,16 @@
1
- import { At as e, Ct as t, Ht as n, Jt as r, St as i, Yt as a, _t as o, bt as s, gt as c, vt as ee, xt as te, yt as ne } from "./components.js";
2
- function l(e) {
3
- let t = a.get(e);
4
- return t ? t instanceof r ? {
1
+ import { Bt as e, Nt as t, ct as n, dt as r, ft as i, lt as a, mt as o, pt as s, ut as c, xt as l, zt as ee } from "./components.js";
2
+ function te(t) {
3
+ let n = e.get(t);
4
+ return n ? n instanceof ee ? {
5
5
  type: "signal",
6
- value: t._value,
7
- subscriberCount: t._subs.size,
6
+ value: n._value,
7
+ subscriberCount: n._subs.size,
8
8
  dependencyCount: 0
9
9
  } : {
10
10
  type: "computed",
11
- value: t._value,
12
- subscriberCount: t._subs.size,
13
- dependencyCount: t._deps.size
11
+ value: n._value,
12
+ subscriberCount: n._subs.size,
13
+ dependencyCount: n._deps.size
14
14
  } : {
15
15
  type: "unknown",
16
16
  value: void 0,
@@ -18,13 +18,13 @@ function l(e) {
18
18
  dependencyCount: 0
19
19
  };
20
20
  }
21
- function u(e) {
21
+ function ne(e) {
22
22
  return typeof e == "object" && !!e && Symbol.toStringTag in e && e[Symbol.toStringTag] === "Signal";
23
23
  }
24
- function re(e) {
24
+ function u(e) {
25
25
  return typeof e == "object" && !!e && Symbol.toStringTag in e && e[Symbol.toStringTag] === "Computed";
26
26
  }
27
- function ie(e, t) {
27
+ function re(e, t) {
28
28
  customElements.get(e) || customElements.define(e, t);
29
29
  }
30
30
  var d = class extends Event {
@@ -37,7 +37,7 @@ var d = class extends Event {
37
37
  }), this.context = e, this.callback = t;
38
38
  }
39
39
  };
40
- function ae(e) {
40
+ function ie(e) {
41
41
  return class extends e {
42
42
  #e = /* @__PURE__ */ new Map();
43
43
  provideContext(e, t) {
@@ -56,7 +56,7 @@ function ae(e) {
56
56
  };
57
57
  };
58
58
  }
59
- function f(e) {
59
+ function ae(e) {
60
60
  return class extends e {
61
61
  #e = /* @__PURE__ */ new Map();
62
62
  requestContext(e, t) {
@@ -70,7 +70,7 @@ function f(e) {
70
70
  };
71
71
  }
72
72
  /** Enables contiguous range selection via drag or click, dispatching `ui-range-change` and `ui-range-select`. */
73
- var p = class {
73
+ var f = class {
74
74
  host;
75
75
  selector;
76
76
  mode;
@@ -193,6 +193,89 @@ var p = class {
193
193
  #T() {
194
194
  this.#w(), this.#p(), this.#y(), this.#n = !1, this.#i = "idle", this.#e = -1, this.#t = -1;
195
195
  }
196
+ }, p = class {
197
+ host;
198
+ handleSelector;
199
+ axis;
200
+ min;
201
+ max;
202
+ disabled;
203
+ reverse;
204
+ #e = 0;
205
+ #t = 0;
206
+ #n = 0;
207
+ #r = 0;
208
+ #i = !1;
209
+ #a = !1;
210
+ constructor(e, t) {
211
+ this.host = e, this.handleSelector = t.handleSelector, this.axis = t.axis ?? "horizontal", this.min = t.min ?? 0, this.max = t.max ?? Infinity, this.disabled = t.disabled ?? !1, this.reverse = t.reverse ?? !1, this.attach();
212
+ }
213
+ attach() {
214
+ this.#a || (this.#a = !0, this.host.addEventListener("pointerdown", this.#o));
215
+ }
216
+ detach() {
217
+ this.#a && (this.#a = !1, this.host.removeEventListener("pointerdown", this.#o), this.#d());
218
+ }
219
+ destroy() {
220
+ this.detach();
221
+ }
222
+ #o = (e) => {
223
+ if (e.button !== 0 || this.disabled || !this.handleSelector) return;
224
+ let t = e.target.closest?.(this.handleSelector);
225
+ if (!t || !this.host.contains(t)) return;
226
+ e.preventDefault(), this.#i = !0, this.#e = e.clientX, this.#t = e.clientY;
227
+ let n = this.host.getBoundingClientRect();
228
+ this.#n = n.width, this.#r = n.height, this.host.setAttribute("resizing", ""), this.host.setPointerCapture(e.pointerId), document.addEventListener("pointermove", this.#s), document.addEventListener("pointerup", this.#c), document.addEventListener("pointercancel", this.#l), document.addEventListener("keydown", this.#u), this.host.dispatchEvent(new CustomEvent("ui-resize-start", {
229
+ bubbles: !0,
230
+ composed: !0,
231
+ detail: {
232
+ width: this.#n,
233
+ height: this.#r
234
+ }
235
+ }));
236
+ };
237
+ #s = (e) => {
238
+ if (!this.#i) return;
239
+ let t = this.reverse ? -1 : 1, n = (e.clientX - this.#e) * t, r = (e.clientY - this.#t) * t;
240
+ if (this.axis === "horizontal" || this.axis === "both") {
241
+ let e = Math.min(this.max, Math.max(this.min, this.#n + n));
242
+ this.host.style.width = `${e}px`;
243
+ }
244
+ if (this.axis === "vertical" || this.axis === "both") {
245
+ let e = Math.min(this.max, Math.max(this.min, this.#r + r));
246
+ this.host.style.height = `${e}px`;
247
+ }
248
+ let i = this.host.getBoundingClientRect();
249
+ this.host.dispatchEvent(new CustomEvent("ui-resize-move", {
250
+ bubbles: !0,
251
+ composed: !0,
252
+ detail: {
253
+ width: i.width,
254
+ height: i.height
255
+ }
256
+ }));
257
+ };
258
+ #c = (e) => {
259
+ if (!this.#i) return;
260
+ let t = this.host.getBoundingClientRect();
261
+ this.host.dispatchEvent(new CustomEvent("ui-resize-end", {
262
+ bubbles: !0,
263
+ composed: !0,
264
+ detail: {
265
+ width: t.width,
266
+ height: t.height
267
+ }
268
+ })), this.#d();
269
+ };
270
+ #l = () => {
271
+ this.#i && ((this.axis === "horizontal" || this.axis === "both") && (this.host.style.width = `${this.#n}px`), (this.axis === "vertical" || this.axis === "both") && (this.host.style.height = `${this.#r}px`), this.#d());
272
+ };
273
+ #u = (e) => {
274
+ e.key === "Escape" && this.#i && (e.preventDefault(), (this.axis === "horizontal" || this.axis === "both") && (this.host.style.width = `${this.#n}px`), (this.axis === "vertical" || this.axis === "both") && (this.host.style.height = `${this.#r}px`), this.#d());
275
+ };
276
+ #d() {
277
+ this.#i = !1, this.host.removeAttribute("resizing"), document.removeEventListener("pointermove", this.#s), document.removeEventListener("pointerup", this.#c), document.removeEventListener("pointercancel", this.#l), document.removeEventListener("keydown", this.#u);
278
+ }
196
279
  }, m = class {
197
280
  host;
198
281
  itemHeight;
@@ -981,21 +1064,21 @@ var p = class {
981
1064
  constructor(e) {
982
1065
  this.host = e;
983
1066
  }
984
- toast(t) {
985
- return e().toastManager.toast(this.host, t);
1067
+ toast(e) {
1068
+ return l().toastManager.toast(this.host, e);
986
1069
  }
987
- dismissToast(t) {
988
- e().toastManager.dismiss(t);
1070
+ dismissToast(e) {
1071
+ l().toastManager.dismiss(e);
989
1072
  }
990
1073
  dismissAllToasts() {
991
- e().toastManager.dismissAll();
1074
+ l().toastManager.dismissAll();
992
1075
  }
993
1076
  destroy() {}
994
1077
  };
995
1078
  const A = {
996
1079
  name: "pressable",
997
1080
  create(e, t) {
998
- return new te(e, { disabled: t.disabled === "true" });
1081
+ return new s(e, { disabled: t.disabled === "true" });
999
1082
  },
1000
1083
  destroy(e) {
1001
1084
  e.destroy();
@@ -1127,7 +1210,7 @@ const A = {
1127
1210
  }, z = {
1128
1211
  name: "roving-focusable",
1129
1212
  create(e, t) {
1130
- return new s(e, {
1213
+ return new i(e, {
1131
1214
  selector: t.selector ?? void 0,
1132
1215
  orientation: t.orientation ?? void 0,
1133
1216
  wrap: t.wrap !== "false",
@@ -1143,7 +1226,7 @@ const A = {
1143
1226
  }, B = {
1144
1227
  name: "dismissable",
1145
1228
  create(e) {
1146
- return new ne(e);
1229
+ return new r(e);
1147
1230
  },
1148
1231
  destroy(e) {
1149
1232
  e.destroy();
@@ -1159,7 +1242,7 @@ const A = {
1159
1242
  }, H = {
1160
1243
  name: "popoverable",
1161
1244
  create(e) {
1162
- return new ee(e);
1245
+ return new c(e);
1163
1246
  },
1164
1247
  destroy(e) {
1165
1248
  e.destroy();
@@ -1167,7 +1250,7 @@ const A = {
1167
1250
  }, U = {
1168
1251
  name: "list-navigable",
1169
1252
  create(e, t) {
1170
- return new o(e, {
1253
+ return new a(e, {
1171
1254
  itemSelector: t["item-selector"] ?? void 0,
1172
1255
  ariaAttr: t["aria-attr"] ?? void 0,
1173
1256
  autoSync: t["auto-sync"] !== "false",
@@ -1182,21 +1265,21 @@ const A = {
1182
1265
  }, W = {
1183
1266
  name: "dialogable",
1184
1267
  create(e) {
1185
- return new c(e);
1268
+ return new n(e);
1186
1269
  },
1187
1270
  destroy(e) {
1188
1271
  e.destroy();
1189
1272
  }
1190
1273
  }, G = {
1191
1274
  name: "draggable",
1192
- create(e, n) {
1193
- return new t(e, {
1194
- selector: n.selector ?? "",
1195
- dropZoneSelector: n["drop-zone-selector"] ?? "",
1196
- axis: n.axis ?? "both",
1197
- mode: n.mode ?? "drop",
1198
- disabled: n.disabled === "true",
1199
- animate: n.animate !== "false"
1275
+ create(e, t) {
1276
+ return new o(e, {
1277
+ selector: t.selector ?? "",
1278
+ dropZoneSelector: t["drop-zone-selector"] ?? "",
1279
+ axis: t.axis ?? "both",
1280
+ mode: t.mode ?? "drop",
1281
+ disabled: t.disabled === "true",
1282
+ animate: t.animate !== "false"
1200
1283
  });
1201
1284
  },
1202
1285
  destroy(e) {
@@ -1208,7 +1291,7 @@ const A = {
1208
1291
  }, K = {
1209
1292
  name: "range-selectable",
1210
1293
  create(e, t) {
1211
- return new p(e, {
1294
+ return new f(e, {
1212
1295
  selector: t.selector ?? "",
1213
1296
  mode: t.mode ?? "drag",
1214
1297
  disabled: t.disabled === "true"
@@ -1223,7 +1306,7 @@ const A = {
1223
1306
  }, q = {
1224
1307
  name: "resizable",
1225
1308
  create(e, t) {
1226
- return new i(e, {
1309
+ return new p(e, {
1227
1310
  handleSelector: t["handle-selector"] ?? "",
1228
1311
  axis: t.axis ?? "horizontal",
1229
1312
  min: t.min ? Number(t.min) : void 0,
@@ -1355,6 +1438,6 @@ const A = {
1355
1438
  * Call once at app startup to enable `traits="..."` attribute on UIElement subclasses.
1356
1439
  */
1357
1440
  function oe() {
1358
- n(A), n(j), n(M), n(N), n(P), n(F), n(I), n(L), n(R), n(z), n(B), n(V), n(H), n(U), n(W), n(G), n(K), n(q), n(J), n(Y), n(X), n(Z), n(Q), n($);
1441
+ t(A), t(j), t(M), t(N), t(P), t(F), t(I), t(L), t(R), t(z), t(B), t(V), t(H), t(U), t(W), t(G), t(K), t(q), t(J), t(Y), t(X), t(Z), t(Q), t($);
1359
1442
  }
1360
- export { w as A, m as B, M as C, O as D, k as E, y as F, ie as G, f as H, v as I, u as J, l as K, _ as L, S as M, x as N, D as O, b as P, g as R, N as S, A as T, ae as U, p as V, d as W, R as _, X as a, F as b, q as c, W as d, U as f, z as g, B as h, Z as i, C as j, T as k, K as l, V as m, $ as n, Y as o, H as p, re as q, Q as r, J as s, oe as t, G as u, L as v, j as w, P as x, I as y, h as z };
1443
+ export { w as A, m as B, M as C, O as D, k as E, y as F, d as G, f as H, v as I, u as J, re as K, _ as L, S as M, x as N, D as O, b as P, g as R, N as S, A as T, ae as U, p as V, ie as W, ne as Y, R as _, X as a, F as b, q as c, W as d, U as f, z as g, B as h, Z as i, C as j, T as k, K as l, V as m, $ as n, Y as o, H as p, te as q, Q as r, J as s, oe as t, G as u, L as v, j as w, P as x, I as y, h as z };