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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prometeo-design-system",
3
3
  "private": false,
4
- "version": "2.6.0",
4
+ "version": "2.6.2",
5
5
  "type": "module",
6
6
  "description": "design kit system",
7
7
  "main": "dist/prometeo-design-system.umd.js",
@@ -173,6 +173,14 @@
173
173
  "types": "./dist/FAButton.d.ts",
174
174
  "import": "./dist/FAButton.es.js"
175
175
  },
176
+ "./RadioButton":{
177
+ "types": "./dist/RadioButton.d.ts",
178
+ "import": "./dist/RadioButton.es.js"
179
+ },
180
+ "./RadioButtonFormik":{
181
+ "types": "./dist/RadioButtonFormik.d.ts",
182
+ "import": "./dist/RadioButtonFormik.es.js"
183
+ },
176
184
  "./styles": "./dist/prometeo-design-system.css",
177
185
  "./intellisense": "./src/styles/intellisense.css"
178
186
  },
@@ -161,6 +161,7 @@
161
161
  @utility border-primary-default-focused { --intellisense-border-primary-default-focused: 1; }
162
162
  @utility border-primary-default-pressed { --intellisense-border-primary-default-pressed: 1; }
163
163
  @utility border-primary-default-disabled { --intellisense-border-primary-default-disabled: 1; }
164
+ @utility border-primary-strong-pressed { --intellisense-border-primary-strong-pressed: 1; }
164
165
  @utility border-primary-light { --intellisense-border-primary-light: 1; }
165
166
  @utility border-primary-medium-default { --intellisense-border-primary-medium-default: 1; }
166
167
  @utility border-primary-medium-pressed { --intellisense-border-primary-medium-pressed: 1; }
