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/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: l,
7
- isHorizontal: s,
8
- currentStep: d
7
+ index: n,
8
+ isHorizontal: t,
9
+ currentStep: u,
10
+ size: s
9
11
  }) => {
10
- const i = l < d, n = l === d - 1;
11
- return /* @__PURE__ */ e.jsxs("div", { className: `relative ${s ? "w-20 h-1" : "w-0.5 h-8"}`, children: [
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: s ? 0 : 1,
24
- scaleY: s ? 1 : 0,
36
+ scaleX: t ? 0 : 1,
37
+ scaleY: t ? 1 : 0,
25
38
  opacity: 0
26
39
  },
27
40
  animate: {
28
- scaleX: i ? 1 : s ? 0 : 1,
29
- scaleY: i || s ? 1 : 0,
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: l * 0.1
48
+ delay: n * 0.1
36
49
  },
37
50
  style: {
38
- originX: s ? 0 : 0.5,
39
- originY: s ? 0.5 : 0
51
+ originX: t ? 0 : 0.5,
52
+ originY: t ? 0.5 : 0
40
53
  }
41
54
  }
42
55
  ),
43
- n && /* @__PURE__ */ e.jsx(
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: s ? 0 : 1,
49
- scaleY: s ? 1 : 0,
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: s ? 0 : 0.5,
64
- originY: s ? 0.5 : 0,
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
- }, I = ({
71
- steps: l,
72
- currentStep: s,
73
- orientation: d = "horizontal",
74
- variant: i = "default",
75
- size: n = "md",
76
- className: f = "",
77
- onStepClick: x,
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 = d === "horizontal", v = (t) => ({
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: "w-8 h-8 text-xs",
95
+ circle: "size-7 aspect-square text-xs",
87
96
  title: "text-sm",
88
- description: "text-xs",
89
- spacing: c ? "gap-4" : "gap-1"
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
- }, N = (t) => t < s ? "completed" : t === s ? "current" : "upcoming", g = (t) => {
104
- const a = `${m[n].circle} rounded-full flex items-center justify-center font-medium`;
105
- switch (t) {
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 `${a} bg-primary-default-default text-neutral-strong-default shadow-lg`;
122
+ return `${l} bg-primary-default-default text-neutral-strong-default shadow-lg`;
108
123
  case "current":
109
- return `${a} border-3 border-primary text-neutral-strong-default shadow-lg duration-900`;
124
+ return `${l} ring-[2px] ring-primary-default-default text-neutral-strong-default shadow-lg duration-900 `;
110
125
  default:
111
- return `${a} bg-neutral-medium-default text-neutral-medium-default`;
126
+ return `${l} bg-neutral-medium-default text-neutral-medium-default`;
112
127
  }
113
- }, h = (t) => {
114
- p && x && x(t);
115
- }, w = c ? `flex items-center ${f}` : `space-y-0 ${f}`;
116
- return /* @__PURE__ */ e.jsx("div", { className: w, children: l.map((t, a) => {
117
- const o = N(a), u = p && x;
118
- return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: c ? /* @__PURE__ */ e.jsx("div", { className: "flex", children: /* @__PURE__ */ e.jsxs("div", { className: "w-40 flex flex-col items-center relative", children: [
119
- /* @__PURE__ */ e.jsx(
120
- r.div,
121
- {
122
- className: `${g(o)} ${u ? "cursor-pointer" : ""} relative z-10`,
123
- initial: { scale: 0.8, opacity: 0 },
124
- animate: { scale: 1, opacity: 1 },
125
- transition: { duration: 0.3, delay: a * 0.1 },
126
- whileTap: u ? { scale: 0.95 } : {},
127
- onClick: () => h(a),
128
- children: i === "numbered" || !t.icon ? o === "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: a + 1 }) : t.icon
129
- }
130
- ),
131
- a < l.length - 1 && /* @__PURE__ */ e.jsx(
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: "absolute",
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: a,
161
+ index: l,
140
162
  isHorizontal: c,
141
- currentStep: s
163
+ currentStep: t,
164
+ size: i
142
165
  }
143
166
  )
144
167
  }
145
- ),
146
- i !== "minimal" && t.description && /* @__PURE__ */ e.jsx("p", { className: j(
147
- m[n].description,
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: `${g(o)} ${u ? "cursor-pointer" : ""}`,
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: a * 0.1 },
160
- whileTap: u ? { scale: 0.95 } : {},
161
- onClick: () => h(a),
162
- children: i === "numbered" || !t.icon ? o === "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: a + 1 }) : t.icon
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
- a < l.length - 1 && /* @__PURE__ */ e.jsx(
166
- b,
183
+ s !== "minimal" && s !== "numbered-minimal" && /* @__PURE__ */ e.jsx(
184
+ r.div,
167
185
  {
168
- index: a,
169
- isHorizontal: c,
170
- currentStep: s
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
- i !== "minimal" && /* @__PURE__ */ e.jsx(
175
- r.div,
199
+ l < n.length - 1 && /* @__PURE__ */ e.jsx("div", { className: "py-2", children: /* @__PURE__ */ e.jsx(
200
+ b,
176
201
  {
177
- className: `absolute -right-30 ml-4 top-3 gap-3 flex flex-col w-full ${m[n].spacing} flex h-full`,
178
- initial: { opacity: 0, x: -10 },
179
- animate: { opacity: 1, x: 0 },
180
- transition: { duration: 0.3, delay: a * 0.1 + 0.1 },
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
- ] }) }, t.id);
207
+ ) })
208
+ ] }) }, a.id);
185
209
  }) });
186
210
  };
187
211
  export {
188
- I as Steps
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.ReactNode;
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.ReactNode;
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 { useDevices } from '../hooks/useDevice';
1
+ export { useIsMobile } from '../hooks/useDevice';
@@ -1,7 +1 @@
1
- export declare const useDevices: () => {
2
- isMobile: boolean;
3
- isTablet: boolean;
4
- isDesktop: boolean;
5
- isTouchDevice: boolean;
6
- screenWidth: number;
7
- };
1
+ export declare const useIsMobile: () => boolean;
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 { useDevices } from './hooks/useDevice';
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';
@@ -0,0 +1,2 @@
1
+ declare const SelectPreview: () => import("react/jsx-runtime").JSX.Element;
2
+ export default SelectPreview;
@@ -0,0 +1,2 @@
1
+ declare const StepsPreview: () => import("react/jsx-runtime").JSX.Element;
2
+ export default StepsPreview;