prometeo-design-system 1.7.6 → 1.8.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.
- package/dist/OtpInput.es.js +231 -179
- package/dist/Steps.es.js +118 -94
- package/dist/components/OtpInput/OtpInput.d.ts +14 -2
- package/dist/components/Steps/Steps.d.ts +4 -2
- package/dist/exports/useDevice.d.ts +1 -1
- package/dist/hooks/useDevice.d.ts +1 -7
- package/dist/index.d.ts +1 -1
- package/dist/preview/SelectPreview.d.ts +2 -0
- package/dist/preview/StepsPreview.d.ts +2 -0
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +2 -2
- package/dist/useDevice.es.js +10 -20
- package/package.json +245 -225
package/dist/Steps.es.js
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
2
|
import { c as j } from "./cn-B6yFEsav.js";
|
|
3
3
|
import { motion as r } from "framer-motion";
|
|
4
|
+
import N from "react";
|
|
4
5
|
import { Icons as y } from "./Icons.es.js";
|
|
5
6
|
const b = ({
|
|
6
|
-
index:
|
|
7
|
-
isHorizontal:
|
|
8
|
-
currentStep:
|
|
7
|
+
index: n,
|
|
8
|
+
isHorizontal: t,
|
|
9
|
+
currentStep: u,
|
|
10
|
+
size: s
|
|
9
11
|
}) => {
|
|
10
|
-
const i =
|
|
11
|
-
|
|
12
|
+
const i = n < u, x = n === u - 1, o = {
|
|
13
|
+
horizontal: {
|
|
14
|
+
sm: "w-[44px] h-[2px]",
|
|
15
|
+
md: "w-20 h-1",
|
|
16
|
+
lg: "w-20 h-1"
|
|
17
|
+
},
|
|
18
|
+
vertical: {
|
|
19
|
+
sm: "w-[2px] h-[44px]",
|
|
20
|
+
md: "w-1 h-20",
|
|
21
|
+
lg: "w-1 h-20"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `relative ${t ? o.horizontal[s] : o.vertical[s]}`, children: [
|
|
12
25
|
/* @__PURE__ */ e.jsx(
|
|
13
26
|
"div",
|
|
14
27
|
{
|
|
@@ -20,33 +33,33 @@ const b = ({
|
|
|
20
33
|
{
|
|
21
34
|
className: "absolute inset-0 rounded-full bg-primary-default-default",
|
|
22
35
|
initial: {
|
|
23
|
-
scaleX:
|
|
24
|
-
scaleY:
|
|
36
|
+
scaleX: t ? 0 : 1,
|
|
37
|
+
scaleY: t ? 1 : 0,
|
|
25
38
|
opacity: 0
|
|
26
39
|
},
|
|
27
40
|
animate: {
|
|
28
|
-
scaleX: i ? 1 :
|
|
29
|
-
scaleY: i ||
|
|
41
|
+
scaleX: i ? 1 : t ? 0 : 1,
|
|
42
|
+
scaleY: i || t ? 1 : 0,
|
|
30
43
|
opacity: i ? 1 : 0
|
|
31
44
|
},
|
|
32
45
|
transition: {
|
|
33
46
|
duration: 0.2,
|
|
34
47
|
ease: "easeInOut",
|
|
35
|
-
delay:
|
|
48
|
+
delay: n * 0.1
|
|
36
49
|
},
|
|
37
50
|
style: {
|
|
38
|
-
originX:
|
|
39
|
-
originY:
|
|
51
|
+
originX: t ? 0 : 0.5,
|
|
52
|
+
originY: t ? 0.5 : 0
|
|
40
53
|
}
|
|
41
54
|
}
|
|
42
55
|
),
|
|
43
|
-
|
|
56
|
+
x && /* @__PURE__ */ e.jsx(
|
|
44
57
|
r.div,
|
|
45
58
|
{
|
|
46
59
|
className: "absolute inset-0 rounded-full bg-primary-default-default",
|
|
47
60
|
initial: {
|
|
48
|
-
scaleX:
|
|
49
|
-
scaleY:
|
|
61
|
+
scaleX: t ? 0 : 1,
|
|
62
|
+
scaleY: t ? 1 : 0,
|
|
50
63
|
opacity: 0
|
|
51
64
|
},
|
|
52
65
|
animate: {
|
|
@@ -60,130 +73,141 @@ const b = ({
|
|
|
60
73
|
ease: "easeInOut"
|
|
61
74
|
},
|
|
62
75
|
style: {
|
|
63
|
-
originX:
|
|
64
|
-
originY:
|
|
76
|
+
originX: t ? 0 : 0.5,
|
|
77
|
+
originY: t ? 0.5 : 0,
|
|
65
78
|
filter: "blur(4px)"
|
|
66
79
|
}
|
|
67
80
|
}
|
|
68
81
|
)
|
|
69
82
|
] });
|
|
70
|
-
},
|
|
71
|
-
steps:
|
|
72
|
-
currentStep:
|
|
73
|
-
orientation:
|
|
74
|
-
variant:
|
|
75
|
-
size:
|
|
76
|
-
className:
|
|
77
|
-
onStepClick:
|
|
83
|
+
}, k = ({
|
|
84
|
+
steps: n,
|
|
85
|
+
currentStep: t,
|
|
86
|
+
orientation: u = "horizontal",
|
|
87
|
+
variant: s = "default",
|
|
88
|
+
size: i = "md",
|
|
89
|
+
className: x = "",
|
|
90
|
+
onStepClick: o,
|
|
78
91
|
allowClickableSteps: p = !1
|
|
79
92
|
}) => {
|
|
80
|
-
const c =
|
|
81
|
-
sm: { right: "-40px", top: "16px" },
|
|
82
|
-
md: { right: "-40px", top: "20px" },
|
|
83
|
-
lg: { right: "-40px", top: "24px" }
|
|
84
|
-
})[t], m = {
|
|
93
|
+
const c = u === "horizontal", m = {
|
|
85
94
|
sm: {
|
|
86
|
-
circle: "
|
|
95
|
+
circle: "size-7 aspect-square text-xs",
|
|
87
96
|
title: "text-sm",
|
|
88
|
-
description: "text-
|
|
89
|
-
spacing: c ? "gap-
|
|
97
|
+
description: "text-[11px] w-16",
|
|
98
|
+
spacing: c ? "gap-2" : "gap-1",
|
|
99
|
+
connectorContainer: "px-2",
|
|
100
|
+
iconSize: 20
|
|
90
101
|
},
|
|
91
102
|
md: {
|
|
92
103
|
circle: "w-10 h-10 text-sm",
|
|
93
104
|
title: "text-base",
|
|
94
|
-
description: "text-sm",
|
|
95
|
-
spacing: c ? "gap-3" : "gap-2"
|
|
105
|
+
description: "text-sm w-20",
|
|
106
|
+
spacing: c ? "gap-3" : "gap-2",
|
|
107
|
+
connectorContainer: "px-2",
|
|
108
|
+
iconSize: 24
|
|
96
109
|
},
|
|
97
110
|
lg: {
|
|
98
111
|
circle: "w-12 h-12 text-base",
|
|
99
112
|
title: "text-lg",
|
|
100
|
-
description: "text-base",
|
|
101
|
-
spacing: c ? "gap-4" : "gap-3"
|
|
113
|
+
description: "text-base w-28",
|
|
114
|
+
spacing: c ? "gap-4" : "gap-3",
|
|
115
|
+
connectorContainer: "px-2",
|
|
116
|
+
iconSize: 28
|
|
102
117
|
}
|
|
103
|
-
},
|
|
104
|
-
const
|
|
105
|
-
switch (
|
|
118
|
+
}, w = (a) => a < t ? "completed" : a === t ? "current" : "upcoming", h = (a) => {
|
|
119
|
+
const l = `${m[i].circle} rounded-full flex items-center justify-center font-medium`;
|
|
120
|
+
switch (a) {
|
|
106
121
|
case "completed":
|
|
107
|
-
return `${
|
|
122
|
+
return `${l} bg-primary-default-default text-neutral-strong-default shadow-lg`;
|
|
108
123
|
case "current":
|
|
109
|
-
return `${
|
|
124
|
+
return `${l} ring-[2px] ring-primary-default-default text-neutral-strong-default shadow-lg duration-900 `;
|
|
110
125
|
default:
|
|
111
|
-
return `${
|
|
126
|
+
return `${l} bg-neutral-medium-default text-neutral-medium-default`;
|
|
112
127
|
}
|
|
113
|
-
},
|
|
114
|
-
p &&
|
|
115
|
-
},
|
|
116
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
117
|
-
const
|
|
118
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: c ? /* @__PURE__ */ e.
|
|
119
|
-
/* @__PURE__ */ e.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
}, g = (a) => {
|
|
129
|
+
p && o && o(a);
|
|
130
|
+
}, v = c ? `flex items-center w-full justify-center ${x}` : `space-y-0 ${x}`;
|
|
131
|
+
return /* @__PURE__ */ e.jsx("div", { className: v, children: n.map((a, l) => {
|
|
132
|
+
const d = w(l), f = p && o;
|
|
133
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex", children: [
|
|
134
|
+
/* @__PURE__ */ e.jsxs("div", { className: "w-max flex flex-col items-center relative", children: [
|
|
135
|
+
/* @__PURE__ */ e.jsx(
|
|
136
|
+
r.div,
|
|
137
|
+
{
|
|
138
|
+
className: `${h(d)} ${f ? "cursor-pointer" : ""} relative z-10`,
|
|
139
|
+
initial: { scale: 0.8, opacity: 0 },
|
|
140
|
+
animate: { scale: 1, opacity: 1 },
|
|
141
|
+
transition: { duration: 0.3, delay: l * 0.3 },
|
|
142
|
+
whileTap: f ? { scale: 0.95 } : {},
|
|
143
|
+
onClick: () => g(l),
|
|
144
|
+
children: s === "numbered" || s === "numbered-minimal" || !a.icon ? d === "completed" ? /* @__PURE__ */ e.jsx(r.div, { initial: { scale: 0 }, animate: { scale: 1 }, transition: { duration: 0.2 }, children: /* @__PURE__ */ e.jsx(y.Check, { size: 24, className: "text-neutral-strong-default" }) }) : /* @__PURE__ */ e.jsx("span", { children: l + 1 }) : N.cloneElement(a.icon, { size: m[i].iconSize })
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
s !== "minimal" && s !== "numbered-minimal" && a.description && /* @__PURE__ */ e.jsx("p", { className: j(
|
|
148
|
+
"absolute text-center w-28 -bottom-2 translate-y-full",
|
|
149
|
+
m[i].description,
|
|
150
|
+
"text-gray-400 mt-2 text-center",
|
|
151
|
+
d === "current" ? "text-neutral-strong-default font-semibold " : "text-neutral-medium-default"
|
|
152
|
+
), children: a.description })
|
|
153
|
+
] }),
|
|
154
|
+
l < n.length - 1 && /* @__PURE__ */ e.jsx(
|
|
132
155
|
"div",
|
|
133
156
|
{
|
|
134
|
-
className:
|
|
135
|
-
style: v(n),
|
|
157
|
+
className: `flex items-center w-max ${m[i].connectorContainer}`,
|
|
136
158
|
children: /* @__PURE__ */ e.jsx(
|
|
137
159
|
b,
|
|
138
160
|
{
|
|
139
|
-
index:
|
|
161
|
+
index: l,
|
|
140
162
|
isHorizontal: c,
|
|
141
|
-
currentStep:
|
|
163
|
+
currentStep: t,
|
|
164
|
+
size: i
|
|
142
165
|
}
|
|
143
166
|
)
|
|
144
167
|
}
|
|
145
|
-
)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"text-gray-400 mt-2 text-center max-w-full",
|
|
149
|
-
o === "current" ? "text-neutral-strong-default font-semibold text-sm" : "text-neutral-medium-default"
|
|
150
|
-
), children: t.description })
|
|
151
|
-
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-36", children: [
|
|
152
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center w-full", children: [
|
|
168
|
+
)
|
|
169
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col items-center w-max", children: [
|
|
170
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center w-full relative", children: [
|
|
153
171
|
/* @__PURE__ */ e.jsx(
|
|
154
172
|
r.div,
|
|
155
173
|
{
|
|
156
|
-
className: `${
|
|
174
|
+
className: `${h(d)} ${f ? "cursor-pointer" : ""}`,
|
|
157
175
|
initial: { scale: 0.8, opacity: 0 },
|
|
158
176
|
animate: { scale: 1, opacity: 1 },
|
|
159
|
-
transition: { duration: 0.3, delay:
|
|
160
|
-
whileTap:
|
|
161
|
-
onClick: () =>
|
|
162
|
-
children:
|
|
177
|
+
transition: { duration: 0.3, delay: l * 0.1 },
|
|
178
|
+
whileTap: f ? { scale: 0.95 } : {},
|
|
179
|
+
onClick: () => g(l),
|
|
180
|
+
children: s === "numbered" || s === "numbered-minimal" || !a.icon ? d === "completed" ? /* @__PURE__ */ e.jsx(r.div, { initial: { scale: 0 }, animate: { scale: 1 }, transition: { duration: 0.2 }, children: /* @__PURE__ */ e.jsx(y.Check, { size: 24, className: "text-neutral-strong-default" }) }) : /* @__PURE__ */ e.jsx("span", { children: l + 1 }) : a.icon
|
|
163
181
|
}
|
|
164
182
|
),
|
|
165
|
-
|
|
166
|
-
|
|
183
|
+
s !== "minimal" && s !== "numbered-minimal" && /* @__PURE__ */ e.jsx(
|
|
184
|
+
r.div,
|
|
167
185
|
{
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
186
|
+
className: `absolute -right-4 top-1/2 -translate-y-1/2 translate-x-full ml-4 gap-3 flex flex-col w-full ${m[i].spacing} flex h-full`,
|
|
187
|
+
initial: { opacity: 0, x: -10 },
|
|
188
|
+
animate: { opacity: 1, x: 0 },
|
|
189
|
+
transition: { duration: 0.3, delay: l * 0.1 + 0.1 },
|
|
190
|
+
children: a.description && /* @__PURE__ */ e.jsx("p", { className: j(
|
|
191
|
+
"h-full text-start flex items-center justify-start ",
|
|
192
|
+
m[i].description,
|
|
193
|
+
"text-gray-400",
|
|
194
|
+
d === "current" ? "text-neutral-strong-default font-semibold " : "text-neutral-medium-default"
|
|
195
|
+
), children: a.description })
|
|
171
196
|
}
|
|
172
197
|
)
|
|
173
198
|
] }),
|
|
174
|
-
|
|
175
|
-
|
|
199
|
+
l < n.length - 1 && /* @__PURE__ */ e.jsx("div", { className: "py-2", children: /* @__PURE__ */ e.jsx(
|
|
200
|
+
b,
|
|
176
201
|
{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
children: t.description && /* @__PURE__ */ e.jsx("p", { className: j(m[n].description, "text-gray-400", o === "current" ? "text-neutral-strong-default font-semibold text-sm" : "text-neutral-medium-default"), children: t.description })
|
|
202
|
+
index: l,
|
|
203
|
+
isHorizontal: c,
|
|
204
|
+
currentStep: t,
|
|
205
|
+
size: i
|
|
182
206
|
}
|
|
183
|
-
)
|
|
184
|
-
] }) },
|
|
207
|
+
) })
|
|
208
|
+
] }) }, a.id);
|
|
185
209
|
}) });
|
|
186
210
|
};
|
|
187
211
|
export {
|
|
188
|
-
|
|
212
|
+
k as Steps
|
|
189
213
|
};
|
|
@@ -1,15 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
export interface OtpInputProps {
|
|
2
3
|
value?: string;
|
|
3
4
|
onChange?: (value: string) => void;
|
|
4
5
|
onComplete?: (value: string) => void;
|
|
6
|
+
onBlur?: () => void;
|
|
5
7
|
maxLength?: number;
|
|
6
8
|
placeholder?: string;
|
|
7
9
|
disabled?: boolean;
|
|
8
10
|
className?: string;
|
|
9
11
|
autoFocus?: boolean;
|
|
10
12
|
pasteTransformer?: (pasted: string) => string;
|
|
11
|
-
errorComponent?: React.
|
|
13
|
+
errorComponent?: React.ReactElement<{
|
|
14
|
+
className?: string;
|
|
15
|
+
}> | string;
|
|
12
16
|
hasError?: boolean;
|
|
17
|
+
helperComponent?: React.ReactElement<{
|
|
18
|
+
className?: string;
|
|
19
|
+
}> | string;
|
|
20
|
+
helperAlignment?: 'left' | 'center' | 'right';
|
|
21
|
+
slotClassName?: string;
|
|
22
|
+
hideSlotsMiddleSeparator?: boolean;
|
|
23
|
+
name?: string;
|
|
24
|
+
variant?: 'default' | 'error' | 'success';
|
|
13
25
|
}
|
|
14
|
-
declare const OtpInputComponent: ({ value, onChange, onComplete, maxLength, placeholder, disabled, className, autoFocus, pasteTransformer, errorComponent, hasError, }: OtpInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare const OtpInputComponent: ({ value, name, onChange, onComplete, onBlur, maxLength, placeholder, disabled, className, autoFocus, pasteTransformer, errorComponent, hasError, helperComponent, helperAlignment, slotClassName, variant, hideSlotsMiddleSeparator }: OtpInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
27
|
export default OtpInputComponent;
|
|
@@ -3,13 +3,15 @@ export interface Step {
|
|
|
3
3
|
id: string | number;
|
|
4
4
|
title: string;
|
|
5
5
|
description?: string;
|
|
6
|
-
icon?: React.
|
|
6
|
+
icon?: React.ReactElement<{
|
|
7
|
+
size: number;
|
|
8
|
+
}>;
|
|
7
9
|
}
|
|
8
10
|
export interface StepsProps {
|
|
9
11
|
steps: Step[];
|
|
10
12
|
currentStep: number;
|
|
11
13
|
orientation?: "horizontal" | "vertical";
|
|
12
|
-
variant?: "default" | "minimal" | "numbered";
|
|
14
|
+
variant?: "default" | "minimal" | "numbered" | "numbered-minimal";
|
|
13
15
|
size?: "sm" | "md" | "lg";
|
|
14
16
|
className?: string;
|
|
15
17
|
onStepClick?: (stepIndex: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { useIsMobile } from '../hooks/useDevice';
|
package/dist/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export { SidebarProvider as SidebarRefProvider, useSidebarContext } from './comp
|
|
|
41
41
|
export { SidebarProvider } from './components/Sidebar/hooks/SidebarProvider';
|
|
42
42
|
export { useSidebar } from './components/Sidebar/hooks/useSidebarHook';
|
|
43
43
|
export { useClickOutside } from './hooks/useClickOutside';
|
|
44
|
-
export {
|
|
44
|
+
export { useIsMobile } from './hooks/useDevice';
|
|
45
45
|
export type { ButtonProps } from './components/Button/Button';
|
|
46
46
|
export type { ISessionLocalStorage } from './components/CardProfile/CardProfile';
|
|
47
47
|
export type { CheckBoxProps } from './components/CheckBox/CheckBox';
|