@elevasis/ui 1.0.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.
- package/dist/api/index.d.ts +87 -0
- package/dist/api/index.js +3 -0
- package/dist/auth/context.d.ts +19 -0
- package/dist/auth/context.js +1 -0
- package/dist/auth/index.d.ts +85 -0
- package/dist/auth/index.js +3 -0
- package/dist/chunk-3KMDHCAR.js +52 -0
- package/dist/chunk-5UWFGBFM.js +129 -0
- package/dist/chunk-6BJOYF6E.js +8 -0
- package/dist/chunk-6M6OLGQY.js +36 -0
- package/dist/chunk-7AI5ZYJ4.js +202 -0
- package/dist/chunk-7PLEQFHO.js +18 -0
- package/dist/chunk-GDV44UWF.js +138 -0
- package/dist/chunk-GEFB5YIR.js +338 -0
- package/dist/chunk-HBRMWW6V.js +43 -0
- package/dist/chunk-HUWJXLLF.js +681 -0
- package/dist/chunk-J3FALDQE.js +176 -0
- package/dist/chunk-JKERRYVS.js +109 -0
- package/dist/chunk-KA7LO7U5.js +28 -0
- package/dist/chunk-LHQTTUL2.js +27 -0
- package/dist/chunk-MAAS6CGR.js +1299 -0
- package/dist/chunk-NE36BUGQ.js +146 -0
- package/dist/chunk-NGXCFBCS.js +398 -0
- package/dist/chunk-OEYU5O27.js +235 -0
- package/dist/chunk-OUHGHTE7.js +748 -0
- package/dist/chunk-OXVOHOP3.js +661 -0
- package/dist/chunk-PSLKGOBZ.js +58 -0
- package/dist/chunk-PYL4XW6H.js +107 -0
- package/dist/chunk-Q47SPRY7.js +1 -0
- package/dist/chunk-Q7DJKLEN.js +18 -0
- package/dist/chunk-RJCA5672.js +1664 -0
- package/dist/chunk-S66I2PYB.js +748 -0
- package/dist/chunk-W7ZBF5AA.js +1 -0
- package/dist/chunk-WNWKOCGJ.js +1067 -0
- package/dist/chunk-XCYKC6OZ.js +1 -0
- package/dist/chunk-YULUKCS6.js +56 -0
- package/dist/chunk-YZ6GTZXL.js +48 -0
- package/dist/chunk-ZGHDPDTF.js +379 -0
- package/dist/components/command-queue/index.css +53 -0
- package/dist/components/command-queue/index.d.ts +204 -0
- package/dist/components/command-queue/index.js +10 -0
- package/dist/components/forms/index.d.ts +56 -0
- package/dist/components/forms/index.js +2 -0
- package/dist/components/index.css +443 -0
- package/dist/components/index.d.ts +1354 -0
- package/dist/components/index.js +18 -0
- package/dist/components/monitoring/index.d.ts +66 -0
- package/dist/components/monitoring/index.js +2 -0
- package/dist/components/navigation/index.d.ts +54 -0
- package/dist/components/navigation/index.js +91 -0
- package/dist/components/notifications/index.d.ts +52 -0
- package/dist/components/notifications/index.js +4 -0
- package/dist/components/resource-definition/index.css +388 -0
- package/dist/components/resource-definition/index.d.ts +301 -0
- package/dist/components/resource-definition/index.js +3 -0
- package/dist/display/index.css +53 -0
- package/dist/display/index.d.ts +606 -0
- package/dist/display/index.js +6 -0
- package/dist/execution/index.css +388 -0
- package/dist/execution/index.d.ts +1090 -0
- package/dist/execution/index.js +4 -0
- package/dist/graph/index.css +388 -0
- package/dist/graph/index.d.ts +429 -0
- package/dist/graph/index.js +1 -0
- package/dist/hooks/index.d.ts +1927 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/published.d.ts +1653 -0
- package/dist/hooks/published.js +4 -0
- package/dist/index.css +505 -0
- package/dist/index.d.ts +7284 -0
- package/dist/index.js +31 -0
- package/dist/initialization/index.d.ts +2325 -0
- package/dist/initialization/index.js +4 -0
- package/dist/organization/index.d.ts +225 -0
- package/dist/organization/index.js +4 -0
- package/dist/profile/index.d.ts +2265 -0
- package/dist/profile/index.js +3 -0
- package/dist/provider/index.css +61 -0
- package/dist/provider/index.d.ts +291 -0
- package/dist/provider/index.js +7 -0
- package/dist/provider/published.d.ts +198 -0
- package/dist/provider/published.js +6 -0
- package/dist/router/context.d.ts +19 -0
- package/dist/router/context.js +1 -0
- package/dist/router/index.d.ts +31 -0
- package/dist/router/index.js +2 -0
- package/dist/sse/index.d.ts +83 -0
- package/dist/sse/index.js +185 -0
- package/dist/supabase/index.d.ts +4289 -0
- package/dist/supabase/index.js +47 -0
- package/dist/typeform/index.d.ts +458 -0
- package/dist/typeform/index.js +1976 -0
- package/dist/typeform/schemas.d.ts +67 -0
- package/dist/typeform/schemas.js +1 -0
- package/dist/utils/index.d.ts +177 -0
- package/dist/utils/index.js +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { TextInput, Textarea, Radio, Stack, Checkbox, Select, NumberInput } from '@mantine/core';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/components/forms/FormFieldRenderer.tsx
|
|
5
|
+
function FormFieldRenderer({ field, form, richTextRenderer }) {
|
|
6
|
+
const commonProps = {
|
|
7
|
+
label: field.label,
|
|
8
|
+
description: field.description,
|
|
9
|
+
placeholder: field.placeholder,
|
|
10
|
+
required: field.required,
|
|
11
|
+
...form.getInputProps(field.name)
|
|
12
|
+
};
|
|
13
|
+
switch (field.type) {
|
|
14
|
+
case "text":
|
|
15
|
+
return /* @__PURE__ */ jsx(TextInput, { ...commonProps });
|
|
16
|
+
case "textarea":
|
|
17
|
+
return /* @__PURE__ */ jsx(Textarea, { ...commonProps, minRows: 3, autosize: true });
|
|
18
|
+
case "number":
|
|
19
|
+
return /* @__PURE__ */ jsx(NumberInput, { ...commonProps, min: field.min, max: field.max });
|
|
20
|
+
case "select":
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
Select,
|
|
23
|
+
{
|
|
24
|
+
...commonProps,
|
|
25
|
+
data: field.options?.map((opt) => ({
|
|
26
|
+
label: opt.label,
|
|
27
|
+
value: String(opt.value)
|
|
28
|
+
})) || []
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
case "checkbox":
|
|
32
|
+
return /* @__PURE__ */ jsx(Checkbox, { ...commonProps, ...form.getInputProps(field.name, { type: "checkbox" }) });
|
|
33
|
+
case "radio":
|
|
34
|
+
return /* @__PURE__ */ jsx(Radio.Group, { ...commonProps, children: /* @__PURE__ */ jsx(Stack, { gap: "xs", children: field.options?.map((opt) => /* @__PURE__ */ jsx(Radio, { value: String(opt.value), label: opt.label }, opt.value)) }) });
|
|
35
|
+
case "richtext": {
|
|
36
|
+
const inputProps = form.getInputProps(field.name);
|
|
37
|
+
if (richTextRenderer) {
|
|
38
|
+
return richTextRenderer({
|
|
39
|
+
content: inputProps.value || "",
|
|
40
|
+
onChange: (content) => form.setFieldValue(field.name, content),
|
|
41
|
+
placeholder: field.placeholder
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
Textarea,
|
|
46
|
+
{
|
|
47
|
+
...commonProps,
|
|
48
|
+
minRows: 5,
|
|
49
|
+
autosize: true
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
default:
|
|
54
|
+
return /* @__PURE__ */ jsx(TextInput, { ...commonProps });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { FormFieldRenderer };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { useMarkAsRead, useMarkAllAsRead, useNotificationCount, useNotifications } from './chunk-JKERRYVS.js';
|
|
2
|
+
import { UnstyledButton, Group, Box, Stack, Text, Center, Loader, Button, Divider, ScrollArea, Popover, Tooltip, Indicator, ActionIcon } from '@mantine/core';
|
|
3
|
+
import { IconCircle, IconCircleFilled, IconBell } from '@tabler/icons-react';
|
|
4
|
+
import { formatDistanceToNow } from 'date-fns';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
import { useDisclosure } from '@mantine/hooks';
|
|
7
|
+
|
|
8
|
+
var categoryColors = {
|
|
9
|
+
info: "blue",
|
|
10
|
+
queue: "cyan",
|
|
11
|
+
alert: "yellow",
|
|
12
|
+
error: "red",
|
|
13
|
+
system: "gray"
|
|
14
|
+
};
|
|
15
|
+
function NotificationItem({ notification, onClose, onNavigate }) {
|
|
16
|
+
const markAsRead = useMarkAsRead();
|
|
17
|
+
const handleClick = async () => {
|
|
18
|
+
if (!notification.read) {
|
|
19
|
+
await markAsRead.mutateAsync(notification.id);
|
|
20
|
+
}
|
|
21
|
+
if (notification.actionUrl) {
|
|
22
|
+
onNavigate?.(notification.actionUrl);
|
|
23
|
+
}
|
|
24
|
+
onClose?.();
|
|
25
|
+
};
|
|
26
|
+
const categoryColor = categoryColors[notification.category] || "gray";
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
UnstyledButton,
|
|
29
|
+
{
|
|
30
|
+
onClick: handleClick,
|
|
31
|
+
style: {
|
|
32
|
+
width: "100%",
|
|
33
|
+
padding: "12px",
|
|
34
|
+
backgroundColor: "transparent",
|
|
35
|
+
transition: "background-color var(--duration-fast) var(--easing)"
|
|
36
|
+
},
|
|
37
|
+
styles: {
|
|
38
|
+
root: {
|
|
39
|
+
"&:hover": {
|
|
40
|
+
backgroundColor: "var(--color-surface-hover)"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
children: /* @__PURE__ */ jsxs(Group, { gap: "sm", align: "flex-start", wrap: "nowrap", children: [
|
|
45
|
+
/* @__PURE__ */ jsx(Box, { mt: 4, children: notification.read ? /* @__PURE__ */ jsx(IconCircle, { size: 12, color: "var(--mantine-color-gray-5)" }) : /* @__PURE__ */ jsx(IconCircleFilled, { size: 12, color: `var(--mantine-color-${categoryColor}-6)` }) }),
|
|
46
|
+
/* @__PURE__ */ jsxs(Stack, { gap: 4, style: { flex: 1 }, children: [
|
|
47
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", fw: notification.read ? 400 : 600, children: notification.title }),
|
|
48
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", lineClamp: 2, children: notification.message }),
|
|
49
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatDistanceToNow(new Date(notification.createdAt), { addSuffix: true }) })
|
|
50
|
+
] })
|
|
51
|
+
] })
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function NotificationList({ notifications, isLoading, onClose, onNavigate }) {
|
|
56
|
+
if (isLoading) {
|
|
57
|
+
return /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, { size: "sm" }) });
|
|
58
|
+
}
|
|
59
|
+
if (notifications.length === 0) {
|
|
60
|
+
return /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "No notifications" }) });
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ jsx(Stack, { gap: 0, children: notifications.map((notification) => /* @__PURE__ */ jsx(NotificationItem, { notification, onClose, onNavigate }, notification.id)) });
|
|
63
|
+
}
|
|
64
|
+
function NotificationPanel({ notifications, isLoading, onClose, onNavigate }) {
|
|
65
|
+
const markAllAsRead = useMarkAllAsRead();
|
|
66
|
+
const hasUnread = notifications.some((n) => !n.read);
|
|
67
|
+
const handleMarkAllAsRead = async () => {
|
|
68
|
+
await markAllAsRead.mutateAsync();
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
71
|
+
/* @__PURE__ */ jsxs(Group, { justify: "space-between", p: "md", pb: "sm", children: [
|
|
72
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, style: { fontFamily: "var(--mantine-font-family-headings)" }, children: "Notifications" }),
|
|
73
|
+
hasUnread && /* @__PURE__ */ jsx(Button, { variant: "subtle", size: "xs", onClick: handleMarkAllAsRead, loading: markAllAsRead.isPending, children: "Mark all as read" })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
76
|
+
/* @__PURE__ */ jsx(ScrollArea, { h: 400, type: "auto", children: /* @__PURE__ */ jsx(
|
|
77
|
+
NotificationList,
|
|
78
|
+
{
|
|
79
|
+
notifications,
|
|
80
|
+
isLoading,
|
|
81
|
+
onClose,
|
|
82
|
+
onNavigate
|
|
83
|
+
}
|
|
84
|
+
) })
|
|
85
|
+
] });
|
|
86
|
+
}
|
|
87
|
+
function NotificationBell({ unreadCount, onNavigate }) {
|
|
88
|
+
const [opened, { toggle, close }] = useDisclosure(false);
|
|
89
|
+
const { data: apiCount = 0 } = useNotificationCount();
|
|
90
|
+
const { data, isLoading } = useNotifications({ limit: 20 });
|
|
91
|
+
const notifications = data?.notifications ?? [];
|
|
92
|
+
const count = unreadCount ?? apiCount;
|
|
93
|
+
return /* @__PURE__ */ jsxs(Popover, { opened, onChange: toggle, position: "bottom-end", width: 400, children: [
|
|
94
|
+
/* @__PURE__ */ jsx(Tooltip, { label: "Notifications", disabled: opened, children: /* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsx(Indicator, { label: count > 99 ? "99+" : count, disabled: count === 0, size: 16, offset: 4, children: /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", size: "lg", onClick: toggle, children: /* @__PURE__ */ jsx(IconBell, { size: 20, color: "var(--color-text-subtle)" }) }) }) }) }),
|
|
95
|
+
/* @__PURE__ */ jsx(Popover.Dropdown, { p: 0, children: /* @__PURE__ */ jsx(
|
|
96
|
+
NotificationPanel,
|
|
97
|
+
{
|
|
98
|
+
notifications,
|
|
99
|
+
isLoading,
|
|
100
|
+
onClose: close,
|
|
101
|
+
onNavigate
|
|
102
|
+
}
|
|
103
|
+
) })
|
|
104
|
+
] });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { NotificationBell, NotificationItem, NotificationList, NotificationPanel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createContext, useContext, createElement } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/router/context.ts
|
|
4
|
+
var RouterContext = createContext(null);
|
|
5
|
+
function useRouterContext() {
|
|
6
|
+
const ctx = useContext(RouterContext);
|
|
7
|
+
if (!ctx) {
|
|
8
|
+
throw new Error(
|
|
9
|
+
"useRouterContext must be used within a RouterProvider. Wrap your app with <TanStackRouterBridge> or a custom RouterProvider."
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
return ctx;
|
|
13
|
+
}
|
|
14
|
+
function RouterProvider({ value, children }) {
|
|
15
|
+
return createElement(RouterContext.Provider, { value }, children);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { RouterProvider, useRouterContext };
|