meticulous-ui 3.5.1 → 3.5.2

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,72 +1,74 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { useState as l, useRef as h, useEffect as R, createElement as N } from "react";
1
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
+ import { useState as i, useRef as R, useEffect as C, createElement as N } from "react";
3
3
  import { createPortal as b } from "react-dom";
4
4
  import { Logo as j } from "./helpers.js";
5
- import k from "../../colors/grey.js";
6
- import { COLOR_MAP as y, INFO as A, INFO_COLORS as B, ERROR as v } from "./constants.js";
7
- import { ToastWrapper as D, Message as I, Title as W, Subtitle as _, CloseButtonContainer as z, ProgressRing as q, CloseWrapper as G, ToastsContainer as H } from "./styles.js";
5
+ import y from "../../colors/grey.js";
6
+ import { COLOR_MAP as A, INFO as B, INFO_COLORS as D, ERROR as M } from "./constants.js";
7
+ import { ToastWrapper as I, Message as W, Title as _, Subtitle as z, CloseButtonContainer as q, ProgressRing as G, CloseWrapper as H, ToastsContainer as J } from "./styles.js";
8
8
  const x = () => {
9
- }, ee = ({ toasts: e, ...r }) => {
10
- const [o, s] = l(e);
11
- R(() => {
12
- s(e);
9
+ }, re = ({ toasts: e, ...r }) => {
10
+ const [o, n] = i(e);
11
+ C(() => {
12
+ n(e);
13
13
  }, [e]);
14
- const u = ({ type: a, id: m, title: d, subtitle: n, duration: f, onExpire: c = x }, C) => /* @__PURE__ */ N(J, { type: a, title: d, subtitle: n, duration: f, key: m, onExpire: c });
14
+ const l = ({ type: u, id: a, title: m, subtitle: d, duration: s, onExpire: f = x }, T) => /* @__PURE__ */ N(K, { type: u, title: m, subtitle: d, duration: s, key: a, onExpire: f });
15
15
  return b(
16
- /* @__PURE__ */ t(H, { ...r, children: [...o].reverse().map(u) }),
16
+ /* @__PURE__ */ t(J, { ...r, children: [...o].reverse().map(l) }),
17
17
  document.body
18
18
  );
19
- }, w = (e, r, o) => () => {
19
+ }, v = (e, r, o) => () => {
20
20
  e(!0), setTimeout(() => {
21
21
  r(!1), o();
22
22
  }, 500);
23
- }, J = ({
24
- type: e = A,
23
+ }, K = ({
24
+ type: e = B,
25
25
  visible: r = !0,
26
26
  duration: o = 5,
27
- onExpire: s = x,
27
+ onExpire: n = x,
28
+ hasClockwiseRotation: l = !1,
28
29
  title: u,
29
30
  subtitle: a,
30
31
  ...m
31
32
  }) => {
32
- const [d, n] = l(r), [f, c] = l(!1), [C, O] = l(!1), T = h(null), p = h((o - 0.5) * 1e3), g = h(null), $ = (F) => {
33
- g.current = Date.now(), T.current = setTimeout(w(c, n, s), F);
33
+ const [d, s] = i(r), [f, T] = i(!1), [L, O] = i(!1), h = R(null), p = R((o - 0.5) * 1e3), g = R(null), $ = (F) => {
34
+ g.current = Date.now(), h.current = setTimeout(v(T, s, n), F);
34
35
  };
35
- R(() => {
36
- n(r);
37
- }, [r]), R(() => ($(p.current), () => clearTimeout(T.current)), []);
38
- const L = () => {
39
- clearTimeout(T.current), p.current -= Date.now() - g.current, O(!0);
40
- }, E = () => {
36
+ C(() => {
37
+ s(r);
38
+ }, [r]), C(() => ($(p.current), () => clearTimeout(h.current)), []);
39
+ const E = () => {
40
+ clearTimeout(h.current), p.current -= Date.now() - g.current, O(!0);
41
+ }, P = () => {
41
42
  O(!1), $(p.current);
42
- }, { main: M, side: P, bg: S } = y[e] ?? B;
43
+ }, { main: w, side: S, bg: k } = A[e] ?? D;
43
44
  if (d)
44
- return /* @__PURE__ */ i(
45
- D,
45
+ return /* @__PURE__ */ c(
46
+ I,
46
47
  {
47
- $bg: S,
48
- role: e === v ? "alert" : "status",
49
- "aria-live": e === v ? "assertive" : "polite",
48
+ $bg: k,
49
+ role: e === M ? "alert" : "status",
50
+ "aria-live": e === M ? "assertive" : "polite",
50
51
  "aria-atomic": "true",
51
52
  className: `${f ? "fade-out" : "fade-in"}`,
52
- onMouseEnter: L,
53
- onMouseLeave: E,
53
+ onMouseEnter: E,
54
+ onMouseLeave: P,
54
55
  ...m,
55
56
  children: [
56
- /* @__PURE__ */ t(j, { type: e, $main: M, $side: P }),
57
- /* @__PURE__ */ i(I, { children: [
58
- /* @__PURE__ */ t(W, { children: u }),
59
- a && /* @__PURE__ */ t(_, { children: a })
57
+ /* @__PURE__ */ t(j, { type: e, $main: w, $side: S }),
58
+ /* @__PURE__ */ c(W, { children: [
59
+ /* @__PURE__ */ t(_, { children: u }),
60
+ a && /* @__PURE__ */ t(z, { children: a })
60
61
  ] }),
61
- /* @__PURE__ */ i(z, { children: [
62
- /* @__PURE__ */ i(
63
- q,
62
+ /* @__PURE__ */ c(q, { children: [
63
+ /* @__PURE__ */ c(
64
+ G,
64
65
  {
65
66
  "aria-hidden": "true",
66
67
  viewBox: "0 0 28 28",
67
68
  $duration: o,
68
- $color: M,
69
- $paused: C,
69
+ $color: w,
70
+ $paused: L,
71
+ $hasClockwiseRotation: l,
70
72
  children: [
71
73
  /* @__PURE__ */ t("circle", { cx: "14", cy: "14", r: "12" }),
72
74
  /* @__PURE__ */ t("circle", { cx: "14", cy: "14", r: "12" })
@@ -74,12 +76,12 @@ const x = () => {
74
76
  }
75
77
  ),
76
78
  /* @__PURE__ */ t(
77
- G,
79
+ H,
78
80
  {
79
81
  "aria-label": "Close notification",
80
82
  size: 13,
81
- color: k.m600,
82
- onClick: w(c, n, s)
83
+ color: y.m600,
84
+ onClick: v(T, s, n)
83
85
  }
84
86
  )
85
87
  ] })
@@ -88,6 +90,6 @@ const x = () => {
88
90
  );
89
91
  };
90
92
  export {
91
- ee as ToastContainer,
92
- J as default
93
+ re as ToastContainer,
94
+ K as default
93
95
  };
@@ -182,7 +182,7 @@ const s = r`
182
182
  `, k = t.svg`
183
183
  position: absolute;
184
184
  inset: 0;
185
- transform: rotate(-90deg);
185
+ transform: ${({ $hasClockwiseRotation: e }) => e ? "rotate(-90deg)" : "rotate(90deg) scaleX(-1)"};
186
186
  pointer-events: none;
187
187
 
188
188
  circle {
@@ -235,7 +235,7 @@ const s = r`
235
235
  max-width: 18rem;
236
236
  width: auto;
237
237
  }
238
- `, I = t.div`
238
+ `, X = t.div`
239
239
  font-weight: 400;
240
240
  font-size: 1.6rem;
241
241
  color: ${a.m700};
@@ -257,7 +257,7 @@ export {
257
257
  b as Outer,
258
258
  y as OuterChild,
259
259
  k as ProgressRing,
260
- I as Subtitle,
260
+ X as Subtitle,
261
261
  z as Title,
262
262
  g as ToastWrapper,
263
263
  w as ToastsContainer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meticulous-ui",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "license": "ISC",
5
5
  "description": "A comprehensive React UI component library with a wide range of customizable components, icons, colors, and utilities for building modern web applications.",
6
6
  "types": "./index.d.ts",