meticulous-ui 1.8.6 → 1.8.7

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,73 +1,74 @@
1
1
  import { j as o } from "../../_virtual/jsx-runtime.js";
2
- import { useState as a, useRef as h, useEffect as D, useLayoutEffect as k, createElement as y } from "react";
3
- import z from "../../node_modules/lodash-es/get.js";
2
+ import { useState as h, useRef as g, useEffect as k, useLayoutEffect as y, createElement as z } from "react";
3
+ import H from "../../node_modules/lodash-es/get.js";
4
4
  import p from "../../colors/grey.js";
5
- import H from "../MenuItem/MenuItem.js";
6
- import L from "../../colors/index.js";
7
- import P from "../../colors/blue.js";
8
- import I from "../Spinner/Spinner.js";
9
- import { DropdownWrapper as M, Box as q, PWrapper as A, ChevronDownWrapper as F, OptionWrapper as G, SpinnerWrapper as J } from "./styles.js";
5
+ import L from "../MenuItem/MenuItem.js";
6
+ import P from "../../colors/index.js";
7
+ import I from "../../colors/blue.js";
8
+ import M from "../Spinner/Spinner.js";
9
+ import { DropdownWrapper as q, Box as A, PWrapper as F, ChevronDownWrapper as G, OptionWrapper as J, SpinnerWrapper as K } from "./styles.js";
10
10
  const oe = ({
11
11
  options: l,
12
- onChange: g,
12
+ onChange: b,
13
13
  value: r,
14
14
  width: n = "20rem",
15
- menuHeight: b = "20rem",
16
- placeholder: x,
17
- theme: $ = "blue",
15
+ menuHeight: x = "20rem",
16
+ placeholder: $,
17
+ theme: w = "blue",
18
18
  isLoading: f,
19
- isDisabled: w,
20
- loaderColor: j
19
+ isDisabled: j,
20
+ loaderColor: C
21
21
  }) => {
22
- const [i, c] = a(!1), [C, u] = a("bottom"), s = h(null), m = h(null), R = () => {
22
+ const [i, c] = h(!1), [R, u] = h("bottom"), s = g(null), m = g(null), O = () => {
23
23
  c((e) => !e);
24
- }, O = (e) => {
25
- e !== r && (g(e), c(!1));
24
+ }, E = (e) => {
25
+ e !== r && (b(e), c(!1));
26
26
  };
27
- D(() => {
27
+ k(() => {
28
28
  const e = (t) => {
29
29
  s.current && !s.current.contains(t.target) && c(!1);
30
30
  };
31
31
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
32
- }, []), k(() => {
32
+ }, []), y(() => {
33
33
  if (i && m.current && s.current) {
34
- const e = m.current.getBoundingClientRect(), t = s.current.getBoundingClientRect(), d = window.innerHeight - t.bottom;
35
- d < e.height + 8 && t.top > d ? u("top") : u("bottom");
34
+ const e = m.current.getBoundingClientRect(), t = s.current.getBoundingClientRect(), a = window.innerHeight - t.bottom;
35
+ a < e.height + 8 && t.top > a ? u("top") : u("bottom");
36
36
  }
37
37
  }, [i]);
38
38
  const {
39
- m50: E,
39
+ m50: D,
40
40
  m100: S,
41
41
  m200: W,
42
42
  m500: v
43
- } = z(L, $, P), B = ({ value: e, label: t }) => /* @__PURE__ */ y(
44
- H,
43
+ } = H(P, w, I), B = ({ value: e, label: t, disabled: d }) => /* @__PURE__ */ z(
44
+ L,
45
45
  {
46
46
  value: e,
47
47
  label: t,
48
- onSelect: O,
48
+ isDisabled: d,
49
+ onSelect: E,
49
50
  isSelected: e === r,
50
51
  key: e,
51
52
  width: n,
52
53
  selectedColor: W,
53
- hoverColor: E,
54
+ hoverColor: D,
54
55
  activeColor: S
55
56
  }
56
57
  );
57
58
  return /* @__PURE__ */ o.jsxs(
58
- M,
59
+ q,
59
60
  {
60
61
  ref: s,
61
62
  $width: n,
62
63
  $isLoading: f,
63
- $isDisabled: w,
64
+ $isDisabled: j,
64
65
  children: [
65
- /* @__PURE__ */ o.jsxs(q, { $width: n, onClick: R, $isOpen: i, $border: v, children: [
66
- /* @__PURE__ */ o.jsx(A, { $width: n, color: r ? p.m700 : p.m500, size: "1.2rem", children: r ? l.find(({ value: e }) => r === e)?.label : x }),
67
- /* @__PURE__ */ o.jsx(F, { color: p.m500, size: 22, $isOpen: i })
66
+ /* @__PURE__ */ o.jsxs(A, { $width: n, onClick: O, $isOpen: i, $border: v, children: [
67
+ /* @__PURE__ */ o.jsx(F, { $width: n, color: r ? p.m700 : p.m500, size: "1.2rem", children: r ? l.find(({ value: e }) => r === e)?.label : $ }),
68
+ /* @__PURE__ */ o.jsx(G, { color: p.m500, size: 22, $isOpen: i })
68
69
  ] }),
69
- i && /* @__PURE__ */ o.jsx(G, { ref: m, $width: n, $height: b, $top: C === "top", children: l.map(B) }),
70
- f && /* @__PURE__ */ o.jsx(J, { children: /* @__PURE__ */ o.jsx(I, { size: "small", color: j }) })
70
+ i && /* @__PURE__ */ o.jsx(J, { ref: m, $width: n, $height: x, $top: R === "top", children: l.map(B) }),
71
+ f && /* @__PURE__ */ o.jsx(K, { children: /* @__PURE__ */ o.jsx(M, { size: "small", color: C }) })
71
72
  ]
72
73
  }
73
74
  );
@@ -1,38 +1,40 @@
1
- import { j as m } from "../../_virtual/jsx-runtime.js";
2
- import i from "../../colors/grey.js";
3
- import r from "../../colors/blue.js";
4
- import $ from "../../colors/white.js";
5
- import { Wrapper as h, PWrapper as u } from "./styles.js";
6
- const w = ({
7
- value: l,
8
- label: o,
9
- width: e = "20rem",
10
- isSelected: t,
11
- defaultColor: p = $,
12
- selectedColor: c = r.m200,
13
- hoverColor: n = r.m50,
14
- activeColor: s = r.m100,
15
- size: a = "1.2rem",
16
- onSelect: d
1
+ import { j as n } from "../../_virtual/jsx-runtime.js";
2
+ import e from "../../colors/grey.js";
3
+ import t from "../../colors/blue.js";
4
+ import d from "../../colors/white.js";
5
+ import { Wrapper as C, PWrapper as h } from "./styles.js";
6
+ const x = ({ isSelected: o, isDisabled: r }) => o ? e.m700 : r ? e.m300 : e.m500, W = ({
7
+ value: o,
8
+ label: r,
9
+ width: m = "20rem",
10
+ isSelected: i,
11
+ defaultColor: p = d,
12
+ selectedColor: c = t.m200,
13
+ hoverColor: s = t.m50,
14
+ activeColor: f = t.m100,
15
+ size: u = "1.2rem",
16
+ onSelect: $,
17
+ isDisabled: l
17
18
  }) => {
18
- const f = () => {
19
- d(l);
19
+ const a = () => {
20
+ $(o);
20
21
  };
21
- return /* @__PURE__ */ m.jsx(
22
- h,
22
+ return /* @__PURE__ */ n.jsx(
23
+ C,
23
24
  {
24
- $isSelected: t,
25
- $width: e,
25
+ $isSelected: i,
26
+ $width: m,
26
27
  $defaultColor: p,
27
28
  $selectedColor: c,
28
- $hoverColor: n,
29
- $activeColor: s,
30
- onClick: f,
31
- title: o,
32
- children: /* @__PURE__ */ m.jsx(u, { size: a, color: t ? i.m700 : i.m500, $width: e, children: o })
29
+ $hoverColor: s,
30
+ $activeColor: f,
31
+ $isDisabled: l,
32
+ onClick: a,
33
+ title: r,
34
+ children: /* @__PURE__ */ n.jsx(h, { size: u, color: x({ isSelected: i, isDisabled: l }), $width: m, children: r })
33
35
  }
34
36
  );
35
37
  };
36
38
  export {
37
- w as default
39
+ W as default
38
40
  };
@@ -1,26 +1,27 @@
1
1
  import t from "../../node_modules/styled-components/dist/styled-components.browser.esm.js";
2
2
  import a from "../Typography/P/P.js";
3
3
  const p = t.div`
4
- width: ${({ $width: r }) => r};
5
- background-color: ${({ $isSelected: r, $defaultColor: o, $selectedColor: e }) => r ? e : o};
6
- cursor: ${({ $isSelected: r }) => r ? "auto" : "pointer"};
4
+ width: ${({ $width: o }) => o};
5
+ background-color: ${({ $isSelected: o, $defaultColor: r, $selectedColor: e }) => o ? e : r};
6
+ cursor: ${({ $isSelected: o }) => o ? "auto" : "pointer"};
7
7
  padding: 0.6rem 0 0.8rem 1rem;
8
8
  margin-top: 0.1rem;
9
+ pointer-events: ${({ $isDisabled: o }) => o ? "none" : "auto"};
9
10
 
10
11
  &:hover {
11
- background-color: ${({ $isSelected: r, $hoverColor: o, $selectedColor: e }) => r ? e : o};
12
+ background-color: ${({ $isSelected: o, $hoverColor: r, $selectedColor: e }) => o ? e : r};
12
13
  }
13
14
 
14
15
  &:active {
15
- background-color: ${({ $isSelected: r, $activeColor: o, $selectedColor: e }) => r ? e : o};
16
+ background-color: ${({ $isSelected: o, $activeColor: r, $selectedColor: e }) => o ? e : r};
16
17
  }
17
- `, d = t(a)`
18
+ `, c = t(a)`
18
19
  overflow: hidden;
19
20
  white-space: nowrap;
20
21
  text-overflow: ellipsis;
21
- max-width: calc(${({ $width: r }) => r} - 2rem);
22
+ max-width: calc(${({ $width: o }) => o} - 2rem);
22
23
  `;
23
24
  export {
24
- d as PWrapper,
25
+ c as PWrapper,
25
26
  p as Wrapper
26
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meticulous-ui",
3
- "version": "1.8.6",
3
+ "version": "1.8.7",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "repository": {