@elevasis/ui 2.40.1 → 2.41.1

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 (92) hide show
  1. package/dist/api/index.js +4 -6
  2. package/dist/app/index.css +384 -0
  3. package/dist/app/index.d.ts +108 -0
  4. package/dist/app/index.js +17 -27
  5. package/dist/auth/index.css +659 -0
  6. package/dist/auth/index.js +19 -6
  7. package/dist/charts/index.css +533 -0
  8. package/dist/charts/index.js +18 -15
  9. package/dist/{chunk-RXH4D6TY.js → chunk-5M4HSHQ5.js} +631 -2
  10. package/dist/{chunk-TE4P6OSJ.js → chunk-7FJI76OH.js} +1 -1
  11. package/dist/chunk-GMXGDO3I.js +244 -0
  12. package/dist/{chunk-CXY7FMUM.js → chunk-GUKY77FJ.js} +50 -4
  13. package/dist/{chunk-5JYKCULK.js → chunk-NZ2F5RQ4.js} +44 -2
  14. package/dist/{chunk-WF7CONXF.js → chunk-OJJK27GC.js} +658 -6
  15. package/dist/{chunk-RX6RSKWC.js → chunk-QDXTIQT4.js} +29255 -18312
  16. package/dist/{chunk-73EWE2EW.js → chunk-V5HWC5EW.js} +1 -1
  17. package/dist/components/chat/index.js +1 -2
  18. package/dist/components/index.css +149 -149
  19. package/dist/components/index.js +13 -37
  20. package/dist/components/navigation/index.css +659 -0
  21. package/dist/components/navigation/index.js +25 -4
  22. package/dist/features/auth/index.js +14 -38
  23. package/dist/features/clients/index.css +149 -149
  24. package/dist/features/clients/index.js +13 -37
  25. package/dist/features/crm/index.js +13 -37
  26. package/dist/features/dashboard/index.js +13 -37
  27. package/dist/features/delivery/index.js +13 -37
  28. package/dist/features/knowledge/index.css +659 -0
  29. package/dist/features/knowledge/index.js +25 -248
  30. package/dist/features/lead-gen/index.d.ts +81 -0
  31. package/dist/features/lead-gen/index.js +13 -37
  32. package/dist/features/monitoring/index.js +13 -37
  33. package/dist/features/monitoring/requests/index.d.ts +69 -7
  34. package/dist/features/monitoring/requests/index.js +32 -41
  35. package/dist/features/operations/index.d.ts +79 -0
  36. package/dist/features/operations/index.js +13 -37
  37. package/dist/features/seo/index.js +1 -4
  38. package/dist/features/settings/index.js +13 -37
  39. package/dist/hooks/access/index.css +659 -0
  40. package/dist/hooks/access/index.js +19 -5
  41. package/dist/hooks/delivery/index.js +13 -37
  42. package/dist/hooks/index.d.ts +18 -6
  43. package/dist/hooks/index.js +13 -37
  44. package/dist/hooks/published.d.ts +18 -6
  45. package/dist/hooks/published.js +13 -37
  46. package/dist/index.d.ts +151 -7
  47. package/dist/index.js +14 -38
  48. package/dist/initialization/index.js +1 -1
  49. package/dist/knowledge/index.css +659 -0
  50. package/dist/knowledge/index.d.ts +81 -0
  51. package/dist/knowledge/index.js +25 -15
  52. package/dist/layout/index.css +659 -0
  53. package/dist/layout/index.d.ts +18 -2
  54. package/dist/layout/index.js +24 -7
  55. package/dist/organization/index.js +13 -37
  56. package/dist/provider/index.css +384 -0
  57. package/dist/provider/index.d.ts +120 -1
  58. package/dist/provider/index.js +18 -22
  59. package/dist/provider/published.css +533 -0
  60. package/dist/provider/published.d.ts +121 -2
  61. package/dist/provider/published.js +18 -17
  62. package/dist/test-utils/index.js +4 -6
  63. package/dist/theme/index.js +2 -5
  64. package/dist/theme/presets/index.js +1 -2
  65. package/dist/utils/index.js +1 -3
  66. package/package.json +3 -3
  67. package/dist/chunk-3KMDHCAR.js +0 -52
  68. package/dist/chunk-4DRI3G36.js +0 -1016
  69. package/dist/chunk-5EYJ2GIN.js +0 -122
  70. package/dist/chunk-66U7JOWV.js +0 -425
  71. package/dist/chunk-6D4LCJ52.js +0 -10
  72. package/dist/chunk-6EV47QQW.js +0 -340
  73. package/dist/chunk-6ROXVZ3L.js +0 -9
  74. package/dist/chunk-7MTWRSUZ.js +0 -357
  75. package/dist/chunk-7PHY5ONQ.js +0 -85
  76. package/dist/chunk-B2DZLPDL.js +0 -39
  77. package/dist/chunk-CLDCYJQT.js +0 -1
  78. package/dist/chunk-CTJBPF3Z.js +0 -734
  79. package/dist/chunk-DT3QYZVU.js +0 -23
  80. package/dist/chunk-IIMU5YAJ.js +0 -53
  81. package/dist/chunk-IUQAP4IO.js +0 -2131
  82. package/dist/chunk-J3FLIZY4.js +0 -423
  83. package/dist/chunk-K7GKKETO.js +0 -3157
  84. package/dist/chunk-L7GXUSCV.js +0 -215
  85. package/dist/chunk-LJDYY3XB.js +0 -133
  86. package/dist/chunk-NYBEU5TE.js +0 -118
  87. package/dist/chunk-RH5VWWSC.js +0 -624
  88. package/dist/chunk-SJNIOGVX.js +0 -112
  89. package/dist/chunk-TYRUKGGD.js +0 -46
  90. package/dist/chunk-WLOQ4IBG.js +0 -654
  91. package/dist/chunk-X4WBGKJQ.js +0 -138
  92. package/dist/chunk-X7D6SUKR.js +0 -1234
