@questpie/admin 0.0.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 (203) hide show
  1. package/.turbo/turbo-build.log +108 -0
  2. package/CHANGELOG.md +10 -0
  3. package/README.md +556 -0
  4. package/STATUS.md +917 -0
  5. package/VALIDATION.md +602 -0
  6. package/components.json +24 -0
  7. package/dist/__tests__/setup.mjs +38 -0
  8. package/dist/__tests__/test-utils.mjs +45 -0
  9. package/dist/__tests__/vitest.d.mjs +3 -0
  10. package/dist/components/admin-app.mjs +69 -0
  11. package/dist/components/fields/array-field.mjs +190 -0
  12. package/dist/components/fields/checkbox-field.mjs +34 -0
  13. package/dist/components/fields/custom-field.mjs +32 -0
  14. package/dist/components/fields/date-field.mjs +41 -0
  15. package/dist/components/fields/datetime-field.mjs +42 -0
  16. package/dist/components/fields/email-field.mjs +37 -0
  17. package/dist/components/fields/embedded-collection.mjs +253 -0
  18. package/dist/components/fields/field-types.mjs +1 -0
  19. package/dist/components/fields/field-utils.mjs +10 -0
  20. package/dist/components/fields/field-wrapper.mjs +34 -0
  21. package/dist/components/fields/index.mjs +23 -0
  22. package/dist/components/fields/json-field.mjs +243 -0
  23. package/dist/components/fields/locale-badge.mjs +16 -0
  24. package/dist/components/fields/number-field.mjs +39 -0
  25. package/dist/components/fields/password-field.mjs +37 -0
  26. package/dist/components/fields/relation-field.mjs +104 -0
  27. package/dist/components/fields/relation-picker.mjs +229 -0
  28. package/dist/components/fields/relation-select.mjs +188 -0
  29. package/dist/components/fields/rich-text-editor/index.mjs +897 -0
  30. package/dist/components/fields/select-field.mjs +41 -0
  31. package/dist/components/fields/switch-field.mjs +34 -0
  32. package/dist/components/fields/text-field.mjs +38 -0
  33. package/dist/components/fields/textarea-field.mjs +38 -0
  34. package/dist/components/index.mjs +59 -0
  35. package/dist/components/primitives/checkbox-input.mjs +127 -0
  36. package/dist/components/primitives/date-input.mjs +303 -0
  37. package/dist/components/primitives/index.mjs +12 -0
  38. package/dist/components/primitives/number-input.mjs +104 -0
  39. package/dist/components/primitives/select-input.mjs +177 -0
  40. package/dist/components/primitives/tag-input.mjs +135 -0
  41. package/dist/components/primitives/text-input.mjs +39 -0
  42. package/dist/components/primitives/textarea-input.mjs +37 -0
  43. package/dist/components/primitives/toggle-input.mjs +31 -0
  44. package/dist/components/primitives/types.mjs +12 -0
  45. package/dist/components/ui/accordion.mjs +55 -0
  46. package/dist/components/ui/avatar.mjs +54 -0
  47. package/dist/components/ui/badge.mjs +34 -0
  48. package/dist/components/ui/button.mjs +48 -0
  49. package/dist/components/ui/card.mjs +58 -0
  50. package/dist/components/ui/checkbox.mjs +21 -0
  51. package/dist/components/ui/combobox.mjs +163 -0
  52. package/dist/components/ui/dialog.mjs +95 -0
  53. package/dist/components/ui/dropdown-menu.mjs +138 -0
  54. package/dist/components/ui/field.mjs +113 -0
  55. package/dist/components/ui/input-group.mjs +82 -0
  56. package/dist/components/ui/input.mjs +17 -0
  57. package/dist/components/ui/label.mjs +15 -0
  58. package/dist/components/ui/popover.mjs +56 -0
  59. package/dist/components/ui/scroll-area.mjs +38 -0
  60. package/dist/components/ui/select.mjs +100 -0
  61. package/dist/components/ui/separator.mjs +16 -0
  62. package/dist/components/ui/sheet.mjs +90 -0
  63. package/dist/components/ui/sidebar.mjs +387 -0
  64. package/dist/components/ui/skeleton.mjs +14 -0
  65. package/dist/components/ui/spinner.mjs +16 -0
  66. package/dist/components/ui/switch.mjs +22 -0
  67. package/dist/components/ui/table.mjs +68 -0
  68. package/dist/components/ui/tabs.mjs +48 -0
  69. package/dist/components/ui/textarea.mjs +15 -0
  70. package/dist/components/ui/tooltip.mjs +44 -0
  71. package/dist/config/component-registry.mjs +38 -0
  72. package/dist/config/index.mjs +129 -0
  73. package/dist/hooks/admin-provider.mjs +70 -0
  74. package/dist/hooks/index.mjs +7 -0
  75. package/dist/hooks/store.mjs +178 -0
  76. package/dist/hooks/use-auth.mjs +76 -0
  77. package/dist/hooks/use-collection-db.mjs +146 -0
  78. package/dist/hooks/use-collection.mjs +112 -0
  79. package/dist/hooks/use-global.mjs +46 -0
  80. package/dist/hooks/use-mobile.mjs +20 -0
  81. package/dist/lib/utils.mjs +10 -0
  82. package/dist/styles/index.css +336 -0
  83. package/dist/styles/index.mjs +1 -0
  84. package/dist/utils/index.mjs +9 -0
  85. package/dist/views/auth/auth-layout.mjs +52 -0
  86. package/dist/views/auth/forgot-password-form.mjs +148 -0
  87. package/dist/views/auth/index.mjs +6 -0
  88. package/dist/views/auth/login-form.mjs +156 -0
  89. package/dist/views/auth/reset-password-form.mjs +184 -0
  90. package/dist/views/collection/auto-form-fields.mjs +525 -0
  91. package/dist/views/collection/collection-form.mjs +91 -0
  92. package/dist/views/collection/collection-list.mjs +76 -0
  93. package/dist/views/collection/form-field.mjs +42 -0
  94. package/dist/views/collection/index.mjs +6 -0
  95. package/dist/views/common/index.mjs +4 -0
  96. package/dist/views/common/locale-switcher.mjs +39 -0
  97. package/dist/views/common/version-history.mjs +272 -0
  98. package/dist/views/index.mjs +9 -0
  99. package/dist/views/layout/admin-layout.mjs +40 -0
  100. package/dist/views/layout/admin-router.mjs +95 -0
  101. package/dist/views/layout/admin-sidebar.mjs +63 -0
  102. package/dist/views/layout/index.mjs +5 -0
  103. package/package.json +276 -0
  104. package/src/__tests__/setup.ts +44 -0
  105. package/src/__tests__/test-utils.tsx +49 -0
  106. package/src/__tests__/vitest.d.ts +9 -0
  107. package/src/components/admin-app.tsx +221 -0
  108. package/src/components/fields/array-field.tsx +237 -0
  109. package/src/components/fields/checkbox-field.tsx +47 -0
  110. package/src/components/fields/custom-field.tsx +50 -0
  111. package/src/components/fields/date-field.tsx +65 -0
  112. package/src/components/fields/datetime-field.tsx +67 -0
  113. package/src/components/fields/email-field.tsx +51 -0
  114. package/src/components/fields/embedded-collection.tsx +315 -0
  115. package/src/components/fields/field-types.ts +162 -0
  116. package/src/components/fields/field-utils.ts +6 -0
  117. package/src/components/fields/field-wrapper.tsx +52 -0
  118. package/src/components/fields/index.ts +66 -0
  119. package/src/components/fields/json-field.tsx +440 -0
  120. package/src/components/fields/locale-badge.tsx +15 -0
  121. package/src/components/fields/number-field.tsx +57 -0
  122. package/src/components/fields/password-field.tsx +51 -0
  123. package/src/components/fields/relation-field.tsx +243 -0
  124. package/src/components/fields/relation-picker.tsx +402 -0
  125. package/src/components/fields/relation-select.tsx +327 -0
  126. package/src/components/fields/rich-text-editor/index.tsx +1337 -0
  127. package/src/components/fields/select-field.tsx +61 -0
  128. package/src/components/fields/switch-field.tsx +47 -0
  129. package/src/components/fields/text-field.tsx +55 -0
  130. package/src/components/fields/textarea-field.tsx +55 -0
  131. package/src/components/index.ts +40 -0
  132. package/src/components/primitives/checkbox-input.tsx +193 -0
  133. package/src/components/primitives/date-input.tsx +401 -0
  134. package/src/components/primitives/index.ts +24 -0
  135. package/src/components/primitives/number-input.tsx +132 -0
  136. package/src/components/primitives/select-input.tsx +296 -0
  137. package/src/components/primitives/tag-input.tsx +200 -0
  138. package/src/components/primitives/text-input.tsx +49 -0
  139. package/src/components/primitives/textarea-input.tsx +46 -0
  140. package/src/components/primitives/toggle-input.tsx +36 -0
  141. package/src/components/primitives/types.ts +235 -0
  142. package/src/components/ui/accordion.tsx +72 -0
  143. package/src/components/ui/avatar.tsx +106 -0
  144. package/src/components/ui/badge.tsx +48 -0
  145. package/src/components/ui/button.tsx +53 -0
  146. package/src/components/ui/card.tsx +94 -0
  147. package/src/components/ui/checkbox.tsx +27 -0
  148. package/src/components/ui/combobox.tsx +290 -0
  149. package/src/components/ui/dialog.tsx +151 -0
  150. package/src/components/ui/dropdown-menu.tsx +254 -0
  151. package/src/components/ui/field.tsx +227 -0
  152. package/src/components/ui/input-group.tsx +149 -0
  153. package/src/components/ui/input.tsx +20 -0
  154. package/src/components/ui/label.tsx +18 -0
  155. package/src/components/ui/popover.tsx +88 -0
  156. package/src/components/ui/scroll-area.tsx +53 -0
  157. package/src/components/ui/select.tsx +192 -0
  158. package/src/components/ui/separator.tsx +23 -0
  159. package/src/components/ui/sheet.tsx +127 -0
  160. package/src/components/ui/sidebar.tsx +723 -0
  161. package/src/components/ui/skeleton.tsx +13 -0
  162. package/src/components/ui/spinner.tsx +10 -0
  163. package/src/components/ui/switch.tsx +32 -0
  164. package/src/components/ui/table.tsx +99 -0
  165. package/src/components/ui/tabs.tsx +82 -0
  166. package/src/components/ui/textarea.tsx +18 -0
  167. package/src/components/ui/tooltip.tsx +70 -0
  168. package/src/config/component-registry.ts +190 -0
  169. package/src/config/index.ts +1099 -0
  170. package/src/hooks/README.md +269 -0
  171. package/src/hooks/admin-provider.tsx +110 -0
  172. package/src/hooks/index.ts +41 -0
  173. package/src/hooks/store.ts +248 -0
  174. package/src/hooks/use-auth.ts +168 -0
  175. package/src/hooks/use-collection-db.ts +209 -0
  176. package/src/hooks/use-collection.ts +156 -0
  177. package/src/hooks/use-global.ts +69 -0
  178. package/src/hooks/use-mobile.ts +21 -0
  179. package/src/lib/utils.ts +6 -0
  180. package/src/styles/index.css +340 -0
  181. package/src/utils/index.ts +6 -0
  182. package/src/views/auth/auth-layout.tsx +77 -0
  183. package/src/views/auth/forgot-password-form.tsx +192 -0
  184. package/src/views/auth/index.ts +21 -0
  185. package/src/views/auth/login-form.tsx +229 -0
  186. package/src/views/auth/reset-password-form.tsx +232 -0
  187. package/src/views/collection/auto-form-fields.tsx +982 -0
  188. package/src/views/collection/collection-form.tsx +186 -0
  189. package/src/views/collection/collection-list.tsx +223 -0
  190. package/src/views/collection/form-field.tsx +52 -0
  191. package/src/views/collection/index.ts +15 -0
  192. package/src/views/common/index.ts +8 -0
  193. package/src/views/common/locale-switcher.tsx +45 -0
  194. package/src/views/common/version-history.tsx +406 -0
  195. package/src/views/index.ts +25 -0
  196. package/src/views/layout/admin-layout.tsx +117 -0
  197. package/src/views/layout/admin-router.tsx +206 -0
  198. package/src/views/layout/admin-sidebar.tsx +185 -0
  199. package/src/views/layout/index.ts +12 -0
  200. package/tsconfig.json +13 -0
  201. package/tsconfig.tsbuildinfo +1 -0
  202. package/tsdown.config.ts +13 -0
  203. package/vitest.config.ts +29 -0
