@spesia/ui 1.10.11 → 1.10.12

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,10 +1,11 @@
1
- export type LogoAnimationColor = "brown" | "coral" | "black" | "light";
1
+ export type LogoAnimationColor = "brown" | "coral" | "monochrome";
2
2
  export type LogoAnimationProps = {
3
3
  size?: number;
4
4
  color?: LogoAnimationColor;
5
+ tone?: 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100;
5
6
  loop?: boolean;
6
7
  speed?: number;
7
8
  className?: string;
8
9
  };
9
- declare const LogoAnimation: ({ size, color, loop, speed, className, }: LogoAnimationProps) => import("react/jsx-runtime").JSX.Element;
10
+ declare const LogoAnimation: ({ size, color, loop, tone, speed, className, }: LogoAnimationProps) => import("react/jsx-runtime").JSX.Element;
10
11
  export default LogoAnimation;
@@ -1,56 +1,56 @@
1
1
  import { jsx as y } from "react/jsx-runtime";
2
- import g from "../../node_modules/.pnpm/lottie-react@2.4.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/lottie-react/build/index.es.js";
3
- import { useMemo as b, useRef as d, useEffect as x } from "react";
4
- import w from "./logo-animation.json.js";
5
- import { colors as p } from "../../styles/colors.js";
2
+ import d from "../../node_modules/.pnpm/lottie-react@2.4.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/lottie-react/build/index.es.js";
3
+ import { useMemo as g, useRef as b, useEffect as w } from "react";
4
+ import x from "./logo-animation.json.js";
5
+ import { colors as e } from "../../styles/colors.js";
6
6
  const E = {
7
- brown: p.primary.brown[90],
8
- coral: p.primary.coral[100],
9
- black: "#000000",
10
- light: p.primary.coral[20]
7
+ brown: { ...e.primary.brown, 10: e.primary.brown[20] },
8
+ coral: { ...e.primary.coral, 10: e.primary.coral[20] },
9
+ monochrome: { ...e.secondary.grey, 10: e.neutral.white }
11
10
  };
12
- function M(t) {
13
- const o = t.replace("#", ""), e = parseInt(o.slice(0, 2), 16) / 255, r = parseInt(o.slice(2, 4), 16) / 255, n = parseInt(o.slice(4, 6), 16) / 255;
14
- return [e, r, n, 1];
11
+ function M(r) {
12
+ const o = r.replace("#", ""), n = parseInt(o.slice(0, 2), 16) / 255, a = parseInt(o.slice(2, 4), 16) / 255, t = parseInt(o.slice(4, 6), 16) / 255;
13
+ return [n, a, t, 1];
15
14
  }
16
- function S(t, o) {
17
- var a;
18
- const [e, r, n, i] = M(o), c = JSON.parse(JSON.stringify(t));
19
- return (a = c.layers) == null || a.forEach((s) => {
20
- var f;
21
- (f = s.shapes) == null || f.forEach((h) => {
22
- var m;
23
- (m = h.it) == null || m.forEach((l) => {
15
+ function S(r, o) {
16
+ var s;
17
+ const [n, a, t, m] = M(o), i = JSON.parse(JSON.stringify(r));
18
+ return (s = i.layers) == null || s.forEach((l) => {
19
+ var c;
20
+ (c = l.shapes) == null || c.forEach((h) => {
21
+ var f;
22
+ (f = h.it) == null || f.forEach((p) => {
24
23
  var u;
25
- l.ty === "fl" && ((u = l.c) != null && u.k) && (l.c.k = [e, r, n, i]);
24
+ p.ty === "fl" && ((u = p.c) != null && u.k) && (p.c.k = [n, a, t, m]);
26
25
  });
27
26
  });
28
- }), c;
27
+ }), i;
29
28
  }
30
- const j = ({
31
- size: t = 64,
29
+ const k = ({
30
+ size: r = 64,
32
31
  color: o = "brown",
33
- loop: e = !0,
34
- speed: r = 1,
35
- className: n
32
+ loop: n = !0,
33
+ tone: a = 100,
34
+ speed: t = 1,
35
+ className: m
36
36
  }) => {
37
- const i = E[o], c = b(() => S(w, i), [i]), a = d(null);
38
- return x(() => {
39
- var s;
40
- (s = a.current) == null || s.setSpeed(r);
41
- }, [r]), /* @__PURE__ */ y(
42
- g,
37
+ const i = E[o][a ?? 100], s = g(() => S(x, i), [i]), l = b(null);
38
+ return w(() => {
39
+ var c;
40
+ (c = l.current) == null || c.setSpeed(t);
41
+ }, [t]), /* @__PURE__ */ y(
42
+ d,
43
43
  {
44
- lottieRef: a,
45
- animationData: c,
46
- loop: e,
44
+ lottieRef: l,
45
+ animationData: s,
46
+ loop: n,
47
47
  autoplay: !0,
48
48
  rendererSettings: { preserveAspectRatio: "xMidYMid meet" },
49
- style: { width: t, height: t },
50
- className: n
49
+ style: { width: r, height: r },
50
+ className: m
51
51
  }
52
52
  );
53
53
  };
54
54
  export {
55
- j as default
55
+ k as default
56
56
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.10.11",
6
+ "version": "1.10.12",
7
7
  "description": "The Spesia UI toolkit for React",
8
8
  "files": [
9
9
  "dist"