@floegence/floe-webapp-core 0.30.0 → 0.32.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.
@@ -1,11 +1,11 @@
1
- import { effect as o, className as u, insert as s, createComponent as r, template as f } from "solid-js/web";
1
+ import { effect as i, className as u, insert as s, createComponent as r, template as f } from "solid-js/web";
2
2
  import { For as h } from "solid-js";
3
- import { cn as i } from "../../utils/cn.js";
3
+ import { cn as o } from "../../utils/cn.js";
4
4
  var m = /* @__PURE__ */ f("<div>"), p = /* @__PURE__ */ f('<div><div class="flex items-center gap-3"><div class="space-y-2 flex-1">'), _ = /* @__PURE__ */ f('<div class="flex items-center gap-3"><div class="flex-1 space-y-1">');
5
5
  function c(n) {
6
6
  return (() => {
7
7
  var l = m();
8
- return o(() => u(l, i("animate-pulse rounded-md bg-muted", n.class))), l;
8
+ return i(() => u(l, o("rounded-md floe-skeleton", n.class))), l;
9
9
  })();
10
10
  }
11
11
  function v(n) {
@@ -20,10 +20,10 @@ function v(n) {
20
20
  },
21
21
  children: (t) => r(c, {
22
22
  get class() {
23
- return i("h-4", t === l() - 1 ? "w-3/4" : "w-full");
23
+ return o("h-4", t === l() - 1 ? "w-3/4" : "w-full");
24
24
  }
25
25
  })
26
- })), o(() => u(e, i("space-y-2", n.class))), e;
26
+ })), i(() => u(e, o("space-y-2", n.class))), e;
27
27
  })();
28
28
  }
29
29
  function y(n) {
@@ -37,7 +37,7 @@ function y(n) {
37
37
  class: "h-3 w-1/4"
38
38
  }), null), s(l, r(v, {
39
39
  lines: 2
40
- }), null), o(() => u(l, i("rounded-lg border border-border p-4 space-y-4", n.class))), l;
40
+ }), null), i(() => u(l, o("rounded-lg border border-border p-4 space-y-4", n.class))), l;
41
41
  })();
42
42
  }
43
43
  function x(n) {
@@ -60,7 +60,7 @@ function x(n) {
60
60
  class: "h-3 w-1/3"
61
61
  }), null), t;
62
62
  })()
63
- })), o(() => u(e, i("space-y-3", n.class))), e;
63
+ })), i(() => u(e, o("space-y-3", n.class))), e;
64
64
  })();
65
65
  }
