prometeo-design-system 7.3.8 → 7.4.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.
@@ -1,37 +1,37 @@
1
1
  import { j as b } from "./jsx-runtime-GkKLlHH4.js";
2
- import { memo as I } from "react";
3
- import { c as T } from "./index-BOQuZ0gG.js";
2
+ import { memo as S } from "react";
3
+ import { c as V } from "./index-BOQuZ0gG.js";
4
4
  import { c as g } from "./cn-B6yFEsav.js";
5
- const N = "data-interaction-group", P = "data-interaction-exclude";
6
- function W() {
7
- return { [N]: "" };
5
+ const O = "data-interaction-group", k = "data-interaction-exclude";
6
+ function G() {
7
+ return { [O]: "" };
8
8
  }
9
- function R(r) {
9
+ function A(r) {
10
10
  return r != null && r !== "self";
11
11
  }
12
- function S(r, e) {
12
+ function E(r, e) {
13
13
  const t = r ?? "neutral";
14
14
  return {
15
15
  color: t,
16
16
  variant: t === "brand" ? "primary" : e ?? "default"
17
17
  };
18
18
  }
19
- function O(r, e) {
19
+ function _(r, e) {
20
20
  return {
21
21
  default: { color: r, variant: e },
22
22
  hover: { color: r, variant: e, forced: "hover" },
23
23
  pressed: { color: r, variant: e, forced: "pressed" }
24
24
  };
25
25
  }
26
- function V(r, e, t) {
26
+ function p(r, e, t) {
27
27
  if (r) return r;
28
- const { color: a, variant: n } = S(e, t);
29
- return O(a, n);
28
+ const { color: a, variant: n } = E(e, t);
29
+ return _(a, n);
30
30
  }
31
- function A(r, e) {
31
+ function x(r, e) {
32
32
  return e || r !== void 0;
33
33
  }
34
- const y = "transition-colors duration-300 ease will-change-colors", i = T(y, {
34
+ const m = "transition-colors duration-300 ease will-change-colors", i = V(m, {
35
35
  variants: {
36
36
  color: {
37
37
  neutral: "",
@@ -183,7 +183,7 @@ const y = "transition-colors duration-300 ease will-change-colors", i = T(y, {
183
183
  }
184
184
  ]
185
185
  });
186
- function p(r) {
186
+ function y(r) {
187
187
  return !("color" in r.default);
188
188
  }
189
189
  function s(r) {
@@ -210,15 +210,15 @@ function s(r) {
210
210
  disabled: !1
211
211
  }).split(" ").find((a) => a.startsWith("bg-") && !a.includes(":")) ?? "bg-neutral-default-default"})`;
212
212
  }
213
- function E(r) {
214
- const e = p(r) ? r.default : r, t = p(r) ? r.selected : void 0, a = {
213
+ function h(r) {
214
+ const e = y(r) ? r.default : r, t = y(r) ? r.selected : void 0, a = {
215
215
  "--cell-bg": s(e.default),
216
216
  "--cell-bg-hover": s(e.hover),
217
217
  "--cell-bg-pressed": s(e.pressed)
218
218
  };
219
219
  return t && (a["--cell-bg-selected"] = s(t.default), a["--cell-bg-sel-hover"] = s(t.hover), a["--cell-bg-sel-pressed"] = s(t.pressed)), a;
220
220
  }
221
- const _ = (r) => {
221
+ const w = (r) => {
222
222
  const e = {
223
223
  color: "neutral",
224
224
  variant: "default",
@@ -235,29 +235,29 @@ const _ = (r) => {
235
235
  interactionSource: u,
236
236
  ...v
237
237
  } = { ...e, ...r };
238
- if (A(n, d)) {
239
- const C = i({ color: t, variant: a, forced: n, disabled: d });
240
- return /* @__PURE__ */ b.jsx("div", { className: g(C, c), "data-disabled": d, ...v, children: l && typeof l == "function" ? l() : l });
238
+ if (x(n, d)) {
239
+ const T = i({ color: t, variant: a, forced: n, disabled: d }), N = p(o, t, a), R = h(N);
240
+ return /* @__PURE__ */ b.jsx("div", { className: g(T, c), "data-disabled": d, style: R, ...v, children: l && typeof l == "function" ? l() : l });
241
241
  }
242
- const h = V(o, t, a), m = E(h), f = R(u);
242
+ const C = p(o, t, a), I = h(C), f = A(u);
243
243
  return /* @__PURE__ */ b.jsx(
244
244
  "div",
245
245
  {
246
246
  "data-cell-interactive": "",
247
247
  "data-interaction-grouped": f ? "" : void 0,
248
248
  "data-interaction-source": f ? u : void 0,
249
- className: g(y, c),
249
+ className: g(m, c),
250
250
  "data-disabled": d,
251
- style: m,
251
+ style: I,
252
252
  ...v,
253
253
  children: l && typeof l == "function" ? l() : l
254
254
  }
255
255
  );
256
- }, x = I(_);
257
- x.displayName = "CardBackground";
256
+ }, j = S(w);
257
+ j.displayName = "CardBackground";
258
258
  export {
259
- P as INTERACTION_EXCLUDE_ATTR,
260
- N as INTERACTION_GROUP_ATTR,
261
- x as default,
262
- W as interactionGroupProps
259
+ k as INTERACTION_EXCLUDE_ATTR,
260
+ O as INTERACTION_GROUP_ATTR,
261
+ j as default,
262
+ G as interactionGroupProps
263
263
  };
package/dist/Dialog.es.js CHANGED
@@ -2,7 +2,7 @@ import { j as n } from "./jsx-runtime-GkKLlHH4.js";
2
2
  import { useContext as Z, createContext as $, forwardRef as ee, memo as O, useRef as h, useState as R, useCallback as p, useEffect as I, useImperativeHandle as ne, useMemo as q } from "react";
3
3
  import { createPortal as te } from "react-dom";
4
4
  import { c as v } from "./cn-B6yFEsav.js";
5
- import { M as re } from "./MenuFloating-Bew5qbpJ.js";
5
+ import { M as re } from "./MenuFloating-CZ7dqXy2.js";
6
6
  import oe from "./CardBackground.es.js";
7
7
  import se from "./IconButton.es.js";
8
8
  import { Close as le } from "./Icons/Close.es.js";
@@ -7,15 +7,15 @@ import { c as h } from "./cn-B6yFEsav.js";
7
7
  const u = {
8
8
  small: {
9
9
  container: "w-8 h-8",
10
- icon: "size-4! "
10
+ icon: " [&>svg]:size-5 "
11
11
  },
12
12
  medium: {
13
13
  container: "w-10 h-10",
14
- icon: "size-6!"
14
+ icon: "[&>svg]:size-6 "
15
15
  },
16
16
  large: {
17
17
  container: "w-12 h-12",
18
- icon: "size-6!"
18
+ icon: "[&>svg]:size-6 "
19
19
  }
20
20
  }, e = {
21
21
  fill: {
package/dist/Menu.es.js CHANGED
@@ -3,7 +3,7 @@ import { memo as k, useMemo as _, Children as G, isValidElement as N, forwardRef
3
3
  import J from "./CardBackground.es.js";
4
4
  import { c as w } from "./cn-B6yFEsav.js";
5
5
  import { u as Q } from "./useDevice-S7cYqLVh.js";
6
- import { M as W } from "./MenuFloating-Bew5qbpJ.js";
6
+ import { M as W } from "./MenuFloating-CZ7dqXy2.js";
7
7
  import { D as Z } from "./DrawerMobile-BzwNbhK7.js";
8
8
  const $ = {
9
9
  color: "neutral",
@@ -0,0 +1,128 @@
1
+ import { j as H } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { forwardRef as K, useState as R, useRef as l, useCallback as S, useEffect as c, useImperativeHandle as U } from "react";
3
+ import { createPortal as V } from "react-dom";
4
+ import { c as W } from "./cn-B6yFEsav.js";
5
+ import { u as _ } from "./useFloatingPosition-CSrirTF5.js";
6
+ const z = 100, D = [
7
+ "a[href]",
8
+ "button:not([disabled])",
9
+ "input:not([disabled])",
10
+ "select:not([disabled])",
11
+ "textarea:not([disabled])",
12
+ '[tabindex]:not([tabindex="-1"])'
13
+ ].join(", ");
14
+ function X(x, C) {
15
+ const {
16
+ triggerRef: s,
17
+ anchorRef: T,
18
+ placement: O = "bottom-start",
19
+ offset: F = 4,
20
+ matchTriggerWidth: A = !1,
21
+ attachToParent: b = !1,
22
+ closeOnScroll: L = !0,
23
+ closeOnClickOutside: v = !0,
24
+ zIndex: P = 50,
25
+ avoidElements: k,
26
+ onClose: w,
27
+ onOpen: h,
28
+ children: I,
29
+ className: M
30
+ } = x, [n, d] = R("closed"), [j, q] = R(0), u = l("closed"), p = l(null), f = l(null), m = l(/* @__PURE__ */ new Set()), r = l(null), a = n !== "closed", o = S(() => {
31
+ r.current && clearTimeout(r.current), u.current = "closing", d("closing"), m.current.forEach((e) => e(!1)), r.current = setTimeout(() => {
32
+ u.current = "closed", d("closed"), p.current = null, w?.();
33
+ }, z);
34
+ }, [w]), { floatingStyles: N, resolvedPlacement: B, isPositioned: g } = _({
35
+ triggerRef: s,
36
+ anchorRef: T,
37
+ floatingRef: f,
38
+ placement: O,
39
+ offset: F,
40
+ matchTriggerWidth: A,
41
+ attachToParent: b,
42
+ enabled: a,
43
+ closeOnScroll: L,
44
+ onClose: o,
45
+ repositionKey: j,
46
+ avoidElements: k
47
+ }), E = S(
48
+ (e) => {
49
+ r.current && clearTimeout(r.current), p.current = e ?? null, u.current = "opening", d("opening"), q((t) => t + 1), h?.(e), m.current.forEach((t) => t(!0));
50
+ },
51
+ [h]
52
+ );
53
+ if (c(() => {
54
+ if (n !== "opening" || !g) return;
55
+ let e, t;
56
+ return e = requestAnimationFrame(() => {
57
+ t = requestAnimationFrame(() => {
58
+ u.current = "open", d("open");
59
+ });
60
+ }), () => {
61
+ cancelAnimationFrame(e), cancelAnimationFrame(t);
62
+ };
63
+ }, [n, g]), U(
64
+ C,
65
+ () => ({
66
+ open: (e) => E(e),
67
+ close: o,
68
+ get isOpen() {
69
+ const e = u.current;
70
+ return e === "open" || e === "opening";
71
+ },
72
+ getContext: () => p.current,
73
+ subscribeOpenChange(e) {
74
+ return m.current.add(e), () => {
75
+ m.current.delete(e);
76
+ };
77
+ }
78
+ }),
79
+ [E, o]
80
+ ), c(() => {
81
+ if (n !== "open") return;
82
+ f.current?.querySelector(D)?.focus();
83
+ }, [n]), c(() => {
84
+ if (n !== "closed") return;
85
+ const e = s.current;
86
+ if (!e || !document.body.contains(e)) return;
87
+ const t = document.activeElement;
88
+ if (t && t !== document.body && t !== e) return;
89
+ const i = e.getBoundingClientRect();
90
+ i.top < window.innerHeight && i.bottom > 0 && i.left < window.innerWidth && i.right > 0 && e.focus({ preventScroll: !0 });
91
+ }, [n, s]), c(() => {
92
+ if (!v || !a) return;
93
+ const e = (t) => {
94
+ const i = t.target;
95
+ f.current?.contains(i) || s.current?.contains(i) || o();
96
+ };
97
+ return window.addEventListener("mousedown", e, !0), () => window.removeEventListener("mousedown", e, !0);
98
+ }, [v, a, o, s]), c(() => {
99
+ if (!a) return;
100
+ const e = (t) => {
101
+ t.key === "Escape" && (t.stopPropagation(), o());
102
+ };
103
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
104
+ }, [a, o]), c(() => () => {
105
+ r.current && clearTimeout(r.current);
106
+ }, []), n === "closed") return null;
107
+ const y = /* @__PURE__ */ H.jsx(
108
+ "div",
109
+ {
110
+ ref: f,
111
+ className: W("pyrion-menu-floating", M),
112
+ "data-open": n === "open" ? "true" : void 0,
113
+ "data-closing": n === "closing" ? "true" : void 0,
114
+ "data-placement": B,
115
+ style: {
116
+ ...N,
117
+ zIndex: P,
118
+ visibility: g ? "visible" : "hidden"
119
+ },
120
+ children: I
121
+ }
122
+ );
123
+ return b ? y : V(y, document.body);
124
+ }
125
+ const ee = K(X);
126
+ export {
127
+ ee as M
128
+ };
@@ -1,35 +1,35 @@
1
1
  import { j as e } from "./jsx-runtime-GkKLlHH4.js";
2
- import c from "./Button.es.js";
3
- import { c as l } from "./cn-B6yFEsav.js";
4
- import d from "react";
5
- const f = "/public/assets/MessageCardImage.png";
6
- function u() {
7
- return l(
2
+ import i from "./Button.es.js";
3
+ import { c as a } from "./cn-B6yFEsav.js";
4
+ import c from "react";
5
+ const d = "/public/assets/MessageCardImage.png";
6
+ function f() {
7
+ return a(
8
8
  "flex flex-col items-center text-center gap-8 min-w-[300px] max-w-[448px]"
9
9
  );
10
10
  }
11
- function x(a) {
12
- return l(
11
+ function u(s) {
12
+ return a(
13
13
  "object-contain shrink-0",
14
- a === "medium" ? "size-[280px]" : "size-[200px]"
14
+ s === "medium" ? "size-[280px]" : "size-[200px]"
15
15
  );
16
16
  }
17
- function p(a) {
18
- return a.filter((t) => !t.disabled);
17
+ function x(s) {
18
+ return s.filter((l) => !l.disabled);
19
19
  }
20
- const g = ({
21
- title: a,
22
- description: t,
20
+ const p = ({
21
+ title: s,
22
+ description: l,
23
23
  image: o,
24
24
  actions: m,
25
- size: r = "medium",
25
+ size: t = "medium",
26
26
  className: n
27
- }) => /* @__PURE__ */ e.jsxs("article", { className: l(u(), n), children: [
27
+ }) => /* @__PURE__ */ e.jsxs("article", { className: a(f(), n), children: [
28
28
  /* @__PURE__ */ e.jsx(
29
29
  "img",
30
30
  {
31
- src: o ?? f,
32
- className: x(r),
31
+ src: o ?? d,
32
+ className: u(t),
33
33
  alt: ""
34
34
  }
35
35
  ),
@@ -37,47 +37,45 @@ const g = ({
37
37
  /* @__PURE__ */ e.jsx(
38
38
  "h3",
39
39
  {
40
- className: l(
41
- r === "medium" ? "prometeo-fonts-title-large" : "prometeo-fonts-title-medium",
40
+ className: a(
41
+ t === "medium" ? "prometeo-fonts-title-large" : "prometeo-fonts-title-medium",
42
42
  "text-neutral-default-default"
43
43
  ),
44
- children: a
44
+ children: s
45
45
  }
46
46
  ),
47
- t ? /* @__PURE__ */ e.jsx(
47
+ l ? /* @__PURE__ */ e.jsx(
48
48
  "p",
49
49
  {
50
- className: l(
51
- r === "medium" ? "prometeo-fonts-body-large" : "prometeo-fonts-body-medium",
50
+ className: a(
51
+ t === "medium" ? "prometeo-fonts-body-large" : "prometeo-fonts-body-medium",
52
52
  "text-neutral-secondary-default"
53
53
  ),
54
- children: t
54
+ children: l
55
55
  }
56
56
  ) : null
57
57
  ] }),
58
58
  m?.length ? /* @__PURE__ */ e.jsx(
59
59
  "div",
60
60
  {
61
- className: l(
61
+ className: a(
62
62
  "flex flex-col gap-3 w-full"
63
63
  ),
64
- children: p(m).map((s, i) => /* @__PURE__ */ e.jsx(
65
- c,
64
+ children: x(m).map((r) => /* @__PURE__ */ e.jsx(
65
+ i,
66
66
  {
67
- label: s.label,
68
- onClick: s.onClick,
69
- variant: s.variant ?? "fill",
70
- color: s.color ?? "brand",
67
+ variant: r.variant ?? "fill",
68
+ color: r.color ?? "brand",
69
+ ...r,
71
70
  className: "w-full",
72
71
  animate: !1,
73
72
  animateIcon: !1
74
- },
75
- s.label + i
73
+ }
76
74
  ))
77
75
  }
78
76
  ) : null
79
- ] }), b = d.memo(g);
80
- b.displayName = "MessageCard";
77
+ ] }), g = c.memo(p);
78
+ g.displayName = "MessageCard";
81
79
  export {
82
- b as default
80
+ g as default
83
81
  };
package/dist/Popover.css CHANGED
@@ -1 +1 @@
1
- .popover-trigger-highlight:after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:var(--popover-highlight-border-radius, inherit);z-index:1;background-color:var(--popover-highlight-background-color, var(--bg-brand-overlay-default));border:var(--popover-highlight-border, none);box-shadow:var(--popover-highlight-box-shadow, none);opacity:0;transition:var( --popover-highlight-transition, opacity var(--popover-highlight-transition-duration, .3s) ease )}.popover-trigger-highlight-visible:after{opacity:var(--popover-highlight-opacity, 1)}
1
+ .popover-trigger-highlight-overlay{pointer-events:none;background-color:var(--popover-highlight-background-color, var(--bg-brand-overlay-default));border:var(--popover-highlight-border, none);box-shadow:var(--popover-highlight-box-shadow, none);opacity:0;transition:opacity var(--popover-highlight-transition-duration, .3s) ease,var(--popover-highlight-transition, none)}.popover-trigger-highlight-overlay--visible{opacity:var(--popover-highlight-opacity, 1)}.popover-trigger-highlight-overlay--closing{opacity:0}.popover-indicator-polygon{fill:var(--cell-bg, var(--bg-neutral-secondary-default));stroke:var(--popover-panel-border-color, transparent);stroke-width:var(--popover-panel-border-width, 0);vector-effect:non-scaling-stroke;shape-rendering:geometricPrecision;paint-order:stroke fill}.popover-panel-radius--flatten-tl{border-top-left-radius:0}.popover-panel-radius--flatten-tr{border-top-right-radius:0}.popover-panel-radius--flatten-bl{border-bottom-left-radius:0}.popover-panel-radius--flatten-br{border-bottom-right-radius:0}