prometeo-design-system 2.6.0 → 2.6.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.
Files changed (41) hide show
  1. package/dist/CheckBox.es.js +27 -24
  2. package/dist/DatePicker.es.js +276 -272
  3. package/dist/DrawerMobile.es.js +87 -87
  4. package/dist/FAButton.d.ts +4 -0
  5. package/dist/FAButton.es.js +60 -0
  6. package/dist/HelperComponent-8ErmQ_n9.js +24 -0
  7. package/dist/Input-r2N9xkjM.js +280 -0
  8. package/dist/Input.es.js +1 -1
  9. package/dist/InputFormik.es.js +136 -93
  10. package/dist/InputFormikV2.d.ts +6 -0
  11. package/dist/InputFormikV2.es.js +29 -0
  12. package/dist/RadioButton.d.ts +2 -0
  13. package/dist/RadioButton.es.js +77 -0
  14. package/dist/RadioButtonFormik.d.ts +2 -0
  15. package/dist/RadioButtonFormik.es.js +30 -0
  16. package/dist/{Select-B5hkJ8Oy.js → Select-IAQKEfnq.js} +9 -8
  17. package/dist/Select.es.js +1 -1
  18. package/dist/SelectFormik.es.js +1 -1
  19. package/dist/SelectSearch.es.js +1 -1
  20. package/dist/components/DatePicker/DatePicker.d.ts +34 -0
  21. package/dist/components/Drawer/DrawerMobile.d.ts +1 -1
  22. package/dist/components/InputFormik/InputFormik.d.ts +2 -1
  23. package/dist/components/InputFormik/InputFormikV2.d.ts +1 -0
  24. package/dist/components/RadioButton/RadioButton.d.ts +12 -0
  25. package/dist/components/RadioButtonFormik/RadioButtonFormik.d.ts +8 -0
  26. package/dist/components/RecurrentDatePicker/FrequencySettings.d.ts +6 -0
  27. package/dist/components/RecurrentDatePicker/PreviewCalendar.d.ts +2 -0
  28. package/dist/components/RecurrentDatePicker/RecurrentDatePicker.d.ts +7 -0
  29. package/dist/components/RecurrentDatePicker/WeekdaysSelector.d.ts +11 -0
  30. package/dist/exports/RadioButton.d.ts +1 -0
  31. package/dist/exports/RadioButtonFormik.d.ts +1 -0
  32. package/dist/index.d.ts +4 -0
  33. package/dist/pages/RecurrentDatePicker.page.d.ts +2 -0
  34. package/dist/preview/RadioButtonPreview.d.ts +2 -0
  35. package/dist/preview/RecurrentDatePickerPreview.d.ts +2 -0
  36. package/dist/prometeo-design-system.css +1 -1
  37. package/dist/prometeo-design-system.es.js +286 -354
  38. package/package.json +9 -1
  39. package/src/styles/intellisense.css +1 -0
  40. package/dist/Input-DHdy-pWf.js +0 -295
  41. package/dist/components/Select copy/Select.d.ts +0 -71
