prometeo-design-system 2.7.1 → 2.7.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.
@@ -1,30 +1,31 @@
1
1
  import { j as l } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as h } from "./cn-B6yFEsav.js";
3
- import { c as k, B as E } from "./Button-CvBWH1HX.js";
4
- import { createPortal as I } from "react-dom";
5
- import { Icons as V } from "./Icons.es.js";
6
- import { forwardRef as B, useRef as u, useState as N, useEffect as d, useCallback as f, useImperativeHandle as P } from "react";
7
- const L = B((t, s) => {
8
- const o = u(null), [e, a] = N(t.defaultOpen || !1), [r, y] = N(null), b = u(t.onClose), c = u(r), {
3
+ import { c as k } from "./index-BOQuZ0gG.js";
4
+ import { createPortal as E } from "react-dom";
5
+ import { Icons as I } from "./Icons.es.js";
6
+ import { forwardRef as V, useRef as u, useState as N, useEffect as d, useCallback as f, useImperativeHandle as P } from "react";
7
+ import B from "./Button.es.js";
8
+ const L = V((t, s) => {
9
+ const n = u(null), [e, a] = N(t.defaultOpen || !1), [r, y] = N(null), b = u(t.onClose), c = u(r), {
9
10
  modal: i = !1,
10
11
  children: m,
11
12
  className: w,
12
13
  direction: C = "left",
13
14
  attachToParent: x = !1,
14
- closeOnOverlayClick: n = !1,
15
+ closeOnOverlayClick: o = !1,
15
16
  hideCloseButton: T = !1
16
- } = t, g = u(n), O = u(e);
17
+ } = t, g = u(o), O = u(e);
17
18
  c.current = r, d(() => {
18
19
  O.current = e;
19
20
  }, [e]), d(() => {
20
21
  c.current = r;
21
22
  }, [r]), d(() => {
22
- g.current = n;
23
- }, [n]);
23
+ g.current = o;
24
+ }, [o]);
24
25
  const R = (p) => {
25
- if (!o.current)
26
+ if (!n.current)
26
27
  return;
27
- const z = o.current;
28
+ const z = n.current;
28
29
  z && !z.contains(p.target) && g.current && O.current && v();
29
30
  };
30
31
  d(() => {
@@ -36,7 +37,7 @@ const L = B((t, s) => {
36
37
  return () => {
37
38
  clearTimeout(p), document.removeEventListener("click", R);
38
39
  };
39
- }, [n, e, i]), d(() => {
40
+ }, [o, e, i]), d(() => {
40
41
  b.current = t.onClose;
41
42
  }, [t.onClose]);
42
43
  const j = f((p) => {
@@ -58,25 +59,25 @@ const L = B((t, s) => {
58
59
  Y,
59
60
  {
60
61
  context: r,
61
- ref: o,
62
+ ref: n,
62
63
  isOpen: e,
63
64
  close: v,
64
65
  direction: C,
65
66
  modal: i,
66
67
  className: w,
67
68
  attachToParent: x,
68
- closeOnOverlayClick: n,
69
+ closeOnOverlayClick: o,
69
70
  hideCloseButton: T,
70
71
  children: typeof m == "function" ? m(r) : m
71
72
  }
72
73
  );
73
- return x ? D : I(D, document.body);
74
+ return x ? D : E(D, document.body);
74
75
  });
75
76
  L.displayName = "DrawerDesktopV2";
76
77
  const Y = ({
77
78
  ref: t,
78
79
  children: s,
79
- direction: o = "left",
80
+ direction: n = "left",
80
81
  isOpen: e,
81
82
  close: a,
82
83
  modal: r = !1,
@@ -88,9 +89,9 @@ const Y = ({
88
89
  }) => {
89
90
  d(() => {
90
91
  if (e && r) {
91
- const n = window.scrollY;
92
- return document.body.style.position = "fixed", document.body.style.top = `-${n}px`, document.body.style.width = "100%", () => {
93
- document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, n);
92
+ const o = window.scrollY;
93
+ return document.body.style.position = "fixed", document.body.style.top = `-${o}px`, document.body.style.width = "100%", () => {
94
+ document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, o);
94
95
  };
95
96
  }
96
97
  }, [e, r]);
@@ -128,8 +129,8 @@ const Y = ({
128
129
  "div",
129
130
  {
130
131
  className: h(C({ isOpen: e })),
131
- onClick: (n) => {
132
- n.preventDefault(), n.stopPropagation(), c && a();
132
+ onClick: (o) => {
133
+ o.preventDefault(), o.stopPropagation(), c && a();
133
134
  },
134
135
  "aria-hidden": "true"
135
136
  }
@@ -141,7 +142,7 @@ const Y = ({
141
142
  className: h(
142
143
  "bg-neutral-strong-default h-full top-0 z-60 w-max overflow-y-auto",
143
144
  b ? "absolute" : "fixed",
144
- w({ isOpen: e, direction: o }),
145
+ w({ isOpen: e, direction: n }),
145
146
  !i && "p-4 pt-10",
146
147
  y
147
148
  ),
@@ -149,9 +150,9 @@ const Y = ({
149
150
  "aria-modal": r,
150
151
  children: [
151
152
  !i && /* @__PURE__ */ l.jsx(
152
- E,
153
+ B,
153
154
  {
154
- icon: /* @__PURE__ */ l.jsx(V.Close, { size: 24 }),
155
+ icon: /* @__PURE__ */ l.jsx(I.Close, { size: 24 }),
155
156
  animate: !1,
156
157
  type: "button",
157
158
  size: "small",
@@ -161,7 +162,7 @@ const Y = ({
161
162
  color: "secondary",
162
163
  className: h(
163
164
  "absolute top-0 z-50",
164
- x({ direction: o })
165
+ x({ direction: n })
165
166
  ),
166
167
  "aria-label": "Close drawer"
167
168
  }
@@ -171,21 +172,21 @@ const Y = ({
171
172
  }
172
173
  )
173
174
  ] });
174
- }, G = () => {
175
+ }, J = () => {
175
176
  const t = u(null), s = f((r) => {
176
177
  t.current?.open(r);
177
- }, []), o = f(() => {
178
+ }, []), n = f(() => {
178
179
  t.current?.close();
179
180
  }, []), e = f(() => t.current?.isOpen ?? !1, []), a = f(() => t.current?.getContext() ?? null, []);
180
181
  return {
181
182
  isOpen: e,
182
183
  open: s,
183
- close: o,
184
+ close: n,
184
185
  drawerRef: t,
185
186
  getContext: a
186
187
  };
187
188
  };
188
189
  export {
189
190
  L as default,
190
- G as useDrawerDesktop
191
+ J as useDrawerDesktop
191
192
  };
@@ -1,22 +1,23 @@
1
- import { j as i } from "./jsx-runtime-DKDX3adD.js";
2
- import s, { memo as c } from "react";
3
- import { c as n } from "./cn-B6yFEsav.js";
4
- import { Icons as f } from "./Icons.es.js";
1
+ import { j as c } from "./jsx-runtime-DKDX3adD.js";
2
+ import u, { memo as n } from "react";
3
+ import { c as f } from "./cn-B6yFEsav.js";
4
+ import { Icons as v } from "./Icons.es.js";
5
5
  import { createPortal as m } from "react-dom";
6
- const v = {
6
+ import { c as b } from "./index-BOQuZ0gG.js";
7
+ const h = {
7
8
  right: 24,
8
9
  bottom: 64,
9
10
  left: "auto",
10
11
  top: "auto"
11
- }, b = {
12
- filled: {
12
+ }, r = {
13
+ fill: {
13
14
  primary: "bg-primary-default-default hover:bg-primary-default-hover active:bg-primary-default-pressed",
14
15
  secondary: "bg-neutral-medium-default hover:bg-neutral-medium-hover active:bg-neutral-medium-pressed",
15
16
  success: "bg-success-default-default hover:bg-success-default-hover active:bg-success-default-pressed",
16
17
  error: "bg-error-default-default hover:bg-error-default-hover active:bg-error-default-pressed",
17
18
  warning: "bg-warning-default-default hover:bg-warning-default-hover active:bg-warning-default-pressed"
18
19
  },
19
- outlined: {
20
+ outline: {
20
21
  primary: "border border-primary-default-default hover:border-primary-default-hover active:border-primary-default-pressed text-primary-default-default hover:text-primary-default-hover active:text-primary-default-pressed",
21
22
  secondary: "border border-neutral-medium-default hover:border-neutral-medium-hover active:border-neutral-medium-pressed text-neutral-medium-default hover:text-neutral-medium-hover active:text-neutral-medium-pressed",
22
23
  success: "border border-success-default-default hover:border-success-default-hover active:border-success-default-pressed text-success-default-default hover:text-success-default-hover active:text-success-default-pressed",
@@ -30,15 +31,58 @@ const v = {
30
31
  error: "text-error-default-default hover:text-error-default-hover active:text-error-default-pressed",
31
32
  warning: "text-warning-default-default hover:text-warning-default-hover active:text-warning-default-pressed"
32
33
  }
33
- }, h = "bg-primary-default-disabled text-neutral-default-disabled hover:bg-primary-default-disabled active:bg-primary-default-disabled cursor-default", g = (e) => {
34
- const t = e.position || v, r = e.attachToParent || !1, o = e.color || "primary", l = e.icon || f.Add, a = e.disabled || !1, u = e.variant || "filled", d = /* @__PURE__ */ i.jsx(
34
+ }, g = "bg-primary-default-disabled text-neutral-default-disabled hover:bg-primary-default-disabled active:bg-primary-default-disabled cursor-default", x = b(
35
+ "transition-all duration-300 cursor-pointer text-neutral-default-default",
36
+ {
37
+ variants: {
38
+ color: {
39
+ primary: "",
40
+ secondary: "",
41
+ success: "",
42
+ error: "",
43
+ warning: ""
44
+ },
45
+ variant: {
46
+ fill: "",
47
+ outline: "",
48
+ text: ""
49
+ },
50
+ disabled: {
51
+ true: g,
52
+ false: ""
53
+ }
54
+ },
55
+ compoundVariants: [
56
+ { variant: "fill", color: "primary", class: r.fill.primary },
57
+ { variant: "fill", color: "secondary", class: r.fill.secondary },
58
+ { variant: "fill", color: "error", class: r.fill.error },
59
+ { variant: "fill", color: "success", class: r.fill.success },
60
+ { variant: "fill", color: "warning", class: r.fill.warning },
61
+ { variant: "outline", color: "primary", class: r.outline.primary },
62
+ { variant: "outline", color: "secondary", class: r.outline.secondary },
63
+ { variant: "outline", color: "success", class: r.outline.success },
64
+ { variant: "outline", color: "error", class: r.outline.error },
65
+ { variant: "outline", color: "warning", class: r.outline.warning },
66
+ { variant: "text", color: "primary", class: r.text.primary },
67
+ { variant: "text", color: "secondary", class: r.text.secondary },
68
+ { variant: "text", color: "success", class: r.text.success },
69
+ { variant: "text", color: "error", class: r.text.error },
70
+ { variant: "text", color: "warning", class: r.text.warning }
71
+ ],
72
+ defaultVariants: {
73
+ color: "primary",
74
+ variant: "fill"
75
+ }
76
+ }
77
+ ), y = (e) => {
78
+ const t = e.position || h, a = e.attachToParent || !1, i = e.color || "primary", s = e.icon || v.Add, o = e.disabled || !1, d = e.variant || "fill", l = /* @__PURE__ */ c.jsx(
35
79
  "div",
36
80
  {
37
81
  style: {
38
82
  width: "56px",
39
83
  height: "56px",
40
84
  borderRadius: "8px",
41
- position: r ? "absolute" : "fixed",
85
+ position: a ? "absolute" : "fixed",
42
86
  right: t.right,
43
87
  bottom: t.bottom,
44
88
  left: t.left,
@@ -47,14 +91,21 @@ const v = {
47
91
  placeItems: "center",
48
92
  padding: 16
49
93
  },
50
- className: n("transition-all duration-300 cursor-pointer text-neutral-default-default", b[u][o], a && h, e.className),
51
- onClick: a ? void 0 : e.onClick,
52
- children: s.createElement(l, { size: 24 })
94
+ className: f(
95
+ x({
96
+ color: i,
97
+ variant: d,
98
+ disabled: o
99
+ }),
100
+ e.className
101
+ ),
102
+ onClick: o ? void 0 : e.onClick,
103
+ children: u.createElement(s, { size: 24 })
53
104
  }
54
105
  );
55
- return r ? d : m(d, document.body);
56
- }, x = c(g, (e, t) => e.attachToParent === t.attachToParent && e.position === t.position && e.color === t.color && e.icon === t.icon && e.disabled === t.disabled && e.variant === t.variant && e.className === t.className && e.onClick === t.onClick);
57
- x.displayName = "FAButton";
106
+ return a ? l : m(l, document.body);
107
+ }, p = n(y, (e, t) => e.attachToParent === t.attachToParent && e.position === t.position && e.color === t.color && e.icon === t.icon && e.disabled === t.disabled && e.variant === t.variant && e.className === t.className && e.onClick === t.onClick);
108
+ p.displayName = "FAButton";
58
109
  export {
59
- x as default
110
+ p as default
60
111
  };
package/dist/Header.es.js CHANGED
@@ -1,32 +1,32 @@
1
- import { j as l } from "./jsx-runtime-DKDX3adD.js";
2
- import { c as a } from "./cn-B6yFEsav.js";
3
- import { motion as r } from "framer-motion";
4
- import { memo as d } from "react";
5
- const x = ({ title: e, subtitle: t, children: i, className: s, subtitleClassName: m, titleClassName: n }) => /* @__PURE__ */ l.jsx(
1
+ import { j as a } from "./jsx-runtime-DKDX3adD.js";
2
+ import { c as l } from "./cn-B6yFEsav.js";
3
+ import { motion as n } from "framer-motion";
4
+ import { memo as c } from "react";
5
+ const d = ({ title: e, subtitle: t, children: i, className: s, subtitleClassName: m, titleClassName: r }) => /* @__PURE__ */ a.jsx(
6
6
  "header",
7
7
  {
8
- className: a(
8
+ className: l(
9
9
  "h-16 flex items-center px-4 sm:h-20 md:h-24 md:px-6 lg:h-28 xl:h-32 2xl:h-36",
10
10
  s
11
11
  ),
12
- children: /* @__PURE__ */ l.jsxs(
13
- r.div,
12
+ children: /* @__PURE__ */ a.jsxs(
13
+ n.div,
14
14
  {
15
15
  initial: { opacity: 0, y: -10 },
16
16
  animate: { opacity: 1, y: 0 },
17
17
  transition: { duration: 0.6, ease: "easeOut" },
18
18
  className: "flex justify-between items-center w-full",
19
19
  children: [
20
- /* @__PURE__ */ l.jsxs("div", { className: "flex flex-col leading-6", children: [
21
- t && /* @__PURE__ */ l.jsx("h3", { className: a("font-semibold text-neutral-medium-default leading-1 sm:leading-2 prometeo-fonts-headline-large ", m), children: t }),
22
- e && /* @__PURE__ */ l.jsx("h1", { className: a("text-xl font-bold text-neutral-strong-default sm:text-2xl md:text-3xl xl:text-[32px] 2xl:text-[34px]", n), children: e })
20
+ /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col leading-6", children: [
21
+ t && /* @__PURE__ */ a.jsx("h3", { className: l(" prometeo-fonts-body-medium text-neutral-medium-default ", m), children: t }),
22
+ e && /* @__PURE__ */ a.jsx("h1", { className: l("prometeo-fonts-headline-small text-neutral-strong-default", r), children: e })
23
23
  ] }),
24
- i && /* @__PURE__ */ l.jsx("div", { className: "flex gap-4", children: i })
24
+ i && /* @__PURE__ */ a.jsx("div", { className: "flex gap-4", children: i })
25
25
  ]
26
26
  }
27
27
  )
28
28
  }
29
- ), h = d(x, (e, t) => e.title !== t.title || e.subtitle !== t.subtitle || e.className !== t.className ? !1 : e.children !== t.children ? !e.children && !t.children : !0);
29
+ ), x = c(d, (e, t) => e.title !== t.title || e.subtitle !== t.subtitle || e.className !== t.className ? !1 : e.children !== t.children ? !e.children && !t.children : !0);
30
30
  export {
31
- h as default
31
+ x as default
32
32
  };
@@ -54,6 +54,11 @@ declare const Icons: {
54
54
  readonly CheckCircle: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
55
55
  readonly FormatColorText: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
56
56
  readonly CheckList: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
57
+ readonly WhatsApp: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
58
+ readonly File: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
59
+ readonly Email: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
60
+ readonly Download: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
61
+ readonly Reload: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
57
62
  };
58
63
  export { Icons };
59
64
  export type IconName = keyof typeof Icons;