trepur_components 2.4.3 → 2.4.5

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,7 +1,7 @@
1
- import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
- import { forwardRef as o, useMemo as v, createContext as L, useContext as p } from "react";
1
+ import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
+ import { forwardRef as o, useMemo as v, createContext as h, useContext as p } from "react";
3
3
  import d from "clsx";
4
- const s = L(null), x = o(({ children: n, className: a, errors: t, placeholder: l, ...e }, i) => {
4
+ const s = h(null), x = o(({ children: r, className: a, errors: t, placeholder: l, ...e }, i) => {
5
5
  const m = v(
6
6
  () => ({
7
7
  errors: t,
@@ -10,24 +10,24 @@ const s = L(null), x = o(({ children: n, className: a, errors: t, placeholder: l
10
10
  }),
11
11
  [t, e]
12
12
  );
13
- return /* @__PURE__ */ r(s.Provider, { value: m, children: /* @__PURE__ */ r(
13
+ return /* @__PURE__ */ n(s.Provider, { value: m, children: /* @__PURE__ */ n(
14
14
  "div",
15
15
  {
16
16
  ref: i,
17
17
  className: d("grid grid-cols-1 gap-2 w-full rounded-md", a),
18
18
  ...e,
19
- children: n
19
+ children: r
20
20
  }
21
21
  ) });
22
- }), f = o(({ children: n, handleChange: a, onClick: t, onBlur: l, ...e }, i) => {
22
+ }), f = o(({ children: r, handleChange: a, onClick: t, onBlur: l, ...e }, i) => {
23
23
  const { placeholder: m, value: g, errors: u } = p(s) || {};
24
24
  return /* @__PURE__ */ c("div", { ref: i, className: "group/input relative isolate flex w-full", children: [
25
- /* @__PURE__ */ r(
25
+ /* @__PURE__ */ n(
26
26
  "input",
27
27
  {
28
28
  placeholder: m,
29
29
  className: d(
30
- "rounded-md flex w-full bg-card px-3 py-1.5 text-sm placeholder:text-gray-500",
30
+ "h-10 border border-black rounded-md flex w-full bg-card px-3 py-1.5 text-sm placeholder:text-gray-500",
31
31
  {
32
32
  "border-border border": !u,
33
33
  "border-red-600 border-2": u
@@ -50,39 +50,39 @@ const s = L(null), x = o(({ children: n, className: a, errors: t, placeholder: l
50
50
  onFocus: e.onFocus
51
51
  }
52
52
  ),
53
- n
53
+ r
54
54
  ] });
55
55
  }), b = o(
56
- ({ className: n, children: a }, t) => /* @__PURE__ */ r(
56
+ ({ className: r, children: a }, t) => /* @__PURE__ */ n(
57
57
  "div",
58
58
  {
59
59
  ref: t,
60
60
  className: d(
61
61
  "absolute right-1 top-1/2 my-auto -translate-y-1/2",
62
- n
62
+ r
63
63
  ),
64
64
  children: a
65
65
  }
66
66
  )
67
- ), y = o(({ className: n, children: a, required: t = !1 }, l) => /* @__PURE__ */ c(
67
+ ), y = o(({ className: r, children: a, required: t = !1 }, l) => /* @__PURE__ */ c(
68
68
  "div",
69
69
  {
70
70
  ref: l,
71
- className: d("flex px-1 text-sm font-normal leading-5", n),
71
+ className: d("flex px-1 text-sm font-normal leading-5", r),
72
72
  children: [
73
- /* @__PURE__ */ r("p", { children: a }),
74
- t && /* @__PURE__ */ r("p", { className: "text-sm font-normal", children: "*" })
73
+ /* @__PURE__ */ n("p", { children: a }),
74
+ t && /* @__PURE__ */ n("p", { className: "text-sm font-normal", children: "*" })
75
75
  ]
76
76
  }
77
- )), I = o(({ ...n }, a) => {
77
+ )), I = o(({ ...r }, a) => {
78
78
  const { errors: t } = p(s) || {};
79
- return /* @__PURE__ */ r(
79
+ return /* @__PURE__ */ n(
80
80
  "div",
81
81
  {
82
82
  ref: a,
83
83
  className: "text-sm pl-1 font-medium text-error-default",
84
- ...n,
85
- children: t == null ? void 0 : t.map((l, e) => /* @__PURE__ */ r("p", { children: l }, `error-msg-${e + 1}`))
84
+ ...r,
85
+ children: t == null ? void 0 : t.map((l, e) => /* @__PURE__ */ n("p", { children: l }, `error-msg-${e + 1}`))
86
86
  }
87
87
  );
88
88
  });
@@ -7,9 +7,13 @@ declare const meta: {
7
7
  Item: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLLIElement> & {
8
8
  value: string;
9
9
  } & import('react').RefAttributes<HTMLLIElement>>;
10
+ Label: import('react').ForwardRefExoticComponent<Omit<import('react').HTMLAttributes<HTMLDivElement> & {
11
+ required?: boolean;
12
+ } & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
10
13
  };
11
14
  parameters: {};
12
15
  args: {
16
+ label: string;
13
17
  children: import("react/jsx-runtime").JSX.Element[];
14
18
  };
15
19
  };
@@ -7,12 +7,17 @@ export interface SelectContextProps {
7
7
  onChange?: (value: string) => void;
8
8
  open?: boolean;
9
9
  setOpen?: (open: boolean) => void;
10
- internalValue: string;
11
- setInternalValue: (val: string) => void;
10
+ internalValue?: string;
11
+ setInternalValue?: (val: string) => void;
12
+ label?: string;
13
+ handleChange?: (e: any) => void;
12
14
  }
13
15
  declare const Select: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & SelectContextProps & import('react').RefAttributes<HTMLDivElement>> & {
14
16
  Item: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLLIElement> & {
15
17
  value: string;
16
18
  } & import('react').RefAttributes<HTMLLIElement>>;
19
+ Label: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement> & {
20
+ required?: boolean;
21
+ } & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
17
22
  };
18
23
  export { Select };
@@ -1,62 +1,64 @@
1
1
  import { jsx as o, jsxs as I } from "react/jsx-runtime";
2
- import { forwardRef as i, useState as N, useCallback as b, useEffect as M, createContext as V, useContext as p } from "react";
3
- import c from "clsx";
4
- import { Input as u } from "../Input/index.js";
5
- import { Card as z } from "../Card/index.js";
6
- import { Button as y } from "../Button/index.js";
7
- import { faCaretDown as A } from "@fortawesome/fontawesome-free-solid";
8
- const m = V(null), v = i(
2
+ import { forwardRef as i, useState as x, useCallback as y, useEffect as A, createContext as E, useContext as p } from "react";
3
+ import u from "clsx";
4
+ import { Input as m } from "../Input/index.js";
5
+ import { Card as H } from "../Card/index.js";
6
+ import { Button as v } from "../Button/index.js";
7
+ import { faCaretDown as P } from "@fortawesome/fontawesome-free-solid";
8
+ const d = E(null), w = i(
9
9
  ({
10
10
  id: l,
11
11
  open: a,
12
12
  defaultOpen: r,
13
13
  onOpenChange: t,
14
14
  onChange: e,
15
- className: n,
16
- children: d,
17
- loading: k,
18
- ...T
15
+ className: c,
16
+ children: s,
17
+ loading: f,
18
+ label: T,
19
+ ...B
19
20
  }) => {
20
- const [h, B] = N(a ?? r), [f, S] = N(""), x = b(
21
- (s) => {
22
- B(s), t == null || t(s);
21
+ const [D, M] = x(a ?? r), [S, b] = x(""), N = y(
22
+ (n) => {
23
+ M(n), t == null || t(n);
23
24
  },
24
25
  [t]
25
- ), D = {
26
- loading: k,
27
- open: h,
28
- setOpen: x,
29
- internalValue: f,
30
- setInternalValue: S
26
+ ), V = {
27
+ loading: f,
28
+ label: T,
29
+ open: D,
30
+ setOpen: N,
31
+ internalValue: S,
32
+ setInternalValue: b
31
33
  };
32
- M(
33
- () => x(a ?? r ?? !1),
34
- [a, r, x]
34
+ A(
35
+ () => N(a ?? r ?? !1),
36
+ [a, r, N]
35
37
  );
36
- const L = b(
37
- (s) => {
38
- f.includes(s) ? (S(""), e == null || e("")) : (S(s), e == null || e(s));
38
+ const z = y(
39
+ (n) => {
40
+ S.includes(n) ? (b(""), e == null || e("")) : (b(n), e == null || e(n));
39
41
  },
40
- [f, e]
42
+ [S, e]
41
43
  );
42
- return /* @__PURE__ */ o(m.Provider, { value: D, children: /* @__PURE__ */ I("div", { className: "grid gap-1", children: [
44
+ return /* @__PURE__ */ o(d.Provider, { value: V, children: /* @__PURE__ */ I("div", { className: "grid gap-1", children: [
43
45
  /* @__PURE__ */ o(
44
- w,
46
+ g,
45
47
  {
46
48
  id: l,
47
- className: n,
48
- onChange: () => L,
49
- ...T,
50
- children: d
49
+ className: c,
50
+ onChange: () => z,
51
+ ...B,
52
+ children: s
51
53
  }
52
54
  ),
53
- /* @__PURE__ */ o(g, { children: d })
55
+ /* @__PURE__ */ o(j, { children: s })
54
56
  ] }) });
55
57
  }
56
- ), E = i(({ className: l, ...a }, r) => {
57
- const { open: t, setOpen: e } = p(m) || {};
58
+ ), R = i(({ className: l, ...a }, r) => {
59
+ const { open: t, setOpen: e } = p(d) || {};
58
60
  return /* @__PURE__ */ o(
59
- y,
61
+ v,
60
62
  {
61
63
  ref: r,
62
64
  className: l,
@@ -66,22 +68,22 @@ const m = V(null), v = i(
66
68
  size: "sm",
67
69
  ...a,
68
70
  children: /* @__PURE__ */ o(
69
- y.Icon,
71
+ v.Icon,
70
72
  {
71
- className: c("transition-transform duration-300 ease-in-out", {
73
+ className: u("transition-transform duration-300 ease-in-out", {
72
74
  "rotate-180 transform": t
73
75
  }),
74
- icon: A
76
+ icon: P
75
77
  }
76
78
  )
77
79
  }
78
80
  );
79
- }), w = i(({ className: l }, a) => {
80
- const { open: r, setOpen: t, internalValue: e } = p(m) || {};
81
+ }), L = i(({ className: l, children: a }, r) => /* @__PURE__ */ o(m.Label, { className: l, ref: r, children: a })), g = i(({ className: l }, a) => {
82
+ const { open: r, setOpen: t, internalValue: e, label: c, handleChange: s } = p(d) || {};
81
83
  return /* @__PURE__ */ I(
82
- u,
84
+ m,
83
85
  {
84
- className: c(
86
+ className: u(
85
87
  "w-full rounded-md bg-white caret-transparent ",
86
88
  l
87
89
  ),
@@ -89,30 +91,31 @@ const m = V(null), v = i(
89
91
  "data-open": r,
90
92
  placeholder: "boo",
91
93
  value: e ?? "",
94
+ onChange: (f) => s == null ? void 0 : s(f.target.value),
92
95
  children: [
93
- /* @__PURE__ */ o(u.Label, { children: "sdfgh" }),
96
+ /* @__PURE__ */ o(m.Label, { children: c }),
94
97
  /* @__PURE__ */ o(
95
- u.Wrapper,
98
+ m.Wrapper,
96
99
  {
97
100
  onClick: () => t == null ? void 0 : t(!r),
98
101
  onBlur: () => t == null ? void 0 : t(!1),
99
- className: c(
102
+ className: u(
100
103
  "caret-transparent rounded hover:cursor-pointer data-[open=true]:border-primary data-[open=true]:ring-1 data-[open=true]:ring-primary",
101
104
  l
102
105
  ),
103
- children: /* @__PURE__ */ o(u.Actions, { children: /* @__PURE__ */ o(E, {}) })
106
+ children: /* @__PURE__ */ o(m.Actions, { children: /* @__PURE__ */ o(R, {}) })
104
107
  }
105
108
  )
106
109
  ]
107
110
  }
108
111
  );
109
- }), g = i(({ children: l, className: a, ...r }, t) => {
110
- const { open: e } = p(m) || {};
112
+ }), j = i(({ children: l, className: a, ...r }, t) => {
113
+ const { open: e } = p(d) || {};
111
114
  return e ? /* @__PURE__ */ o(
112
- z,
115
+ H,
113
116
  {
114
117
  ref: t,
115
- className: c(
118
+ className: u(
116
119
  "!px-0 data-[state=open]:animate-in w-full data-[state=open]:fade-in-0",
117
120
  a
118
121
  ),
@@ -120,30 +123,32 @@ const m = V(null), v = i(
120
123
  children: /* @__PURE__ */ o("ul", { children: l })
121
124
  }
122
125
  ) : null;
123
- }), j = i(({ children: l, value: a, className: r, ...t }, e) => {
124
- const { setInternalValue: n } = p(m) || {};
126
+ }), k = i(({ children: l, value: a, className: r, ...t }, e) => {
127
+ const { setInternalValue: c } = p(d) || {};
125
128
  return /* @__PURE__ */ o(
126
129
  "li",
127
130
  {
128
131
  ref: e,
129
- className: c(
132
+ className: u(
130
133
  "hover:cursor-pointer hover:bg-gray-100 w-full py-2 px-4",
131
134
  r
132
135
  ),
133
136
  value: a,
134
- onMouseDown: (d) => n == null ? void 0 : n(d.target.innerHTML),
137
+ onMouseDown: (s) => c == null ? void 0 : c(s.target.innerHTML),
135
138
  ...t,
136
139
  children: l
137
140
  }
138
141
  );
139
142
  });
140
- v.displayName = "Select";
141
- g.displayName = "Select.Content";
142
- w.displayName = "Select.Trigger";
143
- j.displayName = "Select.Item";
144
- const J = Object.assign(v, {
145
- Item: j
143
+ w.displayName = "Select";
144
+ j.displayName = "Select.Content";
145
+ g.displayName = "Select.Trigger";
146
+ k.displayName = "Select.Item";
147
+ L.displayName = "Select.Label";
148
+ const Q = Object.assign(w, {
149
+ Item: k,
150
+ Label: L
146
151
  });
147
152
  export {
148
- J as Select
153
+ Q as Select
149
154
  };
@@ -1,5 +1,6 @@
1
1
  @import './themes/local.css';
2
2
  @import './themes/penrithmrt.css';
3
+ @import './themes/paa.css';
3
4
 
4
5
  @tailwind base;
5
6
  @tailwind components;
@@ -1,4 +1,4 @@
1
- body.theme-penrithmrt {
1
+ body.theme-paa {
2
2
  --color-primary: #68a97b;
3
3
  --color-secondary: #1d341e;
4
4
  --color-tertiary: #ede9d3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trepur_components",
3
- "version": "2.4.3",
3
+ "version": "2.4.5",
4
4
  "description": "component lib",
5
5
  "author": "trepur_ttenneb",
6
6
  "private": false,