@@ -0,0 +1,112 @@
1
+ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
2
+ import { useAdminContext } from "./admin-provider";
3
+ import { createQuestpieQueryOptions } from "@questpie/tanstack-query";
4
+
5
+ //#region src/hooks/use-collection.ts
6
+ /**
7
+ * Hook to fetch collection list with filters, sorting, pagination
8
+ */
9
+ function useCollectionList(collection, options, queryOptions) {
10
+ const { client, locale } = useAdminContext();
11
+ return useQuery({
12
+ ...createQuestpieQueryOptions(client, { keyPrefix: [
13
+ "qcms",
14
+ "locale",
15
+ locale ?? "default"
16
+ ] }).collections[collection].find(options),
17
+ ...queryOptions
18
+ });
19
+ }
20
+ /**
21
+ * Hook to fetch single collection item
22
+ */
23
+ function useCollectionItem(collection, id, options, queryOptions) {
24
+ const { client, locale } = useAdminContext();
25
+ return useQuery({
26
+ ...createQuestpieQueryOptions(client, { keyPrefix: [
27
+ "qcms",
28
+ "locale",
29
+ locale ?? "default"
30
+ ] }).collections[collection].findOne({
31
+ where: { id },
32
+ ...options
33
+ }),
34
+ ...queryOptions
35
+ });
36
+ }
37
+ /**
38
+ * Hook to create collection item
39
+ */
40
+ function useCollectionCreate(collection, mutationOptions) {
41
+ const { client, locale } = useAdminContext();
42
+ const queryClient = useQueryClient();
43
+ const keyPrefix = [
44
+ "qcms",
45
+ "locale",
46
+ locale ?? "default"
47
+ ];
48
+ return useMutation({
49
+ ...createQuestpieQueryOptions(client, { keyPrefix }).collections[collection].create(),
50
+ onSuccess: (data, variables, context) => {
51
+ queryClient.invalidateQueries({ queryKey: [
52
+ ...keyPrefix,
53
+ "collections",
54
+ collection,
55
+ "find"
56
+ ] });
57
+ (mutationOptions?.onSuccess)?.(data, variables, context);
58
+ },
59
+ ...mutationOptions
60
+ });
61
+ }
62
+ /**
63
+ * Hook to update collection item
64
+ */
65
+ function useCollectionUpdate(collection, mutationOptions) {
66
+ const { client, locale } = useAdminContext();
67
+ const queryClient = useQueryClient();
68
+ const keyPrefix = [
69
+ "qcms",
70
+ "locale",
71
+ locale ?? "default"
72
+ ];
73
+ return useMutation({
74
+ ...createQuestpieQueryOptions(client, { keyPrefix }).collections[collection].update(),
75
+ onSuccess: (data, variables, context) => {
76
+ queryClient.invalidateQueries({ queryKey: [
77
+ ...keyPrefix,
78
+ "collections",
79
+ collection
80
+ ] });
81
+ (mutationOptions?.onSuccess)?.(data, variables, context);
82
+ },
83
+ ...mutationOptions
84
+ });
85
+ }
86
+ /**
87
+ * Hook to delete collection item
88
+ */
89
+ function useCollectionDelete(collection, mutationOptions) {
90
+ const { client, locale } = useAdminContext();
91
+ const queryClient = useQueryClient();
92
+ const keyPrefix = [
93
+ "qcms",
94
+ "locale",
95
+ locale ?? "default"
96
+ ];
97
+ return useMutation({
98
+ ...createQuestpieQueryOptions(client, { keyPrefix }).collections[collection].delete(),
99
+ onSuccess: (data, variables, context) => {
100
+ queryClient.invalidateQueries({ queryKey: [
101
+ ...keyPrefix,
102
+ "collections",
103
+ collection
104
+ ] });
105
+ (mutationOptions?.onSuccess)?.(data, variables, context);
106
+ },
107
+ ...mutationOptions
108
+ });
109
+ }
110
+
111
+ //#endregion
112
+ export { useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionUpdate };
@@ -0,0 +1,46 @@
1
+ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
2
+ import { useAdminContext } from "./admin-provider";
3
+ import { createQuestpieQueryOptions } from "@questpie/tanstack-query";
4
+
5
+ //#region src/hooks/use-global.ts
6
+ /**
7
+ * Hook to fetch global settings
8
+ */
9
+ function useGlobal(globalName, options, queryOptions) {
10
+ const { client, locale } = useAdminContext();
11
+ return useQuery({
12
+ ...createQuestpieQueryOptions(client, { keyPrefix: [
13
+ "qcms",
14
+ "locale",
15
+ locale ?? "default"
16
+ ] }).globals[globalName].get(options),
17
+ ...queryOptions
18
+ });
19
+ }
20
+ /**
21
+ * Hook to update global settings
22
+ */
23
+ function useGlobalUpdate(globalName, mutationOptions) {
24
+ const { client, locale } = useAdminContext();
25
+ const queryClient = useQueryClient();
26
+ const keyPrefix = [
27
+ "qcms",
28
+ "locale",
29
+ locale ?? "default"
30
+ ];
31
+ return useMutation({
32
+ ...createQuestpieQueryOptions(client, { keyPrefix }).globals[globalName].update(),
33
+ onSuccess: (...args) => {
34
+ queryClient.invalidateQueries({ queryKey: [
35
+ ...keyPrefix,
36
+ "globals",
37
+ globalName
38
+ ] });
39
+ mutationOptions?.onSuccess?.(...args);
40
+ },
41
+ ...mutationOptions
42
+ });
43
+ }
44
+
45
+ //#endregion
46
+ export { useGlobal, useGlobalUpdate };
@@ -0,0 +1,20 @@
1
+ import * as React$1 from "react";
2
+
3
+ //#region src/hooks/use-mobile.ts
4
+ const MOBILE_BREAKPOINT = 768;
5
+ function useIsMobile() {
6
+ const [isMobile, setIsMobile] = React$1.useState(void 0);
7
+ React$1.useEffect(() => {
8
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
9
+ const onChange = () => {
10
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
11
+ };
12
+ mql.addEventListener("change", onChange);
13
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
14
+ return () => mql.removeEventListener("change", onChange);
15
+ }, []);
16
+ return !!isMobile;
17
+ }
18
+
19
+ //#endregion
20
+ export { useIsMobile };
@@ -0,0 +1,10 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ //#region src/lib/utils.ts
5
+ function cn(...inputs) {
6
+ return twMerge(clsx(inputs));
7
+ }
8
+
9
+ //#endregion
10
+ export { cn };
@@ -0,0 +1,336 @@
1
+
2
+ @custom-variant dark (&:is(.dark *));
3
+
4
+ /* =============================================================================
5
+ QUESTPIE Design System - Cyber-Minimalist Theme
6
+
7
+ Core principles:
8
+ - Zero radius (sharp corners)
9
+ - Neon purple accents with glow effects
10
+ - Pitch-black foundation
11
+ - Backdrop blur for depth
12
+ ============================================================================= */
13
+
14
+ :root {
15
+ /* Core Colors (Light mode - for completeness, but dark is primary) */
16
+ --background: oklch(1 0 0);
17
+ --foreground: oklch(0.145 0 0);
18
+ --card: oklch(0.98 0 0);
19
+ --card-foreground: oklch(0.145 0 0);
20
+ --popover: oklch(1 0 0);
21
+ --popover-foreground: oklch(0.145 0 0);
22
+ --primary: oklch(0.55 0.3 300);
23
+ --primary-foreground: oklch(1 0 0);
24
+ --secondary: oklch(0.96 0 0);
25
+ --secondary-foreground: oklch(0.55 0.3 300);
26
+ --muted: oklch(0.96 0 0);
27
+ --muted-foreground: oklch(0.5 0 0);
28
+ --accent: oklch(0.96 0 0);
29
+ --accent-foreground: oklch(0.2 0 0);
30
+ --destructive: oklch(0.58 0.22 27);
31
+ --border: oklch(0.9 0 0);
32
+ --input: oklch(0.9 0 0);
33
+ --ring: oklch(0.55 0.3 300 / 50%);
34
+
35
+ /* Chart Colors */
36
+ --chart-1: oklch(0.7 0.25 300);
37
+ --chart-2: oklch(0.65 0.28 310);
38
+ --chart-3: oklch(0.6 0.3 300);
39
+ --chart-4: oklch(0.55 0.3 300);
40
+ --chart-5: oklch(0.5 0.28 300);
41
+
42
+ /* QUESTPIE: Zero Radius */
43
+ --radius: 0px;
44
+
45
+ /* Sidebar */
46
+ --sidebar: oklch(0.98 0 0);
47
+ --sidebar-foreground: oklch(0.145 0 0);
48
+ --sidebar-primary: oklch(0.55 0.3 300);
49
+ --sidebar-primary-foreground: oklch(1 0 0);
50
+ --sidebar-accent: oklch(0.96 0 0);
51
+ --sidebar-accent-foreground: oklch(0.2 0 0);
52
+ --sidebar-border: oklch(0.9 0 0);
53
+ --sidebar-ring: oklch(0.55 0.3 300 / 50%);
54
+ }
55
+
56
+ /* Dark Mode - QUESTPIE Primary Theme */
57
+ .dark {
58
+ /* Depth Black Foundation */
59
+ --background: oklch(0.14 0 0);
60
+ --foreground: oklch(0.92 0.01 255);
61
+
62
+ /* Surface Black */
63
+ --card: oklch(0.18 0 0);
64
+ --card-foreground: oklch(0.92 0.01 255);
65
+
66
+ /* Popover */
67
+ --popover: oklch(0.18 0 0);
68
+ --popover-foreground: oklch(0.92 0.01 255);
69
+
70
+ /* Neon Purple Accent */
71
+ --primary: oklch(0.55 0.3 300);
72
+ --primary-foreground: oklch(1 0 0);
73
+
74
+ /* Neutral Surface */
75
+ --secondary: oklch(0.22 0 0);
76
+ --secondary-foreground: oklch(0.55 0.3 300);
77
+
78
+ /* Muted */
79
+ --muted: oklch(0.25 0 0);
80
+ --muted-foreground: oklch(0.7 0 0);
81
+
82
+ /* Accent */
83
+ --accent: oklch(0.25 0 0);
84
+ --accent-foreground: oklch(0.92 0.01 255);
85
+
86
+ /* Destructive */
87
+ --destructive: oklch(0.65 0.22 27);
88
+
89
+ /* Technical Border */
90
+ --border: oklch(0.32 0 0);
91
+ --input: oklch(0.28 0 0);
92
+
93
+ /* Glow Focus Ring */
94
+ --ring: oklch(0.55 0.3 300 / 50%);
95
+
96
+ /* Chart Colors */
97
+ --chart-1: oklch(0.7 0.25 300);
98
+ --chart-2: oklch(0.65 0.28 310);
99
+ --chart-3: oklch(0.6 0.3 300);
100
+ --chart-4: oklch(0.55 0.3 300);
101
+ --chart-5: oklch(0.5 0.28 300);
102
+
103
+ /* Sidebar */
104
+ --sidebar: oklch(0.16 0 0);
105
+ --sidebar-foreground: oklch(0.92 0.01 255);
106
+ --sidebar-primary: oklch(0.55 0.3 300);
107
+ --sidebar-primary-foreground: oklch(1 0 0);
108
+ --sidebar-accent: oklch(0.22 0 0);
109
+ --sidebar-accent-foreground: oklch(0.92 0.01 255);
110
+ --sidebar-border: oklch(0.32 0 0);
111
+ --sidebar-ring: oklch(0.55 0.3 300 / 50%);
112
+ }
113
+
114
+ @theme inline {
115
+ /* Typography */
116
+ --font-sans: "DM Sans Variable", ui-sans-serif, system-ui, sans-serif;
117
+ --font-mono: "JetBrains Mono Variable", ui-monospace, monospace;
118
+
119
+ /* Color Variables */
120
+ --color-sidebar-ring: var(--sidebar-ring);
121
+ --color-sidebar-border: var(--sidebar-border);
122
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
123
+ --color-sidebar-accent: var(--sidebar-accent);
124
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
125
+ --color-sidebar-primary: var(--sidebar-primary);
126
+ --color-sidebar-foreground: var(--sidebar-foreground);
127
+ --color-sidebar: var(--sidebar);
128
+ --color-chart-5: var(--chart-5);
129
+ --color-chart-4: var(--chart-4);
130
+ --color-chart-3: var(--chart-3);
131
+ --color-chart-2: var(--chart-2);
132
+ --color-chart-1: var(--chart-1);
133
+ --color-ring: var(--ring);
134
+ --color-input: var(--input);
135
+ --color-border: var(--border);
136
+ --color-destructive: var(--destructive);
137
+ --color-accent-foreground: var(--accent-foreground);
138
+ --color-accent: var(--accent);
139
+ --color-muted-foreground: var(--muted-foreground);
140
+ --color-muted: var(--muted);
141
+ --color-secondary-foreground: var(--secondary-foreground);
142
+ --color-secondary: var(--secondary);
143
+ --color-primary-foreground: var(--primary-foreground);
144
+ --color-primary: var(--primary);
145
+ --color-popover-foreground: var(--popover-foreground);
146
+ --color-popover: var(--popover);
147
+ --color-card-foreground: var(--card-foreground);
148
+ --color-card: var(--card);
149
+ --color-foreground: var(--foreground);
150
+ --color-background: var(--background);
151
+
152
+ /* QUESTPIE: Zero Radius */
153
+ --radius-sm: 0px;
154
+ --radius-md: 0px;
155
+ --radius-lg: 0px;
156
+ --radius-xl: 0px;
157
+ --radius-2xl: 0px;
158
+ --radius-3xl: 0px;
159
+ --radius-4xl: 0px;
160
+ }
161
+
162
+ @layer base {
163
+ * {
164
+ @apply border-border outline-ring/50;
165
+ }
166
+ body {
167
+ @apply bg-background font-sans text-foreground;
168
+ }
169
+ html {
170
+ @apply font-sans;
171
+ }
172
+ }
173
+
174
+ /* =============================================================================
175
+ QUESTPIE Atmospheric Utilities
176
+ ============================================================================= */
177
+
178
+ @utility bg-grid-quest {
179
+ background-image:
180
+ linear-gradient(to right, oklch(0.55 0.3 300 / 5%) 1px, transparent 1px),
181
+ linear-gradient(to bottom, oklch(0.55 0.3 300 / 5%) 1px, transparent 1px);
182
+ background-size: 24px 24px;
183
+ }
184
+
185
+ @utility glow-primary {
186
+ box-shadow: 0 0 20px oklch(0.55 0.3 300 / 30%);
187
+ }
188
+
189
+ @utility glow-primary-sm {
190
+ box-shadow: 0 0 8px oklch(0.55 0.3 300 / 25%);
191
+ }
192
+
193
+ @utility glow-destructive {
194
+ box-shadow: 0 0 20px oklch(0.65 0.22 27 / 30%);
195
+ }
196
+
197
+ @utility ambient-beam {
198
+ background: radial-gradient(
199
+ circle,
200
+ oklch(0.55 0.3 300 / 15%) 0%,
201
+ transparent 70%
202
+ );
203
+ filter: blur(100px);
204
+ }
205
+
206
+ /* =============================================================================
207
+ Rich Text Editor Styles
208
+ ============================================================================= */
209
+
210
+ .qp-rich-text-editor__content {
211
+ min-height: 200px;
212
+ padding: 0.75rem;
213
+ outline: none;
214
+ }
215
+
216
+ .qp-rich-text-editor__content > *:first-child {
217
+ margin-top: 0;
218
+ }
219
+
220
+ .qp-rich-text-editor__content > *:last-child {
221
+ margin-bottom: 0;
222
+ }
223
+
224
+ .qp-rich-text-editor__content p {
225
+ margin: 0 0 0.75rem;
226
+ }
227
+
228
+ .qp-rich-text-editor__content h1 {
229
+ font-size: 1.5rem;
230
+ font-weight: 600;
231
+ margin: 1rem 0 0.75rem;
232
+ }
233
+
234
+ .qp-rich-text-editor__content h2 {
235
+ font-size: 1.25rem;
236
+ font-weight: 600;
237
+ margin: 1rem 0 0.75rem;
238
+ }
239
+
240
+ .qp-rich-text-editor__content h3 {
241
+ font-size: 1.125rem;
242
+ font-weight: 600;
243
+ margin: 1rem 0 0.75rem;
244
+ }
245
+
246
+ .qp-rich-text-editor__content ul,
247
+ .qp-rich-text-editor__content ol {
248
+ padding-left: 1.5rem;
249
+ margin: 0.75rem 0;
250
+ }
251
+
252
+ .qp-rich-text-editor__content blockquote {
253
+ border-left: 2px solid var(--border);
254
+ padding-left: 0.75rem;
255
+ color: var(--muted-foreground);
256
+ margin: 0.75rem 0;
257
+ }
258
+
259
+ .qp-rich-text-editor__content code {
260
+ background: var(--muted);
261
+ padding: 0.1rem 0.25rem;
262
+ font-size: 0.875em;
263
+ font-family: var(--font-mono);
264
+ }
265
+
266
+ .qp-rich-text-editor__content pre {
267
+ background: var(--muted);
268
+ padding: 0.75rem;
269
+ overflow-x: auto;
270
+ font-family: var(--font-mono);
271
+ }
272
+
273
+ .qp-rich-text-editor__content hr {
274
+ border: none;
275
+ border-top: 1px solid var(--border);
276
+ margin: 1rem 0;
277
+ }
278
+
279
+ .qp-rich-text-editor__content table {
280
+ border-collapse: collapse;
281
+ margin: 1rem 0;
282
+ width: 100%;
283
+ }
284
+
285
+ .qp-rich-text-editor__content th,
286
+ .qp-rich-text-editor__content td {
287
+ border: 1px solid var(--border);
288
+ padding: 0.5rem;
289
+ text-align: left;
290
+ }
291
+
292
+ .tippy-box[data-theme~="qp-rich-text-editor"] {
293
+ background: var(--popover);
294
+ color: var(--popover-foreground);
295
+ border: 1px solid var(--border);
296
+ box-shadow: 0 0 20px oklch(0 0 0 / 40%);
297
+ }
298
+
299
+ .qp-rich-text-editor__slash {
300
+ display: flex;
301
+ flex-direction: column;
302
+ gap: 0.25rem;
303
+ padding: 0.5rem;
304
+ min-width: 220px;
305
+ }
306
+
307
+ .qp-rich-text-editor__slash-item {
308
+ display: flex;
309
+ flex-direction: column;
310
+ align-items: flex-start;
311
+ gap: 0.125rem;
312
+ padding: 0.5rem;
313
+ font-size: 0.75rem;
314
+ line-height: 1.2;
315
+ color: var(--foreground);
316
+ }
317
+
318
+ .qp-rich-text-editor__slash-item--active,
319
+ .qp-rich-text-editor__slash-item:hover {
320
+ background: var(--muted);
321
+ }
322
+
323
+ .qp-rich-text-editor__slash-title {
324
+ font-weight: 600;
325
+ }
326
+
327
+ .qp-rich-text-editor__slash-description {
328
+ color: var(--muted-foreground);
329
+ }
330
+
331
+ .qp-rich-text-editor__slash-empty {
332
+ padding: 0.5rem;
333
+ font-size: 0.75rem;
334
+ color: var(--muted-foreground);
335
+ }
336
+
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,9 @@
1
+ import { cn } from "../lib/utils";
2
+
3
+ //#region src/utils/index.ts
4
+ /**
5
+ * Utility functions for admin package
6
+ */
7
+
8
+ //#endregion
9
+ export { cn };
@@ -0,0 +1,52 @@
1
+ import "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../components/ui/card";
4
+ import { cn } from "../../lib/utils";
5
+
6
+ //#region src/views/auth/auth-layout.tsx
7
+ /**
8
+ * Centered layout for authentication pages (login, register, forgot password, etc.)
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * <AuthLayout
13
+ * title="Sign in"
14
+ * description="Enter your credentials to access the admin panel"
15
+ * logo={<Logo />}
16
+ * footer={<Link to="/forgot-password">Forgot password?</Link>}
17
+ * >
18
+ * <LoginForm />
19
+ * </AuthLayout>
20
+ * ```
21
+ */
22
+ function AuthLayout({ title, description, logo, footer, children, className }) {
23
+ return /* @__PURE__ */ jsx("div", {
24
+ className: "bg-background flex min-h-screen flex-col items-center justify-center p-4",
25
+ children: /* @__PURE__ */ jsxs("div", {
26
+ className: "w-full max-w-sm space-y-6",
27
+ children: [
28
+ logo && /* @__PURE__ */ jsx("div", {
29
+ className: "flex justify-center",
30
+ children: logo
31
+ }),
32
+ /* @__PURE__ */ jsxs(Card, {
33
+ className: cn("w-full", className),
34
+ children: [/* @__PURE__ */ jsxs(CardHeader, {
35
+ className: "text-center",
36
+ children: [/* @__PURE__ */ jsx(CardTitle, {
37
+ className: "text-lg",
38
+ children: title
39
+ }), description && /* @__PURE__ */ jsx(CardDescription, { children: description })]
40
+ }), /* @__PURE__ */ jsx(CardContent, { children })]
41
+ }),
42
+ footer && /* @__PURE__ */ jsx("div", {
43
+ className: "text-muted-foreground text-center text-xs",
44
+ children: footer
45
+ })
46
+ ]
47
+ })
48
+ });
49
+ }
50
+
51
+ //#endregion
52
+ export { AuthLayout };