@@ -0,0 +1,280 @@
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
+ import { Icons as R } from "./Icons.es.js";
3
+ import { c as r } from "./cn-B6yFEsav.js";
4
+ import { useRef as T, useLayoutEffect as me, memo as ge, forwardRef as xe, useState as O, useCallback as be, useEffect as S } from "react";
5
+ import { useDebounce as he } from "use-debounce";
6
+ import we from "./Spinner.es.js";
7
+ import { H as ye } from "./HelperComponent-8ErmQ_n9.js";
8
+ import { B as je } from "./Button-Bc0LYLfg.js";
9
+ const Ce = (o) => {
10
+ let t = o;
11
+ for (; t && t !== document.body; ) {
12
+ const l = window.getComputedStyle(t).backgroundColor;
13
+ if (l && l !== "transparent" && l !== "rgba(0, 0, 0, 0)")
14
+ return l;
15
+ t = t.parentElement;
16
+ }
17
+ const s = window.getComputedStyle(document.body).backgroundColor;
18
+ return s && s !== "transparent" && s !== "rgba(0, 0, 0, 0)" ? s : "rgb(255, 255, 255)";
19
+ };
20
+ function ze() {
21
+ const o = T(null);
22
+ return me(() => {
23
+ if (!o.current || !o.current.parentElement) return;
24
+ const t = Ce(o.current.parentElement);
25
+ o.current.style.backgroundColor = t;
26
+ }, []), {
27
+ ref: o
28
+ };
29
+ }
30
+ const x = {
31
+ default: {
32
+ container: "",
33
+ input: r(
34
+ "border-neutral-default-default text-neutral-default-default!",
35
+ "focus:ring-primary-default-default focus:ring-[1px] focus:border-primary-default-default ",
36
+ "hover:border-neutral-strong-default"
37
+ ),
38
+ label: r(
39
+ "text-neutral-medium-default"
40
+ ),
41
+ icon: r(
42
+ "text-neutral-medium-default",
43
+ "peer-focus:text-primary-default-default"
44
+ )
45
+ },
46
+ error: {
47
+ container: "",
48
+ input: r(
49
+ "border-error-default-default text-neutral-default-default",
50
+ "focus:border-error-default focus:border-2",
51
+ "focus:ring-0 focus:ring-error-default/20"
52
+ ),
53
+ label: r(
54
+ "text-error-light",
55
+ "peer-focus:text-error-light"
56
+ ),
57
+ icon: r(
58
+ "text-error-light",
59
+ "peer-focus:text-error-light"
60
+ )
61
+ },
62
+ success: {
63
+ container: "",
64
+ input: r(
65
+ "border-success-default-default text-neutral-default-default",
66
+ "focus:border-success-default focus:border-2",
67
+ "focus:ring-0 focus:ring-success-default/20"
68
+ ),
69
+ label: r(
70
+ "text-success",
71
+ "peer-focus:text-success-light"
72
+ ),
73
+ icon: r(
74
+ "text-success-light",
75
+ "peer-focus:text-success-light"
76
+ )
77
+ }
78
+ }, V = xe(({
79
+ label: o,
80
+ icon: t,
81
+ iconPosition: s = "left",
82
+ onChange: b,
83
+ value: l = "",
84
+ debounceMs: d = 0,
85
+ name: h,
86
+ width: g = "100%",
87
+ height: c,
88
+ variant: f = "default",
89
+ labelVariant: a = "default",
90
+ size: F = "medium",
91
+ disabled: w = !1,
92
+ type: n = "text",
93
+ isFetching: p,
94
+ errorComponent: k,
95
+ helperComponent: B,
96
+ placeholder: G,
97
+ required: v = !1,
98
+ onFocus: J,
99
+ onBlur: K,
100
+ onEmptied: H,
101
+ onKeyDown: Q,
102
+ onKeyUp: U,
103
+ className: W,
104
+ isActive: y,
105
+ style: X,
106
+ readOnly: Y = !1,
107
+ onClear: L,
108
+ ...Z
109
+ }, _) => {
110
+ const [j, P] = O(l), [C] = he(j, d), [z, q] = O(!1), { ref: A } = ze(), M = T(null), N = _ || null || M;
111
+ let i = F;
112
+ c && (i = "customHeight");
113
+ const m = {
114
+ small: {
115
+ container: "text-sm",
116
+ input: "h-10 px-3 text-[1rem] prometeo-fonts-body-large",
117
+ label: ` prometeo-fonts-label-large
118
+ peer-focus:prometeo-fonts-label-large
119
+ peer-placeholder-shown:${a === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default peer-focus:text-neutral-medium-default `,
120
+ icon: "w-4 h-4 right-3"
121
+ },
122
+ medium: {
123
+ container: "text-base",
124
+ input: "h-12 px-3 prometeo-fonts-body-large",
125
+ label: ` prometeo-fonts-label-large
126
+ peer-focus:prometeo-fonts-label-large
127
+ peer-placeholder-shown:${a === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default text-neutral-medium-default peer-focus:text-neutral-medium-default `,
128
+ icon: "w-5 h-5 right-3"
129
+ },
130
+ large: {
131
+ container: "text-lg",
132
+ input: "h-14 px-3 text-lg border-b border-t-0 border-x-0 rounded-none focus:ring-0 prometeo-fonts-body-xlarge ",
133
+ label: "peer-placeholder-shown:prometeo-fonts-body-xlarge peer-focus:prometeo-fonts-label-large peer-focus:text-neutral-medium-default prometeo-fonts-label-large ",
134
+ icon: "w-6 h-6 right-3"
135
+ },
136
+ customHeight: {
137
+ container: "text-base",
138
+ input: "text-base",
139
+ label: "text-sm peer-focus:text-sm peer-placeholder-shown:text-xs ",
140
+ icon: "w-6 h-6 right-3"
141
+ }
142
+ }, $ = be(b, []);
143
+ S(() => {
144
+ d > 0 && C !== l && $(C);
145
+ }, [C, d, $, l]), S(() => {
146
+ P(l);
147
+ }, [l]), S(() => {
148
+ y && N.current?.focus();
149
+ }, [y, N.current?.focus]);
150
+ const ee = (u) => {
151
+ J?.(u);
152
+ }, te = (u) => {
153
+ y === void 0 && K?.(u);
154
+ }, re = (u) => {
155
+ const I = u.target.value, pe = u.target.name, ie = j;
156
+ P(I), ie.length > 0 && I.length === 0 && H?.(), (!d || d === 0) && b(I, pe);
157
+ }, oe = () => {
158
+ q(!z);
159
+ }, E = {};
160
+ g && g !== "100%" && (E.width = g), c && (E.height = c);
161
+ const D = f === "error" && k, le = !D && B, se = n === "password", ne = () => a === "static" ? "-top-1 -translate-y-full left-0 pl-3" : t ? `peer-placeholder-shown:top-1/2 -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1 peer-focus:ml-0 peer-focus:mr-0 ${s === "left" ? "peer-placeholder-shown:ml-6" : "peer-placeholder-shown:mr-6"}` : "peer-placeholder-shown:top-1/2 -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1", ae = () => c ? m.customHeight.label : m[i].label, ue = () => c ? { height: c } : {}, ce = () => a === "default" ? o : G || o || "", fe = () => se ? t ? s === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : t ? s === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", de = a === "default" && "transition-all duration-200 ease-in-out";
162
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
163
+ /* @__PURE__ */ e.jsxs(
164
+ "div",
165
+ {
166
+ className: r(
167
+ "relative",
168
+ m[i].container,
169
+ !g && "w-full",
170
+ "bg-inherit",
171
+ a === "static" && "mt-2",
172
+ W
173
+ ),
174
+ style: { ...X, ...E },
175
+ children: [
176
+ /* @__PURE__ */ e.jsx(
177
+ "input",
178
+ {
179
+ id: h,
180
+ name: h,
181
+ ref: N,
182
+ value: j,
183
+ placeholder: ce(),
184
+ type: n === "password" && z ? "text" : n,
185
+ className: r(
186
+ "peer w-full border rounded-lg bg-transparent appearance-none transition-all duration-200 ease-in-out",
187
+ "focus:outline-none px-3",
188
+ a === "default" && "placeholder:text-transparent",
189
+ a === "static" && "placeholder:text-neutral-medium-default ",
190
+ x[f].input,
191
+ m[i].input,
192
+ t && "pr-10",
193
+ w && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
194
+ x[f].container,
195
+ fe()
196
+ ),
197
+ style: ue(),
198
+ onChange: re,
199
+ onFocus: ee,
200
+ onBlur: te,
201
+ disabled: w,
202
+ required: v,
203
+ onEmptied: H,
204
+ onKeyDown: Q,
205
+ onKeyUp: U,
206
+ readOnly: Y,
207
+ ...Z
208
+ }
209
+ ),
210
+ /* @__PURE__ */ e.jsx(
211
+ "label",
212
+ {
213
+ ref: A,
214
+ htmlFor: h,
215
+ className: r(
216
+ "absolute left-3 pointer-events-none px-1 z-10",
217
+ de,
218
+ ae(),
219
+ x[f].label,
220
+ ne(),
221
+ v && "after:content-['*'] after:text-error-default after:ml-1",
222
+ w && "text-neutral-medium-disabled prometeo-fonts-label-large"
223
+ ),
224
+ children: o
225
+ }
226
+ ),
227
+ (t || n === "password" || p) && /* @__PURE__ */ e.jsx(
228
+ "button",
229
+ {
230
+ tabIndex: -1,
231
+ type: "button",
232
+ className: r(
233
+ "absolute top-1/2 -translate-y-1/2 flex items-center justify-center z-10",
234
+ m[i].icon,
235
+ x[f].icon,
236
+ n === "password" && !p ? "cursor-pointer" : "pointer-events-none",
237
+ s === "right" ? "right-3" : "left-3"
238
+ ),
239
+ onClick: n === "password" && !p ? oe : void 0,
240
+ onMouseDown: (u) => n === "password" && !p && u.preventDefault(),
241
+ children: /* @__PURE__ */ e.jsx("div", { children: p && n !== "password" ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(we, { size: 24, color: "#7c86ff", loading: !0, variant: "clip" }) }) : n === "password" ? z ? /* @__PURE__ */ e.jsx(R.EyeVisibility, { size: 24, className: "" }) : /* @__PURE__ */ e.jsx(R.EyeVisibilityOff, { size: 24, className: "" }) : t })
242
+ }
243
+ ),
244
+ L && /* @__PURE__ */ e.jsx(
245
+ je,
246
+ {
247
+ type: "button",
248
+ color: "secondary",
249
+ size: "small",
250
+ animate: !1,
251
+ className: r(
252
+ "absolute top-1/2 -translate-y-1/2 flex items-center justify-center z-10 right-1",
253
+ "size-6 p-4 ",
254
+ "bg-inherit",
255
+ "hover:bg-neutral-default-hover p-4 rounded-full"
256
+ ),
257
+ label: "",
258
+ onClick: L,
259
+ icon: /* @__PURE__ */ e.jsx(R.Close, { size: 20, className: "" })
260
+ }
261
+ )
262
+ ]
263
+ }
264
+ ),
265
+ /* @__PURE__ */ e.jsx("div", { className: "min-h-6", children: (D || le) && /* @__PURE__ */ e.jsx(
266
+ ye,
267
+ {
268
+ className: " absolute",
269
+ variant: f,
270
+ children: k || B
271
+ }
272
+ ) })
273
+ ] });
274
+ });
275
+ V.displayName = "Input";
276
+ const Le = ge(V);
277
+ export {
278
+ Le as I,
279
+ ze as u
280
+ };
package/dist/Input.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { I as f } from "./Input-DHdy-pWf.js";
1
+ import { I as f } from "./Input-r2N9xkjM.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,44 +1,50 @@
1
1
  import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
