prometeo-design-system 9.1.2 → 9.1.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.
@@ -3,7 +3,7 @@ import { c as x } from "./cn-B6yFEsav.js";
3
3
  import { useState as K, useRef as l, useCallback as M, useEffect as p, useLayoutEffect as V, useMemo as S } from "react";
4
4
  import W from "./IconButton.es.js";
5
5
  import Y from "./NotificationCard.es.js";
6
- import { a as Z } from "./Scrollable-C2iwLEgl.js";
6
+ import { a as Z } from "./Scrollable-B845sesY.js";
7
7
  import ee from "./Spinner.es.js";
8
8
  import te from "./Tabs.es.js";
9
9
  import { S as D } from "./Skeleton-C8OCBBLq.js";
@@ -1,4 +1,4 @@
1
- import { P as f } from "./usePyrionLayout-DiYRqqHU.js";
1
+ import { P as f } from "./usePyrionLayout-N9l4oGVr.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,7 +1,8 @@
1
- import { j as t } from "./jsx-runtime-CqQglQKg.js";
2
- import b, { useLayoutEffect as D, useImperativeHandle as O } from "react";
3
- import { useScrollable as V } from "./useScrollable.es.js";
1
+ import { j as s } from "./jsx-runtime-CqQglQKg.js";
2
+ import p, { useLayoutEffect as P, useImperativeHandle as U } from "react";
3
+ import { useScrollable as W } from "./useScrollable.es.js";
4
4
  import { c as n } from "./cn-B6yFEsav.js";
5
+ import { useDragScroll as A } from "./useDragScroll.es.js";
5
6
  import { ChevronLeft as N } from "./Icon-ChevronLeft.es.js";
