@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.
Files changed (97) hide show
  1. package/dist/api/index.d.ts +87 -0
  2. package/dist/api/index.js +3 -0
  3. package/dist/auth/context.d.ts +19 -0
  4. package/dist/auth/context.js +1 -0
  5. package/dist/auth/index.d.ts +85 -0
  6. package/dist/auth/index.js +3 -0
  7. package/dist/chunk-3KMDHCAR.js +52 -0
  8. package/dist/chunk-5UWFGBFM.js +129 -0
  9. package/dist/chunk-6BJOYF6E.js +8 -0
  10. package/dist/chunk-6M6OLGQY.js +36 -0
  11. package/dist/chunk-7AI5ZYJ4.js +202 -0
  12. package/dist/chunk-7PLEQFHO.js +18 -0
  13. package/dist/chunk-GDV44UWF.js +138 -0
  14. package/dist/chunk-GEFB5YIR.js +338 -0
  15. package/dist/chunk-HBRMWW6V.js +43 -0
  16. package/dist/chunk-HUWJXLLF.js +681 -0
  17. package/dist/chunk-J3FALDQE.js +176 -0
  18. package/dist/chunk-JKERRYVS.js +109 -0
  19. package/dist/chunk-KA7LO7U5.js +28 -0
  20. package/dist/chunk-LHQTTUL2.js +27 -0
  21. package/dist/chunk-MAAS6CGR.js +1299 -0
  22. package/dist/chunk-NE36BUGQ.js +146 -0
  23. package/dist/chunk-NGXCFBCS.js +398 -0
  24. package/dist/chunk-OEYU5O27.js +235 -0
  25. package/dist/chunk-OUHGHTE7.js +748 -0
  26. package/dist/chunk-OXVOHOP3.js +661 -0
  27. package/dist/chunk-PSLKGOBZ.js +58 -0
  28. package/dist/chunk-PYL4XW6H.js +107 -0
  29. package/dist/chunk-Q47SPRY7.js +1 -0
  30. package/dist/chunk-Q7DJKLEN.js +18 -0
  31. package/dist/chunk-RJCA5672.js +1664 -0
  32. package/dist/chunk-S66I2PYB.js +748 -0
  33. package/dist/chunk-W7ZBF5AA.js +1 -0
  34. package/dist/chunk-WNWKOCGJ.js +1067 -0
  35. package/dist/chunk-XCYKC6OZ.js +1 -0
  36. package/dist/chunk-YULUKCS6.js +56 -0
  37. package/dist/chunk-YZ6GTZXL.js +48 -0
  38. package/dist/chunk-ZGHDPDTF.js +379 -0
  39. package/dist/components/command-queue/index.css +53 -0
  40. package/dist/components/command-queue/index.d.ts +204 -0
  41. package/dist/components/command-queue/index.js +10 -0
  42. package/dist/components/forms/index.d.ts +56 -0
  43. package/dist/components/forms/index.js +2 -0
  44. package/dist/components/index.css +443 -0
  45. package/dist/components/index.d.ts +1354 -0
  46. package/dist/components/index.js +18 -0
  47. package/dist/components/monitoring/index.d.ts +66 -0
  48. package/dist/components/monitoring/index.js +2 -0
  49. package/dist/components/navigation/index.d.ts +54 -0
  50. package/dist/components/navigation/index.js +91 -0
  51. package/dist/components/notifications/index.d.ts +52 -0
  52. package/dist/components/notifications/index.js +4 -0
  53. package/dist/components/resource-definition/index.css +388 -0
  54. package/dist/components/resource-definition/index.d.ts +301 -0
  55. package/dist/components/resource-definition/index.js +3 -0
  56. package/dist/display/index.css +53 -0
  57. package/dist/display/index.d.ts +606 -0
  58. package/dist/display/index.js +6 -0
  59. package/dist/execution/index.css +388 -0
  60. package/dist/execution/index.d.ts +1090 -0
  61. package/dist/execution/index.js +4 -0
  62. package/dist/graph/index.css +388 -0
  63. package/dist/graph/index.d.ts +429 -0
  64. package/dist/graph/index.js +1 -0
  65. package/dist/hooks/index.d.ts +1927 -0
  66. package/dist/hooks/index.js +6 -0
  67. package/dist/hooks/published.d.ts +1653 -0
  68. package/dist/hooks/published.js +4 -0
  69. package/dist/index.css +505 -0
  70. package/dist/index.d.ts +7284 -0
  71. package/dist/index.js +31 -0
  72. package/dist/initialization/index.d.ts +2325 -0
  73. package/dist/initialization/index.js +4 -0
  74. package/dist/organization/index.d.ts +225 -0
  75. package/dist/organization/index.js +4 -0
  76. package/dist/profile/index.d.ts +2265 -0
  77. package/dist/profile/index.js +3 -0
  78. package/dist/provider/index.css +61 -0
  79. package/dist/provider/index.d.ts +291 -0
  80. package/dist/provider/index.js +7 -0
  81. package/dist/provider/published.d.ts +198 -0
  82. package/dist/provider/published.js +6 -0
  83. package/dist/router/context.d.ts +19 -0
  84. package/dist/router/context.js +1 -0
  85. package/dist/router/index.d.ts +31 -0
  86. package/dist/router/index.js +2 -0
  87. package/dist/sse/index.d.ts +83 -0
  88. package/dist/sse/index.js +185 -0
  89. package/dist/supabase/index.d.ts +4289 -0
  90. package/dist/supabase/index.js +47 -0
  91. package/dist/typeform/index.d.ts +458 -0
  92. package/dist/typeform/index.js +1976 -0
  93. package/dist/typeform/schemas.d.ts +67 -0
  94. package/dist/typeform/schemas.js +1 -0
  95. package/dist/utils/index.d.ts +177 -0
  96. package/dist/utils/index.js +1 -0
  97. 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 };