meticulous-ui 2.2.9 → 2.3.1

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.
package/README.md CHANGED
@@ -47,20 +47,21 @@ export default App;
47
47
 
48
48
  ## 📦 Components
49
49
 
50
- | Component | Description |
51
- | ------------- | -------------------------------------------------- |
52
- | `Pagination` | Fully responsive pagination component |
53
- | `Toast` | Push 4 types of notifications on screen |
54
- | `Timer` | Renders analog / digital clock with alarm |
55
- | `OtpInput` | Gives inputs to enter and edit OTP |
56
- | `VideoPlayer` | Renders video with keyboard shortcuts |
57
- | `Input` | Renders input box to let user enter input |
58
- | `Checkbox` | Renders checkbox to let user give boolean value |
59
- | `RadioGroup` | Renders radio options ina group to let user select |
60
- | `Textarea` | Renders textarea box to let user enter description |
61
- | `Dropdown` | Renders dropdown to select from options |
62
- | `Spinner` | Renders a spinner to show the loading state |
63
- | `Button` | Renders a button to click & take an action |
50
+ | Component | Description |
51
+ | -------------- | ------------------------------------------------------ |
52
+ | `Pagination` | Fully responsive pagination component |
53
+ | `Toast` | Push 4 types of notifications on screen |
54
+ | `Timer` | Renders analog / digital clock with alarm |
55
+ | `OtpInput` | Gives inputs to enter and edit OTP |
56
+ | `VideoPlayer` | Renders video with keyboard shortcuts |
57
+ | `Input` | Renders input box to let user enter input |
58
+ | `Checkbox` | Renders checkbox to let user give boolean value |
59
+ | `RadioGroup` | Renders radio options in a group to let user select |
60
+ | `FileUploader` | Renders a button type input from where user can upload |
61
+ | `Textarea` | Renders textarea box to let user enter description |
62
+ | `Dropdown` | Renders dropdown to select from options |
63
+ | `Spinner` | Renders a spinner to show the loading state |
64
+ | `Button` | Renders a button to click & take an action |
64
65
 
65
66
  ## 📦 Icon Components
66
67
 
@@ -1,53 +1,55 @@
1
1
  import { j as o } from "../../_virtual/jsx-runtime.js";
2
- import C from "../../node_modules/lodash-es/get.js";
3
- import $ from "../Spinner/Spinner.js";
4
- import j from "../../colors/index.js";
2
+ import $ from "../../node_modules/lodash-es/get.js";
3
+ import j from "../Spinner/Spinner.js";
4
+ import g from "../../colors/index.js";
5
5
  import h from "../../colors/blue.js";