@@ -1,215 +0,0 @@
1
- import { topbarHeight, sidebarTransitionDuration, sidebarBottomSectionHeight } from './chunk-DT3QYZVU.js';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { createContext, useState, useContext } from 'react';
4
-
5
- var SubshellContainer = ({ children, className }) => {
6
- return /* @__PURE__ */ jsx(
7
- "div",
8
- {
9
- className,
10
- style: {
11
- display: "flex",
12
- height: "100%",
13
- width: "100%",
14
- position: "relative"
15
- },
16
- children
17
- }
18
- );
19
- };
20
- var SubshellRightSideContainer = ({ children, className }) => {
21
- return /* @__PURE__ */ jsx(
22
- "div",
23
- {
24
- className,
25
- style: {
26
- flex: 1,
27
- minWidth: 0,
28
- display: "flex",
29
- flexDirection: "column",
30
- overflow: "hidden"
31
- },
32
- children
33
- }
34
- );
35
- };
36
- var mdSpacing = 16;
37
- var SubshellContentContainer = ({ children, className }) => {
38
- return /* @__PURE__ */ jsx(
39
- "div",
40
- {
41
- className,
42
- style: {
43
- display: "flex",
44
- flexDirection: "column",
45
- flex: 1,
46
- overflowX: "clip",
47
- overflowY: "auto",
48
- minWidth: 0,
49
- minHeight: 0,
50
- padding: "var(--mantine-spacing-md)",
51
- paddingTop: `${topbarHeight + mdSpacing}px`
52
- },
53
- children
54
- }
55
- );
56
- };
57
- var SubshellSidebar = ({
58
- children,
59
- className,
60
- width,
61
- collapsible = true,
62
- defaultOpen = true
63
- }) => {
64
- const [isOpen, setIsOpen] = useState(defaultOpen);
65
- const effectiveWidth = collapsible && !isOpen ? 0 : width;
66
- if (!collapsible) {
67
- return /* @__PURE__ */ jsx(
68
- "aside",
69
- {
70
- className,
71
- style: {
72
- width: `${width}px`,
73
- flexShrink: 0,
74
- display: "flex",
75
- flexDirection: "column",
76
- backgroundColor: "color-mix(in srgb, var(--glass-background) 80%, transparent)",
77
- backdropFilter: "var(--glass-blur)",
78
- WebkitBackdropFilter: "var(--glass-blur)",
79
- borderRight: "1px solid var(--color-border)",
80
- boxShadow: "var(--card-shadow)",
81
- clipPath: "inset(-100px -100px -100px 0)",
82
- height: `calc(100vh - ${topbarHeight}px)`,
83
- minHeight: 0,
84
- marginTop: `${topbarHeight}px`,
85
- fontFamily: "var(--elevasis-font-family-subtitle)",
86
- overflow: "hidden"
87
- },
88
- children
89
- }
90
- );
91
- }
92
- return /* @__PURE__ */ jsxs(
93
- "div",
94
- {
95
- style: {
96
- position: "relative",
97
- flexShrink: 0,
98
- marginTop: `${topbarHeight}px`,
99
- height: `calc(100vh - ${topbarHeight}px)`,
100
- minHeight: 0
101
- },
102
- children: [
103
- /* @__PURE__ */ jsx(
104
- "aside",
105
- {
106
- className,
107
- style: {
108
- width: `${effectiveWidth}px`,
109
- flexShrink: 0,
110
- display: "flex",
111
- flexDirection: "column",
112
- backgroundColor: "color-mix(in srgb, var(--glass-background) 80%, transparent)",
113
- backdropFilter: "var(--glass-blur)",
114
- WebkitBackdropFilter: "var(--glass-blur)",
115
- borderRight: isOpen ? "1px solid var(--color-border)" : "none",
116
- boxShadow: isOpen ? "var(--card-shadow)" : "none",
117
- clipPath: isOpen ? "inset(-100px -100px -100px 0)" : "none",
118
- height: "100%",
119
- fontFamily: "var(--elevasis-font-family-subtitle)",
120
- overflow: "hidden",
121
- transition: `width ${sidebarTransitionDuration}ms var(--easing)`
122
- },
123
- children: /* @__PURE__ */ jsx(
124
- "div",
125
- {
126
- style: {
127
- width: `${width}px`,
128
- flexShrink: 0,
129
- height: "100%",
130
- minHeight: 0,
131
- display: "flex",
132
- flexDirection: "column",
133
- opacity: isOpen ? 1 : 0,
134
- transition: `opacity var(--duration-fast) var(--easing)`
135
- },
136
- children
137
- }
138
- )
139
- }
140
- ),
141
- /* @__PURE__ */ jsx(
142
- "button",
143
- {
144
- onClick: () => setIsOpen((prev) => !prev),
145
- style: {
146
- position: "absolute",
147
- right: 0,
148
- bottom: 0,
149
- transform: "translateX(100%)",
150
- width: "20px",
151
- // Match the live height of the outer Sidebar's bottom profile section.
152
- // SidebarBottomSection publishes --elevasis-sidebar-bottom-section-height
153
- // via ResizeObserver so this follows its actual height through
154
- // collapse/expand transitions. Falls back to the expanded-state
155
- // constant when rendered outside a Sidebar layout.
156
- height: `var(--elevasis-sidebar-bottom-section-height, ${sidebarBottomSectionHeight}px)`,
157
- display: "flex",
158
- alignItems: "center",
159
- justifyContent: "center",
160
- backgroundColor: "color-mix(in srgb, var(--glass-background) 80%, transparent)",
161
- backdropFilter: "var(--glass-blur)",
162
- WebkitBackdropFilter: "var(--glass-blur)",
163
- border: "1px solid var(--color-border)",
164
- borderLeft: "none",
165
- borderBottom: "none",
166
- borderRadius: "0 4px 0 0",
167
- cursor: "pointer",
168
- color: "var(--color-text-subtle)",
169
- padding: 0,
170
- zIndex: 10,
171
- transition: `color var(--duration-fast) var(--easing)`
172
- },
173
- "aria-label": isOpen ? "Collapse sidebar" : "Expand sidebar",
174
- children: /* @__PURE__ */ jsx(
175
- "svg",
176
- {
177
- width: "6",
178
- height: "10",
179
- viewBox: "0 0 8 12",
180
- fill: "none",
181
- style: {
182
- transform: isOpen ? void 0 : "rotate(180deg)",
183
- transition: `transform var(--duration-fast) var(--easing)`
184
- },
185
- children: /* @__PURE__ */ jsx(
186
- "path",
187
- {
188
- d: "M6 1L1 6L6 11",
189
- stroke: "currentColor",
190
- strokeWidth: "1.5",
191
- strokeLinecap: "round",
192
- strokeLinejoin: "round"
193
- }
194
- )
195
- }
196
- )
197
- }
198
- )
199
- ]
200
- }
201
- );
202
- };
203
- var AppearanceContext = createContext(null);
204
- function AppearanceProvider({ value, children }) {
205
- return /* @__PURE__ */ jsx(AppearanceContext.Provider, { value, children });
206
- }
207
- function useAppearance() {
208
- const ctx = useContext(AppearanceContext);
209
- if (!ctx) {
210
- throw new Error("useAppearance must be used within an AppearanceProvider (ElevasisCoreProvider)");
211
- }
212
- return ctx;
213
- }
214
-
215
- export { AppearanceContext, AppearanceProvider, SubshellContainer, SubshellContentContainer, SubshellRightSideContainer, SubshellSidebar, useAppearance };
@@ -1,133 +0,0 @@
1
- import { useAccess } from './chunk-7MTWRSUZ.js';
2
- import { useInitialization } from './chunk-6DO4PE3O.js';
3
- import { useAuthContext } from './chunk-BRJ3QZ4E.js';
4
- import { useRef, useCallback, useEffect } from 'react';
5
- import { useQueryClient } from '@tanstack/react-query';
6
- import { useNavigate, useLocation } from '@tanstack/react-router';
7
- import { jsx, Fragment } from 'react/jsx-runtime';
8
-
9
- function useStableAccessToken() {
10
- const { getAccessToken } = useAuthContext();
11
- const getAccessTokenRef = useRef(getAccessToken);
12
- getAccessTokenRef.current = getAccessToken;
13
- return useCallback(() => {
14
- return getAccessTokenRef.current();
15
- }, []);
16
- }
17
- function useSessionCheck() {
18
- const { user } = useAuthContext();
19
- const queryClient = useQueryClient();
20
- const isCheckingRef = useRef(false);
21
- const hadUserRef = useRef(false);
22
- if (user) {
23
- hadUserRef.current = true;
24
- }
25
- useEffect(() => {
26
- const handleVisibilityChange = async () => {
27
- if (isCheckingRef.current || document.visibilityState !== "visible") {
28
- return;
29
- }
30
- isCheckingRef.current = true;
31
- try {
32
- if (!user && hadUserRef.current) {
33
- window.location.replace("/login");
34
- return;
35
- }
36
- if (user) {
37
- await queryClient.cancelQueries();
38
- queryClient.invalidateQueries();
39
- }
40
- } finally {
41
- isCheckingRef.current = false;
42
- }
43
- };
44
- document.addEventListener("visibilitychange", handleVisibilityChange);
45
- window.addEventListener("focus", handleVisibilityChange);
46
- return () => {
47
- document.removeEventListener("visibilitychange", handleVisibilityChange);
48
- window.removeEventListener("focus", handleVisibilityChange);
49
- };
50
- }, [user, queryClient]);
51
- }
52
- function ProtectedRoute({
53
- children,
54
- redirectTo = "/login",
55
- fallback = null,
56
- errorFallback,
57
- waitForOrganization = true
58
- }) {
59
- const { userReady, allReady, isInitializing, error, retry } = useInitialization();
60
- const { signIn, canRecover } = useAuthContext();
61
- const navigate = useNavigate();
62
- const location = useLocation();
63
- const hasRedirected = useRef(false);
64
- const unauthenticated = !isInitializing && !userReady && error?.layer !== "profile";
65
- useEffect(() => {
66
- if (unauthenticated && !hasRedirected.current) {
67
- hasRedirected.current = true;
68
- const searchStr = location.searchStr ?? "";
69
- const returnTo = location.pathname + searchStr;
70
- if (canRecover()) {
71
- signIn({ state: { returnTo: returnTo !== "/" ? returnTo : void 0 } });
72
- } else {
73
- navigate({
74
- to: redirectTo,
75
- search: returnTo !== "/" ? { returnTo } : {}
76
- });
77
- }
78
- }
79
- }, [unauthenticated, signIn, canRecover, navigate, redirectTo, location]);
80
- if (isInitializing) {
81
- return /* @__PURE__ */ jsx(Fragment, { children: fallback });
82
- }
83
- if (error && error.layer !== "organization") {
84
- if (errorFallback) {
85
- return /* @__PURE__ */ jsx(Fragment, { children: errorFallback(error, retry) });
86
- }
87
- return null;
88
- }
89
- if (unauthenticated) {
90
- return /* @__PURE__ */ jsx(Fragment, { children: fallback });
91
- }
92
- if (waitForOrganization && !allReady && error?.layer !== "organization") {
93
- return /* @__PURE__ */ jsx(Fragment, { children: fallback });
94
- }
95
- return /* @__PURE__ */ jsx(Fragment, { children });
96
- }
97
- function useOptionalNavigate() {
98
- try {
99
- return useNavigate();
100
- } catch {
101
- return null;
102
- }
103
- }
104
- function renderFallback(fallback, answer) {
105
- return typeof fallback === "function" ? fallback(answer) : fallback ?? null;
106
- }
107
- function AccessGuard({
108
- accessKey,
109
- children,
110
- fallback = null,
111
- loadingFallback = null,
112
- redirectTo = null
113
- }) {
114
- const answer = useAccess(accessKey);
115
- const navigate = useOptionalNavigate();
116
- const hasRedirected = useRef(false);
117
- useEffect(() => {
118
- if (!answer.isReady || answer.allowed || !redirectTo || hasRedirected.current) return;
119
- hasRedirected.current = true;
120
- if (navigate) {
121
- navigate({ to: redirectTo });
122
- return;
123
- }
124
- if (typeof window !== "undefined") {
125
- window.location.assign(redirectTo);
126
- }
127
- }, [answer.allowed, answer.isReady, navigate, redirectTo]);
128
- if (!answer.isReady) return /* @__PURE__ */ jsx(Fragment, { children: loadingFallback });
129
- if (!answer.allowed) return /* @__PURE__ */ jsx(Fragment, { children: renderFallback(fallback, answer) });
130
- return /* @__PURE__ */ jsx(Fragment, { children });
131
- }
132
-
133
- export { AccessGuard, ProtectedRoute, useSessionCheck, useStableAccessToken };
@@ -1,118 +0,0 @@
1
- import { sidebarItemPadding, sidebarItemHeight, sidebarIconSize, sidebarIconStroke, sidebarIconInnerSize } from './chunk-DT3QYZVU.js';
2
- import { UnstyledButton, Group, Box, ThemeIcon } from '@mantine/core';
3
- import { IconChevronRight } from '@tabler/icons-react';
4
- import { jsx, jsxs } from 'react/jsx-runtime';
5
-
6
- var NavigationButton = ({
7
- icon: Icon,
8
- label,
9
- isCollapsed = false,
10
- hasSubItems = false,
11
- isExpanded = false,
12
- isActive = false,
13
- hasActiveBackground = false,
14
- onClick,
15
- style,
16
- transitionDuration = 200
17
- }) => {
18
- const activeColor = "var(--color-primary)";
19
- const textColor = isActive ? activeColor : "var(--color-text)";
20
- const bgColor = hasActiveBackground ? `color-mix(in srgb, ${activeColor} 10%, transparent)` : "transparent";
21
- return /* @__PURE__ */ jsx(
22
- UnstyledButton,
23
- {
24
- onClick: (event) => {
25
- event.preventDefault();
26
- event.stopPropagation();
27
- onClick?.();
28
- },
29
- style: {
30
- height: sidebarItemHeight,
31
- display: "flex",
32
- alignItems: "center",
33
- width: "100%",
34
- padding: sidebarItemPadding,
35
- color: textColor,
36
- backgroundColor: bgColor,
37
- transition: `all ${transitionDuration}ms var(--easing)`,
38
- cursor: "pointer",
39
- overflow: "hidden",
40
- borderRadius: "var(--mantine-radius-default)",
41
- ...style
42
- },
43
- onMouseEnter: (e) => {
44
- if (!hasActiveBackground) {
45
- e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
46
- }
47
- },
48
- onMouseLeave: (e) => {
49
- if (!hasActiveBackground) {
50
- e.currentTarget.style.backgroundColor = "transparent";
51
- }
52
- },
53
- children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: 0, style: { width: "100%", overflow: "hidden" }, children: [
54
- /* @__PURE__ */ jsxs(
55
- Box,
56
- {
57
- style: {
58
- display: "flex",
59
- alignItems: "center",
60
- flex: hasSubItems && !isCollapsed ? 1 : "initial",
61
- minWidth: 0,
62
- overflow: "hidden"
63
- },
64
- children: [
65
- /* @__PURE__ */ jsx(
66
- ThemeIcon,
67
- {
68
- variant: "light",
69
- size: sidebarIconSize,
70
- style: {
71
- backgroundColor: isActive ? activeColor : "var(--color-surface)",
72
- color: isActive ? "white" : activeColor,
73
- marginRight: isCollapsed ? 0 : "var(--mantine-spacing-sm)",
74
- transition: `margin ${transitionDuration}ms var(--easing)`,
75
- flexShrink: 0
76
- },
77
- children: /* @__PURE__ */ jsx(Icon, { size: sidebarIconInnerSize, stroke: sidebarIconStroke })
78
- }
79
- ),
80
- !isCollapsed && /* @__PURE__ */ jsx(
81
- Box,
82
- {
83
- style: {
84
- fontFamily: "var(--elevasis-font-family-subtitle)",
85
- fontSize: "var(--mantine-font-size-md)",
86
- fontWeight: isActive ? 600 : 500,
87
- color: textColor,
88
- transition: `opacity ${transitionDuration}ms var(--easing)`,
89
- whiteSpace: "nowrap",
90
- overflow: "hidden",
91
- textOverflow: "ellipsis"
92
- },
93
- children: label
94
- }
95
- )
96
- ]
97
- }
98
- ),
99
- hasSubItems && !isCollapsed && /* @__PURE__ */ jsx(
100
- IconChevronRight,
101
- {
102
- size: 14,
103
- stroke: 1.5,
104
- style: {
105
- transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)",
106
- transition: `transform var(--duration-fast) var(--easing)`,
107
- color: "var(--color-text-subtle)",
108
- flexShrink: 0,
109
- marginLeft: "auto"
110
- }
111
- }
112
- )
113
- ] })
114
- }
115
- );
116
- };
117
-
118
- export { NavigationButton };