66
66
  export {
@@ -4,6 +4,6 @@ export interface SnakeLoaderProps {
4
4
  class?: string;
5
5
  }
6
6
  /**
7
- * 9-cell grid loader with breathing center and rotating trail
7
+ * 9-cell grid loader with diagonal light wave
8
8
  */
9
9
  export declare function SnakeLoader(props: SnakeLoaderProps): import("solid-js").JSX.Element;
@@ -1,91 +1,44 @@
1
- import { insert as y, createComponent as _, effect as m, className as d, style as x, template as h } from "solid-js/web";
2
- import { createSignal as z, onMount as I, onCleanup as P, For as S } from "solid-js";
3
- import { cn as g } from "../../utils/cn.js";
4
- var B = /* @__PURE__ */ h(`<div role=status aria-label=Loading><style>
5
- @keyframes snakeBreathing {
6
- 0%, 100% {
7
- opacity: 0.5;
8
- transform: scale(0.85);
9
- }
10
- 50% {
11
- opacity: 1;
12
- transform: scale(1);
13
- }
14
- }
15
- `), L = /* @__PURE__ */ h("<div>"), M = /* @__PURE__ */ h('<div style="animation:snakeBreathing 1.5s ease-in-out infinite">');
16
- const u = {
17
- sm: {
18
- grid: "w-6 h-6",
19
- cell: "w-1.5 h-1.5",
20
- center: "w-1 h-1"
1
+ import { insert as g, createComponent as f, effect as n, setStyleProperty as l, className as u, template as d } from "solid-js/web";
2
+ import { For as v } from "solid-js";
3
+ import { cn as h } from "../../utils/cn.js";
4
+ var w = /* @__PURE__ */ d("<div role=status aria-label=Loading>"), y = /* @__PURE__ */ d('<div class="floe-grid-cell bg-primary">');
5
+ const x = {
6
+ sm: "w-6 h-6 gap-[2px]",
7
+ md: "w-9 h-9 gap-[3px]",
8
+ lg: "w-12 h-12 gap-1"
9
+ }, z = {
10
+ slow: {
11
+ duration: "2.4s",
12
+ step: 0.15
21
13
  },
22
- md: {
23
- grid: "w-9 h-9",
24
- cell: "w-2.5 h-2.5",
25
- center: "w-2 h-2"
14
+ normal: {
15
+ duration: "1.8s",
16
+ step: 0.12
26
17
  },
27
- lg: {
28
- grid: "w-12 h-12",
29
- cell: "w-3 h-3",
30
- center: "w-2.5 h-2.5"
18
+ fast: {
19
+ duration: "1.2s",
20
+ step: 0.08
31
21
  }
32
- }, w = {
33
- slow: 200,
34
- normal: 120,
35
- fast: 80
36
- }, f = [
37
- [100, 1.1],
38
- // head: full opacity, slightly larger
39
- [85, 1.05],
40
- // trail 1: smooth transition
41
- [65, 1],
42
- // trail 2
43
- [40, 0.95]
44
- // trail 3: fading out
45
- ];
46
- function R(l) {
47
- const c = () => l.size ?? "md", v = () => l.speed ?? "normal", i = [0, 1, 2, 5, 8, 7, 6, 3], [$, b] = z(0);
48
- I(() => {
49
- const t = setInterval(() => {
50
- b((n) => (n + 1) % i.length);
51
- }, w[v()]);
52
- P(() => clearInterval(t));
53
- });
54
- const k = (t) => {
55
- const n = $();
56
- for (let r = 0; r < f.length; r++)
57
- if (i[(n + i.length - r) % i.length] === t) return r;
58
- return -1;
59
- };
22
+ }, S = [0, 1, 2, 1, 2, 3, 2, 3, 4];
23
+ function F(t) {
24
+ const c = () => t.size ?? "md", m = () => t.speed ?? "normal", s = () => z[m()];
60
25
  return (() => {
61
- var t = B(), n = t.firstChild;
62
- return y(t, _(S, {
26
+ var r = w();
27
+ return g(r, f(v, {
63
28
  each: [0, 1, 2, 3, 4, 5, 6, 7, 8],
64
- children: (r) => {
65
- const o = r === 4, a = () => o ? -1 : k(r);
66
- return (() => {
67
- var s = L();
68
- return y(s, o && (() => {
69
- var e = M();
70
- return m(() => d(e, g("rounded-sm bg-primary", u[c()].center))), e;
71
- })()), m((e) => {
72
- var p = g("flex items-center justify-center rounded-sm", u[c()].cell, o && "bg-transparent"), C = o ? {} : {
73
- "background-color": a() >= 0 ? `color-mix(in srgb, var(--primary) ${f[a()]?.[0] ?? 0}%, transparent)` : "var(--muted)",
74
- transform: `scale(${a() >= 0 ? f[a()]?.[1] ?? 1 : 1})`,
75
- "transition-property": "background-color, transform",
76
- "transition-duration": `${w[v()] * 0.9}ms`,
77
- "transition-timing-function": "ease-out"
78
- };
79
- return p !== e.e && d(s, e.e = p), e.t = x(s, C, e.t), e;
80
- }, {
81
- e: void 0,
82
- t: void 0
83
- }), s;
84
- })();
85
- }
86
- }), n), m(() => d(t, g("grid grid-cols-3 gap-1", u[c()].grid, l.class))), t;
29
+ children: (p) => (() => {
30
+ var o = y();
31
+ return n((e) => {
32
+ var a = s().duration, i = `${S[p] * s().step}s`;
33
+ return a !== e.e && l(o, "--floe-grid-dur", e.e = a), i !== e.t && l(o, "--floe-grid-delay", e.t = i), e;
34
+ }, {
35
+ e: void 0,
36
+ t: void 0
37
+ }), o;
38
+ })()
39
+ })), n(() => u(r, h("grid grid-cols-3", x[c()], t.class))), r;
87
40
  })();
88
41
  }
89
42
  export {
90
- R as SnakeLoader
43
+ F as SnakeLoader
91
44
  };