prometeo-design-system 3.1.7 → 4.1.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.
Files changed (80) hide show
  1. package/dist/{CardProfile-y9Knsg26.js → CardProfile-C1F83KJV.js} +1 -1
  2. package/dist/CardProfile.es.js +1 -1
  3. package/dist/{DatePicker-6eb-0Ns5.js → DatePicker-QuBgR5DQ.js} +799 -794
  4. package/dist/DatePicker.es.js +1 -1
  5. package/dist/DialogModal.es.js +25 -22
  6. package/dist/Icons/ReassignmentFill.es.js +1 -1
  7. package/dist/Icons/StarFill.d.ts +6 -0
  8. package/dist/Icons/StarFill.es.js +19 -0
  9. package/dist/Icons/components/StarFill.d.ts +4 -0
  10. package/dist/Icons/index.d.ts +1 -0
  11. package/dist/Icons/types.d.ts +4 -2
  12. package/dist/Icons.es.js +18 -16
  13. package/dist/Input.es.js +56 -52
  14. package/dist/PlainTooltip.d.ts +6 -0
  15. package/dist/PlainTooltip.es.js +72 -0
  16. package/dist/PyrionLayout.d.ts +6 -0
  17. package/dist/PyrionLayout.es.js +1357 -0
  18. package/dist/RecurrentDatePicker.es.js +2 -2
  19. package/dist/RecurrentDatePickerRRule.es.js +1 -1
  20. package/dist/Scrollable.es.js +118 -86
  21. package/dist/Select.es.js +524 -524
  22. package/dist/SelectSearch.es.js +44 -43
  23. package/dist/TabLinks.es.js +81 -52
  24. package/dist/{badge-B1IK_-i5.js → badge-CbqYNrl4.js} +28 -28
  25. package/dist/components/DatePicker/DatePicker.d.ts +1 -0
  26. package/dist/components/Input/Input.d.ts +1 -0
  27. package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +19 -11
  28. package/dist/components/NavigationDrawer/NavigationDrawerActionItem.d.ts +5 -3
  29. package/dist/components/NavigationDrawer/NavigationDrawerActions.d.ts +3 -3
  30. package/dist/components/NavigationDrawer/NavigationDrawerItemBase.d.ts +1 -0
  31. package/dist/components/NavigationDrawer/NavigationDrawerLinkItem.d.ts +3 -2
  32. package/dist/components/NavigationDrawer/NavigationDrawerNavlinks.d.ts +2 -2
  33. package/dist/components/NavigationDrawer/NavigationDrawerSidebar.d.ts +11 -0
  34. package/dist/components/NotificationCard/NotificationCard.d.ts +3 -2
  35. package/dist/components/PlainTooltip/PlainTooltip.d.ts +11 -0
  36. package/dist/components/PyrionNavigationDrawer/PLContent.d.ts +10 -0
  37. package/dist/components/PyrionNavigationDrawer/PLFooter.d.ts +21 -0
  38. package/dist/components/PyrionNavigationDrawer/PLHeader.d.ts +10 -0
  39. package/dist/components/PyrionNavigationDrawer/PLHelpSection.d.ts +8 -0
  40. package/dist/components/PyrionNavigationDrawer/{PyrionNavigationDrawerMobileAppSwitcher.d.ts → PLMobileAppSwitcher.d.ts} +3 -3
  41. package/dist/components/PyrionNavigationDrawer/PLNotificationsList.d.ts +15 -0
  42. package/dist/components/PyrionNavigationDrawer/PLSidebar.d.ts +12 -0
  43. package/dist/components/PyrionNavigationDrawer/PLSidebarContent.d.ts +17 -0
  44. package/dist/components/PyrionNavigationDrawer/{PyrionNavigationDrawerSystemLogo.d.ts → PLSystemLogo.d.ts} +1 -1
  45. package/dist/components/PyrionNavigationDrawer/PLSystemSessions.d.ts +14 -0
  46. package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +42 -0
  47. package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +146 -0
  48. package/dist/components/PyrionNavigationDrawer/index.d.ts +3 -2
  49. package/dist/components/Scrollable/Scrollable.d.ts +1 -0
  50. package/dist/components/Select/Select.d.ts +1 -0
  51. package/dist/components/TabLinks/TabLinks.d.ts +10 -1
  52. package/dist/components/TabSwitch/TabSwitch.d.ts +2 -0
  53. package/dist/exports/PlainTooltip.d.ts +2 -0
  54. package/dist/exports/PyrionLayout.d.ts +2 -0
  55. package/dist/exports/usePyrionNavigation.d.ts +1 -1
  56. package/dist/hooks/useDevice.d.ts +1 -0
  57. package/dist/index.d.ts +0 -1
  58. package/dist/prometeo-design-system.es.js +2421 -402
  59. package/dist/styles.css +1 -1
  60. package/dist/useDevice-vwn4GLwK.js +16 -0
  61. package/dist/useDevice.es.js +2 -11
  62. package/dist/usePyrionNavigation.es.js +1 -1
  63. package/package.json +8 -16
  64. package/src/styles/base.css +1 -0
  65. package/dist/LayoutGeneric-CfWhV1ov.js +0 -26
  66. package/dist/LayoutGeneric.d.ts +0 -6
  67. package/dist/LayoutGeneric.es.js +0 -4
  68. package/dist/PyrionNavigationDrawer.d.ts +0 -6
  69. package/dist/PyrionNavigationDrawer.es.js +0 -962
  70. package/dist/SwipeContainer.d.ts +0 -4
  71. package/dist/SwipeContainer.es.js +0 -185
  72. package/dist/components/PyrionNavigationDrawer/PyrionHelpSection.d.ts +0 -8
  73. package/dist/components/PyrionNavigationDrawer/PyrionNavigationDrawer.d.ts +0 -130
  74. package/dist/components/PyrionNavigationDrawer/PyrionNotificationsList.d.ts +0 -8
  75. package/dist/components/PyrionNavigationDrawer/SidebarContent.d.ts +0 -13
  76. package/dist/components/PyrionNavigationDrawer/SystemSessions.d.ts +0 -12
  77. package/dist/components/SwipeContainer/SwipeContainer.d.ts +0 -19
  78. package/dist/exports/LayoutGeneric.d.ts +0 -2
  79. package/dist/exports/PyrionNavigationDrawer.d.ts +0 -2
  80. package/dist/exports/SwipeContainer.d.ts +0 -1