- import { c as u } from "./cn-B6yFEsav.js";
3
- import { FastField as O, ErrorMessage as q } from "formik";
4
- import { memo as G, useState as I, useRef as H, useCallback as y, useLayoutEffect as J } from "react";
2
+ import { c as s } from "./cn-B6yFEsav.js";
3
+ import { FastField as q, ErrorMessage as G } from "formik";
4
+ import { memo as H, useState as I, useRef as J, useCallback as y, useLayoutEffect as Q } from "react";
5
5
  import { Icons as N } from "./Icons.es.js";
6
- const Q = ({
7
- icon: l,
6
+ const W = ({
7
+ icon: t,
8
8
  iconPosition: r = "left",
9
9
  label: d,
10
10
  className: B,
11
- containerClassName: $,
11
+ containerClassName: R,
12
12
  id: w,
13
13
  type: j = "text",
14
14
  labelVariant: n = "default",
15
15
  placeholder: p,
16
16
  disabled: b = !1,
17
- field: t,
17
+ field: l,
18
+ innerRef: $,
18
19
  form: z,
19
20
  ...a
20
21
  }) => {
21
- const [o, v] = I(!1), [C, K] = I(!1), c = H(null), F = z.getFieldMeta(t.name), k = F.touched && F.error, E = t.value && t.value.toString().length > 0, x = j === "password", M = x ? C ? "text" : "password" : j, P = () => n === "static" ? p || d : p || "", R = () => x ? l ? r === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : l ? r === "left" ? "pl-10" : "pr-10" : "", A = y(() => {
22
+ const [o, v] = I(!1), [C, K] = I(!1), i = J(null), F = z.getFieldMeta(l.name), k = F.touched && F.error, E = l.value && l.value.toString().length > 0, x = j === "password", M = x ? C ? "text" : "password" : j, P = () => n === "static" ? p || d : p || "", A = () => x ? t ? r === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : t ? r === "left" ? "pl-10" : "pr-10" : "", D = y(() => {
22
23
  v(!0), a.onFocus?.();
23
- }, [a]), D = y((i) => {
24
- v(!1), a.onBlur?.(), t.onBlur(i);
25
- }, [t, a]), T = y(() => {
26
- K((i) => !i);
24
+ }, [a]), T = y(
25
+ (c) => {
26
+ v(!1), a.onBlur?.(), l.onBlur(c);
27
+ },
28
+ [l, a]
29
+ ), U = y(() => {
30
+ K((c) => !c);
27
31
  }, []);
28
- J(() => {
29
- if (c.current) {
30
- const V = ((L) => {
31
- let s = L;
32
- for (; s && s !== document.body; ) {
33
- const f = window.getComputedStyle(s).backgroundColor;
32
+ Q(() => {
33
+ if (i.current) {
34
+ const L = ((O) => {
35
+ let u = O;
36
+ for (; u && u !== document.body; ) {
37
+ const f = window.getComputedStyle(u).backgroundColor;
34
38
  if (f && f !== "transparent" && f !== "rgba(0, 0, 0, 0)")
35
39
  return f;
36
- s = s.parentElement;
40
+ u = u.parentElement;
37
41
  }
38
42
  const m = window.getComputedStyle(document.body).backgroundColor;
39
43
  return m && m !== "transparent" && m !== "rgba(0, 0, 0, 0)" ? m : "rgb(255, 255, 255)";
40
- })(c.current.parentElement);
41
- c.current.style.backgroundColor = V;
44
+ })(
45
+ i.current.parentElement
46
+ );
47
+ i.current.style.backgroundColor = L;
42
48
  }
43
49
  }, []);
44
50
  const g = {
@@ -72,7 +78,7 @@ const Q = ({
72
78
  icon: {},
73
79
  placeholder: {}
74
80
  }
75
- }, U = {
81
+ }, V = {
76
82
  none: {
77
83
  label: "left-2 "
78
84
  },
@@ -92,79 +98,116 @@ const Q = ({
92
98
  label: `top-1/2 -translate-y-1/2 scale-100 peer-focus:text-sm peer-placeholder-shown:text-base ${(o || E) && "top-0 scale-90"}`
93
99
  }
94
100
  }, h = b ? "disabled" : k ? "error" : "default";
95
- return /* @__PURE__ */ e.jsxs("div", { className: u("relative w-full bg-inherit", n === "static" && "mt-5", $), children: [
96
- /* @__PURE__ */ e.jsxs("div", { className: "relative bg-inherit", children: [
97
- /* @__PURE__ */ e.jsx(
98
- "input",
99
- {
100
- disabled: b,
101
- id: w || t.name,
102
- type: M,
103
- name: t.name,
104
- value: t.value || "",
105
- placeholder: P(),
106
- onChange: t.onChange,
107
- onFocus: A,
108
- onEmptied: a.onEmptied,
109
- onKeyDown: a.onKeyDown,
110
- onKeyUp: a.onKeyUp,
111
- onBlur: D,
112
- className: u(
113
- "w-full px-3 h-12 text-left border-[1px] rounded-lg transition-all duration-200 ease-in-out text-neutral-default-default",
114
- "bg-transparent focus:outline-none",
115
- S[n].input,
116
- g[h].input,
117
- R(),
118
- B
119
- )
120
- }
101
+ return /* @__PURE__ */ e.jsxs(
102
+ "div",
103
+ {
104
+ className: s(
105
+ "relative w-full bg-inherit",
106
+ n === "static" && "mt-5",
107
+ R
121
108
  ),
122
- /* @__PURE__ */ e.jsx(
123
- "label",
124
- {
125
- ref: c,
126
- htmlFor: w || a.name,
127
- className: u(
128
- "absolute transition-all duration-200 font-bold text-sm ease-in-out pointer-events-none bg-inherit px-1 z-10",
129
- "prometeo-fonts-label-large text-sm",
130
- U[l ? r : "none"].label,
131
- S[n].label,
132
- g[h].label
109
+ children: [
110
+ /* @__PURE__ */ e.jsxs("div", { className: "relative bg-inherit", children: [
111
+ /* @__PURE__ */ e.jsx(
112
+ "input",
113
+ {
114
+ disabled: b,
115
+ id: w || l.name,
116
+ type: M,
117
+ name: l.name,
118
+ value: l.value || "",
119
+ placeholder: P(),
120
+ onChange: l.onChange,
121
+ onFocus: D,
122
+ onEmptied: a.onEmptied,
123
+ onKeyDown: a.onKeyDown,
124
+ onKeyUp: a.onKeyUp,
125
+ onBlur: T,
126
+ className: s(
127
+ "w-full px-3 h-12 text-left border-[1px] rounded-lg transition-all duration-200 ease-in-out text-neutral-default-default",
128
+ "bg-transparent focus:outline-none",
129
+ S[n].input,
130
+ g[h].input,
131
+ A(),
132
+ B
133
+ ),
134
+ ref: $
135
+ }
133
136
  ),
134
- children: d
135
- }
136
- ),
137
- l && /* @__PURE__ */ e.jsx("div", { className: u(
138
- "absolute top-1/2 -translate-y-1/2 text-neutral-medium-default",
139
- g[h].icon,
140
- r === "left" ? "left-3" : "right-3"
141
- ), children: l }),
142
- x && /* @__PURE__ */ e.jsx(
143
- "button",
144
- {
145
- type: "button",
146
- onClick: T,
147
- className: u(
148
- "absolute top-1/2 -translate-y-1/2 p-1 text-neutral-medium-default hover:text-neutral-strong-default",
149
- "transition-colors duration-200 focus:outline-none focus:text-primary-default-default",
150
- l && r === "right" ? "right-8" : "right-3"
137
+ /* @__PURE__ */ e.jsx(
138
+ "label",
139
+ {
140
+ ref: i,
141
+ htmlFor: w || a.name,
142
+ className: s(
143
+ "absolute transition-all duration-200 font-bold text-sm ease-in-out pointer-events-none bg-inherit px-1 z-10",
144
+ "prometeo-fonts-label-large text-sm",
145
+ V[t ? r : "none"].label,
146
+ S[n].label,
147
+ g[h].label
148
+ ),
149
+ children: d
150
+ }
151
151
  ),
152
- tabIndex: -1,
153
- disabled: b,
154
- children: C ? /* @__PURE__ */ e.jsx(N.EyeVisibility, { size: 24, className: "text-neutral-default-default" }) : /* @__PURE__ */ e.jsx(N.EyeVisibilityOff, { size: 24, className: "text-neutral-default-default" })
155
- }
156
- )
157
- ] }),
158
- k && /* @__PURE__ */ e.jsx(
159
- q,
160
- {
161
- name: t.name,
162
- component: "span",
163
- className: "block text-error-default-default text-xs mt-1"
164
- }
165
- )
166
- ] });
167
- }, W = G(Q), le = (l) => /* @__PURE__ */ e.jsx(O, { name: l.name, children: ({ field: r, form: d }) => /* @__PURE__ */ e.jsx(W, { ...l, field: r, form: d }) });
152
+ t && /* @__PURE__ */ e.jsx(
153
+ "div",
154
+ {
155
+ className: s(
156
+ "absolute top-1/2 -translate-y-1/2 text-neutral-medium-default",
157
+ g[h].icon,
158
+ r === "left" ? "left-3" : "right-3"
159
+ ),
160
+ children: t
161
+ }
162
+ ),
163
+ x && /* @__PURE__ */ e.jsx(
164
+ "button",
165
+ {
166
+ type: "button",
167
+ onClick: U,
168
+ className: s(
169
+ "absolute top-1/2 -translate-y-1/2 p-1 text-neutral-medium-default hover:text-neutral-strong-default",
170
+ "transition-colors duration-200 focus:outline-none focus:text-primary-default-default",
171
+ t && r === "right" ? "right-8" : "right-3"
172
+ ),
173
+ tabIndex: -1,
174
+ disabled: b,
175
+ children: C ? /* @__PURE__ */ e.jsx(
176
+ N.EyeVisibility,
177
+ {
178
+ size: 24,
179
+ className: "text-neutral-default-default"
180
+ }
181
+ ) : /* @__PURE__ */ e.jsx(
182
+ N.EyeVisibilityOff,
183
+ {
184
+ size: 24,
185
+ className: "text-neutral-default-default"
186
+ }
187
+ )
188
+ }
189
+ )
190
+ ] }),
191
+ k && /* @__PURE__ */ e.jsx(
192
+ G,
193
+ {
194
+ name: l.name,
195
+ component: "span",
196
+ className: "block text-error-default-default text-xs mt-1"
197
+ }
198
+ )
199
+ ]
200
+ }
201
+ );
202
+ }, X = H(W), ae = (t) => /* @__PURE__ */ e.jsx(q, { name: t.name, children: ({ field: r, form: d }) => /* @__PURE__ */ e.jsx(
203
+ X,
204
+ {
205
+ ...t,
206
+ field: r,
207
+ form: d,
208
+ innerRef: t.innerRef
209
+ }
210
+ ) });
168
211
  export {
169
- le as default
212
+ ae as default
170
213
  };
@@ -0,0 +1,6 @@
1
+ export * from './exports/InputFormikV2'
2
+ export {}
3
+ import PrometeoDesignSystem from './exports/InputFormikV2'
4
+ export default PrometeoDesignSystem
5
+ export * from './exports/InputFormikV2'
6
+ export {}
@@ -0,0 +1,29 @@
1
+ import { j as o } from "./jsx-runtime-ByW6EXIE.js";
2
+ import { FastField as u } from "formik";
3
+ import { memo as s } from "react";
4
+ import { I as i } from "./Input-r2N9xkjM.js";
5
+ const c = ({
6
+ field: r,
7
+ form: t,
8
+ ...e
9
+ }) => {
10
+ const n = t.getFieldMeta(r.name), a = n.touched && n.error;
11
+ return /* @__PURE__ */ o.jsx(
12
+ i,
13
+ {
14
+ ...e,
15
+ ...r,
16
+ value: r.value,
17
+ onChange: (m) => {
18
+ r.onChange({ target: { value: m, name: r.name } });
19
+ },
20
+ variant: a ? "error" : "default",
21
+ errorComponent: n.error,
22
+ type: e.type,
23
+ ref: e.innerRef
24
+ }
25
+ );
26
+ }, p = s(c), j = (r) => /* @__PURE__ */ o.jsx(u, { name: r.name, children: ({ field: t, form: e }) => /* @__PURE__ */ o.jsx(p, { ...r, field: t, form: e }) });
27
+ export {
28
+ j as default
29
+ };
@@ -0,0 +1,2 @@
1
+ export * from './exports/RadioButton'
2
+ export {}
@@ -0,0 +1,77 @@
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
+ import { c } from "./cn-B6yFEsav.js";
3
+ import { memo as v, forwardRef as x, useRef as k, useEffect as g } from "react";
4
+ import { H as y } from "./HelperComponent-8ErmQ_n9.js";
5
+ const n = x((u, a) => {
6
+ const r = k(null);
7
+ g(() => {
8
+ a && (typeof a == "function" ? a(r.current) : a.current = r.current);
9
+ }, [a]);
10
+ const f = (m) => {
11
+ r.current && (m.stopPropagation(), r.current.click());
12
+ }, { disabled: t = !1, label: o, required: p = !1, errorComponent: l, helperComponent: d, variant: i = "default", ...b } = u, s = i === "error" && l, h = !s && d;
13
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 w-fit h-max", children: [
14
+ /* @__PURE__ */ e.jsxs("label", { className: "flex items-center justify-start gap-3 w-fit", children: [
15
+ /* @__PURE__ */ e.jsxs("div", { className: "relative z-10 h-10 flex items-center", children: [
16
+ /* @__PURE__ */ e.jsx(
17
+ "input",
18
+ {
19
+ hidden: !0,
20
+ type: "radio",
21
+ ref: r,
22
+ className: "peer",
23
+ disabled: t,
24
+ ...b
25
+ }
26
+ ),
27
+ /* @__PURE__ */ e.jsx(
28
+ "div",
29
+ {
30
+ role: "radio",
31
+ "aria-checked": r.current?.checked,
32
+ "aria-disabled": t,
33
+ onClick: t ? () => {
34
+ } : f,
35
+ className: c(
36
+ "size-5 rounded-full border-neutral-default-hover hover:border-neutral-default-default border-[2px] p-[3px]",
37
+ "transition-all duration-300 cursor-pointer relative ",
38
+ "grid place-items-center",
39
+ " before:bg-neutral-default-pressed before:size-10 before:absolute before:rounded-full before:-z-10! before:opacity-0 active:before:opacity-100 before:transition-all before:duration-300 ",
40
+ "hover:before:opacity-0 hover:before:bg-neutral-default-hover",
41
+ "peer-checked:border-primary-default-default peer-checked:hover:before:opacity-100 peer-checked:hover:before:bg-neutral-default-pressed peer-checked:active:before:bg-neutral-default-hover peer-checked:hover:border-primary-default-focused peer-checked:hover:*:bg-primary-default-hover active:before:bg-neutral-default-hover peer-checked:active:border-primary-strong-pressed peer-checked:active:*:bg-primary-default-pressed",
42
+ "peer-checked:*:bg-primary-light",
43
+ //disabled
44
+ "peer-disabled:pointer-events-none",
45
+ "peer-disabled:border-neutral-default-disabled peer-disabled:peer-checked:border-neutral-default-default",
46
+ "peer-disabled:peer-checked:*:bg-neutral-weak-hover"
47
+ ),
48
+ children: /* @__PURE__ */ e.jsx(
49
+ "div",
50
+ {
51
+ className: c(
52
+ "size-full rounded-full transition-all duration-300"
53
+ )
54
+ }
55
+ )
56
+ }
57
+ )
58
+ ] }),
59
+ o && /* @__PURE__ */ e.jsxs("span", { className: "prometeo-fonts-label-large", children: [
60
+ o,
61
+ p && " *"
62
+ ] })
63
+ ] }),
64
+ /* @__PURE__ */ e.jsx("div", { className: "min-h-5", children: (s || h) && /* @__PURE__ */ e.jsx(
65
+ y,
66
+ {
67
+ variant: i,
68
+ children: l || d
69
+ }
70
+ ) })
71
+ ] });
72
+ });
73
+ n.displayName = "RadioButton";
74
+ const z = v(n);
75
+ export {
76
+ z as RadioButton
77
+ };
@@ -0,0 +1,2 @@
1
+ export * from './exports/RadioButtonFormik'
2
+ export {}