prometeo-design-system 2.0.1 → 2.0.3
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/dist/DatePicker.es.js +445 -414
- package/dist/DrawerDesktop.d.ts +6 -1
- package/dist/DrawerDesktop.es.js +7 -7
- package/dist/Input.es.js +33 -30
- package/dist/components/DatePicker/DatePicker.d.ts +6 -6
- package/dist/components/Drawer/DrawerDesktopV2.d.ts +11 -0
- package/dist/components/Input/Input.d.ts +3 -1
- package/dist/pages/Drawer.d.ts +2 -0
- package/dist/prometeo-design-system.css +1 -1
- package/package.json +1 -1
package/dist/DrawerDesktop.d.ts
CHANGED
package/dist/DrawerDesktop.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
-
import { Icons as j } from "./Icons.es.js";
|
|
3
|
-
import { c as m } from "./cn-B6yFEsav.js";
|
|
4
2
|
import { c as d } from "./index-BOQuZ0gG.js";
|
|
5
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as j, useState as D, useRef as x, useCallback as s, useImperativeHandle as b } from "react";
|
|
6
4
|
import { Drawer as o } from "vaul";
|
|
5
|
+
import { Icons as v } from "./Icons.es.js";
|
|
6
|
+
import { c as m } from "./cn-B6yFEsav.js";
|
|
7
7
|
const C = d("text-sm cursor-pointer font-medium shadow-sm transition-all absolute z-30", {
|
|
8
8
|
variants: {
|
|
9
9
|
direction: {
|
|
@@ -18,8 +18,8 @@ const C = d("text-sm cursor-pointer font-medium shadow-sm transition-all absolut
|
|
|
18
18
|
right: "right-0"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
}), N =
|
|
22
|
-
const [l, n] =
|
|
21
|
+
}), N = j(({ children: t, direction: r, modal: a = !1, className: c, onClose: i, defaultOpen: w = !1 }, h) => {
|
|
22
|
+
const [l, n] = D(w), f = x(i);
|
|
23
23
|
f.current = i;
|
|
24
24
|
const u = s(() => {
|
|
25
25
|
n(!0);
|
|
@@ -28,7 +28,7 @@ const C = d("text-sm cursor-pointer font-medium shadow-sm transition-all absolut
|
|
|
28
28
|
}, []), g = s(() => {
|
|
29
29
|
n(!1), f.current?.();
|
|
30
30
|
}, []);
|
|
31
|
-
return
|
|
31
|
+
return b(h, () => ({
|
|
32
32
|
open: u,
|
|
33
33
|
close: p,
|
|
34
34
|
isOpen: l
|
|
@@ -40,7 +40,7 @@ const C = d("text-sm cursor-pointer font-medium shadow-sm transition-all absolut
|
|
|
40
40
|
className: m(O({ direction: r }), c),
|
|
41
41
|
style: { "--initial-transform": "calc(100% + 8px)" },
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */ e.jsx(o.Close, { className: m(C({ direction: r })), children: /* @__PURE__ */ e.jsx(
|
|
43
|
+
/* @__PURE__ */ e.jsx(o.Close, { className: m(C({ direction: r })), children: /* @__PURE__ */ e.jsx(v.Close, { size: 24, className: "text-neutral-default-default" }) }),
|
|
44
44
|
/* @__PURE__ */ e.jsx("div", { className: "bg-neutral-default-default w-full flex-1 overflow-y-auto min-h-0 border-l border-neutral-strong-default", children: t })
|
|
45
45
|
]
|
|
46
46
|
}
|
package/dist/Input.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
2
|
import { Icons as J } from "./Icons.es.js";
|
|
3
3
|
import { c as e } from "./cn-B6yFEsav.js";
|
|
4
|
-
import { memo as
|
|
5
|
-
import { useDebounce as
|
|
6
|
-
import
|
|
4
|
+
import { memo as xe, useState as v, useRef as K, useCallback as me, useEffect as L, useLayoutEffect as ge } from "react";
|
|
5
|
+
import { useDebounce as he } from "use-debounce";
|
|
6
|
+
import be from "./Spinner.es.js";
|
|
7
7
|
const C = {
|
|
8
8
|
default: {
|
|
9
9
|
container: "",
|
|
@@ -53,7 +53,7 @@ const C = {
|
|
|
53
53
|
"peer-focus:text-success-light"
|
|
54
54
|
)
|
|
55
55
|
}
|
|
56
|
-
},
|
|
56
|
+
}, we = ({
|
|
57
57
|
label: S,
|
|
58
58
|
icon: a,
|
|
59
59
|
iconPosition: g = "left",
|
|
@@ -79,9 +79,11 @@ const C = {
|
|
|
79
79
|
onKeyDown: Y,
|
|
80
80
|
onKeyUp: Z,
|
|
81
81
|
className: _,
|
|
82
|
-
isActive: i
|
|
82
|
+
isActive: i,
|
|
83
|
+
style: q,
|
|
84
|
+
readOnly: A = !1
|
|
83
85
|
}) => {
|
|
84
|
-
const [b, F] = v(u), [I] =
|
|
86
|
+
const [b, F] = v(u), [I] = he(b, c), [M, O] = v(i || !1), [B, ee] = v(!1), w = K(null), $ = K(null);
|
|
85
87
|
let p = Q;
|
|
86
88
|
o && (p = "customHeight");
|
|
87
89
|
const x = {
|
|
@@ -109,7 +111,7 @@ const C = {
|
|
|
109
111
|
label: "text-sm peer-focus:text-sm peer-placeholder-shown:text-xs ",
|
|
110
112
|
icon: "w-6 h-6 right-3"
|
|
111
113
|
}
|
|
112
|
-
}, T =
|
|
114
|
+
}, T = me(E, [E]);
|
|
113
115
|
L(() => {
|
|
114
116
|
c > 0 && I !== u && T(I);
|
|
115
117
|
}, [I, c, T, u]), L(() => {
|
|
@@ -117,19 +119,19 @@ const C = {
|
|
|
117
119
|
}, [u]), L(() => {
|
|
118
120
|
i && $.current?.focus();
|
|
119
121
|
}, [i]);
|
|
120
|
-
const
|
|
122
|
+
const te = (s) => {
|
|
121
123
|
O(!0), W?.(s);
|
|
122
|
-
},
|
|
124
|
+
}, re = (s) => {
|
|
123
125
|
i === void 0 && (O(!1), X?.(s));
|
|
124
|
-
},
|
|
126
|
+
}, se = (s) => {
|
|
125
127
|
const m = s.target.value, H = s.target.name, n = b;
|
|
126
128
|
F(m), n.length > 0 && m.length === 0 && V?.(), (!c || c === 0) && E(m, H);
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
+
}, oe = () => {
|
|
130
|
+
ee(!B);
|
|
129
131
|
}, N = {};
|
|
130
132
|
h && h !== "100%" && (N.width = h), o && (N.height = o);
|
|
131
|
-
const
|
|
132
|
-
return
|
|
133
|
+
const le = b.length > 0, G = f === "error" && P, ne = !G && R, ae = r === "password", ue = () => l === "static" || i || M || le ? "-top-2 left-2 scale-90" : a ? `top-1/2 -translate-y-1/2 ${g === "left" ? "ml-6" : "mr-6"} scale-100 ` : "top-1/2 -translate-y-1/2 scale-100", ce = () => l === "static" ? o ? "text-sm" : "text-xs" : o ? x.customHeight.label : x[p].label, fe = () => o ? { height: o } : {}, de = () => l === "default" ? S : U || S || "", ie = () => ae ? a ? g === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : a ? g === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", pe = l === "default" && "transition-all duration-200 ease-in-out";
|
|
134
|
+
return ge(() => {
|
|
133
135
|
if (w.current) {
|
|
134
136
|
const m = ((H) => {
|
|
135
137
|
let n = H;
|
|
@@ -156,7 +158,7 @@ const C = {
|
|
|
156
158
|
l === "static" && "mt-2",
|
|
157
159
|
_
|
|
158
160
|
),
|
|
159
|
-
style: N,
|
|
161
|
+
style: { ...q, ...N },
|
|
160
162
|
children: [
|
|
161
163
|
/* @__PURE__ */ t.jsx(
|
|
162
164
|
"input",
|
|
@@ -165,7 +167,7 @@ const C = {
|
|
|
165
167
|
name: k,
|
|
166
168
|
ref: $,
|
|
167
169
|
value: b,
|
|
168
|
-
placeholder:
|
|
170
|
+
placeholder: de(),
|
|
169
171
|
type: r === "password" && B ? "text" : r,
|
|
170
172
|
className: e(
|
|
171
173
|
"peer w-full border-1 rounded-lg bg-transparent appearance-none transition-all duration-200 ease-in-out",
|
|
@@ -177,17 +179,18 @@ const C = {
|
|
|
177
179
|
a && "pr-10",
|
|
178
180
|
z && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
|
|
179
181
|
C[f].container,
|
|
180
|
-
|
|
182
|
+
ie()
|
|
181
183
|
),
|
|
182
|
-
style:
|
|
183
|
-
onChange:
|
|
184
|
-
onFocus:
|
|
185
|
-
onBlur:
|
|
184
|
+
style: fe(),
|
|
185
|
+
onChange: se,
|
|
186
|
+
onFocus: te,
|
|
187
|
+
onBlur: re,
|
|
186
188
|
disabled: z,
|
|
187
189
|
required: D,
|
|
188
190
|
onEmptied: V,
|
|
189
191
|
onKeyDown: Y,
|
|
190
|
-
onKeyUp: Z
|
|
192
|
+
onKeyUp: Z,
|
|
193
|
+
readOnly: A
|
|
191
194
|
}
|
|
192
195
|
),
|
|
193
196
|
/* @__PURE__ */ t.jsx(
|
|
@@ -197,10 +200,10 @@ const C = {
|
|
|
197
200
|
htmlFor: k,
|
|
198
201
|
className: e(
|
|
199
202
|
"absolute left-3 pointer-events-none px-1 z-10",
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
pe,
|
|
204
|
+
ce(),
|
|
202
205
|
C[f].label,
|
|
203
|
-
|
|
206
|
+
ue(),
|
|
204
207
|
D && "after:content-['*'] after:text-error-default after:ml-1",
|
|
205
208
|
z && "text-neutral-medium-disabled prometeo-fonts-label-large"
|
|
206
209
|
),
|
|
@@ -217,18 +220,18 @@ const C = {
|
|
|
217
220
|
r === "password" && !d ? "cursor-pointer" : "pointer-events-none",
|
|
218
221
|
g === "right" ? "right-3" : "left-3"
|
|
219
222
|
),
|
|
220
|
-
onClick: r === "password" && !d ?
|
|
223
|
+
onClick: r === "password" && !d ? oe : void 0,
|
|
221
224
|
onMouseDown: (s) => r === "password" && !d && s.preventDefault(),
|
|
222
|
-
children: /* @__PURE__ */ t.jsx("div", { children: d && r !== "password" ? /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
225
|
+
children: /* @__PURE__ */ t.jsx("div", { children: d && r !== "password" ? /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(be, { size: 24, color: "#7c86ff", loading: !0, variant: "clip" }) }) : r === "password" ? B ? /* @__PURE__ */ t.jsx(J.EyeVisibility, { size: 24, className: "" }) : /* @__PURE__ */ t.jsx(J.EyeVisibilityOff, { size: 24, className: "" }) : a })
|
|
223
226
|
}
|
|
224
227
|
)
|
|
225
228
|
]
|
|
226
229
|
}
|
|
227
230
|
),
|
|
228
|
-
|
|
231
|
+
ne && R,
|
|
229
232
|
G && P
|
|
230
233
|
] });
|
|
231
|
-
},
|
|
234
|
+
}, Ie = xe(we);
|
|
232
235
|
export {
|
|
233
|
-
|
|
236
|
+
Ie as default
|
|
234
237
|
};
|
|
@@ -25,21 +25,21 @@ interface DatePickerBaseProps {
|
|
|
25
25
|
}
|
|
26
26
|
interface DatePickerSingleProps extends DatePickerBaseProps {
|
|
27
27
|
mode?: "single";
|
|
28
|
-
selected
|
|
29
|
-
onSelect
|
|
28
|
+
selected: Date | undefined;
|
|
29
|
+
onSelect: (date: Date) => void;
|
|
30
30
|
}
|
|
31
31
|
interface DatePickerRangeProps extends DatePickerBaseProps {
|
|
32
32
|
mode: "range";
|
|
33
|
-
selected
|
|
34
|
-
onSelect
|
|
33
|
+
selected: DateRange | undefined;
|
|
34
|
+
onSelect: (range: DateRange) => void;
|
|
35
35
|
min?: number;
|
|
36
36
|
max?: number;
|
|
37
37
|
excludeDisabled?: boolean;
|
|
38
38
|
}
|
|
39
39
|
interface DatePickerMultipleProps extends DatePickerBaseProps {
|
|
40
40
|
mode: "multiple";
|
|
41
|
-
selected
|
|
42
|
-
onSelect
|
|
41
|
+
selected: Date[] | undefined;
|
|
42
|
+
onSelect: (dates: Date[]) => void;
|
|
43
43
|
min?: number;
|
|
44
44
|
max?: number;
|
|
45
45
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DrawerDesktopProps {
|
|
2
|
+
children?: React.ReactNode;
|
|
3
|
+
direction?: 'left' | 'right';
|
|
4
|
+
modal?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
attachToParent?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const DrawerDesktopV2: (props: DrawerDesktopProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default DrawerDesktopV2;
|
|
@@ -29,6 +29,8 @@ export interface InputProps {
|
|
|
29
29
|
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
30
30
|
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
31
31
|
isActive?: boolean;
|
|
32
|
+
style?: React.CSSProperties;
|
|
33
|
+
readOnly?: boolean;
|
|
32
34
|
}
|
|
33
|
-
declare const _default: import('react').MemoExoticComponent<({ label, icon, iconPosition, onChange, value, debounceMs, name, width, height, variant, labelVariant, size, disabled, type, isFetching, errorComponent, helperComponent, placeholder, required, onFocus, onBlur, onEmptied, onKeyDown, onKeyUp, className, isActive }: InputProps) => import("react/jsx-runtime").JSX.Element>;
|
|
35
|
+
declare const _default: import('react').MemoExoticComponent<({ label, icon, iconPosition, onChange, value, debounceMs, name, width, height, variant, labelVariant, size, disabled, type, isFetching, errorComponent, helperComponent, placeholder, required, onFocus, onBlur, onEmptied, onKeyDown, onKeyUp, className, isActive, style, readOnly }: InputProps) => import("react/jsx-runtime").JSX.Element>;
|
|
34
36
|
export default _default;
|