prometeo-design-system 2.6.8 → 2.7.0

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 (40) hide show
  1. package/dist/{Button-DsbEyjth.js → Button-CvBWH1HX.js} +8 -8
  2. package/dist/Button.es.js +1 -1
  3. package/dist/ButtonV2.es.js +12 -12
  4. package/dist/CheckboxFormik.es.js +10 -10
  5. package/dist/DatePicker.es.js +2 -2
  6. package/dist/DrawerDesktop.es.js +1 -1
  7. package/dist/DropZone.es.js +5 -5
  8. package/dist/FAButton.es.js +1 -1
  9. package/dist/{ImageGallery-DnoRTpCr.js → ImageGallery-DKzJg3un.js} +1 -1
  10. package/dist/ImageGallery.es.js +1 -1
  11. package/dist/Input-BTsR-vNF.js +281 -0
  12. package/dist/Input.es.js +1 -1
  13. package/dist/InputFormikV2.es.js +1 -1
  14. package/dist/Pagination.es.js +8 -8
  15. package/dist/ProfilePictureUpload.es.js +3 -3
  16. package/dist/Select-BQMdfu1n.js +1003 -0
  17. package/dist/Select.es.js +1 -1
  18. package/dist/SelectFormik.es.js +1 -1
  19. package/dist/SelectFormikLegacy.es.js +14 -14
  20. package/dist/SelectSearch.es.js +66 -63
  21. package/dist/TabLinks.es.js +8 -8
  22. package/dist/TextArea.es.js +28 -26
  23. package/dist/Toast.es.js +1 -1
  24. package/dist/components/RecurrentDatePicker/CustomFrequencySettings.d.ts +29 -3
  25. package/dist/components/RecurrentDatePicker/FrequencySettings.d.ts +2 -1
  26. package/dist/components/RecurrentDatePicker/MonthlyFrequencySettings.d.ts +9 -3
  27. package/dist/components/RecurrentDatePicker/RecurrentDatePicker.d.ts +28 -1
  28. package/dist/components/RecurrentDatePicker/WeekdaysSelector.d.ts +1 -0
  29. package/dist/components/RecurrentDatePicker/WeeklyFrequencySetting.d.ts +2 -1
  30. package/dist/components/RecurrentDatePicker/YearlyFrequencySettings.d.ts +13 -2
  31. package/dist/components/RecurrentDatePicker/recurrentDatePicker.validations.d.ts +69 -0
  32. package/dist/components/Select/Select.d.ts +18 -0
  33. package/dist/components/TextArea/TextArea.d.ts +2 -1
  34. package/dist/index.d.ts +1 -0
  35. package/dist/preview/SelectPreview/SelectGroupedOptionsPreview.d.ts +2 -0
  36. package/dist/prometeo-design-system.css +1 -1
  37. package/dist/prometeo-design-system.es.js +4 -4
  38. package/package.json +1 -1
  39. package/dist/Input-R52CsX56.js +0 -280
  40. package/dist/Select-CMjYSSZB.js +0 -812
@@ -1,280 +0,0 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
- import { Icons as k } 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 B } from "react";
5
- import { useDebounce as he } from "use-debounce";
6
- import we from "./Spinner.es.js";
7
- import { H as ye } from "./HelperComponent-U6mPwuDH.js";
8
- import { B as je } from "./Button-DsbEyjth.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-lime-500",
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: y,
95
- helperComponent: j,
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: C,
105
- style: X,
106
- readOnly: Y = !1,
107
- onClear: L,
108
- ...Z
109
- }, _) => {
110
- const [z, P] = O(l), [N] = he(z, d), [E, q] = O(!1), { ref: A } = ze(), M = T(null), I = _ || 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
- B(() => {
144
- d > 0 && N !== l && $(N);
145
- }, [N, d, $, l]), B(() => {
146
- P(l);
147
- }, [l]), B(() => {
148
- C && I.current?.focus();
149
- }, [C, I.current?.focus]);
150
- const ee = (u) => {
151
- J?.(u);
152
- }, te = (u) => {
153
- C === void 0 && K?.(u);
154
- }, re = (u) => {
155
- const S = u.target.value, pe = u.target.name, ie = z;
156
- P(S), ie.length > 0 && S.length === 0 && H?.(), (!d || d === 0) && b(S, pe);
157
- }, oe = () => {
158
- q(!E);
159
- }, R = {};
160
- g && g !== "100%" && (R.width = g), c && (R.height = c);
161
- const D = f === "error" && y, le = !D && j, 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, ...R },
175
- children: [
176
- /* @__PURE__ */ e.jsx(
177
- "input",
178
- {
179
- id: h,
180
- name: h,
181
- ref: I,
182
- value: z,
183
- placeholder: ce(),
184
- type: n === "password" && E ? "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" ? E ? /* @__PURE__ */ e.jsx(k.EyeVisibility, { size: 24, className: "" }) : /* @__PURE__ */ e.jsx(k.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(k.Close, { size: 20, className: "" })
260
- }
261
- )
262
- ]
263
- }
264
- ),
265
- (y || j) && /* @__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: y || j
271
- }
272
- ) })
273
- ] });
274
- });
275
- V.displayName = "Input";
276
- const Le = ge(V);
277
- export {
278
- Le as I,
279
- ze as u
280
- };