@@ -1,4 +0,0 @@
1
- export {}
2
- import PrometeoDesignSystem from './exports/SwipeContainer'
3
- export default PrometeoDesignSystem
4
- export {}
@@ -1,185 +0,0 @@
1
- import { j as o } from "./jsx-runtime-GkKLlHH4.js";
2
- import { c as i } from "./cn-B6yFEsav.js";
3
- import { useState as d, useRef as D, useEffect as L } from "react";
4
- const O = ({
5
- children: x,
6
- className: P,
7
- showIndicators: R = !0,
8
- showControls: W = !0,
9
- // Por defecto mostrar controles
10
- autoPlay: k = !1,
11
- autoPlayInterval: $ = 3e3,
12
- onSwipe: m,
13
- threshold: Y = 50,
14
- disabled: l = !1,
15
- cardWidth: f,
16
- // Ancho personalizado de tarjetas
17
- visibleCards: r,
18
- // Número de tarjetas visibles
19
- width: p = "100%",
20
- // Ancho por defecto
21
- height: v = "300px",
22
- // Alto por defecto
23
- gap: g = 16
24
- // Separación por defecto entre cards
25
- }) => {
26
- const [n, h] = d(0), [u, N] = d(!1), [T, B] = d({ x: 0, y: 0 }), [I, w] = d({ x: 0, y: 0 }), y = D(null), c = D(null), s = x.length, C = f ? typeof f == "number" ? `${f}px` : f : r && r > 0 ? `${100 / r}%` : "100%";
27
- L(() => (k && s > 1 && !u && (c.current = setInterval(() => {
28
- h((e) => (e + 1) % s);
29
- }, $)), () => {
30
- c.current && clearInterval(c.current);
31
- }), [k, $, s, u]), L(() => {
32
- u && c.current && clearInterval(c.current);
33
- }, [u]);
34
- const S = (e, t) => {
35
- l || (N(!0), B({ x: e, y: t }), w({ x: e, y: t }));
36
- }, E = (e, t) => {
37
- !u || l || w({ x: e, y: t });
38
- }, X = () => {
39
- if (!u || l) return;
40
- const e = I.x - T.x;
41
- if (Math.abs(e) > Y) {
42
- if (e > 0 && n > 0) {
43
- const a = n - 1;
44
- h(a), m?.(a);
45
- } else if (e < 0 && n < s - 1) {
46
- const a = n + 1;
47
- h(a), m?.(a);
48
- }
49
- }
50
- N(!1), w({ x: 0, y: 0 });
51
- }, U = (e) => {
52
- e.preventDefault(), S(e.clientX, e.clientY);
53
- }, _ = (e) => {
54
- E(e.clientX, e.clientY);
55
- }, b = () => {
56
- X();
57
- }, q = (e) => {
58
- const t = e.touches[0];
59
- S(t.clientX, t.clientY);
60
- }, z = (e) => {
61
- const t = e.touches[0];
62
- E(t.clientX, t.clientY);
63
- }, A = () => {
64
- X();
65
- }, j = (e) => {
66
- l || e < 0 || e >= s || (h(e), m?.(e));
67
- }, F = () => {
68
- const e = I.x - T.x;
69
- let t = 0;
70
- if (r && r > 0) {
71
- const M = y.current ? (y.current.offsetWidth - g * (r - 1)) / r : 0;
72
- t = n * (M + g);
73
- } else
74
- t = n * 100;
75
- const a = r && r > 0 ? `translateX(-${t}px)` : `translateX(-${n * 100}%)`;
76
- if (u) {
77
- const M = `translateX(${e}px)`;
78
- return `${a} ${M}`;
79
- }
80
- return a;
81
- };
82
- return s === 0 ? null : /* @__PURE__ */ o.jsxs(
83
- "div",
84
- {
85
- className: i("relative overflow-hidden", P),
86
- style: {
87
- width: typeof p == "number" ? `${p}px` : p,
88
- height: typeof v == "number" ? `${v}px` : v
89
- },
90
- children: [
91
- /* @__PURE__ */ o.jsx(
92
- "div",
93
- {
94
- ref: y,
95
- className: i(
96
- "relative flex flex-row transition-transform duration-300 ease-out",
97
- l && "pointer-events-none opacity-50"
98
- ),
99
- style: {
100
- transform: F(),
101
- gap: `${g}px`
102
- },
103
- onMouseDown: U,
104
- onMouseMove: _,
105
- onMouseUp: b,
106
- onMouseLeave: b,
107
- onTouchStart: q,
108
- onTouchMove: z,
109
- onTouchEnd: A,
110
- children: x.map((e, t) => /* @__PURE__ */ o.jsx(
111
- "div",
112
- {
113
- className: "flex-shrink-0 h-full",
114
- style: {
115
- width: C
116
- },
117
- children: e
118
- },
119
- t
120
- ))
121
- }
122
- ),
123
- R && s > 1 && /* @__PURE__ */ o.jsx("div", { className: "absolute bottom-4 left-1/2 transform -translate-x-1/2 flex gap-2", children: x.map((e, t) => /* @__PURE__ */ o.jsx(
124
- "button",
125
- {
126
- onClick: () => j(t),
127
- className: i(
128
- "w-2 h-2 rounded-full transition-all duration-200",
129
- t === n ? "bg-primary-default-default" : "bg-neutral-medium-default hover:bg-neutral-default-default"
130
- ),
131
- "aria-label": `Ir al elemento ${t + 1}`
132
- },
133
- t
134
- )) }),
135
- W && s > 1 && /* @__PURE__ */ o.jsxs("div", { className: "absolute inset-0 flex items-center justify-between pointer-events-none", children: [
136
- n > 0 && /* @__PURE__ */ o.jsx(
137
- "button",
138
- {
139
- onClick: () => j(n - 1),
140
- className: i(
141
- "p-2 rounded-full bg-white shadow-md hover:shadow-lg transition-shadow pointer-events-auto",
142
- l && "pointer-events-none opacity-50"
143
- ),
144
- "aria-label": "Elemento anterior",
145
- children: /* @__PURE__ */ o.jsx(
146
- "svg",
147
- {
148
- className: "w-4 h-4 text-neutral-default-default rotate-180",
149
- fill: "none",
150
- stroke: "currentColor",
151
- viewBox: "0 0 24 24",
152
- children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
153
- }
154
- )
155
- }
156
- ),
157
- n < s - 1 && /* @__PURE__ */ o.jsx(
158
- "button",
159
- {
160
- onClick: () => j(n + 1),
161
- className: i(
162
- "p-2 rounded-full bg-white shadow-md hover:shadow-lg transition-shadow pointer-events-auto",
163
- l && "pointer-events-none opacity-50"
164
- ),
165
- "aria-label": "Elemento siguiente",
166
- children: /* @__PURE__ */ o.jsx(
167
- "svg",
168
- {
169
- className: "w-4 h-4 text-neutral-default-default",
170
- fill: "none",
171
- stroke: "currentColor",
172
- viewBox: "0 0 24 24",
173
- children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
174
- }
175
- )
176
- }
177
- )
178
- ] })
179
- ]
180
- }
181
- );
182
- };
183
- export {
184
- O as default
185
- };
@@ -1,8 +0,0 @@
1
- import { ReactNode } from 'react';
2
- interface PyrionHelpSectionProps {
3
- onCloseClick?: VoidFunction;
4
- children?: ReactNode;
5
- title?: string;
6
- }
7
- declare const PyrionHelpSection: ({ onCloseClick, children, title }: PyrionHelpSectionProps) => import("react/jsx-runtime").JSX.Element;
8
- export default PyrionHelpSection;
@@ -1,130 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { NavigationDrawerSidebarProps } from '../NavigationDrawer/NavigationDrawer';
3
- import { NavigationDrawerActionItemProps } from '../NavigationDrawer/NavigationDrawerActionItem';
4
- import { NavigationDrawerLinkItemProps } from '../NavigationDrawer/NavigationDrawerLinkItem';
5
- import { NotificationCardProps } from '../NotificationCard/NotificationCard';
6
- import { AllOptionAccessor } from '../Shared/types';
7
- import { TabSwitchElement } from '../TabSwitch/TabSwitch';
8
- import { subImageUrlAccessor } from './SystemSessions';
9
- type TProduct = {
10
- name: string;
11
- domain: string;
12
- active: boolean;
13
- coverImage?: string;
14
- thumbnail?: string;
15
- };
16
- type TCompany = {
17
- name: string;
18
- products?: TProduct[];
19
- icon?: string;
20
- };
21
- type TUser = {
22
- auth_id: string;
23
- name: string;
24
- surname?: string;
25
- email?: string;
26
- profile_picture?: string;
27
- };
28
- export type TSystem = {
29
- name: string;
30
- url: string;
31
- coverImage?: string;
32
- thumbnail?: string;
33
- _id: string;
34
- };
35
- type TSystemSession<TSystemMetadata> = TSystem & {
36
- metadata?: TSystemMetadata;
37
- };
38
- export interface AuthSession<TSystemMetadata> {
39
- token: string;
40
- expires_at: string;
41
- logoutDate?: string;
42
- userHub: TUser;
43
- systems: TSystemSession<TSystemMetadata>[];
44
- }
45
- export interface NavigationDrawerTabsProps {
46
- currentTabName?: string;
47
- customTabs?: TabSwitchElement[];
48
- onTabClick?: (name: string) => void;
49
- }
50
- type AvailableData<TSystemMetadata> = {
51
- company: TCompany;
52
- user: TUser;
53
- system?: TSystem;
54
- metadata?: TSystemMetadata;
55
- };
56
- type SessionAvailableData<TSystemMetadata> = {
57
- company: TCompany;
58
- user: TUser;
59
- system?: TSystemSession<TSystemMetadata>;
60
- metadata?: TSystemMetadata;
61
- };
62
- type UserCardAccesors<TSystemMetadata> = AllOptionAccessor<AvailableData<TSystemMetadata>, string>;
63
- type SessionCardAccesors<TSystemMetadata> = AllOptionAccessor<SessionAvailableData<TSystemMetadata>, string>;
64
- interface UserCardOptions<TSystemMetadata> {
65
- secondarySlot: UserCardAccesors<TSystemMetadata> | [UserCardAccesors<TSystemMetadata>, UserCardAccesors<TSystemMetadata>] | ((data: AvailableData<TSystemMetadata>) => React.ReactNode);
66
- }
67
- interface SessionCardOptions<TSystemMetadata> {
68
- secondarySlot: SessionCardAccesors<TSystemMetadata> | [SessionCardAccesors<TSystemMetadata>, SessionCardAccesors<TSystemMetadata>] | ((data: SessionAvailableData<TSystemMetadata>) => React.ReactNode);
69
- subImageUrlAccessor?: subImageUrlAccessor<TSystemMetadata>;
70
- }
71
- export interface NotificationsDrawerOptions {
72
- hide?: boolean;
73
- hideActionButton?: boolean;
74
- onMarkAllAsRead?: () => void;
75
- }
76
- export interface HelpSectionDrawerOptions {
77
- hide?: boolean;
78
- hideActionButton?: boolean;
79
- }
80
- export interface ConfigurationActionOptions {
81
- hideActionButton?: boolean;
82
- onClick: VoidFunction;
83
- }
84
- export interface PyrionNavigationDrawerOptions<TSystemMetadata> {
85
- userCardOptions?: UserCardOptions<TSystemMetadata>;
86
- sessionCardOptions?: SessionCardOptions<TSystemMetadata>;
87
- notificationsDrawerOptions?: NotificationsDrawerOptions;
88
- helpSectionDrawerOptions?: HelpSectionDrawerOptions;
89
- configurationActionOptions?: ConfigurationActionOptions;
90
- sidebarOptions: Pick<NavigationDrawerSidebarProps, 'modal' | 'closeOnOverlayClick'>;
91
- }
92
- export interface PyrionNavigationDrawerProps<TSystemMetadata, NotificationMetadata = unknown> {
93
- links?: NavigationDrawerLinkItemProps[];
94
- actions?: NavigationDrawerActionItemProps[];
95
- tabsProps?: NavigationDrawerTabsProps;
96
- activeActionId?: string;
97
- currentSystemId: string;
98
- helpSection?: ReactNode | (() => ReactNode);
99
- children?: ReactNode;
100
- state: {
101
- company: TCompany;
102
- enabled_systems: TSystem[];
103
- user: TUser;
104
- sessions?: AuthSession<TSystemMetadata>[];
105
- metadata?: TSystemMetadata;
106
- notifications?: NotificationCardProps<NotificationMetadata>[];
107
- };
108
- options?: PyrionNavigationDrawerOptions<TSystemMetadata>;
109
- onActionClick?: (id: string) => void;
110
- onLinkClick?: (path: string) => void;
111
- onSessionClick?: (session: AuthSession<TSystemMetadata>) => void;
112
- onNavigate?: (from: string, to: string) => void;
113
- onSystemLogoClick?: (collapsed?: boolean) => void;
114
- onLogoutClick?: () => void;
115
- }
116
- type PyrionNavigationControls = {
117
- toggleCollapse?: () => void;
118
- getIsCollapsed?: () => boolean;
119
- subscribeToCollapse?: (listener: (collapsed: boolean) => void) => () => void;
120
- openSidebar?: () => void;
121
- closeSidebar?: () => void;
122
- toggleSidebar?: () => void;
123
- getIsSidebarOpen?: () => boolean;
124
- subscribeToSidebarOpen?: (listener: (open: boolean) => void) => () => void;
125
- openNotifications?: () => void;
126
- openHelp?: () => void;
127
- };
128
- export declare const usePyrionNavigation: () => PyrionNavigationControls;
129
- declare const PyrionNavigationDrawer: <TAppMetadata = unknown, NotificationMetadata = unknown>({ children, helpSection, state, links: navlinks, onLinkClick, onNavigate, onLogoutClick, actions, activeActionId, onActionClick, tabsProps, currentSystemId, onSessionClick, options, onSystemLogoClick }: PyrionNavigationDrawerProps<TAppMetadata, NotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
130
- export default PyrionNavigationDrawer;
@@ -1,8 +0,0 @@
1
- import { NotificationCardProps } from '../NotificationCard/NotificationCard';
2
- interface PyrionNotificationsDrawerProps<NotificationMetadata> {
3
- onCloseClick?: VoidFunction;
4
- onMarkAllAsRead?: () => void;
5
- notifications?: NotificationCardProps<NotificationMetadata>[];
6
- }
7
- declare const PyrionNotificationsList: <NotificationMetadata = unknown>({ onCloseClick, onMarkAllAsRead, notifications }: PyrionNotificationsDrawerProps<NotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
8
- export default PyrionNotificationsList;
@@ -1,13 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { PyrionNavigationDrawerOptions, PyrionNavigationDrawerProps } from './PyrionNavigationDrawer';
3
- export type SidebarContentHandle = {
4
- setActiveSection: (section: 'notifications' | 'help') => void;
5
- };
6
- declare const SidebarContent: import('react').ForwardRefExoticComponent<{
7
- closeSidebar: () => void;
8
- options?: PyrionNavigationDrawerOptions<any>;
9
- state: PyrionNavigationDrawerProps<any, any>["state"];
10
- helpSection?: ReactNode | (() => ReactNode);
11
- initialSection?: "notifications" | "help";
12
- } & import('react').RefAttributes<SidebarContentHandle>>;
13
- export default SidebarContent;
@@ -1,12 +0,0 @@
1
- import { AllOptionAccessor } from '../Shared/types';
2
- import { AuthSession } from './PyrionNavigationDrawer';
3
- export interface SystemSessionsProps<TSystemMetadata> {
4
- sessions?: AuthSession<TSystemMetadata>[];
5
- onSessionClick?: (session: AuthSession<TSystemMetadata>) => void;
6
- secondarySlot?: React.ReactNode | string | ((session: AuthSession<TSystemMetadata>) => React.ReactNode | string | null) | null;
7
- subImageUrlAccessor?: subImageUrlAccessor<TSystemMetadata>;
8
- currentSystemId: string;
9
- }
10
- export type subImageUrlAccessor<TSystemMetadata> = AllOptionAccessor<TSystemMetadata, string>;
11
- declare const SystemSessions: <TSystemMetadata = unknown>(props: SystemSessionsProps<TSystemMetadata>) => import("react/jsx-runtime").JSX.Element | null;
12
- export default SystemSessions;
@@ -1,19 +0,0 @@
1
- import { default as React, ReactNode } from 'react';
2
- interface SwipeContainerProps {
3
- children: ReactNode[];
4
- className?: string;
5
- showIndicators?: boolean;
6
- showControls?: boolean;
7
- autoPlay?: boolean;
8
- autoPlayInterval?: number;
9
- onSwipe?: (index: number) => void;
10
- threshold?: number;
11
- disabled?: boolean;
12
- cardWidth?: number | string;
13
- visibleCards?: number;
14
- width?: number | string;
15
- height?: number | string;
16
- gap?: number;
17
- }
18
- declare const SwipeContainer: React.FC<SwipeContainerProps>;
19
- export default SwipeContainer;
@@ -1,2 +0,0 @@
1
- export { default } from '../components/Layout/LayoutGeneric';
2
- export type { LayoutGenericProps } from '../components/Layout/LayoutGeneric';
@@ -1,2 +0,0 @@
1
- export { default } from '../components/PyrionNavigationDrawer';
2
- export { type PyrionNavigationDrawerProps, type PyrionNavigationDrawerOptions, type NavigationDrawerTabsProps, type AuthSession } from '../components/PyrionNavigationDrawer';
@@ -1 +0,0 @@
1
- export { default } from '../components/SwipeContainer/SwipeContainer';