meticulous-ui 3.5.2 → 3.5.3

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,56 +1,52 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as D, jsx as o } from "react/jsx-runtime";
2
2
  import { useRef as v } from "react";
3
- import x from "../Spinner/Spinner.js";
3
+ import L from "../Spinner/Spinner.js";
4
4
  import I from "../../colors/colorMap.js";
5
5
  import { blue as f } from "../../colors/blue.js";
6
6
  import { ButtonWrapper as K, SpinnerWrapper as R, Content as B, ButtonContainer as E } from "./styles.js";
7
- import L from "../Ripple/Ripple.js";
8
- import S from "../../colors/white.js";
7
+ import S from "../Ripple/Ripple.js";
8
+ import j from "../../colors/white.js";
9
9
  import k from "../../colors/grey.js";
10
10
  import { MEDIUM as z, SIZE as M } from "./constants.js";
11
- const P = ({ theme: t, children: n }) => /* @__PURE__ */ o(L, { rippleColor: t.m100, children: n }), Q = (t) => {
11
+ const P = ({ theme: t, children: i }) => /* @__PURE__ */ o(S, { rippleColor: t.m100, children: i }), T = (t) => {
12
12
  const {
13
- children: n,
14
- theme: i = f,
13
+ children: i,
14
+ theme: n = f,
15
15
  size: u = z,
16
16
  width: l,
17
17
  leftIcon: W,
18
- rightIcon: j,
19
- isLoading: r,
18
+ rightIcon: U,
19
+ isLoading: e,
20
20
  textColor: s,
21
21
  onKeyDown: w,
22
22
  ...C
23
- } = t || {}, d = v(0), $ = (e) => {
24
- if (e.key === "Enter" || e.key === " ") {
25
- const a = Date.now();
26
- if (a - d.current < 500) {
27
- e.preventDefault(), e.stopPropagation();
23
+ } = t || {}, d = v(0), $ = (r) => {
24
+ if (r.key === "Enter" || r.key === " ") {
25
+ const h = Date.now();
26
+ if (h - d.current < 500) {
27
+ r.preventDefault(), r.stopPropagation();
28
28
  return;
29
29
  }
30
- d.current = a;
30
+ d.current = h;
31
31
  }
32
- w?.(e);
33
- }, { m400: y, m500: g, m600: b } = I[i] ?? f, { height: m, width: c, font: D } = M[u] || {}, p = ["white", "yellow"].includes(i) ? k.m600 : S, h = /* @__PURE__ */ o(
32
+ w?.(r);
33
+ }, { m400: g, m500: y, m600: b } = I[n] ?? f, { height: m, width: c, font: x } = M[u] || {}, a = ["white", "yellow"].includes(n) ? k.m600 : j, p = /* @__PURE__ */ D(
34
34
  K,
35
35
  {
36
36
  type: "button",
37
37
  ...C,
38
38
  onKeyDown: $,
39
- $hoverColor: g,
39
+ $hoverColor: y,
40
40
  $activeColor: b,
41
- $selectedColor: y,
41
+ $selectedColor: g,
42
42
  $height: m,
43
43
  $width: l || c,
44
44
  disabled: t.disabled,
45
- $isLoading: r,
46
- children: r ? /* @__PURE__ */ o(R, { children: /* @__PURE__ */ o(x, { size: "small", color: s || p }) }) : /* @__PURE__ */ o(
47
- B,
48
- {
49
- $textColor: s || p,
50
- $font: D,
51
- children: n
52
- }
53
- )
45
+ $isLoading: e,
46
+ children: [
47
+ /* @__PURE__ */ o(R, { $isLoading: e, children: /* @__PURE__ */ o(L, { size: "small", color: s || a }) }),
48
+ /* @__PURE__ */ o(B, { $isLoading: e, $textColor: s || a, $font: x, children: i })
49
+ ]
54
50
  }
55
51
  );
56
52
  return /* @__PURE__ */ o(
@@ -59,11 +55,11 @@ const P = ({ theme: t, children: n }) => /* @__PURE__ */ o(L, { rippleColor: t.m
59
55
  $height: m,
60
56
  $width: l || c,
61
57
  disabled: t.disabled,
62
- $isLoading: r,
63
- children: r ? h : /* @__PURE__ */ o(P, { theme: i, children: h })
58
+ $isLoading: e,
59
+ children: e ? p : /* @__PURE__ */ o(P, { theme: n, children: p })
64
60
  }
65
61
  );
66
62
  };
67
63
  export {
68
- Q as default
64
+ T as default
69
65
  };
@@ -1,19 +1,21 @@
1
- import e, { css as n } from "styled-components";
1
+ import r, { css as n } from "styled-components";
2
2
  import i from "../../colors/grey.js";
3
- const d = e.button`
3
+ const d = r.button`
4
4
  height: ${({ $height: o }) => o}rem;
5
5
  width: ${({ $width: o }) => o}rem;
6
6
  border-radius: 0.96rem;
7
7
  border: none;
8
8
  padding: 0.96rem 0.64rem;
9
- background-color: ${({ $selectedColor: o, disabled: r }) => r ? i.m500 : o};
10
- cursor: ${({ disabled: o, $isLoading: r }) => o ? "not-allowed" : r ? "auto" : "pointer"};
9
+ position: relative;
10
+ overflow: hidden;
11
+ background-color: ${({ $selectedColor: o, disabled: e }) => e ? i.m500 : o};
12
+ cursor: ${({ disabled: o, $isLoading: e }) => o ? "not-allowed" : e ? "auto" : "pointer"};
11
13
 
12
14
  ${({ $isLoading: o }) => o && n`
13
15
  pointer-events: none;
14
16
  `};
15
17
 
16
- ${({ disabled: o, $isLoading: r }) => !(o || r) && n`
18
+ ${({ disabled: o, $isLoading: e }) => !(o || e) && n`
17
19
  &:hover {
18
20
  background-color: ${({ $hoverColor: t }) => t};
19
21
  }
@@ -26,20 +28,22 @@ const d = e.button`
26
28
  &:focus-visible {
27
29
  outline: none;
28
30
  }
29
- `, m = e.div`
31
+ `, c = r.div`
30
32
  font-size: ${({ $font: o }) => o}rem;
31
33
  font-weight: 500;
32
34
  max-width: 100%;
33
35
  overflow: hidden;
34
36
  color: ${({ $textColor: o }) => o};
35
- `, c = e.div`
37
+ opacity: ${({ $isLoading: o }) => o ? 0 : 1};
38
+ transition: opacity 0.3s ease;
39
+ `, m = r.div`
36
40
  height: ${({ $height: o }) => o}rem;
37
41
  width: ${({ $width: o }) => o}rem;
38
42
  display: inline-block;
39
43
  position: relative;
40
44
  border-radius: 0.96rem;
41
45
 
42
- ${({ disabled: o, $isLoading: r }) => !(o || r) && n`
46
+ ${({ disabled: o, $isLoading: e }) => !(o || e) && n`
43
47
  box-shadow: 0 0.4rem 1.5rem rgba(0, 0, 0, 0.2);
44
48
  transition:
45
49
  transform 0.2s,
@@ -51,15 +55,19 @@ const d = e.button`
51
55
  transform: translateY(-2px);
52
56
  }
53
57
  `};
54
- `, l = e.div`
55
- width: 100%;
58
+ `, p = r.div`
59
+ position: absolute;
60
+ inset: 0;
56
61
  display: flex;
57
- flex-direction: column;
58
62
  align-items: center;
63
+ justify-content: center;
64
+ opacity: ${({ $isLoading: o }) => o ? 1 : 0};
65
+ transition: opacity 0.3s ease;
66
+ pointer-events: none;
59
67
  `;
60
68
  export {
61
- c as ButtonContainer,
69
+ m as ButtonContainer,
62
70
  d as ButtonWrapper,
63
- m as Content,
64
- l as SpinnerWrapper
71
+ c as Content,
72
+ p as SpinnerWrapper
65
73
  };
@@ -1,94 +1,88 @@
1
- import { jsx as o, jsxs as E } from "react/jsx-runtime";
2
- import { useRef as y } from "react";
3
- import { UploadBtnContainer as U, Wrapper as j, HiddenInput as M, PWrapper as W } from "./styles.js";
4
- import B from "../../../colors/white.js";
5
- import { blue as C } from "../../../colors/blue.js";
6
- import F from "../../../colors/grey.js";
7
- import H from "../../../colors/colorMap.js";
8
- import P from "../../Ripple/Ripple.js";
9
- import { SIZE as Z, MEDIUM as q } from "./constants.js";
10
- import A from "../../Icons/Link/Link.js";
11
- const G = ({ theme: t, children: l }) => /* @__PURE__ */ o(P, { rippleColor: t.m100, children: l }), b = ({
1
+ import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
+ import { useRef as w } from "react";
3
+ import E from "../../Spinner/Spinner.js";
4
+ import { UploadBtnContainer as U, Wrapper as j, HiddenInput as M, SpinnerWrapper as S, ContentWrapper as B, PWrapper as F } from "./styles.js";
5
+ import H from "../../../colors/white.js";
6
+ import { blue as y } from "../../../colors/blue.js";
7
+ import P from "../../../colors/grey.js";
8
+ import Z from "../../../colors/colorMap.js";
9
+ import q from "../../Ripple/Ripple.js";
10
+ import { SIZE as A, MEDIUM as G } from "./constants.js";
11
+ import J from "../../Icons/Link/Link.js";
12
+ const L = ({ theme: t, children: l }) => /* @__PURE__ */ r(q, { rippleColor: t.m100, children: l }), tr = ({
12
13
  label: t,
13
14
  labelColor: l,
14
- theme: p = C,
15
- size: x = q,
16
- width: s,
17
- isLoading: e,
18
- disabled: r,
19
- prefixIcon: c = A,
20
- suffixIcon: m,
15
+ theme: c = y,
16
+ size: C = G,
17
+ width: x,
18
+ isLoading: o,
19
+ disabled: e,
20
+ prefixIcon: m = J,
21
+ suffixIcon: s,
21
22
  type: D = "file",
22
- accept: I,
23
- isMultiple: R,
24
- onChange: k,
25
- ...z
23
+ accept: z,
24
+ isMultiple: I,
25
+ onChange: R,
26
+ ...k
26
27
  }) => {
27
- const h = y(null), { m400: K, m500: g, m600: v } = H[p] ?? C, { height: u, width: $, font: n } = Z[x] || {}, f = l || ["white", "yellow"].includes(p) ? F.m600 : B, a = y(0), d = /* @__PURE__ */ E(
28
+ const f = w(null), { m400: K, m500: W, m600: g } = Z[c] ?? y, { height: h, width: v, font: n } = A[C] || {}, i = l || ["white", "yellow"].includes(c) ? P.m600 : H, a = w(0), $ = /* @__PURE__ */ d(
28
29
  j,
29
30
  {
30
31
  $selectedColor: K,
31
- $hoverColor: g,
32
- $height: u,
33
- $width: s || $,
34
- $activeColor: v,
35
- disabled: r,
36
- $isLoading: e,
32
+ $hoverColor: W,
33
+ $height: h,
34
+ $width: x || v,
35
+ $activeColor: g,
36
+ disabled: e,
37
+ $isLoading: o,
37
38
  tabIndex: 0,
38
- "aria-disabled": r,
39
- onKeyDown: (i) => {
40
- if (i.key === "Enter" || i.key === " ") {
41
- i.preventDefault();
42
- const w = Date.now();
43
- if (w - a.current < 500) {
44
- i.stopPropagation();
39
+ "aria-disabled": e,
40
+ onKeyDown: (p) => {
41
+ if (p.key === "Enter" || p.key === " ") {
42
+ p.preventDefault();
43
+ const u = Date.now();
44
+ if (u - a.current < 500) {
45
+ p.stopPropagation();
45
46
  return;
46
47
  }
47
- a.current = w, !r && !e && h.current?.click();
48
+ a.current = u, !e && !o && f.current?.click();
48
49
  }
49
50
  },
50
51
  children: [
51
- /* @__PURE__ */ o(
52
+ /* @__PURE__ */ r(
52
53
  M,
53
54
  {
54
- ref: h,
55
+ ref: f,
55
56
  type: D,
56
- accept: I,
57
- multiple: R,
58
- disabled: r,
59
- onChange: k,
57
+ accept: z,
58
+ multiple: I,
59
+ disabled: e,
60
+ onChange: R,
60
61
  tabIndex: -1
61
62
  }
62
63
  ),
63
- c && /* @__PURE__ */ o(c, { color: f, size: n + 19 }),
64
- /* @__PURE__ */ o(
65
- W,
66
- {
67
- color: f,
68
- size: `${n}rem`,
69
- $prefixIcon: !!c,
70
- $suffixIcon: !!m,
71
- $iconSize: n + 19,
72
- title: t,
73
- children: t
74
- }
75
- ),
76
- m && /* @__PURE__ */ o(m, { color: f, size: n + 19 })
64
+ /* @__PURE__ */ r(S, { $isLoading: o, children: /* @__PURE__ */ r(E, { size: "small", color: i }) }),
65
+ /* @__PURE__ */ d(B, { $isLoading: o, children: [
66
+ m && /* @__PURE__ */ r(m, { color: i, size: n + 19 }),
67
+ /* @__PURE__ */ r(
68
+ F,
69
+ {
70
+ color: i,
71
+ size: `${n}rem`,
72
+ $prefixIcon: !!m,
73
+ $suffixIcon: !!s,
74
+ $iconSize: n + 19,
75
+ title: t,
76
+ children: t
77
+ }
78
+ ),
79
+ s && /* @__PURE__ */ r(s, { color: i, size: n + 19 })
80
+ ] })
77
81
  ]
78
82
  }
79
83
  );
80
- return /* @__PURE__ */ o(
81
- U,
82
- {
83
- $height: u,
84
- $width: s || $,
85
- disabled: r,
86
- $isLoading: e,
87
- ...z,
88
- children: e || r ? d : /* @__PURE__ */ o(G, { theme: p, children: d })
89
- }
90
- );
84
+ return /* @__PURE__ */ r(U, { $height: h, disabled: e, $isLoading: o, ...k, children: o || e ? $ : /* @__PURE__ */ r(L, { theme: c, children: $ }) });
91
85
  };
92
86
  export {
93
- b as default
87
+ tr as default
94
88
  };
@@ -1,10 +1,8 @@
1
1
  import r, { css as i } from "styled-components";
2
2
  import n from "../../Typography/P/P.js";
3
3
  import a from "../../../colors/grey.js";
4
- const l = r.div`
4
+ const c = r.div`
5
5
  height: ${({ $height: e }) => e}rem;
6
- width: fit-content;
7
- max-width: ${({ $width: e }) => e}rem;
8
6
  display: inline-block;
9
7
  position: relative;
10
8
  border-radius: 0.96rem;
@@ -21,7 +19,7 @@ const l = r.div`
21
19
  transform: translateY(-2px);
22
20
  }
23
21
  `};
24
- `, c = r.label`
22
+ `, d = r.label`
25
23
  height: ${({ $height: e }) => `${e}rem`};
26
24
  width: ${({ $width: e }) => `${e}rem`};
27
25
  border-radius: 0.96rem;
@@ -31,6 +29,8 @@ const l = r.div`
31
29
  align-items: center;
32
30
  gap: 0.8rem;
33
31
  outline: none;
32
+ position: relative;
33
+ overflow: hidden;
34
34
  background-color: ${({ $selectedColor: e, disabled: o }) => o ? a.m500 : e};
35
35
  cursor: ${({ disabled: e, $isLoading: o }) => e ? "not-allowed" : o ? "auto" : "pointer"};
36
36
 
@@ -61,7 +61,24 @@ const l = r.div`
61
61
  $iconSize: o
62
62
  }) => e ? ` - ${o}px - 0.8rem` : ""}
63
63
  );
64
- `, h = r.input`
64
+ `, h = r.div`
65
+ position: absolute;
66
+ inset: 0;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ opacity: ${({ $isLoading: e }) => e ? 1 : 0};
71
+ transition: opacity 0.3s ease;
72
+ pointer-events: none;
73
+ `, $ = r.div`
74
+ display: flex;
75
+ align-items: center;
76
+ gap: 0.8rem;
77
+ flex: 1;
78
+ min-width: 0;
79
+ opacity: ${({ $isLoading: e }) => e ? 0 : 1};
80
+ transition: opacity 0.3s ease;
81
+ `, w = r.input`
65
82
  position: absolute;
66
83
  width: 1px;
67
84
  height: 1px;
@@ -73,8 +90,10 @@ const l = r.div`
73
90
  pointer-events: none;
74
91
  `;
75
92
  export {
76
- h as HiddenInput,
93
+ $ as ContentWrapper,
94
+ w as HiddenInput,
77
95
  m as PWrapper,
78
- l as UploadBtnContainer,
79
- c as Wrapper
96
+ h as SpinnerWrapper,
97
+ c as UploadBtnContainer,
98
+ d as Wrapper
80
99
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meticulous-ui",
3
- "version": "3.5.2",
3
+ "version": "3.5.3",
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",