6
- import { ButtonWrapper as g, SpinnerWrapper as u, Content as w, ButtonContainer as b } from "./styles.js";
7
- import v from "../Ripple/Ripple.js";
8
- import I from "../../colors/white.js";
9
- import B from "../../colors/grey.js";
10
- import { MEDIUM as E, SIZE as L } from "./constants.js";
11
- const R = ({ theme: t, children: i }) => /* @__PURE__ */ o.jsx(v, { rippleColor: t.m100, children: i }), G = (t) => {
6
+ import { ButtonWrapper as u, SpinnerWrapper as w, Content as b, ButtonContainer as v } from "./styles.js";
7
+ import I from "../Ripple/Ripple.js";
8
+ import B from "../../colors/white.js";
9
+ import E from "../../colors/grey.js";
10
+ import { MEDIUM as L, SIZE as R } from "./constants.js";
11
+ const S = ({ theme: t, children: e }) => /* @__PURE__ */ o.jsx(I, { rippleColor: t.m100, children: e }), H = (t) => {
12
12
  const {
13
- children: i,
14
- theme: e = h,
15
- size: c = E,
13
+ children: e,
14
+ theme: i = h,
15
+ size: c = L,
16
16
  width: n,
17
- leftIcon: S,
18
- rightIcon: z,
19
- isLoading: r
20
- } = t || {}, { m400: p, m500: a, m600: f } = C(j, e, h), { height: l, width: s, font: x } = L[c] || {}, m = e !== "white" ? I : B.m600, d = /* @__PURE__ */ o.jsx(
21
- g,
17
+ leftIcon: z,
18
+ rightIcon: M,
19
+ isLoading: r,
20
+ ...p
21
+ } = t || {}, { m400: a, m500: f, m600: x } = $(g, i, h), { height: l, width: s, font: C } = R[c] || {}, m = i !== "white" ? B : E.m600, d = /* @__PURE__ */ o.jsx(
22
+ u,
22
23
  {
23
- $hoverColor: a,
24
- $activeColor: f,
25
- $selectedColor: p,
24
+ ...p,
25
+ $hoverColor: f,
26
+ $activeColor: x,
27
+ $selectedColor: a,
26
28
  $height: l,
27
29
  $width: n || s,
28
30
  disabled: t.disabled,
29
31
  $isLoading: r,
30
- children: r ? /* @__PURE__ */ o.jsx(u, { children: /* @__PURE__ */ o.jsx($, { size: "small", color: m }) }) : /* @__PURE__ */ o.jsx(
31
- w,
32
+ children: r ? /* @__PURE__ */ o.jsx(w, { children: /* @__PURE__ */ o.jsx(j, { size: "small", color: m }) }) : /* @__PURE__ */ o.jsx(
33
+ b,
32
34
  {
33
35
  $textColor: m,
34
- $font: x,
35
- children: i
36
+ $font: C,
37
+ children: e
36
38
  }
37
39
  )
38
40
  }
39
41
  );
40
42
  return /* @__PURE__ */ o.jsx(
41
- b,
43
+ v,
42
44
  {
43
45
  $height: l,
44
46
  $width: n || s,
45
47
  disabled: t.disabled,
46
48
  $isLoading: r,
47
- children: r ? d : /* @__PURE__ */ o.jsx(R, { theme: e, children: d })
49
+ children: r ? d : /* @__PURE__ */ o.jsx(S, { theme: i, children: d })
48
50
  }
49
51
  );
50
52
  };
51
53
  export {
52
- G as default
54
+ H as default
53
55
  };
@@ -1,19 +1,19 @@
1
1
  import e, { css as n } from "../../node_modules/styled-components/dist/styled-components.browser.esm.js";
2
2
  import i from "../../colors/grey.js";
3
- const s = e.button`
4
- height: ${({ $height: r }) => r}rem;
5
- width: ${({ $width: r }) => r}rem;
3
+ const d = e.button`
4
+ height: ${({ $height: o }) => o}rem;
5
+ width: ${({ $width: o }) => o}rem;
6
6
  border-radius: 0.6rem;
7
7
  border: none;
8
8
  padding: 0.6rem 0.4rem;
9
- background-color: ${({ $selectedColor: r, disabled: o }) => o ? i.m500 : r};
10
- cursor: ${({ disabled: r, $isLoading: o }) => r ? "not-allowed" : o ? "auto" : "pointer"};
9
+ background-color: ${({ $selectedColor: o, disabled: r }) => r ? i.m500 : o};
10
+ cursor: ${({ disabled: o, $isLoading: r }) => o ? "not-allowed" : r ? "auto" : "pointer"};
11
11
 
12
- ${({ $isLoading: r }) => r && n`
12
+ ${({ $isLoading: o }) => o && n`
13
13
  pointer-events: none;
14
14
  `};
15
15
 
16
- ${({ disabled: r, $isLoading: o }) => !(r || o) && n`
16
+ ${({ disabled: o, $isLoading: r }) => !(o || r) && n`
17
17
  &:hover {
18
18
  background-color: ${({ $hoverColor: t }) => t};
19
19
  }
@@ -22,26 +22,31 @@ const s = e.button`
22
22
  background-color: ${({ $activeColor: t }) => t};
23
23
  }
24
24
  `};
25
+
26
+ &:focus-visible {
27
+ outline: none;
28
+ }
25
29
  `, m = e.div`
26
- font-size: ${({ $font: r }) => r}rem;
30
+ font-size: ${({ $font: o }) => o}rem;
27
31
  font-weight: 500;
28
32
  max-width: 100%;
29
33
  overflow: hidden;
30
- color: ${({ $textColor: r }) => r};
34
+ color: ${({ $textColor: o }) => o};
31
35
  `, c = e.div`
32
- height: ${({ $height: r }) => r}rem;
33
- width: ${({ $width: r }) => r}rem;
36
+ height: ${({ $height: o }) => o}rem;
37
+ width: ${({ $width: o }) => o}rem;
34
38
  display: inline-block;
35
39
  position: relative;
36
40
  border-radius: 0.6rem;
37
41
 
38
- ${({ disabled: r, $isLoading: o }) => !(r || o) && n`
42
+ ${({ disabled: o, $isLoading: r }) => !(o || r) && n`
39
43
  box-shadow: 0 0.4rem 1.5rem rgba(0, 0, 0, 0.2);
40
44
  transition:
41
45
  transform 0.2s,
42
46
  box-shadow 0.2s;
43
47
 
44
- &:hover {
48
+ &:hover,
49
+ &:focus-within {
45
50
  box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.3);
46
51
  transform: translateY(-2px);
47
52
  }
@@ -54,7 +59,7 @@ const s = e.button`
54
59
  `;
55
60
  export {
56
61
  c as ButtonContainer,
57
- s as ButtonWrapper,
62
+ d as ButtonWrapper,
58
63
  m as Content,
59
64
  l as SpinnerWrapper
60
65
  };
@@ -0,0 +1,4 @@
1
+ import r from "./Link.js";
2
+ export {
3
+ r as default
4
+ };
@@ -0,0 +1,76 @@
1
+ import { j as o } from "../../../_virtual/jsx-runtime.js";
2
+ import { useRef as U } from "react";
3
+ import a from "../../../node_modules/lodash-es/get.js";
4
+ import { UploadBtnContainer as v, HiddenInput as M, Wrapper as W, PWrapper as g } from "./styles.js";
5
+ import y from "../../../colors/white.js";
6
+ import x from "../../../colors/blue.js";
7
+ import B from "../../Icons/Link/Link.js";
8
+ import D from "../../../colors/index.js";
9
+ import F from "../../Ripple/Ripple.js";
10
+ import { SIZE as H, MEDIUM as Z } from "./constants.js";
11
+ const q = ({ theme: t, children: r }) => /* @__PURE__ */ o.jsx(F, { rippleColor: t.m100, children: r }), X = ({
12
+ label: t,
13
+ labelColor: r = y,
14
+ theme: s = x,
15
+ size: j = Z,
16
+ width: c,
17
+ isLoading: i,
18
+ disabled: e,
19
+ prefixIcon: n = B,
20
+ suffixIcon: m,
21
+ type: d = "file",
22
+ accept: C,
23
+ isMultiple: R,
24
+ onChange: k
25
+ }) => {
26
+ const l = U(null), { m400: w, m500: z, m600: E } = a(D, s, x), { height: f, width: h, font: p } = H[j] || {}, I = () => {
27
+ var u;
28
+ !e && !i && ((u = l.current) == null || u.click());
29
+ }, $ = /* @__PURE__ */ o.jsxs(
30
+ W,
31
+ {
32
+ $selectedColor: w,
33
+ $hoverColor: z,
34
+ $height: f,
35
+ $width: c || h,
36
+ $activeColor: E,
37
+ disabled: e,
38
+ isLoading: i,
39
+ type: "button",
40
+ onClick: I,
41
+ children: [
42
+ n && /* @__PURE__ */ o.jsx(n, { color: r, size: p + 19 }),
43
+ /* @__PURE__ */ o.jsx(
44
+ g,
45
+ {
46
+ color: r,
47
+ size: `${p}rem`,
48
+ $prefixIcon: !!n,
49
+ $suffixIcon: !!m,
50
+ $iconSize: p + 19,
51
+ title: t,
52
+ children: t
53
+ }
54
+ ),
55
+ m && /* @__PURE__ */ o.jsx(m, { color: r, size: p + 19 })
56
+ ]
57
+ }
58
+ );
59
+ return /* @__PURE__ */ o.jsxs(v, { $height: f, $width: c || h, disabled: e, $isLoading: i, children: [
60
+ /* @__PURE__ */ o.jsx(
61
+ M,
62
+ {
63
+ ref: l,
64
+ type: d,
65
+ accept: C,
66
+ multiple: R,
67
+ disabled: e,
68
+ onChange: k
69
+ }
70
+ ),
71
+ i ? $ : /* @__PURE__ */ o.jsx(q, { theme: s, children: $ })
72
+ ] });
73
+ };
74
+ export {
75
+ X as default
76
+ };
@@ -0,0 +1,29 @@
1
+ const t = "small", h = "medium", o = "large", e = "ex-large", i = {
2
+ [t]: {
3
+ height: 2.8,
4
+ width: 6.75,
5
+ font: 1
6
+ },
7
+ [h]: {
8
+ height: 3.2,
9
+ width: 7.5,
10
+ font: 1.2
11
+ },
12
+ [o]: {
13
+ height: 3.6,
14
+ width: 8.25,
15
+ font: 1.4
16
+ },
17
+ [e]: {
18
+ height: 4,
19
+ width: 9,
20
+ font: 1.6
21
+ }
22
+ };
23
+ export {
24
+ e as EX_LARGE,
25
+ o as LARGE,
26
+ h as MEDIUM,
27
+ i as SIZE,
28
+ t as SMALL
29
+ };
@@ -0,0 +1,4 @@
1
+ import o from "./FileUploader.js";
2
+ export {
3
+ o as default
4
+ };
@@ -0,0 +1,83 @@
1
+ import e, { css as i } from "../../../node_modules/styled-components/dist/styled-components.browser.esm.js";
2
+ import n from "../../Typography/P/P.js";
3
+ import a from "../../../colors/grey.js";
4
+ const p = e.button`
5
+ display: flex;
6
+ align-items: center;
7
+ gap: 0.8rem;
8
+ padding: 0 0.8rem;
9
+ border-radius: 0.6rem;
10
+ border: none;
11
+ outline-offset: 2px;
12
+ background-color: ${({ $inner: o }) => o};
13
+ transition: background-color 0.2s ease;
14
+ height: ${({ $height: o }) => `${o}rem`};
15
+ width: ${({ $width: o }) => `${o}rem`};
16
+ background-color: ${({ $selectedColor: o, disabled: r }) => r ? a.m500 : o};
17
+ cursor: ${({ disabled: o, $isLoading: r }) => o ? "not-allowed" : r ? "auto" : "pointer"};
18
+
19
+ ${({ $isLoading: o }) => o && i`
20
+ pointer-events: none;
21
+ `};
22
+
23
+ ${({ disabled: o, $isLoading: r }) => !(o || r) && i`
24
+ &:hover {
25
+ background-color: ${({ $hoverColor: t }) => t};
26
+ }
27
+
28
+ &:active {
29
+ background-color: ${({ $activeColor: t }) => t};
30
+ }
31
+ `};
32
+ `, c = e.div`
33
+ height: ${({ $height: o }) => o}rem;
34
+ width: ${({ $width: o }) => o}rem;
35
+ display: inline-block;
36
+ position: relative;
37
+ border-radius: 0.8rem;
38
+
39
+ ${({ disabled: o, $isLoading: r }) => !(o || r) && i`
40
+ box-shadow: 0 0.4rem 1.5rem rgba(0, 0, 0, 0.2);
41
+ transition:
42
+ transform 0.2s,
43
+ box-shadow 0.2s;
44
+
45
+ &:hover {
46
+ box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.3);
47
+ transform: translateY(-2px);
48
+ }
49
+ `};
50
+ `, m = e(n)`
51
+ color: ${({ color: o }) => o};
52
+ font-size: ${({ size: o }) => o};
53
+ margin: 0;
54
+ white-space: nowrap;
55
+ overflow: hidden;
56
+ text-overflow: ellipsis;
57
+ width: calc(
58
+ 100%
59
+ ${({ $prefixIcon: o, $iconSize: r }) => o ? ` - ${r}px - 0.8rem` : ""}${({
60
+ $suffixIcon: o,
61
+ $iconSize: r
62
+ }) => o ? ` - ${r}px - 0.8rem` : ""}
63
+ );
64
+ `;
65
+ e.div`
66
+ width: 100%;
67
+ display: flex;
68
+ flex-direction: column;
69
+ align-items: center;
70
+ `;
71
+ const $ = e.input`
72
+ position: absolute;
73
+ width: 0;
74
+ height: 0;
75
+ opacity: 0;
76
+ pointer-events: none;
77
+ `;
78
+ export {
79
+ $ as HiddenInput,
80
+ m as PWrapper,
81
+ c as UploadBtnContainer,
82
+ p as Wrapper
83
+ };
@@ -1,28 +1,35 @@
1
- import { j as f } from "../../_virtual/jsx-runtime.js";
2
- import { useRef as u } from "react";
1
+ import { j as m } from "../../_virtual/jsx-runtime.js";
2
+ import { useRef as g } from "react";
3
3
  /* empty css */
4
4
  const y = ({
5
- children: s,
6
- rippleColor: c = "rgba(255, 255, 255, 0.3)",
7
- className: l = "",
8
- ...p
5
+ children: l,
6
+ rippleColor: p = "rgba(255, 255, 255, 0.3)",
7
+ className: a = "",
8
+ ...d
9
9
  }) => {
10
- const o = u(null), a = (r) => {
11
- const n = o.current;
12
- if (!n) return;
13
- const t = document.createElement("span"), e = n.getBoundingClientRect(), i = Math.max(e.width, e.height), d = r.clientX - e.left - i / 2, m = r.clientY - e.top - i / 2;
14
- t.style.width = t.style.height = `${i}px`, t.style.left = `${d}px`, t.style.top = `${m}px`, t.style.backgroundColor = c, t.classList.add("ripple-effect"), n.appendChild(t), t.addEventListener("animationend", () => {
15
- t.remove();
16
- });
10
+ const r = g(null), c = (t, n) => {
11
+ const i = r.current;
12
+ if (!i) return;
13
+ const e = document.createElement("span"), s = i.getBoundingClientRect(), o = Math.max(s.width, s.height);
14
+ e.style.width = e.style.height = `${o}px`, e.style.left = `${t - o / 2}px`, e.style.top = `${n - o / 2}px`, e.style.backgroundColor = p, e.classList.add("ripple-effect"), i.appendChild(e), e.addEventListener("animationend", () => e.remove());
15
+ }, u = (t) => {
16
+ if (t.detail === 0) return;
17
+ const n = r.current.getBoundingClientRect();
18
+ c(t.clientX - n.left, t.clientY - n.top);
19
+ }, f = (t) => {
20
+ if (t.key !== "Enter" && t.key !== " ") return;
21
+ const n = r.current.getBoundingClientRect();
22
+ c(n.width / 2, n.height / 2);
17
23
  };
18
- return /* @__PURE__ */ f.jsx(
24
+ return /* @__PURE__ */ m.jsx(
19
25
  "div",
20
26
  {
21
- ref: o,
22
- className: `ripple-container ${l}`,
23
- onClick: a,
24
- ...p,
25
- children: s
27
+ ref: r,
28
+ className: `ripple-container ${a}`,
29
+ onClick: u,
30
+ onKeyDown: f,
31
+ ...d,
32
+ children: l
26
33
  }
27
34
  );
28
35
  };
package/index.js CHANGED
@@ -1,46 +1,48 @@
1
- import { default as a } from "./components/Pagination/Pagination.js";
1
+ import { default as t } from "./components/Pagination/Pagination.js";
2
2
  import { default as r } from "./components/Toast/Toast.js";
3
3
  import { default as p } from "./components/Spinner/Spinner.js";
4
- import { default as s } from "./components/OtpInput/OtpInput.js";
5
- import { default as l } from "./components/Dropdown/Dropdown.js";
4
+ import { default as u } from "./components/OtpInput/OtpInput.js";
5
+ import { default as s } from "./components/Dropdown/Dropdown.js";
6
6
  import { default as m } from "./components/Button/Button.js";
7
- import { default as i } from "./components/Timer/Timer.js";
7
+ import { default as n } from "./components/Timer/Timer.js";
8
8
  import { default as c } from "./components/VideoPlayer/VideoPlayer.js";
9
9
  import { default as T } from "./components/Typography/P/P.js";
10
10
  import { default as b } from "./components/Input/Input/Input.js";
11
11
  import { default as h } from "./components/Input/Textarea/Textarea.js";
12
12
  import { default as w } from "./components/Input/Checkbox/Checkbox.js";
13
13
  import { default as B } from "./components/Input/RadioGroup/RadioGroup.js";
14
- import { default as D } from "./colors/index.js";
15
- import { default as O } from "./utils/index.js";
16
- import { default as S } from "./components/Icons/index.js";
14
+ import { default as D } from "./components/Input/FileUploader/FileUploader.js";
15
+ import { default as G } from "./colors/index.js";
16
+ import { default as R } from "./utils/index.js";
17
+ import { default as U } from "./components/Icons/index.js";
17
18
  import { default as j } from "./components/Typography/Headings/H1.js";
18
19
  import { default as v } from "./components/Typography/Headings/H2.js";
19
20
  import { default as A } from "./components/Typography/Headings/H3.js";
20
- import { default as F } from "./components/Typography/Headings/H4.js";
21
- import { default as K } from "./components/Typography/Headings/H5.js";
22
- import { default as M } from "./components/Typography/Headings/H6.js";
21
+ import { default as J } from "./components/Typography/Headings/H4.js";
22
+ import { default as L } from "./components/Typography/Headings/H5.js";
23
+ import { default as N } from "./components/Typography/Headings/H6.js";
23
24
  export {
24
25
  m as Button,
25
26
  w as Checkbox,
26
- l as Dropdown,
27
+ s as Dropdown,
28
+ D as FileUploader,
27
29
  j as H1,
28
30
  v as H2,
29
31
  A as H3,
30
- F as H4,
31
- K as H5,
32
- M as H6,
32
+ J as H4,
33
+ L as H5,
34
+ N as H6,
33
35
  b as Input,
34
- s as OtpInput,
36
+ u as OtpInput,
35
37
  T as P,
36
- a as Pagination,
38
+ t as Pagination,
37
39
  B as RadioGroup,
38
40
  p as Spinner,
39
41
  h as Textarea,
40
- i as Timer,
42
+ n as Timer,
41
43
  r as Toast,
42
44
  c as VideoPlayer,
43
- D as colors,
44
- S as icons,
45
- O as utils
45
+ G as colors,
46
+ U as icons,
47
+ R as utils
46
48
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meticulous-ui",
3
- "version": "2.2.9",
3
+ "version": "2.3.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "repository": {
@@ -36,6 +36,9 @@
36
36
  "button",
37
37
  "input",
38
38
  "textarea",
39
+ "checkbox",
40
+ "radio",
41
+ "file-uploader",
39
42
  "notification",
40
43
  "dropdown",
41
44
  "spinner",