@@ -1,295 +0,0 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
- import { Icons as d } from "./Icons.es.js";
3
- import { c as o } from "./cn-B6yFEsav.js";
4
- import { useRef as T, useLayoutEffect as ge, memo as V, forwardRef as be, useState as O, useCallback as he, useEffect as k } from "react";
5
- import { useDebounce as we } from "use-debounce";
6
- import ye from "./Spinner.es.js";
7
- import { B as je } from "./Button-Bc0LYLfg.js";
8
- const Ce = (t) => {
9
- let r = t;
10
- for (; r && r !== document.body; ) {
11
- const s = window.getComputedStyle(r).backgroundColor;
12
- if (s && s !== "transparent" && s !== "rgba(0, 0, 0, 0)")
13
- return s;
14
- r = r.parentElement;
15
- }
16
- const l = window.getComputedStyle(document.body).backgroundColor;
17
- return l && l !== "transparent" && l !== "rgba(0, 0, 0, 0)" ? l : "rgb(255, 255, 255)";
18
- };
19
- function Ne() {
20
- const t = T(null);
21
- return ge(() => {
22
- if (!t.current || !t.current.parentElement) return;
23
- const r = Ce(t.current.parentElement);
24
- t.current.style.backgroundColor = r;
25
- }, []), {
26
- ref: t
27
- };
28
- }
29
- const F = (t) => {
30
- const { variant: r, className: l } = t, i = {
31
- default: "text-neutral-medium-default pt-[1px]",
32
- error: "text-error-medium-default pt-[1px]",
33
- success: "text-success-medium-default"
34
- }, s = {
35
- default: /* @__PURE__ */ e.jsx(d.Info, { size: 16, className: "text-neutral-medium-default " }),
36
- error: /* @__PURE__ */ e.jsx(d.Error, { size: 16, className: "text-error-medium-default" }),
37
- success: /* @__PURE__ */ e.jsx(d.Check, { size: 16, className: "text-success-medium-default" })
38
- };
39
- return /* @__PURE__ */ e.jsx("div", { ref: t.ref, className: o("pl-3 mt-1", l), children: typeof t.children == "string" ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-0.5 items-start", children: [
40
- s[r],
41
- /* @__PURE__ */ e.jsx("p", { className: o(" prometeo-fonts-body-small", i[r]), children: t.children })
42
- ] }) : t.children });
43
- };
44
- F.displayName = "HelperText";
45
- const ze = V(F), h = {
46
- default: {
47
- container: "",
48
- input: o(
49
- "border-neutral-default-default text-neutral-default-default!",
50
- "focus:ring-primary-default-default focus:ring-[1px] focus:border-primary-default-default ",
51
- "hover:border-neutral-strong-default"
52
- ),
53
- label: o(
54
- "text-neutral-medium-default"
55
- ),
56
- icon: o(
57
- "text-neutral-medium-default",
58
- "peer-focus:text-primary-default-default"
59
- )
60
- },
61
- error: {
62
- container: "",
63
- input: o(
64
- "border-error-default-default text-neutral-default-default",
65
- "focus:border-error-default focus:border-2",
66
- "focus:ring-0 focus:ring-error-default/20"
67
- ),
68
- label: o(
69
- "text-error-light",
70
- "peer-focus:text-error-light"
71
- ),
72
- icon: o(
73
- "text-error-light",
74
- "peer-focus:text-error-light"
75
- )
76
- },
77
- success: {
78
- container: "",
79
- input: o(
80
- "border-success-default-default text-neutral-default-default",
81
- "focus:border-success-default focus:border-2",
82
- "focus:ring-0 focus:ring-success-default/20"
83
- ),
84
- label: o(
85
- "text-success",
86
- "peer-focus:text-success-light"
87
- ),
88
- icon: o(
89
- "text-success-light",
90
- "peer-focus:text-success-light"
91
- )
92
- }
93
- }, G = be(({
94
- label: t,
95
- icon: r,
96
- iconPosition: l = "left",
97
- onChange: i,
98
- value: s = "",
99
- debounceMs: p = 0,
100
- name: w,
101
- width: b = "100%",
102
- height: c,
103
- variant: f = "default",
104
- labelVariant: n = "default",
105
- size: J = "medium",
106
- disabled: y = !1,
107
- type: a = "text",
108
- isFetching: m,
109
- errorComponent: H,
110
- helperComponent: R,
111
- placeholder: K,
112
- required: S = !1,
113
- onFocus: Q,
114
- onBlur: U,
115
- onEmptied: B,
116
- onKeyDown: W,
117
- onKeyUp: X,
118
- className: Y,
119
- isActive: j,
120
- style: Z,
121
- readOnly: _ = !1,
122
- onClear: L,
123
- ...q
124
- }, A) => {
125
- const [C, $] = O(s), [N] = we(C, p), [z, M] = O(!1), { ref: ee } = Ne(), te = T(null), v = A || null || te;
126
- let x = J;
127
- c && (x = "customHeight");
128
- const g = {
129
- small: {
130
- container: "text-sm",
131
- input: "h-10 px-3 text-[1rem] prometeo-fonts-body-large",
132
- label: ` prometeo-fonts-label-large
133
- peer-focus:prometeo-fonts-label-large
134
- peer-placeholder-shown:${n === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default peer-focus:text-neutral-medium-default `,
135
- icon: "w-4 h-4 right-3"
136
- },
137
- medium: {
138
- container: "text-base",
139
- input: "h-12 px-3 prometeo-fonts-body-large",
140
- label: ` prometeo-fonts-label-large
141
- peer-focus:prometeo-fonts-label-large
142
- peer-placeholder-shown:${n === "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 `,
143
- icon: "w-5 h-5 right-3"
144
- },
145
- large: {
146
- container: "text-lg",
147
- input: "h-14 px-3 text-lg border-b border-t-0 border-x-0 rounded-none focus:ring-0 prometeo-fonts-body-xlarge ",
148
- label: "peer-placeholder-shown:prometeo-fonts-body-xlarge peer-focus:prometeo-fonts-label-large peer-focus:text-neutral-medium-default prometeo-fonts-label-large ",
149
- icon: "w-6 h-6 right-3"
150
- },
151
- customHeight: {
152
- container: "text-base",
153
- input: "text-base",
154
- label: "text-sm peer-focus:text-sm peer-placeholder-shown:text-xs ",
155
- icon: "w-6 h-6 right-3"
156
- }
157
- }, P = he(i, []);
158
- k(() => {
159
- p > 0 && N !== s && P(N);
160
- }, [N, p, P, s]), k(() => {
161
- $(s);
162
- }, [s]), k(() => {
163
- j && v.current?.focus();
164
- }, [j, v.current?.focus]);
165
- const re = (u) => {
166
- Q?.(u);
167
- }, oe = (u) => {
168
- j === void 0 && U?.(u);
169
- }, se = (u) => {
170
- const E = u.target.value, me = u.target.name, xe = C;
171
- $(E), xe.length > 0 && E.length === 0 && B?.(), (!p || p === 0) && i(E, me);
172
- }, le = () => {
173
- M(!z);
174
- }, I = {};
175
- b && b !== "100%" && (I.width = b), c && (I.height = c);
176
- const D = f === "error" && H, ae = !D && R, ne = a === "password", ue = () => n === "static" ? "-top-1 -translate-y-full left-0 pl-3" : r ? `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 ${l === "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", ce = () => c ? g.customHeight.label : g[x].label, fe = () => c ? { height: c } : {}, de = () => n === "default" ? t : K || t || "", ie = () => ne ? r ? l === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : r ? l === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", pe = n === "default" && "transition-all duration-200 ease-in-out";
177
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
178
- /* @__PURE__ */ e.jsxs(
179
- "div",
180
- {
181
- className: o(
182
- "relative",
183
- g[x].container,
184
- !b && "w-full",
185
- "bg-inherit",
186
- n === "static" && "mt-2",
187
- Y
188
- ),
189
- style: { ...Z, ...I },
190
- children: [
191
- /* @__PURE__ */ e.jsx(
192
- "input",
193
- {
194
- id: w,
195
- name: w,
196
- ref: v,
197
- value: C,
198
- placeholder: de(),
199
- type: a === "password" && z ? "text" : a,
200
- className: o(
201
- "peer w-full border rounded-lg bg-transparent appearance-none transition-all duration-200 ease-in-out",
202
- "focus:outline-none px-3",
203
- n === "default" && "placeholder:text-transparent",
204
- n === "static" && "placeholder:text-neutral-medium-default ",
205
- h[f].input,
206
- g[x].input,
207
- r && "pr-10",
208
- y && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
209
- h[f].container,
210
- ie()
211
- ),
212
- style: fe(),
213
- onChange: se,
214
- onFocus: re,
215
- onBlur: oe,
216
- disabled: y,
217
- required: S,
218
- onEmptied: B,
219
- onKeyDown: W,
220
- onKeyUp: X,
221
- readOnly: _,
222
- ...q
223
- }
224
- ),
225
- /* @__PURE__ */ e.jsx(
226
- "label",
227
- {
228
- ref: ee,
229
- htmlFor: w,
230
- className: o(
231
- "absolute left-3 pointer-events-none px-1 z-10",
232
- pe,
233
- ce(),
234
- h[f].label,
235
- ue(),
236
- S && "after:content-['*'] after:text-error-default after:ml-1",
237
- y && "text-neutral-medium-disabled prometeo-fonts-label-large"
238
- ),
239
- children: t
240
- }
241
- ),
242
- (r || a === "password" || m) && /* @__PURE__ */ e.jsx(
243
- "button",
244
- {
245
- tabIndex: -1,
246
- type: "button",
247
- className: o(
248
- "absolute top-1/2 -translate-y-1/2 flex items-center justify-center z-10",
249
- g[x].icon,
250
- h[f].icon,
251
- a === "password" && !m ? "cursor-pointer" : "pointer-events-none",
252
- l === "right" ? "right-3" : "left-3"
253
- ),
254
- onClick: a === "password" && !m ? le : void 0,
255
- onMouseDown: (u) => a === "password" && !m && u.preventDefault(),
256
- children: /* @__PURE__ */ e.jsx("div", { children: m && a !== "password" ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(ye, { size: 24, color: "#7c86ff", loading: !0, variant: "clip" }) }) : a === "password" ? z ? /* @__PURE__ */ e.jsx(d.EyeVisibility, { size: 24, className: "" }) : /* @__PURE__ */ e.jsx(d.EyeVisibilityOff, { size: 24, className: "" }) : r })
257
- }
258
- ),
259
- L && /* @__PURE__ */ e.jsx(
260
- je,
261
- {
262
- type: "button",
263
- color: "secondary",
264
- size: "small",
265
- animate: !1,
266
- className: o(
267
- "absolute top-1/2 -translate-y-1/2 flex items-center justify-center z-10 right-1",
268
- "size-6 p-4 ",
269
- "bg-inherit",
270
- "hover:bg-neutral-default-hover p-4 rounded-full"
271
- ),
272
- label: "",
273
- onClick: L,
274
- icon: /* @__PURE__ */ e.jsx(d.Close, { size: 20, className: "" })
275
- }
276
- )
277
- ]
278
- }
279
- ),
280
- (D || ae) && /* @__PURE__ */ e.jsx(
281
- ze,
282
- {
283
- variant: f,
284
- children: H || R
285
- }
286
- )
287
- ] });
288
- });
289
- G.displayName = "Input";
290
- const Le = V(G);
291
- export {
292
- ze as H,
293
- Le as I,
294
- Ne as u
295
- };
@@ -1,71 +0,0 @@
1
- import { ComponentType, JSX, default as React } from 'react';
2
- import { ComponentVariant, LabelVariant, OptionAccessor } from '../Shared/types';
3
- export type SelectDisplayMode = "compact" | "chips";
4
- export type SelectOptionType = {
5
- label: string;
6
- value: string | number;
7
- id: string | number;
8
- };
9
- export type CustomSelectionDisplayProps<T> = {
10
- selectedOptions: T[];
11
- placeholder?: string;
12
- multiple: boolean;
13
- onRemoveOption: (optionId: string | number) => void;
14
- disabled?: boolean;
15
- };
16
- interface SelectOptionRendererProps<T = unknown> {
17
- option: SelectOptionType | T;
18
- isSelected: boolean;
19
- onSelect: (option: SelectOptionType) => void;
20
- multiple: boolean;
21
- disabled?: boolean;
22
- }
23
- export interface CustomSelectOptionRendererProps<T> extends SelectOptionRendererProps<T> {
24
- option: T;
25
- onSelect: () => void;
26
- disabled?: boolean;
27
- }
28
- export type SelectVariant = "default" | "error" | "success";
29
- export type SelectControlsHandler = {
30
- open: () => void;
31
- close: () => void;
32
- toggle: () => void;
33
- };
34
- export type SelectControlsRef = React.RefObject<SelectControlsHandler | null>;
35
- export interface SelectProps<T = unknown> {
36
- label: string;
37
- value: (string | number)[];
38
- isLoading?: boolean;
39
- options: T[];
40
- onOptionClick?: (option: SelectOptionType, name?: string) => void;
41
- onChange?: (newValue: SelectOptionType[], name?: string) => void;
42
- multiple?: boolean;
43
- onClear?: () => void;
44
- onClose?: () => void;
45
- className?: string;
46
- id?: string;
47
- emptyMessage?: string;
48
- optionValue: OptionAccessor<T, string | number>;
49
- optionLabel: OptionAccessor<T, string>;
50
- renderOption?: ComponentType<CustomSelectOptionRendererProps<T>>;
51
- renderSelection?: ComponentType<CustomSelectionDisplayProps<T>>;
52
- placeholder?: string;
53
- containerClassName?: string;
54
- buttonClassName?: string;
55
- dropdownClassName?: string;
56
- displayMode?: SelectDisplayMode;
57
- onRemoveOption?: (option: T) => void;
58
- width?: string;
59
- height?: string;
60
- labelVariant?: LabelVariant;
61
- attachToParent?: boolean;
62
- name?: string;
63
- overflow?: 'wrap' | 'scroll';
64
- errorComponent?: React.ReactNode;
65
- helperComponent?: React.ReactNode;
66
- disabled?: boolean;
67
- variant?: ComponentVariant;
68
- controls?: SelectControlsRef;
69
- }
70
- declare const _default: <T>(props: SelectProps<T>) => JSX.Element;
71
- export default _default;