6
7
  const E = (o) => {
7
8
  switch (o) {
@@ -14,7 +15,7 @@ const E = (o) => {
14
15
  default:
15
16
  return " overflow-auto";
16
17
  }
17
- }, f = (o) => {
18
+ }, b = (o) => {
18
19
  const { position: i, type: l } = o;
19
20
  let a = " absolute z-100";
20
21
  if (l === "icon")
@@ -48,17 +49,21 @@ const E = (o) => {
48
49
  break;
49
50
  }
50
51
  return a;
51
- }, P = (o) => o.hide ? " prometeo-scrollbar-none" : o.size === "small" ? " prometeo-scrollbar-thin" : "", U = (o) => {
52
+ }, _ = (o) => o.hide ? " prometeo-scrollbar-none" : o.size === "small" ? " prometeo-scrollbar-thin" : "", $ = (o) => {
52
53
  const {
53
54
  debugMode: i = !1,
54
55
  className: l,
55
56
  axis: a = "both",
56
57
  children: j,
57
- scrollTopButton: u,
58
+ scrollTopButton: d,
58
59
  contentClassName: I,
59
- persistScroll: v
60
+ persistScroll: v,
60
61
  // Añadir persistScroll a las props desestructuradas
61
- } = o, M = o.scrollableState || {
62
+ disableDragScroll: g = !1
63
+ } = o, { bind: M, ref: R } = A({
64
+ axis: a,
65
+ disabled: g
66
+ }), k = o.scrollableState || {
62
67
  state: {
63
68
  scrollableElement: null,
64
69
  scrollableBaseElement: null,
@@ -98,117 +103,120 @@ const E = (o) => {
98
103
  handleIndicatorWheel: () => {
99
104
  }
100
105
  }
101
- }, { state: c, handlers: R } = M, { finalIndicators: h, finalScrollbarProps: g, scrollTopButtonVisible: k } = c, {
102
- setScrollableRef: B,
103
- setScrollableBaseRef: z,
106
+ }, { state: c, handlers: B } = k, { finalIndicators: h, finalScrollbarProps: z, scrollTopButtonVisible: C } = c, {
107
+ setScrollableRef: D,
108
+ setScrollableBaseRef: H,
104
109
  handleIndicatorClick: y,
105
110
  handleIndicatorMouseEnter: x,
106
111
  handleIndicatorMouseLeave: w,
107
112
  handleIndicatorMouseDown: m,
108
113
  handleIndicatorMouseUp: S,
109
114
  handleIndicatorWheel: T,
110
- scrollToTop: C
111
- } = R, H = b.Children.toArray(j), L = Object.values(h).some((r) => r?.show && r?.type === "icon"), d = b.useRef(null);
112
- return D(() => {
113
- d.current && c.indicatorRefs.top?.style.setProperty("--hyper-extension-top-slot-height", `${d.current.clientHeight}px`);
114
- }, [d.current]), /* @__PURE__ */ t.jsxs("div", { ref: z, className: n("relative p-0", l, E(a), "scrolleable", L ? "overflow-visible" : "overflow-hidden!", "scrollable-base-container"), children: [
115
- o.hyperExtensionTopSlot && /* @__PURE__ */ t.jsx("div", { className: "hyper-extension-top-slot w-full ", ref: d, children: typeof o.hyperExtensionTopSlot == "function" ? o.hyperExtensionTopSlot({ scrollableState: c }) : o.hyperExtensionTopSlot }),
116
- /* @__PURE__ */ t.jsx(
115
+ scrollToTop: L
116
+ } = B, O = p.Children.toArray(j), V = Object.values(h).some((t) => t?.show && t?.type === "icon"), u = p.useRef(null);
117
+ return P(() => {
118
+ u.current && c.indicatorRefs.top?.style.setProperty("--hyper-extension-top-slot-height", `${u.current.clientHeight}px`);
119
+ }, [u.current]), /* @__PURE__ */ s.jsxs("div", { ref: H, className: n("relative p-0", l, E(a), "scrolleable", V ? "overflow-visible" : "overflow-hidden!", "scrollable-base-container"), children: [
120
+ o.hyperExtensionTopSlot && /* @__PURE__ */ s.jsx("div", { className: "hyper-extension-top-slot w-full ", ref: u, children: typeof o.hyperExtensionTopSlot == "function" ? o.hyperExtensionTopSlot({ scrollableState: c }) : o.hyperExtensionTopSlot }),
121
+ /* @__PURE__ */ s.jsx(
117
122
  "div",
118
123
  {
119
- ref: B,
124
+ ref: (t) => {
125
+ D(t), R.current = t;
126
+ },
120
127
  id: v ? `scrollable-content-${v}` : void 0,
121
128
  className: n(
122
129
  i && "border border-red-900 border-dashed",
123
130
  "py-2 relative w-full h-full min-h-full",
124
131
  I,
125
132
  E(a),
126
- P(g),
133
+ _(z),
127
134
  "overscroll-y-contain"
128
135
  ),
129
- children: H?.map((r) => b.cloneElement(r, { className: n(r?.props?.className, "shrink-0! pointer-events-auto") }))
136
+ ...M,
137
+ children: O?.map((t) => p.cloneElement(t, { className: n(t?.props?.className, "shrink-0! pointer-events-auto") }))
130
138
  }
131
139
  ),
132
- o.hyperExtensionBottomSlot && /* @__PURE__ */ t.jsx("div", { className: "hyper-extension-bottom-slot w-full ", children: typeof o.hyperExtensionBottomSlot == "function" ? o.hyperExtensionBottomSlot({ scrollableState: c }) : o.hyperExtensionBottomSlot }),
133
- /* @__PURE__ */ t.jsx("div", { className: "h-full w-full z-10 absolute inset-0 pointer-events-none overflow-hidden rounded-[inherit] shadow-indicators-container", children: Object.entries(h).map(([r, e]) => {
140
+ o.hyperExtensionBottomSlot && /* @__PURE__ */ s.jsx("div", { className: "hyper-extension-bottom-slot w-full ", children: typeof o.hyperExtensionBottomSlot == "function" ? o.hyperExtensionBottomSlot({ scrollableState: c }) : o.hyperExtensionBottomSlot }),
141
+ /* @__PURE__ */ s.jsx("div", { className: "h-full w-full z-10 absolute inset-0 pointer-events-none overflow-hidden rounded-[inherit] shadow-indicators-container", children: Object.entries(h).map(([t, e]) => {
134
142
  if (!e?.show || e.type !== "shadow") return null;
135
- const s = r;
136
- return /* @__PURE__ */ t.jsxs(
143
+ const r = t;
144
+ return /* @__PURE__ */ s.jsxs(
137
145
  "span",
138
146
  {
139
- ref: (p) => {
140
- c.indicatorRefs[r] = p;
147
+ ref: (f) => {
148
+ c.indicatorRefs[t] = f;
141
149
  },
142
150
  className: n(
143
151
  e.behavior === "scroll-on-click" ? "cursor-pointer" : "cursor-default",
144
152
  "ease-in-out z-100",
145
153
  "opacity-0 pointer-events-none"
146
154
  ),
147
- onClick: () => y(s, e.behavior, e.type),
148
- onMouseEnter: () => x(s, e.behavior, e.type),
149
- onMouseLeave: () => w(s, e.behavior, e.type),
150
- onMouseDown: () => m(s, e.behavior, e.type),
151
- onMouseUp: () => S(s, e.behavior, e.type),
155
+ onClick: () => y(r, e.behavior, e.type),
156
+ onMouseEnter: () => x(r, e.behavior, e.type),
157
+ onMouseLeave: () => w(r, e.behavior, e.type),
158
+ onMouseDown: () => m(r, e.behavior, e.type),
159
+ onMouseUp: () => S(r, e.behavior, e.type),
152
160
  onWheel: T,
153
161
  children: [
154
- /* @__PURE__ */ t.jsx("span", { className: n(f({ position: s, type: "shadow" }), "shadow-base", e.className) }),
155
- /* @__PURE__ */ t.jsx("span", { className: n(f({ position: s, type: "shadow" }), "shadow-hover opacity-0 transition-opacity duration-300", e.className) })
162
+ /* @__PURE__ */ s.jsx("span", { className: n(b({ position: r, type: "shadow" }), "shadow-base", e.className) }),
163
+ /* @__PURE__ */ s.jsx("span", { className: n(b({ position: r, type: "shadow" }), "shadow-hover opacity-0 transition-opacity duration-300", e.className) })
156
164
  ]
157
165
  },
158
- r
166
+ t
159
167
  );
160
168
  }) }),
161
- /* @__PURE__ */ t.jsx("div", { className: "h-full w-full z-20 absolute inset-0 pointer-events-none icons-indicators-container", children: Object.entries(h).map(([r, e]) => {
169
+ /* @__PURE__ */ s.jsx("div", { className: "h-full w-full z-20 absolute inset-0 pointer-events-none icons-indicators-container", children: Object.entries(h).map(([t, e]) => {
162
170
  if (!e?.show || e.type !== "icon") return null;
163
- const s = r;
164
- return /* @__PURE__ */ t.jsx(
171
+ const r = t;
172
+ return /* @__PURE__ */ s.jsx(
165
173
  "span",
166
174
  {
167
- ref: (p) => {
168
- c.indicatorRefs[r] = p;
175
+ ref: (f) => {
176
+ c.indicatorRefs[t] = f;
169
177
  },
170
178
  className: "pointer-events-auto cursor-default transition-all duration-300 opacity-0",
171
- onClick: () => y(s, e.behavior, e.type),
172
- onMouseEnter: () => x(s, e.behavior, e.type),
173
- onMouseLeave: () => w(s, e.behavior, e.type),
174
- onMouseDown: () => m(s, e.behavior, e.type),
175
- onMouseUp: () => S(s, e.behavior, e.type),
179
+ onClick: () => y(r, e.behavior, e.type),
180
+ onMouseEnter: () => x(r, e.behavior, e.type),
181
+ onMouseLeave: () => w(r, e.behavior, e.type),
182
+ onMouseDown: () => m(r, e.behavior, e.type),
183
+ onMouseUp: () => S(r, e.behavior, e.type),
176
184
  onWheel: T,
177
- children: /* @__PURE__ */ t.jsx(N, { size: 20, className: n(f({ position: s, type: "icon" }), e.className) })
185
+ children: /* @__PURE__ */ s.jsx(N, { size: 20, className: n(b({ position: r, type: "icon" }), e.className) })
178
186
  },
179
- r
187
+ t
180
188
  );
181
189
  }) }),
182
- u && /* @__PURE__ */ t.jsx(
190
+ d && /* @__PURE__ */ s.jsx(
183
191
  "button",
184
192
  {
185
- tabIndex: u.tabIndex ?? -1,
186
- onClick: C,
193
+ tabIndex: d.tabIndex ?? -1,
194
+ onClick: L,
187
195
  className: n(
188
196
  "absolute bottom-6 right-6 z-50 p-3.5! aspect-square rounded-full! shadow-lg transition-all duration-300 hover:scale-110 pointer-events-auto cursor-pointer scroll-to-top-button",
189
197
  "bg-brand-primary-default hover:bg-brand-primary-hover text-white",
190
198
  // Transiciones de aparición/desaparición
191
199
  "transform translate-y-0 opacity-70",
192
- !k && "translate-y-4 opacity-0 pointer-events-none",
193
- u.className
200
+ !C && "translate-y-4 opacity-0 pointer-events-none",
201
+ d.className
194
202
  ),
195
203
  "aria-label": "Scroll to top",
196
204
  style: {
197
205
  transition: "all 0.3s ease-in-out"
198
206
  },
199
- children: u.icon ? /* @__PURE__ */ t.jsx(u.icon, { size: 20, className: "text-white" }) : /* @__PURE__ */ t.jsx(N, { size: 20, className: "text-white rotate-90" })
207
+ children: d.icon ? /* @__PURE__ */ s.jsx(d.icon, { size: 20, className: "text-white" }) : /* @__PURE__ */ s.jsx(N, { size: 20, className: "text-white rotate-90" })
200
208
  }
201
209
  )
202
210
  ] });
203
- }, K = (o) => {
204
- const { controls: i } = o, l = V(o);
205
- return O(i, () => ({
211
+ }, X = (o) => {
212
+ const { controls: i } = o, l = W(o);
213
+ return U(i, () => ({
206
214
  subscribeToScrollTarget: l.handlers.subscribeToScrollTarget,
207
215
  subscribeToHyperextension: l.handlers.subscribeToHyperextension,
208
216
  releaseHyperextensionOverscroll: l.handlers.releaseHyperextensionOverscroll
209
- }), [l]), /* @__PURE__ */ t.jsx(U, { ...o, scrollableState: l });
217
+ }), [l]), /* @__PURE__ */ s.jsx($, { ...o, scrollableState: l });
210
218
  };
211
219
  export {
212
- K as S,
213
- U as a
220
+ X as S,
221
+ $ as a
214
222
  };
@@ -1,4 +1,4 @@
1
- import { S as r } from "./Scrollable-C2iwLEgl.js";
1
+ import { S as r } from "./Scrollable-B845sesY.js";
2
2
  export {
3
3
  r as Scrollable
4
4
  };
@@ -1,4 +1,4 @@
1
- import { T, T as e } from "./usePyrionLayout-DiYRqqHU.js";
1
+ import { T, T as e } from "./usePyrionLayout-N9l4oGVr.js";
2
2
  export {
3
3
  T as TabSwitch,
4
4
  e as default
package/dist/Tabs.es.js CHANGED
@@ -6,7 +6,7 @@ import { Badge as R } from "./Badge.es.js";
6
6
  import { i as E } from "./iconUtils-rTOfKDxE.js";
7
7
  import { PlainTooltip as M } from "./PlainTooltip.es.js";
8
8
  import { Info as L } from "./Icon-Info.es.js";
9
- import { S as $ } from "./Scrollable-C2iwLEgl.js";
9
+ import { S as $ } from "./Scrollable-B845sesY.js";
10
10
  const A = b(
11
11
  "relative transition-colors duration-200 ease-in-out p-0 gap-0 flex",
12
12
  {
@@ -2,7 +2,7 @@ import { j as e } from "./jsx-runtime-CqQglQKg.js";
2
2
  import { c as u } from "./cn-B6yFEsav.js";
3
3
  import f from "./UserCard.es.js";
4
4
  import h from "./ListItem.es.js";
5
- import { S as v } from "./Scrollable-C2iwLEgl.js";
5
+ import { S as v } from "./Scrollable-B845sesY.js";
6
6
  import b from "./Divider.es.js";
7
7
  import { Settings as y } from "./Icon-Settings.es.js";
8
8
  import { Logout as N } from "./Icon-Logout.es.js";
@@ -70,6 +70,8 @@ export interface ScrollableProps {
70
70
  children?: React.ReactNode;
71
71
  scrollbarProps?: ScrollbarProps;
72
72
  disableMouseScroll?: boolean;
73
+ /** Desactiva el scroll por drag (click y arrastrar). @default false */
74
+ disableDragScroll?: boolean;
73
75
  defaultBehavior?: 'scroll-on-click' | 'scroll-on-hover' | 'none';
74
76
  persistScroll?: boolean | string;
75
77
  controls?: React.RefObject<ScrollableControlsHandler | null>;
@@ -65,7 +65,7 @@ import { default as fa } from "./Spinner.es.js";
65
65
  import { S as pa } from "./Star-DKhRZoa9.js";
66
66
  import { Steps as xa } from "./Steps.es.js";
67
67
  import { Subtitle as ga } from "./Subtitle.es.js";
68
- import { T as Ca } from "./usePyrionLayout-DiYRqqHU.js";
68
+ import { T as Ca } from "./usePyrionLayout-N9l4oGVr.js";
69
69
  import { TertiaryLevelSidebar as wa } from "./TertiaryLevelSidebar.es.js";
70
70
  import { TextArea as Ta, TextArea as La } from "./TextArea.es.js";
71
71
  import { Title as Na } from "./Title.es.js";
@@ -8,7 +8,7 @@ import Z, { useDrawerSidebarOpen as Jt } from "./NavigationDrawer.es.js";
8
8
  import { a as ce, u as Me } from "./useDrawerCollapsed-CJOXf2Fw.js";
9
9
  import { Sidebar as Qt } from "./Sidebar.es.js";
10
10
  import { NavigationRail as ee } from "./NavigationRail.es.js";
11
- import { S as nt } from "./Scrollable-C2iwLEgl.js";
11
+ import { S as nt } from "./Scrollable-B845sesY.js";
12
12
  import je from "./Divider.es.js";
13
13
  import { SidebarItem as le } from "./SidebarItem.es.js";
14
14
  import { Collapsible as qe } from "./Collapsible.es.js";
@@ -1,4 +1,4 @@
1
- import { u as f } from "./usePyrionLayout-DiYRqqHU.js";
1
+ import { u as f } from "./usePyrionLayout-N9l4oGVr.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prometeo-design-system",
3
3
  "private": false,
4
- "version": "9.1.2",
4
+ "version": "9.1.3",
5
5
  "type": "module",
6
6
  "description": "design kit system",
7
7
  "main": "dist/prometeo-design-system.umd.js",